@font-face { font-family: 'Paperlogy-1Thin'; src: url('fonts/Paperlogy-1Thin.ttf'); font-display: swap; }
@font-face { font-family: 'Paperlogy-2ExtraLight'; src: url('fonts/Paperlogy-2ExtraLight.ttf'); font-display: swap; }
@font-face { font-family: 'Paperlogy-3Light'; src: url('fonts/Paperlogy-3Light.ttf'); font-display: swap; }
@font-face { font-family: 'Paperlogy-4Regular'; src: url('fonts/Paperlogy-4Regular.ttf'); font-display: swap; }
@font-face { font-family: 'Paperlogy-5Medium'; src: url('fonts/Paperlogy-5Medium.ttf'); font-display: swap; }
@font-face { font-family: 'Paperlogy-6SemiBold'; src: url('fonts/Paperlogy-6SemiBold.ttf'); font-display: swap; }
@font-face { font-family: 'Paperlogy-7Bold'; src: url('fonts/Paperlogy-7Bold.ttf'); font-display: swap; }
@font-face { font-family: 'Paperlogy-8ExtraBold'; src: url('fonts/Paperlogy-8ExtraBold.ttf'); font-display: swap; }
@font-face { font-family: 'Paperlogy-9Black'; src: url('fonts/Paperlogy-9Black.ttf'); font-display: swap; }
@font-face {
    font-family: 'Mulmaru Mono';
    src: url('fonts/MulmaruMono.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

.modal > .toolbox-modal-content { display: flex; flex-direction: column; width: 96vw; max-width: none; height: 94dvh; max-height: 94dvh; padding: 24px 28px 28px; }
.toolbox-modal-header { flex: 0 0 auto; }
.toolbox-view { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.toolbox-layout { display: grid; grid-template-columns: minmax(220px, 260px) minmax(0, 1fr); gap: 20px; height: 100%; }
.toolbox-catalog, .now-explorer, .rune-explorer, .deca-explorer { border: 1px solid var(--border-default); border-radius: 18px; background: var(--card-bg); padding: 18px; }
.now-explorer, .rune-explorer, .deca-explorer { min-width: 0; overflow: auto; }
.toolbox-panel.hidden { display: none; }
.toolbox-landing { display: grid; min-width: 0; place-content: center; justify-items: center; padding: 32px; border: 1px dashed var(--border-default); border-radius: 18px; background: var(--card-bg); color: var(--text-main); text-align: center; }
.toolbox-landing.hidden { display: none; }
.toolbox-landing-icon { font-size: 38px; }
.toolbox-landing h3 { margin-top: 14px; font-size: 18px; }
.toolbox-landing p { margin-top: 8px; color: var(--text-secondary); font-size: 13px; line-height: 1.6; }
.toolbox-landing strong { color: var(--primary); }
.toolbox-card { width: 100%; display: flex; gap: 12px; align-items: center; margin-top: 12px; padding: 14px; border: 1px solid var(--select-border); border-radius: 14px; background: var(--surface-subtle); color: var(--text-main); text-align: left; cursor: pointer; }
.toolbox-card.active { border-color: var(--primary); background: var(--board-page-active-bg); }
.toolbox-card-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--primary); color: var(--btn-primary-text); font-size: 20px; }
.toolbox-card strong, .toolbox-card small { display: block; }
.toolbox-card small, .toolbox-coming-soon { color: var(--text-secondary); margin-top: 4px; }
.toolbox-coming-soon { font-size: 12px; line-height: 1.5; }
.rune-source-attribution { display: flex; align-items: center; justify-content: flex-end; gap: 7px; margin-bottom: 8px; color: var(--text-secondary); font-size: 11px; }
.rune-source-attribution a { color: var(--primary); font-weight: 700; text-decoration: none; }
.rune-source-attribution a:hover { text-decoration: underline; }
.rune-toolbar { display: grid; grid-template-columns: minmax(260px, 1fr); }
.rune-filter-grid { display: grid; grid-template-columns: repeat(7, minmax(100px, 1fr)); gap: 10px; margin-top: 10px; }
.rune-filter-grid label { display: grid; gap: 4px; color: var(--text-secondary); font-size: 11px; }
.rune-filter-grid select { width: 100%; min-width: 0; }
.rune-search { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 12px; border: 1px solid var(--select-border); border-radius: 12px; background: var(--select-bg); color: var(--text-secondary); }
.rune-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--select-text); font: inherit; }
.rune-source-status { margin: 10px 0 12px; color: var(--text-secondary); font-size: 12px; }
.rune-admin-import { margin-bottom: 14px; padding: 12px 14px; border: 1px solid var(--border-default); border-radius: 14px; background: var(--surface-subtle); }
.rune-admin-import.hidden { display: none; }
.rune-admin-import summary { color: var(--text-main); font-weight: 700; cursor: pointer; }
.rune-import-guide { margin-top: 12px; }
.rune-import-guide p, .rune-import-status { color: var(--text-secondary); font-size: 12px; line-height: 1.6; }
.rune-import-guide a { color: var(--primary); }
.rune-import-guide pre { max-height: 240px; margin: 10px 0; padding: 12px; overflow: auto; border: 1px solid var(--border-default); border-radius: 10px; background: var(--select-bg); color: var(--select-text); font: 11px/1.55 'Mulmaru Mono', monospace; white-space: pre-wrap; }
.rune-json-input { display: grid; gap: 5px; margin-top: 14px; color: var(--text-secondary); font-size: 11px; }
.rune-json-input textarea { width: 100%; resize: vertical; padding: 10px 12px; border: 1px solid var(--select-border); border-radius: 10px; background: var(--select-bg); color: var(--select-text); font: 11px/1.5 'Mulmaru Mono', monospace; }
.rune-import-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.rune-import-actions input { min-width: 0; color: var(--text-secondary); }
.rune-import-status { margin-top: 8px; }
.rune-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; }
.rune-card { --rune-card-grade-color: var(--border-default); display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; padding: 12px; border: 1px solid color-mix(in srgb, var(--rune-card-grade-color) 72%, var(--border-default)); border-radius: 14px; background: var(--surface-subtle); box-shadow: 0 0 0 1px color-mix(in srgb, var(--rune-card-grade-color) 18%, transparent), 0 0 16px color-mix(in srgb, var(--rune-card-grade-color) 22%, transparent); }
.rune-card-grade-01 { --rune-card-grade-color: var(--rune-grade-advanced); }
.rune-card-grade-02 { --rune-card-grade-color: var(--rune-grade-rare); }
.rune-card-grade-03 { --rune-card-grade-color: var(--rune-grade-elite); }
.rune-card-grade-04 { --rune-card-grade-color: var(--rune-grade-epic); }
.rune-card-grade-05 { --rune-card-grade-color: var(--rune-grade-legendary); }
.rune-card-grade-06 { --rune-card-grade-color: var(--rune-grade-unique); }
.rune-card-grade-07 { --rune-card-grade-color: var(--rune-grade-origin); }
.rune-card-grade-08 { --rune-card-grade-color: var(--rune-grade-mythic); }
.rune-card-image { display: grid; place-items: center; width: 52px; height: 52px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--rune-card-grade-color) 48%, var(--border-default)); border-radius: 11px; background: color-mix(in srgb, var(--rune-card-grade-color) 18%, var(--card-bg)); color: var(--rune-card-grade-color); font-size: 22px; }
.rune-card-image img { width: auto; height: auto; max-width: 40px; max-height: 40px; object-fit: contain; }
.rune-card-body { min-width: 0; }
.rune-card-title { display: flex; align-items: center; gap: 10px; }
.rune-card-title strong { min-width: 0; overflow: hidden; color: var(--text-main); text-overflow: ellipsis; white-space: nowrap; }
.rune-card-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.rune-card-meta span { padding: 2px 6px; border-radius: 999px; background: var(--card-bg); color: var(--text-secondary); font-size: 10px; }
.rune-card-meta .rune-grade { color: var(--rune-grade-color); }
.rune-grade-01 { --rune-grade-color: var(--rune-grade-advanced); }
.rune-grade-02 { --rune-grade-color: var(--rune-grade-rare); }
.rune-grade-03 { --rune-grade-color: var(--rune-grade-elite); }
.rune-grade-04 { --rune-grade-color: var(--rune-grade-epic); }
.rune-grade-05 { --rune-grade-color: var(--rune-grade-legendary); }
.rune-grade-06 { --rune-grade-color: var(--rune-grade-unique); }
.rune-grade-07 { --rune-grade-color: var(--rune-grade-origin); }
.rune-grade-08 { --rune-grade-color: var(--rune-grade-mythic); }
.rune-card p { margin-top: 8px; color: var(--text-content); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-line; }
.rune-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }
.rune-pagination-top { margin: 0 0 16px; }
.rune-pagination.hidden { display: none; }
.rune-pagination .btn { min-width: 76px; }
.rune-pagination .btn:disabled { opacity: .45; cursor: default; }
.rune-page-status { color: var(--text-secondary); font: 12px 'Mulmaru Mono', monospace; }
.deca-explorer { color: var(--text-main); }
.deca-heading, .deca-control-title, .deca-chart-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.deca-heading h3 { margin-top: 5px; font-size: 20px; }
.deca-source-status { color: var(--text-secondary); font-size: 11px; text-align: right; }
.deca-perspective-switch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 16px; padding: 5px; border: 1px solid var(--border-default); border-radius: 13px; background: var(--surface-subtle); }
.deca-perspective-switch button { min-height: 38px; padding: 7px 12px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--text-secondary); font: inherit; font-size: 12px; cursor: pointer; }
.deca-perspective-switch button:hover { color: var(--text-main); }
.deca-perspective-switch button.active { border-color: var(--primary); background: var(--card-bg); color: var(--text-main); font-weight: 700; }
.deca-input-grid { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(260px, 1.25fr) auto; gap: 10px; align-items: end; margin-top: 18px; padding: 14px; border: 1px solid var(--border-default); border-radius: 14px; background: var(--surface-subtle); }
.deca-input-grid > label { display: grid; gap: 5px; color: var(--text-secondary); font-size: 11px; }
.deca-input-grid > .deca-cash-field { color: var(--text-main); font-size: 13px; font-weight: 700; }
.deca-cash-field .deca-number-input { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-glow); }
.deca-cash-field input { font: 16px 'Mulmaru Mono', monospace; font-weight: 700; }
.deca-input-grid > label > input, .deca-number-input { min-height: 42px; border: 1px solid var(--select-border); border-radius: 11px; background: var(--select-bg); color: var(--select-text); }
.deca-input-grid > label > input { width: 100%; padding: 0 12px; outline: none; font: inherit; }
.deca-number-input { display: flex; align-items: center; padding: 0 11px; }
.deca-number-input input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--select-text); font: inherit; }
.deca-number-input em { color: var(--text-secondary); font-size: 11px; font-style: normal; }
.deca-auto-reset { flex: 0 0 auto; width: 22px; height: 22px; margin-right: 6px; padding: 0; border: 1px solid var(--border-default); border-radius: 50%; background: transparent; color: var(--text-secondary); font-size: 16px; line-height: 18px; cursor: pointer; }
.deca-auto-reset:hover, .deca-auto-reset:focus-visible { border-color: var(--primary); color: var(--text-main); outline: none; }
.deca-auto-reset.hidden { display: none; }
.deca-control-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.deca-control-grid.deca-single-control { grid-template-columns: minmax(0, 1fr); }
.deca-control-card { padding: 15px; border: 1px solid var(--border-default); border-radius: 14px; background: var(--surface-subtle); }
.deca-control-title { margin-bottom: 11px; }
.deca-control-title strong, .deca-control-title small { display: block; }
.deca-control-title small { margin-top: 4px; color: var(--text-secondary); font-size: 10px; font-weight: 400; }
.deca-control-card select { width: 100%; margin-bottom: 8px; }
.deca-data-badge { padding: 3px 7px; border: 1px solid var(--border-default); border-radius: 999px; color: var(--text-secondary); font: 9px 'Mulmaru Mono', monospace; }
.deca-data-badge.live { border-color: var(--success); color: var(--success); }
.deca-data-badge.manual { border-color: var(--status-warning); color: var(--status-warning); }
.deca-control-detail { margin-top: 8px; color: var(--text-secondary); font-size: 10px; line-height: 1.5; }
.deca-results { margin-top: 12px; }
.deca-results.hidden { display: none; }
.deca-context-hidden { display: none !important; }
.deca-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.deca-metrics article { padding: 14px; border: 1px solid var(--border-default); border-radius: 13px; background: var(--surface-subtle); }
.deca-metrics span, .deca-metrics strong, .deca-metrics small { display: block; }
.deca-metrics span, .deca-metrics small { color: var(--text-secondary); font-size: 10px; }
.deca-metrics strong { margin: 8px 0 5px; color: var(--text-main); font: 18px 'Mulmaru Mono', monospace; }
#deca-gap-card strong { color: var(--status-danger); }
#deca-gap-card.positive strong { color: var(--success); }
.deca-chart-card { margin-top: 10px; padding: 16px; overflow: hidden; border: 1px solid var(--border-default); border-radius: 14px; background: var(--surface-subtle); }
.deca-chart-heading strong, .deca-chart-heading small { display: block; }
.deca-chart-heading small { margin-top: 4px; color: var(--text-secondary); font-size: 10px; font-weight: 400; }
.deca-legend { display: flex; flex-wrap: wrap; gap: 9px; color: var(--text-secondary); font-size: 10px; }
.deca-legend span::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 4px; border-radius: 2px; background: var(--legend-color); }
.deca-legend .buyer { --legend-color: var(--success); }
.deca-legend .seller { --legend-color: var(--primary); }
.deca-legend .current { --legend-color: var(--status-danger); }
#deca-value-chart { display: block; max-width: 100%; margin-top: 10px; }
.deca-verdict { display: flex; align-items: center; gap: 14px; margin-top: 10px; padding: 13px 15px; border: 1px solid var(--border-default); border-radius: 13px; background: var(--board-page-active-bg); }
.deca-verdict strong { flex: 0 0 auto; color: var(--primary); }
.deca-verdict span { color: var(--text-content); font-size: 11px; line-height: 1.55; }
.deca-disclaimer { margin: 12px 2px 0; color: var(--text-secondary); font-size: 9px; line-height: 1.55; }
@media (max-width: 1050px) {
    .deca-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .deca-input-grid { grid-template-columns: 1fr 1fr; }
    .deca-input-grid .btn { grid-column: 1 / -1; }
}
.now-explorer-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.now-table-pickers { flex: 1 1 100%; display: grid; grid-template-columns: minmax(150px, .65fr) minmax(190px, .85fr) minmax(260px, 1.5fr); gap: 10px; }
.now-table-pickers label { display: grid; gap: 3px; color: var(--text-secondary); font-size: 11px; }
.now-table-pickers select { width: 100%; min-width: 0; }
.now-table-pickers { flex-basis: calc(100% - 48px); }
.now-search-toggle { flex: 0 0 40px; align-self: end; }
.now-search-toggle[aria-expanded="true"] { border-color: var(--primary); background: var(--board-page-active-bg); color: var(--primary); }
.now-search-panel { margin-top: 10px; padding: 10px; border: 1px solid var(--border-default); border-radius: 14px; background: var(--surface-subtle); }
.now-search-panel.hidden { display: none; }
.now-search-controls { display: flex; align-items: center; gap: 8px; }
.now-search { flex: 1 1 auto; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--select-border); border-radius: 12px; background: var(--select-bg); color: var(--text-secondary); }
.now-search input { width: 100%; min-height: 42px; border: 0; outline: 0; background: transparent; color: var(--select-text); font: inherit; }
.now-global-results { margin-top: 10px; }
.now-global-results.hidden { display: none; }
.now-global-results-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; color: var(--text-secondary); font-size: 12px; }
.now-search-pagination { display: flex; align-items: center; gap: 8px; }
.now-global-results-list { display: grid; gap: 7px; max-height: 42vh; overflow-y: auto; }
.now-global-hit { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; width: 100%; padding: 10px 12px; border: 1px solid var(--select-border); border-radius: 10px; background: var(--card-bg); color: var(--text-main); text-align: left; cursor: pointer; }
.now-global-hit:hover { border-color: var(--primary); }
.now-global-hit small { grid-column: 1 / -1; color: var(--text-secondary); overflow-wrap: anywhere; }
.now-search-pages { white-space: nowrap; font-family: 'Mulmaru Mono', monospace; }
.now-row-highlight td { animation: now-row-highlight 7s ease-out; }
@keyframes now-row-highlight { 0%, 55% { background: var(--board-page-active-bg); } 100% { background: transparent; } }
.now-overview-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0 12px; padding: 8px 10px; border: 1px solid var(--border-default); border-radius: 12px; background: var(--surface-subtle); }
.now-source-status { min-width: 0; color: var(--text-secondary); font-size: 12px; }
.now-source-status strong { color: var(--text-main); }
.now-summary-grid { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.now-summary-chip { display: flex; align-items: baseline; gap: 5px; padding: 5px 8px; border: 1px solid var(--border-default); border-radius: 999px; background: var(--card-bg); color: var(--text-main); cursor: pointer; }
.now-summary-chip:hover, .now-summary-chip.active { border-color: var(--primary); background: var(--board-page-active-bg); }
.now-summary-grid span { color: var(--text-secondary); font-size: 10px; }
.now-summary-grid strong { font: 12px 'Mulmaru Mono', monospace; color: var(--text-main); }
.now-results { display: grid; gap: 16px; }
.now-result-notice { padding: 10px 12px; border-radius: 10px; background: var(--surface-subtle); color: var(--text-secondary); font-size: 12px; }
.now-table-section { min-width: 0; border: 1px solid var(--border-default); border-radius: 14px; overflow: hidden; background: var(--surface-subtle); }
.now-table-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border-default); }
.now-table-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.now-draw-btn { min-height: 30px; padding: 4px 8px; border: 1px solid var(--select-border); border-radius: 9px; background: var(--card-bg); color: var(--text-main); font: 11px 'Mulmaru Mono', monospace; cursor: pointer; }
.now-draw-btn:hover { border-color: var(--primary); background: var(--board-page-active-bg); }
.now-table-heading span, .now-table-heading strong { display: block; }
.now-table-heading span, .now-table-heading small { color: var(--text-secondary); font-size: 11px; }
.now-table-heading strong { margin-top: 3px; font-size: 14px; }
.now-table-scroll { overflow-x: auto; }
.now-data-table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 13px; }
.now-data-table th, .now-data-table td { padding: 10px 12px; border-right: 1px solid var(--border-default); border-bottom: 1px solid var(--border-default); text-align: center; white-space: pre-wrap; }
.now-data-table th { position: sticky; top: 0; background: var(--card-bg); color: var(--text-main); font-weight: 600; }
.now-data-table td { color: var(--text-content); }
.now-data-table th:last-child, .now-data-table td:last-child { border-right: 0; }
.now-data-table tbody tr:last-child td { border-bottom: 0; }
.now-data-table td:nth-last-child(2) { color: var(--status-warning); font-family: 'Mulmaru Mono', monospace; }
.now-change-column { width: 64px; }
.now-cell-changed del, .now-cell-changed ins { display: block; padding: 2px 4px; text-decoration: none; }
.now-cell-changed del { color: var(--status-danger); }
.now-cell-changed ins { color: var(--success); }
.now-entry { padding: 14px 16px; border: 1px solid var(--border-default); border-radius: 14px; background: var(--surface-subtle); }
.now-entry-head { display: flex; justify-content: space-between; gap: 10px; }
.now-entry-path { color: var(--text-secondary); font-size: 12px; }
.now-entry h3 { margin: 6px 0; font-size: 15px; }
.now-entry-value, .now-diff { color: var(--text-content); font-family: 'Mulmaru Mono', monospace; overflow-wrap: anywhere; }
.now-diff { display: grid; gap: 5px; }
.now-diff del, .now-diff ins { padding: 7px 9px; border-radius: 8px; text-decoration: none; }
.now-diff del { color: var(--status-danger); background: var(--surface-soft); }
.now-diff del::before { content: '- '; }
.now-diff ins { color: var(--success); background: var(--surface-soft); }
.now-diff ins::before { content: '+ '; }
.now-change-badge { padding: 3px 7px; border: 1px solid var(--border-default); border-radius: 999px; font-size: 11px; }
.now-change-added { color: var(--success); }
.now-change-removed { color: var(--status-danger); }
.modal > .probability-draw-modal-content { width: min(880px, 90vw); max-width: 880px; }
.desktop-tool-mobile-notice { display: none; }
#app-confirm-modal { z-index: 7000; }
.modal > .app-confirm-modal-content { width: min(420px, calc(100vw - 32px)); padding: 26px; }
.app-confirm-modal-content h2 { color: var(--text-main); font-size: 18px; }
.app-confirm-modal-content p { margin-top: 12px; color: var(--text-secondary); line-height: 1.6; white-space: pre-line; }
.app-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.probability-draw-title-row { display: flex; align-items: center; gap: 8px; }
.probability-help { position: relative; display: inline-flex; }
.probability-help-trigger { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 1px solid var(--select-border); border-radius: 50%; background: var(--surface-subtle); color: var(--text-secondary); font-weight: 700; cursor: help; }
.probability-help-trigger:hover, .probability-help-trigger:focus-visible { border-color: var(--primary); color: var(--primary); outline: none; }
.probability-help-tooltip { position: absolute; z-index: 5; top: calc(100% + 8px); left: 0; display: none; width: min(430px, 70vw); padding: 12px 14px; border: 1px solid var(--border-default); border-radius: 12px; background: var(--card-bg); color: var(--text-content); box-shadow: var(--popover-shadow); font-size: 12px; line-height: 1.55; }
.probability-help-tooltip strong, .probability-help-tooltip span { display: block; }
.probability-help-tooltip strong { margin-bottom: 6px; color: var(--text-main); }
.probability-help-tooltip span + span { margin-top: 5px; }
.probability-help:hover .probability-help-tooltip, .probability-help:focus-within .probability-help-tooltip { display: block; }
.probability-draw-results { display: grid; gap: 8px; margin-top: 14px; }
.probability-draw-mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 14px; padding: 4px; border-radius: 12px; background: var(--surface-subtle); }
.probability-draw-mode { min-height: 38px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--text-secondary); cursor: pointer; }
.probability-draw-mode.active { border-color: var(--primary); background: var(--card-bg); color: var(--text-main); }
.probability-draw-controls { margin-top: 10px; }
.probability-draw-controls > .probability-draw-target-fieldset { margin-bottom: 10px; }
.probability-draw-mode-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
#probability-draw-target-mode { grid-template-columns: 1fr; justify-items: end; }
.probability-draw-mode-panel.hidden { display: none; }
.probability-draw-controls label { display: grid; gap: 5px; color: var(--text-secondary); font-size: 11px; }
.probability-draw-controls input, .probability-draw-controls select { width: 100%; min-height: 40px; border: 1px solid var(--select-border); border-radius: 10px; background: var(--select-bg); color: var(--select-text); padding: 7px 10px; }
.probability-draw-target-fieldset { min-width: 0; margin: 0; padding: 9px 10px; border: 1px solid var(--select-border); border-radius: 10px; }
.probability-draw-target-fieldset legend { padding: 0 5px; color: var(--text-secondary); font-size: 11px; }
.probability-draw-targets { display: grid; gap: 8px; max-height: 220px; overflow-y: auto; }
.probability-draw-target-group { display: grid; gap: 6px; padding: 8px; border: 1px solid var(--border-default); border-radius: 9px; background: var(--surface-subtle); }
.probability-draw-target-group-heading { display: flex; min-height: 22px; align-items: center; justify-content: space-between; gap: 10px; }
.probability-draw-target-group-heading > strong { color: var(--text-main); font-size: 12px; }
.probability-draw-target-group .probability-draw-target-all { padding: 3px 7px; border: 0; background: transparent; color: var(--text-secondary); }
.probability-draw-target-items { display: flex; flex-wrap: wrap; gap: 6px; }
.probability-draw-targets label { display: flex; grid-template-columns: none; flex-direction: row; align-items: center; gap: 5px; padding: 5px 8px; border: 1px solid var(--border-default); border-radius: 999px; background: var(--card-bg); color: var(--text-main); cursor: pointer; }
.probability-draw-targets input { width: auto; min-height: 0; margin: 0; }
.probability-draw-session-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.probability-draw-session-stats div { padding: 8px 10px; border: 1px solid var(--border-default); border-radius: 9px; background: var(--card-bg); }
.probability-draw-session-stats span, .probability-draw-session-stats strong { display: block; }
.probability-draw-session-stats span { color: var(--text-secondary); font-size: 10px; }
.probability-draw-session-stats strong { margin-top: 3px; color: var(--text-main); font: 13px 'Mulmaru Mono', monospace; }
.probability-draw-session-stats small { display: block; margin-top: 5px; color: var(--text-secondary); font-size: 9px; line-height: 1.45; }
.probability-draw-summary { color: var(--text-secondary); font-size: 12px; }
.probability-draw-result-group { display: grid; gap: 7px; }
.probability-draw-result-group h4 { margin: 5px 2px 0; color: var(--text-secondary); font-size: 11px; font-weight: 700; }
.probability-draw-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid var(--border-default); border-radius: 10px; background: var(--surface-subtle); }
.probability-draw-row.highlighted { border-color: var(--primary); background: var(--board-page-active-bg); }
.probability-draw-row.matched { border-width: 2px; box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 18%, transparent); }
.probability-draw-row strong { color: var(--text-main); }
.probability-draw-row strong em { display: inline-flex; margin-left: 8px; padding: 2px 6px; border-radius: 999px; background: var(--primary); color: var(--button-text); font-size: 10px; font-style: normal; vertical-align: middle; }
.probability-draw-row span { color: var(--primary); font: 14px 'Mulmaru Mono', monospace; white-space: nowrap; }
.now-change-changed { color: var(--status-warning); }
.now-empty { padding: 42px 16px; border: 1px dashed var(--border-default); border-radius: 14px; color: var(--text-secondary); text-align: center; }
@media (max-width: 768px) {
    #toolbox-btn,
    #mobile-toolbox-btn { display: none !important; }
    #toolbox-modal > .toolbox-modal-content,
    #probability-draw-modal > .probability-draw-modal-content { display: none !important; }
    #toolbox-modal > .desktop-tool-mobile-notice,
    #probability-draw-modal > .desktop-tool-mobile-notice {
        display: grid;
        width: min(420px, calc(100vw - 32px));
        gap: 10px;
        justify-items: center;
        padding: 28px 22px;
        border: 1px solid var(--border-default);
        border-radius: 16px;
        background: var(--card-bg);
        color: var(--text-main);
        text-align: center;
    }
    .desktop-tool-mobile-notice > span { font-size: 30px; }
    .desktop-tool-mobile-notice > p { color: var(--text-secondary); font-size: 12px; }
    .desktop-tool-mobile-notice > .btn { margin-top: 4px; }
}

