/* ============================================
   SHILOH — DESIGN SYSTEM v3, "brand bold" skin
   Two themes: Light and Dark. Values come from the brand-bold redesign:
   Sky #5C9ED6, Electric #2E6FD8, Glacier #7CC8F8, Mint #4FD1A1, Spark #9BF6C8
   over a midnight-navy (Dark) or ice-white (Light) ground. The variable NAMES
   are unchanged from the earlier palette so every page that has not been
   converted yet picks the new look up for free; only the values moved.
   Values marked "derived" are not in the brand board and are interpolated.
   The toggle writes "light" or "dark". Any other data-theme, including a
   saved "dark-navy" from before the palette was these two, still renders Dark.
   ============================================ */

/* Plus Jakarta Sans and JetBrains Mono are loaded by templates/_head_assets.html. */

/* ============================================
   THEME: DARK (default / fallback)
   ============================================ */
:root {
    --bg-primary:    #0A1426;
    --bg-secondary:  #132447;
    --bg-tertiary:   #1C3360;
    --bg-sidebar:    #0A1426;
    --bg-input:      #0A1426;

    --border:        rgba(169, 184, 211, 0.16);
    --border-subtle: rgba(169, 184, 211, 0.09);   /* derived */

    --text-primary:  #F3F7FF;
    --text-secondary:#A9B8D3;
    --text-muted:    #9AABCB;   /* derived; AA on all three Dark surfaces */

    /* The fill is Sky with navy text (the brand button ink), not white on blue. */
    --accent:        #5C9ED6;
    --accent-hover:  #7CC8F8;
    --accent-soft:   #1A3563;   /* derived */
    --accent-text:   #0A1426;
    --accent-bar:    #7CC8F8;   /* progress fills, dots, highlights */
    --accent-ink:    #7CC8F8;   /* accent used AS TEXT */

    --danger:        #FF7A7A;
    --success:       #4FD1A1;
    --warning:       #ECC94B;

    --hero-from:     #2E6FD8;
    --hero-to:       #4FD1A1;
    --hero-btn-bg:   #5C9ED6;
    --hero-btn-ink:  #0A1426;
    --auth-panel:    linear-gradient(155deg, #1C3360 0%, #132447 50%, #0A1426 100%);

    --side-from:     rgba(19, 36, 71, 0.62);
    --side-to:       rgba(19, 36, 71, 0.62);
    --side-border:   rgba(169, 184, 211, 0.16);
    --side-ink:      #A9B8D3;
    --side-mute:     #9AABCB;
    --side-active:   #132447;
    --side-active-ink: #F3F7FF;
    --side-hover:    rgba(243, 247, 255, 0.06);
    --glass:         rgba(19, 36, 71, 0.62);
    --glass-2:       rgba(28, 51, 96, 0.55);

    --dot-1:         #7CC8F8;
    --dot-2:         #5C9ED6;
    --dot-3:         #4FD1A1;

    --toggle-track:  rgba(28, 51, 96, 0.55);
    --toggle-on-bg:  #5C9ED6;
    --toggle-on-ink: #0A1426;

    --card-shadow:   0 1px 2px rgba(0, 0, 0, 0.35), 0 18px 40px rgba(3, 8, 20, 0.45);
    /* Flashcard stack: the sheets peeking out behind the top card (consumed by studyspace.css). */
    --stack-layer-1: #173056;
    --stack-layer-2: #152948;
    --stack-layer-3: #122240;
    --stack-shadow:  drop-shadow(0 4px 12px rgba(0, 0, 0, 0.28));
    --shadow-lg:     0 1px 2px rgba(0, 0, 0, 0.35), 0 24px 60px rgba(3, 8, 20, 0.55);

    --grain-opacity: 0.09;
    --glow-a:        #2E6FD8;
    --glow-a-pct:    45%;
    --glow-b:        #4FD1A1;
    --glow-b-pct:    22%;
    --glow-c:        #5C9ED6;
    --glow-c-pct:    30%;

    /* Spacing (theme-independent, so it is not repeated in the light block).
       4px scale: --space-N is N * 4px. 7, 9 and 11 are skipped because 28, 36
       and 44 are not on the scale. Any spacing value snaps to a step.
       Semantic tokens point at the primitives; floors: card padding >= 12px
       (the 14px corner cut needs it), tap targets >= 44px. */
    --space-1:  4px;
    --space-2:  8px;
    --space-3:  12px;
    --space-4:  16px;
    --space-5:  20px;
    --space-6:  24px;
    --space-8:  32px;
    --space-10: 40px;
    --space-12: 48px;

    --space-grid:    var(--space-3);
    --space-section: var(--space-6);
    --space-card-y:  var(--space-4);
    --space-card-x:  var(--space-4);
    --space-page-y:  var(--space-4);
    --space-page-x:  var(--space-6);
    --space-page-b:  var(--space-10);
    --space-head:    var(--space-4);
    --space-hero-y:  var(--space-6);
    --space-hero-x:  var(--space-6);
    --space-row-y:   var(--space-3);
    --space-cluster: var(--space-3);
    --content-max:   1160px;   /* study pages' .page-wrapper */
    --learn-max:     860px;    /* Learn column cap */
}

/* ============================================
   THEME: LIGHT
   ============================================ */
:root[data-theme="light"] {
    --bg-primary:    #F4F8FF;
    --bg-secondary:  #FFFFFF;
    --bg-tertiary:   #E3EEFC;
    --bg-sidebar:    #FFFFFF;
    --bg-input:      #EEF4FE;

    --border:        rgba(11, 26, 51, 0.10);
    --border-subtle: rgba(11, 26, 51, 0.06);   /* derived */

    --text-primary:  #0B1A33;
    --text-secondary:#4A5D7E;
    --text-muted:    #566888;   /* derived; AA on all three Light surfaces */

    --accent:        #2E6FD8;
    --accent-hover:  #2459B5;   /* derived */
    --accent-soft:   #E3EEFC;
    --accent-text:   #FFFFFF;
    --accent-bar:    #2E6FD8;
    --accent-ink:    #2A64A3;   /* the brand sky-text #2F6FB0, nudged to stay AA on the raised tint */

    --danger:        #C62F2F;
    --success:       #0F7552;
    --warning:       #8A5A00;

    --hero-from:     #2E6FD8;
    --hero-to:       #4FD1A1;
    --hero-btn-bg:   #2E6FD8;
    --hero-btn-ink:  #FFFFFF;
    --auth-panel:    linear-gradient(155deg, #0A1426 0%, #132447 50%, #2E6FD8 100%);

    /* The sidebar is light glass here; it used to stay dark in both themes. */
    --side-from:     rgba(255, 255, 255, 0.72);
    --side-to:       rgba(255, 255, 255, 0.72);
    --side-border:   rgba(11, 26, 51, 0.10);
    --side-ink:      #4A5D7E;
    --side-mute:     #566888;
    --side-active:   #FFFFFF;
    --side-active-ink: #0B1A33;
    --side-hover:    rgba(11, 26, 51, 0.05);
    --glass:         rgba(255, 255, 255, 0.72);
    --glass-2:       rgba(227, 238, 252, 0.80);

    --dot-1:         #2E6FD8;
    --dot-2:         #5C9ED6;
    --dot-3:         #12805A;

    --toggle-track:  rgba(227, 238, 252, 0.80);
    --toggle-on-bg:  #FFFFFF;
    --toggle-on-ink: #0B1A33;

    --card-shadow:   0 1px 2px rgba(11, 26, 51, 0.06), 0 16px 36px rgba(46, 111, 216, 0.12);
    --stack-layer-1: #D4E3F6;
    --stack-layer-2: #C6D8F0;
    --stack-layer-3: #B7CCE8;
    --stack-shadow:  drop-shadow(0 6px 16px rgba(46, 111, 216, 0.14));
    --shadow-lg:     0 1px 2px rgba(11, 26, 51, 0.06), 0 24px 56px rgba(46, 111, 216, 0.16);

    --grain-opacity: 0.06;
    --glow-a:        #7CC8F8;
    --glow-a-pct:    45%;
    --glow-b:        #9BF6C8;
    --glow-b-pct:    45%;
    --glow-c:        #5C9ED6;
    --glow-c-pct:    25%;
}

/* Shared across both themes */
:root {
    /* Space the main area reserves for the floating sidebar: 20px gutter + 224px
       panel + 8px. The page wrapper's own 32px padding supplies the rest, so
       content starts at x=284 as in the reference. */
    --sidebar-width: 252px;
    --font-sans:     'Plus Jakarta Sans', system-ui, sans-serif;
    --font-display:  'Plus Jakarta Sans', system-ui, sans-serif;
    --font-mono:     'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    --radius-sm:     0;
    --radius-md:     0;
    --radius-lg:     0;    /* cards */
    --radius-xl:     0;    /* glass panels */
    --radius-focus:  0;
    --radius-pill:   0;
    --shadow-sm:     none;
    --shadow-md:     var(--card-shadow);

    /* Brand palette, theme-independent. */
    --sky:           #5C9ED6;
    --electric:      #2E6FD8;
    --glacier:       #7CC8F8;
    --mint:          #4FD1A1;
    --spark:         #9BF6C8;
    --ink-night:     #0A1426;   /* text on the sky/mint gradients, in both themes */
    --g-skymint:     linear-gradient(120deg, #5C9ED6, #4FD1A1);
    --g-aurora:      linear-gradient(125deg, #2E6FD8 0%, #5C9ED6 38%, #4FD1A1 75%, #9BF6C8 100%);

    /* Cut corners: one clipped corner is the brand signature. Applied with
       clip-path, so the .cut-* classes below skip :focus-visible (see there). */
    --cut:           22px;
    --cut-hero:      34px;
    --cut-btn:       12px;
    --cut-avatar:    7px;
    --cut-tag:       8px;

    --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ============================================
   RESET
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   BASE
   ============================================ */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background-color 0.2s ease, color 0.2s ease;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: var(--font-sans);
}

input, select, textarea {
    font-family: var(--font-sans);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
.font-display {
    font-family: var(--font-sans);
}

h1, h2, h3 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
}

/* ============================================
   SIDEBAR LAYOUT
   A floating panel that stays dark navy in both themes. The inner markup is
   Tailwind utilities (templates/_sidebar.html); this block owns only the
   shell: position, size, surface, and the slide-in that the page scripts
   toggle with .open on small screens.
   ============================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    top: 20px;
    left: 20px;
    bottom: 20px;
    width: 224px;
    display: flex;
    flex-direction: column;
    /* Glass in both themes (it was solid navy in both): the glow behind the page
       shows through. The blur only matters on the desktop rail; on phones the
       drawer slides over content, where it also reads as glass. */
    background: linear-gradient(180deg, var(--side-from), var(--side-to));
    -webkit-backdrop-filter: blur(22px) saturate(1.4);
    backdrop-filter: blur(22px) saturate(1.4);
    border: 1px solid var(--side-border);
    border-radius: 0;
    box-shadow: var(--card-shadow);
    z-index: 50;
    overflow: hidden;
}

/* The logo PNG is white. On Light glass it is flattened to ink so it stays visible. */
:root[data-theme="light"] .sidebar-logo {
    filter: brightness(0);
    opacity: 0.85;
}

.locked-feature {
    opacity: 0.45;
    cursor: not-allowed;
}

.locked-feature:hover {
    opacity: 0.55;
}

/* Initial-in-a-circle avatar; also reused by the Settings page header. */
.sidebar-avatar {
    width: 30px;
    height: 30px;
    clip-path: polygon(0 0, calc(100% - var(--cut-avatar)) 0, 100% var(--cut-avatar), 100% 100%, var(--cut-avatar) 100%, 0 calc(100% - var(--cut-avatar)));
    background: var(--g-skymint);
    color: var(--ink-night);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    flex-shrink: 0;
}

/* Light / Dark segmented control (templates/_theme_toggle.html). Which segment is
   lit is decided here from data-theme, so it is right on first paint with no
   script: anything that is not "light" counts as Dark. The click listener
   lives in templates/_head_assets.html. */
.theme-toggle {
    display: inline-flex;
    padding: 3px;
    gap: 2px;
    background: var(--toggle-track);
    border-radius: 0;
    box-shadow: inset 0 0 0 1px var(--border);
}
.theme-toggle button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: 0;
    border-radius: 0;
    cursor: pointer;
}
:root[data-theme="light"] .theme-toggle [data-theme-set="light"],
:root:not([data-theme="light"]) .theme-toggle [data-theme-set="dark"] {
    background: var(--toggle-on-bg);
    color: var(--toggle-on-ink);
    box-shadow: 0 1px 2px rgba(11, 26, 51, 0.18);
}
.theme-toggle-floating {
    position: absolute;
    top: 28px;
    right: 32px;
    z-index: 40;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-wrapper {
    /* Left-aligned from x=284 (sidebar + gutter), as in the reference, rather
       than a narrow centred column. */
    padding: 2rem;
    max-width: 1200px;
    width: 100%;
    margin: 0;
}

/* ============================================
   PAGE HEADER
   ============================================ */
.page-top {
    margin-bottom: 2rem;
}

.page-top-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.page-top-title {
    font-family: var(--font-sans);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.page-top-sub {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    transition: color 0.15s;
}

.back-link:hover {
    color: var(--text-primary);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--g-skymint);
    color: var(--ink-night);
    border: none;
    padding: 0.55rem 1.1rem;
    border-radius: 0;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.15s, transform 0.1s;
    font-family: var(--font-sans);
}

.btn-primary:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.55rem 1.1rem;
    border-radius: 0;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-family: var(--font-sans);
}

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

.btn-ghost {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    border-radius: 0;
    transition: color 0.15s, background 0.15s;
    font-family: var(--font-sans);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.btn-danger {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.25rem 0.4rem;
    border-radius: 0;
    transition: color 0.15s, background 0.15s;
}

.btn-danger:hover {
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 8%, transparent);
}

/* Keyboard focus ring: buttons, nav links, and clickable cards only draw the
   browser's default outline on mouse click too, which looks like a stray box
   around everything; :focus-visible keeps it for keyboard/assistive nav only. */
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-ghost:focus-visible,
.btn-danger:focus-visible,
.nav-item:focus-visible,
.card:focus-visible,
.class-card:focus-visible,
.tool-card:focus-visible,
.preview-card:focus-visible,
.feature-card:focus-visible,
.mobile-menu-btn:focus-visible,
.theme-toggle button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 1.5rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

/* ============================================
   DASHBOARD — CLASS CARDS
   ============================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.class-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 1.25rem 1.25rem 1rem;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    min-height: 190px;
    position: relative;
    overflow: hidden;
}

.class-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.15s;
}

.class-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.class-card:hover::before {
    opacity: 1;
}

.class-card-name {
    font-family: var(--font-sans);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.class-card-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.class-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-subtle);
}

.class-card-action {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-ink);
}

.class-card-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 0;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}

.class-card-delete:hover {
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 8%, transparent);
}

.add-class-card {
    background: var(--bg-secondary);
    border: 2px dashed var(--border);
    border-radius: 0;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    min-height: 100px;
    gap: 0.4rem;
}

.add-class-card:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.add-class-card-icon {
    font-size: 1.4rem;
    color: var(--text-muted);
}

.add-class-card-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.class-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 0.5rem;
}

.class-card-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 0;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.class-card-badge.good { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); border-color: transparent; }
.class-card-badge.ok { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.class-card-badge.low { background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning); border-color: transparent; }
.class-card-badge.muted { font-weight: 500; }
/* ============================================
   CLASS HUB — TOOL CARDS
   ============================================ */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.85rem;
}

.tool-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 1.25rem 1.25rem;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tool-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateX(3px);
}

