/* ── TYPOGRAPHY — Office Regular ───────────────────────────────────── */
    @font-face {
      font-family: 'Office';
      src: url('fonts/office-regular.otf') format('opentype');
      font-weight: 400;
      font-style: normal;
      font-display: swap;
    }
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --white:  #ffffff;
      --black:  #0a0a0a;
      --mid:    #888888;
      --light:  #d0d0d0;
      --xlight: #efefef;
    }

    html { font-size: 14px; }

    body {
      font-family: 'Office', 'Helvetica Neue', Helvetica, Arial, sans-serif;
      background: var(--white);
      color: var(--black);
      -webkit-font-smoothing: antialiased;
    }

    /* ── TOPBAR ─────────────────────────────────────────────────────── */
    /* ══ TOPBAR ════════════════════════════════════════════════════════ */
    .topbar {
      position: sticky; top: 0; z-index: 100;
      background: var(--white);
      border-bottom: none;
      height: 52px;
      display: flex;
      align-items: stretch;
      min-width: 0;
    }
    .tb-logo {
      display: flex; align-items: center;
      padding: 0 24px;
      border-right: 1px solid var(--light);
      font-size: 1.25rem;
      font-weight: 700;
      letter-spacing: 0.18em;
      text-transform: uppercase;
      white-space: nowrap;
      flex-shrink: 0;
    }
    .tb-section {
      display: flex; align-items: center;
      padding: 0 20px;
      font-size: 1.0rem;
      letter-spacing: 0.10em;
      text-transform: uppercase;
      color: var(--mid);
      flex: 1;
      min-width: 0;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }
    .tb-right {
      display: flex; align-items: stretch;
      margin-left: auto;
      flex-shrink: 0;
    }
    .tb-action {
      cursor: pointer;
      background: none;
      border: none;
      font-family: inherit;
      font-size: 0.88rem;
      letter-spacing: 0.02em;
      text-transform: none;
      color: var(--mid);
      padding: 0 18px;
      display: flex; align-items: center;
      transition: color 0.12s, background 0.12s;
      white-space: nowrap;
      text-decoration: none;
    }
    .tb-action:hover { color: var(--black); }
    /* Left nav — comma-separated, no borders */
    .tb-left .tb-action { padding: 0 0 0 14px; font-size: 1.31rem; color: var(--black); letter-spacing: -0.01em; }
    .tb-left .tb-action:first-child { padding-left: 24px; }
    .tb-left .tb-action::after { content: ","; color: var(--mid); margin-left: 1px; }
    .tb-left .tb-action:last-child::after { content: ""; }
    .tb-left .tb-action:hover { opacity: 0.5; color: var(--black); }
    /* Right nav — same style, comma between Request Access and Log In */
    .tb-right .tb-action { padding: 0 0 0 14px; font-size: 1.31rem; color: var(--black); letter-spacing: -0.01em; background: none; }
    .tb-right .tb-action:last-of-type { padding-right: 24px; }
    #btn-request::after { content: ","; color: var(--mid); margin-left: 1px; }
    .tb-action.primary { background: none; color: var(--black); }
    .tb-action.primary:hover { background: none; opacity: 0.5; }

    /* ══ FILTER BAR ═════════════════════════════════════════════════════ */
    .filterbar {
      border-bottom: 1px solid var(--light);
      position: relative;
      min-width: 0;
    }
    /* Filter buttons region — wraps to a hard-capped 2 rows instead of
       scrolling sideways in 1 line, so far more categories are visible at
       once. The My Collection icon + search box are the last two children
       (see buildFilterbar()), so they land at the end of the row they
       wrap onto — normally row 2 — with margin-left:auto pushing them
       flush to the right edge of that row. _capFilterbarToTwoRows() runs
       after every rebuild (and on resize) to hide category buttons from
       the end until the pinned pair actually fits within 2 rows, so
       they're never scrolled off or clipped away. buildFilterbar()'s
       count-descending ordering means the most-connected categories (most
       snapshots) are the ones kept visible. */
    .f-filters {
      display: flex;
      align-items: stretch;
      flex-wrap: wrap;
      width: 100%;
      min-width: 0;
      max-height: 78px; /* hard cap ~2 rows @ 36-38px, safety net for _capFilterbarToTwoRows() */
      overflow: hidden;
    }
    /* Lifted whenever the "+N more" toggle is expanded — otherwise every row
       past the first 2 (including the pinned My Collection icon and the
       search box, always the last two children) is clipped out of reach by
       the max-height/overflow cap above. See _capFilterbarToTwoRows(). */
    .f-filters.expanded {
      max-height: none;
      overflow: visible;
    }
    .f-btn {
      cursor: pointer;
      background: none;
      border: none;
      font-family: inherit;
      font-size: 0.90rem;
      letter-spacing: 0.03em;
      text-transform: none;
      color: var(--black);
      padding: 0 0 0 18px;
      min-height: 36px;
      display: flex; align-items: center;
      transition: opacity 0.12s;
      white-space: nowrap;
      flex-shrink: 0;
    }
    .f-btn::after { content: ","; color: var(--mid); margin-left: 1px; }
    .f-btn:first-child { padding-left: 20px; }
    .f-btn:hover { opacity: 0.55; }
    .f-btn.active { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
    .f-btn.active::after { text-decoration: none; font-weight: 400; }
    .f-more-btn { font-style: italic; color: var(--mid); }
    .f-more-btn:hover { color: var(--black); opacity: 1; }
    /* Pinned search — end of whichever row it wraps onto (normally row 2),
       pushed flush right via margin-left:auto on the icon button before it */
    .f-search {
      flex-shrink: 0;
      display: flex; align-items: center;
      height: 36px;
      border-left: 1px solid var(--light);
      background: var(--white);
      position: relative;
    }
    .f-search input {
      font-family: inherit;
      font-size: 0.95rem;
      border: none;
      outline: none;
      padding: 0 18px;
      color: var(--black);
      height: 100%;
      width: 180px;
      background: transparent;
      letter-spacing: 0.04em;
    }
    .f-search input::placeholder { color: var(--light); }

    /* ══ GRID ════════════════════════════════════════════════════════════ */
    main {
      padding: 20px 24px 80px;
    }
    .grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 40px 28px;
    }

    /* ── CARD ───────────────────────────────────────────────────────── */
    .card {
      display: flex;
      flex-direction: column;
      cursor: pointer;
    }
    /* Skeleton placeholder while card awaits IntersectionObserver swap */
    .card-skel {
      aspect-ratio: 1400 / 909;
      background: var(--xlight);
      cursor: default;
    }
    /* NOTE: do NOT add content-visibility/contain-intrinsic-size here.
       `contain-intrinsic-size: <one length>` applies to BOTH axes, which forces
       the card width and breaks the grid proportions. Images already carry
       loading="lazy", which is all the laziness this grid needs. */

    /* image area */
    .card-vis {
      position: relative;
      width: 100%;
      overflow: hidden;
      background: transparent;
      flex-shrink: 0;
      aspect-ratio: 1400 / 909;
    }
    .card-vis img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
      transition: opacity 0.3s;
    }
    .card-vis .no-img {
      width: 100%; height: 100%;
      display: flex; align-items: center; justify-content: center;
      font-size: 2.4rem; color: var(--light);
    }
    /* Broken-image placeholder — card stays in grid, path error is visible */
    .card-vis.img-error {
      aspect-ratio: 1400 / 909;
      background: var(--xlight);
      border: 1px dashed var(--light);
    }
    .card-vis.img-error .no-img {
      flex-direction: column;
      gap: 6px;
      font-size: 1.4rem;
      color: var(--light);
    }
    .card-vis.img-error .no-img::after {
      content: 'Image unavailable';
      font-size: 0.62rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--light);
      font-family: inherit;
    }

    /* description overlay — removed per user preference */
    .card-overlay { display: none; }
    .card:hover .card-vis img { opacity: 1; }

    /* item number — hidden from display but kept in DOM for JS id lookups */
    .card-num {
      display: none;
    }

    /* card text area */
    .card-body {
      padding: 11px 0 0;
      display: flex;
      flex-direction: column;
      gap: 2px;
      flex: 1;
    }
    .card-cat {
      font-size: 0.75rem;
      letter-spacing: 0.14em;
      text-transform: uppercase;
      color: var(--mid);
    }
    .card-title {
      font-size: 0.98rem;
      font-weight: 400;
      line-height: 1.4;
      color: var(--black);
    }
    .card-author {
      font-size: 0.78rem;
      color: var(--mid);
      letter-spacing: 0.04em;
    }
    .card-foot {
      margin-top: 6px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .card-ts {
      font-size: 0.78rem;
      color: var(--mid);
      letter-spacing: 0.06em;
      font-variant-numeric: tabular-nums;
    }
    .card-link {
      font-size: 0.78rem;
      letter-spacing: 0.10em;
      text-transform: uppercase;
      color: var(--mid);
      text-decoration: none;
      border-bottom: 1px solid var(--light);
      padding-bottom: 1px;
      transition: all 0.15s;
    }
    .card-link:hover { color: var(--black); border-color: var(--black); }

    /* ── MODALS (shared shell) ───────────────────────────────────────── */
    .overlay {
      display: none;
      position: fixed; inset: 0; z-index: 300;
      background: rgba(0,0,0,0.38);
    }
    .overlay.open { display: block; }
    .modal {
      display: none;
      position: fixed;
      top: 50%; left: 50%;
      transform: translate(-50%, -50%);
      background: var(--white);
      border: 1px solid var(--black);
      z-index: 400;
      width: 520px;
      max-width: 96vw;
      max-height: 90vh;
      overflow-y: auto;
    }
    .modal.modal-wide {
      width: 860px;
    }
    .modal.open { display: block; }
    .modal-head {
      padding: 18px 24px 16px;
      border-bottom: 1px solid var(--black);
      display: flex; align-items: center; justify-content: space-between;
    }
    .modal-head h2 {
      font-size: 1.1rem;
      font-weight: 700;
      letter-spacing: 0.14em;
      text-transform: uppercase;
    }
    .modal-x {
      cursor: pointer; background: none; border: none;
      font-size: 2.2rem; line-height: 1; color: var(--black);
    }
    .modal-body {
      padding: 24px;
      display: flex; flex-direction: column; gap: 18px;
      font-size: 1.1rem;
      line-height: 1.7;
      color: #333;
    }
    .modal-body p { }
    .modal-body strong { font-weight: 700; color: var(--black); }

    /* add form */
    .field label {
      display: block;
      font-size: 0.85rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--mid);
      margin-bottom: 5px;
    }
    .field input, .field textarea, .field select {
      width: 100%;
      font-family: inherit;
      font-size: 1.1rem;
      padding: 8px 0;
      border: none;
      border-bottom: 1px solid var(--black);
      background: transparent;
      color: var(--black);
      outline: none;
    }
    .field input::placeholder, .field textarea::placeholder { color: var(--light); }
    .field textarea { resize: vertical; min-height: 72px; line-height: 1.5; }
    .modal-foot {
      padding: 14px 24px 22px;
      display: flex; justify-content: flex-end; gap: 10px;
      border-top: 1px solid var(--light);
    }
    .btn {
      cursor: pointer;
      font-family: inherit;
      font-size: 1.0rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      padding: 8px 18px;
      border: 1px solid var(--black);
      background: none;
      color: var(--black);
      transition: background 0.15s, color 0.15s;
    }
    .btn:hover { background: var(--black); color: var(--white); }
    .btn.primary { background: var(--black); color: var(--white); }
    .btn.primary:hover { background: #333; }

    /* ── SAVE NOTICE ────────────────────────────────────────────────── */
    .save-bar {
      display: none;
      position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
      background: var(--white);
      border-top: 3px solid var(--black); /* thicker accent */
      padding: 14px 24px;
      align-items: center;
      gap: 14px;
      font-size: 0.92rem;
      box-shadow: 0 -4px 24px rgba(0,0,0,0.10);
    }
    .save-bar.visible { display: flex; animation: savebar-in 0.2s ease; }
    @keyframes savebar-in { from { transform: translateY(100%); opacity:0; } to { transform: none; opacity:1; } }
    .save-bar-icon { font-size: 1.1rem; flex-shrink: 0; }
    .save-bar span { flex: 1; letter-spacing: 0.02em; }
    .save-bar strong { color: var(--black); }

    /* ── ABOUT DIAGRAM ───────────────────────────────────────────────── */
    .about-diagram {
      border-top: 1px solid var(--black);
      margin-top: 4px;
      padding: 20px 0 0;
    }
    .about-diagram .diag-label {
      font-size: 0.72rem;
      letter-spacing: 0.22em;
      text-transform: uppercase;
      color: var(--mid);
      margin-bottom: 16px;
    }
    .diag-premise {
      display: flex;
      align-items: stretch;
      border: 1px solid var(--black);
      margin-bottom: 0;
    }
    .diag-premise + .diag-arrow { margin: 0; }
    .diag-arrow {
      display: flex;
      justify-content: center;
      padding: 5px 0;
    }
    .diag-arrow svg { display: block; }
    .diag-num {
      width: 36px;
      background: var(--black);
      color: var(--white);
      display: flex; align-items: center; justify-content: center;
      font-size: 1.05rem;
      font-weight: 700;
      flex-shrink: 0;
    }
    .diag-premise-body { padding: 12px 16px; flex: 1; }
    .diag-premise-body .d-tag {
      font-size: 0.7rem;
      letter-spacing: 0.18em;
      text-transform: uppercase;
      color: var(--mid);
      margin-bottom: 4px;
    }
    .diag-premise-body .d-head {
      font-size: 1.15rem;
      font-weight: 700;
      line-height: 1.25;
      margin-bottom: 5px;
    }
    .diag-premise-body .d-text {
      font-size: 1.0rem;
      color: #555;
      line-height: 1.55;
    }
    .diag-premise-body .d-stat {
      display: inline-block;
      font-size: 0.85rem;
      letter-spacing: 0.07em;
      padding: 3px 10px;
      border: 1px solid var(--black);
      margin-top: 8px;
    }
    /* 3-step process row */
    .diag-steps {
      display: grid;
      grid-template-columns: 1fr 32px 1fr 32px 1fr;
      align-items: center;
      margin: 0;
    }
    .diag-step {
      border: 1px solid var(--black);
      padding: 12px 14px;
    }
    .diag-step.inv {
      background: var(--black);
      color: var(--white);
    }
    .diag-step .d-tag { color: var(--mid); }
    .diag-step.inv .d-tag { color: #777; }
    .diag-step.inv .d-text { color: #bbb; }
    .diag-step-arrow {
      display: flex; align-items: center; justify-content: center;
    }
    .diag-step-arrow svg { display: block; }
    /* result bar */
    .diag-result {
      display: flex;
      align-items: stretch;
      border: 2px solid var(--black);
      margin-top: 0;
    }
    .diag-result-label {
      background: var(--black);
      color: var(--white);
      font-size: 0.68rem;
      letter-spacing: 0.18em;
      text-transform: uppercase;
      writing-mode: vertical-rl;
      text-orientation: mixed;
      transform: rotate(180deg);
      padding: 10px 9px;
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0;
    }
    .diag-result-body { padding: 14px 20px; flex: 1; }
    .diag-result-body .d-tool {
      font-size: 1.45rem;
      font-weight: 700;
      letter-spacing: 0.18em;
      text-transform: uppercase;
      margin-bottom: 4px;
    }
    .diag-result-body .d-tagline {
      font-size: 0.9rem;
      color: var(--mid);
      letter-spacing: 0.10em;
      text-transform: uppercase;
      margin-bottom: 10px;
    }
    .diag-result-body .d-text {
      font-size: 1.0rem;
      color: #444;
      line-height: 1.6;
      margin-bottom: 12px;
    }
    .diag-props {
      display: flex;
      flex-wrap: wrap;
      gap: 7px;
    }
    .diag-prop {
      font-size: 0.8rem;
      letter-spacing: 0.10em;
      text-transform: uppercase;
      padding: 3px 10px;
      border: 1px solid var(--light);
      color: var(--mid);
    }
    /* about intro text */
    .about-intro {
      display: flex;
      flex-direction: column;
      gap: 16px;
      padding-bottom: 8px;
      border-bottom: 1px solid var(--xlight);
      margin-bottom: 4px;
    }
    .about-intro p {
      font-size: 1.28rem;
      line-height: 1.75;
      color: #1a1a1a;
      margin: 0;
    }
    /* spacing helpers inside about */
    .diag-gap { margin-top: 8px; }
    .about-contact {
      border-top: 1px solid var(--xlight);
      padding-top: 14px;
      margin-top: 20px;
      font-size: 1.05rem;
      line-height: 1.65;
      color: #444;
    }
    .about-contact .contact-line {
      font-size: 0.95rem;
      color: var(--mid);
      margin-top: 8px;
      letter-spacing: 0.03em;
    }

    /* ── OPERATIVE INDEX MODAL ──────────────────────────────────────── */
    /* ── SEARCH INDEX: new columns ────────────────────────── */
    .idx-practice, .idx-institution {
      font-size: 0.78rem;
      color: var(--mid);
      white-space: nowrap;
      max-width: 160px;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    /* ── HOVER THUMBNAIL ───────────────────────────────────── */
    .idx-thumb-tip {
      position: fixed;
      z-index: 9999;
      pointer-events: none;
      opacity: 0;
      transition: opacity 0.18s;
      border: 1px solid rgba(0,0,0,0.15);
      box-shadow: 0 8px 28px rgba(0,0,0,0.22);
      background: #000;
      overflow: hidden;
      border-radius: 2px;
      width: 220px;
      height: 138px;
    }
    .idx-thumb-tip.visible { opacity: 1; }
    .idx-thumb-tip img {
      width: 100%; height: 100%;
      object-fit: cover;
      display: block;
    }

    .modal-index {
      width: 90vw;
      max-width: 1300px;
      height: 86vh;
      max-height: 86vh;
      border: 1px solid var(--black);
      overflow: hidden;
      flex-direction: column;
      padding: 0;
    }
    .modal-index.open { display: flex; }
    .idx-topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 32px 0 0;
      height: 52px;
      border-bottom: 1px solid var(--black);
      flex-shrink: 0;
      font-size: 1.0rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
    }
    .idx-topbar-label {
      display: flex;
      align-items: center;
      height: 100%;
      padding: 0 24px;
      border-right: 1px solid var(--light);
      color: var(--mid);
      font-size: 1.0rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
    }
    .idx-body-wrap {
      overflow-y: auto;
      flex: 1;
    }
    .idx-hero {
      padding: 32px 32px 0;
      position: relative;
    }
    /* Suggestions for the big Index/Search-modal input — same .search-suggest
       base as the small filter-bar box, sized up for this hero context */
    .idx-search-suggest {
      left: 32px; right: 32px;
      font-size: 1.05rem;
      border-color: var(--black);
    }
    .idx-search-suggest .suggest-item { padding: 14px 20px; }
    .idx-hero-heading {
      font-size: clamp(3.5rem, 7vw, 7.5rem);
      line-height: 1;
      letter-spacing: -0.01em;
      font-weight: 400;
    }
    .idx-search-input {
      display: block;
      width: 100%;
      font-family: inherit;
      font-size: clamp(2.5rem, 5.5vw, 6rem);
      line-height: 1.15;
      color: var(--black);
      border: none;
      outline: none;
      background: none;
      padding: 0;
      letter-spacing: -0.01em;
      caret-color: var(--black);
    }
    .idx-search-input::placeholder { color: var(--xlight); }
    .idx-filters {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      padding: 20px 32px;
      border-bottom: 1px solid var(--light);
    }
    .idx-filter-pill {
      cursor: pointer;
      background: none;
      border: 1px solid var(--light);
      border-radius: 100px;
      font-family: inherit;
      font-size: 0.88rem;
      letter-spacing: 0.04em;
      padding: 5px 16px;
      color: var(--mid);
      transition: all 0.12s;
      white-space: nowrap;
    }
    .idx-filter-pill:hover { border-color: var(--black); color: var(--black); }
    .idx-filter-pill.active { background: var(--black); color: var(--white); border-color: var(--black); }
    .idx-table {
      width: 100%;
      border-collapse: collapse;
    }
    .idx-table thead th {
      font-size: 0.75rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--mid);
      font-weight: 400;
      padding: 10px 24px 10px 0;
      border-bottom: 1px solid var(--black);
      text-align: left;
      cursor: pointer;
      white-space: nowrap;
      user-select: none;
      transition: color 0.1s;
    }
    .idx-table thead th:first-child { padding-left: 32px; }
    .idx-table thead th.sort-asc::after { content: ' ↑'; }
    .idx-table thead th.sort-desc::after { content: ' ↓'; }
    .idx-table thead th:hover { color: var(--black); }
    .idx-table tbody tr {
      border-bottom: 1px solid var(--xlight);
      cursor: pointer;
      transition: background 0.08s;
    }
    .idx-table tbody tr:hover { background: var(--xlight); }
    .idx-table tbody td {
      padding: 11px 24px 11px 0;
      font-size: 1.0rem;
      line-height: 1.4;
      vertical-align: middle;
    }
    .idx-table tbody td:first-child { padding-left: 32px; }
    .idx-id {
      color: var(--mid);
      font-size: 0.88rem;
      white-space: nowrap;
      width: 90px;
    }
    .idx-title { color: var(--black); }
    .idx-author-btn {
      cursor: pointer;
      background: none;
      border: none;
      border-bottom: 1px solid currentColor;
      font-family: inherit;
      font-size: 1.0rem;
      color: var(--black);
      padding: 0 0 1px 0;
      display: inline-block;
      margin: 0 8px 2px 0;
      transition: opacity 0.15s;
      white-space: nowrap;
    }
    .idx-author-btn:hover { opacity: 0.4; }
    .idx-type {
      font-size: 0.85rem;
      color: var(--mid);
      letter-spacing: 0.03em;
      white-space: nowrap;
      width: 150px;
    }
    .idx-count-cell {
      font-size: 0.85rem;
      color: var(--mid);
      width: 80px;
      text-align: right;
      padding-right: 32px !important;
    }
    .idx-count-num { color: var(--black); font-size: 0.88rem; }
    .idx-link {
      font-size: 0.85rem;
      color: var(--mid);
      text-decoration: none;
      letter-spacing: 0.04em;
      border-bottom: 1px solid var(--light);
      white-space: nowrap;
      transition: all 0.12s;
    }
    .idx-link:hover { color: var(--black); border-color: var(--black); }
    .idx-empty {
      padding: 40px 32px;
      font-size: 1.0rem;
      color: var(--mid);
      letter-spacing: 0.04em;
    }

    /* ══ RESPONSIVE BREAKPOINTS ═════════════════════════════════════════ */

    /* Large desktop (1400px+): 4 columns — default already set */

    /* Standard desktop (1200-1400px): 4 columns, smaller gap */
    @media (max-width: 1400px) {
      .grid { grid-template-columns: repeat(4, 1fr); gap: 36px 24px; }
    }

    /* Medium desktop / large tablet landscape (960-1200px): 3 columns */
    @media (max-width: 1200px) {
      .grid { grid-template-columns: repeat(3, 1fr); gap: 32px 22px; }
      .tb-section { display: none; }
      .f-btn { font-size: 0.82rem; padding: 0 14px; }
    }

    /* Tablet portrait (768-960px): 3 columns, tighter */
    @media (max-width: 960px) {
      .grid { grid-template-columns: repeat(3, 1fr); gap: 28px 18px; }
      main { padding: 22px 18px 60px; }
      .tb-action { padding: 0 13px; font-size: 0.78rem; }
    }

    /* Large phone / small tablet (600-768px): 2 columns */
    @media (max-width: 768px) {
      .grid { grid-template-columns: repeat(2, 1fr); gap: 24px 14px; }
      main { padding: 18px 14px 60px; }
      .f-search input { width: 130px; }
      .tb-logo { font-size: 1.05rem; padding: 0 16px; }
      .tb-action { padding: 0 11px; font-size: 0.75rem; letter-spacing: 0.10em; }
      /* Hide secondary topbar actions on small screens */
      #btn-request, #btn-login { display: none !important; }
      .modal { width: calc(100vw - 24px); max-width: 100%; }
      .modal.modal-wide { width: calc(100vw - 24px); }
    }

    /* Phone (max 600px): 2 columns still, max compressed */
    @media (max-width: 600px) {
      .grid { grid-template-columns: repeat(2, 1fr); gap: 18px 10px; }
      main { padding: 14px 10px 60px; }
      .tb-logo { font-size: 0.95rem; padding: 0 14px; letter-spacing: 0.12em; }
      .tb-section { display: none; }
      .tb-action { padding: 0 10px; font-size: 0.72rem; }
      .f-btn { font-size: 0.78rem; padding: 0 12px; }
      .f-search input { width: 100px; font-size: 0.85rem; }
      .viewbar { height: 28px; }
      .v-btn { font-size: 0.68rem; padding: 0 14px; }
      .card-desc { -webkit-line-clamp: 2; }
      .card-actions { gap: 4px; margin-top: 6px; }
      .card-btn { font-size: 0.64rem; padding: 3px 8px; }
      .topbar { height: 46px; }
    }

    /* Very small phone (max 420px): 1 column */
    @media (max-width: 420px) {
      .grid { grid-template-columns: 1fr; gap: 24px; }
      main { padding: 12px 10px 60px; }
      .f-search input { width: 80px; }
    }

    /* ══ VIEW BAR ═══════════════════════════════════════════════════════ */
    .viewbar {
      border-bottom: 1px solid var(--light);
      height: 32px;
      display: flex;
      align-items: stretch;
      background: var(--white);
    }
    /* Count badge on filter and theme buttons */
    .f-count, .t-count {
      display: inline-block;
      font-size: 0.62rem;
      font-weight: 400;
      letter-spacing: 0.04em;
      color: var(--light);
      margin-left: 5px;
      vertical-align: middle;
      line-height: 1;
    }
    .f-btn.active .f-count { color: var(--mid); }
    .t-btn.active .t-count { color: var(--mid); }

    /* ── MASTHEAD ────────────────────────────────────────────────── */
    .masthead {
      padding: 6px 24px 14px;
      border-bottom: 1px solid var(--light);
    }
    .masthead-title {
      font-size: clamp(6.75rem, 13.5vw, 12rem);
      font-weight: 400;
      letter-spacing: -0.02em;
      line-height: 0.92;
      margin-bottom: 8px;
    }
    .masthead-desc {
      font-size: 1.0rem;
      color: var(--black);
      line-height: 1.6;
      max-width: none;
      letter-spacing: 0.01em;
    }
    .masthead-desc a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
    .masthead-desc a:hover { opacity: 0.6; }

    /* ── LEFT NAV in topbar ──────────────────────────────────────── */
    .tb-left { display: flex; align-items: stretch; }
    .tb-left .tb-action:first-child { border-left: none; }

    /* ── Separator inside unified filterbar ─────────────────────── */
    .f-bar-sep {
      width: 1px;
      background: var(--light);
      flex-shrink: 0;
      margin: 9px 3px;
      align-self: stretch;
    }

    /* ── AUTHORS DROPDOWN (floating) ─────────────────────────────── */
    .authors-dropdown {
      position: fixed;
      background: var(--white);
      border: 1px solid var(--black);
      z-index: 500;
      max-height: 380px;
      overflow-y: auto;
      min-width: 220px;
      display: none;
      scrollbar-width: thin;
      scrollbar-color: var(--light) transparent;
    }
    .authors-dropdown.open { display: block; }
    .authors-dd-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 9px 18px;
      font-size: 0.88rem;
      color: var(--mid);
      cursor: pointer;
      border-bottom: 1px solid var(--xlight);
      white-space: nowrap;
      transition: color 0.1s;
    }
    .authors-dd-item:hover { color: var(--black); }
    .authors-dd-item.dd-active { color: var(--black); font-weight: 700; }
    .authors-dd-count {
      font-size: 0.68rem;
      color: var(--light);
      margin-left: 14px;
      font-weight: 400;
    }

    /* ── AUTHORS section inside Search modal ─────────────────────── */
    .idx-authors {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 6px;
      padding: 16px 32px;
      border-bottom: 1px solid var(--light);
    }
    /* Thin visual separator between repr and content theme groups */
    .t-group-sep {
      width: 1px;
      background: var(--light);
      flex-shrink: 0;
      margin: 7px 4px;
      align-self: stretch;
    }
    .v-btn {
      cursor: pointer; background: none;
      border: none; border-right: 1px solid var(--light);
      font-family: inherit; font-size: 0.72rem;
      letter-spacing: 0.12em; text-transform: uppercase;
      padding: 0 24px;
      color: var(--black);
      font-weight: 700;
      letter-spacing: 0.06em;
      transition: color 0.15s, background 0.15s;
      flex-shrink: 0;
    }
    .v-btn:hover { color: var(--black); opacity: 0.7; }
    .v-btn.active { color: var(--black); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
    .v-btn.v-dark { background: var(--black); color: var(--white); border-right: none; }
    .v-btn.v-dark:hover { background: #222; color: var(--white); }
    .v-btn.v-dark.active { background: var(--black); color: var(--white); font-weight: 700; }
    /* Separator between view toggles and theme filters */
    .v-sep {
      width: 1px; background: var(--light); flex-shrink: 0; margin: 6px 0;
    }
    /* Scrollable theme section inside viewbar */
    .v-themes {
      display: flex; align-items: stretch;
      flex: 1; min-width: 0;
      overflow-x: auto; overflow-y: hidden;
      scrollbar-width: none;
    }
    .v-themes::-webkit-scrollbar { display: none; }
    .t-btn {
      cursor: pointer; background: none;
      border: none;
      font-family: inherit; font-size: 0.88rem;
      letter-spacing: 0.03em; text-transform: none;
      padding: 0 0 0 18px; color: var(--mid);
      min-height: 36px;
      transition: color 0.15s; white-space: nowrap; flex-shrink: 0;
      display: flex; align-items: center;
    }
    .t-btn::after { content: ","; color: var(--mid); margin-left: 1px; }
    .t-btn:hover { color: var(--black); }
    .t-btn.active { color: var(--black); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
    /* "All themes" reset button inside the theme strip */
    .t-btn.t-all-btn {
      color: var(--mid);
      border-right: 1px solid var(--light);
    }
    .t-btn.t-all-btn.active { color: var(--black); font-weight: 700; }
    /* Per-card quote display (mix mode) */
    .card.show-q .quote-card-body { display: flex !important; }
    /* Quote card: aspect-ratio matches the screenshot crop (1400×909).
       Image is pulled from flow (height:0) so it never overrides the ratio. */
    .card.show-q .card-vis {
      aspect-ratio: 1400/909;
    }
    .card.show-q .card-vis img {
      visibility: hidden;
      height: 0; /* remove from layout so aspect-ratio controls the container */
    }
    .card.show-q .card-vis .no-img { visibility: hidden; }

    /* ── VIDEO MODAL ────────────────────────────────────────────────── */
    .vid-modal {
      display: none;
      position: fixed; inset: 0; z-index: 500;
      background: rgba(0,0,0,0.88);
      flex-direction: column;
      align-items: center; justify-content: center;
    }
    .vid-modal.open { display: flex; }
    .vid-modal-row {
      display: flex;
      align-items: center;
    }
    /* ── DESCRIPTION PANEL — below the video ──────────────────── */
    .vid-desc-panel {
      width: 72vw; max-width: 1000px;
      margin-top: 12px;
      font-size: 0.83rem; line-height: 1.65;
      color: rgba(255,255,255,0.55);
      display: -webkit-box;
      -webkit-line-clamp: 3;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    .vid-desc-panel:empty { display: none; }
    /* ── RELATED STRIP ───────────────────────────────────────── */
    .vid-related {
      width: 72vw; max-width: 1000px;
      margin-top: 10px;
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 8px;
    }
    .rel-card {
      cursor: pointer;
      opacity: 0.5;
      transition: opacity 0.15s;
    }
    .rel-card:hover { opacity: 1; }
    .rel-card-img {
      width: 100%;
      aspect-ratio: 1400/909;
      object-fit: cover;
      display: block;
      background: #1a1a1a;
    }
    .rel-card-body { padding: 4px 0 0; }
    .rel-card-title {
      font-size: 0.68rem;
      color: rgba(255,255,255,0.78);
      line-height: 1.35;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    .rel-card-meta {
      font-size: 0.60rem;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: rgba(255,255,255,0.28);
      margin-top: 2px;
    }
    .vid-modal-inner {
      position: relative;
      width: 72vw; max-width: 1000px;
      aspect-ratio: 16/9;
      background: #000;
    }
    .vid-modal-inner iframe {
      width: 100%; height: 100%;
      border: none; display: block;
    }
    .vid-modal-close {
      position: absolute; top: -40px; right: 0;
      cursor: pointer; background: none; border: none;
      color: #fff; font-size: 2.6rem; line-height: 1;
      opacity: 0.7; transition: opacity 0.15s;
    }
    .vid-modal-close:hover { opacity: 1; }
    /* ← → navigation arrows flanking the modal (flex siblings of vid-modal-inner) */
    .vid-nav-btn {
      flex-shrink: 0; align-self: center;
      background: none; border: none; cursor: pointer;
      color: rgba(255,255,255,0.45); font-size: 2rem; line-height: 1;
      padding: 12px 16px; transition: color 0.15s;
      user-select: none;
    }
    .vid-nav-btn:hover { color: rgba(255,255,255,0.9); }
    .vid-nav-btn.disabled { opacity: 0.18; cursor: default; pointer-events: none; }
    .vid-modal-yt {
      position: absolute; bottom: -36px; right: 0;
      color: rgba(255,255,255,0.55); font-size: 0.8rem;
      letter-spacing: 0.07em; text-decoration: none;
      transition: color 0.15s;
    }
    .vid-modal-yt:hover { color: #fff; }
    /* Fallback / poster UI — shown immediately, replaces black iframe */
    .vid-fallback {
      display: none; position: absolute; inset: 0; z-index: 2;
      align-items: center; justify-content: center;
      flex-direction: column; background: #111;
    }
    .vid-fallback.active { display: flex; }
    .vid-fallback-bg {
      position: absolute; inset: 0;
      background-size: cover; background-position: center center;
      opacity: 0.32;
    }
    .vid-fallback-overlay {
      position: absolute; inset: 0;
      background: linear-gradient(to bottom, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.7) 100%);
    }
    .vid-fallback-content {
      position: relative; z-index: 1;
      display: flex; flex-direction: column;
      align-items: center; gap: 16px;
      text-align: center; padding: 0 48px;
    }
    .vid-fallback-ts {
      font-size: 0.78rem; color: rgba(255,255,255,0.5);
      letter-spacing: 0.18em; text-transform: uppercase;
    }
    .vid-fallback-title {
      font-size: 1.15rem; color: rgba(255,255,255,0.92);
      line-height: 1.4; max-width: 580px; font-weight: 400;
    }
    .vid-fallback-play {
      width: 68px; height: 68px; margin: 8px 0 4px;
      border: 1.5px solid rgba(255,255,255,0.55);
      border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      color: #fff; font-size: 1.5rem;
      background: none; cursor: pointer;
      transition: all 0.2s;
      padding-left: 4px;
    }
    .vid-fallback-play:hover {
      border-color: #fff;
      background: rgba(255,255,255,0.12);
      transform: scale(1.08);
    }
    .vid-fallback-label {
      font-size: 0.72rem; color: rgba(255,255,255,0.4);
      letter-spacing: 0.14em; text-transform: uppercase;
    }
    /* ── Private-video mode: full-brightness snapshot + disclaimer ─── */
    .vid-fallback.private .vid-fallback-bg { opacity: 1; }
    .vid-fallback.private .vid-fallback-overlay { display: none; }
    .vid-fallback-private-footer {
      position: absolute; bottom: 0; left: 0; right: 0;
      padding: 48px 28px 22px;
      background: linear-gradient(transparent, rgba(0,0,0,0.72) 38%);
      display: flex; flex-direction: column; align-items: flex-start; gap: 5px;
    }
    .vid-fallback-private-title {
      font-size: 1.05rem; color: rgba(255,255,255,0.95);
      line-height: 1.35; font-weight: 400; max-width: 580px;
    }
    .vid-fallback-private-note {
      font-size: 0.72rem; color: rgba(255,255,255,0.5);
      letter-spacing: 0.12em; text-transform: uppercase; margin-top: 3px;
    }
    .vid-fallback-private-link {
      font-size: 0.72rem; color: rgba(255,255,255,0.38);
      letter-spacing: 0.08em; text-decoration: none; margin-top: 1px;
      transition: color 0.15s;
    }
    .vid-fallback-private-link:hover { color: rgba(255,255,255,0.75); }
    /* ── QUOTE PANEL — overlay on video ─────────────────────────────── */
    .vid-quote-panel {
      position: absolute; bottom: 0; left: 0; right: 0;
      background: linear-gradient(transparent, rgba(0,0,0,0.88) 28%);
      padding: 48px 32px 22px;
      pointer-events: none; transition: opacity 0.25s;
    }
    .vid-modal-inner:hover .vid-quote-panel { opacity: 1; }
    .vid-quote-text {
      color: rgba(255,255,255,0.90); font-size: 0.92rem; line-height: 1.6;
      font-style: italic; letter-spacing: 0.01em;
      border-left: 2px solid rgba(255,255,255,0.22); padding-left: 16px;
    }
    .vid-quote-edit {
      display: none; /* hidden by default — only admin sees it */
      pointer-events: all; position: absolute; bottom: 22px; right: 28px;
      background: none; border: none; cursor: pointer;
      color: rgba(255,255,255,0.28); font-size: 0.70rem;
      letter-spacing: 0.07em; text-transform: uppercase;
      transition: color 0.15s;
    }
    body.is-admin .vid-quote-edit { display: block; }
    .vid-quote-edit:hover { color: rgba(255,255,255,0.8); }

    /* ── QUOTE-ONLY MODE — full-screen centered black display ─────── */
    .vid-modal.quote-only .vid-modal-inner {
      background: #000;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
    }
    .vid-modal.quote-only .vid-quote-panel {
      position: relative;
      background: none;
      padding: 0 clamp(28px, 8vw, 96px);
      text-align: center;
      display: block !important;
      pointer-events: auto;
      max-width: 860px;
      width: 100%;
    }
    .vid-modal.quote-only .vid-quote-panel::before {
      content: '\201C';
      display: block;
      font-size: clamp(4rem, 8vw, 7rem);
      color: rgba(255,255,255,0.10);
      line-height: 0.75;
      margin-bottom: 28px;
      font-style: italic;
    }
    .vid-modal.quote-only .vid-quote-text {
      font-size: clamp(1.1rem, 2.2vw, 1.65rem);
      line-height: 1.72;
      font-style: italic;
      color: rgba(255,255,255,0.92);
      letter-spacing: 0.025em;
      border-left: none;
      padding-left: 0;
      text-align: center;
      font-weight: 300;
    }
    .vid-quote-attribution {
      display: none;
    }
    .vid-modal.quote-only .vid-quote-attribution {
      display: block;
      margin-top: 32px;
      font-size: 0.72rem;
      letter-spacing: 0.18em;
      text-transform: uppercase;
      color: rgba(255,255,255,0.35);
      text-align: center;
    }
    .vid-modal.quote-only .vid-desc-panel { display: none !important; }
    .vid-modal.quote-only .vid-quote-edit {
      position: relative;
      bottom: auto; right: auto;
      display: block;
      margin: 24px auto 0;
      color: rgba(255,255,255,0.22);
    }
    /* Quote indicator on cards (normal mode) */
    .card.has-quote .card-vis::before {
      content: '\201C'; position: absolute; top: 8px; right: 10px; z-index: 10;
      color: rgba(255,255,255,0.7); font-size: 1.6rem; line-height: 1;
      font-style: italic; pointer-events: none;
    }
    /* ── QUOTES MODE — grid shows text cards instead of images ───────── */
    .grid.quotes-mode .card.has-quote { cursor: pointer; }
    .grid.quotes-mode .card.has-quote .card-vis {
      aspect-ratio: 1400/909;
    }
    .grid.quotes-mode .card.has-quote .card-vis img {
      visibility: hidden;
      height: 0; /* remove from layout so aspect-ratio controls the container */
    }
    .grid.quotes-mode .card.has-quote .card-vis .no-img { visibility: hidden; }
    .grid.quotes-mode .card.has-quote .card-vis::before { display: none; }
    .grid.quotes-mode .card.has-quote .card-overlay { display: none; }
    .grid.quotes-mode .card.has-quote .card-vis .quote-card-body {
      display: flex !important;
    }
    /* Hide AI description in Quotes view — only speaker quotes should appear */
    .grid.quotes-mode .card.has-quote .card-desc { display: none; }

    /* Quote text block inside card-vis */
    .quote-card-body {
      display: none;
      position: absolute; inset: 0; z-index: 5;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      padding: 16px 22px;
      background: #000;
    }
    .quote-card-mark {
      display: none; /* removed — disrupts vertical centering */
    }
    .quote-card-text {
      color: rgba(255,255,255,0.90); font-size: 0.88rem; line-height: 1.55;
      font-style: italic; letter-spacing: 0.01em;
      text-align: center;
      overflow: hidden;
      display: -webkit-box;
      -webkit-line-clamp: 7;
      -webkit-box-orient: vertical;
    }
    /* Clickable cursor on card vis when video is available */
    .card.has-vid .card-vis { cursor: pointer; }

    /* ── BIG CENTERED PLAY OVERLAY ───────────────────────────────── */
    .card-play-overlay {
      position: absolute; inset: 0; z-index: 6;
      display: flex; align-items: center; justify-content: center;
      background: rgba(0,0,0,0);
      opacity: 0;
      transition: opacity 0.18s, background 0.18s;
      pointer-events: none;
    }
    .card.has-vid:hover .card-play-overlay {
      opacity: 1;
      background: rgba(0,0,0,0.28);
      pointer-events: auto;
    }
    .card-play-btn {
      width: 60px; height: 60px;
      border-radius: 50%;
      background: rgba(255,255,255,0.92);
      display: flex; align-items: center; justify-content: center;
      font-size: 1.4rem; color: #000;
      transform: scale(0.88);
      transition: transform 0.18s, background 0.18s;
      padding-left: 4px; /* optical centering of ▶ */
      pointer-events: none;
    }
    .card.has-vid:hover .card-play-btn { transform: scale(1); }

    /* ── CARD DESCRIPTION ─────────────────────────────────────────── */
    .card-desc {
      font-size: 0.80rem;
      line-height: 1.55;
      color: var(--black);
      margin-top: 4px;
      display: -webkit-box;
      -webkit-line-clamp: 3;
      -webkit-box-orient: vertical;
      overflow: hidden;
      flex: 1;
    }

    /* ── CARD ACTION BUTTONS (image / quote / watch) ─────────────── */
    .card-actions {
      display: flex;
      gap: 0;
      margin-top: auto;
      padding-top: 10px;
      flex-wrap: wrap;
      align-items: center;
    }
    .card-btn {
      font-family: inherit;
      font-size: 0.82rem;
      letter-spacing: 0.02em;
      text-transform: none;
      padding: 0;
      border: none;
      background: none;
      cursor: pointer;
      color: var(--black);
      transition: opacity 0.12s;
      text-decoration: none;
      display: inline-flex; align-items: center;
      white-space: nowrap;
    }
    .card-btn::after { content: ","; color: var(--mid); margin-left: 1px; margin-right: 10px; }
    .card-btn:last-child::after { content: ""; margin-right: 0; }
    .card-btn:hover { opacity: 0.5; }

    /* Timestamp chip — always visible in the card actions row */
    .card-ts-chip {
      font-size: 0.74rem;
      letter-spacing: 0.06em;
      color: var(--mid);
      font-variant-numeric: tabular-nums;
      margin-right: 10px;
      flex-shrink: 0;
    }

    /* ── TOUCH / MOBILE: hover states converted to always-on ────────── */
    /* On devices that can't hover (phones, tablets), the play overlay    */
    /* must be permanently visible — there is no hover event on touch.    */
    @media (hover: none) {
      /* Always show a subtle play indicator on video cards */
      .card.has-vid .card-play-overlay {
        opacity: 1;
        background: rgba(0,0,0,0.18);
        pointer-events: auto;
      }
      .card.has-vid .card-play-btn {
        transform: scale(0.78);
        background: rgba(255,255,255,0.82);
      }
      /* Slightly smaller play button on touch so it doesn't dominate */
      .card.has-vid .card-play-btn { width: 46px; height: 46px; font-size: 1.1rem; }
      /* Ensure card images are full opacity (not dimmed waiting for hover) */
      .card .card-vis img { opacity: 1; }
    }

    /* ── AUTH: TOPBAR STATES ─────────────────────────────────────────── */
    /* Toast notification */
    .oa-toast {
      position: fixed; bottom: 72px; left: 50%; transform: translateX(-50%);
      background: var(--black); color: var(--white);
      padding: 10px 22px; font-size: 0.82rem; letter-spacing: 0.06em;
      z-index: 9999; pointer-events: none;
      opacity: 0; transition: opacity 0.25s;
      white-space: nowrap;
    }
    .oa-toast.show { opacity: 1; }
    .tb-user {
      display: flex; align-items: center;
      padding: 0 18px;
      border-left: 1px solid var(--light);
      font-size: 0.9rem;
      letter-spacing: 0.06em;
      color: var(--mid);
      gap: 10px;
      white-space: nowrap;
    }
    .tb-user-check { font-size: 0.8rem; color: var(--mid); }
    .tb-user-email {
      color: var(--black);
      font-size: 0.88rem;
      max-width: 160px;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .tb-user-role {
      font-size: 0.72rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      background: var(--black);
      color: var(--white);
      padding: 2px 6px;
    }

    /* ── REQUEST ACCESS / LOGIN MODALS ───────────────────────────────── */
    .auth-modal {
      display: none;
      position: fixed; inset: 0; z-index: 600;
      background: rgba(10,10,10,0.72);
      align-items: center; justify-content: center;
    }
    .auth-modal.open { display: flex; }
    .auth-box {
      background: var(--white);
      border: 1px solid var(--black);
      width: 480px;
      max-width: 96vw;
      max-height: 90vh;
      overflow-y: auto;
    }
    .auth-head {
      display: flex; align-items: center; justify-content: space-between;
      border-bottom: 1px solid var(--black);
      padding: 0 20px;
      height: 44px;
    }
    .auth-head h2 {
      font-size: 1.0rem;
      letter-spacing: 0.14em;
      text-transform: uppercase;
      font-weight: 700;
    }
    .auth-x {
      cursor: pointer; background: none; border: none;
      font-size: 1.6rem; line-height: 1; color: var(--mid);
      padding: 0 4px;
      transition: color 0.12s;
    }
    .auth-x:hover { color: var(--black); }
    .auth-body { padding: 24px; }
    .auth-intro {
      font-size: 1.0rem;
      line-height: 1.65;
      color: #444;
      margin-bottom: 20px;
    }
    .auth-field {
      margin-bottom: 14px;
    }
    .auth-field label {
      display: block;
      font-size: 0.78rem;
      letter-spacing: 0.14em;
      text-transform: uppercase;
      color: var(--mid);
      margin-bottom: 5px;
    }
    .auth-field input,
    .auth-field textarea,
    .auth-field select {
      width: 100%;
      border: 1px solid var(--black);
      background: var(--white);
      font-family: inherit;
      font-size: 1.0rem;
      color: var(--black);
      padding: 8px 12px;
      outline: none;
      transition: border-color 0.12s;
      appearance: none;
    }
    .auth-field input:focus,
    .auth-field textarea:focus { border-color: var(--black); }
    .auth-field textarea { resize: vertical; min-height: 80px; }
    .auth-btn {
      width: 100%;
      background: var(--black);
      color: var(--white);
      border: none;
      font-family: inherit;
      font-size: 1.0rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      padding: 12px 24px;
      cursor: pointer;
      margin-top: 8px;
      transition: background 0.12s;
    }
    .auth-btn:hover { background: #222; }
    .auth-btn:disabled { background: var(--mid); cursor: default; }
    .auth-msg {
      font-size: 0.95rem;
      line-height: 1.6;
      padding: 12px 14px;
      margin-top: 14px;
      display: none;
    }
    .auth-msg.ok  { background: #f0f8f0; border: 1px solid #4a9; color: #274; }
    .auth-msg.err { background: #fff0f0; border: 1px solid #c66; color: #622; }
    .auth-divider {
      border: none;
      border-top: 1px solid var(--xlight);
      margin: 18px 0;
    }
    .auth-link {
      display: block;
      text-align: center;
      font-size: 0.9rem;
      color: var(--mid);
      margin-top: 14px;
      cursor: pointer;
      text-decoration: underline;
      text-underline-offset: 3px;
    }
    .auth-link:hover { color: var(--black); }

    /* ── ADMIN EDIT OVERLAY ──────────────────────────────────────────── */
    .card { position: relative; }
    .card-admin-btn {
      display: none;
      position: absolute;
      top: 6px; right: 6px;
      z-index: 10;
      background: rgba(10,10,10,0.82);
      border: none;
      color: #fff;
      font-size: 0.75rem;
      letter-spacing: 0.10em;
      text-transform: uppercase;
      padding: 4px 8px;
      cursor: pointer;
      font-family: inherit;
      transition: background 0.12s;
    }
    .card-admin-btn:hover { background: rgba(10,10,10,1); }
    body.is-admin .card-admin-btn { display: block; }
    /* Private badge */
    .card-private-badge {
      display: none;
      position: absolute;
      top: 6px; left: 6px;
      z-index: 10;
      background: #c00;
      color: #fff;
      font-size: 0.68rem;
      letter-spacing: 0.10em;
      text-transform: uppercase;
      padding: 3px 7px;
      font-family: inherit;
    }
    body.is-admin .card.is-private .card-private-badge { display: block; }

    /* ── ADMIN EDIT MODAL ────────────────────────────────────────────── */
    .edit-modal {
      display: none;
      position: fixed; inset: 0; z-index: 700;
      background: rgba(10,10,10,0.80);
      align-items: center; justify-content: center;
    }
    .edit-modal.open { display: flex; }
    .edit-box {
      background: var(--white);
      border: 1px solid var(--black);
      width: 580px;
      max-width: 96vw;
      max-height: 90vh;
      overflow-y: auto;
    }
    .edit-head {
      display: flex; align-items: center; justify-content: space-between;
      border-bottom: 1px solid var(--black);
      padding: 0 20px;
      height: 44px;
    }
    .edit-head h2 {
      font-size: 1.0rem;
      letter-spacing: 0.14em;
      text-transform: uppercase;
      font-weight: 700;
    }
    .edit-x {
      cursor: pointer; background: none; border: none;
      font-size: 1.6rem; line-height: 1; color: var(--mid);
      padding: 0 4px; transition: color 0.12s;
    }
    .edit-x:hover { color: var(--black); }
    .edit-body { padding: 20px 24px 24px; }
    .edit-row {
      margin-bottom: 14px;
    }
    .edit-row label {
      display: block;
      font-size: 0.78rem;
      letter-spacing: 0.14em;
      text-transform: uppercase;
      color: var(--mid);
      margin-bottom: 5px;
    }
    .edit-row input,
    .edit-row textarea {
      width: 100%;
      border: 1px solid var(--black);
      background: var(--white);
      font-family: inherit;
      font-size: 0.95rem;
      color: var(--black);
      padding: 8px 12px;
      outline: none;
    }
    .edit-row textarea { resize: vertical; min-height: 90px; }
    .edit-row .edit-toggle {
      display: flex; align-items: center; gap: 10px;
      font-size: 0.95rem;
      cursor: pointer;
    }
    .edit-row .edit-toggle input[type=checkbox] {
      width: 16px; height: 16px; cursor: pointer;
      accent-color: var(--black);
      flex-shrink: 0;
    }
    .edit-actions {
      display: flex; gap: 10px; margin-top: 20px;
    }
    .edit-save {
      flex: 1;
      background: var(--black); color: var(--white);
      border: none; font-family: inherit;
      font-size: 0.95rem; letter-spacing: 0.10em;
      text-transform: uppercase; padding: 10px 20px;
      cursor: pointer; transition: background 0.12s;
    }
    .edit-save:hover { background: #222; }
    .edit-delete {
      background: #fff; color: #c00;
      border: 1px solid #c00; font-family: inherit;
      font-size: 0.95rem; letter-spacing: 0.10em;
      text-transform: uppercase; padding: 10px 20px;
      cursor: pointer; transition: background 0.12s, color 0.12s;
    }
    .edit-delete:hover { background: #c00; color: #fff; }
    .edit-id-label {
      font-size: 0.78rem;
      color: var(--mid);
      letter-spacing: 0.08em;
      margin-bottom: 16px;
      padding-bottom: 14px;
      border-bottom: 1px solid var(--xlight);
    }

    /* ── INTRO / TRAILER SCREEN ──────────────────────────────────────── */
    .intro-screen {
      position: fixed; inset: 0; z-index: 2000;
      background: #000;
      display: flex; flex-direction: column;
      overflow: hidden;
      transition: opacity 0.6s;
    }
    .intro-screen.fade-out { opacity: 0; pointer-events: none; }

    /* The branded intro video, full-bleed and letterboxed to fit any
       viewport without cropping (object-fit:contain — this is a 16:9
       narrated piece, not a background loop, so nothing should be cut off). */
    .intro-video-player {
      position: absolute; inset: 0;
      width: 100%; height: 100%;
      object-fit: contain;
      background: #000;
    }

    /* Big centered play affordance — shown only when an autoplay-with-sound
       attempt is blocked by the browser (no prior user gesture on first
       visit). A user gesture on THIS button always succeeds. */
    .intro-play-btn {
      position: absolute;
      top: 50%; left: 50%;
      transform: translate(-50%, -50%);
      z-index: 15;
      width: 88px; height: 88px;
      border-radius: 50%;
      background: rgba(0,0,0,0.55);
      border: 1.5px solid rgba(255,255,255,0.7);
      color: #fff;
      font-size: 1.8rem;
      line-height: 1;
      cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      padding-left: 6px; /* optically center the ▶ glyph */
      transition: background 0.15s, transform 0.15s;
    }
    .intro-play-btn:hover { background: rgba(0,0,0,0.75); transform: translate(-50%, -50%) scale(1.05); }

    /* Close button */
    .intro-close {
      position: absolute;
      top: 20px; right: 24px;
      z-index: 20;
      background: none;
      border: none;
      color: rgba(255,255,255,0.5);
      font-family: inherit;
      font-size: 2rem;
      line-height: 1;
      cursor: pointer;
      padding: 8px 12px;
      letter-spacing: 0;
      transition: color 0.15s;
    }
    .intro-close:hover { color: #fff; }


    /* ── CROSS-LECTURE SEARCH ──────────────────────────────────────── */

    /* Summary bar — sits between themebar and grid */
    .search-summary {
      display: none;
      align-items: center;
      gap: 10px;
      padding: 0 24px;
      height: 38px;
      border-bottom: 1px solid var(--light);
      font-size: 0.80rem;
      color: var(--mid);
      letter-spacing: 0.04em;
      overflow-x: auto;
      white-space: nowrap;
      background: var(--xlight);
    }
    .search-summary.visible { display: flex; }
    .search-summary strong { color: var(--black); }
    .summary-sep { color: var(--light); margin: 0 2px; }
    .summary-label { flex-shrink: 0; }

    /* Conference hit pills */
    .summary-conf {
      flex-shrink: 0;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px 8px 2px 7px;
      border: 1px solid var(--black);
      background: var(--white);
      border-radius: 2px;
      font-size: 0.76rem;
      transition: all 0.12s;
      font-family: inherit;
    }
    .summary-conf:hover { background: var(--black); color: var(--white); }
    .summary-conf:hover .conf-n  { color: var(--white); }
    .summary-conf:hover .conf-lbl { color: rgba(255,255,255,0.65); }
    .summary-conf:hover .conf-arrow { color: var(--white); }
    .summary-conf .conf-n  { font-weight: 600; color: var(--black); }
    .summary-conf .conf-lbl { color: var(--mid); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--light); }
    .summary-conf .conf-arrow { font-size: 0.70rem; color: var(--light); margin-left: 1px; }

    /* Clear button */
    .summary-clear {
      margin-left: auto;
      flex-shrink: 0;
      cursor: pointer;
      font-size: 0.78rem;
      color: var(--mid);
      background: none;
      border: none;
      font-family: inherit;
      letter-spacing: 0.08em;
      padding: 2px 4px;
      transition: color 0.12s;
    }
    .summary-clear:hover { color: var(--black); }

    /* Search-clear × inside input */
    .f-search { position: relative; }
    #search-clear {
      position: absolute;
      right: 12px; top: 50%;
      transform: translateY(-50%);
      cursor: pointer;
      color: var(--mid);
      font-size: 1.2rem;
      line-height: 1;
      display: none;
      background: none;
      border: none;
      padding: 0;
      transition: color 0.12s;
    }
    #search-clear.visible { display: block; }
    #search-clear:hover { color: var(--black); }
    #search { padding-right: 32px; }  /* make room for clear button */

    /* Live search suggestions — anchored to .f-search (position:relative above) */
    .search-suggest {
      position: absolute;
      top: 100%; left: 0; right: 0;
      background: var(--white);
      border: 1px solid var(--black);
      border-top: none;
      z-index: 500;
      max-height: 320px;
      overflow-y: auto;
      display: none;
      scrollbar-width: thin;
      scrollbar-color: var(--light) transparent;
    }
    .search-suggest.visible { display: block; }
    .suggest-item {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 12px;
      padding: 9px 18px;
      font-size: 0.85rem;
      color: var(--black);
      cursor: pointer;
      border-bottom: 1px solid var(--xlight);
      white-space: nowrap;
      overflow: hidden;
    }
    .suggest-item:last-child { border-bottom: none; }
    .suggest-item:hover, .suggest-item.suggest-active { background: var(--xlight); }
    .suggest-title { overflow: hidden; text-overflow: ellipsis; }
    .suggest-title mark { background: none; font-weight: 700; color: inherit; }
    .suggest-cat {
      font-size: 0.72rem;
      color: var(--light);
      flex-shrink: 0;
    }

    /* Snippet shown under each card when search is active */
    .card-snippet {
      display: none;
      padding: 7px 0 4px;
      font-size: 0.78rem;
      line-height: 1.45;
      color: var(--mid);
      border-top: 1px solid var(--xlight);
      font-style: italic;
    }
    .card-snippet mark {
      background: rgba(0,0,0,0.07);
      color: var(--black);
      font-style: normal;
      font-weight: 600;
      border-radius: 1px;
      padding: 0 1px;
    }
    body.is-searching .card-snippet { display: block; }

    /* Faint badge on snippet when match is via synonym */
    .snippet-syn-badge {
      display: inline-block;
      margin-left: 6px;
      font-size: 0.68rem;
      letter-spacing: 0.05em;
      color: var(--light);
      font-style: normal;
    }

    /* Synonym note appended to summary bar */
    .summary-syn-note {
      font-size: 0.72rem;
      color: var(--mid);
      letter-spacing: 0.04em;
      margin-left: 6px;
    }

    /* Empty-state: no results + suggestion pills */
    .empty {
      grid-column: 1/-1;
      padding: 72px 0 80px;
      text-align: center;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 18px;
    }
    .empty-msg {
      font-size: 1rem;
      color: var(--mid);
      letter-spacing: 0.04em;
    }
    .empty-msg strong { color: var(--black); }
    .empty-syns {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 8px;
    }
    .empty-syn {
      padding: 5px 14px;
      font-size: 0.75rem;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      border: 1px solid var(--line);
      background: none;
      cursor: pointer;
      font-family: inherit;
      color: var(--mid);
      transition: background 0.12s, color 0.12s, border-color 0.12s;
    }
    .empty-syn:hover {
      background: var(--black);
      color: var(--white);
      border-color: var(--black);
    }

    /* ── CITE MODAL ──────────────────────────────────────────────────── */
    .cite-tabs {
      display: flex;
      border-bottom: 1px solid var(--light);
      margin-bottom: 16px;
      gap: 0;
    }
    .cite-tab {
      font-family: inherit;
      font-size: 0.70rem;
      letter-spacing: 0.14em;
      text-transform: uppercase;
      padding: 7px 16px;
      border: none;
      background: none;
      cursor: pointer;
      color: var(--mid);
      border-bottom: 2px solid transparent;
      margin-bottom: -1px;
      transition: color 0.12s, border-color 0.12s;
    }
    .cite-tab.active { color: var(--black); border-bottom-color: var(--black); }
    .cite-tab:hover  { color: var(--black); }
    .cite-text {
      font-family: 'Georgia', 'Times New Roman', serif;
      font-size: 0.87rem;
      line-height: 1.75;
      color: var(--black);
      background: var(--xlight);
      padding: 16px 18px;
      white-space: pre-wrap;
      word-break: break-word;
      user-select: all;
      cursor: text;
      border: 1px solid var(--light);
    }
    .cite-copy {
      margin-top: 12px;
      font-family: inherit;
      font-size: 0.70rem;
      letter-spacing: 0.14em;
      text-transform: uppercase;
      padding: 8px 20px;
      border: 1px solid var(--black);
      background: var(--black);
      color: var(--white);
      cursor: pointer;
      transition: background 0.12s;
      display: inline-block;
    }
    .cite-copy:hover { background: #333; }
    .cite-copied {
      display: inline-block;
      font-size: 0.72rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--mid);
      margin-left: 12px;
      vertical-align: middle;
    }
    .cite-quote-block {
      font-style: italic;
      font-size: 0.84rem;
      line-height: 1.65;
      color: #555;
      border-left: 2px solid var(--light);
      padding: 8px 16px;
      margin-bottom: 18px;
    }
    .cite-snap-info {
      font-size: 0.75rem;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--mid);
      margin-bottom: 14px;
    }

  
    /* ── COLLECT BUTTON (card action row, between ref and watch) ──── */
    .card-btn-collect { color: var(--black); }
    .card-btn-collect svg { display: block; vertical-align: middle; }
    .card-btn-collect.is-collected { color: #0a0a0a; }
    /* ── MY COLLECTION BUTTON (next to search) ────────────────────── */
    .f-coll-icon-btn {
      display: flex; align-items: center; justify-content: center;
      align-self: center;
      width: 22px; height: 36px;
      margin: 0 2px 0 auto; /* auto pushes this + the search box after it flush right on their row */
      background: none;
      border: none;
      color: var(--mid);
      cursor: pointer;
      flex-shrink: 0;
      transition: color 0.15s, opacity 0.15s;
    }
    .f-coll-icon-btn:hover { opacity: 0.55; }
    .f-coll-icon-btn.active { color: var(--black); }
    /* ── ADMIN PANEL MODAL ────────────────────────────────────────── */
    .adm-modal {
      display: none; position: fixed; inset: 0; z-index: 750;
      background: rgba(10,10,10,0.82);
      align-items: flex-start; justify-content: center;
      overflow-y: auto; padding: 40px 16px;
    }
    .adm-modal.open { display: flex; }
    .adm-box {
      background: var(--white); border: 1px solid var(--black);
      width: 860px; max-width: 96vw;
      display: flex; flex-direction: column;
    }
    .adm-head {
      display: flex; align-items: center; justify-content: space-between;
      border-bottom: 1px solid var(--black);
      padding: 0 24px; height: 50px; flex-shrink: 0;
    }
    .adm-head h2 { font-size: 0.92rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; }
    .adm-x { cursor: pointer; background: none; border: none; font-size: 1.6rem; line-height: 1; color: var(--mid); padding: 0 4px; }
    .adm-x:hover { color: var(--black); }
    .adm-tabs { display: flex; border-bottom: 1px solid var(--black); flex-shrink: 0; }
    .adm-tab {
      cursor: pointer; background: none; border: none; border-right: 1px solid var(--light);
      font-family: inherit; font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase;
      padding: 0 22px; height: 38px; color: var(--mid); transition: color 0.12s;
    }
    .adm-tab:hover { color: var(--black); }
    .adm-tab.active { color: var(--black); font-weight: 700; border-bottom: 2px solid var(--black); margin-bottom: -1px; }
    .adm-panel { display: none; padding: 24px; }
    .adm-panel.active { display: block; }
    /* Entries panel */
    .adm-search { width: 100%; border: 1px solid var(--black); padding: 8px 12px; font-family: inherit; font-size: 0.95rem; margin-bottom: 14px; box-sizing: border-box; }
    .adm-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
    .adm-table th { text-align: left; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mid); border-bottom: 1px solid var(--black); padding: 6px 8px; }
    .adm-table td { padding: 7px 8px; border-bottom: 1px solid var(--light); vertical-align: top; }
    .adm-table tr:hover td { background: var(--xlight); }
    .adm-table .adm-edit-btn { cursor: pointer; background: none; border: 1px solid var(--black); font-family: inherit; font-size: 0.72rem; letter-spacing: 0.10em; text-transform: uppercase; padding: 3px 8px; }
    .adm-table .adm-edit-btn:hover { background: var(--black); color: var(--white); }
    .adm-table .adm-del-btn { cursor: pointer; background: none; border: 1px solid #c00; color: #c00; font-family: inherit; font-size: 0.72rem; letter-spacing: 0.10em; text-transform: uppercase; padding: 3px 8px; margin-left: 4px; }
    .adm-table .adm-del-btn:hover { background: #c00; color: #fff; }
    .adm-entry-count { font-size: 0.80rem; color: var(--mid); margin-bottom: 10px; letter-spacing: 0.04em; }
    /* Users panel */
    .adm-users-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-bottom: 20px; }
    .adm-users-table th { text-align: left; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mid); border-bottom: 1px solid var(--black); padding: 6px 8px; }
    .adm-users-table td { padding: 7px 8px; border-bottom: 1px solid var(--light); }
    .adm-users-table .adm-del-btn { cursor: pointer; background: none; border: 1px solid #c00; color: #c00; font-family: inherit; font-size: 0.72rem; padding: 2px 7px; }
    .adm-users-table .adm-del-btn:hover { background: #c00; color: #fff; }
    .adm-add-user { display: grid; grid-template-columns: 1fr 1fr 100px 80px; gap: 8px; align-items: end; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--light); }
    .adm-add-user label { display: block; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mid); margin-bottom: 4px; }
    .adm-add-user input, .adm-add-user select { width: 100%; border: 1px solid var(--black); padding: 7px 10px; font-family: inherit; font-size: 0.88rem; box-sizing: border-box; }
    .adm-add-user select { background: var(--white); cursor: pointer; }
    .adm-btn-primary { cursor: pointer; background: var(--black); border: 1px solid var(--black); color: var(--white); font-family: inherit; font-size: 0.80rem; letter-spacing: 0.10em; text-transform: uppercase; padding: 8px 16px; }
    .adm-btn-primary:hover { background: #333; }
    .adm-msg { font-size: 0.85rem; color: var(--mid); margin-top: 10px; min-height: 20px; }
    .adm-msg.ok { color: #070; }
    .adm-msg.err { color: #c00; }
    /* Taxonomy panel */
    .adm-theme-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
    .adm-theme-pill {
      display: inline-flex; align-items: center; gap: 6px;
      border: 1px solid var(--black); padding: 4px 10px; font-size: 0.80rem;
      letter-spacing: 0.06em; cursor: default;
    }
    .adm-theme-pill span { font-size: 0.72rem; color: var(--mid); }
    .adm-export-note { font-size: 0.88rem; line-height: 1.7; color: #444; margin-bottom: 16px; }

  
    /* ══ SCAN PAGE ══════════════════════════════════════════════════════ */
    .scan-page {
      position: fixed;
      top: 50%; left: 50%;
      transform: translate(-50%, -50%);
      z-index: 400;
      width: 90vw; max-width: 1300px;
      height: 86vh; max-height: 86vh;
      border: 1px solid var(--black);
      background: var(--white);
      display: none; flex-direction: column;
      overflow: hidden;
    }
    .scan-page.open { display: flex; }

    .scan-topbar {
      height: 52px; display: flex; align-items: center; gap: 14px;
      border-bottom: 1px solid var(--black); padding: 0 24px; flex-shrink: 0;
    }
    .scan-topbar-title {
      font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; font-size: 1.1rem;
    }
    .scan-topbar-sub {
      color: var(--mid); font-size: 0.82rem; letter-spacing: 0.06em;
    }
    .scan-conf-indicator {
      margin-left: auto; margin-right: 12px;
      display: none; align-items: center; gap: 6px;
      font-size: 0.70rem; letter-spacing: 0.10em; text-transform: uppercase;
    }
    .scan-conf-indicator.visible { display: flex; }
    .scan-conf-label { color: var(--mid); }
    .scan-conf-tag {
      font-weight: 700; color: var(--black);
      border: 1px solid var(--black); padding: 2px 8px;
    }
    .scan-close {
      cursor: pointer; background: none; border: none;
      font-size: 1.5rem; color: var(--mid); line-height: 1; padding: 0 4px;
    }
    .scan-close:hover { color: var(--black); }

    /* Inline step guide */
    .scan-steps {
      display: flex; gap: 0; border-bottom: 1px solid var(--light);
      flex-shrink: 0; overflow-x: auto;
    }
    .scan-step {
      display: flex; align-items: flex-start; gap: 10px;
      padding: 12px 20px; flex: 1; min-width: 160px;
      border-right: 1px solid var(--light);
    }
    .scan-step:last-child { border-right: none; }
    .scan-step-num {
      flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%;
      border: 1px solid var(--black); display: flex; align-items: center;
      justify-content: center; font-size: 0.66rem; font-weight: 700;
      letter-spacing: 0.04em; margin-top: 1px;
    }
    .scan-step-body { flex: 1; }
    .scan-step-label {
      font-size: 0.70rem; font-weight: 700; letter-spacing: 0.10em;
      text-transform: uppercase; margin-bottom: 2px;
    }
    .scan-step-desc {
      font-size: 0.72rem; color: var(--mid); line-height: 1.4;
    }

    .scan-url-bar {
      border-bottom: 1px solid var(--light);
      display: flex; align-items: stretch; height: 46px; flex-shrink: 0;
    }
    .scan-url-input {
      flex: 1; border: none; outline: none; padding: 0 20px;
      font-family: inherit; font-size: 0.92rem; color: var(--black);
      background: var(--xlight);
    }
    .scan-url-input::placeholder { color: var(--mid); }
    .scan-url-btn {
      padding: 0 28px; border: none; border-left: 1px solid var(--light);
      background: var(--black); color: var(--white); cursor: pointer;
      font-family: inherit; font-size: 0.78rem; letter-spacing: 0.13em;
      text-transform: uppercase; flex-shrink: 0;
      transition: background 0.12s;
    }
    .scan-url-btn:hover { background: #333; }

    .scan-body { display: flex; flex: 1; min-height: 0; overflow: hidden; }

    /* ── Left: player ── */
    .scan-left {
      flex: 0 0 62%; display: flex; flex-direction: column;
      border-right: 1px solid var(--light); min-height: 0;
    }
    .scan-player-wrap {
      flex: 1; background: #000; min-height: 0; overflow: hidden;
      display: flex; align-items: center; justify-content: center;
    }
    .scan-player-wrap iframe,
    .scan-player-wrap > div { width: 100% !important; height: 100% !important; }
    .scan-player-empty {
      color: #555; font-size: 0.82rem; letter-spacing: 0.09em;
      text-transform: uppercase; text-align: center; line-height: 2.2; padding: 40px;
    }
    .scan-ctrl {
      height: 50px; display: flex; align-items: center; gap: 14px;
      padding: 0 20px; border-top: 1px solid var(--light); flex-shrink: 0;
      background: var(--white);
    }
    .scan-ts-label { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mid); }
    .scan-ts-val {
      font-size: 1.05rem; font-variant-numeric: tabular-nums; min-width: 54px;
      font-weight: 400; color: var(--black);
    }
    .scan-ts-input {
      border: none; border-bottom: 1px solid var(--light); outline: none;
      font-family: inherit; font-size: 1rem; font-variant-numeric: tabular-nums;
      width: 68px; padding: 2px 4px; color: var(--black); background: transparent;
    }
    .scan-mark-btn {
      margin-left: auto; padding: 0 22px; height: 34px;
      background: var(--black); color: var(--white); border: none; cursor: pointer;
      font-family: inherit; font-size: 0.78rem; letter-spacing: 0.13em;
      text-transform: uppercase; transition: background 0.12s; flex-shrink: 0;
    }
    .scan-mark-btn:hover { background: #333; }
    .scan-mark-btn:disabled { background: var(--light); cursor: default; }

    /* ── Right: form + list ── */
    .scan-right {
      flex: 1; display: flex; flex-direction: column; overflow-y: auto; min-height: 0;
    }

    .scan-drop-zone {
      margin: 20px 20px 0; border: 1.5px dashed var(--light);
      padding: 28px 20px; text-align: center; cursor: pointer;
      transition: border-color 0.15s, background 0.15s; position: relative;
      flex-shrink: 0;
    }
    .scan-drop-zone:hover, .scan-drop-zone.drag-over {
      border-color: var(--black); background: var(--xlight);
    }
    .scan-drop-zone input[type=file] {
      position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
    }
    .scan-drop-label { color: var(--mid); font-size: 0.82rem; line-height: 1.8; }
    .scan-drop-label strong { color: var(--black); display: block; font-size: 0.9rem; margin-bottom: 2px; }
    .scan-drop-hint {
      display: block; margin-top: 6px; font-size: 0.72rem; letter-spacing: 0.06em;
      color: var(--light);
    }

    .scan-preview { margin: 16px 20px 0; display: none; flex-shrink: 0; }
    .scan-preview img { width: 100%; display: block; border: 1px solid var(--light); }
    .scan-preview-ts {
      font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
      color: var(--mid); display: block; margin-top: 5px;
    }

    .scan-form { padding: 14px 20px 6px; display: none; flex-shrink: 0; }
    .sf-row { display: flex; gap: 10px; }
    .sf-row .sf-field { flex: 1; }
    .sf-field { margin-bottom: 10px; }
    .sf-field label {
      display: block; font-size: 0.68rem; letter-spacing: 0.12em;
      text-transform: uppercase; color: var(--mid); margin-bottom: 3px;
    }
    .sf-field input, .sf-field textarea {
      width: 100%; border: none; border-bottom: 1px solid var(--light);
      padding: 5px 0; font-family: inherit; font-size: 0.88rem; outline: none;
      background: transparent; transition: border-color 0.12s; color: var(--black);
    }
    .sf-field input:focus, .sf-field textarea:focus { border-color: var(--black); }
    .sf-field textarea { height: 56px; resize: vertical; }
    .scan-themes-grid { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
    .scan-theme-tag {
      border: 1px solid var(--light); padding: 3px 9px; cursor: pointer;
      font-size: 0.68rem; letter-spacing: 0.09em; text-transform: uppercase;
      transition: all 0.1s; user-select: none;
    }
    .scan-theme-tag.checked { border-color: var(--black); background: var(--black); color: var(--white); }
    .scan-save-btn {
      width: 100%; height: 38px; background: var(--black); color: var(--white);
      border: none; cursor: pointer; font-family: inherit; font-size: 0.78rem;
      letter-spacing: 0.13em; text-transform: uppercase; margin-top: 10px;
      transition: background 0.12s;
    }
    .scan-save-btn:hover { background: #333; }

    .scan-entries {
      margin: 20px 20px 0; border-top: 1px solid var(--light);
      padding-top: 14px; display: none; flex-shrink: 0;
    }
    .scan-entries-hd {
      font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
      color: var(--mid); margin-bottom: 8px;
    }
    .scan-entry-row {
      display: flex; align-items: center; gap: 10px;
      padding: 7px 0; border-bottom: 1px solid var(--xlight); font-size: 0.82rem;
    }
    .scan-entry-ts { color: var(--mid); min-width: 44px; font-variant-numeric: tabular-nums; flex-shrink: 0; }
    .scan-entry-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .scan-entry-del { background: none; border: none; color: var(--light); cursor: pointer; font-size: 1rem; flex-shrink: 0; }
    .scan-entry-del:hover { color: var(--black); }

    .scan-export-wrap {
      padding: 16px 20px 24px; flex-shrink: 0; margin-top: auto;
    }
    .scan-export-btn {
      width: 100%; height: 38px; background: none; border: 1px solid var(--black);
      cursor: pointer; font-family: inherit; font-size: 0.78rem;
      letter-spacing: 0.13em; text-transform: uppercase; transition: all 0.12s;
    }
    .scan-export-btn:hover { background: var(--black); color: var(--white); }
    /* Fallback when embed is blocked (file:// origin) */
    .scan-player-fallback {
      color: #aaa; text-align: center; padding: 40px 32px;
      display: flex; flex-direction: column; align-items: center; gap: 14px;
      height: 100%; justify-content: center;
    }
    .spf-badge { font-size: 2.8rem; color: #444; line-height: 1; }
    .spf-title { font-size: 0.88rem; letter-spacing: 0.08em; color: #ccc; text-transform: uppercase; }
    .spf-body  { font-size: 0.78rem; color: #666; line-height: 1.8; }
    .spf-body code { color: #888; background: #1a1a1a; padding: 1px 5px; border-radius: 2px; }
    .spf-link  {
      display: inline-block; color: var(--white); background: #c00;
      padding: 10px 28px; text-decoration: none; font-size: 0.78rem;
      letter-spacing: 0.13em; text-transform: uppercase; margin-top: 4px;
      transition: background 0.12s;
    }
    .spf-link:hover { background: #e00; }
    .scan-export-note {
      font-size: 0.72rem; color: var(--mid); margin-top: 8px; line-height: 1.55;
      letter-spacing: 0.02em;
    }

    @media (max-width: 700px) {
      .scan-body { flex-direction: column; }
      .scan-left { flex: 0 0 50vh; border-right: none; border-bottom: 1px solid var(--light); }
      .scan-right { flex: 1; }
    }


    /* ── OVERVIEW MODAL ─────────────────────────────────────────────── */
    .overview-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      padding: 28px 24px 32px;
      gap: 28px 0;
    }
    .overview-cell {
      padding: 0 20px;
    }
    .overview-cell--brand {
      background: var(--black);
      padding: 14px 20px;
      display: flex;
      flex-direction: column;
      justify-content: center;
    }
    .overview-cell--brand .overview-brand-mark {
      font-size: 1.5rem;
      font-weight: 600;
      letter-spacing: 0.05em;
      line-height: 1;
      color: var(--bg);
      margin-bottom: 7px;
    }
    .overview-cell--brand .overview-label {
      color: rgba(255,255,255,0.55);
    }
    .overview-num {
      font-size: 2.6rem;
      font-weight: 400;
      letter-spacing: -0.02em;
      line-height: 1;
      color: var(--black);
      margin-bottom: 7px;
    }
    .overview-label {
      font-size: 0.68rem;
      letter-spacing: 0.18em;
      text-transform: uppercase;
      color: var(--black);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .overview-header {
      padding: 20px 28px 0;
      font-size: 0.7rem;
      font-weight: 600;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--mid);
      border-bottom: 1px solid var(--line);
      padding-bottom: 14px;
      margin-bottom: 4px;
    }
    .overview-brand {
      color: var(--black);
    }
    .overview-close {
      position: absolute;
      top: 14px; right: 18px;
      cursor: pointer;
      background: none;
      border: none;
      font-size: 2rem;
      line-height: 1;
      color: var(--black);
    }

    /* ── READ MODAL ──────────────────────────────────────────────────── */
    .modal-read {
      width: 90vw;
      max-width: 1300px;
      height: 86vh;
      max-height: 86vh;
      border: 1px solid var(--black);
      overflow: hidden;
      flex-direction: column;
      padding: 0;
      background: var(--black);
    }
    .modal-read.open { display: flex; }
    .read-topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 32px 0 0;
      height: 52px;
      border-bottom: 1px solid var(--black);
      flex-shrink: 0;
      background: var(--white);
    }
    .read-topbar-label {
      display: flex;
      align-items: center;
      height: 100%;
      padding: 0 24px;
      border-right: 1px solid var(--light);
      color: var(--mid);
      font-size: 1.0rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
    }
    .read-topbar-count {
      flex: 1;
      padding-left: 24px;
      font-size: 0.82rem;
      letter-spacing: 0.10em;
      text-transform: uppercase;
      color: var(--mid);
    }
    .read-filterbar {
      display: flex;
      align-items: stretch;
      height: 36px;
      border-bottom: 1px solid var(--light);
      flex-shrink: 0;
      min-width: 0;
      background: var(--white);
    }
    .read-filters {
      display: flex;
      align-items: stretch;
      flex: 1;
      overflow-x: auto;
      scrollbar-width: none;
    }
    .read-filters::-webkit-scrollbar { display: none; }
    .read-f-btn {
      cursor: pointer;
      background: none;
      border: none;
      font-family: inherit;
      font-size: 0.88rem;
      letter-spacing: 0.03em;
      color: var(--black);
      padding: 0 0 0 18px;
      display: flex;
      align-items: center;
      white-space: nowrap;
      flex-shrink: 0;
      transition: opacity 0.12s;
    }
    .read-f-btn::after { content: ","; color: var(--mid); margin-left: 1px; }
    .read-f-btn:last-child::after { content: ""; }
    .read-f-btn:first-child { padding-left: 24px; }
    .read-f-btn:hover { opacity: 0.5; }
    .read-f-btn.active { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

    .read-body {
      overflow-y: auto;
      flex: 1;
      padding: 0 0 80px;
    }
    .read-list {
      max-width: 780px;
      margin: 0 auto;
      padding: 0 40px;
    }
    .read-item {
      padding: 44px 0 40px;
      border-bottom: 1px solid rgba(255,255,255,0.08);
      cursor: pointer;
      transition: opacity 0.12s;
    }
    .read-item:hover { opacity: 0.65; }
    .read-item:last-child { border-bottom: none; }
    .read-quote-text {
      font-size: 1.22rem;
      line-height: 1.78;
      color: #ffffff;
      margin-bottom: 20px;
      letter-spacing: 0.01em;
    }
    .read-quote-text::before { content: "\201C"; }
    .read-quote-text::after  { content: "\201D"; }
    .read-attr {
      display: flex;
      align-items: baseline;
      flex-wrap: wrap;
      gap: 6px 10px;
      font-size: 0.75rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: rgba(255,255,255,0.35);
    }
    .read-attr-speaker { color: rgba(255,255,255,0.7); }
    .read-attr-sep { color: rgba(255,255,255,0.15); }
    .read-attr-link {
      color: rgba(255,255,255,0.35);
      text-decoration: none;
      border-bottom: 1px solid rgba(255,255,255,0.18);
      transition: color 0.12s, border-color 0.12s;
    }
    .read-attr-link:hover { color: #fff; border-color: rgba(255,255,255,0.7); }
    .read-empty {
      padding: 80px 40px;
      text-align: center;
      font-size: 1.0rem;
      color: rgba(255,255,255,0.3);
      letter-spacing: 0.06em;
    }

    /* ── QUICK-LOOK OVERLAY ─────────────────────────────────────────── */

    /* Backdrop: dark, scrollable — panel sits inside and can be longer than viewport */
    .ql-backdrop {
      display: none;
      position: fixed; inset: 0; z-index: 600;
      background: rgba(0,0,0,0.90);
      overflow-y: auto;
      padding: 48px 40px 80px;
    }
    .ql-backdrop.open {
      display: flex;
      justify-content: center;
      align-items: flex-start;
    }

    /* ── Panel: single column, image-first ── */
    .ql-panel {
      position: relative;
      background: #fff;
      width: 100%;
      max-width: 1000px;
      flex-shrink: 0;
    }

    /* ── Close button — top-right of panel ── */
    .ql-close {
      position: absolute; top: 12px; right: 12px; z-index: 10;
      background: rgba(0,0,0,0.52); border: none; cursor: pointer;
      color: #fff; width: 32px; height: 32px;
      font-size: 1.25rem; line-height: 32px; text-align: center;
      transition: background 0.14s;
    }
    .ql-close:hover { background: rgba(0,0,0,0.88); }

    /* ── Image — full panel width, exact screenshot proportions ── */
    .ql-left {
      position: relative;
      background: #0a0a0a;
      overflow: hidden;
      width: 100%;
      aspect-ratio: 1400 / 909;
    }
    .ql-img {
      display: block;
      width: 100%; height: 100%;
      object-fit: cover;
    }
    .ql-img-empty {
      display: none;
      position: absolute; inset: 0;
      align-items: center; justify-content: center;
      color: rgba(255,255,255,0.18); font-size: 2rem;
    }
    .ql-img-empty.visible { display: flex; }

    /* ── Nav arrows — overlaid on image sides ── */
    .ql-nav-btn {
      position: absolute;
      top: 0; bottom: 0;
      display: flex; align-items: center;
      background: none; border: none; cursor: pointer;
      color: rgba(255,255,255,0);   /* invisible until hover */
      font-size: 2rem; line-height: 1;
      padding: 0 22px;
      transition: color 0.15s, background 0.15s;
      user-select: none; z-index: 4;
    }
    .ql-nav-btn:hover {
      color: rgba(255,255,255,0.92);
      background: rgba(0,0,0,0.30);
    }
    .ql-prev { left: 0; }
    .ql-next { right: 0; }
    .ql-nav-btn.hidden { display: none; }

    /* ── Content below image ── */
    .ql-right {
      padding: 26px 36px 30px;
      display: flex;
      flex-direction: column;
      gap: 0;
      border-bottom: 1px solid var(--xlight);
    }

    .ql-meta {
      font-size: 0.68rem;
      letter-spacing: 0.15em;
      text-transform: uppercase;
      color: var(--mid);
      margin-bottom: 10px;
    }
    .ql-title {
      font-size: 1.12rem;
      font-weight: 400;
      line-height: 1.38;
      color: var(--black);
      margin-bottom: 16px;
      letter-spacing: -0.01em;
    }
    .ql-desc {
      font-size: 0.84rem;
      line-height: 1.65;
      color: var(--mid);
      margin-bottom: 22px;
    }
    .ql-quote-wrap {
      display: none;
      border-left: 2px solid var(--black);
      padding-left: 16px;
      margin-bottom: 26px;
    }
    .ql-quote-wrap.has-quote { display: block; }
    .ql-quote-mark {
      font-size: 1.8rem;
      line-height: 1;
      color: var(--black);
      display: block;
      margin-bottom: 4px;
    }
    .ql-quote-text {
      font-size: 0.88rem;
      line-height: 1.65;
      color: var(--black);
      font-style: italic;
      margin: 0;
    }


    /* ── Quote: language badge + translate links ── */
    .ql-quote-lang-row {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-top: 10px;
      flex-wrap: wrap;
    }
    .ql-lang-badge {
      font-size: 0.68rem;
      font-weight: 600;
      letter-spacing: 0.06em;
      color: var(--mid);
      border: 1px solid var(--mid);
      border-radius: 3px;
      padding: 1px 5px;
      line-height: 1.5;
      text-transform: uppercase;
    }
    .ql-translate-sep {
      font-size: 0.72rem;
      color: var(--mid);
    }
    .ql-translate-link {
      font-size: 0.72rem;
      color: var(--mid);
      text-decoration: none;
      border-bottom: 1px solid transparent;
      transition: color 0.15s, border-color 0.15s;
    }
    .ql-translate-link:hover {
      color: var(--black);
      border-color: var(--black);
    }
    /* ── Footer: watch + utility buttons ── */
    .ql-footer {
      padding-top: 20px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
    }
    .ql-footer-btns {
      display: flex; gap: 6px; flex-wrap: wrap;
    }
    .ql-footer-btn {
      padding: 5px 12px;
      font-size: 0.72rem;
      letter-spacing: 0.09em;
      text-transform: uppercase;
      border: 1px solid var(--line);
      background: none; cursor: pointer;
      font-family: inherit;
      color: var(--mid);
      transition: background 0.12s, color 0.12s, border-color 0.12s;
    }
    .ql-footer-btn:hover {
      background: var(--black); color: var(--white); border-color: var(--black);
    }
    .ql-watch-btn {
      display: inline-block;
      padding: 9px 22px;
      background: var(--black); color: var(--white);
      font-size: 0.75rem;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      text-decoration: none;
      font-family: inherit;
      transition: opacity 0.14s;
      white-space: nowrap;
    }
    .ql-watch-btn:hover { opacity: 0.75; }
    .ql-watch-btn.hidden { display: none; }

    /* ── Related entries — full panel width, below content ── */
    .ql-related-wrap {
      padding: 28px 36px 36px;
    }
    .ql-related-wrap.hidden { display: none; }
    .ql-related-label {
      font-size: 0.65rem;
      letter-spacing: 0.16em;
      text-transform: uppercase;
      color: var(--light);
      margin-bottom: 12px;
    }
    .ql-related-strip {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 8px;
    }
    .ql-rel-card {
      cursor: pointer;
      opacity: 0.65;
      transition: opacity 0.14s;
    }
    .ql-rel-card:hover { opacity: 1; }
    .ql-rel-img {
      width: 100%;
      aspect-ratio: 1400/909;
      object-fit: cover;
      display: block;
      background: var(--xlight);
    }
    .ql-rel-title {
      font-size: 0.63rem;
      line-height: 1.35;
      color: var(--black);
      margin-top: 5px;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    .ql-rel-source {
      font-size: 0.58rem;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--mid);
      margin-top: 2px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    /* ── Mobile ── */
    @media (max-width: 600px) {
      .ql-backdrop { padding: 0; }
      .ql-panel { max-width: 100vw; }
      .ql-right { padding: 18px 20px 20px; }
      .ql-related-wrap { padding: 20px 20px 28px; }
      .ql-related-strip { grid-template-columns: repeat(3, 1fr); }
    }

  

/* ── next inline <style> block from the original file ── */


  .result-count {
    display: none;
    align-items: center;
    padding: 0 24px;
    height: 34px;
    border-bottom: 1px solid var(--light);
    font-size: 0.78rem;
    color: var(--mid);
    letter-spacing: 0.05em;
  }
  .result-count.visible { display: flex; }
  .result-count strong { color: var(--black); font-weight: 400; }
  @media (max-width: 960px) { .result-count { padding: 0 18px; } }
  @media (max-width: 768px) { .result-count { padding: 0 14px; } }
  @media (max-width: 600px) { .result-count { padding: 0 10px; } }
  /* The old static, always-visible homepage video embed was removed as
     redundant now that the full-screen "Intro" overlay plays the exact
     same selector-intro.mp4 -- see _startIntro(). */


/* ── next inline <style> block from the original file ── */


  .site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    margin-top: 8px;
    border-top: 1px solid var(--light);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    color: var(--mid);
  }
  .footer-contact-btn {
    background: none; border: none; padding: 0;
    font: inherit; color: var(--mid); letter-spacing: inherit;
    cursor: pointer; transition: color 0.15s;
  }
  .footer-contact-btn:hover { color: var(--black); }
  @media (max-width: 960px) { .site-footer { padding: 14px 18px; } }
  @media (max-width: 768px) { .site-footer { padding: 12px 14px; } }
  @media (max-width: 600px) { .site-footer { padding: 10px 10px; } }


/* ── next inline <style> block from the original file ── */


  .contact-form { display: flex; flex-direction: column; gap: 18px; max-width: 480px; }
  .contact-field { display: flex; flex-direction: column; gap: 6px; }
  .contact-field label { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mid); }
  .contact-field input, .contact-field textarea {
    font: inherit; font-size: 0.95rem; padding: 8px 0;
    border: none; border-bottom: 1px solid var(--light);
    background: transparent; color: var(--black);
    outline: none; resize: vertical;
  }
  .contact-field input:focus, .contact-field textarea:focus { border-bottom-color: var(--black); }
  .contact-submit {
    align-self: flex-start;
    margin-top: 4px;
    padding: 10px 26px;
    background: var(--black); color: var(--white);
    border: none; font: inherit; font-size: 0.75rem;
    letter-spacing: 0.1em; text-transform: uppercase;
    cursor: pointer; transition: opacity 0.14s;
  }
  .contact-submit:hover { opacity: 0.8; }
  .contact-note { font-size: 0.8rem; color: var(--mid); margin: -6px 0 4px; }
