﻿:root { color-scheme: dark; --bg:#0d0e10; --panel:#151619; --panel2:#1d1f23; --line:#2a2d32; --muted:#9da3ad; --text:#f2f3f5; --accent:#f2f3f5; }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
html, body { margin:0; width:100%; height:100%; min-height:100%; overflow:hidden; background:var(--bg); color:var(--text); font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif; }
button, textarea { font:inherit; }
input { font:inherit; }
button { color:inherit; }
.hidden { display:none !important; }
.shell { height:100vh; min-height:0; display:grid; grid-template-columns:260px 1fr; transition:grid-template-columns .2s ease; }
.sidebar { position:fixed; inset:0 auto 0 0; width:260px; padding:18px 14px; background:#111214; border-right:1px solid #202226; display:flex; flex-direction:column; overflow:hidden; z-index:5; transition:transform .2s ease; }
.brand { display:flex; align-items:center; gap:10px; padding:4px 8px 20px; font-size:14px; font-weight:700; letter-spacing:.08em; }
.brand-mark,.hero-mark { display:grid; place-items:center; background:linear-gradient(145deg,#f6f6f3,#999fa8); color:#111; font-weight:900; }
.brand-mark { width:26px; height:26px; border-radius:8px; }
.new-chat,.history-item { border:0; text-align:left; cursor:pointer; }
.new-chat { display:flex; gap:9px; align-items:center; width:100%; padding:11px 12px; border-radius:9px; background:#202226; }
.new-chat:hover,.history-item:hover { background:#292c31; }
.history-label { margin:26px 10px 8px; font-size:10px; color:#707680; letter-spacing:.12em; }
.module-nav { display:grid; gap:3px; margin-top:8px; }
.history { display:grid; flex:1 1 auto; align-content:start; grid-auto-rows:minmax(40px,auto); gap:3px; min-height:0; overflow-y:auto; }
.history-item { min-height:40px; padding:10px 12px; border-radius:8px; background:transparent; color:#c8cbd0; font-size:13px; line-height:20px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.history-item.active { background:#1c1e21; color:#fff; }
.sidebar-foot { flex:0 0 auto; margin-top:auto; padding:14px 8px 2px; border-top:1px solid var(--line); display:flex; gap:10px; align-items:center; }
.sidebar-foot strong,.sidebar-foot small { display:block; font-size:12px; }
.sidebar-foot small { color:var(--muted); margin-top:3px; }
.status-dot { width:8px; height:8px; border-radius:50%; background:#70d69b; box-shadow:0 0 12px #70d69b77; }
.workspace { grid-column:2; height:100vh; min-height:0; display:grid; grid-template-rows:54px minmax(0,1fr); }
.workspace-scroll { position:relative; min-width:0; min-height:0; overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain; scrollbar-gutter:stable; }
.topbar { position:sticky; top:0; z-index:4; display:flex; justify-content:space-between; align-items:center; padding:0 22px; border-bottom:1px solid #1e2024; background:#0d0e10e8; backdrop-filter:blur(14px); }
.topbar strong { font-size:13px; letter-spacing:.03em; }
.candidate { margin-left:9px; padding:3px 6px; border:1px solid #2c493f; border-radius:5px; color:#7ed3ad; background:#111c18; font-size:9px; letter-spacing:.08em; }
.details-button,.menu-button,.settings-button { border:1px solid var(--line); background:transparent; border-radius:8px; padding:7px 10px; cursor:pointer; font-size:12px; }
.top-actions { display:flex; gap:8px; }
.menu-button { display:block; }
.conversation { width:min(820px,calc(100% - 36px)); margin:0 auto; padding:42px 0 200px; }
.welcome { min-height:55vh; display:flex; flex-direction:column; justify-content:center; align-items:center; text-align:center; }
.hero-mark { width:54px; height:54px; border-radius:16px; font-size:25px; box-shadow:0 18px 50px #0008; }
.welcome h1 { margin:20px 0 8px; font-size:30px; letter-spacing:-.04em; }
.welcome>p { margin:0 0 28px; color:var(--muted); font-size:14px; }
.prompt-card,.union-card { width:min(420px,100%); padding:14px 16px; border:1px solid var(--line); border-radius:12px; background:var(--panel); text-align:left; cursor:pointer; }
.union-card { margin-top:10px; background:#1a2020; border-color:#354642; }
.prompt-card:hover,.union-card:hover { border-color:#4a4f58; background:#191b1f; }
.prompt-card span,.prompt-card small,.union-card span,.union-card small { display:block; }
.prompt-card small,.union-card small { margin-top:4px; color:var(--muted); }
.message { display:grid; grid-template-columns:32px 1fr; gap:12px; margin:0 0 28px; }
.avatar { width:30px; height:30px; border-radius:8px; display:grid; place-items:center; background:#272a2f; font-size:12px; font-weight:800; }
.message.user .avatar { background:#ecece9; color:#111; }
.message-body { min-width:0; }
.message-head { display:flex; gap:9px; align-items:center; margin:2px 0 7px; font-size:13px; }
.core-tag { padding:2px 6px; border-radius:4px; background:#23262b; color:#aeb4bd; font-size:9px; }
.message-text { color:#d9dce1; line-height:1.62; font-size:14px; white-space:pre-wrap; }
.next-action { margin-top:12px; padding:11px 13px; border-left:2px solid #d3d6da; background:#17191c; border-radius:0 8px 8px 0; }
.next-action small { display:block; margin-bottom:3px; color:var(--muted); }
.composer { position:fixed; left:260px; right:0; bottom:0; padding:18px 24px 12px; background:linear-gradient(transparent,#0d0e10 25%); }
.composer-box { width:min(820px,100%); margin:auto; padding:13px 13px 10px 16px; border:1px solid #363a41; border-radius:16px; background:#181a1e; box-shadow:0 18px 55px #0009; }
textarea { width:100%; max-height:160px; resize:none; outline:none; border:0; background:transparent; color:#fff; line-height:1.5; }
textarea::placeholder { color:#777d86; }
.composer-actions { display:flex; justify-content:space-between; align-items:center; margin-top:8px; }
.scope { color:#8f959e; font-size:11px; }
.send { width:31px; height:31px; border:0; border-radius:9px; background:#f1f2f3; color:#111; cursor:pointer; font-weight:800; }
.send:disabled { opacity:.35; cursor:default; }
.composer>p { margin:8px auto 0; text-align:center; color:#686e77; font-size:10px; }
dialog { width:min(460px,calc(100% - 32px)); border:1px solid #373b42; border-radius:14px; padding:0; background:#17191c; color:#fff; box-shadow:0 28px 90px #000; }
dialog::backdrop { background:#0009; backdrop-filter:blur(3px); }
.dialog-head { display:flex; justify-content:space-between; padding:17px 18px; border-bottom:1px solid var(--line); }
.dialog-head button { border:0; background:transparent; cursor:pointer; font-size:20px; }
dialog dl { margin:0; padding:8px 18px; }
dialog dl div { display:flex; justify-content:space-between; gap:20px; padding:11px 0; border-bottom:1px solid #25282d; }
dialog dt { color:var(--muted); } dialog dd { margin:0; text-align:right; }
dialog>p { padding:4px 18px 18px; color:var(--muted); line-height:1.5; }
.input-dialog>form>p { margin:0; padding:14px 18px 4px; color:var(--muted); font-size:12px; line-height:1.5; }
.input-dialog-fields { display:grid; gap:13px; padding:14px 18px 18px; }
.input-dialog-fields label { display:grid; gap:6px; color:#b8bdc5; font-size:11px; }
.input-dialog-fields input { width:100%; padding:10px 11px; border:1px solid #343840; border-radius:8px; outline:none; background:#111316; color:#fff; }
.input-dialog-fields input:focus { border-color:#69717d; }
.input-dialog-actions { display:flex; justify-content:flex-end; gap:8px; padding:13px 18px 17px; border-top:1px solid var(--line); }
.input-dialog-actions button { padding:9px 13px; border:1px solid #343840; border-radius:8px; background:#22252a; cursor:pointer; }
.input-dialog-actions button[type="submit"] { background:#eceeec; color:#111; }
.programmer { position:relative; height:calc(100vh - 54px); overflow:hidden; background:#0d0e10; }
.programmer-bar { height:58px; padding:0 22px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid #1f2125; }
.project-button { display:flex; align-items:center; gap:10px; min-width:210px; padding:7px 10px; border:0; border-radius:9px; background:transparent; text-align:left; cursor:pointer; }
.project-button:hover { background:#17191c; }
.project-button small,.project-button strong { display:block; }
.project-button small { margin-bottom:2px; color:#727984; font-size:9px; letter-spacing:.12em; }
.project-button strong { max-width:300px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
.folder-icon { display:grid; place-items:center; width:30px; height:30px; border:1px solid #30343a; border-radius:8px; color:#b9bec6; font-size:18px; }
.chevron { margin-left:auto; color:#707680; }
.programmer-bar-actions { display:flex; align-items:center; gap:9px; }
.project-meta { max-width:42%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); font-size:12px; }
.project-button:disabled,.welcome-project:disabled { opacity:.55; cursor:wait; }
.safe-badge { padding:6px 9px; border:1px solid #2c493f; border-radius:999px; color:#7ed3ad; background:#111c18; font-size:9px; letter-spacing:.08em; }
.changes-button { padding:7px 10px; border:1px solid #30343a; border-radius:8px; background:#17191c; cursor:pointer; font-size:11px; }
.changes-button span { margin-left:5px; padding:1px 5px; border-radius:999px; background:#292c31; color:#aeb4bd; }
.programmer-thread { width:min(780px,calc(100% - 44px)); height:calc(100% - 58px); margin:0 auto; padding:32px 0 190px; overflow-y:auto; scrollbar-width:thin; }
.programmer-welcome { min-height:calc(100vh - 340px); display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; }
.programmer-mark { width:48px; height:48px; display:grid; place-items:center; border-radius:15px; background:linear-gradient(145deg,#f6f6f3,#999fa8); color:#111; font-size:22px; font-weight:900; box-shadow:0 18px 50px #0008; }
.programmer-welcome h1 { margin:18px 0 7px; font-size:28px; letter-spacing:-.04em; }
.programmer-welcome p { max-width:500px; margin:0; color:#8f959e; line-height:1.55; font-size:13px; }
.welcome-project { margin-top:22px; padding:10px 15px; border:1px solid #3a3e45; border-radius:9px; background:#1a1c20; cursor:pointer; font-size:12px; }
.welcome-project:hover { background:#24272c; }
.programmer-message { display:grid; grid-template-columns:32px 1fr; gap:12px; margin-bottom:27px; }
.programmer-message>span { width:30px; height:30px; display:grid; place-items:center; border-radius:8px; background:#272a2f; font-size:11px; font-weight:800; }
.programmer-message.user>span { background:#ecece9; color:#111; }
.programmer-message strong { display:block; margin:2px 0 6px; font-size:12px; }
.programmer-message p { margin:0; color:#d9dce1; white-space:pre-wrap; line-height:1.62; font-size:14px; }
.programmer-composer { position:absolute; left:0; right:0; bottom:0; padding:28px 22px 12px; background:linear-gradient(transparent,#0d0e10 28%); }
.programmer-composer-box { width:min(780px,100%); margin:0 auto; padding:13px 13px 10px 16px; border:1px solid #363a41; border-radius:16px; background:#181a1e; box-shadow:0 18px 55px #0009; }
.programmer-composer textarea { width:100%; min-height:48px; max-height:150px; border:0; outline:0; resize:none; background:transparent; color:#fff; line-height:1.5; }
.programmer-composer-actions { display:flex; align-items:center; justify-content:space-between; margin-top:8px; }
.programmer-composer-actions span { color:#818791; font-size:10px; }
.programmer-composer-actions i { display:inline-block; width:6px; height:6px; margin-right:5px; border-radius:50%; background:#70d69b; }
.programmer-composer-actions button { width:31px; height:31px; border:0; border-radius:9px; background:#f1f2f3; color:#111; cursor:pointer; font-weight:800; }
.programmer-composer>small { display:block; margin:7px auto 0; color:#666c75; text-align:center; font-size:9px; }
.changes-drawer { position:absolute; inset:0 0 0 auto; z-index:7; width:min(390px,100%); padding:0 18px 18px; border-left:1px solid #2a2d32; background:#141518; box-shadow:-20px 0 60px #0008; }
.drawer-head { height:58px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid #282b30; }
.drawer-head button { border:0; background:transparent; cursor:pointer; color:#aeb4bd; font-size:21px; }
.drawer-empty { min-height:55%; display:flex; flex-direction:column; align-items:center; justify-content:center; color:#7d838c; text-align:center; }
.drawer-empty.candidate-review { display:block; position:absolute; inset:59px 10px 112px 10px; min-height:0; overflow:auto; padding:10px; text-align:left; }
.candidate-file { margin:0 0 10px; border:1px solid #32363d; border-radius:9px; background:#1b1d21; color:#c8cdd5; }
.candidate-file summary { cursor:pointer; padding:10px; color:#f0c65a; font-size:12px; overflow-wrap:anywhere; }
.candidate-file strong { display:block; padding:7px 10px 0; color:#9ca3ad; font-size:10px; }
.candidate-file pre { max-height:240px; margin:5px 8px 10px; padding:9px; overflow:auto; white-space:pre-wrap; word-break:break-word; border-radius:6px; background:#101114; color:#d7dae0; font:11px/1.45 ui-monospace,Consolas,monospace; }
.drawer-empty span { display:grid; place-items:center; width:42px; height:42px; margin-bottom:13px; border:1px solid #32363d; border-radius:12px; }
.drawer-empty strong { margin-bottom:5px; color:#b8bdc5; font-size:13px; }
.drawer-empty small { font-size:11px; }
.drawer-decisions { position:absolute; left:18px; right:18px; bottom:18px; display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.drawer-decisions button { padding:10px; border:1px solid #343840; border-radius:8px; background:#22252a; }
.drawer-decisions button:disabled { opacity:.35; }

.controller{height:calc(100vh - 54px);overflow-y:auto;padding:28px;background:#0d0e10}.controller-head{width:min(1040px,100%);margin:0 auto 22px;display:flex;align-items:flex-start;justify-content:space-between;gap:18px}.controller-head h1{margin:10px 0 6px;font-size:26px;letter-spacing:-.035em}.controller-head p{margin:0;max-width:700px;color:var(--muted);font-size:13px;line-height:1.55}.controller-open-badge,.controller-readonly{display:inline-flex;padding:6px 9px;border:1px solid #665627;border-radius:999px;background:#221d0f;color:#e4ca75;font-size:9px;font-weight:800;letter-spacing:.08em}.controller-readonly{border-color:#343840;background:#17191c;color:#9da4ae;white-space:nowrap}.controller-tabs{width:min(1040px,100%);margin:0 auto 18px;display:flex;gap:7px;padding-bottom:1px;overflow-x:auto}.controller-tab{padding:9px 12px;border:1px solid #30343a;border-radius:9px;background:#15171a;color:#aeb4bd;cursor:pointer;white-space:nowrap;font-size:11px}.controller-tab.active{background:#eceeec;color:#111;border-color:#eceeec}.controller-content{width:min(1040px,100%);margin:0 auto}.controller-pane{display:none}.controller-pane.active{display:block}.controller-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:14px}.controller-summary>div{padding:14px;border:1px solid #292d33;border-radius:12px;background:#15171a}.controller-summary small,.controller-summary strong{display:block}.controller-summary small{margin-bottom:6px;color:#717884;font-size:9px;letter-spacing:.08em}.controller-summary strong{overflow-wrap:anywhere;font-size:13px}.controller-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.controller-card,.controller-lock-card{padding:15px;border:1px solid #2c3036;border-radius:13px;background:#15171a}.controller-card-top{display:flex;align-items:center;justify-content:space-between;gap:10px}.controller-card-top>span{padding:3px 6px;border-radius:999px;background:#24282e;color:#aeb4bd;font-size:8px;font-weight:800}.controller-card>small{display:block;margin:5px 0 12px;color:#737a84;font-size:10px;overflow-wrap:anywhere}.controller-card dl{margin:0}.controller-card dl div{display:flex;justify-content:space-between;gap:10px;padding:6px 0;border-top:1px solid #24272c;font-size:10px}.controller-card dt{color:#777e88}.controller-card dd{margin:0;text-align:right;color:#c9cdd3}.controller-error{border-color:#6a3030}.controller-note{margin:13px 2px 0;color:#747b85;font-size:10px;line-height:1.55}.controller-lock-card{min-height:160px;display:flex;flex-direction:column;justify-content:center;align-items:flex-start}.controller-lock-card strong{font-size:16px}.controller-lock-card p{max-width:660px;margin:8px 0 0;color:var(--muted);line-height:1.55;font-size:12px}.memory-summary{grid-template-columns:repeat(4,minmax(0,1fr))}

.controller-readonly[hidden]{display:none}.model-route-panel{width:min(760px,100%);padding:16px;border:1px solid #dfcf9f;border-radius:14px;background:rgba(255,255,255,.78);box-shadow:0 8px 25px rgba(40,70,60,.05)}.model-route-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding-bottom:13px;border-bottom:1px solid #e8dfc3}.model-route-head>div{display:grid;gap:3px}.model-route-head small,.model-route-primary small,.model-route-reserves>small{color:#718078;font-size:9px;font-weight:800;letter-spacing:.08em}.model-route-head strong{font-size:15px}.controller-model-actions{display:flex;align-items:center;gap:10px;min-height:15px;margin:10px 0 0;flex-wrap:wrap}.model-route-primary{display:grid;grid-template-columns:minmax(260px,360px) auto;align-items:end;gap:12px;padding:14px 0 12px}.model-route-primary label{display:grid;gap:6px}.model-route-state{align-self:end;margin-bottom:5px;padding:5px 9px;border-radius:999px;background:#dff3e7;color:#087348;font-size:10px;font-weight:800}.model-route-reserves{display:grid;gap:7px}.model-route-chips{display:flex;gap:7px;flex-wrap:wrap}.model-route-chip{display:inline-flex;align-items:center;gap:7px;padding:7px 10px;border:1px solid #dce5e0;border-radius:9px;background:#fbfdfc;color:#314239;font-size:11px}.model-route-chip b{display:grid;width:18px;height:18px;place-items:center;border-radius:50%;background:#e7f1eb;color:#075f3d;font-size:9px}.model-route-empty{color:#718078;font-size:11px}
#controllerPrimarySelect{width:100%;padding:8px 10px;border:1px solid #d1bd82;border-radius:8px;background:#fff;color:#24352c;font:inherit;font-weight:700}
body.theme-dark #controllerPrimarySelect{background:#0a2119;color:#edf8f1;border-color:#53685d}
.models-registry-open{min-width:170px;padding:9px 13px}
.model-registry-dialog{width:min(1180px,calc(100% - 32px));max-height:90vh;overflow:hidden}
.model-registry-dialog>.model-catalog-panel{max-height:90vh;margin:0;border:0;border-radius:0;overflow:auto;box-shadow:none}
.registry-head-actions{display:flex;align-items:center;gap:8px}.registry-dialog-close{width:36px;height:36px;border:1px solid #d1bd82;border-radius:9px;background:#fff;color:#24352c;cursor:pointer;font-size:21px;line-height:1}
body.theme-dark .registry-dialog-close{background:#15372b;color:#edf8f1;border-color:#53685d}
.controller-action{padding:7px 10px;border:1px solid #343941;border-radius:8px;background:#191c20;color:#c0c5cc;cursor:pointer;font-size:10px}
.controller-action:hover{border-color:#555c67}.controller-action.active{background:#eceeec;color:#111;border-color:#eceeec}.controller-action:disabled{opacity:.4;cursor:not-allowed}
.controller-card-actions{display:flex;gap:7px;margin-top:12px}.controller-card-actions .controller-action{flex:1}
.actual-model-summary{grid-template-columns:1fr 1fr}.controller-model-actions span{color:#7f8792;font-size:10px}.controller-model-actions span.error{color:#d98585}

body.sidebar-collapsed .shell { grid-template-columns:0 1fr; }
body.sidebar-collapsed .sidebar { transform:translateX(-100%); }
body.sidebar-collapsed .composer { left:0; }

@media (max-width:760px) {
  .shell { display:block; }
  .sidebar,body.sidebar-collapsed .sidebar { transform:translateX(-100%); transition:transform .2s ease; box-shadow:10px 0 40px #0008; }
  .sidebar.open,body.sidebar-collapsed .sidebar.open { transform:translateX(0); }
  .workspace { display:grid; }
  .menu-button { display:block; }
  .composer { left:0; padding-inline:12px; }
  .conversation { padding-top:24px; }
  .details-button { padding-inline:8px; font-size:10px; }
  .programmer-bar { padding-inline:12px; }
  .project-button { min-width:0; }
  .project-meta { display:none; }
  .safe-badge { display:none; }
  .programmer-thread { width:calc(100% - 24px); }
  .programmer-composer { padding-inline:12px; }
  .controller { padding:18px 12px 28px; }
  .controller-head { display:block; }
  .controller-readonly { margin-top:12px; }
  .controller-head h1 { font-size:22px; }
  .controller-tabs { margin-bottom:14px; }
  .controller-summary,.memory-summary { grid-template-columns:1fr 1fr; }
  .controller-grid { grid-template-columns:1fr; }
  .model-route-head { align-items:flex-start; flex-direction:column; }
  .model-route-primary { grid-template-columns:1fr; }
  .model-route-state { justify-self:start; }
  .actual-model-summary { grid-template-columns:1fr; }
}

.danger-button{border:1px solid #7b2e2e;background:#271313;color:#ffb4b4;border-radius:8px;padding:8px 12px;font-weight:700}.danger-button:disabled{opacity:.45}

.knowledge-form{width:min(760px,100%);padding:16px;border:1px solid #2c3036;border-radius:13px;background:#15171a}.knowledge-form-intro{margin-bottom:15px;padding-bottom:13px;border-bottom:1px solid #e8dfc3}.knowledge-form-intro strong{font-size:15px}.knowledge-form-intro p{max-width:650px;margin:5px 0 0;color:#66746d;font-size:11px;line-height:1.5}.knowledge-form label{display:block;margin-bottom:12px;color:#66746d;font-size:10px}.knowledge-form label>span,.knowledge-form label>small{color:#849189;font-weight:400}.knowledge-form input,.knowledge-form select,.knowledge-form textarea{box-sizing:border-box;width:100%;margin-top:6px;padding:10px;border:1px solid #343840;border-radius:8px;background:#0f1113;color:#e8e9e9;font:inherit}.knowledge-form select{max-width:340px}.knowledge-form textarea{min-height:90px;resize:vertical}.knowledge-form label:first-of-type textarea{min-height:130px}.knowledge-actions,.knowledge-card-actions{display:flex;gap:7px;align-items:center;flex-wrap:wrap}.knowledge-actions button,.knowledge-card-actions button{padding:7px 10px;border:1px solid #3b4047;border-radius:8px;background:#202328;color:#d7dade;cursor:pointer;font-size:10px}.knowledge-list{display:grid;gap:10px}.knowledge-card{padding:14px;border:1px solid #2c3036;border-radius:12px;background:#15171a}.knowledge-card-head{display:flex;justify-content:space-between;gap:10px;align-items:center}.knowledge-status{padding:4px 7px;border-radius:999px;background:#24282e;font-size:8px;font-weight:800}.knowledge-text{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;line-height:1.5}.knowledge-card>small{display:block;margin:7px 0 11px;color:#747b85}.decision-title{margin:22px 0 10px;font-size:13px}.decision-list{display:grid;gap:6px}.decision-row{padding:8px 10px;border:1px solid #292d33;border-radius:8px;color:#9da4ae;font-size:9px;overflow-wrap:anywhere}@media (max-width:760px){.knowledge-card-actions button{flex:1 1 42%}}

.research-toolbar{display:grid;gap:10px;margin-bottom:14px}.research-form{width:min(820px,100%);box-sizing:border-box;padding:16px;border:1px solid #2c3036;border-radius:13px;background:#15171a}.research-form-intro{margin-bottom:15px;padding-bottom:13px;border-bottom:1px solid #e8dfc3}.research-form-intro strong{font-size:15px}.research-form-intro p{margin:5px 0 0;color:#66746d;font-size:11px}.research-form label{display:block;margin-bottom:12px;color:#9da4ae;font-size:10px}.research-form label span,.research-form label small{color:#849189}.research-form input,.research-form textarea{box-sizing:border-box;width:100%;margin-top:7px;padding:10px;border:1px solid #343840;border-radius:8px;background:#0f1113;color:#e8e9e9;resize:vertical}.research-form textarea{min-height:90px}.research-form label:first-of-type textarea{min-height:115px}.research-form label small{display:block;margin-top:5px}.research-actions,.research-card-actions{display:flex;align-items:center;gap:8px;margin-top:10px;flex-wrap:wrap}.research-actions button,.research-stop,.research-card-actions button{padding:8px 11px;border:1px solid #3b4047;border-radius:8px;background:#202328;color:#d7dade;cursor:pointer}.research-provider-missing,.research-blocker{color:#a76d13}.research-warning{max-width:796px;padding:10px 12px;border:1px solid #d6bd72;border-radius:9px;background:#fff9e8;color:#76530d;font-size:10px}.research-list{display:grid;gap:10px}.research-card{padding:14px;border:1px solid #2c3036;border-radius:12px;background:#15171a}.research-card-head{display:flex;justify-content:space-between;gap:10px;align-items:center}.research-card-head span{padding:4px 7px;border-radius:999px;background:#e9f1ec;font-size:9px;font-weight:800}.research-query{margin-bottom:5px;white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px}.research-criterion{margin:0 0 8px;color:#66746d;font-size:10px}.research-card>small{display:block;color:#747b85;margin-bottom:10px}.research-evidence{display:grid;gap:8px}.research-evidence-row{display:grid;gap:5px;padding:10px;border-top:1px solid #ddd3b2}.research-evidence-row p{margin:0;white-space:pre-wrap;font-size:11px;line-height:1.45}.research-evidence-row small{color:#777e88}.research-evidence-row a{color:#096b4b;font-size:10px}.research-stop{margin-top:10px;border-color:#b95d5d}.research-card-actions{margin-top:12px}
@media (max-width:760px){.research-evidence-row{grid-template-columns:1fr}.research-actions button{width:100%}.research-card-head{align-items:flex-start}}


/* STEP40.6 STAGE2 SYNC1 — preserve current module sidebar + add conversation metadata UI */
.history-tools{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;align-items:center;padding:0 6px 8px}
.history-search{width:100%;box-sizing:border-box;border:1px solid var(--line,#2b2d31);border-radius:9px;background:transparent;color:inherit;padding:8px 9px}
.history-archive-toggle{border:1px solid var(--line,#2b2d31);background:transparent;color:inherit;border-radius:9px;padding:8px 9px;cursor:pointer}
.history-archive-toggle.active{background:rgba(255,255,255,.08)}
.conversation-history{display:grid;min-height:0;overflow-y:auto;gap:2px}
.history-row{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 30px;align-items:center;border-radius:10px;margin:2px 6px}
.history-row.active{background:rgba(255,255,255,.07)}
.history-row .history-item{width:100%;min-width:0;margin:0;background:transparent}
.history-open{display:flex!important;flex-direction:column;align-items:flex-start!important;gap:3px}
.history-title{display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
.history-row.pinned .history-title::before{content:"◆";margin-right:6px;color:#e1bf58;font-size:8px;vertical-align:2px}
.history-meta{display:block;opacity:.55;font-size:10px;font-weight:400}
.history-more{border:0;background:transparent;color:inherit;opacity:.62;border-radius:8px;height:30px;cursor:pointer;font-size:18px}
.history-more:hover{opacity:1;background:rgba(255,255,255,.08)}
.history-menu{position:absolute;z-index:30;right:3px;top:32px;min-width:155px;padding:5px;background:#17191d;border:1px solid var(--line,#2b2d31);border-radius:10px;box-shadow:0 10px 30px rgba(0,0,0,.35)}
.history-menu.floating{position:fixed;top:0;right:auto;bottom:auto;max-height:calc(100vh - 16px);overflow-y:auto}
.history-menu button{display:block;width:100%;border:0;background:transparent;color:inherit;text-align:left;padding:8px 9px;border-radius:7px;cursor:pointer}
.history-menu button:hover{background:rgba(255,255,255,.08)}
.history-menu .history-delete{margin-top:4px;border-top:1px solid rgba(255,255,255,.14);border-radius:0 0 7px 7px;color:#ff7f86}
.delete-conversation-dialog .danger-confirm{border-color:#a51f29!important;background:#a51f29!important;color:#fff!important}
.history-empty{padding:14px 12px;font-size:12px;opacity:.55}
.current-chat-heading{min-width:0;max-width:min(52vw,620px)}
.current-chat-heading strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media (max-width:760px){
  .history-row{margin-inline:4px}
  .current-chat-heading{max-width:52vw}
  .current-chat-heading strong{font-size:14px}
  .history-search{font-size:16px}
}


/* STEP40.6 STAGE3 — explicit Test Archive, never inferred from chat text */
.history-tools{grid-template-columns:minmax(0,1fr) auto auto}
@media (max-width:760px){
  .history-tools{grid-template-columns:minmax(0,1fr) auto}
  #testArchiveViewToggle{grid-column:1 / -1;width:100%}
}


/* STEP40.6 STAGE5 — module status/management UX */
.module-label{margin:12px 10px 5px;font-size:10px;letter-spacing:.08em;opacity:.5}
.module-nav{display:grid;gap:3px;margin-top:0}
.module-entry{display:grid!important;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px}
.module-entry-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.module-entry-state{font-size:9px;letter-spacing:.04em;opacity:.48}
.module-nav-empty{padding:9px 11px;font-size:11px;opacity:.5}
.module-status-panel{margin-top:16px;padding-top:14px;border-top:1px solid var(--line,#2b2d31)}
.module-status-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:8px}
.module-status-head small{max-width:240px;text-align:right;opacity:.55;font-size:10px}
.module-status-list{display:grid;gap:6px}
.module-status-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 10px;border:1px solid var(--line,#2b2d31);border-radius:9px}
.module-status-row strong{font-size:12px}
.module-state-badge{font-size:9px;letter-spacing:.05em;padding:4px 6px;border-radius:999px;border:1px solid currentColor}
.module-state-badge.enabled{opacity:.82}
.module-state-badge.disabled{opacity:.42}
.module-status-empty{font-size:11px;opacity:.55;padding:7px 0}
@media (max-width:760px){
  .module-status-head{display:block}
  .module-status-head small{display:block;max-width:none;text-align:left;margin-top:4px}
}


/* STEP40.6 STAGE6 — clean permanent GARGAR face */
.runtime-status-panel{margin-top:12px;padding-top:10px;border-top:1px solid var(--line,#2b2d31);font-size:11px;opacity:.68}
.runtime-status-panel p{margin:4px 0}


/* STEP40.6 UI CATALOG1 */
.model-catalog-panel{margin:0 0 20px;padding:16px;border:1px solid #2c3036;border-radius:13px;background:#111316}
.model-catalog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:14px}
.model-catalog-head small{display:block;margin-bottom:5px;color:#707884;font-size:9px;font-weight:800;letter-spacing:.09em}
.model-catalog-head h2{margin:0;color:#e8eaed;font-size:17px}
.model-catalog-head p{margin:6px 0 0;color:#7c838d;font-size:10px;line-height:1.5}
.model-catalog-provider{flex:0 0 auto;padding:5px 8px;border:1px solid #343941;border-radius:999px;background:#1b1e22;color:#c2c7ce;font-size:9px;font-weight:800}
.model-catalog-toolbar{display:grid;grid-template-columns:minmax(220px,1fr) auto;gap:10px;align-items:end;margin-bottom:12px}
.model-search{display:grid;gap:5px;color:#777f89;font-size:9px}
.model-search input{width:100%;padding:9px 11px;border:1px solid #30353c;border-radius:9px;background:#0d0f11;color:#e5e7ea;outline:none}
.model-search input:focus{border-color:#626b77}
#controllerCatalogStatus{grid-column:1/-1;color:#7f8792;font-size:10px}
#controllerCatalogStatus.error{color:#d98585}
.model-catalog-list{display:grid;gap:7px}
.model-catalog-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:12px;padding:11px 12px;border:1px solid #292d33;border-radius:10px;background:#15171a}
.model-catalog-info{min-width:0}
.model-catalog-info strong,.model-catalog-info small{display:block;overflow-wrap:anywhere}
.model-catalog-info strong{font-size:12px}
.model-catalog-info small{margin-top:4px;color:#757d87;font-size:9px}
.model-catalog-state{color:#8f97a2;font-size:9px;white-space:nowrap}
.controller-subtitle{margin:0 0 10px;color:#c8ccd2;font-size:12px;font-weight:700}

@media (max-width:760px){
  .model-catalog-head{display:block}
  .model-catalog-provider{display:inline-flex;margin-top:10px}
  .model-catalog-toolbar{grid-template-columns:1fr}
  #controllerCatalogStatus{grid-column:1}
  .model-catalog-row{grid-template-columns:1fr}
  .model-catalog-state{white-space:normal}
}

.attachment-stage1{display:grid;gap:8px;margin:6px 0 10px}
.attachment-toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;font-size:12px}
.attachment-toolbar button,.attachment-upload-state button,.attachment-card button{border:1px solid var(--line,#444);border-radius:8px;padding:6px 10px;background:transparent;color:inherit;cursor:pointer}
.attachment-drop-zone{border:1px dashed var(--line,#555);border-radius:10px;padding:9px;text-align:center;font-size:12px;opacity:.8}
.attachment-drop-zone.dragover{outline:2px solid currentColor}
.attachment-upload-state{display:grid;grid-template-columns:minmax(0,1fr) 160px auto;gap:8px;align-items:center;font-size:12px}
.attachment-upload-state progress{width:100%}
.attachment-errors{font-size:12px}
.attachment-list{display:grid;gap:6px}
.attachment-card{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center;border:1px solid var(--line,#444);border-radius:9px;padding:7px 9px;font-size:12px}
.attachment-card small{display:block;opacity:.72;margin-top:2px}

/* GAR_AI FACE V1 — owner-approved white/gold, emerald and ruby visual system. */
:root{
  color-scheme:light;
  --bg:#f7fafc;
  --panel:rgba(255,255,255,.86);
  --panel2:#f1f6f8;
  --line:#d9c58f;
  --muted:#61706b;
  --text:#17241f;
  --accent:#b78a2d;
  --gar-green:#064c32;
  --gar-green-dark:#023522;
  --gar-green-soft:#0d6847;
  --gar-gold:#c69a36;
  --gar-gold-light:#f0d78b;
  --gar-red:#a80e16;
  --gar-red-light:#d52a31;
  --gar-paper:#fffef9;
}
html,body{background:var(--bg);color:var(--text)}
body{overflow-x:hidden}
.shell{grid-template-columns:280px 1fr;background:#f8fbfd}
.sidebar{
  width:280px;padding:20px 14px 14px;color:#f7fff9;
  background:
    radial-gradient(circle at 18% 4%,rgba(31,151,95,.28),transparent 28%),
    linear-gradient(155deg,var(--gar-green-soft) 0%,var(--gar-green) 38%,var(--gar-green-dark) 100%);
  border-right:1px solid rgba(240,215,139,.56);
  box-shadow:8px 0 28px rgba(0,46,30,.15)
}
.brand{color:var(--gar-gold-light);font-family:Georgia,"Times New Roman",serif;font-size:18px;letter-spacing:.06em;text-shadow:0 1px 10px rgba(240,215,139,.2)}
.brand-mark{
  color:#fff4bd;background:linear-gradient(145deg,#8e6415,#f2d786 45%,#9b6b14);
  border:1px solid #f3dda1;box-shadow:0 5px 18px rgba(0,0,0,.25);font-family:Georgia,serif
}
.new-chat{color:#fff;background:rgba(255,255,255,.11);border:1px solid rgba(255,255,255,.08);box-shadow:inset 0 1px rgba(255,255,255,.08)}
.new-chat:hover,.history-item:hover{background:rgba(255,255,255,.14)}
.module-label,.history-label{color:rgba(240,215,139,.78)}
.history-search,.history-archive-toggle{color:#f4fff8;border-color:rgba(240,215,139,.38);background:rgba(0,30,20,.22)}
.history-search::placeholder{color:rgba(238,250,242,.62)}
.history-archive-toggle:hover,.history-archive-toggle.active{background:rgba(240,215,139,.18);border-color:rgba(240,215,139,.75)}
.history-item{color:#edf8f1}.history-item.active,.history-row.active{background:rgba(255,255,255,.13);color:#fff}
.history-meta{color:#d2e7da}.history-menu{background:#063d2a;border-color:#b8994b}.history-menu button{color:#fff}
.module-entry-state{color:#cfebd8}.sidebar-foot{border-color:rgba(240,215,139,.4)}.sidebar-foot small{color:#c9dfd1}
.status-dot{background:#6ff0b0;box-shadow:0 0 14px rgba(111,240,176,.8)}
.workspace{
  position:relative;height:100vh;min-height:0;grid-template-rows:64px minmax(0,1fr);
  background:
    radial-gradient(ellipse at 80% 38%,rgba(203,228,246,.6),transparent 43%),
    radial-gradient(ellipse at 24% 65%,rgba(255,226,167,.32),transparent 40%),
    linear-gradient(135deg,#fffef9 0%,#f8fcff 50%,#edf7fd 100%);
  overflow:hidden
}
.workspace::before,.workspace::after{content:"";position:fixed;left:280px;right:-8%;pointer-events:none;z-index:0;transform:rotate(-4deg)}
.workspace::before{height:220px;bottom:19%;border-radius:50%;border-top:2px solid rgba(202,158,57,.38);background:linear-gradient(180deg,rgba(255,255,255,.05),rgba(205,231,248,.44));box-shadow:0 -26px 55px rgba(255,238,199,.34)}
.workspace::after{height:145px;bottom:7%;border-radius:50%;border-top:1px solid rgba(202,158,57,.24);background:linear-gradient(180deg,rgba(235,247,255,.24),rgba(184,219,241,.22))}
.workspace-scroll>.conversation,.workspace-scroll>.programmer,.workspace-scroll>.controller{position:relative;z-index:1}
.topbar{
  min-height:64px;padding:0 24px;color:#243229;
  background:rgba(255,254,249,.9);border-top:10px solid var(--gar-red);border-bottom:1px solid rgba(183,138,45,.42);
  box-shadow:inset 0 2px 0 var(--gar-gold-light),0 8px 24px rgba(49,61,57,.06);backdrop-filter:blur(18px)
}
.topbar strong{font-size:14px}.menu-button,.details-button,.settings-button,.theme-toggle{color:#32443a;border-color:#d8c690;background:rgba(255,255,255,.6)}
.menu-button:hover,.details-button:hover,.settings-button:hover,.theme-toggle:hover{border-color:var(--gar-gold);background:#fffaf0}
.settings-button{width:34px;height:34px;padding:0;display:grid;place-items:center;font-size:17px}
.theme-toggle{width:34px;height:34px;border:1px solid #d8c690;border-radius:50%;display:grid;place-items:center;cursor:pointer;font-size:17px}
.top-actions{align-items:center}
.owner-profile{min-width:48px;display:grid;grid-template-columns:32px auto;grid-template-rows:auto auto;align-items:center;column-gap:7px;color:#4b584f}
.owner-profile span{grid-row:1/3;width:32px;height:32px;display:grid;place-items:center;border-radius:9px;color:#fff;background:linear-gradient(145deg,var(--gar-red-light),#8d0910);border:1px solid var(--gar-gold-light);font-weight:800}
.owner-profile small{font-size:10px;line-height:1.1}
.conversation{width:min(900px,calc(100% - 42px));padding:42px 0 230px}
.welcome{min-height:60vh}
.hero-mark{
  width:auto;height:auto;padding:0;border-radius:0;background:transparent;color:var(--gar-gold);
  font:700 86px/1 Georgia,"Times New Roman",serif;
  text-shadow:0 1px 0 #fff5bd,1px 2px 0 #9b6a16,0 12px 30px rgba(183,138,45,.2);box-shadow:none
}
.welcome h1{color:#1b2821;margin:24px 0 10px;font-family:Georgia,"Times New Roman",serif;font-size:29px;letter-spacing:0}
.welcome>p{color:#5e6a64;font-size:15px}
.message{padding:14px 16px;margin-bottom:16px;border:1px solid rgba(196,163,87,.34);border-radius:16px;background:rgba(255,255,255,.74);box-shadow:0 10px 32px rgba(35,73,65,.06);backdrop-filter:blur(10px)}
.avatar{background:linear-gradient(145deg,var(--gar-green-soft),var(--gar-green-dark));color:#fff;border:1px solid rgba(240,215,139,.72)}
.message.user .avatar{background:linear-gradient(145deg,#fff7d3,#d7ae4a);color:#26352d}
.message-head{color:#24352c}.message-text{color:#27372f}.core-tag{background:#edf4ef;color:#53625a}
.next-action{background:#f4f8f5;border-left-color:var(--gar-gold);color:#24352c}
.composer{position:fixed;left:280px;z-index:3;padding:11px 26px 13px;background:linear-gradient(90deg,#86070d 0%,var(--gar-red-light) 48%,#8f080e 100%);border-top:2px solid var(--gar-gold-light);box-shadow:0 -8px 26px rgba(121,8,13,.16)}
.composer-box{width:min(900px,100%);padding:11px 13px 9px 16px;border:1px solid #d9b958;border-radius:18px;background:#fff;box-shadow:0 8px 30px rgba(73,14,17,.25)}
textarea{color:#17241f}textarea::placeholder{color:#78827d}.scope{color:#5d6d64}
.send{background:linear-gradient(145deg,#16835a,#075339);color:#fff;border:1px solid #d9bd64;box-shadow:0 3px 10px rgba(4,76,50,.25)}
.attachment-stage1{color:#314239}.attachment-toolbar button,.attachment-upload-state button,.attachment-card button{border-color:#d8c58e;color:#294035;background:#fffaf0}.attachment-drop-zone{border-color:#c9ac59;background:#fbfdfb}.attachment-card{border-color:#dfce9e;background:#fbfdfb}
#microphoneStop:disabled,#microphoneCancel:disabled{display:none}
dialog{background:#fffef9;color:#1f3027;border-color:#d4b967}.dialog-head{border-color:#dfd1a7}dialog dt,.input-dialog>form>p{color:#66736c}.input-dialog-fields label{color:#526259}.input-dialog-fields input{background:#fff;color:#1f3027;border-color:#d7c693}
.programmer,.controller{background:transparent;color:#1e3027}
.programmer-bar{border-color:#dcca98;background:rgba(255,255,255,.62)}
.programmer-mark{background:transparent;color:var(--gar-gold);box-shadow:none;font-family:Georgia,serif;font-size:46px}
.programmer-welcome p,.project-meta,.controller-head p{color:#607068}
.programmer-composer{background:linear-gradient(transparent,rgba(245,250,252,.96) 30%)}
.programmer-composer-box{background:#fff;border-color:#cfb363;box-shadow:0 18px 55px rgba(41,74,65,.15)}
.programmer-composer textarea{color:#1f3027}.programmer-message p{color:#283a31}.programmer-message>span{background:var(--gar-green);color:#fff}
.controller-open-badge{background:#fff8dc;color:#76530d;border-color:#caa448}.controller-readonly{background:#f4f8f5;color:#516258;border-color:#c8d5cd}
.controller-tab,.controller-action,.research-actions button,.research-stop,.research-card-actions button,.knowledge-actions button,.knowledge-card-actions button{background:#fff;color:#314239;border-color:#d1bd82}
.controller-tab.active,.controller-action.active{background:var(--gar-green);color:#fff;border-color:var(--gar-green)}
.controller-summary>div,.controller-card,.controller-lock-card,.knowledge-form,.knowledge-card,.research-form,.research-card,.model-catalog-panel{background:rgba(255,255,255,.78);border-color:#dfcf9f;box-shadow:0 8px 25px rgba(40,70,60,.05)}
.controller-card dd,.model-catalog-head h2{color:#24352c}.knowledge-form input,.knowledge-form select,.knowledge-form textarea,.research-form input,.research-form textarea,.model-search input{background:#fff;color:#24352c;border-color:#d8c792}
.controller-note,.controller-card>small,.knowledge-card>small,.decision-row,.research-card>small{color:#66746d}
.model-catalog-row{background:#fff!important;border-color:#ddd0a8!important;color:#24352c!important}

body.theme-dark{
  color-scheme:dark;--bg:#071b15;--panel:#10251e;--panel2:#142b23;--line:#6e613a;--muted:#aebbb4;--text:#edf8f1
}
body.theme-dark .workspace{background:radial-gradient(ellipse at 75% 40%,rgba(31,77,71,.5),transparent 46%),linear-gradient(145deg,#0b1d18,#102722 54%,#071712)}
body.theme-dark .topbar{color:#eef8f2;background:rgba(8,31,24,.92)}
body.theme-dark .topbar strong,body.theme-dark .menu-button,body.theme-dark .details-button,body.theme-dark .settings-button,body.theme-dark .theme-toggle{color:#eef8f2}
body.theme-dark .welcome h1,body.theme-dark .welcome>p,body.theme-dark .message-head,body.theme-dark .message-text,body.theme-dark .programmer,body.theme-dark .controller{color:#edf8f1}
body.theme-dark .model-route-panel{background:rgba(11,35,27,.86);border-color:#53685d}body.theme-dark .model-route-head{border-color:#31493e}body.theme-dark .model-route-chip{background:#15372b;color:#edf8f1;border-color:#53685d}body.theme-dark .model-route-state{background:#164a35;color:#bff2d5}
body.theme-dark .message,body.theme-dark .composer-box,body.theme-dark dialog,body.theme-dark .controller-summary>div,body.theme-dark .controller-card,body.theme-dark .controller-lock-card,body.theme-dark .knowledge-form,body.theme-dark .knowledge-card,body.theme-dark .research-form,body.theme-dark .research-card,body.theme-dark .model-catalog-panel{background:rgba(11,35,27,.86);color:#edf8f1}
body.theme-dark textarea,body.theme-dark .programmer-composer textarea,body.theme-dark .input-dialog-fields input,body.theme-dark .knowledge-form input,body.theme-dark .knowledge-form select,body.theme-dark .knowledge-form textarea,body.theme-dark .research-form input,body.theme-dark .research-form textarea,body.theme-dark .model-search input{color:#edf8f1;background:#0a2119}
body.theme-dark .programmer-bar{background:rgba(8,31,24,.7)}
body.theme-dark .programmer-composer{background:linear-gradient(transparent,rgba(7,23,18,.98) 30%)}

@media(max-width:760px){
  .shell{display:block}.sidebar{width:280px}.workspace::before,.workspace::after{left:0}.topbar{padding-inline:12px}.owner-profile small{display:none}.owner-profile{min-width:32px;grid-template-columns:32px}.details-button{display:none}.composer{left:0;padding-inline:10px}.conversation{width:calc(100% - 24px);padding-top:24px}.welcome h1{font-size:24px}.hero-mark{font-size:66px}
}

/* Browser settings and independently scrolling conversation area. */
.settings-dialog{width:min(660px,calc(100% - 28px))}
.settings-dialog .dialog-head>div{display:grid;gap:3px}.settings-dialog .dialog-head small{color:#718079;font-size:12px;font-weight:400}
.settings-list{display:grid;padding:4px 22px 8px}
.settings-list>label{display:grid;grid-template-columns:minmax(0,1fr) minmax(150px,210px);align-items:center;gap:18px;padding:16px 0;border-bottom:1px solid #e3e8e5}
.settings-list>label>span{display:grid;gap:4px}.settings-list strong{font-size:14px}.settings-list small{color:#718079;font-size:12px;line-height:1.4}
.settings-list select{width:100%;padding:9px 34px 9px 11px;border:1px solid #b8c6bf;border-radius:9px;background:#fff;color:#20362c;font:inherit}
.settings-list .settings-switch{grid-template-columns:minmax(0,1fr) auto}.settings-switch input{width:42px;height:23px;accent-color:#087450;cursor:pointer}
.settings-permission-card{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:18px;padding:16px 0;border-bottom:1px solid #e3e8e5}.settings-permission-card>span{display:grid;gap:4px}.settings-permission-card button{padding:9px 12px;border:1px solid #c9a93e;border-radius:9px;background:#fff;color:#075f3d;cursor:pointer}
.agent-download-card{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:14px;margin:14px 0 4px;padding:15px;border:1px solid #d9c477;border-radius:13px;background:linear-gradient(135deg,#fffdf7,#f2f8f4)}
.agent-download-mark{display:grid;width:42px;height:42px;place-items:center;border-radius:11px;background:linear-gradient(145deg,#d7ad35,#9b7118);color:#fff;font:700 24px Georgia,serif;box-shadow:0 5px 14px rgba(117,79,10,.18)}
.agent-download-card>div{display:grid;gap:4px}.agent-download-card #agentDownloadVersion{color:#087450;font-weight:700}
.agent-download-card a{min-width:112px;padding:10px 14px;border:1px solid #087450;border-radius:9px;background:#087450;color:#fff;text-align:center;text-decoration:none;font-weight:700}
.agent-download-card a:hover{background:#05613f}
.settings-actions{display:flex;justify-content:space-between;gap:12px;padding:16px 22px 21px}.settings-actions button{min-width:120px;padding:10px 16px;border:1px solid #cbb25f;border-radius:9px;background:#fff;color:#075f3d;cursor:pointer}.settings-actions .settings-save{background:#087450;color:#fff;border-color:#087450}
body.theme-dark .settings-list>label{border-color:#29483c}body.theme-dark .settings-list select{border-color:#416052;background:#0a2119;color:#edf8f1}body.theme-dark .settings-dialog .dialog-head small,body.theme-dark .settings-list small{color:#adc0b6}body.theme-dark .settings-actions button{background:#15372b;color:#edf8f1}
body.theme-dark .settings-permission-card{border-color:#29483c}body.theme-dark .settings-permission-card button{border-color:#705f2c;background:#15372b;color:#edf8f1}
body.theme-dark .agent-download-card{border-color:#705f2c;background:linear-gradient(135deg,#10271e,#153127)}body.theme-dark .agent-download-card #agentDownloadVersion{color:#75ddb0}
body[data-chat-text-size="small"] .message-text{font-size:13px}body[data-chat-text-size="large"] .message-text{font-size:16px;line-height:1.68}
body[data-chat-width="wide"] .conversation,body[data-chat-width="wide"] .composer-line{width:min(1180px,calc(100% - 42px))}
body[data-chat-width="full"] .conversation,body[data-chat-width="full"] .composer-line{width:calc(100% - 42px);max-width:none}
body[data-chat-density="compact"] .message{margin-bottom:10px;padding:10px 12px}body[data-chat-density="compact"] .message-text{line-height:1.48}
body:not(.show-message-time) .message-head time,body:not(.show-message-time) .message-head small:not(.core-tag){display:none}
@media(max-width:760px){.settings-list>label,.settings-permission-card{grid-template-columns:1fr;gap:9px}.settings-list .settings-switch{grid-template-columns:minmax(0,1fr) auto}.settings-permission-card button{width:100%}.settings-dialog{max-height:92vh}.settings-list{max-height:64vh;overflow:auto}.settings-button{width:32px;height:32px}.agent-download-card{grid-template-columns:auto minmax(0,1fr)}.agent-download-card a{grid-column:1/-1;width:100%}}

/* GAR_AI FACE V2 — compact conversational composer and automatic language. */
.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.conversation{padding-bottom:112px}
.composer{padding:7px 18px 8px;border-top-width:2px}
.composer-box{width:min(900px,100%);padding:0;border-radius:18px;background:#fff;overflow:visible}
.composer-primary{min-height:52px;display:grid;grid-template-columns:38px minmax(0,1fr) 38px 38px 38px;gap:5px;align-items:center;padding:6px 8px}
.composer-primary textarea{grid-column:2;min-height:26px;max-height:112px;padding:4px 6px;align-self:center}
.composer-icon,.composer-primary .send{width:36px;height:36px;display:grid;place-items:center;border:0;border-radius:50%;cursor:pointer}
.composer-icon{color:#587066;background:transparent;font-size:20px;line-height:1}
.composer-icon:hover{color:var(--gar-green);background:#eef6f1}
.attachment-add{grid-column:1;grid-row:1;font-size:26px;font-weight:300}
.microphone-start,.microphone-stop{grid-column:3;grid-row:1}.microphone-start{color:#315f4d;font-size:15px}.microphone-start::before{content:"";width:10px;height:16px;border:2px solid currentColor;border-radius:8px}.microphone-start::after{content:"";position:absolute;width:16px;height:8px;margin-top:8px;border:2px solid currentColor;border-top:0;border-radius:0 0 10px 10px}
.microphone-start{position:relative;color:transparent}.microphone-start::before,.microphone-start::after{color:#315f4d}
.microphone-stop{color:#a80e16;font-size:13px}.microphone-cancel{grid-column:4;grid-row:1;color:#a80e16}
.composer-primary .send{grid-column:5;grid-row:1;background:linear-gradient(145deg,#169465,#05603f);color:#fff;font-size:18px;border:1px solid #e1c56f}
.composer-primary .send:disabled{background:#bbd9ca;color:#fff;border-color:#d6e3da}
.attachment-stage1{display:block;margin:0;padding:0 10px;color:#314239}
.attachment-stage1:has(.attachment-list:empty) .attachment-list{display:none}
.attachment-errors:empty,.attachment-context-state:empty{display:none}
.attachment-errors:not(:empty),#attachmentContextState:not(:empty){padding:0 5px 7px;color:#8d1117;font-size:11px}
.attachment-upload-state{grid-template-columns:minmax(0,1fr) 120px auto;padding:0 4px 7px}
.attachment-list:not(:empty){display:flex;gap:6px;overflow-x:auto;padding:0 0 8px}
.attachment-card{flex:0 0 auto;max-width:420px;padding:5px 7px;border-radius:10px}
.attachment-card .attachment-actions{display:flex;gap:4px}
.attachment-card button{padding:4px 7px;font-size:10px}
.attachment-preview:not([hidden]){max-height:220px;overflow:auto;margin:0 0 8px;padding:8px;border:1px solid #dfce9e;border-radius:10px;background:#fbfdfb}
.attachment-preview:has(.attachment-image-thumbnail){display:flex;align-items:center;width:max-content;max-width:100%;max-height:none;overflow:hidden;margin:0 4px 8px;padding:5px;border:1px solid #dfce9e;border-radius:11px;background:#fff}
.attachment-image-thumbnail{display:block;max-width:132px;max-height:96px;border-radius:7px;object-fit:cover;cursor:pointer}
.attachment-image-wrapper{position:relative;display:inline-block;line-height:0}
.attachment-image-remove{position:absolute;z-index:2;top:-8px;right:-8px;width:20px;height:20px;padding:0;border:2px solid #fff;border-radius:50%;background:#202622;color:#fff;box-shadow:0 2px 7px rgba(0,0,0,.28);font:700 15px/15px Arial,sans-serif;cursor:pointer}
.attachment-image-remove:hover{background:#a81018}.attachment-image-remove:disabled{opacity:.55;cursor:wait}
.message-image-thumbnail{display:block;width:112px;height:84px;margin:3px 0 9px;border:1px solid #dec77e;border-radius:10px;background:#fff;object-fit:cover;cursor:pointer;box-shadow:0 3px 10px rgba(29,54,43,.12)}
.message-image-thumbnail:hover,.attachment-image-thumbnail:hover{outline:2px solid rgba(210,164,45,.45);outline-offset:1px}
.composer-box.attachment-dragover{outline:3px dashed #16875c;outline-offset:4px;background:#f3fff8}
body.theme-dark .composer-box.attachment-dragover{background:#123729;outline-color:#75ddb0}
body.theme-dark .composer-box{background:#0a2119}
body.theme-dark .composer-icon{color:#dcebe3}body.theme-dark .composer-icon:hover{background:#14382b}
body.theme-dark .microphone-start{color:transparent}body.theme-dark .microphone-start::before,body.theme-dark .microphone-start::after{color:#dcebe3}
@media(max-width:760px){
  .conversation{padding-bottom:104px}.composer{padding:6px}.composer-primary{grid-template-columns:34px minmax(0,1fr) 34px 34px 34px;padding:5px}.composer-icon,.composer-primary .send{width:32px;height:32px}.owner-profile{display:none}
}

/* GAR_AI FACE V3 — exact alignment with the owner's reference. */
.brand{color:#f5d675;text-shadow:0 1px 0 #76500a,0 0 12px rgba(255,221,118,.28)}
.brand-mark{color:#fff1ad;border:1px solid #ffe39a;background:linear-gradient(145deg,#8a5e0e 0%,#f7dc7b 48%,#94640d 100%)}
.hero-mark{color:#d3a329;text-shadow:0 1px 0 #fff4ae,1px 2px 0 #8f5d08,0 0 1px #6f4907,0 12px 30px rgba(183,138,45,.23)}
.sidebar-foot strong{color:#f3f7f4;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:220px}
.composer-line{width:min(980px,100%);margin:auto;display:grid;grid-template-columns:minmax(0,1fr) 46px;gap:7px;align-items:center}
.composer-box{width:auto;margin:0;border:2px solid #d5a72d;border-radius:17px;box-shadow:0 4px 15px rgba(76,24,12,.26),inset 0 0 0 1px rgba(255,239,173,.65)}
.composer-primary{grid-template-columns:40px minmax(0,1fr) 40px 40px;gap:3px}
.composer-primary textarea{grid-column:2}
.attachment-add{grid-column:1;font-size:0;position:relative;color:#2d6b52}
.attachment-add::before{content:"";width:21px;height:14px;border:2px solid currentColor;border-radius:2px 3px 3px 3px;background:transparent;box-sizing:border-box;transform:translateY(2px)}
.attachment-add::after{content:"";position:absolute;width:10px;height:5px;left:8px;top:9px;border:2px solid currentColor;border-bottom:0;border-radius:2px 2px 0 0;box-sizing:border-box}
.microphone-start,.microphone-stop{grid-column:3}.microphone-cancel{grid-column:4}
.composer-line>.send{width:42px;height:42px;padding:0;border:0;border-radius:0;background:transparent;color:#098653;font-size:31px;line-height:1;box-shadow:none;text-shadow:0 1px 0 #e5d494,0 2px 8px rgba(0,78,48,.28)}
.composer-line>.send:hover:not(:disabled){color:#00a866;transform:translateX(1px)}
.composer-line>.send:disabled{background:transparent;color:#8fb8a6;border:0;opacity:.45;box-shadow:none}
body.theme-dark .composer-box{border-color:#e1bd52;box-shadow:0 4px 16px rgba(0,0,0,.4),inset 0 0 0 1px rgba(255,222,124,.18)}
body.theme-dark .composer-line>.send{background:transparent;color:#65dba5}
@media(max-width:760px){
  .composer-line{grid-template-columns:minmax(0,1fr) 38px;gap:3px}.composer-primary{grid-template-columns:34px minmax(0,1fr) 34px 34px}.composer-line>.send{width:36px;height:36px;font-size:27px}
}

/* GAR_AI FACE V4 — owner's microphone asset and clearer input feedback. */
.microphone-start::before,.microphone-start::after{display:none}
.microphone-start{color:inherit}
.microphone-start img{display:block;width:27px;height:27px;object-fit:contain;opacity:.82}
.microphone-start:hover img{opacity:1;transform:scale(1.04)}
body.theme-dark .microphone-start{color:inherit}
body.theme-dark .microphone-start img{filter:invert(1);opacity:.9}
.attachment-add:hover::before,.attachment-add:hover::after{filter:drop-shadow(0 1px 2px rgba(0,82,52,.22))}
.attachment-errors a{color:#08764d;font-weight:700;text-decoration:underline;text-underline-offset:2px}
body.theme-dark .attachment-errors a{color:#76e0aa}

/* GAR_AI FACE V5.3 — compact owner-facing file chip; technical actions stay out of the composer. */
.attachment-list:not(:empty){padding:0 4px 7px;overflow:visible}
.attachment-card{position:relative;display:flex;align-items:center;max-width:min(360px,100%);min-height:34px;padding:5px 38px 5px 34px;border-radius:10px;background:#fffdf7}
.attachment-card{cursor:pointer}.attachment-card:hover{border-color:#caa63e;background:#fffaf0}
.attachment-card::before{content:"";position:absolute;left:10px;width:15px;height:12px;border:1.5px solid #34725a;border-radius:2px}
.attachment-card>div:first-child{min-width:0}.attachment-card strong{display:block;max-width:270px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}.attachment-card small{display:none}
.attachment-card .attachment-actions{position:absolute;right:5px;display:block}
.attachment-card .attachment-actions button{display:none}
.attachment-card .attachment-actions button:last-child{display:grid;width:28px;height:28px;padding:0;place-items:center;border:0;border-radius:50%;font-size:0;background:transparent;color:#66736d}
.attachment-card .attachment-actions button:last-child::before{content:"×";font-size:20px;line-height:1}
.attachment-card .attachment-actions button:last-child:hover{background:#f7e9e9;color:#94141a}
body.theme-dark .attachment-card{background:#102b21}

/* GAR_AI FACE V5 — complete owner-grade microphone recording state. */
.composer-primary.is-recording{grid-template-columns:40px minmax(0,1fr) 40px;gap:8px}
.composer-primary.is-recording .attachment-add,.composer-primary.is-recording textarea,.composer-primary.is-recording .microphone-start{display:none}
.composer-primary.is-recording .microphone-cancel{grid-column:1;grid-row:1}
.microphone-recording-ui{grid-column:2;grid-row:1;min-width:0;display:flex;align-items:center;gap:12px;padding:0 3px}
.microphone-waveform{height:34px;min-width:80px;flex:1;display:flex;align-items:center;justify-content:center;gap:3px;overflow:hidden}
.microphone-waveform i{display:block;flex:1 1 2px;max-width:4px;min-width:2px;height:calc(4px + (var(--level) * 27px));border-radius:999px;background:linear-gradient(180deg,#1b8d64,#47645a);transition:height 70ms linear}
.microphone-timer{min-width:42px;color:#6b7771;font:600 12px/1.1 ui-monospace,SFMono-Regular,Consolas,monospace;font-variant-numeric:tabular-nums}
.microphone-cancel{color:#69746f;font-size:25px;background:#f3f4f3}
.microphone-cancel:hover{color:#8f1118;background:#f7e9e9}
.composer-primary.is-recording .microphone-stop{grid-column:3;grid-row:1;display:grid;background:#eef0ef;color:#27342e}
.microphone-stop::before{content:"";width:11px;height:11px;border-radius:2px;background:currentColor}
.microphone-stop:hover{color:#fff;background:#26342d}
.composer-primary.is-voice-ready .microphone-waveform i{background:linear-gradient(180deg,#d2a52e,#16835a)}
.composer-primary.is-voice-ready .microphone-timer{color:#38715b}
body.theme-dark .microphone-waveform i{background:linear-gradient(180deg,#73ddb1,#d5e7de)}
body.theme-dark .microphone-timer{color:#c6d7ce}
body.theme-dark .microphone-cancel,body.theme-dark .composer-primary.is-recording .microphone-stop{background:#17382c;color:#dcebe3}
@media(max-width:760px){
  .composer-primary.is-recording{grid-template-columns:34px minmax(0,1fr) 34px;gap:4px}.microphone-recording-ui{gap:6px}.microphone-waveform{gap:2px}.microphone-timer{min-width:38px;font-size:11px}
}

/* Память: статус должен читаться одинаково в светлой и тёмной теме. */
.knowledge-status{border:1px solid transparent;background:#e8ecea;color:#314039}
.knowledge-status.is-approved{border-color:#b9dfc8;background:#dff3e7;color:#126139}
.knowledge-status.is-rejected{border-color:#efc5c5;background:#fbe6e6;color:#8b2424}
.knowledge-status.is-proposed{border-color:#ead39b;background:#fff4d6;color:#72520a}
.knowledge-status.is-revision{border-color:#c9d4ed;background:#e8eefb;color:#334f89}
.knowledge-status.is-archived,.knowledge-status.is-neutral{border-color:#d5dad7;background:#ecefed;color:#4d5953}

/* Память: рабочие записи отдельно, принятые решения в компактных группах. */
.memory-inbox{padding:14px;border:1px solid #dfbf68;border-radius:14px;background:rgba(255,255,255,.72)}
.memory-inbox-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px}.memory-inbox-head small{display:block;color:#78847e;font-size:9px;font-weight:700;letter-spacing:.08em}.memory-inbox-head h2{margin:3px 0 0;font-size:17px}.memory-inbox-head>strong,.memory-group summary>strong{display:inline-grid;min-width:24px;height:24px;padding:0 7px;place-items:center;border-radius:999px;background:#edf2ef;color:#24533f;font-size:10px}
.memory-groups{display:flex;flex-direction:column;gap:8px;margin-top:12px}
.memory-group{min-width:0;border:1px solid #d9c88f;border-radius:12px;background:rgba(255,255,255,.66);overflow:hidden;transition:border-color .15s ease,box-shadow .15s ease}
.memory-group summary{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:48px;padding:0 16px;cursor:pointer;color:#263b32;font-size:12px;font-weight:700;list-style:none;user-select:none}
.memory-group summary::-webkit-details-marker{display:none}
.memory-group summary::before{content:'›';color:#748078;font-size:18px;line-height:1;transition:transform .15s ease}
.memory-group[open]{border-color:#b99845;box-shadow:0 8px 24px rgba(35,69,56,.08)}
.memory-group[open] summary::before{transform:rotate(90deg)}
.memory-group summary span{flex:1}
.memory-group[open] summary{border-bottom:1px solid #e4dcc1;background:rgba(239,246,242,.74)}
.memory-group>.knowledge-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:12px;overflow:visible}
.memory-group>.decision-list{padding:12px;overflow:visible}
.memory-group .knowledge-card{min-width:0;padding:13px}
.memory-group-empty{grid-column:1/-1;margin:0;padding:16px;color:#738078;font-size:11px;text-align:center}
body.theme-dark .memory-inbox,body.theme-dark .memory-group{background:rgba(8,39,30,.72);border-color:#bfa45b}body.theme-dark .memory-inbox-head small,body.theme-dark .memory-group-empty{color:#aabcb3}body.theme-dark .memory-group summary{color:#edf7f2}body.theme-dark .memory-group summary>strong,body.theme-dark .memory-inbox-head>strong{background:#174936;color:#e5f4ed}body.theme-dark .memory-group[open] summary{border-bottom-color:#536b61;background:rgba(22,72,55,.7)}
@media(max-width:920px){.memory-group>.knowledge-list{grid-template-columns:1fr}}
@media(max-width:760px){.memory-inbox{padding:11px}.memory-group summary{min-height:46px;padding:0 12px}.memory-group>.knowledge-list,.memory-group>.decision-list{padding:9px}}