/* The one recommended next step for a class that isn't set up yet. */
.tool-card.tool-card-recommended {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.tool-card-menu-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1;
    padding: 0.15rem 0.45rem;
    border-radius: 0;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}

.tool-card-menu-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.tool-icon {
    width: 40px;
    height: 40px;
    border-radius: 0;
    background: var(--accent-soft);
    color: var(--accent-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.tool-info-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.tool-info-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 1.75rem;
    width: 90%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.modal-title {
    font-family: var(--font-sans);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.modal-buttons {
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
}

/* ============================================
   FORM INPUTS
   ============================================ */
.input {
    width: 100%;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 0;
    font-size: 0.875rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    font-family: var(--font-sans);
}

.input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent);
}

/* The base rule clears the outline. Keyboard focus puts the token ring back;
   mouse clicks keep the border and shadow above. */
.input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.input::placeholder {
    color: var(--text-muted);
}

select.input {
    cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: var(--calendar-icon-filter, none);
    cursor: pointer;
    opacity: 0.5;
}

:root:not([data-theme="light"]) input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

/* ============================================
   SECTION CARDS (grade categories, etc.)
   ============================================ */
.section-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}

.section-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-card-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}

.section-dashed {
    background: var(--bg-secondary);
    border: 2px dashed var(--border);
    border-radius: 0;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}

