:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --radius: 8px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --font-family: 'Noto Sans KR', sans-serif;
    --nav-height: 56px;
    --header-height: 60px;
    --primary-color-rgb: 37, 99, 235;
}

[data-theme="dark"] {
    --primary-color: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-color-rgb: 59, 130, 246;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    overflow-y: scroll;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Typography & Helpers */
p {
    margin: 0;
}

.mt5 {
    margin-top: 5px;
}

.mt10 {
    margin-top: 10px;
}

.mt20 {
    margin-top: 20px;
}

.mt30 {
    margin-top: 30px;
}

.mbt5 {
    margin-bottom: 5px;
}

.mbt10 {
    margin-bottom: 10px;
}

/* Header */
.site-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.header-right-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.theme-toggle-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.theme-toggle-btn:hover {
    border-color: var(--primary-color);
}



.user-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    margin-left: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
}

.user-links a:hover {
    color: var(--primary-color);
}

.user-links span {
    font-size: 14px;
    color: var(--text-main);
}

/* Navigation */
.site-nav {
    background-color: transparent;
    border-bottom: none;
    box-shadow: none;
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    /* Hide scrollbar for clean look */
}

.nav-inner::-webkit-scrollbar {
    display: none;
}

.site-nav {
    display: flex;
    gap: 10px;
    padding: 0 20px;
    overflow-x: auto;
    position: relative;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    /* hide scrollbar */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

@media (max-width: 768px) {
    .site-nav {
        justify-content: flex-start;
    }
}

.site-nav::-webkit-scrollbar {
    display: none;
}

.nav-btn {
    display: inline-block;
    text-decoration: none;
    font-family: inherit;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    padding: 15px 5px;
    white-space: nowrap;
    position: relative;
    transition: color 0.3s;
}

.site-nav>.nav-btn:first-of-type {
    padding-left: 0;
}

.nav-btn.selected,
.nav-btn:hover {
    color: var(--primary-color);
}

.nav-slider {
    position: absolute;
    bottom: 0;
    height: 3px;
    background-color: var(--primary-color);
    transition: left 0.3s ease, width 0.3s ease;
    border-radius: 3px 3px 0 0;
}

/* Mobile Dock and Modals */
.mobile-dock {
    display: none;
}

.sheet-overlay {
    align-items: flex-end;
}

.bottom-sheet {
    background: var(--card-bg);
    width: 100%;
    max-width: 640px;
    box-sizing: border-box;
    border-radius: 18px 18px 0 0;
    padding: 8px 20px 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: calc(var(--dock-height) + env(safe-area-inset-bottom, 0px));
    animation: slideUp 0.25s ease forwards;
    touch-action: pan-y;
}

.sheet-handle {
    width: 40px;
    height: 5px;
    border-radius: 3px;
    background: var(--border-color);
    margin: 4px auto 12px;
}

.sheet-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.sheet-grid .sheet-item {
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    min-height: 84px;
    padding: 14px 8px;
    text-align: center;
}

.sheet-grid .sheet-item i {
    font-size: 22px;
    color: var(--primary-color);
}

.sheet-item.selected {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.sheet-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 14px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.sheet-footer-links .nav-btn {
    padding: 6px 2px;
    font-size: 12px;
}

.bottom-sheet.closing {
    animation: slideDown 0.3s ease forwards;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(100%);
    }
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.sheet-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text-main);
}

.close-sheet {
    width: 40px;
    height: 40px;
    margin-right: -8px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
}

.sheet-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sheet-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    box-sizing: border-box;
    text-decoration: none;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-color);
    color: var(--text-main);
    font-size: 15px;
    cursor: pointer;
    font-family: inherit;
}

.sheet-item:hover {
    background: #e2e8f0;
}

[data-theme="dark"] .sheet-item:hover {
    background: #334155;
}

/* Main Area */
.site-main {
    flex: 1;
    max-width: 1200px;
    margin: 10px auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}



/* AdSense Placeholders */
.adsense-placeholder {
    width: 100%;
    height: 60px;
    background-color: #e2e8f0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius);
    margin-bottom: 10px;
    font-size: 12px;
}

[data-theme="dark"] .adsense-placeholder {
    background-color: #334155;
    border-color: #475569;
    color: #cbd5e1;
}

/* Content Area */
.content-area {
    background-color: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: 10px 15px;
    margin: 10px 0 10px 0;

}

/* Footer */
.site-footer {
    text-align: center;
    padding: 24px 20px 30px;
    color: var(--text-muted);
    font-size: 13px;
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 18px;
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    padding: 4px 0;
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* Form Elements */
input[type="text"],
input[type="number"],
input[type="password"],
select {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    color: var(--text-main);
    background-color: var(--card-bg);
    outline: none;
    transition: border-color 0.2s;
}

input:focus,
select:focus {
    border-color: var(--primary-color);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

/* Common Button Styles added for script.js */
.back-to-list-btn,
.action-btn {
    background: #e2e8f0;
    color: #1e293b;
    border: none;
    padding: 8px 15px;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.back-to-list-btn:hover,
.action-btn:hover {
    background: #cbd5e1;
}

.btn-main-cta {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
    border-radius: var(--radius);
    text-decoration: none;
    transition: background 0.2s;
}

.btn-main-cta:hover {
    background-color: var(--primary-hover);
    color: white;
}

[data-theme="dark"] .back-to-list-btn,
[data-theme="dark"] .action-btn {
    background: #334155;
    color: #f8fafc;
}

[data-theme="dark"] .back-to-list-btn:hover,
[data-theme="dark"] .action-btn:hover {
    background: #475569;
}

/* Overrides for specific script.js classes */
.loading-overlay-inner {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.loading-overlay-inner.is-active {
    display: flex;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.popup-content,
.modal-content {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-md);
}

.popup-header,
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.popup-close-btn,
.modal-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.popup-close-btn:hover,
.modal-close-btn:hover {
    color: var(--text-main);
}

.popup-body,
.modal-body {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-main);
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 5px;
}

.popup-footer,
.modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    gap: 10px;
}

/* Tooltip */
.custom-tooltip {
    background-color: #334155;
    color: white;
    padding: 10px 15px;
    border-radius: var(--radius);
    font-size: 13px;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: var(--shadow-md);
    line-height: 1.5;

    .level-percentage {
        color: #cbd5e1;
    }
}

.custom-tooltip.visible {
    opacity: 1;
}

.custom-tooltip .no-info {
    /* font-size: 0.9rem; */
    color: #95ff8f;
    line-height: 1.4;
}

.custom-tooltip .ability-stat-container {
    color: #bbbbbb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .site-main {
        padding: 0 10px;
    }

    .desc-pc {
        display: none !important;
    }

    .dashboard-card {
        padding: 15px;
    }

    .dashboard-card h2,
    .dashboard-card h3 {
        margin: 0;
        font-size: 16px;
    }

    .dashboard-card .card-icon {
        font-size: 24px;
        margin-bottom: 10px;
    }

    /* Calculator mobile adjustments */
    .input-row.flex-align {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .input-row.flex-align .form-select,
    .input-row.flex-align .form-input,
    .input-row.flex-align .unit {
        width: 100% !important;
        text-align: center;
    }

    .input-row.flex-align .unit {
        display: none;
    }

    .exp-inputs-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
    }

    .exp-input-group {
        padding: 4px 6px;
        font-size: 11px;
        height: auto;
    }

    .exp-input {
        width: 100%;
        font-size: 11px;
    }

    .grade-filter-container {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
        margin-bottom: 15px;
        justify-content: flex-start;
    }

    .grade-filter-container::-webkit-scrollbar {
        display: none;
    }

    .grade-filter-container .filter-btn {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 6px 12px;
        font-size: 13px;
        margin-right: 5px;
    }

    .search-input::placeholder {
        font-size: 12px;
    }

    .search-bar-wrapper input::placeholder {
        font-size: 12px;
    }

    /* Map card mobile */
    .map-list-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
        gap: 8px;
    }

    .map-list-content {
        width: 100%;
    }

    .map-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        font-size: 12px;
        color: #888;
        margin-top: 5px;
    }

    .map-meta span {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    #map-write-btn-container {
        width: 100%;
        margin-top: 10px;
    }

    #map-write-btn-container button {
        width: 100%;
    }
}

/* Page Header */
.page-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.page-header h1,
.page-header h2 {
    margin: 0 0 2px 0;
    font-size: 18px;
    color: var(--text-main);
}

