:root {
  --bg: #f5f2ea;
  --bg-2: #efeadf;
  --card: #fffdf8;
  --ink: #213330;
  --ink-2: #4f5f5b;
  --muted: #74817d;
  --line: #e3ddd0;
  --sage: #3f7464;
  --sage-2: #5f8f7f;
  --sage-soft: #e2ece6;
  --sage-wash: #eef4f0;
  --sky: #3f6f8e;
  --sky-soft: #e4edf3;
  --sun: #8a6522;
  --sun-soft: #f6ecd6;
  --rose: #8a4637;
  --rose-soft: #f6e5df;
  --lilac: #5d5a8a;
  --lilac-soft: #ebe9f5;
  --shadow: 0 1px 2px rgba(33, 51, 48, .05), 0 6px 20px rgba(33, 51, 48, .05);
  --r: 18px;
  --r-sm: 12px;
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --tab-h: 74px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 18px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--sage); }
h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.tiny { font-size: 13px; }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 260px; flex: none; padding: 28px 18px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--line); background: var(--bg-2);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 22px; font-weight: 700; font-size: 19px; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; background: var(--sage); display: grid; place-items: center; }
.brand-mark svg { width: 20px; height: 20px; }
.nav-btn {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; border: 0;
  background: transparent; text-align: left; cursor: pointer; font-size: 17px; color: var(--ink-2); text-decoration: none;
}
.nav-btn svg { width: 22px; height: 22px; flex: none; }
.nav-btn:hover { background: rgba(63, 116, 100, .08); }
.nav-btn.on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.side .add-big { margin: 18px 0 6px; }
.side .spacer { flex: 1; }
main { flex: 1; min-width: 0; padding: 34px 40px 60px; max-width: 1060px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin-top: 6px; }
.grid { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }

.tabbar { display: none; }

