:root {
  color-scheme: dark;
  --bg: #06100e;
  --surface: #0b1d19;
  --surface-soft: rgba(12, 31, 26, .84);
  --surface-raised: rgba(17, 43, 35, .92);
  --line: rgba(174, 222, 198, .14);
  --line-strong: rgba(174, 222, 198, .27);
  --text: #f4fbf7;
  --muted: #91aa9f;
  --muted-dark: #637b70;
  --green: #ff7d9d;
  --green-deep: #d94f7b;
  --rose: #ff91a8;
  --rose-light: #ffd2dc;
  --gold: #ffd08a;
  --red: #ff8178;
  --blue: #7ac2ff;
  --radius: 20px;
  --shadow: 0 24px 80px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Microsoft YaHei UI", "PingFang SC", Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.ambient { position: fixed; z-index: -2; border-radius: 50%; filter: blur(30px); pointer-events: none; }
.ambient-one { width: 42vw; height: 42vw; right: -14vw; top: -20vw; background: rgba(216, 72, 117, .16); }
.ambient-two { width: 32vw; height: 32vw; left: -12vw; bottom: -18vw; background: rgba(160, 62, 95, .09); }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .35;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, #000 0, transparent 90%);
}

.topbar {
  width: min(1500px, calc(100% - 48px));
  height: 66px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 125, 157, .52);
  border-radius: 50%;
  background: rgba(255, 125, 157, .07);
  box-shadow: 0 0 24px rgba(255, 125, 157, .14);
}
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; background: var(--green); opacity: .72; }
.brand-mark::before { width: 1px; height: 26px; }
.brand-mark::after { width: 26px; height: 1px; }
.brand-mark i { width: 8px; height: 8px; z-index: 1; border: 2px solid var(--green); border-radius: 50%; background: var(--bg); }
.brand-copy strong { display: block; color: var(--text); font-size: 15px; letter-spacing: .04em; }
.brand-copy small { display: block; margin-top: 3px; color: var(--muted-dark); font-size: 9px; letter-spacing: .16em; }
.top-actions, .live-indicator { display: flex; align-items: center; }
.top-actions { gap: 22px; }
.live-indicator { gap: 8px; color: #b6c9c0; font-size: 12px; }
.live-indicator i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }
.live-indicator.offline i { background: var(--red); box-shadow: 0 0 12px var(--red); }
.scan-button {
  min-width: 126px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #052117;
  border: 0;
  border-radius: 10px;
  background: var(--green);
  box-shadow: 0 8px 24px rgba(255, 125, 157, .14);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, opacity .2s;
}
.scan-button:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(255, 125, 157, .24); }
.scan-button:disabled { opacity: .55; cursor: wait; transform: none; }
.scan-icon { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; }
.scan-button:disabled .scan-icon { animation: spin .9s linear infinite; }

