/* House style: drop-in tokens and components.
 * Source of truth: UTDARENA Telestration editor, apps/telestration/editor/static/style.css
 * (redesign of 24 Aug 2026). Values are copied, not approximated.
 * Copied into Advisers Research on 16 November 2026 from the house-style skill. Only the accent
 * block and --blue differ from the skill's file (both from accent.py). App-specific rules live in
 * app.css; do not edit component rules here.
 */

/* ------------------------------------------------------------ tokens */
:root {
  color-scheme: dark;

  /* surface ladder: each step is one small lift, never a jump */
  --bg: #0e0e0e;          /* canvas, stage, page behind panels */
  --panel: #161616;       /* side panels, top bar, dialogs, popovers */
  --field: #1b1b1b;       /* inputs, selects, segmented buttons */
  --raised: #1e1e1e;      /* hover rows, selected rows, active tab, rails */
  --raised-hi: #262626;   /* hover on raised, "on" chips and segments */

  /* hairlines */
  --line: #2a2a2a;        /* panel edges, control borders */
  --line-soft: #222222;   /* row dividers, section-label rules */
  --line-hover: #3d3d3d;  /* control border on hover */

  /* text: three steps only */
  --text: #f4f4f4;
  --dim: #9d9d9d;         /* labels, section headings, secondary values */
  --dimmer: #6e6e6e;      /* non-essential meta only (3.6:1, not for body text) */

  /* accent: legal blue #2563eb, built with the skill's accent.py (brief section 9).
     Never hand-pick these: rerun `python3 accent.py '#hex'` and paste its output. */
  --accent: #2563eb;
  --accent-lift: #2771fc;
  --accent-hover: #2e7bff;
  --accent-deep: #13409b;
  --accent-wash: rgba(37, 99, 235, .13);
  --accent-tint-top: #1a1c1f;
  --accent-tint-bottom: #151719;
  --accent-tint-line: #252c3d;

  /* signal colours: meaning, never decoration */
  --gold: #ffc13d;        /* attention, warnings, counts, progress */
  --blue: #2f9e8f;        /* second series moved by accent.py: the accent is too close to blue */
  --danger: #ff6b6b;
  --danger-line: #5a2326;
  --danger-bg: #241416;

  /* type */
  --font: Arial, "Helvetica Neue", sans-serif;
  --narrow: "Arial Narrow", Arial, sans-serif;   /* numbers, times, codes */

  /* shape */
  --r-sm: 4px;            /* controls */
  --r: 6px;               /* cards, stages, callouts, popovers */
  --r-lg: 10px;           /* dialogs */
  --pill: 100px;          /* chips, toasts, transport clusters */

  /* depth: shadows only on floating layers */
  --shadow-pop: 0 18px 50px -18px #000;
  --shadow-dialog: 0 30px 80px -30px #000;
  --shadow-toast: 0 10px 30px -12px #000;

  /* chrome sizes */
  --hdr: 46px;            /* top bar */
  --phead: 34px;          /* panel header */
  --side-l: 248px;
  --side-r: 304px;

  --ease: .12s ease;
}