/* ============================================
   LIST ROWS
   ============================================ */
.gs-step {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.88rem;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
}

.gs-step-check {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 0;
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    color: var(--accent-text);
}

.gs-step-done { color: var(--text-muted); text-decoration: line-through; cursor: default; }
.gs-step-done .gs-step-check { background: var(--accent); border-color: var(--accent); }
.gs-step-disabled { color: var(--text-muted); cursor: default; }

.list-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.875rem;
}

.list-row:last-child {
    border-bottom: none;
}

.list-row-name {
    flex: 1;
    color: var(--text-primary);
    font-weight: 500;
}

.list-row-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.list-row-score {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress-bar {
    background: var(--bg-tertiary);
    border-radius: 0;
    height: 4px;
    overflow: hidden;
}

.progress-fill {
    background: var(--accent);
    height: 100%;
    border-radius: 0;
    transition: width 0.3s ease;
}

/* ============================================
   BADGES / TAGS
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 0;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-accent {
    background: var(--accent-soft);
    color: var(--accent-ink);
}

.badge-success {
    background: color-mix(in srgb, var(--success) 12%, transparent);
    color: var(--success);
}

.badge-warning {
    background: color-mix(in srgb, var(--warning) 12%, transparent);
    color: var(--warning);
}

.badge-muted {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* ============================================
   GRADE CALCULATOR — SPECIFIC
   ============================================ */
.grade-display {
    text-align: center;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.goal-input {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 0.35rem 0.9rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.goal-input input {
    width: 42px;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.875rem;
    text-align: center;
    outline: none;
    padding: 2px 0;
    font-family: var(--font-sans);
}

.goal-input input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.goal-input input::-webkit-outer-spin-button,
.goal-input input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

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

.grade-hint-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 0.9rem 1.25rem;
    margin-bottom: 1.25rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.add-entry-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.85rem;
    flex-wrap: wrap;
}

.add-entry-form .input {
    font-size: 0.82rem;
    padding: 0.45rem 0.75rem;
}

.add-entry-form .input-wide {
    flex: 2;
    min-width: 160px;
}

.add-entry-form .input-narrow {
    flex: 1;
    min-width: 80px;
}

/* ============================================
   ACCORDION (deadlines)
   ============================================ */
.accordion-header {
    cursor: pointer;
    user-select: none;
}

.accordion-arrow {
    color: var(--text-muted);
    font-size: 0.7rem;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.accordion-content {
    padding-left: 1.5rem;
    border-left: 2px solid var(--border-subtle);
    margin-left: 0.25rem;
}

/* ============================================
   UPLOAD AREA (syllabus)
   ============================================ */
.upload-area {
    background: var(--bg-secondary);
    border: 2px dashed var(--border);
    border-radius: 0;
    padding: 5rem 3rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.upload-area:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.upload-area p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ============================================
   FILE CHIPS
   ============================================ */
.file-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    justify-content: center;
}

.file-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 4px 10px 4px 12px;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.file-chip button {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.65rem;
    cursor: pointer;
    width: 16px;
    height: 16px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: color 0.15s;
}

.file-chip button:hover {
    color: var(--danger);
}

/* ============================================
   STEP-BASED LAYOUT (syllabus scraper)
   ============================================ */
.scraper-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem 4rem;
    position: relative;
    left: 50%;
    width: 100vw;
    transform: translateX(calc(-50% - (var(--sidebar-width) / 2)));
}

.step {
    display: none;
    text-align: center;
    max-width: 900px;
    width: 100%;
}

.step.active {
    display: block;
}

.step-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.step-sub {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* ============================================
   DEADLINE ITEMS
   ============================================ */
.deadline-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    gap: 1rem;
}

.deadline-name {
    font-weight: 600;
    color: var(--text-primary);
}

.deadline-date {
    color: var(--text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

.deadline-flag {
    color: var(--warning);
    font-size: 0.75rem;
    font-weight: 700;
    margin-right: 0.5rem;
    cursor: help;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    display: flex;
    gap: 20px;
    padding: 20px;
    min-height: 100vh;
}

/* Brand panel: a rounded gradient card with the mark top-left and the tagline
   set large beside it. Stays dark in both themes, like the sidebar. */
.login-left {
    flex: 0 0 48%;
    max-width: 690px;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto 1fr;
    column-gap: 0.7rem;
    align-items: center;
    padding: 2.8rem 3rem;
    border-radius: 0;
    background: var(--auth-panel);
    color: #fff;
}

/* The form is a card floating in the space beside the panel (margin:auto
   centres it on both axes of the flex row). */
.login-right {
    width: 420px;
    max-width: 100%;
    margin: auto;
    background: var(--bg-secondary);
    border-radius: 0;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    padding: 2.1rem;
}

.login-left .login-logo-img {
    grid-column: 1;
    grid-row: 1;
    width: 36px;
    height: 36px;
}

.login-logo {
    grid-column: 2;
    grid-row: 1;
    font-family: var(--font-sans);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #fff;
    line-height: 1;
}

.login-logo sup {
    font-size: 0.5em;
    opacity: 0.7;
}

.login-tagline {
    grid-column: 1 / -1;
    grid-row: 2;
    align-self: center;
    justify-self: start;
    max-width: 12ch;
    margin: 0;
    font-size: clamp(2rem, 3.4vw, 3rem);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.035em;
    color: #fff;
    text-align: left;
}

.login-features {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 320px;
    text-align: left;
}

.login-feature {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

.login-feature-icon {
    width: 36px;
    height: 36px;
    border-radius: 0;
    background: var(--accent-soft);
    color: var(--accent-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.login-feature-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.login-feature-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.login-panel-title {
    font-family: var(--font-sans);
    font-size: 1.9rem;
    font-weight: 500;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    text-align: left;
}

.login-panel-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.4rem;
    text-align: left;
}

.oauth-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 0;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    text-decoration: none;
    margin-bottom: 0.75rem;
    font-family: var(--font-sans);
}

.oauth-btn:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: var(--shadow-sm);
}

.oauth-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.login-divider {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin: 0.5rem 0 1.5rem;
}

.login-legal {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 1.5rem;
    line-height: 1.5;
}

.login-legal a {
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Email sign-in, signup and password reset forms (templates/signin.html, auth_form.html) */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
    margin-bottom: 0.75rem;
}

.auth-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-top: 0.7rem;
}

.auth-optional {
    color: var(--text-muted);
    font-weight: 400;
}

.auth-input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid transparent;
    border-radius: 0;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-sans);
    box-sizing: border-box;
}

.auth-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.auth-input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.auth-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

.auth-password-wrap {
    position: relative;
    width: 100%;
}

/* Keep typed text clear of the Show/Hide button. */
.auth-password-wrap .auth-input {
    padding-right: 4.5rem;
}

.auth-password-toggle {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    padding: 0 1rem;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
}

.auth-password-toggle:hover {
    color: var(--text-primary);
}

.auth-password-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.auth-btn {
    margin-top: 1rem;
    width: 100%;
    padding: 0.9rem 1.25rem;
    border: none;
    border-radius: 0;
    background: var(--accent);
    color: var(--accent-text);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
}

.auth-btn:hover {
    filter: brightness(1.08);
}

.auth-error,
.auth-notice {
    font-size: 0.85rem;
    line-height: 1.45;
    width: 100%;
    padding: 0.6rem 0.8rem;
    border-radius: 0;
    margin: 0 0 0.9rem;
    box-sizing: border-box;
}

.auth-error {
    color: var(--text-primary);
    background: rgba(220, 38, 38, 0.12);
    border: 1px solid rgba(220, 38, 38, 0.35);
}

.auth-notice {
    color: var(--text-primary);
    background: var(--accent-soft);
    border: 1px solid var(--border);
}

.auth-links {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    margin: 0.4rem 0 0;
}

.auth-links a,
.auth-legacy a {
    color: var(--accent-ink);
    text-decoration: none;
}

.auth-links a:hover,
.auth-legacy a:hover {
    text-decoration: underline;
}

.auth-legacy-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    vertical-align: middle;
}

