:root { color-scheme: light; --ink: #17252c; --muted: #62757c; --brand: #007c72; --line: #dce7e5; --surface: #fff; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #f3f7f6; color: var(--ink); font: 14px/1.65 system-ui, sans-serif; }
header { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 20px 5vw; background: var(--surface); border-bottom: 1px solid var(--line); }
header > div { display: flex; align-items: center; gap: 12px; }
header strong { font-size: 20px; }
.header-tools { flex-wrap: wrap; justify-content: end; }
.language-control { display: flex; align-items: center; gap: 8px; margin: 0; white-space: nowrap; }
.language-control select { width: auto; margin: 0; padding: 6px 10px; }
.mark { background: var(--brand); color: white; padding: 6px 10px; border-radius: 9px; font-weight: 800; }
.badge { display: inline-block; border: 1px solid #b4d8cd; color: var(--brand); background: #e8f6f1; border-radius: 20px; padding: 3px 10px; font-size: 11px; font-weight: 700; letter-spacing: 1px; }
main { max-width: 1440px; margin: 32px auto; padding: 0 5vw; min-height: 78vh; }
.card { background: var(--surface); padding: 24px; margin-bottom: 22px; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 3px 12px #15272c04; min-width: 0; }
.login { max-width: 660px; margin: 7vh auto; padding: 44px; }
.login h1 { font-size: 42px; line-height: 1.25; }
html[lang="en"] .login h1 { font-size: 38px; }
h1 { font-size: 30px; letter-spacing: -1px; line-height: 1.35; }
h2 { font-size: 17px; margin: 0 0 18px; }
p, small, .muted, #connection { color: var(--muted); }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 2px; color: var(--brand); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
label { display: block; margin-bottom: 14px; font-weight: 550; font-size: 13px; }
input, select, textarea { width: 100%; display: block; margin-top: 6px; padding: 10px 12px; border: 1px solid #cbdad6; border-radius: 7px; background: white; color: var(--ink); font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid #62b4a6; outline-offset: 1px; }
button { background: var(--brand); color: white; border: 1px solid transparent; border-radius: 7px; padding: 10px 16px; cursor: pointer; font: inherit; font-weight: 650; margin: 2px 5px 2px 0; }
button:hover { filter: brightness(.93); }
button:disabled { opacity: .5; cursor: wait; }
button.secondary { background: white; color: var(--muted); border-color: var(--line); }
button.danger { background: #fff1ee; color: #b44230; border-color: #f1d0c9; }
button.small { padding: 4px 9px; font-size: 12px; }
nav { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 30px; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
nav button { background: transparent; color: var(--muted); }
nav button.selected { background: #dcefe9; color: var(--brand); }
#refresh { margin-left: auto; }
.heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.heading h1 { margin: 0; }
.heading > span { font-size: 12px; color: var(--muted); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.metric { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.metric strong { display: block; font-size: 29px; margin-top: 10px; font-variant-numeric: tabular-nums; }
.metric span { color: var(--muted); }
code, pre { font: 12px/1.8 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; white-space: pre-wrap; }
pre { background: #f1f6f4; padding: 16px; border-radius: 8px; overflow: auto; }
code { color: var(--brand); }
.answer { min-height: 240px; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; font-size: 12px; }
th { color: var(--muted); background: #f5f8f7; font-weight: 600; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.check { display: flex; align-items: center; gap: 9px; }
.check input { width: auto; margin: 0; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; }
.filters label { flex: 1; min-width: 120px; margin: 0; }
.pagination { display: flex; gap: 16px; justify-content: end; align-items: center; margin-bottom: 22px; }
#notice { position: fixed; right: 24px; bottom: 24px; max-width: min(560px, 90vw); padding: 16px 24px; background: #193f35; color: white; border-radius: 12px; box-shadow: 0 6px 30px #0002; white-space: pre-wrap; z-index: 10; }
#notice.error { background: #922f29; }
#new-key { margin-top: 18px; padding: 15px; background: #eef8f2; border: 1px dashed #6db795; border-radius: 8px; }
#key-value { display: block; margin-bottom: 12px; }
footer { text-align: center; padding: 20px; color: var(--muted); font-size: 12px; }
a { color: var(--brand); }
section, .metrics, .metric, .filters > *, .grid > * { min-width: 0; }
.metric strong { overflow-wrap: anywhere; }
input, select, textarea { max-width: 100%; min-width: 0; }
.table-wrap { max-width: 100%; overscroll-behavior-x: contain; }
.usage-chart { display: block; width: 100%; height: auto; }
.usage-chart text { fill: var(--muted); font: 11px system-ui, sans-serif; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-upstream { fill: var(--brand); }
.chart-estimated { fill: #b67a12; }
.chart-manual { fill: #62757c; }
.chart-mock { fill: #8659b9; }
.chart-total { fill: var(--ink); }
.chart-track { fill: #edf3f1; }
.chart-line { fill: none; stroke: var(--brand); stroke-width: 2; }
.chart-line.chart-estimated { stroke: #b67a12; stroke-dasharray: 6 4; }
.chart-line.chart-manual { stroke: #62757c; stroke-dasharray: 3 3; }
.chart-line.chart-mock { stroke: #8659b9; stroke-dasharray: 9 3 2 3; }
.chart-line.chart-total { stroke: var(--ink); stroke-width: 2.5; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; }
.chart-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }
.legend-upstream::before { background: var(--brand); }
.legend-estimated::before { background: #b67a12; }
.legend-manual::before { background: #62757c; }
.legend-mock::before { background: #8659b9; }
.legend-total::before { background: var(--ink); }
.breakdown-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; margin-bottom: 14px; }
.breakdown-name { overflow-wrap: anywhere; text-align: left; white-space: normal; }
button.breakdown-name { background: transparent; color: var(--brand); padding: 6px 0; margin: 0; }
.rank-bar { display: block; width: 100%; height: 8px; grid-column: 1 / -1; }
summary { cursor: pointer; padding: 8px 0; overflow-wrap: anywhere; }
.log-message { min-width: 240px; max-width: 440px; white-space: normal; overflow-wrap: anywhere; }
#logs-table pre { min-width: 260px; max-width: 480px; }
.log-level { display: inline-block; padding: 2px 8px; border-radius: 6px; }
.log-error { color: #922f29; background: #ffebe8; }
.log-warning { color: #755009; background: #fff4d6; }
#analytics-summary, #logs-summary, [role="status"] { overflow-wrap: anywhere; }
@media (max-width: 600px) {
  header { padding: 16px 18px; }
  header > div { min-width: 0; flex-wrap: wrap; }
  .header-tools { justify-content: start; }
  main { margin-top: 22px; }
  .card { padding: 16px; }
  .heading { flex-direction: column; gap: 8px; }
  .heading > span { max-width: none; }
  .metrics { gap: 10px; }
  .metric { padding: 12px; }
  .metric strong { font-size: 24px; }
  .filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .filters label { min-width: 0; }
  button, button.small, input:not([type="checkbox"]), select, summary { min-height: 44px; }
  .check { min-height: 44px; }
  .check input { width: 20px; height: 20px; }
  .filters button { width: 100%; margin: 0; }
  nav { gap: 2px; }
  nav button { padding: 9px 11px; margin-right: 0; }
  #refresh { margin-left: 0; }
  .pagination { justify-content: space-between; gap: 8px; }
  .pagination button { padding: 10px; margin: 0; }
}
@media (max-width: 850px) { .grid { grid-template-columns: 1fr; gap: 0; } .metrics { grid-template-columns: 1fr 1fr; } #connection { display: none; } .heading { align-items: start; } .heading > span { max-width: 140px; } .login { padding: 28px; } main { padding: 0 18px; } }