:root {
    --bg-dark: #242428;
    --card-bg: #2d2d32;
    --primary: #6558F2;
    --primary-glow: rgba(101, 88, 242, 0.4);
    --btn-primary-bg: var(--primary);
    --btn-primary-border: var(--primary);
    --btn-primary-text: #fff;
    --btn-primary-shadow: var(--primary-glow);
    --secondary: #64748b;
    --text-main: #f8fafc;
    --text-secondary: #a1a1aa;
    --accent: #e83187;
    --accent-glow: rgba(232, 49, 135, 0.4);
    --danger: #e83187;
    --glass: rgba(45, 45, 50, 0.7);
    --surface-subtle: var(--white-04);
    --surface-soft: var(--white-06);
    --border-default: var(--white-10);
    --text-muted: #aaa;
    --text-soft: #ccc;
    --text-faint: #888;
    --text-content: #e0e0e0;
    --info: #60a5fa;
    --success: #4caf50;
    --status-warning: #fbbf24;
    --status-danger: #ef5350;
    --rune-grade-advanced: #54c884;
    --rune-grade-rare: #55a0ff;
    --rune-grade-elite: #9a7cff;
    --rune-grade-epic: #ff65b3;
    --rune-grade-legendary: #ff7852;
    --rune-grade-unique: #d1d5db;
    --rune-grade-origin: #c88732;
    --rune-grade-mythic: #ffc94a;
    --graph-edge: rgba(148,163,184,.3);
    --graph-edge-highlight: rgba(148,163,184,.6);
    --graph-label: #9ca3af;
    --white: #fff;
    --white-04: rgba(255,255,255,.04);
    --white-05: rgba(255,255,255,.05);
    --white-06: rgba(255,255,255,.06);
    --white-08: rgba(255,255,255,.08);
    --white-10: rgba(255,255,255,.1);
    --white-15: rgba(255,255,255,.15);
    --panel-inset-bg: rgba(7,7,10,.35);
    --panel-inset-border: transparent;
    --panel-item-bg: #3c3c48;
    --panel-item-border: transparent;
    --panel-progress-track: var(--white-08);
    --panel-progress-start: var(--primary);
    --panel-progress-end: #a797ff;
    --party-view-toggle-bg: var(--surface-subtle);
    --party-view-toggle-border: var(--border-default);
    --party-view-toggle-text: var(--text-secondary);
    --party-view-toggle-track: var(--surface-soft);
    --party-view-toggle-thumb: var(--text-secondary);
    --party-view-toggle-track-active: var(--primary);
    --party-view-toggle-thumb-active: var(--btn-primary-text);
    --party-view-toggle-focus: var(--select-focus-shadow);
    --table-divider: rgba(255,255,255,.055);
    --popover-bg: #15151c;
    --popover-border: rgba(255,255,255,.14);
    --popover-shadow: 0 22px 60px rgba(0,0,0,.55);
    --select-color-scheme: dark;
    --native-option-bg: #1e1e2d;
    --native-option-text: var(--text-main);
    --select-bg: #181820;
    --select-border: rgba(255, 255, 255, 0.16);
    --select-text: var(--text-main);
    --select-hover-border: rgba(101, 88, 242, 0.5);
    --select-focus-border: var(--primary);
    --select-focus-shadow: rgba(101, 88, 242, 0.25);
    --modal-header-padding-top: 24px;
    --user-card-bg: #191920;
    --user-card-text: #f5f4fa;
    --user-card-muted: #c7c5cf;
    --user-card-subtle: #aaa7b5;
    --user-card-item-bg: rgba(255,255,255,.035);
    --user-card-item-border: rgba(255,255,255,.07);
    --user-card-avatar-border: var(--user-card-bg);
    --user-card-avatar-bg: #302e46;
    --user-card-identity-bg: var(--user-card-bg);
    --user-card-identity-border: transparent;
    --user-card-status-bg: rgba(25,25,32,.92);
    --user-card-status-border: rgba(255,255,255,.16);
    --user-card-status-text: var(--text-main);
    --user-card-status-shadow: rgba(0,0,0,.26);
    --user-card-power-track: rgba(255,255,255,.09);
    --user-card-power-start: #6558f2;
    --user-card-power-end: #e565a8;
    --chat-panel-bg: rgba(20,18,40,.97);
    --chat-panel-border: var(--white-10);
    --chat-panel-shadow: 0 12px 48px rgba(0,0,0,.6);
    --chat-header-bg: rgba(101,88,242,.15);
    --chat-header-border: rgba(255,255,255,.07);
    --chat-assistant-bg: rgba(255,255,255,.07);
    --chat-assistant-border: transparent;
    --chat-user-bg: linear-gradient(135deg,#6558f2,#a855f7);
    --chat-user-border: transparent;
    --chat-input-area-bg: transparent;
    --chat-input-bg: var(--white-06);
    --chat-input-border: rgba(255,255,255,.12);
    --header-control-bg: var(--white-10);
    --header-control-border: transparent;
    --header-control-text: var(--text-secondary);
    --header-control-hover-bg: var(--white-15);
    --header-control-hover-border: transparent;
    --header-control-hover-text: var(--text-main);
    --board-reading-bg: rgba(27,27,35,.76);
    --board-reading-border: rgba(255,255,255,.085);
    --board-reading-divider: rgba(255,255,255,.075);
    --board-reading-comments-bg: rgba(10,10,14,.2);
    --board-reading-text: #dcdae3;
    --board-reading-heading: #fff;
    --board-reading-muted: #bbb8c7;
    --board-reading-subtle: #777482;
    --board-reading-input-bg: rgba(8,8,11,.42);
    --board-reading-link: #a9a4d1;
    --board-page-active-bg: rgba(101,88,242,.24);
    --board-page-active-border: rgba(145,135,255,.72);
    --board-page-active-text: #f8f7ff;
    --badge-admin-bg: #493f27;
    --badge-admin-border: #6a5931;
    --badge-admin-text: #e1c26e;
    --badge-master-bg: #453448;
    --badge-master-border: #654b69;
    --badge-master-text: #d6b8d9;
    --badge-submaster-bg: #283f4c;
    --badge-submaster-border: #3c5d6e;
    --badge-submaster-text: #a9cbd9;
    --badge-user-bg: #36363e;
    --badge-user-border: #4a4a55;
    --badge-user-text: #c4c3ca;
    --badge-newbie-bg: #213c2f;
    --badge-newbie-border: #2e6648;
    --badge-newbie-text: #6ee7b7;
    --badge-away-bg: var(--badge-user-bg);
    --badge-away-border: var(--badge-user-border);
    --badge-away-text: var(--text-muted);
    --badge-board-notice-bg: var(--badge-admin-bg);
    --badge-board-notice-text: var(--badge-admin-text);
    --badge-board-free-bg: #35324a;
    --badge-board-free-text: #c5bfdf;
    --user-tag-border: var(--white-10);
    --bottom-nav-item-text: var(--text-secondary);
    --bottom-nav-item-hover-text: var(--text-main);
    --bottom-nav-item-hover-bg: var(--white-06);
    --bottom-nav-item-pressed-bg: var(--white-15);
    --bottom-nav-item-selected-bg: var(--panel-item-bg);
    --modal-scrollbar-thumb: rgba(170,167,181,.58);
    --modal-radius: 24px;
    --modal-neutral-border: var(--white-10);
    --modal-panel-bg: var(--surface-subtle);
    --modal-row-bg: var(--white-04);
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --mobile-bottom-nav-height: 66px;
    --login-page-background-image: url('images/login_page_dark.webp');
    --login-page-background-position: 75% 75%;
    --login-page-alternate-image: url('images/login_page_dark_2.webp');
    --login-page-alternate-position: 25% 20%;
    --login-page-alternate-size: cover;
    --login-page-third-image: none;
    --login-page-third-position: center;
    --login-page-third-size: cover;
    --login-page-fourth-image: none;
    --login-page-fourth-position: center;
    --login-page-fourth-size: cover;
    --login-dark-animation-delay: 0s;
    --login-light-animation-delay: 0s;
    --login-features-mobile-filter: transparent;
    --login-page-overlay-start: color-mix(in srgb, var(--bg-dark) 27%, transparent);
    --login-page-overlay-end: color-mix(in srgb, var(--bg-dark) 55%, transparent);
}

html { scrollbar-gutter: stable; }
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Paperlogy-4Regular', sans-serif; }
.hidden,
#welcome-section.hidden,
#dashboard-section.hidden,
#user-profile.hidden,
#user-name.hidden,
#bottom-nav.hidden,
.modal.hidden { 
    display: none !important; 
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(101, 88, 242, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(232, 49, 135, 0.1) 0px, transparent 50%);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 0;
    border-bottom: 1px solid var(--white-10);
}

.logo-area { 
    display: flex; 
    align-items: center; 
}

h1 { 
    display: flex;
    align-items: center;
    gap: 4px; /* 이모지와 텍스트 사이 간격 최소화 */
    font-size: 1.5rem; 
    font-weight: 700; 
    letter-spacing: -0.025em; 
    margin: 0;
}

.logo-icon { 
    font-size: 2.25rem; /* 정확히 36px */
    display: inline-flex;
    align-items: center;
    line-height: 0; 
    height: auto;
    transform: translateY(-6px); /* 게임기 이모지만의 하단 치우침 보정 */
}

#user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.auth-area { display: flex; align-items: center; gap: 20px; }
.badge { font-size: 0.8rem; background: var(--card-bg); padding: 4px 12px; border-radius: 20px; color: var(--text-secondary); border: 1px solid var(--white-05); }

/* Hero Section */
.hero-section {
    padding: 100px 0;
    text-align: center;
    animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-title {
    font-family: 'Inter', sans-serif;
    font-size: 4.5rem; /* Slightly larger for impact */
    line-height: 1.05;
    font-weight: 800;
    margin-bottom: 24px;
    letter-spacing: -0.05em;
}

.highlight {
    background: linear-gradient(90deg, #6558F2, #e83187);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-family: 'Paperlogy-2ExtraLight', sans-serif;
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 48px;
    text-align: center;
    opacity: 0.8; /* 좀 더 톤 다운 */
}

p {
    text-align: left;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Buttons */
.btn {
    font-family: 'Paperlogy-6SemiBold', sans-serif;
    padding: 10px 24px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: normal;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-primary { background: var(--btn-primary-bg); color: var(--btn-primary-text); box-shadow: 0 4px 15px var(--btn-primary-shadow); }
.btn-primary:hover { transform: scale(1.02); filter: brightness(1.1); }

.btn-secondary { background: var(--white-10); color: var(--text-secondary); }
.btn-secondary:hover { background: var(--white-15); }

.btn-call { 
    background: #7c3aed; /* 비비드 퍼플 */
    color: white; 
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
    border: 1px solid rgba(124, 58, 237, 0.5);
}
.btn-call:hover {
    background: #8b5cf6;
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.6);
    transform: translateY(-2px);
}

.btn-lg { padding: 18px 40px; font-size: 1.1rem; border-radius: 16px; }

/* Dashboard */
/* Week Navigator */
.week-navigator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 40px 0 24px;
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 16px;
    padding: 12px 8px;
    gap: 12px;
}

.week-nav-btn {
    background: rgba(101, 88, 242, 0.15);
    border: 1px solid rgba(101, 88, 242, 0.3);
    color: var(--primary);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.week-nav-btn:hover {
    background: rgba(101, 88, 242, 0.3);
    transform: scale(1.05);
    box-shadow: 0 0 12px var(--primary-glow);
}

.week-label-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.week-label {
    font-family: 'Paperlogy-7Bold', sans-serif;
    font-size: 1.1rem;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.week-range {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* Day group headers */
.day-group-header {
    grid-column: 1 / -1;
    padding: 8px 4px 4px;
    font-family: 'Paperlogy-6SemiBold', sans-serif;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--white-06);
    margin-top: 8px;
    letter-spacing: 0.02em;
}

.day-group-header.today-header {
    color: var(--primary);
    border-bottom-color: rgba(101, 88, 242, 0.3);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding-bottom: 60px;
}

.party-card {
    --party-card-accent-width: 2px;
    --party-card-accent-gradient: linear-gradient(var(--primary), transparent 70%);
    background: var(--card-bg);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid var(--white-05);
    transition: all 0.3s ease;
}

.party-card:hover { border-color: var(--primary); box-shadow: 0 10px 30px rgba(0,0,0,0.3); }

.card-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 16px; 
}

.game-title { 
    font-family: 'Inter', sans-serif;
    font-weight: 700; 
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.game-title-block {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
}

.game-title-block .game-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.difficulty-badge {
    font-family: 'Paperlogy-6SemiBold', sans-serif;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(232, 49, 135, 0.12);
    color: var(--accent);
    border: 1px solid rgba(232, 49, 135, 0.3);
    white-space: nowrap;
}

.difficulty-badge--hard {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.4);
}

.difficulty-badge--extreme {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(236, 72, 153, 0.2));
    color: #ff4a4a;
    border: 1px solid rgba(239, 68, 68, 0.5);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
    font-weight: 700;
}

.status-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 8px;
    font-family: 'Paperlogy-6SemiBold', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.status-open {
    color: var(--primary);
    background: rgba(101, 88, 242, 0.1);
    border: 1px solid rgba(101, 88, 242, 0.3);
}

.status-full {
    color: var(--accent);
    background: rgba(232, 49, 135, 0.1);
    border: 1px solid rgba(232, 49, 135, 0.3);
}

.status-expired {
    color: var(--text-secondary);
    background: var(--white-05);
    border: 1px solid var(--white-10);
}

.status-awaiting {
    color: #f5c451;
    background: rgba(245, 196, 81, 0.1);
    border: 1px solid rgba(245, 196, 81, 0.35);
}

.status-completed {
    color: #62d99b;
    background: rgba(98, 217, 155, 0.1);
    border: 1px solid rgba(98, 217, 155, 0.35);
}

/* 종료/해체된 파티 카드: 흐리게 표시 */
.party-card--expired {
    opacity: 0.55;
    filter: grayscale(0.4);
}
.party-card--expired:hover {
    opacity: 0.75;
    filter: grayscale(0.2);
    border-color: var(--white-15);
}

.party-date { 
    color: var(--text-secondary); 
    font-size: 0.85rem; 
    margin-bottom: 20px; 
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.party-date-main { min-width: 0; white-space: nowrap; }

.edit-date-btn {
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--white-05);
    transition: all 0.2s ease;
    filter: grayscale(1);
}

.edit-date-btn:hover {
    background: var(--white-15);
    transform: scale(1.1);
    filter: grayscale(0);
}

.member-info { padding: 16px; border: 1px solid var(--panel-inset-border); border-radius: 12px; margin-bottom: 20px; background: var(--panel-inset-bg); }
.member-count { font-weight: 600; font-size: 0.9rem; margin-bottom: 10px; }
.member-list { display: flex; flex-wrap: wrap; gap: 8px; }
.member-tag { padding: 4px 10px; border: 1px solid var(--panel-item-border); border-radius: 6px; background: var(--panel-item-bg); font-size: 0.75rem; }
.leader-tag { background: var(--primary); font-weight: 700; }

.card-actions {
    display: flex;
    gap: 8px;
    width: 100%;
}

.card-actions .btn { 
    flex: 1; 
    justify-content: center; 
}

/* 특수 파티 이모지 아이콘 공용 규격 (온보딩, 이벤트 등) */
.party-special-icon,
.party-title-sprout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25em;
    line-height: 1;
    cursor: help;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.party-special-icon:hover,
.party-title-sprout:hover {
    transform: scale(1.22);
}

.party-manage-menu { position: relative; z-index: 4; }
.party-manage-menu[open] { z-index: 30; }
.party-manage-menu summary {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 8px;
    color: var(--text-secondary);
    background: var(--white-06);
    cursor: pointer;
    font-size: 1.15rem;
    line-height: 1;
    list-style: none;
}
.party-manage-menu summary::-webkit-details-marker { display: none; }
.party-manage-menu summary:hover { color: var(--text-main); background: rgba(255,255,255,0.12); }
.party-manage-popover {
    position: absolute;
    top: 36px;
    right: 0;
    display: grid;
    width: 180px;
    overflow: hidden;
    border: 1px solid var(--popover-border);
    border-radius: 10px;
    background: var(--popover-bg);
    box-shadow: var(--popover-shadow);
}
.party-manage-menu.overflow-menu--up .party-manage-popover {
    top: auto;
    bottom: 36px;
}
.party-manage-popover button {
    padding: 11px 13px;
    border: 0;
    color: var(--text-main);
    background: transparent;
    cursor: pointer;
    text-align: left;
}
.party-manage-popover button:hover { background: var(--white-08); }
.party-manage-popover .party-manage-danger { color: #ff7777; }
.party-manage-popover .party-manage-complete { color: #168b50; font-weight: 800; }
.party-card--resolved {
    opacity: 0.55;
    filter: grayscale(0.4);
    border-color: rgba(98, 217, 155, 0.28);
}
.party-card--resolved:hover { opacity: 0.75; filter: grayscale(0.2); }

.party-members-modal-content { width: min(560px, calc(100vw - 32px)); max-height: min(760px, 90dvh); overflow-y: auto; }
.party-members-modal-header, .party-members-section-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.party-members-modal-header .modal-header-close { margin-left: auto; }
.party-members-modal-header h2 { margin: 4px 0 0; }
.party-members-section { margin-top: 22px; }
.party-members-section-title { margin-bottom: 9px; color: var(--text-secondary); font-size: 0.82rem; }
.party-members-edit-list, .party-member-search-results { display: grid; gap: 7px; }
.party-member-edit-row {
    display: flex;
    min-height: 50px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 11px;
    border: 1px solid var(--white-08);
    border-radius: 11px;
    background: var(--surface-subtle);
}
.party-member-edit-row span { display: grid; min-width: 0; gap: 2px; }
.party-member-edit-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.86rem; }
.party-member-edit-row small { color: var(--text-secondary); font-size: 0.67rem; }
.party-member-edit-row button { flex-shrink: 0; padding: 7px 10px; border: 0; border-radius: 8px; cursor: pointer; font-weight: 700; }
.party-member-remove { color: #ff8585; background: rgba(255,90,90,0.1); }
.party-member-add { color: #7fe2ae; background: rgba(98,217,155,0.12); }
.party-member-search {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 0 12px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 11px;
    background: rgba(7,7,10,0.34);
}
.party-member-search:focus-within { border-color: rgba(124,108,255,0.55); box-shadow: 0 0 0 3px rgba(124,108,255,0.1); }
.party-member-search input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--text-main); background: transparent; }
.party-member-search-hint { padding: 18px 8px; color: var(--text-secondary); text-align: center; font-size: 0.8rem; }

.btn-leave { background: var(--danger); color: white; }
.btn-join { background: var(--accent); color: white; width: 100% !important; }

/* Modal */
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); display: flex; align-items: center; justify-content: center;
    z-index: 2000; backdrop-filter: blur(5px);
}

.modal-content {
    --modal-scroll-edge-offset: 32px;
    position: relative;
    background: var(--card-bg); 
    padding: var(--modal-header-padding-top) 40px 40px;
    border-radius: var(--modal-radius);
    width: 92vw; 
    max-width: 520px;
    border: 1px solid var(--white-10);
    min-height: 0;
    max-height: calc(100dvh - 32px);
    overflow: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.modal-scroll-body::-webkit-scrollbar,
.admin-body::-webkit-scrollbar,
.board-editor::-webkit-scrollbar,
.board-editor-toolbar::-webkit-scrollbar,
.board-editor-modal-content::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.modal-scroll-body::-webkit-scrollbar-track,
.admin-body::-webkit-scrollbar-track,
.board-editor::-webkit-scrollbar-track,
.board-editor-toolbar::-webkit-scrollbar-track,
.board-editor-modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-scroll-body::-webkit-scrollbar-track {
    margin-block: var(--modal-radius);
}

.modal-scroll-body::-webkit-scrollbar-thumb,
.admin-body::-webkit-scrollbar-thumb,
.board-editor::-webkit-scrollbar-thumb,
.board-editor-toolbar::-webkit-scrollbar-thumb,
.board-editor-modal-content::-webkit-scrollbar-thumb {
    border: 3px solid transparent;
    border-radius: 999px;
    background: var(--modal-scrollbar-thumb);
    background-clip: padding-box;
}

.modal-scroll-body,
.admin-body,
.board-editor,
.board-editor-toolbar,
.board-editor-modal-content {
    scrollbar-width: thin;
    scrollbar-color: var(--modal-scrollbar-thumb) transparent;
}

.modal-content.modal-scroll-framed {
    display: flex;
    min-height: 0;
    flex-direction: column;
}

.modal-scroll-body {
    min-height: 0;
    flex: 1 1 auto;
    margin-right: calc(-1 * var(--modal-scroll-edge-offset));
    padding-right: var(--modal-scroll-edge-offset);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.modal-content h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    font-family: 'Inter', sans-serif;
}

.emoji-icon {
    display: inline-flex;
    align-items: center;
    line-height: 0;
    transform: translateY(-6px);
    font-size: 2.5rem; /* 이모지 사이즈 대폭 확대 */
}

.form-group { margin-bottom: 12px; }
.form-group label { display: block; margin-bottom: 4px; color: var(--text-muted); font-size: 0.85rem; }
.form-group input {
    width: 100%; flex: 1; min-width: 0; padding: 12px; border-radius: 10px; background: rgba(0,0,0,0.2);
    border: 1px solid var(--white-10); color: white;
}
select, .form-group select {
    color-scheme: var(--select-color-scheme, dark);
    width: 100%; flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px;
    background-color: var(--select-bg); border: 1px solid var(--select-border); color: var(--select-text);
    font-family: inherit; font-size: 0.88rem; outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}
select:hover, .form-group select:hover {
    border-color: var(--select-hover-border);
}
select:focus, .form-group select:focus {
    border-color: var(--select-focus-border);
    box-shadow: 0 0 0 3px var(--select-focus-shadow);
}
select option, optgroup, option {
    color-scheme: var(--select-color-scheme, dark);
    background-color: var(--native-option-bg) !important;
    color: var(--native-option-text) !important;
}
.form-group input[type="datetime-local"] { color-scheme: dark; cursor: pointer; }
.form-group input[type="datetime-local"]::-webkit-calendar-picker-indicator { display: block; opacity: 0.82; cursor: pointer; filter: invert(1) brightness(1.35); }
.form-group input[type="datetime-local"]:hover { border-color: rgba(124,108,255,0.48); }
.form-group input[type="datetime-local"]:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(101,88,242,0.12); }

.modal-actions { display: flex; gap: 12px; margin-top: 30px; }
.modal-actions .btn { flex: 1; }
.modal-actions--compact { gap: 8px; }

/* Reusable visual utilities. Values mirror the legacy inline declarations. */
.field-note { opacity: .6; font-size: .8em; }
.field-character-count { display: block; margin-top: 4px; color: var(--text-secondary); font-family: 'Mulmaru Mono', monospace; font-size: 0.7rem; line-height: 1.25; text-align: right; }
.resize-y { resize: vertical; }
.modal-content--550 { max-width: 550px; }
.modal-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-header-row h2 { margin: 0; }
.modal-header-shell {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 0;
    border-bottom: 0;
    margin-bottom: 18px;
}
.modal-header-shell > div {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
}
.modal-header-shell h2,
.modal-header-row h2,
.party-members-modal-header h2,
.admin-header h2,
.leaderboard-header h2 {
    margin: 0;
    font-family: 'Paperlogy-7Bold', sans-serif;
    font-size: clamp(1.35rem, 2vw, 1.7rem);
    line-height: 1.2;
    letter-spacing: -0.03em;
    display: block;
}
.modal-header-shell p,
.modal-header-row p,
.party-members-modal-header p,
.admin-header p,
.leaderboard-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.81rem;
    line-height: 1.45;
    text-align: left;
}
.modal-header-shell .section-kicker,
.modal-header-row .section-kicker,
.party-members-modal-header .section-kicker,
.admin-header .section-kicker,
.leaderboard-header .section-kicker {
    margin: 0 0 2px;
    display: inline-block;
    letter-spacing: 0.14em;
}
.modal-description { margin-bottom: 16px; color: var(--text-muted); font-size: .85rem; line-height: 1.4; }
.form-group--medium { margin-bottom: 16px; }
.form-label--soft { color: var(--text-soft) !important; }
.readonly-accent { color: var(--accent) !important; background: var(--surface-soft) !important; font-weight: 600; }
.form-capacity-display { padding: 10px; border: 1px solid var(--border-default); border-radius: var(--radius-sm); color: var(--info); background: var(--surface-soft); font-size: .95rem; font-weight: 600; }
.inline-add-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.inline-add-row .btn { flex: 0 0 auto; white-space: nowrap; }
.muted-empty { opacity: .7; }
.member-tag--spaced { margin-right: 6px; }
.admin-toolbar--stats { align-items: center; margin-bottom: 16px; }
.admin-toolbar--participation { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.admin-toolbar--participation .admin-search-input { min-width: 220px; flex: 1 1 200px; }
.admin-date-range-wrap { display: inline-flex; align-items: center; gap: 4px; }
.admin-date-range-wrap.hidden { display: none !important; }
.admin-date-input { min-width: 130px !important; flex: 0 0 auto !important; padding: 6px 8px; font-size: 0.82rem; color-scheme: dark light; }
.admin-date-separator { color: var(--text-secondary); font-size: 0.85rem; font-weight: 600; padding: 0 2px; }
.admin-threshold-input-wrap { display: inline-flex; align-items: center; gap: 4px; }
.admin-threshold-input-wrap .admin-input-number { width: 64px; text-align: center; padding-inline: 4px; }
.admin-threshold-unit { color: var(--text-secondary); font-size: 0.85rem; font-weight: 500; }
.admin-status--danger { display: inline-block; padding: 2px 6px; border-radius: 4px; background: rgba(232, 49, 135, 0.15); color: #fb80b8; font-size: 0.78rem; font-weight: 600; }
.sortable-th { cursor: pointer; user-select: none; transition: background 0.15s ease-in-out; }
.sortable-th:hover { background: rgba(255, 255, 255, 0.08) !important; }
.sort-icon { font-size: 0.72rem; opacity: 0.4; margin-left: 2px; }
.sort-icon.active { opacity: 1; color: var(--info, #7c6cff); font-weight: bold; }
.admin-toolbar-label { display: flex; align-items: center; gap: 6px; font-size: .9rem; font-weight: 600; }
.status-board-view { margin-top: 16px; }
.status-toolbar-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.status-filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1 1 auto; }
.status-filter-group .admin-search-input { min-width: 240px; flex: 1 1 220px; }
.status-summary-badge-wrap { display: inline-flex; align-items: center; margin-left: auto; }
.status-pill-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 20px; background: var(--surface-subtle, rgba(255, 255, 255, 0.08)); border: 1px solid var(--border-default, rgba(255, 255, 255, 0.12)); font-size: 0.82rem; color: var(--text-secondary); font-weight: 500; }
.status-pill-badge strong { color: var(--text-main, #fff); font-weight: 700; }
.status-user-cell { display: flex; align-items: center; gap: 6px; }
.status-role-icon-badge {
    width: 22px;
    height: 22px;
    display: inline-grid;
    flex: 0 0 22px;
    place-items: center;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: inset 0 1px 0 var(--white-08);
    text-transform: uppercase;
    flex-shrink: 0;
}
.status-role-icon-badge.master {
    background: var(--badge-master-bg);
    color: var(--badge-master-text);
    border: 1px solid var(--badge-master-border);
}
.status-role-icon-badge.submaster {
    background: var(--badge-submaster-bg);
    color: var(--badge-submaster-text);
    border: 1px solid var(--badge-submaster-border);
}
.status-role-icon-badge.admin {
    background: var(--badge-user-bg);
    color: var(--badge-user-text);
    border: 1px solid var(--badge-user-border);
}
.status-role-icon-badge.user {
    background: var(--badge-user-bg);
    color: var(--badge-user-text);
    border: 1px solid var(--badge-user-border);
}
.status-role-icon-badge.newbie {
    background: var(--badge-newbie-bg);
    color: var(--badge-newbie-text);
    border: 1px solid var(--badge-newbie-border);
}
.status-role-icon-badge.away {
    background: var(--badge-away-bg);
    color: var(--badge-away-text);
    border: 1px solid var(--badge-away-border);
}
.status-role-icon-badge.blacklisted {
    background: rgba(239, 83, 80, 0.25);
    color: var(--status-danger);
    border: 1px solid rgba(239, 83, 80, 0.5);
}

.admin-week-nav { margin-left: auto; padding: 2px 8px; }
.admin-week-label-area { padding: 0 8px; }
.admin-week-label { font-size: .85rem; }
.admin-week-range { font-size: .75rem; }
.kb-section-nav { margin-bottom: 16px; }
.kb-toolbar--compact { display: flex; gap: 10px; margin-bottom: 16px; }
.kb-toolbar--centered { align-items: center; }
.kb-card-form { margin-bottom: 16px; padding: 14px; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--surface-subtle); }
.kb-card-form-title { margin: 0 0 12px; }
.admin-form-actions--row { display: flex; justify-content: flex-end; gap: 8px; }
.kb-subtitle.kb-subtitle--grow { flex-grow: 1; color: var(--text-muted); font-size: .85rem; }
.admin-data-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.admin-data-table thead tr { color: var(--text-soft); background: var(--white-05); }
.summary-table.admin-data-table th { padding: 10px; text-align: left; }
.status-data-table { table-layout: fixed !important; width: 100%; }
.admin-data-table .col-role,
.status-data-table th.col-role,
.status-data-table td.status-role-cell { width: 52px !important; min-width: 52px !important; max-width: 52px !important; box-sizing: border-box; text-align: center; white-space: nowrap; padding: 10px !important; }
.status-data-table .col-message,
.status-data-table th.col-message,
.status-data-table td.col-message {
    min-width: 0;
    box-sizing: border-box;
}
.status-data-table .col-message .status-message-trigger {
    display: block;
    width: 100%;
    border: 0;
    padding: 0 0 0 8px;
    background: transparent;
    text-align: left;
    color: inherit;
    cursor: pointer;
}
.status-data-table .col-message .status-message-trigger:hover,
.status-data-table .col-message .status-message-trigger:focus-visible {
    color: var(--text-main);
    outline: none;
}
.status-data-table .col-message .status-message-text {
    display: block;
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}
.admin-data-table .col-10 { width: 10%; }
.admin-data-table .col-12 { width: 12%; }
.admin-data-table .col-15 { width: 15%; }
.admin-data-table .col-18 { width: 18%; }
.admin-data-table .col-20 { width: 20%; }
.admin-data-table .col-25 { width: 25%; }
.admin-data-table .col-actions { text-align: center; }
.summary-table .admin-table-message { padding: 20px; color: var(--text-faint); text-align: center; }
.summary-table .admin-table-message--error { color: var(--danger); }
.summary-table .admin-table-date { color: var(--text-muted); }
.summary-table .admin-table-highlight { color: var(--info); font-weight: 500; }
.summary-table .admin-table-content { color: var(--text-content); line-height: 1.4; }
.summary-table .admin-table-actions { text-align: center; white-space: nowrap; }
.admin-table-actions .admin-btn + .admin-btn { margin-left: 6px; }
.admin-table-actions .action-btn-group { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; }
.admin-empty-state { padding: 20px; color: var(--text-faint); text-align: center; }
.admin-error-state { color: var(--danger); }
.admin-error-detail { color: var(--text-muted); }
.admin-stat-empty { opacity: .6; font-size: .85rem; }
.admin-table-empty { opacity: .6; text-align: center; }
.admin-status { font-weight: 600; }
.admin-status--danger { color: var(--status-danger); }
.admin-status--success { color: var(--success); }
.admin-user-id { opacity: .6; font-size: .75rem; }
.admin-danger-text { color: var(--status-danger); }
.stats-progress-bar-fill--jobs { background: linear-gradient(90deg, var(--info), var(--primary)); }
.stats-progress-bar-fill--roles { background: linear-gradient(90deg, var(--accent), var(--primary)); }

.hidden { display: none !important; }

/* --- Responsive Styles --- */

/* ── Unified Banner Hero Components: 배너 뱃지 (.banner-badge) & 배너 버튼 (.banner-btn) ── */
.banner-badge,
.banner-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border-radius: 9999px;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.01em;
    white-space: nowrap;
    box-sizing: border-box;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    flex-shrink: 0;
}

.banner-badge {
    background: var(--surface-subtle, rgba(255, 255, 255, 0.08));
    border: 1px solid var(--border-default, rgba(255, 255, 255, 0.12));
    color: var(--text-secondary, #b4b0c7);
    cursor: default;
}
.banner-badge strong {
    color: var(--text-main, #ffffff);
    font-weight: 700;
}

.banner-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success, #10b981);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.banner-btn {
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    outline: none;
}
.banner-btn:hover {
    transform: translateY(-1px) scale(1.02);
}
.banner-btn:active {
    transform: translateY(0) scale(0.98);
}
.banner-btn-icon {
    font-size: 0.9em;
    line-height: 1;
}

.banner-btn-primary {
    background: linear-gradient(135deg, var(--accent, #6366f1) 0%, var(--accent-hover, #4f46e5) 100%);
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.banner-btn-primary:hover {
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45);
}

.banner-btn-secondary {
    background: var(--banner-btn-secondary-bg, rgba(255, 255, 255, 0.12));
    color: var(--text-main, #ffffff) !important;
    border-color: var(--banner-btn-secondary-border, rgba(255, 255, 255, 0.2));
    backdrop-filter: blur(8px);
}
.banner-btn-secondary:hover {
    background: var(--banner-btn-secondary-bg-hover, rgba(255, 255, 255, 0.18));
    border-color: var(--banner-btn-secondary-border-hover, rgba(255, 255, 255, 0.3));
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

/* ── Banner: Light Theme Overrides ── */
html[data-theme="light"] .banner-badge {
    background: rgba(75, 71, 58, 0.08);
    border-color: rgba(75, 71, 58, 0.15);
    color: var(--text-secondary);
}
html[data-theme="light"] .banner-badge strong {
    color: var(--text-main);
}
html[data-theme="light"] .banner-btn-secondary {
    background: rgba(75, 71, 58, 0.08);
    color: var(--text-main) !important;
    border-color: rgba(75, 71, 58, 0.18);
    backdrop-filter: none;
}
html[data-theme="light"] .banner-btn-secondary:hover {
    background: rgba(75, 71, 58, 0.14);
    border-color: rgba(75, 71, 58, 0.28);
    box-shadow: 0 4px 14px rgba(72, 62, 43, 0.12);
}
html[data-theme="light"] .banner-btn-primary {
    background: linear-gradient(135deg, var(--light-lavender-strong) 0%, var(--light-blush-strong) 100%);
    color: var(--light-lavender-ink) !important;
    border-color: var(--light-lavender-border);
    box-shadow: 0 6px 16px rgba(98, 84, 199, 0.12);
}
html[data-theme="light"] .banner-btn-primary:hover {
    background: linear-gradient(135deg, var(--light-lavender) 0%, var(--light-blush) 100%);
    box-shadow: 0 8px 20px rgba(98, 84, 199, 0.16);
}

/* 파티/상황판 모바일 응답형 단위 및 텍스트 표시 */
.power-full, .job-full, .job-header-full, .badge-label-full { display: inline; }
.power-compact, .job-compact, .job-header-compact, .badge-label-compact { display: none; }
.unit-times { display: inline; }

@media (max-width: 768px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: flex !important; }

    .banner-badge,
    .banner-btn {
        height: 30px;
        padding: 0 10px;
        font-size: 0.75rem;
        gap: 4px;
    }

    .power-full, .job-full, .job-header-full, .badge-label-full { display: none !important; }
    .power-compact, .job-compact, .job-header-compact, .badge-label-compact { display: inline !important; }
    .unit-times { display: none !important; }

    /* 상황판 모바일: 이름 옆 중복 직업 이모지 뱃지 숨김 (대표직업 컬럼은 유지) */
    .user-identity-badge--status .member-icon-badge:not(.member-icon-badge--admin) { display: none !important; }

    .status-summary-badge-wrap { flex-shrink: 0; }
    .status-pill-badge {
        font-size: 0.72rem !important;
        padding: 3px 8px !important;
        white-space: nowrap !important;
    }

    .status-data-table td,
    .status-data-table thead th {
        font-size: 0.75rem !important;
        padding: 8px 3px !important;
        white-space: nowrap !important;
    }
    .status-data-table thead th .sort-icon {
        font-size: 0.65rem !important;
        margin-left: 1px !important;
    }

    #main-header {
        position: sticky;
        top: 0;
        z-index: 100;
        background: rgba(36, 36, 40, 0.9);
        backdrop-filter: blur(10px);
        padding: 15px 0;
        height: 64px;
    }

    .header-title { display: none; }
    .logo-area { gap: 8px; }

    .hero-title { font-size: 2.5rem; }
    .hero-section { padding: 60px 0; }

    .grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* 하단 탭바 (모바일에서만 활성화) */
    .bottom-nav {
        display: flex; /* 모바일 미디어 쿼리 안에서만 flex로 전환 */
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 70px;
        background: rgba(36, 36, 40, 0.85);
        backdrop-filter: blur(15px);
        border-top: 1px solid var(--white-10);
        justify-content: space-around;
        align-items: center;
        z-index: 1000;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .nav-item {
        background: none;
        border: none;
        color: var(--text-secondary);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        font-family: 'Paperlogy-4Regular', sans-serif;
        font-size: 0.7rem;
        flex: 1;
    }

    .nav-icon { font-size: 1.4rem; }

    /* FAB (파티 만들기) */
    .nav-item.fab {
        position: relative;
        top: -20px;
        background: var(--primary);
        width: 60px;
        height: 60px;
        border-radius: 50%;
        color: white;
        box-shadow: 0 0 20px var(--primary-glow);
        flex: none;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .nav-item.fab .nav-icon { font-size: 2rem; font-weight: bold; }

    /* 본문 여백 추가 (하단 탭바에 가려지지 않게) */
    #app { padding-bottom: 100px; }
}

/* Features Grid in Welcome Section */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 60px;
}

@media (max-width: 480px) {
    .features-grid { grid-template-columns: 1fr; }
}

.feature-card {
    background: rgba(255,255,255,0.03);
    padding: 24px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid var(--white-05);
}

.feature-icon { font-size: 2rem; display: block; margin-bottom: 12px; }

/* ── 파티 메모 ─────────────────────────────────────────────── */
.party-memo {
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--white-04);
    border-left: 3px solid rgba(101, 88, 242, 0.5);
    border-radius: 0 8px 8px 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.party-memo--empty { display: none; }
.memo-text { flex: 1; line-height: 1.5; word-break: break-word; }
.memo-actions { display: flex; gap: 4px; flex-shrink: 0; }
.memo-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 4px;
    border-radius: 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
}
.memo-btn:hover { opacity: 1; }
.memo-btn-del { color: #ff6b6b; }

.btn-memo-add {
    display: inline-block;
    margin-top: 8px;
    background: none;
    border: 1px dashed rgba(255,255,255,0.2);
    color: var(--text-secondary);
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-memo-add:hover {
    border-color: rgba(101, 88, 242, 0.5);
    color: var(--primary);
}

/* textarea in form-group */
.form-group textarea {
    width: 100%;
    background: var(--white-06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    color: var(--text-primary);
    padding: 10px 14px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* ── AI 채팅 플로팅 버튼 ────────────────────────────────── */
#chat-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--primary), var(--accent));
    border: none;
    cursor: pointer;
    font-family: 'Paperlogy-8ExtraBold', sans-serif;
    color: #ffffff;
    font-size: 1.15rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(101, 88, 242, 0.3);
    z-index: 1000;
    transition: transform 0.2s, box-shadow 0.2s;
}
#chat-fab-icon {
    font-family: 'Paperlogy-8ExtraBold', sans-serif;
    font-weight: normal;
}

#chat-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(101, 88, 242, 0.48);
}
#chat-fab::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(101,88,242,0.4);
    animation: fab-pulse 2s infinite;
}
@keyframes fab-pulse {
    0%   { transform: scale(1);   opacity: 0.8; }
    50%  { transform: scale(1.2); opacity: 0;   }
    100% { transform: scale(1);   opacity: 0;   }
}

/* ── 채팅 패널 ──────────────────────────────────────────── */
#chat-panel {
    position: fixed;
    bottom: 96px;
    right: 28px;
    width: 450px;
    max-height: 640px;
    min-height: 520px;
    background: var(--chat-panel-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--chat-panel-border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--chat-panel-shadow);
    z-index: 999;
    overflow: hidden;
    animation: chat-slide-in 0.25s ease;
}
#chat-panel.hidden { display: none; }

@keyframes chat-slide-in {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--chat-header-bg);
    border-bottom: 1px solid var(--chat-header-border);
    flex-shrink: 0;
}
.chat-header-info { display: flex; align-items: center; gap: 10px; }
.chat-header-actions { display: flex; align-items: center; gap: 4px; }
.chat-header-actions > :is(a, button) {
    height: 30px;
    display: grid;
    box-sizing: border-box;
    padding: 0;
    place-items: center;
    line-height: 1;
}
.chat-ai-avatar { width: 38px; height: 38px; display: grid; flex: 0 0 38px; place-items: center; border-radius: 12px; color: #fff; font-family: 'Paperlogy-8ExtraBold', sans-serif; font-size: 1rem; line-height: 1; background: linear-gradient(145deg, var(--primary), var(--accent)); box-shadow: 0 8px 24px rgba(101, 88, 242, 0.3); }
.chat-title       { display: flex; align-items: center; gap: var(--space-1); font-weight: 700; font-size: 0.95rem; color: var(--text-primary); }
.chat-support-tier {
    display: inline-flex;
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    align-items: center;
    justify-content: center;
    padding: 1px 0 0;
    border: 1px solid var(--panel-item-border);
    border-radius: var(--radius-sm);
    background: var(--panel-item-bg);
    color: var(--text-secondary);
    font-family: 'Paperlogy-6SemiBold', sans-serif;
    font-size: .58rem;
    line-height: 1;
}
.chat-support-tier[data-tier-band="mid"] {
    border-color: var(--panel-progress-start);
    background: color-mix(in srgb, var(--panel-progress-start) 18%, var(--panel-item-bg));
    color: var(--panel-progress-end);
}
.chat-support-tier[data-tier-band="high"] {
    border-color: var(--panel-progress-end);
    background: color-mix(in srgb, var(--panel-progress-end) 24%, var(--panel-item-bg));
    color: var(--text-main);
}
.chat-support-tier--optical-low { padding-top: 2px; }
html[data-theme="light"] .chat-support-tier[data-tier-band="mid"] {
    border-color: var(--panel-item-border);
    color: var(--text-secondary);
}
.chat-status      { font-size: 0.72rem; color: #4ade80; margin-top: 1px; }
.chat-support-progress {
    width: 100%;
    height: 4px;
    flex: 0 0 4px;
    overflow: hidden;
    background: var(--panel-progress-track);
}
.chat-support-progress > span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 0 99px 99px 0;
    background: linear-gradient(90deg, var(--panel-progress-start), var(--panel-progress-end));
    transition: width .4s ease;
}
#chat-support-link {
    display: flex;
    min-width: 0;
    max-width: min(220px, 48vw);
    padding: 0 8px;
    gap: 4px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: .68rem;
    white-space: nowrap;
    text-decoration: none;
    opacity: .68;
    transition: opacity .16s ease, background-color .16s ease, border-color .16s ease;
}
#chat-support-link span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
}
#chat-support-link:hover,
#chat-support-link:focus-visible {
    border-color: var(--border-default);
    background: var(--white-05);
    opacity: 1;
}
#chat-close-btn {
    width: 30px;
    flex: 0 0 30px;
    background: none; border: none; cursor: pointer;
    color: var(--text-secondary); font-size: 1rem;
    border-radius: 6px; transition: color 0.2s;
}
#chat-close-btn:hover { color: var(--text-primary); }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--white-10) transparent;
}

