/* Shared brand, readable text, compact stations, and explicit lifecycle controls. */
:root { --danger-ink: #a82d3c; --body-copy: #515966; }
body { font-size: 16px; }
[hidden] { display:none !important; }
.account-button { display:flex; align-items:center; gap:9px; min-height:44px; padding:4px 10px; color:#262b35; border:1px solid #dfe2e8; border-radius:9px; background:#fff; cursor:pointer; }
.account-button > span { display:grid; place-items:center; width:30px; height:30px; border-radius:50%; color:#fff; background:#272d39; font-size:14px; }
.account-button > b { font-size:14px; font-weight:600; white-space:nowrap; }
.topbar .global-search { flex:1; min-width:130px; max-width:390px; }
.topbar .brand { width:auto; flex-shrink:0; }
.nav-item,.nav-item .nav-label,body[data-view="projects"] .nav-item .nav-label { font-size:14px; }
body[data-view="projects"] .nav-item { min-height:42px; }
.sidebar .storage-card small { font-size:12px; }
.project-hub { padding:24px 28px 40px; }
.project-hub > header { gap:16px; flex-wrap:wrap; }
.project-hub > header h1 { font-size:30px; letter-spacing:-.7px; }
.project-hub > header span,.hub-intake-rule span { font-size:14px; }
.hub-head-actions { flex-wrap:wrap; gap:8px; }
.project-hub > header button { min-height:42px; height:auto; padding:8px 12px; font-size:13px; }
.hub-head-actions .hub-worker { font-size:12px !important; }
.hub-summary { margin:10px 0 12px; }
.hub-summary small,.hub-project-toolbar > div small { font-size:12px; color:#656d79; }
.hub-project-toolbar > div b { font-size:16px; }
.hub-project-toolbar input { font-size:14px; min-height:42px; }
.hub-project-grid { grid-template-columns:repeat(auto-fit,minmax(365px,1fr)); gap:16px; }
.hub-project-section { margin-top:22px; }
.hub-project-section > header { display:flex; justify-content:space-between; margin-bottom:12px; }
.hub-project-section h2 { margin:0; font-size:19px; }
.hub-project-section h2 > span { margin-left:7px; color:#656d79; font-size:14px; }
.hub-project-section header p { margin:5px 0 0; font-size:13px; color:#656d79; }
.hub-group-empty { grid-column:1/-1; margin:0; padding:20px; color:#687180; background:#f9fafb; border:1px dashed #d4d9e0; border-radius:9px; font-size:14px; }
.hub-project-card { position:relative; grid-template-columns:155px minmax(0,1fr); min-height:192px; }
.project-cow-stage { grid-row:1/3; min-height:192px; }
.project-cow-stage .cowvis-desk { top:30px; transform:translateX(-50%) scale(1); }
.project-cow-stage .cow-agent,.hub-cow-project:hover .project-cow-stage .cow-agent { top:80px; transform:translateX(-50%) scale(1.22); }
.project-cow-state { bottom:9px; font-size:12px; }
.project-cow-number { font-size:12px; }
.hub-project-open { padding:12px 14px 6px; }
.hub-project-code { font-size:12px; color:#68717d; }
.hub-project-card h2 { margin:4px 0; font-size:19px; }
.hub-project-card p,.hub-project-open > small { font-size:12px; color:#69717d; }
.hub-project-tags { flex-wrap:wrap; margin:8px 0 6px; }
.hub-project-tags span { padding:3px 5px; font-size:12px; }
.hub-progress { margin-top:7px; }
.project-cow-copy > footer { min-height:38px; margin:0 14px; gap:6px; }
.project-cow-copy > footer b,.project-cow-copy > footer small,.project-cow-copy > footer time { font-size:12px; color:#626a76; }
.project-cow-copy > footer button { padding:8px; font-size:12px; }
.project-record-actions { grid-column:2; display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:5px; padding:4px 10px 8px; }
.project-record-actions .btn { min-height:32px; padding:5px 8px; font-size:12px; }
.btn.danger-text { color:var(--danger-ink); background:#fff; }
.task-section-tabs { display:flex; gap:10px; margin:0 0 18px; }
.managed-task-row { grid-template-columns:44px minmax(0,1fr) 170px 146px; align-items:start; gap:16px; }
.task-description { min-width:0; }
.task-description h3 { font-size:17px; }
.task-description p,.task-description small { font-size:13px; line-height:1.6; overflow-wrap:anywhere; }
.task-row-actions { display:flex; flex-direction:column; gap:8px; }
.task-row-actions .btn { min-height:38px; font-size:13px; }
.task-progress { display:grid; gap:8px; min-width:0; }
.record-modal { width:min(600px,calc(100vw - 40px)); max-height:90vh; overflow:auto; }
.record-modal h2 { font-size:20px; line-height:1.5; }
.record-modal p { font-size:14px; line-height:1.7; color:var(--body-copy); }
.record-modal code { display:block; overflow-wrap:anywhere; font-size:13px; }
.record-modal footer { display:flex; justify-content:flex-end; gap:10px; margin-top:18px; }
.record-modal footer .btn,.record-modal .modal-close { min-height:44px; min-width:44px; }
.deletion-options { margin:20px 0; padding:0; border:0; }
.deletion-options legend { margin-bottom:10px; font-size:15px; font-weight:700; }
.deletion-options label { display:flex; align-items:flex-start; gap:10px; margin-bottom:10px; padding:14px; border:1px solid #d5dbe4; border-radius:9px; cursor:pointer; }
.deletion-options label:has(input:checked) { border-color:#565dde; background:#f6f6ff; }
.deletion-options input { margin-top:4px; width:18px; height:18px; flex:none; }
.deletion-options b { display:block; color:#303641; font-size:15px; line-height:1.5; }
.deletion-options small { display:block; margin-top:7px; font-size:13px; line-height:1.65; color:var(--body-copy); }
.record-modal .record-error { color:var(--danger-ink); }
.record-modal .record-error:empty { display:none; }
.btn.danger-action { color:#fff; background:#a82d3c; border-color:#a82d3c; }
.deletion-safety { padding:10px 12px; border-radius:8px; background:#f1f5f8; }
.btn:disabled { cursor:not-allowed; opacity:.5; }
.account-button:focus-visible,.project-record-actions button:focus-visible,.record-modal button:focus-visible { outline:3px solid #5966c9; outline-offset:2px; }
@media (min-width:1500px) { .hub-project-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:1250px) { .managed-task-row { grid-template-columns:36px minmax(0,1fr) 138px; } .managed-task-row .task-progress { grid-column:2; } .task-row-actions { grid-column:3; grid-row:1/3; } .topbar .team-switcher { display:none; } }
@media (max-width:900px) { .hub-project-grid { grid-template-columns:1fr; } .project-hub { padding:20px; } .hub-intake-rule { grid-template-columns:1fr; } .hub-summary { flex-wrap:wrap; row-gap:12px; } .record-modal { padding:20px; } }
@media (prefers-reduced-motion:reduce) { .project-cow-stage .cow-agent,.project-cow-stage .cowvis-monitor em { animation:none; transition:none; } }

/* One consistent brand above every sidebar, independent of the selected page. */
:root { --sidebar:190px; }
.sidebar { grid-column:1; grid-row:1 / -1; padding:14px 10px 12px; background:#fff; min-height:0; }
.topbar { grid-column:2 / -1; grid-row:1; }
.topbar > .brand { display:none; }
.cowvis-window-dots { display:flex; align-items:center; gap:7px; height:17px; padding-left:8px; flex-shrink:0; }
.cowvis-brand { display:flex; align-items:center; gap:9px; height:42px; padding:0 8px; color:#17191d; border:0; background:transparent; cursor:pointer; flex-shrink:0; }
.cowvis-brand:focus-visible { outline:3px solid #5966c9; outline-offset:-2px; border-radius:6px; }
.sidebar nav { overflow:auto; min-height:0; }
.project-hub > header { display:grid; grid-template-columns:auto auto minmax(0,1fr); align-items:center; gap:24px; }
.hub-title { min-width:0; }
.hub-head-actions { justify-self:end; justify-content:flex-end; }
.project-hub > header .hub-create-project { white-space:nowrap; }
.project-hub > header .account-button { color:#262b35; border:1px solid #dfe2e8; background:#fff; padding:5px 10px; }
.project-hub > header .account-button > span { display:grid; width:30px; height:30px; border-radius:50%; background:#272d39; color:#fff; font-size:14px; flex-shrink:0; }
.project-hub > header .account-button > b { font-size:14px; }
.real-plan-stage { text-align:left; color:inherit; font:inherit; cursor:pointer; }
.real-plan-stage:hover { border-color:#7379b8; box-shadow:0 2px 8px #1c265014; }
.real-plan-stage > em { grid-column:2; font-size:12px; font-style:normal; color:#454cba; }
.real-plan-stage:focus-visible,.reference-prompt-shortcut:focus-visible { outline:3px solid #5966c9; outline-offset:2px; }
.real-plan-reference > .reference-prompt-shortcut { display:grid; align-content:center; gap:5px; min-width:0; width:auto; padding:12px; color:inherit; font:inherit; text-align:left; background:transparent; border:0; cursor:pointer; }
.reference-prompt-shortcut b { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; }
.reference-prompt-shortcut span,.reference-prompt-shortcut small { color:#677386; font-size:12px; }
.reference-controls { padding:16px; margin:0 0 18px; background:#fff; border:1px solid #dfe3eb; border-radius:10px; }
.reference-control-actions { display:flex; gap:10px; flex-wrap:wrap; justify-content:space-between; margin-bottom:14px; }
.reference-control-actions > div { display:flex; gap:10px; flex-wrap:wrap; }
.reference-controls form { display:flex; align-items:end; gap:10px; }
.reference-controls label { display:grid; gap:6px; flex:1; min-width:0; font-size:14px; }
.reference-controls input { min-width:0; width:100%; height:44px; padding:10px 12px; border:1px solid #d6dce6; border-radius:7px; font:inherit; }
.reference-controls .btn { min-height:44px; }
.reference-controls p { margin:10px 0 0; color:#697487; font-size:13px; line-height:1.6; }
.reference-copy footer { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.reference-copy footer [data-delete-reference-asset] { grid-column:1 / -1; }
.reference-copy footer .btn { flex:1; min-height:40px; font-size:13px; padding:8px; }
.reference-copy .source-remove { margin-top:8px; min-height:36px; font-size:12px; }
@media (max-width:1200px) {
  .project-hub > header { grid-template-columns:minmax(0,1fr) auto; gap:16px; }
  .hub-head-actions { grid-column:1 / -1; }
}
@media (max-width:700px) {
  .project-hub > header { grid-template-columns:1fr; }
  .hub-create-project { justify-self:start; }
  .hub-head-actions { justify-self:stretch; }
  .reference-controls form { align-items:stretch; flex-direction:column; }
}
.credentials-form { display: grid; gap: 16px; }
.credentials-form label { display: grid; gap: 6px; }
.credentials-form input { min-height: 44px; padding: 10px; border: 1px solid #ccd0db; border-radius: 8px; font: inherit; width: 100%; }
.retry-mode-option { display: flex; align-items: flex-start; gap: 10px; line-height: 1.6; margin: 16px 0; }
.team-account-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
