/* ═══════════════════════════════════════════════════════════
   ECLIPSE MOBILE — Arbra Design System
   Authored 2026-05-26 (Chunk 10c — Ultrathink Mobile Design
   System Parts 1-5 made buildable as a 5-day single-commit
   atomic ship)
   Loads at viewport widths < 768px.
   :root tokens cascade everywhere; component classes scoped.
   ═══════════════════════════════════════════════════════════ */

:root {
  /* ── SURFACE LAYERS (depth hierarchy) ────────────────────── */
  --ec-l0-void:        #02030a;
  --ec-l1-slab:        #060810;
  --ec-l2-card:        #0a0d18;
  --ec-l3-nested:      #0d111d;
  --ec-l3-inset:       #08090f;
  --ec-l4-deep:        #050709;       /* sheet/modal underlay */

  /* ── TEXT HIERARCHY ──────────────────────────────────────── */
  --ec-text-primary:    #e8eef8;
  --ec-text-secondary:  #9aa3b4;
  --ec-text-tertiary:   #5c6478;
  --ec-text-quaternary: #3a4053;

  /* ── ICE BLUE (accent + voice) ───────────────────────────── */
  --ec-ice:            #88ddff;
  --ec-ice-bright:     #b8ebff;
  --ec-ice-deep:       #4a8db5;
  --ec-ice-g40:        rgba(136, 221, 255, 0.40);
  --ec-ice-g25:        rgba(136, 221, 255, 0.25);
  --ec-ice-g20:        rgba(136, 221, 255, 0.20);
  --ec-ice-g15:        rgba(136, 221, 255, 0.15);
  --ec-ice-g08:        rgba(136, 221, 255, 0.08);
  --ec-ice-g04:        rgba(136, 221, 255, 0.04);

  /* ── STRONG GREEN (positive) ─────────────────────────────── */
  --ec-strong:         #4ade80;
  --ec-strong-g12:     rgba(74, 222, 128, 0.12);
  --ec-strong-g08:     rgba(74, 222, 128, 0.08);

  /* ── RED (reserved — errors only, sparing) ───────────────── */
  --ec-alert:          #f87171;
  --ec-alert-g12:      rgba(248, 113, 113, 0.12);

  /* ── BORDERS ─────────────────────────────────────────────── */
  --ec-border-faint:   #1a1f2e;
  --ec-border-inner:   #141826;
  --ec-border-active:  var(--ec-ice-g25);

  /* ── SPACING (4px base, mobile-tuned) ────────────────────── */
  --ec-s1:  4px;
  --ec-s2:  8px;
  --ec-s3:  12px;
  --ec-s4:  16px;
  --ec-s5:  20px;
  --ec-s6:  24px;
  --ec-s8:  32px;
  --ec-s10: 40px;
  --ec-s12: 48px;
  --ec-s16: 64px;

  /* ── RADII ───────────────────────────────────────────────── */
  --ec-r-pill:    6px;
  --ec-r-chip:    4px;
  --ec-r-nested:  10px;
  --ec-r-card:    16px;
  --ec-r-sheet:   24px 24px 0 0;
  --ec-r-dock:    20px;

  /* ── TYPOGRAPHY FAMILIES ─────────────────────────────────── */
  --ec-f-sans:    'Inter', 'SF Pro Text', -apple-system, system-ui, sans-serif;
  --ec-f-display: 'Inter Display', 'Inter', system-ui, sans-serif;
  --ec-f-mono:    'JetBrains Mono', 'IBM Plex Mono', 'SF Mono', Menlo, monospace;

  /* ── COMPOSITE SHADOWS (the moat) ────────────────────────── */
  --ec-rim:
    0 -1px 0 0 var(--ec-ice-g25),
    0 0 32px -8px var(--ec-ice-g15),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.02),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.4),
    0 2px 12px -4px rgba(0, 0, 0, 0.6);

  --ec-rim-focus:
    0 -1px 0 0 rgba(184, 235, 255, 0.40),
    0 0 48px -8px rgba(136, 221, 255, 0.25),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.04),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.40),
    0 4px 16px -4px rgba(0, 0, 0, 0.7);

  --ec-rim-quiet:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.02),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.3),
    0 1px 6px -2px rgba(0, 0, 0, 0.4);

  --ec-dock-shadow:
    0 -8px 32px -8px rgba(0, 0, 0, 0.8),
    0 -1px 0 0 var(--ec-border-faint);

  /* ── MOTION TIMING ───────────────────────────────────────── */
  --ec-ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
  --ec-ease-in-out:   cubic-bezier(0.65, 0, 0.35, 1);
  --ec-ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
  --ec-dur-instant:   80ms;
  --ec-dur-fast:      160ms;
  --ec-dur-normal:    240ms;
  --ec-dur-slow:      400ms;
  --ec-dur-breath:    2500ms;
}