#chat-load-more {
    align-self: center;
    flex: 0 0 auto;
    padding: 6px 12px;
    font-size: 0.78rem;
}

.chat-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.875rem;
    line-height: 1.5;
    text-align: left;
    word-break: break-word;
}
.chat-bubble.user {
    align-self: flex-end;
    border: 1px solid var(--chat-user-border);
    background: var(--chat-user-bg);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.chat-bubble.assistant {
    align-self: flex-start;
    border: 1px solid var(--chat-assistant-border);
    background: var(--chat-assistant-bg);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}
.chat-bubble.assistant > :first-child { margin-top: 0; }
.chat-bubble.assistant > :last-child { margin-bottom: 0; }
.chat-bubble.assistant,
.chat-bubble.assistant p,
.chat-bubble.assistant h2,
.chat-bubble.assistant h3,
.chat-bubble.assistant li,
.chat-bubble.assistant blockquote,
.chat-bubble.assistant pre { text-align: left !important; }
.chat-bubble.assistant p { margin: 0 0 0.65em; }
.chat-bubble.assistant h2,
.chat-bubble.assistant h3 {
    margin: 0.8em 0 0.4em;
    color: var(--text-primary);
    line-height: 1.3;
}
.chat-bubble.assistant h2 { font-size: 1.05rem; }
.chat-bubble.assistant h3 { font-size: 0.95rem; }
.chat-bubble.assistant ul,
.chat-bubble.assistant ol { margin: 0.45em 0 0.7em; padding-left: 1.35em; }
.chat-bubble.assistant li + li { margin-top: 0.25em; }
.chat-bubble.assistant blockquote {
    margin: 0.6em 0;
    padding: 0.2em 0 0.2em 0.75em;
    border-left: 3px solid var(--primary);
    color: var(--text-secondary);
}
.chat-bubble.assistant pre {
    max-width: 100%;
    margin: 0.6em 0;
    padding: 0.7em;
    overflow-x: auto;
    border-radius: 9px;
    background: var(--bg-dark);
    white-space: pre-wrap;
}
.chat-bubble.assistant code {
    padding: 0.08em 0.3em;
    border-radius: 4px;
    background: var(--bg-dark);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.84em;
}
.chat-bubble.assistant pre code { padding: 0; background: transparent; }
.chat-bubble.assistant hr {
    margin: 0.75em 0;
    border: 0;
    border-top: 1px solid var(--chat-header-border);
}
.chat-link {
    color: #a9a1ff;
    font-family: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(169, 161, 255, 0.45);
    text-underline-offset: 3px;
}
.chat-link:hover { color: #d8d4ff; text-decoration-color: currentColor; }
.user-identity-badge--chat {
    display: inline-flex;
    margin: -1px 1px;
    padding: 1px 4px;
    vertical-align: middle;
    color: var(--accent);
    font-weight: 700;
}
.chat-mention-pending { color: var(--accent); font-weight: 700; }
.chat-bubble.error {
    align-self: center;
    background: rgba(255,100,100,0.15);
    color: #ff8080;
    font-size: 0.8rem;
}

/* 타이핑 인디케이터 */
.chat-bubble.typing {
    display: flex; gap: 5px; align-items: center;
    padding: 12px 16px;
}
.chat-bubble.typing span {
    width: 7px; height: 7px; border-radius: 50%;
    background: rgba(255,255,255,0.4);
    animation: typing-bounce 1.2s infinite;
}
.chat-bubble.typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-bubble.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bounce {
    0%, 80%, 100% { transform: translateY(0);   opacity: 0.4; }
    40%            { transform: translateY(-6px); opacity: 1;   }
}

/* 입력 영역 */
.chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--chat-header-border);
    background: var(--chat-input-area-bg);
    flex-shrink: 0;
}
#chat-input {
    flex: 1;
    background: var(--chat-input-bg);
    border: 1px solid var(--chat-input-border);
    border-radius: 12px;
    color: var(--text-primary);
    padding: 9px 12px;
    font-size: 0.875rem;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    overflow-y: auto;
    transition: border-color 0.2s;
    line-height: 1.4;
}
#chat-input:focus { outline: none; border-color: var(--primary); }
#chat-send-btn {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6558f2, #a855f7);
    border: none; cursor: pointer;
    color: #fff; font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s, opacity 0.2s;
}
#chat-send-btn:hover { transform: scale(1.08); }

@media (max-width: 768px) {
    #chat-panel { width: 360px; min-height: 480px; max-height: 540px; }
}

@media (max-width: 480px) {
    #chat-panel { right: 12px; left: 12px; width: auto; bottom: 88px; min-height: min(520px, 70dvh); max-height: 70dvh; }
    #chat-fab   { bottom: 20px; right: 16px; }
}

/* ── 프로필 닉네임 태그 ─────────────────────────────────────── */
.profile-nick-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 36px;
}

.profile-nick-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(101, 88, 242, 0.15);
    border: 1px solid rgba(101, 88, 242, 0.3);
    color: var(--text-main);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.82rem;
}

.profile-nick-tag button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.profile-nick-tag button:hover { color: #ff6b6b; }

#user-name {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    appearance: none;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 10px;
    padding: 7px 10px;
    color: var(--text-main);
    font: inherit;
    background: rgba(255,255,255,.065);
    box-shadow: 0 1px 0 var(--white-04) inset;
    cursor: pointer;
    transition: border-color .18s, background-color .18s, transform .18s;
}
#user-name:hover {
    border-color: rgba(139,124,255,.48);
    background: rgba(139,124,255,.13);
    transform: translateY(-1px);
}
#user-name:focus-visible { outline: 3px solid rgba(139,124,255,.25); outline-offset: 2px; }
#user-name:active { transform: translateY(0); }
#status-badge.hidden {
    display: none !important;
}
#status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-size: 0.76rem;
    border-radius: 20px;
    background: rgba(245, 158, 11, 0.16);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: var(--status-warning);
    user-select: none;
}
#status-badge.status-badge--danger { color: var(--status-danger); }
.connection-status-dot {
    width: 0.55rem;
    height: 0.55rem;
    flex: 0 0 auto;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent);
}
#user-name,
#logout-btn {
    border-color: var(--header-control-border);
    color: var(--header-control-text);
    background: var(--header-control-bg);
    box-shadow: none;
}
#user-name:hover,
#logout-btn:hover {
    border-color: var(--header-control-hover-border);
    color: var(--header-control-hover-text);
    background: var(--header-control-hover-bg);
    box-shadow: none;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.icon-btn:hover {
    background: var(--white-10);
    color: var(--text-main);
}
/* ── Admin Page & Role Management ──────────────────────────── */
.badge-role {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}
.badge-role.admin { background: var(--badge-user-bg); color: var(--badge-user-text); border: 1px solid var(--badge-user-border); }
.badge-role.master { background: var(--badge-master-bg); color: var(--badge-master-text); border: 1px solid var(--badge-master-border); }
.badge-role.submaster { background: var(--badge-submaster-bg); color: var(--badge-submaster-text); border: 1px solid var(--badge-submaster-border); }
.badge-role.user { background: var(--badge-user-bg); color: var(--badge-user-text); border: 1px solid var(--badge-user-border); }
.badge-role.newbie { background: var(--badge-newbie-bg); color: var(--badge-newbie-text); border: 1px solid var(--badge-newbie-border); }
.badge-role.away { background: var(--badge-away-bg); color: var(--badge-away-text); border: 1px solid var(--badge-away-border); }
.badge-role.blacklisted { background: rgba(239, 83, 80, 0.25); color: var(--status-danger); border: 1px solid rgba(239, 83, 80, 0.5); }

.party-card--onboarding {
    --party-card-accent-width: 3px;
    --party-card-accent-gradient: linear-gradient(#2ecc71, transparent 80%);
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.12), var(--card-bg) 65%) !important;
    border-color: rgba(46, 204, 113, 0.4) !important;
}
.party-card--onboarding:hover {
    border-color: rgba(46, 204, 113, 0.7) !important;
    box-shadow: 0 14px 35px rgba(46, 204, 113, 0.2) !important;
}
.party-badge--onboarding {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: 6px;
    background: #2ecc71;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    margin-right: 6px;
    vertical-align: middle;
}

.form-group--onboarding {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 6px;
    margin-bottom: 0;
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.14), rgba(46, 204, 113, 0.05));
    border: 1px dashed rgba(46, 204, 113, 0.45);
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
    width: 100%;
    box-sizing: border-box;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-group--onboarding:hover {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.2), rgba(46, 204, 113, 0.08));
    border-color: rgba(46, 204, 113, 0.7);
    box-shadow: 0 4px 14px rgba(46, 204, 113, 0.15);
}
.form-checkbox-label {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 0 !important;
}
.onboarding-text-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1.2;
    vertical-align: middle;
}
.form-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2ecc71;
    cursor: pointer;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    vertical-align: middle;
    align-self: center;
}
.form-checkbox-label .onboarding-subtext {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-sub);
    vertical-align: middle;
}

