:root {
  --navy: #183447;
  --gold: #b99657;
  --sage: #6c8475;
  --moss: #aab6a9;
  --mist: #e4eae4;
  --ivory: #f8f4ed;
  --sand: #d1c3af;
  --rose: #ebd8d2;
  --ink: #28352f;
  --muted: #737e77;
  --white: #fffdfa;
  --line: #e9e4dc;
  --shadow: 0 18px 55px rgba(65, 79, 68, .10);
  --soft-shadow: 0 8px 25px rgba(65, 79, 68, .07);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(ellipse at 5% 0%, rgba(235,216,210,.55), transparent 30rem),
              radial-gradient(ellipse at 100% 30%, rgba(228,234,228,.8), transparent 32rem), var(--ivory);
  color: var(--ink);
  font: 15px/1.55 'DM Sans', Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
}
a { color: inherit; }
.wrap { width: min(1160px, calc(100% - 40px)); margin: auto; }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark {
  width: 37px; height: 37px; border: 1px solid var(--gold); border-radius: 12px; background: var(--navy); color: white;
  display: grid; place-items: center; font: 600 19px 'Playfair Display', Georgia, serif;
  box-shadow: 0 6px 14px rgba(83,108,92,.2);
}
.brand-copy { line-height: 1.1; }
.brand-copy b { display: block; font-size: 13px; letter-spacing: .13em; text-transform: uppercase; }
.brand-copy span { font-size: 11px; color: var(--muted); letter-spacing: .07em; }
.nav { display: flex; gap: 8px; align-items: center; }
.nav a, .nav button {
  font: 500 13px 'DM Sans', sans-serif; text-decoration: none; border: 0; background: transparent;
  color: var(--muted); padding: 10px 13px; border-radius: 999px; cursor: pointer;
}
.nav a:hover, .nav button:hover { background: #ffffffa8; color: var(--ink); }
.nav .active { background: var(--white); color: var(--sage); box-shadow: 0 3px 12px #3042330c; }
.auth-logout { border: 1px solid #d7ddd4 !important; border-radius: 999px; }
.auth-gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at 0% 0%, rgba(235,216,210,.7), transparent 30rem), radial-gradient(ellipse at 100% 100%, rgba(228,234,228,.9), transparent 32rem), var(--ivory); }
.auth-card { width: min(540px,100%); padding: clamp(28px,6vw,54px); background: rgba(255,253,250,.92); border: 1px solid #fff; border-radius: 30px; box-shadow: var(--shadow); }
.auth-brand { margin-bottom: 34px; }
.auth-kicker { margin-bottom: 10px; font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--sage); }
.auth-card h1 { max-width: 420px; margin: 0 0 12px; color: var(--navy); font: 500 clamp(34px,6vw,48px)/1.08 'Playfair Display', Georgia, serif; letter-spacing: -.035em; }
.auth-card > p { max-width: 390px; color: var(--muted); }
.auth-card .auth-note { margin-top: 20px; font-size: 12px; }
.auth-card .auth-status { color: #9a4f3b; font-size: 13px; }
.auth-gate[hidden], [data-auth-content][hidden], .auth-logout[hidden], .auth-status[hidden] { display: none !important; }
.date-chip, .eyebrow, .label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .16em; color: var(--navy); }
.hero { padding: 32px 0 26px; }
.hero-card {
  position: relative; overflow: hidden; background: linear-gradient(116deg,#e8ede7 0%,#f5eee6 66%,#f0ded8 100%);
  border: 1px solid #fff; border-radius: 30px; padding: 36px 42px; box-shadow: var(--shadow); min-height: 230px;
}
.hero-card:after {
  content: ''; position: absolute; width: 270px; height: 270px; border-radius: 50%; right: -45px; top: -90px;
  background: radial-gradient(circle,#ffffff8a 0 35%,transparent 36%), radial-gradient(circle at 35% 60%,#aab6a94a,transparent 70%);
  pointer-events: none;
}
.hero-copy { position: relative; z-index: 1; max-width: 670px; }
.hero h1, .page-title { font: 500 clamp(34px,5vw,53px)/1.08 'Playfair Display', Georgia, serif; letter-spacing: -.035em; margin: 10px 0 12px; color: var(--navy); }
.hero p { color: #69756c; max-width: 600px; margin: 0; font-size: 15px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; border-radius: 999px;
  padding: 11px 17px; text-decoration: none; font: 600 13px 'DM Sans', sans-serif;
  border: 1px solid transparent; transition: .2s ease; cursor: pointer;
}
.button.primary { background: var(--navy); color: #fff; box-shadow: 0 7px 16px #18344729; }
.button.primary:hover { transform: translateY(-1px); background: #244a60; }
.button.secondary { border-color: #b9c1b8; background: #ffffff83; color: var(--ink); }
.button.secondary:hover { background: white; }
.tiny-arrow { font-size: 18px; line-height: 0; color: var(--gold); }
.button.primary .tiny-arrow { color: #e8d5ad; }
.dashboard-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 18px; align-items: start; }
.stack { display: grid; gap: 18px; }
.panel { background: var(--white); border: 1px solid #fff; border-radius: var(--radius); padding: 22px; box-shadow: var(--soft-shadow); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.panel-head h2, .panel-head h3 { font: 500 22px 'Playfair Display', Georgia, serif; margin: 2px 0 0; color: var(--navy); }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.panel-tag { color: var(--muted); font-size: 11px; white-space: nowrap; text-decoration: none; }
.todo-list { display: grid; gap: 9px; }
.todo-item { display: flex; align-items: flex-start; gap: 11px; padding: 11px 12px; border-radius: 15px; background: #f7f4ee; border: 1px solid transparent; transition: .18s; }
.todo-item:hover { border-color: #e5e9e2; background: #fbfaf7; }
.todo-item input { appearance: none; width: 20px; height: 20px; flex: 0 0 20px; border: 1.5px solid #aab4aa; border-radius: 6px; background: #fff; margin: 1px 0 0; display: grid; place-items: center; cursor: pointer; }
.todo-item input:checked { background: var(--sage); border-color: var(--sage); }
.todo-item input:checked:after { content: '✓'; color: #fff; font-size: 13px; font-weight: 700; }
.todo-item:has(input:checked) .todo-text { color: #8b958d; text-decoration: line-through; }
.todo-text { font-size: 13px; font-weight: 600; }
.todo-meta { display: block; font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.meter { height: 8px; border-radius: 99px; background: #e9e8e1; overflow: hidden; }
.meter > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg,var(--sage),#a5b1a4); border-radius: inherit; transition: width .25s; }
.meter-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; color: var(--muted); font-size: 11px; }
.calendar { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; text-align: center; }
.calendar .weekday { font-size: 10px; color: #89938b; font-weight: 700; padding: 4px 0 7px; }
.calendar .day { aspect-ratio: 1/1; max-width: 36px; width: 100%; margin: auto; display: grid; place-items: center; border-radius: 50%; font-size: 11px; color: #515e55; }
.calendar .day.today { background: var(--rose); color: #634e45; font-weight: 700; box-shadow: 0 4px 10px #a87d6a22; }
.calendar .day.muted { color: #c4c6bf; }
.cal-month { font: 500 17px 'Playfair Display', Georgia, serif; color: #5b665d; }
.habit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.habit { display: flex; gap: 9px; align-items: center; background: #f4f2ec; border-radius: 13px; padding: 10px; font-size: 12px; color: #4d5b51; min-height: 43px; }
.habit input { accent-color: var(--sage); width: 16px; height: 16px; flex: none; }
.habit-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--sage); }
.habit:nth-child(3n) .habit-dot { background: #c99f91; }
.habit:nth-child(3n+2) .habit-dot { background: #b1b9a8; }
.note-area { width: 100%; min-height: 118px; resize: vertical; border: 1px solid #ece8df; border-radius: 14px; padding: 13px; background: #faf8f3; color: var(--ink); font: 13px/1.5 'DM Sans',sans-serif; outline-color: #91a092; }
.note-area::placeholder { color: #a4aaa1; }
.goal-list { display: grid; gap: 11px; }
.goal { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.goal strong { font-size: 12px; font-weight: 600; }
.status-pill { padding: 5px 9px; border-radius: 99px; background: var(--mist); color: #587161; font-size: 10px; font-weight: 700; white-space: nowrap; }
.status-pill.planned { background: #f2e7df; color: #997566; }
.status-pill.building { background: #ebeadf; color: #797654; }
.pulse-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 9px; }
.pulse { padding: 12px; border-radius: 14px; background: #f5f3ed; }
.pulse b { display: block; color: #869188; font-size: 9px; letter-spacing: .13em; text-transform: uppercase; margin-bottom: 5px; }
.pulse span { font-size: 12px; font-weight: 600; }
.footnote { font-size: 11px; color: var(--muted); margin: 12px 0 0; line-height: 1.45; }
.section { padding: 24px 0 40px; }
.section-title { font: 500 26px 'Playfair Display', Georgia, serif; color: var(--navy); margin: 0 0 5px; }
.section-subtitle { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.page-hero { padding: 30px 0 20px; }
.page-hero .hero-card { min-height: 0; padding: 30px 36px; }
.page-hero h1 { font-size: clamp(32px,4vw,45px); }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.report-card { padding: 20px; border-radius: 18px; background: var(--white); border: 1px solid white; box-shadow: var(--soft-shadow); }
.report-card h3 { font: 500 19px 'Playfair Display', Georgia, serif; margin: 0 0 11px; color: #35483d; }
.report-card ul { margin: 0; padding-left: 17px; color: #5e6c62; font-size: 12px; }
.report-card li { margin: 7px 0; }
.report-card.done { background: #e8eee8; }
.report-card.underway { background: #f3e7e1; }
.report-card.check { background: #f0eee5; }
.mini-label { font-size: 9px; text-transform: uppercase; letter-spacing: .14em; color: #7c8a7e; font-weight: 700; margin-bottom: 7px; }
.task-board { display: grid; gap: 8px; }
.task-row { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: start; background: var(--white); border: 1px solid #eee9e0; border-radius: 14px; padding: 12px; }
.task-row input { accent-color: var(--sage); width: 17px; height: 17px; margin: 2px 0 0; }
.task-row strong { font-size: 12px; display: block; }
.task-row p { font-size: 11px; color: var(--muted); margin: 3px 0 0; }
.priority { font-size: 9px; letter-spacing: .09em; text-transform: uppercase; color: #8a765d; background: #f3ece1; border-radius: 99px; padding: 5px 8px; white-space: nowrap; }
.priority.next { background: #e6eee7; color: #587161; }
.agenda { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.agenda th { text-align: left; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: #879187; padding: 0 12px 4px; }
.agenda td { background: var(--white); padding: 11px 12px; font-size: 11px; vertical-align: top; border-top: 1px solid #f1ece4; border-bottom: 1px solid #f1ece4; }
.agenda td:first-child { border-left: 1px solid #f1ece4; border-radius: 11px 0 0 11px; color: #887962; font-weight: 700; white-space: nowrap; width: 100px; }
.agenda td:last-child { border-right: 1px solid #f1ece4; border-radius: 0 11px 11px 0; color: #66736a; }
.agenda strong { display: block; color: #394a3e; font-size: 12px; }
.week-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 9px; }
.week-day { padding: 14px; border-radius: 14px; background: var(--white); border: 1px solid #f0ebe3; min-height: 102px; }
.week-day b { display: block; font-size: 9px; text-transform: uppercase; letter-spacing: .13em; color: var(--sage); margin-bottom: 7px; }
.week-day span { font-size: 11px; color: #69756b; }
.callout { padding: 16px 18px; background: #e8eee8; border-radius: 16px; color: #526557; font-size: 12px; margin-top: 15px; }
.callout strong { color: #374c3c; }
.page-footer { padding: 24px 0 34px; text-align: center; color: #89928a; font-size: 11px; }
.page-footer a { color: var(--sage); font-weight: 700; text-decoration: none; }
.print-button { border: 1px solid #d8ddd5; background: var(--white); color: var(--sage); }
.agenda-scroll { overflow-x: auto; }
.edit-toggle { border: 1px solid #c5cec4; background: var(--white); color: var(--sage); }
.edit-toggle[aria-pressed="true"] { background: var(--sage); color: white; border-color: var(--sage); }
.edit-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; margin: 5px 0 9px; border-radius: 13px; background: #e8eee8; color: #536659; font-size: 11px; }
.edit-bar[hidden] { display: none; }
.edit-bar button { border: 0; background: transparent; color: #526b5a; font: 700 11px 'DM Sans', sans-serif; text-decoration: underline; cursor: pointer; white-space: nowrap; }
body.editing [data-user-editable="true"] { outline: 1px dashed #8ba091; outline-offset: 2px; border-radius: 3px; background: #fffef3; cursor: text; }
body.editing [data-user-editable="true"]:focus { outline: 2px solid var(--sage); }

@media (max-width: 850px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .pulse-grid { grid-template-columns: 1fr 1fr; }
  .report-grid { grid-template-columns: 1fr 1fr; }
  .week-grid { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 600px) {
  .wrap { width: calc(100% - 24px); }
  .topbar { height: auto; min-height: 62px; padding: 8px 0; align-items: flex-start; }
  .nav { justify-content: flex-end; flex-wrap: wrap; }
  .nav a, .nav button { padding: 8px 9px; font-size: 11px; }
  .brand-copy b { font-size: 11px; }
  .brand-copy span { font-size: 9px; }
  .hero { padding-top: 18px; }
  .hero-card, .page-hero .hero-card { padding: 25px 22px; border-radius: 22px; }
  .hero p { font-size: 13px; }
  .hero h1 { font-size: 36px; }
  .panel { padding: 17px; border-radius: 18px; }
  .habit-grid { grid-template-columns: 1fr 1fr; }
  .report-grid { grid-template-columns: 1fr; }
  .week-grid { grid-template-columns: 1fr 1fr; }
  .page-hero { padding-top: 16px; }
  .agenda { min-width: 670px; }
  .task-row { grid-template-columns: 20px 1fr; }
  .task-row .priority { grid-column: 2; justify-self: start; }
  .pulse-grid { grid-template-columns: 1fr 1fr; }
  .edit-bar { align-items: flex-start; }
}
@media print {
  body { background: #fff; }
  .topbar, .hero-actions, .print-button, .page-footer a { display: none !important; }
  .hero-card, .panel, .report-card, .task-row, .week-day { box-shadow: none; break-inside: avoid; }
  .wrap { width: 100%; }
  .page-hero { padding-top: 0; }
  .section { padding: 10px 0; }
  .agenda { font-size: 9px; }
}