@media (max-width: 900px) {
  .side { display: none; }
  main { padding: 22px 16px calc(var(--tab-h) + 40px); }
  .cols-2 { grid-template-columns: 1fr; }
  h1 { font-size: 26px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(7, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 253, 248, .96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  }
  .tab { border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--muted); cursor: pointer; padding: 0; text-decoration: none; letter-spacing: -0.01em; }
  .tab svg { width: 25px; height: 25px; }
  .tab.on { color: var(--sage); font-weight: 600; }
  .tab.add .plus { width: 46px; height: 46px; border-radius: 16px; background: var(--sage); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(63, 116, 100, .3); }
  .tab.add .plus svg { width: 24px; height: 24px; }
  .tab.add span:last-child { color: var(--sage); font-weight: 600; }
}

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); }
.card.soft { background: var(--sage-wash); border-color: #d7e5dd; box-shadow: none; }
.card.sky { background: var(--sky-soft); border-color: #d2e0ea; box-shadow: none; }
.card.sun { background: var(--sun-soft); border-color: #ecdcb8; box-shadow: none; }
.card.rose { background: var(--rose-soft); border-color: #ecd2c9; box-shadow: none; }
.card.lilac { background: var(--lilac-soft); border-color: #dcd9ee; box-shadow: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { display: flex; align-items: center; gap: 10px; }
.eyebrow { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-weight: 600; font-size: 16px;
  text-decoration: none; color: var(--ink); transition: background .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn svg { width: 20px; height: 20px; }
.btn.primary { background: var(--sage); border-color: var(--sage); color: #fff; }
.btn.primary:hover { background: #366656; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--sage); padding: 0 10px; }
.btn.quiet { background: rgba(255, 255, 255, .6); }
.btn.danger { color: var(--rose); }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 15px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.add-big { width: 100%; min-height: 54px; font-size: 17px; }
.linkish { background: none; border: 0; color: var(--sage); font-weight: 600; cursor: pointer; padding: 4px 0; font-size: 16px; }

/* ---------- pills, chips ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 14px; font-weight: 600; background: var(--sage-soft); color: var(--sage); }
.pill.sun { background: var(--sun-soft); color: var(--sun); }
.pill.sky { background: var(--sky-soft); color: var(--sky); }
.pill.rose { background: var(--rose-soft); color: var(--rose); }
.pill.gray { background: var(--bg-2); color: var(--ink-2); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 16px; font-size: 15px; cursor: pointer; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.seg { display: inline-flex; background: var(--bg-2); border-radius: 14px; padding: 4px; gap: 4px; margin-bottom: 20px; max-width: 100%; overflow-x: auto; }
.seg button { border: 0; background: none; padding: 9px 16px; border-radius: 11px; font-size: 16px; cursor: pointer; color: var(--ink-2); white-space: nowrap; }
.seg button.on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }

/* ---------- today ---------- */
.hello { margin-bottom: 24px; }
.hello .aff { margin-top: 8px; color: var(--ink-2); font-size: 18px; }
.progress { display: flex; align-items: center; gap: 18px; }
.ring { width: 76px; height: 76px; flex: none; }
.ring circle { fill: none; stroke-width: 8; }
.ring .bg { stroke: var(--sage-soft); }
.ring .fg { stroke: var(--sage); stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.ring text { font-size: 20px; font-weight: 700; fill: var(--ink); }

.dose-time { font-size: 14px; font-weight: 600; color: var(--muted); margin: 16px 0 8px; text-transform: uppercase; letter-spacing: .06em; }
.dose {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; background: var(--bg);
  border: 1px solid transparent; margin-bottom: 8px; cursor: pointer; user-select: none; width: 100%; text-align: left;
}
.dose:hover { border-color: var(--line); }
.dose .check { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #c9c2b2; flex: none; display: grid; place-items: center; background: #fff; transition: all .2s; }
.dose .check svg { width: 18px; height: 18px; opacity: 0; color: #fff; }
.dose.done .check { background: var(--sage); border-color: var(--sage); }
.dose.done .check svg { opacity: 1; }
.dose.done .dname { color: var(--muted); }
.dose .dname { font-weight: 600; }
.dose .dsub { font-size: 15px; color: var(--muted); }
.dose.care .check { border-radius: 10px; }
.dose.skipped .check { background: var(--bg-2); border-color: #c9c2b2; }

.visit-card .when { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.datebox { width: 64px; flex: none; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px 0 8px; }
.datebox .m { font-size: 13px; font-weight: 700; text-transform: uppercase; color: var(--rose); letter-spacing: .05em; }
.datebox .d { font-size: 26px; font-weight: 700; line-height: 1.1; }

.change { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid rgba(0, 0, 0, .06); }
.change:first-child { border-top: 0; }
.change.undone { opacity: .5; text-decoration: line-through; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 10px 0; border-top: 1px solid rgba(0, 0, 0, .06); display: flex; gap: 12px; align-items: flex-start; }
.list-plain li:first-child { border-top: 0; }
.bullet { width: 8px; height: 8px; border-radius: 50%; background: currentColor; margin-top: 10px; flex: none; opacity: .5; }
.todo-box { width: 28px; height: 28px; border-radius: 8px; border: 2px solid #c9c2b2; background: #fff; flex: none; cursor: pointer; display: grid; place-items: center; margin-top: 1px; }
.todo-box svg { width: 16px; opacity: 0; color: #fff; }
.todo-box.on { background: var(--sage); border-color: var(--sage); }
.todo-box.on svg { opacity: 1; }

.reading { display: flex; align-items: center; gap: 14px; }
.reading .dot3 { display: flex; gap: 5px; }
.reading .dot3 i { width: 9px; height: 9px; border-radius: 50%; background: var(--sage-2); animation: bob 1.4s infinite ease-in-out; }
.reading .dot3 i:nth-child(2) { animation-delay: .2s; }
.reading .dot3 i:nth-child(3) { animation-delay: .4s; }
@keyframes bob { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

.handled { display: grid; gap: 10px; }
.handled .h { display: flex; gap: 12px; align-items: center; }
.handled .tick { width: 28px; height: 28px; border-radius: 50%; background: var(--sage); color: #fff; display: grid; place-items: center; flex: none; }
.handled .tick svg { width: 16px; }
.handled .tick.wait { background: var(--sun-soft); color: var(--sun); }

/* ---------- medicines ---------- */
.med { display: flex; gap: 16px; align-items: flex-start; }
.med-icon { width: 46px; height: 46px; border-radius: 14px; background: var(--sage-soft); color: var(--sage); display: grid; place-items: center; flex: none; }
.med-icon svg { width: 24px; height: 24px; }
.med-icon.care { background: var(--sky-soft); color: var(--sky); }
.med h3 { font-size: 19px; }
.med .meta { color: var(--ink-2); font-size: 16px; margin-top: 2px; }
.med .when { margin-top: 8px; display: inline-flex; gap: 8px; align-items: center; font-size: 15px; font-weight: 600; color: var(--sage); background: var(--sage-wash); padding: 5px 12px; border-radius: 10px; }
.review-note { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--sun-soft); color: #6c4f17; font-size: 15px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* ---------- charts ---------- */
.marker { display: flex; flex-direction: column; gap: 6px; }
.marker .val { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.marker .val small { font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.chart { width: 100%; height: auto; display: block; margin-top: 6px; }
.chart .band { fill: var(--sage-wash); }
.chart .bandline { stroke: #cfe0d6; stroke-dasharray: 3 4; }
.chart .line { fill: none; stroke: var(--sage); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: url(#gArea); }
.chart .pt { fill: var(--card); stroke: var(--sage); stroke-width: 2.5; }
.chart .pt.last { fill: var(--sage); }
.chart text { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.note-soft { font-size: 15px; color: var(--ink-2); background: var(--bg); border-radius: 12px; padding: 10px 12px; margin-top: 6px; }

/* ---------- team ---------- */
.doc-card { display: flex; gap: 14px; align-items: center; cursor: pointer; text-decoration: none; color: inherit; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--sky-soft); color: var(--sky); font-weight: 700; display: grid; place-items: center; flex: none; font-size: 18px; }
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item::before { content: ''; position: absolute; left: -22px; top: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--sky); border: 3px solid var(--card); }
.agree { display: flex; gap: 12px; align-items: flex-start; }
.agree .tick { width: 26px; height: 26px; border-radius: 50%; background: var(--sage); color: #fff; display: grid; place-items: center; flex: none; margin-top: 2px; }
.agree .tick svg { width: 15px; }

/* ---------- records ---------- */
.rec { display: flex; gap: 14px; align-items: flex-start; padding: 16px 0; border-top: 1px solid var(--line); cursor: pointer; text-decoration: none; color: inherit; }
.rec:first-child { border-top: 0; }
.rec-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--bg-2); color: var(--ink-2); display: grid; place-items: center; flex: none; }
.rec-icon svg { width: 22px; height: 22px; }
.search { width: 100%; min-height: 50px; border: 1px solid var(--line); border-radius: 14px; padding: 0 16px; background: var(--card); font-size: 17px; }

/* ---------- clare care ---------- */
.aff-card {
  border-radius: 24px; padding: 34px 30px; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 10% 0%, #7fa99a 0%, #4b7f70 45%, #335f55 100%);
}
.aff-card .q { font-size: 26px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; max-width: 30ch; position: relative; }
.aff-card .glow { position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; background: rgba(255, 255, 255, .12); animation: breathe 8s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(.9); opacity: .7; } 50% { transform: scale(1.1); opacity: 1; } }
.moods { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.mood { border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 12px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 14px; }
.mood .face { width: 34px; height: 34px; }
.mood.on { border-color: var(--sage); background: var(--sage-wash); font-weight: 600; }
.practice { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; border-radius: 16px; background: var(--bg); cursor: pointer; border: 1px solid transparent; width: 100%; text-align: left; }
.practice:hover { border-color: var(--line); }
.hope { padding: 18px 0; border-top: 1px solid var(--line); }
.hope:first-child { border-top: 0; padding-top: 4px; }
.hope h3 { margin-bottom: 6px; }
.hope .src { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* ---------- overlays ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(33, 51, 48, .32); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { background: var(--card); border-radius: 24px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto; padding: 26px; box-shadow: 0 20px 60px rgba(0, 0, 0, .2); animation: rise .25s ease; }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }
@media (max-width: 600px) {
  .sheet-bg { align-items: flex-end; padding: 0; }
  .sheet { border-radius: 24px 24px 0 0; max-height: 92vh; padding: 24px 18px calc(24px + env(safe-area-inset-bottom)); }
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.x { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--bg); cursor: pointer; display: grid; place-items: center; }
.x svg { width: 18px; }
.drop { border: 2px dashed #c7d8ce; background: var(--sage-wash); border-radius: 20px; padding: 30px 18px; text-align: center; cursor: pointer; transition: all .2s; }
.drop.over { background: var(--sage-soft); border-color: var(--sage); }
.drop svg { width: 40px; height: 40px; color: var(--sage); }
.add-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.add-opt { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); cursor: pointer; text-align: left; font-weight: 600; font-size: 16px; }
.add-opt svg { width: 24px; height: 24px; color: var(--sage); flex: none; }
.safe-line { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); margin-top: 16px; background: var(--bg); padding: 12px 14px; border-radius: 12px; }
.safe-line svg { width: 18px; height: 18px; color: var(--sage); flex: none; margin-top: 2px; }
.drag-veil { position: fixed; inset: 0; z-index: 60; background: rgba(63, 116, 100, .18); backdrop-filter: blur(3px); display: grid; place-items: center; pointer-events: none; }
.drag-veil div { background: var(--card); padding: 30px 40px; border-radius: 24px; font-size: 22px; font-weight: 600; box-shadow: var(--shadow); }

label.f { display: block; font-size: 15px; font-weight: 600; color: var(--ink-2); margin: 14px 0 6px; }
.in, textarea.in, select.in { width: 100%; min-height: 50px; border: 1px solid var(--line); border-radius: 13px; padding: 11px 14px; background: #fff; font-size: 17px; }
textarea.in { min-height: 120px; resize: vertical; }
.in:focus { outline: 2px solid var(--sage-2); outline-offset: 1px; border-color: transparent; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.toggle:first-of-type { border-top: 0; }
.switch { position: relative; width: 54px; height: 32px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #d6d0c2; border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch input:checked + span { background: var(--sage); }
.switch input:checked + span::before { transform: translateX(22px); }

/* recorder */
.recorder { position: fixed; inset: 0; z-index: 70; background: linear-gradient(180deg, #2f574d, #213f38); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: calc(30px + env(safe-area-inset-top)) 22px calc(30px + env(safe-area-inset-bottom)); text-align: center; }
.rec-orb { width: 210px; height: 210px; border-radius: 50%; display: grid; place-items: center; position: relative; }
.rec-orb::before, .rec-orb::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.rec-orb.live::before { animation: pulse 2.6s ease-out infinite; }
.rec-orb.live::after { animation: pulse 2.6s 1.3s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.75); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
.rec-core { width: 150px; height: 150px; border-radius: 50%; background: rgba(255, 255, 255, .14); display: grid; place-items: center; font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; position: relative; z-index: 1; }
.recorder .btn { min-height: 58px; font-size: 18px; border-radius: 18px; }
.recorder .btn.light { background: #fff; color: #213f38; border: 0; }
.recorder .btn.glass { background: rgba(255, 255, 255, .14); color: #fff; border: 0; }
.rec-status { font-size: 16px; opacity: .85; min-height: 24px; }

/* breathing */
.breath-wrap { display: grid; place-items: center; padding: 20px 0; }
.breath { width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, #a8c9bc 0%, #6f9a8a 70%); display: grid; place-items: center; color: #fff; font-size: 22px; font-weight: 600; transform: scale(.6); transition: transform 4s ease-in-out; }

/* print sheet */
.print-only { display: none; }
@media print {
  body { background: #fff; font-size: 13pt; }
  .side, .tabbar, .no-print, .sheet-bg, header.no-print { display: none !important; }
  main { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .print-only { display: block; }
  .prep-q { break-inside: avoid; }
}
.prep-q { padding: 12px 0; border-top: 1px solid var(--line); }
.prep-q:first-child { border-top: 0; }
.prep-q b { display: block; }
.answer-lines { height: 44px; border-bottom: 1px dashed var(--line); margin-top: 6px; display: none; }
@media print { .answer-lines { display: block; } }

.empty { text-align: center; padding: 36px 20px; color: var(--ink-2); }
.empty > svg { width: 54px; height: 54px; color: var(--sage-2); margin-bottom: 10px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 24px); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 13px 20px; border-radius: 14px; z-index: 80; font-size: 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); animation: rise .2s; max-width: calc(100vw - 32px); }
@media (min-width: 901px) { .toast { bottom: 30px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Claire Care: an Aegean morning ---------- */
body.aegean-bg { background: linear-gradient(180deg, #f4f8fb 0%, #eef5f9 40%, #f8f6f1 100%); }
.aegean {
  --sage: #1f5f9e; --sage-2: #3f85c2; --sage-soft: #e1edf8; --sage-wash: #eef5fb;
  --lilac: #1f5f9e; --lilac-soft: #e8f1f9; --card: #ffffff; --line: #dde8f0;
}
.aegean .card { border-color: #e2ecf3; box-shadow: 0 1px 2px rgba(23, 70, 110, .05), 0 10px 28px rgba(23, 70, 110, .06); }
.aegean .card.soft { background: linear-gradient(180deg, #f2f8fd, #eaf3fa); border-color: #d6e6f2; }
.aegean .card.lilac { background: #eaf2f9; border-color: #d4e4f1; }
.aegean h2 { color: #163f63; }
.aegean .handled .tick { background: #1f5f9e; }
.aegean .handled .tick.wait { background: #fbf1dc; color: #9a7428; }
.aegean .mood.on { border-color: #1f5f9e; background: #eef5fb; }
.aegean .practice { background: #f3f8fc; }
.isle { position: relative; border-radius: 26px; overflow: hidden; height: 340px; box-shadow: 0 18px 40px rgba(23, 70, 110, .16); background: #9fd0ec; }
.isle-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.isle-svg .glint { opacity: 0; animation: glint 6s ease-in-out infinite; }
@keyframes glint { 0%, 100% { opacity: 0; transform: translateX(0); } 40% { opacity: .55; } 70% { opacity: .15; transform: translateX(14px); } }
.isle-svg .swell { animation: swell 9s ease-in-out infinite; }
@keyframes swell { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
.isle-svg .sun { animation: breathe 10s ease-in-out infinite; transform-origin: 1010px 96px; }
.isle-card {
  position: absolute; right: 26px; top: 26px; max-width: 430px; padding: 22px 24px; border-radius: 20px;
  background: rgba(255, 255, 255, .72); backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, .7); color: #143a5c;
}
.isle-card .eyebrow { color: #2a6aa6; }
.isle-card .q { font-size: 23px; font-weight: 600; line-height: 1.32; margin-top: 8px; letter-spacing: -0.01em; }
@media (max-width: 1100px) {
  .isle { height: auto; overflow: visible; background: none; box-shadow: none; }
  .isle-svg { position: relative; height: 250px; border-radius: 22px; box-shadow: 0 14px 34px rgba(23, 70, 110, .16); }
  .isle-card { position: relative; right: auto; top: auto; max-width: none; margin: -46px 14px 0; background: rgba(255, 255, 255, .92); box-shadow: 0 10px 28px rgba(23, 70, 110, .12); }
  .isle-card .q { font-size: 21px; }
}
.breath { background: radial-gradient(circle, #9fd0ec 0%, #2a7fb8 75%); }

/* ---------- Ask Kiki ---------- */
.kiki-wrap { max-width: 760px; }
.kiki-log { display: flex; flex-direction: column; gap: 14px; }
.kmsg { display: flex; gap: 10px; align-items: flex-start; }
.kmsg.me { justify-content: flex-end; }
.kava { width: 38px; height: 38px; border-radius: 50%; background: #f3e6cf; color: #8a6522; display: grid; place-items: center; flex: none; }
.kava svg { width: 22px; height: 22px; }
.kb { background: var(--card); border: 1px solid var(--line); border-radius: 18px 18px 18px 6px; padding: 14px 16px; max-width: 88%; box-shadow: var(--shadow); }
.kb p + p, .kb ul + p, .kb p + ul { margin-top: 10px; }
.kb ul { margin: 0; padding-left: 20px; }
.kb li { margin: 4px 0; }
.kmsg.me .kb { background: var(--sage); color: #fff; border-color: var(--sage); border-radius: 18px 18px 6px 18px; white-space: pre-wrap; }
.ksrc { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.ksrc a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kiki-input { display: flex; gap: 10px; align-items: flex-end; margin-top: 18px; position: sticky; bottom: 12px; background: var(--card); padding: 10px; border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.kiki-input textarea { flex: 1; border: 0; resize: none; padding: 10px 8px; font-size: 17px; background: transparent; outline: none; min-height: 46px; max-height: 160px; }
.kiki-input .btn { min-height: 48px; width: 52px; padding: 0; }
@media (max-width: 900px) { .kiki-input { bottom: calc(var(--tab-h) + 10px + env(safe-area-inset-bottom)); } .tab { font-size: 10.5px; } .tab svg { width: 24px; height: 24px; } }

/* ---------- calm color system ---------- */
:root { --bg: #f1f0e8; --accent: #3f7f68; --accent-soft: #e1eee7; --accent-wash: #eef5f1; }
body[data-page="today"] { --accent: #3f7f68; --accent-soft: #dfeee6; --accent-wash: #edf5f0; }
body[data-page="medicines"] { --accent: #2c7f80; --accent-soft: #d9eeee; --accent-wash: #ebf6f5; }
body[data-page="visits"] { --accent: #3a72a0; --accent-soft: #dde9f4; --accent-wash: #edf3f9; }
body[data-page="health"] { --accent: #5b63ad; --accent-soft: #e3e5f6; --accent-wash: #f0f1fa; }
body[data-page="team"] { --accent: #86598f; --accent-soft: #efe2f1; --accent-wash: #f7f0f7; }
body[data-page="records"] { --accent: #9a7036; --accent-soft: #f2e6d2; --accent-wash: #f8f2e8; }
body[data-page="kiki"] { --accent: #b07a1c; --accent-soft: #f6e8cc; --accent-wash: #fbf4e6; }
body:not(.aegean-bg) { background: linear-gradient(180deg, var(--accent-wash) 0, var(--bg) 420px) fixed; transition: background .3s; }
@media (max-width: 900px) { body:not(.aegean-bg) { background: linear-gradient(180deg, var(--accent-wash) 0, var(--bg) 300px); } }
.card { background: #fffefb; }
.side { background: linear-gradient(180deg, #e7f0ea 0%, #eef0ea 55%, #f1ece2 100%); border-right-color: #dfe5dc; }
.nav-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; color: var(--c); background: color-mix(in srgb, var(--c) 11%, transparent); transition: all .2s; }
.nav-ic svg { width: 20px; height: 20px; }
.nav-btn { padding: 7px 10px; }
.nav-btn.on .nav-ic { background: var(--c); color: #fff; }
.tab.on { color: var(--c); }
.tab svg { color: color-mix(in srgb, var(--c, #74817d) 70%, #74817d); }
.tab.on svg { color: var(--c); }
.ph-icon { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; margin-bottom: 12px; background: var(--accent-soft); color: var(--accent); }
.ph-icon svg { width: 25px; height: 25px; }
.card-head h2::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); opacity: .7; flex: none; }
.card.rose .card-head h2::before { background: #c0705c; }
.card.sky .card-head h2::before { background: #3a72a0; }
.card.sun .card-head h2::before { background: #c79a3c; }
.card.soft .card-head h2::before { background: var(--accent); }
.seg button.on { color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); }
.dose { background: var(--accent-wash); }
.dose.done .check { background: var(--accent); border-color: var(--accent); }
.dose.care .check { border-color: #9cbad3; }
.dose.care.done .check { background: #3a72a0; border-color: #3a72a0; }
.ring .bg { stroke: var(--accent-soft); }
.ring .fg { stroke: var(--accent); }
.datebox .m { color: #c06a52; }
.avatar { background: #efe2f1; color: #86598f; }
.rec-icon { background: var(--accent-soft); color: var(--accent); }
.med-icon { background: #d9eeee; color: #2c7f80; }
.marker .val { color: #2f3770; }
body[data-page="health"] .chart .line { stroke: #5b63ad; }
body[data-page="health"] .chart .pt { stroke: #5b63ad; }
body[data-page="health"] .chart .pt.last { fill: #5b63ad; }
body[data-page="health"] .chart .band { fill: #e8f2ec; }
body[data-page="health"] #gArea stop { stop-color: #5b63ad; }
.agree .tick { background: #86598f; }
.hello { position: relative; overflow: hidden; border-radius: 26px; padding: 28px 30px; margin-bottom: 22px;
  background: linear-gradient(120deg, #fbe7d8 0%, #f6eedd 38%, #e3efe6 72%, #dcebf3 100%); border: 1px solid #efe4d4; }
.hello .eyebrow { color: #a0704e; }
.hello h1 { color: #263f39; }
.hello .aff { color: #4a5c57; max-width: 52ch; }
.hello-sun { position: absolute; right: -30px; top: -40px; width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 236, 200, .95) 0%, rgba(255, 220, 170, .45) 45%, rgba(255, 220, 170, 0) 70%); animation: breathe 9s ease-in-out infinite; pointer-events: none; }
@media (max-width: 900px) { .hello { padding: 22px 20px; border-radius: 22px; } }
.btn.primary { background: var(--accent); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(.94); background: var(--accent); }
.linkish, a { color: var(--accent); }
.tab.add .plus { background: linear-gradient(135deg, #4f9a7f, #2f6f6a); }
.side .add-big { background: linear-gradient(135deg, #4f9a7f, #2f6f6a); border: 0; }
.kava { background: #f6e8cc; color: #b07a1c; }
.kmsg.me .kb { background: #b07a1c; border-color: #b07a1c; }
.kava { width: 42px; height: 42px; padding: 0; overflow: hidden; background: none; }
.kava img { width: 100%; height: 100%; display: block; }
.kiki-hero { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.kiki-hero img { width: 92px; height: 92px; border-radius: 50%; flex: none; box-shadow: 0 8px 22px rgba(176, 122, 28, .22); border: 3px solid #fff; }
.kiki-hero > div { flex: 1; }
.kiki-hero p { margin-top: 4px; }
@media (max-width: 600px) { .kiki-hero img { width: 72px; height: 72px; } .kiki-hero h1 { font-size: 24px; } }
.hello > *:not(.hello-sun) { position: relative; z-index: 1; }
.hello-sun { z-index: 0; }
.tab.add .plus svg { color: #fff; }