.admin-modal-content {
    position: relative;
    max-width: 1320px !important;
    width: 95vw !important;
    max-height: 92vh !important;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    overflow: hidden;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--modal-header-padding-top) 24px 16px;
    border-bottom: 1px solid var(--white-08);
}
.admin-header h2 { margin: 0; font-size: 1.3rem; display: flex; align-items: center; gap: 8px; }

.admin-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 24px 0;
    border-bottom: 1px solid var(--white-08);
    background: var(--surface-subtle);
}
.admin-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    border-radius: 6px 6px 0 0;
}
.admin-tab-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.03); }
.admin-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: rgba(101, 88, 242, 0.1);
}

.admin-body {
    min-height: 480px;
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.admin-tab-content { display: none; }
.admin-tab-content.active { display: block; }

/* Stats Overview */
.stats-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
@media (max-width: 768px) {
    .stats-overview-grid { grid-template-columns: repeat(2, 1fr); }

    .admin-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        padding: 10px 12px;
    }

    .admin-tab-btn {
        min-width: 0;
        min-height: 44px;
        padding: 9px 8px;
        line-height: 1.25;
        white-space: normal;
    }
}
@media (max-width: 480px) {
    .stats-overview-grid { grid-template-columns: 1fr; }
}

.stat-card {
    background: var(--white-04);
    border: 1px solid var(--white-08);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.stat-card.danger {
    background: rgba(239, 83, 80, 0.06);
    border-color: rgba(239, 83, 80, 0.2);
}
.stat-icon {
    font-size: 1.8rem;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--white-06);
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-info { display: flex; flex-direction: column; }
.stat-label { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 2px; }
.stat-value { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); }

.stats-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
@media (max-width: 768px) {
    .stats-charts-grid { grid-template-columns: 1fr; }
}

.chart-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--white-06);
    border-radius: 14px;
    padding: 18px;
}
.chart-card.full-width { grid-column: 1 / -1; }
.chart-card h4 { margin: 0 0 16px 0; font-size: 0.95rem; color: var(--text-secondary); }
.chart-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.chart-card-header h4 { margin-bottom: 0; }
.character-scope-filter { flex-shrink: 0; }
.character-distribution-section + .character-distribution-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-default);
}
.character-distribution-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}
.character-distribution-section h5 {
    margin: 0 0 10px;
    color: var(--text-main);
    font-size: .85rem;
}
.character-distribution-heading span {
    color: var(--text-muted);
    font-size: .75rem;
}
@media (max-width: 420px) {
    .chart-card-header { align-items: stretch; flex-direction: column; }
    .character-scope-filter { width: 100%; }
    .character-scope-filter .admin-segmented-filter-btn { flex: 1; }
}

.stats-progress-item {
    margin-bottom: 12px;
}
.stats-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.83rem;
    margin-bottom: 4px;
}
.stats-progress-bar-bg {
    width: 100%;
    height: 8px;
    background: var(--white-08);
    border-radius: 4px;
    overflow: hidden;
}
.stats-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #6558f2, #9c27b0);
    border-radius: 4px;
    transition: width 0.4s ease;
}

/* Admin Toolbar & Table */
.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.admin-segmented-filter {
    display: inline-flex;
    flex: 0 0 auto;
    padding: 3px;
    border: 1px solid var(--border-default);
    border-radius: 10px;
    background: var(--surface-soft);
}
.admin-segmented-filter-btn {
    border: 0;
    border-radius: 7px;
    padding: 7px 10px;
    color: var(--text-muted);
    background: transparent;
    font: inherit;
    font-size: .78rem;
    cursor: pointer;
}
.admin-segmented-filter-btn:hover { color: var(--text-main); }
.admin-segmented-filter-btn.active {
    color: var(--text-main);
    background: var(--card-bg);
}
@media (max-width: 576px) {
    .admin-toolbar { flex-direction: column; }
    .admin-segmented-filter { width: 100%; }
    .admin-segmented-filter-btn { flex: 1; }
}

.admin-search-input {
    flex: 1;
    background: var(--white-06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 8px 14px;
    color: var(--text-primary);
    font-size: 0.88rem;
}

.modal-corner-close {
    position: absolute;
    z-index: 20;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    padding: 0;
}

/* Header close buttons reuse the same square hit area as the modal corner control. */
.modal-header-close {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    padding: 0;
    align-self: flex-start;
}

.modal-content > .modal-corner-close + h2,
.modal-scroll-body > h2:first-child {
    padding-right: 42px;
}

.modal-content:has(> .modal-corner-close) > :is(
    .modal-header,
    .party-members-modal-header,
    .board-editor-header,
    .profile-image-crop-header,
    .admin-header,
    .leaderboard-header
),
.modal-scroll-body:has(> .modal-corner-close) > :is(
    .modal-header,
    .party-members-modal-header,
    .profile-image-crop-header,
    .leaderboard-header
) {
    padding-right: 58px;
}
.admin-search-input:focus { outline: none; border-color: var(--primary); }

.admin-select-filter {
    background-color: var(--select-bg);
    border: 1px solid var(--select-border);
    border-radius: 8px;
    padding: 8px 14px;
    color: var(--select-text);
    font-size: 0.88rem;
}
.admin-select-filter option { color: var(--native-option-text); background: var(--native-option-bg); }

.role-select-inline {
    background-color: var(--select-bg);
    border: 1px solid var(--select-border);
    color: var(--select-text);
    border-radius: 6px;
    padding: 3px 6px;
    font-size: 0.75rem;
}
.role-select-inline option { color: var(--native-option-text); background: var(--native-option-bg); }

/* ── Admin & KB Management UI ── */
.admin-btn {
    background: var(--white-08);
    border: 1px solid var(--white-15);
    color: var(--text-main, var(--text-content));
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.admin-btn:hover {
    background: var(--primary, #e83187);
    color: white;
    border-color: var(--primary, #e83187);
}
.promote-btn {
    background: rgba(147, 51, 234, 0.2);
    border-color: rgba(147, 51, 234, 0.4);
    color: #c084fc;
}
.promote-btn:hover {
    background: #9333ea;
    color: white;
}
.kb-btn {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    color: var(--info);
}
.kb-btn:hover {
    background: #2563eb;
    color: white;
}

.admin-input, .admin-textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--white-15);
    border-radius: 8px;
    color: white;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-family: inherit;
    box-sizing: border-box;
}
.admin-input:focus, .admin-textarea:focus {
    outline: none;
    border-color: var(--primary, #e83187);
}

.admin-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.action-btn {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
}
.primary-btn {
    background: var(--primary, #e83187);
    color: white;
}
.secondary-btn {
    background: var(--white-10);
    color: var(--text-soft);
}

/* KB Modal */
.kb-modal-content {
    max-width: 680px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
}
.kb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--white-10);
    padding-bottom: 12px;
    margin-bottom: 16px;
}
.kb-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}
.card-form {
    background: var(--white-04);
    border: 1px solid var(--white-10);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 16px;
}
.kb-item-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--white-08);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.kb-item-content {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-content);
}
.kb-item-meta {
    font-size: 0.75rem;
    color: var(--text-faint);
    margin-top: 4px;
}
.kb-item-actions {
    display: flex;
    gap: 4px;
}

/* KB Tab Navigation */
.kb-tab-nav {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--white-10);
    margin-bottom: 16px;
}
.kb-tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.kb-tab-btn:hover {
    color: #fff;
}
.kb-tab-btn.active {
    color: var(--primary, #e83187);
    border-bottom-color: var(--primary, #e83187);
}
.kb-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    align-self: center;
    flex-grow: 1;
}

/* Summary Table UI */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}
.summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.summary-table th, .summary-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--white-08);
}
.summary-table th {
    background: var(--white-05);
    color: var(--text-soft);
    font-weight: 600;
}
.summary-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}
.summary-table .text-center, .text-center {
    text-align: center !important;
}
.summary-table .text-right, .text-right {
    text-align: right !important;
}

/* 🌸 핑크 포인트 버튼: 로뛰 키우기 전용 */
.btn-pink {
    background: linear-gradient(135deg, #e83187 0%, #f43f5e 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(232, 49, 135, 0.4) !important;
    border: none !important;
    font-weight: 600 !important;
    transition: all 0.2s ease-in-out !important;
}

.btn-pink:hover {
    background: linear-gradient(135deg, #d81b75 0%, #e11d48 100%) !important;
    box-shadow: 0 6px 20px rgba(232, 49, 135, 0.6) !important;
    transform: translateY(-2px) !important;
}

/* 📱 모바일 전용 하단 내비게이션 바 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(36, 36, 40, 0.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--white-10);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding: 0 10px;
}

@media (min-width: 769px) {
    .bottom-nav {
        display: none !important;
    }
}

@media (max-width: 768px) {
    /* 모바일 상단바: 로뛰 키우기, 파티 만들기 버튼은 하단바가 담당하므로 헤더에서 숨김 */
    #propose-kb-btn,
    #create-btn {
        display: none !important;
    }

    /* 모바일 화면에서는 오른쪽 하단 플로팅 버튼(chat-fab 및 구버전 fab) 숨김 */
    #chat-fab,
    .fab,
    .mobile-create-fab {
        display: none !important;
    }

    .bottom-nav {
        display: flex;
    }

    /* 미로그인 상태 시 하단바 완벽 숨김 */
    .bottom-nav.hidden,
    #bottom-nav.hidden {
        display: none !important;
    }

    .auth-area {
        gap: 6px;
    }

    #user-profile {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    #user-profile .btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}




.bottom-nav .nav-item {
    background: transparent;
    border: none;
    color: #a1a1aa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 0.72rem;
    cursor: pointer;
    flex: 1;
    transition: color 0.2s;
}

.bottom-nav .nav-item:hover, .bottom-nav .nav-item:active {
    color: #ffffff;
}

.bottom-nav .nav-item .nav-icon {
    font-size: 1.25rem;
}

.bottom-nav .nav-item.btn-pink-text {
    color: #e83187;
    font-weight: 600;
}

.bottom-nav .nav-item.nav-item-primary {
    color: var(--info);
    font-weight: 600;
}







/* ── 2026 UI refresh: clearer hierarchy and responsive dashboard ── */
:root {
    --bg-dark: #111116;
    --card-bg: #1c1c23;
    --primary: #7c6cff;
    --primary-glow: rgba(124, 108, 255, 0.3);
    --text-secondary: #aaa9b5;
    --glass: rgba(28, 28, 35, 0.82);
}

body {
    background-image:
        radial-gradient(circle at 12% -10%, rgba(124, 108, 255, 0.2), transparent 38%),
        radial-gradient(circle at 90% 75%, rgba(232, 49, 135, 0.1), transparent 34%);
}

#main-header {
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
    padding: 22px 0;
}

.logo-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    margin-right: 11px;
    border-radius: 12px;
    color: #fff;
    font-family: 'Paperlogy-8ExtraBold', sans-serif;
    background: linear-gradient(145deg, var(--primary), var(--accent));
    box-shadow: 0 8px 24px rgba(101, 88, 242, 0.3);
}

.brand-copy { display: flex; flex-direction: column; line-height: 1; }
.brand-subtitle { margin-top: 5px; color: #777582; font-size: 0.58rem; letter-spacing: 0.2em; }

.hero-section { padding: clamp(82px, 11vw, 138px) 0 88px; }
.hero-title { font-size: clamp(2.2rem, 4vw, 3rem); line-height: 1.14; max-width: 1040px; margin-inline: auto; }
.hero-subtitle { font-family: 'Paperlogy-4Regular', sans-serif; font-size: 1.05rem; opacity: 1; }
.hero-copy-line { display: block; white-space: nowrap; }
.hero-kicker,
.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 20px;
    color: #c2bdff;
    font-family: 'Paperlogy-6SemiBold', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
}
.hero-kicker span { width: 24px; height: 1px; background: var(--primary); }

.features-grid { max-width: 900px; margin: 78px auto 0; border-top: 1px solid var(--white-08); }
.feature-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 24px 18px;
    border: 0;
    border-radius: 0;
    background: transparent;
    text-align: left;
}
.feature-icon { margin: 1px 0 0; color: #8f84ff; font-size: 0.68rem; letter-spacing: 0.08em; }
.feature-card h4 { margin-bottom: 5px; font-family: 'Paperlogy-6SemiBold', sans-serif; }
.feature-card p { font-size: 0.78rem; line-height: 1.5; text-align: left; }

#party-count { color: #ddd9ff; font-family: 'Paperlogy-6SemiBold', sans-serif; }
.week-today-btn:disabled { cursor: default; opacity: 0.45; }

.party-filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 26px; }
.party-filter-options { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.party-filter-check { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 6px 10px; border: 1px solid var(--white-08); border-radius: 10px; color: var(--text-secondary); background: rgba(255,255,255,0.025); cursor: pointer; font-size: 0.75rem; white-space: nowrap; }
.party-filter-check:has(input:checked) { color: #e4e0ff; border-color: rgba(124,108,255,0.42); background: rgba(124,108,255,0.14); }
.party-filter-check input { width: 14px; height: 14px; accent-color: var(--primary); }
.party-filter-check small { margin-left: 3px; color: #777582; font-size: 0.62rem; }
.party-view-toggle { display: inline-flex; min-height: 34px; align-items: center; gap: 8px; padding: 5px 10px; border: 1px solid var(--party-view-toggle-border); border-radius: 10px; color: var(--party-view-toggle-text); background: var(--party-view-toggle-bg); cursor: pointer; font-size: 0.75rem; white-space: nowrap; }
.party-view-toggle input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.party-view-toggle-track { display: flex; width: 30px; height: 18px; align-items: center; padding: 2px; border-radius: 99px; background: var(--party-view-toggle-track); transition: background 0.2s ease; }
.party-view-toggle-track span { width: 14px; height: 14px; border-radius: 50%; background: var(--party-view-toggle-thumb); transition: transform 0.2s ease, background 0.2s ease; }
.party-view-toggle input:checked + .party-view-toggle-track { background: var(--party-view-toggle-track-active); }
.party-view-toggle input:checked + .party-view-toggle-track span { transform: translateX(12px); background: var(--party-view-toggle-thumb-active); }
.party-view-toggle:has(input:focus-visible) { outline: 3px solid var(--party-view-toggle-focus); outline-offset: 2px; }
.party-search-box { display: flex; align-items: center; gap: 8px; width: min(330px, 100%); min-height: 38px; padding: 0 11px; border: 1px solid var(--white-10); border-radius: 11px; color: #8c8997; background: rgba(7,7,10,0.34); }
.party-search-box:focus-within { border-color: rgba(124,108,255,0.55); box-shadow: 0 0 0 3px rgba(124,108,255,0.1); }
.party-search-box input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--text-main); background: transparent; font-size: 0.78rem; }
.party-search-box input::placeholder { color: #706e79; }
.party-filter-result { flex-shrink: 0; color: #aaa5c8; font-size: 0.66rem; }

.week-navigator { margin: 14px 0 26px; padding: 10px; background: rgba(28,28,35,0.78); backdrop-filter: blur(16px); }
.grid { gap: 18px; }
.day-group-header { margin-top: 16px; padding: 8px 2px 9px; font-size: 0.8rem; text-transform: uppercase; }
.party-card { position: relative; overflow: visible; padding: 22px; border-color: var(--white-08); box-shadow: 0 12px 40px rgba(0,0,0,0.12); }
.party-card:has(.party-manage-menu[open]) { z-index: 20; }
.party-card > .party-card-controls > .party-manage-menu { position: absolute; top: 22px; right: 22px; }
.party-card-controls:has(.card-actions) > .party-manage-menu { top: 20px; }
.party-card::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: var(--party-card-accent-gradient) left top / var(--party-card-accent-width) 100% no-repeat; opacity: 0.8; pointer-events: none; }
.party-card:hover { transform: translateY(-3px); border-color: rgba(124,108,255,0.5); }
.party-card--themed {
    --party-card-accent-width: 3px;
    --party-card-accent-gradient: linear-gradient(var(--party-accent), transparent 78%);
    background: linear-gradient(135deg, color-mix(in srgb, var(--party-accent) 14%, var(--card-bg)), var(--card-bg) 62%);
    border-color: color-mix(in srgb, var(--party-accent) 38%, transparent);
}
.party-card--themed:hover {
    border-color: color-mix(in srgb, var(--party-accent) 68%, transparent);
    box-shadow: 0 14px 42px color-mix(in srgb, var(--party-accent) 16%, transparent);
}
.card-header { align-items: flex-start; gap: 12px; }
.game-title { font-family: 'Paperlogy-7Bold', sans-serif; font-size: 1.08rem; }
.party-date { margin-bottom: 16px; }
.member-info { padding: 14px; margin-bottom: 16px; background: var(--panel-inset-bg); }
.member-count { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; color: var(--text-secondary); font-size: 0.78rem; }
.member-count strong { color: var(--text-main); font-size: 0.82rem; }
.member-progress { height: 4px; margin-bottom: 12px; overflow: hidden; border-radius: 99px; background: var(--panel-progress-track); }
.member-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--panel-progress-start), var(--panel-progress-end)); }
.member-tag { border-radius: 999px; background: var(--panel-item-bg); }
.member-tag.leader-tag { border: 1px solid rgba(245,196,81,0.8); color: #fff5cf; background: rgba(154,112,20,0.22); box-shadow: inset 0 0 0 1px rgba(245,196,81,0.08), 0 0 12px rgba(245,196,81,0.08); }
.leader-label { margin-left: 2px; padding: 1px 5px; border-radius: 999px; color: #2d2108; background: #f5c451; font-family: 'Paperlogy-7Bold', sans-serif; font-size: 0.55rem; line-height: 1.4; }
.empty-state { grid-column: 1 / -1; display: flex; min-height: 310px; flex-direction: column; align-items: center; justify-content: center; padding: 48px 20px; border: 1px dashed rgba(255,255,255,0.12); border-radius: 20px; background: rgba(255,255,255,0.015); text-align: center; }
.empty-state-icon { margin-bottom: 14px; color: #8f84ff; font-size: 2rem; }
.empty-state strong { font-family: 'Paperlogy-7Bold', sans-serif; font-size: 1.15rem; }
.empty-state p { margin: 7px 0 20px; }

@media (min-width: 769px) {
    .grid.party-grid--list { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .party-grid--list .day-group-header { margin-top: 18px; }
    .party-grid--list .party-card {
        display: grid;
        grid-template-columns: minmax(170px, .9fr) minmax(260px, 2fr) minmax(230px, 1.25fr);
        grid-template-areas:
            'header members memo'
            'date members actions'
            'status members actions';
        align-items: center;
        column-gap: 18px;
        row-gap: 4px;
        min-height: 94px;
        padding: 14px 16px;
        border-radius: 14px;
    }
    .party-grid--list .party-card:hover { transform: translateY(-1px); }
    .party-grid--list .card-header { grid-area: header; min-width: 0; margin: 0; align-items: center; }
    .party-grid--list .game-title-block { min-width: 0; flex-wrap: wrap; }
    .party-grid--list .party-date { display: contents; }
    .party-grid--list .party-date-main { grid-area: date; max-width: 100%; overflow: hidden; color: var(--text-secondary); font-size: 0.78rem; line-height: 1.25; text-overflow: ellipsis; }
    .party-grid--list .party-date .status-badge { grid-area: status; width: max-content; max-width: 100%; line-height: 1.25; }
    .party-grid--list .member-info { grid-area: members; min-width: 0; margin: 0; padding: 10px 12px; }
    .party-grid--list .member-count { margin-bottom: 5px; }
    .party-grid--list .member-progress { margin-bottom: 7px; }
    .party-grid--list .member-list { flex-wrap: wrap; overflow: visible; }
    .party-grid--list .member-tag { flex: 0 0 auto; }
    .party-grid--list .party-memo { grid-area: memo; display: flex; min-width: 0; margin: 0; padding: 7px 9px; white-space: nowrap; }
    .party-grid--list .party-memo--empty { color: var(--text-muted); border-left-color: var(--white-10); background: var(--white-04); }
    .party-grid--list .memo-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .party-grid--list .party-card-controls { grid-area: actions; display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 8px; }
    .party-grid--list .party-card-controls > .party-manage-menu { position: relative; top: auto; right: auto; flex: 0 0 auto; }
    .party-grid--list .card-actions { min-width: 0; justify-self: stretch; }
    .party-grid--list .card-actions .btn { min-height: 38px; padding-inline: 10px; }
}

.btn:focus-visible,
.week-nav-btn:focus-visible,
.icon-btn:focus-visible,
.nav-item:focus-visible { outline: 3px solid rgba(124,108,255,0.55); outline-offset: 3px; }

@media (max-width: 768px) {
    #main-header {
        width: 100%;
        height: 66px;
        padding: 12px max(14px, env(safe-area-inset-right)) 12px max(14px, env(safe-area-inset-left));
    }
    .brand-copy { display: none; }
    .logo-mark { width: 38px; height: 38px; margin-right: 8px; }
    #status-badge { padding: 4px 8px; font-size: 0.68rem; }
    #user-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.78rem; }
    #logout-btn { padding: 7px 9px !important; font-size: 0; }
    #logout-btn::after { content: '나가기'; font-size: 0.72rem; }
    .hero-section { padding: 72px 0 40px; }
    .hero-kicker { margin-bottom: 16px; }
    .hero-title { font-size: clamp(1.15rem, 5.8vw, 1.9rem); line-height: 1.28; }
    .hero-subtitle { max-width: none; margin-bottom: 34px; font-size: clamp(0.72rem, 3.55vw, 1.05rem); }
    .features-grid { grid-template-columns: 1fr; gap: 0; margin-top: 58px; }
    .feature-card { padding: 17px 8px; border-bottom: 1px solid var(--white-06); }
    .surface-heading { align-items: center; }
    .party-filter-bar { align-items: stretch; flex-direction: column; margin-top: 20px; gap: 10px; }
    .party-filter-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .party-filter-check { justify-content: center; padding-inline: 7px; }
    .party-filter-check:first-child { grid-column: 1 / -1; }
    .party-view-toggle { display: none; }
    .grid.party-grid--list { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
    .party-search-box { width: 100%; }
    .week-today-btn { padding: 8px 10px; font-size: 0.72rem; }
    .week-navigator { margin-top: 12px; }
    .week-nav-btn { width: 42px; height: 42px; }
    .party-card { padding: 19px; }
    .party-card > .party-card-controls > .party-manage-menu { top: 19px; right: 19px; }
    .card-header { align-items: center; gap: 8px; }
    .game-title-block { min-width: 0; gap: 6px; }
    .game-title-block .game-title { font-size: 0.98rem; }
    .difficulty-badge { flex-shrink: 0; padding-inline: 6px; font-size: 0.62rem; }
    .status-badge { padding-inline: 6px; font-size: 0.64rem; }
    .party-manage-menu summary,
    .party-onboarding-badge { width: 28px; height: 28px; font-size: 0.95rem; }
    .card-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
    .card-actions .btn-call { min-height: 44px; }
    .card-actions .btn-leave { min-width: 76px; min-height: 44px; }
    .party-manage-popover { width: min(180px, calc(100vw - 70px)); }
    .status-badge { flex-shrink: 0; }
    .bottom-nav { height: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); }
    #app { padding: 0 14px calc(96px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Mobile header compact status/actions */
@media (max-width: 768px) {
    #logout-btn {
        min-width: 46px;
        padding: 7px 9px !important;
        font-size: 0 !important;
    }

    #logout-btn::after {
        content: '나가기';
        color: var(--text-secondary);
        font-size: 0.72rem;
    }

    #status-badge {
        width: 12px;
        height: 12px;
        padding: 0;
        gap: 0;
        border: 0;
        background: transparent;
        font-size: 0;
        overflow: visible;
    }
    #status-badge .connection-status-dot { width: 10px; height: 10px; box-shadow: none; }
    #status-badge .connection-status-label { display: none; }
}

/* User identity: role first, preserve more nickname text on mobile */
.user-display-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 768px) {
    #user-name {
        width: auto;
        max-width: min(48vw, 180px);
        overflow: visible;
        font-size: 0.8rem;
        text-overflow: clip;
    }

    #user-name .badge-role {
        flex: 0 0 auto;
        gap: 2px;
        padding: 3px 5px;
        font-size: 0.62rem;
    }

    #user-name .user-display-name {
        flex: 1 1 auto;
    }
}

/* Notion-inspired member icon badges */
.profile-icon-field { display: flex; align-items: center; gap: 8px; }
.profile-icon-field select { flex: 1; }

/* Shared user identity badge + Discord-style user card */
.user-identity-badge {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
    padding: 2px 4px;
    border: 0;
    border-radius: 7px;
    color: inherit;
    font: inherit;
    line-height: 1.2;
    text-align: left;
    background: transparent;
    cursor: pointer;
}
.user-identity-badge:hover,
.user-identity-badge:focus-visible { color: #fff; background: rgba(255,255,255,.09); outline: none; }
.user-identity-icons { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 3px; }
.user-identity-icons .member-icon-badge,
.user-identity-icons .status-role-icon-badge { width: 22px; height: 22px; flex-basis: 22px; }
.user-identity-avatar {
    display: grid;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--white-10);
    border-radius: 50%;
    background: rgba(124,108,255,.2);
    font-size: .72rem;
}
.user-identity-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-identity-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-tag .user-identity-badge { margin: -2px -4px; }
.board-mention.user-identity-badge { display: inline-flex; vertical-align: middle; }

