/* ============================================================
   dl.myl.gs · portal additions to colors_and_type.css
   Loaded as a second stylesheet after colors_and_type.css so the
   core token file stays close to its upstream form.
   Everything here is derived from existing primitives; no new hues.
   ============================================================ */

:root {
  /* ---- CORRECTION: no third-party font requests ---------------
     Montserrat / Inter / Roboto / DM Mono were loaded from the
     Google CDN. The @import has been deleted from colors_and_type.css;
     overriding these variables alone would not stop the request.
     Display and system UI now resolve to the already-local Open Sans;
     monospace uses the platform stack.
     If DM Mono is vendored later, prepend "DM Mono" to --font-mono. */
  --font-display: "Open Sans", ui-sans-serif, system-ui, sans-serif;
  --font-system:  "Open Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", "DejaVu Sans Mono", monospace;

  /* ---- Status / feedback surfaces (tints of existing primitives) ---- */
  --bg-success:      rgb(230, 250, 251);   /* teal-500 @ 8% on white */
  --fg-success:      rgb(0, 108, 115);     /* teal darkened for AA on white */
  --border-success:  rgb(163, 233, 238);

  --bg-warning:      rgb(255, 248, 219);   /* yellow-400 tint */
  --fg-warning:      rgb(122, 88, 0);      /* AA on --bg-warning */
  --border-warning:  rgb(247, 224, 138);

  --bg-danger:       rgb(253, 234, 237);
  --fg-danger-strong:rgb(168, 0, 30);      /* AA on --bg-danger */
  --border-danger:   rgb(246, 191, 200);

  --bg-info:         var(--ml-blue-100);
  --fg-info:         var(--ml-blue-700);
  --border-info:     rgb(168, 214, 240);

  /* ---- Buttons: danger + ghost (primary/secondary already exist) ---- */
  --btn-danger-bg:       var(--ml-red-500);
  --btn-danger-bg-press: rgb(168, 0, 30);
  --btn-danger-fg:       var(--white);
  --btn-ghost-fg:        var(--slate-700);
  --btn-ghost-bg-hover:  var(--slate-100);

  /* ---- Admin chrome ---- */
  --admin-rail-w:        236px;
  --admin-rail-bg:       var(--gray-50);
  --admin-rail-fg:       var(--slate-700);
  --admin-rail-sel-bg:   var(--ml-blue-100);
  --admin-rail-sel-fg:   var(--ml-blue-700);

  /* ---- Data table ---- */
  --table-header-fg:     var(--gray-600);
  --table-row-h:         56px;
  --table-row-hover:     var(--gray-25);
  --table-stack-bp:      640px;   /* below this, rows become cards */

  /* ---- Focus ring (visible, 3:1 against both white and gray-50) ---- */
  --focus-ring: 0 0 0 2px var(--white), 0 0 0 4px var(--border-focus);

  /* ---- Portal layout ---- */
  --topbar-h:      76px;
  --content-max:   1120px;
  --reading-max:   680px;   /* auth cards, prose */
}

/* Monospace for hashes, tokens, file names, shell commands.
   tabular-nums keeps hex columns from shifting; the slightly tighter
   letter-spacing stops 64-char SHA-256 strings looking loose. */
.ml-mono {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* Every interactive element uses the same ring. Never remove it. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* Icons are referenced from the sprite in templates/_icons.html as
   <svg class="i"><use href="#i-download"/></svg>. 24x24, 2px stroke. */
.i {
  width: 20px;
  height: 20px;
  flex: none;
  vertical-align: -0.2em;
}
.i-sm { width: 16px; height: 16px; }
.i-lg { width: 24px; height: 24px; }

/* ---- Uploading a build (static/upload.js) ----
   The drop zone is a dashed outline rather than a filled panel: it is a target,
   not a card, and on this page it sits directly above real cards that are.
   Progress bars are 4px because there can be sixteen of them at once for a
   release with fifteen language packs. */
.upload-drop {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: center;
  text-align: center;
  padding: var(--space-6) var(--space-5);
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--fg-tertiary);
  background: var(--bg-subtle);
}
.upload-drop.is-over {
  border-color: var(--border-focus);
  color: var(--ml-blue-600);
}

.upload-list { list-style: none; margin: var(--space-4) 0 0; padding: 0; }
.upload-row { margin-bottom: var(--space-4); }
.upload-bar {
  height: 4px;
  margin-top: var(--space-2);
  border-radius: 2px;
  background: var(--border-hairline);
  overflow: hidden;
}
.upload-bar-fill {
  height: 100%;
  width: 0;
  background: var(--ml-blue-600);
  transition: width 120ms linear;
}
/* A finished or failed row keeps its bar, so a list of sixteen files reads as
   a column of states rather than as bars that vanish one by one. */
.upload-done .upload-bar-fill { background: var(--ok-600, var(--ml-blue-600)); }
.upload-failed .upload-bar-fill { background: var(--danger-600, #b42318); }
.upload-failed .js-state { color: var(--danger-600, #b42318); }