.text-muted {
    color: var(--text-muted);
    font-size: 12px;
    margin: 0;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.dashboard-card {
    display: block;
    color: inherit;
    text-decoration: none;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.card-icon {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.dashboard-card h2,
.dashboard-card h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: var(--text-main);
}

.dashboard-card p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

/* Community Banner */
.community-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.community-banner .banner-content {
    flex: 1;
    min-width: 200px;
}


/* Page1 Calculator Styles */
.calc-flex-container {
    display: flex;
    flex-direction: column;
}


.result-bar-group {
    position: relative;
}

.calc-section {
    background-color: var(--bg-color);
    padding: 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.section-subtitle {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: bold;
    color: var(--text-main);
}

.flex-align {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.form-select,
.form-input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 13px;
    box-sizing: border-box;
    height: 36px;
}

.exp-inputs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
}

.exp-input-group {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    box-sizing: border-box;
    height: 36px;
    overflow: hidden;
    width: 100%;
}

.exp-input {
    flex: 1;
    width: 100%;
    min-width: 0;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 14px;
    text-align: right;
    padding: 0 5px;
    outline: none;
    box-sizing: border-box;
}

.exp-input-group img {
    width: 20px;
    height: 20px;
    margin-right: 5px;
    flex-shrink: 0;
}

.total-exp-box {
    background-color: #e0f2fe;
    border: 1px solid #bae6fd;
    padding: 10px;
    border-radius: var(--radius);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #0369a1;
}

#remaining-exp-trigger {
    color: var(--primary-color);
    cursor: pointer;
    font-size: 13px;
    margin-left: auto;
    text-decoration: underline;
}

/* Progress Bar Overrides */
.result-bar {
    position: relative;
    overflow: hidden;
    background-color: #e2e8f0;
    border-radius: var(--radius);
    min-height: 28px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.progress-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: var(--primary-color);
    z-index: 1;
    transition: width 0.3s ease;
}

.result-bar-content {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8), -1px -1px 2px rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 600;
    gap: 8px;
}

[data-theme="dark"] .result-bar {
    background-color: #0f172a;
}

[data-theme="dark"] .result-bar-content {
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8), -1px -1px 2px rgba(0, 0, 0, 0.8);
}

.result-bar-content img {
    width: 16px;
    height: 16px;
}

/* Page2 Title Search Styles */
.title-search-wrapper {
    background: var(--bg-color);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.sub-nav-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.sub-nav-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius);
    transition: background-color 0.2s, color 0.2s;
}

.sub-nav-btn:hover {
    /* background: #e2e8f0; */
    background: #cbd5e1;
    color: var(--text-main);
}

.sub-nav-btn.active {
    background: var(--primary-color);
    color: white;
}

.grade-filter-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.filter-btn {
    padding: 6px 15px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.search-bar-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    box-sizing: border-box;
}

.btn-secondary {
    padding: 10px 20px;
    background: #e2e8f0;
    border: none;
    border-radius: var(--radius);
    color: var(--text-main);
    cursor: pointer;
    transition: background 0.2s;
    box-sizing: border-box;
}

.btn-secondary:hover {
    background: #cbd5e1;
}

[data-theme="dark"] .btn-secondary {
    background: #334155;
    color: #cbd5e1;
}

[data-theme="dark"] .btn-secondary:hover {
    background: #475569;
}

.title-list-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.title-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.title-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-color);
}

.title-item .img-wrapper {
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 5px;
}

.title-item img {
    max-width: 24px;
    max-height: 24px;
    width: 24px;
    height: 24px;
    object-fit: contain;
    object-position: center;
}

.title-name {
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 3px;
    color: var(--text-main);
}

.title-grade {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    background: #e2e8f0;
    color: var(--text-muted);
}

.ability-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 15px;
}

.ability-item {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ability-header {
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    flex-grow: 1;
    transition: background 0.3s ease;
    background: var(--card-bg);
}

.ability-header:hover {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .ability-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.ability-info .name {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 3px;
    font-size: 13px;
}

.ability-info .desc {
    font-size: 12px;
    color: var(--text-main);
}

.toggle-icon {
    transition: transform 0.3s;
    font-size: 12px;
    color: var(--text-muted);
}

.ability-titles-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease-out;
    background: var(--bg-color);
    border-top: 0px solid transparent;
}

.ability-item.open .ability-titles-wrapper {
    grid-template-rows: 1fr;
    flex-grow: 1;
    border-top: 1px solid var(--border-color);
}

.ability-titles {
    overflow: hidden;
    padding: 0 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ability-item.open .ability-header {
    flex-grow: 0;
}

.ability-item.open .ability-titles {
    padding: 15px;
}

.ability-item.open .toggle-icon {
    transform: rotate(180deg);
}

.title-list-in-ability {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
    color: var(--text-main);
}

.title-list-in-ability li {
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.title-list-in-ability .title-icon {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.pagination-controls span {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s;
}

.pagination-controls span:hover:not(.disabled):not(.active) {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination-controls span.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-color);
}

.pagination-controls span.active {
    color: white;
    background: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: bold;
}


/* News and MapCraft List Styles */
.list-page-container {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.news-header h3 {
    margin: 0 0 10px 0;
    color: var(--text-main);
    font-size: 18px;
}

.news-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

.contact-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
}

.contact-btn:hover {
    background: var(--primary-hover);
}

.search-bar-wrapper {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 20px;
}

.search-bar-wrapper input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    box-sizing: border-box;
}

.search-bar-wrapper button {
    padding: 10px 20px;
    background: #e2e8f0;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    box-sizing: border-box;
}

[data-theme="dark"] .search-bar-wrapper button {
    background: #334155;
    color: #cbd5e1;
}

[data-theme="dark"] .search-bar-wrapper button:hover {
    background: #475569;
}

/* List Cards injected by JS */
.notice-list-wrapper,
.map-list-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.map-list-card {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

.map-list-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-color);
}

.map-meta {
    display: flex;
    gap: 15px;
    color: var(--text-muted);
    font-size: 13px;
}

.notice-list-card,
.map-list-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}

.notice-list-card:hover,
.map-list-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-color);
}

.notice-list-card .title,
.map-list-card .title {
    font-weight: 500;
    font-size: 16px;
    color: var(--text-main);
    flex: 1;
}

.notice-list-card .date,
.map-list-card .date {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    margin-left: 15px;
}

/* Detail Views */
.notice-detail-view,
.map-detail-view {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.notice-detail-header,
.map-detail-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.notice-detail-header h4,
.map-detail-header h4 {
    font-size: 24px;
    margin: 0 0 10px 0;
    color: var(--text-main);
}

.notice-detail-meta,
.map-detail-meta {
    font-size: 13px;
    color: var(--text-muted);
}

.notice-detail-content,
.map-detail-content {
    line-height: 1.8;
    font-size: 15px;
    color: var(--text-main);
    min-height: 200px;
}

.notice-detail-content img,
.map-detail-content img,
.notice-detail-content iframe,
.map-detail-content iframe,
.notice-detail-content embed,
.map-detail-content embed,
.notice-detail-content object,
.map-detail-content object,
.notice-detail-content video,
.map-detail-content video {
    max-width: 100%;
    height: auto;
}

.notice-detail-actions,
.map-detail-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.notice-detail-actions button,
.map-detail-actions button {
    padding: 8px 15px;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    border: none;
}

.notice-detail-actions .back-btn,
.map-detail-actions .back-btn {
    background: #e2e8f0;
    color: var(--text-main);
}

.notice-detail-actions .back-btn:hover {
    background: #cbd5e1;
}

.notice-detail-actions .delete-btn,
.map-detail-actions .delete-btn,
.map-delete,
.notice-delete {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.notice-detail-actions .delete-btn:hover,
.map-detail-actions .delete-btn:hover,
.map-delete:hover,
.notice-delete:hover {
    background: #dc2626;
}


/* General Form Styles */
.form-container {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-main);
    font-size: 14px;
}

.form-input {
    width: 100%;
    box-sizing: border-box;
}

.text-right {
    text-align: right;
}

/* Global Loader */
.global-loader-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    background: color-mix(in srgb, var(--bg-color) 75%, transparent);
    z-index: 998;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

/* Hide Number Input Spin Buttons */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Summernote Theme Support */
.note-editor.note-frame {
    border-color: var(--border-color) !important;
    border-radius: var(--radius);
    overflow: hidden;
}

.note-editor.note-frame .note-editing-area .note-editable {
    background-color: var(--card-bg) !important;
    color: var(--text-main) !important;
}

.note-editor.note-frame .note-statusbar {
    background-color: var(--bg-color) !important;
}

.note-editor .note-toolbar {
    background-color: var(--bg-color) !important;
    border-bottom-color: var(--border-color) !important;
}

.note-editor .note-btn {
    color: var(--text-main) !important;
    background-color: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

.note-editor .note-btn:hover {
    background-color: var(--border-color) !important;
}

.note-editor .note-modal {
    color: #000;
}

/* Keep modal text black as Summernote modals are hardcoded to bootstrap light */


.exp-input-group input[type="number"] {
    border: 0;
    padding: 0px 5px 0px 0px;
}

body.is-loading .site-header,
body.is-loading .site-nav-wrapper,
body.is-loading .mobile-dock {
    pointer-events: none;
}


@media (min-width: 769px) {
    .ability-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

.tooltip-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.2);
    margin: 10px 0;
}

.news-detail-content iframe {
    max-width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
}

/* Custom Checkbox Toggle */
.custom-checkbox-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-color);
    user-select: none;
}

