/* ─────────────────────────  Tokens  ───────────────────────── */
:root {
  --canvas: #f6f5f4;
  --surface: #ffffff;
  --hairline: #e6e4e1;
  --field-border: #dcdad6;
  --ink: #111111;
  --ink-2: #31302e;
  --ink-muted: #5f5b57;   /* 6.1:1 on canvas */
  --ink-faint: #75706a;   /* 4.6:1 on canvas, 4.9:1 on white */
  --primary: #0075de;
  --primary-hover: #0068c6;
  --primary-active: #005bab;
  --on-primary: #ffffff;
  --focus-ring: rgba(0, 117, 222, 0.16);
  --error: #c4320a;
  --danger: #c4320a;
  --success: #15803d;
  --warning: #9a5b00;
  --control-bg: rgba(0, 0, 0, 0.05);
  --control-active: #ffffff;
  --hover-bg: rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.06), 0 16px 40px rgba(0, 0, 0, 0.12);

  /* One motion system: a single decelerating curve, three durations */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --t-fast: 120ms;
  --t-base: 200ms;
  --t-slow: 320ms;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --canvas: #0a0b0e;
  --surface: #131418;
  --hairline: #26282e;
  --field-border: #2f3138;
  --ink: #ededee;
  --ink-2: #c9cacd;
  --ink-muted: #a1a2a8;
  --ink-faint: #8a8c93;   /* 5.2:1 on surface */
  --primary: #3d8fe8;
  --primary-hover: #4d99ec;
  --primary-active: #2d78cc;
  --on-primary: #ffffff;
  --focus-ring: rgba(61, 143, 232, 0.25);
  --error: #f28b74;
  --danger: #f28b74;
  --success: #4ade80;
  --warning: #f5b454;
  --control-bg: #17181c;
  --control-active: #26282e;
  --hover-bg: rgba(255, 255, 255, 0.06);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.4), 0 16px 40px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

/* ─────────────────────────  Base  ───────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
.preload *, .preload *::before, .preload *::after { transition: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* The app is exactly one screen tall and never scrolls inside; layout() in app.js
   fits the content (dropping recent-link rows if space runs out). The page's
   article and footer follow below it. svh, so the mobile URL bar can't resize it. */
