:root{
  color-scheme:dark;
  font-family:-apple-system,BlinkMacSystemFont,"Hiragino Kaku Gothic ProN","Yu Gothic UI","Noto Sans JP",sans-serif;
  color:#f3eee8;background:#171411;
  --ink:#171411;--panel:#211c18;--panel-2:#2a231e;--paper:#fff7ed;--paper-2:#f3e8dc;
  --coral:#f1a27e;--coral-strong:#d97752;--brass:#c8a47c;--text:#f3eee8;--muted:#aa9d92;--line:#ffffff1f;
  --paper-ink:#342820;--paper-muted:#85766b;
  font-synthesis:none;
}
*{box-sizing:border-box}
html,body{min-height:100%}
body{margin:0;background:#171411;min-height:100vh}
button,input,textarea,select{font:inherit}
button,a{-webkit-tap-highlight-color:transparent}
button{cursor:pointer;color:inherit}
button:disabled{opacity:.48;cursor:wait}
a{color:inherit;text-decoration:none}
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid #ffd0b8;outline-offset:3px}
[hidden]{display:none!important}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
svg{display:block}

.login{position:relative;isolation:isolate;min-height:100svh;display:grid;align-items:end;padding:clamp(28px,6vw,72px);overflow:hidden;background:#1d1714}
.login>div{width:min(410px,100%);margin:0 0 4svh;position:relative;z-index:2}
.login .eyebrow{margin:0 0 18px}
.login h1{font-family:"Hiragino Mincho ProN","Yu Mincho",Georgia,serif;font-size:clamp(42px,7vw,64px);line-height:1.25;font-weight:500;letter-spacing:-.045em;margin:0 0 18px}
.login p{font-size:13px;color:#d5c6ba;line-height:1.8}
.login label{display:block;font-size:11px;letter-spacing:.08em;margin:31px 0 9px;color:#c5b5a8}
.login input{background:#1a1512c9;color:#fff;border:1px solid #ffffff33;border-radius:4px;padding:14px 15px;width:100%;min-height:48px}
.login .primary{margin-top:12px;width:100%}
#login-error{min-height:1.6em;color:#ffc3b1!important}

.primary{border:1px solid #f5b697;background:#eea27f;color:#2b1c16;min-height:46px;padding:12px 16px;border-radius:4px;font-size:13px;font-weight:700;letter-spacing:.02em}
.primary:hover{background:#f5af8e}
.secondary{display:inline-flex;align-items:center;justify-content:center;background:transparent;border:1px solid #bfa99b;color:#6e5445;border-radius:4px;padding:11px 13px;font-size:13px;margin-top:12px;min-height:44px}

#app{display:grid;grid-template-columns:minmax(320px,1fr) minmax(370px,420px);gap:clamp(54px,8vw,112px);max-width:1120px;padding:36px;margin:auto;align-items:center;min-height:100svh}
.desktop-intro{max-width:520px}
.brand{display:inline-flex;align-items:baseline;gap:5px;font:italic 60px/1 Georgia,"Times New Roman",serif;letter-spacing:-.08em;color:#f0a17c}
.brand span{font:500 19px/1 "Hiragino Kaku Gothic ProN",sans-serif;letter-spacing:0}
.eyebrow{font-size:9px;letter-spacing:.23em;color:#b88a70;text-transform:uppercase}
.desktop-intro>.eyebrow{margin:46px 0 0}
.desktop-intro h1{font-family:"Hiragino Mincho ProN","Yu Mincho",Georgia,serif;font-size:clamp(42px,4.4vw,57px);line-height:1.35;letter-spacing:-.045em;font-weight:500;margin:17px 0 23px}
.desktop-intro h1 em{color:#efa17d;font-style:normal}
.desktop-intro>p{font-size:13px;color:#b9aaa0;line-height:2.05;margin:0}
.desktop-status{display:grid;grid-template-columns:72px 1fr;align-items:end;border-top:1px solid #4a3a32;margin-top:46px;padding-top:20px}
.desktop-status>span:first-child{font:italic 11px Georgia,serif;letter-spacing:.13em;color:#9f8d82;align-self:start;padding-top:8px}
.desktop-status strong{font:italic 47px/1 Georgia,serif;font-weight:400;color:#f1dfd2;grid-column:2;margin:0}
.desktop-status strong small{font:11px sans-serif;color:#aa9587;letter-spacing:.08em}
.desktop-status>span:last-child{grid-column:2;font-size:11px;color:#a6978d;margin-top:10px}
.desktop-intro .muted{font-size:8px;letter-spacing:.14em;color:#756a63;margin-top:30px}

.phone{position:relative;width:100%;max-width:420px;height:830px;max-height:calc(100svh - 48px);min-height:660px;overflow:hidden;background:#211a16;border:1px solid #59483e;border-radius:18px;box-shadow:0 30px 80px #00000052;display:flex;flex-direction:column;isolation:isolate}
.app-header{height:54px;display:flex;align-items:center;justify-content:space-between;padding:0 16px 0 18px;background:#1b1714;border-bottom:1px solid #49382f;flex-shrink:0;position:relative;z-index:4}
.presence-mark{display:flex;align-items:center;gap:10px}
.presence-mark>div{display:grid;grid-template-columns:auto auto;align-items:baseline;gap:8px}
.app-header strong{font:italic 14px Georgia,serif;letter-spacing:.11em;color:#f6e5d9}
.app-header small{font-size:9px;color:#9f8e83;letter-spacing:.04em}
.status-dot{width:5px;height:5px;background:#b8d4b3;border-radius:50%;box-shadow:0 0 0 3px #b8d4b314}
.icon-btn{background:transparent;border:0;padding:0;width:42px;height:42px;display:grid;place-items:center}
.icon-btn svg{width:21px;height:21px;fill:none;stroke:#dbcabd;stroke-width:1.5;stroke-linecap:round}

.scene{position:relative;flex:1;min-height:0;overflow:hidden;background:#6f5648}
.room{position:absolute;inset:0;overflow:hidden;background:#6d5042}
.window{position:absolute;right:-3px;top:20px;width:151px;height:330px;border:6px solid #f5e4cf24;border-radius:78px 78px 0 0;background:#a57e6c;box-shadow:inset 0 0 0 1px #3e2d2640}
.window:before{content:"";position:absolute;left:50%;height:100%;width:4px;background:#63493c66}
.window:after{content:"";position:absolute;top:51%;width:100%;height:4px;background:#63493c66}
.orbit{position:absolute;left:-83px;top:93px;width:250px;height:356px;border:1px solid #f3dbc62b;border-radius:50%;transform:rotate(-18deg)}
.room-word{position:absolute;left:18px;top:117px;color:#fff0df20;font:italic 27px/1.22 Georgia,serif;letter-spacing:.14em}
.floor{position:absolute;bottom:-115px;left:-25%;width:150%;height:245px;background:#392c2a;border-radius:50% 50% 0 0}
.promise{position:absolute;z-index:3;left:14px;top:13px;right:14px;display:grid;grid-template-columns:3px 78px minmax(0,1fr) 20px;align-items:center;gap:10px;text-align:left;padding:10px 10px 10px 0;border:0;border-top:1px solid #f6d6c399;border-bottom:1px solid #f6d6c33d;background:#211814d9;color:#fff2e8}
.promise:before{content:"";width:3px;height:100%;background:#ee9f7a}
.promise>span{font:italic 8px Georgia,serif;letter-spacing:.13em;color:#d7a98f}
.promise strong{font-size:11px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.promise i{font-style:normal;font-size:16px;color:#e9aa8d;text-align:right}
.avatar{position:absolute;inset:0;width:100%;height:100%;overflow:hidden;background:#604536}
.avatar canvas,.character-portrait{position:absolute;inset:0;width:100%;height:100%;display:block}
.character-portrait{object-fit:cover;transition:filter .3s,opacity .2s}
.avatar[data-renderer="motion-portrait"][data-ready="true"] .character-portrait{visibility:hidden}
.avatar[data-renderer="motion-portrait"][data-motion="fallback"] canvas{display:none}
.avatar[data-state="listening"] .character-portrait{filter:brightness(1.035)}
.avatar[data-state="thinking"] .character-portrait{filter:saturate(.93)}
.avatar[data-state="happy"] .character-portrait{filter:brightness(1.055) saturate(1.025)}
.avatar-error{position:absolute;z-index:2;top:34%;left:13%;right:13%;margin:0;padding:14px;border-left:3px solid #e79b78;background:#251c18e8;color:#fff7ed;font-size:12px;line-height:1.8}

.dialogue{position:absolute;z-index:3;left:13px;right:13px;bottom:12px;background:#fff7ed;color:#342820;padding:13px 15px 16px;border:1px solid #f6e6d6;border-left:4px solid #da7b58;border-radius:2px 15px 15px 15px;box-shadow:0 12px 28px #26150f2b;min-height:118px;max-height:43%;overflow:auto}
.dialogue-top{display:flex;align-items:center;gap:8px;min-height:24px}
.dialogue-top strong{font:italic 12px Georgia,serif;letter-spacing:.09em;color:#9f4d34}
.dialogue-top>span{font-size:9px;color:#8e7768}
.dialogue-top button{margin-left:auto;border:0;background:transparent;color:#9c6b55;padding:4px;width:31px;height:31px;display:grid;place-items:center}
.dialogue-top button svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.dialogue p{font-size:14px;line-height:1.85;margin:7px 0 0;min-height:48px;white-space:pre-wrap;overflow-wrap:anywhere}
.dialogue #thinking{font-size:12px;color:#886f61;display:block;padding-top:12px}
.speaking-indicator{display:inline-flex;gap:2px;align-items:center;height:13px;margin-left:1px}
.speaking-indicator i{display:block;width:2px;height:3px;background:#bc6a49;border-radius:2px}
[data-state="speaking"] .speaking-indicator i{animation:voice-level .62s ease-in-out infinite alternate}
[data-state="speaking"] .speaking-indicator i:nth-child(2){animation-delay:.17s}
[data-state="speaking"] .speaking-indicator i:nth-child(3){animation-delay:.32s}

.conversation-controls{flex-shrink:0;background:#211b18;border-top:1px solid #4a3a32;padding:9px 13px 8px}
#talk-form{display:flex;align-items:center;border:1px solid #5c4a40;background:#181411;padding:3px;gap:2px;border-radius:5px}
#talk-input{background:transparent;border:0;min-width:0;color:#f1e8e2;font-size:16px;flex:1;padding:9px 8px}
#talk-input::placeholder{color:#87786e}
#talk-form>button{border:0;background:transparent;width:40px;min-width:40px;height:40px;display:grid;place-items:center;border-radius:3px}
#talk-form>button svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
#talk-form>#chat-photo{color:#aa8b79}
#talk-form>#send{background:#eda17d;color:#2d1c15}
#talk-form>#send svg{fill:none}
.chat-status{font-size:9px;color:#83746b;margin:6px 4px 0;line-height:1.45}
.chat-status.error{color:#e9a08b}
.photo-status{font-size:10px;color:#d4a68d;padding:5px 1px 7px}
.photo-status button{border:0;background:none;color:#e7b198}
.meal-photo-report{width:100%;min-height:44px;display:grid;grid-template-columns:30px minmax(0,1fr) 18px;align-items:center;gap:8px;text-align:left;border:1px solid #654d41;border-radius:4px;background:#2a211d;color:#f1ddd1;padding:7px 10px;margin:0 0 8px}
.meal-photo-report:hover{background:#32251f}
.meal-photo-icon{font-size:22px;line-height:1;color:#efaa88;text-align:center}
.meal-photo-report strong,.meal-photo-report small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.meal-photo-report strong{font-size:11px;font-weight:600}
.meal-photo-report small{font-size:8px;color:#a99488;margin-top:3px}
.meal-photo-report i,.meal-draft-banner i{font-style:normal;font-size:15px;color:#efaa88;text-align:right}
.meal-draft-banner{margin:0 0 8px;border:1px solid #86624f;background:#30231d;border-radius:4px}
.meal-draft-banner button{width:100%;min-height:44px;display:flex;align-items:center;justify-content:space-between;gap:8px;text-align:left;border:0;background:transparent;color:#f8e7dc;padding:7px 10px}
.meal-draft-banner strong,.meal-draft-banner small{display:block}
.meal-draft-banner strong{font-size:11px;font-weight:600}
.meal-draft-banner small{font-size:8px;color:#c2a394;margin-top:3px}

.bottom-nav{height:58px;display:grid;grid-template-columns:repeat(4,1fr);flex-shrink:0;background:#171411;border-top:1px solid #46372f;padding-bottom:3px}
.bottom-nav button{position:relative;border:0;background:transparent;color:#81746c;min-height:50px;display:grid;justify-items:center;align-content:center;gap:3px}
.bottom-nav button:before{content:"";position:absolute;top:-1px;left:30%;right:30%;height:1px;background:transparent}
.bottom-nav button.active{color:#f0b194}
.bottom-nav button.active:before{background:#ef9f7b}
.bottom-nav svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}
.bottom-nav span{display:block;font-size:9px}

.backdrop{position:absolute;inset:0;z-index:5;background:#110d0acc;backdrop-filter:blur(2px)}
.sheet{position:absolute;z-index:6;left:0;right:0;bottom:0;max-height:84%;padding:18px 19px 27px;border-radius:16px 16px 0 0;background:#fff7ed;color:#3c2f26;box-shadow:0 -12px 36px #0000002b;overflow:auto;overscroll-behavior:contain}
.sheet>header{display:flex;align-items:center;justify-content:space-between;margin-bottom:15px;padding-bottom:12px;border-bottom:1px solid #e7d7c9}
.sheet h2{font-family:"Hiragino Mincho ProN","Yu Mincho",Georgia,serif;font-size:18px;font-weight:600;margin:0;letter-spacing:-.02em}
.sheet>header button{background:transparent;border:1px solid #dcc9ba;border-radius:50%;width:38px;height:38px;font-size:23px;color:#8c6d5b}
.sheet h3{font-size:13px;letter-spacing:.03em;margin:24px 0 10px}
.sheet p{font-size:13px;line-height:1.85}
.sheet .subtle{font-size:11px;color:#87776d}
.sheet label{display:block;font-size:11px;color:#735f53;margin:13px 0 6px}
.sheet input:not([type=checkbox]),.sheet textarea,.sheet select{width:100%;background:#fffdfa;border:1px solid #dac8ba;border-radius:4px;padding:11px;color:#3d2e25;font-size:16px;min-height:44px}
.sheet textarea{resize:vertical;min-height:100px;line-height:1.7}
.sheet input[type=checkbox]{accent-color:#9f5c42;margin-right:7px}
.sheet .primary{width:100%;margin-top:14px;background:#8f4e38;color:#fff6f0;border-color:#8f4e38}
.sheet .secondary{width:100%}
.record-row{border-top:1px solid #e6d8cd;padding:12px 0;display:flex;justify-content:space-between;align-items:center;gap:10px;font-size:13px;overflow-wrap:anywhere}
.record-row span{color:#8c796c;font-size:10px;display:block;margin-top:4px}
.record-row button,.small-btn{border:1px solid #d4bfb0;background:transparent;color:#795e4e;border-radius:4px;padding:8px 10px;font-size:11px;min-height:36px;flex-shrink:0}
.record-row img{width:45px;height:45px;object-fit:cover;border-radius:3px}
.row-actions{display:flex;gap:7px;flex-wrap:wrap;margin:8px 0}
.week-number{font:italic 38px Georgia,serif;color:#8d583f}
.log-message{padding:12px 14px;margin:8px 0;background:#f0e4da;border-left:3px solid #c9a995;border-radius:2px;font-size:13px;line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere}
.log-message.user{background:#5b4235;border-left-color:#e5a27f;color:#fff3e9}
.log-message small{display:block;font-size:9px;opacity:.65;margin-bottom:5px}
.error{color:#a34358!important}.success{color:#47744c!important}
.memory-item{background:#f1e7de;border-left:3px solid #c4a590;padding:12px 13px;margin:9px 0;font-size:13px;line-height:1.7}
.weight-plot{width:100%;height:130px;margin:18px 0;overflow:visible}.weight-plot path{fill:none;stroke:#a56e53;stroke-width:2}.weight-plot circle{fill:#9d6044}.weight-plot text{fill:#867469;font-size:10px}
#toast{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);background:#fff4ea;color:#5b4133;padding:11px 16px;border:1px solid #ead8c9;border-radius:4px;box-shadow:0 8px 30px #0003;max-width:90vw;z-index:20;font-size:12px}
.pill{font-size:9px;border:1px solid #cdb6a7;padding:5px 8px;border-radius:20px;color:#88634f}
.field-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.chat-image{display:block;width:100%;max-height:240px;object-fit:contain;border-radius:4px;margin-top:12px}
.memory-source{font-size:10px;color:#7c6a60;display:block;margin:8px 0;overflow-wrap:anywhere}
.character-about{display:flex;gap:13px;align-items:center;margin-bottom:16px}
.character-about img{width:66px;height:82px;object-fit:cover;object-position:50% 12%;border-radius:3px}
.meal-photo-picker{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:9px;margin-top:13px}
.meal-photo-picker .small-btn{margin:0;min-height:44px}
.meal-photo-preview{height:126px;min-width:0;border:1px dashed #d4bcab;background:#f8eee5;border-radius:4px;display:flex;align-items:center;justify-content:center;gap:7px;overflow:hidden;position:relative;color:#9d8475;font-size:10px;text-align:center}
.meal-photo-preview img{width:100%;height:100%;object-fit:cover;display:block}
.meal-photo-preview span:not(.meal-photo-empty){position:absolute;left:6px;bottom:6px;border-radius:2px;padding:3px 5px;background:#2a211dd9;color:#fff4ec;font-size:9px}
.meal-photo-empty{padding:0 10px}
.meal-upload-status{min-height:1.7em;margin:5px 0 0!important;font-size:10px!important;color:#8f7568!important}
.meal-upload-status.error{color:#a34358!important}
.meal-search-option{display:flex!important;align-items:center;gap:4px;margin-top:14px!important;font-size:11px!important}
.meal-search-option input{margin:0 2px 0 0!important;width:17px!important;min-height:17px!important}
.meal-report-intro{margin-top:0}
.meal-draft-head{display:grid;grid-template-columns:74px minmax(0,1fr);gap:12px;align-items:center;border-bottom:1px solid #e6d8cd;padding-bottom:13px}
.meal-draft-photo{width:74px;height:74px;object-fit:cover;border-radius:4px;background:#f0e1d5}
.meal-draft-label{font-size:16px!important;font-weight:600;line-height:1.45!important;margin:0 0 5px!important;overflow-wrap:anywhere}
.meal-draft-facts{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:13px 0}
.meal-draft-facts>div{min-width:0;padding:10px;background:#f1e5da;border-left:3px solid #c18e73}
.meal-draft-facts span,.meal-draft-facts strong{display:block}
.meal-draft-facts span{font-size:9px;color:#887466}
.meal-draft-facts strong{font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.meal-draft-facts small{display:block;color:#8c796c;font-size:9px;line-height:1.5;margin-top:2px;overflow-wrap:anywhere}
.meal-draft-question{border-left:3px solid #b26b50;background:#f5e9df;padding:9px 11px;margin:12px 0}
.meal-draft-question strong{font-size:11px;color:#8f4e38}
.meal-draft-question p{margin:3px 0 0!important;font-size:12px!important;line-height:1.65!important}
.meal-draft-heading{margin:13px 0 5px!important}
.meal-draft-list,.meal-draft-sources{margin:0 0 8px;padding-left:20px;color:#77665b;font-size:11px;line-height:1.7;overflow-wrap:anywhere}
.meal-draft-sources a{color:#8f4e38;text-decoration:underline;overflow-wrap:anywhere}
.meal-draft-form{border-top:1px solid #e6d8cd;margin-top:14px;padding-top:2px}
.meal-draft-edit{margin-top:9px;border-top:1px solid #eadbd0}
.meal-draft-edit summary{min-height:44px;display:flex;align-items:center;color:#795e4e;font-size:11px;cursor:pointer}
.meal-draft-edit[open] summary{border-bottom:1px solid #eadbd0;margin-bottom:2px}
.meal-draft-kcal-note{margin:5px 0 2px!important}
.meal-draft-reestimate{border-top:1px solid #e6d8cd;margin-top:10px;padding-top:2px}
.meal-draft-reestimate .secondary{margin-top:12px}
#meal-reestimate-form{padding:4px 0 2px}
#meal-reestimate-form .small-btn{background:#8f4e38;color:#fff6f0;border-color:#8f4e38;width:100%;margin-top:7px}
.meal-draft-unrecorded{border-top:1px solid #e6d8cd;padding-top:11px;margin-top:14px!important}

/* Home is a working surface: keep the full B portrait above the compact
   dialogue and let the composer carry the only primary choices. */
.avatar{inset:0 0 clamp(112px,29%,138px);height:auto;display:flex;justify-content:center;align-items:flex-start;background:transparent}
.avatar canvas,.character-portrait{inset:0;width:100%;height:100%;object-fit:contain;object-position:50% 0!important}
.home-actions{min-height:28px;display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 1px 7px;color:#d5c2b5}
.home-context{font-size:10px;letter-spacing:.11em;color:#b48c75;text-transform:uppercase}
.review-link{display:inline-flex;align-items:center;gap:5px;border:0;background:transparent;color:#d9b49f;font-size:10px;padding:4px 2px}
.review-link>span:first-child{font-size:14px;line-height:1;color:#e6a481}
.review-link:hover{color:#f0c3aa}
.meal-draft-banner{margin-bottom:7px}
.home-review-panel{border:1px solid #795542;background:#30231d;color:#f8e7dc;border-left:3px solid #e89b77;border-radius:3px;padding:9px 10px 10px;margin:0 0 8px}
.home-review-head{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #765342;padding-bottom:6px;margin-bottom:8px}
.home-review-head strong{font-size:10px;letter-spacing:.04em;color:#efb092}
.home-review-head button{border:0;background:transparent;color:#c19a85;font-size:19px;line-height:1;padding:0 2px}
.home-review-body{display:grid;grid-template-columns:38px minmax(0,1fr);gap:9px;align-items:center}
.home-review-avatar{width:38px;height:49px;overflow:hidden;background:#6f5041;border-radius:2px}
.home-review-avatar img{display:block;width:100%;height:100%;object-fit:cover;object-position:50% 7%}
.home-review-body strong{display:block;font-size:11px;color:#fff1e7;margin-bottom:3px}
.home-review-body p{font-size:10px;line-height:1.55;color:#d6bbae;margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
.home-review-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}
.home-review-actions .small-btn{color:#e8c5b3;border-color:#8c6654;background:#3c2b24;padding:7px 8px;min-height:32px}
.composer{border-top:1px solid #4a3a32;padding-top:7px}
.composer-head{min-height:17px;display:flex;align-items:center;margin:0 1px 6px}
.composer-head small{font-size:9px;color:#9f8d82}
.composer-modes{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;border:1px solid #604a3e;border-radius:3px;margin-bottom:7px;overflow:hidden}
.composer-modes button{border:0;border-right:1px solid #604a3e;background:#231b17;color:#a99488;min-height:34px;font-size:11px}
.composer-modes button:last-child{border-right:0}
.composer-modes button.is-active{background:#9c6048;color:#fff3ea;font-weight:600}
.composer-modes button:hover{background:#80513f;color:#fff3ea}
.mode-slot{display:grid;grid-template-columns:auto;align-content:center;gap:1px;min-width:74px;background:#181411;color:#9f8d82;padding:2px 6px}
.mode-slot>span{font-size:8px;line-height:1;color:#806b61}
.mode-slot select{width:100%;border:0;background:transparent;color:#eeded5;font-size:11px;padding:1px 0;min-height:20px}
.composer[data-mode="advice"] .mode-slot{opacity:.46}
.meal-fields,.advice-fields{margin-bottom:6px}
.composer-field-row{display:flex;align-items:center;gap:8px;min-height:33px}
.composer-field-row label{font-size:10px;color:#c2aaa0;white-space:nowrap}
.composer-field-row select{width:auto;min-width:112px;flex:1;background:#181411;border:1px solid #604a3e;color:#f1e3da;border-radius:3px;padding:6px 8px;font-size:13px;min-height:33px}
.composer-routine-row{gap:8px;margin-top:4px}
.routine-fill{border:0;border-bottom:1px solid #a36b52;background:transparent;color:#dda184;padding:3px 0;font-size:10px;white-space:nowrap}
.routine-fill:hover{color:#f1bea3;border-bottom-color:#f1bea3}
.routine-fill:disabled{opacity:.58}
.composer-routine-row small{font-size:9px;color:#87756c;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.composer-more{border-top:1px solid #3e312b;margin-top:5px;padding-top:3px}
.composer-more summary{color:#b99b8b;font-size:9px;cursor:pointer;min-height:25px;display:flex;align-items:center}
.composer-more-grid{display:grid;grid-template-columns:auto minmax(0,1fr);gap:4px 8px;align-items:center;padding-bottom:5px}
.composer-more-grid>label:not(.meal-search-option){font-size:9px;color:#9f8c82;margin:0}
.composer-more-grid>input[type=date],.composer-more-grid>input[type=datetime-local]{min-width:0;width:100%;background:#181411;border:1px solid #604a3e;border-radius:3px;color:#f1e3da;padding:5px 6px;font-size:12px;min-height:31px}
.composer-more-grid .meal-search-option{grid-column:1/-1;margin:3px 0 0!important;color:#ae9689!important;font-size:9px!important}
.composer-more-grid .meal-search-option input{min-height:15px!important;width:15px!important}
.composer-note{font-size:9px!important;line-height:1.45!important;color:#8b786e;margin:5px 2px!important}
.attach-row{display:flex;align-items:center;gap:8px;min-height:27px}
.attach-btn{display:inline-flex;align-items:center;gap:4px;border:0;background:transparent;color:#b99685;font-size:10px;padding:3px 1px;white-space:nowrap}
.attach-btn>span:first-child{font-size:17px;line-height:1;color:#e09a78}
.attach-btn:hover{color:#edb59a}
.attach-row .photo-status{min-width:0;flex:1;padding:3px 0 3px;color:#d4a68d;font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.attach-row .photo-status button{font-size:9px}
.advice-fields .composer-note{margin:2px 1px 6px!important}
.routines-form input{margin-bottom:2px}
.routines-form .primary{margin-top:10px}

/* Keep the portrait as the visual anchor on a phone.  The plan action stays
   available as a quiet corner affordance instead of crossing the face. */
.promise{top:8px;left:auto;right:9px;width:30px;height:30px;display:grid;grid-template-columns:1fr;padding:0;border:0;background:transparent}
.promise>span,.promise>strong{display:none}
.promise:before{display:none}
.promise i{font-size:21px;color:#f0b397}
.conversation-controls{padding:3px 12px 3px}
.home-actions{min-height:18px;margin-bottom:2px}
.home-context{font-size:9px}
.composer-head{display:none}
.composer{padding-top:3px}
.composer-modes{margin-bottom:4px}
.composer-modes button{min-height:27px}
.mode-slot{min-width:70px}
.composer-field-row{min-height:28px}
.composer-routine-row{min-height:18px;margin-top:0}
.composer-routine-row small{display:none}
.composer-more{margin-top:1px;padding-top:0}
.composer-more summary{min-height:17px}
.composer-note{display:none!important}
.attach-row{min-height:17px}
.chat-status{font-size:8px;margin:1px 3px 0;min-height:1em}
.chat-status:empty{display:none}
#talk-form{min-height:42px}
#talk-form>button{height:36px;min-height:36px;width:36px;min-width:36px}
#talk-input{padding-top:6px;padding-bottom:6px}
.dialogue{min-height:78px;max-height:27%;padding:7px 11px 8px}
.dialogue-top{min-height:19px;gap:6px}
.dialogue-top button{width:25px;height:25px;padding:2px}
.dialogue p{font-size:12px;line-height:1.5;margin:2px 0 0;min-height:0}
.dialogue #thinking{font-size:10px;padding-top:3px}

/* Progress / achievements: an editorial record of actual days, not a
   rainbow dashboard.  Copper marks invite attention; muted ink carries the
   data so low numbers never read as a "win". */
.progress-view{color:#3c2d25;padding-bottom:6px}
.progress-kicker{margin:0 0 13px!important;color:#7e685b;font-family:"Hiragino Mincho ProN","Yu Mincho",Georgia,serif;font-size:14px!important;line-height:1.55!important}
.progress-range{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;padding:3px;background:#efe1d5;border:1px solid #e1cfc1;border-radius:5px;margin:0 0 17px}
.progress-range-tab{border:0;background:transparent;color:#846d5f;min-height:38px;border-radius:3px;font-size:11px}
.progress-range-tab:hover{background:#fff8f0}
.progress-range-tab.is-active{background:#8f4e38;color:#fff8f1;box-shadow:0 3px 8px #8f4e3833}
.progress-summary{border-top:1px solid #dcc7b8;border-bottom:1px solid #dcc7b8;padding:0 0 13px;margin-bottom:20px}
.progress-stat-grid{display:grid;grid-template-columns:1.1fr 1fr 1fr;gap:7px}
.progress-stat{min-width:0;padding:11px 10px 10px;background:#f1e5db;border-left:2px solid #c6a089}
.progress-stat.is-featured{background:#ead8c9;border-left-color:#aa6248}
.progress-stat span,.progress-stat strong,.progress-stat small{display:block}
.progress-stat span{color:#826c60;font-size:9px;line-height:1.35}
.progress-stat strong{margin:6px 0 4px;color:#53392d;font:italic 21px/1.15 Georgia,"Times New Roman",serif;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.progress-stat small{color:#917d70;font-size:9px;line-height:1.35;overflow-wrap:anywhere}
.progress-comparison{display:grid;grid-template-columns:1fr auto;gap:5px 12px;margin-top:12px;padding:10px 11px;background:#fff9f2;border:1px solid #eadacf}
.progress-comparison span{font-size:10px;color:#806c61}
.progress-comparison strong{font-size:10px;color:#754a38;text-align:right}
.progress-comparison small{grid-column:1/-1;font-size:9px;color:#9a877b;line-height:1.45}
.progress-section-head{display:flex;justify-content:space-between;align-items:end;gap:10px;margin:18px 0 8px}
.progress-section-head h3{font-size:15px;margin:4px 0 0;color:#4d392e}
.progress-section-head .eyebrow{display:block;color:#a06b53;font-size:8px;letter-spacing:.16em}
.progress-sample{font-size:9px;color:#917b6e;white-space:nowrap}
.progress-chart{display:block;width:100%;height:auto;min-height:140px;background:#f8eee6;border:1px solid #eadacf;border-radius:4px;overflow:visible}
.progress-chart path{fill:none;stroke:#a15e43;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.progress-chart circle{fill:#fff8ef;stroke:#a15e43;stroke-width:2}
.progress-chart-value{fill:#754936;font-size:19px;font-family:Georgia,"Times New Roman",serif}
.progress-chart-date{fill:#927d70;font-size:17px}
.progress-chart-axis{stroke:#ddc9ba;stroke-width:1}
.progress-chart-empty{display:grid;place-items:center;min-height:142px;padding:15px;background:#f8eee6;border:1px solid #eadacf;border-radius:4px;color:#927c6e;font-size:11px;line-height:1.7;text-align:center}
.progress-chart-note{margin:5px 2px 0!important;font-size:9px!important;color:#927f73!important}
.progress-days-section{margin-top:21px}
.progress-calendar{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;margin:9px 0 13px;padding:7px;background:#f5e9df;border:1px solid #e6d5c7;border-radius:4px}
.progress-calendar-day{position:relative;min-width:0;min-height:45px;border:1px solid transparent;background:transparent;border-radius:3px;color:#765f53;padding:5px 2px 4px;display:grid;justify-items:center;align-content:center;gap:1px}
.progress-calendar-day:hover{background:#fffaf4;border-color:#dfc6b4}
.progress-calendar-day.is-selected{background:#8f4e38;color:#fff8ef;border-color:#8f4e38}
.progress-calendar-day.is-quiet{opacity:.62}
.progress-calendar-day time{font:italic 14px/1 Georgia,"Times New Roman",serif}
.progress-calendar-day small{font-size:8px;opacity:.8}
.progress-day-dot{width:4px;height:4px;border-radius:50%;background:#ba7959;display:block;margin-top:1px}
.progress-calendar-day.is-selected .progress-day-dot{background:#ffd6bd}
.progress-day-list{border-top:1px solid #e5d5c9}
.progress-day-row{border-bottom:1px solid #e5d5c9;padding:0}
.progress-day-row.is-selected{background:#fffaf4}
.progress-day-open{width:100%;border:0;background:transparent;color:#4a382e;display:grid;grid-template-columns:56px minmax(0,1fr) 17px;align-items:center;gap:8px;text-align:left;padding:10px 3px 6px}
.progress-day-open:hover{background:#fffaf4}
.progress-day-date{display:grid;gap:3px}
.progress-day-date time{font:italic 16px/1 Georgia,"Times New Roman",serif;color:#754936}
.progress-day-date small{font-size:8px;color:#9a8274}
.progress-day-facts{position:relative;min-width:0;display:grid;gap:2px}
.progress-day-facts strong{font-size:11px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.progress-day-facts small{font-size:9px;color:#8c786d;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.progress-day-arrow{font-size:20px;color:#a46b53;text-align:right}
.progress-kcal{height:4px;display:block;position:relative;overflow:hidden;background:#e6d6ca;border-radius:4px;margin-top:3px}
.progress-kcal svg{display:block;width:100%;height:100%;fill:#bd8469}
.progress-kcal em{position:absolute;left:0;top:6px;font-style:normal;font-size:0}
.progress-kcal-unknown{height:auto;background:none;color:#aa8f81;font-size:8px;margin-top:3px}
.progress-tags{display:flex;flex-wrap:wrap;gap:4px;padding:0 28px 8px 67px}
.progress-tag{border:1px solid #dbc6b8;border-radius:20px;color:#8b7162;padding:3px 6px;font-size:8px;line-height:1.2;background:#faf2eb}
.progress-tag.is-self{border-color:#ba8066;color:#8e4e37;background:#f3dfd2}
.progress-day-detail{border-top:2px solid #a56448;margin:22px 0 0;padding-top:15px}
.progress-detail-heading{display:flex;justify-content:space-between;gap:12px;align-items:start}
.progress-detail-heading h3{margin:4px 0 0;font-family:"Hiragino Mincho ProN","Yu Mincho",Georgia,serif;font-size:18px;font-weight:600}
.progress-selfreport{max-width:52%;padding:8px 9px;background:#f2e5db;border:1px solid #e2d0c2;border-radius:4px}
.progress-selfreport label{display:flex!important;align-items:start;gap:5px;margin:0!important;color:#694a3b!important;font-size:10px!important;line-height:1.4}
.progress-selfreport input{accent-color:#9d5e44;margin:1px 0 0!important;min-height:14px!important;width:14px!important}
.progress-selfreport small{display:block;margin-top:4px;color:#947f72;font-size:8px;line-height:1.4}
.progress-detail-body{display:grid;grid-template-columns:minmax(0,1fr);gap:13px;margin-top:14px}
.progress-detail-records{min-width:0}
.progress-detail-label{font-size:9px!important;color:#927b6d!important;margin:0 0 4px!important;letter-spacing:.08em}
.progress-detail-records ul{list-style:none;margin:0;padding:0;border-top:1px solid #eadbd0}
.progress-detail-records li{display:flex;justify-content:space-between;align-items:start;gap:8px;padding:9px 0;border-bottom:1px solid #eadbd0;font-size:11px}
.progress-detail-records li span{min-width:0;display:grid;gap:2px}
.progress-detail-records li b{font-weight:600;color:#594239}
.progress-detail-records li small{font-size:9px;color:#8c776b;overflow-wrap:anywhere}
.progress-detail-records li strong{flex-shrink:0;color:#80513d;font-size:10px;text-align:right}
.progress-detail-records li.progress-detail-empty{color:#917b6e}
.progress-rin-note{display:grid;grid-template-columns:57px minmax(0,1fr);gap:11px;align-items:center;padding:10px;background:#f2e4da;border:1px solid #dfc6b5;border-left:3px solid #a96549;border-radius:3px}
.progress-rin-portrait{width:57px;height:70px;overflow:hidden;background:#cda18b;border-radius:2px;align-self:start}
.progress-rin-face{display:block;width:100%;height:100%;object-fit:cover;object-position:50% 12%;transform:scale(2.2);transform-origin:50% 22%}
.progress-rin-face-empty{display:grid;place-items:center;color:#fff5ec;font:italic 28px Georgia,serif}
.progress-praise-content{min-width:0}
.progress-praise-content>span{display:block;color:#935137;font-size:9px;letter-spacing:.05em;margin-bottom:5px}
.progress-praise-copy{margin:0!important;color:#4b362d;font-size:12px!important;line-height:1.7!important;white-space:pre-wrap;overflow-wrap:anywhere}
.progress-praise-empty{margin:0 0 8px!important;color:#846e61;font-size:10px!important;line-height:1.55!important}
.progress-praise-meta,.progress-praise-content>small{display:block;margin-top:6px;color:#9a8477;font-size:8px;line-height:1.4}
.progress-praise-button{border:1px solid #a76449;background:#8f4e38;color:#fff7f0;border-radius:3px;min-height:38px;padding:8px 10px;font-size:10px;font-weight:600}
.progress-praise-button:hover{background:#a15d42}
.progress-praise-button:disabled{opacity:.58}
.progress-praise-pending,.progress-praise-disabled{display:block;color:#986149;font-size:10px;line-height:1.55}
.progress-praise-error{margin:0!important;color:#a04b43;font-size:10px!important;line-height:1.55!important}
.progress-praise-error span{display:block;color:#917b6f;font-size:9px;margin-top:3px}
.progress-mission{border-top:1px solid #dcc7b8;margin-top:23px;padding-top:17px}
.progress-mission h3{font-size:14px;margin:4px 0 8px}
.progress-mission-card{padding:11px 12px;background:#f2e5db;border-left:3px solid #c18b70;color:#5d4438;font-size:12px;line-height:1.6}
.progress-mission .secondary{width:100%;margin-top:9px}
.progress-mission .subtle{margin:8px 0!important}
.progress-mission .primary{width:100%;margin-top:5px}

@media(max-width:370px){
  .progress-stat-grid{grid-template-columns:1fr 1fr}
  .progress-stat.is-featured{grid-column:1/-1}
  .progress-stat strong{font-size:19px}
  .progress-comparison{grid-template-columns:1fr}
  .progress-comparison strong{text-align:left}
  .progress-detail-heading{display:block}
  .progress-selfreport{max-width:none;margin-top:11px}
  .progress-rin-note{grid-template-columns:48px minmax(0,1fr);gap:9px}
  .progress-rin-portrait{width:48px;height:63px}
}

@keyframes voice-level{to{height:12px}}
@media(max-width:800px){
  #app{display:block;padding:0;min-height:100svh}.desktop-intro{display:none}
  .phone{width:100%;max-width:520px;height:100svh;max-height:none;min-height:580px;border:0;border-radius:0;margin:auto;box-shadow:none}
  .app-header{padding-top:env(safe-area-inset-top);height:calc(52px + env(safe-area-inset-top))}
  .bottom-nav{padding-bottom:calc(3px + env(safe-area-inset-bottom));height:calc(57px + env(safe-area-inset-bottom))}
  .sheet{padding-bottom:calc(24px + env(safe-area-inset-bottom))}
  .conversation-controls{padding:8px 12px 7px}
}
@media(max-height:720px){
  .dialogue{min-height:102px;padding:9px 13px 12px;max-height:44%}.dialogue p{font-size:13px;line-height:1.7}
  .promise{top:8px;padding-top:7px;padding-bottom:7px}.conversation-controls{padding-top:6px}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}

/* Home is a character stage. The dock overlays it; opening a form never
   shrinks the portrait. Crop the background sides instead of fitting a card. */
.phone{--nav-height:58px;--dock-height:64px;display:block}
.app-header{position:absolute;inset:0 0 auto;background:linear-gradient(#21170cc9,transparent);border:0;height:64px;z-index:4}
.app-header small{color:#f0dfcd;text-shadow:0 1px 5px #000}
.app-header .icon-btn{background:#251b1570;border-radius:50%;width:44px;height:44px}
.guide-entry{margin-left:auto;margin-right:10px;min-height:40px;padding:7px 12px;border:1px solid #f4dfc866;border-radius:24px;background:#251b159c;color:#fff0db;font-size:14px}
.guide-entry span{font-size:11px;margin-left:3px}
.plan-outcome{padding:14px;margin-bottom:18px;background:#f1e0d1;border:1px solid #d9b79e;border-radius:12px;color:#543928}
.plan-outcome p{font-size:12px;line-height:1.75}
.plan-outcome button{display:block;min-height:44px;margin-top:8px;text-align:left}
.next-action{display:flex;align-items:center;gap:9px;max-width:100%;margin:0 0 7px auto;padding:8px 13px;min-height:40px;border:1px solid #f4dfc855;border-radius:22px;background:#261b15e8;color:#ffe9d3;box-shadow:0 3px 12px #0002;text-align:left}
.next-action>span{font-size:9px;color:#d9ab8a;flex-shrink:0}
.next-action strong{font-size:12px;font-weight:500}
.next-action i{font-style:normal;color:#ffc49b}
.scene .next-action{position:absolute;z-index:3;right:16px;bottom:calc(var(--dock-height) + var(--dialogue-height,112px) + 24px);max-width:calc(100% - 32px);margin:0}
.tap-spark{position:fixed;z-index:100;pointer-events:none;width:18px;height:18px;margin:-9px 0 0 -9px;background:#ffddad;clip-path:polygon(50% 0,61% 36%,100% 50%,61% 63%,50% 100%,38% 63%,0 50%,38% 36%);animation:tap-spark .5s ease-out forwards}
@keyframes tap-spark{0%{transform:scale(.4) rotate(-15deg);opacity:.9}45%{opacity:.8}100%{transform:translateY(-15px) scale(1.15) rotate(35deg);opacity:0}}
@media(prefers-reduced-motion:reduce){.tap-spark{display:none}}
.scene{position:absolute;inset:0 0 var(--nav-height);overflow:hidden}
.scene .avatar{inset:26px 0 0;height:calc(100% - 26px);width:100%;bottom:0}
.scene .character-portrait{object-fit:cover;object-position:50% 0!important}
.scene:after{content:"";position:absolute;inset:55% 0 0;pointer-events:none;background:linear-gradient(transparent,#1c120b96);z-index:1}
.scene .promise{top:76px;right:13px;background:#20181066;border:1px solid #ffedda50;border-radius:50%;width:42px;height:42px;display:grid;place-items:center;padding:0;z-index:3}
.scene .promise i{font-size:11px;font-style:normal;letter-spacing:.04em}
.scene .dialogue{bottom:calc(var(--dock-height) + 16px);left:16px;right:16px;min-height:0;max-height:112px;padding:12px 14px;background:#241b15d9;color:#fff5e7;border:1px solid #e8cbb43b;border-radius:14px;box-shadow:0 8px 30px #0002;backdrop-filter:blur(12px)}
.scene .dialogue-top strong{color:#ffc19d}
.scene .dialogue-top #mood{color:#d3bda9}
.scene .dialogue-top button{color:#f4cfb1;min-width:32px;min-height:32px}
.scene .dialogue p{font-size:14px;min-height:0;margin-top:3px;line-height:1.65;color:#fff5e7}
.scene .room{background:#392c26}
.scene .room>*{display:none}
.conversation-controls{position:absolute;z-index:4;left:12px;right:12px;bottom:calc(var(--nav-height) + 8px);padding:0;background:none;border:0;max-height:58%;overflow:visible}
.home-actions{display:flex;gap:8px;align-items:center;margin:0;padding:0;min-height:48px}
#composer-toggle{display:flex;flex:1;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:8px 12px;background:#f4dfc8;color:#39261b;border:1px solid #fff1de;border-radius:28px;font-size:13px;font-weight:600;box-shadow:0 4px 16px #0003}
#composer-toggle>span:first-child{font-size:22px;font-weight:400}
.home-actions .review-link{min-height:48px;justify-content:center;padding:8px 12px;background:#261b15d9;border:1px solid #f4dfc855;border-radius:28px;color:#ffe9d3;font-size:11px}
#home-composer{margin-top:8px;padding:12px;background:#211a16f5;border:1px solid #dcb89d50;border-radius:16px;box-shadow:0 8px 26px #0004;max-height:calc(58svh - 70px);overflow-y:auto}
#home-composer .composer-modes button,#home-composer #routine-fill{min-height:40px}
#home-composer #talk-form{margin-top:4px}
#home-composer #talk-input,#home-composer #send{min-height:44px;height:44px}
#home-composer #send{width:44px}
.bottom-nav{position:absolute;bottom:0;left:0;right:0;height:var(--nav-height);z-index:4;background:#201914f0;border-color:#d3ad8933}
.meal-draft-banner{display:flex;align-items:center}
.meal-draft-banner{margin:8px 0 0;background:#211a16ed;border-radius:12px;border:1px solid #dcb89d66}
.meal-draft-banner>#meal-draft-open{flex:1;min-width:0}
.meal-draft-banner>#meal-draft-save{width:auto;flex-shrink:0;margin-right:6px;background:#e5a17d;color:#291b14;border-radius:3px;font-size:11px;padding:9px}
.meal-draft-banner small{white-space:normal;line-height:1.5}
.home-review-panel{position:absolute;z-index:5;bottom:calc(100% + 12px);left:0;right:0;max-height:230px;overflow:auto;box-shadow:0 8px 24px #0006}
.sheet{max-height:62%}
.backdrop{background:#110d0a40;backdrop-filter:none}
@media(max-width:800px){
  .phone{height:100dvh;min-height:0;--nav-height:calc(57px + env(safe-area-inset-bottom))}
  .app-header{height:calc(64px + env(safe-area-inset-top))}
  .scene .avatar{top:calc(26px + env(safe-area-inset-top));height:calc(100% - 26px - env(safe-area-inset-top))}
  .scene .promise{top:calc(76px + env(safe-area-inset-top))}
}
@media(max-height:600px){
  .scene .dialogue{max-height:80px}
  #home-composer{max-height:40dvh}
}