.auth-legacy-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.auth-legacy {
    width: 100%;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

.auth-legacy p {
    margin: 0 0 0.4rem;
}

.auth-link-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--accent-ink);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
    font-family: var(--font-sans);
}

/* ============================================
   HOME (marketing landing page)
   Same system as the app: page background, floating cards, display-font
   headings, the brand-panel gradient from the sign-in page.
   ============================================ */
.home-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--bg-primary) 88%, transparent);
    backdrop-filter: blur(10px);
}

.home-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1rem 2rem;
}

.home-nav-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

/* The mark is white line art: invert it on the light page, leave it on dark. */
.home-nav-logo-img {
    width: 34px;
    height: 34px;
    filter: invert(1);
    opacity: 0.9;
}

:root:not([data-theme="light"]) .home-nav-logo-img {
    filter: none;
    opacity: 1;
}

.home-nav-logo sup {
    font-size: 0.5em;
    opacity: 0.6;
}

.home-nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.home-nav-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.15s;
}

.home-nav-links a:hover {
    color: var(--text-primary);
}

.home-nav-right {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

/* Cut-corner sky->mint button (.cut-btn adds the clip-path and the focus-ring swap).
   Text on the gradient is the night ink in both themes. */
.home-nav-cta {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    background: var(--g-skymint);
    color: var(--ink-night);
    padding: 0 var(--space-6);
    font-size: 0.9rem;
    font-weight: 800;
    transition: filter 0.15s;
}

.home-nav-cta:hover {
    filter: brightness(1.08);
}

.hero {
    position: relative;
    isolation: isolate;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-12) var(--space-8) var(--space-12);
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
}

/* Text sits on top of the brand panel, which fills the hero behind it. */
.hero-content {
    position: relative;
    z-index: 1;
    max-width: 40rem;
}

/* Eyebrow chip: the one-corner cut tag, label type. */
.hero-badge {
    display: inline-block;
    padding: var(--space-2) var(--space-4) var(--space-2) var(--space-3);
    border-radius: 0;
    clip-path: polygon(0 0, calc(100% - var(--cut-tag)) 0, 100% var(--cut-tag), 100% 100%, 0 100%);
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    margin-bottom: var(--space-6);
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.6rem, 5.4vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.04em;
    margin-bottom: var(--space-5);
}

.hero-subtitle {
    font-size: 1.1rem;
    line-height: 1.65;
    color: var(--text-secondary);
    max-width: 34rem;
    margin-bottom: var(--space-8);
}

.hero-cta-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    min-height: 52px;
    background: var(--g-skymint);
    color: var(--ink-night);
    padding: 0 var(--space-6);
    font-size: 1rem;
    font-weight: 800;
    transition: filter 0.15s;
}

.hero-cta:hover {
    filter: brightness(1.08);
}

.hero-note {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* The brand panel from the sign-in page, as the hero visual. */
.hero-visual {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: grid;
    place-items: center end;
    padding-right: 8%;
    background: var(--auth-panel);
    overflow: hidden;
}

/* Brand glow: a mint sun and a sky haze over the night panel (same in both themes). */
.hero-visual-glow {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 72% 22%, color-mix(in srgb, var(--spark) 38%, transparent), transparent 42%),
        radial-gradient(circle at 18% 90%, color-mix(in srgb, var(--mint) 30%, transparent), transparent 55%),
        radial-gradient(circle at 90% 100%, color-mix(in srgb, var(--sky) 40%, transparent), transparent 60%);
}