.app-screen {
  position: relative;
  z-index: 1;
  height: 100vh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* Content pages (privacy, terms, stats…) */
body.page { display: flex; flex-direction: column; min-height: 100dvh; }

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: var(--primary); }
svg { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Theme change: a short whole-page crossfade */
::view-transition-old(root),
::view-transition-new(root) { animation-duration: var(--t-base); animation-timing-function: var(--ease); }

/* ─────────────────────────  Starfield (dark only)  ───────────────────────── */
#stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
:root:not([data-theme="dark"]) #stars { display: none; }
/* Each layer is one 1024px tile repeated, oversized by a tile so it can slide
   a full tile and loop seamlessly. Transform-only, so it stays on the GPU. */
.star-layer {
  position: absolute;
  top: 0; left: 0;
  width: calc(100% + 1024px);
  height: calc(100% + 1024px);
  background-size: 1024px 1024px;
  will-change: transform;
  animation: star-drift linear infinite;
}
.star-layer.far  { background-image: var(--stars-far, none);  animation-duration: 1000s; }
.star-layer.near { background-image: var(--stars-near, none); animation-duration: 500s; }
@keyframes star-drift { to { transform: translate3d(-1024px, -1024px, 0); } }

/* ─────────────────────────  Nav  ───────────────────────── */
.nav {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 24px;
}
.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.brand-mark { width: 22px; height: 22px; color: var(--primary); }
.brand-dot { color: var(--ink-muted); font-weight: 500; }
#theme-toggle { justify-self: end; }

/* Segmented controls share one sliding-indicator pattern (see placeIndicator) */
.tabs, .segmented {
  position: relative;
  display: inline-flex;
  padding: 3px;
  background: var(--control-bg);
}
.tabs { border-radius: 9999px; }
.segmented { border-radius: var(--radius-md); padding: 2px; }
.tab, .segmented button {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  font-weight: 500;
  color: var(--ink-muted);
  white-space: nowrap;
  transition: color var(--t-base) var(--ease);
}
.tab { padding: 6px 16px; border-radius: 9999px; font-size: 14px; }
a.tab { display: inline-flex; align-items: center; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.segmented button { padding: 4px 10px; border-radius: var(--radius-sm); font-size: 13px; }
.tab:hover, .segmented button:hover,
.tab[aria-selected="true"], .segmented button[aria-checked="true"] { color: var(--ink); }
.segmented button:disabled { color: var(--ink-faint); cursor: default; opacity: .5; }
.tab-indicator, .seg-indicator {
  position: absolute;
  top: 3px; bottom: 3px; left: 0;
  width: 0;
  background: var(--control-active);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-slow) var(--ease), width var(--t-slow) var(--ease);
}
.tab-indicator { border-radius: 9999px; }
.seg-indicator { top: 2px; bottom: 2px; border-radius: var(--radius-sm); }
.no-anim { transition: none !important; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 9999px;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.icon-btn:hover { background: var(--hover-bg); color: var(--ink); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.i-moon { fill: currentColor !important; stroke: none !important; }
.i-sun { display: none !important; }
[data-theme="dark"] .i-moon { display: none !important; }
[data-theme="dark"] .i-sun { display: block !important; }

/* ─────────────────────────  Layout  ───────────────────────── */
.wrap {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  /* Pre-JS fallback: roughly centre the input. app.js takes over (layout()). */
  --above-input: 208px;
  padding: max(16px, calc(50vh - var(--above-input))) 24px 0;
  padding-top: max(16px, calc(50svh - var(--above-input)));
  min-height: 0;
  overflow: hidden;
  /* Glides the input when a result appears below it */
  transition: padding-top var(--t-slow) var(--ease);
}

.hero { text-align: center; margin-bottom: 28px; }
h1 {
  margin: 0 0 8px;
  font-size: 40px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.025em;
}
[dir="rtl"] h1 { letter-spacing: 0; }
.lede { margin: 0; color: var(--ink-muted); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─────────────────────────  Reveal (height + fade)  ───────────────────────── */
.collapse {
  display: grid;
  grid-template-rows: 0fr;
  grid-template-columns: minmax(0, 1fr);
  opacity: 0;
  transition: grid-template-rows var(--t-slow) var(--ease), opacity var(--t-base) var(--ease);
}
.collapse.open { grid-template-rows: 1fr; opacity: 1; }
.collapse > .collapse-inner { min-height: 0; min-width: 0; overflow: hidden; }
/* Once fully open, stop clipping so focus rings and shadows show */
.collapse.settled > .collapse-inner { overflow: visible; }
.pt-12 { padding-top: 12px; }
.pt-16 { padding-top: 16px; }
.pt-40 { padding-top: 32px; }

/* ─────────────────────────  Cards & fields  ───────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
}

.input-card {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  padding-inline-end: 8px;
  border-radius: 29px;
  box-shadow: var(--shadow-md);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.input-card:focus-within { border-color: var(--primary); box-shadow: var(--shadow-md), 0 0 0 3px var(--focus-ring); }
.input-card.invalid { border-color: var(--error); }
.input-card.invalid:focus-within { box-shadow: var(--shadow-md), 0 0 0 3px color-mix(in srgb, var(--error) 18%, transparent); }
.input-card input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0 16px;
  font-size: 16px;
}
[dir="rtl"] .input-card input[dir="ltr"]::placeholder { direction: rtl; text-align: right; }
.input-card input::placeholder { color: var(--ink-faint); }

/* "/" shortcut hint: desktop only, while the field is empty and unfocused */
.kbd-hint {
  display: none;
  flex-shrink: 0;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  font: 500 12px/20px var(--mono);
  text-align: center;
  color: var(--ink-faint);
  transition: opacity var(--t-fast) var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .kbd-hint { display: block; }
  .input-card:focus-within .kbd-hint,
  .input-card.has-value .kbd-hint { opacity: 0; pointer-events: none; }
}

/* Small round buttons that live inside the pill (options, clear) */
.field-btn, .clear-btn {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px; height: 32px;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: var(--ink-faint);
  transition: opacity var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.field-btn:hover, .clear-btn:hover { background: var(--hover-bg); color: var(--ink); }
.field-btn[aria-expanded="true"] { background: var(--control-bg); color: var(--ink); }
.field-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.clear-btn { opacity: 0; pointer-events: none; }
.clear-btn.visible { opacity: 1; pointer-events: auto; }
.clear-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* Busy indicator inside the field. The delay means fast responses never flash it. */
.field-spinner {
  flex-shrink: 0;
  width: 16px; height: 16px;
  margin: 0 4px;
  border-radius: 50%;
  border: 2px solid var(--hairline);
  border-top-color: var(--ink-muted);
  opacity: 0;
  transition: opacity var(--t-base) var(--ease);
}
.loading .field-spinner { opacity: 1; transition-delay: 150ms; animation: spin 0.7s linear infinite; }
.loading .kbd-hint { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Form fields (options, QR forms, dialog) */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 12px; font-weight: 600; color: var(--ink-muted); }
.field input, .field select, .prefix-input, .inline-input input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--field-border);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: 14px;
  outline: 0;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.field select { padding-inline-end: 6px; }
.field input:focus, .field select:focus, .prefix-input:focus-within, .inline-input input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.field input::placeholder { color: var(--ink-faint); }
.prefix-input { display: flex; align-items: center; padding: 0; overflow: hidden; }
.prefix-input .prefix { padding-inline-start: 10px; color: var(--ink-faint); font-size: 14px; white-space: nowrap; }
.prefix-input input { flex: 1; min-width: 0; height: 100%; border: 0 !important; box-shadow: none !important; padding-inline-start: 1px; background: transparent; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }

.options-card { padding: 16px; box-shadow: var(--shadow-sm); }
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 12px; }
.options-foot { display: flex; justify-content: flex-end; margin-top: 14px; }

/* ─────────────────────────  Buttons  ───────────────────────── */
.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9999px;
  padding: 11px 24px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-primary:active:not(:disabled) { background: var(--primary-active); transform: scale(0.97); }
.btn-primary:disabled { cursor: default; opacity: .6; }
.btn-primary.sm { padding: 8px 18px; font-size: 14px; }

.btn-utility {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn-utility:hover { background: var(--hover-bg); }
.btn-utility:active { transform: scale(0.97); }
.btn-utility.sm { padding: 4px 10px; font-size: 13px; }
.btn-utility svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.btn-danger {
  border: 0;
  background: transparent;
  padding: 7px 10px;
  border-radius: var(--radius-md);
  color: var(--danger);
  font-size: 14px;
  font-weight: 500;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.btn-danger.confirm { background: var(--danger); color: #fff; }

/* Icon + label crossfade (Copy → Copied) with stable width */
.swap-icon, .swap-label { display: inline-grid; }
.swap-icon > *, .swap-label > * {
  grid-area: 1 / 1;
  transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}
.swap-label > * { text-align: start; }
.swap-b { opacity: 0; }
.swap-icon .swap-b { transform: scale(0.6); }
.copied { color: var(--success); }
.copied .swap-a { opacity: 0; }
.copied .swap-icon .swap-a { transform: scale(0.6); }
.copied .swap-b { opacity: 1; transform: none; }

.link-btn {
  border: 0; background: none; padding: 0;
  color: var(--ink-faint); font-size: 13px;
  transition: color var(--t-fast) var(--ease);
}
.link-btn:hover { color: var(--ink); }

.error { margin: 0; text-align: center; color: var(--error); font-size: 14px; }

/* ─────────────────────────  Result  ───────────────────────── */
.result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  padding-inline-start: 20px;
  box-shadow: var(--shadow-sm);
}
.result-main { min-width: 0; display: flex; flex-direction: column; }
[dir="rtl"] .result-main { align-items: flex-end; }
.short-link {
  max-width: 100%;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.short-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.long-link { max-width: 100%; color: var(--ink-faint); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Bulk results */
.bulk { padding: 8px 0 4px; box-shadow: var(--shadow-sm); }
.bulk-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 12px 8px 16px; }
.bulk-head span { font-size: 13px; font-weight: 600; color: var(--ink-muted); }
.bulk ul { list-style: none; margin: 0; padding: 0; max-height: 36vh; overflow-y: auto; overscroll-behavior: contain; }
.bulk li { display: flex; align-items: center; gap: 12px; padding: 7px 12px 7px 16px; border-top: 1px solid var(--hairline); font-size: 14px; }
.bulk li a { font-weight: 600; text-decoration: none; white-space: nowrap; }
.bulk li .r-long { flex: 1; min-width: 0; color: var(--ink-faint); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulk li.failed a, .bulk li.failed .r-err { color: var(--error); font-size: 13px; white-space: nowrap; }

.ts:empty { display: none; }
.ts { display: flex; justify-content: center; margin-top: 12px; }

/* ─────────────────────────  Recent  ───────────────────────── */
.recent-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; padding: 0 2px; }
.recent h2 { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-muted); }
.recent ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}
.recent li, .bulk li { background: var(--surface); }
.recent li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  padding-inline-start: 14px;
  border-top: 1px solid var(--hairline);
  font-size: 14px;
}
.recent li:first-child { border-top: 0; }
.recent li a, .bulk li a { direction: ltr; }
.recent li a { font-weight: 600; text-decoration: none; white-space: nowrap; }
.recent li a:hover, .bulk li a:hover { text-decoration: underline; text-underline-offset: 3px; }
.recent li .r-long { flex: 1; min-width: 0; color: var(--ink-faint); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: start; }
.recent li .r-badges { display: inline-flex; gap: 4px; color: var(--ink-faint); }
.recent li .r-badges svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.row-btn {
  flex-shrink: 0;
  border: 0; background: none; padding: 4px 8px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; color: var(--ink-muted);
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.row-btn:hover { background: var(--hover-bg); color: var(--ink); }
.row-btn.icon { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; }
.row-btn.icon svg { width: 16px; height: 16px; fill: currentColor; }
.hint { margin: 8px 2px 0; font-size: 12px; color: var(--ink-faint); }

/* ─────────────────────────  QR  ───────────────────────── */
/* ─────────────────────────  QR composer  ─────────────────────────
   One field for every QR type. For links it is the same pill as the shortener;
   other types grow it into a card with label/field rows underneath. */
.composer { display: block; padding: 0; transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), border-radius var(--t-slow) var(--ease); }
.composer.expanded { border-radius: 18px; }
.composer-row { display: flex; align-items: center; gap: 4px; padding: 6px; padding-inline-end: 8px; }
.composer-row input { flex: 1; min-width: 0; height: 44px; border: 0; outline: 0; background: transparent; padding: 0 16px; font-size: 16px; }
.composer-row input::placeholder { color: var(--ink-faint); }

.type-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  height: 36px;
  padding: 0 8px 0 10px;
  margin-inline-start: 4px;
  border: 0;
  border-radius: 9999px;
  background: var(--control-bg);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  transition: background-color var(--t-fast) var(--ease);
}
.type-chip:hover, .type-chip[aria-expanded="true"] { background: color-mix(in srgb, var(--ink) 9%, transparent); }
.chip-icon { display: grid; color: var(--primary); }
.chip-icon svg, .type-chip .chev { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.type-chip .chev { width: 14px; height: 14px; stroke-width: 2; color: var(--ink-faint); transition: transform var(--t-base) var(--ease); }
.type-chip[aria-expanded="true"] .chev { transform: rotate(180deg); }
.chip-label { white-space: nowrap; }

/* Label/field rows, grouped like a settings list */
.fieldset { border-top: 1px solid var(--hairline); }
.frow {
  display: grid;
  grid-template-columns: minmax(96px, 34%) 1fr;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 16px;
  border-top: 1px solid var(--hairline);
  font-size: 14px;
  cursor: text;
}
.frow:first-child { border-top: 0; }
.frow > span { color: var(--ink-muted); }
.frow input, .frow select {
  width: 100%;
  padding: 0;
  min-width: 0;
  height: 44px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
}
.frow input[dir="ltr"] { text-align: start; }
.frow select { cursor: pointer; margin-inline-start: -4px; }
.frow:has(.switch) { cursor: pointer; grid-template-columns: 1fr auto; }

/* Switch */
.switch {
  appearance: none;
  position: relative;
  width: 36px !important;
  height: 22px !important;
  border-radius: 9999px;
  background: var(--field-border) !important;
  cursor: pointer;
  transition: background-color var(--t-base) var(--ease);
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
  transition: transform var(--t-base) var(--ease);
}
.switch:checked { background: var(--primary) !important; }
.switch:checked::after { transform: translateX(14px); }
[dir="rtl"] .switch:checked::after { transform: translateX(-14px); }
[dir="rtl"] .switch::after { left: auto; right: 2px; }

/* Type menu */
.type-menu {
  position: fixed;
  z-index: 40;
  width: 280px;
  padding: 6px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform-origin: top right;
  animation: menu-in 160ms var(--ease);
}
[dir="rtl"] .type-menu { transform-origin: top left; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.type-menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  text-align: start;
  transition: background-color var(--t-fast) var(--ease);
}
.type-menu button:hover, .type-menu button:focus-visible { background: var(--hover-bg); outline: 0; }
.type-menu button[aria-checked="true"] { background: color-mix(in srgb, var(--primary) 9%, transparent); }
.type-menu svg {
  flex-shrink: 0;
  width: 32px; height: 32px;
  padding: 7px;
  border-radius: var(--radius-md);
  background: var(--control-bg);
  color: var(--ink-muted);
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.type-menu button[aria-checked="true"] svg { color: var(--primary); background: var(--surface); box-shadow: var(--shadow-sm); }
.tm-text { display: flex; flex-direction: column; min-width: 0; }
.tm-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.tm-desc { font-size: 12px; color: var(--ink-faint); }

/* Settings dialog */
.qr-settings { width: min(400px, calc(100vw - 32px)); }
.dialog-heading { margin: 0; font-size: 17px; font-weight: 650; }
.qr-mini { width: 120px; aspect-ratio: 1; margin: 4px auto 20px; border-radius: var(--radius-md); background: #fff; overflow: hidden; }
[data-theme="dark"] .qr-mini { box-shadow: 0 0 0 1px var(--hairline); }
.qr-mini.transparent { background: repeating-conic-gradient(#e9e9e9 0 25%, #ffffff 0 50%) 0 0 / 12px 12px; }
.qr-mini canvas { display: block; width: 100%; height: 100%; }
.dialog-foot.end { justify-content: flex-end; }

.qr-card {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 18px;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.qr-preview { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.qr-frame {
  position: relative;
  width: 100%;
  max-width: var(--qr-max, var(--qr-default, 200px));
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: #fff;
  overflow: hidden;
}
/* Checkerboard behind a transparent code */
.qr-frame.transparent {
  background: repeating-conic-gradient(#e9e9e9 0 25%, #ffffff 0 50%) 0 0 / 16px 16px;
}
[data-theme="dark"] .qr-frame { box-shadow: 0 0 0 1px var(--hairline); }
.qr-frame canvas { display: block; width: 100%; height: 100%; }
#qr-prev { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.qr-warning { margin: 0; font-size: 12px; color: var(--warning); text-align: center; }

.qr-controls { display: flex; flex-direction: column; gap: 14px; width: 100%; min-width: 0; }
.qr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}
.swatches { display: flex; gap: 9px; }
.swatch {
  position: relative;
  width: 20px; height: 20px;
  border-radius: 9999px;
  border: 0;
  padding: 0;
  background: var(--c);
  box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 0 0 1px var(--surface), 0 0 0 1px transparent;
  transition: box-shadow var(--t-base) var(--ease);
}
[data-theme="dark"] .swatch { box-shadow: 0 0 0 1px rgba(255,255,255,.18), 0 0 0 1px var(--surface), 0 0 0 1px transparent; }
.swatch[aria-checked="true"],
[data-theme="dark"] .swatch[aria-checked="true"] { box-shadow: 0 0 0 1px transparent, 0 0 0 3px var(--surface), 0 0 0 5px var(--primary); }
.swatch-custom {
  cursor: pointer;
  background: conic-gradient(from 90deg, #f43f5e, #f59e0b, #22c55e, #06b6d4, #6366f1, #d946ef, #f43f5e);
}
.swatch-custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.color-chip { width: 28px; height: 24px; padding: 0; border: 1px solid var(--field-border); border-radius: var(--radius-sm); background: none; cursor: pointer; }
.color-chip::-webkit-color-swatch-wrapper { padding: 2px; }
.color-chip::-webkit-color-swatch { border: 0; border-radius: 3px; }

.qr-more { display: flex; flex-direction: column; gap: 12px; }
.qr-more-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; }
.row-end { display: flex; align-items: center; gap: 10px; }
.more-toggle { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; }
.more-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }

.qr-actions { display: flex; align-items: center; gap: 8px; width: 100%; }
.qr-actions > * { white-space: nowrap; height: 36px; }
.qr-actions .btn-primary { flex: 1; }

/* Wide screens: preview beside the controls */
@media (min-width: 700px) {
  .qr-card { max-width: 560px; grid-template-columns: var(--qr-max, var(--qr-default, 200px)) 1fr; align-items: start; justify-items: stretch; gap: 24px; }
  .qr-row { padding-top: 0; border-top: 0; }
  .qr-controls { justify-content: space-between; min-height: var(--qr-max, var(--qr-default, 200px)); }
}

/* ─────────────────────────  Temp mail  ─────────────────────────
   Built from the shortener's parts: the pill, the options card, the
   recent-links list and the manage dialog. Blue only marks unread. */
.tab-dot {
  display: inline-block;
  width: 6px; height: 6px;
  margin-inline-start: 6px;
  border-radius: 50%;
  background: var(--primary);
  vertical-align: 2px;
}

.mail-bar input { font-weight: 500; text-overflow: ellipsis; cursor: text; }
.mail-bar.expired input { color: var(--ink-faint); text-decoration: line-through; }
.field-btn .swap-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.field-btn.copied { color: var(--success); }
.field-btn:disabled { opacity: .4; pointer-events: none; }

/* name @asus.lol */
.prefix-input.suffix input { padding-inline-start: 10px; }
.suffix-text { flex-shrink: 0; padding-inline: 1px 10px; color: var(--ink-faint); font-size: 14px; }

/* Options: saved addresses, then one row to make a new one */
.mail-options { display: flex; flex-direction: column; gap: 16px; }
.mo-section { display: flex; flex-direction: column; gap: 6px; }
.mo-boxes {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 152px;
  overflow-y: auto;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
}
.mo-boxes li + li { border-top: 1px solid var(--hairline); }
.mo-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  font-size: 14px;
  text-align: start;
  transition: background-color var(--t-fast) var(--ease);
}
.mo-box:hover { background: var(--hover-bg); }
.mo-box:focus-visible { outline-offset: -2px; }
.mo-addr { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.mo-left { font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.mo-box svg { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: var(--primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mo-box[aria-current="true"] .mo-addr { color: var(--ink); font-weight: 600; }
.mo-create { display: flex; align-items: center; gap: 8px; }
.mo-create .prefix-input { flex: 1; min-width: 0; }
.mo-ttl {
  flex-shrink: 0;
  height: 36px;
  padding: 0 6px 0 10px;
  border: 1px solid var(--field-border);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: 14px;
  outline: 0;
  cursor: pointer;
}
.mo-ttl:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus-ring); }
.mo-create .btn-primary { flex-shrink: 0; height: 36px; }

/* Inbox: heading row + list, like "Your recent links" */
.inbox-head { align-items: center; }
.inbox-head h2 { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-muted); }
.inbox-unread { font-weight: 500; color: var(--ink-faint); }
.inbox {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}
.inbox-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; overscroll-behavior: contain; }
.inbox-list li { position: relative; border-top: 1px solid var(--hairline); }
.inbox-list li:first-child { border-top: 0; }
.m-open {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 16px;
  width: 100%;
  padding: 11px 16px 12px;
  border: 0;
  background: transparent;
  text-align: start;
  transition: background-color var(--t-fast) var(--ease);
}
.m-open:hover { background: var(--hover-bg); }
.m-open:focus-visible { outline-offset: -2px; }
.m-from, .m-line { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-from { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.m-time { justify-self: end; font-size: 12px; line-height: 21px; color: var(--ink-faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.m-line { grid-column: 1 / -1; font-size: 13px; color: var(--ink-faint); }
.has-code .m-line { padding-inline-end: 112px; } /* room for the code button */
.m-subj { color: var(--ink-muted); }
.m-snip { white-space: pre; }
.m-clip { display: inline-block; width: 13px; height: 13px; margin-inline-end: 5px; vertical-align: -2px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.unread .m-from { font-weight: 650; color: var(--ink); }
.unread .m-subj { font-weight: 500; color: var(--ink); }

/* Detected one-time code: sits under the time, copies on click */
.code-chip {
  position: absolute;
  inset-inline-end: 12px;
  bottom: 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--control-bg);
  color: var(--ink);
  font: 600 13px/1 var(--mono);
  letter-spacing: 0.06em;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.code-chip:hover { background: color-mix(in srgb, var(--ink) 10%, transparent); }
.code-chip svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--ink-faint); }
.code-chip.copied, .code-chip.copied svg { color: var(--success); }

.inbox-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 28px 24px 30px;
  text-align: center;
}
.inbox-state .field-spinner { opacity: 1; margin: 0 0 10px; animation: spin 0.9s linear infinite; }
.inbox-state .btn-utility { margin-top: 12px; }
.state-title { margin: 0; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.state-hint { margin: 0; font-size: 13px; color: var(--ink-faint); }
.inbox.compact .inbox-state { flex-direction: row; justify-content: center; gap: 10px; padding: 14px 16px; }
.inbox.compact .inbox-state .field-spinner { margin: 0; }
.inbox.compact .state-hint { display: none; }
.inbox.compact .inbox-state .btn-utility { margin-top: 0; }

/* Address actions: timer on the left, tools on the right */
.mail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 20px;
}
.ma-timer { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; color: var(--ink-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ma-timer > svg { width: 15px; height: 15px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; color: var(--ink-faint); }
.ma-timer .soon { color: var(--warning); }
.ma-dot { color: var(--ink-faint); }
.ma-extend { position: relative; display: inline-flex; align-items: center; color: var(--primary); }
.ma-extend select {
  appearance: none;
  border: 0;
  padding: 2px 16px 2px 0;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.ma-extend:hover { color: var(--primary-hover); }
.ma-extend select option { color: var(--ink); background: var(--surface); }
.ma-extend svg { position: absolute; inset-inline-end: 0; width: 14px; height: 14px; pointer-events: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.ma-buttons { display: flex; align-items: center; gap: 6px; }
.ma-buttons .btn-utility { height: 30px; }
.ma-buttons .btn-utility svg { width: 15px; height: 15px; }
.btn-utility.icon { width: 30px; padding: 0; }
#ma-notify .bell-slash { transition: opacity var(--t-fast) var(--ease); }
#ma-notify.on { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 35%, var(--hairline)); }
#ma-notify.on .bell-slash { opacity: 0; }
.ma-delete:hover { color: var(--danger); }
.ma-confirm { display: none; }
.ma-delete.confirm { width: auto; padding: 0 10px; background: var(--danger); border-color: var(--danger); color: #fff; }
.ma-delete.confirm .ma-confirm { display: inline; }
[data-theme="dark"] .ma-delete.confirm { color: #0a0b0e; }

/* Message view */
.dialog.mail-view { width: min(760px, calc(100vw - 32px)); height: min(88dvh, 920px); padding: 0; overflow: hidden; }
.mail-view[open] { display: flex; flex-direction: column; }
.mv-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 12px 0 20px; }
.mv-title { flex: 1; min-width: 0; }
.mv-subject { margin: 4px 0 6px; font-size: 18px; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.mv-from, .mv-sub { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-from { font-size: 14px; color: var(--ink-2); }
.mv-from .addr { color: var(--ink-faint); }
.mv-sub { font-size: 12px; color: var(--ink-faint); }
.mv-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 14px 20px 0; }
.mv-code { display: inline-flex; align-items: center; gap: 10px; }
.mv-code-val { font: 650 20px/1 var(--mono); letter-spacing: 0.08em; }
.mv-quick a svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mv-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 20px 12px; border-bottom: 1px solid var(--hairline); }
.mv-actions { display: flex; align-items: center; gap: 4px; }
.mv-notice { margin: 0; padding: 8px 20px; border-bottom: 1px solid var(--hairline); font-size: 13px; color: var(--ink-faint); }
.mv-notice .link-btn { color: var(--primary); }
.mv-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#mv-frame { flex: 1; width: 100%; border: 0; background: #fff; }
.mv-text { flex: 1; margin: 0; padding: 16px 20px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.6 var(--font); color: var(--ink-2); }
.mv-text.source { font: 12px/1.55 var(--mono); color: var(--ink-muted); }
.mv-loading { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.mv-loading .sk { height: 12px; }
.mv-loading .sk:nth-child(1) { width: 70%; }
.mv-loading .sk:nth-child(2) { width: 92%; }
.mv-loading .sk:nth-child(3) { width: 54%; }
.mv-files { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 12px 20px; list-style: none; border-top: 1px solid var(--hairline); max-height: 112px; overflow-y: auto; }
.mv-files .btn-utility { max-width: 280px; }
.f-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-size { flex-shrink: 0; color: var(--ink-faint); font-weight: 400; }

/* ─────────────────────────  Dialog  ───────────────────────── */
.dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 20px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
.dialog[open] { animation: dialog-in var(--t-base) var(--ease); }
.dialog::backdrop { background: rgba(0, 0, 0, 0.32); animation: fade-in var(--t-base) var(--ease); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(4px) scale(0.98); } }
@keyframes fade-in { from { opacity: 0; } }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -6px -8px 4px 0; }
.dialog-title { font-size: 18px; font-weight: 650; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dialog-meta { margin: 0 0 16px; color: var(--ink-faint); font-size: 13px; }
.inline-input { display: flex; gap: 8px; }
.inline-input input { flex: 1; min-width: 0; }
.dialog-edit .error { text-align: start; margin-top: 8px; }
.dialog-note { margin: 0; padding: 10px 12px; border-radius: var(--radius-md); background: var(--control-bg); color: var(--ink-muted); font-size: 13px; }
.dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 20px; }
.dialog-links { display: flex; gap: 8px; }

/* ─────────────────────────  Scroll hint + article below the app  ───────────────────────── */
.scroll-hint {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: center;
  margin: 0 0 14px;
  padding: 4px 10px;
  border-radius: 9999px;
  color: var(--ink-faint);
  font-size: 13px;
  text-decoration: none;
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.scroll-hint:hover { color: var(--ink); background: var(--hover-bg); }
.scroll-hint svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-height: 620px) { .scroll-hint { display: none; } }

.learn-wrap { position: relative; z-index: 1; border-top: 1px solid var(--hairline); }
.learn-wrap:empty { display: none; }
.learn { max-width: 760px; margin: 0 auto; padding: 64px 24px 24px; scroll-margin-top: 16px; color: var(--ink-2); }
.learn h2 { margin: 0 0 16px; font-size: 24px; font-weight: 700; line-height: 1.25; letter-spacing: -0.015em; color: var(--ink); }
.learn h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.learn p { margin: 0; line-height: 1.65; }
.learn-head { max-width: 640px; }
.learn-head h2 { font-size: 30px; letter-spacing: -0.02em; }
.learn-head p + p { margin-top: 12px; }
.learn-head strong { color: var(--ink); font-weight: 600; }
.learn-block { margin-top: 56px; }

.learn-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; counter-reset: step; }
.learn-steps li { position: relative; padding: 18px; border: 1px solid var(--hairline); border-radius: var(--radius-lg); background: var(--surface); counter-increment: step; }
.learn-steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--control-bg);
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}
.learn-steps p, .learn-grid p { margin-top: 6px; font-size: 14px; color: var(--ink-muted); line-height: 1.55; }

.learn-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 32px; }
.learn-grid li { padding-top: 14px; border-top: 1px solid var(--hairline); }

.learn-faq { border-top: 1px solid var(--hairline); }
.learn-faq details { border-bottom: 1px solid var(--hairline); }
.learn-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 2px;
  list-style: none;
  cursor: pointer;
}
.learn-faq summary::-webkit-details-marker { display: none; }
.learn-faq summary::after {
  content: "";
  flex-shrink: 0;
  width: 8px; height: 8px;
  margin-inline-end: 4px;
  border-right: 1.75px solid var(--ink-faint);
  border-bottom: 1.75px solid var(--ink-faint);
  transform: translateY(-2px) rotate(45deg);
  transition: transform var(--t-base) var(--ease);
}
.learn-faq details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.learn-faq summary:hover h3 { color: var(--primary); }
.learn-faq h3 { font-weight: 500; transition: color var(--t-fast) var(--ease); }
.learn-faq details p { padding: 0 2px 18px; font-size: 14px; color: var(--ink-muted); max-width: 640px; }

.learn-tools { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.learn-tools a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 16px 18px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-decoration: none;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.learn-tools a:hover { border-color: var(--field-border); box-shadow: var(--shadow-md); }
.learn-tools strong { font-size: 15px; font-weight: 600; color: var(--ink); }
.learn-tools span { font-size: 13px; color: var(--ink-muted); line-height: 1.5; }

.footer-tools { flex-basis: 100%; order: -1; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--hairline); }
body.page .footer-tools { display: none; }

@media (max-width: 640px) {
  .learn { padding: 48px 16px 16px; }
  .learn-head h2 { font-size: 24px; }
  .learn h2 { font-size: 21px; }
  .learn-block { margin-top: 44px; }
  .learn-steps, .learn-grid, .learn-tools { grid-template-columns: 1fr; }
  .learn-grid { gap: 20px; }
}

/* ─────────────────────────  Consent, ads, footer, toast  ───────────────────────── */
.consent {
  position: fixed;
  inset-inline: 16px;
  bottom: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 560px;
  margin: 0 auto;
  padding: 14px 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  animation: consent-in var(--t-slow) var(--ease);
}
@keyframes consent-in { from { opacity: 0; transform: translateY(8px); } }
.consent p { margin: 0; color: var(--ink-2); }
.consent-actions { display: flex; gap: 8px; flex-shrink: 0; }

.ad-slot { position: relative; z-index: 1; flex-shrink: 0; display: grid; place-items: center; height: 100px; overflow: hidden; }

.footer {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px 24px 20px;
  font-size: 13px;
  color: var(--ink-faint);
}
.footer-links { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px; }
.footer a, .footer .link-btn { color: var(--ink-faint); text-decoration: none; transition: color var(--t-fast) var(--ease); }
.footer a:hover, .footer .link-btn:hover { color: var(--ink); }
.lang-select {
  height: 26px;
  padding: 0 6px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-faint);
  font-size: 13px;
  cursor: pointer;
}
.lang-select:hover { color: var(--ink); }
.lang-select option { color: initial; }

.toast {
  position: fixed;
  left: 50%; bottom: 24px;
  z-index: 30;
  transform: translate(-50%, 8px);
  padding: 9px 16px;
  border-radius: var(--radius-md);
  background: #1c1c1e;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,.16);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}
[data-theme="dark"] .toast { background: #ededee; color: #0a0b0e; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ─────────────────────────  Content pages  ───────────────────────── */
.page-main { position: relative; z-index: 1; flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 32px 24px 48px; }
.page-main.center { display: flex; flex-direction: column; justify-content: center; text-align: center; max-width: 480px; }
.page-main h1 { font-size: 32px; }
.page-main .lede { white-space: normal; }
.page-card { margin-top: 24px; padding: 20px; text-align: start; box-shadow: var(--shadow-sm); }
.page-actions { display: flex; justify-content: center; gap: 8px; margin-top: 24px; }

.prose { color: var(--ink-2); font-size: 15px; line-height: 1.65; }
.prose h1 { margin-bottom: 4px; }
.prose h2 { margin: 32px 0 8px; font-size: 18px; color: var(--ink); }
.prose p, .prose ul { margin: 0 0 12px; }
.prose ul { padding-inline-start: 20px; }
.prose .updated { color: var(--ink-faint); font-size: 13px; margin-bottom: 24px; }

.dest { display: block; margin-top: 6px; font-size: 15px; word-break: break-all; }
.dest-host { font-size: 20px; font-weight: 650; color: var(--ink); }
.notice { margin: 16px 0 0; padding: 10px 12px; border-radius: var(--radius-md); background: var(--control-bg); font-size: 13px; color: var(--ink-muted); }
.notice.warn { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }

.unlock-form { display: flex; gap: 8px; margin-top: 24px; }
.unlock-form input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--field-border); border-radius: var(--radius-md); background: var(--surface); outline: 0; font-size: 15px; }
.unlock-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus-ring); }
.unlock-form .btn-primary { border-radius: var(--radius-md); }

.stat-sub { color: var(--ink-faint); font-size: 13px; }
.stat-title { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-muted); }

/* ─────────────────────────  Stats page  ───────────────────────── */
.stats-main { max-width: 760px; padding-top: 24px; }
.ic { display: inline-grid; flex-shrink: 0; }
.ic svg, .rank-icon svg, .kpi-delta svg, .chip svg, .stats-dest svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}

/* Header */
.eyebrow { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--ink-muted); }
.stats-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.stats-title h1 { margin: 0; font-size: 32px; letter-spacing: -0.02em; min-width: 0; overflow-wrap: anywhere; }
.stats-title h1 a { color: var(--ink); text-decoration: none; }
.stats-title h1 a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.stats-actions { display: flex; gap: 8px; }
.stats-dest { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; min-width: 0; color: var(--ink-faint); font-size: 14px; }
.stats-dest a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; text-decoration: none; }
.stats-dest a:hover .host { text-decoration: underline; text-underline-offset: 3px; }
.stats-dest .host { color: var(--ink-2); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px;
  border: 1px solid var(--hairline); border-radius: 9999px;
  background: var(--surface);
  color: var(--ink-muted); font-size: 12px; font-weight: 500;
}
.chip svg { width: 14px; height: 14px; color: var(--ink-faint); }

/* KPI tiles: one hero figure, two supporting */
.kpis { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; margin-top: 28px; }
.kpi { padding: 16px 18px; box-shadow: var(--shadow-sm); min-width: 0; }
.kpi-label { margin: 0; font-size: 13px; font-weight: 500; color: var(--ink-muted); }
.kpi-value { margin: 6px 0 0; font-size: 30px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; }
.kpi-hero .kpi-value { font-size: 48px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; margin-top: 10px; }
.kpi-delta { display: flex; align-items: center; gap: 4px; margin: 8px 0 0; font-size: 12px; font-weight: 500; color: var(--ink-faint); }
.kpi-delta svg { width: 14px; height: 14px; stroke-width: 2; }
.kpi-delta.up { color: var(--success); }
.kpi-delta.down { color: var(--danger); }

/* Chart card */
.chart-card, .rank-card { padding: 18px 18px 16px; box-shadow: var(--shadow-sm); }
.chart-card { margin-top: 12px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2 { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); }

.chart { --gutter: 32px; }
.chart-plot { position: relative; height: 180px; margin-inline-start: var(--gutter); margin-top: 8px; }
.gridline { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--hairline); }
.gridline.base { border-top-color: var(--field-border); }
.tick {
  position: absolute; right: 100%; top: 0;
  transform: translateY(-50%);
  padding-right: 8px;
  font-size: 11px; color: var(--ink-faint); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.chart-cols { position: absolute; inset: 0; display: flex; }
.chart-cols .col {
  flex: 1; min-width: 0; height: 100%;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0; border: 0; border-radius: 4px 4px 0 0;
  background: transparent; cursor: default;
  transition: background-color var(--t-fast) var(--ease);
}
.chart-cols .col:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.chart-cols .col.active { background: var(--hover-bg); }
/* Thin columns, 4px rounded data-end, square at the baseline, 2px surface gap */
.bar {
  display: block;
  width: min(24px, calc(100% - 2px));
  border-radius: 4px 4px 0 0;
  background: var(--primary);
  transition: background-color var(--t-fast) var(--ease);
}
.col.active .bar { background: var(--primary-hover); }
.chart-tip {
  position: absolute; z-index: 2;
  display: flex; flex-direction: column;
  padding: 7px 10px;
  border: 1px solid var(--hairline); border-radius: var(--radius-md);
  background: var(--surface); box-shadow: var(--shadow-lg);
  white-space: nowrap; pointer-events: none;
}
.chart-tip strong { font-size: 14px; font-weight: 650; color: var(--ink); }
.chart-tip span { font-size: 12px; color: var(--ink-faint); }
.chart-empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  margin: 0; padding: 0 24px; text-align: center;
  font-size: 13px; color: var(--ink-faint);
}
.chart-x { position: relative; height: 18px; margin: 8px 0 0; margin-inline-start: var(--gutter); }
.chart-x span { position: absolute; top: 0; transform: translateX(-50%); font-size: 11px; color: var(--ink-faint); white-space: nowrap; }
.chart-x span.first { transform: none; left: 0 !important; }
.chart-x span.last { transform: none; left: auto !important; right: 0; }
.chart-table { max-height: 232px; overflow: auto; border: 1px solid var(--hairline); border-radius: var(--radius-md); }
.chart-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.chart-table th, .chart-table td { padding: 7px 12px; text-align: start; border-top: 1px solid var(--hairline); }
.chart-table th { position: sticky; top: 0; border-top: 0; background: var(--surface); font-weight: 600; color: var(--ink-muted); }
.chart-table td:last-child, .chart-table th:last-child { text-align: end; font-variant-numeric: tabular-nums; }