.custom-checkbox-wrapper input[type="checkbox"] {
    appearance: none;
    width: 36px;
    height: 20px;
    background-color: var(--border-color);
    border-radius: 20px;
    position: relative;
    outline: none;
    cursor: pointer;
    transition: background-color 0.3s;
    margin: 0;
}

.custom-checkbox-wrapper input[type="checkbox"]::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.custom-checkbox-wrapper input[type="checkbox"]:checked {
    background-color: var(--primary-color);
}

.custom-checkbox-wrapper input[type="checkbox"]:checked::after {
    transform: translateX(16px);
}

.modal-button {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.modal-button.primary {
    background-color: var(--primary-color);
    color: white;
}

.modal-button.primary:hover {
    background-color: var(--primary-hover);
}

.modal-button.secondary {
    background-color: #64748b;
    color: white;
}

.modal-button.secondary:hover {
    background-color: #475569;
}

.news-detail-header {
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

@media (min-width: 769px) {
    .input-row.flex-align {
        justify-content: center;
    }
}

/* Prevent buttons and action links from wrapping text vertically on mobile */
button,
.btn,
.btn-primary,
.btn-secondary,
.action-btn,
.back-to-list-btn,
.contact-btn,
.modal-button,
.sheet-item {
    white-space: nowrap;
    word-break: keep-all;
}

.news-detail-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.news-detail-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

/* =========================================================
   Calculator v2 (경험치 계산기)
   ========================================================= */
.step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    font-size: 12px;
    margin-right: 6px;
    flex-shrink: 0;
}

#sectionResult {
    scroll-margin-top: calc(var(--header-height) + 60px);
}

.calc-section .section-subtitle {
    font-size: 15px;
    display: flex;
    align-items: center;
}

.calc-level-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.level-select-btn {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.level-select-btn:hover,
.level-select-btn:focus-visible {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.15);
    outline: none;
}

.level-select-btn span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.level-select-caret {
    color: var(--text-muted);
    font-size: 12px;
}

.percent-input-wrap {
    position: relative;
    width: 120px;
    flex-shrink: 0;
}

.percent-input-wrap .form-input {
    height: 100%;
    min-height: 44px;
    padding-right: 30px;
    text-align: right;
    font-size: 15px;
}

.percent-input-wrap .unit {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

.calc-subsection+.calc-subsection {
    margin-top: 18px;
    padding-top: 15px;
    border-top: 1px dashed var(--border-color);
}

.calc-subsection-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}

.calc-subsection-head h4 {
    margin: 0;
    font-size: 14px;
    color: var(--text-main);
}

.calc-help {
    line-height: 1.6;
    margin-bottom: 10px;
}

/* 러닝 포션 입력 */
.potion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 8px;
}

.potion-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.potion-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.potion-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.potion-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.potion-info>div {
    min-width: 0;
}

.potion-exp {
    font-size: 12px;
    color: var(--text-muted);
}

.stepper {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
}

.stepper-btn {
    width: 38px;
    height: 40px;
    border: none;
    background: var(--bg-color);
    color: var(--text-main);
    cursor: pointer;
    font-size: 12px;
    touch-action: manipulation;
}

.stepper-btn:active {
    background: var(--border-color);
}

input[type="number"].stepper-input {
    width: 64px;
    height: 40px;
    border: none;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-radius: 0;
    padding: 0 6px;
    text-align: center;
    font-size: 15px;
    background: var(--card-bg);
}

.added-exp-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-top: 15px;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: rgba(var(--primary-color-rgb), 0.08);
    border: 1px solid rgba(var(--primary-color-rgb), 0.25);
    font-size: 13px;
    color: var(--text-main);
}

.added-exp-summary .divider {
    color: var(--text-muted);
}

.added-exp-summary .added-total {
    margin-left: auto;
}

.added-exp-summary .added-total strong {
    color: var(--primary-color);
}

/* 결과 */
.calc-result-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.calc-result-head .section-subtitle {
    margin: 0;
}

.calc-reset-btn {
    font-size: 13px;
    padding: 6px 12px;
}

.exp-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.exp-summary-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    min-width: 0;
}

.exp-summary-item .label {
    font-size: 12px;
    color: var(--text-muted);
}

.exp-summary-item .value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.exp-summary-item.is-primary {
    border-color: var(--primary-color);
}

.exp-summary-item.is-primary .value {
    color: var(--primary-color);
}

.result-level-card {
    padding: 14px;
    background: var(--card-bg);
    border: 1px solid var(--primary-color);
    border-radius: var(--radius);
}

.result-level-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-color);
}

.result-level-name {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

.next-level-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-muted);
}

.next-level-info strong {
    color: var(--text-main);
}

.level-up-badge {
    padding: 2px 8px;
    border-radius: 999px;
    background: #16a34a;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.target-panel {
    margin-top: 15px;
    padding: 12px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.target-toggle {
    min-height: 32px;
    font-weight: 600;
    color: var(--text-main);
}

.target-inputs {
    margin-top: 12px;
}

.target-inputs[hidden] {
    display: none;
}

.target-result {
    margin-top: 12px;
}

.target-warning {
    font-size: 13px;
    color: #d97706;
}

.target-progress-head {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 6px;
}

.target-progress .result-bar {
    min-height: 12px;
}

.target-progress-meta {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.target-done {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: rgba(22, 163, 74, 0.1);
    color: #16a34a;
    font-weight: 700;
    font-size: 14px;
}

.target-done span {
    font-weight: 500;
    color: var(--text-main);
}

.target-remaining {
    display: flex;
    flex-direction: column;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: var(--bg-color);
    border: 1px solid var(--border-color);
}

.target-remaining .label {
    font-size: 12px;
    color: var(--text-muted);
}

.target-remaining strong {
    color: var(--primary-color);
    font-size: 15px;
}

.potion-plan {
    margin-top: 12px;
}

.potion-plan h4 {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--text-main);
}

.potion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.potion-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 600;
}

.potion-single-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.potion-single {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px;
    border-radius: var(--radius);
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    font-size: 12px;
}

.potion-single .name {
    color: var(--text-muted);
}

.potion-single strong {
    font-size: 14px;
}

/* 결과 요약 바 (모바일·태블릿에서만 표시) */
.calc-sticky-summary {
    display: none;
}

/* 레벨 선택 모달 (화면 중앙) */
.level-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.55);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.level-modal-overlay[hidden] {
    display: none;
}

.level-modal-overlay.is-open {
    opacity: 1;
}

.level-modal {
    width: 100%;
    max-width: 560px;
    max-height: min(80vh, 680px);
    max-height: min(80dvh, 680px);
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    transform: scale(0.96);
    transition: transform 0.2s ease;
    overflow: hidden;
}

.level-modal-overlay.is-open .level-modal {
    transform: scale(1);
}

.level-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--border-color);
}

.level-modal-header h3 {
    margin: 0;
    font-size: 17px;
    color: var(--text-main);
}

.level-modal-preview {
    margin-top: 2px;
    font-size: 13px;
    color: var(--primary-color);
    min-height: 1.4em;
}

.level-modal-close {
    width: 40px;
    height: 40px;
    margin: -6px -8px 0 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.level-modal-close:hover {
    background: var(--bg-color);
    color: var(--text-main);
}

.level-modal-body {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px 18px 18px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 18px;
}

.level-group-title {
    margin: 6px 0;
    font-size: 13px;
    color: var(--text-muted);
}

.level-group-items {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.level-item-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.level-item-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.08);
}

.level-item-btn.selected-level {
    border: 2px solid var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.15);
}

.level-item-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

body.modal-scroll-lock {
    overflow: hidden;
}

@media (max-width: 600px) {
    .level-modal-body {
        grid-template-columns: 1fr;
        padding: 10px 14px 16px;
    }

    .level-item-btn {
        width: 44px;
        height: 44px;
    }

    .exp-summary-grid {
        grid-template-columns: 1fr;
    }

    .potion-grid {
        grid-template-columns: 1fr;
    }

    .potion-single-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .added-exp-summary .added-total {
        margin-left: 0;
        width: 100%;
    }

    .percent-input-wrap {
        width: 104px;
    }
}


/* =========================================================
   Layout v2: 공통 요소 / 모바일·태블릿 하단 독
   ========================================================= */
:root {
    --dock-height: 64px;
}

/* 광고 영역: 광고가 늦게 떠도 레이아웃이 크게 밀리지 않도록 자리 확보 */
.ad-slot {
    min-height: 100px;
    margin: 6px 0;
}

.ad-slot ins.adsbygoogle[data-ad-status="unfilled"] {
    display: none !important;
}

/* 광고가 채워지지 않으면 확보해 둔 빈 공간도 없앰 */
.ad-slot:has(ins.adsbygoogle[data-ad-status="unfilled"]) {
    min-height: 0;
    margin: 0;
}

