/* Obsidian Telemetric — tokens and components taken from the Stitch project
   "Creator Teleprompter — Phase 0 Spikes" (app bar, status strip, sections, bento tiles, bottom nav). */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap');

:root {
  --canvas: #0b0f14;
  --panel: #121820;
  --well: #1a222d;
  --raised: #24303f;
  --line: #263545;
  --line-strong: #374a60;
  --text: #f3f4f6;
  --text-2: #9ca3af;
  --text-3: #4b5563;
  --cyan: #06b6d4;
  --cyan-hi: #4cd7f6;
  --rec: #ef4444;
  --rec-dark: #991b1b;
  --pass: #10b981;
  --warn: #f59e0b;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --sans: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; border-radius: 0; }
html, body { margin: 0; background: var(--canvas); color: var(--text); font: 400 14px/20px var(--sans); -webkit-font-smoothing: antialiased; }
body { max-width: 520px; margin: 0 auto; padding: 0 12px 88px; display: flex; flex-direction: column; gap: 12px; min-height: 100vh; }
main { display: flex; flex-direction: column; gap: 12px; }

/* icons: the clip hides the ligature name if the icon font is offline */
.ms { font-family: 'Material Symbols Outlined'; font-weight: 400; font-style: normal; font-size: 18px; line-height: 1; letter-spacing: normal; text-transform: none; display: inline-block; vertical-align: middle; width: 1em; overflow: hidden; white-space: nowrap; font-feature-settings: 'liga'; }
.ms.sm { font-size: 14px; }
.ms.lg { font-size: 22px; }

/* app bar */
.bar { position: sticky; top: 0; z-index: 50; display: flex; justify-content: space-between; align-items: center; gap: 8px; height: 48px; margin: 0 -12px; padding: 0 12px; background: var(--well); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--cyan-hi); min-width: 0; }
.brand h1 { margin: 0; font: 500 12px/18px var(--mono); letter-spacing: .1em; color: var(--cyan-hi); white-space: nowrap; }

/* bottom nav */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; justify-content: space-around; height: 64px; background: var(--well); border-top: 1px solid var(--line); }
.tabs a { flex: 1; max-width: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text-2); text-decoration: none; font: 600 9px/12px var(--mono); letter-spacing: .08em; text-transform: uppercase; border-top: 2px solid transparent; }
.tabs a:hover { color: var(--cyan-hi); background: var(--raised); }
.tabs a[aria-current] { color: var(--cyan-hi); border-top-color: var(--cyan-hi); background: var(--raised); }

/* status strip and sections */
.strip { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 8px; background: var(--panel); border: 1px solid var(--line); }
.strip .lead { display: flex; align-items: center; gap: 8px; font: 700 9px/12px var(--mono); letter-spacing: .1em; color: var(--cyan-hi); text-transform: uppercase; }
.dot { width: 8px; height: 8px; background: var(--cyan-hi); display: inline-block; }
.dot.live { background: var(--rec); animation: beat 1s ease-in-out infinite; }
@keyframes beat { 50% { opacity: .3; } }

.sect { background: var(--panel); border: 1px solid var(--line); }
.sect > .hd { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px; background: var(--well); border-bottom: 1px solid var(--line); font: 600 10px/14px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.sect > .hd .t { display: flex; align-items: center; gap: 6px; }
.sect > .hd .t::before { content: ''; width: 6px; height: 6px; background: var(--pass); }
.sect > .pad { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.sect.flat { padding: 6px 8px; display: flex; flex-direction: column; gap: 6px; }

/* buttons */
button, select, input, textarea { font: 500 12px/16px var(--mono); color: var(--text); }
button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-transform: uppercase; letter-spacing: .02em; padding: 8px 12px; border: 1px solid var(--line); background: transparent; color: var(--text-2); cursor: pointer; }
button:hover { border-color: var(--text); color: var(--text); }
button.primary { background: var(--cyan); border-color: var(--cyan); color: var(--canvas); font-weight: 700; }
button.primary:hover { background: transparent; color: var(--cyan); }
button.block { width: 100%; padding: 10px 12px; }
button.sm { padding: 2px 8px; font-size: 9px; line-height: 14px; letter-spacing: .08em; }
button.on, button[aria-pressed='true'] { border-color: var(--cyan-hi); color: var(--cyan-hi); background: var(--raised); }
button:disabled { opacity: .4; cursor: not-allowed; }
select, input, textarea { background: var(--well); border: 1px solid var(--line); padding: 6px 8px; }
select:focus, input:focus, textarea:focus, button:focus-visible { outline: 1px solid var(--cyan); outline-offset: 0; }
input[type=range] { width: 100%; padding: 0; accent-color: var(--cyan); }

.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; min-width: 0; }
.seg { display: flex; gap: 4px; }
.seg > * { flex: 1; }

/* tags, tiles, rows */
.tag { display: inline-block; padding: 1px 6px; border: 1px solid var(--line); background: var(--well); color: var(--text-2); font: 600 9px/14px var(--mono); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.tag.pass { color: var(--pass); border-color: var(--pass); background: rgba(16, 185, 129, .1); }
.tag.fail { color: var(--rec); border-color: var(--rec); background: rgba(239, 68, 68, .1); }
.tag.warn { color: var(--warn); border-color: var(--warn); background: rgba(245, 158, 11, .1); }
.tag.cyan { color: var(--cyan-hi); border-color: var(--cyan-hi); }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tiles.four { grid-template-columns: repeat(4, 1fr); gap: 4px; }
.tile { background: var(--canvas); border: 1px solid var(--line); padding: 8px; min-width: 0; }
.tile small, .lbl { display: block; font: 600 9px/12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.tile b { display: block; margin-top: 4px; font: 700 20px/24px var(--mono); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile b.sm { font-size: 11px; line-height: 14px; font-weight: 600; }
.tile .sub { font: 500 10px/14px var(--mono); color: var(--text-2); margin-top: 2px; }
.tile.alert { border-color: var(--rec); background: rgba(239, 68, 68, .06); }
.bar-fill { height: 4px; background: var(--well); margin-top: 6px; overflow: hidden; }
.bar-fill i { display: block; height: 100%; width: 0; background: var(--cyan); }
.list { display: flex; flex-direction: column; gap: 4px; }
.list .item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 8px; background: var(--canvas); border: 1px solid var(--line); font: 500 10px/14px var(--mono); }

/* segmented level meter with dB scale */
.vu { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; height: 14px; padding: 2px; background: var(--canvas); border: 1px solid var(--line); }
.vu i { background: var(--well); }
.vu i.on { background: var(--pass); }
.vu i.on.n { background: var(--cyan); }
.vu i.on.a { background: var(--warn); }
.vu i.on.c { background: var(--rec); }
.vu i.hold { box-shadow: inset -2px 0 0 #fff; }
.scale { display: flex; justify-content: space-between; font: 500 9px/12px var(--mono); color: var(--text-3); padding: 0 2px; }

.note { color: var(--text-2); font-size: 12px; line-height: 16px; margin: 0; }
pre.log { margin: 0; max-height: 120px; overflow: auto; background: var(--canvas); border: 1px solid var(--line); padding: 6px 8px; font: 500 10px/14px var(--mono); color: var(--text-2); white-space: pre-wrap; }
.alert-banner { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 8px; background: rgba(147, 0, 10, .4); border: 1px solid var(--rec); color: #ffdad6; font: 500 11px/16px var(--mono); }
.alert-banner[hidden] { display: none; }
button { white-space: nowrap; }
