:root {
  color-scheme: light;
  --bg: oklch(0.972 0.004 264);
  --surface: oklch(0.996 0.002 264);
  --surface-2: oklch(0.962 0.005 264);
  --surface-3: oklch(0.93 0.007 264);
  --line: oklch(0.912 0.006 264);
  --line-strong: oklch(0.855 0.008 264);
  --text: oklch(0.24 0.02 266);
  --text-2: oklch(0.47 0.016 266);
  --text-3: oklch(0.6 0.012 266);
  --accent: oklch(0.44 0.13 266);
  --accent-hover: oklch(0.39 0.13 266);
  --accent-soft: oklch(0.94 0.025 266);
  --on-accent: oklch(0.985 0.004 266);
  --ok: oklch(0.5 0.11 152);
  --ok-soft: oklch(0.94 0.04 152);
  --warn: oklch(0.52 0.11 65);
  --warn-soft: oklch(0.95 0.05 85);
  --bad: oklch(0.52 0.17 27);
  --bad-soft: oklch(0.95 0.028 27);
  --toast: oklch(0.25 0.02 266);
  --on-toast: oklch(0.97 0.005 266);
  --scrim: oklch(0.22 0.02 266 / 0.36);
  --shadow: 0 1px 2px oklch(0.22 0.02 266 / 0.06);
  --shadow-l: 0 24px 56px -16px oklch(0.22 0.02 266 / 0.3), 0 0 0 1px oklch(0.22 0.02 266 / 0.05);
  --focus: color-mix(in oklch, var(--accent) 24%, transparent);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%236b7080' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E");
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --radius: 8px;
  --radius-l: 12px;
  --sidebar: 232px;
  --control: 36px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: oklch(0.17 0.008 266);
    --surface: oklch(0.205 0.01 266);
    --surface-2: oklch(0.235 0.011 266);
    --surface-3: oklch(0.275 0.012 266);
    --line: oklch(0.285 0.012 266);
    --line-strong: oklch(0.355 0.014 266);
    --text: oklch(0.93 0.006 266);
    --text-2: oklch(0.72 0.012 266);
    --text-3: oklch(0.58 0.012 266);
    --accent: oklch(0.72 0.12 266);
    --accent-hover: oklch(0.78 0.1 266);
    --accent-soft: oklch(0.3 0.05 266);
    --on-accent: oklch(0.17 0.02 266);
    --ok: oklch(0.74 0.12 152);
    --ok-soft: oklch(0.3 0.05 152);
    --warn: oklch(0.8 0.12 80);
    --warn-soft: oklch(0.32 0.05 75);
    --bad: oklch(0.72 0.15 27);
    --bad-soft: oklch(0.31 0.06 27);
    --toast: oklch(0.93 0.006 266);
    --on-toast: oklch(0.2 0.01 266);
    --scrim: oklch(0.08 0.01 266 / 0.6);
    --shadow: none;
    --shadow-l: 0 24px 56px -16px oklch(0 0 0 / 0.6), 0 0 0 1px oklch(1 0 0 / 0.06);
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23a3a8b8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E");
  }
}

@media (pointer: coarse) {
  :root { --control: 44px; }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  font: 14px/1.45 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, dl, dd, figure { margin: 0; }

a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }

@media (hover: hover) and (pointer: fine) {
  a:hover { text-decoration-color: currentColor; }
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

::selection { background: var(--accent-soft); }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.app {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  background: linear-gradient(to right, var(--surface) calc(var(--sidebar) - 1px), var(--line) calc(var(--sidebar) - 1px) var(--sidebar), var(--bg) var(--sidebar));
}

.sidebar {
  position: sticky;
  top: 0;
  inset: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: auto;
  height: 100dvh;
  margin: 0;
  padding: 20px 12px 16px;
  overflow-y: auto;
  border: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 14px;
  font-weight: 700;
}

.nav-group { display: grid; gap: 1px; }

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-weight: 500;
  text-decoration: none;
  transition: background-color 150ms ease, color 150ms ease;
}

