/* NAV-PAGE-STYLES: YouTube player shell, panels, and responsive states. */
      .video-heading { display: flex; align-items: center; gap: 24px; padding: 0 0 18px; }
      .video-heading > a { font-size: 14px; text-decoration: none; color: var(--muted); }
      .video-heading h1 { display: flex !important; align-items: baseline; gap: 16px; font-size: 20px; font-weight: 500; text-align: left; line-height: 1.4; }
      .video-heading h1 span { font-size: 14px; color: var(--muted); font-weight: 400; }
      .original-video { margin-left: auto; }
      .page:has(.library-video) { height: 100dvh; min-height: 0; }
      .wrap:has(.library-video) { align-content: stretch; }
      .surface.library-video { min-height: 0; grid-template-rows: auto minmax(0, 1fr); }
      .library-video .box { min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
      .library-video .player { height: 100%; min-height: 0; grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
      .library-video .stage { aspect-ratio: auto; }
      .library-video .drawer { z-index: 25; }
      .library-video #ytSharedViewer:has(.appearance, .website-transcript, .transcript-reader-backdrop, .word-popup, .krdict-popup) { z-index: 22; }
      .float-actions { position: absolute; bottom: 54px; right: 14px; display: flex; gap: 6px; z-index: 21; }
      .float-actions button { background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.7); padding: 5px 10px; border-radius: 4px; font-size: 11px; cursor: pointer; }
      video#ytPlayer { object-fit: contain; }
      video#ytPlayer::-webkit-media-controls-fullscreen-button { display: none; }
      .library-video .loop-state, .library-video .idle-guide, .library-video .link-form { display: none !important; }
      .library-video .box.idle { display: block; padding: 0; min-height: 0; }
      .library-video .route-feedback { padding: 24px; }
      button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
      @media (max-width: 720px) {
        .video-heading { gap: 14px; flex-wrap: wrap; }
        .video-heading h1 { order: 3; width: 100%; flex-wrap: wrap; gap: 8px 16px; }
      }
      :root {
        color-scheme: dark;
        --bg0: #0b0c0d;
        --bg1: #111214;
        --panel: #111214;
        --panel-2: #181a1b;
        --line: rgba(255, 255, 255, 0.09);
        --line-strong: rgba(255, 255, 255, 0.26);
        --text: #f4f4f4;
        --muted: #b6b6b6;
        --faint: #858585;
        --accent: #f4f4f4;
        --warm: #d8d8d8;
        --ok: #5ddb7a;
        --bad: #ff7a7a;
      }

      * {
        box-sizing: border-box;
      }

      body {
        margin: 0;
        min-height: 100vh;
        font-family: "Inter", "Segoe UI", system-ui, sans-serif;
        color: var(--text);
        background: var(--bg0);
      }

      a {
        color: inherit;
      }

      .page {
        min-height: 100vh;
        display: grid;
        grid-template-rows: 1fr;
      }

      @media (max-width: 700px) {
        .page { grid-template-rows: auto minmax(0, 1fr); }
      }

      nav {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-end;
        gap: 12px;
      }

      .wrap {
        min-height: 0;
        display: grid;
        align-content: center;
        justify-items: center;
        padding: 22px 24px 30px;
      }

      .surface {
        width: min(1440px, 100%);
        display: grid;
        gap: 18px;
      }

      .surface:not(.library-video):not(.playing) {
        width: min(880px, 100%);
      }

      .surface.playing {
        gap: 0;
      }

      h1 {
        margin: 0;
        text-align: left;
        font-size: clamp(1.8rem, 4vw, 3.4rem);
        line-height: 1;
        letter-spacing: 0;
      }

      .surface:not(.library-video):not(.playing) h1 {
        font-size: clamp(2.25rem, 4vw, 3.5rem);
        line-height: 1.1;
      }

      .surface.playing h1 {
        display: none;
      }

      .box {
        min-height: min(72vh, 780px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        background: var(--panel);
        box-shadow: none;
        overflow: hidden;
        position: relative;
      }

      .surface:not(.library-video) .box.idle {
        display: grid;
        min-height: 0;
        gap: 14px;
        padding: 0;
        border: 0;
        background: none;
        box-shadow: none;
        overflow: visible;
      }

      .box:not(.idle):not(.job-failed) .link-form {
        display: none;
      }

      .box.job-failed .link-form {
        padding: 16px;
      }

      .box.job-failed .route-feedback {
        width: auto;
        margin: 0 16px 16px;
      }

      .link-form {
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
      }

      .url-field { min-width: 0; display: grid; gap: 8px; }
      .language-hint { margin: 0; color: var(--muted); font-size: 13px; }

      .url-input {
        width: 100%;
        min-height: 60px;
        border: 1px solid var(--line);
        border-radius: 8px;
        padding: 0 18px;
        color: var(--text);
        background: var(--bg1);
        font: inherit;
        font-size: 1rem;
        outline: none;
      }

      .url-input:focus {
        border-color: var(--line-strong);
        box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
      }

      .submit {
        align-self: start;
        min-height: 60px;
        border: 1px solid var(--line-strong);
        border-radius: 8px;
        color: var(--bg0);
        background: var(--accent);
        font: inherit;
        font-weight: 700;
        padding: 0 22px;
        cursor: pointer;
      }

      .submit:disabled {
        cursor: wait;
        opacity: 0.72;
      }

      .route-feedback {
        width: 100%;
        border: 1px solid rgba(255, 122, 122, 0.38);
        border-radius: 8px;
        color: #ffe2e2;
        background: rgba(80, 20, 24, 0.92);
        padding: 10px 12px;
        font-size: 0.92rem;
        line-height: 1.45;
      }

      .route-feedback[hidden],
      .box:not(.idle):not(.job-failed) .route-feedback {
        display: none !important;
      }

      .idle-guide {
        width: 100%;
        color: var(--muted);
        font-size: 0.92rem;
        line-height: 1.55;
      }

      .idle-guide p {
        margin: 0;
      }

      .box:not(.idle) .idle-guide {
        display: none;
      }

      .player {
        display: grid;
        grid-template-rows: minmax(0, 1fr) auto auto;
        min-height: min(76vh, 860px);
        background: #000;
        outline: none;
        position: relative;
      }

      .box.idle .player {
        display: none;
      }

      .stage {
        position: relative;
        min-height: 0;
        aspect-ratio: 16 / 9;
        background: #000;
      }

      .stage iframe,
      #ytPlayer {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        border: 0;
      }

      .status-pill {
        position: absolute;
        left: 50%;
        top: 16px;
        z-index: 6;
        transform: translateX(-50%);
        display: inline-flex;
        align-items: center;
        gap: 9px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 999px;
        color: rgba(255, 255, 255, 0.78);
        background: rgba(8, 8, 12, 0.76);
        backdrop-filter: blur(10px);
        padding: 8px 13px;
        font-size: 0.86rem;
        line-height: 1.2;
        box-shadow: 0 12px 34px rgba(0, 0, 0, 0.3);
      }

      .status-pill[hidden] {
        display: none;
      }

      .spinner {
        width: 12px;
        height: 12px;
        border-radius: 999px;
        border: 2px solid rgba(255, 255, 255, 0.2);
        border-top-color: rgba(255, 255, 255, 0.86);
        animation: spin 0.82s linear infinite;
      }

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

      .busy {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 4px;
        background: rgba(255, 255, 255, 0.1);
        overflow: hidden;
      }

      .busy-fill {
        width: 0%;
        height: 100%;
        background: linear-gradient(90deg, var(--accent), var(--warm));
        transition: width 0.2s ease;
      }

      .stage:has(#ytJobStatus[hidden]) .busy { display: none; }

      .controls {
        min-width: 0;
        padding: 8px 14px;
        border-top: 1px solid var(--line);
        background: var(--bg1);
        position: relative;
      }

      .playback-controls, .transport-controls, .playback-settings, .study-controls, .study-group {
        display: flex;
        align-items: center;
        gap: 4px;
      }

      .playback-controls { gap: 14px; }
      .playback-settings { margin-left: auto; }
      .study-controls { flex-wrap: wrap; gap: 6px; padding-top: 8px; margin-top: 8px; border-top: 1px solid var(--line); }
      .study-group { padding-right: 8px; margin-right: 2px; border-right: 1px solid var(--line); }

      .controls svg {
        width: 18px;
        height: 18px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
        flex-shrink: 0;
      }

      .ctrl {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        gap: 8px;
        min-height: 34px;
        padding: 5px 9px;
        border: 1px solid transparent;
        border-radius: 4px;
        color: var(--muted);
        background: transparent;
        font: inherit;
        font-size: 13px;
        font-weight: 500;
        line-height: 1.4;
        white-space: nowrap;
        cursor: pointer;
      }

      .ctrl:hover:not(:disabled),
      .ctrl.active {
        color: var(--text);
        background: rgba(255, 255, 255, 0.08);
      }

      .ctrl.active { border-color: var(--line); }
      .icon-control { width: 34px; padding: 0; }
      .ctrl.play-control { color: var(--bg0); background: var(--text); border-radius: 50%; }
      .play-control:hover:not(:disabled) { color: var(--bg0); background: #d8d8d8; }
      .play-control .play-icon { fill: currentColor; width: 16px; height: 16px; }
      .play-control .pause-icon, .play-control[aria-pressed="true"] .play-icon { display: none; }
      .play-control[aria-pressed="true"] .pause-icon { display: block; }
      .ctrl kbd { font: inherit; font-size: 10px; font-weight: 400; color: var(--faint); }
      .mine-control { margin-left: auto; color: var(--text); background: var(--panel-2); border-color: var(--line); }
      .player-more summary { list-style: none; }
      .player-more summary::-webkit-details-marker { display: none; }
      .player-more summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
      .player-more[open] > summary { background: var(--panel-2); color: var(--text); }
      .player-more:not([open]) > .more-controls { display: none; }
      .more-controls {
        position: absolute;
        right: 8px;
        bottom: calc(100% + 8px);
        z-index: 30;
        display: grid;
        width: 244px;
        max-width: calc(100vw - 48px);
        max-height: min(360px, 65dvh);
        overflow-y: auto;
        padding: 6px;
        border: 1px solid var(--line-strong);
        border-radius: 8px;
        background: #1e2022;
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
      }
      .more-controls .ctrl { justify-content: space-between; width: 100%; text-align: left; }
      .more-controls #ytHelp { margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0; }

      .ctrl.ok {
        border-color: rgba(93, 219, 122, 0.54);
        background: rgba(93, 219, 122, 0.14);
      }

      .ctrl:disabled {
        cursor: wait;
        opacity: 0.58;
      }

      .time {
        color: var(--muted);
        font-variant-numeric: tabular-nums;
        font-size: 12px;
        white-space: nowrap;
      }

      .loop-state {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px 14px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        padding: 10px 14px;
        color: rgba(255, 255, 255, 0.72);
        background: var(--bg1);
        font-size: 11px;
        line-height: 1.35;
      }

      .loop-state-item {
        display: inline-flex;
        align-items: baseline;
        gap: 6px;
        min-width: 0;
      }

      .loop-state-label {
        color: var(--faint);
        font-size: inherit;
        font-weight: 400;
      }

      .loop-state-value {
        min-width: 0;
        color: rgba(255, 255, 255, 0.78);
      }

      .loop-state a {
        color: var(--warm);
        text-decoration: none;
        border-bottom: 1px solid var(--line-strong);
      }

      .loop-state a:hover {
        border-bottom-color: var(--text);
      }

      .loop-state [hidden] {
        display: none !important;
      }

      .drawer {
        position: absolute;
        inset: 0 0 0 auto;
        width: min(360px, 32%);
        height: auto;
        border: 0;
        border-left: 1px solid var(--line);
        border-radius: 0;
        color: var(--text);
        background: var(--bg1);
        box-shadow: none;
        overflow: hidden;
        display: grid;
        grid-template-rows: 1fr;
      }

      .drawer[hidden] {
        display: none;
      }

      .panel {
        min-height: 0;
        overflow: auto;
        padding: 0;
      }

      .panel[hidden] {
        display: none;
      }

      .panel.qa {
        height: 100%;
        overflow: hidden;
      }

      .qa {
        display: grid;
        grid-template-rows: auto minmax(0, 1fr) auto;
        height: 100%;
        min-height: 0;
        overflow: hidden;
      }

      .qa-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 14px;
        border-bottom: 1px solid var(--line);
      }

      .qa-title {
        margin: 0;
        color: var(--text);
        font-size: 0.9rem;
        font-weight: 600;
        line-height: 1.4;
      }

      .qa-close {
        display: grid;
        width: 32px;
        height: 32px;
        flex: 0 0 32px;
        place-items: center;
        padding: 0;
        border: 1px solid transparent;
        border-radius: 6px;
        color: var(--muted);
        background: transparent;
        font-size: 1.3rem;
        line-height: 1;
        cursor: pointer;
      }

      .qa-close:hover {
        border-color: var(--line);
        color: var(--text);
        background: var(--panel-2);
      }

      .qa-close:focus-visible {
        outline-color: var(--warm);
      }

      .qa-log {
        min-height: 0;
        overflow: auto;
        display: grid;
        align-content: start;
        padding: 0 16px;
      }

      .qa-empty-state {
        align-self: center;
        justify-self: center;
        max-width: 32ch;
        margin: auto;
        padding: 24px;
        color: var(--muted);
        line-height: 1.5;
        text-align: center;
      }

      .qa-log:has(.qa-empty-state:not([hidden])) {
        align-content: center;
      }

      .qa-bubble {
        padding: 14px 0;
        border-bottom: 1px solid var(--line);
        color: var(--text);
        line-height: 1.5;
        white-space: pre-wrap;
      }

      .qa-bubble.user {
        padding-left: 12px;
        border-left: 2px solid var(--accent);
      }

      .qa-form {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        padding: 12px;
        border-top: 1px solid var(--line);
      }

      .qa-input {
        min-height: 40px;
        min-width: 0;
        border: 1px solid var(--line);
        border-radius: 6px;
        color: var(--text);
        background: var(--bg0);
        padding: 0 12px;
        font: inherit;
        outline: none;
      }

      .qa-input:focus-visible {
        border-color: var(--warm);
        outline: none;
        box-shadow: 0 0 0 2px rgba(221, 160, 130, 0.18);
      }

      .qa-submit {
        min-height: 40px;
        padding: 0 14px;
        border: 1px solid rgba(221, 160, 130, 0.55);
        border-radius: 6px;
        color: #160f0b;
        background: var(--accent);
        font: inherit;
        font-weight: 600;
        cursor: pointer;
      }

      .qa-submit:hover { background: var(--warm); }
      .qa-submit:focus-visible { outline-color: var(--warm); }

      .error {
        position: absolute;
        left: 12px;
        right: 12px;
        top: 12px;
        z-index: 4;
        border: 1px solid rgba(255, 122, 122, 0.38);
        border-radius: 8px;
        color: #ffe2e2;
        background: rgba(80, 20, 24, 0.92);
        padding: 10px 12px;
        font-size: 0.92rem;
        line-height: 1.45;
      }

      .error[hidden],
      .notice[hidden],
      .sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
      }

      .notice {
        position: absolute;
        left: 50%;
        top: 16px;
        z-index: 5;
        transform: translateX(-50%);
        max-width: min(92%, 520px);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 999px;
        color: rgba(255, 255, 255, 0.72);
        background: rgba(8, 8, 12, 0.76);
        backdrop-filter: blur(10px);
        padding: 8px 14px;
        font-size: 0.86rem;
        line-height: 1.3;
        text-align: center;
        box-shadow: 0 12px 34px rgba(0, 0, 0, 0.3);
      }

      .notice.success {
        color: #9ef0bd;
        border-color: rgba(90, 200, 140, 0.28);
      }

      .notice.error {
        color: #ffb8b8;
        border-color: rgba(240, 96, 96, 0.3);
      }

      .hotkey-overlay {
        position: absolute;
        inset: 0;
        z-index: 30;
        display: grid;
        place-items: center;
        pointer-events: auto;
        background: rgba(0, 0, 0, 0.38);
        backdrop-filter: blur(4px);
      }

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

      .hotkey-panel {
        width: min(720px, calc(100% - 28px));
        max-height: calc(100% - 28px);
        overflow: auto;
        border: 1px solid var(--line);
        border-radius: 8px;
        color: var(--text);
        background: var(--bg0);
        box-shadow: 0 16px 64px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.3);
        padding: 16px;
      }

      .hotkey-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        margin-bottom: 12px;
      }

      .hotkey-header strong {
        font-size: 0.95rem;
      }

      .hotkey-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
        gap: 10px;
      }

      .hotkey-group {
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 8px;
        padding: 10px;
        background: rgba(255, 255, 255, 0.035);
      }

      .hotkey-group-title {
        margin: 0 0 8px;
        color: var(--muted);
        font-size: 0.78rem;
        text-transform: uppercase;
      }

      .hotkey-row {
        display: grid;
        grid-template-columns: 70px minmax(0, 1fr);
        gap: 10px;
        align-items: baseline;
        padding: 4px 0;
      }

      .hotkey-key {
        color: var(--accent);
        font-weight: 900;
        font-variant-numeric: tabular-nums;
      }

      .hotkey-desc {
        color: var(--text);
        font-size: 0.88rem;
        line-height: 1.35;
      }

      @media (max-width: 720px) {

        .wrap {
          padding: 22px 12px 30px;
          align-content: start;
        }

        h1 {
          font-size: clamp(2rem, 12vw, 3rem);
        }

        .box,
        .player {
          min-height: 68vh;
        }

        .stage {
          aspect-ratio: 9 / 12;
        }

        .link-form {
          grid-template-columns: 1fr;
        }

        .submit {
          min-height: 52px;
        }

        .drawer {
          inset: auto 0 58px 0;
          width: auto;
          height: min(42vh, 360px, 55%);
          max-height: calc(100% - 66px);
          border-left: 0;
          border-top: 1px solid var(--line);
        }

        .drawer:has(.qa-bubble) {
          position: fixed;
          inset: auto 0 0;
          height: 52dvh;
          max-height: 55dvh;
        }

        .qa-header {
          padding: 8px 12px;
        }

        .qa-form {
          gap: 6px;
          padding: 8px;
        }

        .qa-input,
        .qa-submit {
          min-height: 38px;
        }

        .controls { padding: 8px; }
        .playback-controls { flex-wrap: wrap; gap: 6px; }
        .playback-controls .time { order: 3; width: 100%; padding: 2px 8px; }
        .study-controls { gap: 4px; }
        .study-group { border: 0; padding-right: 0; margin-right: 0; }
        .study-controls .ctrl kbd { display: none; }
        .mine-control { margin-left: 0; }
        .player-more { margin-left: auto; }

        .loop-state {
          align-items: flex-start;
        }

        .loop-state-item {
          flex-basis: 100%;
        }
      }

      @media (pointer: coarse) {
        .controls .ctrl { min-height: 44px; }
        .controls .icon-control { width: 44px; }
        .library-video .player { grid-template-rows: minmax(0, 1fr) auto; }
        .float-actions { position: static; justify-content: flex-end; padding: 6px; }
        .float-actions button { min-width: 44px; min-height: 44px; font-size: 14px; }
      }

      #ytSharedViewer { position: absolute; inset: 0; pointer-events: none; z-index: 20; }
      .idle #ytSharedViewer { display: none; }

      .topbar-actions {
        display: flex;
        min-width: 0;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-end;
        gap: 12px;
        margin-left: auto;
      }

      .site-auth {
        position: relative;
        min-width: 0;
        max-width: 100%;
        z-index: 50;
        color: #eeeeec;
        font: 14px/1.45 "Inter", system-ui, sans-serif;
        --auth-surface: #181818;
        --auth-field: #111111;
        --auth-border: #3b3b39;
        --auth-text: #eeeeec;
        --auth-muted: #aaa9a4;
        --auth-focus: #e1d9bc;
      }

      .site-auth.is-floating {
        position: fixed;
        top: 14px;
        right: 14px;
        z-index: 1200;
      }

      .site-auth[hidden] {
        display: none !important;
      }

      .site-auth-trigger {
        display: inline-flex;
        max-width: 100%;
        align-items: center;
        gap: 12px;
        min-height: 44px;
        padding: 0 14px;
        border: 1px solid var(--auth-border);
        border-radius: 12px;
        color: var(--auth-text);
        background: transparent;
        box-shadow: none;
        cursor: pointer;
        user-select: none;
        list-style: none;
      }

      .site-auth-trigger::-webkit-details-marker {
        display: none;
      }

      .site-auth-trigger::after {
        width: 7px;
        height: 7px;
        flex: 0 0 7px;
        border-right: 1.5px solid currentColor;
        border-bottom: 1.5px solid currentColor;
        content: "";
        transform: translateY(-2px) rotate(45deg);
      }

      .site-auth-trigger:hover,
      .site-auth[open] > .site-auth-trigger {
        border-color: #eeeeec;
        background: #242424;
      }

      .site-auth-trigger:focus-visible {
        outline: 2px solid var(--auth-focus);
        outline-offset: 3px;
      }

      .site-auth[open] > .site-auth-trigger::after {
        transform: translateY(2px) rotate(225deg);
      }

      [data-site-auth-label] {
        min-width: 0;
        max-width: 14ch;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .site-auth-avatar {
        display: none;
      }

      .site-auth-panel {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        display: grid;
        gap: 12px;
        box-sizing: border-box;
        width: min(320px, calc(100vw - 28px));
        max-height: min(760px, calc(100vh - 96px));
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 22px;
        border: 1px solid var(--auth-border);
        border-radius: 8px;
        color: var(--auth-text);
        background: var(--auth-surface);
        box-shadow: 0 8px 24px #0004;
      }

      .site-auth-session-actions > .site-auth-account-link {
        grid-column: 1 / -1;
      }

      .site-auth-footer {
        display: flex;
        flex-wrap: wrap;
        gap: 0 18px;
        margin: 4px 0 0;
        padding-top: 8px;
        border-top: 1px solid var(--auth-border);
      }

      .site-auth-footer a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        color: var(--auth-muted);
        font-size: 12px;
        text-decoration: underline;
        text-underline-offset: 3px;
      }

      .site-auth-form input { box-sizing: border-box; }

      .site-auth:not([open]) .site-auth-panel {
        display: none;
      }

      .site-auth-panel :focus-visible {
        outline: 2px solid var(--auth-focus);
        outline-offset: 3px;
      }

      [data-site-auth-status]:empty {
        display: none;
      }

      .site-auth-copy,
      .site-auth-user,
      .site-auth-account-link {
        color: var(--auth-muted);
        font-size: 0.88rem;
        line-height: 1.45;
      }

      .site-auth-user {
        color: var(--auth-text);
        font-weight: 500;
        overflow-wrap: anywhere;
      }

      .site-auth-account-link {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        color: var(--auth-text);
        font-weight: 500;
        text-decoration: underline;
        text-underline-offset: 3px;
      }

      .site-auth-copy.error {
        color: #ffaaaa;
      }

      .site-auth-copy.success {
        color: #8ce0aa;
      }

      .site-auth-form {
        display: grid;
        gap: 10px;
        min-inline-size: 0;
        margin: 0;
        padding: 0;
        border: 0;
      }

      .site-auth-form[hidden],
      .site-auth-form [hidden],
      .site-auth-session-actions[hidden] {
        display: none !important;
      }

      .site-auth-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px;
      }

      .site-auth-tabs button {
        min-height: 44px;
        padding: 8px 4px;
        border: 0;
        border-bottom: 2px solid transparent;
        color: var(--auth-muted);
        background: transparent;
        font: inherit;
        cursor: pointer;
      }

      .site-auth-tabs button[aria-selected="true"] {
        color: var(--auth-text);
        border-bottom-color: var(--auth-focus);
      }

      .site-auth-fields { display: grid; gap: 10px; }

      .site-auth-form label {
        display: grid;
        gap: 5px;
        color: var(--auth-muted);
        font-size: 0.86rem;
        font-weight: 500;
      }

      .site-auth-form input {
        min-height: 44px;
        width: 100%;
        border: 1px solid var(--auth-border);
        border-radius: 6px;
        padding: 8px 11px;
        color: var(--auth-text);
        background: var(--auth-field);
        font: inherit;
        font-weight: 500;
      }

      .site-auth-form input::placeholder {
        color: #96958f;
      }

      .site-auth-form input:is(:autofill, :-webkit-autofill) {
        box-shadow: 0 0 0 1000px var(--auth-field) inset;
        -webkit-text-fill-color: var(--auth-text);
        caret-color: var(--auth-text);
      }

      .site-auth-form input:focus {
        border-color: var(--auth-focus);
        outline: 2px solid var(--auth-focus);
        outline-offset: 1px;
      }

      .site-auth-actions,
      .site-auth-session-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
      }

      .site-auth-actions { grid-template-columns: 1fr; }

      .site-auth-actions button,
      .site-auth-session-actions button {
        min-height: 44px;
        border: 1px solid var(--auth-border);
        border-radius: 8px;
        padding: 8px 10px;
        color: var(--auth-text);
        background: transparent;
        font: inherit;
        font-weight: 500;
        cursor: pointer;
      }

      .site-auth-actions button {
        border-color: #eeeeec;
        color: #0a0a10;
        background: #eeeeec;
      }

      .site-auth-actions button:hover,
      .site-auth-session-actions button:hover {
        border-color: #eeeeec;
        background: #292929;
      }

      .site-auth-actions button:hover {
        background: #ffffff;
      }

      .site-auth-actions button:disabled,
      .site-auth-session-actions button:disabled {
        cursor: wait;
        opacity: 0.66;
      }

      @media (max-width: 760px) {
        .topbar-actions {
          width: 100%;
          justify-content: space-between;
        }

        .site-auth {
          margin-left: auto;
        }

        .site-auth.is-floating {
          top: 10px;
          right: 10px;
        }

        body.stem-trainer-public .site-auth.is-floating {
          top: 112px;
          right: 12px;
        }
      }
