/* DM Sans (SIL OFL 1.1), self-hosted from @fontsource-variable/dm-sans 5.2.8 */
@font-face { font-family: 'DM Sans'; font-style: normal; font-display: swap; font-weight: 100 1000; src: url(fonts/dm-sans-latin-ext-wght-normal.woff2) format('woff2-variations'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'DM Sans'; font-style: normal; font-display: swap; font-weight: 100 1000; src: url(fonts/dm-sans-latin-wght-normal.woff2) format('woff2-variations'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

    /* ════════════════════════════════════════════════════════════════
       DESIGN TOKENS - Sqilline Color Palette 2025
       ════════════════════════════════════════════════════════════════ */
    :root {
      --c-light-gray: #F0F0F0;
      --c-electric-blue: #1767F5;
      --c-light-blue: #D0DCFF;
      --c-sky-blue: #85ADFF;
      --c-yellow: #FFD757;
      --c-orange: #FF9700;
      --c-white: #FFFFFF;
      --c-cool-gray: #E7E6E2;
      --c-warm-gray: #C6C5C1;
      --c-gray: #777C7F;
      --c-slate: #3D484A;
      --c-ink: #282828;

      --c-blue-hover: #0D50D4;
      --c-negative: #C0392B;
      --c-negative-soft: #FCEBEB;

      --r-sm: 7px;
      --r: 12px;
      --border: 1px solid rgba(0, 0, 0, 0.10);
      --shadow-card: 0 1px 3px rgba(40, 40, 40, 0.05);
      --shadow-pop: 0 8px 28px rgba(40, 40, 40, 0.14);
      --font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    }

    * { box-sizing: border-box; margin: 0; padding: 0; }

    body {
      min-height: 100vh;
      background: var(--c-light-gray);
      font-family: var(--font-family);
      font-size: 15px;
      color: var(--c-ink);
      display: flex;
      flex-direction: column;
      -webkit-font-smoothing: antialiased;
    }

    /* ── Header ───────────────────────────────────────────────────── */
    header {
      height: 56px;
      flex-shrink: 0;
      background: var(--c-white);
      border-bottom: var(--border);
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 0 24px;
    }
    header .svg { height: 26px; width: auto; display: block; }
    header .logo-fallback {
      font-size: 23px;
      font-weight: 700;
      letter-spacing: -0.6px;
      color: var(--c-electric-blue);
      line-height: 1;
    }
    /* Danny DataStruct product lockup - Brand ID 2025, Sqilline Products. */
    header .product {
      display: flex;
      flex-direction: column;
      line-height: 1.05;
      padding-left: 14px;
      border-left: 1px solid rgba(0, 0, 0, 0.12);
      white-space: nowrap;
    }
    header .product-name { font-size: 15px; font-weight: 700; letter-spacing: -0.2px; color: var(--c-electric-blue); }
    header .product-sub { font-size: 15px; font-weight: 400; letter-spacing: -0.2px; color: var(--c-sky-blue); }
    header .slogan {
      margin-left: auto;
      font-size: 10px;
      font-weight: 500;
      letter-spacing: 0.12em;
      color: var(--c-slate);
      white-space: nowrap;
    }

    /* ── Page shell - centres one big panel ───────────────────────── */
    .background-container {
      flex: 1;
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 40px 32px;
    }
    .content-container {
      width: 100%;
      max-width: 940px;
      display: flex;
      flex-direction: column;
      gap: 14px;
      transition: opacity .2s;
    }
    /* JS: added to .content-container while a download is in flight */
    .content-container.downloading { opacity: 0.45; pointer-events: none; }

    /* ── Page-level message / error ────────────────────────────────
       JS toggles .error and sets textContent */
    .message {
      width: 100%;
      max-height: 6em;
      overflow: auto;
      border-radius: var(--r-sm);
      padding: 11px 14px 11px 13px;
      font-size: 13.5px;
      line-height: 1.5;
      display: none;
    }
    .message.error {
      display: block;
      background: var(--c-negative-soft);
      border: 1px solid rgba(192, 57, 43, 0.28);
      border-left: 3px solid var(--c-negative);
      color: var(--c-negative);
    }

    /* ── The panel ────────────────────────────────────────────────── */
    .app-container {
      position: relative;
      width: 100%;
      min-height: 460px;
      background: var(--c-white);
      border: var(--border);
      border-radius: var(--r);
      box-shadow: var(--shadow-card);
      overflow: hidden;
      display: grid;
      grid-template-columns: 0.86fr 1fr;
    }

    /* Left pane - what this is */
    .pane-info {
      background: #FAFAFA;
      border-right: var(--border);
      padding: 38px 34px;
      display: flex;
      flex-direction: column;
      gap: 18px;
    }
    .content-title {
      font-size: 27px;
      font-weight: 600;
      letter-spacing: -0.5px;
      line-height: 1.22;
      color: var(--c-ink);
    }
    .hero-sub { font-size: 14px; line-height: 1.65; color: var(--c-gray); }

    .facts-list { display: flex; flex-direction: column; gap: 11px; margin-top: 2px; }
    .fact-row {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      font-size: 13px;
      line-height: 1.5;
      color: var(--c-slate);
    }
    .fact-row i { font-size: 17px; color: var(--c-electric-blue); flex-shrink: 0; margin-top: 1px; }

    .app-version-info {
      margin-top: auto;
      padding-top: 18px;
      border-top: var(--border);
      font-size: 12px;
      letter-spacing: 0.2px;
      color: var(--c-gray);
    }
    .app-version-info:empty { display: none; }

    /* Right pane - the download controls */
    /* Top-aligned, and pushed down by the height of .content-title plus the
       pane gap, so the label starts on the same line as the description
       paragraph opposite it instead of floating in the vertical centre.
       The offset is the title's own metrics: 2 lines at 27px / 1.22. */
    .pane-download {
      padding: calc(38px + 2 * 27px * 1.22 + 18px) 34px 38px;
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      gap: 16px;
    }
    .pane-label {
      font-size: 11px;
      font-weight: 600;
      letter-spacing: 0.09em;
      color: var(--c-slate);
    }

    /* ── Download forms - one OS per row, roomier than the narrow layout ── */
    .os-list { display: flex; flex-direction: column; gap: 12px; }
    .download-form {
      width: 100%;
      border: var(--border);
      border-radius: var(--r-sm);
      padding: 14px 16px;
      transition: background .15s, border-color .15s;
    }
    .download-form:hover { background: #FAFBFF; border-color: rgba(23, 103, 245, 0.35); }
    .control { display: flex; align-items: center; gap: 13px; }
    .control .os-icon {
      width: 26px;
      height: 26px;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .control .os-icon svg { width: 100%; height: 100%; display: block; }
    .control .os-text { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
    .control .label { font-size: 14.5px; font-weight: 500; color: var(--c-ink); }
    .control .os-note { font-size: 12px; color: var(--c-gray); }

    .download {
      flex-shrink: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      height: 40px;
      padding: 0 18px;
      font-family: inherit;
      font-size: 14px;
      font-weight: 500;
      color: var(--c-white);
      background: var(--c-electric-blue);
      border: 1px solid var(--c-electric-blue);
      border-radius: var(--r-sm);
      cursor: pointer;
      transition: background .15s, border-color .15s, box-shadow .15s;
    }
    .download:hover { background: var(--c-blue-hover); border-color: var(--c-blue-hover); }
    .download:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(23, 103, 245, 0.3); }

    /* ── OS detection ─────────────────────────────────────────────
       The script adds .os-windows or .os-mac to .desktop, which collapses
       the other platform behind a text link. Rows keep their normal size -
       only one of them is on screen at a time. Clicking the link adds
       .show-other and brings the other installer back.

       If the platform cannot be determined, no class is added and both
       rows show with equal weight, exactly as before. */
    .desktop.os-windows .download-form.mac,
    .desktop.os-mac .download-form.windows { display: none; }
    .desktop.os-windows.show-other .download-form.mac,
    .desktop.os-mac.show-other .download-form.windows { display: block; }

    .other-os-toggle {
      display: none;
      align-self: flex-start;
      align-items: center;
      gap: 6px;
      margin-top: 2px;
      padding: 1px 2px;
      font-family: inherit;
      font-size: 13px;
      font-weight: 400;
      color: var(--c-electric-blue);
      background: none;
      border: none;
      border-radius: 3px;
      cursor: pointer;
    }
    .other-os-toggle i { font-size: 16px; }
    .other-os-toggle span { text-decoration: underline; text-decoration-color: rgba(23, 103, 245, 0.35); text-underline-offset: 2px; }
    .other-os-toggle:hover span { text-decoration-color: var(--c-electric-blue); }
    .other-os-toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(23, 103, 245, 0.3); }
    .desktop.os-windows .other-os-toggle,
    .desktop.os-mac .other-os-toggle { display: inline-flex; }
    /* Must stay after the two rules above - hides the link once used. */
    .desktop.show-other .other-os-toggle { display: none; }

    .other-os-toggle .alt-label { display: none; }
    .desktop.os-windows .other-os-toggle .alt-mac { display: inline; }
    .desktop.os-mac .other-os-toggle .alt-windows { display: inline; }

    /* ── Instructions link - inline in the copy, no button chrome ──
       Stays a <button> so the existing JS click listener is untouched. */
    .pane-note { font-size: 13px; line-height: 1.65; color: var(--c-gray); }
    .instructions {
      font-family: inherit;
      font-size: inherit;
      font-weight: 400;
      color: var(--c-electric-blue);
      background: none;
      border: none;
      padding: 0;
      cursor: pointer;
      text-decoration: underline;
      text-decoration-color: rgba(23, 103, 245, 0.35);
      text-underline-offset: 2px;
    }
    .instructions:hover { text-decoration-color: var(--c-electric-blue); }
    .instructions:focus-visible { outline: none; border-radius: 3px; box-shadow: 0 0 0 3px rgba(23, 103, 245, 0.3); }

    /* ── Activity indicator ───────────────────────────────────────
       JS adds .activity-indicator to the .app-container */
    .loader {
      position: absolute;
      inset: 0;
      display: none;
      place-items: center;
      border-radius: var(--r);
      background: rgba(255, 255, 255, 0.72);
      backdrop-filter: blur(1px);
      z-index: 3;
    }
    .loader::after {
      content: "";
      width: 36px;
      height: 36px;
      border-radius: 50%;
      border: 3px solid var(--c-light-blue);
      border-top-color: var(--c-electric-blue);
      animation: spin .8s linear infinite;
    }
    .app-container.activity-indicator { pointer-events: none; }
    .app-container.activity-indicator .loader { display: grid; }
    @keyframes spin { to { transform: rotate(1turn); } }

    /* ── Download progress dialog ─────────────────────────────────
       JS sets style.display = 'block' / 'none' */
    .progress-container {
      display: none;
      position: fixed;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      z-index: 300;
      width: 340px;
      max-width: calc(100vw - 40px);
      padding: 22px;
      background: var(--c-white);
      border: var(--border);
      border-radius: var(--r);
      box-shadow: var(--shadow-pop);
    }
    .progress-container label {
      display: block;
      margin-bottom: 12px;
      font-size: 13px;
      font-weight: 500;
      color: var(--c-ink);
    }
    .progress-container label i { color: var(--c-electric-blue); margin-right: 6px; }
    progress#download-progress {
      -webkit-appearance: none;
      appearance: none;
      display: block;
      width: 100%;
      height: 8px;
      border: none;
      background: var(--c-light-gray);
      border-radius: 99px;
      overflow: hidden;
    }
    progress#download-progress::-webkit-progress-bar { background: var(--c-light-gray); border-radius: 99px; }
    progress#download-progress::-webkit-progress-value { background: var(--c-electric-blue); border-radius: 99px; transition: width .2s; }
    progress#download-progress::-moz-progress-bar { background: var(--c-electric-blue); border-radius: 99px; }

    /* ── Footer ───────────────────────────────────────────────────── */
    footer {
      flex-shrink: 0;
      padding: 0 24px 24px;
      text-align: center;
      font-size: 12px;
      color: var(--c-slate);
      display: flex;
      flex-direction: column;
      gap: 4px;
      align-items: center;
    }
    footer a { color: var(--c-electric-blue); text-decoration: none; font-weight: 500; }
    footer a:hover { text-decoration: underline; }

    /* ── Responsive - collapse the two panes into one column ──────── */
    @media (max-width: 820px) {
      .background-container { align-items: flex-start; padding: 28px 20px; }
      .app-container { grid-template-columns: 1fr; min-height: 0; }
      .pane-info {
        border-right: none;
        border-bottom: var(--border);
        padding: 26px 22px;
      }
      /* Stacked - the panes are no longer side by side, so drop the offset. */
      .pane-download { padding: 26px 22px; }
      .content-title { font-size: 23px; }
      .app-version-info { margin-top: 6px; }
      header .slogan { display: none; }
    }
    @media (max-width: 520px) {
      .control { flex-wrap: wrap; }
      .download { width: 100%; margin-top: 6px; }
    }
    /* ════════════════════════════════════════════════════════════════
       v4 - Upload anonymised files to Danny
       ════════════════════════════════════════════════════════════════ */
    .upload { min-height: 0; scroll-margin-top: 20px; }
    .upload .up-teaser { display: none; }
    .upload.collapsed { display: block; }
    .upload.collapsed .up-teaser { display: flex; }
    .upload.collapsed .pane-info, .upload.collapsed .pane-upload { display: none; }
    .up-teaser { align-items: center; gap: 14px; padding: 16px 20px 16px 22px; }
    .up-teaser .up-ic { width: 38px; height: 38px; border-radius: 9px; background: #EAF3DE; color: #2D8A4E; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
    .up-teaser-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
    .up-teaser-text .t { font-size: 14.5px; font-weight: 500; color: var(--c-ink); }
    .up-teaser-text .d { font-size: 12.5px; color: var(--c-gray); }
    .download.secondary { background: var(--c-white); color: var(--c-electric-blue); border-color: rgba(23, 103, 245, 0.45); }
    .download.secondary:hover { background: #F3F7FF; border-color: var(--c-electric-blue); }
    .download.wide { width: 100%; height: 44px; }
    .download:disabled { opacity: .45; cursor: not-allowed; }
    .download:disabled:hover { background: var(--c-electric-blue); border-color: var(--c-electric-blue); }
    .upload .content-title { font-size: 24px; }
    .up-close { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 7px; border: none; background: none; color: var(--c-gray); cursor: pointer; font-size: 17px; display: flex; align-items: center; justify-content: center; z-index: 2; }
    .upload.collapsed .up-close { display: none; }
    .up-close:hover { background: var(--c-light-gray); color: var(--c-ink); }
    .up-back { margin-top: auto; padding-top: 18px; border-top: var(--border); font-size: 12.5px; color: var(--c-gray); line-height: 1.5; }
    .up-back a { color: var(--c-electric-blue); }

    .pane-upload { padding: calc(38px + 2 * 24px * 1.22 + 18px) 34px 34px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
    .pane-upload.signed-in { padding-top: 34px; }
    .up-form { display: flex; flex-direction: column; gap: 12px; }
    .up-field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 500; color: var(--c-slate); }
    .up-field input { height: 42px; border: 1px solid rgba(0, 0, 0, 0.18); border-radius: var(--r-sm); padding: 0 13px; font-family: inherit; font-size: 14px; color: var(--c-ink); }
    .up-field input:focus { outline: none; border-color: var(--c-electric-blue); box-shadow: 0 0 0 3px rgba(23, 103, 245, 0.15); }
    .up-field input.violated { border-color: var(--c-negative); }
    .up-err { font-size: 12.5px; color: var(--c-negative); min-height: 0; }
    .up-err:empty { display: none; }
    .up-demo { color: #A9ADB0; font-size: 11.5px; }
    .up-demo-row { text-align: right; margin-top: -8px; }
    .up-link { background: none; border: none; padding: 0; font-family: inherit; font-size: 12.5px; color: var(--c-electric-blue); cursor: pointer; text-decoration: underline; text-decoration-color: rgba(23, 103, 245, 0.35); text-underline-offset: 2px; white-space: nowrap; }
    .up-link.up-demo { color: #A9ADB0; text-decoration-color: rgba(0,0,0,.15); }
    .up-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; display: inline-block; animation: spin .8s linear infinite; }
    .up-spin.dark { width: 11px; height: 11px; border-color: #D9D9D9; border-top-color: var(--c-gray); }

    .up-who { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--c-gray); padding-bottom: 12px; border-bottom: var(--border); }
    .up-who span { display: inline-flex; align-items: center; gap: 5px; }
    .up-who b { color: var(--c-ink); font-weight: 500; }
    .up-who i { font-size: 15px; color: #9AA0A3; }
    .up-who .up-link { margin-left: auto; }
    .up-warn { display: flex; gap: 10px; background: #FFF4E5; border: 1px solid #F5C77E; border-radius: var(--r-sm); padding: 11px 13px; font-size: 13px; line-height: 1.5; color: #6B4500; }
    .up-warn i { font-size: 18px; color: #C77700; flex-shrink: 0; margin-top: 1px; }
    .up-drop { border: 1.5px dashed var(--c-sky-blue); border-radius: var(--r-sm); background: #F3F7FF; padding: 20px 14px; text-align: center; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13.5px; color: var(--c-slate); transition: background .15s, border-color .15s; }
    .up-drop:hover, .up-drop.over { background: var(--c-light-blue); border-color: var(--c-electric-blue); }
    .up-drop > i { font-size: 24px; color: var(--c-electric-blue); }
    .up-drop b { color: var(--c-electric-blue); font-weight: 600; }
    .up-drop small { font-size: 11.5px; color: #6F8FD6; }
    .up-drop.compact { flex-direction: row; justify-content: center; gap: 8px; padding: 10px 14px; }
    .up-drop.compact > i { font-size: 19px; }
    .up-drop.compact small { display: none; }
    .up-list { display: flex; flex-direction: column; gap: 7px; }
    .up-row { border: var(--border); border-radius: var(--r-sm); padding: 9px 11px; }
    .up-row.blocked { background: #FFFAFA; border-color: rgba(192, 57, 43, 0.25); }
    .up-main { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
    .up-fi { font-size: 16px; color: #9AA0A3; flex-shrink: 0; }
    .up-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .up-size { font-size: 11.5px; color: #A9ADB0; flex-shrink: 0; }
    .up-x { background: none; border: none; color: #A9ADB0; cursor: pointer; font-size: 15px; padding: 2px; display: flex; flex-shrink: 0; }
    .up-x:hover { color: var(--c-negative); }
    .up-status { display: flex; align-items: center; gap: 10px; margin: 6px 0 0 24px; }
    .up-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 500; white-space: nowrap; }
    .up-badge i { font-size: 13px; }
    .up-badge.ok { background: #EAF3DE; color: #27500A; }
    .up-badge.bad { background: var(--c-negative-soft); color: #A32D2D; }
    .up-badge.wait { background: var(--c-light-gray); color: var(--c-gray); }
    .up-sub { font-size: 12px; line-height: 1.45; color: var(--c-gray); margin: 5px 0 0 24px; }
    .up-find { margin: 7px 0 0 24px; padding-top: 7px; border-top: 1px dashed rgba(0, 0, 0, 0.12); font-size: 12px; }
    .up-find > div { display: flex; gap: 8px; padding: 2px 0; align-items: baseline; }
    .up-find .k { width: 104px; flex-shrink: 0; color: var(--c-ink); }
    .up-find .c { width: 20px; flex-shrink: 0; font-weight: 600; color: #A32D2D; }
    .up-find .e { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c-gray); font-family: ui-monospace, Menlo, monospace; font-size: 11px; }
    .up-find .l { color: #A9ADB0; font-size: 11px; white-space: nowrap; }
    .up-find p { font-size: 11px; color: #A9ADB0; margin-top: 4px; }
    .up-summary { font-size: 12.5px; color: var(--c-gray); margin-top: -4px; }
    .up-summary .bad { color: #A32D2D; }
    .up-confirm { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border: var(--border); border-radius: var(--r-sm); background: #FAFAFA; font-size: 12.5px; line-height: 1.5; color: var(--c-slate); cursor: pointer; }
    .up-confirm input { width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; accent-color: var(--c-electric-blue); cursor: pointer; }
    .up-confirm.disabled { opacity: .5; cursor: not-allowed; }
    .up-prog-list { display: flex; flex-direction: column; gap: 12px; }
    .up-prog-top { display: flex; gap: 10px; font-size: 13px; margin-bottom: 6px; }
    .up-pct { color: var(--c-gray); font-size: 12px; }
    .up-bar { height: 7px; background: var(--c-light-gray); border-radius: 99px; overflow: hidden; }
    .up-bar div { height: 100%; width: 0; background: var(--c-electric-blue); border-radius: 99px; transition: width .14s; }
    .up-done { text-align: center; padding: 6px 0 2px; }
    .up-done-ic { width: 52px; height: 52px; border-radius: 50%; background: #EAF3DE; color: #2D8A4E; font-size: 28px; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; }
    .up-done h3 { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
    .up-done p { font-size: 13px; color: var(--c-gray); line-height: 1.5; }
    .up-res { border: var(--border); border-radius: var(--r-sm); padding: 6px 12px; }
    .up-res > div { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 5px 0; }
    .up-res > div + div { border-top: 1px solid rgba(0, 0, 0, 0.06); }
    .up-res i { font-size: 15px; flex-shrink: 0; }
    .up-res i.ok { color: #2D8A4E; } .up-res i.bad { color: #A32D2D; }
    .up-why { font-size: 12px; color: #A32D2D; white-space: nowrap; }
    @media (max-width: 820px) {
      .pane-upload, .pane-upload.signed-in { padding: 26px 22px; }
      .up-teaser { flex-wrap: wrap; }
    }

    /* ════════════════════════════════════════════════════════════════
       UPLOAD SITE - shell (own layout; not the download page two-pane panel)
       ════════════════════════════════════════════════════════════════ */
    header nav { display: flex; gap: 4px; margin-left: 26px; }
    .nav-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: var(--r-sm); border: none; background: none; font-family: inherit; font-size: 14px; color: var(--c-gray); cursor: pointer; }
    .nav-btn i { font-size: 17px; }
    .nav-btn:hover { background: var(--c-light-gray); color: var(--c-ink); }
    .nav-btn.active { background: var(--c-light-blue); color: var(--c-electric-blue); font-weight: 500; }
    .hdr-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
    .hdr-link { font-size: 13px; color: var(--c-electric-blue); text-decoration: none; }
    .hdr-link:hover { text-decoration: underline; }
    .hdr-hosp { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--c-slate); }
    .hdr-hosp i { font-size: 16px; color: #9AA0A3; }
    .avatar { width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--c-electric-blue); color: #fff; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
    .menu-wrap { position: relative; }
    .menu { display: none; position: absolute; right: 0; top: 42px; width: 250px; background: #fff; border: var(--border); border-radius: 10px; box-shadow: var(--shadow-pop); z-index: 50; padding: 6px 0; }
    .menu-wrap.open .menu { display: block; }
    .menu-head { padding: 9px 14px 11px; border-bottom: var(--border); margin-bottom: 4px; display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--c-gray); }
    .menu-head b { font-size: 13.5px; color: var(--c-ink); font-weight: 600; }
    .menu-sess { font-size: 11px; color: #A9ADB0; margin-top: 3px; }
    .menu button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 14px; border: none; background: none; font-family: inherit; font-size: 13.5px; color: var(--c-ink); cursor: pointer; text-align: left; }
    .menu button:hover { background: var(--c-light-gray); }
    .menu button i { font-size: 16px; color: var(--c-gray); }
    .menu button.demo { font-size: 12px; color: #A9ADB0; border-top: var(--border); margin-top: 4px; }

    main.shell { flex: 1; width: 100%; display: flex; justify-content: center; align-items: flex-start; padding: 40px 24px; }
    body:not(.signed-in) main.shell { align-items: center; }
    #view { width: 100%; display: flex; justify-content: center; }

    .btn-primary, .btn-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 42px; padding: 0 18px; border-radius: var(--r-sm); font-family: inherit; font-size: 14px; font-weight: 500; cursor: pointer; transition: background .15s, border-color .15s; white-space: nowrap; }
    .btn-primary { background: var(--c-electric-blue); border: 1px solid var(--c-electric-blue); color: #fff; }
    .btn-primary:hover { background: var(--c-blue-hover); border-color: var(--c-blue-hover); }
    .btn-primary:disabled { opacity: .45; cursor: not-allowed; background: var(--c-electric-blue); }
    .btn-secondary { background: #fff; border: 1px solid rgba(0,0,0,.18); color: var(--c-ink); }
    .btn-secondary:hover { background: var(--c-light-gray); }
    .btn-primary i, .btn-secondary i { font-size: 16px; }
    .wide { width: 100%; }

    /* Sign in */
    .auth-card { width: 100%; max-width: 420px; background: #fff; border: var(--border); border-radius: var(--r); box-shadow: var(--shadow-card); padding: 34px 34px 28px; display: flex; flex-direction: column; gap: 16px; }
    .auth-card h1 { font-size: 23px; font-weight: 600; letter-spacing: -0.4px; }
    .auth-sub { font-size: 13.5px; line-height: 1.55; color: var(--c-gray); margin-top: -6px; }
    .auth-ic { width: 48px; height: 48px; border-radius: 50%; background: var(--c-light-blue); color: var(--c-electric-blue); display: flex; align-items: center; justify-content: center; font-size: 24px; }
    .auth-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; }
    .chk { display: inline-flex; align-items: center; gap: 7px; color: var(--c-slate); cursor: pointer; }
    .chk input { width: 15px; height: 15px; accent-color: var(--c-electric-blue); }
    .pw-wrap { position: relative; display: block; }
    .pw-wrap input { width: 100%; padding-right: 42px; }
    .pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: none; background: none; color: var(--c-gray); cursor: pointer; font-size: 17px; padding: 6px; display: flex; }
    .auth-foot { font-size: 12.5px; color: var(--c-gray); line-height: 1.5; padding-top: 14px; border-top: var(--border); }
    .auth-foot a { color: var(--c-electric-blue); text-decoration: none; }
    .auth-demo { font-size: 11.5px; color: #A9ADB0; margin-top: -8px; }

    /* Cards */
    .card { width: 100%; max-width: 980px; background: #fff; border: var(--border); border-radius: var(--r); box-shadow: var(--shadow-card); overflow: hidden; }
    .card.narrow { max-width: 720px; }
    .card-head { padding: 24px 30px 18px; border-bottom: var(--border); }
    .card-head.row { display: flex; align-items: flex-start; gap: 20px; }
    .card-head.row > div { flex: 1; }
    .card-head h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.4px; margin-bottom: 5px; }
    .card-head p { font-size: 13.5px; color: var(--c-gray); line-height: 1.5; }
    .card-head b { color: var(--c-ink); font-weight: 500; }
    .card-body { padding: 22px 30px 28px; display: flex; flex-direction: column; gap: 14px; }

    /* Your uploads */
    .hist-tools { display: flex; align-items: center; gap: 12px; padding: 14px 30px; }
    .seg { display: inline-flex; background: var(--c-light-gray); border-radius: 8px; padding: 3px; }
    .seg button { border: none; background: none; font-family: inherit; font-size: 13px; padding: 6px 12px; border-radius: 6px; color: var(--c-gray); cursor: pointer; }
    .seg button.on { background: #fff; color: var(--c-ink); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
    .hist-search { margin-left: auto; height: 34px; width: 240px; border: 1px solid rgba(0,0,0,.18); border-radius: var(--r-sm); padding: 0 11px; font-family: inherit; font-size: 13px; }
    .hist-search:focus { outline: none; border-color: var(--c-electric-blue); }
    .tbl-wrap { padding: 0 30px 26px; }
    table.hist { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13.5px; }
    table.hist th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--c-gray); padding: 9px 10px; border-bottom: var(--border); }
    table.hist td { padding: 11px 10px; border-bottom: 1px solid rgba(0,0,0,.06); vertical-align: top; }
    table.hist .num { text-align: right; }
    table.hist .muted { color: var(--c-gray); font-size: 12.5px; }
    table.hist .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    table.hist .empty { text-align: center; color: var(--c-gray); padding: 30px; }
    .you { font-size: 10.5px; background: var(--c-light-blue); color: var(--c-electric-blue); border-radius: 10px; padding: 1px 6px; margin-left: 3px; }
    .st { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 3px 9px; border-radius: 20px; }
    .st i { font-size: 13px; }
    .st-ok { background: #EAF3DE; color: #27500A; }
    .st-proc { background: #E8EEF9; color: #1255c7; }
    .st-bad { background: var(--c-negative-soft); color: #A32D2D; }
    .st-note { font-size: 11.5px; color: var(--c-gray); margin-top: 3px; }

    /* Change password dialog */
    .modal-bg { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.28); z-index: 100; align-items: center; justify-content: center; padding: 20px; }
    .modal-bg.open { display: flex; }
    .modal { width: 420px; max-width: 100%; background: #fff; border-radius: var(--r); box-shadow: var(--shadow-pop); }
    .modal-h { padding: 18px 22px 0; font-size: 17px; font-weight: 600; }
    .modal-b { padding: 16px 22px; display: flex; flex-direction: column; gap: 12px; }
    .modal-f { padding: 14px 22px 20px; display: flex; justify-content: flex-end; gap: 8px; }
    .modal-f button { height: 38px; }
    .pw-rules { list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--c-gray); }
    .pw-rules li { display: flex; align-items: center; gap: 6px; }
    .pw-rules li.ok { color: #27500A; }
    .pw-rules i { font-size: 14px; }

    .toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: all .2s; background: var(--c-ink); color: #fff; font-size: 13.5px; padding: 11px 16px; border-radius: 9px; display: flex; gap: 8px; align-items: center; z-index: 200; }
    .toast.show { opacity: 1; transform: translate(-50%, 0); }
    .toast i { color: #7BD08F; font-size: 17px; }
    footer .sep { color: #B5B5B5; margin: 0 6px; }

    @media (max-width: 760px) {
      header nav { margin-left: 8px; }
      .nav-btn { padding: 0 9px; font-size: 13px; }
      .hdr-hosp, .hdr-link { display: none; }
      .card-head, .card-body { padding-left: 18px; padding-right: 18px; }
      .hist-tools, .tbl-wrap { padding-left: 18px; padding-right: 18px; }
      .tbl-wrap { overflow-x: auto; } table.hist { min-width: 640px; }
      .hist-search { width: 100%; }
      .hist-tools { flex-wrap: wrap; }
    }

    /* ── v4: sign-in as a split screen - brand-blue explanation, white sign-in side ── */
    body:not(.signed-in) { background: #fff; }
    body:not(.signed-in) main.shell { padding: 0; align-items: stretch; }
    body:not(.signed-in) footer { display: none; }
    body:not(.signed-in) #view { align-items: stretch; }
    .auth-wrap { width: 100%; display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); min-height: calc(100vh - 56px); }
    .about { position: relative; overflow: hidden; color: var(--c-ink); display: flex; align-items: center; justify-content: center; padding: 56px 64px; background: #fff; }
    .about-in { position: relative; max-width: 540px; }
    .about .eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .12em; color: var(--c-electric-blue); margin-bottom: 12px; }
    .about h1 { font-size: 36px; font-weight: 600; letter-spacing: -0.8px; line-height: 1.15; margin-bottom: 14px; color: var(--c-ink); }
    .about .auth-sub { font-size: 15.5px; line-height: 1.6; color: var(--c-gray); margin: 0 0 30px; }
    .steps { list-style: none; display: flex; flex-direction: column; gap: 18px; }
    .steps li { display: flex; gap: 14px; font-size: 14px; line-height: 1.55; color: var(--c-slate); }
    .steps li > span { width: 28px; height: 28px; border-radius: 50%; background: var(--c-light-blue); color: var(--c-electric-blue); font-weight: 600; font-size: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
    .steps b { color: var(--c-ink); font-weight: 600; }
    .about-note { margin-top: 32px; display: flex; gap: 10px; align-items: center; font-size: 13px; line-height: 1.5; color: #6B4500; background: #FFF4E5; border: 1px solid #F5C77E; border-radius: 10px; padding: 11px 14px; }
    .about-note i { font-size: 19px; color: #C77700; flex-shrink: 0; }
    .auth-side { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 40px 28px; background: #F7F7F8; border-left: 1px solid rgba(0, 0, 0, 0.06); }
    .auth-side .auth-card { position: relative; border: none; box-shadow: none; background: transparent; padding: 0; max-width: 380px; border-radius: 0; }
    .auth-side .up-field input { background: #fff; }
    .auth-side .auth-foot { border-top-color: rgba(0,0,0,.12); }
    .auth-card h2 { font-size: 26px; font-weight: 600; letter-spacing: -0.5px; }
    .auth-card .auth-sub { margin-top: -6px; }
    .auth-copy { position: relative; font-size: 12px; color: var(--c-gray); text-align: center; line-height: 1.6; margin-top: 28px; }
    .auth-copy a { color: var(--c-electric-blue); text-decoration: none; }
    header .slogan-txt { font-size: 10px; font-weight: 500; letter-spacing: 0.12em; color: var(--c-slate); white-space: nowrap; }
    .up-actions { display: flex; gap: 10px; flex-wrap: wrap; }
    .ws-single .up-actions { justify-content: center; }
    .ws-single .up-actions button { padding: 0 22px; }
    .ws-single .pane-note { text-align: center; }

    /* ── v3: wide upload workspace ── */
    body.signed-in main.shell { padding: 28px 32px; }
    .ws { width: 100%; max-width: 1320px; background: #fff; border: var(--border); border-radius: var(--r); box-shadow: var(--shadow-card); overflow: hidden; display: flex; flex-direction: column; min-height: calc(100vh - 56px - 56px - 70px); }
    .ws-head { padding: 22px 32px 18px; border-bottom: var(--border); }
    .ws-head h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.4px; margin-bottom: 4px; }
    .ws-head p { font-size: 13.5px; color: var(--c-gray); }
    .ws-head b { color: var(--c-ink); font-weight: 500; }
    .ws-grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; min-height: 0; }
    .ws-left { padding: 24px 28px 20px 32px; display: flex; flex-direction: column; gap: 14px; border-right: var(--border); }
    .big-drop { flex: 1; min-height: 320px; border: 2px dashed var(--c-sky-blue); border-radius: 12px; background: #F3F7FF; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-align: center; padding: 30px; transition: background .15s, border-color .15s; }
    .big-drop:hover, .big-drop.over { background: var(--c-light-blue); border-color: var(--c-electric-blue); }
    .bd-ic { width: 76px; height: 76px; border-radius: 50%; background: var(--c-light-blue); display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
    .bd-ic i { font-size: 36px; color: var(--c-electric-blue); }
    .big-drop h2 { font-size: 20px; font-weight: 600; color: var(--c-ink); }
    .big-drop p { font-size: 14px; color: var(--c-gray); }
    .big-drop p b { color: var(--c-electric-blue); font-weight: 600; }
    .bd-hint { margin-top: 8px; font-size: 12px; color: #6F8FD6; background: #fff; border-radius: 20px; padding: 4px 12px; }
    .ws-left .up-demo-row { margin-top: -4px; }
    .ws-right { padding: 24px 32px 24px 28px; display: flex; flex-direction: column; gap: 12px; min-width: 0; background: #FCFCFC; }
    .ws-right-head { display: flex; align-items: baseline; gap: 12px; }
    .ws-right-head .up-summary { margin: 0 0 0 auto; }
    .ws-right .up-list { flex: 1; overflow-y: auto; max-height: 52vh; padding-right: 2px; }
    .ws-right .up-row { background: #fff; }
    .ws-right .up-row.blocked { background: #FFFAFA; }
    .ws-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; color: #A9ADB0; border: 1px dashed rgba(0,0,0,.1); border-radius: var(--r-sm); padding: 30px; min-height: 200px; }
    .ws-empty i { font-size: 32px; }
    .ws-empty p { font-size: 14px; font-weight: 500; color: var(--c-gray); }
    .ws-empty span { font-size: 12.5px; }
    .ws-foot { display: flex; flex-direction: column; gap: 12px; margin-top: auto; }
    .ws-single { flex: 1; padding: 28px 32px; display: flex; flex-direction: column; gap: 14px; max-width: 720px; width: 100%; margin: 0 auto; }
    @media (max-width: 900px) {
      .auth-wrap { grid-template-columns: 1fr; min-height: 0; }
      .about { padding: 32px 22px; }
      .about h1 { font-size: 27px; }
      .auth-side { border-left: none; border-top: var(--border); }
      .auth-side { padding: 32px 22px; }
      .ws-grid { grid-template-columns: 1fr; }
      .ws-left { border-right: none; border-bottom: var(--border); padding: 20px; }
      .ws-right, .ws-head, .ws-single { padding: 20px; }
      .big-drop { min-height: 220px; }
      body.signed-in main.shell { padding: 16px; }
      header .slogan-txt { display: none; }
    }

/* ── Added for the server version: notices, overall progress, failed files ── */
.up-notice { display: flex; gap: 9px; align-items: flex-start; background: #FFF4E5; border: 1px solid #F5C77E; border-radius: var(--r-sm); padding: 10px 12px; font-size: 13px; line-height: 1.45; color: #6B4500; margin-bottom: 14px; }
.up-notice i { font-size: 17px; color: #C77700; flex-shrink: 0; }
.up-overall { font-size: 12.5px; color: var(--c-gray); margin: -6px 0 2px; }
.up-prog-top .up-size { margin-left: auto; }
.up-prog.bad .up-bar div { background: var(--c-negative); }
.up-prog.bad .up-pct { color: var(--c-negative); }
.up-done-ic.bad { background: #FFF4E5; color: #C77700; }
.up-done p a { color: var(--c-electric-blue); text-decoration: none; }
.up-res-note { flex-shrink: 0; max-width: 55%; font-size: 12px; color: var(--c-gray); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-res-note.bad { color: var(--c-negative); }
