:root {
    --bg: #f7ede1;
    --bg-alt: #fcf4eb;
    --surface: rgba(255, 255, 255, 0.88);
    --surface-strong: #fffdf9;
    --surface-soft: #ffe7db;
    --surface-primary: rgba(255, 255, 255, 0.98);
    --surface-secondary: rgba(255, 251, 246, 0.76);
    --surface-focus: #141d34;
    --ink: #24304d;
    --ink-strong: #111827;
    --muted: #5f6d87;
    --line: rgba(17, 24, 39, 0.12);
    --line-strong: rgba(17, 24, 39, 0.18);
    --accent: #ff633d;
    --accent-strong: #df4522;
    --accent-soft: #ffe2d7;
    --accent-deep: #a23318;
    --teal: #16b8a6;
    --teal-soft: #dff8f4;
    --yellow: #ffd76a;
    --yellow-soft: #fff4c7;
    --danger: #dd4e67;
    --danger-soft: #ffe2e7;
    --success: #1f9f78;
    --success-soft: #dbf7ed;
    --shadow: 0 18px 42px rgba(17, 24, 39, 0.13);
    --shadow-soft: 0 10px 24px rgba(17, 24, 39, 0.09);
    --shadow-secondary: 0 10px 22px rgba(17, 24, 39, 0.07);
    --shadow-primary: 0 24px 56px rgba(17, 24, 39, 0.16);
    --focus-ring: 0 0 0 4px rgba(255, 99, 61, 0.14);
    --radius-xl: 26px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --transition: 180ms ease;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Plus Jakarta Sans", sans-serif;
    line-height: 1.55;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(255, 99, 61, 0.12), transparent 26%),
        radial-gradient(circle at top right, rgba(255, 215, 106, 0.18), transparent 24%),
        linear-gradient(180deg, #f8ecdf 0%, #fdf4ea 52%, #f3e0cf 100%);
}

button,
input,
textarea {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid rgba(255, 99, 61, 0.45);
    outline-offset: 2px;
}

.app-shell {
    min-height: 100vh;
    padding: 24px;
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 24px;
}

.sidebar,
.workspace-panel {
    background: var(--surface);
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.sidebar {
    background: var(--surface-secondary);
    border-color: rgba(17, 24, 39, 0.08);
    box-shadow: var(--shadow-secondary);
    padding: 26px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    position: sticky;
    top: 24px;
    align-self: start;
}

.brand-block {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.brand-mark {
    width: 150px;
    height: 68px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent-strong), var(--accent) 68%, #ffaf57);
    color: #fff;
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 1.9rem;
    box-shadow: 0 14px 28px rgba(223, 69, 34, 0.28);
}

.brand-copy h1,
.dashboard-hero h2,
.panel-heading h3,
.context-panel h3,
.form-card h4,
.library-empty h4,
.study-header-copy h2,
.study-summary h3,
.dialog-card h2,
.sidebar-card h2 {
    margin: 0;
    font-family: "Bricolage Grotesque", sans-serif;
    letter-spacing: -0.03em;
    color: var(--ink-strong);
}

.brand-copy h1 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    line-height: 0.95;
}

.brand-copy p:last-child,
.hero-copy p:last-child,
.panel-heading p:last-child,
.form-card-header p,
.library-empty p,
.context-panel p,
.sidebar-card p,
.helper-text,
.study-hint,
.study-summary p,
.field-status {
    color: var(--muted);
}

.eyebrow,
.section-kicker,
.face-label {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--accent-strong);
}

.sidebar-nav {
    display: flex;
    width: 100%;
    gap: 12px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.tab-btn,
.ai-count-btn,
.study-chip {
    border-radius: 999px;
}

.nav-pill,
.tab-btn,
.ai-count-btn {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--line);
    color: var(--muted);
    font-weight: 700;
    transition: transform var(--transition), background var(--transition), color var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.nav-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 40px;
    padding: 9px 12px;
    border-radius: 12px;
    background: transparent;
    border: 1px solid transparent;
    color: rgba(36, 48, 77, 0.78);
    font-size: 0.95rem;
    font-weight: 700;
}

.tab-btn,
.ai-count-btn {
    padding: 12px 16px;
}

.nav-pill.active {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(255, 99, 61, 0.16);
    color: var(--accent-deep);
    box-shadow: 0 6px 14px rgba(17, 24, 39, 0.08);
}