.global-loader-overlay .loading-spinner {
    width: 40px;
    height: 40px;
}

.global-loader-text {
    color: var(--text-main);
    margin-top: 15px;
    font-weight: bold;
    font-size: 14px;
}

/* 홈 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.section-header h2 {
    margin: 0;
    font-size: 17px;
    color: var(--text-main);
}

.section-header h2 i {
    color: var(--primary-color);
}

.section-more-btn {
    font-size: 12px;
    padding: 6px 12px;
    text-decoration: none;
}

.community-banner h2 {
    margin: 0 0 4px;
    font-size: 17px;
}

/* 상세 화면 제목 */
.news-detail-header h1 {
    font-size: 22px;
    line-height: 1.4;
    margin: 0 0 8px;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.news-detail-content img {
    max-width: 100%;
    height: auto;
}

.news-detail-content {
    overflow-wrap: anywhere;
}

/* 정책/소개 페이지 */
.legal-content {
    max-width: 820px;
    margin: 0 auto;
    padding: 10px 4px 20px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-main);
}

.legal-content h2 {
    font-size: 16px;
    margin: 26px 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

.legal-content ul {
    padding-left: 20px;
    margin: 6px 0;
}

.legal-content li {
    margin-bottom: 4px;
}

.legal-content a {
    color: var(--primary-color);
}

/* 터치 기기에서 hover 효과로 카드가 들뜨는 현상 방지 */
@media (hover: none) {

    .dashboard-card:hover,
    .title-item:hover,
    .notice-list-card:hover,
    .map-list-card:hover {
        transform: none;
        box-shadow: none;
    }

    .dashboard-card:active,
    .notice-list-card:active,
    .map-list-card:active {
        border-color: var(--primary-color);
    }
}

/* ---------- 태블릿 + 모바일 (≤1024px): 상단 메뉴 대신 하단 독 ---------- */
@media (max-width: 1024px) {
    :root {
        --header-height: 56px;
    }

    .site-nav {
        display: none !important;
    }

    .site-aside {
        display: none !important;
    }

    .pc-only {
        display: none !important;
    }

    .header-inner {
        padding: 0 16px;
    }

    .site-logo {
        font-size: 22px;
    }

    .theme-toggle-btn {
        width: 38px;
        height: 38px;
    }

    .site-main {
        margin: 8px auto 0;
        padding: 0 16px;
    }

    .site-footer {
        padding-bottom: calc(var(--dock-height) + env(safe-area-inset-bottom, 0px) + 20px);
    }

    .mobile-dock {
        display: flex;
        justify-content: space-around;
        align-items: stretch;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9000;
        height: calc(var(--dock-height) + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-sizing: border-box;
        background: var(--card-bg);
        background: color-mix(in srgb, var(--card-bg) 92%, transparent);
        -webkit-backdrop-filter: saturate(180%) blur(12px);
        backdrop-filter: saturate(180%) blur(12px);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
    }

    .dock-btn {
        position: relative;
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 0;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 11px;
        font-weight: 500;
        -webkit-tap-highlight-color: transparent;
        transition: color 0.2s;
    }

    .dock-btn i {
        font-size: 20px;
        line-height: 1;
        transition: transform 0.2s;
    }

    .dock-btn.active {
        color: var(--primary-color);
        font-weight: 700;
    }

    /* 현재 메뉴 표시용 상단 막대 */
    .dock-btn.active::before {
        content: "";
        position: absolute;
        top: 0;
        left: 50%;
        width: 28px;
        height: 3px;
        border-radius: 0 0 3px 3px;
        background: var(--primary-color);
        transform: translateX(-50%);
    }

    .dock-btn:active i {
        transform: scale(0.88);
    }

    .sheet-overlay {
        z-index: 8500;
    }

    /* 계산기: 화면 하단 결과 요약 바 */
    .calc-sticky-summary {
        display: flex;
        align-items: center;
        gap: 8px;
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(var(--dock-height) + env(safe-area-inset-bottom, 0px) + 10px);
        z-index: 8000;
        max-width: 600px;
        margin: 0 auto;
        padding: 10px 14px;
        border: 1px solid var(--primary-color);
        border-radius: 12px;
        background: var(--card-bg);
        color: var(--text-main);
        font-family: inherit;
        font-size: 13px;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
        cursor: pointer;
        transition: opacity 0.2s, transform 0.2s;
    }

    .calc-sticky-summary.is-hidden {
        opacity: 0;
        transform: translateY(12px);
        pointer-events: none;
    }

    .calc-sticky-summary .sticky-label {
        color: var(--text-muted);
        font-size: 12px;
    }

    .calc-sticky-summary .sticky-name {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        font-weight: 700;
        text-align: left;
    }

    .calc-sticky-summary .sticky-percent {
        font-weight: 700;
        color: var(--primary-color);
    }

    /* 요약 바에 가리지 않도록 계산기 하단 여백 */
    .calc-flex-container {
        padding-bottom: 70px;
    }
}

/* ---------- 모바일 (≤768px) ---------- */
@media (max-width: 768px) {
    .site-main {
        padding: 0 10px;
    }

    .content-area {
        padding: 12px;
    }

    .page-header h1 {
        font-size: 18px;
    }

    .news-detail-header h1 {
        font-size: 19px;
    }

    .ad-slot {
        min-height: 60px;
    }

    .search-bar-wrapper {
        flex-wrap: wrap;
    }

    .search-bar-wrapper input {
        flex: 1 1 100%;
        min-height: 44px;
        font-size: 16px;
        /* iOS 확대 방지 */
    }

    .search-bar-wrapper button {
        flex: 1;
        min-height: 40px;
    }

    .form-input,
    input[type="text"],
    input[type="password"],
    input[type="number"] {
        font-size: 16px;
        /* iOS 입력 시 화면 확대 방지 */
    }

    .exp-input {
        font-size: 14px;
    }

    .form-container {
        padding: 18px;
    }

    /* 홈 기능 카드: 3칸 타일 */
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .dashboard-card {
        padding: 14px 6px;
    }

    .dashboard-card .card-icon {
        font-size: 22px;
        margin-bottom: 6px;
    }

    .dashboard-card h2 {
        font-size: 13px;
        line-height: 1.35;
        word-break: keep-all;
    }

    .community-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .community-banner .contact-btn {
        display: block;
        padding: 12px;
    }
}


/* =========================================================
   PC v2: 한 줄 헤더 / 본문 + 사이드바 / 페이지별 PC 디자인
   ========================================================= */
:root {
    --content-max: 1320px;
    --aside-width: 300px;
}

/* 본문 + 사이드바 래퍼 (모든 화면 공통) */
.site-body {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 24px;
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    box-sizing: border-box;
}

.site-main {
    flex: 1 1 auto;
    min-width: 0;
}

.site-aside {
    display: none;
    width: var(--aside-width);
    flex-shrink: 0;
}

.ad-slot-bottom {
    margin-top: 16px;
}

/* 홈 상단 소개 영역 */
.home-hero {
    padding: 22px 24px;
    margin-bottom: 20px;
    border: 1px solid rgba(var(--primary-color-rgb), 0.25);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.16), rgba(var(--primary-color-rgb), 0.02) 70%);
}

.home-hero h1 {
    font-size: 22px;
    margin-bottom: 6px;
}

.home-hero p.text-muted {
    font-size: 14px;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .home-hero {
        padding: 16px;
        margin-bottom: 14px;
    }

    .home-hero h1 {
        font-size: 18px;
    }

    .home-hero p.text-muted {
        font-size: 13px;
    }
}