.nav-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }

@media (hover: hover) and (pointer: fine) {
  .nav-link:not([aria-current="page"]):hover { background: var(--surface-2); color: var(--text); }
}

.nav-foot { display: grid; gap: 1px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }

.nav-foot button.nav-link { width: 100%; border: 0; background: none; font: inherit; font-weight: 500; text-align: left; cursor: pointer; }

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

.topbar { display: none; }

.main { width: 100%; max-width: 1240px; padding: 28px 40px 72px; }

.head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 20px;
}

.head h1 { font-size: 22px; line-height: 1.25; font-weight: 650; letter-spacing: -0.01em; }

.head .count { margin-left: 6px; color: var(--text-3); font-weight: 500; font-variant-numeric: tabular-nums; }

.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; color: var(--text-2); }

.meta a { color: var(--text); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.back { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 8px -2px; color: var(--text-2); font-size: 13px; text-decoration: none; }

.back::before {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m14 6-6 6 6 6'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m14 6-6 6 6 6'/%3E%3C/svg%3E") no-repeat center / contain;
}

@media (hover: hover) and (pointer: fine) {
  .back:hover { color: var(--text); }
}

.section { margin-top: 32px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 10px; }

.section-head h2, .panel h2 { font-size: 15px; line-height: 1.3; font-weight: 600; }

.section-head .count { margin-left: 4px; color: var(--text-3); font-weight: 500; font-variant-numeric: tabular-nums; }

.panel {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.stat { display: grid; align-content: start; gap: 4px; padding: 14px 18px; box-shadow: -1px 0 0 var(--line); }

.stat dt { color: var(--text-2); font-size: 13px; }

.stat dd { font-size: 22px; line-height: 1.2; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; }

.stat .sub { color: var(--text-3); font-size: 13px; }

.callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 12px;
  padding: 10px 12px 10px 18px;
  border-radius: var(--radius-l);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}



.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

table { width: 100%; border-collapse: collapse; }

th {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

td { height: 44px; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }

tbody tr:last-child td { border-bottom: 0; }

tr[data-href] { cursor: pointer; }

td a { text-decoration: none; }

@media (hover: hover) and (pointer: fine) {
  tbody tr:hover td { background: var(--surface-2); }
  td a:hover { text-decoration: underline; text-decoration-color: currentColor; }
}

.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.nowrap { white-space: nowrap; }

.dim, .dim a { color: var(--text-2); }

.faint { color: var(--text-3); }

.strong { font-weight: 600; }

.mono { font-family: var(--mono); font-size: 13px; }

.select-all { user-select: all; }

.title-cell { min-width: 220px; }

.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }

.sub-line { display: block; margin-top: 2px; color: var(--text-3); font-size: 13px; }

.truncate { max-width: 52vw; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

tr.group th { padding: 14px 14px 8px; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600; }

tbody + tbody tr.group th { border-top: 1px solid var(--line); }

tr.past td, tr.past td a { color: var(--text-3); }

.past-table td, .past-table td a { color: var(--text-2); }

.show-sm, .show-sm-inline { display: none; }

tr.muted td:not(.cell-action) { opacity: 0.5; }

.cell-action { width: 1%; padding-top: 4px; padding-bottom: 4px; text-align: right; white-space: nowrap; }

.cell-action form { display: inline; }

.empty { padding: 28px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius-l); color: var(--text-2); text-align: center; }

.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.accent { background: var(--accent-soft); color: var(--accent); }

.bar-cell { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }

.bar-cell .meter { flex: none; width: 72px; }

.meter { display: block; }
.meter .track { fill: var(--surface-3); }
.meter .fill { fill: var(--accent); }
.meter.low .fill { fill: var(--bad); }
.meter.mid .fill { fill: var(--warn); }

.tabs { display: flex; flex-wrap: wrap; gap: 2px; width: fit-content; max-width: 100%; padding: 3px; border-radius: 10px; background: var(--surface-3); }

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 7px;
  color: var(--text-2);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 150ms ease, color 150ms ease;
}