.tab-btn.active,
.ai-count-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    border-color: rgba(223, 69, 34, 0.18);
    color: #fff;
    box-shadow: 0 12px 24px rgba(223, 69, 34, 0.26);
}

.nav-pill:hover,
.tab-btn:hover,
.ai-count-btn:hover,
.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.danger-btn:hover,
.rating-btn:hover {
    transform: translateY(-1px);
}

.nav-pill:not(.active):hover,
.tab-btn:not(.active):hover,
.ai-count-btn:not(.active):hover {
    background: #fff;
    border-color: rgba(255, 99, 61, 0.24);
    color: var(--ink-strong);
    box-shadow: var(--shadow-soft);
}

.nav-pill:not(.active):hover {
    box-shadow: none;
    background: rgba(255, 255, 255, 0.72);
}

.sidebar-card {
    padding: 22px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(17, 24, 39, 0.08);
    box-shadow: 0 8px 20px rgba(17, 24, 39, 0.06);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.metric-card {
    padding: 18px;
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, rgba(255, 247, 239, 0.86), rgba(255, 255, 255, 0.95));
    border: 1px solid rgba(17, 24, 39, 0.08);
}

.metric-card strong {
    display: block;
    font-size: 1.8rem;
    font-family: "Bricolage Grotesque", sans-serif;
}

.metric-card span {
    color: var(--muted);
    font-size: 0.92rem;
}

.dashboard {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.dashboard-hero {
    padding: 16px 18px;
    border-radius: var(--radius-xl);
    background:
        radial-gradient(circle at top right, rgba(255, 99, 61, 0.16), transparent 30%),
        radial-gradient(circle at left center, rgba(255, 215, 106, 0.2), transparent 26%),
        linear-gradient(135deg, rgba(255, 248, 241, 0.96) 0%, rgba(255, 255, 255, 0.85) 50%, rgba(255, 245, 238, 0.95) 100%);
    border: 1px solid rgba(17, 24, 39, 0.08);
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.05);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.hero-copy {
    max-width: 700px;
}

.hero-copy h2 {
    font-size: clamp(1.45rem, 2vw, 2rem);
    max-width: 18ch;
    color: var(--ink-strong);
    line-height: 1;
}

.hero-copy p:last-child {
    max-width: 60ch;
    font-size: 0.95rem;
    color: rgba(95, 109, 135, 0.9);
}

.hero-chips {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hero-chips li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    color: rgba(36, 48, 77, 0.74);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero-chips li::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255, 99, 61, 0.95), rgba(255, 215, 106, 0.9));
    box-shadow: 0 0 0 4px rgba(255, 99, 61, 0.08);
}

.study-chip {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow-soft);
    color: var(--ink);
    font-weight: 600;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    align-items: start;
}

.workspace-column,
.context-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.workspace-panel {
    padding: 26px;
    animation: panel-rise 220ms ease;
}

#create-panel.workspace-panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 249, 242, 0.95));
    border-color: rgba(17, 24, 39, 0.08);
    box-shadow: 0 28px 62px rgba(17, 24, 39, 0.16);
    position: relative;
    padding-top: 48px;
}

#create-panel.workspace-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 99, 61, 0.2);
    pointer-events: none;
}

#create-panel.workspace-panel::after {
    content: "";
    position: absolute;
    inset: 18px;
    border-radius: calc(var(--radius-xl) - 10px);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0));
    pointer-events: none;
    z-index: 0;
}

#create-panel > * {
    position: relative;
    z-index: 1;
}

#create-panel .panel-heading {
    margin-bottom: 14px;
}

#create-panel .panel-heading h3 {
    font-size: clamp(2.2rem, 3.5vw, 2.95rem);
    line-height: 1;
    font-weight: 800;
    color: var(--ink-strong);
}

#create-panel .panel-heading p:last-child {
    margin-top: 10px;
    max-width: 52ch;
    font-size: 0.98rem;
}

#create-panel .shared-title-field {
    margin-top: 22px;
}

#create-panel .shared-title-field label,
#manual-pane .field-label {
    font-size: 1rem;
}

#create-panel .shared-title-field input {
    padding: 18px 18px;
    font-size: 1.05rem;
    background: #ffffff;
    border: 1px solid var(--line-strong);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.82),
        0 8px 20px rgba(17, 24, 39, 0.08);
}

#create-panel .tab-bar {
    margin-top: 18px;
    gap: 10px;
}

#create-panel .tab-btn {
    padding: 13px 18px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(17, 24, 39, 0.08);
    color: rgba(102, 112, 139, 0.88);
    box-shadow: none;
}

