/* ╔════════════════════════════════════════════════════════════╗
 * ║  TradingArbor · Components                                 ║
 * ║  v1.1 · May 2026                                           ║
 * ╠════════════════════════════════════════════════════════════╣
 * ║                                                            ║
 * ║  Drop after tokens.css. Apply class names directly —       ║
 * ║  every component reads the design tokens, so dark mode     ║
 * ║  is automatic via [data-theme] on <html>.                  ║
 * ║                                                            ║
 * ║  Naming convention:                                        ║
 * ║                                                            ║
 * ║    .ta-{component}                       base              ║
 * ║    .ta-{component}--{variant}            variant           ║
 * ║    .ta-{component}-{slot}                inner element     ║
 * ║                                                            ║
 * ║    Examples:                                               ║
 * ║      .ta-btn   .ta-btn--primary    .ta-btn--sm             ║
 * ║      .ta-card  .ta-card--elev-2    .ta-card-head           ║
 * ║      .ta-badge .ta-badge--gain     .ta-badge-dot           ║
 * ║                                                            ║
 * ║  Inventory (jump-tos):                                     ║
 * ║                                                            ║
 * ║    1.  Reset                                               ║
 * ║    2.  Card                                                ║
 * ║    3.  Button                                              ║
 * ║    4.  Input field                                         ║
 * ║    5.  Badge                                               ║
 * ║    6.  Toggle (switch)                                     ║
 * ║    7.  Type utility classes                                ║
 * ║    8.  Topbar layout                                       ║
 * ║    9.  Sidebar item                                        ║
 * ║    10. Data table                                          ║
 * ║    11. Theme toggle (segmented control)                    ║
 * ║    12. Animations · fade, skeleton, flash                  ║
 * ║                                                            ║
 * ╚════════════════════════════════════════════════════════════╝ */


/* ── 1. Reset ──────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}


/* ── 2. Card ───────────────────────────────────────────────── *
 *   Default elevation is "1" — resting cards.
 *   Use --elev-2 for hover/popovers, --elev-3 for modals.
 *   Use --flush when content provides its own padding (tables).
 * ──────────────────────────────────────────────────────────── */
.ta-card {
  background:     var(--ta-color-surface);
  border:         1px solid var(--ta-color-border);
  border-radius:  var(--ta-radius);
  padding:        var(--ta-space-5);
  box-shadow:     var(--ta-shadow-1);
}
.ta-card--elev-2 { box-shadow: var(--ta-shadow-2); }
.ta-card--elev-3 { box-shadow: var(--ta-shadow-3); }
.ta-card--flush  { padding: 0; }

.ta-card-head {
  display:        flex;
  align-items:    center;
  justify-content:space-between;
  padding:        var(--ta-space-4) var(--ta-space-5);
  border-bottom:  1px solid var(--ta-color-border);
  background:     var(--ta-color-surface-raised);
}


/* ── 3. Button ─────────────────────────────────────────────── *
 *   Variants: --primary  --secondary  --ghost  --danger  --success
 *   Sizes:    --sm (28px)  default (36px)  --lg (44px)
 *   Width:    --full
 * ──────────────────────────────────────────────────────────── */
.ta-btn {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  gap:             var(--ta-space-2);
  height:          36px;
  padding:         0 14px;
  border-radius:   var(--ta-radius);
  border:          1px solid transparent;
  background:      transparent;
  color:           var(--ta-color-text);
  font-family:     var(--ta-font-sans);
  font-size:       var(--ta-fs-body);
  font-weight:     var(--ta-fw-medium);
  letter-spacing:  -0.005em;
  line-height:     1;
  cursor:          pointer;
  transition:      background 120ms ease,
                   border-color 120ms ease,
                   color 120ms ease,
                   box-shadow 120ms ease;
  user-select:     none;
}
.ta-btn:focus-visible {
  outline:    none;
  box-shadow: var(--ta-shadow-focus);
}