/* ------------------------------------------------------------- base */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 13px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
input, select, textarea, button { accent-color: var(--accent); }
a { color: var(--text); }
.dim { color: var(--dim); }
.hint { color: var(--dim); font-size: 12px; }
.meta { color: var(--dimmer); font-size: 11.5px; }
.num { font-family: var(--narrow); font-variant-numeric: tabular-nums; }
.grow { flex: 1; }
.row { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------- buttons */
button { font: inherit; color: var(--text); cursor: pointer; border: 1px solid var(--line);
  background: linear-gradient(#232323, #1c1c1c); border-radius: var(--r-sm); padding: 5px 10px;
  transition: border-color var(--ease), background var(--ease); }
button:hover { border-color: var(--line-hover); background: linear-gradient(#292929, #212121); }
button:active { background: #1a1a1a; }
button:disabled { opacity: .35; cursor: default; background: #1a1a1a; }
button.primary, button.armed { background: linear-gradient(var(--accent-lift), var(--accent));
  border-color: var(--accent-deep); font-weight: bold; }
button.primary:hover, button.armed:hover { background: linear-gradient(var(--accent-hover), var(--accent-lift)); }
button.quiet { background: none; border-color: transparent; color: var(--dim); }
button.quiet:hover { background: var(--raised); color: var(--text); border-color: var(--line); }
button.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
button.off { opacity: .4; }   /* available later (e.g. no file loaded yet), still clickable */
button.danger:hover { color: var(--danger); border-color: var(--danger-line); background: var(--danger-bg); }
button.icon { width: 28px; height: 28px; padding: 0; display: grid; place-items: center;
  background: none; border-color: transparent; color: var(--dim); }
button.icon:hover { background: var(--raised-hi); border-color: var(--line); color: var(--text); }
.svgi { width: 15px; height: 15px; display: block; }

:is(button, select, input, textarea, summary, a):focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; }

/* ----------------------------------------------------------- fields */
select, input[type=text], input[type=search], input[type=number], input[type=email],
input[type=password], textarea { font: inherit; color: var(--text); background: var(--field);
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 4px 8px;
  transition: border-color var(--ease); }
:is(select, input[type=text], input[type=search], input[type=number], input[type=email],
input[type=password], textarea):hover { border-color: var(--line-hover); }
::placeholder { color: var(--dimmer); }
select { -webkit-appearance: none; appearance: none; padding-right: 24px; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%239d9d9d' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 8px center; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none; margin: 0; }
input[type=checkbox] { -webkit-appearance: none; appearance: none; width: 15px; height: 15px;
  margin: 0; background: var(--field); border: 1px solid var(--line); border-radius: 4px; cursor: pointer;
  display: inline-grid; place-items: center; transition: background var(--ease), border-color var(--ease); }
input[type=checkbox]:hover { border-color: var(--line-hover); }
input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent-deep); }
input[type=checkbox]:checked::before { content: ""; width: 9px; height: 8px; background: #fff;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 8'><path d='M1 4l3 3 5-6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 8'><path d='M1 4l3 3 5-6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / contain no-repeat; }

/* label | control grid used for every property form */
.field { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 10px; align-items: center;
  margin: 0 0 8px; }
.field > label { color: var(--dim); font-size: 12px; line-height: 1.25; overflow-wrap: break-word; }
.field .ctl { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.field .ctl > :is(input[type=text], input[type=search], input[type=number], input[type=email],
input[type=password], select, textarea) { flex: 1; min-width: 0; width: auto; }
.field .unit { color: var(--dimmer); font-size: 11.5px; flex: 0 0 auto; }
.field.stack { grid-template-columns: 1fr; gap: 6px; }

/* segmented control */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: var(--field); color: var(--dim); padding: 4px 9px;
  font-size: 12px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on, .seg button[aria-pressed=true] { background: var(--raised-hi); color: var(--text); font-weight: bold; }

/* ------------------------------------------------------ app chrome */
.app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.topbar { height: var(--hdr); flex: 0 0 var(--hdr); display: flex; align-items: center; gap: 10px;
  padding: 0 12px; background: var(--panel); border-bottom: 1px solid var(--line);
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.02); overflow: hidden; white-space: nowrap; }
.topbar .sep { width: 1px; height: 22px; background: var(--line); flex: 0 0 1px; }
.topbar > :is(select, input) { min-width: 0; flex: 0 1 auto; }   /* shrinks first, so actions stay visible */
.topbar > button { flex: 0 0 auto; }
@media (max-width: 600px) { .topbar .sep, .brand span { display: none; } }
.brand { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: bold;
  letter-spacing: .16em; text-transform: uppercase; flex: 0 0 auto; }
.brand span { font-weight: normal; font-size: 12.5px; letter-spacing: 0; text-transform: none;
  color: var(--dim); margin-left: 2px; }
.workspace { flex: 1; min-height: 0; display: grid;
  grid-template-columns: var(--side-l) minmax(0, 1fr) var(--side-r); }
.panel { background: var(--panel); display: flex; flex-direction: column; min-width: 0; min-height: 0;
  overflow: hidden; }
.panel.left { border-right: 1px solid var(--line); }
.panel.right { border-left: 1px solid var(--line); }
.panel-body { padding: 10px 12px 20px; overflow: auto; }
.stage { position: relative; min-width: 0; min-height: 0; padding: 12px 14px 10px; display: flex;
  flex-direction: column; }
.stage-box { position: relative; flex: 1; min-height: 0; background: #000; border-radius: var(--r); overflow: hidden;
  box-shadow: 0 0 0 1px var(--line); }

/* panel header: a small uppercase caption with a count */
.phead { display: flex; align-items: center; gap: 8px; height: var(--phead); flex: 0 0 var(--phead);
  padding: 0 12px; border-bottom: 1px solid var(--line); }
.phead h2 { margin: 0; font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--dim); font-weight: bold; }

/* section label with trailing hairline: the signature element */
.section-label { display: flex; align-items: center; gap: 8px; margin: 16px 0 8px; font-size: 11px;
  font-weight: bold; letter-spacing: .12em; color: var(--dim); text-transform: uppercase; }
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.section-label:first-child { margin-top: 2px; }

/* two-up tool grid */
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tool-grid button { min-height: 36px; padding: 6px 8px; white-space: normal; line-height: 1.25; }
@media (pointer: coarse) { .tool-grid button { min-height: 44px; } }

/* tabs with an accent underline */
.tabs { display: flex; flex: 0 0 auto; padding: 8px 10px 0; gap: 2px; background: var(--panel);
  border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; border: 0; border-radius: var(--r-sm) var(--r-sm) 0 0; background: none;
  color: var(--dim); padding: 8px 6px 9px; position: relative; }
.tabs button:hover { background: var(--raised); color: var(--text); }
.tabs button.active, .tabs button[aria-selected=true] { color: var(--text); font-weight: bold;
  background: var(--raised); box-shadow: none; }
.tabs button.active::after, .tabs button[aria-selected=true]::after { content: ""; position: absolute;
  left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; }
.tabs button .n { color: var(--dim); font-weight: normal; font-family: var(--narrow); margin-left: 4px; }

/* collapse rail on a panel edge */
.rail { position: absolute; top: 50%; transform: translateY(-50%); z-index: 6; width: 15px; height: 52px;
  display: grid; place-items: center; background: var(--raised); border: 1px solid var(--line);
  color: var(--dim); border-radius: var(--r-sm); cursor: pointer; font-size: 10px; padding: 0; }
.rail:hover { color: var(--text); background: var(--raised-hi); }

/* ------------------------------------------------------------ lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: grid; grid-template-columns: 46px 1fr; gap: 9px; padding: 7px 12px;
  border-bottom: 1px solid var(--line-soft); cursor: pointer; font-size: 12.5px; align-items: baseline;
  transition: background var(--ease); }
.list li:hover { background: var(--raised); }
.list li.here { background: var(--accent-wash); box-shadow: inset 2px 0 0 var(--accent); }   /* current */
.list li.selected { background: var(--raised); box-shadow: inset 3px 0 0 var(--accent); }    /* chosen */
.list li .k { font-family: var(--narrow); color: var(--dim); }
.list li .sub { color: var(--dim); }
.empty { padding: 14px 12px; font-size: 12px; color: var(--dimmer); }

table.data { width: 100%; border-collapse: collapse; font-size: 12px; }
table.data td, table.data th { padding: 3px 4px; border-bottom: 1px solid var(--line-soft); }
table.data th { text-align: left; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--dimmer); font-weight: bold; }
table.data .num { text-align: right; }

/* collapsible group */
details.group { border-top: 1px solid var(--line-soft); margin-top: 10px; padding-top: 9px; }
details.group > summary { list-style: none; cursor: pointer; font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--dim); display: flex; align-items: center; gap: 6px;
  margin-bottom: 8px; font-weight: bold; }
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary::before { content: ""; width: 0; height: 0; border: 4px solid transparent;
  border-left-color: var(--dim); transition: transform var(--ease); }
details.group[open] > summary::before { transform: rotate(90deg) translateX(-1px); }

/* ------------------------------------------------------------ chips */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: var(--pill);
  font-size: 10.5px; font-weight: bold; letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05); color: var(--text);
  white-space: nowrap; }
