/* iauth · technical, calm, high-trust · deep ink + one green signal, Geist + Geist Mono, self-hosted */
/* critique: show the product (live codes) instead of describing it; every colour and face is a token; motion is transform/opacity only */

@font-face {
  font-family: 'Geist';
  src: url('/fonts/geist.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('/fonts/geist-mono.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f6f5f1;
  --bg-glow: rgb(31 122 86 / 0.1);
  --grid: rgb(20 30 25 / 0.05);
  --surface: rgb(255 255 255 / 0.78);
  --surface-solid: #ffffff;
  --surface-2: #f0efea;
  --ink: #0f1512;
  --ink-2: #47524c;
  --ink-3: #78827c;
  --line: rgb(15 21 18 / 0.09);
  --line-2: rgb(15 21 18 / 0.16);
  --signal: #1a7a55;
  --signal-2: #22966a;
  --signal-ink: #ffffff;
  --signal-soft: rgb(26 122 85 / 0.1);
  --warn: #8d5a00;
  --warn-soft: rgb(196 140 30 / 0.14);
  --danger: #b4291c;
  --danger-soft: rgb(180 41 28 / 0.09);
  --focus: #1a7a55;
  --toast-bg: #0f1512;
  --toast-ink: #f6f5f1;
  --shadow-1: 0 1px 2px rgb(15 21 18 / 0.06);
  --shadow-2: 0 1px 2px rgb(15 21 18 / 0.05), 0 12px 32px -12px rgb(15 21 18 / 0.18);
  --shadow-3: 0 2px 4px rgb(15 21 18 / 0.05), 0 30px 60px -20px rgb(15 21 18 / 0.3);
  --av-1: #1a7a55;
  --av-2: #2f5fd0;
  --av-3: #b4501c;
  --av-4: #8a3fb8;
  --av-5: #a3266a;
  --av-6: #0e7c8a;
  --av-ink: #ffffff;
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --r-1: 10px;
  --r-2: 16px;
  --r-3: 24px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #090c0b;
    --bg-glow: rgb(52 211 145 / 0.13);
    --grid: rgb(255 255 255 / 0.035);
    --surface: rgb(22 27 25 / 0.72);
    --surface-solid: #131816;
    --surface-2: #1b211e;
    --ink: #eef2ef;
    --ink-2: #a9b3ad;
    --ink-3: #737d77;
    --line: rgb(255 255 255 / 0.08);
    --line-2: rgb(255 255 255 / 0.14);
    --signal: #3ddc97;
    --signal-2: #6ff0b6;
    --signal-ink: #04130c;
    --signal-soft: rgb(61 220 151 / 0.12);
    --warn: #f0c060;
    --warn-soft: rgb(240 192 96 / 0.12);
    --danger: #ff8a7a;
    --danger-soft: rgb(255 138 122 / 0.1);
    --focus: #6ff0b6;
    --toast-bg: #eef2ef;
    --toast-ink: #090c0b;
    --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-2: 0 1px 2px rgb(0 0 0 / 0.4), 0 16px 40px -16px rgb(0 0 0 / 0.8);
    --shadow-3: 0 2px 4px rgb(0 0 0 / 0.4), 0 40px 80px -24px rgb(0 0 0 / 0.9);
    --av-1: #2a9d6e;
    --av-2: #4a78e0;
    --av-3: #d0682e;
    --av-4: #9c58cc;
    --av-5: #c0397f;
    --av-6: #1a98a8;
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  overflow-x: clip;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  font: 16px/1.55 var(--font);
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  background-color: var(--bg);
  background-image:
    radial-gradient(60rem 40rem at 85% -10%, var(--bg-glow), transparent 60%),
    radial-gradient(40rem 30rem at -10% 110%, var(--bg-glow), transparent 60%),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size:
    auto,
    auto,
    48px 48px,
    48px 48px;
  background-attachment: fixed;
}
h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  overflow-wrap: break-word;
  min-width: 0;
}
h1 {
  font-size: 1.75rem;
}
h2 {
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}
h3 {
  font-size: 1rem;
}
p {
  margin: 0;
}
.hint {
  color: var(--ink-3);
  font-size: 0.9rem;
}
.lead {
  color: var(--ink-2);
  font-size: 1.05rem;
}
::selection {
  background: var(--signal-soft);
}

