:root {
  --navy: #10233f;
  --navy-2: #18385d;
  --ocean: #087f8c;
  --aqua: #22b7ae;
  --coral: #f16e5b;
  --gold: #f6bb43;
  --cream: #fffaf0;
  --ink: #17212b;
  --muted: #65717d;
  --line: #dde5e9;
  --white: #fff;
  --shadow: 0 14px 40px rgba(16, 35, 63, .11);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: #f4f7f8;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.hero {
  position: relative;
  overflow: hidden;
  color: var(--white);
  background: linear-gradient(145deg, #0c203a 0%, #14375b 70%, #075f69 100%);
  padding: calc(28px + env(safe-area-inset-top)) 20px 30px;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto -20% -110px 20%;
  height: 180px;
  background: rgba(255,255,255,.06);
  transform: rotate(-8deg);
}
.hero__content { position: relative; z-index: 2; max-width: 850px; margin: 0 auto; }
.hero__glow { position: absolute; border-radius: 50%; filter: blur(4px); opacity: .65; }
.hero__glow--one { width: 210px; height: 210px; top: -100px; right: -45px; background: #f16e5b; }
.hero__glow--two { width: 120px; height: 120px; bottom: -65px; left: -20px; background: #22b7ae; }
.eyebrow { margin: 0 0 8px; font-size: 11px; font-weight: 800; letter-spacing: .16em; opacity: .8; }
.eyebrow.dark { color: var(--ocean); opacity: 1; }
h1 { margin: 0; max-width: 560px; font-size: clamp(38px, 9vw, 64px); line-height: .98; letter-spacing: -.055em; }
.hero__sub { max-width: 520px; margin: 14px 0 22px; color: rgba(255,255,255,.8); font-size: 16px; line-height: 1.45; }
.profile-switch { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: rgba(255,255,255,.1); backdrop-filter: blur(12px); }
.profile-btn { min-width: 102px; padding: 10px 18px; border: 0; border-radius: 999px; color: rgba(255,255,255,.72); background: transparent; font-weight: 750; }
.profile-btn.is-active { color: var(--navy); background: var(--white); box-shadow: 0 3px 14px rgba(0,0,0,.18); }

main { max-width: 900px; margin: 0 auto; padding: 0 16px calc(80px + env(safe-area-inset-bottom)); }
.summary-strip {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: -14px 0 20px;
  padding: 15px 4px;
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.summary-strip div { display: grid; justify-items: center; gap: 3px; padding: 0 8px; border-right: 1px solid var(--line); text-align: center; }
.summary-strip div:last-child { border-right: 0; }
.summary-strip strong { color: var(--navy); font-size: 21px; }
.summary-strip span { color: var(--muted); font-size: 11px; }

.controls { margin-bottom: 22px; }
.view-tabs { display: grid; grid-template-columns: repeat(3, 1fr); padding: 4px; border-radius: 14px; background: #e7edef; }
.view-tab { padding: 10px 6px; border: 0; border-radius: 11px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 800; }
.view-tab.is-active { color: var(--navy); background: var(--white); box-shadow: 0 3px 10px rgba(16,35,63,.08); }
.filter-row { display: flex; gap: 8px; overflow-x: auto; margin: 14px -16px 12px; padding: 0 16px 4px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip { flex: 0 0 auto; padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--white); font-size: 12px; font-weight: 750; }
.filter-chip.is-active { color: var(--white); border-color: var(--ocean); background: var(--ocean); }
.search { display: flex; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.search span { color: var(--muted); font-size: 22px; transform: rotate(-18deg); }
.search input { width: 100%; padding: 13px 0; border: 0; outline: 0; color: var(--ink); background: transparent; }

.view { display: none; }
.view.is-active { display: block; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 15px; margin: 26px 2px 14px; }
.section-heading h2, .share-panel h2 { margin: 0; color: var(--navy); font-size: 28px; letter-spacing: -.035em; }
.section-heading select { max-width: 142px; padding: 9px 28px 9px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--white); font-size: 12px; }
.event-list { display: grid; gap: 14px; }
.event-card { overflow: hidden; border: 1px solid rgba(16,35,63,.08); border-radius: 20px; background: var(--white); box-shadow: 0 7px 24px rgba(16,35,63,.065); }
.event-card__main { display: block; width: 100%; padding: 18px; border: 0; color: inherit; background: transparent; text-align: left; }
.event-card__topline { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.date-pill, .fit-pill { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 9px; border-radius: 999px; font-size: 10px; font-weight: 850; letter-spacing: .025em; }
.date-pill { color: #176067; background: #dff6f3; }
.fit-pill { color: #8c5112; background: #fff1d1; }
.fit-pill.conflict { color: #9d342c; background: #ffe3df; }
.event-name { margin: 0; color: var(--navy); font-size: 21px; line-height: 1.12; letter-spacing: -.025em; }
.event-type { margin: 6px 0 9px; color: var(--coral); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.event-description { display: -webkit-box; overflow: hidden; margin: 0 0 14px; color: #4c5964; font-size: 14px; line-height: 1.47; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.event-meta { display: flex; flex-wrap: wrap; gap: 8px 15px; color: var(--muted); font-size: 12px; font-weight: 650; }
.event-time::before { content: "◷ "; color: var(--ocean); }
.event-price::before { content: "◎ "; color: var(--ocean); }
.rating-block { padding: 14px 18px 17px; border-top: 1px solid var(--line); background: #fbfcfc; }
.rating-label { display: flex; justify-content: space-between; margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.rating-label strong { color: var(--navy); }
.rating-buttons { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.rating-buttons button { min-height: 41px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: var(--white); font-weight: 850; }
.rating-buttons button.is-active { color: var(--white); border-color: var(--coral); background: var(--coral); transform: translateY(-1px); box-shadow: 0 6px 15px rgba(241,110,91,.2); }
.decision-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 8px; }
.decision-buttons button { padding: 8px 4px; border: 0; border-radius: 9px; color: var(--muted); background: #edf1f2; font-size: 11px; font-weight: 800; }
.decision-buttons button.is-active[data-decision="yes"] { color: #fff; background: var(--ocean); }
.decision-buttons button.is-active[data-decision="maybe"] { color: #5e4000; background: var(--gold); }
.decision-buttons button.is-active[data-decision="no"] { color: #fff; background: #87919a; }

.match-callout { margin-bottom: 15px; padding: 20px; border-radius: 20px; color: var(--white); background: linear-gradient(135deg, var(--ocean), #155b77); box-shadow: var(--shadow); }
.match-callout h3 { margin: 0 0 6px; font-size: 24px; }
.match-callout p { margin: 0; color: rgba(255,255,255,.82); line-height: 1.45; }
.match-score { display: inline-block; margin-top: 14px; padding: 7px 11px; border-radius: 999px; color: var(--navy); background: var(--gold); font-size: 12px; font-weight: 900; }
.empty-state { padding: 45px 20px; text-align: center; }
.empty-state div { font-size: 44px; }
.empty-state h3 { margin-bottom: 6px; color: var(--navy); }
.empty-state p { margin: 0; color: var(--muted); }

.timeline { position: relative; display: grid; gap: 10px; }
.timeline article { display: grid; grid-template-columns: 92px 1fr; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); }
.timeline article.is-free { border-left: 5px solid var(--aqua); }
.timeline time { color: var(--ocean); font-size: 12px; font-weight: 850; }
.timeline h3 { margin: 0 0 4px; color: var(--navy); font-size: 16px; }
.timeline p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.plan-stack { display: grid; gap: 9px; margin-top: 10px; }
.plan-pick { margin-top: 0; padding: 12px; border-radius: 12px; background: #eef8f7; }
.plan-pick--locked { border: 1px solid rgba(246,187,67,.55); background: #fff6dd; }
.plan-pick--works { border: 1px solid rgba(34,183,174,.28); background: #eef8f7; }
.plan-pick--maybe { border: 1px solid rgba(246,187,67,.35); background: #fffaf0; }
.plan-pick--conflict { border: 1px solid rgba(241,110,91,.28); background: #fff0ee; }
.plan-pick strong { display: block; color: var(--navy); font-size: 15px; }
.plan-pick span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.plan-pick p { margin-top: 7px; }
.plan-badge { display: inline-flex !important; width: max-content; margin: 0 0 7px !important; padding: 4px 8px; border-radius: 999px; color: #fff !important; background: var(--ocean); font-size: 9px !important; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.plan-pick--locked .plan-badge { color: var(--navy) !important; background: var(--gold); }
.plan-pick--maybe .plan-badge { color: #5e4000 !important; background: var(--gold); }
.plan-pick--conflict .plan-badge { background: var(--coral); }
.plan-actions { display: flex; gap: 7px; margin-top: 9px; }
.plan-actions button, .lock-plan-btn { padding: 8px 10px; border: 0; border-radius: 9px; color: var(--white); background: var(--navy); font-size: 11px; font-weight: 800; }
.plan-actions button.secondary { color: var(--navy); background: #dfe8eb; }
.lock-plan-btn { display: block; width: 100%; margin-top: 12px; padding: 12px; background: var(--ocean); }
.lock-plan-btn.is-locked { color: var(--navy); background: var(--gold); }

.share-panel { margin-top: 38px; padding: 23px; border: 1px solid var(--line); border-radius: 22px; background: var(--cream); }
.share-panel > div > p:last-child { color: var(--muted); line-height: 1.5; }
.share-actions { display: grid; gap: 8px; margin-top: 18px; }
.primary-btn, .secondary-btn, .text-btn { width: 100%; padding: 13px 16px; border-radius: 13px; font-weight: 850; }
.primary-btn { border: 0; color: var(--white); background: var(--navy); }
.secondary-btn { border: 1px solid var(--navy); color: var(--navy); background: var(--white); }
.text-btn { border: 0; color: var(--ocean); background: transparent; }
.text-btn.danger { color: #a83c34; }

dialog { width: min(620px, calc(100% - 24px)); max-height: 88vh; padding: 0; border: 0; border-radius: 24px; color: var(--ink); background: var(--white); box-shadow: 0 25px 80px rgba(0,0,0,.28); }
dialog::backdrop { background: rgba(5,18,32,.66); backdrop-filter: blur(5px); }
.dialog-close { position: sticky; z-index: 3; float: right; top: 12px; right: 12px; width: 38px; height: 38px; margin: 12px 12px -50px 0; border: 0; border-radius: 50%; color: var(--navy); background: rgba(255,255,255,.92); font-size: 25px; box-shadow: 0 3px 15px rgba(0,0,0,.12); }
.dialog-hero { padding: 30px 24px 24px; color: var(--white); background: linear-gradient(135deg, var(--navy), var(--ocean)); }
.dialog-hero h2 { max-width: 85%; margin: 7px 0; font-size: 31px; line-height: 1.05; letter-spacing: -.04em; }
.dialog-body { padding: 22px 24px 28px; }
.dialog-body h3 { margin: 24px 0 7px; color: var(--navy); }
.dialog-body p { color: #4e5a64; line-height: 1.55; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.detail-grid div { padding: 12px; border-radius: 12px; background: #f1f6f6; }
.detail-grid span { display: block; color: var(--muted); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.detail-grid strong { display: block; margin-top: 5px; color: var(--navy); font-size: 13px; }
.event-link { display: inline-flex; margin-top: 16px; padding: 11px 15px; border-radius: 12px; color: var(--white); background: var(--coral); font-weight: 850; text-decoration: none; }
.import-dialog { padding: 28px 22px 22px; }
.import-dialog h2 { margin: 0; color: var(--navy); }
.import-dialog p { color: var(--muted); line-height: 1.5; }
.import-dialog textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px; outline: none; resize: vertical; }
.form-message { min-height: 20px; color: var(--coral) !important; font-size: 12px; font-weight: 700; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); max-width: calc(100% - 30px); padding: 11px 15px; border-radius: 999px; color: var(--white); background: var(--navy); font-size: 13px; font-weight: 750; opacity: 0; pointer-events: none; transform: translate(-50%, 20px); transition: .22s ease; box-shadow: var(--shadow); }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 720px) {
  .hero { padding-top: 55px; padding-bottom: 48px; }
  main { padding-left: 24px; padding-right: 24px; }
  .event-list { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .summary-strip { margin-top: -24px; }
  .share-panel { display: grid; grid-template-columns: 1.4fr 1fr; gap: 25px; align-items: center; }
  .share-actions { margin-top: 0; }
}