#create-panel .tab-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    border-color: rgba(223, 69, 34, 0.18);
    color: #fff;
    box-shadow: 0 14px 24px rgba(223, 69, 34, 0.24);
}

#create-panel .tab-btn:not(.active):hover {
    background: rgba(255, 255, 255, 0.72);
}

#manual-pane textarea {
    padding: 18px 18px;
    min-height: 268px;
    font-size: 1.02rem;
    background: #ffffff;
    border: 1px solid var(--line-strong);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.84),
        0 12px 28px rgba(17, 24, 39, 0.09);
}

.context-column .workspace-panel {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(255, 255, 255, 0.58);
    box-shadow: var(--shadow-secondary);
}

#create-panel .create-pane {
    margin-top: 16px;
}

#manual-pane .form-card {
    padding: 24px;
    background: linear-gradient(180deg, rgba(255, 245, 238, 0.96), rgba(255, 250, 244, 0.98));
    border: 1px solid rgba(17, 24, 39, 0.08);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 12px 28px rgba(17, 24, 39, 0.08);
}

#manual-pane .form-card-header {
    margin-bottom: 18px;
}

#manual-pane .field-label {
    margin-bottom: 12px;
}

#manual-pane .composer-footer {
    margin-top: 18px;
}

#create-panel .shared-title-field input:hover,
#manual-pane textarea:hover {
    border-color: rgba(255, 99, 61, 0.28);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.84),
        0 12px 24px rgba(17, 24, 39, 0.1);
}

#create-panel .shared-title-field input:focus,
#manual-pane textarea:focus {
    border-color: rgba(255, 99, 61, 0.48);
    box-shadow:
        var(--focus-ring),
        0 18px 28px rgba(17, 24, 39, 0.12);
}

@keyframes panel-rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.workspace-panel[data-panel] {
    display: none;
}

.workspace-panel[data-panel].active {
    display: block;
}

.panel-heading,
.form-card-header,
.library-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.library-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.shared-title-field,
.field-grid,
.count-block,
.composer-footer {
    margin-top: 20px;
}

.shared-title-field label,
.field-label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.95rem;
    font-weight: 700;
}

.field-label-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.field-label-row .field-label {
    margin-bottom: 0;
    max-width: 24ch;
}

.doc-help-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 99, 61, 0.16);
    color: var(--accent-deep);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.25;
    text-decoration: none;
}

.doc-help-link:hover {
    color: var(--accent-strong);
    background: #fff;
    border-color: rgba(255, 99, 61, 0.26);
}

.doc-help-icon {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: var(--accent-soft);
    border: 1px solid rgba(255, 99, 61, 0.18);
    font-size: 0.85rem;
    line-height: 1;
}

.shared-title-field input,
textarea,
.ai-input {
    width: 100%;
    padding: 15px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.94);
    color: var(--ink);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 1px 2px rgba(17, 24, 39, 0.04);
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.shared-title-field input:hover,
textarea:hover,
.ai-input:hover {
    border-color: rgba(255, 99, 61, 0.24);
}

.shared-title-field input:focus,
textarea:focus,
.ai-input:focus {
    border-color: rgba(255, 99, 61, 0.45);
    box-shadow: var(--focus-ring);
}

textarea {
    resize: vertical;
    min-height: 220px;
}

.tab-bar {
    display: flex;
    gap: 12px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.create-pane {
    margin-top: 20px;
    display: none;
}

.create-pane.active {
    display: block;
}

.form-card {
    padding: 22px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(17, 24, 39, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 247, 240, 0.9));
    box-shadow: var(--shadow-soft);
}

.field-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: end;
}

.api-key-form {
    margin-top: 20px;
    padding: 18px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(17, 24, 39, 0.08);
    display: grid;
    gap: 12px;
}

.ai-security-note {
    margin-top: 20px;
    padding: 18px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(17, 24, 39, 0.08);
}

.ai-security-note .field-label,
.ai-security-note .field-status {
    margin: 0;
}

.ai-security-note .field-status {
    margin-top: 10px;
}

.ai-security-note .field-status[data-tone="success"] {
    color: #166952;
}

.ai-security-note .field-status[data-tone="warning"] {
    color: #8a5b00;
}

.ai-security-note .field-status[data-tone="error"] {
    color: #8f2338;
}

.ai-security-note {
    margin-top: 20px;
    padding: 18px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(17, 24, 39, 0.08);
}