/* ---------- brand ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.logo {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(160deg, var(--signal-2), var(--signal));
  color: var(--signal-ink);
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.25),
    0 6px 16px -6px var(--signal);
}

/* ---------- welcome ---------- */
.welcome {
  min-height: 100dvh;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
}
.welcome-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}
.welcome-copy {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 500px;
}
.welcome-copy h1 {
  font-size: clamp(2.4rem, 5vw, 3.9rem);
  letter-spacing: -0.045em;
  line-height: 1.02;
  font-weight: 650;
}
.welcome-copy .lead {
  font-size: 1.15rem;
  max-width: 34ch;
}
.cta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.facts {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
  color: var(--ink-2);
  font-size: 0.95rem;
}
.facts li {
  display: flex;
  align-items: center;
  gap: 10px;
}
.facts .icon {
  color: var(--signal);
}
.welcome-foot {
  color: var(--ink-3);
  font-size: 0.85rem;
}
.showcase {
  position: relative;
  min-height: 440px;
  display: grid;
  place-items: center;
}
.showcase::before {
  content: '';
  position: absolute;
  inset: 8% 6%;
  border-radius: 40px;
  background: radial-gradient(closest-side, var(--bg-glow), transparent);
  filter: blur(10px);
}
.stack {
  position: relative;
  width: min(100%, 400px);
  display: grid;
  gap: 14px;
}
.stack .code-card {
  box-shadow: var(--shadow-3);
  cursor: default;
}
.stack .code-card:nth-child(1) {
  transform: translateX(-18px) rotate(-1.5deg);
}
.stack .code-card:nth-child(2) {
  transform: translateX(22px);
}
.stack .code-card:nth-child(3) {
  transform: translateX(-6px) rotate(1deg);
}
.showcase {
  align-content: center;
  gap: 28px;
}
.showcase-label {
  position: relative;
  font-size: 0.82rem;
  color: var(--ink-3);
  text-align: center;
}

/* auth panels (sign up / recover) */
.panel {
  width: min(100%, 440px);
  margin: 0 auto;
  align-self: center;
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-3);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.panel form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.panel h1 {
  font-size: 1.6rem;
}
.center-card {
  width: min(100%, 440px);
  margin: 12vh auto 0;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-3);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.app-root {
  min-height: 100dvh;
}

