/* Painel OhmScope: as cores e as formas da app. Entre os temas, só mudam as
   cores; a faixa escura do Scope é igual nos dois. */

@font-face { font-family: 'Roboto'; font-weight: 400; font-display: swap; src: url('assets/fonts/Roboto-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Roboto'; font-weight: 500; font-display: swap; src: url('assets/fonts/Roboto-Medium.ttf') format('truetype'); }
@font-face { font-family: 'Roboto'; font-weight: 600; font-display: swap; src: url('assets/fonts/Roboto-SemiBold.ttf') format('truetype'); }
@font-face { font-family: 'Roboto'; font-weight: 700; font-display: swap; src: url('assets/fonts/Roboto-Bold.ttf') format('truetype'); }
@font-face { font-family: 'Roboto'; font-weight: 800; font-display: swap; src: url('assets/fonts/Roboto-ExtraBold.ttf') format('truetype'); }
@font-face { font-family: 'Droid Sans Mono'; font-weight: 400; font-display: swap; src: url('assets/fonts/DroidSansMono.ttf') format('truetype'); }

:root {
  color-scheme: light;
  --bg: #FAFBF9;
  --card: #FFFFFF;
  --line: #EEF0F1;
  --field: #D9DFE2;
  --ink: #173512;
  --muted: #66737C;
  --accent: #44790F;
  --accent-large: #4E8A16;
  --chip: #F1F4F2;
  --hover: #F1F4F2;
  --selected: #D0FA91;
  --selected-ink: #173512;
  --help: #F4FFE5;
  --danger: #B95050;
  --danger-soft: #FBEDED;
  --danger-ink: #9C3F3F;
  --warn: #B45309;
  --warn-soft: #FFF3E3;
  --warn-ink: #9A4A08;
  --track: #E3E8EA;
  --off: #A3AEB5;
  --bar-off: #C9D1D6;
  --band-line: transparent;
  --logo-light: block;
  --logo-dark: none;
  --button: #80E000;
  --button-ink: #173512;
  --button-off: #E3E8EA;
  --button-off-ink: #66737C;
  --scope: #0C1B20;
  --trace: #B1F207;
  --mono: 'Droid Sans Mono', ui-monospace, monospace;
  --band-text: rgba(255, 255, 255, .78);
  --band-mute: rgba(255, 255, 255, .72);
  --band-fill: rgba(255, 255, 255, .07);
  --gutter: clamp(16px, 3vw, 32px);
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #151B1C;
  --card: #20292B;
  --line: #364345;
  --field: #4A595C;
  --ink: #EDF4EF;
  --muted: #A9BABD;
  --accent: #D0FA91;
  --accent-large: #D0FA91;
  --chip: #2A3335;
  --hover: #2A3335;
  --selected: #3D5727;
  --selected-ink: #D0FA91;
  --help: #2C4029;
  --danger: #F08A8A;
  --danger-soft: #3B2527;
  --danger-ink: #F5A5A5;
  --warn: #FFB547;
  --warn-soft: #3A2C18;
  --warn-ink: #FFC670;
  --track: #2A3335;
  --off: #5C6B6E;
  --bar-off: #4A595C;
  --band-line: #364345;
  --logo-light: none;
  --logo-dark: block;
  --button-off: #2A3335;
  --button-off-ink: #A9BABD;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Roboto, system-ui, sans-serif;
  font-size: 14px;
  line-height: 20px;
}

a { color: inherit; }
h1, h2, h3, p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--accent-large); outline-offset: 2px; }
.band :focus-visible { outline-color: var(--trace); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }

/* O menu */
.nav {
  flex: 1 1 248px;
  padding: 24px 16px;
  background: var(--card);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 20px;
}
.nav-brand { display: flex; flex-direction: column; gap: 8px; padding: 0 8px; }
.logo { width: 156px; height: auto; }
.logo-light { display: var(--logo-light); }
.logo-dark { display: var(--logo-dark); }
.nav-kicker { font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: .12em; color: var(--accent); }
.nav-links { display: flex; flex-wrap: wrap; gap: 4px; }
.nav-link {
  flex: 1 1 168px;
  display: flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 12px;
  border-radius: 14px;
  font-weight: 500; text-decoration: none;
}
.nav-link:hover { background: var(--hover); }
.nav-link[aria-current='page'] { background: var(--selected); color: var(--selected-ink); font-weight: 600; }
.nav-link > .grow { flex: 1 1 auto; }
.nav-count {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--danger); color: var(--card);
  font-size: 12px; line-height: 22px; font-weight: 600; text-align: center;
}
.nav-later { padding: 0 8px; border-radius: 11px; background: var(--chip); color: var(--muted); font-size: 12px; line-height: 22px; font-weight: 500; }
.nav-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.nav-safe { display: flex; align-items: center; gap: 8px; padding: 0 8px; color: var(--muted); font-size: 12px; line-height: 16px; overflow-wrap: anywhere; }
.nav-action {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 8px;
  border: 0; border-radius: 12px; background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 500; text-align: left; cursor: pointer;
}
.nav-action:hover { background: var(--hover); color: var(--ink); }

.main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }

