:root {
  color-scheme: light;
  font-family: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  --page: #f3f5fa;
  --ink: #18203a;
  --muted: #555f7a;
  --dark: #1f2b50;
  --dark-pressed: #121a33;
  --card-border: #d3d9e8;
  --line: #d6dcea;
  --progress-idle: #d5dcec;
  --tag-bg: #e6ebf6;
  --tag-ink: #2c3e6e;
  --try-bg: #e3ebfd;
  --try-border: #9fb5e8;
  --yes: #cc4130;
  --link: #b23a29;
  --link-pressed: #8a2c1f;
  --try-dot: #3f63b5;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--page); color: var(--ink); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--try-border);
  outline-offset: 3px;
}

.page-shell { min-height: 100vh; }
.site-header {
  min-height: 62px;
  padding: 12px max(24px, calc((100vw - 1160px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; font-size: 1.13rem; font-weight: 800; letter-spacing: -.025em; }
.brand-mark { width: 32px; height: 32px; position: relative; display: block; }
.brand-mark span { position: absolute; width: 21px; height: 21px; border: 5px solid var(--dark); border-radius: 50%; }
.brand-mark span:first-child { top: 0; left: 0; }
.brand-mark span:last-child { bottom: 0; right: 0; border-color: var(--yes); }
.header-place { color: var(--muted); font-size: .88rem; font-weight: 650; }

main { width: min(1160px, calc(100% - 48px)); margin: 0 auto; }
h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.13; letter-spacing: -.045em; }
.home-page { width: min(520px, 100%); margin: 0 auto; padding: 49px 0 74px; }
.home-page h1 { max-width: 470px; margin: 0 0 25px; font-size: clamp(2.2rem, 6vw, 3.1rem); }
.home-primary {
  width: 100%; padding: 27px; display: flex; flex-direction: column; align-items: flex-start;
  border: 0; border-radius: 23px; background: var(--dark); color: #fff; text-align: left;
  box-shadow: 0 14px 32px rgba(31, 43, 80, 0.12);
}
.home-primary:hover, .home-primary:active { background: var(--dark-pressed); }
.home-primary-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -.035em; }
.home-primary-subtitle { margin-top: 6px; font-size: 1rem; opacity: .86; }
.home-steps { width: 100%; margin-top: 25px; display: grid; gap: 11px; font-size: .95rem; line-height: 1.3; }
.home-steps > span { display: flex; align-items: center; gap: 12px; }
.home-steps b { width: 27px; height: 27px; flex: 0 0 27px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .17); font-size: .83rem; }
.home-start {
  width: 100%; min-height: 52px; margin-top: 22px; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between;
  border-radius: 999px; background: #fff; color: var(--dark);
  font-size: 17px; font-weight: 800; line-height: 1;
}
.home-secondary {
  width: 100%; min-height: 61px; margin-top: 14px; padding: 13px 18px;
  border: 1.5px solid var(--line); border-radius: 16px; background: #fff;
  color: var(--dark); font-weight: 800; text-align: left;
  box-shadow: 0 5px 19px rgba(31, 43, 80, 0.06);
}
.home-secondary:hover { border-color: var(--dark); }
.home-link { display: block; width: fit-content; margin: 30px auto 0; color: var(--link); font-weight: 800; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.home-link:hover, .home-link:active { color: var(--link-pressed); }

.planner-page { width: min(520px, 100%); margin: 0 auto; padding: 25px 0 80px; }
.page-home { margin-bottom: 19px; padding: 7px 0; border: 0; background: transparent; color: var(--link); font-weight: 750; text-decoration: underline; text-underline-offset: 3px; }
.page-home:hover { color: var(--link-pressed); }
.planner-heading { margin-bottom: 18px; }
.planner-heading p { margin: 8px 0 0; color: var(--muted); line-height: 1.48; }
.flow-top { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 25px; }
.flow-exit { width: 43px; height: 43px; flex: 0 0 43px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--dark); font-size: 1.9rem; line-height: 1; }
.flow-exit:hover { background: var(--tag-bg); }
.flow-progress { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin: 2px 0 0; padding: 0; list-style: none; }
.flow-progress li { position: relative; padding-top: 15px; color: var(--muted); font-size: .85rem; font-weight: 720; text-align: center; }
.flow-progress li::before { content: ''; position: absolute; top: 0; left: 2px; right: 2px; height: 6px; border-radius: 99px; background: var(--progress-idle); }
.flow-progress li[data-state="done"]::before, .flow-progress li[data-state="current"]::before { background: var(--dark); }
.flow-progress li[data-state="current"] { color: var(--dark); }

