:root {
  color-scheme: light;
  /* Clawde brand palette — see Clawde-brand-kit-FINAL/color-scheme/palette.json */
  --coral: #FF7958;
  --cream: #FFEAC2;
  --wheat: #D0AE78;
  --ink-brand: #171513;
  --ivory: #F8F3E9;

  --side: #F1EADC;
  --main: var(--ivory);
  --ink: var(--ink-brand);
  --muted: #8A7F72;
  --faint: #B3A795;
  --line: rgba(23, 21, 19, .09);
  --hover: rgba(23, 21, 19, .05);
  --active: rgba(23, 21, 19, .08);
  --composer: #fff;
  --shadow: 0 10px 32px rgba(23, 21, 19, .08);
  --send: var(--coral);
  --send-ink: var(--ink-brand);
  --danger: #c43b55;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --coral: #FF7958;
  --cream: #FFEAC2;
  --wheat: #D0AE78;
  --ink-brand: #171513;
  --ivory: #F8F3E9;

  --side: #171513;
  --main: #0B0A09;
  --ink: #F3ECDF;
  --muted: #9C9284;
  --faint: #6E655A;
  --line: rgba(255, 255, 255, .08);
  --hover: rgba(255, 255, 255, .06);
  --active: rgba(255, 255, 255, .09);
  --composer: #1D1A17;
  --shadow: 0 12px 36px rgba(0, 0, 0, .5);
  --send: var(--coral);
  --send-ink: var(--ink-brand);
  --danger: #ff8b9a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--main);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.app { display: flex; min-height: 100%; }
.side {
  position: relative;
  z-index: 31;
  width: 248px;
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--side);
  border-right: 1px solid var(--line);
  padding: 14px 10px 10px;
  transition: width .16s ease;
}
.brand-row { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.brand { display: flex; align-items: center; height: 44px; padding: 0 8px; min-width: 0; flex: 1; }
.brand img { height: 40px; width: auto; display: none; }
.brand .mark { width: 20px; height: 20px; }
html[data-theme="light"] .brand .word.on-light,
html[data-theme="dark"] .brand .word.on-dark,
html[data-theme="light"] .hero .on-light,
html[data-theme="dark"] .hero .on-dark { display: block; }
.fold { width: 32px; flex: none; justify-content: center; padding: 0; }
@media (min-width: 801px) {
  .side { width: 64px; padding-left: 8px; padding-right: 8px; background: transparent; border-right: 0; }
  .brand-row { flex-direction: column; }
  .brand { flex: none; justify-content: center; height: 32px; padding: 0; }
  .brand .word { display: none !important; }
  html[data-theme="light"] .brand .mark.on-light,
  html[data-theme="dark"] .brand .mark.on-dark { display: block; }
  .nav span, .who { display: none; }
  .nav, .account { justify-content: center; padding: 0; gap: 0; }
}
.side nav { display: flex; flex-direction: column; gap: 2px; }
.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
}
.nav svg { flex: none; width: 18px; height: 18px; }
.nav:hover { background: var(--hover); }
.nav.active { background: var(--active); }
.nav span { font-size: 13.5px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.account { display: flex; align-items: center; gap: 8px; min-width: 0; width: 100%; height: 36px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.account-menu {
  position: fixed; z-index: 1000; width: 280px; padding: 6px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--composer); box-shadow: 0 12px 40px rgba(0, 0, 0, .28);
}
.account-menu .head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 6px; }
.account-menu .head .avatar { width: 28px; height: 28px; font-size: 13px; }
.account-menu .name { font-size: 13px; font-weight: 600; }
.account-menu .sub, .account-menu .usage { color: var(--muted); font-size: 12px; }
.account-menu .usage-title { padding: 2px 8px 0; color: var(--muted); font-size: 11px; }
.account-menu .usage { display: flex; flex-direction: column; gap: 4px; padding: 4px 8px 8px; }
.account-menu .menu-line { display: flex; justify-content: space-between; gap: 12px; }
.account-menu .menu-line b { color: var(--ink); font-weight: 600; }
.account-menu .sep { height: 1px; margin: 4px 6px; background: var(--line); }
.account-menu .item {
  display: flex; align-items: center; width: 100%; height: 32px; padding: 0 8px;
  border: 0; border-radius: 8px; background: transparent; color: inherit;
  font: inherit; text-align: left; text-decoration: none;
}
.account-menu .item:hover { background: var(--hover); }
.account-menu .item.danger { color: var(--danger); }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
a.btn { display: inline-flex; align-items: center; text-decoration: none; }
.avatar {
  width: 20px; height: 20px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); color: var(--main);
  font-size: 11px; font-weight: 600; line-height: 1;
}
.who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
html.embed .side { display: none; }
.stage { flex: 1; min-width: 0; overflow: auto; background: var(--main); }
.page { width: min(1080px, calc(100% - 56px)); margin: 32px auto 48px; }
.page h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.03em; }
.lead { margin: 6px 0 18px; color: var(--muted); }
.tabs { display: flex; gap: 4px; margin: 0 0 18px; flex-wrap: wrap; }
.tabs button {
  height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent;
}
.tabs button.active, .tabs button:hover { background: var(--active); }
.panel, .card, .wrap, article {
  background: var(--composer);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.panel { padding: 18px 18px 16px; margin: 0 0 16px; }
.card { padding: 16px 18px; }
.card span, .label, .note, .stats, .empty, .sub { color: var(--muted); }
.card b, .value { display: block; margin-top: 4px; font-size: 22px; font-weight: 620; letter-spacing: -.03em; }
.grid, .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 0 0 16px; }
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
article { overflow: hidden; }
.results article.on { box-shadow: inset 0 0 0 2px var(--ink); }
article video, article img { display: block; width: 100%; max-height: 420px; object-fit: contain; background: #0e0e0e; }
.results article img, .results article video { cursor: pointer; }
.meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 10px 12px 12px; color: var(--muted); font-size: 12px; }
.meta span { min-width: 0; overflow-wrap: anywhere; }
.meta .btn { height: 28px; padding: 0 10px; flex: none; }
.meta input[type="checkbox"] { width: 16px; height: 16px; margin: 4px 0 0; padding: 0; flex: none; }
.tools { display: flex; align-items: center; gap: 8px; }
.tools .stats { white-space: nowrap; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.filters input[type="search"] { width: min(260px, 100%); }
.filters select { width: auto; }
.seg { display: flex; gap: 6px; }
.seg button {
  height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
}
.seg button.on { background: var(--send); color: var(--send-ink); border-color: transparent; }
.btn.star.on { background: var(--send); color: var(--send-ink); border-color: transparent; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
h2 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.table-wrap, .wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
th { color: var(--muted); font-weight: 520; }
tr:last-child td { border-bottom: 0; }
.field { margin: 0 0 12px; }
label { display: block; margin: 0 0 6px; color: var(--muted); font-size: 13px; }
input, select {
  height: 38px; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--line);
  background: transparent; color: var(--ink);
}
.field input, .field select, .limits-grid input, .limits-grid select { width: 100%; display: block; }
#create-form { display: flex; gap: 8px; align-items: center; }
#create-form input { width: 220px; }
input:focus, select:focus { outline: none; border-color: var(--ink); }
button.primary, .btn {
  height: 36px; padding: 0 14px; border: 0; border-radius: 10px;
  background: var(--send); color: var(--send-ink);
}
.btn.secondary { background: var(--hover); color: var(--ink); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--line); }
button.primary { width: 100%; margin-top: 4px; }
button.primary:disabled, .btn:disabled { opacity: .45; cursor: default; }
.err { min-height: 18px; margin: 0 0 8px; color: var(--danger); font-size: 13px; }
.foot { margin: 14px 0 0; text-align: center; color: var(--faint); font-size: 13px; }
.foot a { color: var(--muted); text-decoration: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
code { font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--hover); padding: 2px 6px; border-radius: 6px; }
pre {
  padding: 14px; border-radius: 12px; overflow: auto;
  background: #161616; color: #e8e8e8;
  font: 12px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.badge { padding: 2px 8px; border-radius: 999px; background: var(--hover); color: var(--ink); font-size: 12px; }
.secret { margin: 12px 0; padding: 14px; border-radius: 12px; background: var(--hover); }
.secret code { display: block; margin: 8px 0; white-space: normal; overflow-wrap: anywhere; }
.flow { height: 4px; margin-top: 10px; border-radius: 4px; background: var(--hover); overflow: hidden; }
.flow i { display: block; height: 100%; background: var(--ink); }
.limits-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 12px 0; }
#notice {
  position: fixed; right: 20px; bottom: 20px; z-index: 5;
  max-width: min(420px, calc(100% - 40px));
  padding: 10px 14px; border-radius: 12px;
  background: var(--send); color: var(--send-ink);
}
.gate { min-height: 100%; display: grid; place-items: center; padding: 32px 16px; }
.gate-stack { width: min(420px, 100%); }
.hero { aspect-ratio: 3; margin: 0 0 22px; }
.hero img { width: 100%; height: 100%; display: none; object-fit: contain; }
.gate .panel { padding: 8px 8px 14px; }
.gate h1 { margin: 8px 8px 0; font-size: 20px; }
.gate .lead { margin: 4px 8px 14px; }
.gate .field, .gate .err, .gate button.primary { margin-left: 8px; margin-right: 8px; }
.gate button.primary { width: calc(100% - 16px); }
.theme-float {
  position: fixed; top: 16px; right: 16px;
  height: 32px; padding: 0 12px; border: 0; border-radius: 8px;
  background: var(--hover); color: var(--ink);
}
.link { color: var(--ink); }
.head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
@media (max-width: 800px) {
  .app { flex-direction: column; }
  .side { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); }
  .side nav, .side-foot { flex-direction: row; overflow: auto; }
  .side-foot { margin-top: 8px; }
  .page { width: min(100% - 28px, 1080px); margin-top: 20px; }
  .two { grid-template-columns: 1fr; }
}

