/* Hallmark · shape: app screen · genre: modern-minimal · theme: Console (deal 1/3, seed internal-monitoring-console-securities-784f·c3534a11·2026-11-02·r0) · redesign: full
 * nav: kept shell, one top bar holding the wordmark, the three tabs and sign-out · signature: the incident ledger, one row per incident read down a time column, its coverage folded beneath · states: loading, empty, error, full · console: graphite (dark), paper (light)
 * axes: dark/grotesk-sans/chromatic-amber · posture: restrained · contrast: pass · modes: dark+light · faces: Be Vietnam Pro for Host Grotesk (no Vietnamese glyphs), Pretendard for Hangul · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H5 E4 S4 R5 V4 · weakest: P, an internal queue argues little; the ledger puts the time first and amber only on what needs a person, so the team reads incidents in the order they broke */
/* Hallmark · finish-review: subagent · 6 findings · 6 resolved (time label shown, amber kept for 알림 대상, phone toolbar, outlet column, mono on figures only, toolbar held still while loading) · gap: none */
/* Hallmark · dismissed F4 · .btn-quiet[aria-expanded="true"] is the open state of the coverage toggle on the cool tint, and .btn-primary lives only on the sign-in page, which is its own page */
/* Hallmark · reworded "11. 02. 18:04" to "11.02 18:04" · same ICT values; the spaced Korean date form broke the mono time column */
/* Hallmark · waive 49b · a.ev__title links are whole Vietnamese news headlines of 80 to 120 characters · each headline is the incident itself and is read in full, so it wraps instead of being cut */
@import url("./tokens.css");
@import url("./base.css");

:root { --container: 1280px; --bar-h: 56px; --col-time: 8.75rem; --col-prio: 3rem; --control-h: 40px; }

body { min-height: 100dvh; }
/* what an instrument wrote (a time, a count, a status code): mono on the figure only, never on the Korean word beside it */
.measured { font-family: var(--font-outlier); font-variant-numeric: tabular-nums slashed-zero; }
a { text-decoration-color: var(--color-rule-2); }
a:hover { color: var(--color-accent); }

/* ---------- top bar ---------- */
.bar { position: sticky; top: 0; z-index: var(--z-sticky-nav); background: var(--color-paper); border-bottom: var(--rule-hair) solid var(--color-rule); }
.bar__inner { display: flex; align-items: stretch; gap: var(--space-lg); min-height: var(--bar-h); }
.wordmark { display: flex; align-items: center; margin: 0; max-width: none; font-size: var(--text-md); font-weight: 500; letter-spacing: -0.01em; line-height: 1.2; white-space: nowrap; }
.tabs { display: flex; gap: var(--space-2xs); overflow-x: auto; scrollbar-width: none; }
.tab { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--space-sm); border: 0; background: none; color: var(--color-muted); font-size: var(--text-sm); font-weight: 500; white-space: nowrap; cursor: pointer; transition: color var(--dur-short) var(--ease-out); }
.tab::after { content: ""; position: absolute; left: var(--space-sm); right: var(--space-sm); bottom: 0; height: 2px; background: var(--color-accent); transform: scaleX(0); transition: transform var(--dur-short) var(--ease-out); }
.tab:hover { color: var(--color-ink); }
.tab:active { color: var(--color-ink-2); }
.tab:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -4px; }
.tab:disabled { opacity: 0.55; cursor: not-allowed; }
.tab[aria-selected="true"] { color: var(--color-ink); }
.tab[aria-selected="true"]::after { transform: scaleX(1); }
.bar__meta { display: flex; align-items: center; gap: var(--space-md); margin-left: auto; }
.updated { min-width: 9.5rem; font-size: var(--text-sm); color: var(--color-muted); white-space: nowrap; }
.updated .measured { color: var(--color-cool); }

/* quiet control: the outline half of Console's pair */
.btn-quiet { position: relative; display: inline-flex; align-items: center; min-height: 32px; padding: 0 var(--space-sm); border: var(--rule-hair) solid var(--color-rule-2); border-radius: var(--radius-pill); background: var(--color-paper-2); color: var(--color-ink); font-size: var(--text-sm); font-weight: 500; line-height: 1.2; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out); }
.btn-quiet::before { content: ""; position: absolute; inset: -6px -2px; } /* 44px hit target */
.btn-quiet:hover { background: var(--color-paper-3); border-color: var(--color-muted); color: var(--color-ink); }
.btn-quiet:active { transform: translateY(1px); }
.btn-quiet:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.btn-quiet:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-quiet[aria-expanded="true"] { border-color: var(--color-cool); background: var(--color-cool-soft); }

