/* kv admin console. Same palette, radii and type scale as the previous UI. */
:root {
  --text: #202c3b;
  --text-2: #45546a;
  --text-3: #66768b;
  --muted: #7c8898;
  --faint: #98a3b2;
  --bg: #f5f7f9;
  --surface: #fff;
  --surface-2: #f8fafc;
  --pool-bg: #edf1f6;
  --border: #e4e9ef;
  --border-2: #dce3eb;
  --accent: #345ee7;
  --accent-hover: #274ed3;
  --accent-light: #edf1ff;
  --ok: #2f8a68;
  --ok-bg: #eaf5f0;
  --ok-border: #d3eadf;
  --warn: #946f24;
  --warn-bg: #fbf5e9;
  --warn-border: #f0e1c0;
  --danger: #b3484b;
  --danger-bg: #fcf0ef;
  --danger-border: #f0dcd9;
  --info: #3d5fc4;
  --info-bg: #eef2fd;
  --info-border: #dbe3fa;
  --neutral-bg: #f0f2f5;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

/* --- base ------------------------------------------------------------------ */
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
button:disabled, input:disabled, select:disabled { cursor: not-allowed; opacity: .5; }
:focus-visible { outline: 3px solid #a9baf7; outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 30px; font-weight: 600; line-height: 1.35; letter-spacing: -.035em; }
h2 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 13px; font-weight: 600; }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.eyebrow { font-size: 10px; letter-spacing: .18em; color: #8290a2; font-weight: 600; }

/* --- buttons ---------------------------------------------------------------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 8px 15px; border: 1px solid var(--border-2); border-radius: 8px;
  color: var(--text-2); background: var(--surface); font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .15s;
}
.button:hover:not(:disabled) { background: #f7f9fc; border-color: #c9d3df; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 3px 8px #345ee71a; }
.button-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.button-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.button-danger:hover:not(:disabled) { background: #9b3a3d; border-color: #9b3a3d; }
.button-danger-quiet { color: var(--danger); }
.button-danger-quiet:hover:not(:disabled) { background: var(--danger-bg); border-color: var(--danger-border); }
.button-quiet { border-color: transparent; background: transparent; }
.button-small { min-height: 30px; padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.button[aria-busy="true"] { cursor: progress; opacity: .75; }
body.is-busy [data-action], body.is-busy .heading-actions .button { cursor: progress; }
.button-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.icon-button {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 30px; height: 30px; border: 0; border-radius: 6px; background: transparent;
  color: #8994a4; font-size: 22px; line-height: 1;
}
.icon-button:hover { background: #edf1f6; }

/* --- badges and chips --------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 0 7px; border: 1px solid transparent; border-radius: 5px;
  background: var(--neutral-bg); color: #828c9b; font-size: 11px; font-weight: 500; line-height: 1.85; white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip { padding: 0 8px; border: 1px solid #e6e9ee; border-radius: 20px; background: var(--neutral-bg); color: #8a95a5; font-size: 11px; line-height: 1.9; }
.chip b { font-weight: 600; }

/* --- top bar and login ---------------------------------------------------------- */
.topbar {
  height: 76px; padding: 0 5vw; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(255, 255, 255, .8); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 13px; font-weight: 600; line-height: 1.35; letter-spacing: .02em; }
.brand-mark {
  display: grid; place-items: center; width: 40px; height: 40px; padding-right: 3px; border-radius: 12px;
  background: #293b66; color: #fff; font-size: 22px; font-weight: 600; letter-spacing: -2px;
}
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 400; letter-spacing: .07em; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.connection { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.connection::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #aeb7c3; }
.connection.connected::before { background: #45a47f; }
.login-view { max-width: 460px; margin: 80px auto 64px; padding: 0 20px; }
.login-view h1 { margin: 18px 0; font-size: 42px; line-height: 1.25; letter-spacing: -.04em; }
.login-description { color: var(--muted); font-size: 13px; }
.login-card { margin-top: 30px; padding: 26px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 10px 40px #23385b05; }
.login-card .button { width: 100%; margin: 14px 0 16px; justify-content: space-between; }
.login-card .small { line-height: 1.8; }
.login-footnote { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 34px; color: #96a2b1; font-size: 10px; letter-spacing: .04em; }
.tiny-dot { width: 4px; height: 4px; border-radius: 50%; background: #a4b2c7; }

/* --- page layout ------------------------------------------------------------------ */
.admin-view { max-width: 1300px; margin: 0 auto; padding: 36px 5vw 140px; }
.page-heading, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.page-heading h1 { margin: 8px 0; }
.page-heading p { max-width: 640px; font-size: 13px; }
.heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.section-heading { margin-bottom: 18px; }
.section-heading p { max-width: 760px; margin-top: 5px; }
.workspace-section { margin-bottom: 30px; }
.page-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 30px; color: #a6afbd; font-size: 11px; flex-wrap: wrap; }

/* --- overview tiles ------------------------------------------------------------------ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 28px 0 34px; }
.stat { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; }
.stat-label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: #7d8a9c; font-size: 12px; }
.stat-value { margin: 4px 0 2px; font-size: 26px; font-weight: 500; line-height: 1.3; letter-spacing: -.03em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.stat-value.mono { font-size: 19px; letter-spacing: 0; }
.stat-note { color: var(--faint); font-size: 12px; line-height: 1.7; }
.stat-reminders { margin: 8px 0 0; padding: 8px 10px 8px 24px; border-radius: 7px; background: var(--warn-bg); color: var(--warn); font-size: 12px; line-height: 1.7; }

/* --- pools and buckets ------------------------------------------------------------------ */
.pools { display: flex; flex-direction: column; gap: 16px; }
.pool { display: flex; flex-direction: column; gap: 14px; padding: 16px; background: var(--pool-bg); border: 1px solid #e1e7ef; border-radius: 12px; }
.pool-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pool-title-group { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.pool-index { color: #a3adbc; font-size: 12px; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.pool-title { min-width: 0; }
.pool-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pool-name { color: #33445c; font-size: 16px; overflow-wrap: anywhere; }
.pool-meta { margin-top: 2px; color: var(--faint); font-size: 12px; }
.pool-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty-board { padding: 44px 20px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed #d5deea; border-radius: 12px; }
.empty-board strong { display: block; margin-bottom: 6px; color: #52627a; font-size: 14px; font-weight: 500; }
.empty-pool { padding: 22px; text-align: center; color: #8f9bad; font-size: 13px; background: #f4f7fa; border: 1px dashed #ccd7e5; border-radius: 9px; }
.bucket-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); gap: 12px; }
.bucket-card {
  display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px 15px 12px;
  background: var(--surface); border: 1px solid #e1e6ed; border-radius: 10px; box-shadow: 0 2px 3px #27395005;
}
.bucket-card.is-down { border-color: var(--danger-border); box-shadow: inset 3px 0 0 var(--danger); }
.bucket-card.bucket-draining { border-style: dashed; border-color: #e2cf9f; }
.bucket-card.bucket-removed { background: var(--surface-2); }
.bucket-card.bucket-removed .bucket-name { color: var(--muted); }
.bucket-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.bucket-heading { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.bucket-name { overflow: hidden; color: var(--text); font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.bucket-id { color: var(--faint); font-size: 11px; }
.badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.bucket-identity { color: #7f8b9b; font-size: 12px; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 12px; margin: 0; font-size: 12px; }
.fact { display: contents; }
.fact dt { color: var(--faint); white-space: nowrap; }
.fact dd { margin: 0; color: var(--text-2); overflow-wrap: anywhere; }
.fact.is-bad dd { color: var(--danger); }
.note { padding: 7px 10px; border: 1px solid transparent; border-radius: 7px; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.bucket-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; border-top: 1px solid #eff2f6; }

/* --- pool publication (descriptor in the pool's data API key) ------------------------------ */
.pool-publication { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.pub-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: 8px 16px; margin: 0; }
.pub-fact { min-width: 0; }
.pub-fact dt { color: var(--faint); font-size: 11px; }
.pub-fact dd { margin: 1px 0 0; color: var(--text-2); font-size: 13px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.pub-fact.is-warn dd { color: var(--warn); }
.pub-fact .hint { color: var(--faint); font-size: 11px; }

/* --- migration --------------------------------------------------------------------------- */
.migration {
  display: flex; flex-direction: column; gap: 12px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--info-border); border-left: 3px solid var(--accent); border-radius: 10px;
}
.migration.is-forced { border-color: var(--danger-border); border-left-color: var(--danger); }
.migration-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.migration-title { margin-top: 3px; font-size: 15px; }
.phase { color: var(--accent); }
.migration-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stepper { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.stepper li { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 6px 9px; color: var(--faint); background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; font-size: 12px; }
.stepper li.done { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-border); }
.stepper li.current { color: var(--accent); background: var(--accent-light); border-color: #cdd8fb; font-weight: 600; }
.step-index { display: grid; place-items: center; flex: none; width: 20px; height: 20px; border: 1px solid currentColor; border-radius: 50%; background: #fff; font-size: 11px; }
.step-label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.migration-text { color: var(--text-3); font-size: 13px; }
.counters { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 0; }
.counter { min-width: 0; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; }
.counter dt { color: var(--faint); font-size: 11px; }
.counter dd { margin: 2px 0 0; color: var(--text-2); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.unreachable { padding: 10px 12px; color: var(--text-2); background: var(--danger-bg); border: 1px solid var(--danger-border); border-radius: 8px; font-size: 13px; }
.unreachable ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; padding: 0; list-style: none; }
.unreachable li { display: flex; align-items: center; gap: 6px; padding: 3px 8px; background: #fff; border: 1px solid var(--danger-border); border-radius: 6px; }
.generations { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 12px; }
.generations li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; color: var(--text-3); }
.generation-tag { padding: 0 6px; border-radius: 4px; background: var(--neutral-bg); color: #8a95a5; font-size: 11px; }
.generations li.current .generation-tag { background: var(--accent-light); color: var(--accent); }
.generation-members { color: var(--text-2); overflow-wrap: anywhere; }

/* --- add bucket form ------------------------------------------------------------------------ */
.add-bucket > summary { display: inline-flex; width: max-content; list-style: none; }
.add-bucket > summary::-webkit-details-marker { display: none; }
.add-bucket[open] > summary { margin-bottom: 10px; }
.add-bucket[open] > summary { background: var(--accent-light); border-color: #cdd8fb; color: var(--accent); }
.add-bucket-form { padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; margin-top: 12px; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.form-result { margin: 0 0 10px; padding: 8px 10px; border: 1px solid transparent; border-radius: 7px; font-size: 12px; overflow-wrap: anywhere; }

/* --- fields ------------------------------------------------------------------------------- */
.field { min-width: 0; margin-bottom: 14px; }
label { display: block; margin-bottom: 6px; color: var(--text-3); font-size: 12px; font-weight: 500; }
.label-hint { margin-left: 5px; color: #a0aaba; font-size: 11px; font-weight: 400; }
input:not([type=checkbox]), select {
  display: block; width: 100%; min-height: 38px; padding: 8px 11px; border: 1px solid #e0e6ee; border-radius: 7px;
  color: #46546b; background: #fff; font-size: 13px; transition: border-color .15s;
}
input::placeholder { color: #b0b8c4; }
input:focus, select:focus { border-color: #9eb0ed; outline: 2px solid var(--accent-light); outline-offset: 1px; }
.field-help { margin-top: 5px; color: var(--faint); font-size: 11px; line-height: 1.7; }
.field-help .range { color: #7f8ca0; }
.field-error { margin-top: 5px; color: var(--danger); font-size: 12px; line-height: 1.6; }
.field.is-warning .field-error { color: var(--warn); }
.field.is-warning input { border-color: #e4c98a; }
.field.is-invalid input { border-color: var(--danger); }
.field-check { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 9px; margin: 0; color: var(--text-2); font-size: 13px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.error-text { margin-top: 12px; color: var(--danger); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }

/* --- settings and activity panels ------------------------------------------------------------ */
.details-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.panel { min-width: 0; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 20px; }
.subtle-badge { padding: 3px 8px; border-radius: 5px; background: #f4f6f9; color: #8e9aab; font-size: 11px; white-space: nowrap; }
.settings-group { min-width: 0; margin: 0 0 6px; padding: 0; border: 0; }
.settings-group + .settings-group { padding-top: 16px; border-top: 1px solid #eff2f6; }
.settings-group legend { margin-bottom: 10px; padding: 0; color: var(--text-3); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 0 16px; }
.settings-form .form-actions { padding-top: 14px; border-top: 1px solid #eff2f6; }
.activity-blocks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.activity-block { min-width: 0; padding: 12px 14px; background: var(--surface-2); border: 1px solid #edf1f6; border-radius: 9px; }
.activity-block h3 { margin-bottom: 6px; color: var(--text-3); font-size: 12px; }
.activity-status p { color: var(--text-2); font-size: 13px; overflow-wrap: anywhere; }
.activity-status .badge { margin-right: 2px; vertical-align: 1px; }
.activity-block > .small { margin-top: 4px; }
.events-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; padding-top: 16px; border-top: 1px solid #eff2f6; }
.events { display: flex; flex-direction: column; gap: 6px; max-height: 520px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.event { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: baseline; gap: 4px 10px; padding: 8px 10px; background: var(--surface-2); border: 1px solid #edf1f6; border-radius: 8px; font-size: 12px; }
.event time { color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.event p { color: var(--text-2); overflow-wrap: anywhere; }
.events-empty { padding: 12px 0; color: #a4aebb; font-size: 12px; }

/* --- feedback ---------------------------------------------------------------------------------- */
.flash-stack { position: fixed; left: 50%; bottom: 20px; z-index: 50; display: flex; flex-direction: column; gap: 8px; width: min(720px, calc(100% - 32px)); transform: translateX(-50%); pointer-events: none; }
.notice, .error-banner {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 11px 12px 11px 16px;
  border-radius: 10px; font-size: 13px; line-height: 1.7; box-shadow: 0 10px 30px #263e7420; overflow-wrap: anywhere; pointer-events: auto;
}
.notice { color: #3f7c64; background: #f2faf6; border: 1px solid var(--ok-border); }
.error-banner { color: var(--danger); background: #fdf3f2; border: 1px solid var(--danger-border); }
.callout { margin-top: 4px; padding: 11px 13px; border: 1px solid transparent; border-radius: 9px; font-size: 12px; line-height: 1.75; }
.callout strong { display: block; margin-bottom: 3px; }
.callout p + p { margin-top: 6px; }

/* --- dialogs ---------------------------------------------------------------------------------- */
.dialog {
  width: min(480px, calc(100% - 32px)); max-height: calc(100dvh - 40px); overflow: auto; padding: 26px;
  color: #263348; background: #fff; border: 1px solid #e1e7ef; border-radius: 15px; box-shadow: 0 25px 100px #1f315d30;
}
.dialog::backdrop { background: #2134504a; backdrop-filter: blur(3px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.dialog-heading h2 { margin-top: 4px; font-size: 19px; overflow-wrap: anywhere; }
.dialog-body p, .dialog-body .steps { margin: 0 0 10px; color: var(--text-3); font-size: 13px; }
.dialog-body .steps { padding-left: 20px; }
.dialog-subject { margin-bottom: 16px; padding: 9px 12px; color: #687d9d; background: #f4f6fa; border: 1px solid #e9edf4; border-radius: 7px; font-size: 12px; overflow-wrap: anywhere; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.dialog form > .small { line-height: 1.8; }

/* --- tones: after every component so they win over its neutral defaults ---------------------- */
.tone-ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-border); }
.tone-warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-border); }
.tone-danger { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-border); }
.tone-info { color: var(--info); background: var(--info-bg); border-color: var(--info-border); }
.tone-muted { color: #828c9b; background: var(--neutral-bg); border-color: #e6e9ee; }

/* --- responsive ---------------------------------------------------------------------------------- */
@media (max-width: 1000px) {
  .admin-view { padding-left: 28px; padding-right: 28px; }
  .details-grid { gap: 16px; }
}
@media (max-width: 700px) {
  .topbar { height: 66px; padding: 0 16px; }
  .brand { gap: 10px; font-size: 13px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 19px; }
  .admin-view { padding: 24px 16px 150px; }
  .page-heading, .section-heading { flex-direction: column; align-items: stretch; gap: 12px; }
  .page-heading h1 { font-size: 25px; }
  .heading-actions { justify-content: flex-start; }
  .heading-actions #updated-at { flex-basis: 100%; }
  .section-heading .button-group { justify-content: flex-end; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 22px 0 26px; }
  .stat { padding: 15px; }
  .stat-value { font-size: 22px; }
  .pool { padding: 12px; }
  .stepper { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid, .activity-blocks { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: 18px; }
  .event { grid-template-columns: auto minmax(0, 1fr); }
  .event p { grid-column: 1 / -1; }
  .login-view { margin-top: 56px; }
  .login-view h1 { font-size: 36px; }
  .dialog { padding: 22px; }
  .flash-stack { bottom: 12px; }
}
@media (max-width: 420px) {
  .stats-grid { grid-template-columns: minmax(0, 1fr); }
  .heading-actions .button { flex: 1 1 auto; }
  .bucket-top { flex-direction: column; }
  .badges { justify-content: flex-start; }
  .topbar-right { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
.snippet-link { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 0; }
.snippet-link code { font-size: 12px; overflow-wrap: anywhere; word-break: break-all; padding: 2px 6px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); }
