/* Shared foundations. */
:root {
    color-scheme: light;
    --ink:#24342f; --muted:#69766f; --paper:#fff; --paper-dim:#f3f6f4; --cream:#f3f6f4;
    --line:#e0e7e2; --sage:#237254; --navy:#245f4b; --navy-deep:#f5f7f5;
    --gold:#86a695; --orange:#237254; --orange-dark:#19593f; --error:#b3423b; --radius:14px;
    --sans:-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei","PingFang SC",sans-serif;
    --serif:var(--sans);
}
.lifeos-shell,.lifeos-shell * { box-sizing:border-box; }
.lifeos-shell { margin:0; min-height:100vh; background:#f5f7f5; color:var(--ink); font:14px/1.65 var(--sans); overflow-wrap:anywhere; }
.lifeos-shell [hidden] { display:none!important; }
.lifeos-shell a { color:var(--sage); text-underline-offset:3px; }
.lifeos-shell h1,.lifeos-shell h2,.lifeos-shell h3,.lifeos-shell h4,.lifeos-shell h5 { color:var(--ink); font-family:var(--sans); line-height:1.4; font-weight:600; }
.lifeos-shell h1 { margin:0; font-size:30px; letter-spacing:-.6px; }
.lifeos-shell h2 { margin:0 0 14px; font-size:20px; }
.lifeos-shell h3 { margin:0 0 12px; font-size:18px; }
.lifeos-shell h4 { margin:0 0 16px; font-size:15px; }
.lifeos-shell p { margin:8px 0; line-height:1.75; }
.lifeos-shell :focus-visible { outline:3px solid #68a991; outline-offset:3px; }
.lifeos-shell button,.lifeos-shell input,.lifeos-shell textarea,.lifeos-shell select { font:inherit; max-width:100%; }
.lifeos-shell input,.lifeos-shell textarea,.lifeos-shell select { min-width:0; min-height:42px; padding:9px 12px; border:1px solid #d8e1db; border-radius:8px; color:var(--ink); background:#fff; box-shadow:none; }
.lifeos-shell input:hover,.lifeos-shell textarea:hover,.lifeos-shell select:hover { border-color:#a6b9ad; }
.lifeos-shell textarea { display:block; width:100%; min-height:96px; resize:vertical; line-height:1.65; }
.lifeos-shell textarea::placeholder,.lifeos-shell input::placeholder { color:#87958c; font-weight:400; }
.lifeos-shell label { font-size:13px; font-weight:500; color:#56655c; }
.lifeos-shell input[type=checkbox],.lifeos-shell input[type=radio] { width:18px; height:18px; min-height:0; accent-color:var(--sage); vertical-align:middle; }
.lifeos-shell button,.lifeos-shell .button,.lifeos-shell .toolbar-link { display:inline-flex; justify-content:center; align-items:center; gap:7px; min-height:42px; min-width:0; max-width:100%; padding:9px 16px; border:1px solid #d8e1db; border-radius:8px; background:#fff; color:#3c5145; font:500 14px/1.5 var(--sans); text-decoration:none; text-align:center; cursor:pointer; box-shadow:none; white-space:normal; }
.lifeos-shell button:hover,.lifeos-shell .button:hover { background:#f0f5f1; border-color:#b4c8ba; }
.lifeos-shell button.primary,.lifeos-shell button.success,.lifeos-shell .button.primary,.lifeos-shell #create-task,.lifeos-shell #generateBtn { background:var(--sage); border-color:var(--sage); color:#fff; }
.lifeos-shell button.primary:hover,.lifeos-shell button.success:hover,.lifeos-shell .button.primary:hover { background:#195c42; border-color:#195c42; }
.lifeos-shell button:disabled { opacity:.5; cursor:not-allowed; }
.lifeos-shell .text-button,.lifeos-shell .icon-button { background:transparent; border-color:transparent; box-shadow:none; }
.lifeos-shell .text-button { padding:8px 10px; color:var(--muted); font-size:13px; }
.lifeos-shell .icon-button { width:42px; padding:6px; font-size:23px; color:#58685e; }
.lifeos-shell .warning,.lifeos-shell .danger,.lifeos-shell .error,.lifeos-shell .message.error { color:var(--error); }
.lifeos-shell .muted,.lifeos-shell .meta,.lifeos-shell .status,.lifeos-shell .note { color:var(--muted); font-size:13px; }
.lifeos-shell .ok,.lifeos-shell .message.ok { color:var(--sage); }
.lifeos-shell .message:empty,.lifeos-shell .draft-status:empty { display:none; }

/* Navigation and page frame. */
.skip-link { position:fixed; top:-70px; left:12px; z-index:100; padding:12px; background:#fff; }
.skip-link:focus { top:8px; }
.lifeos-shell .visually-hidden { position:absolute; width:1px; height:1px; margin:-1px; padding:0; clip-path:inset(50%); overflow:hidden; white-space:nowrap; border:0; }
.lifeos-shell .app-header { position:relative; z-index:20; display:flex; align-items:center; gap:60px; min-height:72px; padding:0 max(28px,calc((100vw - 1120px)/2)); background:#fff; border-bottom:1px solid var(--line); }
.lifeos-shell .brand { display:inline-flex; align-items:center; gap:10px; color:#243f31; font-size:22px; font-weight:650; text-decoration:none; letter-spacing:-.6px; white-space:nowrap; }
.brand-compass { display:inline-flex; justify-content:center; align-items:center; width:30px; height:30px; background:#237254; border-radius:9px; color:#fff; font-size:19px; font-weight:650; }
.brand small { display:none; }
.desktop-nav { display:flex; align-self:stretch; align-items:center; gap:8px; }
.lifeos-shell .desktop-nav a { display:flex; align-items:center; justify-content:center; min-height:40px; padding:7px 22px; border-radius:8px; color:#69766f; text-decoration:none; font-weight:500; }
.lifeos-shell .desktop-nav a:hover { background:#f5f7f5; }
.lifeos-shell .desktop-nav a[aria-current=page] { color:#237254; background:#eaf3ed; }
.lifeos-shell .app-menu { position:relative; margin-left:auto; }
.app-menu>summary { display:flex; align-items:center; gap:8px; min-height:44px; min-width:44px; list-style:none; color:var(--muted); cursor:pointer; }
.app-menu>summary::-webkit-details-marker { display:none; }
.menu-glyph { font-size:20px; }
.menu-label { font-size:13px; }
.lifeos-shell .app-menu nav { position:absolute; right:0; top:calc(100% + 8px); width:230px; padding:8px; border:1px solid var(--line); border-radius:12px; background:#fff; box-shadow:0 12px 32px #223c3018; }
.lifeos-shell .app-menu nav a { display:block; padding:10px 12px; border-radius:6px; color:var(--ink); text-decoration:none; }
.lifeos-shell .app-menu nav a:hover { background:#f1f5f2; }
.menu-logout { margin:6px 0 0; padding-top:6px; border-top:1px solid var(--line); }
.lifeos-shell .menu-logout button { justify-content:flex-start; width:100%; padding:10px 12px; }
.mobile-nav { display:none; }
.lifeos-shell main { width:min(1080px,calc(100% - 56px)); margin:0 auto; padding:36px 0 64px; }
.lifeos-shell.today-page main { width:min(1000px,calc(100% - 56px)); }
.lifeos-shell .page-intro { display:flex; justify-content:space-between; align-items:center; gap:20px; margin:0 0 26px; padding:0 2px; }
.page-intro p { color:var(--muted); margin:6px 0 0; }
.eyebrow { color:var(--muted); font-size:11px; letter-spacing:.1em; margin-bottom:8px; }
.lifeos-shell .paper,.lifeos-shell .card,.lifeos-shell .panel,.lifeos-shell .goal,.lifeos-shell .task,.lifeos-shell .stage-card,.lifeos-shell .proposal,.lifeos-shell .result-card { padding:24px; margin:0 0 20px; background:#fff; color:var(--ink); border:1px solid var(--line); border-radius:var(--radius); box-shadow:0 2px 5px #263e2d03; }
.lifeos-shell main>header:not(.page-intro) { margin-bottom:24px; }
.lifeos-shell .row,.lifeos-shell .toolbar,.lifeos-shell .form-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.lifeos-shell .row,.lifeos-shell .section-title { justify-content:space-between; }
.lifeos-shell .toolbar,.lifeos-shell .form-actions { margin-top:14px; }
.lifeos-shell .section-title { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:16px; }
.lifeos-shell .section-title h2 { margin:0; font-size:18px; }
.lifeos-shell .badge,.lifeos-shell .pill { display:inline-flex; align-items:center; gap:5px; padding:3px 9px; border:0; border-radius:6px; color:#6b766f; background:#f0f3f1; font-size:12px; font-weight:400; white-space:normal; }
.lifeos-shell .badge.done,.lifeos-shell .task.is-complete h3 .badge { background:#edf6f0; color:#337450; }
.lifeos-shell .badge.progress { background:#f6f2e7; color:#867247; }
.lifeos-shell .badge.paused { background:#f0f1f0; color:#6a716c; }
.lifeos-shell .empty { padding:32px 20px; border:1px dashed #d1ddd4; border-radius:12px; color:var(--muted); text-align:center; }
.empty img { display:block; width:64px; height:64px; object-fit:contain; margin:0 auto 12px; }
.lifeos-shell .field { display:grid; gap:8px; margin-bottom:14px; min-width:0; }
.field input,.field select { width:100%; }
.field small { font-weight:400; color:var(--muted); }
.lifeos-shell .form-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.form-grid .wide { grid-column:1/-1; }
.lifeos-shell fieldset { min-width:0; padding:14px; border:1px solid var(--line); border-radius:8px; }
.weekdays { display:flex; gap:8px; flex-wrap:wrap; }
.weekdays label,.checkbox-row { display:flex; align-items:center; gap:7px; min-height:42px; }
.form-message { margin:12px 0 0; }
.draft-status,.draft-note { color:#7b897f; font-size:12px; font-weight:400; }
.lifeos-shell pre { max-width:100%; white-space:pre-wrap; overflow-wrap:anywhere; background:#f4f6f4; padding:14px; border-radius:8px; }
.lifeos-shell details>summary { min-height:42px; padding:10px 0; cursor:pointer; }
.lifeos-shell .tabs { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:20px; }
.lifeos-shell [aria-pressed=true] { border-color:#c3d7ca; background:#eaf3ed; color:#237254; }

/* Today: execution first, aligned record areas. */
.lifeos-shell .today-board { padding:20px 24px; margin-bottom:24px; }
.board-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.board-heading h2 { margin:0; font-size:18px; }
#today-progress { margin:5px 0 0; font-size:13px; }
.date-controls { display:flex; align-items:center; gap:4px; flex-wrap:wrap; }
.date-label { margin:0; }
.date-label input { width:148px; padding:8px 10px; font-size:13px; }
.today-main-actions { display:flex; align-items:baseline; gap:8px; flex-wrap:wrap; }
.today-main-actions .toolbar { margin-top:14px; }
.plan-notice { margin-top:14px; color:var(--muted); }
#topMessage { font-size:13px; margin:12px 0 0; }
.lifeos-shell .task { padding:26px 28px 14px; margin-bottom:22px; }
.task>h3 { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin:0 0 12px; font-size:20px; letter-spacing:-.25px; }
.task>h3 .badge { letter-spacing:0; }
.task .task-description { color:#59695e; font-size:14px; line-height:1.8; margin:5px 0; }
.task .task-description:last-of-type { font-size:12px; color:#859087; margin-top:8px; }
.task-art { width:58px; height:62px; object-fit:contain; }
.task-actions { display:flex; gap:10px; flex-wrap:wrap; margin:20px 0; }
.task-actions>button { min-height:42px; }
.task-hint-preview:empty { display:none; }
.task-hint-preview { margin:16px 0 0; }
.task-hint-preview .task-learning { padding:12px 16px; background:#f4f8f5; border-radius:9px; }
.task-hint-preview h4 { margin:0 0 4px; color:#537260; font-size:12px; }
.hint-item { margin:8px 0 0; }
.hint-item p { margin:0; font-size:13px; color:#5d7365; line-height:1.7; }
.hint-feedback { display:flex; gap:4px; flex-wrap:wrap; margin-top:4px; }
.lifeos-shell .hint-feedback button { min-height:36px; padding:5px 8px; font-size:12px; color:#7a8c7f; }
.task-records { display:grid; grid-template-columns:minmax(0,.8fr) minmax(0,1.4fr); gap:28px; padding:24px 0 22px; border-top:1px solid #ebefec; }
.task-records>*,.task-records form { min-width:0; }
.task-records h4 { font-size:14px; margin-bottom:16px; }
.reflection-input { margin:0; }
.reflection-input label { display:grid; gap:7px; margin:0 0 12px; }
.reflection-input select { width:100%; }
.reflection-input textarea { min-height:82px; }
.reflection-input button { margin-top:3px; }
.task-records>.task-experience { margin:0; padding-left:28px; border-left:1px solid #ebefec; }
.experience-editor { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.experience-editor .field { margin:0; }
.experience-editor textarea { min-height:163px; background:#fcfdfc; }
.experience-editor .experience-success { color:#438363; }
.experience-editor .experience-failure { color:#857552; }
.experience-editor .draft-status,.experience-editor .form-message { grid-column:1/-1; margin:0; }
.experience-editor button { justify-self:start; grid-column:1/-1; margin-top:3px; }
.lifeos-shell .task-records .primary { background:#fff; color:#3c5145; border-color:#d8e1db; }
.task-records .primary:hover { background:#f0f5f1; }
.task-detail { border-top:1px solid #edf0ee; margin-top:0; }
.task-detail>summary { font-size:12px; color:#8a958d; }
.task-detail-body { padding:8px 0; }
.task-secondary-actions { margin:10px 0; }
.task-coach-actions { border-top:1px solid #edf0ee; padding-top:12px; }
.task-coach-actions:empty { display:none; }
.lifeos-shell .task-coach-actions button { border:0; padding:6px 0; min-height:36px; color:#618370; font-size:13px; background:transparent; }
.completed-list { margin:28px 0 0; }
.lifeos-shell .completed-heading { font-size:14px; color:#809086; margin:0 0 14px; font-weight:500; }
.lifeos-shell .task.is-complete { border-color:#dce8df; }
.blocker-note { padding:12px 16px; background:#fbf5ec; border-radius:8px; color:#8b6d46; }
.today-recap,.proposal-notice { display:flex; justify-content:space-between; align-items:center; gap:20px; }
.today-recap h2,.proposal-notice h2 { font-size:17px; margin:0 0 4px; }
.today-recap p,.proposal-notice p { margin:0; }
.today-recap>a,.proposal-notice>a { flex-shrink:0; }
.settlement-art { width:100%; height:220px; object-fit:cover; border-radius:10px; margin-bottom:16px; }
.daily-stamp { width:72px; height:72px; object-fit:contain; vertical-align:middle; margin-right:16px; }
.settlement-options button { margin:5px; }

/* Task library, reviews, and history. */
.task-definition-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
.lifeos-shell .definition-card { margin:0; }
.task-card-heading { display:flex; gap:16px; align-items:center; margin-bottom:18px; }
.task-card-heading>div { min-width:0; }
.task-card-heading h2 { font-size:19px; margin:3px 0 7px; }
.task-card-heading .kicker { color:#859489; font-size:11px; }
.definition-details { flex:1; }
.definition-details>summary { color:var(--muted); font-size:13px; }
.definition-details[open] { flex-basis:100%; }
.history-entry { padding:18px 0; border-bottom:1px solid var(--line); }
.history-entry:last-child { border-bottom:0; }
.history-entry h3,.history-entry h4 { font-size:15px; margin:12px 0 6px; }
.history-entry>.badge,.history-entry>button { margin:6px 8px 0 0; }
.history-link { display:block; padding:10px 0; font-size:13px; }
.legacy-reviews>summary { color:var(--muted); }
.legacy-reviews>a { margin:8px 8px 0 0; }
.stats-grid,.review-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin:16px 0; }
.stat,.stat-tile { padding:18px 12px; background:#f2f6f3; border:1px solid #e5ece6; border-radius:10px; text-align:center; }
.stat strong,.stat-tile strong { display:block; color:#39614b; font-size:30px; font-weight:600; }
.stat span,.stat-tile span { color:var(--muted); font-size:12px; }
.timeline-item { border-left:2px solid #d8e6dc; padding:0 0 20px 20px; margin-left:6px; }
.timeline-date { color:var(--muted); font-size:12px; }
.lifeos-shell .task-review,.lifeos-shell .task-review-version { padding:16px; border:1px solid var(--line); border-radius:10px; background:#f7f9f7; }
.task-review-history { border-top-color:var(--line); }
.generated-art { display:block; max-width:100%; width:min(100%,440px); max-height:400px; object-fit:contain; margin:0 auto 18px; }
.today-layout { display:grid; grid-template-columns:minmax(0,1fr) 260px; gap:24px; align-items:start; }
.coach-character { display:block; width:100%; max-height:340px; object-fit:contain; }
.coach-panel,.coach-card { border:1px solid var(--line); border-radius:12px; background:#fff; padding:20px; }
.coach-mobile { display:none; }
.progress-row { display:flex; align-items:center; gap:12px; }
.progress-row progress { accent-color:var(--sage); height:8px; max-width:260px; }
.lifeos-shell .item { border-radius:10px; background:#fff; border-color:var(--line); }
.subtle-divider { border:0; border-top:1px solid var(--line); margin:20px 0; }
.skeleton { min-height:100px; background:#f0f4f1; border-radius:10px; }
.lifeos-shell.accountability-page .panel { padding:0; }
.lifeos-shell.accountability-page .topbar { flex-wrap:wrap; }
.lifeos-shell.accountability-page .section-kicker,.lifeos-shell.accountability-page .topbar .back-link,.lifeos-shell.accountability-page .hero-copy { color:var(--muted); }
.lifeos-shell.accountability-page .profile-seal { background:#eef4ef; border-color:var(--line); }
.lifeos-shell.accountability-page .profile-seal strong { color:var(--ink); }
.lifeos-shell.accountability-page .switch { height:44px; align-items:center; }
.lifeos-shell.accountability-page .switch-track { height:30px; }

/* Dialogs and responsive layout. */
.toast { position:fixed; z-index:80; bottom:26px; left:50%; transform:translateX(-50%); max-width:min(520px,calc(100vw - 32px)); padding:12px 20px; background:#284b39; color:#fff; font-size:14px; border-radius:10px; box-shadow:0 8px 24px #23462c25; }
.lifeos-dialog { width:min(720px,calc(100vw - 32px)); max-height:calc(100dvh - 48px); margin:auto; border:1px solid var(--line); border-radius:16px; padding:28px; background:#fff; color:var(--ink); box-shadow:0 25px 80px #152d2330; overflow:auto; }
.lifeos-dialog::backdrop { background:#253e3355; backdrop-filter:blur(3px); }
.dialog-heading { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-bottom:22px; }
.dialog-heading h2 { margin:0; font-size:22px; }
@media(max-width:900px) {
    .lifeos-shell .app-header { gap:30px; }
    .task-records { grid-template-columns:1fr; gap:24px; }
    .task-records>.task-experience { padding-left:0; border-left:0; padding-top:20px; border-top:1px solid #ebefec; }
    .reflection-input { display:grid; grid-template-columns:1fr 2fr; gap:12px; }
    .reflection-input h4,.reflection-input .draft-status { grid-column:1/-1; margin:0; }
    .reflection-input button { justify-self:start; }
    .experience-editor textarea { min-height:112px; }
}
@media(max-width:640px) {
    .lifeos-shell .app-header { min-height:62px; padding:0 20px; }
    .lifeos-shell .brand { font-size:20px; }
    .desktop-nav,.menu-label { display:none; }
    .lifeos-shell main,.lifeos-shell.today-page main { width:calc(100% - 28px); padding:24px 0 calc(100px + env(safe-area-inset-bottom)); }
    .lifeos-shell h1 { font-size:26px; }
    .lifeos-shell .page-intro { align-items:flex-start; margin-bottom:20px; }
    .lifeos-shell .page-intro p { font-size:13px; }
    .lifeos-shell .paper,.lifeos-shell .card,.lifeos-shell .panel { padding:18px; }
    .lifeos-shell .today-board { padding:18px; margin-bottom:18px; }
    .board-heading { align-items:flex-start; flex-wrap:wrap; gap:12px; }
    .date-controls { width:100%; }
    .date-controls #todayBtn { margin-left:auto; }
    .lifeos-shell .task { padding:20px 18px 10px; margin-bottom:18px; }
    .task>h3 { font-size:18px; gap:8px; }
    .task .task-description { font-size:13px; }
    .task-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:18px 0; }
    .task-actions>button { padding:9px 10px; font-size:13px; }
    .task-actions>button:only-child { grid-column:1/-1; justify-self:start; }
    .task-records { padding:20px 0; gap:20px; }
    .reflection-input { display:block; }
    .reflection-input h4 { margin-bottom:16px; }
    .reflection-input textarea { min-height:80px; }
    .reflection-input .draft-status { margin-bottom:10px; }
    .experience-editor { grid-template-columns:1fr; gap:16px; }
    .experience-editor textarea { min-height:84px; }
    .experience-editor button { margin-top:0; }
    .task-definition-grid,.today-layout,.lifeos-shell .form-grid,.lifeos-shell .grid { grid-template-columns:1fr; }
    .stats-grid,.review-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .today-recap,.proposal-notice { flex-direction:column; align-items:flex-start; gap:14px; }
    .lifeos-shell .today-recap>a { align-self:flex-end; }
    .lifeos-shell .mobile-nav { position:fixed; z-index:35; bottom:0; left:0; right:0; display:grid; grid-template-columns:repeat(3,1fr); padding:6px 12px calc(6px + env(safe-area-inset-bottom)); background:#fffffff5; border-top:1px solid var(--line); backdrop-filter:blur(12px); }
    .lifeos-shell .mobile-nav a { display:flex; flex-direction:column; gap:1px; justify-content:center; align-items:center; min-height:48px; color:#8a958d; font-size:11px; text-decoration:none; }
    .mobile-nav a span { font-size:21px; line-height:1.3; }
    .lifeos-shell .mobile-nav a[aria-current=page] { color:#237254; }
    .toast { bottom:calc(80px + env(safe-area-inset-bottom)); }
    .lifeos-dialog { padding:20px; width:calc(100vw - 20px); max-height:calc(100dvh - 24px); }
    .dialog-heading { align-items:flex-start; gap:12px; }
    .dialog-heading h2 { font-size:19px; }
    .coach-rail { display:none; }
}
@media(prefers-reduced-motion:reduce) {
    .lifeos-shell *,.lifeos-shell *::before,.lifeos-shell *::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; }
}