/* ---------- workspace ---------- */
main { padding-block: var(--space-lg) var(--space-2xl); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); }
.field { min-height: var(--control-h); padding: 0 var(--space-sm); border: var(--rule-hair) solid var(--color-muted); border-radius: var(--radius-pill); background: var(--color-paper-3); color: var(--color-ink); font-size: var(--text-md); outline: 2px solid transparent; outline-offset: -2px; transition: border-color var(--dur-short) var(--ease-out); }
.field:hover { border-color: var(--color-ink-2); }
.field:focus-visible { outline-color: var(--color-focus); }
.field:disabled { opacity: 0.55; cursor: not-allowed; }
.field::placeholder { color: var(--color-muted); opacity: 1; }
select.field { cursor: pointer; padding-right: var(--space-xs); }
.field--search { flex: 1 1 18rem; min-width: 0; }
.count { min-width: 3.5rem; margin-left: auto; padding-right: var(--space-xs); font-size: var(--text-sm); color: var(--color-muted); text-align: right; white-space: nowrap; }
.count .measured { color: var(--color-ink); }
.hint { min-height: 1lh; margin-top: var(--space-sm); max-width: 72ch; font-size: var(--text-sm); color: var(--color-muted); }

/* the ledger: one surface, one incident per row */
.ledger { margin-top: var(--space-md); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper-2); overflow: clip; }
.ev { display: grid; grid-template-columns: var(--col-time) var(--col-prio) minmax(0, 1fr) auto; grid-template-areas: "time prio main more" ". . members members"; column-gap: var(--space-md); align-items: start; padding: var(--space-md) var(--space-lg); border-top: var(--rule-hair) solid var(--color-rule); }
.ev:first-child { border-top: 0; }
.ev__time { grid-area: time; padding-top: var(--space-3xs); font-size: var(--text-sm); color: var(--color-muted); white-space: nowrap; }
.ev__time .measured { color: var(--color-cool); }
.ev__prio { grid-area: prio; justify-self: start; }
.ev__main { grid-area: main; min-width: 0; }
.ev__more { grid-area: more; justify-self: end; }
.ev__title { font-weight: 500; line-height: 1.4; color: var(--color-ink); text-decoration: none; overflow-wrap: break-word; }
.ev__title:hover { color: var(--color-ink); text-decoration: underline; text-decoration-color: var(--color-accent); }
.ev__title:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; border-radius: 2px; }
.ev__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2xs) var(--space-md); margin-top: var(--space-2xs); font-size: var(--text-sm); color: var(--color-muted); }

.chip { display: inline-flex; align-items: center; min-height: 22px; padding: 0 var(--space-xs); border: var(--rule-hair) solid var(--color-rule-2); border-radius: var(--radius-chip); font-size: var(--text-sm); font-weight: 500; line-height: 1.2; color: var(--color-ink-2); white-space: nowrap; }
.chip--person { border-color: var(--color-accent); background: var(--color-accent-soft); color: var(--color-ink); }
.chip--old { border-style: dashed; color: var(--color-muted); }
/* priority is what the classifier wrote, not a person's call: no amber here; P1 is set apart by ink and a firmer edge */
.prio { display: inline-flex; align-items: center; justify-content: center; min-width: 2.25rem; min-height: 22px; border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-chip); font-size: var(--text-sm); font-weight: 500; line-height: 1.2; color: var(--color-muted); }
.prio--P1 { border-color: var(--color-ink-2); background: var(--color-paper-3); color: var(--color-ink); }

/* coverage of one incident, folded under its row */
.members { grid-area: members; display: grid; gap: var(--space-sm); margin: var(--space-md) 0 0; padding: var(--space-2xs) 0 var(--space-2xs) var(--space-md); border-left: var(--rule-hair) solid var(--color-rule-2); list-style: none; }
.members li { min-width: 0; font-size: var(--text-sm); line-height: 1.45; }
.members a { color: var(--color-ink); overflow-wrap: break-word; }
.members__meta { display: flex; flex-wrap: wrap; gap: 0 var(--space-md); margin-top: var(--space-3xs); color: var(--color-muted); }
.members__meta time, .members__meta .measured { font-family: var(--font-outlier); color: var(--color-cool); font-variant-numeric: tabular-nums slashed-zero; }
.state--error .measured { color: var(--color-bad); }

/* region states */
.state { padding: var(--space-xl) var(--space-lg); text-align: left; color: var(--color-muted); }
.state--error { color: var(--color-bad); }
.state__line { margin-top: var(--space-2xs); color: var(--color-muted); }
.skel { display: block; height: 0.9em; border-radius: var(--radius-chip); background: var(--color-rule); }
.skel--time { width: 5.5rem; }
.skel--prio { width: 2.25rem; height: 22px; }
.skel--title { width: min(36rem, 90%); }
.skel--meta { width: 14rem; margin-top: var(--space-xs); height: 0.75em; }