.tab .faint { font-variant-numeric: tabular-nums; }

.tab[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow), 0 0 0 1px var(--line); }

@media (hover: hover) and (pointer: fine) {
  .tab:not([aria-current="page"]):hover { color: var(--text); }
}

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 14px; }

.toolbar form { display: flex; flex-wrap: wrap; gap: 8px; }

.search { width: 300px; max-width: 100%; }

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--control);
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 160ms var(--ease-out), background-color 150ms ease, border-color 150ms ease, color 150ms ease, opacity 150ms ease;
}

.btn:active { transform: scale(0.97); }

.btn-primary { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }

.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }

.btn-danger:not(.btn-ghost) { color: var(--bad); }

.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }

@media (pointer: coarse) {
  .btn-sm { height: 36px; }
}

.btn.is-confirming { border-color: var(--bad); background: var(--bad); color: var(--on-accent); }

.btn[aria-busy="true"] { opacity: 0.6; pointer-events: none; transition-delay: 0s, 0s, 0s, 0s, 180ms; }

@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--surface-2); }
  .btn-primary:hover { border-color: var(--accent-hover); background: var(--accent-hover); }
  .btn-ghost:hover { color: var(--text); }
  .btn-danger:hover { color: var(--bad); }
  .btn-danger:not(.btn-ghost):hover { border-color: var(--bad); }
  .btn.is-confirming:hover { background: var(--bad); }
}

.btn.is-confirming, .btn.is-confirming:hover { color: var(--on-accent); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: var(--control);
  height: var(--control);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 160ms var(--ease-out), background-color 150ms ease, color 150ms ease;
}

.icon-btn:active { transform: scale(0.94); }

.icon-btn svg { width: 18px; height: 18px; }

@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover { background: var(--surface-2); color: var(--text); }
}

.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }

.fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }

.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; }

.field > span { color: var(--text-2); font-size: 13px; font-weight: 500; }

.field.grow { flex: 1 1 260px; }

.field.wide { flex: 1 1 100%; }

:where(input:not([type="checkbox"], [type="radio"], [type="file"]), select, textarea) {
  width: 100%;
  min-width: 0;
  height: var(--control);
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input::placeholder, textarea::placeholder { color: var(--text-3); }

input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }

input:user-invalid, textarea:user-invalid { border-color: var(--bad); }

select { padding-right: 30px; appearance: none; background: var(--surface) var(--chevron) no-repeat right 10px center; cursor: pointer; }

textarea { height: auto; padding: 9px 10px; line-height: 1.5; resize: vertical; }

textarea.code { min-height: 340px; font-family: var(--mono); font-size: 13px; tab-size: 2; }

textarea.message { min-height: 168px; }

input[type="file"] { width: 100%; color: var(--text-2); font: inherit; }

input[type="file"]::file-selector-button {
  height: var(--control);
  margin-right: 12px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.w-xs { width: 96px; }
.w-s { width: 132px; }
.w-m { width: 200px; }
.w-l { width: 300px; }

.affix { position: relative; display: block; }

.affix input:not([type="checkbox"], [type="radio"], [type="file"]) { padding-right: 34px; }

.affix i { position: absolute; top: 50%; right: 11px; translate: 0 -50%; color: var(--text-3); font-style: normal; pointer-events: none; }

.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

.form-foot .spacer { flex: 1; }

.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.inline-form input[type="file"] { flex: 1 1 240px; width: auto; }

.code-input { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.04em; }

.manage { padding: 4px 20px; }

.manage-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); align-items: center; gap: 8px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }

.manage-row:last-child { border-bottom: 0; }

.manage-row > span { color: var(--text-2); font-weight: 500; }