/* ---------- PC (1025px 이상) ---------- */
@media (min-width: 1025px) {

    /* 헤더: 로고 · 메뉴 · 사용자 메뉴를 한 줄로 */
    :root {
        --header-height: 64px;
    }

    .site-header {
        background: var(--card-bg);
        background: color-mix(in srgb, var(--card-bg) 90%, transparent);
        -webkit-backdrop-filter: saturate(180%) blur(12px);
        backdrop-filter: saturate(180%) blur(12px);
    }

    .header-inner {
        max-width: var(--content-max);
        padding: 0 20px;
        gap: 32px;
        box-sizing: border-box;
    }

    .site-nav {
        flex: 1;
        align-self: stretch;
        display: flex;
        align-items: stretch;
        justify-content: flex-start;
        gap: 2px;
        max-width: none;
        margin: 0;
        padding: 0;
    }

    .site-nav .nav-btn,
    .site-nav>.nav-btn:first-of-type {
        display: flex;
        align-items: center;
        padding: 0 14px;
        font-size: 15px;
        font-weight: 500;
    }

    .site-nav .nav-btn:hover {
        color: var(--text-main);
    }

    .site-nav .nav-btn.selected {
        color: var(--primary-color);
        font-weight: 700;
    }

    .user-links>div {
        gap: 6px !important;
    }

    .user-links a {
        margin-left: 0;
        padding: 7px 12px;
        border-radius: 8px;
        transition: background 0.2s, color 0.2s;
    }

    .user-links a:hover {
        background: rgba(var(--primary-color-rgb), 0.08);
    }

    .user-links #register-link {
        background: var(--primary-color);
        color: #fff;
    }

    .user-links #register-link:hover {
        background: var(--primary-hover);
    }

    /* 본문 */
    .site-body {
        padding: 24px 20px 0;
    }

    .site-main {
        max-width: none;
        margin: 0;
        padding: 0;
    }

    .content-area {
        margin: 0;
        padding: 26px 30px 30px;
        border-radius: 12px;
    }

    .page-header {
        margin-bottom: 20px;
        padding-bottom: 14px;
    }

    .page-header h1 {
        font-size: 24px;
        margin-bottom: 4px;
    }

    .page-header .text-muted {
        font-size: 14px;
        line-height: 1.6;
    }

    .home-hero {
        padding: 30px 32px;
    }

    .home-hero h1 {
        font-size: 28px;
    }

    .home-hero p.text-muted {
        font-size: 15px;
    }

    /* 홈 기능 카드 */
    .dashboard-grid {
        gap: 16px;
    }

    .dashboard-card {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        padding: 22px;
        border-radius: 12px;
    }

    .dashboard-card .card-icon {
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        font-size: 22px;
        margin-bottom: 14px;
        background: rgba(var(--primary-color-rgb), 0.12);
    }

    .dashboard-card h2 {
        font-size: 17px;
        margin-bottom: 6px;
    }

    .dashboard-card p {
        font-size: 13px;
        line-height: 1.6;
    }

    /* 목록/상세 */
    .list-page-container,
    .title-search-wrapper {
        padding: 24px;
        border-radius: 12px;
    }

    .notice-list-card,
    .map-list-card {
        padding: 16px 20px;
        border-radius: 10px;
    }

    .news-detail-view {
        max-width: 860px;
        margin: 0 auto;
    }

    .news-detail-header h1 {
        font-size: 26px;
    }

    .news-detail-content {
        font-size: 15px;
        line-height: 1.8;
    }

    .form-container {
        border-radius: 12px;
    }

    .site-footer {
        margin-top: 40px;
    }
}

/* ---------- 넓은 PC (1280px 이상): 사이드바 표시 ---------- */
@media (min-width: 1280px) {
    .site-body {
        position: relative;
    }

    /* 광고를 받기 전에는 레이아웃에서 빠져 있어 본문이 가운데 그대로 유지됨
       (애드센스가 크기를 계산할 수 있도록 폭만 가진 채 보이지 않게 대기) */
    .site-aside {
        display: block;
        position: absolute;
        top: 24px;
        right: 20px;
        visibility: hidden;
        pointer-events: none;
    }

    /* 광고가 실제로 붙었을 때만 오른쪽 자리를 차지하고 스크롤을 따라옴 */
    .site-aside:has(ins[data-ad-status="filled"]) {
        position: sticky;
        top: calc(var(--header-height) + 24px);
        right: auto;
        visibility: visible;
        pointer-events: auto;
    }

    .site-aside:has(ins[data-ad-status="unfilled"]) {
        display: none;
    }
}

/* ---------- 경험치 계산기: 넓은 화면에서 입력(왼쪽) + 결과(오른쪽 고정) ---------- */
@media (min-width: 1100px) {
    .calc-flex-container {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 380px;
        grid-template-rows: auto 1fr;
        gap: 20px;
        align-items: start;
    }

    #sectionCurrentLevel {
        grid-column: 1;
        grid-row: 1;
    }

    #sectionInventory {
        grid-column: 1;
        grid-row: 2;
        margin-top: 0;
    }

    #sectionResult {
        grid-column: 2;
        grid-row: 1 / span 2;
        margin-top: 0;
        position: sticky;
        top: calc(var(--header-height) + 20px);
        max-height: calc(100vh - var(--header-height) - 40px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .calc-section {
        padding: 18px;
        border-radius: 12px;
    }

    .exp-summary-grid {
        grid-template-columns: 1fr;
    }

    .potion-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

    .potion-single-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---------- 레벨 선택 모달 (PC): 부츠 종류별로 한 줄씩, 2열 배치로 스크롤 없이 한 화면에 ---------- */
@media (min-width: 900px) and (min-height: 600px) {
    .level-modal {
        max-width: 920px;
        max-height: none;
    }

    /* 왼쪽 열을 위에서 아래로 먼저 채운 뒤 오른쪽 열로 (레벨 순서대로 읽히도록) */
    .level-modal-body {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: repeat(9, auto);
        grid-auto-flow: column;
        gap: 6px 28px;
        padding: 14px 22px 20px;
        overflow: visible;
    }

    .level-group {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .level-group-title {
        flex: 0 0 104px;
        margin: 0;
        font-size: 13px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .level-group-items {
        flex-wrap: nowrap;
        gap: 4px;
    }

    .level-item-btn {
        width: 38px;
        height: 38px;
    }
}


/* =========================================================
   v3: 스크롤바 / 계산기 개선 / 즐겨찾기
   ========================================================= */

/* ---------- 스크롤바: 사이트 색상에 맞춘 얇은 스크롤바 ---------- */
:root {
    --scroll-thumb: #cbd5e1;
    --scroll-thumb-hover: #94a3b8;
}

[data-theme="dark"] {
    --scroll-thumb: #334155;
    --scroll-thumb-hover: #475569;
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--scroll-thumb) transparent;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: var(--scroll-thumb);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--scroll-thumb-hover);
}

::-webkit-scrollbar-thumb:active {
    background-color: var(--primary-color);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* 작은 영역(모달·결과 패널 등)은 더 얇게 */
.level-modal-body::-webkit-scrollbar,
#sectionResult::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.popup-body::-webkit-scrollbar,
.bottom-sheet::-webkit-scrollbar,
.admin-table-wrap::-webkit-scrollbar,
.admin-modal-body::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

/* ---------- 계산기: 저장 상태 안내 ---------- */
.calc-sync-status {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 14px;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-muted);
}

.calc-sync-status:empty {
    display: none;
}

.calc-sync-status i {
    margin-top: 3px;
}

.calc-sync-status a {
    color: var(--primary-color);
    font-weight: 700;
}

.calc-sync-status.is-saved i,
.calc-sync-status.is-saving i {
    color: var(--primary-color);
}

.calc-sync-status.is-saving i {
    animation: pulse 1s ease-in-out infinite;
}

.calc-sync-status.is-error {
    color: #d97706;
    border-color: rgba(217, 119, 6, 0.35);
}

.calc-sync-status.is-guest b {
    color: var(--text-main);
}

@keyframes pulse {
    50% {
        opacity: 0.35;
    }
}

/* 섹션 간격 (모바일·태블릿은 세로로 쌓임) */
.calc-flex-container {
    gap: 16px;
}

/* ---------- 어획물 입력칸 추가 ---------- */
.exp-input-group {
    position: relative;
}

.exp-input-group.is-extra {
    padding-right: 30px;
    border-style: dashed;
}

.exp-remove-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
}

.exp-remove-btn:hover {
    background: var(--bg-color);
    color: #dc2626;
}

.exp-input-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
}

.add-input-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 14px;
    border: 1px dashed var(--primary-color);
    border-radius: var(--radius);
    background: rgba(var(--primary-color-rgb), 0.06);
    color: var(--primary-color);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.add-input-btn:hover:not(:disabled) {
    background: rgba(var(--primary-color-rgb), 0.12);
}

.add-input-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.text-btn {
    border: none;
    background: none;
    padding: 6px 4px;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
}

.text-btn:hover {
    color: var(--text-main);
}

/* ---------- 결과: 한 화면에 들어오도록 간결하게 ---------- */
.calc-result-actions {
    display: flex;
    gap: 6px;
}

.calc-result-actions .action-btn {
    font-size: 13px;
    padding: 6px 12px;
}

.exp-summary-list {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--card-bg);
    overflow: hidden;
}

.exp-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    font-size: 13px;
}

.exp-row+.exp-row {
    border-top: 1px solid var(--border-color);
}

.exp-row .label {
    color: var(--text-muted);
}

.exp-row .value {
    font-weight: 700;
    text-align: right;
    cursor: help;
}

.exp-row.is-plus .value::before {
    content: "+ ";
}

.exp-row.is-primary .value {
    color: var(--primary-color);
}

.result-level-card {
    padding: 12px 14px;
}

.result-level-name {
    margin: 2px 0 8px;
    font-size: 17px;
}

.next-level-info {
    margin-top: 8px;
}

.target-panel {
    margin-top: 10px;
    padding: 10px 12px;
}

.target-inputs {
    margin-top: 10px;
}

.target-result {
    margin-top: 10px;
}

.target-progress-meta {
    margin-top: 4px;
}

.target-remaining {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 8px 12px;
}

.target-done {
    margin-top: 10px;
    padding: 8px 12px;
}

