:root {
  color-scheme: light;
  --page: #f2f5fa;
  --ink: #12233d;
  --muted: #4c607a;
  --line: #dce5f1;
  --blue: #1b52bb;
  --blue-soft: #eaf1ff;
  --green: #086343;
  --green-soft: #e7f6ef;
  --rust: #9c3e13;
  --rust-soft: #fff0e5;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); color: var(--ink); }
a { color: inherit; }
button, select, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #3475e4; outline-offset: 3px; }
.topbar { background: var(--ink); color: #fff; }
.topbar-inner, .shell { max-width: 1160px; margin: auto; padding-inline: clamp(16px, 4vw, 40px); }
.topbar-inner { height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; gap: 10px; align-items: center; text-decoration: none; font-size: .94rem; }
.brand strong { font-weight: 800; letter-spacing: .045em; }
.brand img { border-radius: 9px; }
.topbar-actions { display: flex; gap: 5px; }
.shell { padding-top: 40px; padding-bottom: max(42px, env(safe-area-inset-bottom)); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2.15rem, 5vw, 3.25rem); letter-spacing: -.055em; line-height: 1.12; }
h2 { font-size: 1.08rem; line-height: 1.35; letter-spacing: -.015em; }
h3 { font-size: 1.16rem; line-height: 1.35; overflow-wrap: anywhere; }
.route-label { color: var(--blue); font-size: .82rem; font-weight: 700; margin-bottom: 8px; }
.route-label span { margin-inline: 4px; }
.headline { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.health, .muted, .empty, .file-note { color: var(--muted); }
.health { margin-top: 9px; font-size: .9rem; }
.health.warn { color: var(--rust); }
.message { font-size: .88rem; color: var(--muted); margin-top: 8px; }
.message:empty { display: none; }
.button { border: 1px solid transparent; border-radius: 9px; min-height: 44px; padding: 9px 14px; font-size: .89rem; font-weight: 650; }
.button:disabled { opacity: .63; cursor: wait; }
.primary { color: #fff; background: var(--blue); }
.primary:hover:enabled { background: #184799; }
.subtle { color: #fff; background: transparent; padding-inline: 7px; }
.subtle:hover { background: #28415f; }
.secondary { color: var(--blue); background: #fff; border-color: var(--line); }
.secondary:hover { background: var(--blue-soft); }
.refresh { font-size: 1.14rem; vertical-align: -.03em; margin-right: 3px; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 24px 0; }
.metric { display: flex; flex-direction: column; min-width: 0; gap: 3px; color: var(--blue); background: var(--blue-soft); border-radius: 13px; padding: 13px 15px; }
.metric span { font-size: .82rem; font-weight: 650; }
.metric strong { font-size: 1.75rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.metric.positive { color: var(--green); background: var(--green-soft); }
.metric.attention { color: var(--rust); background: var(--rust-soft); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 15px; min-width: 0; box-shadow: 0 2px 3px #12233d06; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 18px; min-height: 66px; border-bottom: 1px solid var(--line); }
select, input { background: #fff; color: var(--ink); border: 1px solid #aebdd1; border-radius: 7px; padding: 7px 8px; }
.files { display: grid; }
.file { text-align: left; width: 100%; padding: 13px 17px; min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 9px; color: var(--ink); border: 0; border-top: 1px solid var(--line); background: #fff; }
.file:first-child { border-top: 0; }
.file:last-child { border-radius: 0 0 14px 14px; }
.file:hover { background: #f5f8ff; }
.file[aria-pressed="true"] { background: #edf3fd; box-shadow: inset 3px 0 var(--blue); }
.file-title { display: block; font-size: .94rem; font-weight: 650; overflow-wrap: anywhere; }
.file-note { display: block; font-size: .83rem; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; line-height: 1.3; border-radius: 6px; padding: 4px 7px; color: var(--blue); background: var(--blue-soft); flex: 0 0 auto; max-width: 46%; }
.tag.problem { color: var(--rust); background: var(--rust-soft); }
.tag.published { color: var(--green); background: var(--green-soft); }
.tag.quiet { color: var(--muted); background: var(--page); }
.empty, .timeline { padding: 17px 18px; }
.timeline-heading { display: flex; justify-content: space-between; gap: 9px; align-items: flex-start; }
.timeline > p { margin-top: 8px; }
.timeline .hint { margin-top: 12px; border-left: 3px solid var(--rust); padding: 8px 10px; border-radius: 4px; color: var(--rust); background: var(--rust-soft); font-size: .88rem; }
.timeline ol { list-style: none; padding: 0; margin: 19px 0 0; }
.timeline li { position: relative; margin-left: 6px; padding: 0 0 14px 17px; border-left: 1px solid #b6c8e3; font-size: .88rem; }
.timeline li::before { content: ''; position: absolute; width: 8px; height: 8px; background: var(--blue); border-radius: 50%; left: -4.5px; top: .36rem; }
.timeline li:last-child { border-color: transparent; padding-bottom: 0; }
.timeline small { display: block; color: var(--muted); }
.notifications { margin-top: 16px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.notifications p { font-size: .86rem; margin-top: 4px; }
.login { padding: clamp(18px, 5vw, 34px); max-width: 465px; margin: 4vh auto; }
.login h1 { font-size: 2rem; }
.login > p { margin-top: 9px; color: var(--muted); }
.login form { display: grid; gap: 8px; margin-top: 20px; }
.login label { font-size: .88rem; font-weight: 650; }
.login input { width: 100%; min-height: 44px; }
.login button { margin-top: 4px; justify-self: start; }
.sr-only { position: absolute; height: 1px; width: 1px; padding: 0; margin: -1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }

@media (max-width: 670px) {
  .shell { padding-top: 27px; }
  .headline { align-items: flex-start; flex-direction: column; gap: 13px; }
  .workspace { grid-template-columns: 1fr; }
  .metrics { gap: 7px; margin: 19px 0; }
  .metric { padding: 9px; border-radius: 10px; }
  .metric span { font-size: .75rem; }
  .metric strong { font-size: 1.4rem; }
}

@media (max-width: 390px) {
  .notifications { align-items: flex-start; flex-direction: column; }
  .topbar-inner { height: auto; min-height: 62px; }
  .brand { font-size: .8rem; }
}
