/* 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: #b8b8b8; }
      .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: #b8b8b8; 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 #a8cbe6; 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: #0b0c0b;
        --bg1: #151613;
        --panel: rgba(16, 17, 15, 0.94);
        --panel-2: rgba(21, 22, 19, 0.96);
        --line: rgba(242, 239, 231, 0.1);
        --line-strong: rgba(215, 181, 109, 0.34);
        --text: #f2efe7;
        --muted: #b8b1a3;
        --faint: #726d64;
        --accent: #d7b56d;
        --warm: #f0cf7f;
        --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: auto 1fr;
      }

      .topbar {
        position: relative;
        z-index: 1000;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        padding: 18px 28px;
        border-bottom: 1px solid rgba(242, 239, 231, 0.08);
        background: rgba(11, 12, 11, 0.92);
        backdrop-filter: blur(20px);
      }

      .brand {
        display: inline-flex;
        align-items: center;
        color: var(--text);
        font-size: 20px;
        font-weight: 600;
        line-height: 1;
        text-decoration: none;
        letter-spacing: -0.02em;
      }

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

      .mobile-site-nav {
        display: none;
        position: relative;
      }

      .mobile-site-nav > summary {
        min-height: 38px;
        align-items: center;
        padding: 8px 12px;
        border: 1px solid var(--line);
        border-radius: 4px;
        color: var(--text);
        background: var(--panel);
        cursor: pointer;
        list-style: none;
      }

      .mobile-site-nav > summary::-webkit-details-marker {
        display: none;
      }

      .nav-link {
        color: var(--muted);
        text-decoration: none;
        font-size: 0.92rem;
        padding: 8px 10px;
        border-bottom: 2px solid transparent;
      }

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

      .nav-link.active {
        color: var(--text);
        border-bottom-color: var(--accent);
      }

      .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: 0 28px 90px rgba(0, 0, 0, 0.42);
        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) .link-form {
        display: none;
      }

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

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

      .url-input:focus {
        border-color: var(--line-strong);
        box-shadow: 0 0 0 4px rgba(215, 181, 109, 0.12);
      }

      .submit {
        min-height: 60px;
        border: 1px solid rgba(215, 181, 109, 0.44);
        border-radius: 8px;
        color: #0a0a10;
        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) .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: #03060d;
        outline: none;
        position: relative;
      }

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

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

      .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;
      }

      .controls {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 7px;
        padding: 10px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        background: rgba(11, 12, 11, 0.98);
      }

      .ctrl {
        min-width: 38px;
        padding: 8px;
        height: 38px;
        border: 1px solid transparent;
        border-radius: 4px;
        color: #edf4ff;
        background: transparent;
        font: inherit;
        font-size: 0.88rem;
        font-weight: 500;
        cursor: pointer;
      }

      .ctrl:hover,
      .ctrl.active {
        border-color: rgba(215, 181, 109, 0.5);
        background: rgba(215, 181, 109, 0.12);
      }

      .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 {
        margin-left: auto;
        color: #9fb1c9;
        font-variant-numeric: tabular-nums;
        font-size: 0.92rem;
      }

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

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

      .loop-state-label {
        color: rgba(215, 181, 109, 0.82);
        font-size: 0.66rem;
        font-weight: 900;
        letter-spacing: 0.06em;
        text-transform: uppercase;
      }

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

      .loop-state a {
        color: #f0cf7f;
        text-decoration: none;
        border-bottom: 1px solid rgba(240, 207, 127, 0.34);
      }

      .loop-state a:hover {
        border-bottom-color: rgba(240, 207, 127, 0.82);
      }

      .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 #30363d;
        border-radius: 0;
        color: #c9d1d9;
        background: #0d1117;
        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 #30363d;
      }

      .qa-title {
        margin: 0;
        color: #f0f6fc;
        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: #8b949e;
        background: transparent;
        font-size: 1.3rem;
        line-height: 1;
        cursor: pointer;
      }

      .qa-close:hover {
        border-color: #30363d;
        color: #f0f6fc;
        background: #21262d;
      }

      .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: #8b949e;
        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 #21262d;
        color: #c9d1d9;
        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 #30363d;
      }

      .qa-input {
        min-height: 40px;
        min-width: 0;
        border: 1px solid #30363d;
        border-radius: 6px;
        color: #c9d1d9;
        background: #010409;
        padding: 0 12px;
        font: inherit;
        outline: none;
      }

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

      .qa-submit {
        min-height: 40px;
        padding: 0 14px;
        border: 1px solid rgba(215, 181, 109, 0.55);
        border-radius: 6px;
        color: #0a0a10;
        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 rgba(160, 150, 255, 0.18);
        border-radius: 8px;
        color: #eeeef5;
        background: hsla(235, 25%, 6%, 0.94);
        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: #a8a8be;
        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: #d4d4de;
        font-size: 0.88rem;
        line-height: 1.35;
      }

      @media (max-width: 720px) {
        .topbar {
          align-items: center;
          padding: 16px;
        }

        .topbar-actions {
          width: auto;
          flex-wrap: nowrap;
        }

        .desktop-site-nav {
          display: none;
        }

        .mobile-site-nav {
          display: block;
        }

        .mobile-site-nav > summary {
          display: inline-flex;
        }

        .mobile-site-nav:not([open]) > nav {
          display: none;
        }

        .mobile-site-nav[open] > nav {
          position: fixed;
          top: 72px;
          right: 12px;
          z-index: 80;
          display: grid;
          width: min(78vw, 300px);
          padding: 8px;
          border: 1px solid var(--line);
          border-radius: 4px;
          background: #151613;
          box-shadow: 0 18px 40px rgba(0, 0, 0, 0.38);
        }

        .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 #30363d;
        }

        .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;
        }

        .time {
          flex-basis: 100%;
          margin-left: 0;
        }

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

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



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

      @media (max-width: 720px) and (orientation: portrait) {
        .library-video .box { align-self: start; }
        .library-video .player:not(:fullscreen) { height: auto; }
        .library-video .player:not(:fullscreen) .stage {
          aspect-ratio: 16 / 9;
          box-sizing: content-box;
          padding-bottom: 60px;
        }
      }

      .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: 4px;
        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: 4px;
        color: var(--auth-text);
        background: var(--auth-surface);
        box-shadow: 0 8px 24px #0004;
      }

      .site-auth-heading {
        margin: 0 0 4px;
        color: var(--auth-text);
        font: 500 20px/1.3 "Inter", system-ui, sans-serif;
        letter-spacing: -0.03em;
      }

      .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-session-actions[hidden] {
        display: none !important;
      }

      .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: 3px;
        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: 3px;
        padding: 8px 10px;
        color: var(--auth-text);
        background: transparent;
        font: inherit;
        font-weight: 500;
        cursor: pointer;
      }

      .site-auth-actions button:first-child {
        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:first-child: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;
        }
      }
/* Match the homepage rail; keep the account controls above the workspace. */
.tool-layout { padding-left: 180px; }
.tool-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 180px;
  padding: 36px 18px;
  overflow-y: auto;
  background: #293b35;
  color: #f6f3ed;
  z-index: 3;
}
.tool-sidebar .brand { text-decoration: none; }
.tool-sidebar .desktop-site-nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  margin-top: 64px;
}
.tool-sidebar .nav-link {
  white-space: normal;
  padding: 16px 0;
  border: 0;
  border-top: 1px solid #ffffff40;
  border-radius: 0;
  color: #f6f3ed;
  background: transparent;
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
}
.tool-sidebar .nav-link:hover,
.tool-sidebar .nav-link[aria-current] { color: #e5c39b; background: transparent; }
.tool-sidebar .nav-link[aria-current] { font-weight: 700; }
.tool-sidebar a:focus-visible { outline: 2px solid #e5c39b; outline-offset: 4px; }
.tool-layout .tool-topbar { display: flex; justify-content: flex-end; }
.tool-layout .tool-topbar > .brand,
.tool-layout .mobile-site-nav { display: none; }
@media (max-width: 1050px) and (min-width: 701px) {
  .tool-layout { padding-left: 160px; }
  .tool-sidebar { width: 160px; padding: 28px 16px; }
}
@media (max-width: 700px) {
  .tool-layout { padding-left: 0; }
  .tool-sidebar { display: none; }
  .tool-layout .tool-topbar > .brand { display: inline-flex; }
  .tool-layout .mobile-site-nav { display: block; }
  .tool-layout .topbar-actions { flex-wrap: nowrap; }
  .tool-layout .mobile-site-nav > summary { display: inline-flex; }
  .tool-layout .mobile-site-nav:not([open]) > nav { display: none; }
  .tool-layout .mobile-site-nav[open] > nav {
    position: fixed;
    top: 72px;
    right: 12px;
    z-index: 60;
    display: grid;
    width: min(78vw, 280px);
    max-height: calc(100dvh - 84px);
    overflow-y: auto;
    padding: 8px;
    background: #293b35;
    border: 1px solid #ffffff40;
    border-radius: 4px;
  }
  .tool-layout .mobile-site-nav .nav-link { white-space: normal; min-height: 44px; }
}