.hero-visual-logo {
    position: relative;
    width: 220px;
    height: 220px;
    opacity: 0.95;
}

.section-heading {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3.4vw, 2.6rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.035em;
    text-align: center;
    margin-bottom: var(--space-10);
}

.steps-section,
.features-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-12) var(--space-8);
}

.steps-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.steps-row .step {
    /* The syllabus page's generic .step is display:none / centred / 900px wide; reset it here. */
    display: block;
    max-width: none;
    width: auto;
    text-align: left;
    /* Brand card: cut corner (.cut-card) on a surface with a hairline, since
       the clip-path would cut a drop shadow off. */
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 0;
    padding: var(--space-6);
}

.step-icon {
    position: relative;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 0;
    background: var(--accent-soft);
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.step-number {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 0;
    background: var(--g-skymint);
    color: var(--ink-night);
    font-size: 0.72rem;
    font-weight: 800;
}

.steps-row .step-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.step-desc {
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.step-connector {
    display: none;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.feature-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 0;
    padding: var(--space-6);
}

.feature-card-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 0;
    background: var(--accent-soft);
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.feature-card-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.feature-card-desc {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.home-footer {
    max-width: 1200px;
    margin: var(--space-8) auto 0;
    padding: var(--space-8);
    text-align: center;
    border-top: 1px solid var(--border-subtle);
}

.home-footer a {
    color: var(--accent-ink);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

@media (max-width: 900px) {
    .home-nav-inner { padding: var(--space-3) var(--space-5); }
    .home-nav-links { display: none; }
    .home-nav-right .theme-toggle { display: none; }
    .hero { grid-template-columns: 1fr; padding: var(--space-8) var(--space-5) var(--space-12); gap: var(--space-8); }
    /* Narrow screens: the tree tucks into the bottom-right corner, clear of the headline and copy. */
    .hero-visual { place-items: end end; padding: 0 var(--space-5) var(--space-5) 0; }
    .hero-visual-logo { width: 110px; height: 110px; }
    .steps-section, .features-section { padding: var(--space-8) var(--space-5); }
    .section-heading { margin-bottom: var(--space-8); }
    .steps-row, .features-grid { grid-template-columns: 1fr; }
}

/* ============================================
   LEGAL PAGES (Terms of Service, Privacy Policy)
   One readable card on the page background. Typography only: the wording
   lives in the templates and is not touched by styling.
   ============================================ */
.legal-page {
    max-width: 840px;
    margin: var(--space-10) auto var(--space-12);
    padding: var(--space-10) var(--space-12) var(--space-12);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 0;
    /* Brand card: one cut corner. clip-path trims a drop shadow, so a hairline stands in. */
    clip-path: polygon(0 0, calc(100% - var(--cut-hero)) 0, 100% var(--cut-hero), 100% 100%, 0 100%);
}

.legal-page h1 {
    margin-bottom: var(--space-3);
    letter-spacing: -0.035em;
}

.legal-page .back-link {
    color: var(--accent-ink);
    font-weight: 700;
}

/* The company / date line reads as the page's eyebrow label. */
.legal-page .legal-meta {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-ink);
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--border-subtle);
}

.legal-page .legal-meta em {
    font-style: normal;
}

.legal-content {
    line-height: 1.75;
    color: var(--text-secondary);
}

.legal-content h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-top: var(--space-10);
    margin-bottom: var(--space-2);
}

.legal-content p {
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.legal-content ul {
    margin: 0 0 1rem 1.3rem;
    font-size: 0.95rem;
}

.legal-content li {
    margin-bottom: 0.35rem;
}

.legal-content a {
    color: var(--accent-ink);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1rem 0 1.5rem;
    font-size: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 0;
    overflow: hidden;
}

.legal-table th,
.legal-table td {
    text-align: left;
    padding: 0.65rem 0.9rem;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}

.legal-table tr:last-child td {
    border-bottom: 0;
}

.legal-table th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
}

.legal-table td {
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .legal-page { margin: var(--space-4) var(--space-3) var(--space-8); padding: var(--space-6) var(--space-5) var(--space-8); }
}

/* ============================================
   LEGAL FOOTER
   ============================================ */
.legal-footer {
    padding: 1.5rem 2.5rem;
    margin-top: auto;
    font-size: 0.72rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
}

.legal-footer a {
    color: var(--text-muted);
    transition: color 0.15s;
}

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

/* ============================================
   GOOGLE CALENDAR BTN
   ============================================ */
/* ============================================
   AUTOFILL FIX
   ============================================ */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px var(--bg-primary) inset;
    -webkit-text-fill-color: var(--text-primary);
    caret-color: var(--text-primary);
}

/* ============================================
   THEME SCRIPT INIT (prevents flash)
   ============================================ */
.theme-init {
    visibility: hidden;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        /* 20px left gutter + the panel width, so none of it peeks in */
        transform: translateX(calc(-100% - 24px));
        transition: transform 0.25s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* The floating toggle would sit under the mobile header; the sidebar
       carries its own copy on small screens. */
    .theme-toggle-floating {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.875rem 1.25rem;
        background: var(--glass);
        -webkit-backdrop-filter: blur(22px) saturate(1.4);
        backdrop-filter: blur(22px) saturate(1.4);
        border-bottom: 1px solid var(--border);
        position: sticky;
        top: 0;
        z-index: 40;
    }

    /* The header markup is a bare "Shiloh™" in every template; the brand mark
       is added here so no template has to change. */
    .mobile-header-logo {
        display: inline-flex;
        align-items: center;
        gap: 0.6rem;
        font-family: var(--font-sans);
        font-size: 1.1rem;
        font-weight: 800;
        letter-spacing: -0.03em;
        color: var(--text-primary);
    }

    .mobile-header-logo::before {
        content: "";
        width: 28px;
        height: 28px;
        background: url("/static/shiloh-logo.png") center / contain no-repeat;
    }

    :root[data-theme="light"] .mobile-header-logo::before {
        filter: brightness(0);
        opacity: 0.85;
    }

    .mobile-menu-btn {
        background: none;
        border: none;
        color: var(--text-primary);
        font-size: 1.3rem;
        cursor: pointer;
        padding: 0.25rem;
    }

    .mobile-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 49;
    }

    .mobile-overlay.active {
        display: block;
    }

    .page-wrapper {
        padding: 1.25rem;
    }

    .login-page {
        flex-direction: column;
        padding: 12px;
        gap: 12px;
    }

    .login-left {
        flex: none;
        max-width: none;
        padding: 1.6rem 1.5rem;
    }

    .login-left .login-tagline {
        margin-top: 2.5rem;
        font-size: 2rem;
    }

    .login-right {
        width: 100%;
        margin: 0;
        padding: 1.6rem 1.4rem;
    }

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

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

@media (min-width: 769px) {
    .mobile-header {
        display: none;
    }
    .mobile-overlay {
        display: none !important;
    }
}

