/* shared-ui -- canonical design tokens for mortload's apps.
 *
 * Single source of truth lives in ~mortload/shared-ui (consumed by Topdeck
 * today, then DashApp / IronLog / FinanceTracker as each adopts it). Pulled
 * into a consuming app's build via Compose's build.additional_contexts
 * (shared_ui: ../shared-ui) + a `COPY --from=shared_ui` in its Dockerfile,
 * exactly like ../shared-feedback-register. Never edit a consuming app's
 * copy -- change it here and rebuild.
 *
 * Every value is a `--td-*` custom property. A consuming app either uses
 * these names directly, or maps its own existing token names onto them once
 * in its own stylesheet (the same one-mapping-block approach IronLog uses
 * for --freg-* today). A "skin" is a runtime override of a subset of these,
 * served by Topdeck's GET /api/skin/<appId> and injected as a <style> tag
 * -- see the loader snippet in this repo's README.
 *
 * Defaults below are a dark palette (matches DashApp's look, the cleanest
 * of the existing three). skins/light.json flips them.
 *
 * --freg-* IS bridged below (restored 2026-09-05, register item #19,
 * reversing a same-day #12 change). History, so nobody re-removes this
 * again: #12 was originally read as "the register should look IDENTICAL
 * everywhere, matching FinanceTracker" and this bridge was deleted so no
 * app could re-theme it. mortload then clarified #12 was actually about
 * the register POPPING UP over the current section (FinanceTracker's
 * mountModal button), not its colors -- and separately asked for colors
 * to go back to matching each app's own theme, "like it previously did."
 * So: the popup-behavior change (TdTopbar.wireFeedbackModal) stays: colors
 * are themed per-app again via this bridge, same as before #12.
 */

:root {
  /* ---- surface / text ---- */
  --td-bg:            #0b0f14;
  --td-bg-elev:       #131a22;
  --td-bg-elev-2:     #1b2530;
  --td-text:          #e6edf3;
  --td-text-dim:      #93a1b0;
  --td-text-faint:    #5b6b7c;
  --td-border:        #253140;

  /* ---- accent ---- */
  --td-accent:        #2dd4ff;
  --td-accent-hover:  #57ddff;
  --td-accent-text:   #04141a;

  /* ---- status ---- */
  --td-ok:            #39d98a;
  --td-danger:        #ff5d5d;
  --td-warn:          #ffb84d;
  --td-muted:         #5b6b7c;

  /* ---- shape / type / space ---- */
  --td-radius:        10px;
  --td-radius-sm:     6px;
  --td-font:          -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --td-font-mono:     "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --td-font-size:     15px;
  --td-line:          1.5;
  --td-space:         16px;
  --td-shadow:        0 2px 8px rgba(0, 0, 0, 0.3);

  /* ---- layout scale (T-091, 2026-11-09) ----
   * Read only by the opt-in sidebar layout and page parts
   * (components/sidebar.css, components/page-parts.css). Nothing that
   * existed before them reads these, so adding them changes no app's
   * look. Every one is a plain length so a skin can override it, and each
   * is listed in Topdeck main.py's _LENGTH_TOKENS (its skin validator
   * rejects any token it doesn't know). Defaults are the sizes the
   * topbar and Topdeck's fleet dashboard already use. */
  --td-text-xs:       11px;
  --td-text-sm:       12px;
  --td-text-md:       13px;
  --td-text-lg:       15px;
  --td-text-xl:       22px;
  --td-text-2xl:      28px;
  --td-sidebar-width: 224px;
  --td-content-width: 1200px;
  --td-space-1:       4px;
  --td-space-2:       8px;
  --td-space-3:       12px;
  --td-space-4:       16px;
  --td-space-5:       24px;
  --td-space-6:       32px;

  /* ---- feedback-register bridge (restored 2026-09-05, see note above) ----
   * shared-feedback-register is scoped under .freg and themes itself off
   * --freg-* names. Bridging them here means any app that adopts shared-ui
   * gets a themed register for free, no per-app --freg-* mapping block. */
  --freg-bg:          var(--td-bg-elev);
  --freg-bg-hover:    var(--td-bg-elev-2);
  --freg-text:        var(--td-text);
  --freg-text-dim:    var(--td-text-dim);
  --freg-border:      var(--td-border);
  --freg-accent:      var(--td-accent);
  --freg-accent-hover: var(--td-accent-hover);
  --freg-accent-text: var(--td-accent-text);
  --freg-radius:      var(--td-radius-sm);
  --freg-font:        var(--td-font);
}