.potion-plan {
    margin-top: 10px;
}

.plan-label {
    margin: 8px 0 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
}

.plan-label:first-child {
    margin-top: 0;
}

.potion-chip {
    padding: 4px 10px;
    font-size: 12px;
}

.potion-single-grid {
    grid-template-columns: repeat(4, 1fr);
}

.potion-single {
    padding: 6px 4px;
}

.potion-single .name {
    font-size: 11px;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .potion-single-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .calc-result-head {
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* ---------- 내 계산 기록 ---------- */
.history-icon {
    color: var(--primary-color);
    margin-right: 6px;
}

.calc-history {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-empty {
    padding: 14px 4px;
    font-size: 13px;
    text-align: center;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--card-bg);
}

.history-main {
    min-width: 0;
}

.history-levels {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 6px;
    font-size: 13px;
    font-weight: 600;
}

.history-levels small {
    color: var(--text-muted);
    font-weight: 500;
}

.history-levels .fa-arrow-right {
    color: var(--primary-color);
    font-size: 11px;
}

.history-meta {
    margin-top: 2px;
    font-size: 12px;
    color: var(--text-muted);
}

.history-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.history-actions .action-btn {
    padding: 6px 10px;
    font-size: 12px;
}

.history-promo {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px dashed rgba(var(--primary-color-rgb), 0.5);
    border-radius: var(--radius);
    background: rgba(var(--primary-color-rgb), 0.05);
}

.history-promo>i {
    font-size: 22px;
    color: var(--primary-color);
}

.history-promo b {
    font-size: 14px;
}

.history-promo p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.history-promo .btn-primary {
    margin-left: auto;
    text-decoration: none;
    padding: 8px 16px;
    font-size: 13px;
    flex-shrink: 0;
}

@media (max-width: 600px) {

    .history-item,
    .history-promo {
        flex-direction: column;
        align-items: stretch;
    }

    .history-actions {
        justify-content: flex-end;
    }

    .history-promo .btn-primary {
        margin-left: 0;
        text-align: center;
    }
}

/* ---------- PC: 입력(왼쪽) + 결과(오른쪽 고정) + 기록(왼쪽 아래) ---------- */
@media (min-width: 1100px) {
    .calc-flex-container {
        grid-template-columns: minmax(0, 1fr) 400px;
        grid-template-rows: auto auto 1fr;
    }

    #sectionResult {
        grid-row: 1 / span 3;
        padding: 14px 16px;
    }

    #sectionHistory {
        grid-column: 1;
        grid-row: 3;
    }

    .calc-result-head {
        margin-bottom: 8px;
    }
}

/* ---------- 칭호 즐겨찾기 ---------- */
.title-item {
    position: relative;
}

.fav-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    opacity: 0.45;
    transition: opacity 0.15s, color 0.15s, transform 0.15s;
}

.title-item:hover .fav-btn,
.fav-btn:focus-visible {
    opacity: 1;
}

.fav-btn:hover {
    transform: scale(1.15);
}

.fav-btn.is-fav {
    color: #f59e0b;
    opacity: 1;
}

.filter-fav i {
    color: #f59e0b;
}

.filter-fav.active i {
    color: #fff;
}

.fav-count:not(:empty) {
    display: inline-block;
    min-width: 18px;
    margin-left: 2px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(var(--primary-color-rgb), 0.15);
    font-size: 11px;
    line-height: 18px;
}

/* ---------- 칭호 목록: 모바일은 2열 ---------- */
@media (max-width: 768px) {
    .title-list-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .title-item {
        padding: 10px 8px;
    }

    .fav-btn {
        opacity: 0.7;
    }
}

/* ---------- 관리자 메뉴 링크 ---------- */
.user-links #admin-link {
    color: var(--primary-color);
}

a.sheet-item {
    color: var(--text-main);
}


/* =========================================================
   v4: 기능 제한 안내 / 알림 종 / 내 정보 / 카카오·디스코드 / 로그인
   ========================================================= */
.flec-gate {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 26px 18px;
    border: 1px dashed rgba(var(--primary-color-rgb), 0.5);
    border-radius: 14px;
    background: rgba(var(--primary-color-rgb), 0.05);
    text-align: center;
    font-size: 14px;
    line-height: 1.6;
}

.flec-gate>i {
    font-size: 28px;
    color: var(--primary-color);
}

.flec-gate-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.flec-gate-actions .btn-primary {
    text-decoration: none;
}

.kakao-btn,
.discord-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.kakao-btn {
    background: #fee500;
    color: #191919;
}

.kakao-btn:hover {
    background: #f5dc00;
}

.discord-btn {
    background: #5865f2;
    color: #fff;
}

.discord-btn:hover {
    background: #4752c4;
}

/* 로그인 · 가입 */
.auth-box {
    max-width: 420px;
    margin: 0 auto;
}

.auth-kakao {
    width: 100%;
    box-sizing: border-box;
    min-height: 48px;
    font-size: 15px;
}

.auth-note {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
}

.auth-note a {
    color: var(--primary-color);
    font-weight: 700;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
    color: var(--text-muted);
    font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-agree {
    margin: 6px 0 4px;
    font-size: 13px;
    line-height: 1.5;
    align-items: flex-start;
}

.auth-agree a {
    color: var(--primary-color);
}

.auth-msg {
    min-height: 20px;
    margin: 8px 0;
    color: #ef4444;
    text-align: center;
    font-size: 14px;
}

/* 알림 종 */
.notify-wrap {
    position: relative;
}

.notify-bell {
    position: relative;
}

.notify-badge,
.dock-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    box-sizing: border-box;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.notify-badge[hidden],
.dock-badge[hidden] {
    display: none;
}

.dock-btn .dock-badge {
    top: 6px;
    right: calc(50% - 22px);
}

.notify-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 2000;
    width: min(360px, calc(100vw - 24px));
    max-height: min(480px, 70vh);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--card-bg);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.notify-panel[hidden] {
    display: none;
}

.notify-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
}

.notify-list {
    flex: 1;
    overflow-y: auto;
}

.notify-item {
    display: flex;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-main);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.notify-item:hover {
    background: rgba(var(--primary-color-rgb), 0.05);
}

.notify-item.unread {
    background: rgba(var(--primary-color-rgb), 0.08);
}

.notify-item>i {
    margin-top: 3px;
    color: var(--primary-color);
}

.notify-item .txt {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    font-size: 13px;
}

.notify-item .txt span {
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notify-item small {
    font-size: 11px;
    color: var(--text-muted);
}

.notify-empty {
    padding: 30px 10px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.notify-more {
    padding: 10px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 13px;
    color: var(--primary-color);
    text-decoration: none;
}

@media (max-width: 1024px) {
    .notify-panel {
        position: fixed;
        top: calc(var(--header-height) + 6px);
        right: 12px;
    }
}

/* 상단 사용자 메뉴의 내 정보 링크 */
.user-links .my-link {
    color: var(--text-main) !important;
    font-weight: 700;
}

/* 내 정보 */
.my-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 760px;
    margin: 0 auto;
}

.my-card {
    padding: 18px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-color);
}

.my-card h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font-size: 16px;
}

.my-card h2>i {
    color: var(--primary-color);
}

.my-tag {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(var(--primary-color-rgb), 0.12);
    color: var(--primary-color);
    font-size: 11px;
}

.my-desc {
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

.my-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.my-row:last-of-type {
    margin-bottom: 10px;
}

.my-row span {
    color: var(--text-muted);
}

.ok {
    color: #16a34a;
}

.warn {
    color: #d97706;
}

.my-channel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--border-color);
}

.my-channel p {
    margin-top: 2px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.my-channel b i {
    width: 18px;
    color: var(--primary-color);
}

.my-state {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--text-muted);
}

.my-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.my-push-device {
    margin: -4px 0 6px;
    font-size: 12px;
}

.my-push-device:empty {
    display: none;
}

.my-sub {
    margin: 14px 0 8px;
    font-size: 14px;
}

.my-types {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
}

.my-flash {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
}

.my-flash-ok {
    background: rgba(22, 163, 74, 0.12);
    color: #16a34a;
}

.my-flash-warn {
    background: rgba(217, 119, 6, 0.12);
    color: #d97706;
}

