:root {
  color-scheme: light;
  --ink: #202425;
  --muted: #595f60;
  --faint: #727779;
  --line: #dfe2e2;
  --rule: #eceeee;
  --ground: #f6f7f7;
  --paper: #fff;
  --blue: #1d5fbf;
  --good: #226844;
  --bad: #a13531;
  --amber: #805515;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--ground);
  font-variant-numeric: tabular-nums;
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 260px; font-size: 14px; line-height: 1.55; }
button, select, input, textarea { font: inherit; color: inherit; }
button, a, summary, select { -webkit-tap-highlight-color: transparent; }
button, .as-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 36px; border: 1px solid #cdd1d1; border-radius: 6px;
  padding: 6px 13px; background: var(--paper); font-weight: 550; cursor: pointer;
}
button:hover { background: #f0f2f2; border-color: #b3b8b9; }
button:active { transform: translateY(1px); }
button:disabled { color: #7c8182; background: #f3f4f4; border-color: var(--line); cursor: default; transform: none; }
button.primary { color: white; background: var(--ink); border-color: var(--ink); }
button.primary:hover { background: #353a3b; }
button.primary:disabled { background: #65696a; border-color: #65696a; }
button.danger { color: var(--bad); }
button.primary.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
button.quiet { border-color: transparent; color: var(--muted); background: transparent; }
button.quiet:hover { background: #f1f2f2; color: var(--ink); }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
h1,h2,h3,p { margin: 0; }
h1 { font-size: 27px; font-weight: 650; line-height: 1.27; letter-spacing: -.035em; }
h2 { font-size: 17px; font-weight: 640; line-height: 1.45; }
h3 { font-size: 14px; line-height: 1.5; font-weight: 620; }
.skip { position: fixed; top: 3px; left: max(18px,calc((100vw - 1200px)/2)); z-index: 8; background: var(--paper); padding: 9px; transform: translateY(-160%); }
.skip:focus { transform: none; }
.frame { width: min(calc(100% - 64px), 1200px); margin-inline: auto; }
.masthead, .navigation { background: var(--paper); border-bottom: 1px solid var(--line); }
.masthead-inner, .header-tools, .brand, .nav-inner, .page-actions, .group-actions, .dialog-actions {
  display: flex; align-items: center;
}
.masthead-inner { min-height: 66px; justify-content: space-between; gap: 16px; }
.header-tools, .brand { gap: 13px; }
.brand strong { font-size: 21px; font-weight: 690; letter-spacing: -.065em; }
.brand > span { border-left: 1px solid #cbd0d0; padding-left: 13px; color: var(--muted); }
.mark { display: block; position: relative; width: 22px; height: 22px; }
.mark::before, .mark::after {
  content: ""; position: absolute; width: 7px; height: 15px; border: 2px solid var(--ink);
  border-radius: 2px; transform: skewY(-16deg); top: 3px; left: 1px;
}
.mark::after { top: 0; left: 11px; }
.nav-inner { gap: 28px; }
.nav-inner a {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 47px;
  padding-inline: 2px; border-bottom: 2px solid transparent; text-decoration: none; color: var(--muted);
  font-weight: 520; white-space: nowrap;
}
.nav-inner a:hover, .nav-inner a[aria-current="page"] { color: var(--ink); }
.nav-inner a[aria-current="page"] { border-bottom-color: var(--ink); font-weight: 630; }
.count { font-size: 12px; line-height: 18px; border-radius: 5px; padding-inline: 5px; background: #e9ebeb; }
.connection { color: var(--muted); font-size: 12px; white-space: nowrap; }
.connection::before, .status i {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  vertical-align: .12em; margin-right: 6px; background: #969c9d;
}
.connection[data-level="good"]::before,.status.good i { background: var(--good); }
.connection[data-level="warn"]::before,.status.warn i { background: var(--amber); }
.status.bad i { background: var(--bad); }
.status { font-size: 12px; color: var(--muted); white-space: normal; overflow-wrap: anywhere; }
main { padding: 27px 0 60px; }
.page-heading,.section-head,.summary-line,.notice,.queue-item {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.page-heading { margin-bottom: 21px; }
.page-heading .meta { margin-top: 5px; }
.meta,.hint,.minor,.empty { color: var(--muted); }
.meta,.minor { font-size: 12px; }
.hint,.empty { font-size: 13px; line-height: 1.65; }
.page-actions,.group-actions,.dialog-actions { gap: 8px; }
.page-actions button { white-space: nowrap; }
.group-actions { flex-wrap: wrap; }
.group-actions button { font-size: 13px; }
.columns { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(0,1fr); gap: 16px; align-items: start; }
.overview-panels { align-items: stretch; }
.stack,.section-stack { display: grid; gap: 16px; min-width: 0; }
.panel {
  min-width: 0; padding: 19px 21px 18px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 8px;
}
.section-head { align-items: baseline; margin-bottom: 15px; }
.section-link { font-size: 13px; color: var(--muted); text-align: right; white-space: nowrap; }
.section-link:hover { color: var(--ink); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); margin: 0; }
.metric { min-width: 0; padding: 4px 19px; border-left: 1px solid var(--line); }
.metric:first-child { padding-left: 0; border-left: 0; }
.metric:last-child { padding-right: 0; }
.metric dt { color: var(--muted); font-size: 13px; }
.metric dd { margin: 5px 0 0; font-size: clamp(21px,2.25vw,32px); font-weight: 540; letter-spacing: -.035em; line-height: 1.25; overflow-wrap: anywhere; }
.number,.numeric { font-variant-numeric: tabular-nums; }
.numeric { text-align: right; }
.positive { color: var(--good); }
.negative { color: var(--bad); }
.missing,.zero { color: var(--faint); }
.panel > .hint,.panel > .minor { margin-top: 12px; }
.panel > .hint:first-child { margin-top: 0; }
.empty { padding: 4px 0 6px; }
.facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px 18px; margin: 0; }
.facts > div { min-width: 0; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 2px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.exposure-table,.ledger { width: 100%; border-collapse: collapse; table-layout: auto; }
th,td { padding: 9px 6px; text-align: left; font-weight: normal; vertical-align: top; }
th { font-size: 12px; color: var(--muted); }
td { border-top: 1px solid var(--rule); overflow-wrap: anywhere; }
th:first-child,td:first-child { padding-left: 0; }
th:last-child,td:last-child { padding-right: 0; }
.exposure-table th,.exposure-table td { white-space: nowrap; }
.exposure-table tbody th { border-top: 1px solid var(--rule); font-size: 14px; color: var(--ink); font-weight: 580; }
.exposure-meter { display: block; height: 5px; width: 63px; margin: 5px 0 2px; appearance: none; border: 0; background: #e9ebec; border-radius: 2px; }
.exposure-meter::-webkit-meter-bar { background: #e9ebec; border: 0; border-radius: 2px; }
.exposure-meter::-webkit-meter-optimum-value { background: var(--blue); border-radius: 2px; }
.exposure-meter::-moz-meter-bar { background: var(--blue); }
.reading-frame { max-width: 100%; overflow-x: auto; }
.reading-frame + .facts { border-top: 1px solid var(--rule); margin-top: 4px; padding-top: 10px; }
.queue-item { align-items: baseline; padding: 9px 0; border-top: 1px solid var(--rule); }
.queue-item:first-child { border-top: 0; padding-top: 0; }
.queue-item:last-child { padding-bottom: 0; }
.queue-item > :first-child { min-width: 0; overflow-wrap: anywhere; }
.queue-item > :last-child { flex-shrink: 0; }
.queue-item .minor { display: block; margin-top: 2px; }
.record { border-top: 1px solid var(--rule); }
.record:first-child { border-top: 0; }
details { min-width: 0; }
.record > summary {
  display: grid; grid-template-columns: minmax(0,1fr) auto 11px; gap: 12px; align-items: center;
  cursor: pointer; min-height: 54px; list-style: none; padding: 9px 2px; border-radius: 3px;
}
.record > summary::-webkit-details-marker { display: none; }
.record > summary::after {
  content: ""; width: 6px; height: 6px; border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); justify-self: center;
}
.record[open] > summary::after { transform: rotate(45deg); }
.record > summary:hover { background: #f7f8f8; }
.record-name { display: block; font-weight: 590; overflow-wrap: anywhere; }
.record-meta { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.record-body { display: grid; gap: 14px; padding: 4px 2px 17px; min-width: 0; }
.paragraph { white-space: pre-wrap; overflow-wrap: anywhere; }
.notice { padding: 10px 15px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; margin-bottom: 16px; }
.warning { color: #73511d; background: #fffbef; border-color: #e5d6ae; }
.notice button { flex-shrink: 0; font-size: 13px; min-height: 32px; }
.entry { max-width: 420px; padding: 0 0 35px; margin: clamp(42px,12vh,135px) auto; }
.entry h1 { margin: 0 0 10px; }
.entry > p:first-of-type { color: var(--muted); margin-bottom: 21px; }
label,legend { font-size: 13px; display: block; font-weight: 590; margin-bottom: 6px; }
input:not([type="checkbox"]),textarea,select { width: 100%; padding: 9px 11px; border: 1px solid #afb5b5; border-radius: 5px; background: var(--paper); }
textarea { resize: vertical; min-height: 90px; }
.entry input { margin-bottom: 16px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.field + .field { margin-top: 14px; }
.check { display: flex; gap: 8px; align-items: baseline; font-weight: normal; }
.check input { margin: 0; }
.form-error { color: var(--bad); font-size: 13px; margin: 9px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
dialog { padding: 22px; width: min(460px,calc(100% - 24px)); max-height: 86dvh; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--paper); }
dialog::backdrop { background: rgba(25,29,30,.43); }
dialog h2 { font-size: 20px; }
#action-description { color: var(--muted); font-size: 14px; margin: 8px 0 17px; white-space: pre-wrap; overflow-wrap: anywhere; }
.dialog-actions { justify-content: flex-end; margin-top: 20px; }
.toast { position: fixed; bottom: max(20px,env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 4; width: max-content; max-width: calc(100% - 32px); padding: 10px 17px; color: #fff; background: var(--ink); border-radius: 6px; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .frame { width: calc(100% - 40px); }
  .columns { grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: 12px; }
  .panel { padding: 16px; }
  .stack,.section-stack { gap: 12px; }
}
@media (max-width: 700px) {
  .columns { grid-template-columns: minmax(0,1fr); }
  .overview-panels > .pending-inbox { order: -1; }
  .navigation { position: static; }
  .nav-inner { justify-content: space-between; gap: 8px; }
  .nav-inner a { min-height: 45px; font-size: 13px; }
  .header-tools,.brand { gap: 8px; }
  .brand > span { display: none; }
  .masthead-inner { min-height: 52px; gap: 6px; }
  .brand strong { font-size: 19px; }
  main { padding-top: 19px; padding-bottom: calc(38px + env(safe-area-inset-bottom)); }
  h1 { font-size: 23px; }
  .page-heading { margin-bottom: 16px; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); row-gap: 14px; }
  .metric { padding: 0 10px; }
  .metric:nth-child(odd) { padding-left: 0; border-left: 0; }
  .metric dd { font-size: 24px; }
  button,.as-button { min-height: 44px; }
  .entry { margin-top: 55px; }
  input:not([type="checkbox"]),textarea,select { font-size: 16px; }
}
@media (max-width: 480px) {
  .frame { width: calc(100% - 32px); }
  .page-heading { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 7px; }
  #work-heading { display: contents; }
  #view-title { grid-area: 1 / 1; }
  .page-actions { grid-area: 1 / 2; }
  #snapshot-time { grid-area: 2 / 1 / 3 / -1; }
  .header-tools button { font-size: 12px; padding-inline: 6px; }
  .page-actions { gap: 5px; }
  .page-actions button { padding-inline: 10px; }
  .connection,.meta { font-size: 12px; }
  .panel { padding: 14px; }
  .section-head { margin-bottom: 11px; }
  .exposure-table td,.exposure-table th { font-size: 12px; padding: 7px 4px; }
  .exposure-table td:first-child,.exposure-table th:first-child { padding-left: 0; }
  .exposure-table td:last-child,.exposure-table th:last-child { padding-right: 0; }
  .exposure-table tbody th { font-size: 13px; }
  .exposure-meter { width: 42px; }
  .record > summary { gap: 7px; }
  .notice { align-items: flex-start; gap: 8px; }
}
@media (max-width: 345px) {
  .page-actions button { padding-inline: 7px; }
  .nav-inner { gap: 2px; }
  .nav-inner a { font-size: 12px; }
  .connection { font-size: 11px; }
  .header-tools { gap: 1px; }
}
@media (prefers-reduced-motion: reduce) { button:active { transform: none; } }