.manage-row .inline-form select { flex: 1 1 260px; width: auto; max-width: 560px; }

.disclosure > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.disclosure > summary::-webkit-details-marker { display: none; }

.disclosure > summary::after { content: ""; width: 12px; height: 12px; background: var(--chevron) no-repeat center; transition: transform 200ms var(--ease-out); }

.disclosure[open] > summary::after { transform: rotate(180deg); }

@media (hover: hover) and (pointer: fine) {
  .disclosure > summary:hover { color: var(--text); }
}

.disclosure pre { margin: 10px 0 0; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); color: var(--text-2); font: 13px/1.55 var(--mono); white-space: pre-wrap; }


.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 24px; }

.facts dt { color: var(--text-2); }

.chart { display: grid; gap: 14px; padding: 16px 20px 12px; }

.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

.chart-head h2 { color: var(--text-2); font-size: 13px; font-weight: 500; }

.chart-head strong { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }

.chart-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; }

.chart-axis { display: flex; flex-direction: column; justify-content: space-between; height: 128px; color: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; text-align: right; }

.chart-axis span { display: flex; align-items: center; justify-content: flex-end; height: 0; white-space: nowrap; }

.chart-plot { display: block; overflow: visible; }

.chart-plot .grid { stroke: var(--line); stroke-width: 1; }

.chart-plot .bar { fill: var(--accent); transition: fill 150ms ease; }

.chart-plot .hit { fill: transparent; }

.chart-plot text { fill: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }

@media (hover: hover) and (pointer: fine) {
  .chart-plot .day:hover .bar { fill: var(--accent-hover); }
}

.stack { display: block; border-radius: 4px; overflow: hidden; }

.stack .s1 { fill: var(--accent); }
.stack .s2 { fill: color-mix(in oklch, var(--accent) 58%, var(--surface)); }
.stack .s3 { fill: color-mix(in oklch, var(--accent) 26%, var(--surface)); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 12px 0 0; padding: 0; color: var(--text-2); list-style: none; }

.legend li::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 2px; }

.legend .s1::before { background: var(--accent); }
.legend .s2::before { background: color-mix(in oklch, var(--accent) 58%, var(--surface)); }
.legend .s3::before { background: color-mix(in oklch, var(--accent) 26%, var(--surface)); }

.legend b { margin-left: 4px; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.answer-card { display: grid; gap: 14px; }

.answer-card + .answer-card { margin-top: 12px; }

.answer-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; color: var(--text-2); font-size: 13px; }

.answer-head a { color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; }

@media (hover: hover) and (pointer: fine) {
  .answer-head a:hover { text-decoration: underline; }
}


.question { font-size: 15px; font-weight: 600; line-height: 1.4; }

.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.compare > div { padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); }

.compare .label { display: block; margin-bottom: 4px; color: var(--text-2); font-size: 12px; font-weight: 500; }

.compare p { white-space: pre-wrap; overflow-wrap: anywhere; }

.compare .reference { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--text-2); }

.grade-row { display: flex; flex-wrap: wrap; gap: 8px; }

.grade-row input { flex: 1 1 240px; width: auto; }

.grade { display: flex; gap: 6px; }

.grade .btn { min-width: 96px; }

.grade .ok-btn { border-color: color-mix(in oklch, var(--ok) 55%, var(--line-strong)); color: var(--ok); }

.grade .bad-btn { color: var(--bad); }

@media (hover: hover) and (pointer: fine) {
  .grade .ok-btn:hover { background: var(--ok-soft); }
  .grade .bad-btn:hover { border-color: var(--bad); background: var(--bad-soft); }
}

.rating { font-variant-numeric: tabular-nums; white-space: nowrap; }

.person { display: flex; align-items: center; gap: 12px; min-width: 0; }

.avatar {
  position: relative;
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  overflow: hidden;
  border-radius: 50%;
  color: oklch(0.99 0 0);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  user-select: none;
}

.avatar-lg { width: 64px; height: 64px; font-size: 24px; }

.avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 180ms var(--ease-out); }

.avatar-img.is-loaded { opacity: 1; }

.av-0 { background: linear-gradient(#ff885e, #ff516a); }
.av-1 { background: linear-gradient(#ffcd6a, #ffa85c); }
.av-2 { background: linear-gradient(#82b1ff, #665fff); }
.av-3 { background: linear-gradient(#a0de7e, #54cb68); }
.av-4 { background: linear-gradient(#53edd6, #28c9b7); }
.av-5 { background: linear-gradient(#72d5fd, #2a9ef1); }
.av-6 { background: linear-gradient(#e0a2f3, #d669ed); }

.compose-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; gap: 20px; }

.compose:not(.is-ready) .editor, .compose.is-ready textarea[name="text"] { display: none; }

.editor {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }

.editor:has(.editor-input[aria-invalid="true"]) { border-color: var(--bad); }

.editor-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px; border-bottom: 1px solid var(--line); }

.tool {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 160ms var(--ease-out), background-color 150ms ease, color 150ms ease;
}

.tool svg { width: 18px; height: 18px; }

.tool:active { transform: scale(0.92); }

.tool[aria-pressed="true"], .tool[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent); }

@media (hover: hover) and (pointer: fine) {
  .tool:not([aria-pressed="true"], [aria-expanded="true"]):hover { background: var(--surface-2); color: var(--text); }
}

@media (pointer: coarse) {
  .tool { width: 40px; height: 40px; }
}

.tool-gap { width: 1px; height: 20px; margin: 0 4px; background: var(--line); }

.link-bar { display: flex; gap: 6px; padding: 6px; border-bottom: 1px solid var(--line); }

.link-bar[hidden] { display: none; }

.link-bar input { flex: 1; height: 30px; }

.link-bar input[aria-invalid="true"] { border-color: var(--bad); }

.editor-input {
  min-height: 180px;
  max-height: 460px;
  overflow-y: auto;
  padding: 12px 14px;
  outline: none;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.editor-input a { color: var(--accent); text-decoration: none; }

.editor-input code, .editor-input pre { border-radius: 4px; background: var(--surface-3); font-family: var(--mono); font-size: 13px; }

.editor-input code { padding: 1px 4px; }

.editor-input pre { display: block; margin: 4px 0; padding: 8px 10px; white-space: normal; }

.editor-input blockquote { margin: 4px 0; padding: 4px 10px; border-left: 3px solid var(--accent); border-radius: 4px; background: var(--accent-soft); }

.editor-input .tg-spoiler {
  border-radius: 3px;
  background-color: color-mix(in oklch, var(--text) 10%, transparent);
  background-image: radial-gradient(color-mix(in oklch, var(--text) 40%, transparent) 0.6px, transparent 0.8px);
  background-size: 3px 3px;
}

.counter { margin-left: auto; color: var(--text-3); font-size: 13px; font-variant-numeric: tabular-nums; }

.counter.is-over { color: var(--bad); font-weight: 500; }

.emoji-panel {
  position: absolute;
  top: 44px;
  left: 4px;
  z-index: 30;
  display: none;
  width: 316px;
  max-width: calc(100% - 8px);
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow-l);
  transform-origin: top left;
}

.emoji-panel.is-open { display: grid; gap: 6px; opacity: 1; transform: none; transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out); }

@starting-style {
  .emoji-panel.is-open { opacity: 0; transform: translateY(-4px) scale(0.98); }
}

.emoji-tabs { display: flex; gap: 2px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }

.emoji-tab, .emoji {
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.emoji-tab { width: 34px; height: 30px; font-size: 17px; opacity: 0.55; filter: grayscale(1); transition: opacity 150ms ease, filter 150ms ease, background-color 150ms ease; }

.emoji-tab[aria-selected="true"] { background: var(--surface-2); opacity: 1; filter: none; }

.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 216px; overflow-y: auto; overscroll-behavior: contain; }

.emoji { height: 36px; font-size: 22px; transition: transform 120ms var(--ease-out), background-color 120ms ease; }

.emoji:active { transform: scale(0.88); }

@media (hover: hover) and (pointer: fine) {
  .emoji:hover { background: var(--surface-2); }
  .emoji-tab:hover { opacity: 1; filter: none; }
}

.tg {
  --tg-head: #ffffff;
  --tg-title: #000000;
  --tg-muted: #8b98a5;
  --tg-wall: linear-gradient(150deg, #dde3c2 0%, #b5d0a3 48%, #d2dcaf 100%);
  --tg-bubble: #ffffff;
  --tg-text: #000000;
  --tg-link: #168acd;
  --tg-time: #a0acb6;
  --tg-quote: #168acd;
  --tg-quote-bg: rgb(22 138 205 / 0.1);
  --tg-code: rgb(0 0 0 / 0.06);
  --tg-tail: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 14'%3E%3Cpath d='M9 0v14H1.2c-.9 0-1.4-1-.8-1.7C3.6 8.6 6.5 5.4 9 0z'/%3E%3C/svg%3E");
  position: sticky;
  top: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--tg-head);
  box-shadow: var(--shadow);
}

@media (prefers-color-scheme: dark) {
  .tg {
    --tg-head: #17212b;
    --tg-title: #f5f5f5;
    --tg-muted: #708499;
    --tg-wall: #0e1621;
    --tg-bubble: #182533;
    --tg-text: #f5f5f5;
    --tg-link: #6ab3f3;
    --tg-time: #6d7f8f;
    --tg-quote: #6ab3f3;
    --tg-quote-bg: rgb(106 179 243 / 0.12);
    --tg-code: rgb(255 255 255 / 0.08);
  }
}

.tg-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: var(--tg-title); }

.tg-head .avatar { width: 38px; height: 38px; font-size: 15px; }

.tg-title { display: grid; line-height: 1.25; }

.tg-title b { font-size: 14px; font-weight: 600; }

.tg-title span { color: var(--tg-muted); font-size: 13px; }

.tg-chat { display: flex; flex-direction: column; justify-content: flex-end; min-height: 320px; max-height: 600px; overflow-y: auto; padding: 18px 14px 16px 18px; background: var(--tg-wall); }

.tg-bubble {
  position: relative;
  align-self: flex-start;
  max-width: 92%;
  padding: 6px 10px 7px 11px;
  border-radius: 14px 14px 14px 4px;
  background: var(--tg-bubble);
  color: var(--tg-text);
  box-shadow: 0 1px 1px rgb(0 0 0 / 0.12);
  font-size: 15px;
  line-height: 1.38;
}

.tg-bubble::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: -8px;
  width: 9px;
  height: 14px;
  background: var(--tg-bubble);
  -webkit-mask: var(--tg-tail) no-repeat center / contain;
  mask: var(--tg-tail) no-repeat center / contain;
}

.tg-text { white-space: pre-wrap; overflow-wrap: anywhere; }

.tg-text a { color: var(--tg-link); text-decoration: none; }

.tg-text code, .tg-text pre { border-radius: 4px; background: var(--tg-code); font-family: var(--mono); font-size: 13.5px; }

.tg-text code { padding: 0 3px; }

.tg-text pre { display: block; margin: 4px 0; padding: 6px 8px; line-height: 1.4; white-space: pre-wrap; }

.tg-text blockquote { margin: 3px 0; padding: 3px 8px 3px 10px; border-left: 3px solid var(--tg-quote); border-radius: 4px; background: var(--tg-quote-bg); }

.tg-text tg-spoiler {
  border-radius: 4px;
  background-image: radial-gradient(circle, var(--tg-text) 0.7px, transparent 0.9px);
  background-size: 4px 4px;
  color: transparent;
  cursor: pointer;
  transition: color 200ms ease;
}

.tg-text tg-spoiler.is-revealed { background-image: none; background-color: var(--tg-code); color: inherit; }

.tg-time { float: right; margin: 9px -3px -4px 12px; color: var(--tg-time); font-size: 12px; line-height: 1; font-variant-numeric: tabular-nums; user-select: none; }

.tg-bubble.is-empty .tg-text {
  width: 200px;
  height: 34px;
  background:
    linear-gradient(var(--tg-code), var(--tg-code)) 0 5px / 100% 9px no-repeat,
    linear-gradient(var(--tg-code), var(--tg-code)) 0 22px / 62% 9px no-repeat;
}

.tg-bubble.is-empty .tg-time { display: none; }

.tg-bubble.is-jumbo { padding: 0; background: transparent; box-shadow: none; font-size: 52px; line-height: 1.1; }

.tg-bubble.is-jumbo::before { display: none; }

.tg-bubble.is-jumbo .tg-time { float: none; display: table; margin: 4px 0 0; padding: 3px 6px; border-radius: 10px; background: rgb(0 0 0 / 0.25); color: oklch(0.99 0 0); font-size: 11px; }

.sheet {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(520px, 100vw);
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-l);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(0);
  transition: transform 340ms var(--ease-drawer), display 340ms allow-discrete, overlay 340ms allow-discrete;
}

.sheet:not(:popover-open) { transform: translateX(100%); transition-duration: 220ms; transition-timing-function: var(--ease-out); }

@starting-style {
  .sheet:popover-open { transform: translateX(100%); }
}

.sheet::backdrop { background: var(--scrim); opacity: 1; transition: opacity 340ms ease, display 340ms allow-discrete, overlay 340ms allow-discrete; }

.sheet:not(:popover-open)::backdrop { opacity: 0; transition-duration: 220ms; }

@starting-style {
  .sheet:popover-open::backdrop { opacity: 0; }
}

.sheet-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 12px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.sheet-head h2 { font-size: 16px; font-weight: 600; }

.sheet-body { display: grid; gap: 18px; padding: 20px 24px 28px; }

.sheet-body + .sheet-body { border-top: 1px solid var(--line); }

.sheet-body h3 { font-size: 14px; font-weight: 600; }

.toasts {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  display: grid;
  justify-items: end;
  gap: 8px;
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 6px 6px 16px;
  border-radius: 10px;
  background: var(--toast);
  color: var(--on-toast);
  box-shadow: var(--shadow-l);
  font-weight: 500;
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 400ms ease, transform 400ms var(--ease-out);
}

@starting-style {
  .toast { opacity: 0; transform: translateY(10px); }
}

.toast.is-leaving { opacity: 0; transform: translateY(6px); transition-duration: 200ms; }

.toast .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }

.toast.bad .dot { background: var(--bad); }

.toast p { flex: 1; padding: 6px 0; }

.toast .icon-btn { width: 32px; height: 32px; color: inherit; opacity: 0.72; }

.auth { display: grid; place-items: center; min-height: 100dvh; padding: 24px 16px; }

.auth-card { display: grid; gap: 20px; width: min(380px, 100%); padding: 28px; }

.auth-card .brand { padding: 0; font-size: 16px; }

.auth-card .error { color: var(--bad); font-size: 13px; }

.certificate { display: grid; gap: 22px; width: min(560px, 100%); padding: 32px; }

.verified { display: inline-flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 600; }

.verified svg { width: 18px; height: 18px; }

.certificate h1 { font-size: 26px; line-height: 1.2; font-weight: 650; letter-spacing: -0.01em; }

.certificate .facts { gap: 10px 28px; }

@media (max-width: 1100px) {
  .main { padding: 24px 28px 64px; }
}

@media (max-width: 1100px) {
  .compose-layout { grid-template-columns: minmax(0, 1fr); }

  .tg { position: static; }
}

@media (max-width: 1023px) {
  .app { display: block; background: var(--bg); }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 56px;
    padding: 0 8px 0 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
  }

  .topbar .brand { padding: 0; }

  .topbar-right { display: flex; align-items: center; gap: 4px; }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(300px, 86vw);
    height: 100dvh;
    padding-top: 16px;
    box-shadow: var(--shadow-l);
    transform: translateX(0);
    transition: transform 340ms var(--ease-drawer), display 340ms allow-discrete, overlay 340ms allow-discrete;
  }

  .sidebar:not(:popover-open) { display: none; transform: translateX(-100%); transition-duration: 220ms; transition-timing-function: var(--ease-out); }

  @starting-style {
    .sidebar:popover-open { transform: translateX(-100%); }
  }

  .sidebar::backdrop { background: var(--scrim); opacity: 1; transition: opacity 340ms ease, display 340ms allow-discrete, overlay 340ms allow-discrete; }

  .sidebar:not(:popover-open)::backdrop { opacity: 0; transition-duration: 220ms; }

  @starting-style {
    .sidebar:popover-open::backdrop { opacity: 0; }
  }

  .sidebar .brand { display: none; }

  .nav-link { min-height: 44px; font-size: 15px; }

  .main { padding: 20px 16px 72px; }
}

@media (max-width: 760px) {
  body { font-size: 15px; }

  :where(input:not([type="checkbox"], [type="radio"], [type="file"]), select, textarea) { font-size: 16px; }

  .head h1 { font-size: 20px; }

  .grid-2, .compare { grid-template-columns: minmax(0, 1fr); }

  .tg-chat { min-height: 240px; }

  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .stat { padding: 12px 14px; box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line); }

  .stat dd { font-size: 20px; }

  .hide-sm { display: none; }

  .show-sm { display: block; }

  .show-sm-inline { display: inline; }

  th, td { padding-right: 12px; padding-left: 12px; }

  .title-cell { min-width: 0; }

  .manage { padding: 4px 16px; }

  .manage-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }

  .manage-row .w-s { width: 108px; }

  .editor-toolbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }

  .editor-toolbar::-webkit-scrollbar { display: none; }

  .tool { flex: none; }

  .bar-cell .meter { display: none; }

  .amount-pending { color: var(--warn); }

  .amount-canceled { color: var(--text-3); text-decoration: line-through; }

  .panel { padding: 16px; }

  .chart { padding: 14px 14px 10px; }

  .toolbar form { flex: 1 1 100%; }

  .search { flex: 1; width: auto; }

  .w-l, .w-m { width: 100%; }

  .field.grow, .field.wide { flex-basis: 100%; }

  .grade { width: 100%; }

  .grade .btn { flex: 1; min-width: 0; }

  .sheet {
    inset: auto 0 0 0;
    width: 100%;
    height: auto;
    max-height: 92dvh;
    border-top: 1px solid var(--line);
    border-left: 0;
    border-radius: 16px 16px 0 0;
  }

  .sheet:not(:popover-open) { transform: translateY(100%); }

  @starting-style {
    .sheet:popover-open { transform: translateY(100%); }
  }

  .sheet-head { padding: 10px 8px 10px 16px; }

  .sheet-body { padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); }

  .toasts { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); justify-items: stretch; }

  .certificate { padding: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet, .toast { transition-property: opacity, display, overlay; }

  .sheet:not(:popover-open) { transform: none; opacity: 0; }

  @starting-style {
    .sheet:popover-open { transform: none; opacity: 0; }
    .toast { transform: none; }
  }

  .toast.is-leaving { transform: none; }

  .btn:active, .icon-btn:active { transform: none; }
}

@media (prefers-reduced-motion: reduce) and (max-width: 1023px) {
  .sidebar { transition-property: opacity, display, overlay; }

  .sidebar:not(:popover-open) { transform: none; opacity: 0; }

  @starting-style {
    .sidebar:popover-open { transform: none; opacity: 0; }
  }
}