.my-flash-err {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

@media (max-width: 600px) {
    .my-channel {
        flex-direction: column;
        align-items: flex-start;
    }

    .my-actions {
        justify-content: flex-start;
    }
}

/* PC 헤더 메뉴가 많아져 좁은 PC에서 줄어들도록 */
@media (min-width: 1025px) and (max-width: 1280px) {

    .site-nav .nav-btn,
    .site-nav>.nav-btn:first-of-type {
        padding: 0 9px;
        font-size: 14px;
    }

    .header-inner {
        gap: 16px;
    }
}

/* 홈 기능 카드 5개 */
@media (min-width: 1025px) {
    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}


/* =========================================================
   v5: 전체 점검 — 폼 요소 · 공통 컴포넌트 정리
   ========================================================= */

/* 모든 입력 요소를 테마 색으로 (검색·URL·여러 줄 입력 포함) */
input[type="search"],
input[type="url"],
input[type="email"],
input[type="tel"],
textarea {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    color: var(--text-main);
    background-color: var(--card-bg);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input,
select {
    color: var(--text-main);
    background-color: var(--card-bg);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.15);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

[data-theme="dark"] input[type="search"]::-webkit-search-cancel-button {
    filter: invert(1);
}

[data-theme="dark"] select,
[data-theme="dark"] input[type="date"] {
    color-scheme: dark;
}

/* 세그먼트 버튼 (관리자 전용이던 스타일을 공통으로) */
.segmented {
    display: inline-flex;
    flex-wrap: wrap;
    padding: 3px;
    gap: 2px;
    border-radius: 10px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
}

.segmented button {
    padding: 6px 14px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

.segmented button:hover {
    color: var(--text-main);
}

.segmented button.active {
    background: var(--card-bg);
    color: var(--primary-color);
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .segmented button.active {
    background: var(--primary-color);
    color: #fff;
}

/* 로그인 · 가입 */
.auth-social {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-social-btn {
    width: 100%;
    box-sizing: border-box;
    min-height: 48px;
    font-size: 15px;
}

.auth-submit {
    width: 100%;
    min-height: 46px;
    margin-top: 4px;
    font-size: 15px;
    font-weight: 700;
}

.auth-box .form-group label {
    font-size: 13px;
}

.auth-box .form-input {
    height: 44px;
}

/* 내 정보: 본인 확인 상태 */
.my-identity {
    margin-top: 10px;
}

.my-badge {
    display: inline-flex;
    align-items: flex-start;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 10px;
    background: var(--border-color);
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
}

.my-badge.ok {
    background: rgba(22, 163, 74, 0.12);
    color: #16a34a;
}

.my-badge.warn {
    background: rgba(217, 119, 6, 0.12);
    color: #d97706;
}

.my-rep-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

/* 상자 시뮬레이터: 좁은 열이 내용 때문에 넓어지지 않게 */
.lb-layout>* {
    min-width: 0;
}

/* 트레이드 탭 줄: 스크롤바 숨김 */
.trade-tabs {
    scrollbar-width: none;
}

.trade-tabs::-webkit-scrollbar {
    display: none;
}

.trade-filters .segmented {
    flex-wrap: nowrap;
}

@media (max-width: 600px) {
    .trade-filters .segmented {
        width: 100%;
    }

    .trade-filters .segmented button {
        flex: 1;
    }
}

.my-push-error {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(217, 119, 6, 0.1);
    color: #b45309;
    font-size: 13px;
    line-height: 1.6;
}

[data-theme="dark"] .my-push-error {
    color: #fbbf24;
}

.my-push-error i {
    margin-top: 3px;
}

/* 칭호·어빌리티 검색줄: 좁은 화면에서 입력칸이 줄어들도록 */
.search-bar-row .search-input {
    min-width: 0;
}

.search-bar-row>button {
    flex-shrink: 0;
}

/* 물약 목록: 아주 좁은 화면(320px)에서 칸이 화면 밖으로 나가지 않게 */
.potion-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
}

.potion-item {
    min-width: 0;
}

/* ---------- 기능이 모두 꺼진 페이지 안내 ---------- */
.feature-off-notice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 56px 20px;
    border: 1px dashed var(--border-color);
    border-radius: 14px;
    text-align: center;
    color: var(--text-muted);
}

.feature-off-notice i {
    font-size: 36px;
    color: var(--primary-color);
}

.feature-off-notice p {
    margin: 0;
    line-height: 1.7;
}

.feature-off-notice .btn-primary {
    text-decoration: none;
}

/* 일부 기능만 꺼진 경우: 보이지만 누를 수 없음 */
.is-feature-off,
.is-feature-off:hover {
    opacity: 0.45;
    cursor: not-allowed !important;
    pointer-events: auto;
}

.feature-off-tag {
    margin-left: 4px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(127, 127, 127, 0.18);
    font-size: 10px;
    font-weight: 700;
    vertical-align: middle;
}

/* ---------- 로딩 표시: 화면 안에서는 가운데, 0.3초 넘게 걸릴 때만 보이게 ---------- */
.loading-spinner {
    display: block;
    width: 32px;
    height: 32px;
    margin: 36px auto;
    border-width: 3px;
    opacity: 0;
    animation: spin 0.8s linear infinite, spinner-appear 0.2s ease 0.3s forwards;
}

@keyframes spinner-appear {
    to {
        opacity: 1;
    }
}

.global-loader-overlay .loading-spinner {
    margin: 0;
    width: 40px;
    height: 40px;
    border-width: 4px;
    opacity: 1;
    animation: spin 1s linear infinite;
}

i.feature-off-tag {
    margin-left: 5px;
    padding: 0;
    background: none;
    font-size: 0.8em;
}

.trade-filters[hidden] {
    display: none;
}

i.feature-off-tag {
    margin-left: 5px;
    padding: 0;
    background: none;
    font-size: 0.8em;
}

.trade-filters[hidden] {
    display: none;
}

/* 경험치 계산기: 좁은 화면에서 포션 이름이 잘리지 않게 (두 줄까지) */
@media (max-width: 480px) {
    .potion-item {
        gap: 8px;
        padding: 8px;
    }

    .potion-name {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-height: 1.35;
        word-break: keep-all;
    }

    .potion-exp {
        white-space: nowrap;
        font-size: 11px;
    }

    .stepper-btn {
        width: 34px;
    }

    input[type="number"].stepper-input {
        width: 52px;
    }
}

/* 칭호·어빌리티: 휴대폰에서 등급 필터는 줄바꿈, 안쪽 카드 여백 축소 */
@media (max-width: 768px) {
    .title-search-wrapper {
        padding: 12px;
    }

    .grade-filter-container {
        flex-wrap: wrap !important;
        overflow: visible;
        gap: 6px;
        padding-bottom: 0;
    }

    .grade-filter-container .filter-btn {
        margin-right: 0;
    }
}

/* 새 소식·맵 크래프트 목록: 휴대폰에서 겹친 카드 여백 축소, 검색칸과 버튼을 한 줄로 */
@media (max-width: 768px) {
    .list-page-container {
        padding: 12px;
    }

    .search-bar-wrapper {
        flex-wrap: nowrap;
    }

    .search-bar-wrapper input {
        flex: 1 1 auto;
        min-width: 0;
    }

    .search-bar-wrapper button {
        flex: 0 0 auto;
        min-height: 44px;
        padding: 0 16px;
    }
}

.map-howto {
    display: flex;
    gap: 8px;
    align-items: baseline;
    margin: 10px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(var(--primary-color-rgb), 0.08);
    color: var(--text-main);
    font-size: 13px;
    line-height: 1.6;
}

.map-howto i {
    color: var(--primary-color);
}

/* 한글이 단어 중간에서 끊기지 않게 (긴 영문·주소는 넘치지 않게 줄바꿈) */
body {
    word-break: keep-all;
    overflow-wrap: break-word;
}

/* 검색칸 옆 버튼이 두 개(검색·초기화)면 휴대폰에서는 검색칸을 한 줄 전체로 */
@media (max-width: 480px) {
    .search-bar-wrapper:has(button + button) {
        flex-wrap: wrap;
    }

    .search-bar-wrapper:has(button + button) input {
        flex: 1 1 100%;
    }

    .search-bar-wrapper:has(button + button) button {
        flex: 1 1 0;
    }
}

.nowrap {
    white-space: nowrap;
}

/* 홈 기능 카드가 5개일 때 PC에서 한 줄에 (4+1로 하나만 떨어지지 않게) */
@media (min-width: 1025px) {
    .dashboard-grid:has(> .dashboard-card:nth-child(5)) {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 14px;
    }
}

/* =========================================================
   도구 페이지 아래 안내·참고 자료 (includes/guide.php)
   ========================================================= */
.guide-section {
    margin-top: 28px;
    padding: 22px 22px 8px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-color);
    line-height: 1.7;
}

.guide-section h2 {
    margin: 0 0 10px;
    font-size: 17px;
}

.guide-section h2 small {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.guide-section h2:not(:first-child) {
    margin-top: 24px;
}

.guide-steps,
.guide-list {
    margin: 0 0 8px;
    padding-left: 22px;
    font-size: 14px;
}

.guide-steps li,
.guide-list li {
    margin-bottom: 6px;
}

.guide-note {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.guide-table-wrap {
    overflow-x: auto;
    margin-bottom: 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.guide-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.guide-table th,
.guide-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    white-space: nowrap;
}

.guide-table td:last-child {
    white-space: normal;
}

.guide-table th {
    background: var(--card-bg);
    font-weight: 700;
    color: var(--text-muted);
}

.guide-table tr:last-child td {
    border-bottom: none;
}

.guide-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.guide-table-2col {
    max-width: 520px;
}

.guide-details {
    margin-bottom: 14px;
}

.guide-details summary {
    cursor: pointer;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
}

.guide-details[open] summary {
    margin-bottom: 10px;
}

.guide-faq {
    margin: 0 0 14px;
    font-size: 14px;
}

.guide-faq dt {
    font-weight: 700;
    margin-top: 10px;
}

.guide-faq dd {
    margin: 2px 0 0;
    color: var(--text-muted);
}

.guide-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.guide-stats>div {
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
}

.guide-stats span {
    font-size: 12px;
    color: var(--text-muted);
}

.guide-stats b {
    font-size: 18px;
}

/* 스크립트가 목록을 그리기 전·검색엔진용 글 목록 */
.guide-post-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.guide-post-list a {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 12px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text-main);
    text-decoration: none;
}

.guide-post-list span {
    grid-column: 1;
    font-size: 13px;
    color: var(--text-muted);
}

.guide-post-list time {
    grid-column: 2;
    grid-row: 1;
    font-size: 12px;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .guide-section {
        padding: 16px 14px 4px;
    }
}

/* 경험치 계산기: 로그인 전 입력값 / 계정 값 선택 창 */
.calc-merge-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.6);
}

.calc-merge-card {
    width: 100%;
    max-width: 440px;
    padding: 22px 20px 18px;
    border-radius: 16px;
    background: var(--card-bg);
    color: var(--text-main);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.calc-merge-card h3 {
    margin: 0;
    font-size: 18px;
}

.calc-merge-card p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
}

.calc-merge-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 4px 0;
}