/* ============================================
   THEME PERSISTENCE SCRIPT
   ============================================ */

/* ============================================
   CONTEXT-AWARE CLASS NAV
   ============================================ */
.nav-class-section {
    margin: 0.25rem 0;
}

.nav-class-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
}

.nav-class-header:hover {
    background: var(--bg-tertiary);
}

.nav-class-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.82rem;
}

.nav-class-tools {
    padding: 0.15rem 0 0.35rem;
}

.nav-tool-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 1.25rem 0.45rem 2.5rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    position: relative;
}

.nav-tool-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-tool-item.active {
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-weight: 600;
}

.nav-tool-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    border-radius: 0;
}

.nav-tool-icon {
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* Nav divider */
.nav-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 0.5rem 1.25rem;
}

/* ============================================
   LOGO IMAGE
   ============================================ */
.sidebar-logo-img {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    filter: invert(1);
    opacity: 0.9;
    color: var(--text-primary);
}

:root:not([data-theme="light"]) .sidebar-logo-img {
    filter: invert(0);
    opacity: 1;
}

.login-logo-img {
    flex-shrink: 0;
}

/* ============================================
   CALENDAR VIEW
   ============================================ */
.calendar-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.5rem;
    align-items: start;
}

.calendar-main {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 1.25rem;
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.calendar-month-label {
    font-family: var(--font-sans);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.calendar-nav-btns {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cal-nav-btn {
    width: 28px;
    height: 28px;
    border-radius: 0;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: background 0.15s, color 0.15s;
}

.cal-nav-btn:hover {
    background: var(--accent-soft);
    color: var(--accent-ink);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 4px;
}

.calendar-weekdays div {
    text-align: center;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 0.35rem 0;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: var(--calendar-row-size, auto);
    gap: 4px;
}

.calendar-day {
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 0;
    /* Cells fill their grid row exactly and never grow past it, so neighbouring
       boxes can't overlap however tall the page above the calendar gets. */
    min-height: 96px;
    min-width: 0;
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow: hidden;
}

.calendar-day-out {
    opacity: 0.35;
}

.calendar-day-today {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.calendar-day-num {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.calendar-day-today .calendar-day-num {
    color: var(--accent-ink);
}

.calendar-day-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.calendar-pill {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 0;
    border: 1px solid;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: transform 0.1s;
}

.calendar-pill:hover {
    transform: translateX(1px);
}

.calendar-more {
    font-size: 0.62rem;
    color: var(--text-muted);
    padding: 1px 4px;
}

/* Next up sidebar */
.next-up-row {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.next-up-row:last-child {
    border-bottom: none;
}

.next-up-dot {
    width: 8px;
    height: 8px;
    border-radius: 0;
    margin-top: 5px;
    flex-shrink: 0;
}

.next-up-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.next-up-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1px;
}

/* Legend */
.legend-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.4rem 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 0;
    flex-shrink: 0;
}

/* Popover */
.cal-popover-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(3px);
    z-index: 200;
}

.cal-popover-overlay.active {
    display: block;
}

.cal-popover {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 1.5rem;
    width: 90%;
    max-width: 340px;
    z-index: 201;
    box-shadow: var(--shadow-lg);
}

.cal-popover.active {
    display: block;
}

.cal-popover-bar {
    width: 36px;
    height: 4px;
    border-radius: 0;
    margin-bottom: 0.85rem;
}

.cal-popover-name {
    font-family: var(--font-sans);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.cal-popover-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.cal-popover-status {
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.75rem;
}

/* Responsive */
@media (max-width: 900px) {
    .calendar-layout {
        grid-template-columns: 1fr;
    }
    .calendar-day {
        height: 68px;
        min-height: 68px;
    }
}

/* ============================================
   CALENDAR — MOBILE (phone) POLISH
   ============================================ */
@media (max-width: 768px) {
    .view-toggle-row .btn-secondary {
        padding: 0.65rem 0.9rem;
        font-size: 0.82rem;
    }

    .cal-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .calendar-main {
        padding: 0.75rem;
    }

    .calendar-month-label {
        font-size: 1.05rem;
    }

    .hour-gutter {
        width: 42px;
    }

    .hour-gutter-label {
        font-size: 0.6rem;
        padding-right: 4px;
    }

    .timed-block-name {
        font-size: 0.7rem;
    }

    .timed-block-time {
        font-size: 0.62rem;
    }

    .allday-pill,
    .calendar-pill {
        font-size: 0.7rem;
        padding: 3px 6px;
    }

    .list-row {
        padding: 0.85rem 0;
        gap: 0.85rem;
    }

    .list-row input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }

    .next-up-row {
        padding: 0.75rem 0;
    }

    /* Popovers become bottom sheets — thumb-reachable instead of centered */
    .cal-popover,
    #dayView {
        max-width: 100%;
        width: 100%;
        left: 0;
        right: 0;
        top: auto;
        bottom: 0;
        transform: none;
        border-radius: 0;
        padding: 1.5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
    }

    .cal-popover .btn-ghost,
    #dayView .btn-ghost {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}

.legend-row:hover {
    background: var(--bg-tertiary);
    cursor: pointer;
}

.feedback-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}

/* ============================================
   DASHBOARD TOP BAR (tabs + quick actions)
   ============================================ */
.dashboard-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.dashboard-tabs {
    display: flex;
    gap: 0.4rem;
}
.dashboard-tab {
    padding: 0.5rem 0.9rem;
    border-radius: 0;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-secondary);
    border: 1px solid transparent;
}
.dashboard-tab.active {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text-primary);
}
.dashboard-tab:hover:not(.active) {
    color: var(--text-primary);
}
.dashboard-actions {
    display: flex;
    gap: 0.5rem;
}

/* ============================================
   DASHBOARD LAYOUT (main column + side stats)
   ============================================ */
.dashboard-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 1.5rem;
    align-items: start;
}
.dashboard-main-col {
    min-width: 0;
}
.dashboard-side-col {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
@media (max-width: 900px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    .dashboard-side-col {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .dashboard-side-col .preview-card {
        flex: 1 1 150px;
    }
}

/* ============================================
   HOME PREVIEW CARDS
   ============================================ */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}
.preview-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 1.1rem 1.25rem;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.preview-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.preview-value {
    font-family: var(--font-sans);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
}
.preview-value.danger { color: var(--warning); }
.preview-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }
.preview-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.2rem; }