.ta-btn--primary {
  background:   var(--ta-color-accent);
  border-color: var(--ta-color-accent);
  color:        #fff;
  box-shadow:   var(--ta-shadow-1),
                inset 0 1px 0 rgba(255,255,255,0.12);
}
.ta-btn--primary:hover {
  background:   var(--ta-color-accent-hover);
  border-color: var(--ta-color-accent-hover);
}

.ta-btn--secondary {
  background:   var(--ta-color-surface);
  border-color: var(--ta-color-border-strong);
  color:        var(--ta-color-text);
  box-shadow:   var(--ta-shadow-1);
}
.ta-btn--secondary:hover {
  background:   var(--ta-color-bg-alt);
}

.ta-btn--ghost {
  color: var(--ta-color-text-muted);
}
.ta-btn--ghost:hover {
  background: var(--ta-color-bg-alt);
  color:      var(--ta-color-text);
}

.ta-btn--danger {
  background:   var(--ta-color-money-loss);
  border-color: var(--ta-color-money-loss);
  color:        #fff;
  box-shadow:   var(--ta-shadow-1);
}

.ta-btn--success {
  background:   var(--ta-color-money-gain);
  border-color: var(--ta-color-money-gain);
  color:        #fff;
  box-shadow:   var(--ta-shadow-1);
}

.ta-btn--sm {
  height:    28px;
  padding:   0 10px;
  font-size: 12.5px;
  gap:       var(--ta-space-1);
}
.ta-btn--lg {
  height:    44px;
  padding:   0 18px;
  font-size: var(--ta-fs-body-l);
  gap:       var(--ta-space-3);
}
.ta-btn--full { width: 100%; }


/* ── 4. Input field ────────────────────────────────────────── *
 *   Pattern: <label class="ta-field">
 *              <span class="ta-field-label">…</span>
 *              <div class="ta-input">…value…</div>
 *              <span class="ta-field-helper">…</span>
 *            </label>
 * ──────────────────────────────────────────────────────────── */
.ta-field {
  display:        flex;
  flex-direction: column;
  gap:            var(--ta-space-1);
}
.ta-field-label {
  font-size:      var(--ta-fs-body-s);
  font-weight:    var(--ta-fw-medium);
  color:          var(--ta-color-text);
  display:        flex;
  justify-content:space-between;
}
.ta-field-sub {
  color:       var(--ta-color-text-subtle);
  font-weight: var(--ta-fw-regular);
}
.ta-input {
  display:      flex;
  align-items:  center;
  gap:          var(--ta-space-2);
  height:       38px;
  padding:      0 12px;
  background:   var(--ta-color-surface);
  border:       1px solid var(--ta-color-border-strong);
  border-radius:var(--ta-radius);
  box-shadow:   var(--ta-shadow-1);
  color:        var(--ta-color-text);
  font-family:  var(--ta-font-sans);
  font-size:    var(--ta-fs-body);
  line-height:  1;
}
.ta-input:focus-within {
  box-shadow:   var(--ta-shadow-focus);
  border-color: var(--ta-color-accent);
}
.ta-input--mono    { font-family: var(--ta-font-mono); }
.ta-input--invalid { border-color: var(--ta-color-money-loss); }

.ta-field-helper          { font-size: 11.5px; color: var(--ta-color-text-subtle); }
.ta-field-helper--error   { color: var(--ta-color-money-loss); }


/* ── 5. Badge ──────────────────────────────────────────────── *
 *   Variants: --neutral  --info  --gain  --loss  --warn
 *   Mode badges: --paper (green) and --live (red) — visual
 *   difference is LOAD-BEARING; never soften.
 *   Add <span class="ta-badge-dot"></span> for a leading dot.
 * ──────────────────────────────────────────────────────────── */