.user-card-popover {
    position: fixed;
    z-index: 4000;
    width: min(340px, calc(100vw - 20px));
    overflow: hidden;
    border: 1px solid var(--popover-border);
    border-radius: 18px;
    background: var(--popover-bg);
    box-shadow: var(--popover-shadow);
    animation: user-card-in .14s ease-out;
}
@keyframes user-card-in { from { opacity: 0; transform: translateY(5px) scale(.985); } }
.user-card-shell { overflow: hidden; color: var(--user-card-text); background: var(--user-card-bg); }
.user-card-cover { position: relative; height: 112px; overflow: hidden; background: linear-gradient(135deg, #6558f2, #c55392); }
.user-card-cover-media { position: relative; width: 100%; height: 100%; }
.user-card-cover-media img { width: 100%; height: 100%; object-fit: cover; opacity: 1; transition: opacity .18s ease; }
.user-card-cover-placeholder { display: grid; position: absolute; inset: 0; place-items: center; color: rgba(255,255,255,.58); font-size: 2rem; background: linear-gradient(135deg, rgba(101,88,242,.9), rgba(197,83,146,.9)); opacity: 0; transition: opacity .18s ease; pointer-events: none; }
.user-card-cover-media.is-fallback .user-card-cover-placeholder { opacity: 1; }
.user-card-cover-media.is-fallback img { opacity: 0; }
.user-card-cover-media.is-loaded img { opacity: 1; }
.user-card-body { position: relative; z-index: 2; display: flow-root; padding: 0 16px 16px; }
.user-card-identity { position: relative; z-index: 3; min-width: 0; margin-top: -29px; text-align: left; }
.user-card-identity-line { display: flex; width: 100%; min-width: 0; align-items: center; gap: 7px; isolation: isolate; }
.user-card-identity-content {
    position: relative;
    z-index: 1;
    display: flex;
    min-width: 0;
    max-width: calc(100% - 65px);
    flex: 0 1 auto;
    align-items: center;
    gap: 7px;
    isolation: isolate;
}
.user-card-identity-content::before {
    position: absolute;
    z-index: -1;
    inset: -5px -14px -5px -20px;
    border: 1px solid var(--user-card-identity-border);
    border-left: 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    background: var(--user-card-identity-bg);
    content: '';
}
.user-card-main-icon-wrap {
    display: grid;
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    place-items: center;
    overflow: hidden;
    border: 5px solid var(--user-card-avatar-border);
    border-radius: 50%;
    background: var(--user-card-avatar-bg);
    box-shadow: none;
    font-size: 1.35rem;
    z-index: 2;
    position: relative;
}
.user-card-main-icon-wrap img { width: 100%; height: 100%; object-fit: cover; opacity: 1; transition: opacity .18s ease; }
.user-card-main-icon-fallback {
    display: grid;
    position: absolute;
    inset: 0;
    place-items: center;
    color: rgba(255,255,255,.72);
    background: var(--user-card-avatar-bg);
    opacity: 1;
    transition: opacity .18s ease;
}
.user-card-main-icon-wrap.is-fallback .user-card-main-icon-fallback { opacity: 1; }
.user-card-main-icon-wrap.is-fallback img { opacity: 0; }
.user-card-main-icon-wrap.is-loaded img { opacity: 1; }
.user-card-main-icon-wrap.is-loaded .user-card-main-icon-fallback { opacity: 0; }
.user-card-profile-icon--fallback { background: rgba(124,108,255,.2); }
.user-card-name-line { display: flex; min-width: 0; flex: 1 1 auto; align-items: center; }
.user-card-name-line strong { overflow: hidden; font-size: 1.08rem; text-overflow: ellipsis; white-space: nowrap; }
.user-card-inline-icons { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 5px; }
.user-card-inline-icons:empty { display: none; }
.user-card-inline-icons .member-icon-badge { width: 28px; height: 28px; flex-basis: 28px; border-radius: 8px; font-size: .9rem; }
.user-card-activity-badge {
    display: inline-flex;
    position: absolute;
    z-index: 4;
    top: 10px;
    right: 16px;
    min-width: 0;
    max-width: 134px;
    align-items: center;
    gap: 4px;
    padding: 5px 8px;
    overflow: hidden;
    border: 1px solid var(--user-card-status-border);
    border-radius: 999px;
    color: var(--user-card-status-text);
    background: var(--user-card-status-bg);
    box-shadow: 0 5px 14px var(--user-card-status-shadow);
    font-size: .66rem;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
}
.user-card-activity-icon { flex: 0 0 auto; }
.user-card-activity-label,
.user-card-activity-secondary { overflow: hidden; text-overflow: ellipsis; }
.user-card-activity-secondary { display: none; }
.user-card-activity-badge.is-offline { opacity: .72; }
.user-card-activity-badge.is-idle { filter: saturate(.86); }
.user-card-activity-badge.is-dnd { filter: saturate(1.18); }
@media (max-width: 520px) {
    .user-card-activity-badge:not(:is(.is-screen-share, .is-voice-channel, .is-mabinogi-mobile, .is-discord-status)) {
        width: 25px;
        max-width: 25px;
        justify-content: center;
        padding: 5px 4px;
    }
    .user-card-activity-badge:not(:is(.is-screen-share, .is-voice-channel, .is-mabinogi-mobile, .is-discord-status)) .user-card-activity-label { display: none; }
}
.user-card-message { width: 100%; min-height: 20px; margin: 7px 0 15px; color: var(--user-card-muted); font-size: .82rem; line-height: 1.45; text-align: left; overflow-wrap: anywhere; }
.user-card-body h4 { display: flex; justify-content: space-between; margin: 0 0 8px; color: var(--user-card-subtle); font-size: .7rem; letter-spacing: .04em; }
.user-card-body h4 span { font-weight: 500; }
.user-card-character-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.user-card-character { padding: 9px 10px; border: 1px solid var(--user-card-item-border); border-radius: 10px; background: var(--user-card-item-bg); }
.user-card-character-line { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 8px; font-size: .72rem; }
.user-card-character-line > span { display: flex; min-width: 0; align-items: center; gap: 6px; overflow: hidden; color: #bdbac7; white-space: nowrap; }
.user-card-character-line strong { overflow: hidden; color: #f1eff7; text-overflow: ellipsis; }
.user-card-character-line strong em { margin-right: 5px; color: #f2c75c; font-size: .58rem; font-style: normal; }
.user-card-character-line i { width: 1px; height: 10px; flex: 0 0 1px; background: rgba(255,255,255,.18); }
.user-card-character-line b { flex: 0 0 auto; color: #d9d6ff; font-size: .7rem; }
.user-card-power-track { height: 4px; margin-top: 7px; overflow: hidden; border-radius: 99px; background: var(--user-card-power-track); }
.user-card-power-track span { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, var(--user-card-power-start), var(--user-card-power-end)); }
.user-card-empty { padding: 15px 8px; color: #85828e; text-align: center; font-size: .74rem; }
.user-card-loading { padding: 28px; color: #aaa7b5; text-align: center; font-size: .8rem; }

/* User-card settings */
.profile-modal-content {
    position: relative;
    width: min(940px, calc(100vw - 32px));
    max-width: 940px;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}
.profile-modal-content > .modal-scroll-body {
    --modal-scroll-edge-offset: 32px;
}
.profile-save-overlay {
    position: absolute;
    z-index: 20;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    padding: 24px;
    color: #f7f5ff;
    text-align: center;
    background: rgba(16,15,24,.82);
    backdrop-filter: blur(5px);
}
.profile-save-overlay strong { margin-top: 5px; font-size: 1rem; }
.profile-save-overlay > span:last-child { color: #c4c0d2; font-size: .78rem; }
.profile-save-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid rgba(255,255,255,.16);
    border-top-color: #8b7cff;
    border-radius: 50%;
    animation: profile-save-spin .75s linear infinite;
}
@keyframes profile-save-spin { to { transform: rotate(360deg); } }
.profile-card-editor { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 28px; align-items: start; }
.profile-card-preview-pane { position: sticky; top: 0; }
.profile-card-preview-pane .user-card-shell { overflow: hidden; border: 1px solid rgba(255,255,255,.12); border-radius: 18px; box-shadow: 0 18px 45px rgba(0,0,0,.25); }
.profile-section-label { margin: 0 0 8px; color: var(--text-secondary); font-size: .78rem; }
.profile-settings-section + .profile-settings-section { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border-default); }
.profile-settings-section-heading { margin: 0 0 16px; }
.profile-settings-section-heading .section-kicker { display: block; margin-bottom: 4px; }
.profile-settings-section-heading h3 { margin: 0; color: var(--text-main); font-size: 1.05rem; }
.profile-settings-section-heading p { margin: 5px 0 0; color: var(--text-secondary); font-size: .8rem; line-height: 1.45; }
.profile-image-controls { display: flex; min-width: 0; align-items: center; gap: 8px; }
.profile-image-controls .btn { width: auto; flex: 0 0 auto; padding: 8px 10px; font-size: .74rem; }
.profile-image-controls span { min-width: 0; flex: 1; overflow: hidden; color: var(--text-secondary); font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.profile-characters-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.profile-characters-heading label { margin: 0; }
.profile-characters-heading .btn { width: auto; padding: 7px 10px; font-size: .74rem; }
.profile-character-editor-list { display: grid; gap: 7px; }
.profile-character-editor { display: grid; grid-template-columns: 52px 1fr 1.25fr minmax(90px, .72fr) 32px; gap: 6px; align-items: stretch; }
.profile-character-editor input,
.profile-character-editor select { min-width: 0; padding: 9px; font-size: .76rem; }
.profile-primary-choice { display: grid !important; margin: 0 !important; place-items: center; align-content: center; gap: 1px; border: 1px solid var(--white-10); border-radius: 9px; cursor: pointer; }
.profile-primary-choice input { width: auto; padding: 0; accent-color: var(--primary); }
.profile-primary-choice span { font-size: .62rem; }
.profile-character-editor button { border: 0; border-radius: 8px; color: #ff9ba5; background: rgba(255,82,96,.1); cursor: pointer; }
.profile-character-empty { margin: 0; padding: 16px; border: 1px dashed rgba(255,255,255,.12); border-radius: 10px; color: var(--text-secondary); text-align: center; font-size: .76rem; }

.profile-image-crop-modal { z-index: 5000; }
.profile-image-crop-content { width: min(680px, calc(100vw - 24px)); max-width: 680px; padding: var(--modal-header-padding-top) 26px 26px; transition: width 0.2s ease, max-width 0.2s ease; }
.profile-image-crop-content.is-banner-modal { width: min(1080px, calc(100vw - 28px)); max-width: 1080px; }
.profile-image-crop-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 0; border-bottom: 0; }
.profile-image-crop-header h2 { margin: 0 0 5px; font-size: 1.25rem; }
.profile-image-crop-header p { margin: 0 0 18px; color: var(--text-secondary); font-size: .8rem; }
.profile-image-crop-stage {
    position: relative;
    container-type: size;
    width: 100%;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 14px;
    background-color: #111116;
    background-image:
        linear-gradient(45deg, rgba(255,255,255,.035) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255,255,255,.035) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255,255,255,.035) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.035) 75%);
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    background-size: 16px 16px;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
    cursor: grab;
    touch-action: none;
    user-select: none;
}
.profile-image-crop-stage.is-dragging { cursor: grabbing; }
.profile-image-crop-stage canvas { display: block; width: 100%; height: 100%; }
.profile-image-crop-stage.is-avatar { width: min(440px, 100%); margin-inline: auto; aspect-ratio: 1; border-radius: 18px; }
.profile-image-crop-stage.is-cover { aspect-ratio: 85 / 28; }
.profile-image-crop-zoom { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; margin-top: 18px; color: var(--text-secondary); font-size: .8rem; }
.profile-image-crop-zoom input { width: 100%; accent-color: var(--primary); }
.profile-image-crop-content .modal-actions { margin-top: 20px; }

@media (max-width: 760px) {
    .profile-modal-content { padding: var(--modal-header-padding-top) 18px 24px; }
    .profile-modal-content > .modal-scroll-body {
        --modal-scroll-edge-offset: 10px;
    }
    .profile-card-editor { grid-template-columns: 1fr; }
    .profile-card-preview-pane { position: static; }
    .profile-character-editor { grid-template-columns: 52px 1fr 32px; }
    .profile-character-editor input[data-character-field="name"],
    .profile-character-editor select { grid-column: 2; }
    .profile-character-editor input[data-character-field="power"] { grid-column: 1 / 3; }
    .profile-character-editor button { grid-column: 3; grid-row: 1 / 4; }
    .profile-primary-choice { grid-column: 1; grid-row: 1 / 3; }
    .profile-image-crop-content {
        --modal-scroll-edge-offset: 8px;
        padding: var(--modal-header-padding-top) 16px 20px;
    }
}
.field-help { margin-top: 7px; color: var(--text-secondary); font-size: 0.75rem; line-height: 1.45; text-align: left; }
.party-character-modal-content { width: min(460px, calc(100vw - 24px)); max-width: 460px; }
.party-character-description { margin: -10px 0 16px; color: var(--text-secondary); font-size: .82rem; }
.party-character-options { display: grid; gap: 8px; }
.party-character-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid var(--white-10);
    border-radius: 11px;
    background: rgba(255,255,255,.035);
    cursor: pointer;
}
.party-character-option:hover { border-color: rgba(139,124,255,.42); background: rgba(139,124,255,.08); }
.party-character-option:has(input:checked) { border-color: rgba(139,124,255,.65); background: rgba(139,124,255,.14); }
.party-character-option input { width: auto; flex: 0 0 auto; accent-color: var(--primary); }
.party-character-option-icon { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; border-radius: 8px; background: var(--white-08); }
.party-character-option-copy { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.party-character-option-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.party-character-option-copy small { color: var(--text-secondary); }
.party-character-empty { padding: 18px; border: 1px dashed rgba(255,255,255,.12); border-radius: 11px; color: var(--text-secondary); text-align: center; font-size: .8rem; }
.member-tag { display: inline-flex; align-items: center; gap: 5px; }
.member-badges { display: inline-flex; align-items: center; gap: 3px; }
.member-badges:empty { display: none; }
.member-icon-badge {
    width: 21px;
    height: 21px;
    display: inline-grid;
    flex: 0 0 21px;
    place-items: center;
    border: 1px solid var(--white-10);
    border-radius: 6px;
    font-family: system-ui, 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
    font-size: 0.78rem;
    line-height: 1;
    box-shadow: inset 0 1px 0 var(--white-08);
}
.member-icon-badge--admin { background: rgba(245, 158, 11, 0.18); }
.member-icon-badge--tank { background: rgba(59, 130, 246, 0.2); }
.member-icon-badge--dealer { background: rgba(239, 68, 68, 0.2); }
.member-icon-badge--healer { background: rgba(34, 197, 94, 0.2); }
.member-icon-badge--buffer { background: rgba(168, 85, 247, 0.2); }

@media (max-width: 480px) {
    .member-icon-badge { width: 20px; height: 20px; flex-basis: 20px; }
}

/* Admin-assigned icon picker */
.admin-icon-picker { display: grid; grid-template-columns: repeat(6, 42px); gap: 8px; margin: 9px 0 10px; }
.admin-icon-option {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--white-10);
    border-radius: 10px;
    background: rgba(255,255,255,0.045);
    font-family: system-ui, 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
    font-size: 1.15rem;
    cursor: pointer;
    transition: 0.18s ease;
}
.admin-icon-option:hover,
.admin-icon-option.selected { border-color: #f59e0b; background: rgba(245,158,11,0.16); transform: translateY(-1px); }
.admin-icon-custom { display: flex; align-items: center; gap: 8px; }
.admin-icon-custom #admin-icon-preview { width: 38px; height: 38px; flex-basis: 38px; font-size: 1rem; }
.admin-icon-custom input { min-width: 0; flex: 1; }
.admin-icon-custom .btn { padding-inline: 12px; }

@media (max-width: 480px) {
    .admin-icon-picker { grid-template-columns: repeat(6, minmax(36px, 1fr)); }
    .admin-icon-option { width: 100%; height: 38px; }
}

.admin-icon-picker { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); }
.admin-icon-option--milestone { height: 48px; display: flex; flex-direction: column; gap: 1px; }
.admin-icon-option--milestone small { color: var(--text-secondary); font-family: 'Paperlogy-5Medium', sans-serif; font-size: 0.55rem; line-height: 1; }
.admin-icon-option--milestone.selected small { color: #fbbf24; }

/* Categorized game statistics */
.game-category-stat { --category-color: #7c6cff; padding: 12px; border: 1px solid rgba(255,255,255,0.07); border-radius: 12px; background: rgba(255,255,255,0.025); }
.game-category-stat + .game-category-stat { margin-top: 12px; }
.game-category-stat--2 { --category-color: #38bdf8; }
.game-category-stat--3 { --category-color: #f472b6; }
.game-category-stat__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 0.84rem; }
.game-category-stat__header strong { color: var(--text-main); }
.game-category-stat__header span { color: var(--text-secondary); font-size: 0.76rem; white-space: nowrap; }
.game-category-stat__bar { height: 5px; margin: 8px 0 13px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,0.07); }
.game-category-stat__bar span { display: block; height: 100%; border-radius: inherit; background: var(--category-color); }
.game-category-stat__items { padding-left: 10px; border-left: 1px solid color-mix(in srgb, var(--category-color) 35%, transparent); }
.stats-progress-item--nested { margin-bottom: 10px; }
.stats-progress-item--nested:last-child { margin-bottom: 0; }
.stats-progress-item--nested .stats-progress-bar-bg { height: 5px; }
.stats-progress-item--nested .stats-progress-bar-fill { background: linear-gradient(90deg, var(--category-color), color-mix(in srgb, var(--category-color) 55%, white)); }

/* Guild leaderboard */
.leaderboard-modal-content { --modal-scroll-edge-offset: 0px; width: min(760px, calc(100vw - 32px)); max-width: 760px; max-height: min(860px, 90vh); overflow: hidden; padding: 0; }
.leaderboard-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: var(--modal-header-padding-top) 28px 20px; border-bottom: 1px solid var(--white-08); }
.leaderboard-header .section-kicker { margin-bottom: 7px; }
.leaderboard-header h2 { margin: 0; font-size: 1.55rem; }
.leaderboard-header p { margin-top: 5px; text-align: left; font-size: 0.82rem; }
.leaderboard-controls { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 28px 12px; }
.leaderboard-tabs, .leaderboard-periods { display: flex; gap: 5px; padding: 4px; border-radius: 11px; background: rgba(255,255,255,0.045); }
.leaderboard-tab, .leaderboard-period { padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text-secondary); font-family: 'Paperlogy-5Medium', sans-serif; font-size: 0.76rem; cursor: pointer; white-space: nowrap; }
.leaderboard-tab.active { background: rgba(124,108,255,0.2); color: #d8d4ff; box-shadow: inset 0 0 0 1px rgba(124,108,255,0.25); }
.leaderboard-period.active { background: var(--white-10); color: var(--text-main); }
.leaderboard-description { margin: 0 28px 14px; color: var(--text-secondary); font-size: 0.8rem; }
.leaderboard-list { min-height: 260px; padding: 0 28px; }
.leaderboard-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; min-height: 58px; padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,0.055); }
.leaderboard-row--top3 { margin-bottom: 6px; border: 1px solid var(--white-08); border-radius: 12px; }
.leaderboard-row.leaderboard-row--rank-1 { border-color: rgba(232, 49, 135, 0.45) !important; background: linear-gradient(100deg, rgba(232, 49, 135, 0.18), rgba(255, 120, 180, 0.05)) !important; }
.leaderboard-row.leaderboard-row--rank-2 { border-color: rgba(124, 108, 255, 0.35); background: linear-gradient(100deg, rgba(124, 108, 255, 0.12), rgba(255, 255, 255, 0.02)); }
.leaderboard-row.leaderboard-row--rank-3 { border-color: rgba(225, 150, 60, 0.3); background: linear-gradient(100deg, rgba(225, 150, 60, 0.1), rgba(255, 255, 255, 0.02)); }
.leaderboard-row.is-mine { border-color: rgba(232,49,135,0.6) !important; box-shadow: inset 0 0 0 1px rgba(232,49,135,0.35); }
.leaderboard-rank { font-family: 'Paperlogy-7Bold', sans-serif; color: var(--text-secondary); font-size: 0.9rem; text-align: center; }
.leaderboard-row--top3 .leaderboard-rank { font-size: 1.25rem; }
.leaderboard-person { display: flex; min-width: 0; align-items: center; gap: 7px; }
.leaderboard-person-icons { display: inline-flex; flex: 0 0 auto; gap: 3px; }
.leaderboard-person-name { overflow: hidden; color: var(--text-main); font-family: 'Paperlogy-6SemiBold', sans-serif; font-size: 0.88rem; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-me-badge { padding: 2px 5px; border-radius: 5px; background: rgba(232,49,135,0.15); color: #fb80b8; font-size: 0.58rem; }
.leaderboard-score { display: flex; align-items: flex-end; flex-direction: column; padding-left: 12px; }
.leaderboard-score strong { color: #ddd9ff; font-size: 0.9rem; }
.leaderboard-score span { margin-top: 1px; color: var(--text-secondary); font-size: 0.66rem; }
.leaderboard-empty { display: grid; min-height: 260px; place-items: center; color: var(--text-secondary); font-size: 0.86rem; }
.leaderboard-my-rank { margin: 16px 28px 0; padding-top: 12px; border-top: 1px solid var(--white-10); }
.leaderboard-my-label { display: block; margin: 0 0 6px 12px; color: #fb80b8; font-family: 'Paperlogy-6SemiBold', sans-serif; font-size: 0.7rem; letter-spacing: 0.08em; }
.leaderboard-my-rank .leaderboard-row { border-radius: 12px; }
.leaderboard-rule { margin: 16px 28px 26px; color: #716f7b; font-size: 0.68rem; text-align: left; }

@media (max-width: 768px) {
    #leaderboard-btn { display: none !important; }
    .leaderboard-modal-content { width: 100%; max-width: none; margin: 0; border-radius: var(--modal-radius); }
    .leaderboard-header { padding: var(--modal-header-padding-top) 18px 17px; }
    .leaderboard-header h2 { font-size: 1.35rem; }
    .leaderboard-controls { align-items: stretch; flex-direction: column; padding: 14px 14px 10px; }
    .leaderboard-tabs, .leaderboard-periods { width: 100%; }
    .leaderboard-tab, .leaderboard-period { flex: 1; padding-inline: 5px; }
    .leaderboard-description { margin: 0 18px 12px; }
    .leaderboard-list { padding: 0 12px; }
    .leaderboard-row { grid-template-columns: 36px minmax(0, 1fr) auto; padding-inline: 8px; }
    .leaderboard-my-rank { margin-inline: 12px; }
    .leaderboard-rule { margin: 14px 18px 22px; }
}

/* Global modal viewport and background scroll containment */
body.modal-scroll-locked {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
}

.modal {
    height: 100dvh;
    overscroll-behavior: none;
    overflow: hidden;
}

@media (max-width: 768px) {
    :root { --modal-header-padding-top: 16px; }

    .modal-header-shell > div { padding-right: 50px; }
    .modal-header-shell .modal-header-close,
    .profile-image-crop-header .modal-header-close {
        position: absolute;
        top: var(--modal-header-padding-top);
        right: 16px;
        z-index: 2;
    }

    .modal {
        --mobile-modal-top-space: max(10px, env(safe-area-inset-top));
        --mobile-modal-bottom-space: max(10px, env(safe-area-inset-bottom));
        align-items: center;
        padding: var(--mobile-modal-top-space) 10px var(--mobile-modal-bottom-space);
    }

    body:has(.modal:not(.hidden)) .bottom-nav {
        display: none !important;
    }

    .modal > .modal-content {
        max-height: calc(100dvh - var(--mobile-modal-top-space) - var(--mobile-modal-bottom-space)) !important;
        padding-top: var(--modal-header-padding-top);
    }

    .leaderboard-modal-content {
        height: auto;
        margin: 0;
        overscroll-behavior-y: contain;
    }

    .leaderboard-rule {
        margin-bottom: max(18px, env(safe-area-inset-bottom));
    }
}

/* Leaderboard trigger open state */
#leaderboard-btn.active { color: #ddd9ff; background: rgba(124,108,255,0.2); box-shadow: inset 0 0 0 1px rgba(124,108,255,0.3); }
#mobile-leaderboard-btn.active { color: #fbbf24; }
#mobile-leaderboard-btn.active .nav-icon { filter: drop-shadow(0 0 8px rgba(251,191,36,0.55)); }

/* Community board */
.main-surface-tabs {
    display: flex;
    align-items: center;
    width: fit-content;
    margin: 18px auto 34px;
    padding: 5px;
    border: 1px solid var(--white-08);
    border-radius: 14px;
    background: rgba(18,18,24,0.72);
    box-shadow: 0 12px 34px rgba(0,0,0,0.16);
}
.main-surface-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 20px;
    border: 0;
    border-radius: 10px;
    color: var(--text-secondary);
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    box-sizing: border-box;
    transition: color .2s ease, background .2s ease, box-shadow .2s ease;
}
.main-surface-tab:hover { color: var(--text-main); }
.main-surface-tab.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(124,108,255,.9), rgba(98,76,235,.82));
    box-shadow: 0 7px 20px rgba(78,58,210,.28);
}
.community-board { width: 100%; margin: 0 auto; }
.surface-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 0;
}
.surface-heading .section-kicker { margin-bottom: 0; }
.surface-heading h2 {
    margin: 5px 0 7px;
    font-family: 'Paperlogy-7Bold', sans-serif;
    font-size: clamp(1.65rem, 3vw, 2.25rem);
    letter-spacing: -0.04em;
}
.surface-heading p { margin: 0; color: var(--text-secondary); text-align: left; }
.board-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-bottom: 13px;
}
.board-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(360px, 100%);
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--white-10);
    border-radius: 11px;
    color: #8c8997;
    background: rgba(7,7,10,.34);
}
.board-search:focus-within { border-color: rgba(124,108,255,.55); box-shadow: 0 0 0 3px rgba(124,108,255,.1); }
.board-search input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--text-main); background: transparent; }
.board-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(255,255,255,.085);
    border-radius: 17px;
    background: rgba(27,27,35,.72);
    box-shadow: 0 16px 50px rgba(0,0,0,.15);
}
.board-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.board-table th {
    padding: 13px 17px;
    color: #8e8b99;
    border-bottom: 1px solid var(--table-divider);
    text-align: left;
    font-size: .71rem;
    letter-spacing: .04em;
}
.board-table th:first-child { width: 50%; }
.board-table th:nth-child(2) { width: 19%; }
.board-table th:nth-child(3) { width: 18%; }
.board-table th:nth-child(4) { width: 6%; text-align: center; }
.board-table th:last-child { width: 7%; text-align: center; }
.board-table td:nth-child(4),
.board-table td:nth-child(5) { text-align: center; }
.board-table td {
    padding: 16px 17px;
    border-bottom: 1px solid var(--table-divider);
    color: #cac8d2;
    font-size: .8rem;
    vertical-align: middle;
}
.board-table tbody tr:last-child td { border-bottom: 0; }
.board-post-row { cursor: pointer; transition: background .18s ease; }
.board-post-row td:first-child {
    min-width: 0;
}
.board-title-line {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.board-title-line strong {
    display: inline-block;
    overflow: hidden;
    color: #f0eef7;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .91rem;
    min-width: 0;
}
.board-unread-mention-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--danger);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 28%, transparent);
    pointer-events: none;
}
html[data-theme="light"] .board-unread-mention-dot { box-shadow: none; }
.board-post-author-line {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 4px;
    vertical-align: middle;
}
.board-post-author-line .board-role { flex: 0 0 auto; margin-right: 0; }
.board-post-author-line .user-identity-badge { min-width: 0; }
.board-edited { display: block; margin-top: 4px; color: #74717e; font-size: .62rem; }
.board-mobile-type { display: none; }
.board-comment-pill {
    position: relative;
    display: inline-grid;
    min-width: 28px;
    min-height: 24px;
    place-items: center;
    border-radius: 999px;
    color: #c8c1ff;
    background: rgba(124,108,255,.13);
    font-size: .68rem;
}
.board-view-count {
    color: var(--text-secondary);
    font-size: .72rem;
}
.board-role {
    display: inline-flex;
    align-items: center;
    margin-right: 4px;
    padding: 2px 5px;
    border: 1px solid var(--white-10);
    border-radius: 5px;
    font-size: .53rem;
    font-weight: 800;
    letter-spacing: .03em;
}
.board-role-admin { border-color: var(--badge-user-border); color: var(--badge-user-text); background: var(--badge-user-bg); }
.board-role-master { border-color: var(--badge-master-border); color: var(--badge-master-text); background: var(--badge-master-bg); }
.board-role-submaster { border-color: var(--badge-submaster-border); color: var(--badge-submaster-text); background: var(--badge-submaster-bg); }
.board-role-user { border-color: var(--badge-user-border); color: var(--badge-user-text); background: var(--badge-user-bg); }
.board-empty { padding: 34px !important; color: var(--text-secondary) !important; text-align: center !important; }
.board-pagination { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; color: var(--text-secondary); font-size: .72rem; }
.board-pagination .btn { min-height: 34px; padding: 7px 13px; }
.board-page-numbers { display: flex; align-items: center; justify-content: center; gap: 4px; }
.board-page-btn {
    min-width: 34px;
    min-height: 34px;
    padding: 6px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.board-page-btn:hover { border-color: var(--border-default); background: var(--select-bg); color: var(--text-main); }
.board-page-btn.is-active {
    border-color: var(--board-page-active-border);
    background: var(--board-page-active-bg);
    color: var(--board-page-active-text);
}
.board-page-ellipsis { min-width: 22px; text-align: center; color: var(--text-secondary); }

@media (max-width: 560px) {
    .board-pagination { gap: 5px; }
    .board-pagination .btn { min-height: 32px; padding: 6px 9px; }
    .board-page-numbers { gap: 1px; }
    .board-page-btn { min-width: 30px; min-height: 32px; padding: 4px; }
    .board-page-ellipsis { min-width: 14px; }
}

.board-back-btn {
    margin-bottom: 18px;
    padding: 0;
    border: 0;
    color: var(--board-reading-link);
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: .8rem;
}
.board-back-btn:hover { color: var(--board-reading-heading); }
.board-detail {
    overflow: hidden;
    border: 1px solid var(--board-reading-border);
    border-radius: 19px;
    background: var(--board-reading-bg);
    box-shadow: 0 18px 55px rgba(0,0,0,.18);
}
.board-detail-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 50px;
    padding: 14px 24px 0;
}
.board-detail-topbar .board-back-btn { margin: 0; }
.board-detail-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-auto-flow: row;
    align-items: stretch;
    width: 100%;
    padding: 22px 24px 20px;
    border-bottom: 1px solid var(--board-reading-divider);
}
.board-detail-title-row,
.board-detail-author-row,
.board-detail-updated-row {
    display: flex;
    align-items: center;
    width: 100%;
}
.board-detail-title-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) fit-content(42%);
    gap: 14px;
}
.board-detail-title-group { display: flex; min-width: 0; flex: 1 1 auto; align-items: center; gap: 10px; }
.board-detail-header h2 {
    display: -webkit-box;
    min-width: 0;
    max-width: 100%;
    flex: 1 1 auto;
    overflow: hidden;
    margin: 0;
    font-size: clamp(1.35rem, 3vw, 1.9rem);
    line-height: 1.28;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}
