:root {
  color-scheme: dark;
  --bg: #080b11;
  --bg-raised: #0d1119;
  --panel: #10151e;
  --panel-soft: #0c1119;
  --panel-hover: #171d28;
  --input: #0a0f16;
  --line: #202836;
  --line-strong: #2c3748;
  --text: #edf3fa;
  --text-soft: #c1cad6;
  --muted: #7f8a99;
  --faint: #515b68;
  --accent: #65d5f5;
  --accent-soft: #173746;
  --good: #7fd7aa;
  --warn: #e4bd72;
  --danger: #eb918d;
  --rail-width: 54px;
  --top-height: 36px;
  --radius: 10px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="black"] {
  --bg: #050505;
  --bg-raised: #090909;
  --panel: #0d0d0e;
  --panel-soft: #09090a;
  --panel-hover: #171718;
  --input: #070707;
  --line: #262627;
  --line-strong: #39393b;
  --text: #f2f1ed;
  --text-soft: #cbc9c2;
  --muted: #8e8c87;
  --faint: #595854;
  --accent: #d7d3c9;
  --accent-soft: #292824;
}

html[data-theme="glass"] {
  --bg: #08080c;
  --bg-raised: #0e0e14;
  --panel: #12121a;
  --panel-soft: #0c0c12;
  --panel-hover: #1a1a24;
  --input: #0a0a10;
  --line: #2e2e3a;
  --line-strong: #3a3a48;
  --text: #f5f3ee;
  --text-soft: #c9c6be;
  --muted: #8e8b84;
  --faint: #66636c;
  --accent: #f59e0b;
  --accent-soft: #2a2113;
}

html[data-theme="ocean"] {
  --bg: #07111d;
  --bg-raised: #0e1d2b;
  --panel: #102333;
  --panel-soft: #0c1a26;
  --panel-hover: #172c3d;
  --input: #0a1620;
  --line: #274154;
  --line-strong: #39778d;
  --text: #edf8fb;
  --text-soft: #b9d3e0;
  --muted: #829eb0;
  --faint: #587184;
  --accent: #65d5f5;
  --accent-soft: #123247;
}

html[data-theme="forest"] {
  --bg: #08100f;
  --bg-raised: #101b19;
  --panel: #101d1a;
  --panel-soft: #0c1614;
  --panel-hover: #172925;
  --input: #0a1412;
  --line: #243633;
  --line-strong: #356b5b;
  --text: #f2f7f5;
  --text-soft: #c3d2ce;
  --muted: #91a5a0;
  --faint: #60746f;
  --accent: #73e6b1;
  --accent-soft: #173e32;
}

html[data-theme="warm"] {
  --bg: #17100b;
  --bg-raised: #251a13;
  --panel: #2b1e16;
  --panel-soft: #1d140e;
  --panel-hover: #35251b;
  --input: #140e0a;
  --line: #49372b;
  --line-strong: #6d4a31;
  --text: #fff7ee;
  --text-soft: #e5d2bf;
  --muted: #b59c87;
  --faint: #887263;
  --accent: #e9ad6b;
  --accent-soft: #3c291c;
}

/* Light themes */
html[data-theme="white"] {
  color-scheme: light;
  --bg: #f4f6f8;
  --bg-raised: #ffffff;
  --panel: #ffffff;
  --panel-soft: #eef1f4;
  --panel-hover: #e6eaef;
  --input: #f8fafb;
  --line: #d5dbe3;
  --line-strong: #b8c2ce;
  --text: #121820;
  --text-soft: #2f3a47;
  --muted: #5c6b7a;
  --faint: #8493a3;
  --accent: #0b6e99;
  --accent-soft: #d8eef8;
  --good: #1f8a57;
  --warn: #9a6b12;
  --danger: #b33a36;
}