.ta-badge {
  display:        inline-flex;
  align-items:    center;
  gap:            5px;
  height:         22px;
  padding:        0 8px;
  border:         1px solid transparent;
  border-radius:  var(--ta-radius);
  font-family:    var(--ta-font-sans);
  font-size:      var(--ta-fs-meta);
  font-weight:    var(--ta-fw-semibold);
  letter-spacing: var(--ta-tracking-mono);
  text-transform: uppercase;
  line-height:    1;
}
.ta-badge-dot {
  width:         6px;
  height:        6px;
  border-radius: 50%;
  background:    currentColor;
}

.ta-badge--neutral {
  background:   var(--ta-color-bg-alt);
  color:        var(--ta-color-text-muted);
  border-color: var(--ta-color-border);
}
.ta-badge--info {
  background:   var(--ta-color-accent-soft);
  color:        var(--ta-color-accent-hover);
  border-color: var(--ta-color-brand-100);
}
.ta-badge--gain  { background: var(--ta-color-money-gain-soft); color: var(--ta-color-money-gain); }
.ta-badge--loss  { background: var(--ta-color-money-loss-soft); color: var(--ta-color-money-loss); }
.ta-badge--warn  { background: var(--ta-color-warn-soft);       color: var(--ta-color-warn); }

/* Trading-mode badges — visually distinct. Don't recolor. */
.ta-badge--paper { background: var(--ta-color-money-gain-soft); color: var(--ta-color-money-gain); }
.ta-badge--live  { background: var(--ta-color-money-loss-soft); color: var(--ta-color-money-loss); }


/* ── 6. Toggle (switch) ────────────────────────────────────── *
 *   Toggle on/off by setting data-on="true|false".
 *   Sizes: default (36×22), --sm (30×18).
 * ──────────────────────────────────────────────────────────── */
.ta-toggle {
  position:      relative;
  width:         36px;
  height:        22px;
  border-radius: 999px;
  background:    var(--ta-color-border-strong);
  transition:    background 120ms ease;
  cursor:        pointer;
  flex-shrink:   0;
}
.ta-toggle::after {
  content:       "";
  position:      absolute;
  top:           2px;
  left:          2px;
  width:         18px;
  height:        18px;
  border-radius: 50%;
  background:    #fff;
  box-shadow:    0 1px 2px rgba(14,23,38,0.18);
  transition:    left 120ms ease;
}
.ta-toggle[data-on="true"]            { background: var(--ta-color-accent); }
.ta-toggle[data-on="true"]::after     { left: 16px; }

.ta-toggle--sm                        { width: 30px; height: 18px; }
.ta-toggle--sm::after                 { width: 14px; height: 14px; }
.ta-toggle--sm[data-on="true"]::after { left: 14px; }


/* ── 7. Type utility classes ───────────────────────────────── *
 *   Use these instead of styling raw heading elements when
 *   you need a specific scale without changing semantics.
 * ──────────────────────────────────────────────────────────── */
.ta-h1 {
  font-size:      var(--ta-fs-h1);
  font-weight:    var(--ta-fw-semibold);
  letter-spacing: var(--ta-tracking-tight);
  color:          var(--ta-color-text);
  margin:         0;
}
.ta-h2 {
  font-size:      var(--ta-fs-h2);
  font-weight:    var(--ta-fw-semibold);
  letter-spacing: var(--ta-tracking-tight);
  color:          var(--ta-color-text);
  margin:         0;
}
.ta-h3 {
  font-size:      var(--ta-fs-h3);
  font-weight:    var(--ta-fw-semibold);
  letter-spacing: var(--ta-tracking-tight);
  color:          var(--ta-color-text);
  margin:         0;
}
.ta-meta {
  font-size:      var(--ta-fs-meta);
  color:          var(--ta-color-text-subtle);
  letter-spacing: var(--ta-tracking-caps);
  text-transform: uppercase;
  font-weight:    var(--ta-fw-medium);
}
.ta-mono {
  font-family:          var(--ta-font-mono);
  font-variant-numeric: tabular-nums;
}


