:root {color-scheme:dark;--line:#373739;--muted:#aaaab0;--ink:#93afff;background:#151517;font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif}
* {box-sizing:border-box}
[hidden] {display:none!important}
body {margin:0;background:#151517;color:#f5f5f6;height:100dvh;overflow:hidden}
button,input,textarea,select {font:inherit}
button {cursor:pointer}
button:disabled {cursor:default}
button:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible {outline:2px solid #91adff;outline-offset:2px}
.auth-screen {height:100dvh;overflow:auto;display:grid;place-items:center;padding:1rem}
.auth-form {width:min(100%,23rem);display:grid;gap:.85rem}
.brand {font-size:1.15rem;font-weight:650}
.auth-form h1,.topbar h1 {font-size:1.25rem}
.auth-form label,.page label {display:grid;gap:.35rem;margin:.55rem 0}
.auth-form input,.page :is(input:not([type=checkbox]),textarea,select) {color:inherit;background:#252527;border:1px solid var(--line);border-radius:9px;width:100%;padding:.6rem .75rem}
.page textarea {resize:vertical}
.auth-form button,.page button,.account button,.phone-buttons button,.compact button {background:#303034;color:inherit;border:1px solid var(--line);border-radius:9px;padding:.5rem .85rem}
.auth-form .primary,.page .primary {background:#426bd0;color:white}
.link {color:var(--ink)}
.shell {display:flex;height:100dvh;position:relative}
nav {display:grid;gap:.3rem}
nav button,#menu {display:flex;align-items:center;text-align:left;background:transparent;color:inherit;border:0;border-radius:8px;padding:.65rem .8rem}
nav button:hover,#menu:hover,nav button[aria-current]{background:#353538}
.account {padding:.8rem 0;margin-top:auto;display:flex;align-items:center;gap:.5rem;justify-content:space-between}
main {display:flex;flex:1;flex-direction:column;min-width:0;min-height:0;overflow:auto}
.topbar {display:flex;align-items:center;flex-shrink:0;gap:.55rem;min-height:56px;padding:.4rem 1rem}
.topbar h1 {margin:0}
.shell[data-pane=chat] .topbar {min-height:60px}
.shell[data-pane=chat] .topbar h1 {display:none}
#portal-synthetic {margin-left:auto;color:var(--muted);font-size:.8rem}
#portal-status:not(:empty){padding:.35rem 1rem;align-self:center;color:var(--muted);font-size:.9rem}
#portal-status[data-error=true],#auth-status{color:#efada0}
.chat-pane {flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;position:relative;isolation:isolate}
#pane-chat {width:100%;color:var(--dsw-alias-label-primary);font-family:var(--dsw-font-family)}
.shell,body {background:var(--dsw-alias-bg-base)}
.shell main {position:relative}
@media(min-width:768px){
  .shell[data-pane=chat]:has(#chat-session[hidden]) .topbar {position:absolute;z-index:2;top:0}
  .shell:has(#portal-nav:not([hidden])) #menu {visibility:hidden}
}
#portal-status:not(:empty),#legacy-demo:not([hidden]) {z-index:2;background:var(--dsw-alias-bg-base)}
#legacy-demo {margin:.35rem auto;padding:.5rem 1rem;font-size:.9rem}
#legacy-demo a {color:var(--ink)}
.shell[data-pane=chat]:has(#legacy-demo:not([hidden])) .topbar {position:static}
.revoke-turn {background:none;border:0;color:var(--dsw-alias-label-tertiary);font:var(--dsw-font-xs-13);padding:2px 4px}
[data-message-body],.note-body {white-space:pre-wrap;overflow-wrap:anywhere}
@media(min-width:768px){.home-caveat{display:none}}
.page,.compact {width:min(100%,58rem);margin:0 auto;padding:1rem clamp(1rem,4vw,3rem) 2rem}
.page h2,.page h3 {font-weight:600}
.page p,.page li {overflow-wrap:anywhere}
.page button {margin:.15rem .3rem .15rem 0}
.page button:hover:not(:disabled),.account button:hover{background:#404045}
.page button:disabled{opacity:.55}
.page fieldset,.page article {border:0;border-top:1px solid var(--line);margin:.8rem 0;padding:.7rem 0}
.page label:has(input[type=checkbox]){display:flex;align-items:baseline;gap:.5rem}
summary {cursor:pointer}
.shell[data-pane=profile] .chat-pane {height:clamp(18rem,50dvh,38rem);flex:0 0 auto;margin-top:1rem}
.shell[data-pane=profile] #portal-opening{display:none}
.shell[data-pane=profile] #welcome{margin:0 auto;padding:0 1rem;flex:none}
#phone {position:fixed;inset:0;z-index:4;display:grid;place-items:center;background:#0009;padding:1rem}
.phone-card {width:min(100%,340px);background:#2d2d2f;border:1px solid #444447;border-radius:24px;padding:1.5rem;box-shadow:0 16px 60px #0005}
.phone-header,.phone-buttons {display:flex;align-items:center;gap:1rem}
.phone-avatar{display:grid;place-items:center;width:58px;height:58px;color:#fff;background:#586fc0;border-radius:50%;font-size:1.3rem}
#phone-time,#phone-status {color:#c7c7cc;font-variant-numeric:tabular-nums}
.phone-buttons {gap:.5rem}
.phone-buttons button {flex:1;border:0;border-radius:2rem;height:44px}
#phone-mute {background:#49494d}
#phone-mute[aria-pressed=true] {background:#eee;color:#222}
#phone-end {background:#d72f31;color:white}
.sr {position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%)}
@media(max-width:767px){#portal-nav{position:absolute;inset:0 auto 0 0;z-index:3;width:230px;box-shadow:12px 0 40px #0005}.shell:has(aside:not([hidden])) main{margin-left:0}.topbar{padding:.4rem .65rem}.phone-card{align-self:start;margin-top:10dvh}}

/* Text is an input mode of this same call; the regular chat layout stays unchanged. */
#phone-reply{white-space:pre-wrap;overflow:auto;max-height:20dvh;margin:.65rem 0;color:inherit}
#phone-text-form{display:grid;gap:.45rem;margin:.65rem 0 1rem}
#phone-text-form textarea{width:100%;resize:vertical;background:#202022;color:inherit;border:1px solid #777;border-radius:9px;padding:.65rem;font:inherit}
#phone-text-form button{justify-self:end;color:inherit;background:#49494d;border:1px solid #6d6d72;border-radius:9px;padding:.45rem .85rem}
#phone button:disabled{opacity:.5;cursor:default}
.phone-card{max-height:calc(100dvh - 2rem);overflow:auto}
@media(max-width:767px){.phone-card{margin-top:min(5dvh,2rem);max-height:calc(100dvh - 6rem)}}

.portal-conversations{min-height:0;display:flex;flex-direction:column;gap:.4rem;margin-top:.85rem;border-top:1px solid var(--line);padding-top:.65rem}
#conversation-list{display:flex;flex-direction:column;gap:.15rem;overflow:auto}
.portal-conversations button{width:100%;min-height:36px;border:0;border-radius:8px;background:transparent;color:inherit;text-align:left;padding:.35rem .65rem;font-size:.875rem}
.portal-conversations button:hover:not(:disabled),.portal-conversations button[aria-current=true]{background:#353538}
.portal-conversations button:disabled{opacity:.56}
/* Editorial list and version detail: a quiet workspace, not an analytics dashboard. */
.editorial-overview,.editorial-detail{padding-block:.35rem}
.editorial-overview>button{margin-bottom:1.15rem}
.editorial-resume{display:flex;align-items:center;justify-content:space-between;gap:14px;border:1px solid var(--line);border-left:3px solid #63947f;border-radius:7px;padding:.8rem 1rem;margin-bottom:1.25rem}
.editorial-resume small,.editorial-resume strong{display:block}.editorial-resume small,.editorial-version{color:#bcbfbb;font-size:.84rem}
.editorial-controls,.editorial-filters{display:flex;align-items:center;flex-wrap:wrap;gap:.25rem}
.editorial-controls{justify-content:space-between;margin-bottom:.5rem}.editorial-controls input{width:min(100%,14rem)!important}
.editorial-filters button{background:transparent}.editorial-filters button[aria-pressed=true]{background:#393a39;font-weight:650}
.page button.editorial-row{margin:0;display:grid;width:100%;grid-template-columns:minmax(0,1fr) auto auto;gap:.8rem;align-items:center;text-align:left;border:0;border-top:1px solid var(--line);border-radius:0;padding:.85rem .35rem;background:transparent}
.page button.editorial-row:hover{background:#282a28}.editorial-row strong{overflow-wrap:anywhere}
.editorial-state{padding:.12rem .35rem;border-radius:4px;background:#383936;white-space:nowrap;font-size:.82rem}
.editorial-state[data-state=review]{color:#f3d19a;background:#49391f}.editorial-state[data-state=published],.editorial-state[data-state=adopted]{color:#b6e3cd;background:#263d32}
.editorial-columns{display:grid;grid-template-columns:minmax(0,1fr) minmax(12rem,30%);gap:1.4rem;margin-top:.7rem}
.editorial-sources{border-left:1px solid var(--line);padding-inline-start:1rem}.editorial-sources h3{margin:0 0 .5rem}
.editorial-sources button{max-width:100%;overflow-wrap:anywhere}.editorial-detail>button{background:transparent}
@media(max-width:660px){.editorial-columns{grid-template-columns:1fr}.editorial-sources{border:0;border-top:1px solid var(--line);padding:1rem 0 0}.editorial-controls input{width:100%!important}.editorial-resume{padding:.55rem .65rem}}

/* Editorial panes inherit the same dark shell and shared controls as other tabs. */
.page button.editorial-new,.page button.primary {background:#426bd0;color:#fff}
.page :is(button.primary,button.editorial-new):hover:not(:disabled){background:#365cb8;color:#fff}
@media(max-width:450px){
  .shell[data-pane=notes] .page button.editorial-row{grid-template-columns:minmax(0,1fr) auto;gap:.35rem .65rem}
  .shell[data-pane=notes] .editorial-version{grid-column:2;text-align:right}
  .shell[data-pane=notes] .editorial-resume>button{flex:none}
}
