:root{font-family:"PingFang SC","Microsoft YaHei",system-ui,sans-serif;color:#2d3b31;background:#f6f5ef;font-synthesis:none;color-scheme:light}
*{box-sizing:border-box}html,body{margin:0;min-height:100%}button,input,textarea,select{font:inherit}button{cursor:pointer}[hidden]{display:none!important}
.shell{min-height:100dvh;display:grid;grid-template-columns:300px minmax(0,1fr);max-width:1800px;margin:auto}
.rail{background:#202e27;color:#f5f3eb;padding:33px 33px 25px;display:flex;flex-direction:column;min-height:100dvh}
.brand{display:flex;align-items:center;gap:12px;color:inherit;text-decoration:none}.brand-mark{display:grid;place-items:center;width:43px;height:43px;border-radius:13px;border:1px solid #c8b49170;color:#d1bb94;font:italic 32px Georgia,serif}.brand strong{display:block;letter-spacing:.16em;font-size:12px;font-weight:600}.brand small{display:block;color:#91a394;font-size:10px;margin-top:5px;letter-spacing:.1em}
.rail-body{margin:auto 0}.eyebrow{font-size:10px;letter-spacing:.18em;color:#a99879;font-weight:600}.select-label{display:block;font-size:13px;margin:20px 0 10px;color:#ebf0e9}
#rooms{appearance:none;width:100%;padding:13px 36px 13px 12px;border:1px solid #5b6c5e;color:#eff4ec;background:#32463a;border-radius:9px;font-size:12px;outline-offset:3px}
.rail-note{margin-top:47px;color:#b7c4b7;font-size:12px;line-height:2.2}.rail-note p{margin:9px 0}.rail-dash{display:block;width:28px;border-top:1px solid #708775;margin-bottom:19px}
.rail-bottom{font-size:10px;line-height:1.9;color:#8da193}.rail-bottom p{margin:6px 0}
.main{min-width:0;display:flex;flex-direction:column}.topbar{height:76px;flex:none;border-bottom:1px solid #e0e6dc;display:flex;justify-content:space-between;align-items:center;padding:0 48px}.top-brand{display:flex;align-items:center;gap:12px}.top-brand>span:not(.mobile-mark){font-size:13px;font-weight:600}.top-brand small{font-size:10px;color:#9aa59a;letter-spacing:.08em}.mobile-mark{display:none}
.top-actions{display:flex;align-items:center;gap:20px}.private-label{font-size:11px;color:#849486}.private-dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:#88af8c;margin-right:5px}.quiet-button,.text-button{border:0;background:none;color:#627a68;font-size:12px;padding:8px}.quiet-button:hover,.text-button:hover{color:#2d4735}
.onboarding{width:min(100%,650px);margin:0 auto;padding:66px 30px 35px}.welcome{text-align:center;margin-bottom:54px}.tiny-rule{height:1px;width:26px;background:#b6a17c;margin:0 auto 24px}.welcome h1,.room-heading h1{font-family:"Songti SC","SimSun",serif;font-weight:500;color:#293c30;font-size:44px;letter-spacing:.035em;margin:12px 0 17px}.welcome-copy{color:#829186;font-size:13px;line-height:2.1;margin:0}.adopt-form{background:#fffefa;border:1px solid #e3e7df;border-radius:20px;padding:34px 38px;box-shadow:0 22px 70px #293c3008}
.step-heading{display:flex;align-items:flex-start;gap:18px;margin-bottom:28px}.step-heading>span{font:italic 24px Georgia,serif;color:#c5b291}.step-heading h2{margin:0 0 7px;font-family:"Songti SC","SimSun",serif;font-size:21px;font-weight:500}.step-heading p{margin:0;font-size:12px;color:#9ca99d;line-height:1.8}.invitation{margin:34px 0 21px;padding-top:29px;border-top:1px solid #e9ece5}
.field-group{margin:0 0 29px;padding:0;border:0;min-width:0}.field-group legend,.field-group label,.input-label,.advanced-inner label,.config-form label:not(.check){font-size:12px;font-weight:600;color:#4b5f50;display:block;margin-bottom:13px}
.gender-options{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.gender-options label{margin:0;position:relative;cursor:pointer}.gender-options input{position:absolute;opacity:0;pointer-events:none}.gender-options span{display:block;text-align:center;border:1px solid #e0e7de;border-radius:10px;padding:13px 6px;color:#6b806f;font-weight:400;font-size:13px;transition:background .16s,border-color .16s}.gender-options input:checked+span{background:#e9f0e9;border-color:#86a28d;color:#2d4c37}.gender-options input:focus-visible+span{outline:2px solid #a8bba9;outline-offset:2px}
.range-heading{display:flex;justify-content:space-between;align-items:center}.range-heading label{margin:0}.range-heading output{color:#5f8169;font-size:12px}
#warmth{width:100%;accent-color:#597962;margin:19px 0 8px;cursor:pointer}.range-ends{display:flex;justify-content:space-between;color:#9ba99e;font-size:11px}
.personality-preview{font-size:12px;line-height:1.9;color:#6c8170;background:#f3f6f0;padding:13px 17px;border-left:2px solid #91a998;border-radius:0 7px 7px 0;margin:-3px 0 24px}
.advanced{border-top:1px solid #e9ece7;padding-top:17px}.advanced summary{list-style:none;cursor:pointer;display:flex;justify-content:space-between;gap:8px;font-size:12px;color:#657f6b}.advanced summary::-webkit-details-marker{display:none}.advanced summary span{color:#a5afa5}.advanced-inner{padding-top:20px}.advanced-inner label,.config-form label:not(.check){margin-top:14px;margin-bottom:8px}
input:not([type=radio]):not([type=range]):not([type=checkbox]),textarea{width:100%;border:1px solid #dfe5dc;border-radius:9px;background:#fdfdfa;color:#304438;font-size:13px;padding:12px 14px;outline:none;min-width:0}input:focus,textarea:focus{border-color:#8da78f!important}textarea{resize:vertical;line-height:1.7}
.primary-button{display:flex;align-items:center;justify-content:center;gap:15px;width:100%;background:#304b39;border:0;border-radius:10px;color:#fffefa;min-height:47px;font-size:13px;margin-top:23px}.primary-button:hover{background:#3c5b45}.primary-button:disabled{opacity:.55;cursor:wait}
.mini-note{color:#9ca99e;font-size:11px;line-height:1.8;margin:12px 0 0}.feedback{min-height:20px;font-size:12px;text-align:center;color:#a65b4f;margin:14px 0}.onboarding-footer{text-align:center;color:#aeb8ac;font-size:10px;letter-spacing:.08em;margin:20px 0}
.room{flex:1;display:flex;flex-direction:column;min-height:0;height:calc(100dvh - 76px)}.room-heading{padding:26px 48px 12px;text-align:center;border-bottom:1px solid #e8ece5}.room-heading h1{font-size:25px;margin:4px 0 8px}.room-heading #status{font-size:11px;color:#87988a;min-height:15px;margin:0}
#messages{flex:1;overflow-y:auto;min-height:0;max-width:900px;width:100%;margin:auto;padding:26px 48px;scrollbar-color:#d4ded2 transparent}.empty-chat{text-align:center;padding:70px 0;color:#95a398}.empty-mark{font-size:28px;color:#c5b291}.empty-chat h2{font-family:"Songti SC","SimSun",serif;color:#6e8170;font-size:20px;font-weight:400}.empty-chat p{font-size:12px}
.message{display:flex;flex-direction:column;align-items:flex-start;gap:7px;margin-bottom:23px}.message.user{align-items:flex-end}.message strong{font-size:11px;color:#879889;font-weight:500}.message-bubble{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.85;font-size:13px;background:#fffefa;border:1px solid #e2e8e0;padding:12px 16px;border-radius:5px 14px 14px 14px;max-width:min(82%,650px)}.message.user .message-bubble{background:#e4eee5;border-color:#d8e7da;border-radius:14px 5px 14px 14px}
.compose-area{padding:10px 40px 20px}.compose{max-width:790px;margin:auto;border:1px solid #dfe6dc;border-radius:15px;background:#fffefa;padding:12px 15px;box-shadow:0 10px 25px #263c2c0b}.compose textarea{border:0!important;background:transparent;padding:1px;font-size:13px;min-height:44px;max-height:160px;resize:vertical}.compose-foot{display:flex;align-items:center;justify-content:space-between;gap:12px}.compose-foot span{font-size:10px;color:#a6b0a5}.compose-foot button{width:35px;height:35px;border-radius:10px;border:0;background:#304b39;color:white;font-size:20px}.compose-foot button:disabled{opacity:.45}.under-compose{max-width:790px;margin:8px auto 0;display:flex;justify-content:space-between;align-items:center;gap:8px;color:#abb8ab;font-size:10px}
.settings-dialog{border:1px solid #dfe6db;border-radius:18px;padding:28px;background:#fffefa;color:#314a39;width:min(490px,calc(100vw - 28px));max-height:86dvh;overflow-y:auto;box-shadow:0 25px 90px #172b2040}.settings-dialog::backdrop{background:#182b207d;backdrop-filter:blur(3px)}.dialog-head{display:flex;justify-content:space-between;align-items:center}.dialog-head h2{font:500 24px "Songti SC","SimSun",serif;margin:0}.close-button{border:0;background:transparent;color:#7c8f7f;font-size:26px}.setting-description{font-size:12px;line-height:1.9;color:#7f9183}.config-form>input,.config-form>textarea{margin-bottom:8px}.config-form label span{font-weight:400;color:#8d9b8e}.check{display:flex;gap:10px;font-size:12px;color:#718373;align-items:center;margin-top:10px}.check input{accent-color:#52725a}.config-form .primary-button{margin-top:20px}
.visually-hidden{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
@media(max-width:950px){.shell{grid-template-columns:240px minmax(0,1fr)}.rail{padding:26px 22px}.topbar{padding:0 26px}}
@media(max-width:700px){.shell{display:block}.rail{min-height:auto;padding:13px 17px}.brand-mark{width:32px;height:32px;font-size:24px;border-radius:9px}.brand strong{font-size:10px}.brand small{font-size:9px}.rail-body,.rail-bottom{display:none}.topbar{height:58px;padding:0 17px}.mobile-mark{display:none}.top-brand small{display:none}.private-label{font-size:10px}.onboarding{padding:38px 16px 22px}.welcome{margin-bottom:30px}.welcome h1{font-size:34px}.welcome-copy{font-size:12px}.adopt-form{padding:27px 21px;border-radius:15px}.step-heading h2{font-size:19px}.room{height:calc(100dvh - 105px)}.room-heading{padding:16px 15px 10px}.room-heading h1{font-size:21px}#messages{padding:17px 14px}.compose-area{padding:6px 10px calc(12px + env(safe-area-inset-bottom))}.under-compose span{display:none}.message-bubble{max-width:88%}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important}}


/* Fish Home V3: a single uncluttered page; room switching stays in the header. */
.shell{display:block;max-width:none}
.main{width:100%;min-height:100dvh}
.topbar{padding:0 clamp(22px,4vw,70px)}
.top-brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:#304738}
.top-symbol{display:grid;place-items:center;width:34px;height:34px;border-radius:10px;border:1px solid #c9bba4;color:#b39d7a;font:italic 25px Georgia,serif}
.top-brand-name{font-size:12px;font-weight:650;letter-spacing:.16em}
.top-brand small{font-size:11px;letter-spacing:.03em;color:#88998b}
.top-actions #top-title{font-size:12px;color:#728375}
#rooms{width:auto;max-width:170px;min-width:110px;padding:9px 27px 9px 10px;border:1px solid #dce5d9;background:#fffefa;color:#46604c;border-radius:8px;font-size:11px}
.onboarding{padding-top:64px}
.invitation{margin:29px 0 27px;padding-top:28px}
.adopt-form>.step-heading:first-child{margin-bottom:23px}
.adopt-form>.input-label{margin-bottom:11px}
.adopt-form>.mini-note{margin-bottom:5px}
.room{height:calc(100dvh - 76px)}
@media(max-width:700px){
 .main{min-height:100dvh}
 .topbar{height:64px;padding:0 16px}
 .top-brand{gap:8px}.top-brand small{display:none}
 .top-actions{gap:8px}.top-actions #top-title{display:none}
 .top-brand-name{font-size:11px}
 #rooms{max-width:118px;min-width:75px}
 .onboarding{padding:38px 15px 22px}
 .room{height:calc(100dvh - 64px)}
}


/* Naming is a deliberate choice, not an auto-generated suggestion. */
.name-group{margin-bottom:25px}
.name-group label{margin-bottom:11px}
.name-group .optional{font-weight:400;color:#a0aa9e}
.name-note{font-size:11px;line-height:1.8;color:#91a293;margin:9px 0 0}

.credit-info{margin:0 0 9px;color:#6c866f;font-size:11px}.credit-info.exhausted{color:#9b6d5d}


/* One home, one companion: no room manager on the consumer chat surface. */
#rooms,#new-room,#top-title{display:none!important}
.room-heading h1,.room-heading .eyebrow{display:none}
.room-heading{padding:15px 24px 11px}
.room-heading #status{line-height:1.8}


/* Same safe MiniMarkdown renderer as the group interface. */
.message.assistant .message-bubble{white-space:normal}
.message-bubble pre{max-width:100%;overflow-x:auto;background:#edf2eb;padding:10px 12px;border-radius:7px;line-height:1.5}
.message-bubble code{overflow-wrap:anywhere;background:#edf2eb;border-radius:3px;padding:1px 3px}
.message-bubble pre code{background:transparent;padding:0;white-space:pre}
.message-bubble a{color:#386c55;text-decoration:underline;text-underline-offset:3px}
.message-bubble br{display:block;content:"";margin:0 0 2px}

/* Private model/tool inspection shares the Group Timeline convention,
 * without bringing the Group's member sidebar into a one-to-one room. */
.timeline-trigger{font-size:12px;letter-spacing:.02em;color:#647d6a;border:1px solid #dfe7dd;border-radius:7px;padding:7px 11px}
.timeline-trigger:hover{background:#edf3ec}
.timeline-description{font-size:11px;line-height:1.7;color:#869788}
.timeline-header-actions{display:flex;align-items:center;gap:8px}
.timeline-events{scrollbar-color:#bdcdbb transparent}
/* Mobile-first readable Timeline cards; raw JSON is an opt-in disclosure. */
.timeline-entry{margin:0 0 10px;border:1px solid #e1e8de;background:#fffefa;border-radius:13px;overflow:hidden;box-shadow:0 4px 18px #263c2c07;min-width:0}
.timeline-entry>summary{cursor:pointer;padding:13px 14px;display:flex;justify-content:space-between;align-items:flex-start;gap:10px;color:#435b48;min-width:0;list-style:none}
.timeline-entry>summary::-webkit-details-marker{display:none}
.timeline-entry>summary::after{content:'⌄';color:#93a394;font-size:17px;line-height:1;flex:none;order:3;transition:transform .15s}
.timeline-entry[open]>summary::after{transform:rotate(180deg)}
.timeline-entry>summary time{font-size:11px;color:#95a49a;white-space:nowrap;margin-top:3px;flex:none}
.timeline-entry[open]>summary{border-bottom:1px solid #e9eee7;background:#fcfdf9}
.tl-event-title{display:flex;align-items:center;flex-wrap:wrap;min-width:0;gap:5px 8px;line-height:1.45}
.tl-event-type{font-size:10px;letter-spacing:.03em;font-weight:700;color:#52735b;background:#e8f1e7;padding:3px 7px;border-radius:5px;white-space:nowrap}
.tl-round{font-size:10px;color:#9d8257;background:#f7f0e4;padding:3px 6px;border-radius:5px;white-space:nowrap}
.tl-event-label{font-size:12px;color:#43594a;overflow-wrap:anywhere}
.tl-event-content{padding:14px 15px 15px;min-width:0;display:grid;gap:13px}
.tl-metrics{display:flex;gap:7px;flex-wrap:wrap}
.tl-metric{min-width:0;display:inline-flex;flex-direction:column;gap:3px;padding:9px 11px;background:#f4f7f1;border:1px solid #e5ecdf;border-radius:9px;flex:1 1 75px;max-width:180px}
.tl-metric-label{color:#8a9c8b;font-size:10px;white-space:nowrap}
.tl-metric strong{font-size:13px;font-weight:600;color:#3c5945;overflow-wrap:anywhere}
.tl-metric.tl-good{background:#edf6ee;border-color:#dceada}
.tl-metric.tl-good strong{color:#3f7952}
.tl-metric.tl-warn{background:#fbf3e9;border-color:#f1e2cc}
.tl-metric.tl-warn strong{color:#a46c36}
.tl-block{border:1px solid #e6ebe2;border-radius:8px;padding:10px 12px;background:#fdfdf9;min-width:0}
.tl-block-label{display:block;font-size:10px;color:#8b9c8f;margin-bottom:7px;font-weight:600;letter-spacing:.02em}
.tl-block-text{font-size:12px;line-height:1.7;color:#425847;white-space:pre-wrap;overflow-wrap:anywhere;max-height:195px;overflow:auto}
.tl-highlight{border-left:3px solid #95b298;background:#f4f8f2}
.tl-subtle{background:#f8faf7}
.tl-section-heading{font-size:11px;color:#6e826f;font-weight:600;margin:0 0 7px}
.tl-message-rows{min-width:0}
.tl-message-row{display:flex;gap:9px;align-items:flex-start;padding:9px 0;border-bottom:1px solid #ebeee8;min-width:0}
.tl-message-row:last-child{border-bottom:0}
.tl-role{font-size:9px;font-weight:700;flex:none;min-width:45px;text-align:center;background:#f2f3ee;color:#7b8e7c;padding:4px 5px;border-radius:4px}
.tl-role-assistant{color:#567a60;background:#e9f1e8}.tl-role-user{color:#6f6d95;background:#efeff7}.tl-role-tool{color:#986e37;background:#f8f0e4}
.tl-message-preview{font-size:11px;line-height:1.65;color:#516556;white-space:pre-wrap;overflow-wrap:anywhere;min-width:0}
.tl-inline-tool{font-weight:600;color:#8c704b}
.tl-tool-call{background:#f8f5ec;border:1px solid #ede3ce;border-radius:10px;padding:11px;min-width:0;display:grid;gap:7px}
.tl-tool-call .tl-block{background:#fffdf8;margin-top:2px}
.tl-tag{font-size:10px;letter-spacing:.03em;border-radius:5px;padding:3px 7px;justify-self:start}
.tl-tag-tool{color:#93703d;background:#f0e6d2}
.tl-tool-name{font:600 13px/1.4 ui-monospace,Consolas,monospace;color:#5d634d;overflow-wrap:anywhere}
.tl-facts{margin:0;display:grid;gap:0;background:#fafbf7;border:1px solid #e9eee6;border-radius:9px;overflow:hidden}
.tl-fact{display:grid;grid-template-columns:minmax(75px,32%) minmax(0,1fr);gap:10px;border-bottom:1px solid #e9eee6;padding:9px 11px;font-size:11px;line-height:1.5}
.tl-fact:last-child{border-bottom:0}
.tl-fact dt{color:#839587}.tl-fact dd{margin:0;color:#435b49;overflow-wrap:anywhere}
.tl-cache{display:grid;gap:6px;font-size:11px;color:#5b7461}
.tl-cache>small{font-size:10px;color:#8da18f}
.tl-cache-track{height:6px;background:#e6ece3;border-radius:6px;overflow:hidden}
.tl-cache-fill{display:block;height:100%;background:#85ac8c;border-radius:6px}
.tl-disclosure{border:1px solid #e2e9df;border-radius:8px;min-width:0;overflow:hidden}
.tl-disclosure>summary{list-style:none;cursor:pointer;font-size:11px;font-weight:600;padding:11px 12px;color:#5f7e65;display:flex;justify-content:space-between;align-items:center;gap:10px}
.tl-disclosure>summary::-webkit-details-marker{display:none}
.tl-disclosure>summary::after{content:'展开 +';font-weight:400;color:#97a698;white-space:nowrap}
.tl-disclosure[open]>summary::after{content:'收起 −'}
.tl-disclosure>pre{margin:0;padding:12px;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.65;font:11px/1.65 ui-monospace,Consolas,'Cascadia Code',monospace;color:#405045;background:#f6f8f4;max-height:55dvh;overflow:auto;border-top:1px solid #e1e9df}
.tl-raw-json>summary{color:#758579}
.timeline-truncated{color:#ac6739;font-size:11px;margin:0;line-height:1.6}
.timeline-empty{font-size:13px;color:#7d8d81;padding:24px 4px;line-height:1.8}
.timeline-response{border-left:3px solid #87a98c}.timeline-tool{border-left:3px solid #b8a275}.timeline-error{border-left:3px solid #bd877e}
@media(max-width:600px){.timeline-entry>summary{padding:12px 11px;gap:7px}.timeline-entry>summary time{font-size:10px}.tl-event-content{padding:11px;gap:11px}.tl-event-label{font-size:11px}.tl-metric{padding:8px 9px;flex-basis:67px}.tl-metric strong{font-size:12px}.tl-fact{grid-template-columns:minmax(68px,30%) minmax(0,1fr)} }
/* Shared Group timestamps, now present on Private messages too. */
.message-meta{display:flex;gap:10px;align-items:baseline}
.message-meta time{font-size:10px;color:#9aaa9e;white-space:nowrap}
.message-delivery{font-size:10px;color:#93a393}
.send-failed .message-delivery{color:#a9685a}
.pending-message .message-bubble{opacity:.88}
.timeline-refresh{flex:none;border:1px solid #dce5d9;border-radius:8px}

/* Group and Private now use the same semantic message DOM; the room type
 * chooses layout and colors, never a separate renderer. */
.room .message{display:flex;flex-direction:row;align-items:flex-start;gap:13px;margin:0 0 24px}
.room .message.mine{flex-direction:row-reverse;align-items:flex-start}
.room .message-avatar{width:35px;height:35px;min-width:35px;display:grid;place-items:center;border-radius:11px;background:#415e4e;color:#f2f5ef;font-size:12px}
.room .message.mine .message-avatar{background:#698b72}
.room .message.ds .message-avatar{background:#687e72}
.room .message-content{min-width:0;max-width:80%}
.room .message-meta{display:flex;align-items:center;gap:10px;margin:0 0 7px;color:#6d7d70;font-size:11px}
.room .message.mine .message-meta{justify-content:flex-end}
.room .message-meta span{font-weight:500}
.room .bubble{border:1px solid #e4e7e0;background:#fffefa;border-radius:5px 15px 15px 15px;padding:12px 16px;color:#324238;line-height:1.85;white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px}
.room .message.mine .bubble{background:#e4eee5;border-color:#d8e7da;border-radius:15px 5px 15px 15px}
.room .message-content .message-delivery{display:block;text-align:right;margin-top:5px;color:#94a296;font-size:10px}
.room .send-failed .message-delivery{color:#aa625c}
.room .message-content .tool-trace{margin:5px 0;font-size:11px}
.room .message-content .tool-trace-text{white-space:pre-wrap;font-size:11px}
.room .message-content pre{max-width:100%;overflow-x:auto;background:#edf2eb;padding:10px 12px;border-radius:7px;line-height:1.5}
.room .message-content code{overflow-wrap:anywhere;background:#edf2eb;border-radius:3px;padding:1px 3px}
.room .message-content pre code{background:transparent;padding:0;white-space:pre}
.room .message-content a{color:#386c55;text-decoration:underline;text-underline-offset:3px}
@media(max-width:700px){.room .message-content{max-width:84%}.room .message-avatar{width:30px;height:30px;min-width:30px}}

/* iOS Safari auto-zooms focused controls when their font is below 16px.
   Keep the viewport zoomable for accessibility; size the controls correctly. */
@media (max-width: 700px) {
  input:not([type=radio]):not([type=range]):not([type=checkbox]),
  textarea, select {
    font-size: 16px;
  }
  .compose textarea { font-size: 16px; }
  #rooms { font-size: 16px; }
}

/* Private context/cache meters share the Group's last-request semantics. */
.fish-context-stats{display:flex;justify-content:center;gap:9px;flex-wrap:wrap;margin:7px 0 5px}
.fish-context-pill{font-size:11px;line-height:1.4;padding:5px 10px;border:1px solid #dce8dd;border-radius:999px;background:#f1f6ef;color:#57735c}
.fish-context-pill.context-warning{background:#fff1dc;border-color:#e9c999;color:#97602d}

/* Durable 30-minute pause marker, intentionally not an AI chat bubble. */
.fish-clock-event{text-align:center;font-size:11px;color:#86998b;margin:14px auto 24px;
  padding:6px 12px;border:1px solid #e2e9e1;border-radius:999px;width:max-content;max-width:100%}


/* Fish mobile conversation: one document scroll, not a pinned viewport split.
   Topbar, status, chat, composer and settings all participate in normal flow. */
html,body{height:auto;min-height:100%;overflow-y:auto;overscroll-behavior-y:auto}
.shell,.main{height:auto;min-height:100dvh;overflow:visible}
.room{height:auto;min-height:0;flex:1 0 auto;overflow:visible}
#messages{height:auto;min-height:0;max-height:none;flex:none;overflow:visible;margin:0 auto;
  padding-bottom:clamp(28px,7vh,70px)}
.room-heading,.compose-area,.topbar{position:static;top:auto;bottom:auto}
.compose-area{padding-bottom:calc(34px + env(safe-area-inset-bottom));}
.jump-to-compose{position:fixed;z-index:30;right:clamp(14px,3vw,28px);
  bottom:calc(20px + env(safe-area-inset-bottom));width:49px;height:49px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;
  border:1px solid #c5d6c6;border-radius:16px;background:#304b39;color:#fffdf7;
  box-shadow:0 5px 19px #223b2940;line-height:1;cursor:pointer;
  -webkit-tap-highlight-color:transparent;touch-action:manipulation;font-size:22px}
.jump-to-compose span{font-size:9px;line-height:1.1;letter-spacing:.04em;margin-top:1px}
.jump-to-compose:focus-visible{outline:3px solid #9aba9d;outline-offset:3px}
@media(max-width:700px){
 .room{height:auto;min-height:0}
 #messages{padding-bottom:34px}
 .compose-area{padding-bottom:calc(32px + env(safe-area-inset-bottom));padding-right:70px}
 .jump-to-compose{right:14px;bottom:calc(16px + env(safe-area-inset-bottom));width:46px;height:46px;border-radius:14px}
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}


/* The usage numbers belong to the composer, not to a distant top banner.
   Quiet, glanceable text with no pills or separate status panel. */
.room-heading{display:none}
.fish-usage-line{max-width:790px;margin:9px auto 0;display:flex;flex-wrap:wrap;
  justify-content:flex-start;align-items:baseline;gap:3px 0;min-width:0;
  color:#8d9a8e;font-size:10px;line-height:1.65}
.fish-usage-line .credit-info{display:inline;margin:0;font-size:inherit;line-height:inherit;color:#7e9381}
.fish-usage-line .credit-info[hidden]{display:none}
.fish-usage-line .credit-info.exhausted{color:#a47569}
.fish-usage-line .fish-context-stats{display:inline-flex;align-items:baseline;flex-wrap:wrap;
  justify-content:flex-start;margin:0;gap:0;font-size:inherit}
.fish-usage-line .fish-context-pill{display:inline;border:0;border-radius:0;background:none;
  padding:0;margin:0;font-size:inherit;line-height:inherit;color:inherit}
.fish-usage-line .fish-context-pill.context-warning{background:none;color:#a47337}
.fish-usage-line .credit-info:not([hidden])::after,
.fish-usage-line .fish-context-pill:not(:last-child)::after{content:' · ';white-space:pre;color:#b5c0b3}
.fish-usage-line .fish-context-pill:not(:last-child){margin-right:0}
.fish-compose-status{max-width:790px;margin:3px auto 0;min-height:0;
  font-size:10px;line-height:1.6;color:#94a394}
.fish-compose-status:empty{display:none}
.fish-compose-status.error{color:#a65b4f}
@media(max-width:700px){.fish-usage-line{font-size:10px;margin-top:8px}.fish-compose-status{font-size:10px}}

.room .fish-document-message .bubble h1,.room .fish-document-message .bubble h2,
.room .fish-document-message .bubble h3{margin:1.1em 0 .5em;color:#2e4938;line-height:1.35;font-weight:650}
.room .fish-document-message .bubble h1{font-size:21px}
.room .fish-document-message .bubble h2{font-size:17px}
.room .fish-document-message .bubble h3{font-size:15px}
.room .fish-document-message .bubble h4,.room .fish-document-message .bubble h5,
.room .fish-document-message .bubble h6{font-size:13px;margin:1em 0 .4em}
.room .fish-document-message .bubble p{margin:.55em 0 1em}
.room .fish-document-message .bubble ul,.room .fish-document-message .bubble ol{padding-left:1.7em;margin:.5em 0 1em}
.room .fish-document-message .bubble li{margin:.3em 0}
.room .fish-document-message .bubble blockquote{border-left:3px solid #aac0aa;padding:5px 13px;background:#f2f6f1;color:#6e8172;margin:12px 0}
.room .fish-document-message .bubble hr{border:0;border-top:1px solid #dce6dc;margin:18px 0}
.fish-document-table-scroll{width:100%;max-width:100%;overflow:auto}
.fish-document-table-scroll table{border-collapse:collapse;font-size:12px;min-width:180px}
.fish-document-table-scroll th,.fish-document-table-scroll td{border:1px solid #dce5d9;padding:6px 9px;text-align:left}
.fish-document-table-scroll th{background:#edf3eb;font-weight:600}


/* Separate document and recovered-message presentation */
.room .fish-document-message .message-content{max-width:min(92%,850px);width:min(850px,100%)}
.room .fish-document-message .bubble{background:#fffefa;border:1px solid #d9e3d9;
  border-radius:0 0 13px 13px;padding:16px 19px;line-height:1.75}
.fish-document-heading{font-size:11px;letter-spacing:.04em;color:#55725d;
  background:#edf3ec;border:1px solid #d9e3d9;border-bottom:0;
  border-radius:12px 12px 0 0;padding:9px 15px;font-weight:600}
.fish-fallback-note{font-size:10px;line-height:1.65;color:#976944;background:#fbf2e5;
  border:1px solid #efdfc8;border-radius:7px;padding:7px 9px;margin:0 0 7px}
.room .fish-fallback-message .bubble{border-color:#eadcc6}
@media(max-width:700px){.room .fish-document-message .message-content{max-width:calc(100% - 42px)}
  .room .fish-document-message .bubble{padding:13px}}


/* Status belongs to the page beginning, below navigation, never beside
   usage statistics at the bottom. It consumes no space when cleared. */
.fish-room-status{margin:0;padding:9px 18px 7px;font-size:11px;line-height:1.6;
  color:#8b9c8d;text-align:center;overflow-wrap:anywhere;position:static}
.fish-room-status:empty{display:none}
.fish-room-status.error{color:#a65b4f}
@media(max-width:700px){.fish-room-status{font-size:10px;padding:8px 12px 6px}}


/* Document: a compact, keyboard-accessible preview in chat. The complete
   Markdown renders only inside a full-viewport modal reader. */
.room .fish-document-message .message-content{max-width:min(84%,540px);width:min(540px,100%)}
.fish-document-card{display:flex;flex-direction:column;align-items:stretch;text-align:left;gap:9px;
  width:100%;border:1px solid #d4e1d4;border-radius:15px;padding:16px 17px;
  color:#344a3a;background:#fffefa;box-shadow:0 7px 24px #1f382709;cursor:pointer;
  -webkit-tap-highlight-color:transparent;min-width:0}
.fish-document-card:focus-visible{outline:3px solid #82ac8c;outline-offset:3px}
.fish-document-card-label{font-size:11px;letter-spacing:.04em;color:#79917e}
.fish-document-card-title{font-size:17px;line-height:1.45;color:#344e3a;overflow-wrap:anywhere}
.fish-document-card-preview{font-size:12px;line-height:1.7;color:#718474;
  white-space:pre-line;overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;
  -webkit-box-orient:vertical;overflow-wrap:anywhere}
.fish-document-card-action{font-size:11px;color:#5a8462;margin-top:5px;
  border-top:1px solid #e7ece5;padding-top:9px}
.fish-document-reader{position:fixed;inset:0;margin:0;padding:0;width:100vw;
  max-width:none;height:100dvh;max-height:100dvh;border:0;background:#f6f5ef;
  color:#304338;overflow:hidden;overscroll-behavior:contain}
.fish-document-reader::backdrop{background:#182b2099}
.fish-document-reader[open]{display:flex;flex-direction:column}
.fish-reader-bar{height:calc(57px + env(safe-area-inset-top));flex:none;
  padding:env(safe-area-inset-top) clamp(14px,3vw,30px) 0;
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  background:#fffefa;border-bottom:1px solid #e2e7df}
.fish-reader-back{border:0;background:transparent;padding:10px 4px;
  font-size:15px;color:#4c7155;cursor:pointer}
.fish-reader-kind{font-size:11px;letter-spacing:.09em;color:#91a193}
.fish-reader-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;padding:24px 17px calc(36px + env(safe-area-inset-bottom))}
.fish-reader-page{background:#fffefa;border:1px solid #e5e9e0;
  border-radius:14px;max-width:790px;min-height:55dvh;margin:0 auto;
  padding:clamp(20px,5vw,52px);box-shadow:0 12px 45px #283b2a0a}
.fish-document-body{font-size:15px;line-height:1.85;overflow-wrap:anywhere}
.fish-document-body h1,.fish-document-body h2,.fish-document-body h3,
.fish-document-body h4,.fish-document-body h5,.fish-document-body h6{
  margin:1.2em 0 .6em;line-height:1.45;color:#2e4938}
.fish-document-body h1{font-size:25px}.fish-document-body h2{font-size:20px}
.fish-document-body h3{font-size:17px}.fish-document-body p{margin:.6em 0 1.1em}
.fish-document-body ul,.fish-document-body ol{padding-left:1.7em}
.fish-document-body li{margin:.3em 0}
.fish-document-body blockquote{margin:15px 0;border-left:3px solid #a8bfa9;
  padding:8px 16px;background:#f2f6f1;color:#697c6c}
.fish-document-body pre{background:#eff3ec;padding:15px;border-radius:9px;
  overflow-x:auto;white-space:pre;font:13px/1.65 ui-monospace,Consolas,monospace}
.fish-document-body hr{border:0;border-top:1px solid #dce6dc;margin:23px 0}
.fish-document-body .fish-document-table-scroll{overflow:auto;max-width:100%}
.fish-document-body table{border-collapse:collapse;font-size:13px}
.fish-document-body th,.fish-document-body td{border:1px solid #dce5d9;padding:8px 11px}
.fish-document-body th{background:#edf3eb}
@media(max-width:700px){.room .fish-document-message .message-content{max-width:calc(100% - 42px);width:100%}
 .fish-document-card{padding:14px}.fish-document-card-title{font-size:16px}
 .fish-reader-scroll{padding:13px 10px calc(26px + env(safe-area-inset-bottom))}
 .fish-reader-page{padding:21px 18px;min-height:80dvh;border-radius:10px}
 .fish-document-body{font-size:14px}}


/* The game-like text reveal only affects fresh live messages; never history. */
.room .bubble.fish-revealing{cursor:pointer;white-space:pre-wrap}
.room .bubble.fish-revealing::after{content:'▏';display:inline;color:#74a78a;
  animation:fish-caret-blink .7s steps(1,end) infinite}
@keyframes fish-caret-blink{50%{opacity:0}}
@media(prefers-reduced-motion:reduce){.room .bubble.fish-revealing::after{animation:none}}




/* Private room image messages (no special microphone permission needed). */
.fish-compose-actions{display:flex;gap:8px;align-items:center}
.compose-foot .fish-image-choose{width:auto;min-width:43px;padding:0 10px;
 background:#edf3eb;color:#4e735a;border:1px solid #d5e0d6;font-size:11px}
.fish-image-draft{position:relative;width:max-content;max-width:100%;margin:9px 0}
.fish-image-draft[hidden]{display:none}
.fish-image-draft img{display:block;max-width:148px;max-height:136px;border-radius:9px;object-fit:contain}
.fish-image-draft button{position:absolute;right:-7px;top:-7px;width:23px;height:23px;
 border:0;border-radius:50%;background:#425b48;color:#fff;font-size:16px}
.room .bubble .fish-message-image{display:block;max-width:min(100%,360px);
 max-height:400px;object-fit:contain;border-radius:10px;margin-bottom:9px}

/* Inline invitation verification, visible beside the five-character input. */
.invite-input-wrap{position:relative}
.invite-input-wrap #code{padding-right:46px}
.invite-validation{position:absolute;right:13px;top:50%;transform:translateY(-50%);display:grid;place-items:center;width:23px;height:23px;border-radius:50%;font-size:16px;font-weight:700;pointer-events:none}
.invite-validation[data-state="checking"]{border:2px solid #d8e4d8;border-top-color:#6d9876;animation:invite-spin .75s linear infinite}
.invite-validation[data-state="valid"]{color:#2c7650;background:#e4f3e7}
.invite-validation[data-state="invalid"]{color:#a44b43;background:#f9e8e5}
@keyframes invite-spin{to{transform:translateY(-50%) rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.invite-validation[data-state="checking"]{animation:none;border-color:#6d9876}}

/* Persisted rename events: low-key in-stream notices, not speech bubbles. */
.fish-identity-event{width:fit-content;max-width:90%;margin:12px auto 23px;padding:7px 13px;border-radius:999px;background:#e9ede6;color:#6e806f;font-size:11px;text-align:center;line-height:1.6;overflow-wrap:anywhere}

/* Persona edits are persistent system events, collapsed to keep chat readable. */
.fish-persona-event{max-width:min(90%,620px);margin:12px auto 23px;color:#6e806f;font-size:11px;text-align:center}
.fish-persona-event summary{cursor:pointer;list-style:none;border-radius:14px;background:#e9ede6;padding:8px 14px}
.fish-persona-event summary::-webkit-details-marker{display:none}
.fish-persona-event pre{margin:9px 0 0;padding:12px;background:#f5f7f2;border:1px solid #e2e8e0;border-radius:10px;text-align:left;white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;line-height:1.7;font-family:inherit}