.board-type-badge { display: inline-flex; flex: 0 0 auto; padding: 4px 8px; border-radius: 7px; font-size: .64rem; font-weight: 800; white-space: nowrap; }
.board-type-notice { color: var(--badge-board-notice-text); background: var(--badge-board-notice-bg); }
.board-type-free { color: var(--badge-board-free-text); background: var(--badge-board-free-bg); }
.board-detail-author-row { justify-content: flex-end; gap: 12px; margin-top: 14px; color: var(--text-secondary); font-size: .74rem; }
.board-detail-view-count { flex: 0 0 auto; white-space: nowrap; }
.board-detail-view-count strong { color: var(--board-reading-text); }
.board-detail-author { display: flex; min-width: 0; max-width: 100%; overflow: hidden; align-items: center; justify-content: flex-end; justify-self: end; gap: 5px; font-size: .74rem; }
.board-detail-author .user-identity-badge { min-width: 0; overflow: hidden; }
.board-detail-author strong { overflow: hidden; color: var(--board-reading-text); text-overflow: ellipsis; white-space: nowrap; }
.board-author-icons { display: inline-flex; flex: 0 0 auto; gap: 3px; }
.board-detail-created { flex: 0 0 auto; white-space: nowrap; }
.board-detail-updated-row { min-height: 18px; justify-content: flex-end; margin-top: 3px; color: var(--board-reading-subtle); font-size: .66rem; }
.board-manage-menu { position: relative; z-index: 5; flex: 0 0 auto; }
.board-manage-menu summary {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 8px;
    color: var(--text-secondary);
    background: var(--white-06);
    cursor: pointer;
    font-size: 1.15rem;
    line-height: 1;
    list-style: none;
}
.board-manage-menu summary::-webkit-details-marker { display: none; }
.board-manage-menu summary:hover { color: var(--text-main); background: rgba(255,255,255,.12); }
.board-manage-popover {
    position: absolute;
    top: 36px;
    right: 0;
    display: grid;
    width: 150px;
    overflow: hidden;
    border: 1px solid var(--popover-border);
    border-radius: 10px;
    background: var(--popover-bg);
    box-shadow: var(--popover-shadow);
}
.board-manage-menu.overflow-menu--up .board-manage-popover {
    top: auto;
    bottom: 36px;
}
.board-manage-popover button {
    padding: 11px 13px;
    border: 0;
    color: var(--text-main);
    background: transparent;
    cursor: pointer;
    text-align: left;
}
.board-manage-popover button:hover { background: var(--white-08); }
.board-manage-popover .board-manage-danger { color: #ff7777; }
.board-rendered-content { min-height: 240px; padding: 30px 26px 45px; color: var(--board-reading-text); font-size: .91rem; line-height: 1.8; overflow-wrap: anywhere; text-align: left; }
.board-rendered-content p, .board-prosemirror p { text-align: left; }
.board-rendered-content > :first-child { margin-top: 0; }
.board-rendered-content h1, .board-rendered-content h2, .board-rendered-content h3, .board-rendered-content h4,
.board-prosemirror h1, .board-prosemirror h2, .board-prosemirror h3, .board-prosemirror h4 {
    margin: 1.5em 0 .6em;
    color: var(--board-reading-heading);
    line-height: 1.35;
    font-weight: 700;
}
.board-rendered-content h1, .board-prosemirror h1 { font-size: 1.65rem; }
.board-rendered-content h2, .board-prosemirror h2 { font-size: 1.38rem; }
.board-rendered-content h3, .board-prosemirror h3 { font-size: 1.18rem; }
.board-rendered-content h4, .board-prosemirror h4 { font-size: 1.02rem; }
.board-rendered-content a,
.board-prosemirror a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s ease;
}
.board-rendered-content a:hover,
.board-prosemirror a:hover {
    color: var(--accent);
}
.board-rendered-content hr,
.board-prosemirror hr {
    margin: 2em 0;
    border: 0;
    border-top: 1px solid var(--white-10);
}
.board-rendered-content ul,
.board-rendered-content ol {
    margin: .75em 0;
    padding-left: 1.7em;
    list-style-position: outside;
}
.board-rendered-content li { padding-left: .2em; }
.board-rendered-content li > ul,
.board-rendered-content li > ol { margin: .3em 0; padding-left: 1.45em; }
.board-rendered-content blockquote { margin: 1.2em 0; padding: 4px 0 4px 17px; border-left: 3px solid var(--primary); color: var(--board-reading-muted); }
.board-rendered-content pre { overflow-x: auto; padding: 16px; border-radius: 12px; background: #101016; line-height: 1.75; }
.board-rendered-content code:not(pre code),
.board-prosemirror code:not(pre code) {
    font-family: 'Mulmaru Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.88em;
    padding: 2px 6px;
    margin: 0 2px;
    border-radius: 5px;
    color: #e4e2e9;
    background: #0c0c11;
    border: 1px solid rgba(255, 255, 255, 0.09);
    font-synthesis: none;
    word-break: break-word;
}
html[data-theme="light"] .board-rendered-content code:not(pre code),
html[data-theme="light"] .board-prosemirror code:not(pre code) {
    color: #39362f;
    background: #eee9dc;
    border-color: rgba(75, 71, 58, 0.15);
}
.board-rendered-content pre code,
.board-prosemirror pre code {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    color: inherit !important;
    background: transparent !important;
    font-size: inherit !important;
}
.board-rendered-content pre,
.board-rendered-content pre code,
.board-rendered-content pre * {
    font-family: 'Mulmaru Mono', ui-monospace, monospace;
    font-size: 12px;
    font-synthesis: none;
}
.board-rendered-content img { display: block; max-width: min(100%, 900px); height: auto; margin: 22px auto; border-radius: 12px; }
.board-mention {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 5px;
    border: 1px solid var(--user-tag-border);
    border-radius: 5px;
    color: #d8d2ff;
    background: rgba(124,108,255,.17);
    font-weight: 700;
    line-height: 1.45;
    text-decoration: none;
    white-space: nowrap;
}
.board-mention .board-author-icons { align-items: center; }
.board-mention .member-icon-badge {
    width: 17px;
    height: 17px;
    flex-basis: 17px;
    border-radius: 5px;
    font-size: .62rem;
}
.board-mention-menu {
    position: fixed;
    z-index: 3200;
    display: grid;
    max-height: min(310px, 45dvh);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--popover-border);
    border-radius: 11px;
    background: var(--popover-bg);
    box-shadow: var(--popover-shadow);
}
.board-mention-option {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: center;
    padding: 9px 10px;
    border: 0;
    border-radius: 7px;
    color: var(--text-main);
    background: transparent;
    cursor: pointer;
    text-align: left;
}
.board-mention-option:hover, .board-mention-option.active { background: rgba(124,108,255,.16); }
.board-mention-option-name { display: flex; min-width: 0; align-items: center; gap: 5px; }
.board-mention-option-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-mention-option-name .member-icon-badge { width: 19px; height: 19px; flex-basis: 19px; font-size: .68rem; }
.board-mention-empty { padding: 14px 10px; color: #898693; font-size: .72rem; text-align: center; }
.board-comments { padding: 24px; border-top: 1px solid var(--board-reading-divider); background: var(--board-reading-comments-bg); }
.board-comments-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 13px; }
.board-comments-heading h3 { margin: 0; font-size: 1rem; }
.board-comments-heading span { color: var(--board-reading-link); font-size: .72rem; }
.board-comment { position: relative; padding: 14px 0; }
.board-comment + .board-comment { border-top: 1px solid var(--board-reading-divider); }
.board-comment header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
    padding: 0;
    border: 0;
    color: var(--board-reading-muted);
    font-size: .7rem;
}
.board-comment header time { color: var(--board-reading-subtle); }
.board-comment-author { display: flex; min-width: 0; align-items: center; gap: 5px; }
.board-comment-author strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-comment-author .member-icon-badge { width: 18px; height: 18px; flex-basis: 18px; font-size: .67rem; }
.board-comment p { margin: 9px 0 0; color: var(--board-reading-text); font-size: .82rem; line-height: 1.65; overflow-wrap: anywhere; text-align: left; }
.board-comment-actions { display: inline-flex; flex: 0 0 auto; gap: 8px; margin-left: 4px; }
.board-comment-actions button { padding: 0; border: 0; color: var(--board-reading-subtle); background: transparent; cursor: pointer; font-size: .65rem; }
.board-comment-actions button:last-child { color: var(--status-danger); }
.board-comment-form { display: flex; align-items: flex-end; gap: 10px; margin-top: 18px; }
.board-comment-form textarea {
    min-height: 76px;
    flex: 1;
    resize: vertical;
    padding: 12px;
    border: 1px solid var(--white-10);
    border-radius: 11px;
    outline: 0;
    color: var(--text-main);
    background: var(--board-reading-input-bg);
    font: inherit;
    font-size: .8rem;
}
.board-comment-form textarea:focus { border-color: rgba(124,108,255,.55); box-shadow: 0 0 0 3px rgba(124,108,255,.1); }
.board-comment-form-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.board-comment-form-actions .btn { white-space: nowrap; }
.board-detail-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    padding: 17px 24px 20px;
    border-top: 1px solid var(--board-reading-divider);
}
.board-detail-footer .board-back-btn { margin: 0; white-space: nowrap; }
#board-detail-prev-btn { grid-column: 1; justify-self: start; }
#board-bottom-back-btn { grid-column: 2; justify-self: center; }
#board-detail-next-btn { grid-column: 3; justify-self: end; }