/* Ranked lists */
.rank-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.rank li {
  display: grid;
  grid-template-columns: 20px 1fr auto 40px;
  grid-template-rows: auto 4px;
  align-items: center;
  gap: 6px 10px;
  font-size: 14px;
}
.rank-icon { display: grid; place-items: center; color: var(--ink-muted); }
.rank-icon svg { width: 18px; height: 18px; }
.flag { display: block; width: 20px; height: 15px; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
[data-theme="dark"] .flag { box-shadow: 0 0 0 1px rgba(255,255,255,.12); }
.rank-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.rank-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.rank-pct { text-align: end; color: var(--ink-faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.rank-meter { grid-column: 2 / -1; height: 4px; border-radius: 9999px; background: var(--control-bg); overflow: hidden; }
.rank-meter > span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.rank-empty { margin: 0; padding: 12px 0 4px; font-size: 13px; color: var(--ink-faint); }

.stats-missing { padding-top: 12vh; text-align: center; }
.stats-missing h1 { font-size: 32px; }

/* Loading skeleton */
.sk { display: block; border-radius: 6px; background: var(--control-bg); animation: sk-pulse 1.4s ease-in-out infinite; }
@keyframes sk-pulse { 50% { opacity: .5; } }
.stats-head .sk, .kpi .sk { max-width: 100%; }

@media (max-width: 640px) {
  .stats-title h1 { font-size: 26px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi-hero { grid-column: 1 / -1; }
  .rank-cols { grid-template-columns: 1fr; }
}

/* ─────────────────────────  Responsive  ───────────────────────── */
@media (max-width: 640px) {
  .nav { padding: 14px 16px; }
  .brand > span { display: none; }
  .tab { padding: 6px 14px; }
  .wrap { --above-input: 189px; padding-left: 16px; padding-right: 16px; }
  h1 { font-size: 32px; }
  .lede { font-size: 15px; }
  .input-card input { padding: 0 12px; }
  .result { flex-direction: column; align-items: stretch; padding: 14px 16px; }
  .result-actions > * { flex: 1; }
  .opt-grid { grid-template-columns: 1fr 1fr; }
  .opt-alias, .opt-password { grid-column: span 2; }
  .footer { padding: 12px 16px 16px; justify-content: center; }
  .footer > span { display: none; }
  .consent { flex-direction: column; align-items: stretch; }
  .consent-actions > * { flex: 1; }
  .recent li .r-long { display: none; }
  .recent li a { flex: 1; overflow: hidden; text-overflow: ellipsis; }
  .tab { padding: 6px 11px; font-size: 13.5px; }
  .mail-bar input { padding: 0 6px 0 12px; font-size: 15px; }
  .m-open { padding-inline: 14px; }
  .mail-actions { margin-bottom: 16px; }
  .ma-buttons { width: 100%; }
  .ma-buttons .btn-utility:not(.icon) { flex: 1; }
  .mo-create { flex-wrap: wrap; }
  .mo-create .prefix-input { flex-basis: 100%; }
  .mo-ttl { flex: 1; }
  .m-snip { display: none; }
  .dialog.mail-view { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .mv-head { padding: 12px 8px 0 16px; }
  .mv-quick, .mv-tools, .mv-notice, .mv-text, .mv-files { padding-inline: 16px; }
}
@media (max-width: 380px) {
  .tab { padding: 6px 9px; font-size: 13px; }
  .nav { gap: 6px; padding-inline: 12px; }
}

/* Short screens: tighter hero and a smaller QR so everything fits without scrolling */
@media (max-height: 760px) {
  h1 { font-size: 30px; }
  .hero { margin-bottom: 20px; }
  .qr-card { gap: 14px; padding: 16px; }
  .qr-card { --qr-default: 160px; }
  .pt-40 { padding-top: 24px; }
}

/* Reduced motion: keep the fades, drop movement and size changes */
@media (prefers-reduced-motion: reduce) {
  .collapse { transition: opacity var(--t-base) var(--ease); }
  .wrap { transition: none; }
  .tab-indicator, .seg-indicator { transition: none; }
  .btn-primary:active:not(:disabled), .btn-utility:active, .icon-btn:active { transform: none; }
  .swap-icon > * { transform: none !important; }
  .toast { transform: translate(-50%, 0); }
  .star-layer { animation: none; }
  .dialog[open] { animation: fade-in var(--t-base) var(--ease); }
  .consent { animation: fade-in var(--t-base) var(--ease); }
}

/* ─────────────────────────  Nav: personal addresses link  ─────────────────────────
   Plain text, like a footer link promoted to the top bar. Shown only while on sale. */
.nav-end { justify-self: end; display: flex; align-items: center; gap: 14px; }
.nav-promo {
  color: var(--ink-muted); font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap;
  text-underline-offset: 3px; transition: color var(--t-fast) var(--ease);
}
.nav-promo:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 640px) { .nav-promo { display: none; } }

/* ─────────────────────────  QR type menu: more types  ───────────────────────── */
/* Ten types: a two-column grid, so every one is visible without scrolling */
.type-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; width: min(460px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 559px) { .tm-desc { display: none; } .type-menu button { padding: 8px; gap: 10px; } }

/* Barcodes: wide frame; QR-only controls hidden */
[data-qr-type="barcode"] .qr-frame { aspect-ratio: 2 / 1; }
[data-qr-type="barcode"] .qr-card { --qr-default: 240px; }
[data-qr-type="barcode"] .qr-mini { aspect-ratio: 2 / 1; }
[data-qr-type="barcode"] #qr-style,
[data-qr-type="barcode"] .qr-more-row:has(#qr-logo),
[data-qr-type="barcode"] .qr-more-row:has(#qr-ec) { display: none; }
@media (min-width: 700px) {
  [data-qr-type="barcode"] .qr-card { max-width: 640px; grid-template-columns: 1fr; }
  [data-qr-type="barcode"] .qr-frame { max-width: 100%; }
  [data-qr-type="barcode"] .qr-controls { min-height: 0; }
  [data-qr-type="barcode"] .qr-row { padding-top: 16px; border-top: 1px solid var(--hairline); }
}
.qr-actions button:disabled { opacity: .45; cursor: not-allowed; }

/* ─────────────────────────  Shortener: more options  ───────────────────────── */
.opt-more { margin-top: 14px; border-top: 1px solid var(--hairline); padding-top: 12px; }
.opt-more summary {
  display: flex; align-items: center; gap: 6px;
  list-style: none; cursor: pointer; user-select: none;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.opt-more summary::-webkit-details-marker { display: none; }
.opt-more summary svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; color: var(--ink-faint); transition: transform var(--t-base) var(--ease); }
[dir="rtl"] .opt-more summary svg { transform: scaleX(-1); }
.opt-more[open] summary svg { transform: rotate(90deg); }
.opt-more-hint { margin-inline-start: auto; font-weight: 400; color: var(--ink-faint); font-size: 12px; }
.opt-more summary:hover .opt-more-hint { color: var(--ink-muted); }
.opt-preview-grid { margin-top: 12px; }
.span-2 { grid-column: span 2; }
.m-preview { margin-top: 14px; }
.m-preview-fields { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.m-preview-fields .hint { margin: 0; }

/* Recent links header: "See all" */
#all-recent { display: inline-flex; align-items: center; gap: 6px; }
#all-recent .count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9999px;
  background: var(--control-bg); color: var(--ink-muted);
  font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums;
}

/* ─────────────────────────  All links dialog  ───────────────────────── */
.dialog.all-links { width: min(560px, calc(100vw - 32px)); }
.al-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 2px 10px; border-bottom: 1px solid var(--hairline); }
.al-check { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.al-check input, .al-row input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); flex: none; }
.al-count { font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.al-list { list-style: none; margin: 0; padding: 4px 0; max-height: min(50vh, 420px); overflow-y: auto; }
.al-list li { display: flex; align-items: center; gap: 4px; border-radius: var(--radius-md); }
.al-list li:hover { background: var(--hover-bg); }
.al-row { flex: 1; min-width: 0; display: grid; grid-template-columns: 16px auto 1fr; align-items: center; gap: 10px; padding: 9px 8px 9px 2px; cursor: pointer; }
.al-short { font-weight: 600; font-size: 14px; white-space: nowrap; }
.al-row .r-long { min-width: 0; font-size: 13px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-list li:has(input:checked) { background: color-mix(in srgb, var(--primary) 7%, transparent); }
.al-hint { margin-top: 10px; }
.all-links .dialog-foot { margin-top: 14px; }
.al-clear { color: var(--ink-muted); }
.al-clear.confirm { color: var(--danger); }
.all-links .error { margin: 10px 0 0; text-align: start; }
.all-links button:disabled { opacity: .45; cursor: not-allowed; }

/* ─────────────────────────  Temp mail: promo  ─────────────────────────
   One line under the inbox hint, same size and colour as the hint itself */
.promo { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 6px; margin: 6px 2px 0; font-size: 12px; color: var(--ink-faint); text-decoration: none; }
.promo-cta { color: var(--ink-muted); font-weight: 500; text-decoration: underline; text-decoration-color: var(--hairline); text-underline-offset: 3px; }
.promo:hover .promo-cta { color: var(--ink); text-decoration-color: currentColor; }
.promo-cta svg { display: none; }
.promo-left { font-variant-numeric: tabular-nums; }
.promo-left::before { content: "· "; }
.promo-left:empty { display: none; }

/* ─────────────────────────  Shared bits for the new pages  ───────────────────────── */
.section-label { margin: 0 0 10px; font-size: 12px; font-weight: 600; color: var(--ink-muted); letter-spacing: .02em; text-transform: uppercase; }
.field textarea {
  width: 100%; min-height: 64px; padding: 8px 10px; resize: vertical;
  border: 1px solid var(--field-border); border-radius: var(--radius-md);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; line-height: 1.45; outline: 0;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus-ring); }
.field-note { min-height: 16px; font-size: 12px; color: var(--ink-faint); }
.field-note.good { color: var(--success); }
.field-note.bad { color: var(--error); }
.field input:disabled { color: var(--ink-muted); background: var(--control-bg); }
.prefix-input:has(input:disabled) { background: var(--control-bg); }
.prefix-input.suffix .suffix-text { padding-inline-end: 10px; color: var(--ink-faint); font-size: 14px; white-space: nowrap; }

/* ─────────────────────────  Developers  ───────────────────────── */
.page-main.doc { max-width: 820px; padding-top: 40px; }
.doc-head h1 { margin: 0; font-size: 40px; letter-spacing: -0.025em; }
.doc-head .lede { margin: 10px 0 0; max-width: 560px; color: var(--ink-muted); }
.doc-toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 28px 0 8px; }
.doc-toc a {
  padding: 5px 11px; border-radius: 9999px; background: var(--control-bg);
  color: var(--ink-2); font-size: 13px; font-weight: 500; text-decoration: none;
  transition: background-color var(--t-fast) var(--ease);
}
.doc-toc a:hover { background: var(--hover-bg); color: var(--ink); }
.doc-sec { padding-top: 40px; scroll-margin-top: 16px; }
.doc-sec h2 { margin: 0 0 10px; font-size: 22px; letter-spacing: -0.015em; }
.doc-sec p, .doc-sec li { color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.doc-sec ul { padding-inline-start: 20px; }
.doc code { font-family: var(--mono); font-size: .88em; }
.doc :not(pre) > code { padding: 1px 5px; border-radius: 4px; background: var(--control-bg); color: var(--ink); }
pre.code {
  margin: 14px 0; padding: 14px 16px; overflow-x: auto;
  border: 1px solid var(--hairline); border-radius: var(--radius-lg);
  background: #111214; color: #e6e6e8;
  font-size: 13px; line-height: 1.6; tab-size: 2;
}
pre.code.out { background: var(--surface); color: var(--ink-2); }
[data-theme="dark"] pre.code { background: #08090b; }
[data-theme="dark"] pre.code.out { background: var(--surface); }
.endpoint { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 22px 0 6px; font-size: 15px; }
.endpoint code { font-weight: 600; }
.endpoint .sep { color: var(--ink-faint); }
.verb {
  display: inline-block; min-width: 54px; padding: 2px 7px; border-radius: 5px;
  font: 600 11px/18px var(--mono); letter-spacing: .03em; text-align: center;
  background: var(--control-bg); color: var(--ink-muted);
}
.verb.post { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }
.verb.delete { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.table-wrap { overflow-x: auto; margin: 12px 0; border: 1px solid var(--hairline); border-radius: var(--radius-lg); background: var(--surface); }
.params { width: 100%; border-collapse: collapse; font-size: 14px; }
.params th, .params td { padding: 9px 14px; text-align: start; vertical-align: top; border-top: 1px solid var(--hairline); }
.params th { border-top: 0; font-size: 12px; font-weight: 600; color: var(--ink-muted); }
.params td:first-child { white-space: nowrap; }
.params td:nth-child(2) { color: var(--ink-faint); white-space: nowrap; font-size: 13px; }
.key-card { margin-top: 16px; padding: 16px; box-shadow: var(--shadow-sm); }
.key-row { display: flex; align-items: flex-end; gap: 10px; }
.key-row .field { flex: 1; }
.key-row .btn-primary { height: 36px; }
.key-out { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-md); background: var(--control-bg); }
.key-out code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.key-card .hint { margin: 10px 0 0; }
.key-card .error { margin: 10px 0 0; text-align: start; }
.bookmarklets { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 6px; }
.bookmarklet {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: 9999px; background: var(--ink); color: var(--canvas);
  font-size: 14px; font-weight: 600; text-decoration: none; cursor: grab; box-shadow: var(--shadow-md);
}
.bookmarklet:active { cursor: grabbing; }
.bookmarklet svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 640px) {
  .doc-head h1 { font-size: 30px; }
  .key-row { flex-direction: column; align-items: stretch; }
}

.ce-mine-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }

/* ─────────────────────────  Personal addresses (/custom-email)  ───────────────────────── */
.page-main.ce-main { max-width: 720px; padding-top: 48px; }
.ce-hero { text-align: center; }
.ce-eyebrow { margin: 0 0 14px; font-size: 13px; font-weight: 600; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.ce-hero h1 { margin: 0; font-size: 48px; line-height: 1.08; letter-spacing: -0.035em; }
.ce-at { color: var(--primary); }
.ce-hero .lede { max-width: 520px; margin: 14px auto 0; font-size: 17px; color: var(--ink-muted); }
.ce-meter { max-width: 340px; margin: 26px auto 0; }
.ce-meter-bar { height: 6px; border-radius: 9999px; background: var(--control-bg); overflow: hidden; }
.ce-meter-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--ink); transition: width 900ms var(--ease); }
.ce-meter-text { margin: 8px 0 0; font-size: 13px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.ce-meter-text strong { color: var(--ink); }
.ce-mine { margin: 32px 0 -12px; }
.ce-mine-list .ce-mine-item {
  height: 32px; padding: 0 12px; border: 1px solid var(--hairline); border-radius: 9999px;
  background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.ce-mine-list .ce-mine-item.current { border-color: var(--primary); color: var(--ink); box-shadow: 0 0 0 3px var(--focus-ring); }
.ce-mine-list li { display: flex; align-items: center; }
.ce-card { margin-top: 36px; padding: 28px; box-shadow: var(--shadow-md); }
.ce-step { display: flex; flex-direction: column; gap: 18px; }
.ce-steps { display: flex; gap: 6px; margin: 0 0 4px; padding: 0; list-style: none; counter-reset: st; }
.ce-steps li {
  counter-increment: st; flex: 1; padding-top: 10px; border-top: 2px solid var(--hairline);
  font-size: 12px; font-weight: 600; color: var(--ink-faint);
}
.ce-steps li::before { content: counter(st) "  "; font-variant-numeric: tabular-nums; }
.ce-steps li.on { border-color: var(--primary); color: var(--ink); }
.ce-steps li.done { border-color: var(--ink); color: var(--ink-muted); }
.ce-name { height: 48px !important; }
.ce-name input { font-size: 18px !important; font-weight: 600; }
.ce-name .suffix-text { font-size: 18px !important; font-weight: 600; color: var(--ink-faint); }
.ce-price {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius-lg); background: var(--canvas); border: 1px solid var(--hairline);
}
.ce-price-amount { display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.ce-price-note { font-size: 13px; color: var(--ink-faint); }
.ce-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
  border-radius: 9999px; background: var(--control-bg); color: var(--ink-2);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.ce-chip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; color: #7b3fe4; }
.ce-go { height: 46px; font-size: 15px; }
.ce-fine { margin: 0; font-size: 12px; color: var(--ink-faint); text-align: center; }
.ce-fine a { color: inherit; }
.ce-for { margin: 0; font-size: 14px; color: var(--ink-muted); }
.ce-for strong { color: var(--ink); }
.ce-pay { display: grid; grid-template-columns: 196px 1fr; gap: 24px; align-items: center; }
.ce-qr { padding: 10px; border-radius: var(--radius-lg); background: #fff; box-shadow: 0 0 0 1px var(--hairline); }
.ce-qr svg { display: block; width: 100%; height: auto; }
.ce-details { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.ce-details dt { font-size: 12px; font-weight: 600; color: var(--ink-muted); margin-bottom: 4px; }
.ce-details dd { margin: 0; }
.ce-copyable { display: flex; align-items: center; gap: 10px; }
.ce-amount { font: 700 28px/1.1 var(--mono); letter-spacing: -0.02em; color: var(--ink); }
.ce-wallet { flex: 1; min-width: 0; font: 500 13px/1.45 var(--mono); color: var(--ink-2); overflow-wrap: anywhere; }
.ce-status {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-radius: var(--radius-md); background: var(--control-bg); font-size: 14px; color: var(--ink-2);
}
.ce-status .field-spinner { margin: 0; opacity: 1; animation: spin 0.7s linear infinite; }
.ce-timer { color: var(--ink-faint); font-variant-numeric: tabular-nums; margin-inline-start: 4px; }
.ce-notes { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-muted); }
.ce-notes strong { color: var(--ink-2); }
.ce-cancel { align-self: center; color: var(--ink-faint); font-size: 13px; }
.ce-cancel.confirm { color: var(--danger); }
.ce-state { text-align: center; padding: 8px 0 4px; }
.ce-state h2 { margin: 14px 0 0; font-size: 24px; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.ce-sub { margin: 6px 0 0; color: var(--ink-muted); font-size: 15px; }
.ce-icon { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--control-bg); color: var(--ink-muted); }
.ce-icon.ok { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.ce-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ce-callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-lg); border: 1px solid var(--hairline); background: var(--canvas); }
.ce-callout svg { flex: none; width: 20px; height: 20px; margin-top: 2px; fill: none; stroke: var(--primary); stroke-width: 1.8; stroke-linejoin: round; }
.ce-callout p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.55; }
.ce-change summary { cursor: pointer; font-size: 13px; color: var(--ink-muted); width: fit-content; }
.ce-change form { margin-top: 10px; }
.ce-change .hint { margin-top: 8px; }
.ce-live-actions { display: flex; align-items: center; justify-content: center; gap: 12px; }
.ce-forwarded { font-size: 13px; color: var(--ink-faint); }
.ce-pending { margin: 0; padding: 10px 12px; border-radius: var(--radius-md); background: var(--control-bg); font-size: 13px; color: var(--ink-muted); text-align: center; }
@media (max-width: 640px) {
  .page-main.ce-main { padding-top: 28px; }
  .ce-hero h1 { font-size: 34px; }
  .ce-card { padding: 18px; margin-top: 28px; }
  .ce-pay { grid-template-columns: 1fr; }
  .ce-qr { width: 200px; margin: 0 auto; }
  .ce-amount { font-size: 24px; }
}

/* Stats: CSV button icon */
.stats-actions .btn-utility .ic svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Fourth tab (link in bio): a shorter label on phones */
.tab-short { display: none; }
@media (max-width: 480px) { .tab-long { display: none; } .tab-short { display: inline; } }

/* Link in bio: shared pickers */
.f-sans { font-family: var(--font); }
.f-serif { font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif; }
.f-mono { font-family: var(--mono); }
.f-rounded { font-family: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito", system-ui, sans-serif; }
.shape-ic { display: block; width: 14px; height: 14px; border: 1.5px solid currentColor; }
.bf-accent { display: flex; align-items: center; gap: 10px; }
.accent-chip {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 6px;
  border: 1px solid var(--field-border); border-radius: 9999px; background: var(--surface);
  font-size: 13px; color: var(--ink-muted); cursor: pointer; font-variant-numeric: tabular-nums;
}
.accent-chip::before {
  content: ""; width: 20px; height: 20px; border-radius: 50%;
  background: conic-gradient(from 90deg, #f43f5e, #f59e0b, #22c55e, #06b6d4, #6366f1, #d946ef, #f43f5e);
}
.accent-chip.set::before { background: var(--chip); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.accent-chip.set { color: var(--ink); }
.accent-chip input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

/* Theme picker: each swatch is a little type specimen of the theme */
.theme-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.tp {
  width: auto; height: 44px; padding: 0; border-radius: 8px;
  border: 1px solid rgba(0,0,0,.08); box-shadow: none;
  font: 600 15px/1 var(--font); letter-spacing: -0.01em;
  transition: box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.tp:hover { transform: translateY(-1px); }
.tp[aria-checked="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
[data-theme="dark"] .tp { border-color: rgba(255,255,255,.1); }
.tp-mono { border: 1.5px solid #000; }
.tp-paper { background: #f4f1ea; color: #1a1916; }
.tp-ink { background: #121211; color: #f2efe8; }
.tp-sand { background: #e9dcc6; color: #2b2117; }
.tp-sage { background: #dde3d4; color: #1d2719; }
.tp-lilac { background: #e3dcf3; color: #221a38; }
.tp-cobalt { background: #1d3ccf; color: #ffffff; }
.tp-tomato { background: #e5452a; color: #fff8f1; }
.tp-forest { background: #1b3124; color: #edf2e9; }
.tp-night { background: #0d1222; color: #e9ecf6; }
.tp-mono { background: #ffffff; color: #000000; }


/* Under a fresh short link: the "+" stats trick */
.result-tip { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; margin: 10px 4px 0; font-size: 13px; color: var(--ink-muted); }
.result-tip svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.result-tip a { color: var(--ink); font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums; }
.result-tip a strong { color: var(--primary); font-weight: 700; padding-inline-start: 1px; }
.result-tip a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ─────────────────────────  Link in bio builder (/link-in-bio)  ─────────────────────────
   Claim a name, then a two-pane app: editor tabs on the left, the page on the right. */
.page-main.bb { max-width: 1080px; padding-top: 24px; }

/* Claim */
.bb-claim { max-width: 560px; margin: 0 auto; padding: 56px 0 24px; text-align: center; }
.bb-claim h1 { margin: 0; font-size: 44px; line-height: 1.08; letter-spacing: -0.035em; }
.bb-claim .lede { margin: 14px auto 0; max-width: 440px; font-size: 17px; color: var(--ink-muted); }
.claim {
  display: flex; align-items: center; gap: 6px; margin: 32px auto 0; padding: 6px;
  border: 1px solid var(--field-border); border-radius: 9999px; background: var(--surface); box-shadow: var(--shadow-md);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.claim:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--focus-ring), var(--shadow-md); }
.claim-field { flex: 1; min-width: 0; display: flex; align-items: center; padding-inline-start: 16px; font-size: 18px; cursor: text; }
.claim-prefix { color: var(--ink-faint); white-space: nowrap; }
.claim-field input { flex: 1; min-width: 0; height: 44px; border: 0; outline: 0; background: none; font: 600 18px/1 var(--font); color: var(--ink); }
.claim .btn-primary { height: 44px; padding: 0 22px; border-radius: 9999px; }
.claim-note { min-height: 20px; margin: 10px 0 0; font-size: 13px; color: var(--ink-faint); }
.claim-note.good { color: var(--success); }
.claim-note.bad { color: var(--error); }
.claim-points { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 18px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink-muted); }
.claim-points li::before { content: "✓"; margin-inline-end: 6px; color: var(--success); font-weight: 700; }

/* Top bar */
.bb-bar { display: flex; align-items: center; gap: 12px; padding: 4px 0 16px; }
.bb-pages { position: relative; }
.bb-current {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px 0 14px;
  border: 1px solid var(--hairline); border-radius: 9999px; background: var(--surface);
  font-size: 14px; font-weight: 650; color: var(--ink); box-shadow: var(--shadow-sm);
}
.bb-current svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; color: var(--ink-faint); }
.bb-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 240px; padding: 6px;
  border: 1px solid var(--hairline); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg);
}
.bb-menu hr { margin: 6px 4px; border: 0; border-top: 1px solid var(--hairline); }
.bb-menu-item { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-md); background: none; text-align: start; font-size: 14px; color: var(--ink); }
.bb-menu-item:hover, .bb-menu-item:focus-visible { background: var(--hover-bg); outline: 0; }
.bb-menu-item[aria-checked="true"] { font-weight: 650; }
.bb-menu-item[aria-checked="true"]::after { content: " ✓"; color: var(--primary); }
.bb-menu-new { color: var(--primary); font-weight: 600; }
.bb-status { margin-inline-start: auto; font-size: 13px; color: var(--ink-faint); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.bb-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .7; }
.bb-status.saved::before { background: var(--success); opacity: 1; }
.bb-status.saving::before { animation: sk-pulse 1s ease-in-out infinite; }
.bb-status.error { color: var(--error); }
.bb-bar-actions { display: flex; gap: 8px; }
.bb-bar-actions .btn-utility svg { width: 14px; height: 14px; }

/* Layout */
.bb-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
.bb-editor { min-width: 0; }
.bb-tabs { display: flex; gap: 2px; margin-bottom: 18px; border-bottom: 1px solid var(--hairline); }
.bb-tabs button {
  position: relative; padding: 10px 14px 12px; border: 0; background: none;
  font-size: 14px; font-weight: 600; color: var(--ink-faint);
  transition: color var(--t-fast) var(--ease);
}
.bb-tabs button:hover { color: var(--ink-2); }
.bb-tabs button[aria-selected="true"] { color: var(--ink); }
.bb-tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--ink); }
.bb-pane { display: flex; flex-direction: column; gap: 18px; animation: fade-in var(--t-base) var(--ease); }
.bb-pane[hidden] { display: none; }

/* Links */
.bb-add { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.bb-add .btn-primary, .bb-add .btn-utility { height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.bb-add .btn-primary { border-radius: 9999px; font-size: 15px; }
.bb-add .btn-utility { border-radius: 9999px; padding: 0 18px; }
.bb-add svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.lc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.lc {
  display: grid; grid-template-columns: 24px 34px minmax(0, 1fr) auto; align-items: start; gap: 10px;
  padding: 14px 14px 12px 8px; border: 1px solid var(--hairline); border-radius: 14px; background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: opacity var(--t-base) var(--ease), border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.lc:focus-within { border-color: var(--field-border); }
.lc.dragging { position: relative; z-index: 5; box-shadow: var(--shadow-lg); border-color: var(--field-border); transition: none; }
.lc.leaving { opacity: 0; }
.lc.is-hidden { background: var(--canvas); }
.lc.is-hidden .lc-body, .lc.is-hidden .lc-glyph { opacity: .45; }
.lc.invalid { border-color: var(--error); box-shadow: 0 0 0 3px color-mix(in srgb, var(--error) 15%, transparent); }
.lc-btn { display: grid; place-items: center; padding: 0; border: 0; background: none; color: var(--ink-faint); border-radius: 6px; }
.lc-btn:hover { color: var(--ink); background: var(--hover-bg); }
.lc-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lc-drag { width: 24px; height: 34px; cursor: grab; touch-action: none; }
.lc-drag svg { fill: currentColor; stroke: none; }
.lc.dragging .lc-drag { cursor: grabbing; }
.lc-glyph {
  position: relative; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  background: var(--control-bg); color: var(--ink-muted);
}
.lc-glyph svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lc-glyph img { position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; border-radius: 4px; object-fit: contain; opacity: 0; }
.lc-glyph.has-fav img { opacity: 1; }
.lc-glyph.has-fav svg { opacity: 0; }
.lc-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lc-body input {
  width: 100%; height: 30px; padding: 0 8px; margin-inline-start: -8px; border: 1px solid transparent; border-radius: 7px;
  background: transparent; color: var(--ink); outline: 0; transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.lc-body input:hover { background: var(--hover-bg); }
.lc-body input:focus { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px var(--focus-ring); }
.lc-title { font-size: 15px; font-weight: 650; }
.lc-url { font-size: 13px; color: var(--ink-muted) !important; }
.lc-title::placeholder, .lc-url::placeholder { color: var(--ink-faint); font-weight: 500; }
.lc-tools { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.lc-hl, .lc-showwrap {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 9px;
  border-radius: 9999px; background: var(--control-bg); font-size: 12px; font-weight: 600; color: var(--ink-muted);
}
.lc-hl svg { width: 14px; height: 14px; }
.lc-hl[aria-pressed="true"] { background: color-mix(in srgb, #e8a400 16%, transparent); color: #a87400; }
[data-theme="dark"] .lc-hl[aria-pressed="true"] { color: #f2c14e; }
.lc-hl[aria-pressed="true"] svg { fill: currentColor; }
.lc-showwrap select { height: 28px; padding: 0 4px 0 0; border: 0; background: transparent; font: inherit; color: var(--ink-2); cursor: pointer; outline: 0; }
.lc-showwrap:focus-within { box-shadow: 0 0 0 2px var(--focus-ring); }
.lc-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 18px; align-self: stretch; }
.lc-del { width: 30px; height: 30px; }
.lc-del:hover { color: var(--danger); }
.lc.as-icon .lc-glyph { box-shadow: 0 0 0 1.5px var(--ink-faint); border-radius: 50%; }
/* Section headers: one line */
.lc-header { align-items: center; padding-block: 10px; background: var(--canvas); box-shadow: none; }
.lc-header .lc-side { flex-direction: row; align-items: center; gap: 8px; align-self: center; }
.lc-glyph-h { background: none; }
.lc-header .lc-title { font-size: 13px; letter-spacing: .02em; color: var(--ink-muted); }
.bb-empty { padding: 36px 24px; border: 1px dashed var(--field-border); border-radius: 14px; text-align: center; color: var(--ink-muted); font-size: 14px; }
.bb-empty p { margin: 0 auto; max-width: 380px; }
.bb-empty-title { margin-bottom: 6px !important; font-weight: 650; color: var(--ink); font-size: 15px; }

/* Profile */
.bb-photo { display: flex; align-items: center; gap: 18px; }
.bb-avatar {
  position: relative; display: grid; place-items: center; width: 96px; height: 96px; padding: 0; flex: none;
  border: 1px dashed var(--field-border); border-radius: 50%; background: var(--control-bg); color: var(--ink-faint); overflow: hidden;
}
.bb-avatar.filled { border-style: solid; border-color: var(--hairline); }
.bb-avatar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; transition: opacity var(--t-fast) var(--ease); }
.bb-avatar.filled svg { position: absolute; padding: 36px; width: 100%; height: 100%; color: #fff; background: rgba(0,0,0,.35); opacity: 0; }
.bb-avatar.filled:hover svg, .bb-avatar.filled:focus-visible svg { opacity: 1; }
.bb-avatar-img { position: absolute; inset: 0; display: grid; place-items: center; background: center / cover no-repeat; font-size: 44px; }
.bb-photo-actions { display: flex; align-items: center; gap: 12px; }
.bb-count { float: inline-end; font-weight: 500; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

/* Design */
.bb-group { display: flex; flex-direction: column; gap: 10px; }
.bb-label { margin: 0; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.bb-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
.bb-cols .segmented { align-self: flex-start; }
.bb-pane .theme-picker { grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); }
.tp-custom { display: grid; place-items: center; background: var(--control-bg); color: var(--ink-muted); border: 1px dashed var(--field-border); }
.tp-custom svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.tp-custom[aria-checked="true"] svg { filter: drop-shadow(0 0 1px rgba(0,0,0,.3)); }
.bb-custom { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; padding: 12px; border-radius: 12px; background: var(--control-bg); }
.cc { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 6px; border-radius: 9px; background: var(--surface); font-size: 13px; font-weight: 550; color: var(--ink-2); cursor: pointer; }
.cc input[type="color"] { width: 28px; height: 28px; padding: 0; border: 1px solid var(--hairline); border-radius: 7px; background: none; cursor: pointer; flex: none; }
.cc input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.cc input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 6px; }
.cc input[type="color"]::-moz-color-swatch { border: 0; border-radius: 6px; }
.cc .switch { margin-inline-start: auto; }
.cc.off input[type="color"] { opacity: .35; }
.style-picker, .font-picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.style-picker button, .font-picker button {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 6px 10px;
  border: 1px solid var(--hairline); border-radius: 12px; background: var(--surface);
  font-size: 12px; font-weight: 600; color: var(--ink-muted);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.style-picker button:hover, .font-picker button:hover { border-color: var(--field-border); }
.style-picker button[aria-checked="true"], .font-picker button[aria-checked="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); color: var(--ink); }
.sp { display: block; width: 100%; max-width: 74px; height: 18px; border-radius: 5px; }
.sp-fill { background: var(--control-bg); border: 1px solid var(--hairline); }
.sp-outline { border: 1.5px solid var(--ink-2); }
.sp-shadow { background: var(--surface); box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.sp-hard { border: 1.5px solid var(--ink-2); box-shadow: 3px 3px 0 var(--ink-2); border-radius: 2px; }
.font-picker b { font-size: 22px; line-height: 1; color: var(--ink); font-weight: 600; }
.font-picker .f-serif b { font-weight: 500; }
.shape-ic.pill { width: 20px; border-radius: 9999px; }
.bb-toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid var(--hairline); border-radius: 12px; cursor: pointer; }
.bb-toggle > span { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--ink-muted); }
.bb-toggle strong { font-size: 14px; color: var(--ink); }

/* Settings */
.bb-card { display: flex; flex-direction: column; gap: 12px; padding: 18px; border: 1px solid var(--hairline); border-radius: 14px; background: var(--surface); }
.bb-card .hint { margin: 0; }
.bb-card > .btn-utility { align-self: flex-start; }
.bb-card-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.bb-link { display: inline-block; margin-top: 4px; font-size: 18px; font-weight: 650; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.bb-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.bb-views { display: flex; flex-direction: column; align-items: flex-end; font-size: 12px; color: var(--ink-faint); }
.bb-views strong { font-size: 22px; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.bb-share { display: flex; gap: 16px; align-items: center; padding-top: 12px; border-top: 1px solid var(--hairline); }
.bb-qr { flex: none; width: 112px; padding: 6px; border-radius: 10px; background: #fff; box-shadow: 0 0 0 1px var(--hairline); }
.bb-qr svg { display: block; width: 100%; height: auto; }
.bb-share-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bb-share-actions .hint { flex-basis: 100%; }
.bb-share-actions svg { width: 15px; height: 15px; }
.bb-danger { flex-direction: row; align-items: center; justify-content: space-between; border-color: color-mix(in srgb, var(--danger) 30%, var(--hairline)); }
.bb-danger .btn-danger { flex: none; }

/* Preview: the page at phone width, scaled into the frame */
.bb-preview { position: sticky; top: 20px; }
.bb-phone {
  position: relative; width: 100%; aspect-ratio: 390 / 760; overflow: hidden;
  border-radius: 28px; box-shadow: 0 0 0 1px var(--hairline), 0 0 0 7px var(--surface), 0 0 0 8px var(--hairline), var(--shadow-lg);
  background: var(--canvas);
}
.bb-phone iframe { position: absolute; top: 0; left: 0; width: 390px; border: 0; transform-origin: 0 0; background: transparent; }
.bb-preview-btn { display: none; }
.bb-sheet { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0; background: var(--canvas); }
.bb-sheet::backdrop { background: rgba(0,0,0,.5); }
.bb-sheet iframe { display: block; width: 100%; height: 100%; border: 0; }
.bb-sheet-close {
  position: fixed; top: 14px; left: 14px; display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--hairline); border-radius: 50%; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-md);
}
.bb-sheet-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

@media (max-width: 900px) {
  .bb-grid { grid-template-columns: 1fr; }
  .bb-preview { display: none; }
  .bb-preview-btn {
    position: fixed; right: 16px; bottom: 16px; z-index: 20; display: inline-flex; align-items: center; gap: 8px;
    height: 46px; padding: 0 18px; border: 0; border-radius: 9999px; background: var(--ink); color: var(--canvas);
    font-size: 14px; font-weight: 650; box-shadow: var(--shadow-lg);
  }
  .bb-preview-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
  .bb-app { padding-bottom: 64px; }
}
@media (max-width: 600px) {
  .bb-claim { padding-top: 32px; }
  .bb-claim h1 { font-size: 32px; }
  .claim-field, .claim-field input { font-size: 16px; }
  .claim-field { padding-inline-start: 12px; }
  .claim .btn-primary { padding: 0 16px; }
  .bb-bar { flex-wrap: wrap; }
  .bb-status { order: 3; width: 100%; margin: 0; }
  .bb-bar-actions { margin-inline-start: auto; }
  .bb-tabs { overflow-x: auto; scrollbar-width: none; }
  .bb-tabs button { padding-inline: 10px; flex: none; }
  .bb-add { grid-template-columns: 1fr; }
  .lc { grid-template-columns: 20px 30px minmax(0, 1fr) auto; gap: 8px; padding-inline-end: 10px; }
  .lc-glyph { width: 30px; height: 30px; }
  .lc-tools { flex-wrap: wrap; }
  .bb-cols, .style-picker, .font-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bb-cols { grid-template-columns: 1fr; }
  .bb-share { flex-direction: column; align-items: flex-start; }
  .bb-danger { flex-direction: column; align-items: flex-start; }
}
