/* Linglu AI — brand, type and workspace foundations. */
:root {
  --brand: #6750c9;
  --brand-hover: #5139b0;
  --indigo: #4130c5;
  --purple: #994de3;
  --bg: #f6f8fc;
  --paper: #ffffff;
  --ink: #202a3c;
  --muted: #626e82;
  --line: #e1e6ef;
  --line-strong: #cbd5e5;
  --pale: #f3f0ff;
  --green: var(--brand);
  --amber: #925d0b;
  --red: #b93641;
  --success: #147453;
  --focus: #b8cdfa;
  --sidebar-width: 200px;
  --banner-height: 36px;
  --radius: 10px;
  --space: 20px;
  color: var(--ink);
  font: 400 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); -webkit-font-smoothing: antialiased; }
body.live { --banner-height: 0px; }
button, input, select, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
:where(button, a, input, select, textarea, summary):focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4, strong { font-weight: 600; }
a { color: var(--brand); text-underline-offset: 3px; }
[hidden] { display: none !important; }
.muted, .note { color: var(--muted); }
.note { font-size: 14px; line-height: 1.7; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Shell and the supplied deer/growth brand mark. */
.mode-banner { height: var(--banner-height); position: sticky; top: 0; z-index: 70; display: flex; align-items: center; justify-content: center; gap: 16px; padding: 0 16px; background: #f1f4fb; border-bottom: 1px solid var(--line); color: #52637f; font-size: 14px; }
.mode-banner button { border: 0; border-radius: 4px; padding: 2px 6px; background: transparent; color: var(--brand); font-size: 14px; }
.mode-banner button:hover { background: #e5ecfb; }
.shell { display: flex; min-height: calc(100vh - var(--banner-height)); min-height: calc(100dvh - var(--banner-height)); }
.sidebar { position: fixed; inset: var(--banner-height) auto 0 0; width: var(--sidebar-width); display: flex; flex-direction: column; padding: 24px 12px 16px; background: #f8faff; border-right: 1px solid var(--line); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 9px; padding: 0 8px 24px; color: #223253; line-height: 1; white-space: nowrap; }
.brand-symbol { display: block; width: 38px; height: 40px; flex: 0 0 38px; object-fit: contain; }
.brand-wordmark { display: inline-flex; align-items: baseline; gap: 5px; color: var(--indigo); font-size: 24px; font-weight: 650; letter-spacing: .02em; }
.brand-wordmark small { display: inline; margin: 0; color: var(--purple); font-size: 14px; font-weight: 650; letter-spacing: .04em; }
.mark { display: grid; place-items: center; width: 36px; height: 40px; flex: 0 0 36px; border-radius: 10px; background: var(--brand); color: white; font: italic 32px Georgia, serif; }
.nav { display: grid; gap: 4px; }
.nav button { position: relative; display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 9px 12px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #526079; text-align: left; font-size: 14px; font-weight: 500; transition: color .15s, background .15s, border-color .15s; }
.nav button:hover { background: #edf2fb; color: #2f4771; }
.nav button.active { border-color: #dbe6fd; background: #eaf1ff; color: var(--brand); font-weight: 600; }
.nav button.active::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; background: var(--brand); border-radius: 0 3px 3px 0; }
.nav svg { width: 18px; height: 18px; flex: 0 0 18px; }
.sidebar-foot { margin-top: auto; padding: 24px 12px 0; color: var(--muted); font-size: 14px; }
.sidebar-foot strong { display: block; font-size: 14px; font-weight: 500; }
.sidebar-foot button { margin-top: 8px; }
.main { flex: 1; min-width: 0; margin-left: var(--sidebar-width); background: var(--paper); }
.topbar { position: sticky; top: var(--banner-height); z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 66px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--paper); }
.topbar select { max-width: 320px; min-height: 38px; padding: 6px 28px 6px 10px; border: 1px solid transparent; border-radius: 8px; background: var(--paper); color: var(--ink); font-size: 14px; font-weight: 500; }
.topbar select:hover { border-color: var(--line-strong); background: #fafcff; }
.topbar-account { display: none; }
.account-actions { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-right small { color: var(--muted); font-size: 14px; }
.content { max-width: 1720px; margin: auto; padding: 24px 24px 36px; }
.workspace-with-agent > .content { max-width:none; margin:0; }
.scope-control { display:flex; align-items:center; flex-wrap:wrap; gap:10px; min-width:0; }
.scope-control > label { color:var(--muted); font-size:14px; white-space:nowrap; }
.scope-control > select { max-width:300px; border-color:var(--line); background:#fafbfe; }
.scope-badge { border:1px solid #e3def5; border-radius:6px; padding:3px 8px; background:#f7f5ff; color:#5a42ac; font-size:14px; white-space:nowrap; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-head h1 { font-size: 24px; font-weight: 650; line-height: 1.35; letter-spacing: -.02em; }
.page-head p, .drawer-head p { margin-top: 6px; font-size: 14px; color: var(--muted); }
.page-head p:empty, .drawer-head p:empty { display: none; }
.eyebrow { margin-bottom: 8px; color: var(--muted); font-size: 14px; }

/* Interactive controls: one visual language in pages, tables and drawers. */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--paper); color: #35455f; font-size: 14px; font-weight: 500; line-height: 1.5; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
.button:hover:not(:disabled) { border-color: #b7c7e2; background: #f5f8ff; color: var(--brand); }
.button:active:not(:disabled) { background: #eaf1ff; }
.button.primary { border-color: var(--indigo); background: linear-gradient(115deg, var(--brand), var(--indigo)); color: white; box-shadow: 0 1px 2px #1b3e7914; }
.button.primary:hover:not(:disabled) { border-color: var(--brand-hover); background: var(--brand-hover); color: white; }
.button.primary:active:not(:disabled) { border-color: #0d3d9f; background: #0d3d9f; }
.button.soft { border-color: #dce2fd; background: #f0f1ff; color: var(--indigo); }
.button.soft:hover:not(:disabled) { border-color: #c5ccf5; background: #e8ebff; color: #3324a5; }
.button.danger { border-color: #f1cdd2; background: #fff6f7; color: var(--red); }
.button.danger:hover:not(:disabled) { border-color: #e7aeb6; background: #ffedef; color: #9e2630; }
.button.small { min-height: 34px; padding: 6px 10px; font-size: 14px; }
.button.link { justify-content: flex-start; min-height: 32px; padding: 4px 0; border-color: transparent; background: transparent; color: var(--brand); box-shadow: none; }
.button.link:hover:not(:disabled) { border-color: transparent; background: transparent; color: var(--brand-hover); text-decoration: underline; text-underline-offset: 3px; }
.button:disabled, .button[aria-disabled="true"] { border-color: #e0e5ee; background: #f1f3f8; color: #8a95a6; opacity: 1; box-shadow: none; cursor: not-allowed; }
.button.primary:disabled { background: #e9eef8; border-color: #dde5f3; color: #8392ae; }
.button.link:disabled { background: transparent; border-color: transparent; color: #8a95a6; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.segmented { display: inline-flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #f3f5fa; }
.segmented button { min-height: 32px; padding: 5px 12px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); font-size: 14px; white-space: nowrap; }
.segmented button:hover { background: #e9eef9; color: var(--brand); }
.segmented button.active { border-color: #dce4f2; background: white; color: var(--brand); font-weight: 600; box-shadow: 0 1px 3px #1836620a; }
.tabs { display: flex; gap: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.tabs button { min-height: 44px; padding: 9px 2px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 15px; font-weight: 500; white-space: nowrap; }
.tabs button:hover { color: var(--brand); }
.tabs button.active { border-bottom-color: var(--brand); color: var(--brand); font-weight: 600; }
.tabs button:focus-visible { outline-offset: -4px; }
.tabs .button { border-radius: 0; }

/* Overview and reusable surfaces. */
.work-summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; padding: 20px 24px; border: 1px solid #dce6fa; border-radius: 12px; background: #f6f9ff; }
.work-summary h2 { color: #263f6e; font-size: 18px; font-weight: 600; }
.work-summary p { margin-top: 6px; color: var(--muted); font-size: 14px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.metric { min-width: 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); text-align: left; }
button.metric { transition: border-color .15s, background .15s; }
button.metric:hover { border-color: #bacdf3; background: #fcfdff; }
.metric span { color: var(--muted); font-size: 14px; }
.metric strong { display: block; margin-top: 6px; color: #26344c; font-size: 28px; font-weight: 600; line-height: 1.3; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.metric small { display: block; margin-top: 8px; color: var(--muted); font-size: 14px; }
.grid { display: grid; gap: 20px; margin-bottom: 24px; }
.grid.two { grid-template-columns: 1.25fr 1fr; }
.grid.equal { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel { min-width: 0; overflow: hidden; margin-bottom: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.grid > .panel { margin-bottom: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px; }
.panel-head h2 { color: #26344c; font-size: 17px; font-weight: 600; }
.panel-head p { margin-top: 4px; color: var(--muted); font-size: 14px; }
.panel-body { padding: 0 20px 20px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid #edf0f5; }
.row:last-child { border-bottom: 0; }
.row > div:first-child { min-width: 0; }
.row strong { color: #2b3a52; font-size: 15px; font-weight: 500; }
.row p { margin-top: 4px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.row .actions { flex-shrink: 0; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border: 1px solid #e5e9f1; border-radius: 6px; background: #f3f5f9; color: #5a677d; font-size: 14px; font-weight: 500; line-height: 1.5; white-space: nowrap; }
.tag.good { border-color: #cde9dc; background: #edf8f2; color: var(--success); }
.tag.warn { border-color: #f1deaf; background: #fff7e7; color: var(--amber); }
.tag.bad { border-color: #f0cdd1; background: #fff0f2; color: var(--red); }
.tag.blue { border-color: #d7e5fc; background: #edf4ff; color: #245bb8; }
.pill-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.empty { padding: 36px 24px; color: var(--muted); text-align: center; font-size: 14px; }
.empty strong { display: block; margin-bottom: 6px; color: #53617a; font-size: 16px; font-weight: 500; }
.expert-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.expert-card { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-content: start; column-gap: 12px; min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); text-align: left; transition: border-color .15s, background .15s; }
.expert-card:hover { border-color: #bdcef0; background: #fbfcff; }
.expert-card strong { display: block; margin-bottom: 4px; color: #293753; font-size: 16px; font-weight: 600; }
.expert-card p { min-height: 0; margin-bottom: 10px; color: var(--muted); font-size: 14px; }
.expert-card small, .expert-card .tag { grid-column: 2; justify-self: start; }
.expert-card small { display: block; margin-top: 8px; color: var(--muted); font-size: 14px; }
.expert-card:not(:has(.orb)) { display: block; }
.orb { display: grid; grid-row: 1 / 4; place-items: center; width: 36px; height: 36px; border: 1px solid #e1e2fb; border-radius: 10px; background: #f2f1fd; color: var(--indigo); font-size: 20px; }

/* Data tables, grouped orders and the matching filter/batch bars. */
.table-scroll { width: 100%; overflow: auto; scrollbar-width: thin; scrollbar-color: #bdc9dd transparent; }
.table { width: 100%; border-collapse: collapse; text-align: left; font-size: 16px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.table th { padding: 12px 20px; border-top: 1px solid #edf0f5; border-bottom: 1px solid var(--line); background: #f8faff; color: #52617a; font-size: 14px; font-weight: 600; white-space: nowrap; }
.table td { padding: 16px 20px; border-bottom: 1px solid #e9edf4; color: #34435c; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background-color: #fbfcff; }
.table td strong { color: #26354e; font-size: 16px; font-weight: 500; }
.table small { display: block; margin-top: 5px; color: var(--muted); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.table td:last-child { white-space: nowrap; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 20px 20px; }
.ow-filters { padding-top: 0; }
.ow-filters .ow-filter-grid { gap: 16px; padding-inline: 20px !important; margin-bottom: 16px; }
.ow-filters .field input, .ow-filters .field select { min-height: 42px; }
.ow-filters details { margin: 0 20px 16px; }
.ow-filters details summary { font-size: 14px; }
.ow-status-tabs { gap: 20px; margin: 0 20px 16px; }
.ow-status-tabs button { font-size: 14px; }
.ow-status-tabs button span { margin-left: 5px; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.ow-status-tabs button.active span { color: var(--brand); }
.ow-batchbar { gap: 12px; margin: 0; padding: 14px 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f8faff; }
.ow-batchbar > strong { font-size: 14px; font-weight: 600; }
.ow-batchbar > .note { display: inline-flex; align-items: center; gap: 8px; }
.ow-business-table .table { min-width: 1120px; }
.ow-business-table .table th { padding: 12px 16px; border-top: 0; }
.ow-business-table .table td { padding: 20px 16px; vertical-align: top; }
.ow-business-table .table td:last-child { min-width: 220px; white-space: normal; }
.ow-business-table .table thead th:last-child { position: sticky; right: 0; z-index: 3; background: #f8faff; box-shadow: -1px 0 0 var(--line); }
.ow-business-table .table tbody tr:not(.ow-order-head) > td:last-child { position: sticky; right: 0; z-index: 1; background: var(--paper); box-shadow: -1px 0 0 var(--line); }
.ow-business-table .table tbody tr:not(.ow-order-head):hover > td:last-child { background: #fbfcff; }
.ow-business-table .ow-order-head td { padding: 12px 16px !important; border-top: 1px solid #dce4f1; border-bottom: 1px solid #e6edf8; background: #f7faff !important; }
.ow-order-head strong { font-size: 14px; font-weight: 600; }
.ow-order-head .actions { gap: 12px; }
.ow-order-head span { font-size: 14px; }
.ow-product strong { font-size: 16px !important; font-weight: 600 !important; line-height: 1.5; }
.ow-lines small { margin-top: 7px; line-height: 1.6; }
.ow-ai > small { color: var(--indigo); }
.ow-ai strong { display: block; margin: 7px 0; color: #343d64; font-size: 16px; font-weight: 600; }
.ow-ai .note { font-size: 14px !important; }
.ow-ai .actions { gap: 8px; }
.ow-ai .actions .button { padding: 6px 10px; }
.ow-task-row { padding-top: 10px; border-top: 1px solid #e7ecf5; }
.ow-deadline { display: block; margin-top: 12px; color: var(--amber); font-weight: 600; }
.ow-money-positive { color: var(--success) !important; }
.ow-money-negative { color: var(--red) !important; }

/* Forms, evidence and confirmation states. */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; color: #52617a; font-size: 14px; font-weight: 500; }
.field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--paper); color: var(--ink); font-size: 16px; font-weight: 400; line-height: 1.5; transition: border-color .15s, box-shadow .15s; }
.field input::placeholder, .field textarea::placeholder { color: #8a95a6; }
.field input:hover:not(:disabled), .field select:hover:not(:disabled), .field textarea:hover:not(:disabled) { border-color: #aebed7; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); }
.field input:disabled, .field select:disabled, .field textarea:disabled { background: #f2f4f8; color: #7e899c; }
.field textarea { min-height: 112px; resize: vertical; }
.field small { color: var(--muted); font-size: 14px; font-weight: 400; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; margin: 0 5px 0 0; accent-color: var(--brand); vertical-align: middle; cursor: pointer; }
input[type="file"]::file-selector-button { margin-right: 12px; padding: 5px 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: #f5f8ff; color: #40547c; font: inherit; font-size: 14px; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; margin: 16px 0 20px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid .field .readonly { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #f5f7fb; color: var(--muted); }
.rule-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0 24px; }
.rule-check { display: flex; align-items: center; gap: 10px; color: #465771; font-size: 14px; line-height: 1.6; }
.rule-check input { flex-shrink: 0; }
.notice { margin: 16px 0; padding: 12px 16px; border: 1px solid #dce6f9; border-radius: 8px; background: #f6f9ff; color: #4b5e80; font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
.notice.warn { border-color: #efdaad; background: #fffaee; color: #885c13; }
.notice.bad { border-color: #f0ccd1; background: #fff3f4; color: var(--red); }
.approval { margin-bottom: 24px; padding: 20px; border: 1px solid #ecd29b; border-radius: 12px; background: #fffcf5; font-size: 16px; }
.approval h3 { color: #835710; }
.approval .details dd { color: var(--ink); }
.approval label.note { display: flex; align-items: flex-start; gap: 8px; }
.approval label.note input { flex-shrink: 0; margin-top: 4px; }
details { min-width: 0; }
details summary { min-height: 40px; margin: 8px 0; padding: 8px 0; color: #4f6080; font-size: 14px; font-weight: 500; cursor: pointer; }
details summary:hover { color: var(--brand); }
details summary::marker { color: #7991b8; }
details[open] > summary { color: var(--brand); }
pre { max-height: 340px; overflow: auto; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: #f6f8fc; color: #53637e; font: 14px/1.75 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.details { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px 16px; margin: 16px 0; font-size: 14px; line-height: 1.8; }
.details dt { color: var(--muted); }
.details dd { margin: 0; color: #30415e; overflow-wrap: anywhere; }
.checklist { margin: 0; padding: 0; list-style: none; }
.checklist li { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; color: #52617b; font-size: 14px; }
.checklist li::before { content: "✓"; flex: 0 0 12px; color: var(--success); }
.checklist li.missing::before { content: "○"; color: var(--amber); }

/* Task/AI drawers keep records legible and actions within reach. */
.overlay { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: flex-end; background: #15244052; }
.drawer { display: flex; flex-direction: column; width: min(800px, 100%); height: 100%; overflow: auto; overscroll-behavior: contain; background: var(--paper); box-shadow: -12px 0 44px #102a4f1c; animation: slide .18s ease-out; }
.drawer-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 28px; border-bottom: 1px solid var(--line); background: var(--paper); }
.drawer-head h2 { color: #26344e; font-size: 22px; font-weight: 600; line-height: 1.5; }
.close { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: #f1f4f9; color: #64738c; font-size: 22px; line-height: 1; }
.close:hover { border-color: var(--line-strong); background: #e9eff9; color: var(--brand); }
.drawer-body { padding: 24px 28px; }
.drawer-foot { position: sticky; bottom: 0; z-index: 4; margin-top: auto; padding: 16px 28px; border-top: 1px solid var(--line); background: var(--paper); }
.drawer h3 { margin-bottom: 12px; color: #30405d; font-size: 16px; font-weight: 600; }
.drawer .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.drawer .metric { padding: 14px 16px; }
.drawer .metric strong { font-size: 24px; }
.drawer details { margin-bottom: 16px; }
.drawer .rule-checks { margin-bottom: 24px; }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; margin-left: 6px; padding: 0 0 24px 24px; border-left: 1px solid #d9e3f3; }
.timeline li:last-child { border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; top: 8px; left: -4px; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.timeline strong { display: block; color: #344765; font-size: 16px; font-weight: 500; }
.timeline p { margin-top: 4px; color: var(--muted); font-size: 14px; }
.timeline small { color: var(--muted); font-size: 14px; }
.chat { display: grid; gap: 14px; margin: 16px 0 20px; }
.bubble { padding: 16px; border: 1px solid #e0e7f8; border-radius: 10px; background: #f5f8ff; color: #334969; font-size: 16px; line-height: 1.8; white-space: pre-line; overflow-wrap: anywhere; }
.bubble.user { margin-left: 36px; border-color: #e4dff5; background: #f8f5ff; color: #44336b; }
.bubble small { display: block; margin-bottom: 6px; color: #627492; font-size: 14px; }
.progress { height: 4px; overflow: hidden; margin: 12px 0; border-radius: 3px; background: #e9eef8; }
.progress i { display: block; height: 100%; background: var(--brand); }

/* Secondary and legacy surfaces share the same restrained palette. */
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.product-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.product-card h3 { margin-bottom: 6px; font-size: 16px; font-weight: 600; }
.product-card p { margin-bottom: 12px; color: var(--muted); font-size: 14px; }
.product-card .actions { margin-top: 16px; }
.object-cover { display: grid; place-items: center; height: 104px; margin-bottom: 16px; border: 1px solid #e5eaf4; border-radius: 8px; background: #f4f7fc; color: #a3b2cf; font-size: 36px; }
.comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.comparison > div { padding: 16px; border: 1px solid var(--line); border-radius: 8px; color: #384c6c; font-size: 16px; }
.comparison small { display: block; margin-bottom: 8px; color: var(--muted); font-size: 14px; }
.hero { display: grid; grid-template-columns: 1.5fr 1fr; gap: 28px; margin-bottom: 24px; padding: 28px; border: 1px solid #dde6f6; border-radius: 12px; background: #f7faff; }
.hero h2 { max-width: 540px; margin-bottom: 14px; color: #2d4166; font-size: 28px; font-weight: 600; line-height: 1.5; }
.hero p { max-width: 550px; color: var(--muted); font-size: 14px; line-height: 1.8; }
.hero .actions { margin-top: 20px; }
.hero-aside { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding-left: 24px; border-left: 1px solid #dce5f4; }
.hero-aside strong { font-size: 16px; font-weight: 500; }
.hero-aside span { color: var(--muted); font-size: 14px; }
.hero-aside .signal { display: flex; align-items: flex-start; gap: 10px; }
.signal i { flex: 0 0 6px; width: 6px; height: 6px; margin-top: 9px; border-radius: 50%; background: var(--brand); }
.flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; color: var(--muted); font-size: 14px; }
.flow span { padding: 7px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.flow .done { border-color: #cfdefa; background: #eff5ff; color: var(--brand); }
.login { max-width: 420px; margin: 14vh auto; padding: 36px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: 0 12px 40px #18315a08; }
.login .brand { padding: 0 0 28px; }
.login h1 { margin-bottom: 16px; font-size: 22px; }
.login p { margin-bottom: 24px; color: var(--muted); font-size: 14px; }
.login .button { width: 100%; margin-top: 20px; }
.auth-tabs { display: flex; gap: 18px; margin: 2px 0 22px; border-bottom: 1px solid var(--line); }
.auth-tabs button { border: 0; border-bottom: 2px solid transparent; background: none; padding: 10px 2px; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.auth-tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }
.auth-tabs button:disabled { opacity: .45; cursor: not-allowed; }
.auth-code { display: flex; gap: 8px; align-items: center; }
.auth-code input { min-width: 0; flex: 1; }
.login .auth-code .button { width: auto; flex: 0 0 112px; margin: 0; white-space: nowrap; }
.login .auth-hint { font-size: 12px; margin: 12px 0 0; }
.toast { position: fixed; bottom: 28px; left: 50%; z-index: 150; transform: translateX(-50%); max-width: min(560px, 90vw); padding: 12px 20px; border: 1px solid #3b4d72; border-radius: 10px; background: #253657; color: white; box-shadow: 0 8px 28px #152a4b26; font-size: 14px; }
.screen-error { max-width: 700px; margin: auto; padding: 36px; }
.value-list { padding-left: 20px; color: #52617b; font-size: 14px; line-height: 1.9; }
.section-space { margin-top: 24px; }
footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 24px; padding: 20px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
@keyframes slide { from { transform: translateX(16px); opacity: .8; } to { transform: translateX(0); opacity: 1; } }

/* Narrow workspaces retain every control; tables scroll instead of compressing facts. */
@media (max-width: 1200px) {
  .content { padding-inline: 24px; }
  .topbar { padding-inline: 24px; }
  .grid.two { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .expert-grid { gap: 12px; }
  .expert-card { padding: 16px; column-gap: 10px; }
}
@media (max-width: 900px) {
  :root { --sidebar-width: 76px; }
  .sidebar { padding: 24px 10px 16px; }
  .sidebar .brand { justify-content: center; padding: 0 0 28px; }
  .sidebar .brand-symbol { width: 36px; height: 40px; flex-basis: 36px; }
  .sidebar .brand-wordmark, .sidebar .brand > span:last-child:not(.brand-symbol):not(.mark), .nav button > span, .sidebar-foot { display: none; }
  .nav button { justify-content: center; padding: 12px 8px; }
  .nav button.active::before { top: 13px; bottom: 13px; }
  .live .topbar-account { display: inline-flex; flex: 0 0 auto; }
  .topbar-right small { display: none; }
  .topbar { padding-inline: 20px; }
  .content { padding: 24px 20px 32px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.equal, .grid.three { grid-template-columns: 1fr; }
  .expert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-summary { align-items: flex-start; flex-direction: column; }
  .rule-checks { grid-template-columns: 1fr; }
  .ow-filters .ow-filter-grid { grid-template-columns: 1fr 1fr !important; }
  .hero { grid-template-columns: 1fr; padding: 24px; }
  .hero-aside { padding: 20px 0 0; border-top: 1px solid #dce5f4; border-left: 0; }
  .details { grid-template-columns: 100px minmax(0, 1fr); }
}
@media (max-width: 600px) {
  :root { --sidebar-width: 64px; }
  .sidebar { padding-inline: 7px; }
  .sidebar .brand-symbol { width: 32px; height: 36px; flex-basis: 32px; }
  .mode-banner { gap: 10px; padding-inline: 8px; }
  .mode-banner, .mode-banner button { font-size: 14px; }
  .content { padding: 20px 14px 28px; }
  .topbar { height: auto; min-height: 72px; flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
  .topbar select { max-width: 220px; font-size: 14px; }
  .scope-control { gap:6px; }
  .scope-control > label { font-size:14px; }
  .scope-badge { display:none; }
  .topbar-right { gap: 8px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 16px; }
  .page-head h1 { font-size: 25px; }
  .page-head > .actions { width: 100%; }
  .metrics { gap: 10px; }
  .metric { padding: 14px; }
  .metric strong { font-size: 28px; }
  .expert-grid, .product-grid { grid-template-columns: 1fr; }
  .work-summary, .panel-head { padding: 16px; }
  .panel-body { padding: 0 16px 16px; }
  .row { align-items: flex-start; flex-wrap: wrap; padding: 16px; }
  .row .actions { flex-wrap: wrap; }
  .drawer-head, .drawer-body { padding: 20px; }
  .drawer-foot { padding: 16px 20px; }
  .drawer .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drawer-head h2 { font-size: 20px; }
  .form-grid, .comparison { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .ow-filters .ow-filter-grid { grid-template-columns: 1fr !important; padding-inline: 16px !important; }
  .ow-status-tabs { margin-inline: 16px; gap: 18px; }
  .toolbar, .ow-batchbar { padding-inline: 16px; }
  .table th, .table td { padding-inline: 16px; }
  .ow-business-table .table thead th:last-child, .ow-business-table .table tbody tr:not(.ow-order-head) > td:last-child { position: static; box-shadow: none; }
  .details { grid-template-columns: 88px minmax(0, 1fr); gap: 10px 12px; }
  .bubble.user { margin-left: 20px; }
  .segmented { max-width: 100%; flex-wrap: wrap; }
  .segmented button { padding-inline: 10px; }
  .login { margin: 8vh 16px; padding: 28px; }
  .hero h2 { font-size: 24px; }
  footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

/* Growth-first navigation and the two customer starting points. */
.nav-section { padding:16px 12px 7px; color:var(--muted); font-size:12px; font-weight:500; letter-spacing:.04em; }
.nav-section:first-child { padding-top:0; }
.growth-entry-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; margin-bottom:24px; }
.growth-entry { display:flex; align-items:flex-start; gap:14px; border:1px solid #e1dff1; border-radius:12px; padding:24px; text-align:left; background:#fcfbff; min-width:0; }
.growth-entry:hover { border-color:#9f92dc; background:#f7f4ff; }
.growth-entry.featured { background:linear-gradient(115deg,#f2f4ff,#f6f0ff); border-color:#d9d0f2; }
.growth-entry-symbol { display:grid; place-items:center; width:42px; height:42px; border-radius:12px; color:var(--brand); background:#fff; box-shadow:0 1px 8px #4330c50a; font-size:28px; flex-shrink:0; }
.growth-entry small { display:block; color:var(--muted); font-size:14px; margin-bottom:8px; }
.growth-entry h2 { font-size:21px; line-height:1.5; }
.growth-entry h2 span { color:var(--brand); margin-left:5px; }
.growth-entry p { margin-top:9px; font-size:14px; color:var(--muted); }
.home-empty-plan { padding:28px 20px; display:flex; align-items:center; gap:18px; }
.home-empty-plan > div { flex:1; }
.home-empty-plan h3 { font-size:16px; }
.home-empty-plan p { font-size:14px; margin-top:4px; color:var(--muted); }
.home-quick-links { padding:0 20px 20px; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.home-quick-links .button { white-space:normal; text-align:left; justify-content:flex-start; }
.workspace-with-agent > .content { width:100%; }
@media (min-width:1251px) and (max-width:1550px) { .growth-entry-grid { grid-template-columns:1fr; } .growth-entry { padding:20px; } }
@media (max-width:900px) { .nav-section { font-size:0; padding:10px 0 3px; border-top:1px solid var(--line); margin-top:10px; } .nav-section:first-child { display:none; } }
@media (max-width:680px) { .growth-entry-grid { grid-template-columns:1fr; } .home-empty-plan { flex-wrap:wrap; } .home-quick-links { grid-template-columns:1fr; } }
.growth-mission { display:flex; align-items:center; justify-content:space-between; gap:24px; padding:26px; margin-bottom:24px; border:1px solid #ded7f1; border-radius:12px; background:linear-gradient(110deg,#f7f5ff,#f3f6ff); }
.growth-mission-label { display:block; color:var(--brand); font-size:14px; font-weight:500; margin-bottom:8px; }
.growth-mission h2 { font-size:26px; }
.growth-mission p { color:var(--muted); font-size:14px; margin-top:8px; }
.growth-mission .actions { margin-top:20px; }
.growth-mission-flow { display:flex; flex-direction:column; gap:8px; padding:10px 0 10px 24px; border-left:1px solid #ded7f1; color:var(--muted); font-size:14px; min-width:210px; }
.growth-mission-flow strong { font-size:18px; color:#4c3b88; }
@media (max-width:1500px) { .growth-mission-flow { display:none; } }
@media (max-width:680px) { .growth-mission { padding:20px; } .growth-mission h2 { font-size:23px; } }