.board-editor-modal-content {
    width: min(1440px, calc(100vw - 64px));
    max-width: none;
    height: min(900px, calc(100dvh - 48px));
    max-height: calc(100dvh - 48px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    padding: var(--modal-header-padding-top) 34px 24px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}
.board-editor-header {
    margin-bottom: 18px;
}
.board-editor-header h2 {
    margin: 0;
}
#board-editor-form {
    min-height: 0;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
}
#board-editor-form > .form-group { flex: 0 0 auto; }
#board-editor-title {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    padding: 0 12px;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 10px;
    outline: 0;
    color: var(--text-main);
    background: rgba(8,8,11,.4);
    font: inherit;
}
#board-editor-title:focus { border-color: rgba(124,108,255,.58); box-shadow: 0 0 0 3px rgba(124,108,255,.1); }
.board-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 16px;
    padding: 8px;
    border: 1px solid rgba(255,255,255,.09);
    border-bottom: 0;
    border-radius: 12px 12px 0 0;
    background: rgba(10,10,14,.7);
}
.board-editor-toolbar button {
    min-width: 34px;
    min-height: 32px;
    padding: 5px 8px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: #bdbac7;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: .72rem;
}
.board-editor-toolbar button:hover, .board-editor-toolbar button.active { color: #fff; border-color: rgba(124,108,255,.26); background: rgba(124,108,255,.15); }
.board-toolbar-divider { width: 1px; min-height: 24px; margin: 4px 3px; background: var(--white-10); }
.board-editor {
    min-width: 0;
    min-height: 360px;
    flex: 1;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 0 0 12px 12px;
    background: rgba(8,8,11,.35);
}
.board-prosemirror {
    min-height: 100%;
    box-sizing: border-box;
    padding: 20px;
    outline: 0;
    color: #e4e2e9;
    font-size: .9rem;
    line-height: 1.75;
    text-align: left;
}
.board-prosemirror p.is-editor-empty:first-child::before { content: '내용을 입력하세요.'; float: left; height: 0; color: #6f6c78; pointer-events: none; }
.board-prosemirror ul,
.board-prosemirror ol {
    margin: .75em 0;
    padding-left: 1.7em;
    list-style-position: outside;
}
.board-prosemirror li { padding-left: .2em; }
.board-prosemirror li > ul,
.board-prosemirror li > ol { margin: .3em 0; padding-left: 1.45em; }
.board-prosemirror img { display: block; max-width: 100%; height: auto; margin: 18px auto; border-radius: 11px; }
.board-prosemirror img[data-upload-state="uploading"] {
    min-width: min(240px, 70%);
    min-height: 120px;
    opacity: .62;
    outline: 2px dashed var(--primary);
    outline-offset: 3px;
    background: var(--card-bg);
    filter: saturate(.72);
    animation: board-image-upload-pulse 1.25s ease-in-out infinite alternate;
}
@keyframes board-image-upload-pulse {
    from { opacity: .48; }
    to { opacity: .78; }
}
.board-prosemirror img.ProseMirror-selectednode {
    outline: 3px solid var(--primary);
    outline-offset: 3px;
    box-shadow: 0 0 0 6px var(--primary-glow);
}
.board-prosemirror blockquote { padding-left: 15px; border-left: 3px solid var(--primary); color: #aaa6bb; }
.board-prosemirror pre { overflow-x: auto; padding: 14px; border-radius: 10px; background: #0c0c11; line-height: 1.75; }
.board-prosemirror pre,
.board-prosemirror pre code,
.board-prosemirror pre * {
    font-family: 'Mulmaru Mono', ui-monospace, monospace;
    font-size: 12px;
    font-synthesis: none;
}
.board-editor-usage {
    display: flex;
    flex: 0 0 auto;
    justify-content: flex-end;
    gap: 8px;
    margin: 7px 2px 0;
    color: var(--text-secondary);
    font-size: .68rem;
    font-variant-numeric: tabular-nums;
}
.board-editor-usage span {
    padding: 3px 8px;
    border: 1px solid var(--border-default);
    border-radius: 999px;
    background: var(--white-04);
}
.board-editor-usage span.is-limit { color: var(--accent); border-color: currentColor; }
.board-editor-toolbar button:disabled { opacity: .42; cursor: not-allowed; }
.board-editor-key-help { margin: 8px 2px 0; color: #777482; font-size: .65rem; line-height: 1.55; }
.board-editor-key-help kbd {
    display: inline-block;
    min-width: 18px;
    padding: 1px 4px;
    border: 1px solid rgba(255,255,255,.13);
    border-bottom-color: rgba(255,255,255,.22);
    border-radius: 4px;
    color: #aaa6b7;
    background: rgba(255,255,255,.045);
    text-align: center;
    font: inherit;
}
.board-upload-status { min-height: 16px; margin: 4px 2px 0; color: #aaa5d1; font-size: .69rem; }
.board-editor-modal-content .modal-actions { flex: 0 0 auto; margin-top: 10px; }

@media (max-width: 768px) {
    .main-surface-tabs { width: 100%; margin-bottom: 23px; }
    .main-surface-tab { min-width: 0; flex: 1; padding: 0 7px; font-size: .73rem; }
    .surface-heading p { font-size: .76rem; }
    .board-toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: stretch;
        width: 100%;
    }
    .board-search { width: auto; }
    .board-table, .board-table tbody, .board-table tr, .board-table td { display: block; width: 100%; }
    .board-table thead { display: none; }
    .board-table-wrap { overflow: hidden; }
    .board-post-row { position: relative; padding: 14px 48px 14px 15px; border-bottom: 1px solid var(--table-divider); }
    .board-post-row:last-child { border-bottom: 0; }
    .board-table td { padding: 0; border: 0; }
    .board-post-row td:first-child { margin-bottom: 9px; }
    .board-mobile-type { display: block; margin-bottom: 3px; color: #9690c8; font-size: .68rem; font-weight: 600; }
    .board-title-line { display: flex; align-items: center; gap: 6px; }
    .board-post-row td:nth-child(2), .board-post-row td:nth-child(3) { display: inline; margin-right: 7px; font-size: .67rem; }
    .board-post-row td:nth-child(4) {
        position: static;
        display: inline;
        width: auto;
        margin-left: 0;
        transform: none;
    }
    .board-post-row .board-view-count { font-size: .64rem; }
    .board-post-row .board-view-count::before { content: '조회수 '; }
    .board-post-row td:last-child {
        position: absolute;
        top: 50%;
        right: 13px;
        left: auto;
        display: block;
        width: auto;
        transform: translateY(-50%);
    }
    .board-edited { display: none; }
    .board-detail-topbar { padding-inline: 17px; }
    .board-detail-header, .board-rendered-content, .board-comments { padding-inline: 17px; }
    .board-detail-title-row { grid-template-columns: minmax(0, 1fr); gap: 9px; }
    .board-detail-title-group { gap: 7px; }
    .board-detail-header h2 { font-size: 1.22rem; }
    .board-type-badge { padding: 3px 6px; font-size: .58rem; }
    .board-detail-author-row { gap: 8px; margin-top: 12px; font-size: .68rem; }
    .board-detail-author { max-width: 100%; gap: 3px; font-size: .68rem; }
    .board-detail-author .member-icon-badge { width: 18px; height: 18px; flex-basis: 18px; font-size: .67rem; }
    .board-detail-created { font-size: .65rem; }
    .board-detail-updated-row { font-size: .61rem; }
    .board-manage-menu summary { width: 28px; height: 28px; }
    .board-manage-popover { width: 135px; }
    .board-comment header { align-items: flex-start; flex-direction: column; gap: 5px; }
    .board-comment-author { width: 100%; }
    .board-comment-form { align-items: stretch; flex-direction: column; }
    .board-comment-form-actions { align-self: flex-end; }
    .board-detail-footer { padding-inline: 17px; }
    .board-editor-modal-content {
        width: 100%;
        height: calc(100dvh - var(--mobile-modal-top-space) - var(--mobile-modal-bottom-space));
        padding: var(--modal-header-padding-top) 15px 14px;
    }
    .board-editor-header { margin-bottom: 12px; }
    .board-editor-toolbar { max-height: 96px; overflow-y: auto; }
    .board-toolbar-divider { display: none; }
    .board-editor { min-height: 0; flex-basis: 260px; }
    .board-prosemirror { min-height: 100%; padding: 15px; }
    .board-editor-key-help { font-size: .59rem; }
}

@media (max-width: 480px) {
    .modal-actions {
        flex-wrap: wrap;
    }

    .modal-actions .btn {
        min-width: min(132px, 100%);
        white-space: normal;
    }
}

/* Shared active state for exclusive desktop/mobile surfaces */
#user-profile .btn.active { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18), 0 0 16px rgba(124,108,255,0.18); filter: brightness(1.12); }
.bottom-nav .nav-item.active { color: #ffffff; background: rgba(124,108,255,0.12); border-radius: 10px; }
.bottom-nav .nav-item.active .nav-icon { transform: translateY(-1px); filter: drop-shadow(0 0 7px rgba(124,108,255,0.5)); }

@media (max-width: 768px) {
    .leaderboard-rule {
        margin-bottom: 18px;
    }
}

/* Give the connection state clear separation from the service name */
@media (min-width: 769px) {
    #status-badge { margin-left: 16px; }
}

/* Unified floating feedback for primary desktop actions */
#propose-kb-btn,
#create-btn {
    transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease !important;
}

#propose-kb-btn:hover,
#create-btn:hover {
    transform: translateY(-2px) scale(1.01) !important;
    filter: brightness(1.1);
}

#propose-kb-btn:active,
#create-btn:active {
    transform: translateY(0) scale(0.98) !important;
    filter: brightness(0.96);
}

/* Desktop header action order */
@media (min-width: 769px) {
    #admin-btn { order: -2; }
    #leaderboard-btn { order: -1; }
}

/* Keep desktop header actions aligned while preserving hierarchy */
@media (min-width: 769px) {
    #user-profile > .btn {
        height: 44px;
        min-height: 44px;
        padding-top: 0;
        padding-bottom: 0;
        line-height: 1;
    }

    #user-profile > #admin-btn,
    #user-profile > #leaderboard-btn,
    #user-profile > #logout-btn {
        height: 36px;
        min-height: 36px;
    }

    #user-name,
    #logout-btn {
        height: 36px;
        min-height: 36px;
        padding: 0 14px;
        border-radius: 12px;
        font-family: 'Paperlogy-6SemiBold', sans-serif;
        font-size: .8rem;
        font-weight: normal;
        line-height: 1;
    }
}

/* ── Account color themes ─────────────────────────────────────
   Layout, spacing and typography intentionally stay shared.
   Only semantic colors are changed by the light theme. */
html { color-scheme: dark; }
html[data-theme="light"] {
    color-scheme: light;
    --bg-dark: #f7f3e8;
    --card-bg: #fffdf7;
    --primary: #6254c7;
    --primary-glow: rgba(98,84,199,.2);
    --btn-primary-bg: var(--light-neutral);
    --btn-primary-border: var(--light-blush-border);
    --btn-primary-text: var(--text-main);
    --btn-primary-shadow: transparent;
    --secondary: #6c756f;
    --text-main: #2f2c27;
    --text-secondary: #534f48;
    --accent: #c45435;
    --accent-glow: rgba(196,84,53,.18);
    --danger: #bd3c4f;
    --glass: rgba(255,253,247,.9);
    --surface-subtle: rgba(69,65,53,.035);
    --surface-soft: rgba(69,65,53,.055);
    --border-default: rgba(75,71,58,.13);
    --text-muted: #625d55;
    --text-soft: #48443e;
    --text-faint: #706a61;
    --text-content: #36332e;
    --info: #28738a;
    --success: #3d7b55;
    --status-warning: #a56a00;
    --status-danger: #c64855;
    --rune-grade-advanced: #28784b;
    --rune-grade-rare: #2869b8;
    --rune-grade-elite: #6946c6;
    --rune-grade-epic: #c52f7d;
    --rune-grade-legendary: #c84b2c;
    --rune-grade-unique: #686868;
    --rune-grade-origin: #9b5e16;
    --rune-grade-mythic: #b87900;
    --graph-edge: rgba(82,92,88,.25);
    --graph-edge-highlight: rgba(82,92,88,.48);
    --graph-label: #545d58;
    --white: #2f2c27;
    --white-04: rgba(69,65,53,.04);
    --white-05: rgba(69,65,53,.05);
    --white-06: rgba(69,65,53,.06);
    --white-08: rgba(69,65,53,.08);
    --white-10: rgba(69,65,53,.1);
    --white-15: rgba(69,65,53,.15);
    --light-lavender: #e8e1f0;
    --light-lavender-strong: #ddd3e8;
    --light-lavender-border: #c5b5d7;
    --light-lavender-ink: #4d405b;
    --light-blush: #f1e0e2;
    --light-blush-strong: #e8d2d6;
    --light-blush-border: #d8b5bd;
    --light-blush-ink: #67404a;
    --light-neutral: #eee8dc;
    --light-neutral-strong: #e5decf;
    --light-neutral-border: #d4cbbb;
    --panel-inset-bg: var(--light-neutral);
    --panel-inset-border: var(--light-neutral-border);
    --panel-item-bg: #e6deea;
    --panel-item-border: var(--light-lavender-border);
    --panel-progress-track: #d8d0c2;
    --panel-progress-start: #8b7aa5;
    --panel-progress-end: #b18fa4;
    --party-view-toggle-bg: var(--light-neutral);
    --party-view-toggle-border: var(--light-neutral-border);
    --party-view-toggle-text: var(--light-lavender-ink);
    --party-view-toggle-track: var(--light-neutral-strong);
    --party-view-toggle-thumb: var(--text-muted);
    --party-view-toggle-track-active: var(--light-lavender-strong);
    --party-view-toggle-thumb-active: var(--light-lavender-ink);
    --party-view-toggle-focus: var(--select-focus-shadow);
    --table-divider: var(--light-neutral-border);
    --popover-bg: #fffdf7;
    --popover-border: var(--light-lavender-border);
    --popover-shadow: 0 18px 42px rgba(72,62,43,.16);
    --select-color-scheme: light;
    --native-option-bg: var(--card-bg);
    --native-option-text: var(--text-main);
    --select-bg: #f4efe4;
    --select-border: rgba(75, 71, 58, 0.22);
    --select-text: var(--text-main);
    --select-hover-border: rgba(98, 84, 199, 0.5);
    --select-focus-border: var(--primary);
    --select-focus-shadow: rgba(98, 84, 199, 0.2);
    --user-card-bg: #fffdf7;
    --user-card-text: #34312c;
    --user-card-muted: #48433d;
    --user-card-subtle: #514c45;
    --user-card-item-bg: #f4eee2;
    --user-card-item-border: var(--light-neutral-border);
    --user-card-avatar-border: var(--user-card-bg);
    --user-card-avatar-bg: var(--light-lavender);
    --user-card-identity-bg: var(--user-card-bg);
    --user-card-identity-border: transparent;
    --user-card-status-bg: var(--light-lavender);
    --user-card-status-border: var(--light-lavender-border);
    --user-card-status-text: var(--light-lavender-ink);
    --user-card-status-shadow: rgba(72,62,43,.12);
    --user-card-power-track: rgba(69,65,53,.12);
    --user-card-power-start: #8977a5;
    --user-card-power-end: #b27f98;
    --chat-panel-bg: #faf6ec;
    --chat-panel-border: var(--light-lavender-border);
    --chat-panel-shadow: 0 16px 38px rgba(72,62,43,.16);
    --chat-header-bg: var(--light-lavender);
    --chat-header-border: var(--light-lavender-border);
    --chat-assistant-bg: var(--light-neutral);
    --chat-assistant-border: var(--light-neutral-border);
    --chat-user-bg: var(--light-lavender);
    --chat-user-border: var(--light-lavender-border);
    --chat-input-area-bg: #f4eee2;
    --chat-input-bg: #faf6ec;
    --chat-input-border: var(--light-blush-border);
    --header-control-bg: var(--light-neutral);
    --header-control-border: var(--light-neutral-border);
    --header-control-text: var(--light-lavender-ink);
    --header-control-hover-bg: var(--light-neutral-strong);
    --header-control-hover-border: var(--light-neutral-border);
    --header-control-hover-text: #524561;
    --board-reading-bg: var(--card-bg);
    --board-reading-border: var(--light-neutral-border);
    --board-reading-divider: var(--light-neutral-border);
    --board-reading-comments-bg: var(--light-neutral);
    --board-reading-text: var(--text-content);
    --board-reading-heading: var(--text-main);
    --board-reading-muted: var(--text-muted);
    --board-reading-subtle: var(--text-faint);
    --board-reading-input-bg: var(--card-bg);
    --board-reading-link: var(--light-lavender-ink);
    --board-page-active-bg: var(--light-lavender);
    --board-page-active-border: var(--light-lavender-border);
    --board-page-active-text: var(--light-lavender-ink);
    --badge-admin-bg: #e7dcc2;
    --badge-admin-border: #cdbc96;
    --badge-admin-text: #6d5928;
    --badge-master-bg: #e2d7e4;
    --badge-master-border: #c6b4c9;
    --badge-master-text: #624d66;
    --badge-submaster-bg: #d7e3e7;
    --badge-submaster-border: #adc1ca;
    --badge-submaster-text: #46626e;
    --badge-user-bg: #e5ded1;
    --badge-user-border: var(--light-neutral-border);
    --badge-user-text: #514b44;
    --badge-newbie-bg: #d7f4e3;
    --badge-newbie-border: #9edcb8;
    --badge-newbie-text: #1b8a4a;
    --badge-away-bg: var(--badge-user-bg);
    --badge-away-border: var(--badge-user-border);
    --badge-away-text: var(--text-muted);
    --badge-board-notice-bg: var(--badge-admin-bg);
    --badge-board-notice-text: var(--badge-admin-text);
    --badge-board-free-bg: var(--light-lavender);
    --badge-board-free-text: var(--light-lavender-ink);
    --user-tag-border: var(--light-neutral-border);
    --bottom-nav-item-text: #514c45;
    --bottom-nav-item-hover-text: var(--light-lavender-ink);
    --bottom-nav-item-hover-bg: var(--light-neutral);
    --bottom-nav-item-pressed-bg: var(--light-neutral-strong);
    --bottom-nav-item-selected-bg: var(--light-lavender);
    --modal-scrollbar-thumb: #a99db0;
    --modal-neutral-border: #c8bead;
    --modal-panel-bg: var(--light-neutral);
    --modal-row-bg: #f7f1e6;
    --login-page-background-image: url('images/login_page_light.webp');
    --login-page-background-position: 75% 75%;
    --login-page-alternate-image: url('images/login_page_light_2.webp');
    --login-page-alternate-position: 66% 58%;
    --login-page-alternate-size: 112% auto;
    --login-page-third-image: url('images/login_page_light_3.webp');
    --login-page-third-position: 72% 30%;
    --login-page-third-size: 112% auto;
    --login-page-fourth-image: url('images/login_page_light_4.webp');
    --login-page-fourth-position: 72% 50%;
    --login-page-fourth-size: cover;
    --login-features-mobile-filter: color-mix(in srgb, var(--card-bg) 38%, transparent);
    --login-page-overlay-start: color-mix(in srgb, var(--bg-dark) 28%, transparent);
    --login-page-overlay-end: color-mix(in srgb, var(--bg-dark) 55%, transparent);
}

html[data-theme="light"] body {
    background-image:
        radial-gradient(circle at 12% -10%, rgba(98,84,199,.1), transparent 38%),
        radial-gradient(circle at 90% 75%, rgba(196,84,53,.055), transparent 34%);
}
html[data-theme="light"] .rune-card { border-color: color-mix(in srgb, var(--rune-card-grade-color) 58%, var(--border-default)); box-shadow: none; }
html[data-theme="light"] .rune-card-image { background: color-mix(in srgb, var(--rune-card-grade-color) 10%, var(--card-bg)); }

html[data-theme="light"] #main-header {
    background-color: transparent;
}
html[data-theme="light"] .brand-subtitle { color: #625d55; }
html[data-theme="light"] .badge { background: #fffdf7; }
html[data-theme="light"] .btn-secondary {
    color: var(--light-lavender-ink);
    background: var(--light-neutral);
}
html[data-theme="light"] .btn-secondary:hover { background: var(--light-neutral-strong); }
html[data-theme="light"] .btn-pink {
    color: var(--light-blush-ink) !important;
    border-color: var(--light-blush-border) !important;
    background: var(--light-blush) !important;
}
html[data-theme="light"] .hero-kicker,
html[data-theme="light"] .section-kicker { color: #50445d; }
html[data-theme="light"] .highlight {
    background: linear-gradient(90deg, #665781, #9b5368);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
html[data-theme="light"] .feature-card,
html[data-theme="light"] .party-card,
html[data-theme="light"] .modal-content,
html[data-theme="light"] .admin-section,
html[data-theme="light"] .leaderboard-modal-content {
    border-color: rgba(75,71,58,.11);
    background-color: #fffdf7;
    box-shadow: 0 18px 46px rgba(72,62,43,.1);
}
html[data-theme="light"] .party-card::before { opacity: .72; }
html[data-theme="light"] .party-card--expired,
html[data-theme="light"] .party-card--resolved { background-color: #f3efe4; }
html[data-theme="light"] .party-card--themed {
    background:
        linear-gradient(155deg, color-mix(in srgb, var(--game-card-color) 11%, #fffdf7), #fffdf7 68%);
}
html[data-theme="light"] .member-info {
    color: var(--text-content);
}
html[data-theme="light"] .member-count { color: var(--text-muted); }
html[data-theme="light"] .member-count strong { color: var(--text-main); }
html[data-theme="light"] .party-card .member-tag { color: var(--light-lavender-ink); }
html[data-theme="light"] .party-card .member-tag.leader-tag {
    border-color: #d4bd87;
    color: #5f5030;
    background: #eadfc4;
    box-shadow: none;
}
html[data-theme="light"] .leader-label {
    color: #59491f;
    background: #ddca92;
}
html[data-theme="light"] .party-memo {
    border-left-color: var(--light-lavender-border);
    color: #504a43;
    background: #f0e9dc;
}
html[data-theme="light"] .btn-memo-add {
    border-color: var(--light-blush-border);
    color: var(--light-blush-ink);
    background: #faf6ec;
}
html[data-theme="light"] .difficulty-badge {
    border-color: var(--light-blush-border);
    color: var(--light-blush-ink);
    background: var(--light-blush);
    box-shadow: none;
}
html[data-theme="light"] .difficulty-badge--hard,
html[data-theme="light"] .difficulty-badge--extreme {
    border-color: #d5b6a8;
    color: #7c4d3d;
    background: #eedbd3;
    box-shadow: none;
}
html[data-theme="light"] .status-open {
    border-color: var(--light-lavender-border);
    color: var(--light-lavender-ink);
    background: var(--light-lavender);
}
html[data-theme="light"] .status-full {
    border-color: var(--light-blush-border);
    color: var(--light-blush-ink);
    background: var(--light-blush);
}
html[data-theme="light"] .status-awaiting {
    border-color: #d5c18e;
    color: #715c2c;
    background: #eee3c8;
}
html[data-theme="light"] .status-completed {
    border-color: #b8cabd;
    color: #466653;
    background: #e1e9e1;
}
html[data-theme="light"] .status-expired,
html[data-theme="light"] .edit-date-btn,
html[data-theme="light"] .party-manage-menu summary {
    border-color: var(--light-neutral-border);
    color: #625b52;
    background: var(--light-neutral);
    filter: none;
}
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
    border-color: rgba(75,71,58,.14);
    color: var(--text-main);
    background-color: #fffdf7;
}
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder { color: #716a61; }
html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus,
html[data-theme="light"] textarea:focus {
    border-color: rgba(98,84,199,.52);
    box-shadow: 0 0 0 3px rgba(98,84,199,.1);
}
html[data-theme="light"] #user-name {
    border-color: var(--header-control-border);
    color: var(--header-control-text);
    background: var(--header-control-bg);
    box-shadow: none;
}
html[data-theme="light"] #user-name:hover {
    border-color: var(--header-control-hover-border);
    color: var(--header-control-hover-text);
    background: var(--header-control-hover-bg);
}
html[data-theme="light"] .main-surface-tabs {
    border-color: rgba(75,71,58,.11);
    background: rgba(255,253,247,.82);
    box-shadow: 0 12px 30px rgba(72,62,43,.08);
}
html[data-theme="light"] .main-surface-tab.active { color: #fff; }
html[data-theme="light"] .week-navigator,
html[data-theme="light"] .board-table-wrap,
html[data-theme="light"] .board-detail,
html[data-theme="light"] .party-members-section,
html[data-theme="light"] .game-category-stat {
    border-color: rgba(75,71,58,.1);
    background-color: rgba(255,253,247,.76);
}
html[data-theme="light"] .board-table th {
    color: #514c45;
    background: #f1ecdf;
}
html[data-theme="light"] .board-table td {
    border-color: var(--table-divider);
    color: #48443e;
}
html[data-theme="light"] .board-post-row td:first-child strong,
html[data-theme="light"] .board-detail-header h2,
html[data-theme="light"] .board-rendered-content,
html[data-theme="light"] .board-comment-body { color: #34312c; }
html[data-theme="light"] .board-post-row:hover,
html[data-theme="light"] .board-post-row:focus { background: rgba(98,84,199,.055); }
html[data-theme="light"] .board-comment-pill {
    color: var(--light-lavender-ink);
    background: var(--light-lavender);
}
html[data-theme="light"] .board-mention {
    color: var(--light-lavender-ink);
    background: var(--light-lavender);
}
html[data-theme="light"] .board-comment,
html[data-theme="light"] .board-comment-form {
    background: transparent;
}
html[data-theme="light"] .board-comment-form textarea {
    border-color: var(--light-neutral-border);
    background: var(--board-reading-input-bg);
}
html[data-theme="light"] .board-editor,
html[data-theme="light"] .board-prosemirror {
    border-color: rgba(75,71,58,.13);
    color: #34312c;
    background: #fffdf7;
}
html[data-theme="light"] #board-editor-title {
    border-color: rgba(75,71,58,.14);
    color: var(--text-main);
    background: #fffdf7;
}
html[data-theme="light"] .board-editor-toolbar,
html[data-theme="light"] .board-editor-key-help { background: #f1ecdf; }
html[data-theme="light"] .board-editor-toolbar button { color: #504b44; }
html[data-theme="light"] .board-editor-toolbar button:hover,
html[data-theme="light"] .board-editor-toolbar button.active {
    color: #4f4597;
    border-color: rgba(98,84,199,.22);
    background: rgba(98,84,199,.09);
}
html[data-theme="light"] .board-rendered-content blockquote {
    color: #625e55;
    background: rgba(98,84,199,.055);
}
html[data-theme="light"] .board-rendered-content code,
html[data-theme="light"] .board-prosemirror code { color: #a0442b; background: rgba(69,65,53,.06); }
html[data-theme="light"] .board-rendered-content pre,
html[data-theme="light"] .board-prosemirror pre { color: #39362f; background: #eee9dc; }
html[data-theme="light"] .party-manage-popover,
html[data-theme="light"] .board-manage-popover,
html[data-theme="light"] .mention-results {
    border-color: rgba(75,71,58,.13);
    background: #fffdf7;
    box-shadow: 0 16px 36px rgba(72,62,43,.16);
}
html[data-theme="light"] .party-manage-popover button,
html[data-theme="light"] .board-manage-popover button { color: #49463f; }
html[data-theme="light"] .party-manage-popover button:hover,
html[data-theme="light"] .board-manage-popover button:hover { background: rgba(69,65,53,.065); }
html[data-theme="light"] .member-tag,
html[data-theme="light"] .party-character-option,
html[data-theme="light"] .profile-primary-choice {
    border-color: rgba(75,71,58,.11);
    color: #49463f;
    background: rgba(69,65,53,.055);
}
html[data-theme="light"] .member-tag.leader-tag {
    color: #6d4d08;
    background: rgba(245,196,81,.18);
}
html[data-theme="light"] .profile-save-overlay {
    color: #34312c;
    background: rgba(250,247,238,.9);
}
html[data-theme="light"] .profile-save-overlay > span:last-child { color: #6d685f; }
html[data-theme="light"] .profile-save-spinner { border-color: rgba(75,71,58,.13); border-top-color: #6254c7; }
html[data-theme="light"] .profile-character-empty,
html[data-theme="light"] .party-character-empty { border-color: rgba(75,71,58,.14); }
html[data-theme="light"] .profile-image-crop-stage {
    border-color: rgba(75,71,58,.16);
    background-color: #ece6d8;
    background-image:
        linear-gradient(45deg, rgba(69,65,53,.045) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(69,65,53,.045) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(69,65,53,.045) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(69,65,53,.045) 75%);
}
html[data-theme="light"] .user-card-shell {
    border-color: var(--popover-border);
    background: var(--user-card-bg);
    box-shadow: var(--popover-shadow);
}
html[data-theme="light"] .user-card-popover {
    border-color: var(--popover-border);
    background: var(--popover-bg);
    box-shadow: var(--popover-shadow);
}
html[data-theme="light"] .user-card-body {
    color: var(--user-card-text);
    background: var(--user-card-bg);
}
html[data-theme="light"] .user-card-main-icon-wrap {
    border-color: var(--user-card-avatar-border);
    background: var(--user-card-avatar-bg);
    box-shadow: none;
}
html[data-theme="light"] .user-card-name-line strong,
html[data-theme="light"] .user-card-character-line strong { color: var(--user-card-text); }
html[data-theme="light"] .user-card-message,
html[data-theme="light"] .user-card-character-line > span { color: var(--user-card-muted); }
html[data-theme="light"] .user-card-body h4,
html[data-theme="light"] .user-card-loading { color: var(--user-card-subtle); }
html[data-theme="light"] .user-card-character {
    border-color: var(--user-card-item-border);
    background: var(--user-card-item-bg);
}
html[data-theme="light"] .user-card-character-line i,
html[data-theme="light"] .user-card-power-track { background: var(--user-card-power-track); }
html[data-theme="light"] .user-card-character-line b { color: #493d68; }
html[data-theme="light"] .user-card-character-line strong em { color: #705b2b; }
html[data-theme="light"] .user-card-power-track span {
    background: linear-gradient(90deg, var(--user-card-power-start), var(--user-card-power-end));
}
html[data-theme="light"] .user-card-empty { color: #625d55; }
html[data-theme="light"] .bottom-nav {
    border-color: rgba(75,71,58,.1);
    color: #514c45;
    background: rgba(255,253,247,.92);
    box-shadow: 0 -8px 24px rgba(72,62,43,.08);
}
html[data-theme="light"] .bottom-nav .nav-item { color: #514c45; }
html[data-theme="light"] .bottom-nav .nav-item.active {
    color: #50469a;
    background: rgba(98,84,199,.09);
}
html[data-theme="light"] .chat-message.bot,
html[data-theme="light"] .chat-message.system { color: #4d4942; background: #f0ebde; }
html[data-theme="light"] .chat-message.user { color: #fff; }
html[data-theme="light"] .admin-data-table th,
html[data-theme="light"] .admin-data-table td,
html[data-theme="light"] .summary-table th,
html[data-theme="light"] .summary-table td { border-color: rgba(75,71,58,.09); }
html[data-theme="light"] .admin-data-table thead tr,
html[data-theme="light"] .summary-table thead tr { background: #f1ecdf; }
html[data-theme="light"] .community-board {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}
html[data-theme="light"] #chat-panel {
    border-color: var(--chat-panel-border);
    background: var(--chat-panel-bg);
    box-shadow: var(--chat-panel-shadow);
}
html[data-theme="light"] .chat-header {
    border-bottom-color: var(--chat-header-border);
    background: var(--chat-header-bg);
}
html[data-theme="light"] .chat-title { color: #332d38; }
html[data-theme="light"] .chat-status { color: #3f654d; }
html[data-theme="light"] .chat-ai-avatar,
html[data-theme="light"] #chat-fab {
    border: 1px solid var(--light-blush-border);
    color: var(--light-blush-ink);
    background: linear-gradient(145deg, var(--light-lavender-strong), var(--light-blush-strong));
    box-shadow: none;
}
html[data-theme="light"] #chat-fab:hover {
    transform: none;
    box-shadow: none;
}
html[data-theme="light"] #chat-fab::before { display: none; }
html[data-theme="light"] #chat-close-btn {
    border: 1px solid var(--light-blush-border);
    color: var(--light-blush-ink);
    background: #faf6ec;
}
html[data-theme="light"] #chat-support-link:hover,
html[data-theme="light"] #chat-support-link:focus-visible {
    border-color: var(--light-neutral-border);
    background: var(--light-neutral);
}
html[data-theme="light"] #chat-close-btn:hover { background: var(--light-blush); }
html[data-theme="light"] .chat-messages {
    background: var(--chat-panel-bg);
    scrollbar-color: var(--light-lavender-border) transparent;
}
html[data-theme="light"] .chat-bubble.assistant {
    border-color: var(--chat-assistant-border);
    color: #3e3a35;
    background: var(--chat-assistant-bg);
}
html[data-theme="light"] .chat-bubble.user {
    border-color: var(--chat-user-border);
    color: var(--light-lavender-ink);
    background: var(--chat-user-bg);
}
html[data-theme="light"] .chat-bubble.error {
    border: 1px solid var(--light-blush-border);
    color: #844d58;
    background: var(--light-blush);
}
html[data-theme="light"] .chat-bubble.typing span { background: #8e819c; }
html[data-theme="light"] .chat-link {
    color: #514061;
    text-decoration-color: #b7a8c5;
}
html[data-theme="light"] .chat-link:hover { color: #51415f; }
html[data-theme="light"] .chat-input-area {
    border-top-color: var(--chat-header-border);
    background: var(--chat-input-area-bg);
}
html[data-theme="light"] #chat-input {
    border-color: var(--chat-input-border);
    color: var(--text-main);
    background: var(--chat-input-bg);
}
html[data-theme="light"] #chat-input:focus {
    border-color: var(--light-lavender-border);
    box-shadow: none;
}
html[data-theme="light"] #chat-send-btn {
    border: 1px solid var(--light-lavender-border);
    color: var(--light-lavender-ink);
    background: var(--light-lavender);
    box-shadow: none;
}
html[data-theme="light"] #chat-send-btn:hover {
    transform: none;
    background: var(--light-lavender-strong);
}

/* Light-theme interactions use opaque pastel surfaces instead of dark-mode glow. */
html[data-theme="light"] .btn,
html[data-theme="light"] .icon-btn,
html[data-theme="light"] .week-nav-btn,
html[data-theme="light"] .nav-item {
    border: 1px solid var(--light-lavender-border);
    color: var(--light-lavender-ink);
    background-color: #faf6ec;
    box-shadow: none !important;
    filter: none !important;
}
html[data-theme="light"] .btn:hover,
html[data-theme="light"] .btn:active,
html[data-theme="light"] .icon-btn:hover,
html[data-theme="light"] .icon-btn:active,
html[data-theme="light"] .week-nav-btn:hover,
html[data-theme="light"] .week-nav-btn:active {
    border-color: #b9a7cd;
    color: #524561;
    background: var(--light-lavender);
    box-shadow: none !important;
    filter: none !important;
}
html[data-theme="light"] .btn-primary,
html[data-theme="light"] .btn-call,
html[data-theme="light"] .btn-join,
html[data-theme="light"] .primary-btn,
html[data-theme="light"] .nav-item.nav-item-primary {
    border-color: var(--light-lavender-border) !important;
    color: var(--light-lavender-ink) !important;
    background: var(--light-lavender) !important;
    box-shadow: none !important;
    filter: none !important;
}
html[data-theme="light"] .btn-primary:hover,
html[data-theme="light"] .btn-call:hover,
html[data-theme="light"] .btn-join:hover,
html[data-theme="light"] .primary-btn:hover,
html[data-theme="light"] .nav-item.nav-item-primary:hover {
    border-color: #b6a3ca !important;
    color: #51435f !important;
    background: var(--light-lavender-strong) !important;
    box-shadow: none !important;
    filter: none !important;
}
html[data-theme="light"] .btn-pink:hover,
html[data-theme="light"] .btn-pink:active,
html[data-theme="light"] .nav-item.btn-pink-text:hover {
    color: #70464f !important;
    border-color: #cda5ae !important;
    background: var(--light-blush-strong) !important;
    box-shadow: none !important;
    filter: none !important;
}
html[data-theme="light"] .btn-danger,
html[data-theme="light"] .btn-leave {
    border-color: var(--light-blush-border);
    color: #844d58;
    background: var(--light-blush);
    box-shadow: none;
}
html[data-theme="light"] .btn-warning {
    border-color: #d4c29d;
    color: #735f38;
    background: #eee5d2;
}
html[data-theme="light"] .btn-success {
    border-color: #b6cbbd;
    color: #466653;
    background: #e1e9e1;
}
html[data-theme="light"] .btn:disabled,
html[data-theme="light"] .week-nav-btn:disabled {
    border-color: #ddd5c7;
    color: #7b746a;
    background: #f1ecdf;
    box-shadow: none;
    opacity: 1;
}
html[data-theme="light"] .btn:focus-visible,
html[data-theme="light"] .week-nav-btn:focus-visible,
html[data-theme="light"] .icon-btn:focus-visible,
html[data-theme="light"] .nav-item:focus-visible {
    outline: 2px solid #bca9cf;
    outline-offset: 2px;
    box-shadow: none !important;
}
html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus,
html[data-theme="light"] textarea:focus,
html[data-theme="light"] .party-search-box:focus-within,
html[data-theme="light"] .party-member-search:focus-within,
html[data-theme="light"] .board-search:focus-within,
html[data-theme="light"] .board-comment-form textarea:focus,
html[data-theme="light"] #board-editor-title:focus {
    border-color: var(--light-lavender-border);
    box-shadow: none;
}
html[data-theme="light"] .party-filter-check {
    border-color: var(--light-blush-border);
    color: #4d4842;
    background: #faf6ec;
}
html[data-theme="light"] .party-filter-check:has(input:checked) {
    border-color: var(--light-lavender-border);
    color: var(--light-lavender-ink);
    background: var(--light-lavender);
}
html[data-theme="light"] .party-filter-check input,
html[data-theme="light"] .party-character-option input,
html[data-theme="light"] .profile-primary-choice input {
    accent-color: #7565a0;
}
html[data-theme="light"] .party-search-box,
html[data-theme="light"] .board-search,
html[data-theme="light"] .party-member-search {
    border-color: var(--light-blush-border);
    color: #5d564e;
    background: #faf6ec;
}
html[data-theme="light"] .party-search-box input::placeholder,
html[data-theme="light"] .board-search input::placeholder,
html[data-theme="light"] .party-member-search input::placeholder {
    color: #71695f;
}
html[data-theme="light"] .party-character-option:hover,
html[data-theme="light"] .party-character-option:has(input:checked) {
    border-color: var(--light-lavender-border);
    color: var(--light-lavender-ink);
    background: var(--light-lavender);
    box-shadow: none;
}
html[data-theme="light"] .main-surface-tab {
    border: 1px solid transparent;
    color: #504a43;
}
html[data-theme="light"] .main-surface-tab:hover {
    border-color: var(--light-blush-border);
    color: var(--light-blush-ink);
    background: var(--light-blush);
}
html[data-theme="light"] .main-surface-tab.active {
    border-color: var(--light-lavender-border);
    color: var(--light-lavender-ink);
    background: var(--light-lavender);
    box-shadow: none;
}
html[data-theme="light"] .leaderboard-tab.active,
html[data-theme="light"] .leaderboard-period.active,
html[data-theme="light"] .admin-tab-btn.active,
html[data-theme="light"] .kb-tab-btn.active {
    border-color: var(--light-lavender-border);
    color: var(--light-lavender-ink);
    background: var(--light-lavender);
    box-shadow: none;
}
html[data-theme="light"] #user-profile .btn.active,
html[data-theme="light"] .bottom-nav .nav-item.active {
    border-color: var(--light-lavender-border);
    color: var(--light-lavender-ink);
    background: var(--light-lavender);
    box-shadow: none;
    filter: none;
}
html[data-theme="light"] .bottom-nav .nav-item.active .nav-icon,
html[data-theme="light"] #mobile-leaderboard-btn.active .nav-icon {
    filter: none;
}
@media (max-width: 768px) {
    html[data-theme="light"] .bottom-nav .nav-item,
    html[data-theme="light"] .bottom-nav .nav-item.nav-item-primary,
    html[data-theme="light"] .bottom-nav .nav-item.active {
        border: 0 !important;
    }
}

/* Public login surface: the class exists in the initial HTML, before auth runs. */
html body.login-page {
    position: relative;
    isolation: isolate;
    background-color: var(--bg-dark);
    background-image:
        linear-gradient(to bottom, var(--login-page-overlay-start), var(--login-page-overlay-end)),
        var(--login-page-background-image);
    background-position: center, var(--login-page-background-position);
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

html body.login-page #welcome-section.hero-section {
    display: flex;
    min-height: calc(100svh - 82px);
    flex-direction: column;
    animation-name: loginFadeIn;
}

@keyframes loginFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

html body.login-page .hero-actions {
    margin-bottom: clamp(64px, 10vh, 120px);
}

html body.login-page #login-btn.btn-primary {
    border-color: var(--btn-primary-border) !important;
    color: var(--btn-primary-text) !important;
    background: var(--btn-primary-bg) !important;
    box-shadow: 0 4px 15px var(--btn-primary-shadow) !important;
}

html body.login-page #login-btn.btn-primary:hover {
    filter: brightness(1.08) !important;
}

html body.login-page .features-grid {
    width: 100%;
    margin-top: auto;
}

html body.login-page .feature-card,
html[data-theme="light"] body.login-page .feature-card {
    background: transparent;
    box-shadow: none;
}

html body.login-page::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(to bottom, var(--login-page-overlay-start), var(--login-page-overlay-end)),
        var(--login-page-alternate-image);
    background-position: center, var(--login-page-alternate-position);
    background-size: cover, var(--login-page-alternate-size);
    background-repeat: no-repeat;
    opacity: 0;
    animation: loginBackgroundAlternate 60s ease-in-out infinite;
    animation-delay: var(--login-dark-animation-delay);
}

html[data-theme="light"] body.login-page::before {
    animation-name: loginBackgroundSecond;
    animation-duration: 120s;
    animation-delay: var(--login-light-animation-delay);
}

html[data-theme="light"] body.login-page::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(to bottom, var(--login-page-overlay-start), var(--login-page-overlay-end)),
        var(--login-page-third-image);
    background-position: center, var(--login-page-third-position);
    background-size: cover, var(--login-page-third-size);
    background-repeat: no-repeat;
    opacity: 0;
    animation: loginBackgroundThird 120s ease-in-out infinite;
    animation-delay: var(--login-light-animation-delay);
}

html body.login-page .login-background-fourth {
    display: none;
}

html[data-theme="light"] body.login-page .login-background-fourth {
    display: block;
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(to bottom, var(--login-page-overlay-start), var(--login-page-overlay-end)),
        var(--login-page-fourth-image);
    background-position: center, var(--login-page-fourth-position);
    background-size: cover, var(--login-page-fourth-size);
    background-repeat: no-repeat;
    opacity: 0;
    animation: loginBackgroundFourth 120s ease-in-out infinite;
    animation-delay: var(--login-light-animation-delay);
}

@keyframes loginBackgroundAlternate {
    0%, 45%, 100% { opacity: 0; }
    50%, 95% { opacity: 1; }
}

@keyframes loginBackgroundSecond {
    0%, 21%, 50%, 100% { opacity: 0; }
    25%, 46% { opacity: 1; }
}

@keyframes loginBackgroundThird {
    0%, 46%, 75%, 100% { opacity: 0; }
    50%, 71% { opacity: 1; }
}

@keyframes loginBackgroundFourth {
    0%, 71%, 100% { opacity: 0; }
    75%, 96% { opacity: 1; }
}

@media (max-aspect-ratio: 8 / 5) {
    html[data-theme="light"] {
        --login-page-alternate-size: auto 112%;
        --login-page-third-size: auto 112%;
    }
}

@media (prefers-reduced-motion: reduce) {
    html body.login-page::before,
    html body.login-page::after,
    html body.login-page .login-background-fourth {
        animation: none;
    }
}

@media (max-width: 768px) {
    html body.login-page {
        background-attachment: scroll;
    }

    html body.login-page .hero-actions {
        position: fixed;
        top: 12px;
        right: max(14px, env(safe-area-inset-right));
        z-index: 101;
        margin: 0;
    }

    html body.login-page #login-btn {
        min-height: 42px;
        padding: 9px 12px;
        font-size: 0.75rem;
    }

    html body.login-page #welcome-section.hero-section {
        min-height: calc(100svh - 66px);
    }

    html body.login-page #app {
        padding-bottom: 0;
    }

    html body.login-page .features-grid {
        border-radius: var(--radius-md);
        background: var(--login-features-mobile-filter);
    }

    html[data-theme="light"] body.login-page .hero-copy-panel {
        margin-bottom: 34px;
        padding: 18px 10px 20px;
        border-radius: var(--radius-md);
        background: var(--login-features-mobile-filter);
    }

    html[data-theme="light"] body.login-page .hero-copy-panel .hero-subtitle {
        margin-bottom: 0;
    }
}
html[data-theme="light"] .party-card:hover,
html[data-theme="light"] .party-card--themed:hover {
    border-color: var(--light-neutral-border);
    box-shadow: none;
}
html[data-theme="light"] .user-identity-badge:hover,
html[data-theme="light"] .user-identity-badge:focus-visible,
html[data-theme="light"] .board-mention-option:hover,
html[data-theme="light"] .board-mention-option.active {
    color: var(--light-lavender-ink);
    background: var(--light-lavender);
    box-shadow: none;
}
html[data-theme="light"] #propose-kb-btn:hover,
html[data-theme="light"] #create-btn:hover,
html[data-theme="light"] #propose-kb-btn:active,
html[data-theme="light"] #create-btn:active {
    transform: none !important;
    filter: none !important;
    box-shadow: none !important;
}
html[data-theme="light"] #status-badge,
html[data-theme="light"] body:has(#dashboard-section:not(.hidden)) #status-badge {
    box-shadow: none;
}
@media (min-width: 769px) {
    html[data-theme="light"] #create-btn {
        border: 0 !important;
    }
    html[data-theme="light"] #admin-btn,
    html[data-theme="light"] #leaderboard-btn,
    html[data-theme="light"] #logout-btn {
        border-color: var(--light-neutral-border) !important;
    }
}
html[data-theme="light"] .main-surface-tabs,
html[data-theme="light"] .week-navigator {
    border-color: var(--panel-inset-border);
    background: var(--panel-inset-bg);
    box-shadow: none;
    backdrop-filter: none;
}
html[data-theme="light"] .dashboard-heading p,
html[data-theme="light"] .board-heading p,
html[data-theme="light"] .week-range,
html[data-theme="light"] .field-note,
html[data-theme="light"] .field-help,
html[data-theme="light"] .party-filter-check small,
html[data-theme="light"] .party-filter-result,
html[data-theme="light"] .board-edited,
html[data-theme="light"] .board-editor-key-help,
html[data-theme="light"] .leaderboard-description,
html[data-theme="light"] .leaderboard-rule {
    color: #5d574f;
}
html[data-theme="light"] #party-count,
html[data-theme="light"] #party-count-copy {
    color: #44384f;
}
html[data-theme="light"] .leaderboard-score strong,
html[data-theme="light"] .leaderboard-me-badge,
html[data-theme="light"] .leaderboard-my-label,
html[data-theme="light"] .board-mobile-type,
html[data-theme="light"] .admin-icon-option--milestone.selected small {
    color: #5b4658;
}

@media (max-width: 768px) {
    html[data-theme="light"] #main-header {
        background: rgba(247,243,232,.94);
        box-shadow: 0 6px 22px rgba(72,62,43,.07);
    }

    #user-name,
    #admin-btn,
    #logout-btn {
        height: 36px;
        min-height: 36px;
        padding: 0 10px !important;
        border-radius: 10px;
        font-family: 'Paperlogy-6SemiBold', sans-serif;
        line-height: 1;
    }

    #user-name,
    #admin-btn {
        font-size: .72rem !important;
        font-weight: normal;
    }

    #logout-btn::after {
        font-family: 'Paperlogy-6SemiBold', sans-serif;
        font-size: .72rem;
        font-weight: normal;
        line-height: 1;
    }

    #user-name .user-display-name {
        font: inherit;
    }

    html[data-theme] .bottom-nav .nav-item {
        border: 0 !important;
        border-radius: 10px;
        color: var(--bottom-nav-item-text) !important;
        background: transparent !important;
        box-shadow: none !important;
        filter: none !important;
        transform: none;
        transition: color .16s ease, background-color .16s ease, transform .1s ease;
    }

    html[data-theme] .bottom-nav .nav-item:hover,
    html[data-theme] .bottom-nav .nav-item:focus-visible {
        color: var(--bottom-nav-item-hover-text) !important;
        background: var(--bottom-nav-item-hover-bg) !important;
    }

    html[data-theme] .bottom-nav .nav-item.active {
        color: var(--bottom-nav-item-hover-text) !important;
        background: var(--bottom-nav-item-selected-bg) !important;
    }

    html[data-theme] .bottom-nav .nav-item:active {
        color: var(--bottom-nav-item-hover-text) !important;
        background: var(--bottom-nav-item-pressed-bg) !important;
        transform: scale(.97);
    }

    html[data-theme] .bottom-nav .nav-item .nav-icon {
        transform: none;
        filter: none !important;
    }
}

