/* ══════════════════════════════════════════════════════════════════════
       STUDY HUB - MINIMAL & PREMIUM CLEAN STYLES
       ══════════════════════════════════════════════════════════════════════ */
    .sh-container {
        max-width: var(--wq-page-max, 1080px);
        margin: 0 auto;
        padding: 6px 0 32px;
    }

    .sh-container > [hidden] { display: none !important; }
    .sh-container--guest { display: flex; flex-direction: column; gap: 18px; }
    .sh-container--guest > section { margin-top: 0; margin-bottom: 0; }
    .sh-container--guest .sh-due-review { order: -3; }
    .sh-container--guest .sh-recent-section { order: -2; }
    .sh-container--guest .sh-quick-start { order: -1; }
    .sh-container--guest .sh-review-guide { order: 1; }
    .sh-container--guest .sh-guest-account { order: 2; }
    .sh-container--guest .sh-storage-note { order: 0; }
    .sh-guest-account .sp-guest-actions { display: flex; flex-wrap: wrap; gap: 6px; }
    .sh-guest-account .sp-guest-actions a { flex: 1; padding: 8px 10px; font-size: .8rem; background: var(--wq-surface-2); border: 1px solid var(--wq-border); color: var(--wq-text); }
    .sh-container--guest .sh-review-section { order: 0; }
    .sh-quick-start { padding: 22px; border: 1px solid var(--wq-border); border-radius: 16px; background: var(--wq-surface); }
    .sh-quick-eyebrow { margin: 0 0 8px; color: var(--wq-accent); font-size: .8rem; font-weight: 700; }
    .sh-quick-start h1 { margin: 0 0 10px; font-size: clamp(1.3rem, 4.8vw, 1.7rem); line-height: 1.45; color: var(--wq-text); word-break: keep-all; }
    .sh-quick-start > p:not(.sh-quick-eyebrow) { margin: 0 0 18px; color: var(--wq-text-muted); line-height: 1.6; font-size: .88rem; }
    .sh-subjects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .sh-subjects a { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px; padding: 14px; min-height: 52px; border: 1px solid var(--wq-border); border-radius: 10px; background: var(--wq-surface-2); color: var(--wq-text); text-decoration: none; }
    .sh-subjects a:hover { border-color: var(--wq-accent); }
    .sh-subjects a:focus-visible { outline: 2px solid var(--wq-accent); outline-offset: 3px; }
    .sh-subjects span { color: var(--wq-accent); font-size: .78rem; }
    .sh-review-guide { padding: 4px 2px; }
    .sh-review-guide h2 { margin: 0 0 16px; font-size: 1rem; color: var(--wq-text); }
    .sh-review-guide ol { display: grid; gap: 14px; margin: 0; padding-left: 22px; }
    .sh-review-guide li { padding-left: 4px; color: var(--wq-accent); }
    .sh-review-guide strong, .sh-review-guide span { display: block; line-height: 1.6; font-size: .85rem; }
    .sh-review-guide strong { color: var(--wq-text); }
    .sh-review-guide span, .sh-review-guide > p { color: var(--wq-text-muted); }
    .sh-review-guide > p { margin: 18px 0 0; font-size: .78rem; line-height: 1.6; }
    .sh-storage-note { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px; border: 1px solid var(--wq-border); border-radius: 12px; background: var(--wq-surface); }
    .sh-storage-note p { flex: 1 1 100%; margin: 0; font-size: .85rem; line-height: 1.6; color: var(--wq-text-muted); }
    .sh-storage-note a, .sh-storage-note button { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; border: 1px solid var(--wq-border); border-radius: 8px; background: var(--wq-surface-2); color: var(--wq-text); font-size: .85rem; text-decoration: none; }
    .sh-storage-note button { margin-left: auto; }
    @media(max-width: 480px) { .sh-quick-start { padding: 18px 16px; } .sh-subjects a { padding: 12px; } }

    .sh-page-header {
        display: none;
    }
    .sh-phone-only {
        display: none;
    }
    .sh-wide-only {
        display: inline;
    }

    .sh-guest-banner {
        background: var(--wq-surface-2, #23262f);
        border: 1px solid var(--wq-border, #2b2f3a);
        border-radius: 12px;
        padding: 10px 14px;
        margin-bottom: 14px;
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 0.8rem;
    }
    .sh-review-section { margin-top: 28px; }
    .sh-review-description { margin: 8px 0 16px; color: var(--wq-text-muted); font-size: .85rem; }
    .sh-review-list { display: grid; gap: 10px; }
    .sh-review-card { padding: 18px; border: 1px solid var(--wq-border, #30333c); border-radius: 16px; background: var(--wq-surface, #181b24); }
    .sh-review-card h3 { margin: 6px 0 8px; font-size: 1rem; line-height: 1.5; overflow-wrap: anywhere; }
    .sh-review-date, .sh-review-meta { color: var(--wq-text-muted); font-size: .8rem; }
    .sh-review-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
    .sh-review-actions a, .sh-review-more { border: 1px solid var(--wq-border, #30333c); border-radius: 9px; padding: 9px 13px; color: var(--wq-text); font-size: .8rem; text-decoration: none; background: transparent; }
    .sh-review-actions a:first-child { background: var(--wq-primary); border-color: transparent; color: var(--wq-on-primary, #fff); }
    .sh-review-actions a:last-child { margin-left: auto; color: var(--wq-text-muted); }
    .sh-review-empty { padding: 30px 12px; text-align: center; color: var(--wq-text-muted); font-size: .9rem; }
    .sh-review-more { display: block; width: 100%; margin-top: 12px; }
    .sh-review-more[hidden], .sh-review-empty[hidden] { display: none; }
    .sh-guest-banner span {
        background: var(--wq-accent-soft);
        color: var(--wq-text-soft);
        padding: 2px 7px;
        border-radius: 5px;
        font-weight: 700;
        font-size: 0.72rem;
        flex-shrink: 0;
    }
    .sh-guest-banner p {
        margin: 0;
        flex: 1;
        color: var(--wq-text-muted, #9aa0ad);
    }
    .sh-guest-banner a {
        color: var(--wq-accent-2, #a0d3e1);
        font-weight: 700;
        text-decoration: none;
        flex-shrink: 0;
    }

    /* ── 상단 액션 섹션 ── */
    .sh-action-section {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 24px;
    }

    /* 1행: 낱말카드 | 자동재생 (2열) */
    .sh-mode-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .sh-mode-card {
        background: var(--wq-surface, #1a1d24);
        border: 1px solid var(--wq-border, #2b2f3a);
        border-radius: 14px;
        padding: 16px 14px 14px;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        cursor: pointer;
        transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
        text-align: left;
        -webkit-tap-highlight-color: transparent;
        font-family: inherit;
    }
    .sh-mode-card:hover {
        border-color: var(--wq-border-strong, #3b4252);
        transform: translateY(-2px);
    }
    .sh-mode-card:active {
        transform: scale(0.97);
        background: var(--wq-surface-2, #23262f);
    }

    .sh-mode-card__icon {
        width: 42px;
        height: 42px;
        border-radius: 11px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .sh-mode-card--study .sh-mode-card__icon,
    .sh-mode-card--quiz .sh-mode-card__icon {
        background: var(--wq-accent-soft);
        color: var(--wq-text-soft);
    }
    .sh-mode-card--flashcard .sh-mode-card__icon {
        background: var(--wq-accent-soft);
        color: var(--wq-text-soft);
    }
    .sh-mode-card--autoplay .sh-mode-card__icon {
        background: var(--wq-surface-2, #23262f);
        color: var(--wq-text-soft, #c9d1d9);
    }

    .sh-mode-card__text {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    .sh-mode-card__title {
        font-size: 1.02rem;
        font-weight: 700;
        color: var(--wq-text, #ffffff);
    }
    .sh-mode-card__sub {
        font-size: 0.76rem;
        color: var(--wq-text-muted, #9aa0ad);
    }

    /* 2행: 자동재생 | 학습 기록 (2열 서브 바) */
    .sh-sub-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .sh-sub-bar {
        background: var(--wq-surface, #1a1d24);
        border: 1px solid var(--wq-border, #2b2f3a);
        border-radius: 12px;
        padding: 10px 12px;
        display: flex;
        align-items: center;
        gap: 10px;
        text-decoration: none;
        color: inherit;
        cursor: pointer;
        transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
        -webkit-tap-highlight-color: transparent;
        font-family: inherit;
        text-align: left;
    }
    .sh-sub-bar:hover {
        border-color: var(--wq-border-strong, #3b4252);
    }
    .sh-sub-bar:active {
        transform: scale(0.98);
        background: var(--wq-surface-2, #23262f);
    }
    .sh-sub-bar__icon {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
    .sh-sub-bar--autoplay .sh-sub-bar__icon {
        background: var(--wq-surface-2, #23262f);
        color: var(--wq-text-soft, #c9d1d9);
    }
    .sh-sub-bar--history .sh-sub-bar__icon {
        background: rgba(245, 158, 11, 0.15);
        color: #f59e0b;
    }
    .sh-sub-bar__text {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 1px;
    }
    .sh-sub-bar__title {
        font-size: 0.88rem;
        font-weight: 700;
        color: var(--wq-text, #ffffff);
    }
    .sh-sub-bar__sub {
        font-size: 0.72rem;
        color: var(--wq-text-muted, #9aa0ad);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .sh-sub-bar__arrow {
        font-size: 1.2rem;
        color: var(--wq-text-muted, #9aa0ad);
        font-weight: 300;
    }

    /* 토글 카드 (객관식 주관식 풀이) */
    .sh-toggle-card {
        background: var(--wq-surface-2, #23262f);
        border: 1px solid var(--wq-border, #2b2f3a);
        border-radius: 12px;
        padding: 10px 12px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        cursor: pointer;
        transition: border-color 0.14s ease, background 0.14s ease;
    }
    .sh-toggle-card:hover {
        border-color: var(--wq-border-strong, #3b4252);
    }
    .sh-toggle-card__info {
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 0;
    }
    .sh-toggle-card__title {
        font-size: 0.82rem;
        font-weight: 700;
        color: var(--wq-text, #ffffff);
    }
    .sh-toggle-card__desc {
        font-size: 0.69rem;
        color: var(--wq-text-muted, #9aa0ad);
        line-height: 1.35;
    }
    .sh-switch {
        position: relative;
        display: inline-block;
        width: 42px;
        height: 24px;
        flex-shrink: 0;
    }
    .sh-switch input {
        opacity: 0;
        width: 0;
        height: 0;
        position: absolute;
    }
    .sh-slider {
        position: absolute;
        cursor: pointer;
        inset: 0;
        background-color: var(--wq-border-strong, #424857);
        transition: 0.2s ease;
        border-radius: 24px;
    }
    .sh-slider:before {
        position: absolute;
        content: "";
        height: 18px;
        width: 18px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        transition: 0.2s ease;
        border-radius: 50%;
    }
    .sh-switch input:checked + .sh-slider {
        background-color: var(--wq-accent, #78bdd2);
    }
    .sh-switch input:checked + .sh-slider:before {
        transform: translateX(18px);
    }

    /* ── 최근 푼 세트 ── */
    .sh-recent-section {
        margin-top: 6px;
    }
    .sh-section-header {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-bottom: 8px;
    }
    .sh-section-dot {
        width: 4px;
        height: 12px;
        border-radius: 2px;
        background: var(--wq-accent, #78bdd2);
    }
    .sh-section-title {
        font-size: 0.88rem;
        font-weight: 700;
        color: var(--wq-text-muted, #9aa0ad);
        margin: 0;
    }

    .sh-recent-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    .sh-recent-item {
        background: var(--wq-surface, #1a1d24);
        border: 1px solid var(--wq-border, #2b2f3a);
        border-radius: 16px;
        padding: 16px;
        color: var(--wq-text, #f3f4f6);
        text-decoration: none;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }
    .sh-recent-item__main {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 7px;
    }
    .sh-recent-item__tags {
        display: flex;
        align-items: center;
        gap: 6px;
    }
    .sh-tag {
        font-size: 0.68rem;
        padding: 1px 6px;
        border-radius: 4px;
        background: rgba(255, 255, 255, 0.06);
        color: var(--wq-text-muted, #9aa0ad);
    }
    .sh-meta-count {
        font-size: 0.7rem;
        color: var(--wq-text-muted, #9aa0ad);
    }
    .sh-recent-item__title {
        font-size: 0.9rem;
        font-weight: 700;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .sh-recent-item__title a,
    html.dark .sh-recent-item__title a {
        color: var(--wq-text, #f3f4f6) !important;
        text-decoration: none;
    }
    .sh-recent-item__title a:hover,
    html.dark .sh-recent-item__title a:hover {
        color: var(--wq-text, #f3f4f6) !important;
        text-decoration: underline;
    }
    .sh-btn-quick {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        line-height: 1.4;
        padding: 5px 12px;
        border-radius: 7px;
        background: var(--wq-primary);
        color: var(--wq-on-primary, #fff) !important;
        font-size: 0.78rem;
        font-weight: 700;
        text-decoration: none;
        white-space: nowrap;
    }

    .sh-recent-item[hidden] { display: none; }
    .sh-local-recent:hover { border-color: var(--wq-accent, var(--wq-accent)); }
    .sh-recent-item:focus-visible, .sh-btn-quick:focus-visible {
        outline: 2px solid var(--wq-accent, var(--wq-accent));
        outline-offset: 3px;
    }
    .sh-recent-progress {
        height: 4px;
        margin-top: 3px;
        background: var(--wq-border, #2b2f3a);
        border-radius: 8px;
        overflow: hidden;
    }
    .sh-recent-progress span {
        display: block;
        height: 100%;
        border-radius: inherit;
        background: var(--wq-accent, #78bdd2);
    }
    .sh-btn-quick { flex-shrink: 0; padding: 9px 12px; border-radius: 9px; }

    @media (min-width: 992px) {
        .sh-local-recent { padding: 20px 24px; gap: 24px; }
        .sh-local-recent .sh-btn-quick {
            min-width: 124px;
            min-height: 48px;
            padding: 12px 24px;
            font-size: 0.9rem;
        }
    }

    /* ══════════════════════════════════════════════════════════════════════
       STUDY SETUP MODAL (CLEAN & MINIMAL)
       ══════════════════════════════════════════════════════════════════════ */
    .sh-modal-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.75);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        z-index: 10001;
        opacity: 0;
        transition: opacity 0.2s ease;
        justify-content: center;
        align-items: flex-end;
    }
    .sh-modal-backdrop.is-open {
        display: flex;
        opacity: 1;
    }

    .sh-modal-sheet {
        width: 100%;
        max-width: 480px;
        max-height: 90dvh;
        background: var(--wq-surface, #1a1d24);
        border: 1px solid var(--wq-border-strong, #3b4252);
        border-bottom: none;
        border-radius: 20px 20px 0 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        transform: translateY(100%);
        transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
        overflow: hidden;
        box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.75);
        box-sizing: border-box;
    }
    .sh-modal-backdrop.is-open .sh-modal-sheet {
        transform: translateY(0);
    }

    .sh-modal-handle {
        width: 36px;
        height: 4px;
        background: var(--wq-border-strong, #424857);
        border-radius: 999px;
        margin: 8px auto 4px;
        padding: 6px 24px;
        box-sizing: content-box;
        cursor: grab;
        -webkit-tap-highlight-color: transparent;
        touch-action: none;
    }
    .sh-modal-handle:active {
        cursor: grabbing;
    }

    .sh-modal-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 4px 18px 10px;
        border-bottom: 1px solid var(--wq-border, #2b2f3a);
        flex-shrink: 0;
    }
    .sh-modal-title {
        font-size: 1.05rem;
        font-weight: 800;
        color: var(--wq-text, #ffffff);
        margin: 0;
    }
    .sh-modal-close {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: var(--wq-surface-2, #23262f);
        border: 1px solid var(--wq-border, #2b2f3a);
        color: var(--wq-text-muted, #9aa0ad);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        padding: 0;
        transition: all 0.15s ease;
    }
    .sh-modal-close:hover {
        color: #fff;
        background: var(--wq-border-strong, #3b4252);
    }

    .sh-modal-form {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    .sh-modal-body {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 14px 18px;
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    .sh-modal-bottom {
        flex-shrink: 0;
        padding: 12px 18px calc(14px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--wq-border, #2b2f3a);
        background: var(--wq-surface, #1a1d24);
    }

    .sh-form-group {
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        gap: 6px;
        min-width: 0;
        margin: 0;
        padding: 0;
        border: 0;
    }
    .sh-group-header {
        flex-wrap: wrap;
        gap: 4px 12px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .sh-group-title {
        font-size: 0.82rem;
        font-weight: 700;
        color: var(--wq-text-muted, #9aa0ad);
    }
    .sh-group-controls {
        display: flex;
        align-items: center;
        gap: 6px;
    }
    .sh-selected-badge {
        font-size: 0.74rem;
        font-weight: 700;
        color: var(--wq-accent-2, #a0d3e1);
        margin-right: 4px;
    }
    .sh-btn-text {
        background: transparent;
        border: none;
        color: var(--wq-text-muted, #9aa0ad);
        font-size: 0.74rem;
        font-weight: 600;
        cursor: pointer;
        padding: 8px 6px;
        min-height: 40px;
    }
    .sh-btn-text:hover {
        color: var(--wq-text, #ffffff);
    }
    .sh-divider {
        color: var(--wq-border-strong, #3b4252);
        font-size: 0.7rem;
    }

    /* ── 세트 리스트 ── */
    .sh-wb-list {
        max-height: 320px;
        overflow-y: auto;
        background: var(--wq-surface-2, #23262f);
        border: 1px solid var(--wq-border, #2b2f3a);
        border-radius: 11px;
        padding: 4px;
        display: flex;
        flex-direction: column;
        gap: 8px;
        flex-shrink: 0;
    }
    .sh-wb-card {
        position: relative;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px;
        border-radius: 12px;
        cursor: pointer;
        background: var(--wq-surface, #1a1d24);
        border: 1px solid transparent;
        transition: all 0.12s ease;
    }
    .sh-wb-card:has(.sh-wb-chk:checked) {
        border-color: var(--wq-border);
        background: var(--wq-accent-soft);
    }
    .sh-wb-chk {
        position: absolute;
        width: 1px;
        height: 1px;
        opacity: 0;
    }
    .sh-wb-card__check {
        display: flex;
        width: 22px;
        height: 22px;
        border-radius: 7px;
        border: 1px solid var(--wq-border-strong, #424857);
        color: transparent;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        transition: all 0.14s ease;
    }
    .sh-wb-chk:checked + .sh-wb-card__check {
        color: var(--wq-on-primary, #fff);
        border-color: var(--wq-primary);
        background: var(--wq-primary);
    }
    .sh-wb-card:focus-within {
        outline: 2px solid var(--wq-accent-2, var(--wq-accent));
        outline-offset: 1px;
    }
    .sh-wb-card__info {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 5px;
    }
    .sh-wb-card__title {
        font-size: 0.9rem;
        font-weight: 700;
        color: var(--wq-text, #ffffff);
        line-height: 1.5;
        overflow-wrap: anywhere;
        word-break: keep-all;
    }
    .sh-wb-card__meta {
        font-size: 0.75rem;
        line-height: 1.5;
        color: var(--wq-text-muted, #9aa0ad);
        overflow-wrap: anywhere;
    }
    .sh-wb-card__meta b { font-weight: 600; }
    .sh-wb-bookmark-meta { color: #d7c49b; }
    .sh-wb-empty {
        padding: 16px;
        text-align: center;
        color: var(--wq-text-muted, #9aa0ad);
        font-size: 0.8rem;
    }
    .sh-wb-empty a {
        color: var(--wq-accent-2, #a0d3e1);
        font-weight: 700;
        text-decoration: none;
        display: inline-block;
        margin-top: 4px;
    }

    /* ── 학습 범위 ── */
    .sh-scope-options {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 7px;
    }
    .sh-scope-group {
        display: none;
    }
    .sh-scope-card {
        position: relative;
        /* overflow: hidden 으로 자식이 카드 밖으로 절대 삐져나오지 않게 */
        overflow: hidden;
        min-width: 0;
        min-height: 64px;
        padding: 10px;
        border: 1px solid var(--wq-border, #2b2f3a);
        border-radius: 12px;
        background: var(--wq-surface-2, #23262f);
        /* 라디오 도트를 오른쪽에 고정, 텍스트는 남은 공간 */
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 9px;
        cursor: pointer;
        transition: border-color 0.14s ease, background 0.14s ease, transform 0.14s ease;
        -webkit-tap-highlight-color: transparent;
    }
    .sh-scope-card:has(input:checked) {
        border-color: rgba(247, 247, 245, 0.52);
        background: rgba(255, 255, 255, 0.08);
    }
    .sh-scope-card:active:not(.is-disabled) {
        transform: scale(0.98);
    }
    .sh-scope-card.is-disabled {
        cursor: default;
        opacity: 0.48;
    }
    .sh-scope-card input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }
    .sh-scope-card__icon {
        width: 32px;
        height: 32px;
        border-radius: 9px;
        background: rgba(255, 255, 255, 0.07);
        color: var(--wq-text-soft, #c9d1d9);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
    }
    .sh-scope-card__icon--bookmark {
        color: #d7c49b;
        background: rgba(205, 178, 124, 0.12);
    }
    .sh-scope-card__copy {
        /* 그리드 셀이 min-width: 0을 보장하므로 overflow 처리 가능 */
        min-width: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    .sh-scope-card__copy strong {
        display: block;
        color: var(--wq-text, #f7f7f5);
        font-size: 0.8rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .sh-scope-card__copy small {
        display: block;
        color: var(--wq-text-muted, #92928d);
        font-size: 0.67rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .sh-scope-card__radio {
        width: 14px;
        height: 14px;
        border-radius: 50%;
        border: 1.5px solid var(--wq-border-strong, #484848);
        flex: 0 0 auto;
        box-shadow: inset 0 0 0 3px var(--wq-surface-2, #23262f);
        transition: border-color 0.14s ease, background 0.14s ease;
    }
    .sh-scope-card:has(input:checked) .sh-scope-card__radio {
        border-color: #f7f7f5;
        background: #f7f7f5;
    }

    /* ── 세그먼트 컨트롤 ── */
    .sh-segment-ctrl {
        display: flex;
        background: var(--wq-surface-2, #23262f);
        padding: 3px;
        border-radius: 10px;
        border: 1px solid var(--wq-border, #2b2f3a);
        gap: 3px;
    }
    .sh-segment-item {
        flex: 1;
        position: relative;
        cursor: pointer;
    }
    .sh-segment-item input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }
    .sh-segment-item span {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 34px;
        padding: 0 6px;
        border-radius: 7px;
        color: var(--wq-text-muted, #9aa0ad);
        font-size: 0.78rem;
        font-weight: 700;
        transition: all 0.14s ease;
        text-align: center;
        white-space: nowrap;
    }
    .sh-segment-item input:checked + span {
        background: var(--wq-surface, #1a1d24);
        color: var(--wq-text, #ffffff);
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
        border: 1px solid var(--wq-border-strong, #3b4252);
    }

    /* ── 하단 버튼 ── */
    .sh-btn-submit {
        width: 100%;
        height: 48px;
        border-radius: 12px;
        background: var(--wq-primary);
        color: var(--wq-on-primary, #fff);
        border: none;
        font-size: 0.95rem;
        font-weight: 800;
        cursor: pointer;
        transition: all 0.15s ease;
        box-shadow: none;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .sh-btn-submit:hover {
        background: var(--wq-accent-hover, #94cede);
    }
    .sh-btn-submit:active {
        transform: scale(0.98);
    }

    @media (min-width: 641px) {
        .sh-modal-backdrop {
            align-items: center;
            padding: 20px;
        }
        .sh-modal-sheet {
            border-radius: 18px;
            transform: scale(0.95);
        }
        .sh-modal-backdrop.is-open .sh-modal-sheet {
            transform: scale(1);
        }
    }

    @media (max-width: 640px) {
        .sh-phone-only {
            display: inline;
        }
        .sh-wide-only {
            display: none;
        }
        .sh-container {
            padding-top: 0;
        }
        .sh-page-header {
            min-height: 52px;
            margin: -2px 0 12px;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        .sh-page-eyebrow {
            display: none;
        }
        .sh-page-header h1 {
            margin: 0;
            color: var(--wq-text, #f7f7f5);
            font-size: 1.35rem;
            line-height: 1.2;
            font-weight: 800;
            letter-spacing: -0.035em;
        }
        .sh-page-bookmarks {
            height: 32px;
            padding: 0 10px;
            border: 1px solid var(--wq-border, #303030);
            border-radius: 999px;
            background: var(--wq-surface-2, #1b1b1b);
            color: #d7c49b;
            display: inline-flex;
            align-items: center;
            gap: 5px;
            font-size: 0.76rem;
            font-weight: 800;
        }
        .sh-mode-card {
            min-height: 154px;
            padding: 16px;
            border-radius: 18px;
            justify-content: space-between;
        }
        .sh-mode-card__icon {
            width: 48px;
            height: 48px;
            border-radius: 15px;
        }
        .sh-mode-card__title {
            font-size: 1rem;
        }
        .sh-mode-card__sub {
            max-width: 130px;
            font-size: 0.72rem;
            line-height: 1.45;
        }
        .sh-sub-bar {
            min-height: 52px;
            padding: 9px 10px;
            border-radius: 13px;
            background: #1b1b1b;
        }
        .sh-sub-bar__icon {
            width: 32px;
            height: 32px;
            border-radius: 9px;
        }
        .sh-sub-bar__title {
            font-size: 0.85rem;
        }
        .sh-sub-bar__sub {
            font-size: 0.69rem;
        }
        /* 모바일 모달 최적화 (화면 영역에 정확히 맞추고 넘치지 않게) */
        .sh-modal-sheet {
            max-height: 92dvh;
            border-radius: 20px 20px 0 0;
            background: var(--wq-surface, #1a1d24);
        }
        .sh-modal-header {
            padding: 4px 16px 10px;
        }
        .sh-modal-body {
            padding: 12px 16px;
            gap: 12px;
        }
        .sh-modal-bottom {
            padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
            background: var(--wq-surface, #1a1d24);
        }
        .sh-wb-list {
            max-height: min(36dvh, 300px);
            padding: 4px;
            background: var(--wq-surface-2, #23262f);
        }
        .sh-wb-card {
        position: relative;
        flex-shrink: 0;
            min-height: 44px;
            padding: 12px;
            background: var(--wq-surface, #1a1d24);
        }
        .sh-wb-card__title {
            font-size: 0.83rem;
        }
        .sh-scope-card {
            min-height: 54px;
            padding: 8px 10px;
            border-radius: 12px;
            background: var(--wq-surface-2, #23262f);
        }
        .sh-scope-group {
            display: flex;
        }
        .sh-segment-ctrl {
            min-height: 38px;
            padding: 3px;
            background: var(--wq-surface-2, #23262f);
        }
        .sh-segment-item span {
            height: 32px;
            min-height: 32px;
            font-size: 0.76rem;
            padding: 0 4px;
        }
        .sh-btn-submit {
            height: 48px;
            border-radius: 12px;
            font-size: 0.94rem;
        }
    }
    @media (max-width: 380px) {
        .sh-scope-options { grid-template-columns: 1fr; }
    }


    /* Colour pass (2026-11-16): neutral surfaces, one deep-blue action with white ink, logo blue
       (#4da3f7) only for lines, indicators and small text. No light-blue fill under navy ink, no
       translucent blue tints. Prefixed with body.is-study-hub to outrank paper_shell.css. */
    body.is-study-hub { --wq-accent: #4da3f7; --wq-accent-2: #4da3f7; --wq-accent-hover: #87bfff; --wq-accent-soft: rgba(77, 163, 247, .12); }
    html.dark body.is-study-hub .sh-subjects a { background: var(--wq-surface-2); border-color: var(--wq-border); }
    html.dark body.is-study-hub .sh-subjects strong { color: #f4f8fd; font-size: 1rem; font-weight: 700; }
    html.dark body.is-study-hub .sh-subjects span { color: var(--wq-text-muted); }
    @media (hover: hover) {
        html.dark body.is-study-hub .sh-subjects a:hover { border-color: #4da3f7; }
        html.dark body.is-study-hub .sh-subjects a:hover span { color: #f4f8fd; }
    }
    html.dark body.is-study-hub .sh-mode-card { border-color: var(--wq-border) !important; }
    /* Solid tiles with white glyphs, same as the home subject menu. */
    html.dark body.is-study-hub .sh-mode-card__icon { background: #3388ee; color: #fff; }
    html.dark body.is-study-hub .sh-mode-card--autoplay .sh-mode-card__icon { background: #17975a; }
    html.dark body.is-study-hub .sh-section-dot { display: none; }
    html.dark body.is-study-hub .sh-section-title { color: var(--wq-text); font-size: 1.05rem; }
    html.dark body.is-study-hub .sh-tag { background: var(--wq-surface-2); border: 1px solid var(--wq-border); color: var(--wq-text-muted); }
    html.dark body.is-study-hub .study-set-progress__track span, html.dark body.is-study-hub .sh-recent-progress span { background: #4da3f7; }
    html.dark body.is-study-hub .sh-recent-item .wkb-action-btn.study:not(:disabled):not(.disabled):not(.is-added),
    html.dark body.is-study-hub .sh-recent-item .wkb-action-btn.exam-start,
    html.dark body.is-study-hub .sh-review-actions a:first-child,
    html.dark body.is-study-hub .sh-review-link--primary {
        background: var(--wq-surface-2) !important; border: 1px solid #445366 !important; color: #f4f8fd !important; font-weight: 600;
    }
    html.dark body.is-study-hub .sh-recent-item .wkb-action-btn.auto-learn:not(:disabled):not(.disabled) {
        background: transparent !important; border: 1px solid var(--wq-border) !important; color: var(--wq-text-soft) !important;
    }
    @media (hover: hover) {
        html.dark body.is-study-hub .sh-recent-item .wkb-action-btn:is(.study, .exam-start, .auto-learn):hover:not(:disabled):not(.disabled):not(.is-added),
        html.dark body.is-study-hub :is(.sh-review-actions a:first-child, .sh-review-link--primary):hover {
            background: var(--wq-surface-3) !important; border-color: #4da3f7 !important; color: #f4f8fd !important;
        }
    }
    /* Reminder "설정" is a setting, not the page's main action: same quiet button as 시험일 정하기. */
    html.dark body.is-study-hub .sp-reminder__actions .sp-btn--primary { border: 1px solid var(--wq-border-strong); background: var(--wq-surface-2); color: var(--wq-text); }
    html.dark body.is-study-hub .sp-reminder__actions .sp-btn--primary:hover { border-color: #4da3f7; background: var(--wq-surface-3); }
    html.dark body.is-study-hub .sp-guest-actions a, html.dark body.is-study-hub .sp-guest-actions a:first-child { border: 1px solid var(--wq-border); background: var(--wq-surface-2); color: var(--wq-text); }
    html.dark body.is-study-hub .sp-guest-actions a:hover { border-color: #4da3f7; }
    html.dark body.is-study-hub .sp-exam__dday { background: transparent; border: 1px solid #4da3f7; color: #4da3f7; }
    html.dark body.is-study-hub .sh-guest-banner span { background: transparent; color: #4da3f7 !important; }
    /* Study modal: chosen set and checkbox. */
    html.dark body.is-study-hub .sh-wb-card:has(.sh-wb-chk:checked) { background: var(--wq-surface-2); border-color: #4da3f7; }
    html.dark body.is-study-hub .sh-wb-chk:checked + .sh-wb-card__check { background: var(--wq-primary); border-color: var(--wq-primary); color: #fff; }
    html.dark body.is-study-hub .sh-selected-badge { color: #4da3f7; }
    html.dark body.is-study-hub .sh-btn-submit { box-shadow: none; }