.ai-security-note .field-label,
.ai-security-note .field-status {
    margin: 0;
}

.ai-security-note .field-status {
    margin-top: 10px;
}

.ai-security-note .field-status[data-tone="success"] {
    color: #166952;
}

.ai-security-note .field-status[data-tone="warning"] {
    color: #8a5b00;
}

.ai-security-note .field-status[data-tone="error"] {
    color: #8f2338;
}

.field-inline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: stretch;
}

.field-actions {
    display: flex;
    align-items: center;
    margin-top: 0;
}

.ghost-inline-btn {
    min-height: 40px;
    padding: 10px 14px;
    border-radius: 12px;
    background: transparent;
    border: 1px solid var(--line-strong);
    color: var(--muted);
    font-weight: 700;
    transition: transform var(--transition), border-color var(--transition), color var(--transition), background var(--transition);
}

.ghost-inline-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 99, 61, 0.28);
    color: var(--ink-strong);
    background: rgba(255, 255, 255, 0.72);
}

.field-status {
    margin: 10px 0 0;
    font-size: 0.92rem;
    line-height: 1.5;
}

.composer-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.helper-text {
    margin: 0;
    max-width: 56ch;
}

.import-card .import-dropzone {
    margin-top: 18px;
    padding: 26px;
    border-radius: var(--radius-lg);
    border: 1px dashed rgba(255, 99, 61, 0.42);
    background: linear-gradient(180deg, rgba(255, 235, 226, 0.68), rgba(255, 255, 255, 0.96));
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn,
.rating-btn {
    min-height: 48px;
    padding: 13px 18px;
    border-radius: 14px;
    font-weight: 700;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition), opacity var(--transition);
}

button:disabled {
    opacity: 0.58;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.primary-btn {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 0 14px 26px rgba(223, 69, 34, 0.24);
}

.accent-btn {
    background: linear-gradient(135deg, #ff744f, var(--accent-strong));
    box-shadow: 0 14px 28px rgba(223, 69, 34, 0.28);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.94);
    color: var(--ink);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-soft);
}

.ghost-btn {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.danger-btn {
    background: linear-gradient(135deg, var(--danger), #c23f57);
    color: #fff;
    box-shadow: 0 14px 25px rgba(221, 78, 103, 0.22);
}

.primary-btn:hover {
    box-shadow: 0 16px 30px rgba(223, 69, 34, 0.3);
}

.secondary-btn:hover {
    background: linear-gradient(180deg, #ffffff, #fff5f0);
    border-color: rgba(255, 99, 61, 0.28);
    color: var(--ink-strong);
    box-shadow: 0 12px 24px rgba(17, 24, 39, 0.1);
}

.ghost-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 99, 61, 0.32);
}

.danger-btn:hover {
    box-shadow: 0 16px 28px rgba(221, 78, 103, 0.28);
}

.rating-btn:hover {
    box-shadow: 0 16px 28px rgba(17, 24, 39, 0.16);
}

.compact-btn {
    min-height: 44px;
    padding: 11px 16px;
}

.inline-message {
    margin: 18px 0 0;
    padding: 13px 14px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-size: 0.95rem;
}

.inline-message[data-tone="error"] {
    background: var(--danger-soft);
    color: #8f2338;
    border-color: rgba(221, 78, 103, 0.22);
}

.inline-message[data-tone="success"] {
    background: var(--success-soft);
    color: #166952;
    border-color: rgba(31, 159, 120, 0.18);
}

.inline-message[data-tone="info"] {
    background: var(--teal-soft);
    color: #17594f;
    border-color: rgba(22, 184, 166, 0.18);
}

.ai-count-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ai-feedback {
    margin-top: 18px;
}

.ai-progress,
.ai-success {
    padding: 18px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(17, 24, 39, 0.08);
}

.ai-progress {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ai-success {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--success-soft);
    border-color: rgba(31, 159, 120, 0.2);
}

.ai-loading-animation {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 4px solid rgba(22, 184, 166, 0.18);
    border-top-color: var(--teal);
    animation: spin 900ms linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.set-list {
    display: grid;
    gap: 16px;
}

.library-empty {
    padding: 28px;
    text-align: center;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(255, 248, 236, 0.8), rgba(255, 255, 255, 0.9));
    border: 1px dashed rgba(255, 99, 61, 0.28);
    margin-bottom: 18px;
}

.set-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    padding: 20px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(255, 247, 240, 0.95));
    border: 1px solid rgba(17, 24, 39, 0.08);
    box-shadow: var(--shadow-soft);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.set-item:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 99, 61, 0.22);
    box-shadow: 0 16px 28px rgba(17, 24, 39, 0.12);
}

