:root {
  color-scheme: light;
  --ink: #102722;
  --ink-soft: #52615d;
  --paper: #f4f1e9;
  --paper-deep: #eae5d8;
  --card: #fffdf8;
  --line: rgba(16, 39, 34, 0.13);
  --signal: #ef5b3f;
  --signal-dark: #a93624;
  --lime: #d9ee88;
  --mint: #cae5dc;
  --strong-bg: #102722;
  --strong-fg: #f9f6ed;
  --strong-muted: rgba(249, 246, 237, 0.72);
  --strong-subtle: rgba(249, 246, 237, 0.2);
  --strong-accent: #d9ee88;
  --decision-bg: #a93624;
  --decision-fg: #fffdf8;
  --decision-accent: #d9ee88;
  --control-bg: #fffdf8;
  --tag-bg: #eae5d8;
  --culture-bg: #eee1cc;
  --sport-bg: #e7dfef;
  --watch-bg: #f4e9df;
  --nav-muted: #596763;
  --rating-off: #70746d;
  --shadow: 0 14px 36px rgba(27, 45, 38, 0.09);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--paper); scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 92% -8%, rgba(217, 238, 136, 0.42), transparent 28rem),
    var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(239, 91, 63, 0.25);
  outline-offset: 2px;
}

.app-shell { max-width: 760px; min-height: 100vh; margin: 0 auto; position: relative; }

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(66px + var(--safe-top));
  padding: var(--safe-top) 20px 0;
  background: rgba(244, 241, 233, 0.9);
  border-bottom: 1px solid rgba(16, 39, 34, 0.07);
  backdrop-filter: blur(18px);
}

.brand { display: flex; gap: 10px; align-items: center; padding: 0; border: 0; background: none; }
.brand-copy { display: grid; text-align: left; line-height: 1; }
.brand-copy b { font-size: 13px; letter-spacing: 0.15em; }
.brand-copy small { margin-top: 5px; color: var(--ink-soft); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }

.radar-mark {
  position: relative;
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--lime);
}
.radar-mark::before, .radar-mark::after {
  position: absolute;
  width: 18px;
  height: 18px;
  content: "";
  border: 1px solid rgba(16, 39, 34, 0.55);
  border-radius: 50%;
}
.radar-mark::after { width: 6px; height: 6px; background: var(--signal); }
.radar-mark span { position: absolute; width: 1px; height: 50%; top: 50%; left: 50%; background: var(--ink); transform-origin: top; transform: rotate(42deg); }
.radar-mark.large { width: 74px; height: 74px; }
.radar-mark.large::before { width: 42px; height: 42px; }
.radar-mark.large::after { width: 10px; height: 10px; }

.icon-button {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
}
.filter-glyph, .filter-glyph::before, .filter-glyph::after { display: block; width: 17px; height: 1.5px; background: var(--ink); content: ""; }
.filter-glyph::before { transform: translateY(-5px) scaleX(0.65); }
.filter-glyph::after { transform: translateY(3.5px) scaleX(0.42); }
.filter-count {
  position: absolute; top: -3px; right: -2px; min-width: 17px; height: 17px; padding: 0 4px;
  color: var(--decision-fg); border-radius: 9px; background: var(--decision-bg); font-size: 10px; font-weight: 800; line-height: 17px;
}

.main-content { padding-bottom: calc(94px + var(--safe-bottom)); }
.screen { display: none; animation: enter 0.28s ease both; }
.screen.active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.feed-hero { padding: 38px 20px 22px; }
.eyebrow { margin: 0 0 14px; color: var(--signal-dark); font-size: 10px; font-weight: 800; letter-spacing: 0.18em; }
.live-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 5px rgba(239, 91, 63, 0.12); animation: pulse 2.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px rgba(239, 91, 63, 0); } }
.feed-hero h1, .page-intro h1 {
  margin: 0; max-width: 520px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(43px, 12.5vw, 68px); font-weight: 400; line-height: 0.91; letter-spacing: -0.055em;
}
.feed-hero h1 em { color: var(--signal); font-weight: 400; }
.hero-subtitle { max-width: 520px; margin: 20px 0 0; color: var(--ink-soft); font-size: 15px; line-height: 1.55; }