/* Modal defaults stay neutral; semantic focus, selection and action states keep accents. */
html[data-theme="light"] .modal .modal-content,
html[data-theme="light"] .modal :is(input, select, textarea):not(:focus),
html[data-theme="light"] .modal .party-member-edit-row,
html[data-theme="light"] .modal .admin-table-container,
html[data-theme="light"] .modal .admin-section,
html[data-theme="light"] .modal .profile-primary-choice,
html[data-theme="light"] .modal .profile-card-preview-pane .user-card-shell {
    border-color: var(--modal-neutral-border);
}

html[data-theme="light"] .modal .btn-secondary,
html[data-theme="light"] .modal .icon-btn,
html[data-theme="light"] .modal .modal-corner-close {
    border-color: var(--modal-neutral-border) !important;
}

html[data-theme="light"] .modal .btn-secondary:hover,
html[data-theme="light"] .modal .btn-secondary:active,
html[data-theme="light"] .modal .icon-btn:hover,
html[data-theme="light"] .modal .icon-btn:active,
html[data-theme="light"] .modal .modal-corner-close:hover,
html[data-theme="light"] .modal .modal-corner-close:active {
    border-color: var(--modal-neutral-border) !important;
}

html[data-theme="light"] .modal .party-character-option:not(:hover):not(:has(input:checked)) {
    border-color: var(--modal-neutral-border);
}

html[data-theme="light"] .modal :is(
    .modal-header,
    .admin-header,
    .admin-tabs,
    .leaderboard-header,
    .leaderboard-my-rank
) {
    border-color: var(--modal-neutral-border);
}

html[data-theme="light"] .modal :is(.stat-card, .chart-card) {
    border-color: var(--modal-neutral-border);
    background: var(--modal-panel-bg);
}

html[data-theme="light"] .modal .stat-card.danger {
    border-color: var(--light-blush-border);
    background: var(--light-blush);
}

html[data-theme="light"] .modal .stat-icon {
    background: var(--modal-row-bg);
}

html[data-theme="light"] .modal .game-category-stat {
    border-color: var(--modal-neutral-border);
    background: var(--modal-row-bg);
}

html[data-theme="light"] .modal .leaderboard-row {
    margin-bottom: 6px;
    border: 1px solid var(--modal-neutral-border);
    border-radius: 12px;
    background: var(--modal-row-bg);
}

html[data-theme="light"] .modal .leaderboard-row--top3 {
    border-color: var(--modal-neutral-border);
}

html[data-theme="light"] .modal .leaderboard-row.leaderboard-row--rank-1 {
    border-color: var(--light-blush-border) !important;
    background: linear-gradient(100deg, #fce8f0, #fffcf7) !important;
}

html[data-theme="light"] .modal .leaderboard-row.leaderboard-row--rank-2 {
    border-color: var(--light-lavender-border);
    background: linear-gradient(100deg, var(--light-lavender), var(--modal-row-bg));
}

html[data-theme="light"] .modal .leaderboard-row.leaderboard-row--rank-3 {
    border-color: rgba(215, 160, 80, 0.35);
    background: linear-gradient(100deg, #f8efe0, var(--modal-row-bg));
}

html[data-theme="light"] .modal .leaderboard-row.is-mine {
    border-color: #e83187 !important;
    box-shadow: inset 0 0 0 1.5px #e83187;
}

/* ── Guild Header Banner Component ── */
.guild-header-banner-hero {
    position: relative;
    width: 100%;
    padding: 16px;
    margin-bottom: 24px;
    border-radius: 0;
    overflow: hidden;
    background: transparent;
    transition: background-image 0.25s ease-in-out;
}
.guild-header-banner-hero.has-banner {
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    box-shadow: none;
}
.guild-header-banner-hero .guild-banner-overlay,
.crop-stage-ui-overlay .guild-banner-overlay {
    display: none !important;
}
.guild-header-banner-hero .guild-banner-hero-content {
    position: relative;
    z-index: 2;
}
.guild-header-banner-hero .main-surface-tabs {
    position: relative;
    z-index: 2;
    margin: 18px auto 34px;
}

/* ── Guild Header Banner: Mobile Edge-to-Edge (must come after width: 100% base rule) ── */
@media (max-width: 768px) {
    .guild-header-banner-hero {
        margin-left: -14px;
        margin-right: -14px;
        width: auto;
        padding: 12px 14px 16px;
    }
    .guild-header-banner-hero .main-surface-tabs {
        margin: 0 auto 12px;
    }
}

/* ── Cropper Modal 3-Viewport Live Preview Switcher ── */
.profile-image-crop-target {
    display: flex;
    justify-content: flex-start;
    margin: 0 0 12px;
}
.profile-image-crop-target-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid rgba(175, 156, 255, 0.45);
    border-radius: 999px;
    background: rgba(124, 108, 255, 0.12);
    color: var(--text-main);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.profile-image-crop-stage.is-banner {
    aspect-ratio: 1160 / 317;
    max-height: 320px;
    border-radius: 14px;
}
.profile-image-crop-stage.is-banner-mobile {
    aspect-ratio: 2.25 / 1;
    max-width: 520px;
    max-height: 280px;
    margin-inline: auto;
}
.profile-image-crop-stage.is-banner-desktop {
    aspect-ratio: 1160 / 317;
    max-height: 320px;
}
/* ── Cropper Stage Exact Real UI Overlay ── */
.crop-stage-ui-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.38cqw;
    border-radius: inherit;
    overflow: hidden;
    transition: opacity 0.2s ease;
}

.crop-stage-ui-overlay.hidden {
    display: none !important;
}

/* Reused exact layout elements inside stage */
.crop-stage-ui-overlay .main-surface-tabs {
    position: relative;
    z-index: 2;
    margin: 1.55cqw auto 2.93cqw;
    padding: .43cqw;
    gap: 0;
    display: flex;
    align-items: center;
}

.crop-stage-ui-overlay .main-surface-tab {
    cursor: default;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-sizing: border-box;
    min-height: 3.45cqw;
    padding: 0 1.72cqw;
    border-radius: .86cqw;
    font-size: 1.13cqw;
}

.crop-stage-ui-overlay .guild-banner-hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
}

.crop-stage-ui-overlay .surface-heading {
    margin-bottom: 0;
}

.crop-stage-ui-overlay[data-theme="light"] .surface-heading h2 {
    color: var(--text-main, #2b2319);
}

.crop-stage-ui-overlay[data-theme="light"] .surface-heading p {
    color: var(--text-secondary, #6b5c4d);
}

.crop-stage-ui-overlay[data-theme="dark"] .surface-heading h2,
.crop-stage-ui-overlay:not([data-theme="light"]) .surface-heading h2 {
    color: #ffffff;
}

.crop-stage-ui-overlay[data-theme="dark"] .surface-heading p,
.crop-stage-ui-overlay:not([data-theme="light"]) .surface-heading p {
    color: rgba(255, 255, 255, 0.75);
}

/* Adjustments for Mobile Banner Crop Stage (is-banner-mobile) */
.profile-image-crop-stage.is-banner-mobile .crop-stage-ui-overlay,
.crop-stage-ui-overlay[data-variant="mobile"] {
    padding: 1.33cqw 1.56cqw;
}

.profile-image-crop-stage.is-banner-mobile .crop-stage-ui-overlay .main-surface-tabs,
.crop-stage-ui-overlay[data-variant="mobile"] .main-surface-tabs {
    width: 100%;
    margin: 0 0 1.33cqw;
    padding: .56cqw;
    display: flex;
    align-items: center;
}

.profile-image-crop-stage.is-banner-mobile .crop-stage-ui-overlay .main-surface-tab,
.crop-stage-ui-overlay[data-variant="mobile"] .main-surface-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
    min-height: 3.56cqw;
    padding: 0 .78cqw;
    font-size: .81cqw;
    line-height: 1;
    box-sizing: border-box;
    text-align: center;
}

.profile-image-crop-stage.is-banner-mobile .crop-stage-ui-overlay .surface-heading,
.crop-stage-ui-overlay[data-variant="mobile"] .surface-heading {
    align-items: center;
}

.profile-image-crop-stage.is-banner-mobile .crop-stage-ui-overlay .section-kicker,
.crop-stage-ui-overlay[data-variant="mobile"] .section-kicker {
    font-size: 0.58rem;
}

.profile-image-crop-stage.is-banner-mobile .crop-stage-ui-overlay h2,
.crop-stage-ui-overlay[data-variant="mobile"] h2 {
    font-size: 1.1rem;
    margin: 2px 0 4px;
}

.profile-image-crop-stage.is-banner-mobile .crop-stage-ui-overlay p,
.crop-stage-ui-overlay[data-variant="mobile"] p {
    font-size: 0.76rem;
}

.profile-image-crop-stage.is-banner-mobile .crop-stage-ui-overlay .week-today-btn,
.crop-stage-ui-overlay[data-variant="mobile"] .week-today-btn {
    padding: 6px 10px;
    font-size: 0.72rem;
    flex-shrink: 0;
}

/* ── Admin Modal Banner Cards ── */
.admin-banner-section {
    padding: 12px 4px;
}
.admin-banner-header h3 {
    margin: 0 0 6px;
    font-size: 1.1rem;
}
.admin-banner-desc {
    margin: 0 0 6px;
    font-size: 0.84rem;
    color: var(--text-secondary);
}
.admin-banner-spec {
    margin: 0 0 20px;
    font-size: 0.78rem;
    color: var(--text-tertiary);
}
.admin-banner-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}
.admin-banner-card {
    border: 1px solid var(--white-10);
    border-radius: 16px;
    padding: 16px;
    background: var(--surface-subtle);
}
.admin-banner-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.admin-banner-card-top h4 {
    margin: 0;
    font-size: 0.95rem;
}
.admin-banner-preview-box {
    container-type: inline-size;
    position: relative;
    width: 100%;
    border-radius: 10px;
    border: 1px dashed var(--white-15);
    background: rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.admin-banner-preview-box.is-desktop {
    aspect-ratio: 1160 / 317;
}
.admin-banner-preview-box.is-mobile {
    aspect-ratio: 2.25 / 1;
}
.admin-banner-preview-box img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.admin-banner-preview-ui {
    --preview-nav-bg: rgba(18, 18, 24, .78);
    --preview-nav-border: rgba(255, 255, 255, .18);
    --preview-nav-text: rgba(255, 255, 255, .84);
    --preview-nav-active-bg: rgba(124, 108, 255, .32);
    --preview-nav-active-text: #fff;
    position: absolute;
    z-index: 1;
    inset: 0;
    pointer-events: none;
}
.admin-banner-preview-ui.is-light {
    --preview-nav-bg: rgba(255, 253, 247, .86);
    --preview-nav-border: rgba(75, 71, 58, .2);
    --preview-nav-text: #534f48;
    --preview-nav-active-bg: rgba(98, 84, 199, .18);
    --preview-nav-active-text: #2f2c27;
}
.admin-banner-preview-ui .main-surface-tabs {
    display: flex;
    align-items: center;
    width: max-content;
    max-width: calc(100% - 8cqw);
    margin: 2.93cqw auto 0;
    padding: .43cqw;
    gap: 0;
    border: 1px solid var(--preview-nav-border);
    border-radius: 1.2cqw;
    background: var(--preview-nav-bg);
    box-shadow: 0 .9cqw 2.2cqw rgba(0, 0, 0, .16);
}
.admin-banner-preview-ui .main-surface-tab {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    min-height: 3.45cqw;
    padding: 0 1.72cqw;
    border-radius: .86cqw;
    color: var(--preview-nav-text);
    font-family: 'Paperlogy-5Medium', sans-serif;
    font-size: clamp(6px, 1.13cqw, 13px);
    line-height: 1.1;
    white-space: nowrap;
}
.admin-banner-preview-ui .main-surface-tab.active {
    background: var(--preview-nav-active-bg);
    color: var(--preview-nav-active-text);
}
/* The preview's theme belongs to its banner, never to the surrounding admin page. */
html .admin-banner-preview-ui .main-surface-tabs {
    border-color: var(--preview-nav-border);
    background: var(--preview-nav-bg);
}
html .admin-banner-preview-ui .main-surface-tab {
    border: 1px solid transparent;
    color: var(--preview-nav-text);
    background: transparent;
    box-shadow: none;
}
html .admin-banner-preview-ui .main-surface-tab:hover {
    border-color: transparent;
    color: var(--preview-nav-text);
    background: transparent;
}
html .admin-banner-preview-ui .main-surface-tab.active {
    border-color: transparent;
    color: var(--preview-nav-active-text);
    background: var(--preview-nav-active-bg);
    box-shadow: none;
}
.admin-banner-preview-box.is-mobile .admin-banner-preview-ui .main-surface-tabs {
    width: calc(100% - 8cqw);
    max-width: none;
    margin: 1.33cqw auto 0;
    padding: .56cqw;
    gap: 0;
}
.admin-banner-preview-box.is-mobile .admin-banner-preview-ui .main-surface-tab {
    flex: 1 1 0;
    min-height: 3.56cqw;
    padding: 0 .78cqw;
    font-size: clamp(6px, .81cqw, 13px);
    text-align: center;
}
.banner-empty-text {
    font-size: 0.76rem;
    color: var(--text-muted);
}
.admin-banner-card-actions {
    display: flex;
    gap: 8px;
}

/* ── Pinned Notice Thin Banner & Badges ── */
.party-pinned-notices-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.party-pinned-notice-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 12px;
    background: linear-gradient(90deg, var(--card-bg) 0%, var(--surface-subtle) 100%);
    border: 1px solid var(--white-10);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.party-pinned-notice-banner:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}
.party-pinned-notice-banner-left {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}
.party-pinned-notice-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.party-pinned-notice-banner-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    font-size: 0.76rem;
    color: var(--text-secondary);
}
.board-pinned-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 5px;
    font-size: .72rem;
    font-weight: 700;
    border-radius: 5px;
    background: rgba(232, 49, 135, 0.15);
    color: #ff5e9c;
    border: 1px solid rgba(232, 49, 135, 0.3);
    flex-shrink: 0;
    vertical-align: middle;
    line-height: 1;
}
html[data-theme="light"] .board-pinned-badge {
    background: rgba(232, 49, 135, 0.1);
    color: #d61f74;
    border-color: rgba(232, 49, 135, 0.25);
}
.board-post-row.is-pinned {
    background: rgba(232, 49, 135, 0.05);
}
html[data-theme="light"] .board-post-row.is-pinned {
    background: rgba(232, 49, 135, 0.04);
}

/* YouTube Rich Card Embed */
.youtube-preview-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 380px;
    margin: 1.2em 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--card-bg, #14141d);
    border: 1px solid var(--white-10, rgba(255, 255, 255, 0.08));
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
html[data-theme="light"] .youtube-preview-card {
    background: #f7f6f2;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
.youtube-preview-card:hover {
    border-color: rgba(255, 0, 0, 0.35);
    box-shadow: 0 6px 22px rgba(255, 0, 0, 0.15);
}
.youtube-preview-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
}
.youtube-preview-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .25s ease;
}
.youtube-preview-card:hover .youtube-preview-thumb {
    transform: scale(1.03);
}
.youtube-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 54px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 0, 0, 0.88);
    color: #fff;
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    transition: background .2s ease, transform .2s ease;
    z-index: 2;
}
.youtube-play-btn:hover {
    background: #ff0000;
    transform: translate(-50%, -50%) scale(1.08);
}
.youtube-play-icon {
    font-size: 1rem;
    line-height: 1;
    margin-left: 2px;
}
.youtube-preview-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.youtube-preview-title {
    font-weight: 600;
    font-size: .88rem;
    line-height: 1.4;
    color: var(--text-main, #e4e2e9);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
html[data-theme="light"] .youtube-preview-title {
    color: #1c1b18;
}
.youtube-preview-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .74rem;
    color: var(--text-secondary, #8e8b99);
}
.youtube-preview-domain {
    color: #3b82f6;
    text-decoration: underline;
}
.youtube-preview-ext {
    color: var(--text-secondary, #8e8b99);
    text-decoration: none;
    opacity: .8;
}
.youtube-preview-ext:hover {
    opacity: 1;
}
.youtube-embed-iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* ── PWA Update Toast Banner (Fixed Floating Overlay) ── */
.pwa-update-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9990;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-width: 320px;
    max-width: 420px;
    padding: 12px 16px;
    border: 1px solid var(--border-default, rgba(255, 255, 255, 0.15));
    border-radius: 14px;
    background: var(--card-bg, #2d2d32);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
    animation: pwaToastSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-update-toast.hidden {
    display: none !important;
}

.pwa-update-toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main, #f8fafc);
}

.pwa-update-toast-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.pwa-update-toast-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pwa-update-toast-close {
    padding: 4px 8px;
    font-size: 0.95rem;
    opacity: 0.75;
    transition: opacity 0.15s ease;
}

.pwa-update-toast-close:hover {
    opacity: 1;
}

html[data-theme="light"] .pwa-update-toast {
    border-color: rgba(75, 71, 58, 0.18);
    background: #fffdf7;
    box-shadow: 0 12px 32px rgba(72, 62, 43, 0.14);
}

@keyframes pwaToastSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .pwa-update-toast {
        bottom: 80px;
        left: 14px;
        right: 14px;
        min-width: auto;
        max-width: none;
    }
}