/* A faixa escura, como o ecrã do Scope */
.band {
  background: var(--scope);
  border-bottom: 1px solid var(--band-line);
  border-radius: 0 0 32px 32px;
  padding: 28px var(--gutter) 24px;
  display: flex; flex-direction: column; gap: 16px;
  color: #FFFFFF;
}
.band-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
  background-size: 100% 32px, 32px 100%;
}
.band-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.band-title { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.band h1 { font-size: 34px; line-height: 40px; font-weight: 800; letter-spacing: -.01em; }
.band h1 em { color: #D0FA91; font-style: normal; }
.band h1:focus { outline: none; }
.band p { color: var(--band-text); max-width: 720px; }
.band-tag { align-self: flex-start; padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, .1); font-size: 12px; line-height: 16px; font-weight: 500; }
.band-side { display: flex; align-items: flex-end; gap: 20px; }
.osci-band { display: block; width: 112px; height: 100px; margin-bottom: -18px; position: relative; z-index: 1; }

.periods { display: flex; gap: 4px; padding: 4px; margin-bottom: 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); }
.period {
  min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px;
  background: transparent; color: rgba(255, 255, 255, .82);
  font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.period[aria-pressed='true'] { background: var(--button); color: var(--button-ink); }

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 8px; }
.metric {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 12px 14px; border: 0; border-radius: 16px;
  background: var(--band-fill); color: #FFFFFF; text-align: left;
}
button.metric { min-height: 88px; background: transparent; cursor: pointer; }
button.metric:hover { background: var(--band-fill); }
button.metric[aria-pressed='true'] { background: rgba(255, 255, 255, .09); box-shadow: inset 0 0 0 1px var(--trace); }
.metric-label { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--band-mute); }
.metric-value { font-size: 26px; line-height: 32px; font-weight: 700; overflow-wrap: anywhere; }
.metric-value small { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--band-mute); }
.metric-note { font-size: 12px; line-height: 16px; color: #D0FA91; }

/* O gráfico: o visor do Scope */
.visor {
  position: relative; height: 240px;
  border: 1px solid rgba(255, 255, 255, .13); border-radius: 18px; overflow: hidden;
  background-color: var(--scope);
  background-image:
    linear-gradient(rgba(255, 255, 255, .13), rgba(255, 255, 255, .13)),
    linear-gradient(rgba(255, 255, 255, .13), rgba(255, 255, 255, .13)),
    linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
  background-size: 100% 1px, 1px 100%, 100% 12.5%, 10% 100%;
  background-position: 0 50%, 50% 0, 0 0, 0 0;
  background-repeat: no-repeat, no-repeat, repeat, repeat;
}
.visor svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.chart-area { fill: var(--trace); fill-opacity: .1; stroke: none; }
.chart-line { fill: none; stroke: var(--trace); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart-title { position: absolute; left: 48px; top: 6px; font-size: 13px; line-height: 18px; font-weight: 600; color: #FFFFFF; }
.tick { position: absolute; left: 10px; transform: translateY(-50%); font-family: var(--mono); font-size: 11px; line-height: 16px; color: var(--band-mute); }
.chart-dates { position: absolute; left: 6%; right: 7%; bottom: 5px; display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; line-height: 16px; color: var(--band-mute); }
.chart-limit { position: absolute; left: 6%; right: 7%; height: 1px; background: rgba(255, 255, 255, .5); }
.chart-limit.bars { right: 3%; }
.chart-limit-label { position: absolute; right: 10px; transform: translateY(-120%); font-size: 11px; line-height: 16px; color: rgba(255, 255, 255, .82); }
.chart-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--trace); box-shadow: 0 0 0 2px var(--scope); }
.chart-end { position: absolute; left: 93%; transform: translate(11px, -50%); font-family: var(--mono); font-size: 13px; line-height: 18px; font-weight: 600; color: #FFFFFF; }
.chart-cross { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, .45); pointer-events: none; }
.chart-hover-dot { pointer-events: none; }
.chart-tip { position: absolute; top: 34px; padding: 6px 10px; border-radius: 10px; background: #FFFFFF; color: #173512; font-size: 12px; line-height: 16px; white-space: nowrap; pointer-events: none; }
.chart-tip strong { font-weight: 700; }
.chart-bars { position: absolute; left: 6%; right: 3%; top: 12.5%; bottom: 12.5%; display: flex; align-items: flex-end; gap: 2px; }
.chart-column { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.chart-bar { width: 100%; max-width: 24px; border-radius: 4px 4px 0 0; background: var(--trace); }
.chart-column.hot .chart-bar { background: #FFFFFF; }
.visor[data-kind='bars'] .chart-dates { right: 3%; }
.visor[data-kind='bars'] { height: 220px; background-position: 0 87.5%, 50% 0, 0 0, 0 0; background-size: 100% 1px, 0 0, 100% 12.5%, 10% 100%; }

/* O conteúdo */
.content { padding: 24px var(--gutter) 40px; }
.content-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr)); gap: 16px; align-items: stretch; }
.content-grid.top { align-items: start; }
.content-split { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.col-wide { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.col-side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 20px;
  display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.card-center { align-items: center; text-align: center; padding: 28px 20px; gap: 10px; }
.kicker { font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: .1em; color: var(--accent); }
.kicker.danger { color: var(--danger); }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.title { font-size: 18px; line-height: 24px; font-weight: 700; overflow-wrap: anywhere; }
.note { font-size: 13px; line-height: 18px; color: var(--muted); overflow-wrap: anywhere; }
.strong { font-weight: 600; }
.medium { font-weight: 500; }
.mono { font-family: var(--mono); }
.grow { flex: 1 1 auto; min-width: 0; }
.stack { display: flex; flex-direction: column; min-width: 0; }
.stack-2 { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stack-4 { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stack-6 { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.stack-8 { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.fact { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.fact > :first-child { color: var(--muted); }
.fact > :last-child { font-weight: 600; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.push-bottom { margin-top: auto; }

.more {
  display: flex; align-items: center; min-height: 44px; color: var(--accent); font-weight: 600; text-decoration: none;
  border: 0; background: transparent; padding: 0; cursor: pointer; text-align: left;
}
.more:hover { text-decoration: underline; }

.fact-row { border-top: 1px solid var(--line); padding-top: 8px; min-height: 56px; }
.fact-action { align-items: center; min-height: 44px; padding: 0; }
.gap-0 { gap: 0; }
.gap-0 > .kicker { margin-bottom: 10px; }
.flex-280 { flex: 1 1 280px; }
.flex-240 { flex: 1 1 240px; }
.align-start { align-items: flex-start; gap: 20px; }
.row-start { align-self: flex-start; }
.fact > .ink, .ink { color: var(--ink); }

/* Botões e pastilhas */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px; border: 0; border-radius: 999px;
  background: var(--button); color: var(--button-ink);
  font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.button:disabled { background: var(--button-off); color: var(--button-off-ink); cursor: default; }
.button.small { min-height: 44px; padding: 0 20px; }
.button.outline { background: transparent; border: 1px solid var(--field); color: var(--ink); font-weight: 600; }
.button.outline:hover { background: var(--hover); }
.button.danger { background: var(--danger); color: var(--card); }
.button.text { background: transparent; color: var(--ink); font-weight: 600; }
.button.wide { flex: 1 1 130px; }
.danger-link {
  min-height: 44px; padding: 0 12px; border: 0; background: transparent;
  color: var(--danger); font-size: 14px; font-weight: 600; cursor: pointer;
}
.accent-link {
  min-height: 44px; padding: 0 12px; border: 0; background: transparent;
  color: var(--accent); font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center;
}
.tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.tab {
  min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px;
  background: var(--chip); color: var(--ink);
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.tab[aria-pressed='true'] { background: var(--selected); color: var(--selected-ink); }
.segmented { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--chip); }
.segment {
  flex: 1 1 0; min-height: 44px; border: 0; border-radius: 999px;
  background: transparent; color: var(--ink);
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.segment[aria-pressed='true'] { background: var(--card); box-shadow: 0 1px 2px rgba(12, 27, 32, .12); }
.pill { align-self: flex-start; padding: 3px 10px; border-radius: 999px; background: var(--chip); font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap; }
.pill.danger { background: var(--danger-soft); color: var(--danger-ink); font-weight: 600; }
.pill.warn { background: var(--warn-soft); color: var(--warn-ink); font-weight: 600; }
.pill.good { background: var(--selected); color: var(--selected-ink); font-weight: 600; }
.code-chip {
  padding: 3px 8px; border-radius: 6px; background: var(--scope); color: #D0FA91;
  font-family: var(--mono); font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--button); flex: 0 0 8px; }
.status-dot.off { background: var(--off); }
.status-dot.warn { background: var(--warn); }
.help { padding: 10px 12px; border-radius: 14px; background: var(--help); }
.help.warn { background: var(--warn-soft); }
.done { font-weight: 600; color: var(--accent); }
.avatar {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--selected); color: var(--selected-ink); font-weight: 700;
}
.avatar.large { flex-basis: 56px; width: 56px; height: 56px; font-size: 20px; line-height: 24px; }

/* Campos */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-grow { flex: 1 1 180px; }
.label { font-size: 13px; line-height: 18px; font-weight: 500; }
.input {
  width: 100%; min-height: 48px; padding: 0 14px;
  border: 1px solid var(--field); border-radius: 14px; background: var(--card); color: var(--ink);
  font-size: 14px;
}
textarea.input { padding: 12px 14px; line-height: 20px; resize: vertical; }
.input.round { border-radius: 999px; padding: 0 16px; }
.input.code { font-family: var(--mono); font-size: 20px; letter-spacing: .3em; text-align: center; }
.stepper { flex: 0 0 auto; display: flex; align-items: center; gap: 4px; }
.step {
  width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--chip); color: var(--ink);
  font-size: 20px; cursor: pointer;
}
.step:disabled { opacity: .4; cursor: default; }
.step-value { min-width: 52px; text-align: center; font-family: var(--mono); font-size: 14px; line-height: 20px; font-weight: 600; }
.switch-row {
  width: 100%; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 8px 0; border: 0; border-top: 1px solid var(--line); background: transparent; color: inherit;
  text-align: left; cursor: pointer;
}
.switch { flex: 0 0 44px; height: 27px; padding: 3px; border-radius: 14px; background: var(--off); display: flex; justify-content: flex-start; }
.switch i { width: 21px; height: 21px; border-radius: 50%; background: #FFFFFF; }
[aria-checked='true'] > .switch { background: var(--button); justify-content: flex-end; }
.confirm { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; background: var(--danger-soft); }
.confirm.neutral { background: var(--help); }

/* Barras */
.meter { height: 10px; border-radius: 5px; background: var(--track); overflow: hidden; }
.meter > div { height: 10px; border-radius: 5px; background: var(--button); }
.meter.thin, .meter.thin > div { height: 6px; border-radius: 3px; }
.h-bar { display: flex; align-items: center; gap: 8px; }
.h-bar > div { height: 12px; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--button); }
.h-bar > span { font-size: 13px; line-height: 18px; font-weight: 600; }
.version-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 8px; }
.version-choice {
  display: flex; flex-direction: column; gap: 4px; min-height: 52px; padding: 6px 10px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: inherit; text-align: left; cursor: pointer;
}
.version-choice[aria-pressed='true'] { border-color: var(--button); background: var(--help); }
.version-choice.outside .h-bar > div { background: var(--bar-off); }
.big-number { display: flex; align-items: baseline; gap: 8px; }
.big-number strong { font-size: 40px; line-height: 44px; font-weight: 800; }
.big-number span { font-size: 15px; line-height: 20px; color: var(--muted); }
.mini-stats { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.mini-stats > div { display: flex; flex-direction: column; }
.mini-stats span:first-child { font-size: 12px; line-height: 16px; color: var(--muted); }
.mini-stats span:last-child { font-size: 15px; line-height: 20px; font-weight: 600; }

/* Linhas com ligação */
.link-row {
  display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 10px; margin: 0 -10px;
  border: 0; border-radius: 16px; background: transparent; color: inherit; text-decoration: none; text-align: left; cursor: pointer;
}
.link-row:hover { background: var(--hover); }
.link-icon { flex: 0 0 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--chip); }
.link-icon.danger { background: var(--danger-soft); color: var(--danger); }
.link-icon.warn { background: var(--warn-soft); color: var(--warn); }
.link-chevron { color: var(--muted); flex: 0 0 18px; }
.mini-visor {
  position: relative; height: 72px; border-radius: 12px; overflow: hidden;
  background-color: var(--scope);
  background-image:
    linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
  background-size: 100% 25%, 10% 100%;
}
.mini-visor .spark { position: absolute; inset: 0; width: 100%; height: 100%; }
.spark { display: block; }
.spark path { fill: none; stroke: var(--accent-large); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.mini-visor .spark path { stroke: var(--trace); stroke-width: 2; }

/* As tabelas */
.table-scroll { overflow-x: auto; }
.table { display: flex; flex-direction: column; gap: 4px; }
.table-people { min-width: 640px; }
.table-errors { min-width: 600px; }
.table-head, .table-row { display: grid; gap: 10px; }
.table-people .table-head, .table-people .table-row { grid-template-columns: minmax(170px, 1fr) 76px 76px 60px 60px 104px; }
.table-errors .table-head, .table-errors .table-row { grid-template-columns: 84px minmax(180px, 1fr) 48px 56px 96px; }
.table-head { padding: 0 10px; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--muted); }
.table-row {
  align-items: center; min-height: 56px; padding: 6px 10px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: inherit; text-align: left; cursor: pointer;
}
.table-row[aria-pressed='true'] { border-color: var(--button); background: var(--help); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-row .justify-start { justify-self: start; }
.table-row .spark { width: 96px; height: 28px; justify-self: end; }

/* As denúncias */
.report-body { display: flex; flex-wrap: wrap; gap: 16px; }
.report-text { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.report-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.report-actions .danger-link { margin-left: auto; }
.resolved-row { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 12px 6px 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.circuit-sketch {
  flex: 0 0 132px; height: 100px; border-radius: 14px; overflow: hidden;
  background-color: var(--scope);
  background-image:
    linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
  background-size: 100% 25%, 10% 100%;
}
.circuit-sketch.large { flex: none; width: 100%; height: 260px; }
.circuit-sketch svg { width: 100%; height: 100%; display: block; }
.circuit-sketch .wire { fill: none; stroke: #D0FA91; stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.circuit-sketch .part { fill: #0C1B20; stroke: #FFFFFF; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.circuit-sketch text { fill: #FFFFFF; font-family: var(--mono); font-size: 18px; }
.candidate {
  display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 12px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card); color: inherit; text-align: left; cursor: pointer;
}
.candidate[aria-pressed='true'] { border-color: var(--button); background: var(--help); }
.radio { flex: 0 0 16px; height: 16px; border-radius: 50%; border: 2px solid var(--off); background: var(--card); }
[aria-pressed='true'] > .radio { border: 5px solid var(--accent-large); }
.scheduled { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; background: var(--help); }

/* A mensagem, como aparece na app */
.notice-preview {
  position: relative; max-width: 380px; min-height: 148px; padding: 14px 40px 14px 16px; border-radius: 20px; overflow: hidden;
  display: flex; flex-direction: column; gap: 6px; color: #FFFFFF;
  background-color: var(--scope);
  background-image:
    linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
  background-size: 100% 25%, 10% 100%;
}
.notice-preview svg { width: 100%; height: 36px; display: block; }
.notice-preview path { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.notice-preview.warning path { stroke: #FFB547; }
.notice-preview.info path { stroke: #91BEFF; }
.notice-preview strong { font-size: 15px; line-height: 20px; font-weight: 700; }
.notice-preview span { min-width: 0; overflow-wrap: anywhere; font-size: 13px; line-height: 18px; color: rgba(255, 255, 255, .86); }
.notice-close { position: absolute; right: 14px; top: 10px; font-size: 18px; line-height: 22px; color: rgba(255, 255, 255, .78); }

/* O registo */
.log-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 0; border-top: 1px solid var(--line); }
.log-time { flex: 0 0 44px; font-family: var(--mono); font-size: 12px; line-height: 16px; color: var(--muted); }
.log-icon { flex: 0 0 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--chip); }
.log-day { margin-top: 8px; }

/* A entrada */
.login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px;
  background-color: var(--scope);
  background-image:
    linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
  background-size: 100% 32px, 32px 100%;
}
.login-card { width: 100%; max-width: 420px; background: var(--card); border-radius: 32px; padding: 28px 24px; display: flex; flex-direction: column; gap: 16px; }
.login-title { font-size: 26px; line-height: 32px; font-weight: 800; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.qr { display: block; width: 224px; height: 224px; align-self: center; padding: 8px; background: #FFFFFF; border-radius: 16px; }
.secret { padding: 10px 12px; border-radius: 12px; background: var(--chip); font-family: var(--mono); font-size: 13px; line-height: 18px; overflow-wrap: anywhere; user-select: all; }
.error-text { color: var(--danger); font-weight: 500; }

/* As janelas */
.dialog-veil {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-start; justify-content: center;
  padding: clamp(16px, 6vh, 64px) 16px; overflow-y: auto; background: rgba(12, 27, 32, .55);
}
.dialog { width: 100%; max-width: 720px; background: var(--card); border-radius: 24px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.report-text-body {
  max-height: 60vh; overflow: auto; padding: 12px; border-radius: 12px; background: var(--chip);
  font-family: var(--mono); font-size: 12px; line-height: 18px; white-space: pre-wrap; overflow-wrap: anywhere;
}

.toast {
  position: fixed; right: 16px; bottom: 16px; z-index: 30; max-width: min(420px, calc(100vw - 32px));
  padding: 12px 16px; border-radius: 16px; background: var(--scope); color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, .13); font-weight: 500;
}
.toast.bad { color: #FFC9C9; }
.loading { padding: 24px var(--gutter); color: var(--muted); }

@media (max-width: 720px) {
  .chart-end { transform: translate(calc(-100% - 11px), -100%); }
}
@media (max-width: 420px) {
  .band-side { gap: 8px; }
  .period { padding: 0 10px; }
  .osci-band { width: 84px; height: 75px; margin-bottom: -10px; }
}
@media (min-width: 1000px) {
  .nav { position: sticky; top: 0; height: 100vh; overflow-y: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  .nav-link, .tab, .period, .segment, .button, .switch { transition: background-color .15s ease; }
}
@media print {
  .nav, .toast { display: none; }
}
