/* Beavr design system. All colours are tokens; contrast pairs meet WCAG AA. */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/static/fonts/bricolage-grotesque-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/static/fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url("/static/fonts/dm-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url("/static/fonts/dm-sans-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/dm-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/dm-mono-latin-500-normal.woff2") format("woff2");
}

:root {
  /* surfaces */
  --bg: #f3f3f1;
  --surface: #ffffff;
  --surface-2: #f7f7f5;
  --surface-3: #ecece9;
  --border: #dfdfdb;
  --border-strong: #c9c9c4;
  /* ink */
  --ink: #1b1b19;
  --ink-2: #4a4a46;
  --muted: #696964;
  /* primary action: near black */
  --primary: #1b1b19;
  --primary-hover: #33332f;
  --on-primary: #ffffff;
  /* accent: warm orange. Used as a fill with dark ink on top (7.4:1), never as text on white. */
  --accent: #ff6a1f;
  --accent-hover: #f25a0c;
  --on-accent: #1b1b19;
  --accent-soft: #fff0e6;
  --accent-text: #ad4200; /* orange for text/links on white: 5.6:1 */
  /* status */
  --ok: #0f7a47;
  --ok-soft: #e4f4ea;
  --warn: #8a5a00;
  --warn-soft: #fdf1d3;
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --info: #1f5fbf;
  --info-soft: #e6eefb;
  /* chart series (validated against --surface, see docs/DECISIONS.md) */
  --chart-1: #d9480f;
  --chart-2: #1b1b19;
  --chart-grid: #e6e6e2;

  --radius: 2px;
  --font-display: "Bricolage Grotesque", "DM Sans", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --page-width: 1180px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0;
}
h1 {
  font-size: 30px;
}
h2 {
  font-size: 20px;
}
h3 {
  font-size: 16px;
}
p {
  margin: 0 0 12px;
}
a {
  color: inherit;
}
a.link,
.prose a {
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}
code,
pre,
kbd {
  font-family: var(--font-mono);
  font-size: 13px;
}
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.muted {
  color: var(--muted);
}
.mono {
  font-family: var(--font-mono);
}
.nowrap {
  white-space: nowrap;
}
.right {
  text-align: right;
}
.label,
.table th,
.card-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ---------- top hint bar ---------- */
.hintbar {
  background: var(--accent);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 8px 16px;
  font-weight: 600;
  text-align: center;
  flex-wrap: wrap;
}
.hintbar.danger {
  background: var(--danger);
  color: #fff;
}
.hintbar.dev {
  background: var(--ink);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  padding: 5px 16px;
}
.hintbar.dev a {
  color: #fff;
}
.hintbar .btn {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--surface);
  height: 32px;
}