.toast-container {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.65rem 1.1rem;
    border-radius: 0;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.error {
    border-color: var(--danger);
    color: var(--danger);
}

@keyframes checkPop {
    0% { transform: scale(1); }
    45% { transform: scale(1.35); }
    100% { transform: scale(1); }
}
.deadline-checkbox.pop { animation: checkPop 0.3s ease; }

@keyframes completeFlash {
    0% { background: var(--accent-soft); }
    100% { background: transparent; }
}
.deadline-row.just-completed { animation: completeFlash 0.6s ease; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
.card, .section-card, .class-card-wrapper, .preview-card, .stat-card, .tool-card {
    animation: fadeInUp 0.35s ease both;
}

sup {
  font-size: 40%;
  vertical-align: super;
  position: relative;
  top: -0.4em;
}
/* "Soon" pill next to a nav item that is not launched yet (see billing.STUDYSPACE_AVAILABLE) */
.nav-soon { margin-left:auto; font-size:0.62rem; font-weight:700; letter-spacing:0.04em; text-transform:uppercase; padding:0.1rem 0.4rem; border-radius: 0; border:1px solid var(--border); color:var(--text-muted); }

/* ============================================
   ABOUT US PAGE (templates/about_us.html)
   ============================================ */
.about-wrapper { max-width: 760px; }

.about-card { padding: 3rem 3.25rem; }

.about-content {
    max-width: 62ch;
    margin: 0 auto;
}

.about-content p {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text-secondary);
    margin: 0 0 1.6rem;
}

/* the opening paragraph reads first: a touch larger and in the primary text colour */
.about-content .about-lead {
    font-size: 1.2rem;
    line-height: 1.75;
    color: var(--text-primary);
}

/* keep the author's own line breaks (one sentence per line) for this paragraph */
.about-content .about-lines { white-space: pre-line; }

/* the mission opens the page: it is what everything below is for */
.about-mission {
    margin: 0 0 2.75rem;
    padding-bottom: 2.25rem;
    border-bottom: 1px solid var(--border-subtle);
}
.about-content .about-mission-label {
    margin: 0 0 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--accent-ink);
}
.about-content .about-mission-text {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.5rem;
    line-height: 1.3;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}
.about-mission .about-verse { margin-top: 1.5rem; }

.about-verse {
    margin: 2.5rem 0 0;
    padding: 0.35rem 0 0.35rem 1.4rem;
    border-left: 3px solid var(--mint);
    font-family: var(--font-sans);
    font-style: italic;
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--text-primary);
}

.about-verse cite {
    display: block;
    margin-top: 0.6rem;
    font-family: var(--font-sans);
    font-style: normal;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.about-roadmap-link {
    margin: 2rem 0 0;
    padding-top: 1.4rem;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.9rem;
}

.about-roadmap-link a {
    color: var(--accent-ink);
    font-weight: 600;
    text-decoration: none;
}

.about-roadmap-link a:hover { text-decoration: underline; }

/* signed-out layout: no sidebar, just the logo above a centred card */
.about-public {
    max-width: 760px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 2rem;
}

.about-public-logo {
    display: block;
    width: 56px;
    margin: 0 auto 1.75rem;
}

.about-public-logo img { display: block; width: 56px; height: 56px; }

/* The logo PNG is white line art: flatten it to ink on the light page, like the sidebar logo. */
:root[data-theme="light"] .about-public-logo img {
    filter: brightness(0);
    opacity: 0.85;
}

/* Public About/Support card: the brand cut corner on a hairline surface. */
.about-public .about-card {
    border: 1px solid var(--border-subtle);
    border-radius: 0;
    box-shadow: none;
    clip-path: polygon(0 0, calc(100% - var(--cut-hero)) 0, 100% var(--cut-hero), 100% 100%, 0 100%);
}

@media (max-width: 640px) {
    .about-card { padding: 1.75rem 1.25rem; }
    .about-content p { font-size: 1rem; }
    .about-content .about-lead { font-size: 1.1rem; }
    .about-verse { font-size: 1.05rem; }
}

/* ============================================
   ROADMAP PAGE (templates/roadmap.html)
   ============================================ */
.roadmap-wrapper { max-width: 960px; }

.roadmap-public {
    max-width: 960px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 2rem;
}

.roadmap-head { margin-bottom: 2.25rem; }
.roadmap-eyebrow { font-size: 0.8rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-ink); margin: 0 0 0.6rem; }
.roadmap-title { font-family: var(--font-display); font-size: 2.6rem; line-height: 1.1; font-weight: 800; letter-spacing: -0.04em; color: var(--text-primary); margin: 0 0 var(--space-4); }
.roadmap-intro { font-size: 1.05rem; line-height: 1.6; color: var(--text-secondary); margin: 0; max-width: 640px; }

.roadmap-phase { margin-bottom: 2.75rem; }
.roadmap-phase-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.roadmap-num {
    width: 44px; height: 44px; flex-shrink: 0; box-sizing: border-box;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--border); border-radius: 0;
    clip-path: polygon(0 0, calc(100% - var(--cut-avatar)) 0, 100% var(--cut-avatar), 100% 100%, var(--cut-avatar) 100%, 0 calc(100% - var(--cut-avatar)));
    font-family: var(--font-display); font-size: 1.15rem; font-weight: 800; color: var(--text-secondary);
}
.roadmap-phase.is-next .roadmap-num { border-color: var(--accent); color: var(--accent-ink); }
.roadmap-phase-text { flex-grow: 1; min-width: 0; }
.roadmap-phase-title { font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; letter-spacing: -0.03em; color: var(--text-primary); margin: 0 0 0.15rem; }
.roadmap-phase-sub { font-size: 0.95rem; color: var(--text-secondary); margin: 0; }
.roadmap-status { flex-shrink: 0; padding: 0.3rem 0.9rem 0.3rem 0.8rem; border-radius: 0; clip-path: polygon(0 0, calc(100% - var(--cut-tag)) 0, 100% var(--cut-tag), 100% 100%, 0 100%); background: var(--bg-tertiary); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-secondary); }
.roadmap-phase.is-next .roadmap-status { background: var(--g-skymint); color: var(--ink-night); }

.roadmap-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1rem; }
.roadmap-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.roadmap-grid.cols-1 { grid-template-columns: minmax(0, 1fr); }
.roadmap-item { grid-column: span 2; padding: var(--space-6); border: 1px solid var(--border-subtle); border-radius: 0; background: var(--bg-secondary); clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%); }
.roadmap-grid.cols-2 .roadmap-item, .roadmap-grid.cols-1 .roadmap-item { grid-column: auto; }
.roadmap-item.span-3 { grid-column: span 3; }
.roadmap-icon { display: block; width: 26px; height: 26px; color: var(--accent-ink); margin-bottom: 0.8rem; }
.roadmap-item h3 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text-primary); margin: 0 0 0.5rem; }
.roadmap-item p { font-size: 0.92rem; line-height: 1.6; color: var(--text-secondary); margin: 0; }
.roadmap-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; }
.roadmap-tags span { padding: 0.25rem 0.9rem 0.25rem 0.75rem; border-radius: 0; clip-path: polygon(0 0, calc(100% - var(--cut-tag)) 0, 100% var(--cut-tag), 100% 100%, 0 100%); background: var(--bg-tertiary); font-size: 0.82rem; font-weight: 500; color: var(--text-secondary); }
.roadmap-foot { font-size: 0.92rem; color: var(--text-muted); margin: 0; }

@media (max-width: 760px) {
    .roadmap-title { font-size: 2rem; }
    .roadmap-phase-head { flex-wrap: wrap; }
    .roadmap-grid, .roadmap-grid.cols-2 { grid-template-columns: minmax(0, 1fr); }
    .roadmap-item, .roadmap-item.span-3 { grid-column: auto; }
}


