/* Eides components. Every value is a token from tokens.css; nothing here declares a colour, size or speed of its own. */

.ei { font-family: var(--font-sans); color: var(--ink); -webkit-font-smoothing: antialiased; }
.ei * { box-sizing: border-box; }
.ei :focus-visible { outline: var(--stroke-focus) solid var(--focus); outline-offset: 2px; }

/* Button */
.ei-btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font: 600 15px/1 var(--font-sans); letter-spacing: -0.005em;
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-1);
  border: var(--stroke-hair) solid transparent; cursor: pointer; text-decoration: none;
  transition: background-color var(--dur-tick) var(--ease-instrument), border-color var(--dur-tick) var(--ease-instrument), color var(--dur-tick) var(--ease-instrument), transform var(--dur-tick) var(--ease-instrument);
}
.ei-btn:active { transform: translateY(1px); }
.ei-btn--primary { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.ei-btn--primary:hover { background: var(--ink-muted); border-color: var(--ink-muted); }
.ei-btn--secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.ei-btn--secondary:hover { background: var(--surface-100); border-color: var(--ink); }
.ei-btn--quiet { background: transparent; color: var(--ink-muted); padding-left: var(--space-2); padding-right: var(--space-2); }
.ei-btn--quiet:hover { color: var(--ink); background: var(--surface-200); }
.ei-btn[disabled] { color: var(--ink-faint); background: var(--surface-200); border-color: var(--surface-200); cursor: not-allowed; }
.ei-btn .ei-kbd { font: 500 11px/1 var(--font-mono); letter-spacing: 0.08em; opacity: 0.7; padding: 2px var(--space-1); border: var(--stroke-hair) solid currentColor; border-radius: var(--radius-1); }

/* StateChip */
.ei-chip {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font: 500 11px/1.2 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase;
  padding: var(--space-1) var(--space-2) var(--space-1) var(--space-2); border-radius: var(--radius-pill);
  background: var(--surface-200); color: var(--ink-muted); white-space: nowrap;
  transition: background-color var(--dur-tick) var(--ease-instrument), color var(--dur-tick) var(--ease-instrument);
}
.ei-chip::before { content: ""; width: 6px; height: 6px; border-radius: var(--radius-pill); background: var(--line-strong); flex: none; }
.ei-chip--unresolved { background: var(--laser-tint); color: var(--laser-ink); }
.ei-chip--unresolved::before { background: var(--laser); }
.ei-chip--selected { background: var(--ice-tint); color: var(--ice-ink); }
.ei-chip--selected::before { background: var(--ice); outline: var(--stroke-hair) solid var(--ice-ink); outline-offset: -1px; }
.ei-chip--resolved { background: var(--resolved-tint); color: var(--resolved-ink); }
.ei-chip--resolved::before { background: var(--resolved); }
.ei-chip--live { background: var(--nerve-tint); color: var(--nerve-ink); }
.ei-chip--live::before { background: var(--nerve); box-shadow: 0 0 0 0 var(--nerve); animation: ei-breathe 1800ms var(--ease-draw) infinite; }
@keyframes ei-breathe { 0% { box-shadow: 0 0 0 0 var(--nerve); opacity: 1; } 70% { box-shadow: 0 0 0 5px transparent; opacity: 0.8; } 100% { box-shadow: 0 0 0 0 transparent; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ei-chip--live::before { animation: none; } }

/* Readout */
.ei-readout {
  display: grid; gap: var(--space-1); padding: var(--space-4); min-width: 0;
  background: var(--surface-100); border: var(--stroke-hair) solid var(--line); border-radius: var(--radius-1);
}
.ei-readout__label { font: 500 11px/1.2 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-muted); }
.ei-readout__value { font: 500 48px/1 var(--font-mono); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--ink); }
.ei-readout__value small { font-size: 24px; letter-spacing: -0.01em; color: var(--ink-muted); margin-left: var(--space-1); }
.ei-readout__note { font: 400 13px/1.45 var(--font-sans); color: var(--ink-muted); }
.ei-readout--unresolved .ei-readout__value { color: var(--laser-ink); }
.ei-readout--resolved .ei-readout__value { color: var(--resolved-ink); }
.ei-readout--live .ei-readout__value { color: var(--nerve-ink); }