/* ── 8. Topbar layout ──────────────────────────────────────── *
 *   The sticky chrome row at the top of every product surface.
 * ──────────────────────────────────────────────────────────── */
.ta-topbar {
  display:        flex;
  align-items:    center;
  justify-content:space-between;
  height:         56px;
  padding:        0 var(--ta-space-8);
  background:     var(--ta-color-surface);
  border-bottom:  1px solid var(--ta-color-border);
  position:       sticky;
  top:            0;
  z-index:        5;
}


/* ── 9. Sidebar item ───────────────────────────────────────── *
 *   For left-rail nav. Set aria-current="page" on the active link.
 * ──────────────────────────────────────────────────────────── */
.ta-side-item {
  display:       flex;
  align-items:   center;
  gap:           var(--ta-space-3);
  padding:       var(--ta-space-2) var(--ta-space-3);
  border-radius: var(--ta-radius);
  color:         var(--ta-color-text-muted);
  font-size:     var(--ta-fs-body);
  font-weight:   var(--ta-fw-medium);
  cursor:        pointer;
  transition:    background 120ms ease, color 120ms ease;
}
.ta-side-item:hover {
  background: var(--ta-color-bg-alt);
}
.ta-side-item[aria-current="page"] {
  background: var(--ta-color-accent-soft);
  color:      var(--ta-color-accent-hover);
}


/* ── 10. Data table (positions, journal, signals) ──────────── *
 *   <table class="ta-table">
 *     <thead><tr><th>…</th></tr></thead>
 *     <tbody><tr><td>…</td></tr></tbody>
 *   </table>
 *
 *   Add class="ta-num" to numeric cells for right-align + mono.
 *   Combine with .ta-money / .ta-money--loss for currency cells.
 * ──────────────────────────────────────────────────────────── */
.ta-table {
  width:           100%;
  border-collapse: collapse;
}
.ta-table thead th {
  text-align:     left;
  font-size:      var(--ta-fs-meta);
  font-weight:    var(--ta-fw-medium);
  color:          var(--ta-color-text-subtle);
  letter-spacing: var(--ta-tracking-caps);
  text-transform: uppercase;
  padding:        10px var(--ta-space-5);
  background:     var(--ta-color-surface-raised);
  border-bottom:  1px solid var(--ta-color-border);
}
.ta-table tbody td {
  padding:       var(--ta-space-3) var(--ta-space-5);
  border-bottom: 1px solid var(--ta-color-border);
  font-size:     var(--ta-fs-body);
  color:         var(--ta-color-text);
}
.ta-table tbody tr:last-child td { border-bottom: none; }
.ta-table .ta-num {
  text-align:           right;
  font-family:          var(--ta-font-mono);
  font-variant-numeric: tabular-nums;
}


/* ── 11. Theme toggle (segmented control) ──────────────────── *
 *   Required on every authenticated product surface.
 *   <div class="ta-theme-toggle">
 *     <button data-theme="light" aria-pressed="true">Light</button>
 *     <button data-theme="dark"  aria-pressed="false">Dark</button>
 *   </div>
 *   See INTEGRATION.md for the JS wiring snippet.
 * ──────────────────────────────────────────────────────────── */
/* Segmented control. v0.114.20: hardened against the
   .ta-form-surface bare-button defaults that would otherwise
   stamp 36px height + border + shadow onto each pill and break
   the layout. Container has internal padding so the active
   pill's surface background sits cleanly inside the outer
   border; pills use min-width to keep proportions stable
   regardless of label length, and the active shadow is a softer
   inset variant that can't protrude past the outer border. */