/* ---------- collection status ---------- */
.health { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2xl); }
.overview { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-xl) var(--space-2xl); align-items: end; padding-bottom: var(--space-xl); border-bottom: var(--rule-hair) solid var(--color-rule); }
.reading { display: grid; gap: var(--space-xs); }
.reading__value { font-family: var(--font-outlier); font-size: clamp(3.5rem, 6vw, 5rem); font-weight: 400; line-height: 1; letter-spacing: -0.04em; color: var(--color-ink); font-variant-numeric: tabular-nums slashed-zero; }
.reading__unit { font-size: 0.5em; color: var(--color-muted); letter-spacing: 0; }
.reading__label { font-size: var(--text-sm); color: var(--color-muted); }
.figures { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0; }
.figures > div { padding-inline: var(--space-md); border-left: var(--rule-hair) solid var(--color-rule); }
.figures > div:first-child { padding-left: 0; border-left: 0; }
.figures dt { font-size: var(--text-sm); color: var(--color-muted); text-wrap: balance; }
.figures dd { margin: var(--space-2xs) 0 0; font-family: var(--font-outlier); font-size: var(--text-2xl); line-height: 1.1; color: var(--color-ink); font-variant-numeric: tabular-nums slashed-zero; }
.figures dd.is-bad { color: var(--color-bad); }
.block h2 { font-size: var(--text-lg); letter-spacing: -0.01em; }
.block .note { margin-top: var(--space-sm); max-width: 72ch; font-size: var(--text-sm); color: var(--color-muted); }
.scroll { margin-top: var(--space-md); overflow-x: auto; }
.tbl { width: 100%; min-width: 40rem; border-collapse: collapse; font-size: var(--text-sm); } /* narrower screens scroll the table instead of crushing it */
.tbl th, .tbl td { padding: var(--space-xs) var(--space-md) var(--space-xs) 0; border-bottom: var(--rule-hair) solid var(--color-rule); text-align: left; vertical-align: top; }
.tbl th { font-weight: 500; color: var(--color-muted); white-space: nowrap; }
.tbl td.num, .tbl th.num { text-align: right; padding-right: var(--space-lg); }
.tbl td.num, .tbl td.measured { font-family: var(--font-outlier); font-variant-numeric: tabular-nums slashed-zero; color: var(--color-ink-2); }
.tbl td.measured { color: var(--color-cool); white-space: nowrap; }
.tbl td.url { color: var(--color-muted); overflow-wrap: anywhere; min-width: 16rem; }
.tbl--outlets td:first-child { min-width: 11rem; }
.tbl td.is-bad { color: var(--color-bad); }
.tbl th:first-child, .tbl td:first-child { position: sticky; left: 0; background: var(--color-paper); }

/* ---------- sign-in (served by functions/_middleware.js) ---------- */
.login { display: grid; place-items: center; min-height: 100dvh; padding: var(--space-lg) var(--space-md); }
.login__panel { width: min(22rem, 100%); padding: var(--space-xl) var(--space-lg); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); background: var(--color-paper-2); }
.login__title { max-width: none; font-size: var(--text-lg); letter-spacing: -0.01em; line-height: 1.3; }
.login form { display: grid; gap: var(--space-xs); margin-top: var(--space-lg); }
.login label { font-size: var(--text-sm); font-weight: 500; color: var(--color-ink-2); }
.login .field { width: 100%; }
.login .field[aria-invalid="true"] { border-color: var(--color-bad); }
.login__error { min-height: 1lh; font-size: var(--text-sm); color: var(--color-bad); }
.btn-primary { display: inline-flex; align-items: center; justify-content: center; min-height: var(--control-h); padding: 0 var(--space-md); border: var(--rule-hair) solid var(--color-accent); border-radius: var(--radius-pill); background: var(--color-accent); color: var(--color-accent-ink); font-size: var(--text-md); font-weight: 500; white-space: nowrap; cursor: pointer; transition: background-color var(--dur-short) var(--ease-out); }
.btn-primary:hover { background: color-mix(in oklab, var(--color-accent) 88%, var(--color-ink)); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ---------- narrow screens ---------- */
@media (max-width: 60rem) {
  .bar__inner { flex-wrap: wrap; column-gap: var(--space-md); row-gap: 0; }
  .wordmark, .bar__meta { min-height: 48px; }
  .tabs { order: 3; flex: 1 0 100%; margin-inline: calc(-1 * var(--space-sm)); }
  .overview { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .figures { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: var(--space-md); }
  .figures > div:nth-child(3n + 1) { padding-left: 0; border-left: 0; }
}
@media (max-width: 40rem) {
  .ev { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "prio time" "main main" "more more" "members members"; row-gap: var(--space-xs); padding: var(--space-md); }
  .ev__time { padding-top: 0; align-self: center; }
  .ev__more { justify-self: start; }
  .members { margin-top: var(--space-2xs); }
  .toolbar select.field { flex: 1 1 0; min-width: 0; }
  .field--search { flex: 1 0 100%; }
  .count { min-width: 0; margin-left: 0; text-align: left; }
  .updated { min-width: 0; }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figures > div:nth-child(3n + 1) { padding-left: var(--space-md); border-left: var(--rule-hair) solid var(--color-rule); }
  .figures > div:nth-child(2n + 1) { padding-left: 0; border-left: 0; }
}