.dashboard {
  width: min(1500px, calc(100% - 48px));
  margin: 0 auto;
}
.hero-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(430px, 1.25fr) minmax(220px, .62fr) minmax(290px, .76fr);
  align-items: center;
  gap: clamp(24px, 3vw, 52px);
  padding: 30px 34px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(120deg, rgba(15, 38, 32, .94), rgba(8, 25, 21, .78));
  box-shadow: var(--shadow);
}
.hero-card::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  left: -240px;
  top: -260px;
  border-radius: 50%;
  background: rgba(255, 145, 168, .09);
  filter: blur(30px);
  pointer-events: none;
}
.dedication { position: relative; z-index: 1; min-width: 0; }
.love-kicker {
  margin: 0 0 5px;
  color: var(--rose-light);
  font-size: clamp(15px, 1.3vw, 19px);
  font-weight: 700;
  letter-spacing: .12em;
}
.love-kicker span { margin-right: 7px; color: var(--rose); text-shadow: 0 0 18px rgba(255, 145, 168, .5); }
h1 {
  margin: 0;
  color: var(--rose-light);
  font-family: "STKaiti", "KaiTi", "Microsoft YaHei UI", sans-serif;
  font-size: clamp(68px, 6vw, 100px);
  font-weight: 800;
  line-height: .95;
  letter-spacing: .13em;
  text-shadow: 0 5px 34px rgba(255, 125, 155, .2);
}
.radar-title { margin: 12px 0 0; color: #dcebe4; font-size: clamp(22px, 2vw, 31px); font-weight: 500; letter-spacing: .05em; }
.radar-title strong { color: var(--green); font-weight: 850; }
.hero-description { max-width: 690px; margin: 12px 0 0; color: #a8bdb3; font-size: 13px; line-height: 1.65; }
.system-strip { margin-top: 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 15px; color: var(--muted-dark); font-size: 10px; }
.scan-message { min-height: 29px; display: inline-flex; align-items: center; padding: 0 11px; color: #bdd0c7; border: 1px solid var(--line); border-radius: 8px; background: rgba(4, 17, 14, .52); }
.source-summary b { margin-right: 3px; color: var(--green); }

.radar-panel { min-width: 0; justify-self: center; width: min(100%, 250px); }
.radar {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(255, 125, 157, .28);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(112, 36, 64, .28), rgba(27, 10, 19, .82) 70%);
  box-shadow: inset 0 0 55px rgba(180, 46, 91, .17), 0 0 48px rgba(217, 79, 123, .08);
}
.radar-grid {
  position: absolute;
  inset: 10%;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: radial-gradient(circle, transparent 24.7%, var(--line-strong) 25%, transparent 25.5%, transparent 49.7%, var(--line-strong) 50%, transparent 50.5%, transparent 74.7%, var(--line-strong) 75%, transparent 75.5%);
}
.radar-cross { position: absolute; background: var(--line-strong); }
.radar-cross-x { left: 7%; right: 7%; top: 50%; height: 1px; }
.radar-cross-y { top: 7%; bottom: 7%; left: 50%; width: 1px; }
.radar-sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 15deg, transparent 0deg, transparent 302deg, rgba(255,125,157,.02) 315deg, rgba(255,125,157,.4) 359deg, transparent 360deg);
  animation: sweep 5s linear infinite;
}
.radar-panel:not(.scanning) .radar-sweep { animation-duration: 12s; opacity: .55; }
.radar-core {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: 80px;
  height: 80px;
  transform: translate(-50%, -50%);
  display: grid;
  place-content: center;
  text-align: center;
  border: 1px solid rgba(255, 125, 157, .34);
  border-radius: 50%;
  background: rgba(5, 24, 17, .91);
  box-shadow: 0 0 25px rgba(255, 125, 157, .13);
}
.radar-core strong { color: var(--green); font-size: 26px; line-height: 1; }
.radar-core span { margin-top: 5px; color: #849d91; font-size: 9px; }
.radar-signal { position: absolute; z-index: 3; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 4px 2px rgba(255,125,157,.3), 0 0 18px var(--green); animation: pulse 2.4s ease-in-out infinite; }
.radar-meta { margin-top: 10px; display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.radar-meta i { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }

.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.metrics article {
  min-height: 102px;
  padding: 16px 17px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(6, 22, 18, .58);
}
.metrics article.metric-live { border-color: rgba(255, 125, 157, .25); background: rgba(102, 31, 58, .42); }
.metrics span { color: #bfd0c8; font-size: 12px; font-weight: 650; }
.metrics strong { grid-row: span 2; align-self: center; color: var(--text); font-size: 36px; line-height: 1; }
.metrics .metric-live strong { color: var(--green); }
.metrics small { margin-top: 7px; color: var(--muted-dark); font-size: 9px; }

.events-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 18px 22px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(7, 23, 19, .72);
  box-shadow: var(--shadow);
}
.events-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.events-title { min-width: 0; display: flex; align-items: center; gap: 12px; }
.section-mark { width: 4px; height: 38px; border-radius: 4px; background: linear-gradient(var(--green), var(--green-deep)); box-shadow: 0 0 16px rgba(255,125,157,.25); }
.events-title p { margin: 0 0 2px; color: var(--green-deep); font-size: 9px; font-weight: 800; letter-spacing: .17em; }
.events-title h2 { margin: 0; color: var(--text); font-size: 22px; line-height: 1; }
.result-count { color: var(--muted); font-size: 11px; white-space: nowrap; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; }
.search-box input {
  width: 220px;
  height: 36px;
  padding: 0 12px;
  color: var(--text);
  border: 1px solid var(--line);
  outline: none;
  border-radius: 9px;
  background: rgba(3, 15, 12, .68);
  font-size: 11px;
}
.search-box input:focus { border-color: rgba(255,125,157,.48); box-shadow: 0 0 0 3px rgba(255,125,157,.06); }
.search-box input::placeholder { color: #587066; }
.page-controls { height: 36px; display: inline-flex; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; }
.page-controls button { width: 36px; height: 100%; padding: 0; color: var(--green); border: 0; background: rgba(255,125,157,.05); font-size: 22px; cursor: pointer; }
.page-controls button:hover:not(:disabled) { background: rgba(255,125,157,.12); }
.page-controls button:disabled { color: #40574d; cursor: default; }
.page-controls span { min-width: 48px; color: #a8bcb3; text-align: center; font-size: 10px; }
.filters { margin: 13px 0; display: flex; flex-wrap: nowrap; gap: 6px; }
.filters button { min-height: 30px; padding: 0 12px; color: var(--muted); border: 1px solid transparent; border-radius: 8px; background: transparent; font-size: 11px; cursor: pointer; }
.filters button:hover { color: var(--text); background: rgba(255,255,255,.025); }
.filters button.active { color: var(--green); border-color: rgba(255,125,157,.25); background: rgba(255,125,157,.08); }
.event-list { min-height: 0; flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.loading-card, .empty-card {
  grid-column: 1 / -1;
  min-height: 0;
  display: grid;
  place-content: center;
  padding: 28px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: rgba(6, 20, 16, .38);
}
.empty-card strong { margin-bottom: 8px; color: var(--text); font-size: 19px; }
.empty-card span { max-width: 520px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.event-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  column-gap: 15px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(15, 38, 32, .94), rgba(7, 23, 19, .8));
  transition: transform .2s, border-color .2s, background .2s;
}
.event-card:hover { transform: translateY(-2px); border-color: var(--line-strong); background: linear-gradient(145deg, rgba(18, 46, 38, .97), rgba(7, 23, 19, .86)); }
.event-card::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px; background: var(--status-color, var(--muted)); box-shadow: 0 0 18px var(--status-color, transparent); }
.date-block { grid-row: 1 / 3; padding-right: 14px; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid var(--line); }
.date-block strong { color: var(--text); font-size: 37px; line-height: 1; letter-spacing: -.05em; }
.date-block span { margin-top: 5px; color: var(--muted); font-size: 12px; }
.date-block small { margin-top: 12px; color: var(--green); font-size: 11px; font-weight: 750; }
.event-info { min-width: 0; align-self: center; }
.event-topline { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.status-badge, .platform-badge { min-height: 22px; display: inline-flex; align-items: center; padding: 0 8px; border-radius: 6px; font-size: 9px; font-weight: 750; }
.status-badge { color: var(--status-color); border: 1px solid color-mix(in srgb, var(--status-color) 28%, transparent); background: color-mix(in srgb, var(--status-color) 8%, transparent); }
.platform-badge { color: #9db3a8; border: 1px solid var(--line); }
.confidence { width: 100%; color: var(--muted-dark); font-size: 9px; }
.event-info h3 { margin: 0; overflow: hidden; display: -webkit-box; color: #f2faf6; font-size: 16px; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.event-details { margin-top: 10px; display: grid; gap: 6px; color: #91a99e; font-size: 11px; }
.event-details span { min-width: 0; display: flex; align-items: center; gap: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-details i { flex: 0 0 auto; width: 5px; height: 5px; border: 1px solid var(--green-deep); border-radius: 50%; }
.evidence { display: none; }
.ticket-actions {
  grid-column: 1 / -1;
  margin-top: 15px;
  padding-top: 13px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 7px 12px;
  border-top: 1px solid var(--line);
}
.price { color: var(--gold); font-size: 14px; font-weight: 800; }
.ticket-link { min-width: 114px; height: 34px; display: inline-flex; align-items: center; justify-content: center; color: #052117; border: 0; border-radius: 8px; background: var(--green); text-decoration: none; font-size: 11px; font-weight: 800; }
.ticket-link:hover { filter: brightness(1.08); }
.ticket-link.disabled { color: var(--muted); border: 1px solid var(--line); background: transparent; pointer-events: none; }
.extra-links { grid-column: 1; grid-row: 2; color: var(--muted-dark); font-size: 9px; }
.background-data { display: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@keyframes sweep { to { transform: rotate(360deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .28; transform: scale(.68); } }

@media (min-width: 781px) {
  html, body { height: 100%; overflow: hidden; }
  .dashboard {
    height: calc(100dvh - 66px);
    padding: 16px 0 18px;
    display: grid;
    grid-template-rows: minmax(270px, 39%) minmax(0, 1fr);
    gap: 14px;
  }
}

@media (max-width: 1220px) and (min-width: 781px) {
  .hero-card { grid-template-columns: minmax(350px, 1.15fr) 200px 260px; gap: 22px; padding-inline: 25px; }
  h1 { font-size: clamp(62px, 6vw, 82px); }
  .radar-title { font-size: 23px; }
  .hero-description { font-size: 12px; }
  .metrics article { min-height: 92px; padding: 13px; }
  .metrics strong { font-size: 31px; }
  .event-card { padding: 15px; grid-template-columns: 68px minmax(0, 1fr); column-gap: 12px; }
  .event-info h3 { font-size: 14px; }
}

@media (max-width: 980px) and (min-width: 781px) {
  .dashboard { grid-template-rows: minmax(245px, 37%) minmax(0, 1fr); }
  .hero-card { grid-template-columns: minmax(330px, 1fr) 190px 220px; gap: 16px; padding: 20px; }
  .love-kicker { font-size: 14px; }
  h1 { font-size: 60px; }
  .radar-title { font-size: 20px; }
  .hero-description { font-size: 11px; line-height: 1.5; }
  .system-strip { margin-top: 9px; }
  .radar-core { width: 65px; height: 65px; }
  .metrics { gap: 7px; }
  .metrics article { min-height: 82px; padding: 10px; }
  .metrics span { font-size: 10px; }
  .metrics strong { font-size: 27px; }
  .metrics small { font-size: 8px; }
  .event-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters button { padding-inline: 8px; }
  .search-box input { width: 180px; }
}

@media (max-height: 760px) and (min-width: 781px) {
  .dashboard { padding-top: 10px; padding-bottom: 10px; grid-template-rows: minmax(225px, 37%) minmax(0, 1fr); gap: 10px; }
  .hero-card { padding-top: 18px; padding-bottom: 18px; }
  h1 { font-size: clamp(58px, 8vh, 76px); }
  .hero-description { margin-top: 7px; line-height: 1.45; }
  .system-strip { margin-top: 8px; }
  .radar-panel { width: min(100%, 210px); }
  .metrics article { min-height: 78px; }
  .events-panel { padding-top: 13px; padding-bottom: 13px; }
  .filters { margin: 8px 0; }
  .event-card { padding-top: 13px; padding-bottom: 13px; }
  .date-block strong { font-size: 32px; }
  .ticket-actions { margin-top: 9px; padding-top: 8px; }
}

@media (max-width: 780px) {
  body { overflow-x: hidden; }
  .topbar, .dashboard { width: calc(100% - 28px); }
  .topbar { height: 64px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-copy strong { font-size: 13px; }
  .brand-copy small, .live-indicator { display: none; }
  .scan-button { min-width: 102px; height: 36px; }
  .dashboard { padding: 14px 0 26px; }
  .hero-card { grid-template-columns: 1fr; gap: 24px; padding: 25px 21px; }
  .love-kicker { font-size: 15px; }
  h1 { font-size: clamp(66px, 21vw, 90px); }
  .radar-title { font-size: 24px; }
  .hero-description { font-size: 13px; }
  .radar-panel { width: min(78vw, 300px); }
  .metrics { width: 100%; }
  .metrics article { min-height: 92px; }
  .events-panel { margin-top: 14px; padding: 17px 15px; }
  .events-header { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { width: 100%; }
  .search-box { flex: 1; }
  .search-box input { width: 100%; }
  .filters { overflow-x: auto; padding-bottom: 4px; }
  .filters button { flex: 0 0 auto; }
  .event-list { grid-template-columns: 1fr; }
  .event-card { min-height: 270px; }
}

@media (max-width: 480px) {
  .brand-copy strong { font-size: 12px; }
  .scan-button { min-width: 92px; font-size: 11px; }
  .hero-card { padding-inline: 17px; }
  .love-kicker { letter-spacing: .06em; }
  .radar-title { font-size: 21px; }
  .system-strip { align-items: flex-start; flex-direction: column; }
  .metrics article { min-height: 86px; padding: 12px; }
  .metrics strong { font-size: 30px; }
  .events-title h2 { font-size: 19px; }
  .result-count { display: none; }
  .event-card { grid-template-columns: 66px minmax(0, 1fr); padding: 15px; }
}

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

/* Rose love theme — warm, romantic, and intentionally free of green UI accents. */
:root {
  --bg: #160a12;
  --surface: #24121b;
  --surface-soft: rgba(38, 18, 28, .88);
  --surface-raised: rgba(50, 23, 35, .94);
  --line: rgba(255, 198, 212, .16);
  --line-strong: rgba(255, 198, 212, .3);
  --text: #fff8fa;
  --muted: #c4a8b2;
  --muted-dark: #8d6e79;
  --green: #ff7d9d;
  --green-deep: #d94f7b;
  --rose: #ff7d9d;
  --rose-light: #ffe0e7;
  --gold: #ffd49c;
  --blue: #bda5ff;
}
body {
  background:
    radial-gradient(circle at 82% 4%, rgba(196, 58, 103, .18), transparent 31rem),
    radial-gradient(circle at 3% 88%, rgba(137, 62, 101, .12), transparent 30rem),
    var(--bg);
}
.ambient-one { background: rgba(216, 72, 117, .2); }
.ambient-two { background: rgba(255, 173, 195, .1); }
.brand-mark {
  border-color: rgba(255, 125, 157, .56);
  background: rgba(255, 125, 157, .08);
  box-shadow: 0 0 24px rgba(255, 125, 157, .17);
}
.scan-button { box-shadow: 0 8px 24px rgba(255, 125, 157, .18); }
.scan-button:hover { box-shadow: 0 10px 30px rgba(255, 125, 157, .28); }
.hero-card {
  background: linear-gradient(120deg, rgba(52, 24, 37, .96), rgba(28, 13, 22, .88));
  box-shadow: 0 24px 80px rgba(30, 5, 17, .34);
}
.hero-card::after { background: rgba(255, 125, 157, .13); }
.radar {
  border-color: rgba(255, 125, 157, .33);
  background: radial-gradient(circle, rgba(112, 36, 64, .3), rgba(27, 10, 19, .88) 70%);
  box-shadow: inset 0 0 55px rgba(180, 46, 91, .2), 0 0 48px rgba(255, 125, 157, .1);
}
.radar-sweep {
  background: conic-gradient(from 15deg, transparent 0deg, transparent 302deg, rgba(255,125,157,.02) 315deg, rgba(255,125,157,.44) 359deg, transparent 360deg);
}
.radar-core {
  border-color: rgba(255, 125, 157, .38);
  background: rgba(35, 10, 21, .92);
  box-shadow: 0 0 25px rgba(255, 125, 157, .17);
}
.radar-signal { box-shadow: 0 0 4px 2px rgba(255,125,157,.32), 0 0 18px var(--green); }
.metrics article { background: rgba(37, 16, 26, .65); }
.metrics article.metric-live { border-color: rgba(255, 125, 157, .28); background: rgba(102, 31, 58, .4); }
.events-panel {
  background: rgba(31, 13, 22, .78);
  box-shadow: 0 24px 80px rgba(30, 5, 17, .3);
}
.event-card { background: linear-gradient(145deg, rgba(49, 22, 34, .96), rgba(27, 12, 20, .86)); }
.event-card:hover { background: linear-gradient(145deg, rgba(61, 27, 42, .98), rgba(30, 13, 22, .9)); }
.loading-card, .empty-card { background: rgba(37, 15, 25, .45); }
.search-box input { background: rgba(27, 10, 18, .76); }
.search-box input:focus { border-color: rgba(255,125,157,.5); box-shadow: 0 0 0 3px rgba(255,125,157,.07); }
.filters button.active { border-color: rgba(255,125,157,.28); background: rgba(255,125,157,.09); }
.page-controls button { background: rgba(255,125,157,.06); }
.page-controls button:hover:not(:disabled) { background: rgba(255,125,157,.14); }
.ticket-link { box-shadow: 0 7px 20px rgba(255, 125, 157, .12); }
.ticket-link.lead-link { color: var(--rose-light); border: 1px solid rgba(255, 125, 157, .34); background: rgba(255, 125, 157, .1); box-shadow: none; }
.ticket-link.lead-link:hover { background: rgba(255, 125, 157, .2); }

/* Main tabs and protected life-planning workspace */
[hidden] { display: none !important; }
.main-tabs {
  height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(35, 14, 23, .66);
}
.main-tab {
  height: 32px;
  padding: 0 18px;
  color: var(--muted);
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: color .2s, background .2s, box-shadow .2s;
}
.main-tab span { margin-left: 4px; color: var(--rose); }
.main-tab:hover { color: var(--text); }
.main-tab.active {
  color: #32101e;
  background: linear-gradient(135deg, #ffd4df, #ff89a7);
  box-shadow: 0 6px 18px rgba(255, 125, 157, .2);
}
.main-tab:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; }
body.planning-active .top-actions { visibility: hidden; }

.planning-shell {
  width: min(1500px, calc(100% - 48px));
  margin: 0 auto;
}
.auth-card {
  position: relative;
  overflow: hidden;
  width: min(520px, 100%);
  margin: auto;
  padding: 46px 48px 42px;
  text-align: center;
  border: 1px solid rgba(255, 191, 208, .23);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(60, 25, 40, .96), rgba(30, 12, 21, .94));
  box-shadow: 0 28px 90px rgba(32, 3, 17, .4);
}
.auth-card::before, .auth-card::after {
  content: "";
  position: absolute;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  filter: blur(20px);
  pointer-events: none;
}
.auth-card::before { right: -150px; top: -145px; background: rgba(255, 125, 157, .16); }
.auth-card::after { left: -165px; bottom: -160px; background: rgba(255, 204, 218, .08); }
.auth-ornament { position: relative; z-index: 1; color: var(--rose); font-size: 30px; text-shadow: 0 0 25px rgba(255, 125, 157, .45); }
.auth-eyebrow { position: relative; z-index: 1; margin: 12px 0 5px; color: var(--rose); font-size: 10px; font-weight: 850; letter-spacing: .22em; }
.auth-card h1 { position: relative; z-index: 1; margin: 0; font-size: 48px; letter-spacing: .09em; }
.auth-card > p:not(.auth-eyebrow):not(.auth-message):not(.auth-privacy) { position: relative; z-index: 1; margin: 18px auto 0; max-width: 390px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.auth-form { position: relative; z-index: 1; margin-top: 27px; display: grid; gap: 10px; text-align: left; }
.auth-form label { color: #e6cbd3; font-size: 11px; font-weight: 700; }
.auth-form input {
  width: 100%;
  height: 48px;
  padding: 0 15px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  outline: none;
  border-radius: 11px;
  background: rgba(19, 7, 13, .62);
  color-scheme: dark;
  font-size: 14px;
}
.auth-form input:focus { border-color: var(--rose); box-shadow: 0 0 0 4px rgba(255, 125, 157, .08); }
.auth-form button {
  height: 46px;
  margin-top: 4px;
  color: #37101f;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, #ffd5df, #ff82a2);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}
.auth-form button:disabled { opacity: .55; cursor: wait; }
.auth-message { position: relative; z-index: 1; min-height: 20px; margin: 13px 0 0; color: var(--gold); font-size: 11px; }
.auth-privacy { position: relative; z-index: 1; margin: 8px 0 0; color: #765b66; font-size: 9px; }

.plan-workspace {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(45, 19, 31, .94), rgba(25, 10, 18, .92));
  box-shadow: 0 24px 80px rgba(30, 5, 17, .32);
}
.plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 28px 17px;
  border-bottom: 1px solid var(--line);
}
.plan-kicker { margin: 0 0 4px; color: var(--rose); font-size: 9px; font-weight: 850; letter-spacing: .22em; }
.plan-header h1 { margin: 0; color: var(--text); font-family: inherit; font-size: 26px; line-height: 1.1; letter-spacing: -.03em; text-shadow: none; }
.plan-header > div > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 10px; }
.logout-button {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 14px;
  color: #e8bdc9;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(255, 255, 255, .025);
  font-size: 10px;
  cursor: pointer;
}
.logout-button:hover { color: var(--text); border-color: var(--rose); }
.plan-chapters {
  padding: 10px 20px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}
.plan-chapters button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 14px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}
.plan-chapters button:hover { color: var(--text); }
.plan-chapters button.active { color: var(--rose-light); border-color: rgba(255, 125, 157, .25); background: rgba(255, 125, 157, .09); }
.plan-body {
  min-height: 0;
  overflow: auto;
  padding: 20px 24px 28px;
  outline: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 125, 157, .35) transparent;
}
.plan-loading, .plan-error { min-height: 240px; display: grid; place-content: center; color: var(--muted); text-align: center; }
.plan-error { color: var(--red); }
.plan-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.plan-summary-card {
  min-height: 120px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, .025);
}
.plan-summary-card span { color: var(--muted); font-size: 11px; }
.plan-summary-card strong { margin-top: 8px; color: var(--rose-light); font-size: 22px; }
.plan-summary-card small { margin-top: 7px; color: var(--muted-dark); font-size: 9px; line-height: 1.5; }
.plan-summary-card.tone-home { border-top-color: #eaa9bc; }
.plan-summary-card.tone-car { border-top-color: #bda5ff; }
.plan-summary-card.tone-wedding { border-top-color: #ff7d9d; }
.plan-summary-card.tone-money { border-top-color: #ffd49c; }
.plan-section { margin-top: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255, 255, 255, .018); }
.plan-section > header { margin-bottom: 13px; display: flex; align-items: center; justify-content: space-between; }
.plan-section > header h2 { margin: 0; color: var(--text); font-size: 16px; }
.plan-section > header p { margin: 5px 0 0; color: var(--muted-dark); font-size: 9px; }
.focus-list { margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; list-style: none; }
.focus-list li { min-height: 62px; padding: 11px 13px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 5px 10px; border-radius: 10px; background: rgba(19, 7, 13, .44); }
.focus-priority { grid-row: 1 / 3; min-width: 38px; padding: 5px; color: var(--rose-light); border-radius: 6px; background: rgba(255, 125, 157, .12); text-align: center; font-size: 9px; }
.focus-list time { color: var(--muted-dark); font-size: 9px; }
.focus-list strong { color: #f6e9ed; font-size: 11px; }
.focus-list small { grid-column: 3; grid-row: 1 / 3; color: var(--muted); font-size: 9px; }
.chapter-stack { display: grid; gap: 0; }
.chapter-intro { padding: 3px 4px 12px; display: flex; align-items: center; gap: 15px; }
.chapter-intro > span { width: 50px; height: 50px; display: grid; place-content: center; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 125, 157, .07); color: var(--gold); font-size: 23px; }
.chapter-intro h2 { margin: 0; color: var(--text); font-size: 22px; }
.chapter-intro p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.plan-table-wrap { overflow-x: auto; }
.plan-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.plan-table th { padding: 9px 11px; color: #dbbdc6; background: rgba(255, 125, 157, .06); text-align: left; font-weight: 750; white-space: nowrap; }
.plan-table td { padding: 10px 11px; color: #bfa8b0; border-bottom: 1px solid rgba(255, 198, 212, .08); line-height: 1.45; }
.plan-table tr:last-child td { border-bottom: 0; }
.plan-table td:first-child { color: #f0dfe4; font-weight: 650; }
.plan-status { display: inline-flex; min-height: 21px; align-items: center; padding: 0 7px; border-radius: 6px; white-space: nowrap; font-size: 8px; }
.plan-status.is-progress { color: var(--gold); background: rgba(255, 212, 156, .09); }
.plan-status.is-done { color: #e8b5c5; background: rgba(255, 125, 157, .09); }
.plan-status.is-pending { color: var(--muted); background: rgba(255, 255, 255, .04); }
.plan-notes { margin-top: 12px; display: grid; gap: 6px; }
.plan-notes p { margin: 0; padding: 8px 10px; color: var(--muted); border-radius: 8px; background: rgba(255, 212, 156, .04); font-size: 9px; line-height: 1.55; }
.plan-notes span { margin-right: 8px; color: var(--rose); }
.plan-todos { margin: 0; padding: 0; display: grid; gap: 8px; list-style: none; }
.plan-todos li { min-height: 38px; padding: 9px 11px; display: flex; align-items: center; gap: 10px; color: #d7c0c8; border-radius: 9px; background: rgba(19, 7, 13, .42); font-size: 10px; }
.todo-box { flex: 0 0 auto; width: 15px; height: 15px; border: 1px solid var(--line-strong); border-radius: 4px; }
.schedule-heading { margin: 28px 0 4px; padding: 20px; border-radius: 15px; background: linear-gradient(120deg, rgba(116, 36, 65, .35), rgba(255, 125, 157, .05)); }
.schedule-heading span { color: var(--rose); font-size: 9px; font-weight: 850; letter-spacing: .2em; }
.schedule-heading h2 { margin: 6px 0 0; font-size: 21px; }
.schedule-heading p { margin: 7px 0 0; color: var(--muted); font-size: 10px; }
.board-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.board-column { padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255, 255, 255, .018); }
.board-column h2 { margin: 0 0 12px; color: var(--text); font-size: 15px; }
.board-column h2 span { margin-right: 8px; }
.board-column article { padding: 10px 0; display: grid; grid-template-columns: auto 1fr; gap: 5px 8px; border-bottom: 1px solid rgba(255, 198, 212, .08); }
.board-column article:last-child { border-bottom: 0; }
.priority { padding: 3px 6px; border-radius: 5px; background: rgba(255, 125, 157, .1); color: var(--rose-light); font-size: 8px; }
.board-column time { align-self: center; color: var(--muted-dark); font-size: 8px; }
.board-column p { grid-column: 1 / -1; margin: 0; color: #d8c3ca; font-size: 10px; line-height: 1.45; }
.fund-advice { margin-top: 16px; padding: 18px; border: 1px solid rgba(255, 212, 156, .2); border-radius: 14px; background: rgba(255, 212, 156, .045); }
.fund-advice span { color: var(--gold); font-size: 10px; font-weight: 800; }
.fund-advice p { margin: 8px 0 0; color: #d1bfc1; font-size: 11px; line-height: 1.7; }

.status-on_sale { --status-color: #ff7d9d; }
.status-pre_sale { --status-color: #ffd49c; }
.status-registration { --status-color: #bda5ff; }
.status-lead { --status-color: #ff9fba; }
.status-sold_out { --status-color: #ff8178; }
.status-unknown { --status-color: #a98d97; }
.signal-1 { left: 28%; top: 29%; animation-delay: 0s; }
.signal-2 { left: 67%; top: 22%; animation-delay: -.31s; }
.signal-3 { left: 77%; top: 51%; animation-delay: -.62s; }
.signal-4 { left: 63%; top: 75%; animation-delay: -.93s; }
.signal-5 { left: 34%; top: 70%; animation-delay: -1.24s; }
.signal-6 { left: 18%; top: 50%; animation-delay: -1.55s; }
.signal-7 { left: 49%; top: 17%; animation-delay: -1.86s; }
.signal-8 { left: 84%; top: 67%; animation-delay: -2.17s; }
.signal-9 { left: 42%; top: 83%; animation-delay: -2.48s; }
.signal-10 { left: 70%; top: 39%; animation-delay: -2.79s; }

@media (min-width: 781px) {
  .planning-shell {
    height: calc(100dvh - 66px);
    padding: 16px 0 18px;
    display: grid;
    place-items: center;
  }
  .planning-shell .plan-workspace { width: 100%; }
}

@media (max-width: 980px) {
  .main-tab { padding-inline: 12px; }
  .plan-summary-grid { grid-template-columns: 1fr 1fr; }
  .board-grid { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .topbar { height: 112px; flex-wrap: wrap; }
  .main-tabs { order: 3; width: 100%; height: 38px; }
  .main-tab { flex: 1; height: 30px; }
  body.planning-active .top-actions { visibility: visible; }
  body.planning-active .scan-button { display: none; }
  .planning-shell { width: calc(100% - 28px); padding: 14px 0 28px; }
  .auth-card { margin-top: 18px; padding: 36px 24px 32px; }
  .auth-card h1 { font-size: 42px; }
  .plan-workspace { min-height: calc(100vh - 140px); overflow: visible; }
  .plan-header { align-items: flex-start; padding: 19px 17px 14px; }
  .plan-header h1 { font-size: 21px; }
  .plan-header > div > p:last-child { line-height: 1.6; }
  .plan-chapters { padding-inline: 12px; }
  .plan-body { overflow: visible; padding: 16px 13px 24px; }
  .plan-summary-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .plan-summary-card { min-height: 106px; padding: 13px; }
  .plan-summary-card strong { font-size: 17px; }
  .focus-list { grid-template-columns: 1fr; }
  .plan-section { padding: 13px; }
  .plan-table { font-size: 9px; min-width: 580px; }
  .board-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .top-actions { gap: 0; }
  .plan-summary-grid { grid-template-columns: 1fr; }
  .auth-card h1 { font-size: 38px; }
  .logout-button { padding-inline: 9px; }
}


/* Love-first controls: every action remains readable and carries a heart. */
.scan-button {
  min-width: 142px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffe1e8 0%, #ff8bab 52%, #ed5d86 100%);
}
.scan-icon {
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  color: #8d183e;
  font-size: 17px;
  line-height: 1;
  animation: heartbeat 1.7s ease-in-out infinite;
}
.scan-button:disabled .scan-icon { animation: heartbeat .9s ease-in-out infinite; }
.main-tab::before,
.filters button::before,
.plan-chapters button::before,
.auth-form button::before,
.logout-button::before,
.ticket-link:not(.disabled)::before {
  content: "♥";
  display: inline-block;
  margin-right: 6px;
  color: var(--rose);
  font-size: .82em;
  line-height: 1;
  text-shadow: 0 0 10px rgba(255, 125, 157, .42);
}
.main-tab.active::before,
.auth-form button::before,
.ticket-link:not(.lead-link):not(.disabled)::before { color: #8d183e; }
.ticket-link.lead-link::before { color: var(--rose-light); }
.main-tab span { display: none; }
.main-tab,
.filters button,
.plan-chapters button,
.auth-form button,
.logout-button,
.ticket-link {
  position: relative;
  isolation: isolate;
}
.main-tab:hover::before,
.filters button:hover::before,
.plan-chapters button:hover::before,
.auth-form button:hover::before,
.logout-button:hover::before,
.ticket-link:hover::before { animation: heartbeat .75s ease-in-out infinite; }
.page-controls { gap: 3px; padding: 3px; border-radius: 999px; }
.page-controls span { min-width: 52px; }
.page-controls .page-heart-button {
  position: relative;
  width: 32px;
  height: 30px;
  color: var(--rose);
  border: 0;
  border-radius: 50%;
  background: rgba(255, 125, 157, .12);
  font-size: 15px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 125, 157, .15);
}
.page-controls .page-heart-button:first-child { transform: scaleX(-1); }
.page-controls .page-heart-button:hover:not(:disabled) {
  color: #8d183e;
  background: var(--rose-light);
  box-shadow: 0 4px 14px rgba(255, 125, 157, .28);
}
.page-controls .page-heart-button:disabled { opacity: .32; color: var(--muted-dark); background: rgba(255, 255, 255, .035); }

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.16); }
  48% { transform: scale(.98); }
  67% { transform: scale(1.09); }
}

/* A heart cursor is used only where a real mouse/trackpad exists. */
@media (hover: hover) and (pointer: fine) {
  html, body, body * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath d='M14 25S2.7 18.1 2.7 9.8C2.7 5.8 5.5 3 9.2 3c2.1 0 4 1 4.8 2.7C14.8 4 16.7 3 18.8 3c3.7 0 6.5 2.8 6.5 6.8C25.3 18.1 14 25 14 25Z' fill='%23ff6f98' stroke='%23fff0f4' stroke-width='1.4'/%3E%3C/svg%3E") 14 12, auto !important;
  }
  button, a, input, select, textarea, label { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath d='M14 25S2.7 18.1 2.7 9.8C2.7 5.8 5.5 3 9.2 3c2.1 0 4 1 4.8 2.7C14.8 4 16.7 3 18.8 3c3.7 0 6.5 2.8 6.5 6.8C25.3 18.1 14 25 14 25Z' fill='%23ff477b' stroke='%23fff0f4' stroke-width='1.4'/%3E%3C/svg%3E") 14 12, pointer !important; }
}

/* Touch targets stay spacious even though a phone has no mouse cursor. */
@media (hover: none), (pointer: coarse) {
  button, .ticket-link, .main-tab, .filters button, .plan-chapters button, .logout-button {
    min-height: 44px;
    touch-action: manipulation;
  }
  .scan-button { min-height: 46px; }
  .page-controls { height: 46px; padding: 4px; }
  .page-controls .page-heart-button { width: 38px; height: 36px; font-size: 17px; }
  .filters { -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
  .filters button, .plan-chapters button { scroll-snap-align: start; }
}

@media (max-width: 780px) {
  .scan-button { min-width: 118px; height: 44px; padding-inline: 13px; }
  .scan-icon { font-size: 18px; }
  .main-tabs { min-height: 48px; padding: 4px; }
  .main-tab { min-height: 40px; padding-inline: 10px; font-size: 12px; }
  .main-tab::before { margin-right: 4px; }
  .toolbar-actions { gap: 10px; }
  .page-controls { flex: 0 0 auto; }
  .filters { gap: 8px; padding-bottom: 6px; }
  .filters button { padding-inline: 14px; }
  .plan-chapters { gap: 8px; padding-block: 9px; }
  .plan-chapters button { padding-inline: 15px; }
  .auth-form button { min-height: 48px; }
}

@media (max-width: 480px) {
  .scan-button { min-width: 106px; padding-inline: 10px; }
  .scan-button #scanButtonText { font-size: 11px; }
  .main-tab { font-size: 11px; }
  .ticket-link { min-height: 44px; }
}


/* A little-love-universe tab switcher: one heart travels between two shared worlds. */
.love-switch.main-tabs {
  position: relative;
  isolation: isolate;
  min-width: 284px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 5px;
  overflow: visible;
  border-color: rgba(255, 181, 202, .35);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(104, 37, 61, .86), rgba(42, 15, 28, .9));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .025), 0 8px 24px rgba(116, 25, 57, .15);
}
.love-switch-rail {
  position: absolute;
  z-index: 0;
  left: 15%;
  right: 15%;
  bottom: 4px;
  height: 8px;
  pointer-events: none;
}
.love-switch-rail::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 4px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 207, 219, .62) 18%, rgba(255, 125, 157, .8) 50%, rgba(255, 207, 219, .62) 82%, transparent);
  box-shadow: 0 0 10px rgba(255, 125, 157, .42);
}
.love-switch-rail::after {
  content: "♥   ♥";
  position: absolute;
  top: -4px;
  left: 23%;
  color: rgba(255, 225, 233, .55);
  font-size: 7px;
  letter-spacing: 34px;
  white-space: nowrap;
}
.love-switch-heart {
  position: absolute;
  z-index: 1;
  left: 10%;
  top: -4px;
  width: 17px;
  height: 17px;
  display: grid;
  place-content: center;
  color: #fff4f7;
  border: 1px solid rgba(255, 238, 243, .7);
  border-radius: 50%;
  background: linear-gradient(135deg, #ff9cb6, #e64978);
  box-shadow: 0 0 0 3px rgba(255, 125, 157, .13), 0 0 17px rgba(255, 125, 157, .66);
  font-size: 9px;
  font-style: normal;
  line-height: 1;
  transform: translateX(-50%);
  transition: left .62s cubic-bezier(.34, 1.56, .64, 1), transform .4s ease, box-shadow .4s ease;
  animation: orbit-heartbeat 1.9s ease-in-out infinite;
}
.love-switch--planning .love-switch-heart { left: 90%; }
.love-switch .main-tab {
  z-index: 2;
  min-height: 34px;
  padding-bottom: 6px;
  border-radius: 999px;
  background: transparent;
  transition: color .3s ease, text-shadow .3s ease, background .3s ease;
}
.love-switch .main-tab.active {
  color: #fff7f9;
  background: radial-gradient(circle at 50% 110%, rgba(255, 125, 157, .19), transparent 56%);
  box-shadow: none;
  text-shadow: 0 0 15px rgba(255, 225, 233, .36);
}
.love-switch .main-tab.active::before { color: #ffd6e1; }
.love-burst {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 50%;
  color: #ffdbe4;
  pointer-events: none;
  font-size: 12px;
  font-style: normal;
  opacity: 0;
  text-shadow: 0 0 12px rgba(255, 125, 157, .85);
}
.love-burst-1 { animation: love-flight-one .85s ease-out both; }
.love-burst-2 { animation: love-flight-two .8s .03s ease-out both; }
.love-burst-3 { animation: love-flight-three .9s .01s ease-out both; }
.love-burst-4 { animation: love-flight-four .86s .05s ease-out both; }
.love-burst-5 { animation: love-flight-five .78s .02s ease-out both; }
.love-burst-6 { animation: love-flight-six .9s .04s ease-out both; }
@keyframes orbit-heartbeat {
  0%, 100% { transform: translateX(-50%) scale(1); }
  35% { transform: translateX(-50%) scale(1.18); }
  52% { transform: translateX(-50%) scale(.95); }
}
@keyframes love-flight-one { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(-88px, -48px) scale(1.35) rotate(-22deg); } }
@keyframes love-flight-two { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(46px, -58px) scale(1.05) rotate(20deg); } }
@keyframes love-flight-three { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(96px, -12px) scale(1.45) rotate(36deg); } }
@keyframes love-flight-four { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(58px, 43px) scale(1.1) rotate(-18deg); } }
@keyframes love-flight-five { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(-48px, 40px) scale(1.27) rotate(15deg); } }
@keyframes love-flight-six { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(-104px, 2px) scale(1.06) rotate(-35deg); } }

@media (max-width: 780px) {
  .love-switch.main-tabs { min-width: 0; }
  .love-switch-rail { left: 17%; right: 17%; }
  .love-switch .main-tab { min-height: 40px; padding-bottom: 7px; }
  .love-switch-heart { top: -3px; width: 16px; height: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .love-switch-heart, .love-burst { animation: none !important; }
  .love-burst { display: none; }
}


/* Clear page gateway: the two destinations are deliberately large, labeled choices. */
.love-navigation {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 420px;
}
.love-navigation-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #ffdbe5;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.love-navigation-label::before,
.love-navigation-label::after {
  content: "♥";
  color: var(--rose);
  font-size: 11px;
  text-shadow: 0 0 12px rgba(255, 125, 157, .55);
}
.love-switch.main-tabs {
  width: 420px;
  min-width: 420px;
  min-height: 56px;
  padding: 4px 6px 7px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(124, 41, 72, .96), rgba(48, 15, 31, .96));
  box-shadow: 0 9px 28px rgba(116, 25, 57, .26), inset 0 0 0 1px rgba(255, 231, 238, .06);
}
.love-switch .main-tab {
  min-height: 45px;
  padding: 4px 11px 9px 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  border: 1px solid transparent;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 850;
  letter-spacing: .04em;
  text-align: left;
}
.love-switch .main-tab::before {
  position: absolute;
  left: 13px;
  top: 50%;
  margin: 0;
  font-size: 15px;
  transform: translateY(-58%);
}
.love-switch .main-tab::after {
  content: attr(data-hint);
  display: block;
  color: #d7aab8;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: .05em;
  line-height: 1.1;
}
.love-switch .main-tab:hover {
  color: #fff6f8;
  border-color: rgba(255, 204, 218, .23);
  background: rgba(255, 174, 198, .08);
}
.love-switch .main-tab.active {
  color: #fff9fa;
  border-color: rgba(255, 215, 226, .22);
  background: linear-gradient(135deg, rgba(255, 149, 180, .27), rgba(255, 222, 232, .1));
  box-shadow: inset 0 0 18px rgba(255, 219, 229, .09), 0 3px 12px rgba(44, 6, 24, .28);
}
.love-switch .main-tab.active::after { color: #ffe1e9; }
.love-switch-rail { bottom: 3px; }

@media (min-width: 781px) {
  .topbar { height: 82px; }
  .dashboard { height: calc(100dvh - 82px); padding-top: 10px; }
  .planning-shell { height: calc(100dvh - 82px); padding-top: 10px; }
}

@media (max-width: 780px) {
  .topbar { height: 138px; align-content: start; padding-top: 10px; }
  .love-navigation { order: 3; width: 100%; min-width: 0; gap: 5px; }
  .love-navigation-label { font-size: 9px; letter-spacing: .1em; }
  .love-switch.main-tabs { width: 100%; min-width: 0; min-height: 58px; }
  .love-switch .main-tab { min-height: 46px; padding-left: 29px; font-size: 13px; }
  .love-switch .main-tab::before { left: 11px; font-size: 14px; }
  .love-switch .main-tab::after { font-size: 8px; }
  .plan-workspace { min-height: calc(100vh - 166px); }
}

@media (max-width: 390px) {
  .love-navigation-label { letter-spacing: .06em; }
  .love-switch .main-tab { padding-left: 27px; font-size: 12px; }
  .love-switch .main-tab::before { left: 9px; }
}


/* Planning unlock identity — make the beloved's title unmistakable. */
.auth-love-name {
  position: relative;
  z-index: 1;
  margin: 14px auto 0;
  color: #ffe6ed;
  font-family: "STKaiti", "KaiTi", "Microsoft YaHei UI", sans-serif;
  font-size: clamp(24px, 2.3vw, 34px);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: .07em;
  text-shadow: 0 0 22px rgba(255, 125, 157, .54), 0 4px 18px rgba(38, 2, 19, .36);
}
.auth-love-name::before,
.auth-love-name::after {
  content: "♥";
  display: inline-block;
  margin: 0 .32em;
  color: var(--rose);
  font-family: inherit;
  font-size: .7em;
  vertical-align: .09em;
  text-shadow: 0 0 14px rgba(255, 125, 157, .72);
}
.auth-card > .auth-love-name + #authDescription { margin-top: 12px; }
.auth-form .birthday-hint {
  margin: -3px 0 2px;
  color: #b9909e;
  font-size: 10px;
  line-height: 1.45;
}
.auth-form input[placeholder]::placeholder { color: #8f6473; }

@media (max-width: 780px) {
  .auth-love-name { font-size: clamp(22px, 7vw, 30px); letter-spacing: .04em; }
}


/* Planning is the first gateway; the travelling heart follows the selected side. */
.love-switch-heart { left: 90%; }
.love-switch--planning .love-switch-heart { left: 10%; }

/* Give the private name the prominence it deserves. */
.auth-card { width: min(680px, 100%); }
.auth-love-name {
  margin-top: 18px;
  font-size: clamp(34px, 3.2vw, 50px);
  line-height: 1.14;
  letter-spacing: .06em;
  text-shadow: 0 0 30px rgba(255, 125, 157, .72), 0 5px 22px rgba(38, 2, 19, .46);
}
.auth-love-name::before,
.auth-love-name::after { font-size: .62em; }
.auth-form .birthday-hint { color: #e2a9b9; font-size: 11px; font-weight: 700; }

/* Successful unlock: two hearts meet, with a brief halo of celebrating hearts. */
.unlock-love-effect {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-content: center;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(255, 159, 185, .34), rgba(32, 3, 17, .78) 45%, rgba(17, 4, 11, .9));
  animation: unlock-love-overlay 1.8s ease-out both;
}
.unlock-love-pair { display: flex; align-items: center; justify-content: center; height: 108px; }
.unlock-love-heart {
  color: #ffe5ed;
  font-family: Georgia, serif;
  font-size: 94px;
  font-style: normal;
  line-height: 1;
  text-shadow: 0 0 28px #ff5f8b, 0 0 54px rgba(255, 125, 157, .9);
}
.unlock-love-heart--left { animation: unlock-heart-left 1.15s cubic-bezier(.2, .95, .3, 1.25) both; }
.unlock-love-heart--right { animation: unlock-heart-right 1.15s cubic-bezier(.2, .95, .3, 1.25) both; }
.unlock-love-title {
  margin: 8px 0 0;
  color: #fff5f8;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: .35em;
  text-align: center;
  text-indent: .35em;
  text-shadow: 0 0 18px rgba(255, 125, 157, .85);
  animation: unlock-love-title 1.4s .32s ease-out both;
}
.unlock-love-spark {
  position: absolute;
  left: 50%;
  top: 50%;
  color: #ffd3e0;
  font-size: 20px;
  font-style: normal;
  opacity: 0;
  text-shadow: 0 0 14px #ff6f99;
}
.unlock-love-spark--1 { animation: unlock-spark-1 1.25s .18s ease-out both; }
.unlock-love-spark--2 { animation: unlock-spark-2 1.2s .12s ease-out both; }
.unlock-love-spark--3 { animation: unlock-spark-3 1.3s .2s ease-out both; }
.unlock-love-spark--4 { animation: unlock-spark-4 1.18s .14s ease-out both; }
.unlock-love-spark--5 { animation: unlock-spark-5 1.28s .16s ease-out both; }
.unlock-love-spark--6 { animation: unlock-spark-6 1.16s .22s ease-out both; }
@keyframes unlock-love-overlay { 0% { opacity: 0; } 12%, 72% { opacity: 1; } 100% { opacity: 0; } }
@keyframes unlock-heart-left { 0% { opacity: 0; transform: translateX(-135px) scale(.25) rotate(-24deg); } 62% { opacity: 1; transform: translateX(7px) scale(1.14) rotate(4deg); } 100% { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes unlock-heart-right { 0% { opacity: 0; transform: translateX(135px) scale(.25) rotate(24deg); } 62% { opacity: 1; transform: translateX(-7px) scale(1.14) rotate(-4deg); } 100% { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes unlock-love-title { 0% { opacity: 0; transform: translateY(12px) scale(.7); } 55% { opacity: 1; transform: translateY(0) scale(1.08); } 100% { opacity: 1; transform: scale(1); } }
@keyframes unlock-spark-1 { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.2); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(-160px, -110px) scale(1.2); } }
@keyframes unlock-spark-2 { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.2); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(130px, -124px) scale(.9); } }
@keyframes unlock-spark-3 { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.2); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(184px, 18px) scale(1.35); } }
@keyframes unlock-spark-4 { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.2); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(116px, 128px) scale(1); } }
@keyframes unlock-spark-5 { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.2); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(-132px, 114px) scale(1.15); } }
@keyframes unlock-spark-6 { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.2); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(-184px, 4px) scale(.9); } }

@media (max-width: 780px) {
  .auth-card { width: min(100%, 620px); }
  .auth-love-name { font-size: clamp(30px, 9vw, 42px); line-height: 1.18; }
  .unlock-love-heart { font-size: 78px; }
  .unlock-love-title { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .unlock-love-effect { animation: none; }
  .unlock-love-heart, .unlock-love-title, .unlock-love-spark { animation: none; opacity: 1; }
  .unlock-love-spark { display: none; }
}


/* Final prominence pass for the private love title. */
.auth-card { width: min(780px, 100%); }
.auth-love-name {
  max-width: 100%;
  margin-top: 22px;
  font-size: clamp(34px, 3.2vw, 44px);
  font-weight: 950;
  line-height: 1.12;
  letter-spacing: .045em;
  text-shadow: 0 0 38px rgba(255, 125, 157, .86), 0 7px 28px rgba(38, 2, 19, .58);
}
.auth-love-name::before,
.auth-love-name::after {
  margin-inline: .22em;
  font-size: .56em;
}
@media (max-width: 780px) {
  .auth-card { width: min(100%, 680px); }
  .auth-love-name { margin-top: 19px; font-size: clamp(30px, 8.5vw, 38px); letter-spacing: .025em; }
}


/* The longer dedication remains readable at every header width. */
.brand-copy { min-width: 0; }
.brand-copy strong { line-height: 1.28; }
@media (max-width: 1180px) and (min-width: 781px) {
  .brand { max-width: 265px; }
  .brand-copy strong { font-size: 11px; }
  .top-actions { gap: 8px; }
}
@media (max-width: 780px) {
  .brand { min-width: 0; flex: 1; max-width: calc(100% - 112px); gap: 8px; }
  .brand-copy strong { font-size: 10px; line-height: 1.25; white-space: normal; }
}


/* Stable header hierarchy: space name, signature, then a quiet tagline. */
.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
}
.brand-title {
  display: grid;
  gap: 1px;
  color: var(--text);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .025em;
}
.brand-space-name,
.brand-signature { display: block; white-space: nowrap; }
.brand-space-name { font-size: 14px; }
.brand-signature {
  color: var(--rose-light);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}
.brand-copy small { margin-top: 2px; line-height: 1.1; }
@media (max-width: 1180px) and (min-width: 781px) {
  .brand-title { letter-spacing: 0; }
  .brand-space-name { font-size: 11px; }
  .brand-signature { font-size: 9px; }
}
@media (max-width: 780px) {
  body.planning-active .brand { max-width: 100%; }
  .brand-title { gap: 0; letter-spacing: 0; }
  .brand-space-name { font-size: 10px; line-height: 1.22; white-space: normal; }
  .brand-signature { font-size: 9px; line-height: 1.2; letter-spacing: .04em; }
}


/* Grand love title: intentionally twice the previous scale. */
.auth-card { width: min(1400px, 100%); padding-inline: 32px; }
.auth-love-name {
  font-size: clamp(68px, 6.4vw, 88px);
  line-height: 1.06;
  letter-spacing: .02em;
  text-shadow: 0 0 46px rgba(255, 125, 157, .94), 0 9px 34px rgba(38, 2, 19, .64);
}
.auth-love-name::before,
.auth-love-name::after { margin-inline: .14em; font-size: .36em; }
@media (max-width: 780px) {
  .auth-card { width: 100%; padding-inline: 18px; }
  .auth-love-name { font-size: clamp(60px, 17vw, 76px); line-height: 1.08; letter-spacing: 0; }
  .auth-love-name::before,
  .auth-love-name::after { margin-inline: .08em; font-size: .32em; }
}


/* Love records: a quiet, dedicated space for our shared words. */
.love-switch.main-tabs {
  width: 600px;
  min-width: 600px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.love-switch-rail::after {
  content: "♥  ♥  ♥";
  left: 15%;
  letter-spacing: 23px;
}
.love-switch-heart { left: 83.333%; }
.love-switch--planning .love-switch-heart { left: 16.667%; }
.love-switch--records .love-switch-heart { left: 50%; }

.love-records-shell {
  display: grid;
  place-items: center;
}
.love-records-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: min(720px, 100%);
  padding: clamp(42px, 7vw, 78px) clamp(26px, 7vw, 80px);
  text-align: center;
  border: 1px solid rgba(255, 197, 215, .34);
  border-radius: 32px;
  background: linear-gradient(145deg, rgba(83, 29, 53, .94), rgba(35, 11, 25, .96));
  box-shadow: 0 28px 80px rgba(33, 3, 18, .4), inset 0 0 0 1px rgba(255, 241, 245, .04);
}
.love-records-card::before,
.love-records-card::after {
  content: "♥";
  position: absolute;
  z-index: -1;
  color: rgba(255, 159, 186, .16);
  font-family: Georgia, serif;
  font-size: clamp(140px, 20vw, 220px);
  line-height: 1;
  text-shadow: 0 0 48px rgba(255, 125, 157, .23);
}
.love-records-card::before { top: -80px; left: -65px; transform: rotate(-18deg); }
.love-records-card::after { right: -70px; bottom: -94px; transform: rotate(21deg); }
.love-records-eyebrow {
  margin: 0 0 18px;
  color: #ff9fbb;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .25em;
}
.love-records-card h1 {
  margin: 0;
  color: #fff0f4;
  font-family: "STKaiti", "KaiTi", "Microsoft YaHei UI", serif;
  font-size: clamp(42px, 6vw, 68px);
  font-weight: 900;
  letter-spacing: .11em;
  text-indent: .11em;
  text-shadow: 0 0 28px rgba(255, 125, 157, .46);
}
.love-records-quote {
  margin: 30px auto 0;
  color: #ffe0e9;
  font-family: "STKaiti", "KaiTi", "Microsoft YaHei UI", serif;
  font-size: clamp(21px, 3vw, 31px);
  font-weight: 700;
  line-height: 1.85;
  letter-spacing: .1em;
  text-indent: .1em;
  text-shadow: 0 0 18px rgba(255, 125, 157, .26);
}

@media (max-width: 780px) {
  .love-switch.main-tabs { width: 100%; min-width: 0; }
  .love-records-shell { min-height: calc(100dvh - 138px); }
  .love-records-card { width: 100%; padding: 48px 20px; border-radius: 24px; }
  .love-records-eyebrow { margin-bottom: 15px; }
  .love-records-quote { margin-top: 24px; line-height: 1.7; }
}

@media (max-width: 390px) {
  .love-switch .main-tab { padding-left: 23px; font-size: 11px; }
  .love-switch .main-tab::before { left: 7px; font-size: 12px; }
  .love-switch .main-tab::after { font-size: 7px; }
}


/* Keep all three destinations legible without crowding the desktop header. */
@media (max-width: 1180px) and (min-width: 781px) {
  .love-navigation { min-width: 420px; }
  .love-switch.main-tabs { width: 420px; min-width: 420px; }
  .love-switch .main-tab { padding-left: 25px; font-size: 12px; }
  .love-switch .main-tab::before { left: 9px; font-size: 13px; }
  .love-switch .main-tab::after { font-size: 8px; }
}

@media (max-width: 1050px) and (min-width: 781px) {
  .topbar { gap: 8px; }
  .brand { max-width: 190px; }
  .brand-copy small, .live-indicator { display: none; }
  .love-navigation { min-width: 370px; }
  .love-switch.main-tabs { width: 370px; min-width: 370px; }
  .love-switch .main-tab { padding-left: 20px; font-size: 11px; }
  .love-switch .main-tab::before { left: 7px; font-size: 11px; }
  .love-switch .main-tab::after { font-size: 7px; }
}


/* Our shared journey: six love stations instead of plain chapter tabs. */
.plan-chapters {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  overflow: visible;
  padding: 17px 22px 15px;
  border-bottom-color: rgba(255, 181, 202, .2);
  background: linear-gradient(90deg, rgba(77, 25, 47, .34), rgba(255, 125, 157, .045), rgba(77, 25, 47, .34));
}
.plan-chapters::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 36px;
  left: calc(8.333% + 22px);
  right: calc(8.333% + 22px);
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 125, 157, .18), rgba(255, 222, 232, .7), rgba(255, 125, 157, .18));
  box-shadow: 0 0 12px rgba(255, 125, 157, .35);
}
.plan-chapters .plan-chapter {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 56px;
  padding: 4px 7px 6px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  color: #b89ba5;
  border: 1px solid transparent;
  border-radius: 15px;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
  text-align: left;
  transition: color .25s ease, border-color .25s ease, background .25s ease, transform .25s ease;
}
.plan-chapters .plan-chapter::before { content: none; }
.plan-chapter:hover {
  color: #ffe8ef;
  border-color: rgba(255, 190, 210, .25);
  background: rgba(255, 125, 157, .08);
  transform: translateY(-2px);
}
.plan-chapters .plan-chapter.active {
  color: #fff3f6;
  border-color: rgba(255, 209, 222, .4);
  background: linear-gradient(140deg, rgba(255, 139, 171, .29), rgba(255, 226, 235, .11));
  box-shadow: 0 7px 19px rgba(60, 8, 30, .26), inset 0 0 16px rgba(255, 226, 235, .08);
}
.plan-chapter:focus-visible { outline: 2px solid #ffd2df; outline-offset: 3px; }
.chapter-number {
  width: 27px;
  height: 27px;
  display: grid;
  place-content: center;
  color: #ffc3d4;
  border: 1px solid rgba(255, 190, 210, .4);
  border-radius: 50%;
  background: rgba(47, 12, 27, .88);
  box-shadow: 0 0 0 3px rgba(52, 14, 30, .85), 0 0 12px rgba(255, 125, 157, .18);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}
.plan-chapter.active .chapter-number {
  color: #7f183b;
  border-color: #ffe3eb;
  background: linear-gradient(135deg, #ffe9f0, #ff92b2);
  box-shadow: 0 0 0 3px rgba(93, 22, 49, .88), 0 0 18px rgba(255, 125, 157, .65);
}
.chapter-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapter-heart { color: rgba(255, 180, 203, .45); font-size: 10px; }
.plan-chapter.active .chapter-heart { color: #ffe1e9; animation: heartbeat 1.45s ease-in-out infinite; }

@media (max-width: 780px) {
  .plan-chapters {
    grid-template-columns: repeat(6, minmax(122px, 1fr));
    gap: 9px;
    overflow-x: auto;
    padding: 14px 13px 13px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .plan-chapters::-webkit-scrollbar { display: none; }
  .plan-chapters::before { left: 74px; right: 74px; top: 33px; }
  .plan-chapters .plan-chapter { min-height: 48px; padding: 4px 8px; scroll-snap-align: start; }
}

@media (prefers-reduced-motion: reduce) {
  .plan-chapters .plan-chapter, .plan-chapter.active .chapter-heart { animation: none; transition: none; }
  .plan-chapters .plan-chapter:hover { transform: none; }
}


@media (max-width: 780px) {
  .plan-chapters { scroll-padding-inline: 13px; }
  .plan-chapters .plan-chapter { scroll-snap-align: center; }
}


/* Final mobile planning layout: the page scrolls vertically; only rails and tables scroll sideways. */
@media (max-width: 780px) {
  html,
  body {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
  }

  .planning-shell,
  .plan-workspace,
  .plan-body,
  .plan-section,
  .plan-table-wrap {
    min-width: 0;
    max-width: 100%;
  }

  .planning-shell { width: calc(100% - 28px); }

  .plan-workspace {
    height: auto;
    min-height: calc(100dvh - 166px);
    display: block;
    overflow: visible;
  }

  .plan-body {
    min-height: auto;
    overflow: visible;
    padding: 16px 13px calc(32px + env(safe-area-inset-bottom));
  }

  .plan-chapters {
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-auto-columns: minmax(108px, 72vw);
    inline-size: 100%;
    max-inline-size: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scroll-padding-inline: 13px;
  }

  .plan-chapters .plan-chapter {
    min-width: 0;
    scroll-snap-align: center;
  }

  .plan-table-wrap {
    inline-size: 100%;
    max-inline-size: 100%;
    min-inline-size: 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .plan-table {
    inline-size: max-content;
    min-inline-size: max(100%, 580px);
  }
}


/* Tablet-to-phone planning fallback: avoid the desktop fixed-height workspace on narrow displays. */
@media (max-width: 1180px) {
  html,
  body {
    height: auto;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .planning-shell,
  .plan-workspace,
  .plan-body,
  .plan-section,
  .plan-table-wrap {
    min-width: 0;
    max-width: 100%;
  }

  .planning-shell {
    height: auto;
    width: calc(100% - 28px);
    padding: 14px 0 calc(28px + env(safe-area-inset-bottom));
    display: block;
  }

  .plan-workspace {
    height: auto;
    min-height: calc(100dvh - 166px);
    display: block;
    overflow: visible;
  }

  .plan-body {
    min-height: auto;
    overflow: visible;
    padding: 16px 13px calc(32px + env(safe-area-inset-bottom));
  }

  .plan-chapters {
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-auto-columns: minmax(108px, 220px);
    inline-size: 100%;
    max-inline-size: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scroll-padding-inline: 13px;
  }

  .plan-chapters .plan-chapter {
    min-width: 0;
    scroll-snap-align: center;
  }

  .plan-table-wrap {
    inline-size: 100%;
    max-inline-size: 100%;
    min-inline-size: 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .plan-table {
    inline-size: max-content;
    min-inline-size: max(100%, 580px);
  }
}


/* Compact headers and readable plan rows on tablets and phones. */
@media (max-width: 1180px) {
  .topbar {
    height: auto;
    min-height: 138px;
    flex-wrap: wrap;
    align-content: start;
    gap: 8px;
    padding-top: 10px;
  }

  .love-navigation {
    order: 3;
    width: 100%;
    min-width: 0;
    gap: 5px;
  }

  .love-switch.main-tabs {
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .love-switch .main-tab {
    min-width: 0;
    min-height: 46px;
    padding-left: 28px;
    font-size: 12px;
  }

  .love-switch .main-tab::before { left: 10px; font-size: 13px; }
  .love-switch .main-tab::after { font-size: 8px; }

  .plan-table-wrap { overflow: visible; }
  .plan-table {
    width: 100%;
    min-inline-size: 0;
    display: block;
    font-size: 11px;
  }

  .plan-table thead { display: none; }
  .plan-table tbody,
  .plan-table tr,
  .plan-table td {
    display: block;
    width: 100%;
  }

  .plan-table tr {
    padding: 7px 0;
    border-bottom: 1px solid rgba(255, 198, 212, .12);
  }

  .plan-table tr:last-child { border-bottom: 0; }
  .plan-table td {
    min-height: 30px;
    padding: 7px 9px;
    display: grid;
    grid-template-columns: minmax(7.2em, 42%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    border: 0;
    overflow-wrap: anywhere;
  }

  .plan-table td::before {
    content: attr(data-label);
    color: #d9b8c4;
    font-size: 10px;
    font-weight: 800;
  }

  .plan-table td:first-child { color: #f0dfe4; }
}


/* Keep the private plan fully readable through standard desktop widths. */
@media (max-width: 1600px) {
  html,
  body {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .planning-shell {
    height: auto;
    display: block;
    padding: 14px 0 calc(28px + env(safe-area-inset-bottom));
  }

  .plan-workspace {
    height: auto;
    min-height: calc(100dvh - 166px);
    display: block;
    overflow: visible;
  }

  .plan-body {
    min-height: auto;
    overflow: visible;
    padding-bottom: calc(32px + env(safe-area-inset-bottom));
  }

  .plan-table-wrap { overflow: visible; }
  .plan-table {
    width: 100%;
    min-inline-size: 0;
    display: block;
  }

  .plan-table thead { display: none; }
  .plan-table tbody,
  .plan-table tr,
  .plan-table td { display: block; width: 100%; }
  .plan-table tr { padding: 7px 0; border-bottom: 1px solid rgba(255, 198, 212, .12); }
  .plan-table tr:last-child { border-bottom: 0; }
  .plan-table td {
    min-height: 30px;
    padding: 7px 9px;
    display: grid;
    grid-template-columns: minmax(7.2em, 42%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    border: 0;
    overflow-wrap: anywhere;
  }
  .plan-table td::before {
    content: attr(data-label);
    color: #d9b8c4;
    font-size: 10px;
    font-weight: 800;
  }
}


/* Planning must remain complete at every rendered width. */
html.planning-active {
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
}
body.planning-active {
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
body.planning-active .topbar {
  height: auto;
  min-height: 138px;
  flex-wrap: wrap;
  align-content: start;
  gap: 8px;
  padding-top: 10px;
}
body.planning-active .love-navigation {
  order: 3;
  width: 100%;
  min-width: 0;
  gap: 5px;
}
body.planning-active .love-switch.main-tabs {
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
body.planning-active .love-switch .main-tab {
  min-width: 0;
  min-height: 46px;
  padding-left: 28px;
  font-size: 12px;
}
body.planning-active .love-switch .main-tab::before { left: 10px; font-size: 13px; }
body.planning-active .love-switch .main-tab::after { font-size: 8px; }
body.planning-active .planning-shell {
  height: auto;
  width: calc(100% - 28px);
  padding: 14px 0 calc(28px + env(safe-area-inset-bottom));
  display: block;
}
body.planning-active .plan-workspace {
  height: auto;
  min-height: calc(100dvh - 166px);
  display: block;
  overflow: visible;
}
body.planning-active .plan-body {
  min-height: auto;
  overflow: visible;
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
}
body.planning-active .plan-table-wrap { overflow: visible; }
body.planning-active .plan-table {
  width: 100%;
  min-inline-size: 0;
  display: block;
}
body.planning-active .plan-table thead { display: none; }
body.planning-active .plan-table tbody,
body.planning-active .plan-table tr,
body.planning-active .plan-table td { display: block; width: 100%; }
body.planning-active .plan-table tr {
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 198, 212, .12);
}
body.planning-active .plan-table tr:last-child { border-bottom: 0; }
body.planning-active .plan-table td {
  min-height: 30px;
  padding: 7px 9px;
  display: grid;
  grid-template-columns: minmax(7.2em, 42%) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 0;
  overflow-wrap: anywhere;
}
body.planning-active .plan-table td::before {
  content: attr(data-label);
  color: #d9b8c4;
  font-size: 10px;
  font-weight: 800;
}
