:root {
  --bg: #fff8f0;
  --panel: #ffffffcc;
  --ink: #2f2118;
  --muted: #7b6656;
  --brand: #b75d44;
  --brand-dark: #873f2f;
  --soft: #f2dfcf;
  --line: #e4cbbb;
  --shadow: 0 18px 60px rgba(47, 33, 24, .14);
}
* { box-sizing: border-box; }
html { overflow-x: hidden; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, #ffe7d4 0, transparent 35%),
    linear-gradient(135deg, #fff8f0, #f8ede4 55%, #f3dac8);
  min-height: 100vh;
  overflow-x: hidden;
}
.app-shell { width: min(1180px, calc(100% - 24px)); margin: 0 auto; padding: 24px 0 56px; }
.hero { display: grid; gap: 20px; padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 32px; box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.hero-copy { display: grid; gap: 10px; }
.hero-actions { display: flex; align-items: center; justify-content: flex-start; }
.eyebrow { margin: 0 0 8px; text-transform: uppercase; letter-spacing: .16em; font-size: .75rem; color: var(--brand-dark); font-weight: 800; }
h1, h2, h3 { margin: 0; line-height: 1.08; }
h1 { font-size: clamp(2rem, 5vw, 4.4rem); max-width: 820px; }
.subtitle { color: var(--muted); font-size: 1.05rem; max-width: 640px; }
.hero-note { margin: 0; color: var(--muted); max-width: 540px; }
.primary-btn, .ghost-btn, .card button { border: 0; border-radius: 999px; padding: 13px 18px; font-weight: 800; cursor: pointer; min-height: 48px; touch-action: manipulation; }
.primary-btn { color: white; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); box-shadow: 0 12px 28px rgba(135, 63, 47, .25); }
.ghost-btn { background: var(--soft); color: var(--brand-dark); }
.quick-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.quick-stats article { background: #fffdf9bb; border: 1px solid var(--line); border-radius: 22px; padding: 18px; }
.quick-stats strong { display: block; font-size: 2rem; }
.quick-stats span { color: var(--muted); }
.dashboard-section,
.discovery-section, .featured-block, .memory-journal-section, .bucketlist-section { margin-bottom: 18px; }
.dashboard-shell { display: grid; gap: 18px; }
.dashboard-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dashboard-card { background: #fffdf9bb; border: 1px solid var(--line); border-radius: 22px; padding: 18px; box-shadow: var(--shadow); }
.dashboard-card strong { display: block; font-size: 1.9rem; }
.dashboard-card span,
.dashboard-empty,
.dashboard-next p,
.memory-tree p { color: var(--muted); }
.dashboard-panels { display: grid; gap: 18px; }
.dashboard-panel { margin-bottom: 0; }
.dashboard-next { display: grid; gap: 10px; }
.memory-tree { display: grid; gap: 12px; align-items: center; }
.memory-tree-visual { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: linear-gradient(180deg, #fff3e3, #f2dfcf); font-size: 2rem; }
.dashboard-actions-panel { margin-bottom: 0; }
.dashboard-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dashboard-actions .ghost-btn { min-height: 56px; text-align: left; white-space: normal; }
.discovery-section { background: var(--panel); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); padding: 22px; }
.discovery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.discovery-card { display: grid; gap: 8px; text-align: left; padding: 18px; border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(180deg, #fffefb, #f8eee5); color: var(--ink); box-shadow: 0 10px 24px rgba(47, 33, 24, .06); }
.discovery-card.active { border-color: rgba(183, 93, 68, .45); background: linear-gradient(180deg, #fbe9de, #f5dfd0); box-shadow: 0 14px 34px rgba(135, 63, 47, .16); }
.discovery-emoji { font-size: 1.7rem; line-height: 1; }
.discovery-title { font-size: 1.02rem; font-weight: 800; }
.discovery-copy { color: var(--muted); font-size: .93rem; line-height: 1.45; }
.featured-sections { display: grid; gap: 18px; margin-bottom: 18px; }
main { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: start; }
.filters, .content-area { background: var(--panel); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); padding: 22px; }
.filters { position: sticky; top: 18px; }
.filters label { display: grid; gap: 8px; margin-top: 18px; color: var(--muted); font-weight: 700; }
select, input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 16px; padding: 13px 14px; font: inherit; background: white; color: var(--ink); min-height: 50px; }
.section-header { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 18px; }
.section-copy { margin: -4px 0 18px; color: var(--muted); line-height: 1.55; }
.planner-meta { padding: 12px 14px; border-radius: 16px; background: #fff8f1; border: 1px solid var(--line); }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cards-featured { grid-template-columns: 1fr; }
.card { background: white; border: 1px solid var(--line); border-radius: 24px; padding: 20px; display: grid; gap: 13px; align-content: start; }
.card-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.memory-card, .bucketlist-card { gap: 14px; }
.memory-date { margin: 0; color: var(--muted); font-size: .88rem; font-weight: 700; }
.empty-memory, .empty-bucketlist { margin: 0; color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { border-radius: 999px; background: var(--soft); color: var(--brand-dark); font-size: .78rem; font-weight: 800; padding: 7px 10px; }
.card p { color: var(--muted); margin: 0; }
.actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.card button { background: #f7eee7; color: var(--ink); width: 100%; }
.card button.active { background: var(--brand); color: white; }
.active-discovery { margin: 0 0 18px; padding: 12px 16px; border-radius: 16px; background: #f8eee5; color: var(--brand-dark); font-weight: 700; }
dialog { border: 0; border-radius: 28px; padding: 0; width: min(560px, calc(100% - 20px)); max-height: min(90vh, 760px); overflow: auto; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(47,33,24,.35); backdrop-filter: blur(5px); }
.dialog-card { padding: 26px; display: grid; gap: 18px; }
.memory-joined,
.memory-do-again { margin: 0; padding: 0; border: 0; display: grid; gap: 10px; }
.memory-joined legend,
.memory-do-again legend { padding: 0; color: var(--muted); font-weight: 700; }
.joined-options { display: flex; flex-wrap: wrap; gap: 10px; }
.joined-chip { position: relative; }
.joined-chip input { position: absolute; opacity: 0; inset: 0; }
.joined-chip span,
.memory-do-again label { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); }
.joined-chip input:checked + span { background: var(--soft); border-color: rgba(183, 93, 68, .35); color: var(--brand-dark); }
.memory-do-again { grid-template-columns: 1fr; }
.memory-do-again label { width: fit-content; }
.close-btn { position: absolute; top: 12px; right: 14px; border: 0; background: transparent; font-size: 2rem; cursor: pointer; }
@media (min-width: 861px) {
  .hero { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .dashboard-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .dashboard-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .featured-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards-featured { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .hero, .section-header { align-items: stretch; }
  main { grid-template-columns: 1fr; }
  .filters { position: static; }
  .cards { grid-template-columns: 1fr; }
  .quick-stats { grid-template-columns: 1fr; }
  .hero-actions .primary-btn,
  .dashboard-actions .ghost-btn { width: 100%; }
  .dashboard-stats,
  .dashboard-actions { grid-template-columns: 1fr; }
  .discovery-grid { grid-template-columns: 1fr; }
  .app-shell { width: min(100%, calc(100% - 20px)); padding: 16px 0 40px; }
  .hero { padding: 22px; }
  .dashboard-card, .filters, .content-area, .discovery-section, .card { border-radius: 20px; }
  .section-copy { margin-bottom: 16px; }
}
@media (max-width: 640px) {
  .hero { padding: 18px; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .card-top { flex-direction: column; }
  .cards, .actions { grid-template-columns: 1fr; }
  .dashboard-card strong { font-size: 1.6rem; }
  .quick-stats article { padding: 14px; }
  h1 { font-size: clamp(1.8rem, 6vw, 2.6rem); }
  .dialog-card { padding: 18px; gap: 14px; }
  .close-btn { top: 8px; right: 10px; }
  .badges { gap: 6px; }
  .badge { padding: 6px 9px; }
  select, input, textarea { min-height: 52px; }
  textarea { min-height: 120px; }
}