/* Opted-in workspaces share a compact tablet rail. Keeping navigation beside
   content avoids the full-height sidebar consuming a column layout's height.
   Phones retain their drawer; wider screens retain their existing layouts. */
@media (min-width: 601px) and (max-width: 800px) {
  html body > .app[data-tablet-rail] { flex-direction: row; }
  html body > .app[data-tablet-rail] > .side {
    width: 64px;
    flex: 0 0 64px;
    height: var(--app-height, 100dvh);
    max-height: var(--app-height, 100dvh);
    min-height: 0;
    border-bottom: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .app[data-tablet-rail] > .side .brand-row { flex-direction: column; }
  .app[data-tablet-rail] > .side .brand { flex: none; justify-content: center; height: 32px; padding: 0; }
  .app[data-tablet-rail] > .side .brand .word { display: none !important; }
  html[data-theme="light"] .app[data-tablet-rail] > .side .brand .mark.on-light,
  html[data-theme="dark"] .app[data-tablet-rail] > .side .brand .mark.on-dark { display: block; }
  .app[data-tablet-rail] > .side .nav span,
  .app[data-tablet-rail] > .side .who { display: none; }
  .app[data-tablet-rail] > .side .nav,
  .app[data-tablet-rail] > .side .account { justify-content: center; padding: 0; gap: 0; }
  html body > .app[data-tablet-rail] > .side nav,
  html body > .app[data-tablet-rail] > .side .side-foot { flex-direction: column; }
  html body > .app[data-tablet-rail] > .side .side-foot { margin-top: auto; }
  /* The knowledge workspace has an existing 8px margin on both edges. */
  html body.knowledge-page > .app[data-tablet-rail] > .stage { height: calc(var(--app-height, 100dvh) - 16px); }
}

/* Shared popup motion: every dialog fades and rises in the same way. */
@keyframes popup-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes popup-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
dialog[open] { animation: popup-in .16s ease-out; }
dialog[open]::backdrop { animation: popup-backdrop-in .16s ease-out; }
@media (prefers-reduced-motion: reduce) { dialog[open], dialog[open]::backdrop { animation: none; } }

/* Hub reserves this launcher slot, including the home iframe at phone widths. */
html.unified-chat-home[data-pane="open"] body:has(#pane[data-route="/hub"]) .browser-launch-float {
  display:grid!important;right:16px!important;top:16px!important;width:32px!important;height:32px!important;
}
@media(max-width:600px){
  /* Creation tabs also share the phone's fixed navigation row. */
  html body.creation-page .creation-header{padding-top:64px}
}

/* Shared model picker: one stylesheet for both pages. */
.composer-menu, .agent-model-settings > div { --floating-height: min(360px, calc(100dvh - 16px)); }
.agent-model-settings{position:relative;min-width:0}
html body .agent-model-settings{flex:0 1 auto;min-width:0;margin:0 4px 0 auto}
.agent-model-settings summary{display:flex;align-items:center;gap:6px;cursor:pointer;list-style:none;padding:8px;border-radius:999px;color:var(--muted);font-size:13px}
.agent-model-settings summary::-webkit-details-marker{display:none}
.agent-model-settings summary::after{content:"";flex:none;width:6px;height:6px;margin:-3px 0 0 2px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg);transition:transform .15s ease}
.agent-model-settings[open] summary::after{margin-top:3px;transform:rotate(-135deg)}
.agent-model-settings summary:hover{background:var(--hover)}
.agent-model-settings summary .model{display:inline-flex;align-items:center;gap:6px;max-width:180px;overflow:hidden;white-space:nowrap}
.agent-model-tag{flex:none;padding:3px 7px;border-radius:999px;background:var(--hover);color:var(--muted);font-size:11px;font-weight:500;line-height:1}
.agent-model-settings>div{position:absolute;bottom:calc(100% + 10px);right:0;left:auto;z-index:30;width:288px;max-width:calc(100vw - 32px);padding:6px;border:1px solid var(--line);border-radius:16px;background:var(--composer);box-shadow:var(--shadow)}
.agent-model-title{display:flex;align-items:baseline;justify-content:space-between;padding:8px 10px 6px;color:var(--ink);font-size:13px;font-weight:600}
.agent-model-title small{color:var(--muted);font-size:11px;font-weight:400}
.agent-model-group-title{padding:8px 10px 4px;font-size:11px;color:var(--muted)}
.agent-model-option{display:flex;align-items:center;gap:8px;position:relative;width:100%;min-height:40px;padding:9px 30px 9px 10px;border:0;border-radius:10px;background:transparent;color:var(--ink);font:inherit;font-size:13px;text-align:left;cursor:pointer;overflow-wrap:anywhere}
.agent-model-option i{width:7px;height:7px;border-radius:50%;background:#8b909a;flex:none}
.agent-model-option[data-online=true] i{background:#3dd68c;box-shadow:0 0 0 3px color-mix(in srgb,#3dd68c 28%,transparent)}
.agent-model-name{flex:1;min-width:0}
.agent-model-state{display:none;flex:none;color:var(--muted);font-size:11px;font-style:normal}
.agent-model-option[aria-disabled=true] .agent-model-state{display:inline}
.agent-model-option[aria-disabled=true]{color:var(--muted);opacity:.55;cursor:default}
.agent-model-option:hover,.agent-model-option[aria-selected=true]{background:var(--hover)}
.agent-model-option[aria-disabled=true]:hover{background:transparent}
.agent-model-option[aria-selected=true]::after{content:"✓";position:absolute;right:11px;color:var(--accent)}
#agent-model-options{display:flex;flex-direction:column;gap:2px}
#agent-model-options>div>p{margin:2px 10px 8px;color:var(--muted);font-size:12px}
.agent-model-foot{margin:6px 4px 2px;padding:8px 6px 2px;border-top:1px solid var(--line)}
.agent-model-foot p{margin:0 0 4px;color:var(--muted);font-size:12px;line-height:1.6}
.agent-model-foot a{display:block;padding:8px 6px;border-radius:8px;color:var(--accent);font-size:13px;text-decoration:none}
.agent-model-foot a:hover{background:var(--hover)}

/* Shared composer controls; intentional conversation UI alignment, 2026-11-11. */
  .composer-menu { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 6; width: 248px; padding: 8px; border: 1px solid var(--line, rgba(0,0,0,.08)); border-radius: 14px; background: var(--composer, #fff); box-shadow: 0 12px 32px rgba(0,0,0,.12); }
  .composer-menu[hidden] { display: none; }
  .composer-menu > button { display: flex; width: 100%; height: 32px; margin: 0; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
  .composer-menu > button:hover { background: var(--hover); }
  .composer-menu { width: 288px; padding: 6px; border-radius: 16px; }
  .composer-menu > button.ask-item, .ask-link .ask-item { display: flex; align-items: center; gap: 12px; width: 100%; height: auto; min-height: 52px; margin: 0; padding: 8px 10px; border: 0; border-radius: 10px; box-sizing: border-box; text-align: left; }
  .ask-item svg { flex: none; width: 18px; height: 18px; color: var(--muted); }
  .ask-item span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .ask-item b { font-size: 13px; font-weight: 600; line-height: 1.3; }
  .ask-item small { color: var(--muted); font-size: 12px; line-height: 1.4; }
  .ask-item-static { cursor: default; }
  .ask-link { display: block; margin: 2px 0 0; }
  .ask-link-row { display: flex; gap: 6px; padding: 0 10px 6px 40px; }
  .ask-link-row input { flex: 1; min-width: 0; height: 34px; border: 1px solid var(--line, rgba(0,0,0,.08)); border-radius: 9px; background: var(--main, transparent); color: inherit; font: inherit; font-size: 13px; padding: 0 10px; }
  .ask-link-row input:focus { outline: none; border-color: var(--send); }
  .ask-link-row button { flex: none; height: 34px; padding: 0 14px; border: 0; border-radius: 9px; background: var(--send); color: var(--send-ink, #fff); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
  .ask-link-row button:hover { filter: brightness(.95); }
  .ask-hint { margin: 4px 10px 4px; padding-top: 8px; border-top: 1px solid var(--line, rgba(0,0,0,.08)); color: var(--muted); font-size: 12px; }

html body .composer-menu { display:block; width:288px; max-width:calc(100vw - 32px); padding:6px; border-radius:16px; gap:normal; }
html body .composer-menu[hidden] { display:none; }
html body .composer-menu > .ask-item { display:flex; align-items:center; gap:12px; width:100%; min-height:52px; height:auto; padding:8px 10px; border:0; border-radius:10px; background:transparent; color:inherit; font:inherit; text-align:left; cursor:pointer; }
html body .composer-menu .ask-link-row button { border:0; border-radius:9px; background:var(--send); color:var(--send-ink,#fff); padding:0 14px; }
html body .composer-menu .ask-link-row input { height:34px; box-sizing:border-box; }
html body .composer-menu .agent-model-settings { display:block; flex:none; width:100%; margin:0 0 4px; padding-bottom:4px; border-bottom:1px solid var(--line); }
html body .composer-menu .agent-model-settings summary { justify-content:space-between; min-height:44px; padding:8px 10px; border-radius:10px; color:var(--ink); font-size:13px; }
html body .composer-menu .agent-model-settings summary::before { content:"模型"; margin-right:auto; color:var(--muted); }
html body .composer-menu .agent-model-settings summary .model { max-width:none; font-size:12px; }
html body .composer-menu :is(button,summary,input):focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
@media(max-width:600px) {
 /* Phones: a compact sheet — titles only, so the whole menu fits above the composer. */
 .composer-menu, .agent-model-settings > div { width:min(272px, calc(100vw - 32px)); }
 html body .composer-menu { width:min(272px, calc(100vw - 32px)); }
 html body .composer-menu.floating-menu .agent-model-settings > div { width:min(272px, calc(100vw - 32px)); padding:0; border:0; box-shadow:none; color:var(--ink); }
 html body .composer-menu :is(button,summary,input) { min-height:44px; }
 html body .composer-menu .ask-item small { display:none; }
 html body .composer-menu > .ask-item, html body .composer-menu .ask-link .ask-item { min-height:44px; padding:6px 10px; }
 html body .composer-menu .ask-link .ask-item-static { position:absolute; width:1px; height:1px; min-height:0; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
 html body .composer-menu .ask-link-row { padding:6px 10px; }
 html body .agent-model-option { flex-wrap:wrap; }
 html body .agent-model-state { white-space:normal; }
}

html body .bar > .agent-model-settings { margin-left:auto; }
html body .bar .bar-left { flex:none; }
html body .bar .composer-actions { margin-left:0; }
html body .composer-menu .mode-row { display:flex; flex-wrap:wrap; gap:6px; padding:6px 10px; margin:0; }

html body :is(form.composer, form.ask) button.composer-plus { width:36px; height:36px; min-width:36px; min-height:36px; padding:0; border:1px solid var(--line); border-radius:50%; background:transparent!important; color:var(--ink); display:grid; place-items:center; cursor:pointer; }
html body :is(form.composer, form.ask) button.composer-plus:hover, html body :is(form.composer, form.ask) button.composer-plus[aria-expanded="true"] { background:var(--hover)!important; }
@media(max-width:600px) { html body :is(form.composer, form.ask) button.composer-plus { width:44px!important; height:44px!important; min-width:44px; min-height:44px; border:0!important; } }

/* macOS overlay scrollbars take no layout width (scrollbar-gutter cannot reserve it) and widen
   to ~15px on hover, covering the right edge of messages; keep the thread content clear of them. */
@media (min-width: 601px) {
  html body .thread, html body.agent-workspace .work.is-chat .thread { padding-right: 16px; }
}

/* Thinking strength next to the 思考 toggle in the composer menu. */
html body .composer-menu .mode-row .think-effort { min-height:32px; padding:0 8px; border:1px solid var(--line); border-radius:999px; background:transparent; color:var(--ink); font:inherit; font-size:13px; }
html body .composer-menu .mode-row .think-effort[hidden] { display:none; }

/* ICP filing number at the foot of the account menu. */
.account-menu .icp-link { display:block; margin:8px 0 2px; font-size:11px; line-height:1.4; text-align:center; color:var(--faint); text-decoration:none; }
.account-menu .icp-link:hover { color:var(--muted); text-decoration:underline; }

/* Agent: thinking strength in the model popup. */
.agent-effort { padding: 8px 4px 2px; border-top: 1px solid var(--line); margin-top: 8px; }
.agent-effort-row { display: flex; gap: 6px; margin: 6px 0; }
.agent-effort-row button { flex: 1; min-height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.agent-effort-row button[aria-checked="true"] { background: var(--accent-soft, rgba(255, 122, 89, .14)); border-color: var(--accent, var(--send)); color: var(--accent, var(--send)); font-weight: 600; }
.agent-effort-row button:disabled { opacity: .45; cursor: not-allowed; }
.agent-effort-note { margin: 0; font-size: 12px; color: var(--muted); }

/* Account entry (bottom left): a photo avatar, a clickable header and icon rows. */
.avatar.has-photo { background-image: var(--avatar-url); background-size: cover; background-position: center; color: transparent; }
html body .account-menu { width: 296px; padding: 8px; }
html body .account-menu .head { width: 100%; margin: 0 0 6px; padding: 10px; border: 0; border-radius: 10px; background: var(--hover); color: inherit; font: inherit; text-align: left; cursor: pointer; }
html body .account-menu .head:hover { background: var(--active); }
html body .account-menu .head .avatar { width: 40px; height: 40px; font-size: 17px; }
html body .account-menu .name { font-size: 14px; }
html body .account-menu .sub { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
html body .account-menu .sub .tag { padding: 0 7px; border-radius: 999px; background: var(--send); color: var(--send-ink); font-size: 11px; line-height: 17px; }
html body .account-menu .usage { padding: 2px 10px 8px; }
html body .account-menu .item, html body .account-menu button.item[data-href] { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; }
html body .account-menu .item svg { flex: none; color: var(--muted); }
html body .account-menu .item:hover svg { color: var(--ink); }
html body .account-menu .item.danger svg { color: var(--danger); }

/* Filing number at the bottom right (wide screens; the account menu carries it everywhere). */
.icp-fixed { position: fixed; right: 26px; bottom: 12px; z-index: 2; font-size: 11px; line-height: 1.4; color: var(--faint); text-decoration: none; white-space: nowrap; }
.icp-fixed:hover { color: var(--muted); text-decoration: underline; }
html.embed .icp-fixed { display: none; }
@media (max-width: 1100px) { .icp-fixed { display: none; } }

/* Thinking and internet as icon buttons beside the + button (chat and Agent composers). */
html body .composer-quick { display: flex; align-items: center; gap: 6px; }
html.unified-chat-home #composer .composer-quick, html.unified-agent-content #ask .composer-quick { position: absolute; left: 52px; bottom: 10px; z-index: 50; margin: 0; }
html body .composer-chip { position: relative; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
html body .composer-chip svg { width: 16px; height: 16px; }
html body .composer-chip:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
html body .composer-chip.on { border-color: var(--accent, var(--send)); background: var(--accent-soft, rgba(255, 122, 89, .12)); color: var(--accent, var(--send)); }
html body .composer-chip.on:hover:not(:disabled) { background: var(--accent-soft, rgba(255, 122, 89, .2)); color: var(--accent, var(--send)); }
html body .composer-chip:disabled { opacity: .45; cursor: not-allowed; }
html body .composer-chip:focus-visible { outline: 2px solid var(--send); outline-offset: 2px; }
@media (max-width: 600px) {
  html.unified-chat-home #composer .composer-quick, html.unified-agent-content #ask .composer-quick { position: static; margin-left: 48px; }
}

/* The + menu no longer repeats thinking and internet (they are icon buttons in the bar) or links to the creation pages (the sidebar has them).
   The row stays in the page: its buttons hold the state the icon buttons mirror. */
html body .composer-menu .mode-row, html body #composer .composer-menu .mode-row { display: none !important; }

/* Scroll hint at the bottom of the model panel: one down arrow, shown only while there is more below. */
html body .agent-scroll-hint { position: sticky; bottom: -6px; display: flex; justify-content: center; margin-top: 2px; padding: 22px 0 6px; background: linear-gradient(to bottom, transparent, var(--composer) 45%); pointer-events: none; }
html body .agent-scroll-hint[hidden] { display: none; }
html body .agent-scroll-hint button { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--composer); color: var(--accent, var(--ink)); box-shadow: var(--shadow); cursor: pointer; pointer-events: auto; }
html body .agent-scroll-hint button:hover { background: var(--hover); }
html body .agent-scroll-hint button:focus-visible { outline: 2px solid var(--send); outline-offset: 2px; }
html body .agent-scroll-hint i { width: 8px; height: 8px; margin-top: -3px; border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; transform: rotate(45deg); animation: agent-hint-nudge 1.4s ease-in-out infinite; }
@keyframes agent-hint-nudge { 0%, 100% { translate: 0 0; } 50% { translate: 0 3px; } }
@media (prefers-reduced-motion: reduce) { html body .agent-scroll-hint i { animation: none; } }

/* Phone navigation drawer: one labelled overlay on every page (injected by shell.js, <=600px, not embedded). */
@media (max-width: 600px) {
  html:not(.embed):not(.unified-chat-home)[data-mobile-nav-open] { --phone-drawer-w: min(240px, 78vw); }
  html:not(.embed):not(.unified-chat-home)[data-mobile-nav-open] body:not(#_) > .app { padding-left: 0 !important; }
  html:not(.embed):not(.unified-chat-home)[data-mobile-nav-open] body:not(#_) > .app > .side {
    width: var(--phone-drawer-w) !important; align-items: stretch; padding-left: 10px; padding-right: 10px;
    overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  }
  html:not(.embed):not(.unified-chat-home)[data-mobile-nav-open] body:not(#_) > .app > .side .brand-row { flex-direction: row; }
  html:not(.embed):not(.unified-chat-home)[data-mobile-nav-open] body:not(#_) > .app > .side .brand { flex: 1; justify-content: flex-start; height: 44px; padding: 0 8px; }
  html:not(.embed):not(.unified-chat-home)[data-mobile-nav-open] body:not(#_) > .app > .side .brand .mark { display: none !important; }
  html:not(.embed):not(.unified-chat-home)[data-theme="light"][data-mobile-nav-open] body:not(#_) > .app > .side .brand .word.on-light,
  html:not(.embed):not(.unified-chat-home)[data-theme="dark"][data-mobile-nav-open] body:not(#_) > .app > .side .brand .word.on-dark { display: block !important; height: 28px; width: auto; }
  html:not(.embed):not(.unified-chat-home)[data-mobile-nav-open] body:not(#_) > .app > .side :is(.nav, .account) {
    justify-content: flex-start !important; gap: 12px !important; padding: 0 12px !important; min-height: 44px;
  }
  html:not(.embed):not(.unified-chat-home)[data-mobile-nav-open] body:not(#_) > .app > .side .nav span,
  html:not(.embed):not(.unified-chat-home)[data-mobile-nav-open] body:not(#_) > .app > .side .who { display: inline !important; }
  html:not(.embed):not(.unified-chat-home)[data-mobile-nav-open] body:not(#_) > .app > .side .nav.fold { display: none !important; }
  html:not(.embed):not(.unified-chat-home)[data-mobile-nav-open] body:not(#_) > .app > .side .side-foot { margin-top: auto !important; }
  html:not(.embed):not(.unified-chat-home)[data-mobile-nav-open] body:not(#_) #pane,
  html:not(.embed):not(.unified-chat-home)[data-mobile-nav-open] body:not(#_) #studio { left: 0 !important; width: 100% !important; }
  html:not(.embed):not(.unified-chat-home)[data-mobile-nav-open] body:not(#_) #pane-loading { left: 0 !important; }
  html:not(.unified-chat-home)[data-mobile-nav-open] body:not(#_) .mobile-nav-backdrop { left: var(--phone-drawer-w, 240px) !important; }
}

/* Phones: every app page scrolls inside its own containers, so a drag that runs past their end must not
   pull the browser to refresh or bounce the whole page. */
@media (max-width: 800px) {
  html:has(body > .app), html:has(body > .app) body { overscroll-behavior-y: none; }
  .stage, .tasks, .chat-history, .thread, .work, .hub, #kb-sidebar, .creation-results, .side, .agent-control .control-body { overscroll-behavior-y: contain; }
}

/* Phones: thinking/internet buttons sit right beside the + button, and the conversation starts below the fixed toolbar. */
@media (max-width: 600px) {
  html body .bar:has(> .composer-quick) { justify-content: flex-start; gap: 4px; }
  html body .bar > .composer-quick { margin-left: 0 !important; flex: none; }
  html body .bar > .composer-quick + * { margin-left: auto; }
  html:not(.embed) body .stage.is-chat .stack { padding-top: calc(var(--phone-toolbar-height, 56px) + 8px); }
  html:not(.embed) body.agent-workspace .work.is-chat .thread { padding-top: calc(var(--phone-toolbar-height, 56px) + 8px); }
}