.ta-theme-toggle {
  display:       inline-flex;
  align-items:   center;
  gap:           4px;
  /* Explicit height so the visual padding around each pill is
     symmetric — 4px on every side (top/right/bottom/left). Without
     this the parent flex container stretched the segmented control
     to ~54px tall, producing 13px vertical padding vs 4px
     horizontal. Container math: button(28) + padding(4+4) = 36px. */
  height:        36px;
  box-sizing:    border-box;
  padding:       4px;
  background:    var(--ta-color-bg-alt);
  border:        1px solid var(--ta-color-border);
  border-radius: 8px;
}
.ta-theme-toggle button,
.ta-form-surface .ta-theme-toggle button {
  display:        inline-flex !important;
  align-items:    center !important;
  justify-content:center !important;
  /* box-sizing: border-box pinned because the bare-element button
     defaults may not include it, causing height + padding to stack
     vertically and push the pill out of the 36px container.
     Vertical-align baseline -> middle keeps the inline-flex pill
     from sitting on the text baseline of its container. */
  box-sizing:     border-box !important;
  vertical-align: middle !important;
  height:         28px !important;
  min-width:      64px !important;
  padding:        0 12px !important;
  margin:         0 !important;
  line-height:    1 !important;
  background:     transparent !important;
  border:         none !important;
  box-shadow:     none !important;
  color:          var(--ta-color-text-muted);
  font-family:    var(--ta-font-sans);
  font-size:      13px;
  font-weight:    var(--ta-fw-medium);
  letter-spacing: -0.005em;
  text-transform: none;
  cursor:         pointer;
  border-radius:  6px !important;
  transition:     background-color 120ms ease, color 120ms ease;
}
.ta-theme-toggle button:hover,
.ta-form-surface .ta-theme-toggle button:hover {
  background: rgba(0, 0, 0, 0.04) !important;
  color:      var(--ta-color-text) !important;
}
.ta-theme-toggle button[aria-pressed="true"],
.ta-form-surface .ta-theme-toggle button[aria-pressed="true"] {
  background: var(--ta-color-surface) !important;
  color:      var(--ta-color-text) !important;
  /* Subtle inset highlight + 1px outline replace the wider
     box-shadow that was protruding past the container border. */
  box-shadow: 0 0 0 1px var(--ta-color-border),
              0 1px 2px rgba(14, 23, 38, 0.06) !important;
}


/* ── 12. Animations · fade, skeleton, flash ────────────────── *
 *
 *   Three motion patterns, the only motion in the system.
 *
 *     .ta-fade-in       — mount animation for any element
 *     .ta-skeleton-*    — loading placeholders for data sections
 *     .ta-flash--gain   — green flash on a number update (decays)
 *     .ta-flash--loss   — red flash on a negative update (decays)
 *
 *   All use the motion tokens from tokens.css so durations
 *   collapse to 0ms when the user prefers reduced motion.
 *
 *   USAGE patterns:
 *
 *     Mount fade:
 *       <div class="ta-card ta-fade-in">…</div>
 *
 *     Skeleton loader (replace with real content when loaded):
 *       <div class="ta-skeleton ta-skeleton-line"></div>
 *       <div class="ta-skeleton ta-skeleton-line" style="width:60%"></div>
 *       <div class="ta-skeleton ta-skeleton-circle"></div>
 *       <div class="ta-skeleton ta-skeleton-block" style="height:160px"></div>
 *
 *     Number flash on update (apply class for one frame, removes self):
 *       el.classList.add('ta-flash--gain');
 *       setTimeout(() => el.classList.remove('ta-flash--gain'), 700);
 * ──────────────────────────────────────────────────────────── */

/* ─ Fade-in on mount ─────────────────────────────────────── */
@keyframes ta-kf-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ta-fade-in {
  animation: ta-kf-fade-in var(--ta-duration-base) var(--ta-ease-out) both;
}
/* Stagger child fades — apply with style="--ta-stagger: 1" etc. */
.ta-fade-in[style*="--ta-stagger"] {
  animation-delay: calc(var(--ta-stagger, 0) * 60ms);
}