.set-info h4,
.context-panel h3,
.study-summary h3 {
    margin: 0 0 8px;
}

.set-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.meta-pill {
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--accent-deep);
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(255, 99, 61, 0.14);
}

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

.action-text-btn {
    min-height: 44px;
    padding: 11px 15px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line-strong);
    font-weight: 700;
    color: var(--ink);
    transition: transform var(--transition), border-color var(--transition), background var(--transition), box-shadow var(--transition), color var(--transition);
}

.action-text-btn:hover {
    transform: translateY(-1px);
    background: linear-gradient(180deg, #ffffff, #fff5f0);
    border-color: rgba(255, 99, 61, 0.28);
    color: var(--ink-strong);
    box-shadow: var(--shadow-soft);
}

.action-text-btn.delete {
    color: #9c2940;
    background: var(--danger-soft);
    border-color: rgba(221, 78, 103, 0.18);
}

.action-text-btn.delete:hover {
    background: #ffdfe6;
    border-color: rgba(221, 78, 103, 0.3);
    color: #8c1f36;
}

.set-ai-history {
    grid-column: 1 / -1;
    margin-top: 6px;
    padding: 16px 18px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(17, 24, 39, 0.08);
}

.set-ai-history summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--ink);
}

.set-ai-history-content {
    margin-top: 16px;
    display: grid;
    gap: 14px;
}

.set-ai-card {
    padding: 16px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 250, 244, 0.9), rgba(255, 255, 255, 0.96));
    border: 1px solid rgba(30, 36, 64, 0.08);
}

.set-ai-card h5,
.set-ai-entry p {
    margin: 0;
}

.set-ai-card h5 {
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 1rem;
}

.set-ai-card-question,
.set-ai-card-answer {
    margin: 10px 0 0;
    color: var(--muted);
}

.set-ai-entry {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(30, 36, 64, 0.08);
    display: grid;
    gap: 8px;
}

.set-ai-entry-meta {
    font-size: 0.88rem;
    color: var(--muted);
}

.set-ai-entry-user,
.set-ai-entry-answer {
    line-height: 1.55;
    white-space: pre-wrap;
}

.flow-list {
    padding-left: 18px;
    margin: 14px 0 0;
    color: var(--muted);
}

.flow-list li + li {
    margin-top: 10px;
}

.study-view {
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(circle at top, rgba(255, 99, 61, 0.16), transparent 24%),
        radial-gradient(circle at right top, rgba(255, 215, 106, 0.12), transparent 20%),
        linear-gradient(180deg, #11182d 0%, #15203d 46%, #10172d 100%);
    color: #f6f8ff;
}

.study-shell {
    max-width: 1240px;
    margin: 0 auto;
    min-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.study-header {
    width: 100%;
    display: flex;
    gap: 18px;
    align-items: center;
}

.study-header-leading,
.study-header-actions {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
}

.study-header-leading {
    justify-content: flex-start;
}

.study-header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
}

.study-header-copy {
    flex: 0 1 auto;
    width: min(520px, 100%);
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.study-header-copy .eyebrow,
.face-label {
    color: rgba(255, 255, 255, 0.72);
}

.study-header-copy h2 {
    font-size: clamp(2rem, 3vw, 3.1rem);
    color: #fdfefe;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.22);
}

.study-progress-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
}

.study-chip {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    box-shadow: none;
    border: 1px solid rgba(255, 99, 61, 0.2);
}

.study-chip strong {
    margin-right: 4px;
}

.study-streak {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1;
    flex: 0 0 auto;
}

.study-streak-icon {
    font-size: 0.95rem;
    opacity: 0.9;
}

.study-streak-value {
    display: inline-block;
    margin: 0;
    font-size: 0.88rem;
    font-weight: 600;
}

.study-streak-value.is-pulsing {
    animation: streak-pop 320ms ease;
}

@keyframes streak-pop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
    100% {
        transform: scale(1);
    }
}

.study-progress-bar {
    width: min(520px, 100%);
    height: 10px;
    margin: 14px auto 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.study-progress-bar span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--yellow), var(--accent));
    transition: width 220ms ease;
}