/* ============================================
   SOFT SKIN
   Warm rounded cards, sans labels, serif display headings. Replaces the old
   instrument-panel look (hairline borders, monospace labels, grid backdrop).
   Tokens live in the theme blocks at the top of this file.
   ============================================ */
body {
    letter-spacing: -0.003em;
    font-feature-settings: 'cv11', 'ss01';
}
h1, h2, h3, h4,
.page-top-title, .modal-title, .section-card-title, .sidebar-logo-text {
    letter-spacing: -0.01em;
    font-weight: 600;
}
/* Page titles take the display weight (Plus Jakarta Sans 800). */
h1, .page-top-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 2.5rem;
    line-height: 1.1;
    letter-spacing: -0.035em;
}

/* The small line above a title ("Tuesday", "Socratic tutor · Biology 101"):
   plain and quiet, not an uppercase tag. */
.page-top-label {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
    font-size: 0.82rem;
}

/* Micro-labels: small, uppercase, tracked, in the UI face */
.nav-section-label, .section-card-label, .add-class-card-label,
.roadmap-eyebrow, .badge, .class-card-badge,
.calendar-month-label, .hero-badge, .preview-label {
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}
.nav-section-label, .section-card-label { font-size: 0.68rem; }
.badge, .class-card-badge { font-size: 0.64rem; }

/* Numbers keep tabular alignment but use the UI face */
.deadline-date, .hour-gutter-label, .record-duration,
.stat-value, .stat-number, .class-card-grade, .time, time {
    font-family: var(--font-sans);
    font-variant-numeric: tabular-nums;
}

.badge { border: 1px solid color-mix(in srgb, currentColor 30%, transparent); }
.badge-accent, .badge-success, .badge-warning { background: transparent; }

/* Surfaces: soft cards. Light gets a shadow, Dark a hairline ring plus shadow. */
.card, .section-card, .class-card-wrapper, .preview-card, .stat-card, .tool-card,
.modal {
    box-shadow: var(--card-shadow);
    border-radius: 0;
    border-color: transparent;
}
.card:hover, .class-card-wrapper:hover, .tool-card:hover { transform: none; }
.section-card-title { border-bottom: 1px solid var(--border-subtle); padding-bottom: 0.6rem; }

/* Buttons */
.btn-primary, .btn-secondary, .btn-ghost, .btn-danger {
    border-radius: 0;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: none;
}
.btn-primary:hover, .btn-secondary:hover { transform: none; box-shadow: none; }

/* Inputs */
input, select, textarea { border-radius: 0; background-color: var(--bg-input); }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Fields and wells inside a card read as recessed, not as holes to the page behind.
   Pages colour their inputs with var(--bg-primary) (the page background); inside a
   card that is remapped to the field colour. On Dark the two are the same value. */
.card, .section-card, .modal, .stat-card, .tool-card, .preview-card, .class-card-wrapper {
    --bg-primary: var(--bg-input);
}

.main-content { position: relative; }
.main-content > * { position: relative; }
.progress-bar, .progress-fill, .file-chip { border-radius: 0; }
.roadmap-num, .roadmap-status, .roadmap-tags span, .roadmap-eyebrow { font-family: var(--font-sans); }
.roadmap-status, .roadmap-tags span { text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.68rem; }
.roadmap-item h3 { letter-spacing: -0.01em; }

/* Decorative motion (page transitions, checkbox pops, the syllabus chip
   brawl's CSS) is not required to use the app. A near-zero duration keeps
   the end state without the movement. JS-driven loops check the same
   media query themselves. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================
   BRAND BOLD: background, cut corners, shared pieces
   ============================================ */

/* Page ground: blurred glow washes and film grain, fixed behind everything.
   Both layers sit at z-index -1 so they can never cover content, a modal or the
   fixed sidebar, and neither takes pointer events. The glow is radial gradients
   rather than the mockup's 90px-blurred circles: same look, and no blur filter
   on a full-screen fixed layer. Nothing here animates, so the reduced-motion
   rule above has nothing to switch off. */
body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}
body::before {
    background:
        radial-gradient(620px circle at -4% -8%, color-mix(in srgb, var(--glow-a) var(--glow-a-pct), transparent), transparent 70%),
        radial-gradient(560px circle at 100% -10%, color-mix(in srgb, var(--glow-c) var(--glow-c-pct), transparent), transparent 70%),
        radial-gradient(640px circle at 104% 104%, color-mix(in srgb, var(--glow-b) var(--glow-b-pct), transparent), transparent 70%);
}
body::after {
    background-image: var(--grain);
    opacity: var(--grain-opacity);
    mix-blend-mode: overlay;
}

/* ---- Cut corners ----
   clip-path also clips outlines and box-shadows, which would hide a keyboard
   focus ring. So every cut shape drops its clip-path while it has :focus-visible
   and the outline (offset 2px) draws on the plain box instead. */
.cut-card {
    clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
}
.cut-hero {
    clip-path: polygon(0 0, calc(100% - var(--cut-hero)) 0, 100% var(--cut-hero), 100% 100%, 0 100%);
}
.cut-btn,
.btn-primary,
.ap-record {
    clip-path: polygon(0 0, calc(100% - var(--cut-btn)) 0, 100% var(--cut-btn), 100% 100%, var(--cut-btn) 100%, 0 calc(100% - var(--cut-btn)));
}
.cut-avatar,
.ap-avatar,
.sidebar-avatar {
    clip-path: polygon(0 0, calc(100% - var(--cut-avatar)) 0, 100% var(--cut-avatar), 100% 100%, var(--cut-avatar) 100%, 0 calc(100% - var(--cut-avatar)));
}
.cut-avatar {
    background: var(--g-skymint);
    color: var(--ink-night);
    font-weight: 800;
}
.cut-card:focus-visible,
.cut-hero:focus-visible,
.cut-btn:focus-visible,
.cut-avatar:focus-visible,
.btn-primary:focus-visible,
.ap-record:focus-visible,
.ap-avatar:focus-visible,
.sidebar-avatar:focus-visible,
.badge:focus-visible {
    clip-path: none;
}

/* Tags: .badge goes from a pill to a one-corner cut tag. */
.badge {
    border-radius: 0;
    clip-path: polygon(0 0, calc(100% - var(--cut-tag)) 0, 100% var(--cut-tag), 100% 100%, 0 100%);
    padding-right: 0.65rem;
    font-weight: 800;
}

/* Glass: for panels that sit over the glow. */
.glass {
    background: var(--glass);
    -webkit-backdrop-filter: blur(22px) saturate(1.4);
    backdrop-filter: blur(22px) saturate(1.4);
    border-radius: 0;
    box-shadow: var(--card-shadow);
}

/* Gradient text: sky to mint. Light uses the AA-safe inks. */
.gradient-text {
    background: linear-gradient(120deg, var(--sky), var(--mint));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
:root[data-theme="light"] .gradient-text {
    background-image: linear-gradient(120deg, #2F6FB0, #12805A);
}

/* The aurora fill, for hero blocks that opt in. Text on it is night navy. */
.bg-aurora {
    background: var(--g-aurora);
    color: var(--ink-night);
}
