@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/inter/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/inter/inter-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;

  --stone-50: #FAFAF9;
  --stone-100: #F5F5F4;
  --stone-200: #E7E5E4;
  --stone-300: #D6D3D1;
  --stone-500: #78716C;
  --stone-700: #44403C;
  --stone-800: #292524;
  --stone-900: #1C1917;

  --bg: var(--stone-50);
  --surface: #FFFFFF;
  --surface-sunken: var(--stone-100);
  --surface-pressed: var(--stone-200);
  --border: var(--stone-200);
  --border-strong: var(--stone-300);
  --ink: var(--stone-900);
  --ink-soft: var(--stone-700);
  --muted: var(--stone-500);

  --brand: #C4500C;
  --brand-pressed: #A8440A;
  --on-brand: #FFFFFF;
  --vivid: #EE6A1F;
  --vivid-soft: #F9C9A8;
  --teal: #0E8C83;
  --on-vivid: #FFFFFF;

  --toast-bg: var(--stone-900);
  --toast-ink: var(--stone-50);
  --toast-action: #F7A060;

  --danger: #B91C1C;
  --danger-fill: #DC2626;
  --danger-soft: #FCA5A5;
  --danger-surface: #FEF2F2;
  --on-danger: #FFFFFF;

  --status-idea: #64748B;
  --status-purchased: #2563EB;
  --status-wrapped: #9333EA;
  --status-given: #16A34A;
  --chip-tint: 12%;

  --backdrop: rgb(28 25 23 / 0.45);
  --shadow: 0 1px 2px rgb(28 25 23 / 0.05);
  --shadow-raised: 0 -8px 24px rgb(28 25 23 / 0.08);

  --radius: 16px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --touch: 44px;
  --page-max: 640px;
  --gutter: 16px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --bg: var(--stone-900);
    --surface: var(--stone-800);
    --surface-sunken: #24201E;
    --surface-pressed: var(--stone-700);
    --border: var(--stone-700);
    --border-strong: #57534E;
    --ink: var(--stone-50);
    --ink-soft: var(--stone-300);
    --muted: #A8A29E;

    --brand: #F7A060;
    --brand-pressed: #F9B47F;
    --on-brand: var(--stone-900);
    --vivid: #FF8A45;
    --vivid-soft: #9A522A;
    --teal: #2EC4B6;
    --on-vivid: var(--stone-900);

    --toast-bg: var(--stone-50);
    --toast-ink: var(--stone-900);
    --toast-action: #C4500C;

    --danger: #FCA5A5;
    --danger-fill: #EF4444;
    --danger-soft: #7F2A2A;
    --danger-surface: #3A1C1A;
    --on-danger: var(--stone-900);

    --status-idea: #94A3B8;
    --status-purchased: #60A5FA;
    --status-wrapped: #C084FC;
    --status-given: #4ADE80;
    --chip-tint: 20%;

    --backdrop: rgb(0 0 0 / 0.6);
    --shadow: none;
    --shadow-raised: 0 -8px 24px rgb(0 0 0 / 0.35);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p {
  margin: 0;
}

body:has(dialog[open]) {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--brand);
}

img {
  display: block;
}

[hidden] {
  display: none !important;
}

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

h1:focus {
  outline: none;
}

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

.num {
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 14px;
}