.calc-merge-compare>div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-color);
    font-size: 13px;
}

.calc-merge-compare small {
    color: var(--text-muted);
    font-size: 11px;
}

.calc-merge-compare span {
    color: var(--text-muted);
    font-size: 12px;
}

.calc-merge-card button {
    min-height: 44px;
    width: 100%;
}

@media (max-width: 420px) {
    .calc-merge-compare {
        grid-template-columns: 1fr;
    }
}

/* 안내 영역 안의 링크: 사이트 강조색, 밑줄은 마우스를 올렸을 때만 */
.guide-section a {
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: none;
    border-radius: 4px;
    transition: color 0.15s, background-color 0.15s;
}

.guide-section a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.guide-section a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 홈 소개: 기능 목록은 아이콘 없는 칩 모양 링크 + 설명 */
.home-intro .guide-list {
    list-style: none;
    margin: 14px 0 12px;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.home-intro .guide-list li {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

.home-intro .guide-list a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(var(--primary-color-rgb), 0.12);
    white-space: nowrap;
}

.home-intro .guide-list a::after {
    content: "\f054";
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 10px;
}

.home-intro .guide-list a:hover {
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
}

.home-intro>p:first-of-type {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-main);
}

/* =========================================================
   어획물 자동 인식 (assets/js/fishScan.js)
   ========================================================= */
.fish-scan-open {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid var(--primary-color);
    border-radius: 999px;
    background: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-color);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.fish-scan-open:hover {
    background: var(--primary-color);
    color: #fff;
}

.fish-scan-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    /* 하단 메뉴·결과 요약 바보다 위 */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.65);
}

.fish-scan-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 620px;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    padding: 20px;
    border-radius: 16px;
    background: var(--card-bg);
    color: var(--text-main);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.fish-scan-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fish-scan-head h3 {
    margin: 0;
    font-size: 18px;
}

.fish-scan-head h3 i {
    color: var(--primary-color);
}

.fish-scan-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

.fish-scan-guide {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-muted);
}

.fish-scan-guide b {
    color: var(--text-main);
}

.fish-scan-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fish-scan-actions .btn-primary,
.fish-scan-actions .action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1 1 200px;
    min-height: 44px;
    cursor: pointer;
}

.fish-scan-actions .btn-primary.is-sharing {
    background: #dc2626;
}

.fish-scan-status {
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--bg-color);
    font-size: 13px;
}

.fish-scan-status.is-error {
    color: #dc2626;
}

[data-theme="dark"] .fish-scan-status.is-error {
    color: #f87171;
}

.fish-scan-pages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.fish-scan-pages:empty,
.fish-scan-result:empty {
    display: none;
}

.fish-scan-chip {
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(var(--primary-color-rgb), 0.12);
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 700;
}

.fish-scan-result {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fish-scan-warn {
    margin: 0;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
    font-size: 13px;
}

[data-theme="dark"] .fish-scan-warn {
    color: #fbbf24;
}

.fish-scan-page {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.fish-scan-page-head {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-color);
    font-size: 13px;
}

.fish-scan-page-head span {
    color: var(--primary-color);
    font-weight: 700;
}

.fish-scan-rows {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.fish-scan-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-top: 1px solid var(--border-color);
}

.fish-scan-row.is-unsure {
    background: rgba(245, 158, 11, 0.14);
}

.fish-scan-row img {
    flex-shrink: 0;
    border-radius: 8px;
}

.fish-scan-name {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    font-size: 13px;
    line-height: 1.4;
}

.fish-scan-name small {
    color: var(--text-muted);
    font-size: 11px;
}

.fish-scan-name select {
    min-height: 32px;
    padding: 2px 6px;
    font-size: 13px;
}

.fish-scan-row input[type="number"] {
    width: 84px;
    min-height: 34px;
    padding: 4px 8px;
    text-align: right;
}

.fish-scan-privacy {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

.fish-scan-foot {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.fish-scan-foot button {
    min-height: 44px;
}

@media (max-width: 480px) {
    .fish-scan-card {
        padding: 16px 14px;
    }

    .fish-scan-foot button {
        flex: 1;
    }
}

.calc-subsection-head:has(.fish-scan-open) {
    align-items: center;
    flex-wrap: wrap;
}

.calc-subsection-head .fish-scan-open {
    margin-left: auto;
}

/* 자동 인식 결과: 한 페이지씩 보기 */
button.fish-scan-chip {
    position: relative;
    border: 1px solid transparent;
    font-family: inherit;
    cursor: pointer;
}

button.fish-scan-chip.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: #fff;
}

/* 확인이 필요한 칸이 있는 페이지: 노란 점 */
button.fish-scan-chip.has-unsure::after {
    content: "";
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    border: 2px solid var(--card-bg);
    border-radius: 50%;
    background: #f59e0b;
}

.fish-scan-page-head {
    align-items: center;
    gap: 8px;
}

.fish-scan-page-title {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.4;
}

.fish-scan-page-title span {
    font-size: 12px;
}

.fish-scan-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text-main);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.fish-scan-nav:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.fish-scan-nav:disabled {
    opacity: 0.4;
    cursor: default;
}

@media (max-width: 480px) {
    .fish-scan-nav {
        padding: 6px 10px;
    }
}

/* 결과 줄: 한 줄에 물고기 하나 (일반/트리플 선택칸의 긴 이름이 잘리지 않게) */
.fish-scan-rows {
    grid-template-columns: 1fr;
}

.fish-scan-name select {
    width: 100%;
    max-width: 320px;
}

@media (max-width: 480px) {
    .fish-scan-row {
        gap: 8px;
        padding: 6px 8px;
    }

    .fish-scan-row input[type="number"] {
        width: 64px;
    }

    .fish-scan-name select {
        font-size: 12px;
        padding-right: 22px;
    }
}
/* 안내 표: 숫자 열은 머리글도 같은 쪽 정렬 */
.guide-table th.num {
    text-align: right;
}

.guide-table th.center,
.guide-table td.center {
    text-align: center;
    width: 56px;
}

/* 어획물 교환 경험치: 아이콘 카드 격자 (긴 표 대신 가로 공간을 모두 사용) */
.guide-fish-grid {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 6px;
}

.guide-fish-grid li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
    font-size: 13px;
}

.guide-fish-grid img {
    flex-shrink: 0;
    border-radius: 8px;
}

.guide-fish-grid .nm {
    flex: 1;
    min-width: 0;
    line-height: 1.35;
}

.guide-fish-grid b {
    flex-shrink: 0;
    color: var(--primary-color);
    font-variant-numeric: tabular-nums;
}

/* 휴대폰: 두 줄 격자, 이름 아래에 경험치 */
@media (max-width: 480px) {
    .guide-fish-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .guide-fish-grid li {
        display: grid;
        grid-template-columns: 32px minmax(0, 1fr);
        column-gap: 8px;
        padding: 6px 8px;
    }

    .guide-fish-grid img {
        grid-row: span 2;
        width: 32px;
        height: 32px;
    }

    .guide-fish-grid .nm {
        font-size: 12px;
    }

    .guide-fish-grid b {
        font-size: 12px;
    }
}

/* 레벨 표(126줄): 높이를 정해 두고 머리글은 스크롤해도 위에 고정 */
.guide-details .guide-table-wrap {
    max-height: 480px;
    overflow: auto;
}

.guide-details .guide-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}
