/* Ricky's Style — editorial "Quiet Luxury" design system (reservar + cockpit).
   Matte charcoal #0A0A0A · graphite cards #141414 · hairline glass borders · desaturated champagne accent · ivory text.
   Mobile-first: 100dvh shells, safe areas respected, 44px+ touch targets. */
:root {
  --obsidian: #0A0A0A;
  --obsidian-2: #141414;
  --graphite: #141414;
  --graphite-2: #1B1B1B;
  --gold: #C9B48A;
  --gold-soft: #DCCFB0;
  --ivory: #F5F1E8;
  --ivory-dim: #A8A396;
  --line: rgba(201, 180, 138, .24);
  --line-soft: rgba(255, 255, 255, .07);
  --glass: rgba(20, 20, 20, .9);
  --bar-bg: rgba(10, 10, 10, .88);
  --field: rgba(244, 239, 228, .05);
  --sheet-bg: #181818;
  --bad: #E58A80;
  --ok: #7FCB9E;
  --radius: 18px;
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}
/* Light theme (cockpit toggle): editorial ivory paper, same champagne accent family. */
:root[data-theme="light"] {
  --obsidian: #F6F4EF; --obsidian-2: #FFFFFF; --graphite: #FFFFFF; --graphite-2: #EFECE4;
  --gold: #8A7344; --gold-soft: #6F5C35; --ivory: #16140F; --ivory-dim: #6A665C;
  --line: rgba(138, 115, 68, .35); --line-soft: rgba(0, 0, 0, .09);
  --glass: rgba(255, 255, 255, .92); --bar-bg: rgba(246, 244, 239, .9); --field: rgba(0, 0, 0, .04); --sheet-bg: #FBFAF7;
  --bad: #B3392E; --ok: #2F7D52;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--obsidian); color: var(--ivory); font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; overscroll-behavior-y: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: .02em; margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ivory-dim); }
.gold { color: var(--gold); }
.eyebrow { font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); font-weight: 600; }

/* Surfaces */
.card {
  background: var(--graphite);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 16px;
}
.card.flat { background: var(--obsidian-2); }
.card.gilt { border-color: var(--line); box-shadow: 0 10px 40px -22px rgba(201, 180, 138, .28); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px; border-radius: 999px;
  border: 1px solid var(--gold); background: transparent; color: var(--gold);
  font-weight: 600; letter-spacing: .02em; transition: transform .12s ease, background .2s ease, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, #DCCFB0, #C9B48A 60%, #B7A072); color: #14110A; border-color: transparent; }
.btn.block { width: 100%; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.quiet { border-color: var(--line-soft); color: var(--ivory); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.icon-btn {
  width: 44px; height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--line-soft); background: var(--glass); color: var(--gold);
}
.icon-btn:active { transform: scale(.94); }

/* Chips & badges */
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-soft); background: transparent; color: var(--ivory-dim); font-size: 14px;
}
.chip[aria-pressed="true"], .chip.on { color: #14110A; background: var(--gold); border-color: var(--gold); font-weight: 600; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--line-soft); color: var(--ivory-dim); }
.badge.gold { color: var(--gold); border-color: var(--line); }
.badge.ok { color: var(--ok); border-color: rgba(127, 203, 158, .35); }
.badge.bad { color: var(--bad); border-color: rgba(229, 138, 128, .4); }

/* Form */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ivory-dim); margin-bottom: 6px; }
.input {
  width: 100%; min-height: 52px; padding: 12px 16px; border-radius: 14px;
  background: var(--field); border: 1px solid var(--line-soft); color: var(--ivory); font-size: 16px; /* 16px stops iOS zoom */
}
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { border-color: var(--gold); outline: none; }
.msg { min-height: 22px; font-size: 14px; margin: 8px 0; }
.msg.bad { color: var(--bad); }
.msg.ok { color: var(--ok); }

/* Bottom sheet */
.sheet-back { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .66); backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s; }
.sheet-back.in { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-height: 92dvh; overflow-y: auto;
  margin: 0 auto; max-width: 560px;
  background: linear-gradient(180deg, var(--sheet-bg), var(--obsidian)); border: 1px solid var(--line);
  border-bottom: 0; border-radius: 26px 26px 0 0; padding: 10px 18px calc(22px + var(--sab));
  transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}
.sheet.in { transform: none; }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line-soft); margin: 4px auto 14px; }
.sheet h2 { font-size: 22px; margin-bottom: 12px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--sab)); transform: translate(-50%, 20px); z-index: 80;
  background: var(--obsidian-2); border: 1px solid var(--line); color: var(--ivory); border-radius: 999px;
  padding: 12px 20px; font-size: 14px; opacity: 0; transition: .25s; max-width: 90vw; text-align: center;
}
.toast.in { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { border-color: var(--bad); color: var(--bad); }

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