.center {
  text-align: center;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.boot {
  padding: 48px 16px;
  text-align: center;
  color: var(--muted);
}

/* Layout */

.app {
  min-height: 100dvh;
}

.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.content {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 8px calc(var(--gutter) + var(--safe-right)) calc(32px + var(--safe-bottom)) calc(var(--gutter) + var(--safe-left));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.has-bottom-bar .content {
  padding-bottom: calc(112px + var(--safe-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding-top: var(--safe-top);
  border-bottom: 1px solid transparent;
}

.topbar-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  min-height: 64px;
  padding: 8px calc(8px + var(--safe-right)) 8px calc(8px + var(--safe-left));
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-symbol {
  width: 32px;
  height: 32px;
  margin: 0 4px 0 8px;
}

.topbar-title {
  flex: 1;
  min-width: 0;
}

.page-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.page-subtitle {
  display: block;
  font-size: 14px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-switch-heading {
  flex: 1;
  min-width: 0;
  display: flex;
  font: inherit;
}

.event-switch {
  flex: 1;
  min-width: 0;
  min-height: var(--touch);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
}

.event-switch:active {
  background: var(--surface-sunken);
}

.event-switch-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.event-switch-chevron {
  color: var(--muted);
}

.icon-btn {
  flex: none;
  width: var(--touch);
  height: var(--touch);
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);
}

.icon-btn:active {
  background: var(--surface-pressed);
}

.icon-btn .icon {
  width: 22px;
  height: 22px;
}

.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  background: var(--bg);
  border-top: 1px solid var(--border);
  box-shadow: var(--shadow-raised);
}

.bottom-bar-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 12px calc(var(--gutter) + var(--safe-right)) calc(12px + var(--safe-bottom)) calc(var(--gutter) + var(--safe-left));
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 120ms ease, opacity 120ms ease;
}

.btn:disabled {
  opacity: 0.55;
  cursor: progress;
}

.btn-primary {
  background: var(--brand);
  color: var(--on-brand);
}

.btn-primary:active:not(:disabled) {
  background: var(--brand-pressed);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--ink);
}

.btn-secondary:active:not(:disabled) {
  background: var(--surface-pressed);
}

.btn-danger {
  background: var(--danger-fill);
  color: var(--on-danger);
}

.btn-danger-ghost {
  background: transparent;
  color: var(--danger);
  border-color: var(--border-strong);
}

.btn-danger-ghost:active {
  background: var(--danger-surface);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  min-height: var(--touch);
  padding: 0 14px;
  font-size: 15px;
}

.btn-sm .icon {
  width: 18px;
  height: 18px;
}

.link-btn {
  min-height: var(--touch);
  padding: 0 4px;
  margin: -12px -4px -12px auto;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-weight: 600;
  font-size: 15px;
}

/* Cards */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.budget-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.budget-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.budget-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.budget-amount {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.budget-head .budget-label {
  flex: none;
}

.budget-head .budget-amount,
.budget-head .budget-none {
  margin-left: auto;
}

.budget-none {
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}

.budget-head .link-btn {
  margin-left: 4px;
}

.bar {
  display: flex;
  height: 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-pressed);
  overflow: hidden;
}

.bar-mini {
  height: 6px;
}

.bar-spent {
  background: var(--vivid);
}

.bar-planned {
  background: var(--vivid-soft);
}

.bar-spent + .bar-planned {
  border-left: 2px solid var(--surface);
}

.bar.is-over .bar-spent {
  background: var(--danger-fill);
}

.bar.is-over .bar-planned {
  background: var(--danger-soft);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: 14px;
  color: var(--muted);
}

.legend strong {
  color: var(--ink);
  font-weight: 600;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.legend-key {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.key-spent {
  background: var(--vivid);
}

.key-planned {
  background: var(--vivid-soft);
}

.legend.is-over .key-spent {
  background: var(--danger-fill);
}

.legend.is-over .key-planned {
  background: var(--danger-soft);
}

.over-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-surface);
  color: var(--danger);
  font-weight: 600;
  font-size: 15px;
}

.tile {
  flex: none;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--vivid);
  color: var(--on-vivid);
}

.tile .icon {
  width: 24px;
  height: 24px;
}

.shortcut-card,
.total-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  color: var(--ink);
  text-decoration: none;
}

.shortcut-card:active {
  background: var(--surface-sunken);
}

.shortcut-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.shortcut-title {
  font-weight: 600;
  font-size: 17px;
}

.shortcut-sub {
  color: var(--muted);
  font-size: 14px;
}

.total-amount {
  font-size: 24px;
  font-weight: 700;
}

.chevron {
  color: var(--muted);
}

/* Sections and lists */

.section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px 0;
}

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  min-width: 0;
}

.section-link {
  color: inherit;
  text-decoration: none;
}

