:root {
  --font: "Avenir Next", "Segoe UI", "Liberation Sans", system-ui, sans-serif;
  --serif: "Iowan Old Style", Palatino, "Liberation Serif", Georgia, serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(900px 480px at 10% -10%, color-mix(in srgb, var(--glow) 55%, transparent), transparent 60%),
    radial-gradient(700px 420px at 110% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, p { margin: 0; }

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.shell {
  width: min(560px, 100%);
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) 18px calc(28px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.logo {
  width: 52px;
  height: 52px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: var(--on-accent);
  background: linear-gradient(160deg, var(--accent-2), var(--accent));
  box-shadow: var(--shadow);
}

.logo svg { width: 28px; height: 28px; }

.brand h1, .wordmark {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1;
}

.tagline, .lead, .hint, .fine {
  color: var(--muted);
}

.lead { margin-top: 8px; font-size: 18px; }

.hello {
  font-family: var(--serif);
  font-size: clamp(34px, 9vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 8px 0 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  touch-action: manipulation;
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: var(--on-accent);
  font-weight: 700;
}

.btn-ghost {
  background: var(--panel);
  border-color: var(--border);
}

.btn-text {
  min-height: 48px;
  background: transparent;
  color: var(--text-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-xl { width: 100%; font-size: 20px; }
.btn-block { width: 100%; }

.btn:disabled { opacity: 0.55; }

.stack { display: grid; gap: 12px; }

.tiles { display: grid; gap: 14px; margin-top: 22px; }

.tile {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  min-height: 124px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.tile-soon { opacity: 0.92; }

.tile-icon {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 14%, var(--panel-2));
  color: var(--accent);
}

.tile-icon svg { width: 40px; height: 40px; }
.tile-name { display: block; font-size: 26px; font-weight: 750; letter-spacing: -0.02em; }
.tile-tag { display: block; color: var(--muted); margin-top: 2px; }

.badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--panel-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 14px;
  font-weight: 700;
}

.auth-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 18px calc(24px + env(safe-area-inset-bottom));
}

.auth-card {
  width: min(460px, 100%);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.people { display: grid; gap: 12px; margin-top: 22px; }

.person {
  min-height: 84px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.person strong { font-size: 24px; }
.person span { color: var(--muted); font-size: 16px; }

.dots {
  min-height: 36px;
  letter-spacing: 0.4em;
  font-size: 28px;
  text-align: center;
  margin: 8px 0 4px;
}

.pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 8px 0 14px;
}

.pad button {
  min-height: 72px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 28px;
  font-weight: 650;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 14px;
  min-height: 48px;
}

.check input { width: 22px; height: 22px; accent-color: var(--accent); }

.field { display: grid; gap: 8px; margin: 12px 0; }
.field span, .field-label { font-weight: 650; }

input[type="password"], input[type="text"], input[type="search"], textarea {
  width: 100%;
  min-height: 56px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1.5px solid var(--field-border);
  background: var(--field);
  font-size: 18px;
}

textarea { min-height: 76px; resize: vertical; }

.form-error {
  color: var(--danger);
  min-height: 1.4em;
  margin: 4px 0 8px;
  font-weight: 650;
}

.back {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sheet {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--text) 35%, transparent);
  display: grid;
  align-items: end;
  z-index: 20;
  padding: 12px;
}

.sheet-card {
  width: min(560px, 100%);
  margin: 0 auto;
  background: var(--panel);
  border-radius: 24px 24px 18px 18px;
  padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow);
  max-height: min(80dvh, 640px);
  overflow: auto;
}

.choice-grid, .swatches { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; }

.chip, .swatch {
  min-height: 48px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--panel-2);
}

.chip[aria-pressed="true"], .swatch[aria-pressed="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, var(--panel));
  font-weight: 750;
}

.swatch { display: inline-flex; align-items: center; gap: 8px; }
.swatch i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: block;
}

.results { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.results button {
  width: 100%;
  text-align: left;
  min-height: 56px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  padding: 10px 14px;
}

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(440px, calc(100% - 24px));
  display: grid;
  gap: 8px;
  z-index: 30;
}

.toast {
  background: var(--text);
  color: var(--bg);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.foot {
  margin-top: 28px;
  color: var(--muted);
  font-size: 15px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

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