.study-main {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.study-section-manager {
    width: 100%;
    padding: 24px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 99, 61, 0.16);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.study-section-manager-header,
.study-section-controls,
.study-section-list-item,
.study-section-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.study-section-manager-header h3,
.study-section-list-header h4,
.study-section-list-item h4 {
    margin: 0;
    font-family: "Bricolage Grotesque", sans-serif;
    letter-spacing: -0.03em;
}

.study-section-manager-header p:last-child,
.study-section-list-header p,
.study-section-range,
.study-section-progress {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.72);
}

.study-section-controls {
    margin-top: 20px;
    align-items: end;
    flex-wrap: wrap;
}

.study-section-size-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.study-section-custom {
    display: grid;
    gap: 8px;
    min-width: 160px;
    color: rgba(255, 255, 255, 0.86);
    font-weight: 600;
}

.study-section-custom input {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 99, 61, 0.2);
    background: rgba(8, 15, 34, 0.32);
    color: #fff;
}

.study-section-list-header {
    margin-top: 22px;
    align-items: end;
}

.study-section-list {
    margin-top: 14px;
    display: grid;
    gap: 12px;
}

.study-section-list-empty,
.study-section-list-item {
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.study-section-list-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.72);
}

.study-section-list-item.active {
    border-color: rgba(255, 99, 61, 0.42);
    box-shadow: 0 14px 28px rgba(255, 99, 61, 0.14);
}

.study-section-item-copy {
    min-width: 0;
}

.study-section-range,
.study-section-progress {
    font-size: 0.94rem;
}

.study-section-item-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.study-stage {
    width: min(860px, 100%);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.flashcard {
    width: min(820px, 100%);
    margin: 0 auto;
    min-height: 500px;
    padding: 0;
    background: none;
    border: 0;
    perspective: 1600px;
}

.flashcard.study-locked {
    cursor: default;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    min-height: 500px;
    transition: transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
    transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-face {
    position: absolute;
    inset: 0;
    padding: 30px;
    border-radius: 28px;
    backface-visibility: hidden;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
    overflow: hidden;
}

.flashcard-front {
    background:
        radial-gradient(circle at top right, rgba(255, 99, 61, 0.18), transparent 26%),
        radial-gradient(circle at bottom left, rgba(255, 215, 106, 0.26), transparent 32%),
        linear-gradient(180deg, #ffffff 0%, #fff4eb 100%);
    color: var(--ink);
    border: 1px solid rgba(255, 255, 255, 0.92);
}

.flashcard-back {
    background:
        radial-gradient(circle at top right, rgba(255, 215, 106, 0.16), transparent 28%),
        linear-gradient(160deg, rgba(255, 99, 61, 0.96), rgba(94, 33, 20, 0.95));
    color: #fff;
    transform: rotateY(180deg);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.flashcard-copy {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 0;
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
    text-align: center;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    overflow-y: auto;
    scrollbar-width: thin;
}

.study-hint {
    margin: 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.72);
}

.study-mode-toggle {
    width: min(680px, 100%);
    margin: 0 auto;
    align-self: center;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 8px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 99, 61, 0.16);
}

.study-mode-btn {
    min-height: 48px;
    padding: 12px 16px;
    border-radius: 14px;
    background: transparent;
    color: rgba(255, 255, 255, 0.76);
    border: 1px solid transparent;
    font-weight: 700;
    transition: transform var(--transition), background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.study-mode-btn:hover {
    transform: translateY(-1px);
    color: #fff;
}

.study-mode-btn.active {
    background: linear-gradient(135deg, rgba(255, 99, 61, 0.92), rgba(255, 160, 82, 0.92));
    border-color: rgba(255, 218, 184, 0.22);
    color: #fff;
    box-shadow: 0 16px 26px rgba(255, 99, 61, 0.24);
}

.study-interaction,
.adaptive-help-panel {
    width: min(680px, 100%);
    margin: 0 auto;
    padding: 20px 22px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 99, 61, 0.16);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);
}

.study-answer-panel,
.adaptive-help-grid {
    display: grid;
    gap: 14px;
}

.study-answer-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.study-answer-input {
    width: 100%;
    min-height: 48px;
    padding: 13px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 99, 61, 0.2);
    background: rgba(8, 15, 34, 0.36);
    color: #fff;
}

.study-answer-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.study-answer-feedback,
.study-mc-status,
.adaptive-help-status {
    margin: 0;
    color: rgba(255, 255, 255, 0.76);
}

.study-answer-feedback[data-tone="success"] {
    color: #aef0d5;
}

