:root {
  color-scheme: light;
  font: 16px/1.5 system-ui, sans-serif;
  color: #19271e;
  background: #f5f7f4;
  --muted: #4f6355;
  --border: #d9e4da;
  --green: #22643f;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.frame { max-width: 1000px; margin: 0 auto; padding-inline: clamp(16px, 5vw, 42px); }
.site-header { border-bottom: 1px solid var(--border); background: #fff; }
.header-inner, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.header-inner { min-height: 68px; }
.wordmark { display: inline-flex; gap: 9px; align-items: center; color: inherit; text-decoration: none; font-weight: 750; }
.cell-icon { display: inline-block; width: 12px; height: 19px; background: var(--green); border-radius: 3px; position: relative; }
.cell-icon::before { content: ""; width: 5px; height: 3px; background: inherit; position: absolute; bottom: 100%; left: 3.5px; border-radius: 1px 1px 0 0; }
main { padding-block: 38px 50px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 6vw, 3.35rem); line-height: 1.1; letter-spacing: -.045em; }
h2 { font-size: 1.27rem; letter-spacing: -.02em; }
.intro p, .pairs p { color: var(--muted); margin-top: 8px; }
#notice:not(:empty) { margin-top: 18px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 27px; }
.stats div { background: #fff; border: 1px solid var(--border); border-radius: 13px; padding: 13px clamp(10px, 3vw, 20px); }
.stats strong { display: block; font-size: 1.6rem; }
.stats span, .detail { color: var(--muted); font-size: .86rem; }
.pairs, .inventory { margin-top: 20px; background: #fff; border: 1px solid var(--border); border-radius: 15px; padding: clamp(14px, 3vw, 22px); }
.pairs { background: #eaf3ea; }
.pair-list { padding: 0; margin: 13px 0 0; list-style: none; display: grid; gap: 8px; }
.pair-list:empty { display: none; }
.pair-list li { background: #fff; border-radius: 8px; padding: 8px 11px; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 12px; }
.badge { display: inline-block; padding: 4px 9px; border-radius: 16px; background: #e9f1e9; color: #295137; font-size: .75rem; font-weight: 670; white-space: nowrap; }
.pairs .badge { background: #d6e9d9; }
button, .button, input, select { font: inherit; border-radius: 8px; }
button, .button { background: var(--green); border: 1px solid transparent; color: white; padding: 8px 13px; cursor: pointer; font-size: .88rem; font-weight: 650; text-decoration: none; text-align: center; }
.secondary { background: #fff; color: #285437; border-color: var(--border); }
button:disabled { opacity: .55; }
:focus-visible { outline: 3px solid #427ab5; outline-offset: 2px; }
input, select { width: 100%; color: inherit; border: 1px solid #9aafa1; padding: 8px 10px; background: #fff; }
#search { margin-block: 14px 6px; max-width: 360px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
th { color: var(--muted); font-size: .79rem; font-weight: 650; }
td { font-size: .9rem; }
td strong, td .detail { display: block; }
tr:last-child td { border-bottom: none; }
#empty { padding: 12px 0 0; }
dialog { width: min(430px, calc(100% - 30px)); max-height: 90dvh; border: 1px solid var(--border); border-radius: 16px; padding: 20px; color: inherit; }
dialog::backdrop { background: #1b302680; }
dialog label { display: grid; gap: 4px; margin-top: 10px; font-size: .9rem; }
dialog label.check { display: flex; align-items: baseline; gap: 8px; }
.check input { width: auto; }
.dialog-actions { display: flex; gap: 7px; flex-wrap: wrap; }
dialog [role="alert"] { margin-block: 10px; color: #9f2c24; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 550px) {
  .stats { gap: 6px; }
  table, tbody { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 9px; padding: 9px 0; border-bottom: 1px solid var(--border); }
  tbody tr:last-child { border-bottom: 0; }
  td, tr:last-child td { border: none; padding: 3px 0; }
  td::before { content: attr(data-label); display: block; color: var(--muted); font-size: .76rem; }
}
