/*
 * css/widgets.css: widget bodies (js/widgets/**, js/charts.js). plan3's instrument anatomy from app/studio.css and
 * the preset widget styles from app/globals.css, namespaced .w-* so the studio shell's own rules never collide.
 * Colours come from css/tokens.css (copper -> green); fallbacks keep the lab page usable on its own.
 * Width rules use container queries on .w-root, so a widget adapts to its own size (canvas, list view, library card).
 */

.w-root {
  container: wroot / inline-size;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  color: var(--foreground, #f2ede2);
  font-family: var(--font-sans, "Geist", Arial, sans-serif);
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
.w-root *, .w-root *::before, .w-root *::after { box-sizing: border-box; }
:where(.w-root) :where(p, h3, dl, dd) { margin: 0; }
/* library cards style their own title strong; keep widget text at its own size inside previews */
.studio-preset .w-root strong { font-size: inherit; }
.w-root svg.w-ico { display: inline-block; width: 15px; height: 15px; flex-shrink: 0; }
.w-root a { color: inherit; }
.w-root .is-positive { color: var(--teal, #42b59a); }
.w-root .is-negative { color: var(--brick, #d76c5c); }
.w-root .w-ochre { color: var(--ochre, #c8ae62); }
.w-root .w-muted { color: var(--muted-foreground, #aaa294); font: 12px var(--font-mono, monospace); letter-spacing: 0; }

/* ------------------------------------------------------------------ instrument frame */

.w-root .w-instrument {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  padding: 17px 18px 12px;
  gap: 8px;
}
/* fixed parts keep their size; list bodies take the rest and scroll inside the widget (plan3 tables scroll in place) */
.w-root .w-instrument > * { flex-shrink: 0; min-width: 0; }
.w-root .w-instrument > :is(.w-watch, .w-compact, .w-perf, .w-tape-list, .w-list, .w-ext-list, .w-hold-list, .w-usage, .w-scroll, .w-note, .w-bars, .w-cats, .w-movers-grid) {
  flex: 1 1 auto;
  min-height: 44px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #3c4a40 transparent;
  overscroll-behavior: contain;
}
.w-root .w-instrument > .w-chart { flex: 1 1 auto; }
.w-root .w-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 20px;
  color: var(--muted-foreground, #aaa294);
  font: 12px/1.2 var(--font-mono, monospace);
  letter-spacing: .08em;
}
.w-root .w-kicker { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-root .w-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  max-width: 60%;
  color: var(--muted-foreground, #aaa294);
  letter-spacing: .04em;
  white-space: nowrap;
}
.w-root .w-chip > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.w-root .w-chip svg.w-ico { width: 11px; height: 11px; color: var(--green, #3fbf6e); }
.w-root .w-logo { --size: 20px; }
.w-root .w-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.w-root .w-value {
  display: block;
  margin-top: 6px;
  font: 400 clamp(26px, 10cqi, 42px)/1.2 var(--font-mono, monospace);
  letter-spacing: -.06em;
  overflow-wrap: anywhere;
}
.w-root .w-label { font-size: 14px; color: #b9b09f; }
.w-root .w-formula { font: 12px/1.6 var(--font-mono, monospace); color: var(--muted-foreground, #aaa294); overflow-wrap: anywhere; }
.w-root .w-condition .w-formula { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.w-root .w-metric .w-formula, .w-root .w-eth .w-formula { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }

.w-root .w-source {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #332d24;
  color: var(--muted-foreground, #aaa294);
  font-size: 12px;
}
.w-root .w-source > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-root .w-source > span:last-child { flex-shrink: 0; }
.w-root .w-src { display: inline-flex; align-items: center; gap: 6px; }
.w-root .w-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal, #42b59a);
  box-shadow: 0 0 0 3px rgba(66, 181, 154, .1);
}
.w-root .w-dot.is-bad { background: var(--brick, #d76c5c); box-shadow: 0 0 0 3px rgba(215, 108, 92, .12); }
.w-root .w-dot.is-wait { background: var(--ochre, #c8ae62); box-shadow: 0 0 0 3px rgba(200, 174, 98, .12); }
.w-root .w-dot.is-hit { background: var(--green, #3fbf6e); box-shadow: 0 0 0 3px rgba(63, 191, 110, .16); }

/* ------------------------------------------------------------------ states */

.w-root .w-loading { display: flex; flex-direction: column; gap: 16px; color: var(--muted-foreground, #aaa294); font-size: 12px; }
.w-root .w-loading i { display: block; height: 24px; border-radius: 4px; background: var(--muted, #26231f); animation: w-pulse 1.1s ease-in-out infinite; }
.w-root .w-loading i:nth-of-type(2) { height: 56px; width: 70%; }
.w-root .w-loading i:nth-of-type(3) { width: 45%; }
.w-root .w-loading small { font-size: 11px; color: #8f897e; }
.w-root .w-skeleton { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 8px 0 18px; }
.w-root .w-skeleton i { display: block; height: 18px; border-radius: 4px; background: var(--muted, #26231f); animation: w-pulse 1.1s ease-in-out infinite; }
.w-root .w-skeleton i:first-child { width: 58%; height: 28px; }
.w-root .w-skeleton i:last-child { width: 76%; }

.w-root .w-failure { justify-content: center; gap: 8px; color: var(--muted-foreground, #aaa294); }
.w-root .w-failure strong { color: var(--foreground, #f2ede2); font-size: 14px; font-weight: 600; }
.w-root .w-failure p { font-size: 12px; line-height: 1.6; }
.w-root .w-failure small { font: 11px/1.5 var(--font-mono, monospace); color: var(--brick, #d76c5c); overflow-wrap: anywhere; }
.w-root .w-failure .w-btn { align-self: flex-start; margin-top: 4px; }

.w-root .w-empty {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 8px;
  color: var(--muted-foreground, #aaa294);
  font-size: 12px;
  text-align: center;
  flex: 1;
}
.w-root .w-empty > svg.w-ico { width: 18px; height: 18px; color: var(--ochre, #c8ae62); }
.w-root .w-note-empty { padding: 18px 0; color: #998b78; font-size: 12px; line-height: 1.7; }

@keyframes w-pulse { 50% { opacity: .45; } }
@keyframes w-spin { to { transform: rotate(360deg); } }
.w-root svg.is-spinning { animation: w-spin .8s linear infinite; }

/* ------------------------------------------------------------------ controls */

.w-root .w-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--border, #3a352f);
  border-radius: 5px;
  background: transparent;
  color: var(--foreground, #f2ede2);
  font: 500 12px/1.2 var(--font-sans, sans-serif);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.w-root .w-btn:hover:not(:disabled):not(.is-primary) { background: #2c2923; }
.w-root .w-btn:disabled { opacity: .4; cursor: default; }
.w-root .w-btn svg.w-ico { width: 14px; height: 14px; }
.w-root .w-btn.is-primary { background: var(--green, #3fbf6e); border-color: var(--green, #3fbf6e); color: var(--primary-foreground, #0b130e); font-weight: 650; }
.w-root .w-btn.is-primary:hover:not(:disabled) { background: var(--green-hover, #5fd38a); border-color: var(--green-hover, #5fd38a); }
.w-root .w-icon-btn { padding: 6px; min-width: 32px; }
.w-root .w-icon-btn.is-on { color: var(--green, #3fbf6e); border-color: var(--green-soft, #2c4a36); }
.w-root .w-link { border: 0; padding: 0; background: none; color: var(--green, #3fbf6e); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.w-root .w-seg {
  min-height: 28px;
  padding: 4px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted-foreground, #aaa294);
  font: 600 11px/1 var(--font-sans, sans-serif);
  cursor: pointer;
}
.w-root .w-seg.is-on { background: var(--green-soft, #2c4a36); color: var(--foreground, #f2ede2); }
.w-root .w-seg:hover:not(.is-on):not(:disabled) { color: var(--foreground, #f2ede2); background: transparent; }
.w-root :is(button, a, input, select, summary, [tabindex]):focus-visible { outline: 2px solid var(--green, #3fbf6e); outline-offset: 2px; }
.w-root .w-tabs { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--border, #3a352f); border-radius: 7px; background: var(--muted, #26231f); letter-spacing: 0; }
.w-root .w-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.w-root .w-row-btns { display: inline-flex; gap: 6px; align-items: center; flex-shrink: 0; }

.w-root .w-field { display: flex; flex-direction: column; gap: 6px; color: #beb6a8; font-size: 12px; }
.w-root .w-input-wrap { display: flex; align-items: center; gap: 8px; border: 1px solid #3b362f; border-radius: 5px; background: var(--canvas, #151411); padding: 0 10px 0 0; }
.w-root .w-input-wrap em { flex-shrink: 0; color: var(--muted-foreground, #aaa294); font: 12px var(--font-mono, monospace); font-style: normal; }
.w-root .w-field input.w-input:not([type="checkbox"]):not([type="radio"]), .w-root .w-swap-line input.w-input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--foreground, #f2ede2);
  padding: 9px 10px;
  font: 400 15px var(--font-mono, monospace);
  outline: none;
}
.w-root .w-field input.w-input:not([type="checkbox"]):focus-visible { outline: none; }
.w-root .w-input-wrap:focus-within { border-color: var(--green, #3fbf6e); }
.w-root select.w-select {
  min-width: 0;
  max-width: 120px;
  border: 1px solid #3b362f;
  border-radius: 5px;
  background: var(--canvas, #151411);
  color: var(--foreground, #f2ede2);
  padding: 6px 8px;
  font: 600 13px var(--font-mono, monospace);
}

/* ------------------------------------------------------------------ chart */

.w-root .w-chart-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin-top: 5px; }
.w-root .w-chart-title strong { font: 400 27px/1.1 var(--font-mono, monospace); letter-spacing: -.04em; }
.w-root .w-chg { display: inline-flex; align-items: center; gap: 4px; font: 650 11px/1 var(--font-mono, monospace); white-space: nowrap; }
.w-root .w-chg svg.w-ico { width: 12px; height: 12px; }
.w-root .w-chg small { margin-left: 3px; color: #8f897e; font-weight: 500; }

.w-root .w-chart { position: relative; display: flex; flex-direction: column; gap: 6px; flex: 1; min-height: 128px; min-width: 0; }
.w-root .w-chart-plot { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; flex: 1; min-height: 78px; }
.w-root .w-chart-area { position: relative; min-height: 78px; border-radius: 4px; outline-offset: 4px; touch-action: pan-y; }
.w-root svg.w-chart-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; display: block; }
.w-root .w-grid { fill: none; stroke: currentColor; stroke-width: 1; opacity: .12; vector-effect: non-scaling-stroke; }
.w-root .w-zero { fill: none; stroke: var(--muted-foreground, #aaa294); stroke-width: 1; stroke-dasharray: 3 4; opacity: .55; vector-effect: non-scaling-stroke; }
.w-root .w-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.w-root .is-multi .w-line { stroke-width: 2; }
.w-root .w-area { opacity: .07; stroke: none; }
.w-root .w-chart-dot { position: absolute; width: 8px; height: 8px; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 2px var(--card, #1d1b18); pointer-events: none; }
.w-root .w-chart-endlabel { position: absolute; right: 10px; transform: translateY(-50%); padding: 1px 3px; border-radius: 3px; background: rgba(29, 27, 24, .82); color: var(--foreground, #f2ede2); font: 600 10px/1.2 var(--font-mono, monospace); pointer-events: none; }
.w-root .w-chart-range { display: flex; flex-direction: column; justify-content: space-between; padding: 2px 0; color: var(--muted-foreground, #aaa294); font: 12px/1 var(--font-mono, monospace); text-align: right; white-space: nowrap; }
.w-root .w-chart-hair { position: absolute; top: 0; bottom: 0; width: 1px; margin-left: -.5px; background: rgba(242, 237, 226, .38); pointer-events: none; }
.w-root .w-chart-tip {
  position: absolute;
  top: 2px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px 8px;
  border: 1px solid var(--border, #3a352f);
  border-radius: 6px;
  background: var(--popover, #24211d);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .35);
  font: 11px/1.25 var(--font-mono, monospace);
  white-space: nowrap;
  pointer-events: none;
}
.w-root .w-tip-date { color: var(--muted-foreground, #aaa294); font-size: 10px; }
.w-root .w-tip-row { display: flex; align-items: center; gap: 6px; }
.w-root .w-tip-row i { width: 10px; height: 2px; border-radius: 1px; }
.w-root .w-tip-row strong { font-weight: 600; color: var(--foreground, #f2ede2); }
.w-root .w-tip-row small { color: var(--muted-foreground, #aaa294); }
.w-root .w-chart-dates { display: flex; justify-content: space-between; gap: 10px; color: var(--muted-foreground, #aaa294); font: 12px/1.2 var(--font-mono, monospace); }
.w-root .w-chart-dates > span { white-space: nowrap; }
.w-root .w-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted-foreground, #aaa294); font: 11px var(--font-mono, monospace); }
.w-root .w-legend span { display: inline-flex; align-items: center; gap: 6px; }
.w-root .w-legend i { width: 12px; height: 2px; border-radius: 1px; }
.w-root .w-chart-data { font-size: 13px; }
.w-root .w-chart-data summary { cursor: pointer; padding: 4px 0; color: var(--foreground, #f2ede2); font-size: 13px; }
.w-root .w-chart-data .w-scroll { max-height: 190px; margin-top: 6px; }
.w-root .w-chart-data table, .w-root .w-table table { width: 100%; border-collapse: collapse; }
.w-root .w-chart-data caption { text-align: left; color: var(--muted-foreground, #aaa294); font-size: 12px; padding-bottom: 6px; caption-side: top; }
.w-root .w-chart-data th, .w-root .w-chart-data td { padding: 7px 8px; border-bottom: 1px solid var(--border, #3a352f); text-align: right; font: 400 12px var(--font-mono, monospace); white-space: nowrap; }
.w-root .w-chart-data th:first-child, .w-root .w-chart-data .w-l { text-align: left; }

.w-root svg.w-spark { display: block; width: 100%; height: 28px; overflow: visible; }
.w-root .w-spark path { fill: none; stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke: var(--muted-foreground, #aaa294); }
.w-root .w-spark.is-up path { stroke: var(--teal, #42b59a); }
.w-root .w-spark.is-down path { stroke: var(--brick, #d76c5c); }
.w-root .w-spark.is-flat path { stroke: var(--green, #3fbf6e); }
.w-root .w-spark.is-empty { height: 28px; border-bottom: 1px dashed var(--border, #3a352f); }
.w-root .w-spark-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; color: var(--muted-foreground, #aaa294); font-size: 11px; }

/* ------------------------------------------------------------------ tables (instruments) */

.w-root .w-scroll { overflow: auto; min-width: 0; max-width: 100%; scrollbar-width: thin; scrollbar-color: #3c4a40 transparent; overscroll-behavior-x: contain; }
.w-root .w-table th, .w-root .w-table td { padding: 8px 8px; border-bottom: 1px solid var(--border, #3a352f); text-align: right; font: 400 14px var(--font-mono, monospace); white-space: nowrap; }
.w-root .w-table thead th { position: sticky; top: 0; z-index: 2; background: var(--card, #1d1b18); color: var(--muted-foreground, #aaa294); font-size: 12px; padding-top: 4px; }
.w-root .w-table thead th.w-l { z-index: 3; }
.w-root .w-table .w-l { text-align: left; position: sticky; left: 0; z-index: 1; background: var(--card, #1d1b18); }
.w-root .w-table tbody tr.is-asset th, .w-root .w-table tbody tr.is-asset td { background-color: rgba(63, 191, 110, .05); }
.w-root .w-asset { display: inline-flex; align-items: center; gap: 8px; }
.w-root .w-asset small { color: #766c5f; font-size: 11px; }
.w-root .w-asset b { font-weight: 500; }
.w-root .w-table-note { font-size: 11px; }

/* ------------------------------------------------------------------ metric line, micro stats */

.w-root .w-metric-line { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; padding: 4px 0 6px; }
.w-root .w-metric-line > strong { font: 700 30px/1 var(--font-mono, monospace); letter-spacing: -.05em; overflow-wrap: anywhere; }
.w-root .w-micro { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.w-root .w-micro > div { min-width: 0; padding: 0 8px; border-right: 1px solid var(--border, #3a352f); }
.w-root .w-micro > div:first-child { padding-left: 0; }
.w-root .w-micro > div:last-child { border-right: 0; }
.w-root .w-micro dt { color: var(--muted-foreground, #aaa294); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-root .w-micro dd { margin-top: 5px; font: 620 13px/1.1 var(--font-mono, monospace); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-root .w-kv { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 0; }
.w-root .w-kv > div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--border, #3a352f); padding-bottom: 6px; }
.w-root .w-kv dt { color: var(--muted-foreground, #aaa294); font-size: 11px; }
.w-root .w-kv dd { font: 600 12px var(--font-mono, monospace); }
.w-root .w-stat-line { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted-foreground, #aaa294); font-size: 11px; }
.w-root .w-stat-line strong { margin-left: 4px; color: var(--foreground, #f2ede2); font: 700 15px var(--font-mono, monospace); letter-spacing: -.02em; }
.w-root .w-stat-line strong.is-positive { color: var(--teal, #42b59a); }
.w-root .w-stat-line strong.is-negative { color: var(--brick, #d76c5c); }

/* ------------------------------------------------------------------ watchlist, compact, performance */

.w-root .w-watch-head, .w-root .w-watch-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 84px; align-items: center; gap: 10px; min-height: 40px; border-top: 1px solid var(--border, #3a352f); }
.w-root .w-watch-head { position: sticky; top: 0; z-index: 1; background: var(--card, #1d1b18); min-height: 26px; color: var(--muted-foreground, #aaa294); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.w-root .w-watch-head span:nth-child(n+2), .w-root .w-watch-row > :nth-child(n+2) { justify-self: end; }
.w-root .w-watch-row > span:first-child { display: flex; align-items: center; gap: 8px; min-width: 0; }
.w-root .w-watch-row strong { font: 600 12px/1 var(--font-mono, monospace); }
.w-root .w-watch-row small { color: var(--muted-foreground, #aaa294); font-size: 10px; }
.w-root .w-watch-row.is-asset > span:first-child strong { color: var(--green-bright, #8fe0ad); }

.w-root .w-compact-head, .w-root .w-compact-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 76px; align-items: center; gap: 10px; min-height: 33px; border-top: 1px solid var(--border, #3a352f); }
.w-root .w-compact-head { position: sticky; top: 0; z-index: 1; background: var(--card, #1d1b18); min-height: 25px; color: var(--muted-foreground, #aaa294); font: 600 10px/1 var(--font-mono, monospace); letter-spacing: .06em; text-transform: uppercase; }
.w-root .w-compact-head span:nth-child(n+2), .w-root .w-compact-row > :nth-child(n+2) { justify-self: end; }
.w-root .w-compact-row > span:first-child { display: flex; align-items: center; gap: 8px; min-width: 0; }
.w-root .w-compact-row small { width: 16px; color: var(--muted-foreground, #aaa294); font: 500 10px/1 var(--font-mono, monospace); }
.w-root .w-compact-row strong { font: 600 12px/1 var(--font-mono, monospace); }
.w-root .w-compact-row.is-asset > span:first-child strong { color: var(--green-bright, #8fe0ad); }

.w-root .w-perf-row { display: grid; grid-template-columns: minmax(64px, .9fr) repeat(4, minmax(0, 1fr)); align-items: center; gap: 6px; min-height: 33px; border-top: 1px solid var(--border, #3a352f); }
.w-root .w-perf-head { position: sticky; top: 0; z-index: 1; background: var(--card, #1d1b18); min-height: 25px; color: var(--muted-foreground, #aaa294); font: 600 10px/1 var(--font-mono, monospace); text-transform: uppercase; }
.w-root .w-perf-row > :nth-child(n+2) { justify-self: stretch; text-align: center; }
.w-root .w-perf-row > strong { display: flex; align-items: center; gap: 6px; font: 600 12px/1 var(--font-mono, monospace); min-width: 0; }
.w-root .w-perf-row.is-asset > strong { color: var(--green-bright, #8fe0ad); }
.w-root .w-heat { display: block; padding: 6px 3px; border-radius: 5px; font: 600 10px/1 var(--font-mono, monospace); white-space: nowrap; }
.w-root .w-heat.is-flat { color: var(--muted-foreground, #aaa294); background: rgba(242, 237, 226, .04); }

/* ------------------------------------------------------------------ movers, breadth */

.w-root .w-movers-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.w-root .w-movers-grid section { min-width: 0; padding: 10px; border: 1px solid var(--border, #3a352f); border-radius: 7px; background: var(--surface-soft, #201e1a); }
.w-root .w-movers-grid h3 { margin: 0 0 7px; font: 650 11px/1 var(--font-mono, monospace); }
.w-root .w-mover-row { min-height: 31px; display: flex; align-items: center; justify-content: space-between; gap: 6px; border-top: 1px solid var(--border, #3a352f); font: 600 11px/1 var(--font-mono, monospace); }
.w-root .w-mover-row span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.w-root .w-mover-row strong { font-size: 11px; }

.w-root .w-breadth-title { display: flex; align-items: baseline; gap: 8px; }
.w-root .w-breadth-title strong { font: 700 28px/1 var(--font-mono, monospace); letter-spacing: -.04em; }
.w-root .w-breadth-title span { color: var(--muted-foreground, #aaa294); font-size: 12px; }
.w-root .w-breadth-track { height: 9px; overflow: hidden; border-radius: 99px; background: var(--brick, #d76c5c); }
.w-root .w-breadth-track i { display: block; height: 100%; background: var(--teal, #42b59a); border-right: 2px solid var(--card, #1d1b18); }
.w-root .w-breadth-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.w-root .w-breadth-counts div { padding: 9px; border: 1px solid var(--border, #3a352f); border-radius: 7px; background: var(--surface-soft, #201e1a); min-width: 0; }
.w-root .w-breadth-counts span, .w-root .w-breadth-counts strong { display: block; }
.w-root .w-breadth-counts span { color: var(--muted-foreground, #aaa294); font-size: 10px; }
.w-root .w-breadth-counts strong { margin-top: 6px; font: 700 17px/1 var(--font-mono, monospace); }
.w-root .w-breadth-median { display: flex; justify-content: space-between; color: var(--muted-foreground, #aaa294); font-size: 11px; }
.w-root .w-breadth-median strong { font-family: var(--font-mono, monospace); }

/* ------------------------------------------------------------------ bars, sectors, donut, gauge */

.w-root .w-bars { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 9px; }
.w-root .w-bar-item > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 5px; font: 600 11px/1.2 var(--font-mono, monospace); }
.w-root .w-bar-item > div > span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; }
.w-root .w-bar-item > div > span small { margin-left: 4px; color: var(--muted-foreground, #aaa294); font-weight: 500; }
.w-root .w-bar-item > div strong { color: var(--muted-foreground, #aaa294); white-space: nowrap; }
.w-root .w-bar-item.is-active > div > span { color: var(--green-bright, #8fe0ad); }
.w-root .w-bar-item > i { display: block; height: 4px; overflow: hidden; border-radius: 99px; background: var(--muted, #26231f); }
.w-root .w-bar-item > i b { display: block; height: 100%; border-radius: inherit; }
.w-root .tone-accent { background: var(--green, #3fbf6e); }
.w-root .tone-teal { background: var(--teal, #42b59a); }
.w-root .tone-brick { background: var(--brick, #d76c5c); }
.w-root .tone-ochre { background: var(--ochre, #c8ae62); }
.w-root .tone-muted, .w-root .w-bar-item.is-muted > i b { background: var(--muted-foreground, #aaa294); }

.w-root .w-cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.w-root .w-cat { min-width: 0; min-height: 74px; padding: 9px; border: 1px solid var(--border, #3a352f); border-radius: 7px; background-color: var(--surface-soft, #201e1a); }
.w-root .w-cat strong, .w-root .w-cat span, .w-root .w-cat b, .w-root .w-cat small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-root .w-cat strong { color: var(--foreground, #f2ede2); font-size: 11px; font-weight: 600; }
.w-root .w-cat span { margin-top: 5px; color: var(--muted-foreground, #aaa294); font: 500 10px/1 var(--font-mono, monospace); }
.w-root .w-cat b { margin-top: 6px; font: 700 12px/1 var(--font-mono, monospace); }
.w-root .w-cat.is-positive b { color: var(--teal, #42b59a); }
.w-root .w-cat.is-negative b { color: var(--brick, #d76c5c); }
.w-root .w-cat small { margin-top: 4px; color: var(--muted-foreground, #aaa294); font-size: 9px; }

.w-root .w-donut { width: 82px; height: 82px; display: grid; place-items: center; border-radius: 50%; flex-shrink: 0; }
.w-root .w-donut > span { width: 60px; height: 60px; display: grid; place-content: center; border-radius: 50%; background: var(--card, #1d1b18); text-align: center; }
.w-root .w-donut strong { font: 700 14px/1 var(--font-mono, monospace); }
.w-root .w-donut small { margin-top: 4px; color: var(--muted-foreground, #aaa294); font-size: 8px; }

.w-root .w-gauge { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.w-root .w-gauge svg { width: 132px; height: 74px; overflow: visible; display: block; }
.w-root .w-gauge-track { fill: none; stroke: var(--muted, #26231f); stroke-width: 9; stroke-linecap: round; }
.w-root .w-gauge-val { fill: none; stroke-width: 9; stroke-linecap: round; background: none; }
.w-root .w-gauge-val.tone-teal { stroke: var(--teal, #42b59a); }
.w-root .w-gauge-val.tone-brick { stroke: var(--brick, #d76c5c); }
.w-root .w-gauge-val.tone-muted { stroke: var(--muted-foreground, #aaa294); }
.w-root .w-gauge-tick { stroke: var(--muted-foreground, #aaa294); stroke-width: 1.5; }
.w-root .w-gauge-needle { stroke: var(--foreground, #f2ede2); stroke-width: 2; stroke-linecap: round; }
.w-root .w-gauge-hub { fill: var(--foreground, #f2ede2); }
.w-root .w-gauge-read { text-align: center; }
.w-root .w-gauge-read strong { display: block; font: 700 17px/1.1 var(--font-mono, monospace); }
.w-root .w-gauge-read small { color: var(--muted-foreground, #aaa294); font-size: 10px; }
.w-root .w-twap-body { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 16px; }
.w-root .w-mini-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--muted-foreground, #aaa294); font-size: 11px; }
.w-root .w-mini-list b { font: 600 11px var(--font-mono, monospace); color: var(--foreground, #f2ede2); }
.w-root .w-mini-list em { font-style: normal; }

/* ------------------------------------------------------------------ premium, morpho tables */

.w-root .w-prem, .w-root .w-morpho { min-width: 420px; }
.w-root .w-prem-row { display: grid; grid-template-columns: minmax(70px, 1fr) repeat(2, minmax(64px, .9fr)) minmax(70px, .9fr) minmax(56px, .8fr); align-items: center; gap: 8px; min-height: 32px; border-top: 1px solid var(--border, #3a352f); font: 600 11px/1 var(--font-mono, monospace); }
.w-root .w-prem-row > :nth-child(n+2) { justify-self: end; white-space: nowrap; }
.w-root .w-prem-row > strong { display: flex; align-items: center; gap: 6px; }
.w-root .w-prem-row small { color: var(--muted-foreground, #aaa294); font-size: 11px; }
.w-root .w-prem-head, .w-root .w-morpho-head { position: sticky; top: 0; z-index: 1; background: var(--card, #1d1b18); min-height: 25px; color: var(--muted-foreground, #aaa294); font: 600 10px/1 var(--font-mono, monospace); text-transform: uppercase; }
.w-root .w-prem-row.is-asset > strong, .w-root .w-morpho-row.is-asset > strong { color: var(--green-bright, #8fe0ad); }
.w-root .w-morpho-row { display: grid; grid-template-columns: minmax(80px, 1.1fr) repeat(3, minmax(60px, .9fr)) minmax(72px, .9fr); align-items: center; gap: 8px; min-height: 32px; border-top: 1px solid var(--border, #3a352f); font: 600 11px/1 var(--font-mono, monospace); }
.w-root .w-morpho-row > :nth-child(n+2) { justify-self: end; white-space: nowrap; }
.w-root .w-morpho-row > strong { display: flex; align-items: center; gap: 6px; }

/* ------------------------------------------------------------------ extended rows, profile */

.w-root .w-ext-list { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; }
.w-root .w-ext-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 38px; padding: 6px 0; border-top: 1px solid var(--border, #3a352f); }
.w-root .w-ext-row > span { min-width: 0; }
.w-root .w-ext-row strong, .w-root .w-ext-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-root .w-ext-row strong { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.w-root .w-ext-row small { margin-top: 3px; color: var(--muted-foreground, #aaa294); font-size: 10px; }
.w-root .w-ext-row b { flex: 0 0 auto; font: 650 11px/1 var(--font-mono, monospace); text-align: right; }
.w-root .w-ext-row.is-asset strong { color: var(--green-bright, #8fe0ad); }
.w-root .w-profile-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.w-root .w-profile-head > div { min-width: 0; }
.w-root .w-profile-head strong { display: block; font-size: 15px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-root .w-profile-head span { display: block; margin-top: 3px; color: var(--muted-foreground, #aaa294); font-size: 11px; }

/* ------------------------------------------------------------------ tape, flow, holdings, usage */

.w-root .w-tape-list { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; }
.w-root .w-tape-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto minmax(58px, auto); align-items: center; gap: 8px; min-height: 31px; border-top: 1px solid var(--border, #3a352f); font: 500 11px/1 var(--font-mono, monospace); }
.w-root .w-tape-row > span:nth-child(2) { color: var(--muted-foreground, #aaa294); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-root .w-tape-row b { font-weight: 650; white-space: nowrap; }
.w-root .w-tape-row small { justify-self: end; color: var(--muted-foreground, #aaa294); font-size: 10px; white-space: nowrap; }
.w-root .w-side { display: inline-flex; align-items: center; gap: 4px; font: 650 10px/1 var(--font-mono, monospace); letter-spacing: .04em; }
.w-root .w-side svg.w-ico { width: 12px; height: 12px; }
.w-root .w-side.is-buy { color: var(--teal, #42b59a); }
.w-root .w-side.is-sell { color: var(--brick, #d76c5c); }
.w-root a.w-tx { display: inline-flex; align-items: center; gap: 3px; color: var(--muted-foreground, #aaa294); text-decoration: none; }
.w-root a.w-tx:hover { color: var(--green, #3fbf6e); }
.w-root a.w-tx svg.w-ico { width: 10px; height: 10px; }
.w-root .w-flow { height: 6px; overflow: hidden; border-radius: 99px; background: var(--brick, #d76c5c); }
.w-root .w-flow i { display: block; height: 100%; background: var(--teal, #42b59a); border-right: 2px solid var(--card, #1d1b18); }
.w-root .w-flow-legend { display: flex; justify-content: space-between; gap: 8px; margin-top: -4px; font: 600 10px var(--font-mono, monospace); }

.w-root .w-hold-list { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; }
.w-root .w-hold-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 10px; row-gap: 5px; padding: 7px 0 8px; border-top: 1px solid var(--border, #3a352f); }
.w-root .w-hold-row > span { display: flex; align-items: center; gap: 8px; min-width: 0; }
.w-root .w-hold-row strong { font: 600 12px/1 var(--font-mono, monospace); }
.w-root .w-hold-row small { color: var(--muted-foreground, #aaa294); font: 10px var(--font-mono, monospace); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-root .w-hold-row > b { font: 650 12px/1 var(--font-mono, monospace); align-self: center; }
.w-root .w-hold-row > i { grid-column: 1 / -1; display: block; height: 3px; border-radius: 99px; background: var(--muted, #26231f); overflow: hidden; }
.w-root .w-hold-row > i b { display: block; height: 100%; background: var(--green, #3fbf6e); }
.w-root .w-hold-row.is-asset strong { color: var(--green-bright, #8fe0ad); }

.w-root .w-usage { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 9px; }
.w-root .w-usage-row > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.w-root .w-usage-row > div > span { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; min-width: 0; }
.w-root .w-usage-row > div > strong { font: 600 11px/1 var(--font-mono, monospace); white-space: nowrap; }
.w-root .w-usage-row > i { display: block; height: 4px; margin-bottom: 4px; overflow: hidden; border-radius: 99px; background: var(--muted, #26231f); }
.w-root .w-usage-row > i b { display: block; height: 100%; }
.w-root .w-usage-row small { display: block; color: var(--muted-foreground, #aaa294); font-size: 10px; overflow-wrap: anywhere; }
.w-root .w-health { letter-spacing: .02em; }

/* ------------------------------------------------------------------ condition, note, evidence */

.w-root .w-cond-state { display: flex; align-items: center; gap: 8px; padding: 2px 0; color: var(--teal, #42b59a); font-size: 13px; }
.w-root .w-cond-state strong { font-weight: 500; }
.w-root .w-cond-state.is-met { color: var(--ring, #7fdca2); }
.w-root .w-cond-state.is-unknown { color: var(--muted-foreground, #aaa294); }
.w-root .w-cond-state svg.w-ico { width: 16px; height: 16px; }
.w-root .w-cond-expr { color: var(--muted-foreground, #aaa294); font-size: 14px; line-height: 1.7; }
.w-root .w-cond-expr strong { color: var(--foreground, #f2ede2); font: 500 18px/1.7 var(--font-mono, monospace); }
.w-root .w-cond-note { margin-top: auto; color: #998b78; font-size: 11px; line-height: 1.6; }
.w-root .w-cond-note + .w-source { margin-top: 0; }

.w-root .w-note { white-space: pre-wrap; color: #c7beaf; font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.w-root .w-note p + p { margin-top: 12px; }
.w-root .w-note b { color: var(--foreground, #f2ede2); font-weight: 500; }
.w-root .w-note.is-placeholder { color: var(--muted-foreground, #aaa294); font-style: italic; }
.w-root .w-evidence { margin-top: auto; padding: 12px; border: 1px solid var(--border, #3a352f); border-radius: 6px; }
.w-root .w-evidence strong { font-size: 13px; font-weight: 600; }
.w-root .w-evidence p { margin-top: 6px; color: var(--muted-foreground, #aaa294); font-size: 12px; line-height: 1.6; }
.w-root .w-evidence.needs-review { border-color: var(--green, #3fbf6e); background: var(--surface-raised, #25221e); }

/* ------------------------------------------------------------------ agent monitor */

.w-root .w-proposal-flag {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 27px;
  margin: -17px -18px 0;
  padding: 0 14px;
  background: rgba(63, 191, 110, .12);
  color: var(--green-bright, #8fe0ad);
  font: 650 10px/1 var(--font-mono, monospace);
  letter-spacing: .11em;
}
.w-root .w-proposal-flag svg.w-ico { width: 12px; height: 12px; }
.w-root .w-agent-copy { color: #d5cec2; font-size: 13px; line-height: 1.55; }
.w-root .w-rule-stack { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.w-root .w-rule-stack span { padding: 7px 8px; border: 1px solid var(--border, #3a352f); border-radius: 6px; background: var(--surface-soft, #201e1a); font: 600 10px/1 var(--font-mono, monospace); white-space: nowrap; }
.w-root .w-rule-stack span.is-hit { border-color: var(--green-soft, #2c4a36); color: var(--green-bright, #8fe0ad); }
.w-root .w-rule-stack span.is-miss { color: var(--muted-foreground, #aaa294); }
.w-root .w-rule-stack b { color: var(--muted-foreground, #aaa294); font-size: 11px; }
.w-root .w-monitor-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; color: var(--muted-foreground, #aaa294); font-size: 11px; }
.w-root .w-monitor-meta span { display: inline-flex; align-items: center; gap: 5px; }
.w-root .w-monitor-meta svg.w-ico { width: 12px; height: 12px; }
.w-root .w-proposal-actions { display: flex; gap: 6px; padding-top: 10px; border-top: 1px solid var(--border, #3a352f); }
.w-root .w-active-monitor { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; min-height: 43px; padding-top: 8px; border-top: 1px solid var(--border, #3a352f); color: var(--teal, #42b59a); font-size: 12px; }
.w-root .w-active-monitor > span { display: inline-flex; align-items: center; gap: 8px; }
.w-root .w-active-monitor.is-rejected { color: var(--muted-foreground, #aaa294); }

/* ------------------------------------------------------------------ lists (mandates, signals, gallery) */

.w-root .w-list { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; }
.w-root .w-list-row { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 0; border-top: 1px solid var(--border, #3a352f); }
.w-root .w-list-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.w-root .w-list-main > span { min-width: 0; }
.w-root .w-list-main strong { display: block; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-root .w-list-main small { display: block; margin-top: 3px; color: var(--muted-foreground, #aaa294); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-root .w-list-main em { display: block; margin-top: 4px; color: #c7beaf; font-size: 11px; font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-root .w-badge { flex-shrink: 0; padding: 4px 7px; border-radius: 99px; background: var(--muted, #26231f); color: var(--muted-foreground, #aaa294); font: 600 9px/1 var(--font-mono, monospace); text-transform: uppercase; letter-spacing: .06em; }
.w-root .w-badge.is-open { color: var(--ochre, #c8ae62); background: rgba(200, 174, 98, .12); }
.w-root .w-badge.is-triggered, .w-root .w-badge.is-executed { color: var(--green-bright, #8fe0ad); background: var(--green-wash, #1f3022); }
.w-root .w-badge.is-expired, .w-root .w-badge.is-cancelled { color: var(--muted-foreground, #aaa294); }
.w-root .w-why { max-width: 140px; color: var(--muted-foreground, #aaa294); font-size: 10px; text-align: right; }
.w-root .w-board-ico { display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0; border: 1px solid var(--border, #3a352f); border-radius: 7px; color: var(--green, #3fbf6e); background: var(--surface-soft, #201e1a); }
.w-root .w-board-stats { display: inline-flex; gap: 10px; color: var(--muted-foreground, #aaa294); font: 600 11px var(--font-mono, monospace); }
.w-root .w-board-stats span { display: inline-flex; align-items: center; gap: 4px; }
.w-root .w-board-stats svg.w-ico { width: 12px; height: 12px; }
.w-root .w-txline { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border, #3a352f); border-radius: 6px; background: var(--surface-soft, #201e1a); font-size: 12px; line-height: 1.45; }
.w-root .w-txline > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.w-root .w-txline.is-ok { border-color: var(--green-soft, #2c4a36); color: var(--green-bright, #8fe0ad); }
.w-root .w-txline.is-err { border-color: rgba(215, 108, 92, .4); color: #f1c4bd; background: #2c1c19; }
.w-root .w-txline svg.w-ico { width: 14px; height: 14px; }

/* ------------------------------------------------------------------ swap */

.w-root .w-swap { gap: 8px; }
.w-root .w-swap-box { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px; border: 1px solid var(--border, #3a352f); border-radius: 8px; background: var(--surface-soft, #201e1a); }
.w-root .w-swap-box:focus-within { border-color: var(--green-soft, #2c4a36); }
.w-root .w-swap-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--muted-foreground, #aaa294); font-size: 12px; }
.w-root .w-swap-top small { font: 11px var(--font-mono, monospace); white-space: nowrap; }
.w-root .w-swap-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.w-root .w-swap-line input.w-input:not([type="checkbox"]):not([type="radio"]) { padding: 4px 0; font: 400 24px/1.2 var(--font-mono, monospace); letter-spacing: -.03em; flex: 1; }
.w-root .w-swap-line input.w-input:not([type="checkbox"]):focus-visible { outline: none; }
.w-root .w-swap-out { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 24px/1.2 var(--font-mono, monospace); letter-spacing: -.03em; padding: 4px 0; }
.w-root .w-swap-tok { display: inline-flex; flex-shrink: 0; }
.w-root .w-swap-out.is-refreshing { opacity: .6; }
.w-root .w-swap-flip { align-self: center; display: grid; place-items: center; width: 34px; height: 34px; margin: -14px 0; z-index: 1; border: 1px solid var(--border, #3a352f); border-radius: 8px; background: var(--card, #1d1b18); color: var(--muted-foreground, #aaa294); cursor: pointer; }
.w-root .w-swap-flip:hover { color: var(--green, #3fbf6e); }
.w-root .w-swap-facts { display: grid; gap: 6px; margin: 2px 0 0; font-size: 12px; }
.w-root .w-swap-facts > div { display: flex; justify-content: space-between; gap: 12px; }
.w-root .w-swap-facts dt { color: var(--muted-foreground, #aaa294); flex-shrink: 0; }
.w-root .w-swap-facts dd { font: 500 12px var(--font-mono, monospace); text-align: right; min-width: 0; overflow-wrap: anywhere; }
.w-root .w-swap-err dd { color: var(--brick, #d76c5c); font-family: var(--font-sans, sans-serif); }
.w-root .w-route { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px; }
.w-root .w-route svg.w-route-sep { width: 11px; height: 11px; color: var(--muted-foreground, #aaa294); transform: rotate(45deg); }
.w-root .w-swap-slip { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted-foreground, #aaa294); font-size: 12px; }
.w-root .w-swap-slip > div { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--border, #3a352f); border-radius: 7px; background: var(--muted, #26231f); }
.w-root .w-swap-slip b { margin-left: 4px; color: var(--foreground, #f2ede2); font: 500 12px var(--font-mono, monospace); }
.w-root .w-swap-slip .w-seg:disabled { cursor: default; }
.w-root .w-swap-go { width: 100%; min-height: 44px; font-size: 13px; }
.w-root .w-swap-note { color: var(--muted-foreground, #aaa294); font-size: 11px; line-height: 1.5; margin-top: auto; }
/* a status line takes the note's place, so a two-line message still fits the default 420 x 520 block */
.w-root .w-swap.has-status { gap: 6px; }
.w-root .w-swap.has-status .w-swap-note { display: none; }

/* ------------------------------------------------------------------ converter */

.w-root .w-conv { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.w-root .w-conv-swap { justify-self: center; color: var(--muted-foreground, #aaa294); }

/* ------------------------------------------------------------------ narrow widgets (phone list view, small cards) */

@container wroot (max-width: 380px) {
  .w-root .w-instrument { padding: 14px 14px 10px; gap: 9px; }
  .w-root .w-proposal-flag { margin: -14px -14px 0; }
  .w-root .w-chart-dates .w-chart-obs { display: none; }
  .w-root .w-chart-range, .w-root .w-chart-dates { font-size: 11px; }
  .w-root .w-watch-head, .w-root .w-watch-row { grid-template-columns: minmax(0, 1fr) auto 76px; gap: 8px; }
  .w-root .w-compact-head, .w-root .w-compact-row { grid-template-columns: minmax(0, 1fr) auto 72px; gap: 8px; }
  .w-root .w-perf-row { grid-template-columns: minmax(54px, .9fr) repeat(4, minmax(0, 1fr)); gap: 4px; }
  .w-root .w-perf-row > strong .w-logo { display: none; }
  .w-root .w-heat { font-size: 9px; padding: 6px 1px; }
  .w-root .w-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .w-root .w-metric-line > strong { font-size: 26px; }
  .w-root .w-micro dd { font-size: 12px; }
  .w-root .w-tape-row { grid-template-columns: 62px minmax(0, 1fr) auto auto; gap: 6px; }
  .w-root .w-list-row { flex-wrap: wrap; }
  .w-root .w-list-main { flex-basis: 100%; }
  .w-root .w-list-row .w-badge { margin-left: 40px; }
  .w-root .w-list-row .w-row-btns, .w-root .w-list-row .w-board-stats { margin-left: auto; }
  .w-root .w-swap-line input.w-input:not([type="checkbox"]):not([type="radio"]), .w-root .w-swap-out { font-size: 21px; }
}
@container wroot (max-width: 300px) {
  .w-root .w-twap-body { grid-template-columns: 1fr; justify-items: center; gap: 8px; }
  .w-root .w-twap-body .w-kv { width: 100%; }
  .w-root .w-movers-grid { grid-template-columns: 1fr; }
  .w-root .w-micro { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .w-root .w-micro > div { padding: 0 5px; }
  .w-root .w-source { flex-wrap: wrap; }
  .w-root .w-stat-line strong { font-size: 13px; }
  .w-root .w-table th, .w-root .w-table td { font-size: 13px; padding: 8px 6px; }
}
@container wroot (min-width: 560px) {
  .w-root .w-chart-title strong { font-size: 30px; }
}

/* list views (studio phone layout, lab phone layout): widgets grow with content, so give charts real height */
.studio-list-view .w-chart-plot, .studio-list-view .w-chart-area, .lab-phone .w-chart-plot, .lab-phone .w-chart-area { min-height: 150px; }

/* touch: 40 px targets */
@media (pointer: coarse) {
  .w-root .w-btn, .w-root .w-seg { min-height: 40px; }
  .w-root .w-icon-btn { min-width: 40px; }
  .w-root .w-chart-data summary { padding: 10px 0; }
}
/* phones: inputs at 16 px so iOS never zooms */
@media (max-width: 760px), (pointer: coarse) {
  .w-root .w-field input.w-input:not([type="checkbox"]):not([type="radio"]), .w-root select.w-select { font-size: 16px; }
  .w-root .w-swap-line input.w-input:not([type="checkbox"]):not([type="radio"]) { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .w-root .w-loading i, .w-root .w-skeleton i, .w-root svg.is-spinning { animation: none; }
}