.study-answer-feedback[data-tone="warning"] {
    color: #ffd994;
}

.study-answer-feedback[data-tone="error"] {
    color: #ffb5c2;
}

.study-mc-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.study-mc-option {
    min-height: 72px;
    padding: 14px 16px;
    border-radius: 16px;
    text-align: left;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    font-weight: 600;
    transition: transform var(--transition), border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.study-mc-option:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 209, 170, 0.32);
    background: rgba(255, 255, 255, 0.1);
}

.study-mc-option.correct {
    background: rgba(31, 159, 120, 0.22);
    border-color: rgba(174, 240, 213, 0.38);
}

.study-mc-option.incorrect {
    background: rgba(221, 78, 103, 0.2);
    border-color: rgba(255, 181, 194, 0.34);
}

.study-mc-option.loading {
    justify-content: center;
    text-align: center;
    color: rgba(255, 255, 255, 0.72);
}

.adaptive-help-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.adaptive-help-header h3 {
    margin: 0;
    font-family: "Bricolage Grotesque", sans-serif;
    letter-spacing: -0.03em;
}

.adaptive-help-grid {
    margin-top: 16px;
}

.adaptive-help-item {
    padding: 16px 18px;
    border-radius: 16px;
    background: rgba(8, 15, 34, 0.32);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.adaptive-help-item h4,
.adaptive-help-item p {
    margin: 0;
}

.adaptive-help-item p {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.6;
    white-space: pre-wrap;
}

.study-actions,
.summary-actions,
.dialog-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.rating-btn {
    min-width: 148px;
    color: #fff;
}

.rating-btn.hard {
    background: linear-gradient(135deg, #d74d62, #b93756);
}

.rating-btn.medium {
    background: linear-gradient(135deg, #f4b63d, #f39b2d);
    color: #503600;
}

.rating-btn.easy {
    background: linear-gradient(135deg, #2cc395, #169f7c);
}

.study-helper-toggle {
    min-height: 44px;
    padding: 11px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 99, 61, 0.2);
    color: #fff;
    font-weight: 700;
    transition: transform var(--transition), background var(--transition), border-color var(--transition);
}

.study-helper-toggle:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 99, 61, 0.34);
}

.study-helper-toggle[aria-expanded="true"] {
    background: rgba(255, 99, 61, 0.16);
    border-color: rgba(255, 99, 61, 0.42);
}

.study-ai-helper {
    width: min(680px, 100%);
    margin: 0 auto;
    padding: 22px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 99, 61, 0.16);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);
}

.study-ai-header,
.study-ai-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.study-ai-header h3 {
    margin: 0;
    font-family: "Bricolage Grotesque", sans-serif;
    letter-spacing: -0.03em;
}

.study-ai-badge {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 99, 61, 0.14);
    border: 1px solid rgba(255, 99, 61, 0.22);
    color: rgba(255, 244, 239, 0.92);
    font-size: 0.85rem;
    font-weight: 700;
}

.study-ai-status {
    margin: 14px 0 0;
    color: rgba(255, 255, 255, 0.72);
}

.study-ai-status[data-tone="error"] {
    color: #ffb5c2;
}

.study-ai-status[data-tone="success"] {
    color: #aef0d5;
}

.study-ai-status[data-tone="warning"] {
    color: #ffd994;
}

.study-ai-setup-toggle {
    margin-top: 12px;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(255, 214, 187, 0.92);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.study-ai-setup-toggle:hover {
    color: #fff0e6;
}

.adaptive-help-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 214, 187, 0.28);
    background: rgba(255, 214, 187, 0.08);
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.adaptive-help-toggle[aria-pressed="true"] {
    background: rgba(255, 214, 187, 0.16);
    border-color: rgba(255, 214, 187, 0.48);
    color: #fff8f1;
}

.study-ai-setup {
    margin-top: 16px;
    padding: 16px;
    border-radius: 16px;
    background: rgba(8, 15, 34, 0.34);
    border: 1px solid rgba(255, 99, 61, 0.16);
}

.study-ai-setup .field-label {
    display: block;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.86);
}

.study-ai-key-input {
    width: 100%;
    min-height: 48px;
    padding: 13px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(8, 15, 34, 0.36);
    color: #fff;
    font: inherit;
}

.study-ai-key-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.study-ai-setup .field-actions {
    margin-top: 12px;
}

.study-ai-setup .helper-text {
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.58);
}