/* Navigation uses the public homepage's typography, spacing, and black rail. */
@font-face { font-family:Inter; src:url('/gloss-fonts/InterVariable.woff2') format('woff2'); font-display:swap; }
.tool-layout { padding-left:180px; }
.tool-layout > .skip, .tool-layout > .skip-to-content { z-index:1001; }
.tool-sidebar {
  position:fixed; inset:0 auto 0 0; z-index:3;
  display:flex; flex-direction:column; width:180px; padding:32px 20px 96px;
  box-sizing:border-box; overflow-y:auto; scroll-padding-bottom:96px; border-right:1px solid #242628;
  background:#000; color:#f4f4f4; font:14px Inter,system-ui,sans-serif;
}
.tool-sidebar .brand {
  display:inline-flex; flex:0 0 auto; align-items:center; gap:10px;
  color:inherit; font:500 21px/26px Inter,system-ui,sans-serif;
  letter-spacing:-.055em; text-decoration:none; white-space:nowrap;
}
.tool-sidebar .brand-mark {
  position:relative; display:inline-block; flex:0 0 20px; width:20px; height:26px;
  box-sizing:border-box; border-top:5px solid currentColor; border-bottom:5px solid currentColor;
  transform:skewY(-14deg);
}
.tool-sidebar .brand-mark::after { position:absolute; left:0; top:6px; width:14px; height:4px; background:currentColor; content:''; }
.tool-sidebar .desktop-site-nav {
  display:flex; flex:0 0 auto; flex-direction:column; flex-wrap:nowrap;
  align-items:stretch; gap:4px; margin-top:52px;
}
.tool-sidebar .nav-link {
  position:relative; display:flex; flex:0 0 auto; align-items:center;
  align-self:stretch; justify-content:flex-start; text-align:left;
  min-height:40px; padding:9px 0; border:0; border-radius:0; box-sizing:border-box;
  color:#a4a7ab; background:transparent; font:400 13px/1.4 Inter,system-ui,sans-serif;
  text-decoration:none; white-space:normal;
}
.tool-sidebar .nav-link:hover, .tool-sidebar .nav-link[aria-current] { color:#fff; text-decoration:none; background:transparent; }
.tool-sidebar .nav-link[aria-current] { font-weight:500; }
.tool-sidebar .desktop-site-nav .nav-link[aria-current]::before { content:''; position:absolute; left:-20px; top:12px; bottom:12px; width:2px; background:#f4f4f4; }
.tool-sidebar a:focus-visible, .tool-sidebar summary:focus-visible { outline:2px solid #f08d62; outline-offset:4px; }
.tool-sidebar .rail-bottom { display:grid; flex:0 0 auto; gap:16px; margin-top:auto; padding-top:40px; }
.tool-sidebar .rail-bottom .nav-link { min-height:0; padding:0; color:#9b9ea4; font-size:12px; }
.tool-sidebar .rail-bottom .nav-link:hover, .tool-sidebar .rail-bottom .nav-link[aria-current] { color:#fff; }
.site-account-control { position:fixed; bottom:32px; left:20px; z-index:1000; width:139px; }
.site-account-control .site-auth { min-width:0; color:#eeeeec; font:14px/1.45 Inter,system-ui,sans-serif; --auth-surface:#181818; --auth-field:#111111; --auth-border:#3b3b39; --auth-text:#eeeeec; --auth-muted:#aaa9a4; --auth-focus:#e1d9bc; }
.site-account-control .site-auth-trigger { min-height:44px; padding:0 12px; border:1px solid var(--auth-border); border-radius:12px; color:var(--auth-text); background:transparent; }
.site-account-control .site-auth-panel { position:fixed; top:32px; left:200px; right:auto; max-height:calc(100dvh - 64px); overflow-y:auto; }
.tool-sidebar .mobile-site-nav { display:none; }
@media (max-width:700px) {
  .tool-layout { padding-left:0; }
  .tool-layout > .shell { padding-top:0; }
  .tool-sidebar {
    position:relative; inset:auto; z-index:1000; flex-direction:row; align-items:center;
    width:100%; gap:12px; padding:20px; overflow:visible;
    border-right:0; border-bottom:1px solid #303236;
  }
  .tool-sidebar > .brand { margin-right:auto; }
  .tool-sidebar .desktop-site-nav, .tool-sidebar .rail-bottom { display:none; }
  .tool-sidebar .site-nav-controls { flex:0 0 auto; padding-right:122px; }
  .site-account-control { position:absolute; top:20px; right:20px; bottom:auto; left:auto; width:110px; }
  .tool-sidebar .mobile-site-nav { display:block; position:static; }
  .tool-sidebar .mobile-site-nav > summary { display:flex; align-items:center; min-height:44px; padding:0; border:0; color:#a4a7ab; background:transparent; font:13px/1.4 Inter,system-ui,sans-serif; cursor:pointer; list-style:none; }
  .tool-sidebar .mobile-site-nav > summary::-webkit-details-marker { display:none; }
  .tool-sidebar .mobile-site-nav:not([open]) > nav { display:none; }
  .tool-sidebar .mobile-site-nav[open] > nav {
    position:absolute; top:76px; right:20px; z-index:60; display:flex;
    flex-direction:column; flex-wrap:nowrap; align-items:stretch; justify-content:flex-start;
    gap:4px; width:min(230px,calc(100vw - 40px));
    max-height:calc(100dvh - 92px); overflow-y:auto; margin:0; padding:14px 20px;
    box-sizing:border-box; border:1px solid #303236; border-radius:6px; background:#000;
  }
  .tool-sidebar .mobile-site-nav .nav-link { min-height:44px; width:100%; }
  .site-account-control .site-auth-panel { top:76px; right:20px; left:auto; max-height:calc(100dvh - 92px); }
}