html[data-theme="paper"] {
  color-scheme: light;
  --bg: #f7f3ea;
  --bg-raised: #fffdf8;
  --panel: #fffdf8;
  --panel-soft: #f0e9db;
  --panel-hover: #e8dfcc;
  --input: #fbf8f1;
  --line: #ddd2bc;
  --line-strong: #c4b69a;
  --text: #1c1610;
  --text-soft: #3d3428;
  --muted: #6e6252;
  --faint: #958671;
  --accent: #8a5a14;
  --accent-soft: #f0e0c4;
  --good: #2f7a45;
  --warn: #9a6b12;
  --danger: #a83d35;
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; min-width: 320px; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); }
body { font-size: 13px; line-height: 1.45; }
button, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:disabled { cursor: default; opacity: .42; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
[hidden] { display: none !important; }
kbd { padding: 1px 5px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--muted); background: var(--panel-soft); font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; white-space: nowrap; }

.app-shell {
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  grid-template-rows: var(--top-height) minmax(0, 1fr);
  width: 100%;
  height: 100dvh;
  background: var(--bg);
}

.app-shell.rail-expanded { --rail-width: 168px; }

.menu-bar {
  position: relative;
  z-index: 30;
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: center;
  min-width: 0;
  height: var(--top-height);
  padding: 0 8px 0 7px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-raised) 96%, transparent);
  user-select: none;
}

