:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --bg: #f4f5f3;
  --surface: #ffffff;
  --surface-soft: #f7f8f6;
  --surface-deep: #edf0ed;
  --text: #171a18;
  --text-soft: #343a36;
  --muted: #737a76;
  --line: #e2e6e2;
  --line-strong: #d2d8d3;
  --accent: #16845f;
  --accent-strong: #0d6749;
  --accent-soft: #e8f4ef;
  --blue: #2378b8;
  --blue-soft: #eaf3fa;
  --amber: #a7670a;
  --amber-soft: #fff4df;
  --red: #bd453d;
  --red-soft: #fff0ee;
  --rail: #15231e;
  --radius: 16px;
  --tap: 44px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; min-height: 100%; }
html { scroll-behavior: smooth; }
body { margin: 0; overflow: hidden; background: var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .46; }
button, a, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(22, 132, 95, .22);
  outline-offset: 2px;
}
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 1000; top: 8px; left: 8px; padding: 9px 12px; border-radius: 8px; background: var(--text); color: #fff; transform: translateY(-150%); }
.skip-link:focus { transform: none; }

/* Public official site */
.site-loading { min-height: 100dvh; display: none; place-items: center; align-content: center; gap: 12px; background: var(--bg); color: var(--text); font-size: 18px; font-weight: 750; letter-spacing: -.02em; }
.site-loading-mark { width: 48px; height: 48px; display: grid; place-items: center; color: var(--text); font-size: 16px; }
body[data-access="loading"] .site-loading { display: grid; }
.landing { display: none; min-height: 100dvh; overflow: hidden; background: #f2f0e7; color: #102019; }
body[data-access="public"] { overflow: auto; background: #f2f0e7; }
body[data-access="public"] .landing { display: block; }
html.native-workspace #official-site { display:none!important; }
html.native-workspace body[data-access="public"] { background:var(--surface,#fff);overflow:hidden; }
body[data-access="public"] .app-shell, body[data-access="loading"] .app-shell { display: none; }
body[data-access="public"] .skip-link, body[data-access="loading"] .skip-link { display: none; }
body[data-access="app"] .landing, body[data-access="app"] .site-loading { display: none; }

.site-header { width: min(1320px, calc(100% - 56px)); height: 84px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin: 0 auto; border-bottom: 1px solid rgba(16,32,25,.15); }
.site-brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.site-brand > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: #102019; color: #b8ff5b; font-size: 14px; font-weight: 900; }
.site-brand strong { font-size: 19px; letter-spacing: -.04em; }
.site-nav { display: flex; align-items: center; gap: 34px; }
.site-nav a, .site-footer a, .site-footer button { color: #49534d; text-decoration: none; font-size: 13px; }
.site-nav a:hover, .site-footer a:hover, .site-footer button:hover { color: #102019; }
.site-login { justify-self: end; min-width: 92px; min-height: 40px; border: 1px solid #102019; border-radius: 99px; background: transparent; color: #102019; font-size: 13px; font-weight: 760; }
.site-login:hover { background: #102019; color: #f2f0e7; }

.hero-section { width: min(1320px, calc(100% - 56px)); min-height: 720px; display: grid; grid-template-columns: minmax(0, .86fr) minmax(540px, 1.14fr); gap: 46px; align-items: center; margin: 0 auto; padding: 68px 0 78px; }
.hero-copy { position: relative; z-index: 2; }
.eyebrow, .section-heading > p, .download-intro > p, .closing-section > div > p { display: flex; align-items: center; gap: 10px; margin: 0 0 24px; color: #526158; font-size: 11px; font-weight: 820; letter-spacing: .18em; }
.eyebrow span { width: 24px; height: 2px; background: #62b12c; }
.hero-copy h1 { max-width: 700px; margin: 0; color: #0b1713; font-size: clamp(54px, 5.4vw, 82px); font-weight: 790; line-height: .98; letter-spacing: -.067em; }
.hero-copy h1 em { color: #55a823; font-family: Georgia, "Times New Roman", serif; font-weight: 520; }
.hero-lead { max-width: 590px; margin: 30px 0 0; color: #526158; font-size: 17px; line-height: 1.85; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.primary-cta, .secondary-cta { min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 18px; padding: 0 22px; border-radius: 8px; font-size: 14px; font-weight: 780; text-decoration: none; }
.primary-cta { border: 1px solid #102019; background: #102019; color: #fff; }
.primary-cta:hover { background: #21382e; }
.primary-cta span, .secondary-cta span { font-size: 17px; }
.secondary-cta { border: 1px solid rgba(16,32,25,.28); background: rgba(255,255,255,.3); color: #102019; }
.secondary-cta:hover { border-color: #102019; background: rgba(255,255,255,.62); }
.hero-proof { display: flex; flex-wrap: wrap; gap: 17px; margin-top: 25px; color: #68746d; font-size: 11px; }
.hero-proof span { display: inline-flex; align-items: center; gap: 6px; }
.hero-proof i { width: 5px; height: 5px; border-radius: 50%; background: #62b12c; }

.hero-product { position: relative; min-width: 0; min-height: 550px; display: grid; place-items: center; }
.product-glow { position: absolute; inset: 6% 1% 0 4%; border-radius: 50%; background: radial-gradient(circle at 52% 48%, rgba(184,255,91,.55) 0, rgba(175,228,100,.18) 38%, rgba(255,255,255,0) 69%); filter: blur(15px); }
.product-window { position: relative; z-index: 2; width: min(730px, 100%); min-height: 455px; overflow: hidden; border: 1px solid rgba(16,32,25,.18); border-radius: 18px; background: #fafbf8; box-shadow: 0 34px 90px rgba(22,48,35,.19), 0 5px 16px rgba(22,48,35,.1); transform: perspective(1400px) rotateY(-4deg) rotateX(2deg); }
.window-bar { height: 58px; display: flex; align-items: center; gap: 9px; padding: 0 16px; border-bottom: 1px solid #e3e8e3; background: rgba(255,255,255,.88); }
.window-bar .mini-brand { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: #15231e; color: #b8ff5b; font-size: 11px; font-weight: 900; }
.window-bar b { font-size: 13px; }
.window-bar small { display: flex; align-items: center; gap: 5px; color: #758078; font-size: 8px; }
.window-bar small i { width: 6px; height: 6px; border-radius: 50%; background: #47c797; }
.window-bar button { margin-left: auto; border: 0; background: transparent; color: #758078; }
.window-body { min-height: 397px; display: grid; grid-template-columns: 52px minmax(0, 1fr) 185px; }
.window-rail { display: flex; flex-direction: column; align-items: center; gap: 17px; padding: 13px 8px; background: #15231e; color: rgba(255,255,255,.55); }
.window-rail b { width: 31px; height: 31px; display: grid; place-items: center; margin-bottom: 6px; border-radius: 9px; background: #fff; color: #15231e; font-size: 11px; }
.window-rail span { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 8px; font-size: 12px; }
.window-rail span.active { background: rgba(255,255,255,.12); color: #b8ff5b; }
.window-chat { min-width: 0; display: flex; flex-direction: column; gap: 13px; padding: 28px 24px 18px; background: #fff; }
.chat-date { margin: 0 auto 4px; color: #9aa19c; font-size: 8px; }
.bubble { max-width: 80%; padding: 12px 14px; border-radius: 13px; font-size: 10px; line-height: 1.65; }
.bubble.user { align-self: flex-end; border-bottom-right-radius: 4px; background: #15231e; color: #fff; }
.bubble.assistant { border: 1px solid #e0e6e1; border-bottom-left-radius: 4px; background: #f6f8f5; color: #38433d; }
.bubble.assistant strong { color: #15231e; }
.composer-demo { height: 47px; display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 0 8px 0 14px; border: 1px solid #dfe4df; border-radius: 13px; color: #9aa19c; font-size: 9px; }
.composer-demo b { width: 31px; height: 31px; display: grid; place-items: center; margin-left: auto; border-radius: 9px; background: #15231e; color: #fff; font-size: 14px; }
.window-tasks { padding: 20px 14px; border-left: 1px solid #e3e8e3; background: #f7f8f6; }
.window-tasks > p { margin: 0 0 14px; color: #15231e; font-size: 11px; font-weight: 800; }
.window-tasks article { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; margin-bottom: 10px; padding: 11px 9px; border: 1px solid #e1e6e2; border-radius: 9px; background: #fff; }
.window-tasks article > span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: var(--vi-brand-soft,#fdede3); color: var(--vi-action,#b54825); font-size: 8px; font-weight: 850; }
.window-tasks article div { min-width: 0; display: grid; gap: 4px; }
.window-tasks article b { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.window-tasks article small { color: #87918a; font-size: 7px; line-height: 1.4; }
.floating-card { position: absolute; z-index: 4; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid rgba(16,32,25,.15); border-radius: 12px; background: rgba(255,255,255,.94); box-shadow: 0 18px 38px rgba(22,48,35,.15); }
.floating-card > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; background: var(--vi-support-soft,#f3f1ed); color: var(--vi-support,#6e6963); font-size: 8px; font-weight: 900; letter-spacing: .08em; }
.floating-card div { display: grid; gap: 3px; }
.floating-card b { font-size: 10px; }
.floating-card small { color: #78827b; font-size: 8px; }
.floating-card i { width: 7px; height: 7px; margin-left: 9px; border-radius: 50%; background: #47c797; }
.host-card-demo { right: -2%; bottom: 5%; }
.file-card-demo { left: -4%; top: 8%; }

.statement-section { padding: 110px max(28px, calc((100% - 1320px) / 2)); background: #0b1713; color: #f3f4ec; }
.statement-section > p { margin: 0 0 20px; color: #8d9a92; font-size: 11px; font-weight: 800; letter-spacing: .17em; }
.statement-section > h2 { max-width: 1040px; margin: 0; font-size: clamp(38px, 5vw, 68px); font-weight: 620; line-height: 1.12; letter-spacing: -.05em; }
.statement-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 78px; background: rgba(255,255,255,.14); }
.statement-grid article { min-height: 260px; padding: 30px 32px; background: #0b1713; }
.statement-grid span { color: #b8ff5b; font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.statement-grid h3 { margin: 50px 0 14px; font-size: 25px; font-weight: 680; letter-spacing: -.03em; }
.statement-grid p { max-width: 330px; margin: 0; color: #98a39d; font-size: 14px; line-height: 1.8; }

.architecture-section { padding: 110px max(28px, calc((100% - 1320px) / 2)) 124px; background: var(--vi-support-soft,#f3f1ed); }
.section-heading { display: grid; grid-template-columns: 1fr 2fr; gap: 40px; align-items: start; }
.section-heading h2 { max-width: 780px; margin: 0; font-size: clamp(38px, 4.6vw, 63px); font-weight: 670; line-height: 1.08; letter-spacing: -.05em; }
.architecture-track { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 16px; align-items: center; margin-top: 72px; }
.layer-card { min-height: 320px; padding: 24px; border: 1px solid rgba(16,32,25,.18); border-radius: 15px; background: rgba(255,255,255,.52); }
.layer-card.host { background: #b8ff5b; }
.layer-no { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(16,32,25,.2); border-radius: 50%; font: 750 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.layer-card > p { margin: 60px 0 10px; color: #5f6c65; font-size: 9px; font-weight: 850; letter-spacing: .16em; }
.layer-card h3 { margin: 0 0 25px; font-size: 27px; letter-spacing: -.035em; }
.layer-card ul { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.layer-card li { color: #526158; font-size: 12px; }
.layer-card li::before { content: "—"; margin-right: 8px; color: #58a428; }
.layer-link { color: #647169; font-size: 25px; }

.download-section { display: grid; grid-template-columns: .8fr 1.2fr; gap: 80px; padding: 116px max(28px, calc((100% - 1320px) / 2)); background: #f2f0e7; }
.download-intro { position: sticky; top: 40px; align-self: start; }
.download-intro h2 { margin: 0; font-size: clamp(42px, 4.5vw, 62px); font-weight: 680; line-height: 1.08; letter-spacing: -.055em; }
.download-note { max-width: 440px; margin: 25px 0 0; color: #6a756e; font-size: 13px; line-height: 1.75; }
.download-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.download-card { min-height: 290px; display: flex; flex-direction: column; align-items: flex-start; padding: 25px; border: 1px solid rgba(16,32,25,.16); border-radius: 15px; background: rgba(255,255,255,.5); }
.download-card.featured { background: #102019; color: #fff; }
.platform-icon { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid rgba(16,32,25,.2); border-radius: 12px; font-size: 15px; font-weight: 850; }
.featured .platform-icon { border-color: rgba(255,255,255,.2); background: #b8ff5b; color: #102019; }
.download-card > div { margin-top: 30px; }
.download-card small { color: #758078; font-size: 8px; font-weight: 850; letter-spacing: .16em; }
.featured small { color: #a9b5ae; }
.download-card h3 { margin: 7px 0 10px; font-size: 24px; letter-spacing: -.04em; }
.download-card p { margin: 0; color: #6b776f; font-size: 12px; line-height: 1.65; }
.featured p { color: #a7b3ac; }
.download-card a, .download-card button { min-height: 39px; display: inline-flex; align-items: center; justify-content: center; gap: 13px; margin-top: auto; padding: 0 14px; border: 1px solid rgba(16,32,25,.22); border-radius: 7px; background: transparent; color: inherit; font-size: 11px; font-weight: 780; text-decoration: none; }
.featured a { border-color: #b8ff5b; background: #b8ff5b; color: #102019; }
.download-card.muted { background: rgba(255,255,255,.23); }
.status-pill { margin-top: auto; padding: 6px 9px; border: 1px solid rgba(16,32,25,.16); border-radius: 99px; color: #7b857f; font-size: 8px; font-weight: 800; letter-spacing: .12em; }

.closing-section { min-height: 470px; display: flex; align-items: end; justify-content: space-between; gap: 50px; padding: 92px max(28px, calc((100% - 1320px) / 2)); background: #a8ed54; }
.closing-section h2 { margin: 0; font-size: clamp(46px, 6vw, 82px); font-weight: 690; line-height: 1.01; letter-spacing: -.06em; }
.closing-login { width: 174px; height: 174px; flex: 0 0 auto; display: grid; place-items: center; align-content: center; gap: 12px; border: 0; border-radius: 50%; background: #102019; color: #fff; font-size: 13px; font-weight: 760; }
.closing-login b { color: #b8ff5b; font-size: 25px; }
.site-footer { min-height: 110px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 30px; padding: 0 max(28px, calc((100% - 1320px) / 2)); background: #0b1713; color: #fff; }
.site-footer p { color: #758078; font-size: 11px; }
.site-footer > div { justify-self: end; display: flex; gap: 20px; }
.site-footer a, .site-footer button { color: #9aa59f; }
.site-footer button { padding: 0; border: 0; background: transparent; }

.app-shell { width: 100%; max-width: 100vw; height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; background: var(--bg); }

/* Navigation */
.side-rail { display: none; min-width: 0; background: var(--rail); color: rgba(255,255,255,.7); }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: #fff; color: var(--rail); font-size: 18px; font-weight: 850; }
.rail-actions { width: 100%; display: grid; gap: 8px; }
.rail-button { position: relative; min-width: 0; min-height: 58px; display: grid; place-items: center; gap: 3px; padding: 7px 4px; border: 0; border-radius: 12px; background: transparent; color: rgba(255,255,255,.58); font-size: 10px; }
.personal-entry { width: 100%; flex: 0 0 auto; cursor: pointer; }
.personal-entry-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; background: #fff; color: var(--rail); font-size: 15px; font-weight: 850; }
.rail-button svg { width: 19px; height: 19px; }
.rail-button:hover, .rail-button.active { background: rgba(255,255,255,.1); color: #fff; }
.rail-button b { position: absolute; top: 4px; right: 5px; min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 4px; border-radius: 99px; background: #47c797; color: #10241c; font-size: 9px; }
.rail-status { width: 34px; height: 34px; display: grid; place-items: center; margin-top: auto; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; }
.rail-status span, .online-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; background: #48c895; }

/* Main conversation surface */
.assistant-main { width: 100%; max-width: 100%; min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; overflow: hidden; isolation: isolate; background: var(--surface); }
.assistant-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.assistant-identity { min-width: 0; display: flex; align-items: center; gap: 11px; }
.assistant-avatar { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 14px; background: var(--rail); color: #fff; font-weight: 850; }
.identity-line { display: flex; align-items: center; gap: 7px; }
.identity-line h1 { margin: 0; font-size: 17px; line-height: 1.2; letter-spacing: -.02em; }
.assistant-identity p { max-width: 52vw; margin: 4px 0 0; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: 7px; }
.mobile-personal-entry { width: var(--tap); height: var(--tap); display: none; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text-soft); cursor: pointer; }
.mobile-personal-entry svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mobile-personal-entry:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.mobile-personal-entry:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 24%, transparent); outline-offset: 2px; }
.unread-messages { min-height: 30px; padding: 4px 9px; border: 1px solid #efd7aa; border-radius: 99px; background: #fff8e9; color: #9a6506; font-size: 10px; font-weight: 750; }
.unread-messages:hover { background: #ffefcb; }
.unread-messages.active { border-color: #9fd1bd; background: var(--accent-soft); color: var(--accent); }
.autoplay-switch { min-height: var(--tap); display: flex; align-items: center; gap: 7px; padding: 0 4px; color: var(--text-soft); font-size: 12px; cursor: pointer; user-select: none; }
.autoplay-switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { position: relative; width: 34px; height: 20px; border-radius: 99px; background: #cbd1cd; transition: background 160ms ease; }
.switch-track i { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform 160ms ease; }
.autoplay-switch input:checked + .switch-track { background: var(--accent); }
.autoplay-switch input:checked + .switch-track i { transform: translateX(14px); }
.autoplay-switch input:focus-visible + .switch-track { outline: 3px solid rgba(22,132,95,.22); outline-offset: 2px; }
.settings-autoplay-switch { min-height: 62px; justify-content: space-between; gap: 18px; padding: 11px 2px; }
.settings-toggle-copy { min-width: 0; display: grid; gap: 4px; }
.settings-toggle-copy strong { color: var(--text); font-size: 12px; }
.settings-toggle-copy small { color: var(--muted); font-size: 10px; line-height: 1.55; }
.settings-autoplay-switch .switch-track { flex: 0 0 auto; }
.task-entry { min-height: var(--tap); display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text-soft); font-size: 12px; font-weight: 700; }
.task-entry:hover { background: var(--surface-soft); border-color: var(--line-strong); }
.task-entry b { min-width: 19px; height: 19px; display: grid; place-items: center; padding: 0 5px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 10px; }
.task-entry svg { width: 17px; height: 17px; }
.workspace-control { min-width: 0; }
.workspace-control select { max-width: 180px; min-height: 34px; padding: 0 28px 0 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); color: var(--text-soft); font-size: 10px; font-weight: 700; }
.cloud-resource-scope { display: grid; gap: 3px; margin-left: auto; color: var(--text-soft); font-size: 10px; font-weight: 700; }
.cloud-drive-navigation { display: grid; gap: 9px; margin-bottom: 12px; }
.cloud-drive-navigation[hidden], .cloud-group-picker[hidden] { display: none; }
.cloud-drive-kinds { display: inline-flex; width: fit-content; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.cloud-drive-kinds button { min-height: 34px; padding: 0 15px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 760; }
.cloud-drive-kinds button.active { background: var(--surface); color: var(--accent); box-shadow: 0 2px 8px rgba(23,36,29,.08); }
.cloud-group-picker { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; font-weight: 700; }
.cloud-group-picker select { min-height: 34px; padding: 0 30px 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); font: inherit; }

.conversation { width: 100%; max-width: 100%; min-width: 0; min-height: 0; contain: inline-size layout paint; overflow-x: clip; overflow-y: auto; overscroll-behavior: contain; padding: 24px 16px; display: flex; flex-direction: column; gap: 12px; background: var(--surface); scrollbar-gutter: stable; }
.message { position: relative; min-width: 0; width: fit-content; max-width: min(84%, 760px); line-height: 1.65; overflow-wrap: anywhere; word-break: break-word; }
.message > * { min-width: 0; max-width: 100%; }
.message.user { align-self: flex-end; padding: 11px 14px 9px; border-radius: 17px 17px 5px 17px; background: var(--accent); color: #fff; }
.message.assistant { align-self: flex-start; padding: 8px 0 6px; color: var(--text); }
.message.assistant.streaming { min-width: 150px; }
.streaming-cursor { width: 2px; height: 1.1em; display: inline-block; margin-left: 3px; border-radius: 2px; background: var(--accent); vertical-align: -.12em; animation: streaming-cursor 760ms step-end infinite; }
.streaming-wait { display: inline-flex; align-items: center; gap: 4px; color: var(--text-soft); }
.streaming-wait i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: streaming-dot 900ms ease-in-out infinite; }
.streaming-wait i:nth-child(2) { animation-delay: 140ms; }
.streaming-wait i:nth-child(3) { animation-delay: 280ms; }
.streaming-elapsed { color: var(--accent) !important; }
.message-plain { display: block; max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.message-meta { min-height: 19px; display: flex; align-items: center; gap: 7px; margin-top: 5px; }
.message-channel { position: relative; display: inline-flex; flex: 0 0 22px; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; color: #738398; background: color-mix(in srgb, currentColor 8%, transparent); cursor: help; }
.message-channel svg { display: block; width: 14px; height: 14px; fill: currentColor; }
.message-channel[data-channel="coappx_client"] svg { fill: none; }
.message-channel[data-channel="weixin"] { color: #078747; }
.message-channel[data-channel="feishu"] { color: #3370ff; }
.message-channel[data-channel="dingtalk"] { color: #1677ff; }
.message-channel:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.message-channel::after { content: attr(data-tooltip); position: absolute; z-index: 6; inset-inline-end: -3px; bottom: calc(100% + 7px); width: max-content; max-width: min(250px, 72vw); padding: 6px 9px; border-radius: 7px; color: #fff; background: #26354a; font-size: 11px; line-height: 1.4; font-weight: 400; pointer-events: none; opacity: 0; transition: opacity 150ms ease; }
.message-channel:hover::after, .message-channel:focus-visible::after { opacity: 1; }
.message-channel[data-delivery]::before { content: ''; position: absolute; top: 1px; right: 1px; width: 5px; height: 5px; border: 1px solid var(--surface, #fff); border-radius: 50%; background: #d88a18; }
.message-channel[data-delivery="failed"]::before { background: #c34c50; }
@media (prefers-reduced-motion: reduce) { .message-channel::after { transition: none; } }
.message-presentation { width: min(560px, 100%); display: grid; gap: 9px; margin-top: 10px; padding: 12px; border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line)); border-radius: 13px; background: color-mix(in srgb, var(--surface) 86%, var(--accent-soft)); }
.message-presentation-title { font-size: 12px; }
.message-presentation-items { display: grid; gap: 7px; }
.message-presentation-item { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 12px; padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.message-presentation-field { min-width: 0; display: grid; gap: 2px; }
.message-presentation-field > span { color: var(--muted); font-size: 8px; font-weight: 750; }
.message-presentation-field > b { overflow: hidden; color: var(--text-soft); font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.message-presentation-field.field-title, .message-presentation-field.field-text, .message-presentation-field.field-source { grid-column: 1 / -1; }
.message-presentation-field.field-text > b { display: -webkit-box; overflow: hidden; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.message-presentation-more { color: var(--muted); font-size: 9px; }
.message-presentation-item.is-file { cursor: pointer; }
.message-presentation-item.is-file:hover, .message-presentation-item.is-file:focus-visible { border-color: var(--accent); outline: none; }
.message-presentation-image { display: grid; gap: 7px; width: 100%; padding: 0; overflow: hidden; color: var(--text-soft); text-align: left; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.message-presentation-image img { display: block; width: 100%; max-height: 360px; object-fit: contain; background: var(--canvas); }
.message-presentation-image span { padding: 0 10px 9px; font-size: 10px; font-weight: 750; }
.message-presentation-image-error { padding: 14px; color: var(--muted); font-size: 10px; }
.message small { color: var(--muted); font-size: 10px; }
.message.user small { color: rgba(255,255,255,.68); }
.message-reply { display: grid; gap: 3px; width: min(100%, 440px); margin: 0 0 10px; padding: 8px 11px; border: 0; border-left: 3px solid var(--line-strong); border-radius: 5px 9px 9px 5px; background: var(--surface-soft); color: var(--text-soft); text-align: left; cursor: pointer; }
.message-reply:hover:not(:disabled), .message-reply:focus-visible { background: var(--accent-soft); border-left-color: var(--accent); outline: none; }
.message-reply:disabled { cursor: default; opacity: .72; }
.message-reply-label { color: var(--muted); font-size: 10px; }
.message-reply-text { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: pre-wrap; font-size: 12px; line-height: 1.5; }
.message.message-referenced { outline: 3px solid color-mix(in srgb, var(--accent) 38%, transparent); outline-offset: 5px; transition: outline-color .3s; }
.message-send-status { margin-left: auto; }
.message-pending .message-meta { flex-wrap: wrap; }
.message-send-status.error { font-weight: 700; }
.message-retry { min-height: 28px; padding: 2px 8px; border: 1px solid rgba(255,255,255,.55); border-radius: 8px; background: transparent; color: inherit; font-size: 11px; cursor: pointer; }
.message-retry:hover, .message-retry:focus-visible { background: rgba(255,255,255,.16); outline: 2px solid rgba(255,255,255,.45); outline-offset: 2px; }
.message-source { padding: 2px 6px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: var(--surface-soft); font-size: 9px; line-height: 1.2; }
.message-source.doubao_realtime { color: var(--blue); border-color: #bfdaec; background: var(--blue-soft); }
.message-source.coappx_fast_brain { color: var(--accent); border-color: #bbddcf; background: var(--accent-soft); }
.message-source.coappx_task_ledger { color: var(--amber); border-color: #efd7aa; background: var(--amber-soft); }
.message-source.coappx_task_result { color: #7a52a2; border-color: #dac8e8; background: #f6f0fa; }
.message.assistant.unread::before { content: ""; position: absolute; left: -11px; top: 17px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.message-unread { color: var(--accent); font-size: 9px; font-weight: 750; }
.empty { margin: auto; padding: 24px; color: var(--muted); text-align: center; }
.load-older { align-self: center; min-height: 36px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface-soft); color: var(--muted); font-size: 11px; }
.load-older:hover { color: var(--accent); border-color: #bbddcf; background: var(--accent-soft); }

@keyframes streaming-cursor { 50% { opacity: 0; } }
@keyframes streaming-dot { 0%, 70%, 100% { opacity: .25; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-2px); } }

/* Markdown and files */
.markdown-body { min-width: 0; max-width: 100%; color: inherit; font-size: 14px; line-height: 1.72; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body p { margin: .58em 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 { margin: 1.15em 0 .46em; color: var(--text); line-height: 1.35; letter-spacing: -.015em; }
.markdown-body h1 { font-size: 1.38em; }
.markdown-body h2 { padding-bottom: .28em; border-bottom: 1px solid var(--line); font-size: 1.22em; }
.markdown-body h3 { font-size: 1.1em; }
.markdown-body h4, .markdown-body h5, .markdown-body h6 { font-size: 1em; }
.markdown-body ul, .markdown-body ol { margin: .58em 0; padding-left: 1.55em; }
.markdown-body li { margin: .25em 0; }
.markdown-body li::marker { color: var(--accent); }
.markdown-body a { color: #0969a8; overflow-wrap: anywhere; word-break: break-word; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.markdown-body a:hover { color: #064f81; }
.message-references { margin-top: 12px; padding-top: 9px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.message-references summary { cursor: pointer; width: fit-content; padding: 3px 0; }
.message-references summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.message-references ol { margin-bottom: 0; }
.markdown-body code { padding: .13em .36em; border: 1px solid #d7e3ea; border-radius: 5px; background: #eef4f7; color: #145b7e; font: .88em/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.markdown-body blockquote { margin: .68em 0; padding: .4em .8em; border-left: 3px solid #72bda0; background: var(--accent-soft); color: #3c574b; white-space: pre-line; }
.markdown-body hr { height: 1px; margin: .95em 0; border: 0; background: var(--line); }
.markdown-code-block { margin: .72em 0; overflow: hidden; border: 1px solid #28342f; border-radius: 11px; background: #111b17; color: #dff2ea; }
.markdown-code-header { min-height: 32px; display: flex; align-items: center; justify-content: space-between; padding: 3px 6px 3px 11px; border-bottom: 1px solid rgba(255,255,255,.11); color: #92a59c; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.markdown-code-block pre { max-width: 100%; margin: 0; padding: 13px; overflow: auto; }
.markdown-code-block pre code { padding: 0; border: 0; background: transparent; color: #dff2ea; font-size: 11px; white-space: pre; }
.markdown-table-wrap { max-width: 100%; margin: .72em 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.markdown-body table { width: 100%; border-collapse: collapse; font-size: 12px; }
.markdown-body th, .markdown-body td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.markdown-body th { background: var(--surface-soft); font-weight: 750; }
.markdown-body tr:last-child td { border-bottom: 0; }
.message-actions { min-height: 25px; display: flex; gap: 3px; align-items: center; margin: 5px -5px -2px; opacity: 0; transition: opacity 140ms ease; }
.message:hover .message-actions, .message:focus-within .message-actions { opacity: 1; }
.text-action, a.text-action { min-height: 26px; display: inline-flex; align-items: center; justify-content: center; padding: 3px 7px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 700; text-decoration: none; }
.text-action:hover, a.text-action:hover { border-color: var(--line); background: var(--surface-soft); color: var(--accent); }

.artifact-file-list { display: grid; gap: 7px; margin-top: 9px; }
.artifact-file-list.compact { margin: 10px 0 2px; }
.artifact-file { min-width: 0; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 9px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.file-type { min-width: 38px; height: 32px; display: grid; place-items: center; border: 1px solid #c7dce9; border-radius: 8px; background: var(--blue-soft); color: var(--blue); font: 750 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.artifact-file-copy { min-width: 0; display: grid; gap: 2px; }
.artifact-file-copy strong, .artifact-file-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artifact-file-copy strong { color: var(--text); font-size: 11px; }
.artifact-file-copy small { color: var(--muted); font-size: 9px; }
.artifact-file-actions { display: flex; gap: 2px; }
.artifact-file.image { display: block; padding: 0; overflow: hidden; background: var(--surface); }
.artifact-image-button { width: 100%; display: block; padding: 0; border: 0; background: var(--surface-deep); cursor: pointer; }
.artifact-image { width: 100%; max-height: 460px; display: block; object-fit: contain; background: var(--surface-deep); }
.artifact-image-footer { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 11px; }
.artifact-image-footer .artifact-file-actions { flex: 0 0 auto; }

/* Voice */
.voice-dock { min-width: 0; max-width: calc(100% - 32px); display: none; width: 850px; margin: 0 auto 8px; padding: 13px; overflow: hidden; contain: inline-size layout paint; border: 1px solid #bfddcf; border-radius: 15px; background: var(--ws-subtle,#f3f1ed); }
.voice-dock.active { display: block; }
.voice-dock-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.voice-state-copy { min-width: 0; display: flex; align-items: center; gap: 10px; }
.voice-state-orb { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: var(--accent); animation: voice-pulse 1.35s ease-out infinite; }
.voice-state-copy div { min-width: 0; display: grid; gap: 2px; }
.voice-state-copy strong { font-size: 12px; }
.voice-state-copy small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.voice-dock-close { width: 36px; height: 36px; flex: 0 0 auto; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 22px; font-weight: 400; }
.voice-dock-close:hover { background: rgba(0,0,0,.05); color: var(--text); }
.voice-io-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.voice-channel { min-width: 0; padding: 8px 9px; border: 1px solid #d8e8e1; border-radius: 10px; background: rgba(255,255,255,.72); }
.voice-channel.output { border-color: #d8e5ed; }
.voice-channel-heading { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 9px; }
.voice-channel-heading span:first-child { color: var(--text-soft); font-weight: 750; }
.voice-wave { display: block; width: 100%; height: 28px; margin-top: 3px; border-radius: 6px; background: var(--surface-soft); }
.voice-meter { height: 4px; margin-top: 6px; overflow: hidden; border-radius: 99px; background: var(--surface-deep); }
.voice-meter span { display: block; width: 0; height: 100%; border-radius: inherit; background: #44bd90; transition: width 70ms linear; }
.voice-meter.output span { background: #6eb7e7; }
.voice-live-text { min-height: 17px; margin: 8px 0 0; overflow: hidden; color: var(--text-soft); font-size: 11px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.voice-boundary { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.4; }
.voice-guard-status { margin: 5px 0 0; padding-top: 5px; border-top: 1px solid rgba(22,132,95,.12); color: #6b8278; font-size: 9px; line-height: 1.4; }
.voice-guard-status.allow { color: var(--accent); }
.voice-guard-status.reject { color: var(--amber); }
.voice-thinking { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 9px; align-items: center; margin-top: 9px; padding: 8px 10px; overflow: hidden; border: 1px solid #c8e3d8; border-radius: 10px; background: rgba(255,255,255,.72); }
.voice-thinking[hidden] { display: none; }
.voice-thinking-orb { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: voice-thinking-orb 1.2s ease-out infinite; }
.voice-thinking-copy { min-width: 0; display: grid; gap: 2px; }
.voice-thinking-copy strong { font-size: 10px; }
.voice-thinking-copy small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.voice-thinking-dots { display: inline-flex; gap: 3px; }
.voice-thinking-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); animation: voice-thinking-dot 900ms ease-in-out infinite; }
.voice-thinking-dots i:nth-child(2) { animation-delay: 140ms; }
.voice-thinking-dots i:nth-child(3) { animation-delay: 280ms; }

/* Composer */
.composer { position: relative; z-index: 4; width: 100%; max-width: 100%; min-width: 0; padding: 8px 16px max(10px, env(safe-area-inset-bottom)); overflow: hidden; contain: inline-size layout paint; background: var(--surface); }
.composer-box { width: 100%; max-width: 850px; min-width: 0; margin: 0 auto; padding: 10px; border: 1px solid var(--line-strong); border-radius: 17px; background: var(--surface); box-shadow: 0 7px 26px rgba(23,36,29,.08); }
.composer-quote { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; padding: 8px 10px; border-left: 3px solid var(--accent-strong); border-radius: 7px; background: var(--surface-soft); }
.composer-quote[hidden] { display: none; }
.composer-quote-copy { min-width: 0; flex: 1; display: grid; gap: 3px; }
.composer-quote-copy strong { font-size: 10px; color: var(--muted); }
.composer-quote-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: var(--text-soft); }
#composer-quote-cancel { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 18px; }
#composer-quote-cancel:hover { background: var(--surface-deep); }
.composer-attachments { display: flex; gap: 7px; margin: 0 0 8px; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; }
.composer-capture-session { width: 100%; display: grid; grid-template-columns: auto minmax(0, auto) 1fr; gap: 6px; align-items: center; margin: 0 0 8px; padding: 7px 10px; border: 1px solid #bddaca; border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); text-align: left; }
.composer-capture-session[hidden] { display: none; }
.composer-capture-session span { font-size: 9px; font-weight: 800; }
.composer-capture-session strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.composer-capture-session small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 8px; }
.composer-attachments[hidden] { display: none; }
.composer-attachment { min-width: 170px; max-width: 260px; display: grid; grid-template-columns: 34px minmax(0, 1fr) 28px; gap: 8px; align-items: center; padding: 7px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.composer-attachment.failed { border-color: #e5b9b4; background: var(--red-soft); }
.composer-attachment-icon { width: 34px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: var(--blue-soft); color: var(--blue); font: 750 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.composer-attachment-copy { min-width: 0; display: grid; gap: 2px; }
.composer-attachment-copy strong, .composer-attachment-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-attachment-copy strong { font-size: 10px; }
.composer-attachment-copy small { color: var(--muted); font-size: 8px; }
.composer-attachment-remove { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 17px; }
.composer-attachment-remove:hover { background: var(--surface-deep); color: var(--red); }
.composer-attachment-notice { margin: -2px 2px 7px; color: var(--muted); font-size: 9px; }
.composer-attachment-notice.error { color: var(--red); }
.composer textarea { width: 100%; min-height: 28px; max-height: 142px; display: block; resize: none; padding: 3px 4px 8px; border: 0; outline: 0; background: transparent; color: var(--text); line-height: 1.55; }
.composer textarea::placeholder { color: #959b97; }
.composer-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.voice-entry-actions, .composer-send-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.voice-pipeline-control, .agent-target-control { min-height: var(--tap); display: inline-flex; align-items: center; gap: 6px; padding: 0 8px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); color: var(--text-soft); font-size: 10px; font-weight: 700; }
.voice-pipeline-control select, .agent-target-control select { max-width: 148px; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.voice-pipeline-control select:disabled { cursor: not-allowed; opacity: .55; }
.composer-agent-target { max-width: min(240px, 42vw); }
.composer-agent-target select { max-width: 190px; text-overflow: ellipsis; }
.composer-action { min-height: var(--tap); display: inline-flex; align-items: center; gap: 6px; padding: 0 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); color: var(--text-soft); font-size: 11px; font-weight: 700; user-select: none; touch-action: none; }
.composer-action svg { width: 17px; height: 17px; }
.composer-attachment-button { position: relative; cursor: pointer; }
.composer-attachment-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.composer-attachment-button:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 28%, transparent); outline-offset: 2px; }
.composer-action:hover:not(:disabled) { border-color: var(--line-strong); background: var(--surface-deep); }
.composer-action.active { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.voice-push.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.send-button { min-width: var(--tap); min-height: var(--tap); display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 14px; border: 0; border-radius: 11px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; }
.send-button:hover:not(:disabled) { background: var(--accent-strong); }
.send-button svg { width: 17px; height: 17px; }
.composer-hint { width: min(850px, 100%); margin: 6px auto 0; color: var(--muted); font-size: 9px; }
kbd { padding: 1px 4px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: var(--surface-soft); color: var(--text-soft); font-family: inherit; }

.message-attachment-list { display: grid; gap: 6px; margin-bottom: 8px; }
.message-attachment { min-width: 210px; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; align-items: center; padding: 7px 9px; border: 1px solid color-mix(in srgb, currentColor 18%, transparent); border-radius: 10px; background: color-mix(in srgb, currentColor 7%, transparent); }
.message-attachment .file-type { background: rgba(255,255,255,.8); }
.message-attachment-copy { min-width: 0; display: grid; gap: 2px; }
.message-attachment-copy strong, .message-attachment-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-attachment-copy strong { font-size: 10px; }
.message-attachment-copy small { color: inherit; font-size: 8px; opacity: .72; }

/* Task panel */
.task-panel { position: relative; z-index: 6; min-width: 0; min-height: 0; display: none; flex-direction: column; overflow: hidden; isolation: isolate; background: var(--surface-soft); border-left: 1px solid var(--line); }
.task-panel-header { min-height: 82px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 16px; border-bottom: 1px solid var(--line); }
.task-panel-header p { margin: 0 0 3px; color: var(--muted); font-size: 10px; }
.task-panel-header h2 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.task-panel-tools { display: flex; align-items: center; gap: 7px; }
.count { min-width: 28px; height: 28px; display: grid; place-items: center; padding: 0 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 800; }
.panel-close { width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); font-size: 21px; font-weight: 400; }
.task-filters { flex: 0 0 auto; display: flex; gap: 5px; padding: 10px 12px; overflow-x: auto; scrollbar-width: none; }
.task-filters::-webkit-scrollbar { display: none; }
.task-filters button { min-height: 34px; flex: 0 0 auto; padding: 0 10px; border: 1px solid transparent; border-radius: 99px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 700; }
.task-filters button:hover, .task-filters button.active { border-color: #c9ded5; background: var(--accent-soft); color: var(--accent); }
.tasks { min-height: 0; flex: 1 1 auto; overflow: auto; overscroll-behavior: contain; padding: 4px 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.task { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.task-title { margin: 0 0 8px; font-size: 13px; line-height: 1.48; }
.task-taxonomy { display: flex; flex-wrap: wrap; gap: 5px; margin: -2px 0 9px; }
.task-category, .task-tag { padding: 2px 6px; border-radius: 999px; background: var(--surface-deep); color: var(--muted); font-size: 9px; }
.task-category { color: var(--accent); }
.task-lineage { display: grid; gap: 3px; margin: 0 0 10px; padding: 8px 9px; border: 1px solid #cddfeb; border-radius: 9px; background: var(--blue-soft); }
.task-lineage strong { color: var(--blue); font-size: 10px; }
.task-lineage span { overflow: hidden; color: var(--text-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.task-lineage small { color: var(--muted); font-size: 9px; }
.task-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 10px; }
.task-due-at { margin: 8px 0 0; color: var(--accent); font-size: 11px; font-weight: 650; }
.task-agent { margin: 7px 0 0; color: var(--blue); font-size: 10px; }
.status { color: var(--amber); }
.status.reported { color: var(--accent); }
.status.failed, .status.cancelled { color: var(--red); }
.bar { height: 5px; margin: 11px 0 8px; overflow: hidden; border-radius: 99px; background: var(--surface-deep); }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.progress-copy { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.48; }
.task-failure { margin-top: 10px; padding: 10px 11px; border: 1px solid #ecc8c4; border-radius: 10px; background: var(--red-soft); }
.task-failure strong { color: var(--red); font-size: 11px; }
.task-failure p { margin: 5px 0; font-size: 11px; line-height: 1.45; }
.task-failure small { color: var(--muted); font-size: 9px; }
.task-artifact { margin-top: 10px; padding: 9px 10px; border: 1px solid #c4dfd3; border-radius: 10px; background: var(--accent-soft); }
.task-artifact.mock { border-color: #ead4a9; background: var(--amber-soft); }
.task-artifact strong { color: var(--accent); font-size: 10px; }
.task-artifact.mock strong { color: var(--amber); }
.task-artifact p { margin: 5px 0; font-size: 10px; line-height: 1.45; }
.task-artifact small, .task-question { color: var(--muted); font-size: 9px; }
.task-question { margin: 9px 0 0; line-height: 1.5; }
.refine { display: flex; gap: 6px; margin-top: 10px; }
.refine input { width: 100%; min-width: 0; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); font-size: 11px; }
.refine button, .task-retry, .task-actions button { min-height: 38px; padding: 0 10px; border: 0; border-radius: 9px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 750; }
.task-retry { margin-top: 9px; background: var(--amber-soft); color: var(--amber); }
.task-actions { display: flex; gap: 7px; margin-top: 10px; }
.task-actions button.secondary { background: var(--red-soft); color: var(--red); }
.diagnostics { flex: 0 0 auto; border-top: 1px solid var(--line); background: var(--surface); }
.diagnostics summary { min-height: 43px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 14px; color: var(--muted); font-size: 10px; cursor: pointer; list-style: none; }
.diagnostics summary::-webkit-details-marker { display: none; }
.events { max-height: 180px; overflow: auto; margin: 0; padding: 0 14px 12px 34px; font: 9px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.events li { padding: 3px 0; color: var(--muted); }
.events strong { color: var(--text-soft); }

/* Mobile navigation */
.mobile-nav { position: fixed; z-index: 20; right: 0; bottom: 0; left: 0; height: calc(58px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(2, 1fr); padding: 4px 18px env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: rgba(255,255,255,.97); }
.mobile-nav button { position: relative; min-height: 48px; display: grid; place-items: center; align-content: center; gap: 2px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 10px; }
.mobile-nav button.active { color: var(--accent); }
.mobile-nav svg { width: 20px; height: 20px; }
.mobile-nav b { position: absolute; top: 2px; left: calc(50% + 8px); min-width: 16px; height: 16px; display: grid; place-items: center; padding: 0 4px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 8px; }
body[data-surface="tasks"] .assistant-main { display: none; }
body[data-surface="tasks"] .task-panel { display: flex; padding-bottom: calc(58px + env(safe-area-inset-bottom)); border-left: 0; }
body[data-surface="conversation"] .assistant-main { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }

/* File preview */
.file-preview { width: min(980px, calc(100vw - 24px)); height: min(760px, calc(100dvh - 24px)); padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: 0 28px 90px rgba(25,38,31,.24); }
.file-preview::backdrop { background: rgba(20,29,25,.54); backdrop-filter: blur(4px); }
.file-preview-shell { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.file-preview-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.file-preview-header > div { min-width: 0; display: grid; gap: 3px; }
.file-preview-header strong, .file-preview-header small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-preview-header strong { font-size: 14px; }
.file-preview-header small { color: var(--muted); font-size: 10px; }
.icon-button { width: var(--tap); height: var(--tap); padding: 0; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 22px; }
.file-preview-body { min-height: 0; overflow: auto; padding: 20px; background: var(--surface-soft); }
.file-preview-body > .markdown-body { width: min(760px, 100%); margin: 0 auto; font-size: 15px; }
.file-text-preview { width: min(860px, 100%); min-height: 100%; margin: 0 auto; color: var(--text-soft); font: 12px/1.7 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; white-space: pre-wrap; }
.file-image-preview { display: block; max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; }
.file-frame-preview { width: 100%; height: 100%; min-height: 540px; border: 0; border-radius: 8px; background: #fff; }
.file-media-preview { width: 100%; max-height: 100%; }
.file-preview-fallback { width: min(520px, 100%); margin: 14vh auto 0; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: center; }
.file-preview-loading, .file-preview-error, .file-preview-fallback p { color: var(--muted); line-height: 1.65; }
.file-preview-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.file-preview-actions button, .secondary-action, a.secondary-action { min-height: var(--tap); display: inline-flex; align-items: center; justify-content: center; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text-soft); font-size: 11px; font-weight: 750; text-decoration: none; }
#file-preview-open { border-color: var(--accent); background: var(--accent); color: #fff; }

/* Personal center, Host enrollment and per-Agent routing */
.host-manager { width: min(1040px, calc(100vw - 24px)); height: min(780px, calc(100dvh - 24px)); max-height: min(780px, calc(100dvh - 24px)); padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: 0 28px 90px rgba(25,38,31,.24); }
.host-manager::backdrop { background: rgba(20,29,25,.54); backdrop-filter: blur(4px); }
.host-manager-shell { height: 100%; max-height: inherit; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.host-manager-body.personal-settings-layout { min-height: 0; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 0; overflow: hidden; padding: 0; }
.personal-settings-nav { min-height: 0; display: flex; flex-direction: column; gap: 4px; overflow: auto; padding: 14px 12px; border-right: 1px solid var(--line); background: var(--surface-soft); }
.personal-settings-nav button { width: 100%; min-height: 54px; display: grid; align-content: center; gap: 3px; padding: 9px 11px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: var(--text-soft); text-align: left; transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease; }
.personal-settings-nav button:hover { background: var(--surface); }
.personal-settings-nav button.active { border-color: color-mix(in srgb, var(--accent) 26%, var(--line)); background: var(--accent-soft); color: var(--accent-strong); }
.personal-settings-nav button strong { font-size: 11px; }
.personal-settings-nav button small { color: var(--muted); font-size: 9px; line-height: 1.3; }
.personal-settings-nav button.active small { color: color-mix(in srgb, var(--accent-strong) 72%, var(--muted)); }
.personal-settings-nav-spacer { flex: 1 0 18px; }
.personal-settings-nav .account-action-tab { margin-top: 4px; border-top-color: var(--line); }
.personal-settings-content { min-width: 0; min-height: 0; overflow: auto; padding: 24px 26px 34px; scroll-behavior: auto; }
.personal-settings-panel { width: min(720px, 100%); margin: 0 auto; display: grid; align-content: start; gap: 16px; }
.settings-panel-header { display: grid; gap: 4px; padding: 2px 0 5px; }
.settings-panel-header > span { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.settings-panel-header h2 { margin: 0; font-size: 20px; line-height: 1.25; }
.settings-panel-header p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.settings-panel-stack { display: grid; gap: 12px; }
.account-settings-card { display: grid; gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(135deg, var(--surface), var(--surface-soft)); }
.account-settings-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.account-settings-identity { min-width: 0; display: flex; align-items: center; gap: 12px; }
.account-settings-avatar { flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--rail); color: #fff; font-size: 17px; font-weight: 850; }
.account-settings-identity > div { min-width: 0; display: grid; gap: 2px; }
.account-settings-identity small { color: var(--muted); font-size: 9px; font-weight: 700; }
.account-settings-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.account-settings-identity p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.danger-secondary-action { min-height: 38px; padding: 0 13px; border: 1px solid #edc4c0; border-radius: 10px; background: var(--surface); color: var(--red); font-size: 10px; font-weight: 780; }
.account-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.settings-form-card { min-width: 0; display: grid; align-content: start; gap: 9px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.settings-form-card > strong { font-size: 12px; }
.settings-form-card > p { min-height: 31px; margin: 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.personal-settings-panel .settings-form-card > p { min-height: 0; }
.settings-form-card label { display: grid; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 720; }
.settings-form-card input, .settings-form-card select { width: 100%; min-height: 40px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); color: var(--text); }
.settings-form-card button { min-height: 40px; padding: 0 13px; border: 0; border-radius: 9px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 780; }
.settings-form-card output { color: var(--muted); font-size: 9px; }
.foundation-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.foundation-summary > div { min-width: 0; display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.foundation-summary span, .foundation-summary small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.foundation-summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent-strong); font-size: 14px; }
.foundation-section { gap: 12px; }
.foundation-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.foundation-form > label:has(textarea), .foundation-form > .foundation-form-grid, .foundation-form > .foundation-form-actions, .foundation-form > button, .foundation-form > .foundation-check-grid { grid-column: 1 / -1; }
.foundation-form textarea { width: 100%; min-height: 72px; padding: 9px 10px; resize: vertical; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); color: var(--text); font: inherit; line-height: 1.5; }
.foundation-form-grid, .foundation-check-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.foundation-check-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.foundation-check-grid label { display: flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); color: var(--text-soft); }
.foundation-check-grid input { width: auto; min-height: 0; accent-color: var(--accent); }
.foundation-form-actions, .foundation-record-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.foundation-form-actions .secondary-action { min-height: 40px; }
.foundation-record { display: grid; gap: 7px; }
.foundation-record.compact { gap: 3px; }
.foundation-record-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.foundation-record-heading strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foundation-record-heading small, .foundation-record-meta { color: var(--muted); font-size: 9px; line-height: 1.5; }
.foundation-record p { margin: 0; color: var(--text-soft); font-size: 10px; line-height: 1.6; white-space: pre-wrap; }
.foundation-record-actions button { min-height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--accent-strong); font-size: 9px; font-weight: 760; }
.foundation-record-actions .danger-secondary-action { min-height: 30px; color: var(--red); }
.foundation-capability-card { gap: 4px; }
.foundation-capability-card p, .foundation-capability-card small { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.model-settings-card { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.model-settings-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.model-settings-heading p, .model-settings-note { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.model-settings-heading > span { flex: 0 0 auto; padding: 4px 8px; border-radius: 99px; background: var(--surface-deep); color: var(--muted); font-size: 9px; }
.model-settings-heading > span.pending { background: #fff4dd; color: #8a5d00; }
.model-settings-heading > span.ready { background: var(--accent-soft); color: var(--accent); }
.agent-sharing-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 8px; align-items: end; }
.agent-sharing-form label { min-width: 0; display: grid; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 700; }
.agent-sharing-form select { width: 100%; min-height: 38px; padding: 0 28px 0 9px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); color: var(--text); }
.agent-sharing-form button { min-height: 38px; padding: 0 13px; border: 0; border-radius: 9px; background: var(--accent); color: #fff; font-weight: 800; }
.agent-sharing-list { display: grid; gap: 7px; }
.agent-sharing-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.agent-sharing-row div { min-width: 0; display: grid; gap: 2px; }
.agent-sharing-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.agent-sharing-row small { color: var(--muted); font-size: 9px; }
.agent-sharing-row button { flex: 0 0 auto; min-height: 30px; border: 0; background: transparent; color: var(--red); font-weight: 750; }
.model-setting-row { display: grid; grid-template-columns: minmax(120px, .7fr) minmax(220px, 1.3fr) auto; gap: 9px; align-items: center; }
.model-setting-row label { display: grid; gap: 2px; }
.model-setting-row label small { color: var(--muted); font-size: 9px; }
.model-setting-row select { min-width: 0; min-height: 42px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--text); }
.model-setting-row button { min-height: 42px; padding: 0 13px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 750; }
.host-install-card { display: grid; gap: 12px; padding: 16px; border: 1px solid #c4dfd3; border-radius: 14px; background: var(--accent-soft); }
.host-install-card p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.host-install-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.host-install-actions button { min-height: var(--tap); padding: 0 13px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 750; }
.host-enrollment-code { padding: 12px; border: 1px dashed var(--accent); border-radius: 10px; background: #fff; color: var(--accent-strong); font: 750 14px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.host-list-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.host-list-heading span { color: var(--muted); font-size: 11px; }
.host-list-section { gap: 8px; }
.host-list { display: grid; gap: 9px; }
.host-card { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.host-card.online { border-color: var(--ws-line,var(--line)); background: var(--ws-subtle,var(--surface-soft)); }
.host-card.revoked { opacity: .6; }
.host-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.host-card-heading > div { min-width: 0; display: grid; gap: 3px; }
.host-card-heading small { color: var(--muted); font-size: 10px; }
.source-heading-actions { display: flex !important; align-items: flex-end; gap: 6px; }
.host-state { flex: 0 0 auto; padding: 3px 7px; border-radius: 99px; background: var(--surface-deep); color: var(--muted); font-size: 9px; }
.host-card.online .host-state { background: var(--accent-soft); color: var(--accent); }
.host-agents { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.host-agent-state { display: flex; flex-direction: column; align-items: stretch; gap: 4px; max-width: 100%; }
.host-agent-topline { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.host-agent-metadata { color: var(--muted); font-size: 10px; line-height: 1.45; }
.source-rename-toggle { border: 0; background: transparent; color: var(--accent); padding: 2px 0; min-height: 0; font-size: 10px; cursor: pointer; }
.source-rename-form { display: flex; align-items: center; gap: 5px; }
.source-rename-form[hidden] { display: none; }
.source-rename-form input { width: min(160px, 34vw); min-height: 30px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; background: var(--surface); }
.source-rename-form button { min-height: 30px; padding: 5px 9px; font-size: 10px; }
.host-agents span { padding: 4px 7px; border-radius: 8px; background: var(--blue-soft); color: var(--blue); font-size: 10px; }
.host-agents span.ready { background: var(--accent-soft); color: var(--accent); }
.host-agents span.unavailable { background: #fff4dd; color: #9a6700; cursor: help; }
.host-agents span.muted { background: var(--surface-deep); color: var(--muted); }
.host-agent-reason { max-width: 220px; color: var(--muted); font-size: 9px; line-height: 1.35; overflow-wrap: anywhere; }
.host-remove { margin-top: 11px; padding: 0; border: 0; background: transparent; color: var(--red); font-size: 10px; }
.settings-empty-card, .settings-route-card, .account-operation-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.settings-empty-card { display: grid; gap: 5px; }
.settings-empty-card p, .settings-route-card p, .account-operation-card p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.settings-route-card > div, .account-operation-card > div { min-width: 0; }
.settings-route-card button { flex: 0 0 auto; min-height: var(--tap); padding: 0 15px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 780; }
.account-operation-card button { flex: 0 0 auto; }
.account-operation-card.danger-zone { border-color: color-mix(in srgb, var(--red) 28%, var(--line)); background: color-mix(in srgb, var(--red-soft) 58%, var(--surface)); }

/* Tenant workspace and cloud files */
.cloud-manager { width: min(1120px, calc(100vw - 24px)); height: min(780px, calc(100dvh - 24px)); padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: 0 28px 90px rgba(25,38,31,.24); }
.cloud-manager::backdrop, .project-manager::backdrop, .project-direct::backdrop, .auth-dialog::backdrop { background: rgba(20,29,25,.54); backdrop-filter: blur(4px); }
.cloud-manager-shell { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.cloud-manager-body { min-height: 0; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.cloud-folder-pane { min-width: 0; overflow: auto; padding: 12px 10px; border-right: 1px solid var(--line); background: var(--surface-soft); }
.cloud-folder-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 3px 10px; }
.cloud-folder-heading > div { min-width: 0; display: grid; gap: 2px; }
.cloud-folder-heading strong { font-size: 12px; }
.cloud-folder-heading small { color: var(--muted); font-size: 8px; }
.cloud-folder-all, .cloud-folder-select { width: 100%; min-height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--text-soft); text-align: left; font-size: 10px; font-weight: 700; }
.cloud-folder-all { padding: 0 9px; }
.cloud-folder-all.selected, .cloud-folder-row.selected { background: var(--accent-soft); color: var(--accent-strong); }
.cloud-folder-tree { display: grid; gap: 2px; margin-top: 3px; }
.cloud-folder-row { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; border-radius: 8px; }
.cloud-folder-select { overflow: hidden; padding: 0 6px; text-overflow: ellipsis; white-space: nowrap; }
.cloud-folder-row:hover { background: var(--surface-deep); }
.cloud-file-pane { min-width: 0; min-height: 0; height: 100%; display: grid; grid-template-rows: auto auto auto auto auto auto minmax(0, 1fr); }
.cloud-drive-toolbar { display: grid; grid-template-columns: auto minmax(220px, 1fr) auto; gap: 9px; align-items: center; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.cloud-file-search { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.cloud-file-search input { width: 100%; min-width: 0; min-height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-right: 0; border-radius: 10px 0 0 10px; background: var(--surface); color: var(--text); }
.cloud-file-search button { min-height: 40px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 0 10px 10px 0; background: var(--surface-soft); color: var(--accent-strong); font-size: 10px; font-weight: 800; cursor: pointer; }
.cloud-sort-control { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; }
.cloud-sort-control select { min-height: 40px; padding: 0 28px 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text-soft); font-size: 10px; }
.cloud-action-menu { position: relative; }
.cloud-action-menu > summary { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text-soft); font-size: 10px; font-weight: 800; cursor: pointer; list-style: none; transition: background-color .18s ease, border-color .18s ease; }
.cloud-action-menu > summary::-webkit-details-marker { display: none; }
.cloud-action-menu > summary:hover, .cloud-action-menu[open] > summary { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.cloud-new-menu > summary { min-height: 40px; border-color: var(--accent); background: var(--accent); color: #fff; }
.cloud-new-menu > summary:hover, .cloud-new-menu[open] > summary { background: var(--accent-strong); color: #fff; }
.cloud-new-menu > summary span { font-size: 16px; font-weight: 500; line-height: 1; }
.cloud-action-menu-popover { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 156px; display: grid; gap: 2px; padding: 6px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: 0 14px 36px rgba(25,38,31,.16); }
.cloud-action-menu-right { right: 0; left: auto; }
.cloud-action-menu-popover button, .cloud-action-menu-popover label { min-height: 34px; display: flex; align-items: center; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--text-soft); font-size: 10px; font-weight: 700; text-align: left; cursor: pointer; }
.cloud-action-menu-popover button:hover, .cloud-action-menu-popover label:hover { background: var(--surface-deep); }
.cloud-action-menu-popover .danger { color: var(--red); }
.cloud-action-menu-popover input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.cloud-breadcrumbs { min-height: 38px; display: flex; align-items: center; gap: 2px; padding: 0 15px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.cloud-breadcrumbs button { flex: 0 0 auto; min-height: 28px; padding: 0 7px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 700; cursor: pointer; }
.cloud-breadcrumbs button:hover { background: var(--surface-deep); color: var(--accent-strong); }
.cloud-breadcrumbs button:last-child { color: var(--text); }
.cloud-breadcrumbs span { color: var(--muted); font-size: 9px; }
.cloud-selection-toolbar { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 15px; border-bottom: 1px solid #bddacb; background: var(--accent-soft); }
.cloud-selection-toolbar[hidden] { display: none; }
.cloud-selection-toolbar > strong { color: var(--accent-strong); font-size: 10px; }
.cloud-selection-actions { display: flex; align-items: center; gap: 5px; }
.cloud-selection-actions > button { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text-soft); font-size: 9px; font-weight: 750; cursor: pointer; }
.cloud-selection-actions > button:disabled { opacity: .45; cursor: default; }
.cloud-selection-actions .cloud-selection-clear { width: 32px; padding: 0; border-color: transparent; background: transparent; font-size: 16px; }
.cloud-list-header, .cloud-file-row { min-width: 670px; display: grid; grid-template-columns: 28px 42px minmax(220px, 1fr) 120px 72px 38px; gap: 10px; align-items: center; }
.cloud-list-header { min-height: 34px; padding: 0 15px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 8px; font-weight: 750; }
.cloud-notice { margin: 10px 14px 0; padding: 9px 11px; border: 1px solid #c4dfd3; border-radius: 9px; background: var(--accent-soft); color: var(--accent-strong); font-size: 10px; }
.cloud-notice { margin: 10px 14px 0; padding: 9px 11px; border: 1px solid #c4dfd3; border-radius: 9px; background: var(--accent-soft); color: var(--accent-strong); font-size: 10px; }
.cloud-item-dialog { width: min(430px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: 0 24px 80px rgba(25,38,31,.26); }
.cloud-item-dialog::backdrop { background: rgba(20,29,25,.42); backdrop-filter: blur(3px); }
.cloud-item-form { display: grid; gap: 14px; padding: 18px; }
.cloud-item-form header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.cloud-item-form header > div { display: grid; gap: 4px; }
.cloud-item-form header strong { font-size: 15px; }
.cloud-item-form header small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.cloud-item-form > label { display: grid; gap: 6px; color: var(--text-soft); font-size: 10px; font-weight: 750; }
.cloud-item-form input, .cloud-item-form select { width: 100%; min-height: 42px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--text); }
.cloud-item-form output { min-height: 16px; color: var(--red); font-size: 10px; }
.cloud-item-actions { display: flex; justify-content: flex-end; gap: 8px; }
.cloud-item-actions button { min-height: 40px; padding: 0 15px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 800; }
.cloud-item-actions .secondary-action { border: 1px solid var(--line); background: var(--surface); color: var(--text-soft); }
.cloud-notice.error { border-color: #ecc8c4; background: var(--red-soft); color: var(--red); }
.cloud-file-list { min-height: 0; overflow: auto; padding: 0 15px 18px; }
.cloud-file-row { min-width: 640px; padding: 9px 0; border-bottom: 1px solid var(--line); transition: background-color .18s ease; touch-action: pan-y pinch-zoom; }
.cloud-file-row:last-child { border-bottom: 0; }
.cloud-file-row:hover, .cloud-file-row.selected { background: var(--surface-soft); }
.cloud-file-row.selected { box-shadow: inset 3px 0 0 var(--accent); }
.cloud-file-check { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.cloud-file-icon { width: 42px; height: 38px; display: grid; place-items: center; border: 1px solid #c7dce9; border-radius: 9px; background: var(--blue-soft); color: var(--blue); font: 750 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.cloud-folder-icon { border-color: #d8c998; background: #fff7d8; color: #986b00; }
.cloud-file-thumbnail { width: 42px; height: 42px; display: block; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-deep); object-fit: cover; }
.cloud-file-copy { min-width: 0; display: grid; gap: 3px; }
.cloud-file-copy strong, .cloud-file-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cloud-file-copy strong { font-size: 11px; }
.cloud-file-name-button { max-width: 100%; padding: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-weight: 750; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.cloud-file-name-button:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; }
.cloud-file-copy small { color: var(--muted); font-size: 9px; }
.cloud-file-copy .cloud-file-origin { color: var(--text-soft); font-weight: 650; }
.cloud-file-copy .cloud-file-summary { max-width: 680px; }
.cloud-item-date, .cloud-item-size { color: var(--muted); font-size: 9px; white-space: nowrap; }
.cloud-row-menu > summary { width: 32px; min-height: 32px; padding: 0; font-size: 16px; letter-spacing: .08em; }
.cloud-row-menu .cloud-action-menu-popover { right: 0; left: auto; top: calc(100% + 3px); min-width: 148px; }
.cloud-empty { min-height: 220px; display: grid; place-items: center; align-content: center; gap: 6px; color: var(--muted); text-align: center; }
.cloud-empty strong { color: var(--text-soft); font-size: 12px; }
.cloud-empty p { margin: 0; font-size: 9px; }
.cloud-file-share-select { min-height: 32px; max-width: 140px; padding: 0 24px 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--accent-strong); font-size: 9px; font-weight: 750; }
.cloud-drive-toolbar button:focus-visible, .cloud-drive-toolbar summary:focus-visible, .cloud-file-row button:focus-visible, .cloud-file-row input:focus-visible, .cloud-selection-toolbar button:focus-visible, .cloud-breadcrumbs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.workspace-card input, .workspace-card select, .auth-form input, .auth-form select { width: 100%; min-height: 42px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--text); }
.workspace-card button, .auth-form button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 0 13px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; }

@media (max-width: 1100px) and (min-width: 821px) {
  .cloud-manager-body { grid-template-columns: 210px minmax(0, 1fr); }
  .cloud-drive-toolbar { grid-template-columns: auto minmax(0, 1fr) auto; }
  .cloud-sort-control > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .cloud-sort-control select { max-width: 112px; }
  .cloud-list-header, .cloud-file-row { min-width: 0; grid-template-columns: 28px 42px minmax(0, 1fr) 38px; }
  .cloud-list-header > span:nth-child(4), .cloud-list-header > span:nth-child(5),
  .cloud-file-row .cloud-item-date, .cloud-file-row .cloud-item-size { display: none; }
}
.workspace-pane { min-width: 0; overflow: auto; padding: 14px; background: var(--surface-soft); }
.personal-workspace-pane { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; overflow: visible; padding: 0; background: transparent; }
.personal-workspace-pane .workspace-card { margin: 0; }
.workspace-card { display: grid; gap: 8px; margin: 0 0 10px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.workspace-card > strong, .workspace-card-heading strong { font-size: 12px; }
.workspace-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.workspace-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.workspace-card-heading > div { min-width: 0; display: grid; gap: 3px; }
.workspace-card-heading small { color: var(--muted); font-size: 9px; }
.workspace-card-heading button { min-height: auto; padding: 0; background: transparent; color: var(--red); font-weight: 650; }
.workspace-invite-code { padding: 9px; border: 1px dashed var(--accent); border-radius: 8px; color: var(--accent-strong); font: 750 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.workspace-members { display: grid; gap: 7px; }
.workspace-member { display: flex; justify-content: space-between; gap: 8px; padding-top: 7px; border-top: 1px solid var(--line); font-size: 10px; }
.workspace-member span:last-child { color: var(--muted); }
.group-management-shell { min-height: 560px; display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 12px; }
.group-directory { min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.group-directory-heading, .group-section-heading, .group-detail-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.group-directory-heading strong { font-size: 12px; }
.group-directory-heading span { min-width: 24px; padding: 3px 7px; border-radius: 999px; background: var(--surface-deep); color: var(--muted); text-align: center; font-size: 9px; }
.group-list { display: grid; gap: 7px; }
.group-list-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); text-align: left; }
.group-list-item.active { border-color: var(--accent); background: var(--accent-soft); }
.group-list-item span { min-width: 0; display: grid; gap: 3px; }
.group-list-item strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.group-list-item small, .group-list-item em { color: var(--muted); font-size: 8px; font-style: normal; }
.group-list-item em { flex: 0 0 auto; }
.group-list-empty { margin: 5px 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.group-action-drawer { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; }
.group-action-drawer summary { color: var(--accent); font-size: 10px; font-weight: 800; cursor: pointer; }
.group-action-drawer .workspace-card { margin-top: 8px; padding: 10px; }
.group-action-drawer textarea, .group-inline-form input, .group-inline-form select, .group-detail-section input, .group-detail-section select, .group-detail-section textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); color: var(--text); resize: vertical; }
.group-detail { min-width: 0; display: grid; align-content: start; gap: 10px; }
.group-detail-header { padding: 2px 2px 4px; }
.group-detail-header > div { min-width: 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; align-items: center; }
.group-detail-header h3 { margin: 0; font-size: 19px; letter-spacing: -.03em; }
.group-detail-header p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 9px; }
.group-detail-header button, .group-detail-section button, .group-inline-form button { min-height: 36px; padding: 0 11px; border: 0; border-radius: 9px; background: var(--accent); color: #fff; font-size: 9px; font-weight: 800; }
.group-type-badge { padding: 4px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 9px; font-weight: 800; }
.group-overview-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.group-summary-card { display: grid; gap: 3px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.group-summary-card span, .group-summary-card small { color: var(--muted); font-size: 8px; }
.group-summary-card strong { font-size: 18px; }
.group-detail-section { display: grid; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.group-section-heading strong { font-size: 11px; }
.group-section-heading span { color: var(--muted); font-size: 8px; }
.group-inline-form { display: grid; grid-template-columns: minmax(0, 1fr) 120px 100px auto; gap: 7px; }
.group-inline-form output { grid-column: 1 / -1; }
.group-member-row { align-items: center; }
.group-member-row > span:first-child { display: grid; gap: 2px; color: var(--text); }
.group-member-row small { color: var(--muted); font-size: 8px; }
.group-member-actions select { min-height: 30px; padding: 0 24px 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 9px; }
.group-member-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.group-member-actions .group-member-remove { min-height: 30px; padding: 0 8px; border: 0; border-radius: 8px; background: var(--red-soft); color: var(--red); font-size: 9px; }
.group-member-actions em { color: var(--muted); font-size: 9px; font-style: normal; }
.group-invitations, .group-audit-events, .group-resource-list { display: grid; gap: 6px; }
.group-invitation-row, .group-audit-row, .group-resource-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 7px; border-top: 1px solid var(--line); font-size: 9px; }
.group-invitation-row > span:last-child { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.group-invitation-row button { min-height: 28px; background: var(--red-soft); color: var(--red); }
.group-audit-row time, .group-resource-row small { color: var(--muted); font-size: 8px; }
.group-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.group-detail-section label { display: grid; gap: 5px; color: var(--text-soft); font-size: 9px; font-weight: 700; }
.group-detail-section .group-checkbox { display: flex; align-items: center; gap: 7px; }
.group-checkbox input { width: auto; }
.group-detail-section output { color: var(--muted); font-size: 9px; }
.group-empty { min-height: 300px; display: grid; place-items: center; align-content: center; gap: 7px; padding: 30px; border: 1px dashed var(--line-strong); border-radius: 14px; color: var(--muted); text-align: center; }
.group-empty strong { color: var(--text-soft); font-size: 13px; }
.group-empty p { max-width: 360px; margin: 0; font-size: 10px; line-height: 1.6; }

@media (max-width: 820px) {
  .group-management-shell { grid-template-columns: 1fr; }
  .group-directory { max-height: none; }
  .group-overview-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .group-inline-form, .group-form-grid { grid-template-columns: 1fr; }
}

.project-entry { min-height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--accent); font-size: 9px; font-weight: 800; }
.project-manager { width: min(980px, calc(100vw - 24px)); height: min(760px, calc(100dvh - 24px)); padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: 0 28px 90px rgba(25,38,31,.24); }
.project-manager-shell { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.project-manager-body { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 320px; }
.project-list-pane { min-width: 0; min-height: 0; overflow: auto; padding: 16px; border-right: 1px solid var(--line); background: var(--surface-soft); }
.project-list { display: grid; gap: 11px; }
.project-card, .project-empty { padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.project-card.blocked { border-color: #e8c98d; }
.project-card-heading, .project-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.project-card-heading strong { font-size: 13px; }
.project-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.project-card-action { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: var(--surface); color: var(--text); cursor: pointer; }
.project-card-action:disabled { opacity: .55; cursor: wait; }
.project-folder-choice { min-width: 140px; max-width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 7px; background: var(--surface); color: var(--text); }
.project-status { flex: 0 0 auto; padding: 4px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 9px; font-weight: 800; }
.project-card.blocked .project-status { background: #fff4dd; color: #9a6700; }
.project-goal, .project-evidence p, .project-empty p { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.project-evidence { margin-top: 11px; padding: 10px; border-radius: 10px; background: var(--surface-soft); }
.project-evidence strong { font-size: 10px; }
.project-blocker { color: #9a6700; }
.project-card-meta { margin-top: 10px; color: var(--muted); font-size: 9px; }
.project-create-pane { min-width: 0; overflow: auto; padding: 16px; }
.project-create-card { display: grid; gap: 10px; }
.project-create-card p { margin: -3px 0 2px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.project-create-card label { display: grid; gap: 5px; color: var(--text-soft); font-size: 10px; font-weight: 700; }
.project-create-card input, .project-create-card textarea { width: 100%; padding: 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--text); resize: vertical; }
.project-create-card button { min-height: 42px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 800; }
.project-create-card output, .project-error { color: var(--muted); font-size: 10px; }

.project-direct-entry { min-height: 38px; display: inline-flex; align-items: center; gap: 6px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--accent); font-size: 10px; font-weight: 800; }
.project-direct-entry svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.project-direct { width: min(1120px, calc(100vw - 24px)); height: min(800px, calc(100dvh - 24px)); padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: 0 28px 90px rgba(25,38,31,.24); }
.project-direct-shell { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.project-direct-body { min-height: 0; display: grid; grid-template-columns: 310px minmax(0, 1fr); }
.project-direct-navigation { min-height: 0; display: grid; grid-template-rows: auto auto auto auto minmax(0, 1fr); gap: 11px; padding: 15px; border-right: 1px solid var(--line); background: var(--surface-soft); }
.project-direct-navigation label { display: grid; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 750; }
.project-direct-navigation select { width: 100%; min-height: 42px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--text); }
.project-direct-thread-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.project-direct-thread-heading span { display: flex; gap: 6px; }
.project-direct-thread-heading button { min-height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--accent); font-size: 9px; font-weight: 750; }
.project-direct-create-thread { display: grid; gap: 7px; padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.project-direct-create-thread[hidden] { display: none; }
.project-direct-create-thread textarea { width: 100%; min-height: 62px; padding: 8px 9px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); resize: vertical; }
.project-direct-create-thread div { display: flex; justify-content: flex-end; gap: 6px; }
.project-direct-create-thread button { min-height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--accent); font-size: 9px; font-weight: 750; }
.project-direct-threads { min-height: 0; overflow: auto; display: grid; align-content: start; gap: 7px; }
.project-direct-thread { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--text); text-align: left; }
.project-direct-thread.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.project-direct-thread-copy { min-width: 0; display: grid; gap: 4px; }
.project-direct-thread-copy strong, .project-direct-thread-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-direct-thread-copy small, .project-direct-thread time { color: var(--muted); font-size: 9px; }
.project-direct-state { width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: var(--ws-muted,#73736f); }
.project-direct-state.running { background: var(--accent); animation: projectDirectPulse 1s ease-in-out infinite; }
.project-direct-state.failed, .project-direct-state.system_error { background: var(--red); }
@keyframes projectDirectPulse { 50% { opacity: .35; transform: scale(.75); } }
.project-direct-conversation { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; }
.project-direct-thread-header { display: grid; gap: 3px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.project-direct-thread-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.project-direct-release { min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); font-size: 11px; font-weight: 700; }
.project-direct-release:disabled { opacity: .5; cursor: default; }
.project-direct-interrupt { min-height: 30px; padding: 0 10px; border: 1px solid #e8a3a0; border-radius: 9px; background: #fff4f3; color: var(--red); font-size: 9px; font-weight: 800; }
.project-direct-thread-header small { color: var(--muted); font-size: 10px; }
.project-direct-messages { min-height: 0; overflow: auto; display: grid; align-content: start; gap: 10px; padding: 18px; }
.project-direct-message { max-width: min(760px, 88%); display: grid; gap: 5px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-soft); }
.project-direct-message.user { justify-self: end; background: var(--accent); color: #fff; border-color: var(--accent); }
.project-direct-message small { font-size: 9px; font-weight: 750; opacity: .7; }
.project-direct-message p, .project-direct-message summary { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; line-height: 1.6; }
.project-direct-message details > p { margin-top: 8px; }
.project-direct-empty { place-self: center; max-width: 360px; text-align: center; color: var(--muted); }
.project-direct-empty p { font-size: 10px; line-height: 1.6; }
.project-direct-composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; padding: 12px 16px 6px; border-top: 1px solid var(--line); }
.project-direct-composer textarea { width: 100%; max-height: 120px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface); color: var(--text); resize: none; }
.project-direct-composer button { min-width: 84px; border: 0; border-radius: 11px; background: var(--accent); color: #fff; font-weight: 800; }
.project-direct-composer button:disabled { opacity: .55; }
.project-direct-status { min-height: 23px; padding: 0 17px 8px; color: var(--muted); font-size: 9px; }

.auth-dialog { width: min(430px, calc(100vw - 24px)); padding: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--text); box-shadow: 0 28px 90px rgba(25,38,31,.24); }
.auth-shell { display: grid; gap: 16px; padding: 26px; }
.auth-topline { display: flex; align-items: center; justify-content: space-between; }
.auth-topline > button { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--muted); font-size: 22px; }
.auth-brand { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 16px; background: var(--rail); color: #fff; font-size: 20px; font-weight: 850; }
.auth-shell h2 { margin: 0; font-size: 22px; }
.auth-shell p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.auth-panel { display: grid; gap: 16px; }
.auth-panel[hidden] { display: none; }
.auth-kicker { display: block; margin-bottom: 5px; color: var(--accent); font-size: 9px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.auth-back { width: fit-content; padding: 0; border: 0; background: none; color: var(--accent); font-size: 10px; font-weight: 800; cursor: pointer; }
.auth-form { display: grid; gap: 10px; }
.auth-form label { display: grid; gap: 5px; color: var(--text-soft); font-size: 10px; font-weight: 700; }
.auth-route { display: flex; align-items: center; justify-content: center; gap: 5px; padding-top: 3px; color: var(--muted); font-size: 10px; }
.auth-route button, .auth-secondary-routes button { padding: 0; border: 0; background: none; color: var(--accent); font-size: inherit; font-weight: 800; cursor: pointer; }
.auth-secondary-routes { display: flex; justify-content: center; gap: 16px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.auth-error { min-height: 18px; color: var(--red) !important; }
.auth-dialog[open] { max-height: calc(100dvh - 24px); overflow: auto; }
.registration-form output { min-height: 15px; color: var(--muted); font-size: 10px; }
.otp-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.otp-field button { min-width: 94px; padding-inline: 10px; }
.onboarding-dialog { width: min(560px, calc(100vw - 24px)); }
#onboarding-close { width: auto; min-width: 54px; padding: 0 12px; border-radius: 99px; font-size: 10px; font-weight: 800; }
#onboarding-profile-step, #onboarding-ready-step { display: grid; gap: 16px; }
#onboarding-profile-step[hidden], #onboarding-ready-step[hidden] { display: none; }
.onboarding-progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.onboarding-progress > * { min-height: 26px; display: grid; place-items: center; border-radius: 99px; background: var(--surface-deep); color: var(--muted); font-size: 9px; }
.onboarding-progress > b, .onboarding-progress.complete > * { background: var(--accent-soft); color: var(--accent); }
.onboarding-profile-form output { min-height: 15px; color: var(--muted); font-size: 10px; }
.assistant-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 0; padding: 0; border: 0; }
.assistant-choice legend { grid-column: 1 / -1; margin-bottom: 1px; color: var(--text-soft); font-size: 10px; font-weight: 700; }
.assistant-choice label { position: relative; display: block; }
.assistant-choice input { position: absolute; opacity: 0; pointer-events: none; }
.assistant-choice label > span { min-height: 66px; display: grid; align-content: center; gap: 3px; padding: 11px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); cursor: pointer; }
.assistant-choice label > span b { color: var(--text); font-size: 13px; }
.assistant-choice label > span small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.assistant-choice input:checked + span { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 14%, transparent); }
.assistant-choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.onboarding-steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.onboarding-steps li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.onboarding-steps li > b { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-deep); color: var(--muted); }
.onboarding-steps li.done > b { background: var(--accent-soft); color: var(--accent); }
.onboarding-steps span { display: grid; gap: 3px; }
.onboarding-steps strong { font-size: 12px; }
.onboarding-steps small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.onboarding-steps button, .onboarding-start { min-height: 38px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--accent); color: white; font-weight: 800; }
.onboarding-start { min-height: 46px; }

@keyframes voice-pulse { 0% { box-shadow: 0 0 0 0 rgba(22,132,95,.35); } 80%,100% { box-shadow: 0 0 0 9px rgba(22,132,95,0); } }
@keyframes voice-thinking-orb { 0% { box-shadow: 0 0 0 0 rgba(22,132,95,.35); } 80%,100% { box-shadow: 0 0 0 8px rgba(22,132,95,0); } }
@keyframes voice-thinking-dot { 0%,100% { opacity: .3; transform: translateY(1px); } 50% { opacity: 1; transform: translateY(-2px); } }

@media (min-width: 768px) {
  .app-shell { grid-template-columns: 72px minmax(0, 1fr); }
  .side-rail { display: flex; flex-direction: column; align-items: center; gap: 28px; padding: 14px 8px; }
  .mobile-nav { display: none; }
  body[data-surface="conversation"] .assistant-main { padding-bottom: 0; }
  body[data-surface="tasks"] .assistant-main { display: grid; }
  body[data-surface="tasks"] .task-panel { position: fixed; z-index: 30; top: 0; right: 0; bottom: 0; width: min(390px, calc(100vw - 72px)); display: flex; padding-bottom: 0; border-left: 1px solid var(--line); box-shadow: -18px 0 50px rgba(24,38,31,.14); }
  .assistant-header { padding-inline: 22px; }
  .conversation { padding: 30px max(24px, calc((100vw - 922px) / 2)) 22px; }
  .composer { padding: 9px 22px 14px; }
  .message-actions { opacity: 0; }
}

@media (min-width: 1180px) {
  .app-shell { grid-template-columns: 72px minmax(0, 1fr) 390px; }
  .task-panel, body[data-surface="tasks"] .task-panel { position: static; width: auto; display: flex; padding-bottom: 0; box-shadow: none; }
  .panel-close, .task-entry { display: none; }
  .host-entry { display: inline-flex; }
  .conversation { padding-inline: max(24px, calc((100vw - 1312px) / 2)); }
}

@media (min-width: 561px) and (max-width: 1040px) {
  .hero-section { min-height: auto; grid-template-columns: 1fr; padding-top: 72px; }
  .hero-copy { max-width: 760px; }
  .hero-product { width: min(760px, 92vw); justify-self: center; }
  .statement-grid article { padding-inline: 24px; }
  .architecture-track { grid-template-columns: 1fr; }
  .layer-link { justify-self: center; transform: rotate(90deg); }
  .download-section { grid-template-columns: 1fr; }
  .download-intro { position: static; }
}

@media (max-width: 560px) {
  .project-manager-body { grid-template-columns: 1fr; overflow: auto; }
  .project-list-pane { min-height: 280px; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
  .project-direct-entry span { display: none; }
  .project-direct-entry { width: 38px; padding: 0; justify-content: center; }
  .project-direct-body { grid-template-columns: 1fr; grid-template-rows: minmax(220px, 36%) minmax(0, 1fr); }
  .project-direct-navigation { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto minmax(0, 1fr); border-right: 0; border-bottom: 1px solid var(--line); }
  .project-direct-thread-heading { grid-column: 1 / -1; }
  .project-direct-create-thread { grid-column: 1 / -1; }
  .project-direct-threads { grid-column: 1 / -1; display: flex; overflow-x: auto; }
  .project-direct-thread { min-width: 220px; }
  .agent-sharing-form { grid-template-columns: 1fr; }
  .site-header { width: calc(100% - 32px); height: 70px; grid-template-columns: 1fr auto; }
  .site-nav { display: none; }
  .site-brand strong { font-size: 17px; }
  .site-login { min-width: 76px; min-height: 36px; }
  .hero-section { width: calc(100% - 32px); min-height: auto; display: block; padding: 54px 0 75px; }
  .hero-copy h1 { font-size: 51px; }
  .hero-lead { margin-top: 24px; font-size: 15px; line-height: 1.75; }
  .hero-actions { display: grid; grid-template-columns: 1fr; }
  .primary-cta, .secondary-cta { width: 100%; }
  .hero-proof { display: grid; gap: 9px; }
  .hero-product { min-height: 390px; margin-top: 50px; }
  .product-window { width: 112%; min-height: 340px; transform: translateX(-1%) perspective(1400px) rotateY(-4deg) rotateX(2deg); }
  .window-bar { height: 48px; }
  .window-body { min-height: 292px; grid-template-columns: 42px minmax(0, 1fr); }
  .window-tasks { display: none; }
  .window-rail { gap: 10px; }
  .window-chat { padding: 20px 14px 14px; }
  .floating-card { padding: 10px; }
  .file-card-demo { left: -2%; top: -2%; }
  .host-card-demo { right: -4%; bottom: -3%; }
  .statement-section { padding-block: 78px; }
  .statement-section > h2 { font-size: 40px; }
  .statement-grid { grid-template-columns: 1fr; margin-top: 54px; }
  .statement-grid article { min-height: 220px; padding-inline: 8px; }
  .statement-grid h3 { margin-top: 37px; }
  .section-heading { display: block; }
  .section-heading h2 { margin-top: 18px; font-size: 40px; }
  .architecture-section { padding-block: 78px; }
  .architecture-track { grid-template-columns: 1fr; margin-top: 45px; }
  .layer-card { min-height: 260px; }
  .layer-card > p { margin-top: 39px; }
  .layer-link { justify-self: center; transform: rotate(90deg); }
  .download-section { display: block; padding-block: 80px; }
  .download-intro { position: static; }
  .download-intro h2 { font-size: 42px; }
  .download-grid { grid-template-columns: 1fr; margin-top: 45px; }
  .download-card { min-height: 275px; }
  .closing-section { min-height: 520px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding-block: 75px; }
  .closing-section h2 { font-size: 49px; }
  .closing-login { width: 138px; height: 138px; align-self: flex-end; }
  .site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; padding-block: 28px; }
  .site-footer p { width: 100%; order: 3; }
  .assistant-header { min-height: 64px; padding: 9px 12px; }
  .assistant-avatar { width: 38px; height: 38px; border-radius: 12px; }
  .mobile-personal-entry { display: grid; }
  .task-entry > span { display: none; }
  .workspace-control select { width: 92px; max-width: 92px; }
  .conversation { padding: 18px 14px; }
  .message { max-width: 92%; }
  .message-actions { opacity: 1; }
  .voice-dock { width: calc(100% - 20px); margin-bottom: 5px; padding: 11px; }
  .voice-io-grid { grid-template-columns: 1fr; }
  .voice-boundary { display: none; }
  .composer { padding: 6px 10px 9px; }
  .composer-box { padding: 9px; border-radius: 15px; }
  .composer-action { width: var(--tap); padding: 0; justify-content: center; }
  .composer-action span { display: none; }
  .voice-pipeline-control { width: auto; max-width: 122px; padding-inline: 7px; }
  .voice-pipeline-control > span { display: none; }
  .voice-pipeline-control select { max-width: 106px; font-size: 9px; }
  .agent-target-control { max-width: 146px; padding-inline: 7px; }
  .agent-target-control > span { display: none; }
  .agent-target-control select { max-width: 128px; font-size: 9px; }
  .send-button { width: var(--tap); padding: 0; }
  .send-button span { display: none; }
  .composer-hint { display: none; }
  .artifact-file { grid-template-columns: 34px minmax(0, 1fr); }
  .artifact-file-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .file-preview { width: 100vw; height: 100dvh; max-width: none; max-height: none; border: 0; border-radius: 0; }
  .host-manager { width: 100vw; max-width: none; height: 100dvh; max-height: none; border: 0; border-radius: 0; }
  .foundation-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foundation-form, .foundation-form-grid, .foundation-check-grid { grid-template-columns: 1fr; }
  .host-manager-body.personal-settings-layout { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .personal-settings-nav { min-height: auto; flex-direction: row; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 9px 10px; border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .personal-settings-nav::-webkit-scrollbar { display: none; }
  .personal-settings-nav button { flex: 0 0 auto; width: auto; min-height: 40px; padding: 7px 11px; white-space: nowrap; }
  .personal-settings-nav button small, .personal-settings-nav-spacer { display: none; }
  .personal-settings-nav .account-action-tab { margin-top: 0; border-top-color: transparent; }
  .personal-settings-content { padding: 18px 14px 28px; }
  .settings-panel-header h2 { font-size: 18px; }
  .settings-route-card, .account-operation-card { align-items: flex-start; flex-direction: column; }
  .settings-route-card button, .account-operation-card button { width: 100%; }
  .personal-workspace-pane { grid-template-columns: 1fr; }
  .model-setting-row { grid-template-columns: 1fr auto; }
  .model-setting-row label { grid-column: 1 / -1; }
  .cloud-manager { width: 100vw; max-width: none; height: 100dvh; max-height: none; border: 0; border-radius: 0; }
  .cloud-manager-body { display: block; overflow: auto; }
  .cloud-folder-pane { max-height: 220px; border-right: 0; border-bottom: 1px solid var(--line); }
  .cloud-file-pane { min-height: 58dvh; border-right: 0; border-bottom: 1px solid var(--line); }
  .cloud-drive-toolbar { grid-template-columns: auto minmax(0, 1fr); }
  .cloud-sort-control { grid-column: 1 / -1; }
  .cloud-sort-control select { flex: 1; }
  .cloud-list-header { display: none; }
  .cloud-file-list { padding-top: 5px; }
  .cloud-file-row { min-width: 0; grid-template-columns: 24px 36px minmax(0, 1fr) 34px; gap: 8px; }
  .cloud-file-icon { width: 36px; height: 34px; }
  .cloud-file-thumbnail { width: 36px; height: 36px; }
  .cloud-item-date, .cloud-item-size { display: none; }
  .cloud-selection-toolbar { align-items: flex-start; }
  .cloud-selection-actions { flex-wrap: wrap; justify-content: flex-end; }
  .file-preview-actions { flex-wrap: wrap; }
}

/* Unified client experience V3 */
.brand-mark { flex: 0 0 auto; padding: 0; border: 0; cursor: pointer; }
.assistant-main { position: relative; }
.companion-surface { min-width: 0; min-height: 0; display: none; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; background: radial-gradient(circle at 50% 36%, var(--accent-soft), var(--surface) 55%); }
.surface-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent); }
.surface-header small { color: var(--muted); font-size: 10px; font-weight: 750; }
.surface-header h1 { margin: 2px 0 0; font-size: 20px; }
.companion-stage { position: relative; min-height: 0; display: grid; place-items: center; align-content: center; gap: 22px; overflow: hidden; padding: 32px; }
.companion-halo { position: absolute; width: min(68vw, 620px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 20%, transparent), transparent 67%); filter: blur(12px); }
.companion-avatar-v3 { position: relative; width: clamp(190px, 29vw, 330px); aspect-ratio: 1; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line)); border-radius: 43% 57% 48% 52% / 45% 43% 57% 55%; background: linear-gradient(145deg, #fff4df, #f8cda8 52%, #a1c9ff); box-shadow: 0 28px 80px color-mix(in srgb, var(--accent) 18%, transparent); color: #4e392e; transform: rotate(-2deg); }
.companion-avatar-v3::before, .companion-avatar-v3::after { content: ""; position: absolute; top: 42%; width: 16px; height: 22px; border-radius: 50%; background: #3c322d; }
.companion-avatar-v3::before { left: 31%; }
.companion-avatar-v3::after { right: 31%; }
.companion-avatar-v3 span { margin-top: 40%; font-size: 13px; font-weight: 850; opacity: .62; }
.companion-copy { position: relative; display: grid; grid-template-columns: auto auto; align-items: center; justify-content: center; gap: 7px; text-align: center; }
.companion-copy p { grid-column: 1 / -1; max-width: 420px; margin: 2px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.companion-actions { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.companion-actions button { min-height: var(--tap); padding: 0 18px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--text); font-weight: 750; }
.companion-actions button:last-child { border-color: var(--accent); background: var(--accent); color: #fff; }
body[data-surface="companion"] .companion-surface { display: grid; }
body[data-surface="companion"] .assistant-main, body[data-surface="companion"] .task-panel { display: none; }

.jump-to-latest { position: absolute; z-index: 8; right: 24px; bottom: 126px; min-height: 38px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 99px; background: var(--surface); color: var(--accent); box-shadow: 0 8px 26px rgba(23,36,29,.14); font-size: 11px; font-weight: 780; }

/* Local brain debugger: deliberately lives inside the assistant message. */
.message-debug { margin: 10px 0 2px; padding: 8px 0 0; border-top: 1px dashed var(--line-strong); color: var(--text-soft); }
.message-debug-title { width: fit-content; color: var(--accent); font-size: 11px; font-weight: 800; cursor: pointer; list-style: none; }
.message-debug-title::-webkit-details-marker { display: none; }
.message-debug-title::before { content: "▾"; display: inline-block; margin-right: 5px; color: var(--muted); }
.message-debug:not([open]) .message-debug-title::before { content: "▸"; }
.message-debug-body { display: grid; gap: 3px; margin-top: 5px; padding-left: 16px; }
.message-debug-body p { margin: 0; color: var(--muted); font: 10px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.execution-options { position: relative; }
.execution-options > summary { min-height: var(--tap); display: inline-flex; align-items: center; padding: 0 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); color: var(--muted); font-size: 10px; font-weight: 720; cursor: pointer; list-style: none; }
.execution-options > summary::-webkit-details-marker { display: none; }
.execution-options[open] > summary { border-color: color-mix(in srgb, var(--accent) 38%, var(--line)); color: var(--accent); }
.execution-options-menu { position: absolute; z-index: 20; bottom: calc(100% + 8px); left: 0; width: min(310px, calc(100vw - 32px)); display: grid; gap: 7px; padding: 9px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: 0 18px 55px rgba(19,31,25,.18); }
.execution-options-menu .agent-target-control, .execution-options-menu .voice-pipeline-control { width: 100%; justify-content: space-between; }

.task-panel { display: none; background: var(--surface-soft); }
.task-toolbar { display: grid; grid-template-columns: minmax(180px, 1fr) 160px; gap: 8px; padding: 12px 16px 8px; }
.task-toolbar input, .task-toolbar select { min-width: 0; min-height: var(--tap); padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); }
.task-filters { flex-wrap: wrap; overflow: visible; padding: 0 16px 11px; }
.task-workspace { min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); overflow: hidden; border-top: 1px solid var(--line); }
.tasks { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; overflow: auto; padding: 12px; border-right: 1px solid var(--line); }
.task-summary { width: 100%; min-width: 0; display: grid; gap: 7px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--text); text-align: left; transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease; }
.task-summary:hover { border-color: var(--line-strong); background: color-mix(in srgb, var(--surface) 86%, var(--accent-soft)); }
.task-summary.selected { border-color: color-mix(in srgb, var(--accent) 44%, var(--line)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 10%, transparent); }
.task-summary-heading, .task-summary-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.task-summary-heading time { color: var(--muted); font-size: 9px; }
.task-summary-title { overflow: hidden; font-size: 13px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.task-summary-copy { display: -webkit-box; overflow: hidden; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.task-next-run { margin:0; color:var(--accent); font-size:11px; line-height:1.5; }
.task-summary-meta { justify-content: flex-start; color: var(--muted); font-size: 9px; }
.task-summary-meta span + span::before { content: "·"; margin-right: 8px; color: var(--line-strong); }
.task-summary-meta .attention-dot { color: var(--accent); font-weight: 760; }
.task-state { width: fit-content; display: inline-flex; align-items: center; min-height: 22px; padding: 0 7px; border-radius: 99px; background: var(--surface-deep); color: var(--muted); font-size: 9px; font-weight: 800; }
.task-state.result { background: var(--accent-soft); color: var(--accent); }
.task-state.attention { background: var(--amber-soft); color: var(--amber); }
.task-state.danger { background: var(--red-soft); color: var(--red); }
.task-state.active { background: var(--blue-soft); color: var(--blue); }
.task-detail { min-width: 0; min-height: 0; overflow: auto; background: var(--surface); }
.task-detail-empty { min-height: 100%; display: grid; place-items: center; align-content: center; gap: 5px; padding: 30px; color: var(--muted); text-align: center; }
.task-detail-empty p { margin: 0; font-size: 11px; }
.task-detail-content { width: min(840px, 100%); display: grid; gap: 16px; margin: 0 auto; padding: 22px; }
.task-detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.task-detail-heading > div:first-child { min-width: 0; display: grid; gap: 7px; }
.task-detail-heading h3 { margin: 0; font-size: 22px; line-height: 1.35; }
.task-detail-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.task-organize-actions { flex: 0 0 auto; display: flex; gap: 7px; }
.task-attention-clear-action { min-height: var(--tap); padding: 0 13px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 750; }
.task-result-section, .task-detail-section, .task-facts, .task-diagnostic { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.task-result-section { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); background: color-mix(in srgb, var(--surface) 78%, var(--accent-soft)); }
.section-eyebrow { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.task-result-section h4 { margin: 5px 0 0; font-size: 16px; }
.task-result-summary, .task-detail-section > p { margin: 8px 0 0; color: var(--text-soft); font-size: 12px; line-height: 1.65; }
.task-result-deliverable { margin-top: 14px; color: var(--text); font-size: 14px; line-height: 1.75; overflow-wrap: anywhere; }
.task-result-deliverable > :first-child { margin-top: 0; }
.task-result-deliverable > :last-child { margin-bottom: 0; }
.task-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 0; }
.task-facts dt { color: var(--muted); font-size: 10px; }
.task-facts dd { margin: 0; color: var(--text-soft); font-size: 10px; }
.task-original-request { white-space: pre-wrap; }
.task-diagnostic summary { color: var(--muted); font-size: 11px; font-weight: 750; cursor: pointer; }
.task-detail-refine { margin-top: 0; }
.task-primary-action { min-height: var(--tap); border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 780; }

body[data-surface="tasks"] .assistant-main, body[data-surface="tasks"] .companion-surface { display: none; }
body[data-surface="tasks"] .task-panel { position: static; z-index: auto; width: auto; min-width: 0; display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto; padding-bottom: calc(58px + env(safe-area-inset-bottom)); border-left: 0; box-shadow: none; }
body[data-surface="cloud"] .assistant-main, body[data-surface="cloud"] .companion-surface, body[data-surface="cloud"] .task-panel { display: none; }
.cloud-manager[open] { position: fixed; z-index: 12; inset: 0 0 calc(58px + env(safe-area-inset-bottom)) 0; width: auto; max-width: none; height: auto; max-height: none; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.cloud-manager[open] .cloud-manager-shell { height: 100%; }
.cloud-manager[open] .cloud-file-pane { min-height: 0; }

/* Assistant skill and knowledge marketplace MVP. */
.marketplace-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.marketplace-summary > div { display: grid; gap: 5px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.marketplace-summary span { color: var(--muted); font-size: 10px; }
.marketplace-summary strong { font-size: 24px; }
.marketplace-section { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-soft); }
.knowledge-collections { display:grid; gap:10px; padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.knowledge-collection-list { display:grid; gap:8px; }
.knowledge-collection-card { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px; border:1px solid var(--line); border-radius:10px; background:var(--surface-soft); }
.knowledge-collection-card.selected { border-color:var(--accent); box-shadow:inset 3px 0 var(--accent); }
.knowledge-collection-form { display:grid; gap:6px; padding-top:8px; border-top:1px solid var(--line); }
.knowledge-collection-form output { color:var(--red); font-size:10px; }
.marketplace-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.marketplace-section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.marketplace-section-heading > span, .marketplace-import-form output, #knowledge-index-status { color: var(--accent); font-size: 10px; }
.marketplace-card-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.marketplace-package-card { min-width: 0; display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.marketplace-package-card.enabled { border-color: color-mix(in srgb, var(--accent) 38%, var(--line)); box-shadow: inset 3px 0 var(--accent); }
.marketplace-package-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.marketplace-package-copy { min-width: 0; }
.marketplace-package-copy p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.marketplace-toggle { flex: 0 0 auto; min-height: 34px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 99px; background: var(--surface-soft); color: var(--muted); font-size: 10px; font-weight: 800; }
.marketplace-toggle.enabled { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.marketplace-package-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.marketplace-package-tags span { padding: 3px 7px; border-radius: 99px; background: var(--surface-deep); color: var(--muted); font-size: 8px; font-weight: 750; }
.marketplace-package-meta { color: var(--muted); font-size: 9px; overflow-wrap: anywhere; }
.marketplace-package-details { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 5px 10px; padding-top: 9px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.marketplace-package-details strong { color: var(--text-soft); }
.marketplace-share-controls { display: grid; gap: 7px; padding-top: 9px; border-top: 1px solid var(--line); }
.marketplace-access-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.marketplace-access-badges > span { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 99px; background: var(--surface-deep); color: var(--muted); font-size: 8px; font-weight: 750; }
.marketplace-access-badges > span.personal { color: var(--accent); }
.marketplace-access-badges button { padding: 0; border: 0; background: none; color: var(--red); font: inherit; cursor: pointer; }
.marketplace-share-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.marketplace-share-form select { min-width: 0; min-height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text-soft); font-size: 9px; }
.marketplace-share-form button { min-height: 34px; padding: 0 9px; border: 1px solid var(--accent); border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 9px; font-weight: 750; }
.marketplace-inline-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, .6fr) minmax(130px, .45fr) auto; gap: 8px; }
.marketplace-inline-form input, .marketplace-inline-form select, .marketplace-import-form textarea { min-width: 0; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--text); }
.marketplace-inline-form input, .marketplace-inline-form select { min-height: var(--tap); padding: 0 11px; }
.marketplace-inline-form button, .marketplace-import-form button { min-height: var(--tap); padding: 0 14px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 780; }
.marketplace-import-drawer summary { color: var(--text-soft); font-size: 11px; font-weight: 780; cursor: pointer; }
.marketplace-import-drawer[open] summary { margin-bottom: 10px; }
.marketplace-import-form textarea { padding: 11px; line-height: 1.6; resize: vertical; }
.marketplace-import-form + .marketplace-inline-form { margin-top: 9px; grid-template-columns: minmax(0, 1fr) auto; }
.marketplace-record-list, .marketplace-search-results { display: grid; gap: 8px; }
.marketplace-record-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.marketplace-record-row > .marketplace-share-controls { flex: 1 0 100%; }
.marketplace-record-copy { min-width: 0; display: grid; gap: 4px; }
.marketplace-record-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.marketplace-record-copy small { color: var(--muted); font-size: 9px; }
.marketplace-record-actions { flex: 0 0 auto; display: flex; gap: 6px; }
#knowledge-document-list .marketplace-record-actions { flex: 1 1 100%; min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
#knowledge-document-list .marketplace-record-actions select { flex: 1 1 130px; min-width: 0; max-width: 180px; }
.knowledge-links-dialog { width:min(620px, calc(100% - 24px)); max-height:85dvh; overflow:auto; padding:20px; border:1px solid var(--line); border-radius:20px; color:var(--text); background:var(--surface); box-shadow:0 24px 64px #0003; }
.knowledge-links-dialog::backdrop { background:#10272155; }
.knowledge-links-dialog > .settings-form-card { padding:0; border:0; background:transparent; }
.knowledge-link-row { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; padding:16px 0; border-top:1px solid var(--line); }
.knowledge-link-row .marketplace-record-copy { flex:1 1 240px; }
.knowledge-link-row .marketplace-record-actions { flex-wrap:wrap; }
.knowledge-source-warning { color:var(--text-soft); }
.document-knowledge-association { display:inline-flex; flex-wrap:wrap; align-items:center; gap:6px; }
.marketplace-record-action { min-height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); color: var(--text-soft); font-size: 9px; font-weight: 750; }
.marketplace-record-action.danger { color: var(--red); }
.marketplace-search-hit { display: grid; gap: 7px; padding: 12px; border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--surface) 88%, var(--accent-soft)); }
.marketplace-search-hit p { margin: 0; color: var(--text-soft); font-size: 11px; line-height: 1.65; }
.marketplace-search-hit small, .marketplace-empty { margin: 0; color: var(--muted); font-size: 9px; }
.marketplace-empty.error { color: var(--red); }

@media (min-width: 768px) {
  .app-shell, body[data-surface="tasks"] .app-shell { grid-template-columns: 72px minmax(0, 1fr); }
  .side-rail { position: relative; z-index: 20; }
  body[data-surface="tasks"] .task-panel { grid-column: 2; padding-bottom: 0; }
  .cloud-manager[open] { inset: 0 0 0 72px; }
  .companion-surface { grid-column: 2; }
}

@media (max-width: 767px) {
  .mobile-nav { grid-template-columns: repeat(4, 1fr); padding-inline: 6px; }
  .companion-surface { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
  .surface-header { min-height: 64px; padding: 9px 12px; }
  .companion-stage { padding: 20px 16px; }
  .task-toolbar { grid-template-columns: minmax(0, 1fr) 126px; padding-inline: 12px; }
  .task-filters { flex-wrap: nowrap; overflow-x: auto; padding-inline: 12px; }
  .task-workspace { display: block; overflow: auto; }
  .tasks { overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
  .task-detail { overflow: visible; }
  .task-detail-content { padding: 16px 12px 28px; }
  .task-detail-heading { display: grid; }
  .task-organize-actions { width: 100%; }
  .task-organize-actions > * { flex: 1; }
  .jump-to-latest { right: 12px; bottom: 136px; }
  .execution-options-menu { right: 0; left: auto; }
  .message-debug-body { padding-left: 12px; }
  .marketplace-summary { grid-template-columns: 1fr; }
  .marketplace-card-list { grid-template-columns: 1fr; }
  .marketplace-inline-form { grid-template-columns: 1fr; }
  .marketplace-record-row { align-items: flex-start; flex-direction: column; }
  .marketplace-record-actions { width: 100%; }
  .marketplace-record-actions button { flex: 1; }
}

@media (prefers-color-scheme: dark) {
  body[data-access="app"] {
    color-scheme: dark;
    --bg: #101512; --surface: #171d19; --surface-soft: #1d2520; --surface-deep: #26302a;
    --text: #f1f5f2; --text-soft: #d1d9d4; --muted: #9aa69f; --line: #303b35; --line-strong: #45524b;
    --accent: #55c99d; --accent-strong: #7de0ba; --accent-soft: #18382d; --blue: #75bce9; --blue-soft: #193247;
    --amber: #e7af53; --amber-soft: #3b2e18; --red: #ed8d84; --red-soft: #3d211f; --rail: #0c120f;
  }
  body[data-access="app"] .assistant-header, body[data-access="app"] .mobile-nav { background: rgba(23,29,25,.96); }
  body[data-access="app"] .assistant-avatar, body[data-access="app"] .brand-mark, body[data-access="app"] .personal-entry-avatar { background: #f2f5f3; color: #15231e; }
  body[data-access="app"] .companion-avatar-v3 { border-color: #665a4b; }
  body[data-access="app"] .markdown-body a { color: #78c7f2; }
  body[data-access="app"] .markdown-body code { border-color: #344954; background: #1b2d35; color: #9bdcf7; }
  body[data-access="app"] .unread-messages { border-color: #6a5228; background: #342916; color: #f2bd63; }
  body[data-access="app"] .artifact-image, body[data-access="app"] .artifact-image-button { background: #101512; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.brain-mode-options { display: flex; gap: 12px; flex-wrap: wrap; }
.brain-mode-options button[aria-pressed="true"] { background: #205d66; color: #fff; border-color: #205d66; }
#brain-mode-feedback { min-height: 1.5em; }

/* Settings hub: one source for each setting, with explicit scope and grouped navigation. */
.settings-nav-group { padding: 13px 11px 5px; font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.personal-settings-nav button strong { font-size: 13px; }
.personal-settings-nav button small { font-size: 11px; }
.personal-settings-panel { width: min(100%, 960px); }
.settings-note { font-size:13px; color:var(--text-soft); line-height:1.7; overflow-wrap:anywhere; }
.settings-scope-note { background: var(--accent-soft); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 15px 18px; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.settings-quick-links, .group-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.settings-quick-links button, .group-tabs button { min-height: 38px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; background: var(--surface); color: var(--text); cursor: pointer; }
.group-tabs { padding: 12px 0; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.group-tabs [aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent); }
.group-detail, [data-group-panel], #group-library, #group-messages, #group-relations { min-width: 0; }
.group-detail .settings-form-card { margin: 12px 0; }
.group-detail .settings-form-card label { display: grid; gap: 6px; font-size: 13px; }
.group-detail select, .group-detail textarea, .group-detail input { max-width: 100%; min-width: 0; }
.group-detail h4 { margin: 20px 0 10px; font-size: 14px; }
#settings-runtime-frame { width: 100%; min-height: 72vh; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.personal-settings-layout :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[data-group-panel][hidden], .personal-settings-panel[hidden] { display: none !important; }
@media(max-width:820px) { .settings-nav-group { display: none; } }
@media(max-width:600px) { .settings-hub-grid { grid-template-columns: 1fr; }.settings-hub-card { padding: 17px; }.group-tabs button { flex: 1 0 auto; font-size: 12px; } }
.group-management-shell { display: block; min-height: 0; }
.group-management-shell .group-directory { margin-bottom: 18px; }
.group-management-shell .group-list { grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); }
.group-detail .settings-note { font-size: 13px; }
.group-detail-section button, .group-detail-section input, .group-detail-section select, .group-detail-section textarea { font-size: 12px; }
.group-summary-card span, .group-summary-card small { font-size: 11px; }
.group-list-item strong { font-size: 13px; }.group-list-item small, .group-list-item em { font-size: 11px; }

/* Two-pane settings: one persistent category list and one detail surface. */
.host-manager { width:min(1160px,calc(100vw - 32px)); height:min(860px,calc(100dvh - 32px)); max-height:calc(100dvh - 32px); }
.host-manager > .host-manager-shell > .file-preview-header { min-height:62px; padding:12px 20px; }
#host-manager-subtitle { display:none; }
.settings-current-location { color:var(--muted); font-size:12px; font-weight:400; margin-left:16px; }
.host-manager-body.personal-settings-layout { grid-template-columns:224px minmax(0,1fr); grid-template-rows:minmax(0,1fr); }
.personal-settings-nav { display:block; overflow:auto; padding:16px 10px; border-right:1px solid var(--line); border-bottom:0; scrollbar-width:thin; }
.settings-nav-heading { font-size:20px; font-weight:650; padding:0 12px 14px; }
.settings-category { margin:0 0 12px; }
.settings-category > summary { display:flex; align-items:center; gap:8px; list-style:none; padding:9px 9px; color:var(--muted); font-size:12px; font-weight:650; cursor:pointer; border-radius:6px; }
.settings-category > summary::-webkit-details-marker { display:none; }
.settings-category > summary::before { content:'›'; display:inline-block; font-size:16px; line-height:1; transition:transform 150ms ease; }
.settings-category[open] > summary::before { transform:rotate(90deg); }
.settings-category > summary:hover { background:var(--surface); }
.settings-category-items { display:grid; gap:2px; }
.personal-settings-nav button { display:flex; align-items:center; width:100%; min-height:36px; border-radius:7px; padding:7px 14px 7px 27px; font-size:13px; font-weight:450; white-space:normal; line-height:1.45; text-align:left; cursor:pointer; }
.personal-settings-nav button.active { background:var(--accent-strong); color:#fff; border-color:transparent; font-weight:600; }
.personal-settings-content { padding:26px 32px 36px; background:var(--surface-soft); }
.personal-settings-panel { width:min(100%,800px); gap:18px; }
.settings-panel-header { gap:6px; margin-bottom:2px; }
.settings-panel-header h2 { font-size:23px; font-weight:650; }
.settings-panel-header > span { font-size:11px; }
.settings-panel-header p { font-size:12px; line-height:1.65; }
.personal-settings-panel .settings-form-card > strong { font-size:14px; }
.personal-settings-panel .settings-form-card > p,.personal-settings-panel .settings-form-card label,.personal-settings-panel .settings-form-card output { font-size:12px; }
.personal-settings-panel .settings-form-card button { font-size:12px; justify-self:start; min-width:100px; }
.personal-settings-panel .settings-form-card { padding:18px; gap:12px; }
.settings-frame-panel { display:block; width:100%; height:100%; }
#settings-billing-frame { display:block; border:0; width:100%; height:100%; min-height:0; background:var(--surface); }
.personal-settings-content:has(.settings-frame-panel.active) { padding:0; overflow:hidden; }
#settings-runtime-frame,#settings-mcp-frame,#settings-places-frame { display:block; border:0; border-radius:0; width:100%; height:100%; min-height:0; background:var(--surface); }
.personal-settings-panel [data-foundation-pane][hidden] { display:none!important; }
.group-management-shell .group-directory,.personal-settings-panel>.group-directory { margin:0 0 18px; border:1px solid var(--line); border-radius:12px; padding:12px 14px; background:var(--surface); }
.group-directory-heading { display:flex; gap:12px; align-items:center; }
.group-directory-heading label { font-size:12px; color:var(--muted); white-space:nowrap; }
#settings-group-select { min-width:0; flex:1; max-width:100%; padding:8px; color:var(--text); background:var(--surface); border:1px solid var(--line); border-radius:7px; font-size:13px; }
.group-directory .group-action-drawer { margin-top:8px; }
.group-directory .group-action-drawer>summary { font-size:11px; }
#group-list[hidden],#group-overview-cards { display:none; }
.group-detail-header { padding-top:0; margin-bottom:12px; }
.group-detail-header h3 { font-size:15px; margin:4px 0; }
.group-detail-header p { font-size:11px; }
#settings-panel-workspace>.settings-panel-header p { display:none; }
#settings-files-mount { min-width:0; }
#settings-files-mount .cloud-manager-shell { display:block; height:auto; }
#settings-files-mount .cloud-manager-shell>header,#settings-files-mount #workspace-control { display:none!important; }
#settings-files-mount .cloud-manager-body { display:grid; grid-template-columns:130px minmax(0,1fr); min-height:430px; border:1px solid var(--line); border-radius:12px; overflow:hidden; }
#settings-files-mount .cloud-file-pane { min-width:0; padding:12px; }
#settings-files-mount .cloud-folder-pane { min-width:0; padding:12px 8px; }
#settings-files-mount .cloud-file-search { min-width:100px; flex:1; }
#settings-files-mount .cloud-drive-toolbar { flex-wrap:wrap; }
@media(max-width:760px) {
 .host-manager { width:calc(100vw - 16px);height:calc(100dvh - 16px);max-height:calc(100dvh - 16px);border-radius:14px; }
 .host-manager-body.personal-settings-layout { grid-template-columns:150px minmax(0,1fr); }
 .personal-settings-nav { padding:12px 6px; }
 .personal-settings-nav button { min-height:40px;padding:8px 10px 8px 20px; font-size:12px; }
 .settings-nav-heading { font-size:18px; }
 .personal-settings-content { padding:20px 16px; }
 .settings-current-location { margin:0;font-size:11px; }
 #settings-files-mount .cloud-manager-body { grid-template-columns:1fr; }
 #settings-files-mount .cloud-folder-pane { max-height:150px;border-right:0;border-bottom:1px solid var(--line); }
}
@media(max-width:540px) {
 .host-manager-body.personal-settings-layout { grid-template-columns:112px minmax(0,1fr); }
 .personal-settings-nav button { font-size:11px; padding:8px; min-height:42px; }
 .settings-category>summary { padding:8px 2px;font-size:11px;gap:4px; }
 .settings-nav-heading { padding-left:8px;font-size:17px; }
 .personal-settings-content { padding:16px 10px; }
 .settings-panel-header h2 { font-size:19px; }
 .personal-settings-panel .settings-form-card { padding:12px; }
 .personal-settings-panel .settings-form-card input,.personal-settings-panel .settings-form-card select,.personal-settings-panel .settings-form-card textarea { min-width:0;max-width:100%; }
 .group-directory-heading { flex-wrap:wrap;gap:4px; }
 .group-directory-heading select { flex-basis:100%; }
 .settings-current-location { display:none; }
 .personal-settings-panel .foundation-form-grid,.personal-settings-panel .group-form-grid { grid-template-columns:1fr; }
}
@media(prefers-reduced-motion:reduce) { .settings-category>summary::before,.personal-settings-nav button { transition:none; } }

#settings-category-toggle,#settings-category-dismiss { display:none; }
@media(max-width:540px) {
 .host-manager-body.personal-settings-layout { position:relative;grid-template-columns:minmax(0,1fr); }
 #settings-category-toggle { display:block; padding:7px 10px;border:1px solid var(--line);border-radius:8px;color:var(--accent-strong);background:var(--surface);font-size:13px;min-height:36px; }
 #host-manager .file-preview-header>div { flex:1;min-width:0; }
 .personal-settings-nav { display:none; position:absolute; inset:0 auto 0 0; width:220px; z-index:3; padding:16px 10px;background:var(--surface-soft);box-shadow:12px 0 24px #0002; }
 .personal-settings-nav button { font-size:13px;min-height:42px;padding:8px 18px; }
 .settings-category>summary { font-size:12px;padding:9px;gap:8px; }
 #host-manager[data-navigation="open"] .personal-settings-nav { display:block; }
 #host-manager[data-navigation="open"] #settings-category-dismiss { display:block;position:absolute;inset:0;z-index:2;background:#0004;border:0;border-radius:0;width:100%;height:100%; }
 .personal-settings-content { padding:20px 16px; }
 .settings-panel-header h2 { font-size:22px; }
 .marketplace-section-heading { flex-wrap:wrap; }
 .marketplace-section-heading>span { flex-basis:100%; }
}

/* Each object has one editable home; data scope is independent from its kind. */
.settings-nav-footer { border-top:1px solid var(--line); padding-top:12px; margin-top:12px; }
.settings-nav-footer button { padding-left:14px; color:var(--muted); }
.settings-scope-bar { display:flex; align-items:center; flex-wrap:wrap; gap:10px; padding:14px 16px; border:1px solid var(--line); border-radius:10px; background:var(--surface); font-size:12px; }
.settings-scope-bar select { min-width:160px; max-width:100%; }.settings-scope-bar small { color:var(--muted); }
.settings-inline-actions,.settings-segmented { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
#web-voiceprint-settings h3 { font-size:18px; margin:0 0 10px; }
#web-voiceprint-settings > p,#web-voiceprint-settings > output { font-size:14px; line-height:1.7; }
#web-voiceprint-settings > label { display:flex; align-items:center; gap:10px; font-size:15px; line-height:1.5; }
#web-voiceprint-settings input[type="checkbox"] { appearance:auto; width:20px; height:20px; min-width:20px; min-height:20px; padding:0; margin:0; flex:0 0 20px; }
#web-voiceprint-settings .settings-inline-actions button { width:auto; min-height:40px; font-size:14px; padding:8px 14px; }
#web-voiceprint-settings > output { display:block; margin-top:12px; color:var(--muted); }
.settings-segmented { margin-bottom:10px; }.settings-segmented button { background:var(--surface); color:var(--muted); border:1px solid var(--line); padding:8px 14px; border-radius:8px; }
.settings-segmented button[aria-pressed="true"] { background:var(--accent-strong); color:#fff; }
#assistant-instructions { resize:vertical; font-family:inherit; font-size:13px; line-height:1.7; font-weight:400; padding:12px; border:1px solid var(--line); border-radius:8px; min-height:220px; }
#assistant-instructions-count { margin-left:auto; color:var(--muted); }
.settings-feature-row { display:flex; justify-content:space-between; gap:14px; border-top:1px solid var(--line); padding:14px 0; font-size:13px; }.settings-feature-row small { color:var(--muted); text-align:right; }
#settings-data-mount > .personal-settings-panel > .settings-panel-header { display:none; }
#settings-data-mount > .personal-settings-panel { width:100%; }
#settings-data-mount .cloud-drive-navigation { display:none; }
#settings-data-group-memory .group-detail-section { margin-top:18px; }
.settings-tools-panel { width:100%; }
#settings-tools-frame,#settings-tool-connections #settings-mcp-frame { width:100%; height:max(500px,calc(100dvh - 300px)); display:block; border:1px solid var(--line); border-radius:10px; }
.settings-form-card > summary { cursor:pointer; font-size:14px; font-weight:600; }
@media(max-width:540px) { .settings-feature-row { flex-direction:column; gap:5px; }.settings-feature-row small { text-align:left; }.settings-scope-bar select { width:100%; }.settings-segmented { gap:6px; }.settings-segmented button { font-size:12px; padding:8px; } }
#settings-panel-data,#settings-data-mount,#settings-data-group-knowledge,#settings-data-group-memory { min-width:0; max-width:100%; }
#settings-panel-data .foundation-record,#settings-panel-data .foundation-record-heading { min-width:0; }
#settings-panel-data .foundation-record strong,#settings-panel-data .foundation-record p { overflow-wrap:anywhere; white-space:normal; }
#settings-panel-data [hidden],#settings-panel-tools [hidden] { display:none!important; }
@media(max-width:767px) {
 #settings-panel-data .marketplace-record-row { flex-wrap:nowrap; }
 #settings-panel-data .marketplace-record-row > .marketplace-share-controls { flex:none; width:100%; min-width:0; }
 #settings-panel-data .marketplace-record-copy { max-width:100%; }
}

/* File editor shares the library preview, keeping navigation and file identity stable. */
.document-editor { display: grid; gap: 16px; }
.document-editor-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.document-version { color: #183b32; white-space: nowrap; }
.document-version-select { margin-left: auto; max-width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid #d5dfda; border-radius: 10px; background: #fff; color: #405b50; }
.document-textarea { box-sizing: border-box; width: 100%; min-height: 45vh; resize: vertical; border: 1px solid #a6c8b9; border-radius: 12px; padding: 20px; font: 15px/1.8 ui-monospace, SFMono-Regular, monospace; color: #183b32; background: #fcfdfc; }
.document-textarea:focus-visible { outline: 3px solid #cce7db; outline-offset: 2px; }
.document-editor-controls { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.document-editor-count { margin-right: auto; color: #65786e; font-size: 13px; }
.document-editor-status { margin: 0; line-height: 1.6; color: #53695e; }
.document-editor [hidden] { display: none !important; }
@media (max-width: 600px) { .document-version-select { width: 100%; order: 3; } .document-textarea { padding: 12px; min-height: 42vh; font-size: 16px; } }

.channel-account-card { margin-top:12px; }
.channel-binding-line { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:12px; padding:12px 0; border-top:1px solid var(--line); }
.channel-binding-line > span { flex:1 1 240px; font-size:12px; color:var(--text-soft); }
.channel-binding-challenge code { display:block; padding:14px; border-radius:10px; background:var(--surface-soft); font-size:18px; letter-spacing:1px; user-select:all; }

/* 0.7 mobile library: keep navigation, actions and files visible in one flow. */
@media (max-width: 767px) {
  .cloud-manager[open] .file-preview-header { min-height: 60px; padding: 10px 13px; }
  .cloud-manager[open] .file-preview-header strong { font-size: 16px; }
  .cloud-manager[open] .file-preview-header small { max-width: 68vw; font-size: 10px; line-height: 1.35; }
  .cloud-manager[open] .cloud-manager-body { display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
  .cloud-manager[open] .cloud-folder-pane { max-height: none; display: flex; align-items: center; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 8px 10px; scrollbar-width: none; }
  .cloud-manager[open] .cloud-folder-pane::-webkit-scrollbar { display: none; }
  .cloud-manager[open] .cloud-folder-heading { display: none; }
  .cloud-manager[open] .cloud-folder-all, .cloud-manager[open] .cloud-folder-select { width: auto; min-width: max-content; min-height: 38px; padding-inline: 12px; font-size: 12px; }
  .cloud-manager[open] .cloud-folder-tree { display: flex; gap: 6px; margin: 0; }
  .cloud-manager[open] .cloud-folder-row { flex: 0 0 auto; }
  .cloud-manager[open] .cloud-file-pane { overflow: hidden; }
  .cloud-manager[open] .cloud-drive-toolbar { position: sticky; top: 0; z-index: 4; grid-template-columns: auto minmax(0, 1fr); padding: 10px 12px; background: var(--surface); }
  .cloud-manager[open] .cloud-file-search input, .cloud-manager[open] .cloud-file-search button, .cloud-manager[open] .cloud-new-menu > summary { min-height: 44px; }
  .cloud-manager[open] .cloud-sort-control { min-height: 42px; }
  .cloud-manager[open] .cloud-file-list { overflow: auto; overscroll-behavior: contain; }
  .cloud-manager[open] .cloud-file-row { min-height: 66px; padding-inline: 12px; }
  .cloud-manager[open] .cloud-file-copy strong { font-size: 13px; }
  .cloud-manager[open] .cloud-file-copy small { font-size: 10px; }
  .cloud-manager[open] .cloud-file-check { width: 20px; height: 20px; }
}

/* One guided connection journey across personal IM channels. */
.channel-identity{display:grid;gap:4px;padding:14px 16px;background:var(--ws-subtle,var(--vi-support-soft,#f3f1ed));border-radius:12px;font-size:13px}
.channel-identity span{color:var(--text-soft)}
.channel-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0}
.channel-card{min-width:0;padding:18px;border:1px solid var(--line);border-radius:14px;background:var(--surface)}
.channel-card-heading{display:flex;justify-content:space-between;align-items:center;gap:10px}
.channel-card-heading strong{font-size:18px}.channel-card>button{margin-top:10px;min-height:38px}
.channel-badge{font-size:12px;color:var(--text-soft);padding:4px 8px;background:var(--ws-subtle,var(--vi-support-soft,#f3f1ed));border-radius:8px}.channel-badge.connected{color:var(--ws-positive,var(--vi-success,#246b53));background:var(--ws-positive-soft,var(--vi-support-soft,#f3f1ed))}
.channel-card.planned{opacity:.8}.channel-card.planned>.channel-badge{margin-left:10px}.channel-manage{border-top:1px solid var(--line);margin-top:15px;padding-top:10px}
.channel-actions{display:flex;gap:8px;flex-wrap:wrap}.channel-manage details{margin-top:14px;font-size:12px}.channel-manage summary{cursor:pointer}
.channel-wizard{width:min(570px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;padding:0;border:1px solid var(--line);border-radius:18px;background:var(--surface);color:var(--text);box-shadow:0 20px 80px #142c2440}
.channel-wizard::backdrop{background:#10272166;backdrop-filter:blur(3px)}
.channel-wizard-head{padding:20px 22px 12px;display:flex;justify-content:space-between;align-items:center;gap:12px}.channel-wizard-head h2{margin:0;font-size:22px}
.channel-steps{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;list-style:none;margin:0;padding:0 22px}.channel-steps li{border-top:3px solid var(--line);padding-top:8px;font-size:12px;color:var(--text-soft)}.channel-steps li.current{border-color:var(--accent,#376b50);color:var(--text);font-weight:650}
.channel-wizard-body{padding:22px}.channel-wizard-body h3{margin:0 0 14px;font-size:20px}.channel-wizard-body label{display:grid;gap:8px;font-size:13px}.channel-wizard-body select{width:100%;padding:10px;border:1px solid var(--line);background:var(--surface);color:var(--text);border-radius:8px}
.channel-wizard-body form{display:grid;gap:14px;margin-top:18px}.channel-wizard-body form input{width:100%;box-sizing:border-box;padding:10px;border:1px solid var(--line);background:var(--surface);color:var(--text);border-radius:8px}
.channel-wizard-actions{padding:16px 22px;border-top:1px solid var(--line);display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}.channel-wizard-actions button{min-height:40px}
.channel-qr{display:block;width:min(260px,100%);height:auto;aspect-ratio:1;margin:18px auto;background:#fff;border-radius:10px}
.channel-code{border:1px dashed var(--line);border-radius:12px;padding:16px;display:grid;justify-items:center;gap:16px;background:var(--ws-subtle,var(--vi-support-soft,#f3f1ed))}.channel-code code{font-size:20px;user-select:all;overflow-wrap:anywhere}
.channel-hint{padding:13px 15px;background:var(--ws-subtle,var(--vi-support-soft,#f3f1ed));border-radius:10px;font-size:13px;line-height:1.7;margin-top:15px}.channel-status{display:block;padding:0 22px 16px;font-size:13px;overflow-wrap:anywhere}.channel-status:empty{padding:0}.channel-open-link{display:inline-block;margin-top:12px;color:var(--text);text-decoration:underline;text-underline-offset:3px}
.channel-wizard button:focus-visible,.channel-card button:focus-visible,.channel-open-link:focus-visible{outline:3px solid #4779bd;outline-offset:3px}
@media(max-width:600px){.channel-grid{grid-template-columns:1fr}.channel-wizard-body,.channel-wizard-head,.channel-wizard-actions{padding:18px}.channel-steps{padding:0 18px}.channel-steps li{font-size:11px}.channel-wizard-actions{justify-content:stretch}.channel-wizard-actions button{flex:1}.channel-card{padding:15px}}

.channel-wizard button { border: 1px solid var(--ws-line,var(--vi-border,#dddcd5)); border-radius: 12px; padding: 11px 16px; background: var(--ws-surface,var(--vi-surface,#fff)); color: var(--ws-ink,var(--vi-ink,#30332f)); font: inherit; cursor: pointer; }
.channel-wizard button.primary-action { background: var(--ws-accent,var(--vi-action,#b54825)); border-color: var(--ws-accent,var(--vi-action,#b54825)); color: var(--ws-on-accent,var(--vi-on-action,#fff)); font-weight: 650; }
.channel-wizard button:hover { filter: brightness(.96); }
.channel-wizard button:focus-visible, .channel-wizard a:focus-visible { outline: 3px solid var(--ws-accent,var(--vi-action,#b54825)); outline-offset: 3px; }

#scheduled-task-form [data-schedule-weekly] { grid-column:1 / -1; display:flex; flex-wrap:wrap; gap:10px 16px; border:1px solid #cbd8ce; border-radius:9px; padding:12px; }
#scheduled-task-form [data-schedule-weekly][hidden] { display:none; }
#scheduled-task-form [data-schedule-weekly] label { display:flex; align-items:center; gap:6px; min-height:40px; }
#scheduled-task-form [data-schedule-weekly] input { width:18px; height:18px; padding:0; accent-color:#19705a; }
#scheduled-task-preview { grid-column:1 / -1; line-height:1.6; }

.pdf-preview{display:flex;flex-direction:column;align-items:center;gap:12px;width:100%;min-height:260px;padding:12px;box-sizing:border-box;background:#eef1f5;border-radius:12px}.pdf-preview-toolbar{display:flex;justify-content:space-between;align-items:center;gap:10px;width:100%;position:sticky;top:0;padding:8px;background:#fff;border-radius:8px;box-sizing:border-box;z-index:1}.pdf-preview-toolbar button{min-height:40px;padding:8px 12px;border:1px solid #d4dce8;border-radius:8px;background:#fff;color:#244574;cursor:pointer}.pdf-preview-toolbar button:disabled{opacity:.4;cursor:default}.pdf-preview-position{font-size:13px;color:#334155;white-space:nowrap}.pdf-preview-canvas{max-width:100%;height:auto;box-shadow:0 3px 16px #17335314;background:#fff}.pdf-preview-notice{margin:0;font-size:12px;line-height:1.6;color:#596779;text-align:center}
@media (min-width:1180px) {
  #file-preview[open][data-presentation="full"] { position:fixed; z-index:60; inset:16px; width:calc(100vw - 32px); max-width:none; height:calc(100dvh - 32px); max-height:none; margin:0; }
}
#file-preview:has(.pdf-preview) .library-preview-actions { display:flex; gap:8px; flex-wrap:wrap; }
#file-preview:has(.pdf-preview) .library-preview-actions > button { width:auto; flex:0 0 auto; min-height:36px; padding:6px 10px; }

.html-artifact-preview{width:100%;height:100%;min-height:560px;display:flex;flex-direction:column;background:#f0f2f5}.html-preview-controls{display:flex;gap:8px;padding:10px;flex-wrap:wrap}.html-preview-controls button{padding:7px 12px;border:1px solid #d2d9e2;border-radius:8px;background:white;color:#24364c;cursor:pointer}.html-artifact-preview>p{font-size:12px;padding:0 12px;margin:0 0 8px;color:#59677b}.html-preview-stage{width:100%;max-width:100%;flex:1;min-height:480px;align-self:center;overflow:auto}.html-preview-stage>iframe{border:0;width:100%;height:100%;min-height:480px;background:#fff}.html-artifact-preview:fullscreen{height:100vh;padding:12px}@media(max-width:600px){.html-artifact-preview{min-height:70vh}.html-preview-stage>iframe{min-height:65vh}}

.html-preview-stage{position:relative;height:min(75vh,960px);flex:auto}.html-preview-stage>iframe{position:absolute;top:0;left:0;transform-origin:top left;min-height:0}

.conversation-objects{display:grid;gap:12px;margin-top:12px;max-width:520px}.conversation-object{display:flex;gap:16px;padding:14px;border:1px solid var(--line,#ddd);border-radius:16px;background:var(--surface,#fff);color:var(--ink,inherit)}.conversation-object>img{width:104px;height:104px;object-fit:cover;border-radius:10px;flex-shrink:0}.conversation-object-body{min-width:0;display:grid;gap:8px}.conversation-object-body strong{font-size:17px;overflow-wrap:anywhere}.conversation-object-body p{font-size:13px;margin:0;opacity:.7}.conversation-object-actions{display:flex;gap:8px;flex-wrap:wrap}.conversation-object-actions button{min-height:44px;min-width:62px}.conversation-object [role=status]{font-size:13px}@media(max-width:420px){.conversation-object{gap:10px;padding:10px}.conversation-object>img{width:76px;height:96px}.conversation-object-actions{gap:5px}}

.conversation-object-actions button{border:1px solid var(--line,#d9dde5);border-radius:10px;background:var(--surface,#fff);color:inherit;font:inherit;font-size:14px;padding:9px 14px;cursor:pointer}.conversation-object-actions button:first-child{background:var(--accent,#5266d9);color:#fff;border-color:transparent}.conversation-object-actions button:disabled{opacity:.55;cursor:wait}.conversation-object [role=status]:empty{display:none}

.digital-employee-actions { display: flex; flex-wrap: wrap; gap: 6px; }
#settings-panel-agents[data-employee-page="open"] > :not(#digital-employee-page),
.app-workers[data-employee-page="open"] > :not(#digital-employee-page) { display: none; }
.digital-employee-subpage { display: grid; gap: 16px; min-width: 0; padding: 12px; }
.digital-employee-subpage > header { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.digital-employee-subpage h2, .digital-employee-subpage h3, .digital-employee-subpage p { margin: 0; }
.digital-employee-subpage .work-create-form { padding: 0; max-width: 560px; }
.digital-employee-file { display: block; min-height: 44px; padding-block: 10px; color: var(--accent); }
#digital-employee-page .project-direct-shell { min-height: 420px; height: min(680px, calc(100dvh - 132px)); }
#digital-employee-page #project-direct-close { order: -1; width: auto; min-height: 40px; padding-inline: 9px; }
#digital-employee-page :is(.task-primary-action, .project-direct-composer button) {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
@media (max-width: 759px) {
  html:not(.native-global-shell) body[data-surface="apps"] #web-workspace.has-global-system-bar:has(.app-workers) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
  html:not(.native-global-shell) body[data-surface="apps"] #web-workspace.has-global-system-bar:has(.app-workers) > .ws-system-bar {
    grid-column: 1;
  }
  html:not(.native-global-shell) body[data-surface="apps"] #web-workspace.has-global-system-bar > #applications-surface:has(.app-workers) {
    grid-area: 2 / 1;
  }
  html:not(.native-global-shell) body[data-surface="apps"] #web-workspace.has-global-system-bar:has(.app-workers) > .mobile-nav {
    grid-area: 3 / 1;
  }
}
#project-direct-browse { display: none; }
.project-direct-navigation label[hidden], .project-direct-composer[hidden] { display: none; }
.project-direct-message p, .project-direct-message summary { font-size: 14px; }
.project-direct-status { font-size: 12px; }
@media (max-width: 680px) {
  .digital-employee-actions button, .digital-employee-subpage button, #project-direct-browse { min-height: 44px; }
  #project-direct-browse { display: inline-flex; align-items: center; margin-inline-start: auto; }
  .project-direct-shell .file-preview-header small { display: none; }
  .project-direct-body { grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
  .project-direct-shell[data-browse="open"] .project-direct-navigation { display: flex; flex-direction: column; overflow: auto; border-bottom: 0; }
  .project-direct-shell[data-browse="open"] .project-direct-body { grid-template-rows: minmax(0, 1fr) auto; }
  .project-direct-shell[data-browse="open"] .project-direct-conversation { display: contents; }
  .project-direct-shell[data-browse="open"] .project-direct-conversation > :not(.project-direct-status) { display: none; }
  .project-direct-shell[data-browse="open"] .project-direct-threads { display: grid; overflow: visible; }
  .project-direct-shell[data-browse="closed"] .project-direct-navigation { display: none; }
  .project-direct-thread { min-width: 0; min-height: 44px; }
  .project-direct-composer { padding-inline: 10px; }
  .project-direct-composer textarea { font-size: 16px; }
  .project-direct-composer button { min-width: 58px; }
  .project-direct-messages { padding-inline: 10px; }
  .project-direct-message { max-width: 95%; }
}

/* The employee app opens history and conversation as distinct, in-page views. */
#digital-employee-page {
  --employee-chat-ink: var(--ws-ink, var(--text));
  --employee-chat-muted: var(--ws-muted, var(--muted));
  --employee-chat-surface: var(--ws-surface, var(--surface));
  --employee-chat-line: var(--ws-line, var(--line));
  --employee-chat-soft: var(--ws-subtle, var(--surface-soft));
  min-width: 0;
  color: var(--employee-chat-ink);
}
#digital-employee-page .employee-chat,
#digital-employee-page .project-direct-shell {
  height: min(760px, calc(100dvh - 145px));
  min-height: 390px;
  padding: 0;
  gap: 0;
  background: var(--employee-chat-surface);
}
#digital-employee-page .employee-chat {
  display: grid;
  grid-template: auto minmax(0, 1fr) auto / minmax(0, 1fr);
}
#digital-employee-page .employee-chat-header,
#digital-employee-page .project-direct-shell > .file-preview-header {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: center;
  min-height: 65px;
  padding: 8px 0;
  border-bottom: 1px solid var(--employee-chat-line);
}
#digital-employee-page .employee-chat-title,
#digital-employee-page .project-direct-shell > .file-preview-header > div {
  flex: 1;
  min-width: 0;
}
#digital-employee-page :is(.employee-chat-title h2, #project-direct-title) {
  display: block;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  line-height: 1.35;
}
#digital-employee-page .employee-chat-title p {
  color: var(--employee-chat-muted);
  font-size: 12px;
  margin-top: 3px;
}
#digital-employee-page :is(.employee-chat-back, #project-direct-close) {
  display: inline-grid;
  place-items: center;
  flex: 0 0 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--employee-chat-soft);
  font-size: 28px;
  line-height: 1;
}
#digital-employee-page .employee-chat-scroll {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
#digital-employee-page :is(.employee-chat-list, .employee-chat-transcript) {
  display: grid;
  align-content: start;
  gap: 10px;
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 4px 20px;
}
#digital-employee-page .employee-chat-list-intro { padding: 7px 5px 9px; }
#digital-employee-page .employee-chat-list-intro h3 { margin: 0 0 5px; font-size: 22px; letter-spacing: -.02em; }
#digital-employee-page :is(.employee-chat-list-intro p, .employee-chat-note) { color: var(--employee-chat-muted); font-size: 13px; }
#digital-employee-page .employee-chat-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 14px;
  align-items: center;
  gap: 10px;
  min-height: 65px;
  padding: 10px 11px;
  border: 1px solid var(--employee-chat-line);
  border-radius: 13px;
  text-align: left;
  background: var(--employee-chat-surface);
}
#digital-employee-page .employee-chat-row:hover { background: var(--employee-chat-soft); }
#digital-employee-page .employee-chat-row-copy { min-width: 0; display: grid; gap: 4px; }
#digital-employee-page .employee-chat-row-copy strong { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; overflow-wrap: anywhere; font-size: 15px; }
#digital-employee-page :is(.employee-chat-row-copy small, .employee-chat-row time, .employee-chat-message time, .employee-chat-step time) {
  color: var(--employee-chat-muted);
  font-size: 11px;
}
#digital-employee-page .employee-chat-chevron { font-size: 19px; color: var(--employee-chat-muted); }
#digital-employee-page .employee-chat-all { justify-self: start; border: 0; color: var(--accent); background: transparent; }
#digital-employee-page .employee-chat-transcript { gap: 18px; }
#digital-employee-page .employee-chat-message { display: grid; gap: 6px; min-width: 0; }
#digital-employee-page .employee-chat-message[data-role="user"] { justify-self: end; width: fit-content; max-width: 86%; }
#digital-employee-page .employee-chat-message-meta { display: flex; align-items: baseline; gap: 8px; font-size: 12px; }
#digital-employee-page .employee-chat-message[data-role="user"] .employee-chat-message-meta { justify-content: end; }
#digital-employee-page .employee-chat-message-body { font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
#digital-employee-page .employee-chat-message-body p { margin: 0 0 6px; white-space: pre-wrap; }
#digital-employee-page .employee-chat-message-body p:last-child { margin-bottom: 0; }
#digital-employee-page .employee-chat-message[data-role="user"] .employee-chat-message-body {
  padding: 10px 13px;
  border-radius: 17px 17px 4px 17px;
  background: var(--employee-chat-soft);
}
#digital-employee-page .employee-chat-context {
  padding: 9px 11px;
  border: 1px solid var(--employee-chat-line);
  border-radius: 11px;
  font-size: 13px;
  overflow-wrap: anywhere;
}
#digital-employee-page .employee-chat-context summary { font-weight: 600; cursor: pointer; }
#digital-employee-page .employee-chat-context p { margin-top: 8px; }
#digital-employee-page .employee-chat-context ul { padding-inline-start: 20px; }
#digital-employee-page .employee-chat-step {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  padding: 0 0 0 10px;
  border-inline-start: 2px solid var(--employee-chat-line);
  font-size: 12px;
  color: var(--employee-chat-muted);
}
#digital-employee-page .employee-chat-result .digital-employee-file {
  margin-top: 9px;
  padding: 8px 12px;
  border: 1px solid var(--employee-chat-line);
  border-radius: 11px;
  text-decoration-thickness: 1px;
}
#digital-employee-page .employee-chat-composer,
#digital-employee-page .project-direct-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 7px;
  align-items: end;
  padding: 7px;
  border: 1px solid var(--employee-chat-line);
  border-radius: 23px;
  background: var(--employee-chat-soft);
}
#digital-employee-page :is(.employee-chat-composer, .project-direct-composer)[hidden] { display: none; }
#digital-employee-page :is(.employee-chat-composer, .project-direct-composer) textarea {
  border: 0;
  background: transparent;
  color: var(--employee-chat-ink);
  padding: 9px 10px;
  font-size: 16px;
  min-height: 44px;
  max-height: 112px;
  resize: none;
}
#digital-employee-page :is(.employee-chat-composer, .project-direct-composer) button {
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  color: white;
  background: var(--accent);
  border-color: var(--accent);
}
#digital-employee-page :is(.employee-chat-composer, .project-direct-composer) button { font-size: 22px; }
#digital-employee-page .employee-chat-feedback { grid-column: 1 / -1; padding-inline: 8px; font-size: 12px; }
#digital-employee-page .employee-chat-feedback:empty { display: none; }
#digital-employee-page .project-direct-navigation { background: transparent; }
#digital-employee-page .project-direct-thread {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto 14px;
  min-height: 62px;
  align-items: center;
  text-align: left;
}
#digital-employee-page .project-direct-thread-copy strong { font-size: 14px; }
#digital-employee-page .project-direct-thread-copy small { font-size: 12px; }
#digital-employee-page .project-direct-messages { gap: 18px; padding: 14px 5px; }
#digital-employee-page .project-direct-thread-header { padding: 9px 4px; }
#digital-employee-page .project-direct-thread-header small { font-size: 11px; }
#digital-employee-page .project-direct-status:empty { display: none; }

@media (max-width: 759px) {
  #digital-employee-page .project-direct-body { grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
  #digital-employee-page #project-direct-browse:not([hidden]) { display: inline-flex; align-items: center; min-height: 44px; margin: 0; }
  #digital-employee-page .project-direct-shell[data-browse="open"] .project-direct-body { grid-template-rows: minmax(0, 1fr) auto; }
  #digital-employee-page .project-direct-shell[data-browse="open"] .project-direct-navigation { display: flex; flex-direction: column; overflow: auto; border: 0; padding: 6px 0; }
  #digital-employee-page .project-direct-shell[data-browse="open"] .project-direct-conversation { display: contents; }
  #digital-employee-page .project-direct-shell[data-browse="open"] .project-direct-conversation > :not(.project-direct-status) { display: none; }
  #digital-employee-page .project-direct-shell[data-browse="open"] .project-direct-threads { display: grid; overflow: visible; }
  #digital-employee-page .project-direct-shell[data-browse="closed"] .project-direct-navigation { display: none; }
  #digital-employee-page .project-direct-thread { min-width: 0; }
  #digital-employee-page .project-direct-shell[data-browse="closed"] .project-direct-thread-title > strong { display: none; }
}

#digital-employee-page .employee-chat-request details { margin-top: 6px; font-size: 13px; }
#digital-employee-page .employee-chat-request summary { color: var(--accent); cursor: pointer; }
#digital-employee-page .employee-chat-request details p { margin-top: 6px; }

/* Object URLs reuse the default character's existing call layout. */
#web-workspace .ws-global-call[data-mode=stage] .ws-call-avatar-stage:has(>.ws-pet-motion-layer[data-motion-source])>.ws-pet-motion-layer {
  width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;
}
#web-workspace .ws-global-call[data-mode=assistant] .ws-call-pet:has(>.ws-pet-motion-layer[data-motion-source]) {
  width:190px;height:min(280px,44dvh);
}
#web-workspace .ws-global-call .ws-pet-motion-layer[data-motion-source] { transition:none; }