.pulse-card {
  position: relative; display: flex; min-height: 142px; margin-top: 28px; overflow: hidden; align-items: stretch; justify-content: space-between;
  color: var(--strong-fg); border-radius: 25px; background: var(--strong-bg); box-shadow: var(--shadow);
}
.pulse-copy { z-index: 1; display: grid; align-content: center; padding: 22px 24px; }
.pulse-copy > span { margin-bottom: 7px; color: var(--strong-accent); font-size: 10px; font-weight: 800; letter-spacing: 0.15em; }
.pulse-copy strong { font-family: Georgia, serif; font-size: 44px; font-weight: 400; line-height: 1; }
.pulse-copy small { margin-top: 4px; color: var(--strong-muted); font-size: 12px; }
.pulse-visual { position: relative; width: 46%; min-width: 150px; overflow: hidden; }
.pulse-visual i { position: absolute; right: -12px; top: 50%; width: 180px; height: 180px; border: 1px solid rgba(217, 238, 136, 0.2); border-radius: 50%; transform: translateY(-50%); }
.pulse-visual i:nth-child(2) { width: 122px; height: 122px; right: 17px; }
.pulse-visual i:nth-child(3) { width: 62px; height: 62px; right: 47px; }
.pulse-visual::before { position: absolute; z-index: 1; right: 77px; top: 50%; width: 1px; height: 86px; content: ""; background: var(--strong-accent); transform-origin: top; transform: rotate(42deg); }
.pulse-visual b { position: absolute; z-index: 2; right: 72px; top: calc(50% - 5px); width: 11px; height: 11px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 8px rgba(239, 91, 63, 0.17); }
.calibration-entry { display: grid; width: 100%; min-height: 70px; margin-top: 10px; padding: 12px 14px; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; text-align: left; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: 0 5px 18px rgba(27, 45, 38, 0.03); }
.calibration-entry-mark { display: grid; width: 38px; height: 38px; place-items: center; color: var(--signal-dark); border-radius: 12px; background: var(--mint); font-family: Georgia, serif; font-size: 22px; }
.calibration-entry > span:nth-child(2) { display: grid; gap: 2px; }
.calibration-entry small { color: var(--signal-dark); font-size: 9px; font-weight: 900; letter-spacing: 0.11em; }
.calibration-entry b { font-family: Georgia, serif; font-size: 16px; font-weight: 400; }
.calibration-entry i { color: var(--ink-soft); font-size: 10px; font-style: normal; }
.calibration-entry > strong { color: var(--signal-dark); font-family: Georgia, serif; font-size: 19px; font-weight: 400; }

.sticky-tools { padding: 8px 20px 2px; }
.search-field { display: flex; height: 50px; align-items: center; gap: 10px; padding: 0 15px; border: 1px solid var(--line); border-radius: 16px; background: var(--control-bg); }
.search-field span { font-family: Georgia, serif; font-size: 25px; transform: rotate(-12deg); }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 14px; }
.search-field input::placeholder, .inline-add input::placeholder { color: var(--ink-soft); opacity: 1; }
.quick-filters { display: flex; gap: 8px; margin: 13px -20px 0; padding: 0 20px 8px; overflow-x: auto; scrollbar-width: none; }
.quick-filters::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: transparent; font-size: 12px; font-weight: 700; }
.chip.active { color: var(--strong-fg); border-color: var(--strong-bg); background: var(--strong-bg); }

.section-heading { display: flex; margin: 26px 20px 16px; align-items: end; justify-content: space-between; }
.section-heading span { color: var(--signal-dark); font-size: 10px; font-weight: 800; letter-spacing: 0.14em; }
.section-heading h2 { margin: 4px 0 0; font-family: Georgia, serif; font-size: 27px; font-weight: 400; letter-spacing: -0.03em; }
.text-button { padding: 8px 0; border: 0; border-bottom: 1px solid var(--ink); background: none; font-size: 11px; font-weight: 800; }