/* ---------- header ---------- */
.header {
  background: var(--surface);
  padding: 0 20px;
}
.header-row {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 58px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
}
.brand svg {
  display: block;
}
.header-spacer {
  flex: 1;
}
.switcher,
.menu {
  position: relative;
}
.switcher > summary,
.menu > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 500;
  user-select: none;
}
.switcher > summary::-webkit-details-marker,
.menu > summary::-webkit-details-marker {
  display: none;
}
.switcher > summary:hover,
.menu > summary:hover,
.switcher[open] > summary,
.menu[open] > summary {
  border-color: var(--border);
  background: var(--surface-2);
}
.pop {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 30;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 4px;
}
.menu .pop {
  left: auto;
  right: 0;
}
.pop a,
.pop button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  text-decoration: none;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius);
}
.pop a:hover,
.pop button:hover {
  background: var(--surface-2);
}
.pop a[aria-current="true"] {
  font-weight: 600;
}
.pop hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}
.pop .pop-label {
  padding: 6px 10px 2px;
}
.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 7px;
  background: var(--surface-3);
  border-radius: var(--radius);
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--ink-2);
  white-space: nowrap;
}
.balance {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.balance:hover {
  border-color: var(--border-strong);
}
.balance .label {
  font-weight: 500;
}
.balance.low {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.balance.empty {
  border-color: var(--danger);
  background: var(--danger-soft);
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  min-width: 36px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-family: var(--font-mono);
  font-size: 12px;
  text-decoration: none;
}
.icon-btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

/* ---------- tabs ---------- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 0 20px;
  overflow-x: auto;
}
.tabs a {
  padding: 10px 12px 11px;
  text-decoration: none;
  color: var(--ink-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tabs a:hover {
  color: var(--ink);
}
.tabs a[aria-current="page"] {
  color: var(--ink);
  font-weight: 500;
  border-bottom-color: var(--ink);
}
.tabs .tabs-sep {
  flex: 1;
}
.subtabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin: 0 0 24px;
  overflow-x: auto;
}
.subtabs a {
  padding: 8px 12px 9px;
  text-decoration: none;
  color: var(--ink-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  font-size: 14px;
}
.subtabs a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

/* ---------- page ---------- */
.page {
  width: 100%;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 36px 20px 64px;
  flex: 1;
}
.page.narrow {
  max-width: 760px;
}
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.page-head p {
  margin: 6px 0 0;
  color: var(--ink-2);
}
.page-head .actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.crumbs {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.crumbs a {
  text-decoration: none;
}
.crumbs a:hover {
  text-decoration: underline;
}
.title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.grid {
  display: grid;
  gap: 24px;
}
.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid.side {
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.stack.tight {
  gap: 12px;
}
.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.row.between {
  justify-content: space-between;
}
.spacer {
  flex: 1;
}

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  min-height: 60px;
}
.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.card-body {
  padding: 20px;
}
.card-body.flush {
  padding: 0;
}
.card-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.card.danger-zone {
  border-color: #e6b8b4;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.stat {
  padding: 22px 24px;
}
.stat + .stat {
  border-left: 1px solid var(--border);
}
.stat-label {
  color: var(--ink-2);
  margin-bottom: 6px;
}
.stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-value small {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 15px;
  color: var(--ink-2);
  margin-left: 4px;
}

/* ---------- tables ---------- */
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  text-align: left;
  padding: 12px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tr:last-child td {
  border-bottom: 0;
}
.table th.right,
.table td.right {
  text-align: right;
}
.table td.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.table tbody tr.clickable:hover td {
  background: var(--surface-2);
}
.table a.row-link {
  text-decoration: none;
  font-weight: 500;
}
.table a.row-link:hover {
  text-decoration: underline;
}
.table-wrap {
  overflow-x: auto;
}
.table.dns {
  table-layout: fixed;
  min-width: 620px;
}
.table.dns .dns-type {
  width: 84px;
}
.table.dns .dns-name {
  width: 36%;
}
.table.dns .dns-state {
  width: 140px;
}
.dns-cell {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.dns-cell code {
  overflow-wrap: anywhere;
  min-width: 0;
  padding-top: 5px;
}
.cell-main {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cell-sub {
  color: var(--muted);
  font-size: 13px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover {
  background: var(--surface-2);
}
.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}
.btn.primary:hover {
  background: var(--primary-hover);
}
.btn.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}
.btn.accent:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn.danger {
  color: var(--danger);
  border-color: #e0aaa6;
}
.btn.danger:hover {
  background: var(--danger-soft);
}
.btn.danger.solid {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn.small {
  height: 32px;
  padding: 0 10px;
  font-size: 14px;
}
.btn.block {
  width: 100%;
}
.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn.ghost {
  border-color: transparent;
  background: none;
}
.btn.ghost:hover {
  background: var(--surface-3);
}
form.inline {
  display: inline;
}

/* ---------- forms ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}
.field:last-child {
  margin-bottom: 0;
}
.field > label,
.field > .label {
  display: block;
}
.field > label.checkbox {
  display: flex;
}
.input,
.select,
.textarea {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.textarea {
  height: auto;
  min-height: 120px;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}
.input.mono {
  font-family: var(--font-mono);
  font-size: 13px;
}
.input::placeholder,
.textarea::placeholder {
  color: #8a8a85;
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: 2px solid var(--ink);
  outline-offset: -1px;
}
.input[aria-invalid="true"],
.select[aria-invalid="true"] {
  border-color: var(--danger);
}
.hint {
  color: var(--muted);
  font-size: 13px;
}
.error-text {
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
}
.input-group {
  display: flex;
}
.input-group .input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.input-group .addon {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-left: 0;
  background: var(--surface-2);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 13px;
  white-space: nowrap;
}
.input-group .addon.pre {
  border-left: 1px solid var(--border-strong);
  border-right: 0;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}
.form-grid .span-2 {
  grid-column: span 2;
}
.checkbox {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
}
.checkbox input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--ink);
  flex: none;
}
.checkbox small {
  display: block;
  color: var(--muted);
}

/* option cards (radio groups) */
.options {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.options.sizes {
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
}
.options.wide {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.option {
  position: relative;
  display: block;
  cursor: pointer;
}
.option input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}
.option-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
}
.option:hover .option-box {
  background: var(--surface-2);
}
.option input:checked + .option-box {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
  background: var(--surface);
}
.option input:focus-visible + .option-box {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.option-title {
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.option-desc {
  color: var(--muted);
  font-size: 13px;
}
.option-price {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 4px;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-3);
  border-radius: var(--radius);
  gap: 2px;
}
.segmented a,
.segmented button {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
  cursor: pointer;
  border-radius: var(--radius);
}
.segmented [aria-current="true"],
.segmented [aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
}

/* ---------- status ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--surface-3);
  color: var(--ink-2);
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.badge.ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.badge.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.badge.danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.badge.info {
  background: var(--info-soft);
  color: var(--info);
}
.badge.busy::before {
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}
@media (prefers-reduced-motion: reduce) {
  .badge.busy::before {
    animation: none;
  }
}

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 20px;
}
.notice.ok {
  border-left-color: var(--ok);
}
.notice.warn {
  background: var(--accent-soft);
  border-color: #f6cfb4;
  border-left-color: var(--accent);
}
.notice.danger {
  background: var(--danger-soft);
  border-color: #e6b8b4;
  border-left-color: var(--danger);
}
.notice.info {
  border-left-color: var(--info);
}
.notice > div {
  flex: 1;
}
.notice strong {
  display: block;
}
.notice p:last-child {
  margin-bottom: 0;
}

/* ---------- empty states ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 56px 24px;
  gap: 8px;
}
.empty-art {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-text);
  border-radius: var(--radius);
  margin-bottom: 8px;
}
.empty h2 {
  font-size: 20px;
}
.empty p {
  color: var(--ink-2);
  max-width: 460px;
}
.empty .actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---------- code, credentials ---------- */
.code {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.code pre {
  margin: 0;
  padding: 14px 112px 14px 16px;
  overflow-x: auto;
  line-height: 1.6;
  white-space: pre;
}
.code .copy {
  position: absolute;
  top: 8px;
  right: 8px;
}
.copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  flex: none;
}
.copy:hover {
  background: var(--surface-2);
}
.copy.done {
  background: var(--ok-soft);
  border-color: var(--ok);
  color: var(--ok);
}
.kv {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
}
.kv > div {
  padding: 11px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.kv > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}
.kv .k {
  background: var(--surface-2);
}
.kv .v code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.secret[data-hidden="true"] code {
  letter-spacing: 0.1em;
}

.log {
  background: #161615;
  color: #e9e9e4;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  padding: 14px 16px;
  height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: var(--radius);
}
.log.short {
  height: 300px;
}
.log .ts {
  color: #9a9a94;
}
.log .err {
  color: #ff9d8a;
}
.log .sys {
  color: #ffb07a;
}
.log:empty::before {
  content: attr(data-empty);
  color: #9a9a94;
}

/* ---------- dialogs ---------- */
dialog {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0;
  width: min(560px, calc(100vw - 32px));
  color: var(--ink);
  background: var(--surface);
}
dialog::backdrop {
  background: rgba(243, 243, 241, 0.8);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.dialog-body {
  padding: 20px;
}
.dialog-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

/* ---------- cost estimate ---------- */
.estimate {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.estimate-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.estimate-body {
  padding: 16px 18px;
}
.estimate-total {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.estimate-total small {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--ink-2);
}
.estimate ul {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  font-size: 14px;
}
.estimate li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  border-top: 1px dashed var(--border);
}
.estimate li span:last-child {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.estimate .hint {
  margin-top: 12px;
}

/* ---------- lists ---------- */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.list > li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.list > li:last-child {
  border-bottom: 0;
}
.list .grow {
  flex: 1;
  min-width: 0;
}
.steps {
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
}
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 20px 40px;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  border-radius: var(--radius);
}
.steps > li.done::before {
  background: var(--ok);
  content: "✓";
}
.steps > li:last-child {
  padding-bottom: 0;
}

/* ---------- charts ---------- */
.chart {
  display: block;
  width: 100%;
  height: auto;
}
.chart text {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--muted);
}
.chart .grid-line {
  stroke: var(--chart-grid);
  stroke-width: 1;
}
.chart .series-1 {
  stroke: var(--chart-1);
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.chart .series-2 {
  stroke: var(--chart-2);
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.chart .area-1 {
  fill: var(--chart-1);
  opacity: 0.1;
}
.chart .bar-1 {
  fill: var(--chart-1);
}
.chart .hover-line {
  stroke: var(--ink);
  stroke-width: 1;
}
.chart-wrap {
  position: relative;
}
.chart-tip {
  position: absolute;
  top: 0;
  pointer-events: none;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: var(--radius);
  white-space: nowrap;
  transform: translate(-50%, -6px);
}
.legend {
  display: flex;
  gap: 14px;
  font-size: 13px;
  color: var(--ink-2);
}
.legend i {
  display: inline-block;
  width: 12px;
  height: 3px;
  margin-right: 6px;
  vertical-align: middle;
}
.metric-now {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}
.meter {
  height: 8px;
  background: var(--surface-3);
  border-radius: var(--radius);
  overflow: hidden;
}
.meter > i {
  display: block;
  height: 100%;
  background: var(--ink);
}

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 18px 0;
  color: var(--muted);
  font-size: 13px;
}
.footer-row {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.footer a {
  text-decoration: none;
}
.footer a:hover {
  text-decoration: underline;
}

/* ---------- auth (split layout) ---------- */
.auth {
  display: grid;
  grid-template-columns: minmax(360px, 2fr) 3fr;
  min-height: 100vh;
  flex: 1;
}
.auth-form {
  background: var(--surface);
  display: flex;
  flex-direction: column;
  padding: 32px 40px;
}
.auth-inner {
  width: 100%;
  max-width: 380px;
  margin: auto;
}
.auth-inner h1 {
  font-size: 34px;
  margin: 20px 0 8px;
}
.auth-inner .lead {
  color: var(--ink-2);
  margin-bottom: 28px;
}
.auth-legal {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.auth-legal a {
  text-decoration: underline;
}
.auth-art {
  background: var(--accent);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.auth-art svg.art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.auth-art-caption {
  position: relative;
  margin: 40px;
  padding: 16px 20px;
  max-width: 420px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
}
.auth-art-caption small {
  display: block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #d6d6d0;
}

/* ---------- prose (legal pages) ---------- */
.prose {
  max-width: 720px;
}
.prose h2 {
  margin: 28px 0 10px;
}
.prose ul {
  padding-left: 20px;
}
.placeholder {
  background: var(--warn-soft);
  color: var(--warn);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 1px 5px;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .grid.cols-2,
  .grid.cols-3,
  .grid.side {
    grid-template-columns: minmax(0, 1fr);
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat:nth-child(3) {
    border-left: 0;
  }
  .stat:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }
  .auth {
    grid-template-columns: 1fr;
  }
  .auth-art {
    display: none;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .span-2 {
    grid-column: auto;
  }
}
@media (max-width: 560px) {
  .page {
    padding: 24px 16px 48px;
  }
  .header,
  .tabs {
    padding: 0 16px;
  }
  .balance .label {
    display: none;
  }
  .kv {
    grid-template-columns: 1fr;
  }
  .kv .k {
    border-bottom: 0;
    padding-bottom: 2px;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .stat + .stat {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
  h1 {
    font-size: 26px;
  }
}
