:root {
  --ink: #18201e;
  --muted: #66706d;
  --paper: #f4f3ee;
  --card: #fffefa;
  --line: #dcded8;
  --orange: #ff5a2f;
  --orange-dark: #dd3e16;
  --green: #28745c;
  --red: #a63c2f;
  --shadow: 0 18px 55px rgba(30, 42, 38, .08);
}

* { box-sizing: border-box; }
html { color: var(--ink); background: var(--paper); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { margin: 0; min-width: 320px; }
button, input, textarea, select { font: inherit; }
button, summary, .delivery-toggle { cursor: pointer; }
.hidden { display: none !important; }

.site-header { height: 72px; padding: 0 max(24px, calc((100vw - 820px) / 2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(244, 243, 238, .92); }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: -.02em; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: white; background: var(--orange); font: 20px/1 Georgia, serif; }
.service-state, .monitor-state { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.service-state i, .monitor-state i { width: 8px; height: 8px; border-radius: 50%; background: #c4932d; box-shadow: 0 0 0 4px rgba(196, 147, 45, .12); }
.service-state.ready i, .monitor-state.live i { background: #36a274; box-shadow: 0 0 0 4px rgba(54, 162, 116, .12); }

main { width: min(820px, calc(100% - 40px)); margin: 0 auto; padding: 76px 0 46px; }
.eyebrow { margin: 0 0 12px; color: var(--orange-dark); font-size: 11px; font-weight: 800; letter-spacing: .16em; }

.setup-card, .unlock-card, .preferences-card, .activity-card, .matches-card { margin-top: 20px; padding: 32px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
h2 { margin: 0; font: 500 28px/1.15 Georgia, serif; letter-spacing: -.025em; }
.setup-card > div > p:last-child, .unlock-card > p { margin: 12px 0 0; color: var(--muted); line-height: 1.55; }
code { padding: 2px 5px; border-radius: 5px; background: #eeede7; font-size: .9em; }

.setup-list { padding: 0; margin: 25px 0 20px; list-style: none; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.setup-list li { min-height: 68px; padding: 12px 16px; display: grid; grid-template-columns: 10px 1fr auto; gap: 13px; align-items: center; background: white; }
.setup-list li + li { border-top: 1px solid var(--line); }
.setup-list i { width: 9px; height: 9px; border-radius: 50%; background: #d38a73; }
.setup-list li.ready i { background: #36a274; }
.setup-list strong, .setup-list small { display: block; }
.setup-list strong { font-size: 14px; }
.setup-list small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.setup-list b { color: var(--red); font-size: 12px; }
.setup-list li.ready b { color: var(--green); }

.unlock-card { max-width: 620px; }
.unlock-card form { margin-top: 24px; }
.unlock-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.inline-error { margin: 10px 0 0; color: var(--red); font-size: 13px; }

.card-heading, .activity-heading, .matches-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
label { display: block; font-size: 14px; font-weight: 700; }
label > span { color: var(--muted); font-size: 12px; font-weight: 500; }
.field-help { margin: 7px 0 12px; color: var(--muted); font-size: 13px; line-height: 1.5; }
textarea, input, select { width: 100%; border: 1px solid #cfd3cc; border-radius: 10px; color: var(--ink); background: white; outline: none; }
textarea { display: block; margin-bottom: 24px; padding: 15px 16px; line-height: 1.55; resize: vertical; }
input, select { min-height: 45px; padding: 10px 12px; }
textarea:focus, input:focus, select:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 90, 47, .12); }

.delivery-toggle { min-height: 76px; margin-top: 30px; padding: 15px 16px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; border: 1px solid var(--line); border-radius: 12px; background: #f7f6f1; }
.delivery-toggle span strong, .delivery-toggle span small { display: block; }
.delivery-toggle span small { margin-top: 4px; color: var(--muted); font-weight: 400; }
.delivery-toggle input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.delivery-toggle > i { width: 46px; height: 26px; padding: 3px; border-radius: 99px; background: #b8bfba; transition: background .18s ease; }
.delivery-toggle > i:after { content: ""; display: block; width: 20px; height: 20px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.24); transition: transform .18s ease; }
.delivery-toggle input:checked + i { background: var(--green); }
.delivery-toggle input:checked + i:after { transform: translateX(20px); }
.delivery-toggle:has(input:focus-visible) { outline: 3px solid rgba(255, 90, 47, .2); outline-offset: 2px; }

.advanced { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.advanced summary { padding: 16px; font-size: 13px; font-weight: 700; }
.advanced-grid { padding: 0 16px 17px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.advanced-grid label { color: var(--muted); font-size: 12px; }
.advanced-grid input, .advanced-grid select { margin-top: 7px; color: var(--ink); font-size: 14px; font-weight: 500; }

.form-actions { margin-top: 24px; display: flex; align-items: center; gap: 10px; }
.form-actions p { margin: 0 0 0 auto; color: var(--muted); font-size: 12px; }
.primary-button, .secondary-button, .text-button { min-height: 44px; border-radius: 9px; font-weight: 700; }
.primary-button { padding: 0 22px; border: 1px solid var(--ink); color: white; background: var(--ink); }
.primary-button:hover { background: #303b38; }
.secondary-button { padding: 0 18px; border: 1px solid #cfd3cc; color: var(--ink); background: white; }
.secondary-button:hover { background: #f5f4ef; }
.secondary-button .button-spinner { border-color: rgba(24, 32, 30, .25); border-top-color: var(--ink); }
.text-button { min-height: auto; padding: 5px; border: 0; color: var(--orange-dark); background: transparent; }
button:focus-visible, summary:focus-visible { outline: 3px solid rgba(255, 90, 47, .25); outline-offset: 2px; }
button:disabled { cursor: wait; opacity: .6; }

.activity-card { box-shadow: none; }
.activity-heading { margin-bottom: 22px; }
.activity-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.activity-grid div { min-height: 76px; padding: 15px; display: flex; flex-direction: column; justify-content: center; background: white; }
.activity-grid div + div { border-left: 1px solid var(--line); }
.activity-grid span { color: var(--muted); font-size: 12px; }
.activity-grid strong { margin-top: 5px; font-size: 15px; }
.monitor-error { margin: 14px 0 0; padding: 12px; border-radius: 8px; color: var(--red); background: #fff1ed; font-size: 13px; }

.matches-heading { align-items: center; margin-bottom: 15px; }
.matches-heading > span { color: var(--muted); font-size: 13px; }
.match { padding: 20px 0; display: grid; grid-template-columns: 48px 1fr; gap: 16px; border-top: 1px solid var(--line); }
.match-score { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: #e6f1ec; font-size: 12px; font-weight: 800; }
.match h3 { margin: 0; font-size: 16px; line-height: 1.35; }
.match p { margin: 7px 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.match a { color: var(--orange-dark); font-size: 12px; font-weight: 700; text-decoration: none; }
.empty-matches { margin: 0; padding: 22px 0 4px; border-top: 1px solid var(--line); color: var(--muted); }

footer { padding: 30px 0 10px; color: #7d8581; text-align: center; font-size: 12px; }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 30; display: grid; gap: 8px; }
.toast { max-width: 360px; padding: 13px 16px; border-radius: 9px; color: white; background: var(--ink); box-shadow: var(--shadow); font-size: 13px; }
.toast.error { background: var(--red); }
.button-spinner { width: 13px; height: 13px; margin-right: 8px; display: inline-block; vertical-align: -2px; border: 2px solid rgba(255,255,255,.35); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 620px) {
  .site-header { height: 64px; padding: 0 18px; }
  .brand { font-size: 14px; }
  .service-state > span { display: none; }
  main { width: min(100% - 28px, 820px); padding-top: 48px; }
  .setup-card, .unlock-card, .preferences-card, .activity-card, .matches-card { padding: 22px 18px; border-radius: 14px; }
  .card-heading { display: block; }
  .monitor-state { margin-top: 16px; }
  .unlock-row, .advanced-grid { grid-template-columns: 1fr; }
  .unlock-row .primary-button { min-height: 46px; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions p { margin: 5px 0 0; text-align: center; }
  .activity-grid { grid-template-columns: 1fr; }
  .activity-grid div + div { border-left: 0; border-top: 1px solid var(--line); }
  .match { grid-template-columns: 40px 1fr; gap: 12px; }
  .match-score { width: 38px; height: 38px; }
}

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