/* ModelFrame: corner ticks mark a live instrument */
.ei-frame { position: relative; background: var(--surface-200); border-radius: var(--radius-0); min-width: 0; }
.ei-frame__ticks { position: absolute; inset: 0; pointer-events: none; }
.ei-frame__ticks i { position: absolute; width: var(--space-3); height: var(--space-3); border: 0 solid var(--line-strong); }
.ei-frame__ticks i:nth-child(1) { left: 0; top: 0; border-left-width: var(--stroke-rule); border-top-width: var(--stroke-rule); }
.ei-frame__ticks i:nth-child(2) { right: 0; top: 0; border-right-width: var(--stroke-rule); border-top-width: var(--stroke-rule); }
.ei-frame__ticks i:nth-child(3) { left: 0; bottom: 0; border-left-width: var(--stroke-rule); border-bottom-width: var(--stroke-rule); }
.ei-frame__ticks i:nth-child(4) { right: 0; bottom: 0; border-right-width: var(--stroke-rule); border-bottom-width: var(--stroke-rule); }
.ei-frame__bar { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); padding: var(--space-3) var(--space-4); border-bottom: var(--stroke-hair) solid var(--line); }
.ei-frame__facts { display: flex; gap: var(--space-4); font: 500 11px/1.2 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-muted); flex-wrap: wrap; }
.ei-frame__facts b { color: var(--ink); font-weight: 500; }
.ei-frame__view { position: relative; display: block; width: 100%; }
.ei-frame__view canvas { display: block; width: 100%; height: auto; }
.ei-frame__hud { position: absolute; left: var(--space-4); bottom: var(--space-4); display: grid; gap: var(--space-1); padding: var(--space-2) var(--space-3); background: var(--surface-100); border: var(--stroke-hair) solid var(--line); border-radius: var(--radius-2); box-shadow: var(--shadow-float); font: 400 13px/1.4 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink-muted); }
.ei-frame__hud b { color: var(--ink); font-weight: 500; }

/* ClashList */
.ei-table { width: 100%; border-collapse: collapse; font: 400 15px/1.5 var(--font-sans); color: var(--ink); background: var(--surface-100); border: var(--stroke-hair) solid var(--line); border-radius: var(--radius-0); }
.ei-table th { text-align: left; font: 500 11px/1.2 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-muted); background: var(--surface-200); padding: var(--space-3); border-bottom: var(--stroke-hair) solid var(--line); }
.ei-table td { padding: var(--space-3); border-bottom: var(--stroke-hair) solid var(--line); vertical-align: middle; }
.ei-table tr:last-child td { border-bottom: 0; }
.ei-table td.ei-num, .ei-table th.ei-num { font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.ei-table tr.is-selected td { background: var(--ice-tint); }
.ei-table tr:hover td { background: var(--surface-000); }
.ei-table tr.is-selected:hover td { background: var(--ice-tint); }
.ei-table .ei-id { font: 400 13px/1.4 var(--font-mono); color: var(--ink-muted); }

/* ProgressLine: resolved vs unresolved as a line, never a bar with a percentage */
.ei-line { display: grid; gap: var(--space-2); }
.ei-line__track { position: relative; height: var(--stroke-rule); background: var(--laser); border-radius: 0; overflow: hidden; }
.ei-line__done { position: absolute; left: 0; top: 0; bottom: 0; background: var(--resolved); transform-origin: left; transition: width var(--dur-draw) var(--ease-draw); }
.ei-line__row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-4); }
.ei-line__fig { font: 500 24px/1.1 var(--font-mono); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.ei-line__fig.ei-res { color: var(--resolved-ink); }
.ei-line__fig.ei-open { color: var(--laser-ink); }

/* Teaser (social square or wide) */
.ei-teaser { position: relative; display: flex; flex-direction: column; justify-content: space-between; aspect-ratio: 1 / 1; padding: var(--space-6); background: var(--surface-inverse); color: var(--on-inverse); border-radius: var(--radius-0); min-width: 0; }
.ei-teaser--wide { aspect-ratio: 16 / 9; }
.ei-teaser__top { display: flex; justify-content: space-between; align-items: center; }
.ei-teaser__top img { height: 20px; width: auto; display: block; }
.ei-teaser__num { font: 500 11px/1.2 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.7; }
.ei-teaser__h { margin: 0; font: 600 40px/1 var(--font-sans); letter-spacing: -0.025em; text-wrap: balance; }
.ei-teaser__h em { font-style: normal; color: var(--laser-on-inverse); }
.ei-teaser__h .ei-fig { font: 500 40px/1 var(--font-mono); letter-spacing: -0.06em; color: var(--laser-on-inverse); font-variant-numeric: tabular-nums; }
.ei-teaser__foot { font: 400 15px/1.5 var(--font-sans); opacity: 0.7; }

/* Pulse: the live line */
.ei-pulse { display: grid; gap: var(--space-3); padding: var(--space-4); background: var(--surface-100); border: var(--stroke-hair) solid var(--line); border-radius: var(--radius-1); }
.ei-pulse svg { display: block; width: 100%; height: auto; overflow: visible; }
.ei-pulse__grid { stroke: var(--line); stroke-width: 1; }
.ei-pulse__path { fill: none; stroke: var(--nerve); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ei-pulse__dot { fill: var(--nerve); }
.ei-pulse__head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); }
.ei-pulse__title { font: 600 20px/1.3 var(--font-sans); letter-spacing: -0.01em; }
.ei-pulse__meta { font: 400 13px/1.4 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink-muted); }
@media (prefers-reduced-motion: no-preference) {
  .ei-pulse__path.is-drawing { stroke-dasharray: var(--ei-len, 1000); stroke-dashoffset: var(--ei-len, 1000); animation: ei-draw var(--dur-draw) var(--ease-draw) forwards; }
  @keyframes ei-draw { to { stroke-dashoffset: 0; } }
}