/* ─ Skeleton loader ──────────────────────────────────────── */
@keyframes ta-kf-skeleton-pulse {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
.ta-skeleton {
  background:
    linear-gradient(
      90deg,
      var(--ta-color-bg-alt)  0%,
      var(--ta-color-surface-raised) 50%,
      var(--ta-color-bg-alt)  100%
    );
  background-size: 200% 100%;
  animation: ta-kf-skeleton-pulse 1.4s var(--ta-ease-linear) infinite;
  border-radius: var(--ta-radius);
  display: block;
}

/* Skeleton variants */
.ta-skeleton-line {
  height: 12px;
  border-radius: var(--ta-radius-sm);
  margin: 6px 0;
}
.ta-skeleton-line--lg     { height: 18px; }
.ta-skeleton-line--xl     { height: 28px; }
.ta-skeleton-circle {
  width:  32px;
  height: 32px;
  border-radius: 50%;
}
.ta-skeleton-block {
  width: 100%;
  height: 120px;
  /* shape stays var(--ta-radius), which is 5px — matches cards */
}

/* Skeleton group container — gives natural spacing */
.ta-skeleton-group        { display: flex; flex-direction: column; gap: var(--ta-space-2); }
.ta-skeleton-group--row   { display: flex; flex-direction: row;    gap: var(--ta-space-3); align-items: center; }

/* ─ Number-update flash ──────────────────────────────────── *
 *   Adds a brief tinted halo that fades to transparent.
 *   Wrap the price/equity value in a span and toggle the class
 *   for ~600ms each time the value updates.
 * ──────────────────────────────────────────────────────────── */
@keyframes ta-kf-flash-gain {
  from { background-color: var(--ta-color-money-gain-soft); }
  to   { background-color: transparent; }
}
@keyframes ta-kf-flash-loss {
  from { background-color: var(--ta-color-money-loss-soft); }
  to   { background-color: transparent; }
}
.ta-flash--gain {
  animation: ta-kf-flash-gain var(--ta-duration-flash) var(--ta-ease-out) both;
  border-radius: var(--ta-radius-sm);
}
.ta-flash--loss {
  animation: ta-kf-flash-loss var(--ta-duration-flash) var(--ta-ease-out) both;
  border-radius: var(--ta-radius-sm);
}


/* ── 13. Bare-element defaults ─────────────────────────────── *
 * v0.114.19. Component classes (.ta-btn, .ta-input, etc.) require
 * every page to opt in by class. Most settings sub-forms still
 * use raw <input>, <select>, <button>, and <table> elements with
 * legacy CSS — they read OK because of the --brd/--ink alias
 * block, but the visual weight, spacing, and focus rings drift
 * from the design canvas.
 *
 * This section paints reasonable design-canvas defaults onto bare
 * elements that live inside .ta-form-surface. Any form wrapped in
 * a .ta-form-surface gets standardized inputs/buttons/tables
 * without per-element class migration.
 *
 * Scoped intentionally — bare <button> in /performance, /signals,
 * etc. still uses whatever ad-hoc CSS those pages ship. Add
 * .ta-form-surface to a wrapper to opt in.
 * ──────────────────────────────────────────────────────────── */

.ta-form-surface input[type="text"],
.ta-form-surface input[type="email"],
.ta-form-surface input[type="password"],
.ta-form-surface input[type="number"],
.ta-form-surface input[type="search"],
.ta-form-surface input[type="tel"],
.ta-form-surface input[type="url"],
.ta-form-surface input:not([type]),
.ta-form-surface select,
.ta-form-surface textarea {
  height: 38px;
  padding: 0 12px;
  width: 100%;
  background: var(--ta-color-surface);
  border: 1px solid var(--ta-color-border-strong);
  border-radius: var(--ta-radius);
  box-shadow: var(--ta-shadow-1);
  color: var(--ta-color-text);
  font-family: var(--ta-font-sans);
  font-size: var(--ta-fs-body);
  line-height: 1;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.ta-form-surface textarea {
  height: auto;
  min-height: 96px;
  padding: 10px 12px;
  line-height: 1.5;
  resize: vertical;
  font-family: var(--ta-font-sans);
}
.ta-form-surface input[type="text"]:focus,
.ta-form-surface input[type="email"]:focus,
.ta-form-surface input[type="password"]:focus,
.ta-form-surface input[type="number"]:focus,
.ta-form-surface input[type="search"]:focus,
.ta-form-surface input[type="tel"]:focus,
.ta-form-surface input[type="url"]:focus,
.ta-form-surface input:not([type]):focus,
.ta-form-surface select:focus,
.ta-form-surface textarea:focus {
  outline: none;
  border-color: var(--ta-color-accent);
  box-shadow: var(--ta-shadow-focus);
}
.ta-form-surface input[disabled],
.ta-form-surface select[disabled],
.ta-form-surface textarea[disabled] {
  background: var(--ta-color-bg-alt);
  color: var(--ta-color-text-subtle);
  cursor: not-allowed;
}
.ta-form-surface select {
  /* Native caret stays — replacing it would block the OS focus
     affordances. Just align padding with text inputs. */
  padding-right: 32px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7488' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.ta-form-surface input[type="checkbox"],
.ta-form-surface input[type="radio"] {
  width: 16px; height: 16px;
  margin: 0 8px 0 0;
  vertical-align: -2px;
  accent-color: var(--ta-color-accent);
  cursor: pointer;
}
/* v0.114.20: form labels are sentence-case sans-serif rather than
   uppercase mono. The uppercase + monospace + wide-tracking look
   read as "tech demo / AI-generated template" and made polished
   user-facing surfaces feel synthetic. Sentence-case in Inter at
   normal tracking is what mature fintech ships (Stripe, Linear,
   Wise, Vercel dashboard) — it reads as deliberate craft rather
   than design-system showcase. The `.inline` variant for
   checkbox + label pairs is unchanged. */
.ta-form-surface label {
  display: block;
  font-family: var(--ta-font-sans);
  font-size: 13px;
  font-weight: var(--ta-fw-medium);
  color: var(--ta-color-text);
  letter-spacing: -0.005em;
  text-transform: none;
  margin: 0 0 8px;
}
.ta-form-surface label.inline {
  display: inline-flex; align-items: center;
  text-transform: none;
  font-family: var(--ta-font-sans);
  font-size: var(--ta-fs-body);
  letter-spacing: normal;
  font-weight: var(--ta-fw-regular);
  margin: 0;
  cursor: pointer;
}

/* Buttons — semantic colors picked up by class on the bare button
   so existing markup like <button class="primary">Save</button>
   gets the design-canvas look automatically. */
.ta-form-surface button {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--ta-space-2);
  height: 36px;
  padding: 0 14px;
  border-radius: var(--ta-radius);
  border: 1px solid var(--ta-color-border-strong);
  background: var(--ta-color-surface);
  color: var(--ta-color-text);
  font-family: var(--ta-font-sans);
  font-size: var(--ta-fs-body);
  font-weight: var(--ta-fw-medium);
  letter-spacing: -0.005em;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--ta-shadow-1);
  transition: background 120ms ease, border-color 120ms ease,
              color 120ms ease, box-shadow 120ms ease;
}
.ta-form-surface button:hover {
  background: var(--ta-color-bg-alt);
}
.ta-form-surface button:focus-visible {
  outline: none;
  box-shadow: var(--ta-shadow-focus);
}
.ta-form-surface button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.ta-form-surface button.primary,
.ta-form-surface button[type="submit"]:not([class*="ghost"]):not([class*="secondary"]):not([class*="danger"]):not(.outline) {
  background: var(--ta-color-accent);
  border-color: var(--ta-color-accent);
  color: #fff;
}
.ta-form-surface button.primary:hover,
.ta-form-surface button[type="submit"]:hover:not([class*="ghost"]):not([class*="secondary"]):not([class*="danger"]):not(.outline) {
  background: var(--ta-color-accent-hover);
  border-color: var(--ta-color-accent-hover);
}
.ta-form-surface button.danger {
  background: transparent;
  border-color: var(--ta-color-money-loss);
  color: var(--ta-color-money-loss);
}
.ta-form-surface button.danger:hover {
  background: var(--ta-color-money-loss-soft);
}
.ta-form-surface button.success {
  background: var(--ta-color-money-gain);
  border-color: var(--ta-color-money-gain);
  color: #fff;
}

/* Standardized tables — same row treatment as the React console's
   data tables. Header is uppercase + monospace + muted; rows
   hover-highlight; borders use the token. */
.ta-form-surface table,
table.ta-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--ta-fs-body-s);
  margin: 8px 0 18px;
}
.ta-form-surface table th,
.ta-form-surface table td,
table.ta-table th,
table.ta-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--ta-color-border);
  vertical-align: middle;
}
.ta-form-surface table th,
table.ta-table th {
  font-family: var(--ta-font-mono);
  font-size: 10.5px;
  font-weight: var(--ta-fw-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ta-color-text-subtle);
  background: var(--ta-color-bg-alt);
}
.ta-form-surface table tbody tr:hover,
table.ta-table tbody tr:hover {
  background: var(--ta-color-bg-alt);
}
.ta-form-surface table tbody tr:last-child td,
table.ta-table tbody tr:last-child td {
  border-bottom: none;
}