/* ---------- app shell ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 12px 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}
.topbar-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}
.segmented {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.seg {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 550;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 160ms var(--ease),
    color 160ms var(--ease);
}
.seg:hover {
  color: var(--ink);
}
.seg[aria-selected='true'] {
  background: var(--surface-solid);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.9rem;
  font-weight: 550;
  max-width: 220px;
}
.chip span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avatar-sm {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: var(--signal);
  color: var(--signal-ink);
  font-size: 0.78rem;
  font-weight: 700;
  flex: none;
}
.content {
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-head h1 {
  font-size: 1.9rem;
  letter-spacing: -0.035em;
}
.page-head p {
  color: var(--ink-3);
  margin-top: 4px;
}

/* ---------- controls ---------- */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--surface-solid);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 560;
  letter-spacing: -0.005em;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--shadow-1);
  transition:
    background-color 140ms var(--ease),
    border-color 140ms var(--ease),
    transform 140ms var(--ease),
    opacity 140ms var(--ease);
}
.btn:hover {
  border-color: var(--ink-3);
}
.btn:active {
  transform: translateY(1px) scale(0.99);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.btn.busy {
  cursor: progress;
  opacity: 0.75;
}
.btn.primary {
  background: linear-gradient(180deg, var(--signal-2), var(--signal));
  border-color: transparent;
  color: var(--signal-ink);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.22),
    0 8px 20px -10px var(--signal);
}
.btn.primary:hover {
  border-color: transparent;
  opacity: 0.94;
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--ink-2);
}
.btn.ghost:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.btn.danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  background: transparent;
  box-shadow: none;
}
.btn.danger:hover {
  background: var(--danger-soft);
}
.btn.big {
  min-height: 50px;
  padding: 12px 22px;
  font-size: 1rem;
  border-radius: 14px;
}
.btn.small {
  min-height: 32px;
  padding: 4px 12px;
  font-size: 0.86rem;
  border-radius: 10px;
}
.btn.block {
  width: 100%;
}
.link {
  appearance: none;
  background: none;
  border: 0;
  color: var(--ink-2);
  font: inherit;
  font-size: 0.92rem;
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-underline-offset: 4px;
  cursor: pointer;
  padding: 4px 0;
  align-self: flex-start;
}
.link:hover {
  color: var(--ink);
  text-decoration-color: currentColor;
}
.icon-btn {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  transition:
    background-color 140ms var(--ease),
    color 140ms var(--ease);
}
.icon-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}
label {
  font-weight: 560;
  font-size: 0.9rem;
  color: var(--ink-2);
  margin-top: 4px;
}
input,
textarea,
select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface-solid);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 11px 14px;
  min-height: 46px;
  box-shadow: var(--shadow-1);
  transition:
    border-color 140ms var(--ease),
    box-shadow 140ms var(--ease);
}
input::placeholder,
textarea::placeholder {
  color: var(--ink-3);
}
textarea {
  font-family: var(--mono);
  font-size: 0.95rem;
  resize: vertical;
}
input:hover,
textarea:hover,
select:hover {
  border-color: var(--ink-3);
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--signal);
  box-shadow: 0 0 0 4px var(--signal-soft);
  outline: none;
}
.input-wrap {
  position: relative;
}
.input-wrap .prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}
.input-wrap input {
  padding-left: 40px;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  color: var(--ink);
}
.check input {
  width: 18px;
  height: 18px;
  min-height: 0;
  accent-color: var(--signal);
  box-shadow: none;
}
details summary {
  cursor: pointer;
  color: var(--ink-2);
  font-size: 0.9rem;
  margin-top: 6px;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  transition: none;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.icon {
  flex: none;
}
.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.actions.spread {
  justify-content: space-between;
}
.grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

/* ---------- codes ---------- */
.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.toolbar .input-wrap {
  flex: 1 1 240px;
}
.codes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 14px;
}
.code-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 16px 16px 20px;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    'av meta act'
    'code code side';
  column-gap: 12px;
  row-gap: 14px;
  align-items: center;
  min-width: 0;
  box-shadow: var(--shadow-2);
  transition:
    border-color 160ms var(--ease),
    transform 160ms var(--ease);
}
.code-card:hover {
  border-color: var(--line-2);
  transform: translateY(-2px);
}
.code-card:active {
  transform: translateY(0) scale(0.995);
}
.avatar {
  grid-area: av;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--av-ink);
  background: var(--av-1);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.2);
}
.avatar[data-hue='2'] {
  background: var(--av-2);
}
.avatar[data-hue='3'] {
  background: var(--av-3);
}
.avatar[data-hue='4'] {
  background: var(--av-4);
}
.avatar[data-hue='5'] {
  background: var(--av-5);
}
.avatar[data-hue='6'] {
  background: var(--av-6);
}
.code-meta {
  grid-area: meta;
  min-width: 0;
}
.issuer {
  font-weight: 600;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account {
  color: var(--ink-3);
  font-size: 0.86rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-actions {
  grid-area: act;
  align-self: start;
}
.code {
  grid-area: code;
  font-family: var(--mono);
  font-size: 2.1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.code-side {
  grid-area: side;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-3);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}
.timer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--line);
}
.timer i {
  display: block;
  height: 100%;
  background: var(--signal);
  transform-origin: left center;
  transform: scaleX(var(--p, 1));
  transition: transform 1s linear;
}
.timer.low i {
  background: var(--danger);
}
.timer.reset i {
  transition: none;
}
.copied {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--surface-solid) 86%, transparent);
  color: var(--signal);
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms var(--ease);
}
.code-card.is-copied .copied {
  opacity: 1;
}
.empty {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
  padding: 56px 24px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-3);
  color: var(--ink-2);
  background: var(--surface);
}
.empty .icon {
  color: var(--signal);
}
.empty p {
  max-width: 44ch;
}
.locked {
  text-align: center;
  align-items: center;
}
.locked .btn {
  align-self: stretch;
}
.locked .link {
  align-self: center;
}
.lock-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: var(--signal);
  background: var(--signal-soft);
  margin: 0 auto 4px;
}