.brand-button, .menu-list button, .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.brand-button { gap: 7px; height: 29px; padding: 0 7px 0 3px; border-radius: 6px; font-weight: 680; letter-spacing: -.01em; }
.brand-button:hover, .menu-list button:hover, .icon-button:hover { background: var(--panel-hover); }
.brand-button img { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; }
.menu-list { display: flex; align-items: center; margin-left: 4px; }
.menu-list button { height: 27px; padding: 0 8px; border-radius: 5px; color: var(--text-soft); font-size: 12px; }
.project-crumb { display: flex; align-items: center; gap: 7px; min-width: 0; margin: 0 auto; color: var(--muted); font-size: 11px; }
.project-crumb strong { color: var(--text-soft); font-weight: 590; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.top-actions { display: flex; align-items: center; gap: 7px; }
.connection-state { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.connection-state > span { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); box-shadow: 0 0 0 2px color-mix(in srgb, var(--faint) 16%, transparent); }
.icon-button { width: 28px; height: 28px; padding: 0; border-radius: 6px; }
.icon-button svg { width: 16px; height: 16px; }

.app-menu {
  position: absolute;
  top: calc(100% + 5px);
  z-index: 50;
  width: 264px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: color-mix(in srgb, var(--panel) 97%, transparent);
  box-shadow: 0 18px 50px #0008;
  backdrop-filter: blur(18px);
}
.app-menu[data-menu="file"] { left: 70px; }
.app-menu[data-menu="edit"] { left: 110px; }
.app-menu[data-menu="view"] { left: 151px; }
.app-menu[data-menu="help"] { left: 195px; }
.app-menu[data-menu="theme"] { right: 7px; width: 246px; }
.app-menu > button { display: flex; align-items: center; width: 100%; min-height: 34px; gap: 10px; padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; text-align: left; cursor: pointer; }
.app-menu > button:hover:not(:disabled) { background: var(--panel-hover); }
.app-menu > button svg { flex: 0 0 auto; width: 16px; height: 16px; color: var(--muted); }
.app-menu > button > span:not(.theme-swatch) { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.app-menu small { color: var(--muted); font-size: 10px; }
.app-menu kbd { margin-left: auto; }
.menu-separator { height: 1px; margin: 5px 3px; background: var(--line); }
.menu-label { margin: 7px 8px 3px; color: var(--faint); font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.menu-empty { margin: 5px 8px 8px; color: var(--muted); font-size: 11px; }
.theme-swatch { width: 24px; height: 24px; flex: 0 0 auto; border: 1px solid var(--line-strong); border-radius: 50%; box-shadow: inset 0 0 0 3px #fff1; }
.theme-swatch.midnight { background: #0b1018; }
.theme-swatch.black { background: #050505; }
.theme-swatch.glass { background: linear-gradient(145deg, #1a1a24, #08080c); }
.theme-swatch.ocean { background: #07111d; box-shadow: inset 0 0 0 3px #65d5f533; }
.theme-swatch.forest { background: #08100f; box-shadow: inset 0 0 0 3px #73e6b133; }
.theme-swatch.warm { background: #17100b; box-shadow: inset 0 0 0 3px #e9ad6b33; }
.theme-swatch.white { background: #f4f6f8; border-color: #b8c2ce; box-shadow: inset 0 0 0 3px #0b6e9922; }
.theme-swatch.paper { background: #f7f3ea; border-color: #c4b69a; box-shadow: inset 0 0 0 3px #8a5a1422; }
.theme-menu button[aria-checked="true"] { background: var(--panel-hover); }
.theme-menu button[aria-checked="true"]::after { content: "✓"; color: var(--accent); }
.app-menu[data-menu="theme"] { width: min(280px, calc(100vw - 16px)); max-height: min(70dvh, 420px); overflow: auto; }

.icon-rail {
  z-index: 20;
  grid-column: 1;
  grid-row: 2;
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  padding: 7px 6px 6px;
  border-right: 1px solid var(--line);
  background: var(--bg-raised);
  transition: width 160ms ease;
}
.rail-main { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: 2px; }
.rail-item, .rail-collapse {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}
.rail-item:hover, .rail-collapse:hover { color: var(--text); background: var(--panel-hover); }
.rail-item.active { color: var(--text); background: var(--accent-soft); }
.rail-item.active::before { content: ""; position: absolute; left: 3px; width: 2px; height: 18px; border-radius: 3px; background: var(--accent); }
.rail-item svg, .rail-collapse svg { flex: 0 0 auto; width: 18px; height: 18px; }
.rail-item span, .rail-collapse span { opacity: 0; transition: opacity 100ms ease; }
.rail-expanded .rail-item span, .rail-expanded .rail-collapse span { opacity: 1; }
.rail-collapse { margin-top: auto; }
.rail-expanded .rail-collapse svg { transform: rotate(180deg); }

.workspace {
  position: relative;
  z-index: 1;
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 0 36px 0 0;
  background:
    radial-gradient(circle at 66% 8%, color-mix(in srgb, var(--accent) 4%, transparent), transparent 32%),
    var(--bg);
}
.honesty-banner { display: flex; min-height: 34px; align-items: center; gap: 8px; padding: 6px 9px 6px 13px; border-bottom: 1px solid var(--line); color: var(--muted); background: var(--panel-soft); font-size: 10.5px; }
.honesty-banner svg { flex: 0 0 auto; width: 14px; height: 14px; color: var(--accent); }
.honesty-banner strong { color: var(--text-soft); }
.honesty-banner > span { flex: 1; }
.honesty-banner button { display: grid; width: 24px; height: 24px; place-items: center; padding: 0; border: 0; border-radius: 5px; color: var(--muted); background: transparent; cursor: pointer; }
.honesty-banner button:hover { background: var(--panel-hover); }
.honesty-banner button svg { width: 13px; height: 13px; }

.pane-grid { display: grid; grid-template-columns: minmax(300px, .94fr) minmax(380px, 1.06fr); min-width: 0; height: calc(100% - 34px); transition: margin-right 180ms ease; }
.workspace.banner-dismissed .pane-grid { height: 100%; }
.workspace.drawer-open .pane-grid { margin-right: 360px; }
.workspace.hide-team .pane-grid { grid-template-columns: minmax(0, 1fr); }
.workspace.hide-team .team-pane { display: none; }
.workspace.hide-conversation .pane-grid { grid-template-columns: minmax(0, 1fr); }
.workspace.hide-conversation .conversation-pane { display: none; }
.workspace-pane { display: grid; min-width: 0; min-height: 0; grid-template-rows: 58px minmax(0, 1fr) auto; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 93%, transparent); }
.conversation-pane { border-right: 0; }
.pane-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg-raised) 72%, transparent); }
.eyebrow { margin: 0 0 1px; color: var(--faint); font-size: 8.5px; font-weight: 750; letter-spacing: .13em; }
.pane-header h1, .drawer-header h2, .dialog-heading h2 { margin: 0; font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
.pane-actions { display: flex; align-items: center; gap: 4px; }
.quiet-status { display: inline-flex; align-items: center; gap: 6px; margin-right: 2px; color: var(--muted); font-size: 9.5px; }
.quiet-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--faint); }
.pane-scroll, .conversation-scroll { min-height: 0; overflow: auto; scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }
.pane-scroll { padding: clamp(18px, 4.5vw, 50px) clamp(16px, 4vw, 44px); }
.empty-hero { display: flex; max-width: 400px; min-height: 46%; margin: 0 auto; align-items: center; flex-direction: column; justify-content: center; text-align: center; }
.empty-icon { display: grid; width: 42px; height: 42px; place-items: center; margin-bottom: 12px; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--muted); background: var(--panel); }
.empty-icon svg { width: 20px; height: 20px; }
.empty-hero h2 { max-width: 320px; margin: 5px 0 7px; font-size: 19px; line-height: 1.2; letter-spacing: -.025em; }
.empty-hero > p:not(.eyebrow) { max-width: 370px; margin: 0 0 15px; color: var(--muted); font-size: 12px; }
.secondary-button, .drawer-empty button { min-height: 31px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--panel); cursor: pointer; }
.secondary-button:hover, .drawer-empty button:hover { background: var(--panel-hover); }
.local-card { max-width: 440px; margin: 28px auto 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-soft); }
.card-heading { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; }
.local-tag { padding: 2px 6px; border: 1px solid var(--line); border-radius: 10px; color: var(--faint); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.local-card h3 { margin: 12px 0 4px; font-size: 13px; }
.local-card p { margin: 0; color: var(--muted); font-size: 11px; }
.text-button { padding: 0; border: 0; color: var(--accent); background: transparent; cursor: pointer; font-size: 11px; }
.local-card .text-button { margin-top: 10px; }
.pane-footer { display: flex; min-height: 34px; align-items: center; justify-content: space-between; padding: 7px 13px; border-top: 1px solid var(--line); color: var(--faint); font-size: 9.5px; }
.pane-footer > span { display: flex; align-items: center; gap: 6px; }
.pane-footer svg { width: 11px; height: 11px; }
.provider-actions { display: flex; align-items: center; gap: 10px; }
.provider-actions .text-button { white-space: nowrap; }

.conversation-scroll { padding: 14px clamp(14px, 2.5vw, 28px) 20px; }
.day-divider { display: flex; align-items: center; gap: 9px; margin: 4px 0 18px; color: var(--faint); font-size: 8.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.day-divider::before, .day-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.message { max-width: 680px; padding-left: 11px; border-left: 2px solid var(--line-strong); }
.message-body { min-width: 0; }
.message-meta { display: flex; align-items: baseline; gap: 8px; }
.message-meta strong { font-size: 11px; }
.message-meta span { color: var(--faint); font-size: 9px; }
.message-body > p { max-width: 650px; margin: 5px 0 7px; color: var(--text-soft); font-size: 12px; line-height: 1.55; }
.details-toggle { display: inline-flex; align-items: center; gap: 3px; padding: 2px 0; border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 9.5px; }
.details-toggle svg { width: 11px; height: 11px; }
.details-toggle.expanded svg { transform: rotate(180deg); }
.technical-details { max-width: 420px; margin-top: 7px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-soft); }
.technical-details dl { margin: 0; }
.technical-details dl div { display: flex; justify-content: space-between; gap: 16px; padding: 3px 0; }
.technical-details dt { color: var(--faint); }
.technical-details dd { margin: 0; color: var(--muted); text-align: right; }
.next-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; max-width: 680px; margin: 26px 0 0; }
.next-steps button, .choice-list button { display: flex; min-width: 0; align-items: center; gap: 9px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); text-align: left; cursor: pointer; }
.next-steps button:hover, .choice-list button:hover { border-color: var(--line-strong); background: var(--panel-hover); }
.next-steps svg, .choice-list svg { flex: 0 0 auto; color: var(--muted); }
.next-steps span, .choice-list span { display: flex; min-width: 0; flex-direction: column; }
.next-steps strong, .choice-list strong { overflow: hidden; font-size: 10px; font-weight: 590; text-overflow: ellipsis; white-space: nowrap; }
.next-steps small, .choice-list small { overflow: hidden; color: var(--faint); font-size: 8.5px; text-overflow: ellipsis; white-space: nowrap; }

.composer { padding: 5px 14px calc(11px + env(safe-area-inset-bottom)); background: linear-gradient(0deg, var(--bg) 80%, transparent); }
.draft-notice { min-height: 18px; color: var(--faint); font-size: 9px; text-align: center; }
.composer-box { padding: 8px 9px 7px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--input); box-shadow: 0 8px 30px #0003; }
.composer-box:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 8%, transparent), 0 8px 30px #0004; }
.composer textarea { display: block; width: 100%; max-height: 130px; min-height: 39px; resize: none; padding: 2px 2px 6px; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 12px; line-height: 1.45; }
.composer textarea::placeholder { color: var(--faint); }
.composer-toolbar { display: flex; min-height: 28px; align-items: center; justify-content: space-between; }
.composer-toolbar > div { display: flex; align-items: center; gap: 3px; }
.composer-mode { display: inline-flex; height: 28px; align-items: center; gap: 5px; padding: 0 8px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; cursor: pointer; font-size: 9.5px; }
.composer-mode:hover { background: var(--panel-hover); }
.composer-mode svg { width: 13px; height: 13px; color: var(--good); }
.send-button { display: grid; width: 29px; height: 29px; place-items: center; padding: 0; border: 0; border-radius: 7px; color: #071117; background: var(--accent); cursor: pointer; }
.send-button svg { width: 16px; height: 16px; stroke-width: 2.1; }

.drawer-dock { position: absolute; z-index: 8; top: 50%; right: 0; display: flex; flex-direction: column; gap: 3px; width: 36px; padding: 5px 4px; transform: translateY(-50%); border: 1px solid var(--line); border-right: 0; border-radius: 8px 0 0 8px; background: var(--bg-raised); }
.drawer-dock button { display: grid; width: 27px; height: 29px; place-items: center; padding: 0; border: 0; border-radius: 5px; color: var(--muted); background: transparent; cursor: pointer; }
.drawer-dock button:hover { color: var(--text); background: var(--panel-hover); }
.drawer-dock svg { width: 15px; height: 15px; }
.drawer-dock span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.drawer-open .drawer-dock { display: none; }

.context-drawer { position: absolute; z-index: 12; top: 0; right: 0; display: grid; width: 360px; height: 100%; grid-template-rows: 58px minmax(0, 1fr); border-left: 1px solid var(--line-strong); background: var(--panel-soft); box-shadow: -18px 0 50px #0004; transform: translateX(101%); transition: transform 180ms ease; }
.workspace.drawer-open .context-drawer { transform: translateX(0); }
.drawer-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 11px 9px 15px; border-bottom: 1px solid var(--line); background: var(--bg-raised); }
.drawer-scroll { min-height: 0; overflow-y: auto; padding: 14px; scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }
.drawer-intro, .drawer-note { margin: 0 0 14px; color: var(--muted); font-size: 11px; }
.drawer-empty { display: flex; min-height: 360px; align-items: center; flex-direction: column; justify-content: center; text-align: center; }
.drawer-empty > svg { width: 28px; height: 28px; margin-bottom: 12px; color: var(--faint); }
.drawer-empty h3 { margin: 0 0 5px; font-size: 14px; }
.drawer-empty p { max-width: 280px; margin: 0 0 14px; color: var(--muted); font-size: 11px; }
.compact-empty { min-height: 240px; }
.browser-bar { display: flex; height: 34px; align-items: center; gap: 7px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--faint); background: var(--input); font-size: 10px; }
.browser-bar > span { flex: 1; }
.browser-bar svg { width: 12px; height: 12px; }
.browser-bar button { display: grid; width: 24px; height: 24px; place-items: center; padding: 0; border: 0; color: var(--faint); background: transparent; }
.canvas-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; height: 130px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background-color: var(--input); background-image: radial-gradient(var(--line-strong) .7px, transparent .7px); background-size: 12px 12px; }
.canvas-grid div { border: 1px solid var(--line); border-radius: 6px; background: color-mix(in srgb, var(--panel) 80%, transparent); }
.preview-frame { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--input); }
.preview-toolbar { display: flex; height: 28px; align-items: center; gap: 5px; padding: 0 9px; border-bottom: 1px solid var(--line); }
.preview-toolbar span { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.preview-body { display: flex; height: 250px; align-items: center; flex-direction: column; justify-content: center; gap: 8px; color: var(--faint); font-size: 10px; }
.preview-body svg { width: 24px; height: 24px; }
.drawer-note { margin-top: 10px; }
.choice-list { display: grid; gap: 7px; }
.choice-list button { min-height: 55px; }
.choice-list strong { font-size: 11px; }
.choice-list small { font-size: 9.5px; }
.integration-list { display: grid; gap: 7px; }
.integration-list article { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.integration-list article.provider-choice { grid-template-columns: 34px minmax(0, 1fr) auto auto; }
.integration-mark { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text-soft); background: var(--panel-soft); font-size: 10px; font-weight: 700; }
.integration-mark svg { width: 16px; height: 16px; }
.integration-list article > div { display: flex; flex-direction: column; }
.integration-list strong { font-size: 11px; }
.integration-list small { color: var(--muted); font-size: 9px; }
.not-connected { padding: 2px 6px; border: 1px solid var(--line); border-radius: 8px; color: var(--faint); font-size: 8px; }
.provider-connect { min-height: 25px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--text-soft); background: var(--panel-soft); cursor: pointer; font-size: 9px; }
.provider-connect:hover { background: var(--panel-hover); }
.guard-state { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; padding: 14px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--panel); }
.guard-orbit { display: grid; width: 48px; height: 48px; place-items: center; border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--line)); border-radius: 50%; color: var(--warn); background: color-mix(in srgb, var(--warn) 8%, transparent); }
.guard-orbit svg { width: 22px; height: 22px; }
.guard-state span { display: block; color: var(--muted); font-size: 9px; }
.guard-state strong { display: block; margin-top: 2px; color: var(--warn); font-size: 13px; }
.guard-state p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.guard-section { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.guard-section h3 { display: flex; justify-content: space-between; margin: 0 0 6px; font-size: 11px; }
.guard-section h3 span { color: var(--muted); font-weight: 500; }
.guard-section p { margin: 0; color: var(--muted); font-size: 10px; }
.guard-section ul { margin: 6px 0 0; padding-left: 16px; color: var(--muted); font-size: 10px; }
.guard-section li + li { margin-top: 4px; }
.history-filters { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: var(--input); }
.history-filters button { flex: 1; min-height: 25px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; cursor: pointer; font-size: 9px; }
.history-filters button.active { color: var(--text); background: var(--panel-hover); }
.help-list { display: grid; gap: 8px; }
.help-list article { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.help-list h3 { margin: 0 0 4px; font-size: 11px; }
.help-list p { margin: 0; color: var(--muted); font-size: 10px; }

.mobile-pane-switch { display: none; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); max-width: calc(100% - 28px); padding: 9px 12px; transform: translateX(-50%); border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text-soft); background: var(--panel); box-shadow: 0 12px 40px #0009; font-size: 11px; }
.shortcuts-dialog { width: min(420px, calc(100% - 28px)); padding: 0; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--text); background: var(--panel); box-shadow: 0 24px 70px #000b; }
.shortcuts-dialog::backdrop { background: #000a; backdrop-filter: blur(2px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 11px 15px; border-bottom: 1px solid var(--line); }
.shortcuts-dialog dl { margin: 0; padding: 8px 15px 13px; }
.shortcuts-dialog dl div { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); }
.shortcuts-dialog dl div:last-child { border-bottom: 0; }
.shortcuts-dialog dt { color: var(--text-soft); font-size: 11px; }
.shortcuts-dialog dd { margin: 0; }

@media (max-width: 1180px) {
  .workspace.drawer-open .pane-grid { margin-right: 0; }
  .workspace.drawer-open::after { content: ""; position: absolute; z-index: 10; inset: 0 360px 0 0; background: #0006; }
  .context-drawer { box-shadow: -28px 0 60px #000b; }
  .next-steps { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  :root { --top-height: 40px; }
  .app-shell { grid-template-columns: 1fr; grid-template-rows: var(--top-height) minmax(0, 1fr) calc(52px + env(safe-area-inset-bottom)); }
  .menu-bar { grid-column: 1; }
  .brand-button span, .project-crumb, .connection-state { display: none; }
  .menu-list { margin-left: 0; }
  .menu-list button { padding: 0 6px; }
  .top-actions { margin-left: auto; }
  .app-menu[data-menu="file"] { left: 42px; }
  .app-menu[data-menu="edit"] { left: 78px; }
  .app-menu[data-menu="view"] { left: 117px; }
  .app-menu[data-menu="help"] { left: 158px; }
  .icon-rail { grid-column: 1; grid-row: 3; flex-direction: row; overflow-x: auto; padding: 4px 7px calc(4px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); border-right: 0; scrollbar-width: none; }
  .rail-main { min-width: max-content; flex: 1; flex-direction: row; gap: 2px; }
  .rail-item { width: calc((100vw - 30px) / 9); min-height: 40px; flex: 0 0 calc((100vw - 30px) / 9); justify-content: center; padding: 0; }
  .rail-item.active::before { inset: auto auto 2px auto; width: 18px; height: 2px; }
  .rail-item span, .rail-collapse { display: none; }
  .workspace { grid-column: 1; grid-row: 2; padding-right: 0; }
  .honesty-banner { min-height: 38px; padding-left: 9px; }
  .honesty-banner span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mobile-pane-switch { display: flex; height: 36px; align-items: center; gap: 3px; padding: 4px 7px; border-bottom: 1px solid var(--line); background: var(--bg-raised); }
  .mobile-pane-switch button { height: 27px; flex: 1; border: 0; border-radius: 5px; color: var(--muted); background: transparent; cursor: pointer; font-size: 10px; }
  .mobile-pane-switch button[aria-selected="true"] { color: var(--text); background: var(--panel-hover); }
  .pane-grid, .workspace.banner-dismissed .pane-grid { display: block; height: calc(100% - 74px); }
  .workspace.banner-dismissed .pane-grid { height: calc(100% - 36px); }
  .workspace-pane { width: 100%; height: 100%; border-right: 0; }
  .workspace.mobile-conversation .team-pane, .workspace:not(.mobile-conversation) .conversation-pane { display: none; }
  .workspace.hide-team .team-pane { display: none; }
  .workspace.hide-team .conversation-pane { display: grid; }
  .workspace.hide-conversation .conversation-pane { display: none; }
  .workspace.hide-conversation .team-pane { display: grid; }
  .drawer-dock { top: auto; right: 8px; bottom: 42px; width: auto; flex-direction: row; padding: 4px; transform: none; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px #0008; }
  .workspace.mobile-conversation .drawer-dock { bottom: 118px; }
  .context-drawer { top: auto; bottom: 0; width: 100%; height: min(78%, 650px); border-top: 1px solid var(--line-strong); border-left: 0; border-radius: 12px 12px 0 0; transform: translateY(101%); }
  .workspace.drawer-open .context-drawer { transform: translateY(0); }
  .workspace.drawer-open::after { inset: 0 0 min(78%, 650px); }
  .drawer-header::before { content: ""; position: absolute; top: 5px; left: 50%; width: 30px; height: 3px; transform: translateX(-50%); border-radius: 3px; background: var(--line-strong); }
  .drawer-header { position: relative; padding-top: 13px; }
  .empty-hero { min-height: 52%; }
  .next-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-left: 38px; }
  .provider-actions { gap: 8px; }
}

@media (max-width: 460px) {
  .pane-footer { align-items: flex-start; flex-direction: column; gap: 5px; }
  .provider-actions { width: 100%; justify-content: space-between; }
  .integration-list article.provider-choice { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .integration-list article.provider-choice .not-connected { display: none; }
}

@media (max-width: 520px) {
  .app-menu { position: fixed; top: 42px; right: 8px; left: 8px !important; width: auto !important; }
  .pane-header { height: 54px; padding: 8px 11px; }
  .quiet-status { display: none; }
  .pane-scroll { padding: 18px 14px; }
  .empty-hero h2 { font-size: 18px; }
  .conversation-scroll { padding: 12px 12px 18px; }
  .next-steps { grid-template-columns: 1fr; margin: 22px 0 0 38px; }
  .composer { padding-right: 10px; padding-left: 10px; }
  .draft-notice { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .drawer-scroll { padding: 12px; }
  .drawer-empty { min-height: 280px; }
  .compact-empty { min-height: 200px; }
}

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