/* Section card — replaces ad-hoc `.panel { padding; border }` styling.
   Settings sections, account sections, etc. should wrap their
   content in <section class="ta-panel"> for visual continuity with
   the React console's `.card-v2` surfaces. */
.ta-panel {
  background: var(--ta-color-surface);
  border: 1px solid var(--ta-color-border);
  border-radius: var(--ta-radius);
  padding: 22px 24px 26px;
  margin-bottom: 18px;
  box-shadow: var(--ta-shadow-1);
}
.ta-panel > h2,
.ta-panel > .panel-head h2 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: var(--ta-fw-semibold);
  letter-spacing: var(--ta-tracking-tight);
  color: var(--ta-color-text);
}
.ta-panel > p.sub,
.ta-panel > .panel-head .sub {
  margin: 0 0 18px;
  color: var(--ta-color-text-muted);
  font-size: var(--ta-fs-body-s);
  line-height: 1.5;
}
.ta-panel-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
@media (min-width: 720px) {
  .ta-panel-row.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ta-panel-row.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}


/* ── 13. Brand lockup ───────────────────────────────────────────
   The "TRADING ARBOR" wordmark is artwork (a PNG lockup), never
   re-typeset in HTML/CSS. This helper paints the right variant for
   the surface theme: the on-light lockup (navy wordmark + blue
   compass) by default, swapping to the reversed all-white lockup
   under [data-theme="dark"]. Both <img>s ship; CSS toggles which
   shows, so the swap is instant on theme change and needs no JS.

   Usage:
     <a class="ta-brand" href="/" aria-label="Trading Arbor">
       <img class="ta-brand-img on-light"
            src="/static/brand/tradingarbor-lockup-light.png" alt="Trading Arbor">
       <img class="ta-brand-img on-dark"
            src="/static/brand/tradingarbor-lockup-dark.png" alt="" aria-hidden="true">
     </a>

   Size with --ta-brand-h (default 28px) on the .ta-brand element.
   For symbol-only chrome (tight columns), use .ta-brand--symbol with
   the symbol-blue / symbol-white pair instead. */
.ta-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  line-height: 0;
}
.ta-brand-img {
  display: block;
  height: var(--ta-brand-h, 28px);
  width: auto;
}
.ta-brand .on-dark { display: none; }
[data-theme="dark"] .ta-brand .on-light { display: none; }
[data-theme="dark"] .ta-brand .on-dark { display: block; }