.chip .tick { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 6px; }
.chip.warn { border-color: rgba(255,193,61,.5); background: rgba(255,193,61,.12); color: var(--gold); }

.fchip { padding: 3px 10px; border-radius: var(--pill); background: none; border: 1px solid var(--line);
  color: var(--dimmer); font-size: 11.5px; }
.fchip:hover { background: var(--raised); color: var(--dim); border-color: var(--line-hover); }
.fchip.on { background: var(--raised-hi); border-color: #3a3a3a; color: var(--text); }
.fchips { display: flex; flex-wrap: wrap; gap: 5px; }

/* pill-shaped button cluster (transport, pagers) */
.cluster { display: inline-flex; align-items: stretch; height: 32px; border: 1px solid var(--line);
  border-radius: var(--pill); overflow: hidden; background: var(--panel); }
.cluster button { border: 0; border-radius: 0; background: none; color: var(--dim);
  font-family: var(--narrow); font-variant-numeric: tabular-nums; font-size: 12.5px; padding: 0 13px; }
.cluster button + button { border-left: 1px solid var(--line-soft); }
.cluster button:hover { background: var(--raised-hi); color: var(--text); }

kbd { display: inline-block; min-width: 18px; text-align: center; font: 11px/1.6 var(--font);
  background: #242424; border: 1px solid #383838; border-bottom-color: var(--line); border-radius: 4px;
  padding: 0 5px; margin: 0 1px; color: var(--dim); }

/* -------------------------------------------------------- callouts */
.modebar { display: flex; gap: 10px; align-items: center; min-height: 38px; padding: 4px 10px;
  font-size: 12.5px; background: linear-gradient(var(--accent-tint-top), var(--accent-tint-bottom));
  border: 1px solid var(--accent-tint-line);
  border-left: 3px solid var(--accent); border-radius: var(--r); }
.modebar b { color: var(--text); }
.modebar .step { color: var(--dim); }
.modebar .count { font-family: var(--narrow); color: var(--gold); }
.notice { display: flex; gap: 8px; align-items: flex-start; padding: 9px 10px; font-size: 12px;
  color: var(--dim); background: #1a1613; border: 1px solid #3a3020; border-radius: var(--r); }
.notice b { color: var(--gold); }

/* ------------------------------------------------- floating layers */
.popover { position: absolute; z-index: 9; width: 248px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-pop);
  padding: 10px 11px 11px; animation: rise-in .15s ease; }
.popover h3 { margin: 0 0 8px; font-size: 13px; }

.dialog { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.55); display: flex;
  align-items: center; justify-content: center; animation: fade-in .14s ease; }
.dialog .box { width: min(560px, 92%); max-height: 84vh; overflow: auto; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-dialog);
  padding: 16px; animation: rise-in .18s ease; }
.dialog h3 { margin: 0 0 4px; font-size: 15px; }
.dialog .sub { color: var(--dim); font-size: 12px; margin: 0 0 12px; }
.dialog .foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

/* sits inside a positioned container (the stage), floating above its lower edge */
.toast { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 8;
  max-width: min(560px, 84%); display: flex; align-items: center; gap: 9px; padding: 9px 14px;
  border-radius: var(--pill); font-size: 12.5px; background: rgba(22,22,22,.95);
  border: 1px solid var(--line); box-shadow: var(--shadow-toast); animation: toast-in .18s ease; }
.toast.error { border-color: var(--danger-line); }
.spin { width: 13px; height: 13px; flex: 0 0 13px; border-radius: 50%;
  border: 2px solid rgba(255,193,61,.25); border-top-color: var(--gold); animation: sp .8s linear infinite; }

/* -------------------------------------------------------- scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2e2e2e; border-radius: 6px; border: 2px solid var(--panel); }
::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------ motion */
@keyframes sp { to { transform: rotate(360deg); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 7px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
