:root {
  --ink: #573a29;
  --muted: #987664;
  --paper: #fffaf3;
  --cream: #f7ede1;
  --peach: #f5cfbe;
  --peach-deep: #c97d5f;
  --gold: #ddb26e;
  --gold-soft: #f7e8ba;
  --line: rgba(143, 91, 58, .14);
  --shadow: 0 18px 50px rgba(126, 77, 43, .10);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Manrope", system-ui, sans-serif;
  background:
    radial-gradient(circle at 7% 4%, rgba(255, 219, 197, .65), transparent 25rem),
    radial-gradient(circle at 93% 90%, rgba(247, 224, 170, .45), transparent 28rem),
    #f8f0e7;
}
button, input, textarea, select { font: inherit; }
button { color: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 254px 1fr; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 34px 24px;
  background: rgba(255, 250, 244, .82); border-right: 1px solid var(--line);
  backdrop-filter: blur(18px); z-index: 20;
}
.brand { display: flex; gap: 13px; align-items: center; margin: 0 8px 45px; }
.brand-mark { position: relative; flex: 0 0 auto; width: 48px; height: 48px; object-fit: cover; border-radius: 50%; border: 1px solid rgba(157, 110, 72, .18); background: #fbf3e8; box-shadow: 0 8px 20px rgba(174, 109, 72, .18); }
.brand strong { display: block; font-family: "DM Serif Display", serif; font-size: 20px; letter-spacing: .5px; font-weight: 400; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: 2.2px; }
.nav-list { display: grid; gap: 9px; }
.nav-button { width: 100%; border: 0; background: transparent; display: flex; align-items: center; gap: 13px; padding: 13px 16px; border-radius: 16px; cursor: pointer; color: #8d6b59; text-align: left; transition: .2s; }
.nav-button:hover { background: rgba(244, 221, 204, .55); color: var(--ink); }
.nav-button.active { background: linear-gradient(135deg, #f8dfd1, #f5e7c9); color: #714a34; box-shadow: inset 0 0 0 1px rgba(193, 123, 85, .12); }
.nav-icon { width: 23px; text-align: center; font-size: 18px; }
.sidebar-quote { position: absolute; bottom: 34px; left: 30px; right: 30px; padding-top: 18px; border-top: 1px solid var(--line); color: #a38370; font-size: 12px; line-height: 1.8; }

.main { min-width: 0; padding: 40px clamp(28px, 5vw, 72px) 80px; }
.topbar { max-width: 1180px; margin: 0 auto 30px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.eyebrow { color: #bd795c; font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
.page-title { margin: 5px 0 0; font-family: "DM Serif Display", serif; font-size: clamp(32px, 4vw, 52px); font-weight: 400; line-height: 1.12; }
.date-chip { white-space: nowrap; padding: 11px 16px; border-radius: 999px; color: #896856; background: rgba(255,255,255,.55); border: 1px solid var(--line); font-size: 13px; }
.page { max-width: 1180px; margin: 0 auto; animation: lift .35s ease; }
@keyframes lift { from { opacity: 0; transform: translateY(8px); } }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(250px, .78fr); gap: 22px; }
.hero-card { position: relative; overflow: hidden; min-height: 390px; padding: clamp(30px, 5vw, 60px); border-radius: var(--radius-xl); background: linear-gradient(135deg, #f3c9b8 0%, #f8dfc9 52%, #f8e9bc 100%); box-shadow: var(--shadow); }
.hero-card::after { content: ""; position: absolute; width: 260px; height: 260px; right: -70px; top: -80px; border: 1px solid rgba(255,255,255,.42); border-radius: 50%; box-shadow: 0 0 0 35px rgba(255,255,255,.09), 0 0 0 70px rgba(255,255,255,.07); }
.hero-card > * { position: relative; z-index: 1; }
.hero-kicker { display: inline-flex; align-items: center; gap: 9px; color: #8a5741; font-weight: 600; font-size: 13px; }
.hero-kicker::before { content: "✦"; color: #b06f4f; }
.hero-card h2 { max-width: 660px; margin: 22px 0 18px; font-size: clamp(34px, 5vw, 62px); line-height: 1.15; letter-spacing: -2px; font-weight: 600; }
.hero-copy { max-width: 610px; color: #825e4e; font-size: 16px; line-height: 1.9; }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn { border: 0; padding: 13px 20px; border-radius: 14px; cursor: pointer; font-weight: 600; transition: transform .18s, box-shadow .18s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { color: #fff9ed; background: #704936; box-shadow: 0 10px 22px rgba(103, 64, 43, .22); }
.btn-gold { color: #6e4829; background: linear-gradient(135deg, #f4d795, #dfae62); box-shadow: 0 10px 22px rgba(176, 115, 48, .18); }
.btn-soft { background: rgba(255,255,255,.55); border: 1px solid rgba(116,72,45,.16); }
.btn-danger { color: #a3584f; background: #fff1ec; border: 1px solid #f1d5cc; }
.btn-small { padding: 9px 13px; font-size: 12px; border-radius: 11px; }

.card { background: rgba(255, 252, 247, .87); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 12px 35px rgba(118, 74, 44, .07); }
.daily-card { padding: 28px; display: flex; flex-direction: column; }
.daily-card .orbit { width: 82px; height: 82px; margin-bottom: 34px; border-radius: 50%; display: grid; place-items: center; color: #9a663e; background: linear-gradient(145deg, #fff3df, #f3d6bb); box-shadow: inset 0 0 0 12px rgba(255,255,255,.35); font-size: 28px; }
.daily-card h3 { font-size: 20px; margin-bottom: 10px; }
.daily-card p { color: var(--muted); line-height: 1.75; font-size: 13px; }
.daily-card .mini-progress { margin-top: auto; }
.progress-label { display: flex; justify-content: space-between; color: #987563; font-size: 12px; margin-bottom: 9px; }
.track { height: 7px; border-radius: 99px; background: #f0e2d6; overflow: hidden; }
.track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #d9956d, #e5bd6a); }

.section { margin-top: 38px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
.section-head h2 { margin: 4px 0 0; font-size: 24px; }
.section-head p { margin: 0; color: var(--muted); font-size: 13px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.metric { padding: 21px 23px; }
.metric strong { display: block; font-family: "DM Serif Display", serif; font-size: 31px; font-weight: 400; color: #765039; }
.metric span { color: var(--muted); font-size: 12px; }
.path-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.path-card { padding: 23px; position: relative; }
.path-no { color: #c88b6d; font-family: "DM Serif Display", serif; font-size: 24px; }
.path-card h3 { margin: 18px 0 7px; font-size: 16px; }
.path-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.path-state { position: absolute; right: 18px; top: 18px; padding: 6px 9px; border-radius: 99px; background: #f5e9db; color: #a17055; font-size: 10px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.filter { border: 1px solid var(--line); background: rgba(255,255,255,.48); color: #98715d; border-radius: 99px; padding: 9px 15px; cursor: pointer; font-size: 12px; }
.filter.active { color: #744a33; background: #f4d7c7; border-color: transparent; }
.template-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 17px; }
.template-card { min-height: 245px; padding: 24px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.template-card::after { content: ""; position: absolute; width: 110px; height: 110px; right: -35px; top: -35px; background: var(--wash, #f4d9c9); border-radius: 50%; opacity: .55; }
.template-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: var(--wash, #f4d9c9); font-size: 22px; position: relative; z-index: 1; }
.template-card .meta { color: #bd795c; font-size: 11px; letter-spacing: 1px; margin: 22px 0 7px; }
.template-card h3 { font-size: 17px; margin-bottom: 9px; }
.template-card p { color: var(--muted); font-size: 12px; line-height: 1.75; }
.template-card button { margin-top: auto; align-self: flex-start; border: 0; background: transparent; color: #9d6448; font-weight: 600; cursor: pointer; padding: 8px 0 0; }

.tool-list { display: grid; gap: 13px; }
.tool-row { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 19px 21px; }
.tool-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 16px; background: #f5e7d4; color: #9d7046; font-size: 21px; }
.tool-copy h3 { margin: 0 0 4px; font-size: 15px; }
.tool-copy p { margin: 0; color: var(--muted); font-size: 12px; }
.tool-meta { text-align: right; }
.tool-meta span { display: block; color: #b28268; font-size: 11px; }
.tool-actions { display: flex; gap: 8px; margin-top: 8px; }

.profile-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 20px; }
.profile-card { padding: 28px; }
.profile-card h3 { margin-bottom: 8px; }
.profile-card > p { color: var(--muted); font-size: 13px; line-height: 1.8; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 24px; border-top: 1px solid var(--line); padding-top: 22px; }
.stat-row div { text-align: center; }
.stat-row strong { display: block; font-family: "DM Serif Display", serif; font-size: 28px; font-weight: 400; }
.stat-row span { color: var(--muted); font-size: 11px; }
.backup-card { background: linear-gradient(135deg, #f8e3d5, #f8edcd); }
.backup-status { display: flex; align-items: center; gap: 9px; padding: 12px 13px; margin: 20px 0; border-radius: 13px; background: rgba(255,255,255,.45); font-size: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #d6a356; box-shadow: 0 0 0 5px rgba(214,163,86,.15); }
.evidence-list { display: grid; gap: 12px; }
.evidence-item { display: grid; grid-template-columns: 46px 1fr; gap: 14px; align-items: start; padding: 17px; }
.evidence-date { text-align: center; padding: 7px 4px; border-radius: 12px; background: #f6e8db; }
.evidence-date strong { display: block; font-size: 16px; }
.evidence-date span { font-size: 9px; color: var(--muted); }
.evidence-item p { margin: 2px 0 4px; font-size: 13px; line-height: 1.6; }
.evidence-item small { color: var(--muted); }

.empty-state { text-align: center; padding: 55px 25px; }
.empty-state .orbit { width: 76px; height: 76px; display: grid; place-items: center; margin: 0 auto 20px; border-radius: 50%; background: #f7e7d8; font-size: 26px; }
.empty-state p { color: var(--muted); font-size: 13px; line-height: 1.8; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; background: rgba(70, 44, 31, .38); backdrop-filter: blur(7px); }
.modal { width: min(720px, 100%); max-height: min(88vh, 860px); overflow: auto; padding: 30px; border-radius: 28px; background: #fffaf4; box-shadow: 0 30px 80px rgba(70, 41, 25, .25); animation: pop .25s ease; }
.modal.modal-wide { width: min(900px, 100%); }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(8px); } }
.modal-head { display: flex; justify-content: space-between; gap: 20px; align-items: start; margin-bottom: 24px; }
.modal-head h2 { margin: 3px 0 0; font-size: 25px; }
.icon-button { border: 0; width: 38px; height: 38px; border-radius: 50%; background: #f4e8de; cursor: pointer; font-size: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.field { display: grid; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.field label { color: #785846; font-size: 12px; font-weight: 600; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid #ead8ca; outline: 0; color: var(--ink); background: #fffdf9; border-radius: 13px; padding: 12px 13px; }
.field textarea { min-height: 90px; resize: vertical; line-height: 1.65; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: #d49d80; box-shadow: 0 0 0 3px rgba(212,157,128,.12); }
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.choice { border: 1px solid #ead8ca; background: #fffdf9; padding: 13px; border-radius: 13px; cursor: pointer; text-align: left; }
.choice.selected { background: #f7ded0; border-color: #dea98f; }
.choice strong { display: block; font-size: 13px; }
.choice small { color: var(--muted); }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

.practice-layout { display: grid; grid-template-columns: 230px 1fr; gap: 22px; }
.practice-menu { display: grid; align-content: start; gap: 7px; }
.practice-tab { border: 0; background: transparent; padding: 12px; border-radius: 12px; text-align: left; cursor: pointer; font-size: 12px; }
.practice-tab.active { background: #f5e0d2; }
.practice-panel { min-height: 390px; padding: 23px; border: 1px solid var(--line); border-radius: 20px; background: #fffcf7; }
.practice-panel h3 { margin-bottom: 6px; }
.practice-panel .intro { color: var(--muted); font-size: 12px; line-height: 1.7; }
.release-stage { text-align: center; padding: 25px 10px; }
.breath { width: 130px; height: 130px; margin: 20px auto; border: 1px solid #dbc29f; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, #fff8e9, #f6e4c9); animation: breathe 5s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.06); box-shadow: 0 0 0 15px rgba(229,193,137,.08); } }
.option-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 15px 0; }
.option { border: 1px solid #e8d6c4; background: #fffaf3; border-radius: 99px; padding: 8px 13px; cursor: pointer; font-size: 12px; }
.option.selected { background: #f2d6c5; border-color: #dca184; }
.affirmation-card { margin: 18px 0; padding: 25px; border-radius: 18px; text-align: center; background: linear-gradient(135deg, #fff0d5, #f8dfb8); color: #7c5535; font-family: "DM Serif Display", serif; font-size: 20px; line-height: 1.8; }
.timer { text-align: center; margin: 18px 0; font-family: "DM Serif Display", serif; font-size: 42px; font-variant-numeric: tabular-nums; }
.mood-row { display: flex; flex-wrap: wrap; gap: 7px; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 200; transform: translateX(-50%); padding: 11px 18px; color: #fff; background: rgba(82,52,36,.92); border-radius: 99px; font-size: 12px; box-shadow: var(--shadow); animation: toast .25s ease; }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 8px); } }
.mobile-nav { display: none; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 92px 1fr; }
  .sidebar { padding: 28px 15px; }
  .brand { justify-content: center; margin: 0 0 40px; }
  .brand-copy, .nav-label, .sidebar-quote { display: none; }
  .nav-button { justify-content: center; padding: 14px; }
  .hero-grid, .profile-grid { grid-template-columns: 1fr; }
  .daily-card { min-height: 260px; }
  .template-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  body { background: #fbf4ec; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main { padding: 26px 17px 110px; }
  .topbar { align-items: flex-start; margin-bottom: 22px; }
  .page-title { font-size: 34px; }
  .date-chip { padding: 8px 10px; font-size: 10px; }
  .hero-card { min-height: 430px; padding: 30px 24px; border-radius: 27px; }
  .hero-card h2 { font-size: 39px; letter-spacing: -1.2px; }
  .hero-copy { font-size: 14px; }
  .metric-grid, .path-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .metric { padding: 17px 10px; text-align: center; }
  .metric strong { font-size: 25px; }
  .template-grid { grid-template-columns: 1fr; }
  .template-card { min-height: 220px; }
  .tool-row { grid-template-columns: auto 1fr; }
  .tool-meta { grid-column: 1 / -1; text-align: left; padding-left: 68px; margin-top: -10px; }
  .stat-row { gap: 6px; }
  .modal { padding: 23px 18px; border-radius: 23px; }
  .form-grid, .choice-grid { grid-template-columns: 1fr; }
  .practice-layout { grid-template-columns: 1fr; }
  .practice-menu { grid-template-columns: repeat(2, 1fr); }
  .mobile-nav { position: fixed; display: grid; grid-template-columns: repeat(4, 1fr); left: 13px; right: 13px; bottom: 12px; z-index: 90; padding: 7px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,250,244,.93); backdrop-filter: blur(18px); box-shadow: 0 16px 38px rgba(81,49,31,.18); }
  .mobile-nav .nav-button { display: grid; justify-items: center; gap: 2px; padding: 7px 2px; font-size: 10px; border-radius: 15px; }
  .mobile-nav .nav-icon { font-size: 17px; }
  .mobile-nav .nav-label { display: block; }
}