.count {
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list {
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
}

.list > li + li {
  border-top: 1px solid var(--border);
}

.person-row-wrap {
  display: flex;
  align-items: center;
  padding-right: 12px;
}

.person-row {
  flex: 1;
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 14px 16px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
}

.person-row:active {
  background: var(--surface-sunken);
}

.avatar {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
  background: var(--surface-pressed);
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 18px;
}

.avatar-sm {
  width: 36px;
  height: 36px;
  font-size: 15px;
}

.avatar-xs {
  width: 28px;
  height: 28px;
  font-size: 13px;
}

.avatar-add {
  background: transparent;
  border: 1.5px dashed var(--border-strong);
  color: var(--brand);
}

.avatar-add .icon {
  width: 18px;
  height: 18px;
}

.person-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.person-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.person-name {
  font-weight: 600;
  font-size: 17px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.person-figures {
  color: var(--muted);
  font-size: 13px;
}

.person-over {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}

.person-over .icon {
  width: 16px;
  height: 16px;
}

.person-budget {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  color: var(--muted);
  font-size: 13px;
}

.person-budget strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
}

.row-action {
  flex: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.chip-neutral {
  background: var(--surface-sunken);
  color: var(--ink-soft);
}

.tag {
  padding: 0 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  font-size: 12px;
  font-weight: 500;
}

.dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
}

.dot.status-idea { background: var(--status-idea); }
.dot.status-purchased { background: var(--status-purchased); }
.dot.status-wrapped { background: var(--status-wrapped); }
.dot.status-given { background: var(--status-given); }

.status-chip { color: var(--ink); }
.status-chip.status-idea { background: color-mix(in srgb, var(--status-idea) var(--chip-tint), var(--surface)); }
.status-chip.status-purchased { background: color-mix(in srgb, var(--status-purchased) var(--chip-tint), var(--surface)); }
.status-chip.status-wrapped { background: color-mix(in srgb, var(--status-wrapped) var(--chip-tint), var(--surface)); }
.status-chip.status-given { background: color-mix(in srgb, var(--status-given) var(--chip-tint), var(--surface)); }

/* Filters */

.filters {
  display: flex;
  gap: 8px;
  margin: 0 calc(-1 * var(--gutter));
  padding: 2px var(--gutter) 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--touch);
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 15px;
  font-weight: 500;
}

.filter-chip[aria-pressed='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.filter-count {
  color: inherit;
  opacity: 0.7;
}

/* Gifts */

.gift-card {
  overflow: hidden;
}

.gift-main {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.gift-main:active {
  background: var(--surface-sunken);
}

.gift-top {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.gift-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 17px;
  overflow-wrap: anywhere;
}

.gift-price {
  flex: none;
  font-weight: 700;
  font-size: 17px;
}

.gift-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gift-note {
  color: var(--muted);
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.gift-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 16px 14px;
}

.gift-actions .btn-primary {
  flex: 1 1 auto;
  max-width: 260px;
}

/* Empty states */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 24px;
  text-align: center;
}

.empty-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
  color: var(--brand);
}

.empty-icon .icon {
  width: 28px;
  height: 28px;
}

.empty-title {
  font-size: 19px;
  font-weight: 700;
}

.empty-text {
  max-width: 34ch;
  color: var(--muted);
}

.empty .btn {
  margin-top: 8px;
}

/* Address book */

.archived {
  display: flex;
  flex-direction: column;
}

.archived-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--touch);
  padding: 0 4px;
  color: var(--muted);
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.archived-summary::-webkit-details-marker {
  display: none;
}

.summary-chevron {
  transition: transform 150ms ease;
}

.archived[open] .summary-chevron {
  transform: rotate(90deg);
}

.archived[open] .list {
  margin-top: 8px;
}

/* Sheets */

.sheet {
  width: 100%;
  max-width: var(--page-max);
  max-height: min(92dvh, 100%);
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 20px 20px 0 0;
  background: var(--surface);
  color: var(--ink);
  overflow: hidden auto;
  overscroll-behavior: contain;
}

.sheet::backdrop {
  background: var(--backdrop);
}

.sheet-inner {
  padding: 4px calc(var(--gutter) + var(--safe-right)) calc(16px + var(--safe-bottom)) calc(var(--gutter) + var(--safe-left));
}

.sheet-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 -8px;
  padding: 8px 0 8px 8px;
  background: var(--surface);
}

.sheet-title {
  flex: 1;
  min-width: 0;
  font-size: 19px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.sheet-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 4px;
}