.study-ai-input {
    min-height: 96px;
    margin-top: 14px;
    resize: vertical;
    background: rgba(8, 15, 34, 0.36);
    border-color: rgba(255, 99, 61, 0.18);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.study-ai-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.study-ai-footer {
    margin-top: 14px;
}

.study-ai-footer .helper-text {
    color: rgba(255, 255, 255, 0.58);
}

.study-ai-response {
    margin-top: 16px;
    padding: 16px 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--ink);
    line-height: 1.6;
    white-space: pre-wrap;
    box-shadow: var(--shadow-soft);
}

.study-summary {
    width: min(640px, 100%);
    margin: 0 auto;
    padding: 28px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 99, 61, 0.16);
    text-align: center;
}

.toast-stack {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 80;
}

.toast {
    min-width: 260px;
    max-width: 360px;
    padding: 14px 16px;
    border-radius: 14px;
    color: #fff;
    box-shadow: var(--shadow);
    animation: toast-slide 220ms ease;
}

.toast.info {
    background: linear-gradient(135deg, #1c8a88, #146d73);
}

.toast.success {
    background: linear-gradient(135deg, #1f9f78, #15765a);
}

.toast.warning {
    background: linear-gradient(135deg, #ee7c3b, #cc5b1f);
}

.toast.error {
    background: linear-gradient(135deg, #d74d62, #b93756);
}

@keyframes toast-slide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 22, 47, 0.4);
    backdrop-filter: blur(8px);
}

.dialog-card {
    width: min(420px, 100%);
    padding: 26px;
    border-radius: 22px;
    background: #fff;
    color: var(--ink);
    border: 1px solid rgba(17, 24, 39, 0.08);
    box-shadow: var(--shadow);
}

.dialog-card .ghost-btn {
    background: rgba(30, 36, 64, 0.06);
    color: var(--ink);
    border: 1px solid var(--line);
}

[hidden] {
    display: none !important;
}

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

    .context-column {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .study-header {
        flex-direction: column;
    }

    .study-header-copy {
        order: -1;
        width: 100%;
    }

    .study-header-leading,
    .study-header-actions {
        justify-content: center;
    }
}

@media (max-width: 920px) {
    .app-shell {
        grid-template-columns: 1fr;
        padding-bottom: 100px;
    }

    .sidebar {
        position: relative;
        top: 0;
    }

    .dashboard-hero,
    .panel-heading,
    .form-card-header,
    .library-heading,
    .set-item {
        grid-template-columns: 1fr;
    }

    .dashboard-hero,
    .panel-heading,
    .form-card-header,
    .library-heading,
    .set-item,
    .field-grid {
        display: block;
    }

    .hero-chips,
    .set-actions,
    .library-actions {
        margin-top: 14px;
        justify-content: flex-start;
    }

    .field-inline {
        display: block;
    }

    .field-inline .secondary-btn {
        margin-top: 14px;
    }

    .field-label-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .field-actions {
        margin-top: 14px;
    }

    .context-column {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .app-shell,
    .study-view {
        padding: 16px;
    }

    .sidebar {
        padding-bottom: 26px;
    }

    .sidebar-nav {
        width: 100%;
        padding: 6px;
    }

    .nav-pill {
        flex: 1;
    }

    .workspace-panel,
    .sidebar,
    .dashboard-hero {
        border-radius: 24px;
        padding: 20px;
    }

    .flashcard,
    .flashcard-inner {
        min-height: 390px;
    }

    .flashcard-face {
        padding: 22px;
        border-radius: 28px;
    }

    .flashcard-copy {
        font-size: clamp(1.7rem, 8vw, 2.5rem);
    }

    .study-actions,
    .summary-actions,
    .dialog-actions,
    .study-ai-footer,
    .study-ai-header,
    .adaptive-help-header,
    .study-section-manager-header,
    .study-section-controls,
    .study-section-list-item,
    .study-section-list-header,
    .study-header-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .rating-btn,
    .study-actions .rating-btn,
    .summary-actions .primary-btn,
    .summary-actions .secondary-btn,
    .dialog-actions button,
    .study-ai-footer button,
    .study-header-actions button,
    .study-section-item-actions button,
    .study-section-manager-header button {
        width: 100%;
    }

    .study-section-item-actions {
        width: 100%;
    }

    .study-mode-toggle,
    .study-mc-options {
        grid-template-columns: 1fr;
    }

    .study-answer-row {
        grid-template-columns: 1fr;
    }
}
