:root {
  color-scheme: light;
  --ink: #172520;
  --muted: #4f615a;
  --line: #d9e3de;
  --canvas: #f3f6f4;
  --accent: #125541;
  --accent-hover: #0c4231;
  --danger: #922826;
  font-family: Inter, system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: .23em; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible { outline: 3px solid #35836d; outline-offset: 3px; }
header { background: #112a23; color: white; }
.shell { width: min(75rem, 100% - 3rem); margin-inline: auto; }
.header-inner, nav, .brand, .heading, .section-heading, .actions, .pagination {
  display: flex; align-items: center; flex-wrap: wrap; gap: .8rem;
}
.header-inner, .heading, .section-heading { justify-content: space-between; }
.header-inner { min-height: 4.4rem; padding-block: .55rem; gap: .5rem 2rem; }
.brand { color: white; text-decoration: none; gap: .75rem; }
.brand span { background: #d6f0df; color: #153c2e; padding: .36rem .5rem; border-radius: .25rem; font-weight: 750; }
nav a, .nav-button { color: inherit; padding: .5rem .3rem; }
nav a:hover, .nav-button:hover { text-decoration: underline; }
.nav-button { border: 0; background: transparent; }
main { padding-block: 2.25rem 4rem; }
h1, h2 { margin: 0; letter-spacing: -.035em; line-height: 1.15; }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin-bottom: 1rem; }
h2 { font-size: 1.26rem; }
.heading { margin-bottom: 1.15rem; }
.heading h1, .section-heading h2 { margin: 0; }
p { line-height: 1.55; }
.panel { padding: 1.2rem; border: 1px solid var(--line); border-radius: .75rem; background: white; margin-bottom: 1rem; }
.panel p:first-child { margin-top: 0; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin: 0 0 1rem; }
.metrics div { padding: 1rem 1.2rem; border-radius: .7rem; background: #e4efe9; border: 1px solid #d4e5db; }
.metrics dt { color: var(--muted); font-size: .88rem; font-weight: 600; }
.metrics dd { font-size: clamp(1.5rem, 3vw, 2.25rem); margin: .28rem 0 0; font-weight: 700; font-variant-numeric: tabular-nums; }
button, input, select, textarea, .button { font: inherit; }
button, .button { border-radius: .42rem; padding: .65rem .95rem; min-height: 2.6rem; font-weight: 650; cursor: pointer; }
.button { display: inline-flex; align-items: center; text-decoration: none; }
.primary { background: var(--accent); color: white; border: 1px solid var(--accent); }
.primary:hover { background: var(--accent-hover); }
.secondary { color: var(--accent); border: 1px solid #bfd1c8; background: white; }
.secondary:hover { background: #edf6f0; }
.danger { background: #fff8f8; color: var(--danger); border: 1px solid #e8c4c0; }
label, legend { display: block; font-size: .9rem; font-weight: 650; margin-bottom: .28rem; }
input:not([type=checkbox]):not([type=hidden]), select, textarea {
  width: 100%; min-width: 0; border: 1px solid #97aaa0; padding: .55rem .65rem; border-radius: .35rem;
  min-height: 2.65rem; background: white; color: var(--ink);
}
input:disabled, select:disabled { opacity: .75; }
textarea { resize: vertical; }
input[type=checkbox] { accent-color: var(--accent); }
.helptext, .muted, .intro { color: var(--muted); font-size: .9rem; }
.helptext { margin-top: .25rem; }
.block { display: block; }
fieldset { min-width: 0; border: 1px solid var(--line); border-radius: .4rem; }
.field-stack > div, .field-stack > fieldset { margin: 0 0 .9rem; }
.field-stack button { margin-top: .35rem; }
.filter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; margin-bottom: 1rem; }
.actions > label { margin: 0; }
.export { margin-left: auto; }
.table-panel { padding: 0; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: .91rem; }
th, td { text-align: left; padding: .75rem .8rem; border-bottom: 1px solid var(--line); }
th { white-space: nowrap; background: #edf3ef; color: #33483e; }
tr:last-child td { border-bottom: 0; }
td:first-child a { white-space: nowrap; font-weight: 650; }
.pagination { justify-content: center; }
.pill { font-size: .78rem; color: #45584e; background: #eef2f0; border-radius: 1rem; padding: .22rem .5rem; white-space: nowrap; }
.narrow { max-width: 40rem; margin: auto; }
.auth { max-width: 28rem; padding-top: 1.3rem; }
.back { display: inline-block; margin-bottom: .7rem; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.definition { display: grid; grid-template-columns: minmax(7rem, 1fr) 1.7fr; gap: .55rem .8rem; margin-bottom: .5rem; }
.definition dt { color: var(--muted); }
.definition dd { margin: 0; overflow-wrap: anywhere; }
.history, .cancel, .account-actions { border-top: 1px solid var(--line); padding-top: .7rem; margin-top: .7rem; }
.history li { margin: .35rem 0; overflow-wrap: anywhere; }
summary { cursor: pointer; font-weight: 650; color: var(--accent); }
details form { margin-block: .75rem 0; }
.item-list { list-style: none; padding: 0; margin: .6rem 0 0; }
.item-list li { padding: .75rem 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.notice { padding: .65rem .85rem; background: #e5f3eb; border-left: 3px solid var(--accent); }
.errorlist, .error { color: var(--danger); }
.notice.error { background: #fff2f1; border-color: var(--danger); }
.qr { display: block; background: white; border: 1px solid var(--line); padding: .35rem; margin-bottom: .6rem; }
.secret, .codes { font-family: ui-monospace, monospace; overflow-wrap: anywhere; }
.codes { columns: 2; padding-left: 1.2rem; line-height: 1.7; }
.skip { position: absolute; left: .8rem; top: -8rem; background: white; padding: .5rem; }
.skip:focus { top: .5rem; z-index: 2; }
@media (max-width: 48rem) {
  .shell { width: calc(100% - 1.5rem); }
  main { padding-top: 1.4rem; }
  .header-inner { align-items: flex-start; }
  nav { gap: .45rem; }
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
  .metrics div { padding: .65rem .5rem; }
  .metrics dd { overflow-wrap: anywhere; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: 1fr; gap: 0; }
  .table-panel { background: transparent; border: 0; }
  table, tbody, tr, td { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tr { border: 1px solid var(--line); border-radius: .6rem; margin-bottom: .6rem; background: white; padding: .55rem .75rem; }
  td { border: 0; padding: .24rem 0; display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: .45rem; }
  td::before { content: attr(data-label); color: var(--muted); font-size: .83rem; }
  .export { margin-left: 0; }
}
