:root{--bg:#f4f2ed;--surface:#fff;--ink:#111827;--muted:#687386;--line:#e5e1d9;--navy:#0d1b2a;--navy2:#152a3d;--accent:#9a7a45;--accent-soft:#f2ebdf;--green:#276749;--green-soft:#edf7f1;--amber:#8a6417;--amber-soft:#fbf5e7;--red:#9a372d;--red-soft:#fcf0ee;--shadow:0 12px 34px rgba(17,24,39,.065);--radius:22px;--gutter:18px}
*{box-sizing:border-box;min-width:0}html,body{margin:0;width:100%;max-width:100%;overflow-x:hidden;background:var(--bg);color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Helvetica Neue",Arial,sans-serif;-webkit-text-size-adjust:100%}body{padding-bottom:calc(86px + env(safe-area-inset-bottom))}button,input,select,textarea{font:inherit}button{cursor:pointer}.app-shell{width:100%;max-width:760px;margin:0 auto;padding:0 var(--gutter) 34px;overflow:hidden}.topbar{height:74px;display:flex;align-items:center;justify-content:space-between}.brand-lockup{display:flex;align-items:center;gap:11px}.brand-mark{width:38px;height:38px;border-radius:12px;background:var(--navy);color:white;display:grid;place-items:center;font-family:Georgia,serif;font-size:21px}.brand-name{display:block;font-size:12px;letter-spacing:.12em;font-weight:800}.brand-sub{display:block;font-size:12px;color:var(--muted);margin-top:2px}.icon-button,.close-button{width:42px;height:42px;border:1px solid var(--line);border-radius:13px;background:rgba(255,255,255,.7);display:grid;place-items:center;color:var(--navy)}.icon-button svg,.close-button svg{width:20px;height:20px}.view{display:none}.view.active{display:block}.surgery-hero{background:linear-gradient(145deg,var(--navy),var(--navy2));border-radius:28px;color:#fff;padding:26px 24px;box-shadow:var(--shadow);margin-bottom:14px}.hero-kicker,.section-kicker{font-size:11px;font-weight:850;letter-spacing:.12em;text-transform:uppercase;color:var(--accent)}.hero-row{display:flex;justify-content:space-between;gap:16px;align-items:flex-end;margin-top:8px}.hero-date{font-family:Georgia,"Times New Roman",serif;font-size:31px;line-height:1.05;letter-spacing:-.025em}.hero-count{font-size:15px;margin-top:10px;color:#dce5ee}.week-chip{white-space:nowrap;background:rgba(255,255,255,.09);border:1px solid rgba(255,255,255,.14);border-radius:999px;padding:9px 12px;font-size:12px;font-weight:800}.readiness-card{background:var(--surface);border:1px solid var(--line);border-radius:20px;padding:16px 17px;display:flex;justify-content:space-between;gap:16px;align-items:center;box-shadow:0 4px 16px rgba(17,24,39,.035)}.readiness-card h2{font-size:18px;margin:4px 0 2px}.readiness-card p{margin:0;color:var(--muted);font-size:13px}.quiet-button,.text-button,.back-button{border:0;background:transparent;color:var(--navy);font-weight:800}.quiet-button{border:1px solid var(--line);border-radius:12px;padding:10px 13px;background:#fff}.text-button{padding:8px}.section-block{margin-top:26px}.section-heading{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;margin-bottom:12px}.section-heading h2{margin:4px 0 0;font-size:24px;letter-spacing:-.03em}.helper{font-size:12px;color:var(--muted);margin:8px 3px 0;line-height:1.45}.segmented{display:grid;grid-template-columns:repeat(3,1fr);background:#e9e6df;border-radius:14px;padding:4px;gap:4px}.segmented button{border:0;border-radius:11px;padding:11px 7px;background:transparent;color:var(--muted);font-weight:800;font-size:13px}.segmented button.active{background:#fff;color:var(--navy);box-shadow:0 2px 9px rgba(17,24,39,.08)}.card-stack,.planner-stack,.history-list{display:flex;flex-direction:column;gap:10px}.plan-card,.actual-card,.history-card{width:100%;background:var(--surface);border:1px solid var(--line);border-radius:20px;padding:15px;display:flex;align-items:center;gap:13px;text-align:left;box-shadow:0 5px 20px rgba(17,24,39,.03);overflow:hidden}.plan-card.modified{border-color:#d9c8aa;background:#fffdf9}.line-icon{width:40px;height:40px;border-radius:13px;background:#f1efe9;color:var(--navy);display:grid;place-items:center;flex:0 0 40px}.line-icon svg{width:21px;height:21px;stroke-width:1.8}.plan-copy,.actual-copy{flex:1;min-width:0}.plan-copy strong,.actual-copy strong{display:block;font-size:15px;letter-spacing:-.01em}.plan-copy small,.actual-copy small{display:block;color:var(--muted);font-size:12.5px;margin-top:3px;white-space:normal;overflow-wrap:anywhere}.status-label{display:inline-flex;margin-top:7px;border-radius:999px;background:var(--accent-soft);color:#745b32;font-size:10px;font-weight:850;letter-spacing:.04em;padding:4px 7px;text-transform:uppercase}.check-control{width:34px;height:34px;border-radius:50%;border:1px solid #d7d2c8;background:#fff;display:grid;place-items:center;flex:0 0 34px;color:var(--green)}.check-control.done{background:var(--green-soft);border-color:#b9ddc8}.chevron{width:18px;color:#9aa2ad;flex:0 0 18px}.aggravated-button{width:100%;display:flex;align-items:center;gap:13px;border:1px solid #ead6d2;background:var(--red-soft);color:var(--red);border-radius:18px;padding:14px 16px;margin-top:22px;text-align:left}.aggravated-button svg{width:22px;height:22px}.aggravated-button span:nth-child(2){display:flex;flex-direction:column}.aggravated-button small{font-weight:500;margin-top:2px;color:#9b5a53}.page-heading{padding:8px 2px 20px}.page-heading h1,.day-page-head h1{font-family:Georgia,"Times New Roman",serif;font-size:36px;line-height:1.05;margin:6px 0 7px;letter-spacing:-.025em}.page-heading p,.day-page-head p{margin:0;color:var(--muted);line-height:1.45}
.topbar{justify-content:flex-start}
.hero-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end}
.week-chip{min-width:112px;padding:10px 16px;text-align:center;line-height:1;flex:0 0 auto;font-size:11px}
.compact-heading{padding-bottom:12px}
.plan-card{cursor:pointer}
.plan-card:active{transform:scale(.997)}
.check-control{position:relative;z-index:2}
@media(max-width:390px){.hero-date{font-size:29px}.week-chip{min-width:108px;padding-left:13px;padding-right:13px}}

.appearance-panel{background:var(--surface);border:1px solid var(--line);border-radius:20px;padding:18px}
.theme-switch{display:grid;grid-template-columns:1fr 1fr;background:#e9e6df;border-radius:14px;padding:4px;gap:4px;margin-top:14px}
.theme-switch button{border:0;border-radius:11px;padding:12px;background:transparent;color:var(--muted);font-weight:850}
.theme-switch button.active{background:#fff;color:#0d1b2a;box-shadow:0 2px 9px rgba(17,24,39,.08)}
.appearance-panel p{margin:12px 2px 0;color:var(--muted);font-size:12.5px;line-height:1.5}

html[data-theme="dark"]{
 --bg:#08111b;--surface:#111d2a;--ink:#f3f5f7;--muted:#9aa8b8;--line:#263647;
 --accent:#c1a16a;--accent-soft:#2a241d;--green:#70bd91;--green-soft:#132b22;
 --amber:#d3ac58;--amber-soft:#302719;--red:#e08b80;--red-soft:#321d1d;
 --shadow:0 14px 38px rgba(0,0,0,.24)
}
html[data-theme="dark"] body{background:var(--bg)}
html[data-theme="dark"] .brand-mark{background:#e7edf3;color:#0d1b2a}
html[data-theme="dark"] .quiet-button,
html[data-theme="dark"] .check-control{background:#162332;border-color:var(--line);color:var(--ink)}
html[data-theme="dark"] .segmented{background:#0d1722}
html[data-theme="dark"] .segmented button.active{background:#1a2a3a;color:#fff;box-shadow:none}
html[data-theme="dark"] .plan-card.modified{background:#191a19;border-color:#5a4c36}
html[data-theme="dark"] .line-icon{background:#182635;color:#d8e5f1}
html[data-theme="dark"] .status-label{color:#d6bd90}
html[data-theme="dark"] .aggravated-button{border-color:#58322e}
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea{background:#0c1723!important;color:var(--ink)!important;border-color:var(--line)!important}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder{color:#6f7d8d}
html[data-theme="dark"] option{background:#0c1723;color:var(--ink)}
html[data-theme="dark"] .theme-switch{background:#0c1723}
html[data-theme="dark"] .theme-switch button.active{background:#213246;color:#fff;box-shadow:none}

.today-plan-row{display:grid;grid-template-columns:minmax(0,1fr) 34px;gap:8px;align-items:stretch}
.today-plan-row .plan-card{height:100%}
.today-order-controls{display:flex;flex-direction:column;gap:6px;justify-content:center}
.today-order-controls .tiny-button{width:34px;height:34px}
.today-order-controls .tiny-button:disabled{opacity:.28;cursor:default}
.routine-card{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:4px 15px 14px;margin:10px 0}
html[data-theme="dark"] .routine-card{background:var(--surface)}

html[data-theme="dark"] .text-button,
html[data-theme="dark"] .back-button{color:#e9eef4}

.hero-phase{margin-top:7px;color:#b8c5d1;font-size:11.5px;line-height:1.35}
.readiness-action{margin-top:5px!important;font-weight:750}
.today-gesture-hint{margin:5px 0 0;color:var(--muted);font-size:11px;line-height:1.35}
.actual-copy strong{color:var(--ink)}
.check-control{width:44px;height:44px;flex-basis:44px}
.today-plan-row{position:relative;display:block;overflow:hidden;border-radius:20px}
.today-row-content{position:relative;z-index:2;display:grid;grid-template-columns:44px minmax(0,1fr);gap:8px;align-items:stretch;background:var(--bg);transition:transform .18s ease;touch-action:pan-y}
.today-drag-handle{width:44px;min-height:100%;border:1px solid var(--line);border-radius:16px;background:var(--surface);color:var(--muted);display:grid;place-items:center;touch-action:none}
.today-drag-handle svg{width:19px;height:19px}
.today-plan-row.dragging{opacity:.72;outline:2px solid var(--accent);outline-offset:-2px}
.today-plan-row.dragging .today-row-content{transition:none}
.swipe-delete{position:absolute;z-index:1;right:0;top:0;bottom:0;width:84px;border:0;border-radius:0 18px 18px 0;background:var(--red);color:#fff;font-weight:850}
.session-prep{margin:0 0 10px;background:var(--accent-soft);border:1px solid var(--line);border-radius:16px;padding:12px 14px}
.session-prep strong,.session-prep span{display:block}
.session-prep strong{font-size:12.5px}
.session-prep span{margin-top:3px;color:var(--muted);font-size:11.5px;line-height:1.4}

.today-drag-handle,
.today-drag-handle *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.today-drag-handle{touch-action:none}
.today-drag-active{-webkit-user-select:none!important;user-select:none!important}
.today-drag-active *{-webkit-user-select:none!important;user-select:none!important}

.plan-copy strong{line-height:1.18;hyphens:none;-webkit-hyphens:none;word-break:normal;overflow-wrap:normal}

/* Compact surgery countdown */
.surgery-hero{padding:20px 20px 18px;margin-bottom:14px}
.surgery-hero .hero-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:18px;align-items:center;margin-top:6px}
.hero-count-block{display:flex;align-items:baseline;gap:9px;min-width:0}
.hero-count{font-family:Georgia,"Times New Roman",serif;font-size:54px;line-height:.92;letter-spacing:-.045em;color:#fff;font-weight:500}
.hero-count-block>span{font-size:14px;font-weight:800;color:#dce5ee;line-height:1.05;max-width:68px}
.hero-meta{display:flex;flex-direction:column;align-items:flex-end;gap:9px}
.hero-date{font-family:inherit;font-size:14px;line-height:1.2;font-weight:850;letter-spacing:.01em;color:#e8eef4;white-space:nowrap}
.hero-phase{margin-top:12px;padding-top:11px;border-top:1px solid rgba(255,255,255,.10);font-size:11px;line-height:1.35;color:#b8c5d1}
.week-chip{min-width:0;padding:8px 11px;font-size:10.5px}
.readiness-card .quiet-button{white-space:nowrap}
.today-drag-handle,.day-drag-handle{cursor:grab}
.today-plan-row.dragging .today-drag-handle,.day-plan-row.dragging .day-drag-handle{cursor:grabbing;background:var(--accent-soft)}
@media(max-width:390px){
 .hero-count{font-size:49px}
 .hero-count-block>span{font-size:13px}
 .hero-date{font-size:13px}
}