/* ═══════════════════════════════════════════════════════════
   DESKTOP DEFAULT — Mobile-only surfaces are hidden above 768px
   The .ec-dock / .ec-sheet / .ec-syn-panel only appear on mobile.
   ═══════════════════════════════════════════════════════════ */

.ec-dock,
.ec-sheet-backdrop,
.ec-sheet,
.ec-syn-panel {
  display: none;
}

/* ═══════════════════════════════════════════════════════════
   MOBILE BREAKPOINT — Everything below is scoped to <768px
   The 28 existing inline <style> blocks govern desktop (>=768px);
   eclipse-mobile.css governs the carved mobile cockpit (<768px).
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 767px) {

  /* ── BASE LAYER ─────────────────────────────────────────── */
  html, body {
    background: var(--ec-l0-void);
    color: var(--ec-text-primary);
    font-family: var(--ec-f-sans);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  .mobile-shell {
    min-height: 100dvh;
    background: var(--ec-l1-slab);
    padding-bottom: 96px;  /* room for dock */
    display: flex;
    flex-direction: column;
  }

  /* ─────────────────────────────────────────────────────────
     §4.1 — TYPOGRAPHY LADDER
     Italic = voice register, non-negotiable. Voice content only.
     UI labels, data, navigation are never italic.
     ───────────────────────────────────────────────────────── */

  /* ── DISPLAY (Inter Display) ───────────────────────────── */
  .ec-t-display-xl  { font: 600 44px/1.0   var(--ec-f-display); letter-spacing: -0.02em; }
  .ec-t-display-lg  { font: 600 28px/1.05  var(--ec-f-display); letter-spacing: -0.015em; }
  .ec-t-display-md  { font: 600 22px/1.1   var(--ec-f-display); letter-spacing: -0.01em; }

  /* ── VOICE (italic, ICE for names, gray for narrative) ── */
  .ec-t-voice-name  { font: italic 500 28px/1.1 var(--ec-f-display); letter-spacing: -0.01em; color: var(--ec-ice); }
  .ec-t-voice-body  { font: italic 400 15px/1.5 var(--ec-f-sans);   color: var(--ec-text-secondary); }
  .ec-t-voice-sm    { font: italic 400 13px/1.4 var(--ec-f-sans);   color: var(--ec-text-secondary); }

  /* ── BODY (UI, copy, labels) ──────────────────────────── */
  .ec-t-body-lg     { font: 400 15px/1.5 var(--ec-f-sans); color: var(--ec-text-primary); }
  .ec-t-body-md     { font: 400 14px/1.5 var(--ec-f-sans); color: var(--ec-text-primary); }
  .ec-t-body-sm     { font: 400 13px/1.4 var(--ec-f-sans); color: var(--ec-text-secondary); }

  /* ── MONO (data voice — JetBrains Mono) ───────────────── */
  .ec-t-mono-lg     { font: 500 16px/1.3 var(--ec-f-mono); color: var(--ec-text-primary); }
  .ec-t-mono-md     { font: 500 13px/1.4 var(--ec-f-mono); color: var(--ec-text-primary); }
  .ec-t-mono-sm     { font: 500 11px/1.3 var(--ec-f-mono); color: var(--ec-text-secondary); letter-spacing: 0.02em; }

  /* ── EYEBROW (status voice — uppercase mono) ──────────── */
  .ec-t-eyebrow     { font: 600 10px/1   var(--ec-f-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ec-text-tertiary); }
  .ec-t-eyebrow-sm  { font: 600 9px/1    var(--ec-f-mono); letter-spacing: 0.15em; text-transform: uppercase; color: var(--ec-text-quaternary); }

  /* ── ICE-toned variants (apply on .ec-t-x classes) ────── */
  .ec-color-ice    { color: var(--ec-ice); }
  .ec-color-strong { color: var(--ec-strong); }
  .ec-color-mute   { color: var(--ec-text-secondary); }
  .ec-color-faint  { color: var(--ec-text-tertiary); }

  /* ─────────────────────────────────────────────────────────
     §4.3 — CARD PRIMITIVE (THE moat)
     `overflow: hidden` + `isolation: isolate` prevent rim halo
     from bleeding into neighbors. The ::before halo is the
     ICE-blue rim signature of Arbra.
     ───────────────────────────────────────────────────────── */
  .ec-card {
    position: relative;
    background: var(--ec-l2-card);
    border: 1px solid var(--ec-border-faint);
    border-top: 1px solid var(--ec-ice-g15);   /* rim hairline */
    border-radius: var(--ec-r-card);
    padding: var(--ec-s5);
    box-shadow: var(--ec-rim);
    isolation: isolate;
    overflow: hidden;
  }

  /* The rim halo — pseudo-element layered on top */
  .ec-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 48px;
    background: linear-gradient(180deg,
      var(--ec-ice-g40) 0%,
      var(--ec-ice-g15) 30%,
      var(--ec-ice-g04) 60%,
      transparent 100%
    );
    pointer-events: none;
    opacity: 0.55;
    z-index: 0;
  }

  .ec-card > * {
    position: relative;
    z-index: 1;
  }

  /* ── Variants ─────────────────────────────────────────── */

  .ec-card--focused {
    box-shadow: var(--ec-rim-focus);
    border-top-color: var(--ec-ice-g25);
  }

  .ec-card--focused::before {
    opacity: 0.75;
    background: linear-gradient(180deg,
      rgba(184, 235, 255, 0.45) 0%,
      var(--ec-ice-g25) 30%,
      var(--ec-ice-g08) 60%,
      transparent 100%
    );
  }

  .ec-card--quiet {
    box-shadow: var(--ec-rim-quiet);
    border-top: 1px solid var(--ec-border-faint);
  }

  .ec-card--quiet::before {
    display: none;
  }

  .ec-card--live::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid var(--ec-ice-g25);
    pointer-events: none;
    animation: ec-breathe 2.5s var(--ec-ease-in-out) infinite;
    z-index: 2;
  }

  /* ─────────────────────────────────────────────────────────
     §4.4 — NESTED MINI-CARD (the 2x2 signature)
     ───────────────────────────────────────────────────────── */
  .ec-mini-card {
    background: var(--ec-l3-nested);
    border: 1px solid var(--ec-border-inner);
    border-radius: var(--ec-r-nested);
    padding: var(--ec-s4);
    display: flex;
    flex-direction: column;
    gap: var(--ec-s2);
    min-height: 84px;
  }
  /* No rim on mini-cards. L3 darker + tighter radius enforces hierarchy. */

  .ec-mini-card__label {
    font: 600 10px/1 var(--ec-f-mono);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ec-text-tertiary);
  }

  .ec-mini-card__primary {
    font: 600 22px/1.1 var(--ec-f-display);
    color: var(--ec-text-primary);
    letter-spacing: -0.01em;
  }
  .ec-mini-card__primary--mono {
    font: 600 20px/1.2 var(--ec-f-mono);
  }
  .ec-mini-card__sub {
    font: 500 11px/1.3 var(--ec-f-mono);
    color: var(--ec-text-secondary);
    letter-spacing: 0.02em;
  }
  .ec-mini-card__sub--strong { color: var(--ec-strong); }
  .ec-mini-card__sub--ice    { color: var(--ec-ice); }

  .ec-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--ec-s2);
  }

  /* ─────────────────────────────────────────────────────────
     §4.5 — PILL SYSTEM (ice / strong / ghost / alert)
     ───────────────────────────────────────────────────────── */
  .ec-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--ec-s1);
    padding: 5px 10px;
    border-radius: var(--ec-r-pill);
    font: 500 11px/1 var(--ec-f-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .ec-pill--ice {
    color: var(--ec-ice);
    background: var(--ec-ice-g08);
    border: 1px solid var(--ec-ice-g20);
  }

  .ec-pill--strong {
    color: var(--ec-strong);
    background: var(--ec-strong-g12);
    border: 1px solid transparent;
  }

  .ec-pill--ghost {
    color: var(--ec-ice);
    background: transparent;
    border: none;
    padding: 5px 0;
  }

  .ec-pill--alert {
    color: var(--ec-alert);
    background: var(--ec-alert-g12);
    border: 1px solid transparent;
  }

  .ec-pill__dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
  }

  .ec-pill__dot--breathe {
    animation: ec-dot-breathe 1800ms var(--ec-ease-in-out) infinite;
  }

  /* ─────────────────────────────────────────────────────────
     §4.6 — INITIAL CHIP
     ───────────────────────────────────────────────────────── */
  .ec-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--ec-r-chip);
    background: var(--ec-ice-g08);
    border: 1px solid var(--ec-ice-g20);
    color: var(--ec-ice);
    font: 500 11px/1 var(--ec-f-mono);
  }

  .ec-chip-row {
    display: inline-flex;
    gap: var(--ec-s1);
  }

  /* ─────────────────────────────────────────────────────────
     §4.7 — BUTTONS (primary / secondary / ghost / icon / full)
     44px min height — iOS minimum tap target rule.
     ───────────────────────────────────────────────────────── */
  .ec-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ec-s2);
    height: 44px;
    padding: 0 var(--ec-s5);
    border-radius: 10px;
    font: 500 14px/1 var(--ec-f-sans);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    background: transparent;
    border: 0;
    color: var(--ec-text-primary);
    transition:
      background var(--ec-dur-fast) var(--ec-ease-out),
      transform var(--ec-dur-fast) var(--ec-ease-out),
      box-shadow var(--ec-dur-fast) var(--ec-ease-out);
  }

  .ec-btn:active {
    transform: scale(0.97);
  }

  .ec-btn--primary {
    background: var(--ec-ice);
    color: var(--ec-l0-void);
    font-weight: 600;
  }
  .ec-btn--primary:active {
    background: var(--ec-ice-bright);
  }

  .ec-btn--secondary {
    background: var(--ec-ice-g08);
    color: var(--ec-ice);
    border: 1px solid var(--ec-ice-g20);
  }
  .ec-btn--secondary:active {
    background: var(--ec-ice-g15);
  }

  .ec-btn--ghost {
    background: transparent;
    color: var(--ec-text-secondary);
  }
  .ec-btn--ghost:active {
    background: rgba(255, 255, 255, 0.04);
    color: var(--ec-text-primary);
  }

  .ec-btn--full {
    width: 100%;
  }

  .ec-btn--icon-only {
    width: 44px;
    padding: 0;
  }

  /* ─────────────────────────────────────────────────────────
     §4.8 — INPUT (base / search / syn)
     CRITICAL: .ec-input--syn uses 16px font-size to avoid the
     iOS Safari auto-zoom-on-focus bug.
     ───────────────────────────────────────────────────────── */
  .ec-input {
    display: block;
    width: 100%;
    height: 48px;
    padding: 0 var(--ec-s4);
    background: var(--ec-l3-inset);
    border: 1px solid var(--ec-border-inner);
    border-radius: 10px;
    color: var(--ec-text-primary);
    font: 400 15px/1 var(--ec-f-sans);
    -webkit-appearance: none;
    appearance: none;
    transition: border-color var(--ec-dur-fast) var(--ec-ease-out);
  }

  .ec-input::placeholder { color: var(--ec-text-tertiary); }

  .ec-input:focus {
    outline: none;
    border-color: var(--ec-ice-g25);
    box-shadow: 0 0 0 3px var(--ec-ice-g08);
  }

  .ec-input--search {
    padding-left: 44px;
    /* Inline ICE-tinted search-glass SVG */
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2388ddff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='M21 21l-4.35-4.35'/></svg>");
    background-position: 16px center;
    background-repeat: no-repeat;
    background-size: 18px 18px;
  }

  /* The Syn-chat ask input — taller, more presence, 16px to avoid iOS zoom */
  .ec-input--syn {
    height: 56px;
    background: var(--ec-l3-nested);
    border-radius: 14px;
    font-size: 16px;
    padding-right: 56px;
  }

  /* ─────────────────────────────────────────────────────────
     §4.9 — TOPBAR (workspace breadcrumb + actions)
     ───────────────────────────────────────────────────────── */
  .ec-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 var(--ec-s4);
    background: var(--ec-l1-slab);
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--ec-border-faint);
  }

  .ec-topbar__breadcrumb {
    font: 600 10px/1 var(--ec-f-mono);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ec-text-tertiary);
    display: flex;
    align-items: center;
    gap: var(--ec-s2);
  }

  .ec-topbar__breadcrumb-active {
    color: var(--ec-text-primary);
  }

  .ec-topbar__actions {
    display: flex;
    align-items: center;
    gap: var(--ec-s2);
  }

  .ec-topbar__back {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ec-text-secondary);
    margin-left: -8px;
    background: transparent;
    border: 0;
  }

  /* ─────────────────────────────────────────────────────────
     §4.10 — BOTTOM DOCK + SYN-EYE
     5-slot grid: Home / Pipeline / [Syn-eye 88px] / Activity / Settings
     ───────────────────────────────────────────────────────── */
  .ec-dock {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: var(--ec-l1-slab);
    border-radius: var(--ec-r-dock) var(--ec-r-dock) 0 0;
    box-shadow: var(--ec-dock-shadow);
    display: grid;
    grid-template-columns: 1fr 1fr 88px 1fr 1fr;
    align-items: center;
    padding: 0 var(--ec-s2) env(safe-area-inset-bottom);
    z-index: 100;
  }

  .ec-dock__slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 56px;
    color: var(--ec-text-tertiary);
    font: 500 10px/1 var(--ec-f-sans);
    -webkit-tap-highlight-color: transparent;
    transition: color var(--ec-dur-fast) var(--ec-ease-out);
    position: relative;
    background: transparent;
    border: 0;
    cursor: pointer;
  }

  .ec-dock__slot--active {
    color: var(--ec-ice);
  }

  .ec-dock__slot--active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: var(--ec-ice);
    border-radius: 0 0 2px 2px;
  }

  .ec-dock__icon {
    width: 24px;
    height: 24px;
  }

  /* ── The Syn-eye center button ─────────────────────────── */
  .ec-syn-eye {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 35%,
      var(--ec-ice-bright) 0%,
      var(--ec-ice) 35%,
      var(--ec-ice-deep) 100%);
    box-shadow:
      0 0 24px -4px var(--ec-ice-g40),
      0 0 64px -16px var(--ec-ice-g25),
      inset 0 -2px 4px 0 rgba(0, 0, 0, 0.3),
      inset 0 2px 4px 0 rgba(255, 255, 255, 0.2);
    margin-top: -16px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    border: 0;
    cursor: pointer;
    padding: 0;
  }

  .ec-syn-eye__pupil {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--ec-l0-void);
    position: relative;
    transition: transform var(--ec-dur-slow) var(--ec-ease-out);
  }

  .ec-syn-eye__pupil::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 3px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--ec-ice-bright);
    opacity: 0.9;
  }

  .ec-syn-eye--active {
    animation: ec-eye-pulse 2200ms var(--ec-ease-in-out) infinite;
  }

  /* §5.7.1 — Syn-eye gaze (thinking state — pupil rises 2px) */
  .ec-syn-eye--thinking .ec-syn-eye__pupil {
    transform: translateY(-2px);
  }

  .ec-syn-eye__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--ec-strong);
    color: var(--ec-l0-void);
    font: 600 11px/20px var(--ec-f-mono);
    text-align: center;
    border: 2px solid var(--ec-l1-slab);
  }

  /* ─────────────────────────────────────────────────────────
     §4.11 — BOTTOM SHEET
     Includes backdrop-filter fallback for legacy browsers.
     ───────────────────────────────────────────────────────── */
  .ec-sheet-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(2, 3, 10, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--ec-dur-normal) var(--ec-ease-out);
  }

  /* Fallback when backdrop-filter unsupported */
  @supports not ((backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px))) {
    .ec-sheet-backdrop {
      background: rgba(2, 3, 10, 0.92);
    }
  }

  .ec-sheet-backdrop--open {
    opacity: 1;
    pointer-events: auto;
  }

  .ec-sheet {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 85dvh;
    background: var(--ec-l1-slab);
    border-radius: var(--ec-r-sheet);
    z-index: 201;
    transform: translateY(100%);
    transition: transform var(--ec-dur-normal) var(--ec-ease-out);
    padding: var(--ec-s4) var(--ec-s4) var(--ec-s8);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ec-sheet--open {
    transform: translateY(0);
  }

  .ec-sheet::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--ec-text-quaternary);
    margin: 0 auto var(--ec-s4);
  }

  .ec-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: var(--ec-s4);
    margin-bottom: var(--ec-s4);
    border-bottom: 1px solid var(--ec-border-faint);
  }

  .ec-sheet__title {
    font: 600 18px/1.2 var(--ec-f-display);
    color: var(--ec-text-primary);
  }

  .ec-sheet__close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ec-text-tertiary);
    background: transparent;
    border: 0;
    cursor: pointer;
  }

  /* ─────────────────────────────────────────────────────────
     §4.12 — SYN PANEL + SYN APPROVAL CARD
     Three states: collapsed (in dock), peek (60%), full (15%).
     ───────────────────────────────────────────────────────── */
  .ec-syn-panel {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--ec-l2-card);
    border-top: 1px solid var(--ec-ice-g20);
    border-radius: var(--ec-r-sheet);
    box-shadow:
      0 -1px 0 0 var(--ec-ice-g25),
      0 -8px 40px -8px var(--ec-ice-g15);
    z-index: 150;
    transform: translateY(100%);
    transition: transform var(--ec-dur-normal) var(--ec-ease-out);
    max-height: 85dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: var(--ec-s4);
  }

  .ec-syn-panel--peek  { transform: translateY(60%); }
  .ec-syn-panel--full  { transform: translateY(15%); }

  .ec-syn-panel__header {
    display: flex;
    align-items: center;
    gap: var(--ec-s2);
    padding: var(--ec-s3) var(--ec-s4);
    margin: calc(var(--ec-s4) * -1) calc(var(--ec-s4) * -1) var(--ec-s3);
    border-bottom: 1px solid var(--ec-border-faint);
  }

  .ec-syn-panel__name {
    font: 500 14px/1 var(--ec-f-sans);
    color: var(--ec-text-primary);
  }

  .ec-syn-panel__meta {
    font: 500 11px/1 var(--ec-f-mono);
    color: var(--ec-text-tertiary);
    margin-left: auto;
  }

  .ec-syn-approval {
    background: var(--ec-l3-nested);
    border: 1px solid var(--ec-ice-g20);
    border-radius: var(--ec-r-nested);
    padding: var(--ec-s4);
    margin: var(--ec-s3) 0;
    position: relative;
  }

  .ec-syn-approval::before {
    content: '';
    position: absolute;
    top: 0;
    left: 16px;
    right: 16px;
    height: 1px;
    background: linear-gradient(90deg,
      transparent 0%,
      var(--ec-ice-g40) 50%,
      transparent 100%
    );
  }

  .ec-syn-approval__plan {
    display: flex;
    flex-direction: column;
    gap: var(--ec-s2);
    margin-top: var(--ec-s3);
  }

  .ec-syn-approval__step {
    display: flex;
    align-items: center;
    gap: var(--ec-s2);
    font: 500 13px/1 var(--ec-f-mono);
    color: var(--ec-text-primary);
  }

  .ec-syn-approval__step--done { color: var(--ec-strong); }
  .ec-syn-approval__step--pending { color: var(--ec-text-secondary); }

  .ec-syn-approval__step::before {
    content: '✓';
    width: 16px;
    text-align: center;
    font-weight: 600;
  }
  .ec-syn-approval__step--pending::before { content: '○'; }

  /* ─────────────────────────────────────────────────────────
     §4.13 — MOTION PRIMITIVES
     Five canonical keyframes + the tap-response scale.
     ───────────────────────────────────────────────────────── */

  /* Tap response — every interactive element */
  .ec-btn:active,
  .ec-card:active,
  .ec-pill:active {
    transform: scale(0.97);
    transition: transform var(--ec-dur-instant) var(--ec-ease-out);
  }

  /* ─────────────────────────────────────────────────────────
     §5.7 — INSIGHT-LAYER MICRO-INTERACTIONS (Day 5)
     CSS support for the 5 interactions; JS hooks live inline
     in index.html extending the existing arbra:* namespace.
     ───────────────────────────────────────────────────────── */

  /* §5.7.2 — Card breathing on data updates (pulse-once) */
  .ec-card--pulse-once {
    animation: ec-pulse-once 600ms var(--ec-ease-out);
  }

  /* §5.7.3 — Voice copy fade-in
     Voice arrives last, like someone speaking after a breath.
     400ms ease-out + 200ms delay. Pure CSS, no JS. */
  .ec-t-voice-body,
  .ec-t-voice-sm,
  .ec-t-voice-name {
    animation: ec-voice-enter 400ms 200ms both var(--ec-ease-out);
  }

  /* §5.7.4 — Approval card glow on appearance */
  .ec-syn-approval--entering {
    animation: ec-approval-arrive 1200ms var(--ec-ease-out) both;
  }

  /* §5.7.5 — Bottom-dock contextual hint
     1px ICE line under the active dock slot when Syn has a
     high-confidence proactive draft ready for that section. */
  [data-syn-suggests="pipeline"] .ec-dock__slot[data-route="pipeline"]::after,
  [data-syn-suggests="customers"] .ec-dock__slot[data-route="customers"]::after,
  [data-syn-suggests="activity"] .ec-dock__slot[data-route="activity"]::after,
  [data-syn-suggests="home"] .ec-dock__slot[data-route="home"]::after,
  [data-syn-suggests="settings"] .ec-dock__slot[data-route="settings"]::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 25%;
    right: 25%;
    height: 1px;
    background: var(--ec-ice);
  }

  /* ─────────────────────────────────────────────────────────
     §4.15 — ACCESSIBILITY
     Focus states + reduce-motion + WCAG AA verified contrast
     pairings (see spec §4.15 table — all primary/secondary
     pairings AA-compliant; tertiary AA-large only).
     ───────────────────────────────────────────────────────── */
  :focus-visible {
    outline: 2px solid var(--ec-ice);
    outline-offset: 2px;
    border-radius: 4px;
  }

  .ec-card:focus-visible,
  .ec-pill:focus-visible,
  .ec-btn:focus-visible,
  .ec-input:focus-visible,
  .ec-dock__slot:focus-visible,
  .ec-syn-eye:focus-visible {
    outline: 2px solid var(--ec-ice);
    outline-offset: 2px;
  }

} /* end @media (max-width: 767px) */

