:root{font-family:system-ui,"Microsoft YaHei",sans-serif;color:#182218;background:#f5f7f2}*{box-sizing:border-box}body{margin:0;padding:24px}main{max-width:680px;margin:auto}header{margin-bottom:20px}header p{color:#58725f;margin:0}h1{margin:5px 0}small{color:#607068}#timeline{display:grid;gap:12px;margin-bottom:20px}.message{padding:14px;border-radius:12px;background:white;box-shadow:0 1px 5px #0011}.message.user{background:#e4f1e7;margin-left:12%}.card{margin-top:10px;padding:12px;border:1px solid #bfcec1;border-radius:9px}.card h2{font-size:16px;margin:0 0 8px}.card h3{font-size:14px;margin:12px 0 6px}.card p{margin:0;color:#62736a}.card dl{display:grid;grid-template-columns:auto minmax(0,1fr);gap:4px;margin:8px 0}.card dt{color:#62736a}.card dd{margin:0;overflow-wrap:anywhere}.card button,#send,#query-send{border:0;border-radius:8px;background:#236c43;color:white;padding:10px 14px;font:inherit;cursor:pointer;margin-top:10px}form{display:grid;gap:8px;background:white;padding:14px;border-radius:12px;margin-top:12px}textarea,input{width:100%;min-height:42px;padding:10px;font:inherit;border:1px solid #aab9ae;border-radius:8px}textarea{min-height:76px}@media(max-width:480px){body{padding:12px}.message.user{margin-left:4%}}

.draft-item{border-top:1px solid #d9e3d9;padding:10px 0}.draft-item.excluded{color:#778278;background:#f5f7f5;padding:10px}.draft-item.excluded p{color:#778278}.draft-editor{border:1px solid #bfcec1;background:#f7faf7}.draft-editor label{display:grid;gap:4px}.draft-editor input[type=checkbox]{width:auto;min-height:0;margin-right:8px}.draft-editor label:has(input[type=checkbox]){display:flex;align-items:center}.draft-editor select{width:100%;min-height:42px;padding:10px;font:inherit;border:1px solid #aab9ae;border-radius:8px}.draft-editor button[type=button]{background:#e5eee5;color:#285638}

#final-review:not([hidden]),#close-review:not([hidden]){position:fixed;z-index:20;left:50%;top:50%;transform:translate(-50%,-50%);width:min(420px,calc(100vw - 32px));max-height:calc(100vh - 32px);overflow:auto;background:#fff;box-shadow:0 0 0 100vmax #14241877,0 8px 30px #0013;border-radius:12px;padding:18px}

[hidden] { display: none !important; }

#daily-overview{width:auto;min-height:0;margin-right:8px;vertical-align:middle}

#issue-consent{width:auto;min-height:0;margin-right:8px}#withdraw-review:not([hidden]){position:fixed;z-index:20;left:50%;top:50%;transform:translate(-50%,-50%);width:min(420px,calc(100vw - 32px));max-height:calc(100vh - 32px);overflow:auto;background:#fff;box-shadow:0 0 0 100vmax #14241877,0 8px 30px #0013;border-radius:12px;padding:18px}#issue-list h3{overflow-wrap:anywhere}

#save-issue:disabled{opacity:.45;cursor:not-allowed}

.image-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(100px,1fr));gap:10px;margin:12px 0;max-width:100%}.image-grid img{display:block;width:100%;height:120px;object-fit:contain;background:#edf2ed;border-radius:8px}.image-preview{min-width:0}.image-preview span{display:block;overflow-wrap:anywhere;font-size:13px;margin:6px 0}.image-preview button{font-size:13px;padding:6px 8px}#issue-images{max-width:100%;width:100%;font:inherit}#upload-progress{width:100%}details{margin:10px 0}summary{cursor:pointer;color:#236c43}.form-hint{font-size:13px;color:#607068}#issue-list p{font-size:14px}

#new-issue{margin-right:8px}#issue-form label{display:grid;gap:6px}#issue-form label:has(#issue-consent){display:flex;align-items:flex-start}#issue-consent{flex:0 0 auto;margin-top:4px}.detail-note{color:#607068}
/* F5.5-D: real assistant timeline and fixed single composer. */
body[data-page=assistant]{background:#f4f6f3}
.assistant-content{padding-bottom:190px!important}
.assistant-content #timeline{gap:22px;margin:0;padding-bottom:24px}
.assistant-content .message{width:92%;max-width:680px;justify-self:start;padding:14px;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:none;overflow-wrap:anywhere}
.assistant-content .message.user{width:auto;max-width:80%;justify-self:end;margin:0;background:#e8f2ed;border-color:#d7e8dd;white-space:pre-wrap}
.message-copy{margin:0;white-space:pre-wrap;font-size:13px;line-height:1.7}
.assistant-content .card{margin:12px 0 0;padding:0;border:0;background:none}
.assistant-content .card h2{font-size:13px;color:var(--deep);margin:0 0 6px}.assistant-content .card h3{font-size:12px;margin:12px 0 6px}
.assistant-content .card>p{font-size:12px}.content-card{border:1px solid var(--line);border-radius:10px;padding:10px;margin-top:8px;min-width:0}
.content-heading{display:flex;align-items:center;flex-wrap:wrap;gap:5px;min-width:0}
.content-heading .record-title{max-width:100%;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600;font-size:14px;color:#183f31;background:none;border:0;padding:0;min-height:44px;text-align:left;margin:0}
.content-heading .item-tags{margin:0}.item-tags{display:flex;gap:4px;flex-wrap:wrap;font-size:10px}.item-tags span{padding:1px 5px;background:#edf3ef;color:#647369;border-radius:4px;font-weight:400}
.content-card dl,#record-detail dl{display:grid;grid-template-columns:58px minmax(0,1fr);gap:6px;margin:0;font-size:13px;line-height:1.6}.content-card dt,#record-detail dt{color:var(--muted)}.content-card dd,#record-detail dd{margin:0;overflow-wrap:anywhere;white-space:pre-wrap}
.changed-value{margin-left:8px;color:var(--green)}del{color:var(--muted)}.title-change{font-size:12px}.excluded,.conflict-comparison{background:#f3f5f3;color:var(--muted)}.conflict-comparison dd:first-of-type{font-weight:600}.proposal-label,.card-note{font-size:11px;color:var(--muted)}
.card-actions{display:flex;justify-content:flex-end;gap:6px;flex-wrap:wrap;border-top:1px solid var(--line);margin-top:6px;padding-top:0}
.assistant-content .card-actions button{min-height:44px;margin:0;border:0;border-radius:8px;background:#e8f2ed;color:var(--green);padding:6px 10px;font-size:12px}.assistant-content .card-actions button:last-child{background:var(--green);color:#fff}
.assistant-content button.query-row{display:grid;width:100%;grid-template-columns:62px minmax(0,1fr);gap:18px;background:none;color:inherit;text-align:left;padding:10px 0;border:0;border-bottom:1px solid var(--line);border-radius:0;margin:0;min-height:64px}
.item-time{font-size:13px;line-height:1.5;font-variant-numeric:tabular-nums;align-self:center}.item-time strong{display:block;font-weight:400;font-size:13px}.item-time small{display:block;font-size:11px}.range-connector{width:1px;height:5px;background:#b2c1b8;margin-left:4px}.item-main{min-width:0;position:relative}.item-main:before{content:'';position:absolute;left:-9px;top:0;bottom:0;width:1px;background:#e3eae5}.item-title{display:block;font-size:13px;font-weight:600;overflow-wrap:anywhere;white-space:normal}.item-main .item-tags{margin-top:5px}
.assistant-content .card a{font-size:12px;color:var(--green);display:inline-block;min-height:44px;padding-top:10px}
.welcome{padding:24px 0 36px}.welcome>p{font-size:12px;color:var(--muted)}.welcome h2{font-size:25px;line-height:1.6;color:var(--deep);margin:12px 0}
#composer{position:fixed;bottom:0;left:224px;right:0;background:rgba(244,246,243,.98);padding:10px 24px 18px;border-top:1px solid var(--line);z-index:8}
#form{max-width:680px;margin:auto;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:10px;padding:8px;background:#fff;border:1px solid #c8d4ca;border-radius:14px}
#input{border:0;resize:none;min-height:64px;max-height:160px;padding:8px;background:transparent}#send{margin:0;min-height:44px;padding:8px 16px}#new-messages{display:block;margin:0 auto 8px;border:1px solid var(--line);border-radius:20px;background:#fff;color:var(--green);min-height:44px;padding:6px 14px}
#timeline-status{font-size:12px;color:var(--muted);white-space:pre-wrap}#timeline-status:empty{display:none}#retry-timeline{background:white;border:1px solid var(--line);border-radius:8px;min-height:44px;color:var(--green);margin-bottom:12px}
.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.real-modal.draft-editor{width:min(520px,calc(100vw - 32px))!important;margin:0!important}.draft-editor label{min-width:0}.draft-editor input,.draft-editor select{min-width:0}.real-modal#record-detail{width:min(460px,calc(100vw - 32px))!important;padding-bottom:20px!important}#record-detail h3{font-size:14px;overflow-wrap:anywhere;margin:8px 0}#record-detail .item-tags{margin-bottom:12px}.dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.dialog-heading h2{margin:0}.real-modal#record-detail button{background:white;color:var(--green)}.stale-editor{color:var(--risk-text)!important}
@media(max-width:959px){#composer{left:0;bottom:calc(64px + env(safe-area-inset-bottom));padding:8px 16px 10px}.assistant-content{padding-bottom:210px!important}.assistant-content .message{width:88%}.assistant-content .message.user{max-width:86%}.welcome h2{font-size:23px}}
@media(max-width:360px){.assistant-content .message{padding:10px;width:94%}.card-actions{gap:3px}.assistant-content .card-actions button{padding:6px 8px}#composer{padding-left:12px;padding-right:12px}}

/* D visual refinement: compact paragraphs and one in-card operation badge. */
.message-copy{white-space:normal}.message-copy>p{margin:0;white-space:pre-wrap;line-height:1.7}.message-copy>p+p{margin-top:10px}
.content-card{position:relative}.content-card:has(.proposal-badge){padding-top:36px}.proposal-badge{position:absolute;right:10px;top:9px;font-size:11px;line-height:1.5;padding:2px 7px;border-radius:5px;background:var(--soft);color:var(--green)}
.proposal-card[data-readonly=true] .content-card{background:#f8faf8}.message[data-history=true] .proposal-badge{background:#eef1ee;color:var(--muted)}
.card-actions{margin-top:12px;padding-top:8px;gap:8px}.assistant-content .card-actions button{min-height:44px;padding:4px 9px;font-size:12px;background:linear-gradient(transparent 6px,#e8f2ed 6px,#e8f2ed calc(100% - 6px),transparent calc(100% - 6px))}.assistant-content .card-actions button:last-child{background:linear-gradient(transparent 6px,var(--green) 6px,var(--green) calc(100% - 6px),transparent calc(100% - 6px))}

.assistant-content .card-actions button:last-child{background:linear-gradient(transparent 6px,#e8f2ed 6px,#e8f2ed calc(100% - 6px),transparent calc(100% - 6px));color:var(--green)}.assistant-content .card-actions button.primary-action{background:linear-gradient(transparent 6px,var(--green) 6px,var(--green) calc(100% - 6px),transparent calc(100% - 6px));color:white}

/* Creation only: stable item shells, safe historical buttons and batch ownership. */
.creation-item{background:white!important;padding:10px;border-color:#dce5df}
.standard-item .content-heading{display:grid;gap:0}
.creation-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}
.creation-heading .record-title{flex:1;max-width:none}
.creation-state{flex:none;font-size:11px;font-weight:400;color:#56776a;white-space:nowrap;background:none;padding:0}
.creation-state::before{content:'○';margin-right:4px}
.creation-state.result-badge{color:var(--green)}.creation-state.result-badge::before{content:'✓'}
.standard-item .item-tags{margin:0 0 10px}
.creation-batch{padding:10px;background:#f8faf8;border-radius:12px}
.creation-group-label{margin:0 0 6px;font-size:11px;color:var(--muted)}
.creation-batch>.creation-item{margin-top:8px}
.creation-proposal .card-actions{border:0;margin-top:6px;padding-top:0;gap:8px}
.creation-batch>.card-actions{margin-top:10px}
.standard-item[data-inactive=true]{border-color:#e8ede9;color:#56665d}
.standard-item[data-inactive=true] .record-title{color:#617167}
.standard-item[data-inactive=true] .creation-state{color:#78837c}
.creation-item.excluded .creation-state::before{content:'−'}
.assistant-content .creation-proposal .card-actions .historical-button{opacity:1;cursor:not-allowed;color:#849087;background:linear-gradient(transparent 6px,#f1f4f1 6px,#f1f4f1 calc(100% - 6px),transparent calc(100% - 6px))}
.creation-history-note{font-size:11px;color:#78837c;margin:6px 0 0;line-height:1.6}
.standard-item .content-heading{grid-template-columns:minmax(0,1fr)}

.creation-proposal .creation-history-note{margin-top:6px}.creation-batch>.creation-group-label{margin-bottom:6px}

/* Shared detail proposals/results retain their own comparison and risk meaning. */
.standard-item{background:white!important;padding:10px;border-color:#dce5df}
.standard-proposal .card-actions{border:0;margin-top:6px;padding-top:0;gap:8px}
.standard-proposal .history-note{font-size:11px;color:#78837c;margin-top:6px;line-height:1.6}
.assistant-content .standard-proposal .card-actions .historical-button{opacity:1;cursor:not-allowed;color:#849087;background:linear-gradient(transparent 6px,#f1f4f1 6px,#f1f4f1 calc(100% - 6px),transparent calc(100% - 6px))}
.assistant-content .standard-proposal .card-actions .danger-action{color:var(--risk-text);background:linear-gradient(transparent 6px,var(--risk-bg) 6px,var(--risk-bg) calc(100% - 6px),transparent calc(100% - 6px))}
.risk-review{padding:10px;border:1px solid var(--risk-border);border-radius:12px;background:#fffafa}
.risk-review[data-risk=false]{border-color:var(--line);background:#f8faf8}
.risk-review>.risk-summary{font-size:12px;color:var(--risk-text);margin-bottom:8px}
.risk-review[data-risk=false]>.risk-summary{color:var(--muted)}
.risk-review .conflict-comparison{background:white;color:#5d6c62}
.type-change{font-size:12px;margin:4px 0 8px}
.standard-item[data-result-kind=delete] .result-badge{color:var(--risk-text)}

/* Query and overview retain lists; notices group only the same persisted message. */
.list-heading{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:4px 10px;margin-bottom:6px}
.assistant-content .list-heading h2{margin:0;font-size:13px}
.list-meta{font-size:11px;color:var(--muted)}
.record-list-group{margin-top:10px}
.assistant-content .record-list-group h3{margin:0 0 4px;color:#536d5c}
.assistant-content .record-list .query-row{border-bottom:0;padding:8px 0}
.assistant-content .record-list-group>a{padding-top:6px}
.assistant-content .list-empty{margin-top:6px;font-size:12px;color:var(--muted)}
.notification-group{margin-top:10px;padding:10px;background:#f8faf8;border-radius:12px}
.creation-state.record-state{color:var(--muted)}.creation-state.record-state::before{content:none}

body[data-page=assistant]{overflow-anchor:none}
.request-progress{max-width:680px;padding:10px 14px;margin:12px 0;font-size:13px;color:var(--muted);background:#edf3ef;border-radius:12px}
.request-progress:not([hidden]){display:flex;align-items:center;gap:8px}
.request-progress::before{content:'';width:7px;height:7px;flex:none;border-radius:50%;background:var(--green);animation:chat-pulse 1s ease-in-out infinite alternate}
@keyframes chat-pulse{to{opacity:.3}}
@media(prefers-reduced-motion:reduce){.request-progress::before{animation:none}}