/* ---------- sections & lists ---------- */
.section {
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-2);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.section > .btn {
  align-self: flex-start;
  margin-top: 4px;
}
.list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
}
.list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.list li:first-child {
  border-top: 0;
}
.list.compact li {
  padding: 10px 0;
}
.li-main {
  min-width: 0;
  flex: 1 1 240px;
}
.li-title {
  font-weight: 560;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.li-sub {
  color: var(--ink-3);
  font-size: 0.85rem;
  display: flex;
  gap: 2px 14px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 2px;
}
.badge {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.badge.ok {
  background: var(--signal-soft);
  border-color: transparent;
  color: var(--signal);
}

/* ---------- banners, toast, modal ---------- */
.banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: var(--r-2);
  font-size: 0.94rem;
  border: 1px solid transparent;
}
.banner.warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 25%, transparent);
}
.banner.ok {
  background: var(--signal-soft);
  color: var(--signal);
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  background: var(--toast-bg);
  color: var(--toast-ink);
  padding: 11px 18px;
  border-radius: 14px;
  font-weight: 560;
  font-size: 0.94rem;
  box-shadow: var(--shadow-3);
  max-width: calc(100% - 32px);
  z-index: 100;
  transition:
    opacity 180ms var(--ease),
    transform 180ms var(--ease);
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast.err {
  background: var(--danger);
  color: var(--av-ink);
}
.modal {
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  background: var(--surface-solid);
  color: var(--ink);
  padding: 0;
  width: min(480px, calc(100% - 24px));
  max-height: calc(100dvh - 32px);
  box-shadow: var(--shadow-3);
}
.modal[open] {
  animation: modal-in 200ms var(--ease);
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}
.modal.wide {
  width: min(640px, calc(100% - 24px));
}
.modal::backdrop {
  background: rgb(4 8 6 / 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 24px 0;
}
.modal-head h2 {
  font-size: 1.2rem;
}
.modal-body {
  padding: 14px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.modal-body form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.modal-body p {
  color: var(--ink-2);
}
.recovery-key {
  font-family: var(--mono);
  font-size: 1.08rem;
  line-height: 1.8;
  letter-spacing: 0.04em;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px dashed var(--line-2);
  word-break: break-all;
  user-select: all;
  color: var(--ink);
}
.options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
  gap: 10px;
}
.option {
  appearance: none;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border-radius: var(--r-2);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition:
    border-color 140ms var(--ease),
    transform 140ms var(--ease);
}
.option:hover {
  border-color: var(--signal);
  transform: translateY(-1px);
}
.opt-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--signal);
  background: var(--signal-soft);
  margin-bottom: 6px;
}
.opt-title {
  font-weight: 600;
  letter-spacing: -0.01em;
}
.opt-desc {
  color: var(--ink-3);
  font-size: 0.85rem;
  line-height: 1.4;
}
.scanner {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--r-2);
  background: var(--toast-bg);
}
.steps {
  padding-left: 1.2em;
  margin: 0;
  color: var(--ink-2);
}
.steps li {
  margin: 6px 0;
}
.consent-app {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.consent-list {
  margin: 0;
  padding-left: 1.2em;
  color: var(--ink-2);
}
.consent-list li {
  margin: 4px 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }
}

@media (max-width: 900px) {
  .welcome-main {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }
  .showcase {
    min-height: 380px;
  }
}

@media (max-width: 640px) {
  .topbar-inner {
    grid-template-columns: 1fr auto;
    padding: 10px 16px;
  }
  .topbar-inner > .segmented {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    overflow-x: auto;
  }
  .seg {
    flex: 1;
    padding: 7px 10px;
  }
  .chip span:last-child {
    display: none;
  }
  .chip {
    padding: 4px;
  }
  .content {
    padding: 20px 16px 64px;
  }
  .welcome {
    padding: 20px 16px;
  }
  .panel,
  .center-card {
    padding: 24px;
  }
  .center-card {
    margin-top: 4vh;
  }
  .code {
    font-size: 1.85rem;
  }
  .stack .code-card:nth-child(n) {
    transform: none;
  }
}