/* ═══════════════════════════════════════════════════════════
   KEYFRAMES — declared OUTSIDE @media so prefers-reduced-motion
   override can blanket them. (Animations only PLAY inside the
   mobile breakpoint because elements with these classes are
   only rendered/styled at mobile widths.)
   ═══════════════════════════════════════════════════════════ */

@keyframes ec-breathe {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 0.9; }
}

@keyframes ec-dot-breathe {
  0%, 100% { opacity: 0.5; transform: scale(0.85); }
  50%      { opacity: 1.0; transform: scale(1.0); }
}

@keyframes ec-eye-pulse {
  0%, 100% {
    box-shadow:
      0 0 24px -4px var(--ec-ice-g40),
      0 0 64px -16px var(--ec-ice-g25),
      inset 0 -2px 4px 0 rgba(0, 0, 0, 0.3),
      inset 0 2px 4px 0 rgba(255, 255, 255, 0.2);
  }
  50% {
    box-shadow:
      0 0 32px -2px var(--ec-ice-g40),
      0 0 96px -16px var(--ec-ice-g40),
      inset 0 -2px 4px 0 rgba(0, 0, 0, 0.3),
      inset 0 2px 4px 0 rgba(255, 255, 255, 0.3);
  }
}

/* §5.7.2 — pulse-once on data update (card rim swells then back) */
@keyframes ec-pulse-once {
  0%, 100% { box-shadow: var(--ec-rim); }
  50% {
    box-shadow:
      0 -1px 0 0 var(--ec-ice-g40),
      0 0 48px -8px var(--ec-ice-g25),
      inset 0 1px 0 0 rgba(255, 255, 255, 0.03),
      inset 0 -1px 0 0 rgba(0, 0, 0, 0.4),
      0 2px 16px -4px rgba(0, 0, 0, 0.7);
  }
}