.profile-form, .profile-picker { margin-bottom: 16px; }
.profile-form label, .profile-picker label, .names-form label, .plan-form label { display: block; margin-bottom: 8px; font-size: .92rem; font-weight: 770; }
.inline-form { display: flex; gap: 8px; }
input, select { min-height: 48px; padding: 10px 13px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
input { min-width: 0; width: 100%; }
select {
  min-width: 0; appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%231f2b50' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.profile-picker { display: flex; align-items: center; gap: 10px; }
.profile-picker label { margin: 0; white-space: nowrap; }
.profile-picker select { flex: 1; }
.profile-picker .text-button { white-space: nowrap; }
.solid-button { min-height: 48px; padding: 11px 20px; border: 1.5px solid var(--dark); border-radius: 12px; background: var(--dark); color: #fff; font-weight: 780; }
.solid-button:hover, .solid-button:active { background: var(--dark-pressed); }
.text-button { padding: 9px 2px; border: 0; background: transparent; color: var(--link); font-weight: 760; text-decoration: underline; text-underline-offset: 3px; }
.text-button:hover { color: var(--link-pressed); }
.status { margin: 12px 0 15px; color: var(--muted); font-size: .93rem; line-height: 1.45; }
.status:empty { display: none; }
.empty-panel, .handoff-panel { padding: 22px; border: 1px solid var(--card-border); border-radius: 18px; background: #fff; line-height: 1.5; }
.names-form { display: grid; gap: 8px; }
.names-form label:not(:first-child) { margin-top: 13px; }
.names-form .solid-button { margin-top: 17px; }
.handoff-panel { display: grid; gap: 16px; }
.handoff-panel p { margin: 0; }

.card-stack { position: relative; padding-bottom: 17px; isolation: isolate; }
.stack-back { position: absolute; overflow: hidden; border: 1px solid var(--card-border); border-radius: 23px; background: #fff; box-shadow: 0 6px 17px rgba(31, 43, 80, 0.06); pointer-events: none; }
.stack-back .swipe-card { min-height: 100%; height: 100%; border: 0; border-radius: inherit; box-shadow: none; }
.stack-back-1 { z-index: 1; top: 8px; right: 8px; bottom: 8px; left: 8px; }
.stack-back-2 { z-index: 0; top: 16px; right: 16px; bottom: 0; left: 16px; }
.stack-current { position: relative; z-index: 2; transition: transform 250ms ease, opacity 250ms ease; animation: card-enter 180ms ease backwards; }
.card-leaving .stack-current { animation: none; transform: translateY(-88px) scale(.97); opacity: 0; }
.card-leaving .stack-back-1 { transform: translateY(-8px) scale(1.02); transition: transform 250ms ease; }
.card-leaving .stack-back-2 { transform: translateY(-8px) scale(1.02); transition: transform 250ms ease; }
@keyframes card-enter { from { opacity: .7; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.swipe-card {
  min-height: 296px; padding: 23px; display: flex; flex-direction: column; align-items: flex-start;
  border: 1px solid var(--card-border); border-radius: 23px; background: #fff;
  box-shadow: 0 13px 31px rgba(31, 43, 80, 0.12);
}
.gesture-card { touch-action: none; }
.card-top { width: 100%; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.category { display: inline-block; padding: 6px 10px; border-radius: 100px; background: var(--tag-bg); color: var(--tag-ink); font-size: .83rem; font-weight: 790; }
.info-link { min-width: 44px; height: 44px; margin: -7px -7px 0 0; display: grid; place-items: center; color: var(--dark); font-size: 1.75rem; line-height: 1; text-decoration: none; }
.info-link:hover { color: var(--link); }
.swipe-card .event-name { margin: 15px 0 12px; font-size: clamp(1.45rem, 5vw, 2rem); }
.event-name { margin: 0 0 12px; font-size: 1.25rem; line-height: 1.26; letter-spacing: -.025em; overflow-wrap: anywhere; }
.activity { margin: -3px 0 16px; color: var(--muted); font-size: .95rem; line-height: 1.42; }
.card-meta { width: 100%; margin: auto 0 0; display: grid; gap: 10px; }
.meta-row { display: flex; align-items: flex-start; gap: 9px; color: var(--ink); line-height: 1.4; overflow-wrap: anywhere; }
.meta-row .icon { color: var(--dark); margin-top: 2px; }
.icon { width: 18px; height: 18px; flex: 0 0 18px; display: inline-flex; align-items: center; justify-content: center; }
.icon svg { width: 100%; height: 100%; display: block; }
.choice-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.choice-actions button { min-height: 64px; padding: 9px 5px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1.5px solid var(--line); border-radius: 13px; background: #fff; color: var(--dark); font-size: .88rem; font-weight: 800; line-height: 1.17; text-align: center; }
.choice-actions button .icon { width: 20px; height: 20px; flex-basis: 20px; }
.choice-actions button[data-choice="maybe"], .choice-actions button[data-personal-choice="maybe"] { border-color: var(--try-border); background: var(--try-bg); }
.choice-actions button[data-choice="yes"], .choice-actions button[data-personal-choice="yes"] { border-color: var(--yes); background: var(--yes); color: #fff; }
.choice-actions button:hover:not(:disabled) { box-shadow: 0 6px 17px rgba(31, 43, 80, 0.12); }
.gesture-tip { margin: 0 0 14px; padding: 12px 12px 12px 15px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-radius: 12px; background: var(--tag-bg); color: var(--dark); }
.gesture-tip p { margin: 0; font-size: .87rem; line-height: 1.38; }
.tip-close { width: 44px; height: 44px; flex: 0 0 44px; border: 0; background: transparent; color: var(--dark); font-size: 1.5rem; line-height: 1; }

.choice-feedback { position: fixed; z-index: 20; right: max(16px, calc((100vw - 520px) / 2)); bottom: 15px; left: max(16px, calc((100vw - 520px) / 2)); min-height: 60px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--card-border); border-radius: 15px; background: #fff; box-shadow: 0 8px 28px rgba(31, 43, 80, 0.12); }
.feedback-dot { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 50%; background: var(--dark); color: #fff; }
.choice-feedback.tone-maybe .feedback-dot { background: var(--try-dot); }
.choice-feedback.tone-yes .feedback-dot { background: var(--yes); }
.feedback-words { min-width: 0; flex: 1; display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.feedback-words strong { flex: 0 0 auto; font-size: .88rem; }
.feedback-words span { min-width: 0; overflow: hidden; color: var(--muted); font-size: .85rem; text-overflow: ellipsis; }
.feedback-undo { padding: 8px 1px; border: 0; background: transparent; color: var(--link); font-size: .9rem; font-weight: 800; }
.feedback-undo:hover { color: var(--link-pressed); }
.has-feedback .planner-page { padding-bottom: 122px; }

.match-eyebrow { margin: 0 0 11px; color: var(--link); font-size: .86rem; font-weight: 810; }
.best-match { min-height: 0; }
.best-match .solid-button { width: 100%; margin-top: 20px; }
.other-matches { margin-top: 24px; }
.other-matches h2 { margin: 0 0 11px; font-size: 1rem; }
.match-row { width: 100%; min-height: 54px; padding: 10px 13px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); text-align: left; }
.match-row + .match-row { margin-top: 8px; }
.match-row:hover { border-color: var(--dark); }
.match-row-name { min-width: 0; overflow: hidden; font-weight: 760; text-overflow: ellipsis; white-space: nowrap; }
.match-row-action { flex: 0 0 auto; color: var(--link); font-size: .85rem; font-weight: 800; }
.plan-form { display: grid; gap: 10px; margin-top: 20px; }
.form-hint { margin: 0; color: var(--muted); font-size: .89rem; line-height: 1.4; }
.plan-actions { display: flex; align-items: center; gap: 18px; margin-top: 8px; }
.next-plan-button { margin-top: 19px; }

.ideas { padding: 25px 0 64px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.date-range { margin: 5px 0 0; color: var(--muted); font-size: .9rem; line-height: 1.4; }
.refresh-button { padding: 11px 18px; border: 1.5px solid var(--dark); border-radius: 100px; background: transparent; color: var(--dark); font-size: .9rem; font-weight: 750; white-space: nowrap; }
.refresh-button:hover:not(:disabled) { background: var(--dark); color: #fff; }
.refresh-button:disabled { cursor: wait; }
.kind-switch { display: flex; gap: 8px; margin-top: 18px; }
.kind-button { padding: 10px 20px; border: 1px solid var(--line); border-radius: 100px; background: #fff; color: var(--dark); font-weight: 750; }
.kind-button:hover { border-color: var(--dark); }
.kind-button[aria-pressed="true"] { background: var(--dark); border-color: var(--dark); color: #fff; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.event-card { padding: 20px; display: flex; flex-direction: column; align-items: flex-start; border: 1px solid var(--card-border); border-radius: 18px; background: #fff; box-shadow: 0 8px 28px rgba(31, 43, 80, 0.06); }
.event-card:hover { box-shadow: 0 12px 34px rgba(31, 43, 80, 0.12); }
.event-card .card-top { margin-bottom: 11px; }
.event-details { width: 100%; margin: auto 0 16px; display: grid; gap: 8px; }
.detail-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; line-height: 1.4; }
.detail-label { color: var(--muted); font-size: .88rem; font-weight: 700; }
.detail-value { min-width: 0; margin: 0; font-size: .92rem; font-weight: 650; overflow-wrap: anywhere; }
.event-link { padding-bottom: 2px; color: var(--link); font-size: .92rem; font-weight: 800; text-decoration-color: currentColor; text-underline-offset: 4px; }
.event-link:hover { color: var(--link-pressed); }
.site-footer { padding: 24px max(24px, calc((100vw - 1160px) / 2)); border-top: 1px solid var(--line); background: #fff; }
.site-footer p { max-width: 760px; margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.site-footer a { color: var(--dark); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }

@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .site-header { min-height: 56px; padding: 10px 16px; gap: 8px 16px; }
  .brand { font-size: 1rem; }
  .header-place { font-size: .78rem; }
  main { width: calc(100% - 32px); }
  .home-page { padding-top: 34px; }
  .home-primary { padding: 22px; }
  .planner-page { padding-top: 18px; }
  .swipe-card { min-height: 276px; padding: 19px; }
  .profile-picker { gap: 8px; }
  .profile-picker .text-button { font-size: .84rem; }
  .choice-actions button { font-size: .875rem; }
  .cards { grid-template-columns: 1fr; gap: 12px; }
  .event-card { padding: 16px; }
  .kind-switch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kind-button { padding: 10px 8px; }
  .site-footer { padding: 24px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .stack-current, .stack-back { animation-duration: 1ms; transition-duration: 1ms; }
}