.sheet-actions {
  display: flex;
  gap: 10px;
  padding-top: 4px;
}

.sheet-actions .btn {
  flex: 1;
}

.confirm-message {
  color: var(--ink-soft);
}

@media (min-width: 640px) {
  .sheet {
    max-width: 480px;
    margin: auto;
    border-radius: var(--radius);
  }

  .sheet-inner {
    padding: 8px 24px 24px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .sheet[open] {
    animation: sheet-up 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .sheet[open]::backdrop {
    animation: fade-in 220ms ease;
  }

  @media (min-width: 640px) {
    .sheet[open] {
      animation-name: pop-in;
    }
  }

  .toast.is-visible {
    animation: toast-in 200ms ease;
  }
}

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

@keyframes sheet-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes pop-in {
  from { transform: scale(0.97); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes toast-in {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.menu-list {
  margin: 0 -8px;
  padding: 0;
  list-style: none;
}

.menu-item {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
}

.menu-item:active {
  background: var(--surface-sunken);
}

.menu-item .icon {
  color: var(--muted);
}

.menu-item.is-danger,
.menu-item.is-danger .icon {
  color: var(--danger);
}

.event-option.is-current {
  font-weight: 700;
}

.event-option.is-current .icon {
  color: var(--brand);
}

.event-option-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.menu-sub {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

/* Forms */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field-label {
  padding: 0;
  font-size: 15px;
  font-weight: 600;
}

.field-optional {
  color: var(--muted);
  font-weight: 400;
}

.field-hint {
  color: var(--muted);
  font-size: 14px;
}

.field-error,
.form-error {
  color: var(--danger);
  font-size: 14px;
  font-weight: 500;
}

.form-error {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-surface);
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 12px;
}

.input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 16px;
  appearance: none;
}

.input:focus {
  border-color: var(--brand);
  outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent);
  outline-offset: 0;
}

.input[aria-invalid='true'] {
  border-color: var(--danger);
}

.input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.textarea {
  min-height: 88px;
  resize: vertical;
}

input[type='date'].input {
  min-height: 48px;
}

.money-input {
  position: relative;
}

.input-money {
  padding-right: 36px;
  font-variant-numeric: tabular-nums;
}

.money-suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.segmented-options {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
}

.segmented-wrap .segmented-options,
.segmented-status .segmented-options {
  grid-auto-flow: row;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 420px) {
  .segmented-status .segmented-options {
    grid-auto-flow: column;
    grid-template-columns: none;
  }

  .segmented-wrap .segmented-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.segment {
  position: relative;
  display: block;
}

.segment-label {
  min-height: var(--touch);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 9px;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
}

.segment input:checked + .segment-label {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--border-strong);
}

.segment input:focus-visible + .segment-label {
  outline: 3px solid var(--teal);
  outline-offset: 1px;
}

.picker-list {
  display: flex;
  flex-direction: column;
  max-height: 40dvh;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.picker-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 12px;
  cursor: pointer;
}

.picker-option + .picker-option {
  border-top: 1px solid var(--border);
}

.picker-option:has(input:checked) {
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
}

.picker-radio {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--brand);
}

.picker-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.picker-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker-sub {
  color: var(--muted);
  font-size: 14px;
}

.new-person-fields {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Toast */

.toast {
  position: fixed;
  inset: auto 0 calc(96px + var(--safe-bottom)) 0;
  z-index: 50;
  width: calc(100% - 2 * var(--gutter));
  max-width: 560px;
  height: auto;
  margin: 0 auto;
  padding: 10px 10px 10px 16px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--toast-bg);
  color: var(--toast-ink);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.25);
  display: none;
  align-items: center;
  gap: 12px;
  overflow: visible;
}

.toast.is-visible {
  display: flex;
}

.toast-message {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.toast-action {
  flex: none;
  min-height: var(--touch);
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--toast-action);
  font-weight: 700;
}

/* Login */

.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(24px + var(--safe-top)) calc(20px + var(--safe-right)) calc(24px + var(--safe-bottom)) calc(20px + var(--safe-left));
}

.login-card {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-logo img {
  width: 220px;
  height: auto;
  margin: 0 auto 24px;
}

.login-title {
  font-size: 24px;
  font-weight: 700;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}