/* §5.7.3 — voice copy enter (fade-in + small lift) */
@keyframes ec-voice-enter {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* §5.7.4 — approval card arrive (slide + glow + settle) */
@keyframes ec-approval-arrive {
  0% {
    transform: translateY(20px);
    opacity: 0;
    border-color: var(--ec-ice-g40);
  }
  20% {
    transform: translateY(0);
    opacity: 1;
  }
  50% {
    border-color: var(--ec-ice);
    box-shadow: 0 0 32px -8px var(--ec-ice-g40);
  }
  100% {
    border-color: var(--ec-ice-g20);
    box-shadow: 0 0 0 transparent;
  }
}

/* ═══════════════════════════════════════════════════════════
   REDUCE-MOTION — honor user preference universally
   ═══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .ec-card--live::after,
  .ec-pill__dot--breathe,
  .ec-syn-eye--active,
  .ec-card--pulse-once,
  .ec-syn-approval--entering,
  .ec-t-voice-body,
  .ec-t-voice-sm,
  .ec-t-voice-name {
    animation: none !important;
  }
  .ec-card--live::after { opacity: 0.7; }
  .ec-syn-eye--active {
    box-shadow:
      0 0 32px -2px var(--ec-ice-g40),
      0 0 64px -16px var(--ec-ice-g25),
      inset 0 -2px 4px 0 rgba(0, 0, 0, 0.3),
      inset 0 2px 4px 0 rgba(255, 255, 255, 0.2);
  }
  /* Reset voice elements to fully visible (no enter animation) */
  .ec-t-voice-body,
  .ec-t-voice-sm,
  .ec-t-voice-name {
    opacity: 1;
    transform: none;
  }
  * { transition-duration: 0.01ms !important; }
}

/* ═══════════════════════════════════════════════════════════
   §4.16 — TABLET / DESKTOP SCALE-UP HOOKS
   Dock fades out at 768px; spacing token enlargement applied.
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
  :root {
    --ec-s4: 20px;
    --ec-s5: 24px;
    --ec-s6: 32px;
  }
  /* Mobile-only surfaces stay hidden on desktop (already
     declared display:none at top of stylesheet). */
}

/* ═══════════════════════════════════════════════════════════
   END eclipse-mobile.css
   ═══════════════════════════════════════════════════════════ */