.event-list { display: grid; gap: 13px; padding: 0 14px; }
.event-card {
  position: relative; padding: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--card); box-shadow: 0 5px 18px rgba(27, 45, 38, 0.035); transition: transform 0.16s ease;
}
.event-card:active { transform: scale(0.988); }
.event-card::after { position: absolute; right: -38px; bottom: -58px; width: 140px; height: 140px; content: ""; border: 1px solid rgba(16, 39, 34, 0.06); border-radius: 50%; pointer-events: none; }
.event-topline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.event-meta { display: flex; align-items: center; gap: 9px; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.date-tile { display: grid; min-width: 48px; height: 48px; place-items: center; align-content: center; border-radius: 14px; background: var(--paper-deep); line-height: 1; }
.date-tile b { font-family: Georgia, serif; font-size: 20px; font-weight: 400; }
.date-tile span { margin-top: 3px; color: var(--signal-dark); font-size: 9px; font-weight: 900; letter-spacing: 0.08em; }
.event-when { display: grid; gap: 3px; }
.event-when b { color: var(--ink); font-size: 12px; }
.score-badge { display: grid; width: 48px; height: 48px; flex: 0 0 48px; place-items: center; border: 1px solid var(--ink); border-radius: 50%; background: var(--lime); font-family: Georgia, serif; font-size: 19px; }
.score-badge::after { content: "%"; margin-left: -6px; margin-top: 14px; font-family: Inter, sans-serif; font-size: 9px; font-weight: 800; }
.event-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 15px 0 8px; }
.event-tag, .status-pill { padding: 5px 8px; border-radius: 7px; background: var(--mint); font-size: 9px; font-weight: 900; letter-spacing: 0.07em; text-transform: uppercase; }
.event-tag.category-culture { background: var(--culture-bg); }
.event-tag.category-sport { background: var(--sport-bg); }
.status-pill { background: var(--lime); }
.event-card h3 { margin: 8px 0; padding-right: 4px; font-family: Georgia, serif; font-size: 23px; font-weight: 400; line-height: 1.08; letter-spacing: -0.025em; }
.event-description { display: -webkit-box; margin: 0; overflow: hidden; color: var(--ink-soft); font-size: 12.5px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.reason-line { display: flex; margin-top: 13px; gap: 7px; align-items: flex-start; color: var(--ink); font-size: 11px; line-height: 1.4; }
.reason-line span { color: var(--signal); font-weight: 900; }
.decision-preview { display: grid; margin-top: 14px; padding: 13px 14px; gap: 5px; border-left: 3px solid var(--signal); border-radius: 0 12px 12px 0; background: var(--mint); }
.decision-preview span { color: var(--signal-dark); font-size: 9px; font-weight: 900; letter-spacing: 0.11em; }
.decision-preview b { font-size: 11px; line-height: 1.45; }
.value-tags { display: flex; margin-top: 10px; flex-wrap: wrap; gap: 5px; }
.value-tags span { padding: 6px 8px; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; background: var(--tag-bg); font-size: 10px; font-weight: 700; }
.source-line { display: flex; margin-top: 12px; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 10px; }
.source-line span { text-transform: uppercase; letter-spacing: 0.08em; }
.source-line b { max-width: 55%; overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.source-line i { margin-left: auto; font-style: normal; }
.event-actions { position: relative; z-index: 2; display: flex; gap: 8px; margin-top: 16px; }
.event-actions button, .event-actions a { min-height: 39px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: transparent; font-size: 11px; font-weight: 800; text-decoration: none; }
.event-actions .card-primary { flex: 1; color: var(--strong-fg); border-color: var(--strong-bg); background: var(--strong-bg); }
.event-actions .saved-action { color: var(--ink); border-color: var(--lime); background: var(--lime); }
.review-note { margin-top: 15px; padding: 13px; border-left: 3px solid var(--signal); border-radius: 0 10px 10px 0; background: var(--paper); }
.review-note .stars { color: var(--signal); letter-spacing: 2px; }
.review-note p { margin: 7px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.45; }

.skeleton-card { height: 250px; overflow: hidden; border-radius: 22px; background: var(--card); }
.skeleton-card::before { display: block; width: 45%; height: 100%; content: ""; background: linear-gradient(90deg, transparent, rgba(234, 229, 216, 0.8), transparent); animation: shimmer 1.2s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(320%); } }
.empty-state { padding: 45px 24px; text-align: center; border: 1px dashed var(--line); border-radius: 22px; }
.empty-state span { display: block; font-family: Georgia, serif; font-size: 42px; }
.empty-state h3 { margin: 12px 0 5px; font-family: Georgia, serif; font-size: 24px; font-weight: 400; }
.empty-state p { margin: 0 auto; max-width: 300px; color: var(--ink-soft); font-size: 13px; line-height: 1.5; }

.page-intro { padding: 42px 20px 26px; }
.page-intro h1 { font-size: clamp(46px, 14vw, 66px); }
.page-intro > p:last-child { max-width: 480px; margin: 18px 0 0; color: var(--ink-soft); font-size: 14px; line-height: 1.55; }
.compact-intro { padding-bottom: 18px; }
.plan-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 14px 18px; }
.plan-summary article { display: grid; min-height: 92px; padding: 14px; align-content: space-between; border: 1px solid var(--line); border-radius: 17px; background: var(--card); }
.plan-summary article.accent { background: var(--lime); }
.plan-summary strong { font-family: Georgia, serif; font-size: 28px; font-weight: 400; }
.plan-summary span { color: var(--ink-soft); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.segment-control { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 3px 14px 18px; padding: 4px; border-radius: 14px; background: var(--paper-deep); }
.segment-control button { height: 40px; border: 0; border-radius: 10px; background: none; font-size: 11px; font-weight: 800; }
.segment-control button.active { background: var(--card); box-shadow: 0 4px 10px rgba(16, 39, 34, 0.06); }

.history-intro { padding-bottom: 18px; }
.impact-card { display: grid; grid-template-columns: 1.3fr 1px 1fr 1fr; margin: 0 14px; padding: 21px; align-items: center; color: var(--strong-fg); border-radius: 23px; background: var(--strong-bg); }
.impact-score { display: flex; align-items: center; gap: 10px; }
.impact-score strong { color: var(--strong-accent); font-family: Georgia, serif; font-size: 38px; font-weight: 400; }
.impact-score span { color: var(--strong-muted); font-size: 10px; font-weight: 700; line-height: 1.35; text-transform: uppercase; }
.impact-divider { width: 1px; height: 46px; background: var(--strong-subtle); }
.impact-metric { display: grid; justify-items: end; gap: 5px; }
.impact-metric span { color: var(--strong-muted); font-size: 9px; font-weight: 800; }
.impact-metric b { font-family: Georgia, serif; font-size: 23px; font-weight: 400; }
.history-heading { margin-top: 28px; }
.history-list .event-card { border-left: 4px solid var(--mint); }

.profile-cover { display: flex; padding: 45px 20px 30px; align-items: center; gap: 16px; }
.profile-avatar { display: grid; width: 72px; height: 72px; flex: 0 0 72px; place-items: center; border: 1px solid var(--ink); border-radius: 24px; background: var(--lime); font-family: Georgia, serif; font-size: 35px; transform: rotate(-3deg); }
.profile-cover p { margin: 0 0 5px; color: var(--signal-dark); font-size: 9px; font-weight: 900; letter-spacing: 0.12em; }
.profile-cover h1 { margin: 0; font-family: Georgia, serif; font-size: 36px; font-weight: 400; line-height: 1; }
.profile-cover span { display: block; margin-top: 7px; color: var(--ink-soft); font-size: 11px; }
.profile-form { display: grid; gap: 13px; padding: 0 14px; }
.settings-card { padding: 20px; border: 1px solid var(--line); border-radius: 22px; background: var(--card); }
.settings-heading { display: flex; margin-bottom: 19px; align-items: center; gap: 12px; }
.settings-heading > span { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 50%; background: var(--paper-deep); font-size: 9px; font-weight: 900; }
.settings-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 23px; font-weight: 400; }
.settings-heading p { margin: 3px 0 0; color: var(--ink-soft); font-size: 10px; }
.mode-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.mode-picker button { display: grid; min-height: 70px; padding: 12px; text-align: left; border: 1px solid var(--line); border-radius: 14px; background: transparent; }
.mode-picker button.active { color: var(--strong-fg); border-color: var(--strong-bg); background: var(--strong-bg); }
.mode-picker b { font-family: Georgia, serif; font-size: 18px; font-weight: 400; }
.mode-picker small { margin-top: 5px; color: inherit; opacity: 0.8; font-size: 10px; text-transform: uppercase; }
.mode-picker button.active small { color: var(--strong-muted); opacity: 1; }
.settings-subtitle { display: block; margin: 18px 0 8px; }
.toggle-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.toggle-grid button, .weekday-picker button { min-height: 40px; padding: 7px; border: 1px solid var(--line); border-radius: 11px; background: transparent; font-size: 10px; font-weight: 800; }
.toggle-grid button.active, .weekday-picker button.active { color: var(--strong-fg); border-color: var(--strong-bg); background: var(--strong-bg); }
.weekday-picker { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 8px; }
.weekday-picker button { min-width: 0; padding: 5px 2px; }
.time-window { margin-top: 17px; }
.schedule-picker { display: grid; gap: 8px; }
.schedule-picker label { display: flex; min-height: 62px; padding: 11px 13px; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); cursor: pointer; }
.schedule-picker input { width: 19px; height: 19px; accent-color: var(--signal); }
.schedule-picker span { display: grid; gap: 3px; }
.schedule-picker b { font-size: 12px; }
.schedule-picker small { color: var(--ink-soft); font-size: 10px; text-transform: uppercase; }
.blocklist { display: flex; min-height: 29px; margin-top: 8px; flex-wrap: wrap; gap: 6px; }
.blocklist > span { display: inline-flex; max-width: 100%; min-height: 29px; padding: 5px 6px 5px 10px; align-items: center; gap: 5px; overflow-wrap: anywhere; border-radius: 15px; background: var(--mint); font-size: 10px; font-weight: 700; }
.blocklist > span button { display: grid; width: 19px; height: 19px; padding: 0; flex: 0 0 19px; place-items: center; color: var(--ink-soft); border: 0; border-radius: 50%; background: var(--paper); font-size: 14px; }
.blocklist-empty { margin: 4px 0; color: var(--ink-soft); font-size: 10px; }
.blocklist-label { display: block; margin-top: 20px; }
.inline-add { display: grid; grid-template-columns: 1fr auto; gap: 7px; margin-top: 9px; }
.inline-add input { min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; outline: none; background: var(--paper); font-size: 11px; }
.inline-add button { padding: 0 12px; border: 1px solid var(--ink); border-radius: 11px; background: transparent; font-size: 10px; font-weight: 900; }
.form-field { display: grid; gap: 7px; }
.form-field > span, .field-label { color: var(--ink-soft); font-size: 10px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; outline: none; background: var(--paper); font-size: 13px;
}
.form-field textarea { resize: vertical; line-height: 1.5; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.interest-controls { display: grid; gap: 16px; }
.interest-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; }
.interest-row label { font-size: 12px; font-weight: 700; }
.interest-row output { color: var(--signal-dark); font-family: Georgia, serif; font-size: 15px; }
.interest-row input { grid-column: 1 / -1; width: 100%; accent-color: var(--signal); }
.primary-button, .secondary-button { min-height: 50px; padding: 0 18px; border: 1px solid var(--ink); border-radius: 14px; font-size: 12px; font-weight: 900; }
.primary-button { color: var(--strong-fg); border-color: var(--strong-bg); background: var(--strong-bg); }
.secondary-button { background: transparent; }
.save-profile { margin: 3px 0 0; }
.data-note { display: flex; margin: 14px 14px 20px; padding: 17px; gap: 12px; border-radius: 18px; background: var(--mint); }
.data-note > span { font-size: 24px; }
.data-note p { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.data-note b { color: var(--ink); }

.bottom-nav {
  position: fixed; z-index: 40; left: 50%; bottom: 0; display: grid; width: min(100%, 760px); height: calc(70px + var(--safe-bottom)); padding: 7px 12px var(--safe-bottom); grid-template-columns: repeat(4, 1fr); border-top: 1px solid rgba(16, 39, 34, 0.1); background: rgba(255, 253, 248, 0.94); backdrop-filter: blur(20px); transform: translateX(-50%);
}
.bottom-nav button { position: relative; display: grid; padding: 4px; place-items: center; align-content: center; gap: 3px; color: var(--nav-muted); border: 0; background: none; }
.bottom-nav button span { height: 25px; font-family: Georgia, serif; font-size: 25px; line-height: 1; }
.bottom-nav button b { font-size: 10px; }
.bottom-nav button.active { color: var(--ink); }
.bottom-nav button.active span { color: var(--signal); }
.bottom-nav i { position: absolute; top: 1px; right: 22%; min-width: 15px; height: 15px; padding: 0 4px; color: var(--decision-fg); border-radius: 8px; background: var(--decision-bg); font-size: 9px; font-style: normal; font-weight: 800; line-height: 15px; }

.sheet-backdrop { position: fixed; z-index: 70; inset: 0; background: rgba(16, 39, 34, 0.42); backdrop-filter: blur(3px); }
.filter-sheet { position: fixed; z-index: 71; left: 50%; bottom: 0; width: min(100%, 760px); max-height: 92vh; padding: 8px 20px calc(22px + var(--safe-bottom)); overflow-y: auto; border-radius: 27px 27px 0 0; background: var(--card); transform: translate(-50%, 105%); transition: transform 0.26s ease; }
.filter-sheet.open { transform: translate(-50%, 0); }
.sheet-handle { width: 42px; height: 4px; margin: 2px auto 17px; border-radius: 3px; background: var(--line); }
.sheet-heading { display: flex; align-items: start; justify-content: space-between; }
.sheet-heading p { margin: 0 0 4px; color: var(--signal-dark); font-size: 9px; font-weight: 900; letter-spacing: 0.14em; }
.sheet-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 29px; font-weight: 400; }
.sheet-heading button, .dialog-close { display: grid; width: 38px; height: 38px; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: transparent; font-size: 22px; }
.filter-sheet fieldset { margin: 23px 0 0; padding: 0; border: 0; }
.filter-sheet legend { margin-bottom: 9px; color: var(--ink-soft); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.choice-grid.three { grid-template-columns: repeat(3, 1fr); }
.choice-grid button { min-height: 42px; border: 1px solid var(--line); border-radius: 12px; background: transparent; font-size: 11px; font-weight: 800; }
.choice-grid button.active { color: var(--strong-fg); border-color: var(--strong-bg); background: var(--strong-bg); }
.range-field { display: grid; gap: 14px; margin-top: 23px; }
.range-field > span { display: flex; align-items: center; justify-content: space-between; font-size: 10px; }
.range-field output { color: var(--signal-dark); font-family: Georgia, serif; font-size: 18px; }
.range-field input { width: 100%; accent-color: var(--signal); }
.sheet-actions { display: grid; grid-template-columns: 0.8fr 1.4fr; gap: 8px; margin-top: 25px; }

dialog { color: var(--ink); }
dialog::backdrop { background: rgba(16, 39, 34, 0.52); backdrop-filter: blur(4px); }
.event-dialog, .review-dialog, .calibration-dialog { width: min(calc(100% - 20px), 700px); max-height: calc(100vh - 32px); margin: auto; padding: 0; overflow: hidden; border: 0; border-radius: 25px; background: var(--card); box-shadow: 0 30px 80px rgba(10, 27, 22, 0.26); }
.dialog-scroll { max-height: calc(100vh - 32px); overflow-y: auto; }
.dialog-hero { min-height: 190px; padding: 22px; color: var(--strong-fg); background: var(--strong-bg); }
.dialog-hero-top { display: flex; align-items: center; justify-content: space-between; }
.dialog-hero .dialog-close { color: var(--strong-fg); border-color: var(--strong-subtle); }
.dialog-date { color: var(--strong-accent); font-size: 10px; font-weight: 800; letter-spacing: 0.12em; }
.dialog-hero h2 { display: -webkit-box; max-width: 570px; margin: 30px 0 0; overflow: hidden; font-family: Georgia, serif; font-size: clamp(30px, 8vw, 45px); font-weight: 400; line-height: 1.02; -webkit-box-orient: vertical; -webkit-line-clamp: 7; }
.dialog-body { padding: 22px; }
.dialog-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dialog-facts div { padding: 13px; border-radius: 13px; background: var(--paper); }
.dialog-facts span { display: block; color: var(--ink-soft); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.dialog-facts b { display: block; margin-top: 5px; font-size: 12px; }
.dialog-description { margin: 20px 0; white-space: pre-line; color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.decision-hero { margin: 16px 0 0; padding: 18px; color: var(--decision-fg); border-radius: 17px; background: var(--decision-bg); }
.decision-hero span { color: var(--decision-accent); font-size: 9px; font-weight: 900; letter-spacing: 0.14em; }
.decision-hero p { margin: 7px 0 0; font-family: Georgia, serif; font-size: 20px; line-height: 1.3; }
.why-block { padding: 17px; border-radius: 16px; background: var(--mint); }
.why-block h3 { margin: 0 0 9px; font-family: Georgia, serif; font-size: 20px; font-weight: 400; }
.why-block ul { margin: 0; padding-left: 18px; color: var(--ink-soft); font-size: 11px; line-height: 1.6; }
.insight-grid { display: grid; gap: 9px; }
.insight-block { display: flex; padding: 17px; gap: 12px; border: 1px solid var(--line); border-radius: 17px; }
.insight-block > span, .block-heading > span { display: grid; width: 29px; height: 29px; flex: 0 0 29px; place-items: center; border-radius: 50%; background: var(--paper-deep); font-size: 9px; font-weight: 900; }
.outcome-block { border: 0; background: var(--mint); }
.insight-block h3, .block-heading h3 { margin: 0; font-family: Georgia, serif; font-size: 20px; font-weight: 400; }
.insight-block ul, .watch-block ul { margin: 8px 0 0; padding-left: 17px; color: var(--ink-soft); font-size: 11px; line-height: 1.55; }
.insight-block li + li, .watch-block li + li { margin-top: 5px; }
.fit-block, .watch-block { margin-top: 10px; padding: 17px; border: 1px solid var(--line); border-radius: 17px; }
.block-heading { display: flex; align-items: center; gap: 12px; }
.block-heading p { margin: 3px 0 0; color: var(--ink-soft); font-size: 10px; }
.fit-list { display: grid; margin-top: 15px; gap: 10px; }
.fit-row { display: grid; grid-template-columns: 92px 1fr 31px; align-items: center; gap: 8px; font-size: 10px; }
.fit-row > span { color: var(--ink-soft); }
.fit-row > div { height: 6px; overflow: hidden; border-radius: 4px; background: var(--paper-deep); }
.fit-row > div i { display: block; height: 100%; border-radius: inherit; background: var(--signal); }
.fit-row > b { text-align: right; font-size: 10px; }
.watch-block { border: 0; background: var(--watch-bg); }
.source-proof { display: flex; margin-top: 10px; padding: 17px; align-items: center; justify-content: space-between; border-radius: 17px; color: var(--strong-fg); background: var(--strong-bg); }
.source-proof div { display: grid; max-width: 70%; gap: 3px; }
.source-proof div span { color: var(--strong-accent); font-size: 9px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; }
.source-proof div b { font-size: 12px; }
.source-proof div small { color: var(--strong-muted); font-size: 10px; }
.source-proof strong { display: flex; align-items: center; gap: 4px; color: var(--strong-accent); font-family: Georgia, serif; font-size: 30px; font-weight: 400; }
.source-proof strong i { color: var(--strong-muted); font-family: sans-serif; font-size: 9px; font-style: normal; font-weight: 800; line-height: 1.1; text-transform: uppercase; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.dialog-actions .wide { grid-column: 1 / -1; }
.dialog-actions a { display: grid; min-height: 50px; place-items: center; color: var(--ink); border: 1px solid var(--ink); border-radius: 14px; font-size: 12px; font-weight: 900; text-decoration: none; }

.review-dialog { padding: 25px 21px calc(23px + var(--safe-bottom)); }
.review-dialog form { position: relative; }
.review-dialog .dialog-close { position: absolute; top: -6px; right: -4px; }
.review-dialog h2 { margin: 0 45px 20px 0; font-family: Georgia, serif; font-size: 30px; font-weight: 400; line-height: 1.08; }
.outcome-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 19px; }
.outcome-picker button { min-height: 45px; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: transparent; font-size: 10px; font-weight: 800; }
.outcome-picker button.active { color: var(--strong-fg); border-color: var(--strong-bg); background: var(--strong-bg); }
.rating-picker { display: flex; gap: 5px; margin: 7px 0 18px; }
.rating-picker button { padding: 0; color: var(--rating-off); border: 0; background: none; font-size: 31px; line-height: 1; }
.rating-picker button.active { color: var(--signal); }
.reason-field { margin-bottom: 14px; }
.review-dialog .form-field { margin-top: 12px; }
.review-dialog .primary-button { width: 100%; margin-top: 18px; }

.calibration-shell { max-height: calc(100vh - 32px); padding: 22px 18px calc(20px + var(--safe-bottom)); overflow-y: auto; }
.calibration-header { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.calibration-header .eyebrow { margin-bottom: 7px; }
.calibration-header h2 { margin: 0; font-family: Georgia, serif; font-size: 29px; font-weight: 400; line-height: 1.05; }
.calibration-header .dialog-close { flex: 0 0 38px; }
.calibration-metrics { display: grid; margin-top: 18px; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.calibration-metrics article { display: grid; min-height: 65px; padding: 10px; align-content: space-between; border-radius: 13px; background: var(--paper); }
.calibration-metrics span { color: var(--ink-soft); font-size: 9px; font-weight: 900; letter-spacing: 0.07em; }
.calibration-metrics strong { font-family: Georgia, serif; font-size: 19px; font-weight: 400; }
.calibration-progress { height: 5px; margin-top: 9px; overflow: hidden; border-radius: 3px; background: var(--paper-deep); }
.calibration-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--signal); transition: width 0.25s ease; }
.calibration-explainer { margin: 12px 2px 16px; color: var(--ink-soft); font-size: 10px; line-height: 1.45; }
.calibration-skeleton { height: 410px; }
.calibration-card { padding: 18px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); }
.calibration-card-top { display: flex; align-items: center; justify-content: space-between; color: var(--signal-dark); font-size: 9px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.calibration-card-top strong { display: flex; width: 48px; height: 48px; align-items: center; justify-content: center; color: var(--ink); border: 1px solid var(--ink); border-radius: 50%; background: var(--lime); font-family: Georgia, serif; font-size: 20px; font-weight: 400; }
.calibration-card-top strong i { margin: 10px 0 0 1px; font-family: sans-serif; font-size: 9px; font-style: normal; }
.calibration-location { margin: 6px 58px 0 0; overflow: hidden; color: var(--ink-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.calibration-card h3 { margin: 18px 0 12px; font-family: Georgia, serif; font-size: 25px; font-weight: 400; line-height: 1.08; }
.calibration-decision { display: grid; padding: 12px 13px; gap: 4px; border-left: 3px solid var(--signal); border-radius: 0 11px 11px 0; background: var(--mint); }
.calibration-decision span { color: var(--signal-dark); font-size: 9px; font-weight: 900; letter-spacing: 0.1em; }
.calibration-decision b { font-size: 10px; line-height: 1.4; }
.calibration-description { display: -webkit-box; margin: 12px 0 0; overflow: hidden; color: var(--ink-soft); font-size: 11px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.calibration-details { width: 100%; min-height: 38px; margin-top: 12px; border: 1px solid var(--line); border-radius: 11px; background: transparent; font-size: 10px; font-weight: 800; }
.calibration-question { display: grid; margin-top: 18px; gap: 3px; }
.calibration-question span { font-size: 11px; font-weight: 800; }
.calibration-question small { color: var(--ink-soft); font-size: 9px; }
.calibration-labels { display: grid; margin-top: 9px; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.calibration-labels button { display: grid; min-width: 0; min-height: 58px; padding: 6px 2px; place-items: center; align-content: center; gap: 3px; border: 1px solid var(--line); border-radius: 11px; background: var(--card); }
.calibration-labels button:active { color: var(--strong-fg); border-color: var(--strong-bg); background: var(--strong-bg); }
.calibration-labels button:disabled { opacity: 0.45; }
.calibration-labels b { font-family: Georgia, serif; font-size: 20px; font-weight: 400; }
.calibration-labels span { max-width: 48px; font-size: 9px; font-weight: 800; line-height: 1.1; text-align: center; }
.calibration-undo { display: flex; margin-top: 10px; padding: 10px 12px; align-items: center; justify-content: space-between; border-radius: 11px; background: var(--mint); font-size: 10px; font-weight: 800; }
.calibration-undo[hidden] { display: none; }
.calibration-undo button { padding: 5px 8px; color: var(--signal-dark); border: 0; border-bottom: 1px solid currentColor; background: none; font-size: 10px; font-weight: 900; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: calc(84px + var(--safe-bottom)); max-width: calc(100% - 32px); padding: 12px 17px; color: var(--strong-fg); border-radius: 14px; background: var(--strong-bg); box-shadow: var(--shadow); font-size: 11px; font-weight: 700; opacity: 0; pointer-events: none; transform: translate(-50%, 14px); transition: 0.22s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.fatal-state { position: fixed; z-index: 200; inset: 0; display: grid; padding: 30px; place-content: center; justify-items: center; text-align: center; background: var(--paper); }
.fatal-state[hidden] { display: none; }
.fatal-state h1 { margin: 24px 0 10px; font-family: Georgia, serif; font-size: 36px; font-weight: 400; line-height: 1.05; }
.fatal-state p { max-width: 340px; margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.6; }

@media (min-width: 680px) {
  .feed-hero, .page-intro { padding-left: 30px; padding-right: 30px; }
  .sticky-tools { padding-left: 30px; padding-right: 30px; }
  .quick-filters { margin-left: -30px; margin-right: -30px; padding-left: 30px; padding-right: 30px; }
  .event-list { grid-template-columns: 1fr 1fr; padding: 0 20px; }
  .event-card { min-height: 100%; }
  .history-list .empty-state, #plansList .empty-state { grid-column: 1 / -1; }
  .profile-form { grid-template-columns: 1fr 1fr; padding: 0 20px; align-items: start; }
  .interests-card, .save-profile { grid-column: 1 / -1; }
  .plan-summary, .segment-control { margin-left: 20px; margin-right: 20px; }
  .impact-card { margin-left: 20px; margin-right: 20px; }
}

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

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #eaf2ed;
    --ink-soft: #a6b3ae;
    --paper: #10201c;
    --paper-deep: #1a2d27;
    --card: #172923;
    --line: rgba(235, 245, 239, 0.17);
    --signal: #ff7458;
    --signal-dark: #ff8b73;
    --lime: #c4dc78;
    --mint: #27463d;
    --strong-bg: #eaf2ed;
    --strong-fg: #102722;
    --strong-muted: rgba(16, 39, 34, 0.72);
    --strong-subtle: rgba(16, 39, 34, 0.2);
    --strong-accent: #5c6e2c;
    --decision-bg: #ff8b73;
    --decision-fg: #102722;
    --decision-accent: #102722;
    --control-bg: #172923;
    --tag-bg: #1a2d27;
    --culture-bg: #443a2a;
    --sport-bg: #3a3145;
    --watch-bg: #3b2d27;
    --nav-muted: #a6b3ae;
    --rating-off: #7f908a;
    --shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
  }
  body { background: radial-gradient(circle at 92% -8%, rgba(196, 220, 120, 0.09), transparent 28rem), var(--paper); }
  .topbar { background: rgba(16, 32, 28, 0.9); }
  .score-badge, .radar-mark, .plan-summary article.accent { color: #102722; }
  .bottom-nav { background: rgba(23, 41, 35, 0.95); }
}
