:root,
html[data-theme="dark"] {
  --bg: #111210;
  --text: #f2f1eb;
  --muted: #9c9d96;
  --line: #30312d;
  --line-soft: #252621;
  --card: #171815;
  --surface: #1b1c19;
  --btn-dark: #f2f1eb;
  --btn-dark-hover: #ffffff;
  --console-accent: #647945;
  --console-accent-soft: #22281b;
  --sidebar-bg: #0d0e0c;
  --sidebar-hover: #181916;
  --sidebar-active: #292a27;
  --popover-bg: #171815;
}

/* AI Chat brand mark: the route moves History into this row ahead of the
   logo, leaving the requested history → mark → Idrok reading order. */
.idrok-brain-logo { display: none; }
body.ai-chat-route .idrok-brain-logo {
  display: block !important;
  flex: 0 0 40px;
  align-self: center;
  width: 40px;
  height: 44px;
  margin: 0 10px 0 8px;
  color: #fff;
  background: currentColor;
  -webkit-mask: url("./idrok-cubic-mark.png") center / 100% 100% no-repeat;
  mask: url("./idrok-cubic-mark.png") center / 100% 100% no-repeat;
}
html[data-theme="light"] body.ai-chat-route .idrok-brain-logo { color: #000; }

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f1;
  --text: #171815;
  --muted: #686b62;
  --line: #d2d4ca;
  --line-soft: #e2e4dc;
  --card: #fcfcf8;
  --surface: #f7f8f3;
  --btn-dark: #171815;
  --btn-dark-hover: #252621;
  --console-accent: #647945;
  --console-accent-soft: #e7ecdc;
  --sidebar-bg: #eff0ea;
  --sidebar-hover: #e5e7df;
  --sidebar-active: #dce1d2;
  --popover-bg: #fbfbf8;
}

/* Dedicated AI Chat workspace: no permanent assistant rail consumes the
   application canvas. Existing authenticated Idrok DOM is relocated into
   this route so conversation state, streaming, model and mode controls stay
   exactly the same. */
@media (min-width: 681px) {
  .app-page { --ai-sidebar-track: 0px !important; grid-template-columns: var(--app-sidebar-track) minmax(0, 1fr) !important; }
  .copilot-launcher, .copilot-scrim { display: none !important; }
  body.ai-chat-route .app-main { padding: 0 !important; overflow: hidden; }
  .ai-chat-page { height: 100%; min-height: 0; }
  .ai-chat-mount { height: 100%; min-height: 0; }
  body.ai-chat-route .copilot-drawer { position: static !important; display: grid !important; grid-template-columns: minmax(238px, 290px) minmax(0, 1fr); width: 100% !important; height: 100% !important; min-height: 0; transform: none !important; visibility: visible !important; border: 0 !important; background: var(--bg) !important; box-shadow: none !important; }
  body.ai-chat-route .copilot-panel-content { grid-column: 2; grid-row: 1; position: static !important; display: flex !important; min-width: 0; padding: 28px clamp(24px, 4vw, 64px) 22px !important; background: var(--bg) !important; }
  body.ai-chat-route .copilot-history-drawer { grid-column: 1; grid-row: 1; position: static !important; display: flex !important; width: auto !important; min-width: 0; height: auto !important; transform: none !important; visibility: visible !important; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: var(--surface) !important; box-shadow: none !important; }
  body.ai-chat-route .copilot-control-rail, body.ai-chat-route .copilot-resize-handle, body.ai-chat-route .copilot-header-close { display: none !important; }
  body.ai-chat-route .copilot-messages { max-width: 900px; width: 100%; margin: 0 auto; }
  body.ai-chat-route .copilot-composer, body.ai-chat-route .copilot-header { width: min(900px, 100%); margin-inline: auto; }
}

/* Idrok hiring proposals are a bounded review surface, not an assistant
   message or an implied action. The card intentionally carries no glow,
   elevated modal frame, or autonomous affordance. */
.copilot-hiring-review {
  align-self: flex-start;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 18px;
  width: min(100%, 470px);
  margin: 4px 0 8px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--line) 92%, var(--text) 8%);
  border-radius: 11px;
  background: color-mix(in srgb, var(--surface) 94%, var(--card));
  color: var(--text);
}
.copilot-hiring-review-copy { min-width: 0; }
.copilot-hiring-review-eyebrow { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; }
.copilot-hiring-review h3 { margin: 0; overflow-wrap: anywhere; color: var(--text); font-size: 14px; font-weight: 650; line-height: 1.25; }
.copilot-hiring-review-copy p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.35; text-transform: capitalize; }
.copilot-hiring-review-details { display: grid; grid-template-columns: repeat(2, max-content); gap: 8px 13px; margin: 0; }
.copilot-hiring-review-details > div { display: grid; gap: 2px; }
.copilot-hiring-review-details dt { color: var(--muted); font-size: 10px; line-height: 1.1; }
.copilot-hiring-review-details dd { margin: 0; color: var(--text); font-size: 11px; font-weight: 620; line-height: 1.2; white-space: nowrap; }
.copilot-hiring-review-instructions { grid-column: 1 / -1; margin: 0; padding-top: 9px; border-top: 1px solid color-mix(in srgb, var(--line) 80%, transparent); color: var(--text); font-size: 12px; line-height: 1.48; overflow-wrap: anywhere; }
.copilot-hiring-review-status { grid-column: 1 / -1; margin: -2px 0 0; color: var(--muted); font-size: 11px; line-height: 1.35; }
.copilot-hiring-review[data-state="uncertain"] .copilot-hiring-review-status,
.copilot-hiring-review[data-state="blocked"] .copilot-hiring-review-status { color: #b46f5d; }
.copilot-hiring-review[data-state="confirmed"] .copilot-hiring-review-status { color: var(--semantic-success, #6c8b5e); }
.copilot-hiring-review-actions { display: flex; grid-column: 1 / -1; justify-content: flex-end; gap: 7px; }
.copilot-hiring-review-actions button { min-height: 31px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: transparent; font: 650 11px/1 var(--font-sans, Inter, sans-serif); cursor: pointer; }
.copilot-hiring-review-actions button[data-copilot-hiring-confirm] { border-color: color-mix(in srgb, var(--console-accent) 58%, var(--line)); background: var(--console-accent); color: #10130d; }
.copilot-hiring-review-actions button:hover:not(:disabled) { border-color: color-mix(in srgb, var(--text) 28%, var(--line)); background: color-mix(in srgb, var(--text) 5%, transparent); }
.copilot-hiring-review-actions button[data-copilot-hiring-confirm]:hover:not(:disabled) { background: color-mix(in srgb, var(--console-accent) 88%, #000); }
.copilot-hiring-review-actions button:disabled { cursor: wait; opacity: .62; }
.copilot-hiring-review-actions button:focus-visible { outline: 2px solid color-mix(in srgb, var(--console-accent) 70%, #fff); outline-offset: 2px; }
.copilot-hiring-review-truncation { align-self: flex-start; width: min(100%, 470px); margin: -1px 0 8px; color: var(--muted); font-size: 10px; line-height: 1.4; }
html[data-theme="light"] .copilot-hiring-review-actions button[data-copilot-hiring-confirm] { color: #fff; background: #53663e; }
@media (max-width: 520px) {
  .copilot-hiring-review { grid-template-columns: 1fr; width: 100%; gap: 10px; padding: 12px; }
  .copilot-hiring-review-details { grid-row: 2; }
  .copilot-hiring-review-actions { justify-content: stretch; }
  .copilot-hiring-review-actions button { flex: 1 1 0; }
}
@media (prefers-reduced-motion: reduce) { .copilot-hiring-review { animation: none; } }

/* Idrok execution timeline. It shows only observed client state and
   server-measured results: a running row while the request is open, then a
   compact heading with the backend's latency and one row per authoritative
   action event. It is not a decorative tool timeline or a reasoning trace.
   The panel is a normal flow item, never absolutely positioned or clamped to a
   fixed height, so it grows with its content and pushes the transcript down
   rather than overlapping the messages around it. */
.copilot-message.assistant.copilot-execution-panel { display: block; flex: none; align-self: flex-start; box-sizing: border-box; width: min(100%, 470px); max-width: 100%; margin: 4px 0 6px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--line) 88%, var(--text) 12%); border-radius: 10px; background: color-mix(in srgb, var(--surface) 96%, var(--card)); box-shadow: none; color: var(--text); font-size: 12px; line-height: 1.4; }
.copilot-execution-heading { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; line-height: 1.3; }
.copilot-execution-identity { display: inline-flex; align-items: center; gap: 5px; min-width: 0; color: var(--text); font-size: 12px; font-weight: 680; letter-spacing: -.01em; }
.copilot-execution-idrok-mark { display: block; flex: none; width: 14px; height: 14px; background: currentColor; -webkit-mask: url("./idrok-cubic-mark.png") center / contain no-repeat; mask: url("./idrok-cubic-mark.png") center / contain no-repeat; }
.copilot-execution-title { min-width: 0; color: var(--muted); font-weight: 540; }
.copilot-execution-elapsed { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.copilot-execution-chevron { flex: none; width: 6px; height: 6px; margin-left: 2px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg) translate(-1px, -1px); transition: transform 160ms var(--motion-ease-standard, ease); }
.copilot-execution-details[open] > summary .copilot-execution-chevron { transform: rotate(225deg); }
.copilot-execution-details > summary { display: block; list-style: none; cursor: pointer; }
.copilot-execution-details > summary::-webkit-details-marker { display: none; }
.copilot-execution-details > summary:focus-visible { outline: 2px solid color-mix(in srgb, var(--console-accent) 70%, #fff); outline-offset: 3px; border-radius: 4px; }
.copilot-message.assistant.copilot-execution-panel .copilot-execution-steps { display: grid; gap: 6px; margin: 9px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 11px; line-height: 1.35; }
.copilot-message.assistant.copilot-execution-panel .copilot-execution-steps li { position: relative; display: flex; align-items: baseline; gap: 10px; min-width: 0; margin: 0; padding-left: 13px; }
.copilot-message.assistant.copilot-execution-panel .copilot-execution-steps li::before { content: ""; position: absolute; top: .42em; left: 0; width: 5px; height: 5px; border: 1px solid currentColor; border-radius: 50%; }
.copilot-execution-steps .is-complete { color: var(--text); }
.copilot-execution-steps .is-complete::before { border-color: var(--console-accent); background: var(--console-accent); }
.copilot-execution-steps .is-failed { color: #b46f5d; }
.copilot-execution-steps .is-failed::before { border-color: #b46f5d; background: #b46f5d; }
.copilot-execution-step-label { min-width: 0; overflow-wrap: anywhere; }
.copilot-execution-duration { margin-left: auto; padding-left: 8px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.copilot-execution-panel:not([data-execution-state="running"]) .copilot-activity-mark { animation: none; opacity: .85; }
.copilot-execution-panel[data-execution-state="failed"] .copilot-activity-mark, .copilot-execution-panel[data-execution-state="cancelled"] .copilot-activity-mark { background: #b46f5d; }
.copilot-action-review { align-self: flex-start; box-sizing: border-box; width: min(100%, 470px); max-width: 100%; margin: 4px 0 8px; padding: 14px; border: 1px solid color-mix(in srgb, var(--line) 90%, var(--text) 10%); border-radius: 11px; background: color-mix(in srgb, var(--surface) 96%, var(--card)); color: var(--text); }
.copilot-action-review-head { display: flex; align-items: center; gap: 9px; min-width: 0; }
.copilot-action-review-icon { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 7px; background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
.copilot-action-review-icon svg { display: block; width: 14px; height: 14px; }
.copilot-action-review h3 { min-width: 0; margin: 0; color: var(--text); font-size: 14px; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.copilot-action-review-objective { margin: 10px 0 0; padding: 9px 11px; border: 1px solid color-mix(in srgb, var(--line) 80%, transparent); border-radius: 8px; background: color-mix(in srgb, var(--text) 4%, transparent); color: var(--text); font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.copilot-action-review-label { margin: 13px 0 0; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.copilot-action-review-effects { display: grid; gap: 5px; margin: 6px 0 0; padding: 0 0 0 16px; color: var(--text); font-size: 12px; line-height: 1.45; }
.copilot-action-review-effects li::marker { color: var(--console-accent); }
.copilot-action-review-denied { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.copilot-action-review-details { margin-top: 12px; color: var(--muted); font-size: 11px; }
.copilot-action-review-details > summary { cursor: pointer; list-style: none; }
.copilot-action-review-details > summary::-webkit-details-marker { display: none; }
.copilot-action-review-details dl { margin-top: 7px; }
.copilot-action-review-state, .copilot-action-review-result, .copilot-action-review-error { margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.copilot-action-review-error { color: #b46f5d; }
.copilot-action-review dl { display: grid; gap: 5px; margin: 10px 0 0; }
.copilot-action-review dl > div { display: grid; grid-template-columns: minmax(88px, .35fr) 1fr; gap: 8px; }
.copilot-action-review dt { color: var(--muted); font-size: 11px; text-transform: capitalize; }
.copilot-action-review dd { min-width: 0; margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.copilot-action-review-actions { display: flex; gap: 8px; margin-top: 14px; }
.copilot-action-review-actions button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font: 650 12px/1 var(--font-sans, Inter, sans-serif); cursor: pointer; }
.copilot-action-review-actions button[data-confirmed="true"] { background: var(--text); color: var(--card); }
html[data-theme="light"] .copilot-action-review-actions button[data-confirmed="true"] { background: #111; color: #fff; }
.copilot-action-review-actions button[data-confirmed="false"]:hover:not(:disabled) { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.copilot-action-review-actions button:disabled { cursor: wait; opacity: .55; }
.copilot-action-review-actions button:focus-visible { outline: 2px solid color-mix(in srgb, var(--console-accent) 70%, #fff); outline-offset: 2px; }
@media (max-width: 520px) { .copilot-action-review { width: 100%; } .copilot-action-review-actions button { flex: 1 1 0; } }

/* Dedicated AI Chat: the final desktop layout owner. History is a true grid
   track, so closing it releases width to the conversation rather than leaving
   a phantom column behind. */
@media (min-width: 681px) {
  body.ai-chat-route .copilot-drawer,
  body.ai-chat-route .copilot-drawer.is-open {
    display: grid !important;
    grid-template-columns: 0 minmax(0, 1fr) !important;
    overflow: hidden !important;
    transition: grid-template-columns 250ms cubic-bezier(.22, .61, .36, 1) !important;
  }
  body.ai-chat-route.ai-chat-history-open .copilot-drawer,
  body.ai-chat-route.ai-chat-history-open .copilot-drawer.is-open {
    grid-template-columns: clamp(276px, 19vw, 300px) minmax(0, 1fr) !important;
  }
  body.ai-chat-route .copilot-history-drawer,
  body.ai-chat-route .copilot-history-drawer.is-open {
    display: flex !important;
    flex-direction: column !important;
    grid-column: 1 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
    width: 100% !important;
    overflow: hidden !important;
    visibility: hidden !important;
    opacity: 0 !important;
    transform: translateX(-18px) !important;
    pointer-events: none !important;
    transition: transform 250ms cubic-bezier(.22, .61, .36, 1), opacity 180ms ease, visibility 0s linear 250ms !important;
  }
  body.ai-chat-route.ai-chat-history-open .copilot-history-drawer,
  body.ai-chat-route.ai-chat-history-open .copilot-history-drawer.is-open {
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateX(0) !important;
    pointer-events: auto !important;
    transition-delay: 0s !important;
  }
  body.ai-chat-route .copilot-panel-content {
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
    padding: 20px clamp(24px, 4vw, 72px) 18px !important;
  }
  body.ai-chat-route .copilot-header {
    display: flex !important;
    flex: 0 0 auto !important;
    width: min(920px, 100%) !important;
    min-height: 48px !important;
    margin: 0 auto !important;
    padding: 0 0 12px !important;
  }
  body.ai-chat-route .copilot-header-copy,
  body.ai-chat-route .copilot-header-copy h2,
  body.ai-chat-route .copilot-header-actions,
  body.ai-chat-route #copilotHistoryToggle {
    display: flex !important;
    visibility: visible !important;
  }
  body.ai-chat-route .copilot-header-copy { align-items: center !important; }
  body.ai-chat-route .copilot-header-copy h2 { font: 500 25px/1.1 Georgia, serif !important; }
  body.ai-chat-route .copilot-runtime-state { display: none !important; }
  body.ai-chat-route .copilot-header-actions { position: static !important; margin-left: auto !important; gap: 6px !important; }
  body.ai-chat-route .copilot-header-icon { display: grid !important; width: 32px !important; height: 32px !important; }
  body.ai-chat-route .copilot-header-close { display: none !important; }
  body.ai-chat-route .copilot-messages { flex: 1 1 auto !important; min-height: 0 !important; width: min(920px, 100%) !important; max-width: 920px !important; margin: 0 auto !important; overflow-y: auto !important; }
  body.ai-chat-route .copilot-messages:has(.copilot-empty-state) { justify-content: center !important; padding-bottom: 8vh !important; }
  body.ai-chat-route .copilot-composer { position: relative !important; flex: 0 0 auto !important; width: min(920px, 100%) !important; max-width: 920px !important; margin: 0 auto !important; padding: 12px 0 max(6px, env(safe-area-inset-bottom)) !important; }
  body.ai-chat-route .copilot-composer > .copilot-composer-input { min-height: 104px !important; border-radius: 16px !important; }
  body.ai-chat-route .copilot-attachments { flex: 0 0 auto !important; width: min(920px, 100%) !important; margin: 0 auto 6px !important; }
  body.ai-chat-route .copilot-history-drawer-head { display: flex !important; align-items: center !important; min-height: 64px !important; padding: 16px 16px 10px !important; }
  body.ai-chat-route .copilot-history-drawer-head h2 { font: 650 18px/1.1 Inter, sans-serif !important; }
  body.ai-chat-route .copilot-history-drawer-head small,
  body.ai-chat-route .copilot-history-close { display: none !important; }
  body.ai-chat-route .copilot-history-drawer-actions { margin-left: auto !important; }
  body.ai-chat-route .copilot-history-search { display: grid !important; width: 30px; height: 30px; place-items: center; padding: 0; border: 0; color: var(--muted); background: transparent; opacity: .58; }
  body.ai-chat-route .copilot-history-search svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
  body.ai-chat-route .copilot-history-new { display: flex !important; align-items: center; gap: 8px; width: calc(100% - 20px); min-height: 38px; margin: 0 10px 8px; padding: 0 9px; border: 0; border-radius: 8px; color: var(--text); background: transparent; font-size: 13px; font-weight: 500; text-align: left; }
  body.ai-chat-route .copilot-history-new:hover,
  body.ai-chat-route .copilot-history-new:focus-visible { background: color-mix(in srgb, var(--text) 7%, transparent); }
  body.ai-chat-route .copilot-history-new span { color: var(--muted); font-size: 18px; }
  body.ai-chat-route .copilot-history-body { display: flex !important; flex: 1 1 auto !important; min-height: 0 !important; padding: 8px 10px 14px !important; overflow: hidden !important; }
  body.ai-chat-route .copilot-history-list { flex: 1 1 auto !important; min-height: 0 !important; overflow-y: auto !important; gap: 2px !important; }
  body.ai-chat-route .copilot-history-group { margin: 15px 8px 6px; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .02em; }
  body.ai-chat-route .copilot-history-group:first-child { margin-top: 4px; }
  body.ai-chat-route .copilot-history-item { grid-template-columns: minmax(0, 1fr) 26px !important; min-height: 40px; border-radius: 8px !important; }
  body.ai-chat-route .copilot-history-open { display: flex !important; min-width: 0 !important; min-height: 40px; padding: 0 5px 0 10px !important; }
  body.ai-chat-route .copilot-history-open strong { overflow: hidden; color: var(--text); font-size: 13px !important; font-weight: 500 !important; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
  body.ai-chat-route .copilot-history-open small,
  body.ai-chat-route .copilot-history-active { display: none !important; }
  body.ai-chat-route .copilot-history-more { opacity: 0 !important; }
  body.ai-chat-route .copilot-history-item:hover .copilot-history-more,
  body.ai-chat-route .copilot-history-item:focus-within .copilot-history-more { opacity: .8 !important; }
}
@media (min-width: 681px) and (max-width: 1120px) {
  body.ai-chat-route .copilot-drawer,
  body.ai-chat-route.ai-chat-history-open .copilot-drawer { grid-template-columns: minmax(0, 1fr) !important; }
  body.ai-chat-route .copilot-history-drawer { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  body.ai-chat-route .copilot-drawer,
  body.ai-chat-route .copilot-history-drawer { transition-duration: 0s !important; }
}

/* Timeline rows use integration marks only when supplied by the backend. */
body.ai-chat-route .copilot-message.assistant.copilot-execution-panel .copilot-execution-steps li { flex-wrap: wrap; }
body.ai-chat-route .copilot-message.assistant.copilot-execution-panel .copilot-execution-steps li.has-integration::before { display: none; }
body.ai-chat-route .copilot-execution-step-icon { flex: none; width: 16px; height: 16px; object-fit: contain; align-self: center; }
body.ai-chat-route .copilot-execution-step-detail { flex: 0 0 100%; margin-left: 0; padding-top: 2px; color: var(--muted); line-height: 1.5; }
body.ai-chat-route .copilot-execution-steps .has-integration .copilot-execution-step-detail { padding-left: 26px; }
body.ai-chat-route .copilot-execution-step-label { flex: 0 1 auto; }
body.ai-chat-route .copilot-execution-duration { margin-left: auto; }

/* The latest AI Chat refinement must follow the legacy drawer cascade. */
@media (min-width: 681px) {
  body.ai-chat-route .copilot-drawer .copilot-panel-content { padding: 18px 30px 14px !important; }
  body.ai-chat-route .copilot-header { width: 100% !important; max-width: none !important; }
  body.ai-chat-route .copilot-header .copilot-header-copy { gap: 8px !important; }
  body.ai-chat-route .copilot-header .copilot-header-copy #copilotHistoryToggle { order: -1; }
  body.ai-chat-route .copilot-header .copilot-header-actions { margin-left: 10px !important; }
  body.ai-chat-route .copilot-header .copilot-header-actions > :not(#copilotHistoryToggle) { display: none !important; }
  body.ai-chat-route .copilot-header #copilotHistoryToggle { display: grid !important; width: 30px !important; height: 30px !important; padding: 0 !important; border: 0 !important; border-radius: 7px !important; color: var(--muted) !important; background: transparent !important; }
  body.ai-chat-route .copilot-header #copilotHistoryToggle:hover,
  body.ai-chat-route .copilot-header #copilotHistoryToggle:focus-visible { color: var(--text) !important; background: color-mix(in srgb, var(--text) 7%, transparent) !important; }
  body.ai-chat-route .copilot-header #copilotNew { display: none !important; }
  body.ai-chat-route .copilot-history-drawer-head { border-bottom: 0 !important; }
  body.ai-chat-route.ai-chat-history-open .copilot-history-close { display: grid !important; width: 30px; height: 30px; place-items: center; padding: 0; border: 0; border-radius: 7px; color: var(--muted); background: transparent; }
  body.ai-chat-route .copilot-history-close:hover,
  body.ai-chat-route .copilot-history-close:focus-visible { color: var(--text); background: color-mix(in srgb, var(--text) 7%, transparent); }
  body.ai-chat-route .copilot-history-close svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  body.ai-chat-route .copilot-history-search-field { display: grid; grid-template-columns: minmax(0, 1fr) 30px; align-items: center; gap: 5px; margin: 0 10px 8px; padding: 0 6px 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
  body.ai-chat-route .copilot-history-search-field[hidden] { display: none !important; }
  body.ai-chat-route .copilot-history-search-field label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  body.ai-chat-route .copilot-history-search-field input { min-width: 0; height: 34px; padding: 0; border: 0; outline: 0; color: var(--text); background: transparent; font: 13px/1.2 Inter, sans-serif; }
  body.ai-chat-route .copilot-history-search-field input::placeholder { color: var(--muted); }
  body.ai-chat-route .copilot-history-search-field input:placeholder-shown + button { visibility: hidden; pointer-events: none; }
  body.ai-chat-route .copilot-history-search-field button { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 18px; line-height: 1; }
  body.ai-chat-route .copilot-history-search-field button:hover,
  body.ai-chat-route .copilot-history-search-field button:focus-visible { color: var(--text); background: color-mix(in srgb, var(--text) 7%, transparent); }
}

/* One sidebar control is visible in each state: the chat-header control opens
   History; the equivalent control inside the open History header closes it. */
@media (min-width: 681px) {
  body.ai-chat-route.ai-chat-history-open .copilot-header-copy #copilotHistoryToggle { display: none !important; }
  body.ai-chat-route .copilot-drawer .copilot-header { width: 100% !important; max-width: none !important; margin: 0 !important; }
  body.ai-chat-route .copilot-drawer .copilot-history-drawer,
  body.ai-chat-route .copilot-drawer .copilot-history-drawer-head,
  body.ai-chat-route .copilot-drawer .copilot-history-body { background: var(--surface) !important; border-top: 0 !important; border-bottom: 0 !important; box-shadow: none !important; }
  body.ai-chat-route .copilot-drawer .copilot-history-drawer-head { border: 0 !important; }
  body.ai-chat-route .copilot-drawer .copilot-history-drawer-head::before,
  body.ai-chat-route .copilot-drawer .copilot-history-drawer-head::after { display: none !important; content: none !important; }
  body.ai-chat-route .copilot-drawer .copilot-history-new { border: 0 !important; box-shadow: none !important; background: transparent !important; }
  body.ai-chat-route .copilot-drawer .copilot-history-close { display: grid !important; }
}
html[data-theme="light"] body.ai-chat-route .copilot-drawer .copilot-history-drawer,
html[data-theme="light"] body.ai-chat-route .copilot-drawer .copilot-history-drawer-head,
html[data-theme="light"] body.ai-chat-route .copilot-drawer .copilot-history-body { background: #f8f8f8 !important; }

/* Slide the actual History surface through its clipped grid track. The track
   grows rightward on open and contracts leftward on close with the chat. */
@media (min-width: 681px) {
  body.ai-chat-route .copilot-drawer .copilot-history-drawer {
    transform: translateX(-100%) !important;
    opacity: 0 !important;
    transition: transform 250ms cubic-bezier(.22, .61, .36, 1), opacity 160ms ease, visibility 0s linear 250ms !important;
  }
  body.ai-chat-route.ai-chat-history-open .copilot-drawer .copilot-history-drawer {
    transform: translateX(0) !important;
    opacity: 1 !important;
    transition-delay: 0s !important;
  }
}

/* History search only changes the list. The dedicated chat scene always owns
   the desktop viewport, even if the filtered list has one short result. */
@media (min-width: 681px) {
  body.ai-chat-route.app-page { height: 100vh !important; min-height: 100vh !important; grid-template-rows: minmax(0, 100vh) !important; overflow: hidden !important; }
  body.ai-chat-route .app-main,
  body.ai-chat-route #page-ai-chat,
  body.ai-chat-route .ai-chat-mount,
  body.ai-chat-route .copilot-drawer { height: 100vh !important; min-height: 100vh !important; }
  body.ai-chat-route .copilot-history-body { min-height: 0 !important; overflow: hidden !important; }
  body.ai-chat-route .copilot-history-list { min-height: 0 !important; overflow-y: auto !important; }
}

/* Search is fully contained inside the fixed History track. Filtering rows
   cannot contribute intrinsic width or move the conversation column. */
@media (min-width: 1121px) {
  body.ai-chat-route.ai-chat-history-open .copilot-drawer { grid-template-columns: 300px minmax(0, 1fr) !important; }
  body.ai-chat-route .copilot-drawer .copilot-history-drawer { contain: layout paint !important; }
  body.ai-chat-route .copilot-drawer .copilot-history-search-field { width: calc(100% - 20px) !important; max-width: calc(100% - 20px) !important; min-width: 0 !important; box-sizing: border-box !important; overflow: hidden !important; }
  body.ai-chat-route .copilot-drawer .copilot-history-search-field input { width: 100% !important; min-width: 0 !important; box-sizing: border-box !important; }
}
html[data-theme="light"] body.ai-chat-route .copilot-drawer,
html[data-theme="light"] body.ai-chat-route .copilot-panel-content { background: #fff !important; }
html[data-theme="light"] body.ai-chat-route .copilot-history-drawer { background: #f8f8f8 !important; border-right-color: #e3e3e3 !important; }
html[data-theme="light"] body.ai-chat-route .copilot-history-item:hover,
html[data-theme="light"] body.ai-chat-route .copilot-history-item:focus-within { background: #f0f0f0 !important; }
html[data-theme="light"] body.ai-chat-route .copilot-history-item.is-active { background: #eaeaea !important; }
html[data-theme="light"] body.ai-chat-route .copilot-composer > .copilot-composer-input { border-color: #e2e2e2 !important; background: #fff !important; box-shadow: 0 5px 18px rgba(24, 24, 24, .035) !important; }
html[data-theme="light"] body.ai-chat-route .copilot-composer > .copilot-composer-input:focus-within { border-color: #bdbdbd !important; box-shadow: 0 0 0 2px rgba(30, 30, 30, .035) !important; }
html[data-theme="light"] body.ai-chat-route .copilot-composer textarea { color: #191919 !important; background: transparent !important; }
html[data-theme="light"] body.ai-chat-route .copilot-composer textarea::placeholder { color: #929292 !important; }
html[data-theme="light"] body.ai-chat-route .copilot-send { color: #fff !important; background: #191919 !important; }
html[data-theme="light"] body.ai-chat-route .copilot-message.user .copilot-message-content,
html[data-theme="light"] body.ai-chat-route .copilot-message.user .message-bubble { border-color: #e4e4e4 !important; background: #f7f7f7 !important; color: #1c1c1c !important; }

/* Compact desktop composer and quiet, document-style response treatment. */
@media (min-width: 681px) {
  body.ai-chat-route .copilot-composer { padding-top: 8px !important; }
  body.ai-chat-route .copilot-composer > .copilot-composer-input { min-height: 76px !important; padding: 8px 10px 7px !important; border-radius: 14px !important; }
  body.ai-chat-route .copilot-composer textarea { min-height: 34px !important; padding: 2px 3px 5px !important; }
  body.ai-chat-route .copilot-composer-bottom { min-height: 29px !important; }
  body.ai-chat-route .copilot-composer .copilot-attach { width: 28px !important; height: 28px !important; flex-basis: 28px !important; font-size: 20px !important; }
  body.ai-chat-route .copilot-runtime-trigger { height: 27px !important; }
  body.ai-chat-route .copilot-message.assistant:not(.is-thinking):not(.copilot-execution-panel) { padding: 12px 5px 14px !important; font-size: 14px !important; line-height: 1.62 !important; }
  body.ai-chat-route .copilot-message.assistant p { margin-bottom: 9px !important; }
  body.ai-chat-route .copilot-message.assistant.is-thinking { display: inline-flex !important; width: auto !important; min-height: 20px !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; }
  body.ai-chat-route .copilot-message.assistant.is-thinking .thinking-anim-seq { min-width: 25px; color: var(--console-accent); font-size: 13px; letter-spacing: 1.5px; }
}

/* The default composer is intentionally slim. The existing input-resize
   routine expands only the textarea as a draft grows. */
@media (min-width: 681px) {
  body.ai-chat-route .copilot-composer > .copilot-composer-input { min-height: 0 !important; padding: 6px 10px 6px !important; }
  body.ai-chat-route .copilot-composer textarea { min-height: 0 !important; padding: 1px 3px 3px !important; }
  body.ai-chat-route .copilot-composer-bottom { min-height: 27px !important; }
  body.ai-chat-route .copilot-composer { padding-top: 6px !important; }
}

/* AI Chat visual refinement. These rules are deliberately route-scoped so the
   neutral light workspace does not change TensorOS operational pages. */
@media (min-width: 681px) {
  body.ai-chat-route .copilot-header #copilotNew { display: none !important; }
  body.ai-chat-route .copilot-history-drawer-head { border-bottom: 0 !important; }
  body.ai-chat-route .copilot-history-close { display: grid !important; width: 30px; height: 30px; place-items: center; padding: 0; border: 0; border-radius: 7px; color: var(--muted); background: transparent; }
  body.ai-chat-route .copilot-history-close:hover,
  body.ai-chat-route .copilot-history-close:focus-visible { color: var(--text); background: color-mix(in srgb, var(--text) 7%, transparent); }
  body.ai-chat-route .copilot-history-close svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  body.ai-chat-route .copilot-history-search-field { display: grid; grid-template-columns: minmax(0, 1fr) 30px; align-items: center; gap: 5px; margin: 0 10px 8px; padding: 0 6px 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
  body.ai-chat-route .copilot-history-search-field[hidden] { display: none !important; }
  body.ai-chat-route .copilot-history-search-field label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  body.ai-chat-route .copilot-history-search-field input { min-width: 0; height: 34px; padding: 0; border: 0; outline: 0; color: var(--text); background: transparent; font: 13px/1.2 Inter, sans-serif; }
  body.ai-chat-route .copilot-history-search-field input::placeholder { color: var(--muted); }
  body.ai-chat-route .copilot-history-search-field button { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 18px; line-height: 1; }
  body.ai-chat-route .copilot-history-search-field button:hover,
  body.ai-chat-route .copilot-history-search-field button:focus-visible { color: var(--text); background: color-mix(in srgb, var(--text) 7%, transparent); }
}
html[data-theme="light"] body.ai-chat-route .copilot-drawer,
html[data-theme="light"] body.ai-chat-route .copilot-panel-content { background: #fff !important; }
html[data-theme="light"] body.ai-chat-route .copilot-history-drawer { background: #f8f8f8 !important; border-right-color: #e3e3e3 !important; }
html[data-theme="light"] body.ai-chat-route .copilot-history-item:hover,
html[data-theme="light"] body.ai-chat-route .copilot-history-item:focus-within { background: #f0f0f0 !important; }
html[data-theme="light"] body.ai-chat-route .copilot-history-item.is-active { background: #eaeaea !important; }
html[data-theme="light"] body.ai-chat-route .copilot-composer > .copilot-composer-input { border-color: #e2e2e2 !important; background: #fff !important; box-shadow: 0 5px 18px rgba(24, 24, 24, .035) !important; }
html[data-theme="light"] body.ai-chat-route .copilot-composer textarea { color: #191919 !important; background: transparent !important; }
html[data-theme="light"] body.ai-chat-route .copilot-composer textarea::placeholder { color: #929292 !important; }
html[data-theme="light"] body.ai-chat-route .copilot-send { color: #fff !important; background: #191919 !important; }
html[data-theme="light"] body.ai-chat-route .copilot-message.user .copilot-message-content,
html[data-theme="light"] body.ai-chat-route .copilot-message.user .message-bubble { border-color: #e4e4e4 !important; background: #f7f7f7 !important; color: #1c1c1c !important; }
@media (min-width: 681px) and (max-width: 1120px) {
  body.ai-chat-route .copilot-drawer { grid-template-columns: minmax(0, 1fr); }
  body.ai-chat-route .copilot-history-drawer { display: none !important; }
}

/* AI Chat desktop composition: one grid column for history and one proper
   flex column for the conversation. This is deliberately flow-based—never
   positioned against the browser viewport—so the composer stays at the bottom
   of the conversation column at every laptop height. */
@media (min-width: 1121px) {
  body.ai-chat-route .copilot-drawer,
  body.ai-chat-route .copilot-drawer.is-open { grid-template-columns: clamp(280px, 19vw, 310px) minmax(0, 1fr) !important; }
  body.ai-chat-route .copilot-history-drawer,
  body.ai-chat-route .copilot-history-drawer.is-open { flex-direction: column !important; overflow: hidden !important; }
  body.ai-chat-route .copilot-history-drawer-head { display: flex !important; flex: 0 0 auto !important; min-height: 68px; padding: 20px 18px 14px !important; border-bottom: 1px solid var(--line) !important; }
  body.ai-chat-route .copilot-history-drawer-head h2 { font-family: Inter, sans-serif !important; font-size: 18px !important; font-weight: 650 !important; }
  body.ai-chat-route .copilot-history-drawer-actions { display: flex !important; align-items: center; gap: 6px; }
  body.ai-chat-route #copilotNew { width: auto !important; min-height: 30px; padding: 0 9px !important; border: 1px solid var(--line) !important; border-radius: 7px !important; color: var(--text) !important; background: var(--bg) !important; font-size: 0 !important; }
  body.ai-chat-route #copilotNew::after { content: "New chat"; font: 600 11px/1 Inter, sans-serif; }
  body.ai-chat-route .copilot-history-body { display: flex !important; flex: 1 1 auto !important; flex-direction: column !important; min-height: 0 !important; padding: 10px 9px 16px !important; overflow: hidden !important; }
  body.ai-chat-route .copilot-history-list { flex: 1 1 auto !important; min-height: 0 !important; overflow-y: auto !important; }
  body.ai-chat-route .copilot-panel-content { flex-direction: column !important; align-items: stretch !important; height: 100% !important; overflow: hidden !important; }
  body.ai-chat-route .copilot-header { display: flex !important; flex: 0 0 auto !important; align-items: center !important; min-height: 58px; padding: 0 0 14px !important; }
  body.ai-chat-route .copilot-header-copy { display: flex !important; align-items: baseline !important; gap: 12px !important; }
  body.ai-chat-route .copilot-header-copy h2 { display: block !important; margin: 0 !important; font-size: 24px !important; }
  body.ai-chat-route .copilot-runtime-state { display: none !important; }
  body.ai-chat-route .copilot-messages { display: flex !important; flex: 1 1 auto !important; flex-direction: column !important; min-height: 0 !important; overflow-y: auto !important; padding: 18px max(4px, 4%) 24px !important; }
  body.ai-chat-route .copilot-composer { position: relative !important; display: block !important; flex: 0 0 auto !important; width: min(920px, 94%) !important; margin: 0 auto !important; padding: 14px 0 max(12px, env(safe-area-inset-bottom)) !important; border-top: 0 !important; }
  body.ai-chat-route .copilot-composer > .copilot-composer-input { min-height: 108px !important; padding: 12px 14px !important; border: 1px solid var(--line) !important; border-radius: 16px !important; background: var(--surface) !important; }
  body.ai-chat-route .copilot-composer textarea { min-height: 54px !important; }
  body.ai-chat-route .copilot-attachments { flex: 0 0 auto !important; width: min(920px, 94%) !important; margin: 0 auto 6px !important; }
  body.ai-chat-route .copilot-messages:has(.copilot-empty-state) { justify-content: center; padding-bottom: 10vh !important; }
}
html[data-theme="light"] { --bg: #fff; --surface: #f8f9f7; --card: #fff; --sidebar-bg: #eff2ec; --sidebar-hover: #e7ebe4; --sidebar-active: #dfe6da; --line: #dee4db; --line-soft: #edf0eb; --text: #1d211c; --muted: #626a60; }

.app-page {
  --app-sidebar-track: 260px;
  --ai-sidebar-size: clamp(420px, 30vw, 520px);
  --ai-sidebar-track: 54px;
  --ai-history-size: clamp(260px, 19vw, 300px);
  display: grid;
  grid-template-columns: var(--app-sidebar-track) minmax(0, 1fr) var(--ai-sidebar-track);
  grid-template-rows: 100vh;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  transition: grid-template-columns var(--motion-duration-drawer) var(--motion-ease-enter);
}

.app-page.sidebar-collapsed { --app-sidebar-track: 68px; }
.app-page.copilot-open,
body.copilot-open { --ai-sidebar-track: var(--ai-sidebar-size); }
.app-page.copilot-history-open,
body.copilot-history-open { --ai-sidebar-track: calc(var(--ai-sidebar-size) + 290px); }

.settings-wrap { display: none; }

/* Mobile Topbar */
.mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 56px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

/* Sidebar Top Brand Header */
.sidebar-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 38px;
  padding: 0 4px 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
  transition: opacity var(--motion-duration-fast) var(--motion-ease-standard), max-width var(--motion-duration-base) var(--motion-ease-enter);
}

.sidebar-brand .brand-arrow,
.brand .brand-arrow {
  width: auto;
  height: auto;
  display: inline-block;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-family: "IBM Plex Mono", monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--console-accent, #9eae78) !important;
  letter-spacing: -.06em;
  flex-shrink: 0;
}

.sidebar-brand .brand-name,
.brand .brand-name {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -.035em;
  color: var(--text);
  white-space: nowrap;
  transition: opacity var(--motion-duration-fast) var(--motion-ease-standard), max-width var(--motion-duration-base) var(--motion-ease-enter), transform var(--motion-duration-fast) var(--motion-ease-standard);
  max-width: 140px;
  overflow: hidden;
}

.sidebar-toggle {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--motion-duration-fast), color var(--motion-duration-fast), border-color var(--motion-duration-fast), transform var(--motion-duration-drawer) var(--motion-ease-enter);
}

.sidebar-toggle:hover {
  background: var(--sidebar-hover);
  color: var(--text);
  border-color: var(--line);
}

.sidebar-toggle svg {
  width: 17px;
  height: 17px;
}

/* When collapsed: toggle button slides smoothly to the left on the same horizontal row, no jump */
.app-page.sidebar-collapsed .sidebar-header {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding: 0 0 10px;
}

.app-page.sidebar-collapsed .sidebar-brand {
  max-width: 0;
  opacity: 0;
  transform: translateX(-8px);
  pointer-events: none;
}

.app-page.sidebar-collapsed .sidebar-toggle {
  margin: 0 auto;
}

.workspace-btn,
.settings-btn {
  background: var(--card);
}

.workspace-btn {
  border-radius: 8px;
}

.ws-avatar,
.ws-item-avatar {
  border-radius: 7px;
  background: #252b1d;
  color: #b9c99a;
}

.app-sidebar {
  padding: 18px 10px 16px;
  background: var(--sidebar-bg);
}

.sidebar-menu {
  padding: 0;
  gap: 3px;
}

.sidebar-link {
  min-height: 43px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}

.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: var(--text);
  transform: none;
}

.sidebar-link.active {
  background: var(--sidebar-active);
  color: var(--text);
  box-shadow: none;
}

.sidebar-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  width: 2px;
  height: 18px;
  border-radius: 2px;
  background: var(--console-accent);
}

.sidebar-link svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-main {
  max-width: none;
  height: 100%;
  padding: 38px clamp(28px, 4vw, 68px) 70px;
  margin: 0;
  background: var(--bg);
}

.app-page-content {
  max-width: 1480px;
  margin: 0 auto;
  animation: none;
}

.page-header {
  align-items: flex-start;
  margin-bottom: 30px;
}

.console-eyebrow,
.panel-kicker {
  margin: 0 0 7px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.page-header h1 {
  margin-bottom: 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 3vw, 46px);
  font-weight: 400;
  letter-spacing: -.035em;
}

.console-hire {
  margin: 4px 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 9px;
  font-size: 14px;
}

.console-hire span { color: var(--console-accent); font-size: 18px; line-height: 1; }

.dashboard-content {
  gap: 22px;
}

.dashboard-stats-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 12px !important;
  margin-bottom: 24px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.dashboard-stats-grid .stat-card {
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  min-height: 96px !important;
  max-height: 115px !important;
  padding: 14px 16px !important;
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
  background: var(--card) !important;
  box-sizing: border-box !important;
  transition: border-color 120ms ease !important;
}

.dashboard-stats-grid .stat-card:hover {
  border-color: #43443f !important;
  transform: none !important;
  box-shadow: none !important;
}

.dashboard-stats-grid .stat-label {
  margin: 0 0 6px 0 !important;
  color: var(--muted) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.dashboard-stats-grid .stat-value {
  margin: 0 !important;
  color: var(--text) !important;
  font-family: "Space Grotesk", var(--font-sans), sans-serif !important;
  font-size: 24px !important;
  font-weight: 600 !important;
  line-height: 1.1 !important;
}

.dashboard-stats-grid .stat-note {
  margin: 6px 0 0 0 !important;
  color: var(--muted) !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

@media (max-width: 1300px) {
  .dashboard-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 850px) {
  .dashboard-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 550px) {
  .dashboard-stats-grid {
    grid-template-columns: 1fr !important;
  }
}

.console-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-card,
.console-panel,
.activity-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.stat-card {
  min-height: 158px;
  padding: 20px;
  background: var(--card);
}

.stat-card::before {
  display: none;
}

.stat-card:hover {
  border-color: #43443f;
  box-shadow: none;
  transform: none;
}

.stat-label {
  margin-bottom: 25px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.stat-value {
  font-size: 32px;
  font-weight: 600;
}

.stat-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.stat-note.positive,
.live-status {
  color: var(--console-accent);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--console-accent);
  box-shadow: 0 0 0 3px var(--console-accent-soft);
}

.console-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr);
  gap: 12px;
}

.console-panel {
  min-width: 0;
  overflow: hidden;
}

.console-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
}

.console-panel-head h2,
.activity-section h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.console-panel-head a {
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.console-panel-head a:hover {
  color: var(--text);
}

.workforce-table {
  border-top: 1px solid var(--line-soft);
}

.workforce-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(180px, 1.6fr) 90px 50px;
  align-items: center;
  gap: 15px;
  min-height: 65px;
  padding: 9px 20px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 12px;
}

.workforce-row:last-child {
  border-bottom: 0;
}

.workforce-labels {
  min-height: 34px;
  color: #73756e;
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.workforce-person {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
}

.workforce-person .employee-avatar {
  grid-row: 1 / 3;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-style: normal;
  font-size: 11px;
}

.employee-avatar.coral { background: #4a2b25; color: #ff9a80; }
.employee-avatar.violet { background: #292642; color: #b6aaff; }
.employee-avatar.mint { background: #20352d; color: #83dab5; }

.workforce-person b {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.workforce-person small {
  color: var(--muted);
  font-size: 10px;
}

.workforce-row strong {
  color: var(--text);
  text-align: right;
}

.live-status,
.idle-status {
  font-size: 11px;
}

.live-status::before,
.idle-status::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
}

.idle-status { color: #e8c36d; }

.queue-count {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: #2f2519;
  color: #f0c36c;
  font-size: 11px;
}

.queue-item {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 16px 20px;
  border-top: 1px solid var(--line-soft);
  color: var(--text);
  text-decoration: none;
}

.queue-item:hover { background: #1b1c19; }

.queue-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.queue-item b,
.queue-item small { display: block; }
.queue-item b { font-size: 12px; font-weight: 600; }
.queue-item small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.queue-item time { color: var(--muted); font-family: "IBM Plex Mono", monospace; font-size: 9px; }

.queue-footer {
  display: block;
  padding: 15px 20px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 11px;
  text-decoration: none;
}

.activity-section {
  gap: 0;
  overflow: hidden;
}

.activity-feed {
  padding: 0 20px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
}

.activity-item {
  align-items: center;
  min-height: 48px;
  padding: 10px 0;
}

.activity-time { width: 52px; font-size: 9px; }
.activity-text { font-size: 12px; }

.roster-card,
.card,
.employee-item,
.approval-card,
.settings-panel,
.audit-timeline {
  border-radius: 12px;
  background: var(--card);
}

.modal-overlay {
  backdrop-filter: blur(12px);
}

.modal-content {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  box-shadow: 0 28px 90px rgba(0,0,0,.55);
}

@media (max-width: 1180px) {
  .console-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .console-workspace-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1000px) {
  .app-page { grid-template-columns: 1fr; }
  .app-main { padding: 28px 22px 60px; }
}

/* Public-quality plan cards inside the workspace */
.workspace-plan-grid { border-radius: 16px; }
.workspace-plan-card { min-height: 500px; padding: 30px 22px; }
.workspace-plan-card h2 { font-size: 25px; }
.workspace-plan-audience { min-height: 31px; margin-top: 7px; font-size: 11px; }
.workspace-plan-price { margin: 22px 0 12px; }
.workspace-plan-price strong { font-size: 31px; }
.workspace-plan-price small { font-size: 10px; }
.workspace-plan-card > p:not(.workspace-plan-audience):not(.workspace-plan-price) { min-height: 74px; margin-bottom: 18px; font-size: 11px; line-height: 1.6; }
.workspace-plan-card > button { min-height: 42px; border-radius: 9px; font-size: 11px; }
.workspace-plan-card ul { gap: 13px; margin-top: 23px; padding-top: 21px; }
.workspace-plan-card li { padding-left: 20px; font-size: 10px; line-height: 1.45; }
.workspace-plan-label { top: 17px; right: 16px; padding: 5px 8px; font-size: 8px; }

/* Consistent navigation and account icon geometry */
.sidebar-link { gap: 12px; }
.app-page.sidebar-collapsed .sidebar-link { padding-inline: 11px; }
.sidebar-account { padding-inline: 0; }
.account-trigger { min-height: 52px; }
.account-option-icon { width: 24px; height: 24px; color: var(--muted); font-size: 0; }
.account-option-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.account-options a,
.account-options button { grid-template-columns: 24px minmax(0, 1fr) auto; gap: 11px; padding-inline: 10px; }
.account-menu { width: 320px; padding: 14px; }
.account-menu-head { gap: 12px; padding: 3px 5px 14px; }
.account-menu-head .account-avatar { width: 36px; height: 36px; flex-basis: 36px; }
.account-menu-head strong { font-size: 14px; }
.account-menu-head small { font-size: 11px; }

.sidebar-link .badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 1px solid color-mix(in srgb, var(--console-accent) 35%, var(--line));
  background: var(--console-accent-soft);
  color: var(--console-accent);
  box-shadow: none;
  font-size: 9px;
}

/* Complete light workspace treatment */
html[data-theme="light"] .app-header,
html[data-theme="light"] .app-main { background: var(--bg); }
html[data-theme="light"] .app-sidebar { box-shadow: inset -1px 0 var(--line); }
html[data-theme="light"] .stat-card,
html[data-theme="light"] .console-panel,
html[data-theme="light"] .activity-section,
html[data-theme="light"] .workspace-plan-card { box-shadow: 0 1px 0 rgba(24,26,21,.025); }
html[data-theme="light"] .stat-card:hover,
html[data-theme="light"] .console-panel:hover { border-color: #b7bbaF; }
html[data-theme="light"] .queue-item:hover { background: var(--sidebar-hover); }
html[data-theme="light"] .queue-count { background: #efe5cd; color: #795d26; }

/* Final knowledge/connections precedence: these sit after legacy detail styles
   so the laptop workspace always retains its calm, two-surface hierarchy. */
#empTabKnowledge .knowledge-split-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; gap: 20px !important; }
#empTabKnowledge .knowledge-config-pane > .emp-card-section,
#empTabKnowledge .knowledge-test-pane,
#empTabTelegram .telegram-manage-card { background: var(--surface) !important; border: 1px solid var(--line) !important; border-radius: 12px !important; box-shadow: none !important; }
#empTabKnowledge .knowledge-config-pane > .emp-card-section { padding: 24px 26px !important; }
#empTabKnowledge .knowledge-test-pane { height: auto !important; min-height: 560px !important; max-height: none !important; }
#empTabKnowledge .knowledge-preview-header { display: flex !important; flex-direction: row !important; align-items: center !important; justify-content: space-between !important; padding: 18px 24px !important; border-bottom: 1px solid var(--line) !important; background: transparent !important; }
#empTabKnowledge .test-conversation-area { background: transparent !important; }
#empTabKnowledge .test-composer { padding: 14px 24px 22px !important; background: transparent !important; border-top: 0 !important; }
#empTabKnowledge .composer-content { border-color: var(--line) !important; background: transparent !important; }
#empTabKnowledge .knowledge-dropzone.polished-dropzone { background: color-mix(in srgb, var(--semantic-success) 4%, var(--surface)) !important; border-color: color-mix(in srgb, var(--semantic-success) 74%, var(--line)) !important; }
#empTabTelegram .telegram-manage-card { max-width: none !important; padding: 26px 28px !important; }
#empTabTelegram .tg-status-banner { border-top: 1px solid var(--line) !important; border-bottom: 1px solid var(--line) !important; }
html[data-theme="light"] #empTabKnowledge .knowledge-test-pane,
html[data-theme="light"] #empTabKnowledge .knowledge-config-pane > .emp-card-section,
html[data-theme="light"] #empTabTelegram .telegram-manage-card { background: #fcfcf8 !important; border-color: #d5dbcf !important; }
@media (max-width: 760px) {
  #empTabKnowledge .knowledge-split-layout { grid-template-columns: minmax(0, 1fr) !important; }
  #empTabKnowledge .knowledge-config-pane > .emp-card-section,
  #empTabTelegram .telegram-manage-card { padding: 18px !important; }
}

/* Employee settings is a complete management workspace: quiet neutral surfaces
   hold editable configuration, while status and destructive intent remain the
   only semantic accents. */
#empTabSettings .employee-settings-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
#empTabSettings .employee-settings-main,
#empTabSettings .employee-settings-aside { display: grid; gap: 14px; min-width: 0; }
#empTabSettings .employee-settings-card,
#empTabSettings .employee-danger-zone { padding: 20px 22px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: none; }
#empTabSettings .employee-settings-heading { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 17px; }
#empTabSettings .settings-section-mark { display: grid; width: 29px; height: 29px; flex: 0 0 29px; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--console-accent) 8%, transparent); color: var(--console-accent); font-size: 16px; }
#empTabSettings .employee-settings-heading h3,
#empTabSettings .employee-danger-zone h3 { margin: 0; color: var(--text); font-size: 16px; font-weight: 650; letter-spacing: -.015em; }
#empTabSettings .employee-settings-heading p,
#empTabSettings .employee-danger-zone > p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
#empTabSettings .employee-profile-settings-grid { display: grid; grid-template-columns: 155px minmax(0, 1fr); gap: 20px; align-items: start; }
#empTabSettings .settings-field-label,
#empTabSettings .employee-profile-fields label,
#empTabSettings .employee-settings-preferences-grid label,
#empTabSettings .employee-access-label { display: grid; gap: 6px; color: var(--text); font-size: 12px; font-weight: 600; }
#empTabSettings .employee-profile-fields label span { color: var(--muted); font-weight: 500; }
#empTabSettings .employee-avatar-setting-row { display: flex; gap: 11px; align-items: center; margin-top: 9px; }
#empTabSettings .employee-settings-avatar { display: grid; width: 58px; height: 58px; flex: 0 0 58px; overflow: hidden; place-items: center; border: 1px solid color-mix(in srgb, var(--console-accent) 28%, var(--line)); border-radius: 50%; background: color-mix(in srgb, var(--console-accent) 9%, var(--surface)); color: var(--console-accent); font-size: 20px; font-weight: 650; }
#empTabSettings .employee-settings-avatar img { width: 100%; height: 100%; object-fit: cover; }
#empTabSettings .employee-avatar-setting small { display: block; margin-top: 8px; color: var(--muted); font-size: 10px; line-height: 1.4; }
#empTabSettings .employee-settings-fields-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
#empTabSettings .employee-profile-fields .tensor-input,
#empTabSettings .employee-settings-preferences-grid .tensor-select,
#empTabSettings .employee-access-label .tensor-select { width: 100%; min-height: 36px; padding: 7px 10px; border-color: var(--line); border-radius: 7px; background: transparent; color: var(--text); font-size: 12px; box-shadow: none; }
#empTabSettings .employee-settings-field-note { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
#empTabSettings .employee-settings-save-row { display: flex; justify-content: flex-end; margin-top: 13px; }
#empTabSettings .employee-settings-save-row .cta { min-height: 34px; padding: 7px 13px; font-size: 12px; }
#empTabSettings .employee-settings-preferences-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
#empTabSettings .employee-settings-preferences-grid small { color: var(--muted); font-size: 10px; font-weight: 500; line-height: 1.35; }
#empTabSettings .employee-alerts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#empTabSettings .employee-alert-option { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; align-items: center; min-height: 58px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
#empTabSettings .employee-alert-option input { position: absolute; opacity: 0; pointer-events: none; }
#empTabSettings .employee-alert-option .switch-slider { position: relative; width: 34px; height: 20px; border: 1px solid var(--line); border-radius: 999px; background: var(--sidebar-hover); transition: background 160ms ease, border-color 160ms ease; }
#empTabSettings .employee-alert-option .switch-slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); transition: transform 160ms ease; }
#empTabSettings .employee-alert-option input:checked + .switch-slider { border-color: var(--console-accent); background: var(--console-accent); }
#empTabSettings .employee-alert-option input:checked + .switch-slider::after { transform: translateX(14px); }
#empTabSettings .employee-alert-option strong { display: block; color: var(--text); font-size: 12px; }
#empTabSettings .employee-alert-option small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.3; }
#empTabSettings .employee-lifecycle-card { display: grid; grid-template-columns: minmax(175px, .9fr) minmax(0, 2fr); align-items: center; gap: 18px; }
#empTabSettings .employee-lifecycle-card .employee-settings-heading { margin: 0; }
#empTabSettings .employee-lifecycle-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
#empTabSettings .employee-lifecycle-actions .btn-secondary { min-height: 35px; padding: 7px 9px; font-size: 11px; white-space: nowrap; }
#empTabSettings .employee-settings-details { margin: 0; }
#empTabSettings .employee-settings-details > div { display: grid; grid-template-columns: 42% minmax(0, 1fr); gap: 10px; min-height: 38px; align-items: center; border-top: 1px solid var(--line); }
#empTabSettings .employee-settings-details dt { color: var(--muted); font-size: 11px; }
#empTabSettings .employee-settings-details dd { margin: 0; color: var(--text); font-size: 11px; font-weight: 550; text-align: right; }
#empTabSettings .employee-settings-details .emp-card-status-badge { justify-content: flex-end; padding: 4px 7px; font-size: 10px; }
#empTabSettings .employee-owner-row { display: flex; align-items: center; gap: 9px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
#empTabSettings .employee-owner-avatar { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--console-accent) 12%, var(--surface)); color: var(--console-accent); font-size: 11px; font-weight: 700; }
#empTabSettings .employee-owner-row strong,
#empTabSettings .employee-owner-row small { display: block; }
#empTabSettings .employee-owner-row strong { color: var(--text); font-size: 12px; }
#empTabSettings .employee-owner-row small { margin-top: 2px; color: var(--muted); font-size: 10px; }
#empTabSettings .employee-access-label { margin-top: 13px; }
#empTabSettings .employee-settings-access-card > p { margin: 8px 0 12px; color: var(--muted); font-size: 10px; line-height: 1.45; }
#empTabSettings .employee-settings-access-card .btn-secondary { min-height: 33px; padding: 6px 10px; font-size: 11px; }
#empTabSettings .employee-danger-zone { border-color: color-mix(in srgb, var(--semantic-danger) 45%, var(--line)); background: color-mix(in srgb, var(--semantic-danger) 4%, var(--surface)); }
#empTabSettings .employee-danger-zone h3 { color: var(--semantic-danger); }
#empTabSettings .employee-danger-action { display: block; width: 100%; margin-top: 10px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--semantic-danger) 42%, var(--line)); border-radius: 7px; background: transparent; color: var(--semantic-danger); text-align: left; cursor: pointer; }
#empTabSettings .employee-danger-action:hover { background: color-mix(in srgb, var(--semantic-danger) 8%, transparent); }
#empTabSettings .employee-danger-action span,
#empTabSettings .employee-danger-action small { display: block; }
#empTabSettings .employee-danger-action span { font-size: 12px; font-weight: 650; }
#empTabSettings .employee-danger-action small { margin-top: 3px; color: var(--muted); font-size: 10px; }
@media (max-width: 1040px) { #empTabSettings .employee-settings-workspace { grid-template-columns: 1fr; } #empTabSettings .employee-settings-aside { grid-template-columns: 1fr 1fr; } #empTabSettings .employee-danger-zone { grid-column: 1 / -1; } }
@media (max-width: 760px) { #empTabSettings .employee-settings-workspace { gap: 12px; } #empTabSettings .employee-settings-card, #empTabSettings .employee-danger-zone { padding: 17px; } #empTabSettings .employee-profile-settings-grid, #empTabSettings .employee-lifecycle-card { grid-template-columns: 1fr; } #empTabSettings .employee-settings-fields-two, #empTabSettings .employee-settings-preferences-grid, #empTabSettings .employee-alerts-grid, #empTabSettings .employee-settings-aside { grid-template-columns: 1fr; } #empTabSettings .employee-lifecycle-actions { grid-template-columns: 1fr; } }
html[data-theme="light"] .workspace-plan-tabs button.active { border-color: #c5c8bf; background: var(--sidebar-active); }
html[data-theme="light"] .workspace-plan-card > button { border-color: #c8cac1; background: #eff0e9; color: var(--text); }
html[data-theme="light"] .workspace-plan-card > button:hover { border-color: #abb09f; background: #e7e9df; }
html[data-theme="light"] .workspace-plan-card li { color: #484b43; }
html[data-theme="light"] .account-menu { box-shadow: 0 22px 60px rgba(43,47,37,.16); }
html[data-theme="light"] .account-options .upgrade-option { color: #53663e; }
html[data-theme="light"] .employee-avatar.coral { background: #f0d9d2; color: #8b4938; }
html[data-theme="light"] .employee-avatar.violet { background: #e0dcf1; color: #514880; }
html[data-theme="light"] .employee-avatar.mint { background: #d7e9e0; color: #356b56; }
html[data-theme="light"] .workforce-labels { color: #777a71; }
html[data-theme="light"] .idle-status { color: #8a6a24; }
html[data-theme="light"] .app-page.sidebar-collapsed .sidebar-link::after,
html[data-theme="light"] .app-page.sidebar-collapsed .account-trigger::after { border-color: #c8cbc1; background: #fbfbf7; color: #20211e; box-shadow: 0 14px 38px rgba(35,39,30,.16); }

@media (max-width: 700px) {
  .page-header { align-items: stretch; flex-direction: column; }
  .console-hire { width: 100%; }
  .console-metrics { grid-template-columns: 1fr 1fr; }
  .workforce-labels { display: none; }
  .workforce-row { grid-template-columns: 1fr auto; }
  .workforce-row > :nth-child(2) { display: none; }
  .workforce-row > :nth-child(3) { text-align: right; }
  .workforce-row > :nth-child(4) { display: none; }
}

@media (max-width: 460px) {
  .console-metrics { grid-template-columns: 1fr; }
  .app-main { padding-inline: 14px; }
}

/* Collapsible console navigation */
.app-page,
.app-sidebar,
.sidebar-link,
.sidebar-link > span:not(.badge),
.sidebar-toggle {
  transition: grid-template-columns var(--motion-duration-slow) var(--motion-ease-enter), width var(--motion-duration-slow) var(--motion-ease-enter), padding var(--motion-duration-slow) var(--motion-ease-enter), gap var(--motion-duration-base) var(--motion-ease-standard), background var(--motion-duration-fast) var(--motion-ease-standard), color var(--motion-duration-fast) var(--motion-ease-standard), opacity 160ms ease;
}

.app-page.sidebar-collapsed {
  --app-sidebar-track: 68px;
}

.app-header .brand-arrow {
  width: auto;
  min-width: 0;
  height: 30px;
  border: 0;
  border-radius: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.06em;
}

.app-header .brand { gap: 0; }

.header-sidebar-toggle {
  display: none;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}

.header-sidebar-toggle svg { width: 18px; height: 18px; }

.app-sidebar {
  z-index: 8;
  overflow: visible;
}

.sidebar-top {
  display: flex;
  justify-content: flex-end;
  padding: 0 2px;
  margin-bottom: 14px;
}

.sidebar-toggle {
  border: 0;
  background: transparent;
}

.sidebar-toggle:hover { background: #20211e; }

.sidebar-menu li { position: relative; }

.sidebar-link > span:not(.badge) {
  overflow: hidden;
  opacity: 1;
}

.app-page.sidebar-collapsed .sidebar-top {
  justify-content: center;
}

.app-page.sidebar-collapsed .sidebar-link {
  width: 46px;
  margin-inline: auto;
  padding-inline: 14px;
  justify-content: center;
  gap: 0;
}

.app-page.sidebar-collapsed .sidebar-link > span:not(.badge) {
  width: 0;
  max-width: 0;
  opacity: 0;
}

.app-page.sidebar-collapsed .sidebar-link .badge {
  position: absolute;
  top: 4px;
  right: 3px;
  width: 7px;
  height: 7px;
  padding: 0;
  overflow: hidden;
  color: transparent;
  border: 1px solid #0d0e0c;
}

.app-page.sidebar-collapsed .sidebar-link::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 13px);
  top: 50%;
  z-index: 50;
  width: max-content;
  max-width: 180px;
  padding: 8px 10px;
  border: 1px solid #343530;
  border-radius: 8px;
  background: #1b1c19;
  color: #f3f2ec;
  box-shadow: 0 14px 38px rgba(0,0,0,.38);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(0, -50%) translateX(-6px) scale(.97);
  transform-origin: left center;
  transition: opacity 170ms ease, transform 220ms cubic-bezier(.2,.8,.2,1), visibility 170ms;
}

.app-page.sidebar-collapsed .sidebar-link:hover::after,
.app-page.sidebar-collapsed .sidebar-link:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%) translateX(0) scale(1);
}

/* Account control is the single plan entry point inside the workspace */
.sidebar-bottom { display: none; }

.sidebar-account {
  position: relative !important;
  z-index: 1000 !important;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.sidebar-account.is-open {
  z-index: 99999 !important;
}

.account-trigger {
  position: relative;
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background var(--motion-duration-fast) var(--motion-ease-standard), width var(--motion-duration-slow) var(--motion-ease-enter), padding var(--motion-duration-slow) var(--motion-ease-enter);
}

.account-trigger:hover,
.sidebar-account.is-open .account-trigger { background: #1b1c19; }

.account-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border: 1px solid #3a3b36;
  border-radius: 50%;
  background: #252621;
  color: #f3f2ec;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  overflow: hidden;
}

.account-avatar img,
.settings-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.app-page.sidebar-collapsed .account-trigger[data-plan="Free"] .account-avatar::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: 1px;
  width: 7px;
  height: 7px;
  border: 2px solid var(--sidebar-bg);
  border-radius: 50%;
  background: var(--console-accent);
}

.account-copy {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 3px;
  overflow: hidden;
  white-space: nowrap;
  transition: width var(--motion-duration-base) var(--motion-ease-standard), opacity 160ms ease;
}

.account-copy strong { font-size: 11px; font-weight: 650; }
.account-copy small { color: var(--muted); font-size: 9px; }
.account-caret { color: var(--muted); font-size: 11px; transition: transform 200ms ease; }
.sidebar-account.is-open .account-caret { transform: rotate(180deg); }

.account-menu {
  position: fixed !important;
  left: 12px !important;
  bottom: 64px !important;
  top: auto !important;
  z-index: 2147483647 !important;
  width: 330px !important;
  max-width: calc(100vw - 24px) !important;
  max-height: calc(100vh - 80px) !important;
  overflow-y: auto !important;
  padding: 14px !important;
  border: 1px solid #353630 !important;
  border-radius: 13px !important;
  background: #171815 !important;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.85) !important;
  box-sizing: border-box !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px) scale(.98);
  transform-origin: bottom left;
  transition: opacity 170ms ease, transform 220ms cubic-bezier(.2,.8,.2,1), visibility 170ms !important;
}

.account-options {
  display: grid;
  gap: 2px;
  padding-top: 9px;
}

.account-options a,
.account-options button {
  width: 100%;
  min-height: 40px;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d3d4cd;
  cursor: pointer;
  font-size: 10px;
  text-align: left;
  text-decoration: none;
  transition: color 160ms ease, background var(--motion-duration-fast) var(--motion-ease-standard), transform 180ms cubic-bezier(.2,.8,.2,1);
}

.account-options a:hover,
.account-options button:hover { color: #fff; background: #22231f;  }
.account-options small { color: #777970; font-size: 8px; }
.account-option-icon { width: 22px; height: 22px; display: grid; place-items: center; color: #a5a69f; font-size: 14px; }
.account-option-divider { height: 1px; margin: 7px 5px; background: var(--line-soft); }
.account-options .upgrade-option { color: #bec99f; }
.account-options .upgrade-option small { padding: 3px 6px; border: 1px solid #434b35; border-radius: 999px; color: var(--console-accent); }

.sidebar-account.is-open .account-menu {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(0) scale(1) !important;
  position: fixed !important;
  left: 12px !important;
  bottom: 64px !important;
  top: auto !important;
  z-index: 2147483647 !important;
  width: 330px !important;
}

.app-page.sidebar-collapsed .sidebar-account {
  overflow: visible !important;
}

.app-page.sidebar-collapsed .sidebar-account.is-open .account-menu {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(0) scale(1) !important;
  position: fixed !important;
  left: 68px !important;
  bottom: 12px !important;
  top: auto !important;
  z-index: 2147483647 !important;
  width: 330px !important;
}

.account-menu-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 3px 12px;
  border-bottom: 1px solid var(--line-soft);
}

.account-menu-head .account-avatar { width: 31px; height: 31px; flex-basis: 31px; }
.account-menu-head div { display: grid; gap: 2px; }
.account-menu-head strong { font-size: 11px; }
.account-menu-head small { color: var(--muted); font-size: 9px; }
.account-plan-list { display: grid; gap: 3px; padding: 9px 0; }

.account-plan {
  width: 100%;
  min-height: 45px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.account-plan:hover { background: #21221f;  }
.account-plan.active { border-color: rgba(201,243,107,.3); background: rgba(201,243,107,.08); }
.account-plan span { display: grid; gap: 2px; }
.account-plan strong { font-size: 10px; }
.account-plan small { color: var(--muted); font-size: 8px; }
.account-plan b { color: var(--console-accent); font-family: "IBM Plex Mono", monospace; font-size: 9px; font-weight: 600; }

.account-menu-actions {
  display: grid;
  gap: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}

.account-menu-actions a {
  padding: 8px 9px;
  border-radius: 7px;
  color: #c9cac3;
  font-size: 9px;
  text-decoration: none;
}

.account-menu-actions a:hover { background: #21221f; color: #fff; }

.app-page.sidebar-collapsed .account-trigger {
  width: 46px;
  margin-inline: auto;
  justify-content: center;
  padding-inline: 5px;
}

.app-page.sidebar-collapsed .account-menu { left: calc(100% + 12px) !important; bottom: 0 !important; z-index: 100000 !important; transform-origin: bottom left !important; }

.app-page.sidebar-collapsed .account-trigger::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 13px);
  top: 50%;
  width: max-content;
  padding: 8px 10px;
  border: 1px solid #343530;
  border-radius: 8px;
  background: #1b1c19;
  color: #f3f2ec;
  box-shadow: 0 14px 38px rgba(0,0,0,.38);
  font-size: 11px;
  font-weight: 600;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-6px, -50%) scale(.97);
  transition: opacity 170ms ease, transform 220ms cubic-bezier(.2,.8,.2,1), visibility 170ms;
}

/* Dedicated in-workspace plan explorer */
.workspace-plans-page { max-width: 1460px; }
.workspace-plans-head { max-width: 760px; margin: 0 auto 42px; text-align: center; }
.workspace-plans-head h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(38px, 4vw, 58px); font-weight: 400; letter-spacing: -.05em; }
.workspace-plans-head > p:not(.panel-kicker) { margin: 15px 0 0; color: var(--muted); font-size: 11px; }

.workspace-plan-tabs {
  width: fit-content;
  display: flex;
  gap: 4px;
  margin: 30px auto 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.workspace-plan-tabs button {
  min-height: 40px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  transition: color 170ms ease, background 200ms ease, border-color 170ms ease, transform 150ms ease;
}

.workspace-plan-tabs button:hover { color: var(--text); }
.workspace-plan-tabs button.active { border-color: #464840; background: #292a26; color: var(--text); }
.workspace-plan-tabs button:active { transform: scale(.98); }
.workspace-plan-panel { animation: plan-panel-in 300ms cubic-bezier(.2,.8,.2,1); }
.workspace-plan-panel[hidden] { display: none; }
@keyframes plan-panel-in { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }

.workspace-plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 15px; overflow: hidden; background: var(--card); }
.workspace-plan-grid.enterprise { width: min(980px, 100%); margin: 0 auto; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.workspace-plan-card { position: relative; min-width: 0; min-height: 530px; padding: 28px 25px; border-right: 1px solid var(--line); background: var(--card); font-family: "Inter", sans-serif; }
.workspace-plan-card:last-child { border-right: 0; }
.workspace-plan-card h2 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.035em; }
.workspace-plan-audience { min-height: 22px; margin: 6px 0 0; color: var(--muted); font-size: 9px; }
.workspace-plan-price { margin: 18px 0 11px; }
.workspace-plan-price strong { font-size: 28px; font-weight: 600; letter-spacing: -.04em; }
.workspace-plan-price small { margin-left: 4px; color: var(--muted); font-size: 9px; }
.workspace-plan-card > p:not(.workspace-plan-audience):not(.workspace-plan-price) { min-height: 52px; margin: 0 0 16px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.workspace-plan-card > button { width: 100%; min-height: 39px; border: 1px solid #3b3c36; border-radius: 8px; background: #22231f; color: var(--text); cursor: pointer; font-size: 10px; font-weight: 650; transition: transform 170ms ease, background 170ms ease, border-color 170ms ease; }
.workspace-plan-card > button:hover { transform: translateY(-1px); background: #2b2c27; border-color: #5b5d54; }
.workspace-plan-card > button.selected { border-color: #66704f; color: var(--console-accent); }
.workspace-plan-card ul { display: grid; gap: 13px; margin: 21px 0 0; padding: 20px 0 0; border-top: 1px solid var(--line-soft); list-style: none; }
.workspace-plan-card li { position: relative; padding-left: 18px; color: #c4c5bd; font-size: 10px; }
.workspace-plan-card li::before { content: "✓"; position: absolute; left: 0; color: var(--console-accent); font-weight: 700; }
.workspace-plan-label { position: absolute; top: 16px; right: 16px; padding: 4px 7px; border: 1px solid #414735; border-radius: 999px; color: var(--console-accent); font-size: 7px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

.plan-sigil {
  width: 104px;
  height: 74px;
  margin-bottom: 26px;
  display: grid;
  align-content: center;
  justify-items: start;
  color: var(--console-accent);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-weight: 700;
  letter-spacing: -.08em;
  line-height: 1;
  opacity: .82;
}
.plan-sigil span { display: block; white-space: pre; }
.plan-sigil.tier-start span { font-size: 27px; }
.plan-sigil.tier-plus span { font-size: 23px; }
.plan-sigil.tier-pro { gap: 2px; font-size: 15px; }
.plan-sigil.tier-pro .branch { margin-left: 29px; }
.plan-sigil.tier-max { width: 126px; gap: 0; font-size: 13px; }
.plan-sigil.tier-max .branch { margin-left: 35px; }
.plan-sigil.tier-max .two,
.plan-sigil.tier-max .three { margin-left: 21px; }
.plan-sigil.tier-enterprise { width: 112px; }
.plan-sigil.tier-enterprise svg { width: 104px; height: 70px; overflow: visible; }
.plan-sigil.tier-enterprise path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.workspace-plan-visual { position: relative; width: 68px; height: 66px; margin-bottom: 25px; }
.workspace-plan-visual span { position: absolute; left: 33px; bottom: 4px; width: 1px; height: 50px; background: #a7a9a0; }
.workspace-plan-visual i { position: absolute; width: 10px; height: 10px; border: 1px solid #a7a9a0; border-radius: 50%; }
.workspace-plan-visual i:nth-of-type(1) { left: 28px; top: 0; }
.workspace-plan-visual i:nth-of-type(2) { left: 10px; top: 23px; }
.workspace-plan-visual i:nth-of-type(3) { right: 9px; top: 23px; }
.workspace-plan-visual i:nth-of-type(4) { left: 18px; top: 39px; }
.workspace-plan-visual i:nth-of-type(5) { right: 17px; top: 39px; }
.workspace-plan-visual::before,
.workspace-plan-visual::after { content: ""; position: absolute; top: 29px; width: 25px; height: 1px; background: #a7a9a0; }
.workspace-plan-visual::before { left: 14px; transform: rotate(28deg); }
.workspace-plan-visual::after { right: 13px; transform: rotate(-28deg); }
.workspace-plan-visual.building span { left: 11px; right: 11px; bottom: 7px; width: auto; height: 43px; border: 1px solid #a7a9a0; background: transparent; }
.workspace-plan-visual.building::before { left: 20px; top: 7px; width: 28px; height: 12px; border: 1px solid #a7a9a0; background: transparent; transform: none; }
.workspace-plan-visual.building::after { left: 24px; right: auto; top: 29px; width: 20px; height: 1px; transform: none; }
.workspace-plan-visual.building i { display: none; }

.metric-card,
.console-panel,
.activity-section { transition: border-color var(--motion-duration-fast) var(--motion-ease-standard), background var(--motion-duration-fast) var(--motion-ease-standard), transform 200ms cubic-bezier(.2,.8,.2,1); }
.metric-card:hover,
.console-panel:hover { border-color: #414438; background: color-mix(in srgb, var(--console-accent-soft) 12%, var(--card)); }
.cta:active,
.sidebar-link:active,
.account-trigger:active { transform: scale(.985); }

.app-page.sidebar-collapsed .account-trigger:hover::after,
.app-page.sidebar-collapsed .account-trigger:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%) scale(1);
}

/* Pricing comparison */
.pricing-console {
  padding-top: 28px;
  scroll-margin-top: 28px;
}

.pricing-console-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 20px;
}

.pricing-console-head h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 2.3vw, 38px);
  font-weight: 400;
  letter-spacing: -.035em;
}

.pricing-console-head p:not(.panel-kicker) {
  max-width: 690px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.pricing-console-head > span {
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  white-space: nowrap;
}

.pricing-console-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
}

.console-plan {
  position: relative;
  min-width: 0;
  min-height: 465px;
  padding: 22px 18px 24px;
  border-right: 1px solid var(--line);
  background: var(--card);
}

.console-plan:last-child { border-right: 0; }

.console-plan.recommended {
  background: color-mix(in srgb, var(--console-accent-soft) 34%, var(--card));
  box-shadow: inset 0 2px var(--console-accent);
}

.recommended-label {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--console-accent-soft);
  color: var(--console-accent);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.plan-top p {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
}

.plan-top span {
  display: block;
  min-height: 30px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.plan-price {
  margin: 17px 0 10px;
}

.plan-price strong {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -.04em;
}

.plan-price small {
  margin-left: 4px;
  color: var(--muted);
  font-size: 9px;
}

.plan-description {
  min-height: 65px;
  margin: 0 0 17px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.plan-action {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #20211e;
  color: var(--text);
  cursor: pointer;
  font-size: 10px;
  font-weight: 650;
  transition: background 170ms ease, border-color 170ms ease, color 170ms ease, transform 170ms ease;
}

.plan-action:hover {
  border-color: #555750;
  background: #292a27;
  transform: translateY(-1px);
}

.plan-action.primary {
  border-color: var(--console-accent);
  background: var(--console-accent);
  color: #172000;
}

.plan-action.is-selected {
  border-color: var(--console-accent);
  color: var(--console-accent);
}

.console-plan ul {
  display: grid;
  gap: 12px;
  margin: 19px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--line-soft);
  list-style: none;
}

.console-plan li {
  position: relative;
  padding-left: 17px;
  color: #c6c7bf;
  font-size: 10px;
  line-height: 1.4;
}

.console-plan li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--console-accent);
  font-size: 11px;
  font-weight: 700;
}

@media (max-width: 1280px) {
  .pricing-console-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 0;
    gap: 12px;
    background: transparent;
  }

  .console-plan {
    min-height: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
  }
}

@media (max-width: 1160px) {
  .workspace-plan-grid { grid-template-columns: 1fr; gap: 12px; border: 0; background: transparent; }
  .workspace-plan-grid.enterprise { grid-template-columns: 1fr; }
  .workspace-plan-card { min-height: 0; border: 1px solid var(--line); border-radius: 12px; }
}

@media (max-width: 1000px) {
  .header-sidebar-toggle { display: grid; }
  .app-page.sidebar-collapsed { grid-template-columns: 1fr; }
  .app-main { grid-column: 1; grid-row: 2; }
  .app-sidebar {
    display: flex;
    position: fixed;
    top: 70px;
    bottom: 0;
    left: 0;
    right: auto;
    width: 272px;
    max-height: none;
    padding: 18px 10px 16px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    transform: translateX(-102%);
    transition: transform var(--motion-duration-base) var(--motion-ease-enter);
  }

  .app-page.sidebar-open .app-sidebar { transform: translateX(0); }
  .sidebar-top { display: none; }
  .app-page.sidebar-collapsed .sidebar-link {
    width: auto;
    margin-inline: 0;
    padding: 10px 12px;
    justify-content: flex-start;
    gap: 12px;
  }
  .app-page.sidebar-collapsed .sidebar-link > span:not(.badge) {
    width: auto;
    max-width: none;
    opacity: 1;
  }
  .app-page.sidebar-collapsed .sidebar-link::after { display: none; }
  .app-page.sidebar-collapsed .sidebar-link .badge {
    position: static;
    width: 20px;
    height: 20px;
    color: #fff;
    border: 0;
  }
  .sidebar-account { margin-top: auto; }
  .app-page.sidebar-collapsed .account-trigger { width: 100%; margin: 0; justify-content: flex-start; padding: 7px 8px; }
  .app-page.sidebar-collapsed .account-copy { width: auto; opacity: 1; }
  .app-page.sidebar-collapsed .account-caret { width: auto; opacity: 1; }
  .app-page.sidebar-collapsed .account-trigger::after { display: none; }
  .app-page.sidebar-collapsed .account-menu { left: 4px; bottom: calc(100% + 12px); }
}

@media (max-width: 680px) {
  .pricing-console-head { align-items: flex-start; flex-direction: column; }
  .pricing-console-grid { grid-template-columns: 1fr; }
  .workspace-plan-tabs { width: 100%; }
  .workspace-plan-tabs button { flex: 1; padding-inline: 8px; }
}

/* Dense, touch-friendly settings surfaces. The control rail stays visible
   while the selected article scrolls beneath it. */
#page-settings .settings-tabs {
  position: sticky;
  top: 0;
  z-index: 12;
  width: 100%;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0 12px;
  border-bottom: 0;
  background: var(--bg);
}
#page-settings .settings-tab,
#page-settings .settings-docs-link {
  flex: 1 1 0;
  width: auto;
  min-width: 34px;
  max-width: 42px;
  height: 38px;
  min-height: 38px;
}
#page-settings .settings-content { max-width: 880px; padding: 24px 0 42px; }
#page-settings .settings-panel-head { padding-bottom: 16px; }
#page-settings .settings-panel-head h2 { font-size: clamp(25px, 2.3vw, 31px); }
#page-settings .settings-avatar { width: 50px; height: 50px; }
#page-settings .settings-form { gap: 15px; max-width: 680px; }
#page-settings .settings-form input { min-height: 42px; }
#page-settings .settings-form-actions { justify-content: flex-start; gap: 8px; }
#page-settings .settings-save,
#page-settings .settings-secondary-action,
#page-settings .security-row button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  font: 600 11px/1 var(--font-sans, sans-serif);
}
#page-settings .settings-save { border-color: var(--console-accent); color: var(--console-accent); }
#page-settings .settings-save:hover,
#page-settings .settings-save:focus-visible { color: var(--bg); background: var(--console-accent); outline: 0; }
#page-settings .settings-secondary-action:hover,
#page-settings .settings-secondary-action:focus-visible,
#page-settings .security-row button:hover,
#page-settings .security-row button:focus-visible { border-color: var(--console-accent); color: var(--text); background: var(--sidebar-hover); outline: 0; }

/* Appearance is a three-mode choice, never three full-width cards. */
#page-settings .theme-settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 620px; gap: 8px; padding-top: 16px; }
#page-settings .theme-settings-grid button { min-width: 0; gap: 5px; min-height: 114px; padding: 10px; border-radius: 10px; }
#page-settings .theme-settings-grid .theme-preview { height: 48px; }
#page-settings .theme-settings-grid small { font-size: 9px; }

/* iPhone-like switches: visual state is contained in the control, while the
   explanatory copy remains readable in the row. */
#page-settings .settings-toggle-list { max-width: 760px; padding-top: 0; }
#page-settings .settings-toggle-list label { min-height: 72px; gap: 16px; padding: 13px 0; }
#page-settings .settings-toggle-list input[role="switch"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: 0 0 42px;
  width: 42px;
  height: 25px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  cursor: pointer;
  transition: background-color 180ms ease;
}
#page-settings .settings-toggle-list input[role="switch"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .24);
  transition: transform 180ms cubic-bezier(.2,.8,.2,1);
}
#page-settings .settings-toggle-list input[role="switch"]:checked { background: var(--console-accent); }
#page-settings .settings-toggle-list input[role="switch"]:checked::after { transform: translateX(17px); }
#page-settings .settings-toggle-list input[role="switch"]:focus-visible { outline: 2px solid var(--console-accent); outline-offset: 3px; }
#page-settings .security-row { max-width: 760px; min-height: 80px; padding: 15px 0; }
#page-settings .security-row button { flex: 0 0 auto; }

@media (max-width: 680px) {
  #page-settings .settings-tabs {
    top: 0;
    width: calc(100% + (var(--mobile-gutter) * 2));
    margin: -24px calc(var(--mobile-gutter) * -1) 0;
    padding: 10px var(--mobile-gutter) 12px !important;
    gap: 6px;
    overflow: visible !important;
  }
  #page-settings .settings-tab,
  #page-settings .settings-docs-link { flex: 1 1 0; width: auto; min-width: 30px; max-width: 38px; height: 36px; min-height: 36px; }
  #page-settings .settings-content { padding: 22px 0 92px !important; }
  #page-settings .theme-settings-grid { gap: 6px; }
  #page-settings .theme-settings-grid button { min-height: 94px; padding: 8px; }
  #page-settings .theme-settings-grid small { display: none; }
  #page-settings .theme-settings-grid .theme-preview { height: 38px; }
  #page-settings .settings-toggle-list label { min-height: 68px; }
  #page-settings .security-row { align-items: flex-start; min-height: 88px; gap: 12px; }
  #page-settings .security-row button { min-height: 34px; padding-inline: 10px; font-size: 10px; }
}

/* Refined workspace shell */
.app-page.sidebar-collapsed { --app-sidebar-track: 68px; }
.sidebar-toggle:hover,
.account-trigger:hover,
.sidebar-account.is-open .account-trigger { background: var(--sidebar-hover); }

.sidebar-workspace-selector {
  position: relative;
  width: 100%;
  margin: 0 0 16px;
}

.sidebar-workspace-selector .workspace-btn {
  width: 100%;
  min-height: 43px;
  padding: 6px 8px;
  border-color: var(--line);
  background: color-mix(in srgb, var(--card) 84%, transparent);
}

.sidebar-workspace-selector .workspace-menu {
  top: calc(100% + 8px);
  right: auto;
  left: 0;
  width: min(276px, calc(100vw - 28px));
  background: var(--popover-bg);
}

.app-page.sidebar-collapsed .sidebar-workspace-selector .workspace-btn,
.app-page.sidebar-collapsed .sidebar-link,
.app-page.sidebar-collapsed .account-trigger {
  width: 42px;
}

.app-page.sidebar-collapsed .sidebar-workspace-selector .workspace-btn {
  margin-inline: auto;
  padding: 6px;
  justify-content: center;
}

.app-page.sidebar-collapsed .sidebar-workspace-selector .ws-name,
.app-page.sidebar-collapsed .sidebar-workspace-selector .ws-caret {
  width: 0;
  max-width: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
}

.app-page.sidebar-collapsed .sidebar-link { padding-inline: 12px; }
.app-page.sidebar-collapsed .account-trigger { padding-inline: 3px; }

.account-menu {
  background: var(--popover-bg);
  border-color: var(--line);
}

.account-menu-head strong { font-size: 13px; }
.account-menu-head small { font-size: 11px; }
.account-options a,
.account-options button { min-height: 44px; color: var(--text); font-size: 12px; }
.account-options small { font-size: 10px; }
.account-options a:hover,
.account-options button:hover { color: var(--text); background: var(--sidebar-hover); }

html[data-theme="light"] .account-avatar {
  border-color: #c9cbc2;
  background: #dfe1d8;
  color: #282a25;
}

html[data-theme="light"] .app-page.sidebar-collapsed .sidebar-link .badge { border-color: var(--sidebar-bg); }

/* Tensor OS keeps a quiet, single-purpose edge control while closed. The
   working surface opens only on request; its New and History actions belong
   with the conversation rather than in a permanent secondary toolbar. */
@media (min-width: 1001px) {
  .app-page,
  .app-page.sidebar-collapsed { --ai-sidebar-track: 48px; }
  .app-page.copilot-open,
  body.copilot-open { --ai-sidebar-track: var(--ai-sidebar-size); }
  .copilot-drawer { background: transparent !important; }
  .copilot-panel-content { inset: 0 48px 0 0 !important; }
  .copilot-control-rail { top: 16px; right: 8px; gap: 0; }
  .copilot-control-rail button {
    width: 32px !important;
    height: 32px !important;
    border: 0 !important;
    border-radius: 50% !important;
    color: var(--muted) !important;
    background: transparent !important;
  }
  .copilot-control-rail button:hover,
  .copilot-control-rail button:focus-visible { color: var(--text) !important; background: var(--sidebar-hover) !important; }
}

.copilot-header { position: relative; }
.copilot-header-actions { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.copilot-header-icon {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font: 400 21px/1 var(--font-sans, sans-serif);
  transition: color var(--motion-duration-fast) var(--motion-ease-standard), background-color var(--motion-duration-fast) var(--motion-ease-standard), transform var(--motion-duration-fast) var(--motion-ease-standard);
}
.copilot-header-icon svg { width: 15px; height: 15px; padding: 0 !important; }
.copilot-header-icon:hover,
.copilot-header-icon:focus-visible,
.copilot-header-icon[aria-expanded="true"] { color: var(--text); background: var(--sidebar-hover); outline: 0; }
.copilot-header-icon:active { transform: scale(.94); }

/* Settings navigation becomes a compact icon rail. Tooltips/ARIA retain each
   label while making all sections immediately visible in one horizontal row. */
#page-settings .settings-console { display: block; min-height: 0; }
#page-settings .settings-tabs {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  padding: 8px 0 12px;
  overflow-x: auto;
  border-right: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  scrollbar-width: none;
}
#page-settings .settings-tabs::-webkit-scrollbar { display: none; }
#page-settings .settings-tab,
#page-settings .settings-docs-link {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
}
#page-settings .settings-tab span,
#page-settings .settings-tab small,
#page-settings .settings-docs-link span { display: none; }
#page-settings .settings-tab svg,
#page-settings .settings-docs-link svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#page-settings .settings-tab:hover,
#page-settings .settings-tab:focus-visible,
#page-settings .settings-docs-link:hover,
#page-settings .settings-docs-link:focus-visible { color: var(--text); background: var(--sidebar-hover); outline: 0; }
#page-settings .settings-tab.active { color: var(--console-accent); border-color: color-mix(in srgb, var(--console-accent) 48%, var(--line)); background: transparent; }

@media (max-width: 680px) {
  .copilot-header { padding-right: 82px !important; }
  .copilot-header-actions { position: absolute; top: max(15px, env(safe-area-inset-top)); right: 58px; }
  .copilot-header-icon { width: 28px; height: 28px; }
  .copilot-history-top { position: static; min-height: 28px; padding: 0; background: transparent; }
  #page-settings .settings-tabs { gap: 7px; padding-block: 8px 11px !important; }
  #page-settings .settings-tab,
  #page-settings .settings-docs-link { flex-basis: 34px; width: 34px; min-width: 34px; height: 34px; min-height: 34px; }
}

/* Settings console */
.settings-console {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.settings-tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 12px;
  border-right: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--sidebar-bg) 72%, var(--card));
}

.settings-tab {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: background var(--motion-duration-fast) var(--motion-ease-standard), color var(--motion-duration-fast) var(--motion-ease-standard), transform 180ms cubic-bezier(.2,.8,.2,1);
}

.settings-tab span { font-size: 13px; font-weight: 650; }
.settings-tab small { font-size: 10px; }
.settings-tab:hover { background: var(--sidebar-hover); color: var(--text);  }
.settings-tab.active { background: var(--sidebar-active); color: var(--text); }

.settings-content { min-width: 0; padding: 30px; }
.settings-panel { display: none; max-width: 780px; margin: 0; border: 0; background: transparent; }
.settings-panel.active { display: block; animation: settings-in var(--motion-duration-base) var(--motion-ease-enter); }
@keyframes settings-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.settings-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line-soft);
}
.settings-panel-head h2 { margin: 0 0 6px; font-family: Georgia, "Times New Roman", serif; font-size: 27px; font-weight: 400; }
.settings-panel-head p { margin: 0; color: var(--muted); font-size: 12px; }
.settings-avatar { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--sidebar-active); font-family: Georgia, serif; }

/* The avatar remains in the profile heading. Clicking it opens the platform's
   own image picker, so no separate editing mark or intermediate menu is needed. */
.settings-profile-avatar {
  position: relative;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--sidebar-active);
  color: var(--text);
  font-family: Georgia, serif;
  font-size: 18px;
  cursor: pointer;
}
.settings-profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.settings-profile-avatar:hover,
.settings-profile-avatar:focus-visible { border-color: var(--console-accent); outline: 0; }
.settings-profile-photo-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.settings-form { display: grid; gap: 18px; padding-top: 24px; }
.settings-form label { display: grid; gap: 8px; color: var(--text); font-size: 12px; font-weight: 600; }
.settings-form input,
.settings-form select { width: 100%; min-height: 44px; padding: 0 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); outline: 0; }
.settings-form input:focus,
.settings-form select:focus { border-color: var(--console-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--console-accent) 14%, transparent); }
.settings-form-actions { display: flex; justify-content: flex-end; }
.settings-save,
.security-row button { min-height: 38px; padding: 0 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--text); color: var(--bg); cursor: pointer; font-weight: 650; transition: transform 160ms ease, opacity 160ms ease; }
.settings-save:hover,
.security-row button:hover { transform: translateY(-1px); opacity: .9; }

.theme-settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding-top: 24px; }
.theme-settings-grid button { display: grid; gap: 7px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--text); cursor: pointer; text-align: left; }
.theme-settings-grid button.active { border-color: var(--console-accent); background: var(--console-accent-soft); }
.theme-settings-grid strong { font-size: 12px; }
.theme-settings-grid small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.theme-preview { height: 74px; border: 1px solid var(--line); border-radius: 7px; background: #f1f1ec; box-shadow: inset 18px 0 #dedfd7; }
.theme-preview.dark { background: #151614; box-shadow: inset 18px 0 #090a09; }
.theme-preview.auto { background: linear-gradient(110deg, #f1f1ec 0 49%, #151614 50%); box-shadow: none; }

.settings-toggle-list { display: grid; padding-top: 10px; }
.settings-toggle-list label,
.security-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 84px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.settings-toggle-list label span { display: grid; gap: 5px; }
.settings-toggle-list strong,
.security-row strong { font-size: 13px; }
.settings-toggle-list small,
.security-row p { margin: 0; color: var(--muted); font-size: 10px; }
.settings-toggle-list input { width: 38px; height: 20px; accent-color: var(--console-accent); }

/* Approvals with clear context and restrained feedback */
.approvals-list { flex-direction: column; gap: 12px; }
.approval-card { padding: 20px; border: 1px solid var(--line); }
.approval-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.approval-identity { display: flex; align-items: center; gap: 12px; }
.approval-icon { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--console-accent-soft); color: var(--console-accent); }
.approval-title { margin: 0 0 4px; color: var(--text); font-size: 14px; font-weight: 650; }
.approval-meta { margin: 0; color: var(--muted); font-size: 10px; }
.approval-risk { padding: 4px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 8px; text-transform: uppercase; }
.approval-reason { margin: 16px 0; padding: 13px 14px; border-left: 2px solid var(--console-accent); background: color-mix(in srgb, var(--console-accent-soft) 55%, transparent); color: var(--muted); font-size: 11px; line-height: 1.55; }
.approval-actions { display: flex; justify-content: flex-end; gap: 8px; }
.approval-actions .cta { min-width: 92px; }

.app-toast { position: fixed; right: 22px; bottom: 22px; z-index: 200; padding: 11px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--popover-bg); color: var(--text); box-shadow: 0 18px 50px rgba(0,0,0,.28); font-size: 11px; opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity var(--motion-duration-fast) var(--motion-ease-standard), transform 220ms cubic-bezier(.2,.8,.2,1), visibility 180ms; }
.app-toast.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.app-toast.success { border-color: color-mix(in srgb, var(--console-accent) 52%, var(--line)); }

.workspace-plan-label.power { border-color: #596347; background: var(--console-accent-soft); }
.workspace-plan-visual.max { width: 86px; height: 76px; }
.workspace-plan-visual.max span { left: 42px; height: 59px; }
.workspace-plan-visual.max i:nth-of-type(1) { left: 37px; }
.workspace-plan-visual.max i:nth-of-type(2) { left: 10px; }
.workspace-plan-visual.max i:nth-of-type(3) { right: 9px; }
.workspace-plan-visual.max i:nth-of-type(4) { left: 20px; top: 42px; }
.workspace-plan-visual.max i:nth-of-type(5) { right: 19px; top: 42px; }
.workspace-plan-visual.max i:nth-of-type(6) { left: 3px; top: 54px; }
.workspace-plan-visual.max i:nth-of-type(7) { right: 2px; top: 54px; }
.workspace-plan-visual.max::before { left: 19px; width: 30px; }
.workspace-plan-visual.max::after { right: 18px; width: 30px; }

@media (max-width: 760px) {
  .settings-console { grid-template-columns: 1fr; }
  .settings-tabs { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .settings-tab { min-width: 130px; }
  .settings-content { padding: 22px 18px; }
  .theme-settings-grid { grid-template-columns: 1fr; }
  .settings-profile-avatar { width: 50px; height: 50px; }
}

/* Employee knowledge and connections are working surfaces, not generic settings
   panels. Source management stays factual on the left; a separately framed,
   runtime-gated preview stays on the right. */
#empTabKnowledge .knowledge-split-layout {
  align-items: stretch;
  gap: 20px;
}
#empTabKnowledge .knowledge-config-pane > .emp-card-section,
#empTabKnowledge .knowledge-test-pane,
#empTabTelegram .telegram-manage-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: none;
}
#empTabKnowledge .knowledge-config-pane > .emp-card-section {
  padding: 24px 26px;
}
#empTabKnowledge .section-title-group h3,
#empTabKnowledge .knowledge-preview-header h3,
#empTabTelegram .employee-panel-title h2 {
  margin: 0;
  color: var(--text);
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -.02em;
}
#empTabKnowledge .section-title-group .form-hint,
#empTabTelegram .employee-panel-title .form-hint {
  margin: 5px 0 20px;
  color: var(--muted);
  font-size: 13px;
}
#empTabKnowledge .knowledge-dropzone.polished-dropzone {
  min-height: 166px;
  border: 1px dashed color-mix(in srgb, var(--semantic-success) 74%, var(--line)) !important;
  border-radius: 9px;
  background: color-mix(in srgb, var(--semantic-success) 4%, var(--surface)) !important;
  padding: 28px 20px !important;
}
#empTabKnowledge .knowledge-dropzone.polished-dropzone:hover,
#empTabKnowledge .knowledge-dropzone.polished-dropzone.dragover {
  border-color: var(--semantic-success) !important;
  background: color-mix(in srgb, var(--semantic-success) 8%, var(--surface)) !important;
}
#empTabKnowledge .knowledge-dropzone .dz-text { color: var(--text) !important; font-size: 14px; }
#empTabKnowledge .knowledge-dropzone .dz-sub { color: var(--muted) !important; }
#empTabKnowledge .knowledge-sources-stack { margin-top: 12px; }
#empTabKnowledge .knowledge-source-item {
  min-height: 64px;
  margin: 9px 0 0;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
}
#empTabKnowledge .knowledge-source-item .source-icon { filter: grayscale(.2); }
#empTabKnowledge .knowledge-source-item strong { color: var(--text); font-size: 13px; }
#empTabKnowledge .knowledge-source-status { color: var(--semantic-success); }
#empTabKnowledge .knowledge-source-status::before { color: var(--semantic-success); }
#empTabKnowledge .knowledge-direct-notes {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
#empTabKnowledge .knowledge-subsection-heading h4 { margin: 0; color: var(--text); font-size: 15px; }
#empTabKnowledge .knowledge-subsection-heading p { margin: 4px 0 12px; color: var(--muted); font-size: 12px; }
#empTabKnowledge .knowledge-textarea-full {
  min-height: 108px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  font: 500 13px/1.5 var(--font-sans);
}
#empTabKnowledge .knowledge-note-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
}
#empTabKnowledge .knowledge-note-actions .btn-secondary { min-height: 30px; padding: 5px 11px; }
#empTabKnowledge .knowledge-test-pane {
  height: auto !important;
  min-height: 560px !important;
  max-height: none;
  overflow: hidden;
}
#empTabKnowledge .knowledge-preview-header {
  display: flex;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px;
  min-height: 80px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line) !important;
  background: transparent !important;
}
#empTabKnowledge .knowledge-preview-header .test-runtime-status { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
#empTabKnowledge .knowledge-info-mark {
  display: inline-grid;
  width: 15px;
  height: 15px;
  margin-left: 5px;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: var(--muted);
  font: 700 10px/13px var(--font-sans);
  text-align: center;
  vertical-align: 2px;
}
#empTabKnowledge .btn-chat-simulate {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 13px;
  border: 1px solid color-mix(in srgb, var(--semantic-success) 38%, var(--line));
  border-radius: 7px;
  background: color-mix(in srgb, var(--semantic-success) 8%, var(--surface));
  color: var(--semantic-success);
}
#empTabKnowledge .test-conversation-area {
  min-height: 230px;
  padding: 22px 26px !important;
  background: transparent !important;
}
#empTabKnowledge .test-chat-empty-state {
  width: min(330px, 100%);
  margin: auto;
  color: var(--muted);
  text-align: center;
  align-items: center;
  gap: 8px;
}
#empTabKnowledge .test-chat-empty-state svg {
  width: 42px;
  height: 42px;
  margin-bottom: 9px;
  fill: none;
  stroke: var(--semantic-inactive);
  stroke-width: 1.25;
}
#empTabKnowledge .test-chat-empty-state h4 { margin: 0; color: var(--text); font-size: 14px; font-weight: 600; }
#empTabKnowledge .test-chat-empty-state p { margin: 0; font-size: 12px; line-height: 1.55; }
#empTabKnowledge .knowledge-preview-suggestions { padding: 0 24px 16px; }
#empTabKnowledge .knowledge-preview-suggestions > span { display: block; margin-bottom: 9px; color: var(--muted); font-size: 12px; }
#empTabKnowledge .knowledge-preview-suggestions > div { display: flex; flex-wrap: wrap; gap: 8px; }
#empTabKnowledge .knowledge-sample-prompt {
  min-height: 32px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: 500 12px var(--font-sans);
  cursor: pointer;
}
#empTabKnowledge .knowledge-sample-prompt:hover:not(:disabled) { border-color: var(--semantic-data); color: var(--semantic-data); }
#empTabKnowledge .knowledge-sample-prompt:disabled { cursor: not-allowed; opacity: .56; }
#empTabKnowledge .test-composer { padding: 14px 24px 22px !important; background: transparent !important; }
#empTabKnowledge .composer-content {
  padding: 8px 10px 8px 14px;
  border: 1px solid var(--line) !important;
  border-radius: 8px;
  background: transparent !important;
}

/* A connection exposes its confirmed state and only its confirmed state. */
#empTabTelegram .telegram-manage-card { max-width: none; padding: 26px 28px; }
#empTabTelegram .employee-panel-title { margin-bottom: 22px; }
#empTabTelegram .tg-status-banner {
  padding: 16px 0;
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
#empTabTelegram .tg-logo-md { width: 48px; height: 48px; }
#empTabTelegram .tg-banner-left { gap: 15px; }
#empTabTelegram .tg-banner-left h3 { color: var(--text); font-size: 18px; }
#empTabTelegram .tg-handle-sub { color: var(--semantic-telegram); font-size: 13px; }
#empTabTelegram .tg-settings-info { gap: 0; margin-top: 2px; }
#empTabTelegram .tg-settings-info .info-row {
  min-height: 42px;
  padding: 10px 0;
  justify-content: flex-start;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
#empTabTelegram .tg-settings-info .info-label { width: min(32%, 250px); color: var(--muted); }
#empTabTelegram .tg-settings-info .info-val { color: var(--text); }
#empTabTelegram .telegram-setup-notice {
  margin: 18px 0 0;
  padding: 14px 16px 14px 18px;
  border-left: 3px solid var(--semantic-warning);
  border-radius: 6px;
  background: color-mix(in srgb, var(--semantic-warning) 8%, transparent);
  color: var(--semantic-warning);
  font-size: 13px;
  font-weight: 600;
}
#empTabTelegram .telegram-management-actions { margin-top: 18px; }
#empTabTelegram .telegram-management-actions .cta-primary { background: var(--console-accent); border-color: var(--console-accent); }

@media (max-width: 760px) {
  #empTabKnowledge .knowledge-config-pane > .emp-card-section,
  #empTabTelegram .telegram-manage-card { padding: 18px; }
  #empTabKnowledge .knowledge-preview-header,
  #empTabKnowledge .test-conversation-area { padding-inline: 18px; }
  #empTabKnowledge .knowledge-preview-suggestions,
  #empTabKnowledge .test-composer { padding-inline: 18px !important; }
  #empTabTelegram .tg-settings-info .info-row { gap: 12px; }
  #empTabTelegram .tg-settings-info .info-label { width: 42%; }
}

@media (max-width: 1000px) {
  .app-page.sidebar-collapsed { grid-template-columns: 1fr; }
  .app-page.sidebar-collapsed .sidebar-workspace-selector .workspace-btn,
  .app-page.sidebar-collapsed .sidebar-link,
  .app-page.sidebar-collapsed .account-trigger { width: 100%; }
  .app-page.sidebar-collapsed .sidebar-workspace-selector .workspace-btn { justify-content: flex-start; padding: 6px 8px; }
  .app-page.sidebar-collapsed .sidebar-workspace-selector .ws-name,
  .app-page.sidebar-collapsed .sidebar-workspace-selector .ws-caret { width: auto; max-width: none; opacity: 1; }
}

/* Final shell polish: keep these overrides last so both themes match */
.workspace-plan-grid { border-radius: 16px; }
.workspace-plan-card { min-height: 500px; padding: 30px 22px; }
.workspace-plan-card h2 { font-size: 25px; }
.workspace-plan-audience { min-height: 31px; margin-top: 7px; font-size: 11px; }
.workspace-plan-price { margin: 22px 0 12px; }
.workspace-plan-price strong { font-size: 31px; }
.workspace-plan-price small { font-size: 10px; }
.workspace-plan-card > p:not(.workspace-plan-audience):not(.workspace-plan-price) { min-height: 74px; margin-bottom: 18px; font-size: 11px; line-height: 1.6; }
.workspace-plan-card > button { min-height: 42px; border-radius: 9px; font-size: 11px; }
.workspace-plan-card ul { gap: 13px; margin-top: 23px; padding-top: 21px; }
.workspace-plan-card li { padding-left: 20px; color: #d0d1ca; font-size: 10px; line-height: 1.45; }
.workspace-plan-label { top: 17px; right: 16px; padding: 5px 8px; font-size: 8px; }

.sidebar-link { gap: 12px; }
.app-page.sidebar-collapsed .sidebar-link { padding-inline: 11px; }
.sidebar-account { padding-inline: 0; }
.account-trigger { min-height: 52px; }
.account-option-icon { width: 24px; height: 24px; color: var(--muted); font-size: 0; }
.account-option-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.account-options a,
.account-options button { grid-template-columns: 24px minmax(0, 1fr) auto; gap: 11px; padding-inline: 10px; }
.account-menu { width: 320px; padding: 14px; }
.account-menu-head { gap: 12px; padding: 3px 5px 14px; }
.account-menu-head .account-avatar { width: 36px; height: 36px; flex-basis: 36px; }
.account-menu-head strong { font-size: 14px; }
.account-menu-head small { font-size: 11px; }
.sidebar-link .badge { min-width: 18px; height: 18px; padding: 0 5px; border: 1px solid color-mix(in srgb, var(--console-accent) 35%, var(--line)); background: var(--console-accent-soft); color: var(--console-accent); box-shadow: none; font-size: 9px; }

html[data-theme="light"] .app-header,
html[data-theme="light"] .app-main { background: var(--bg); }
html[data-theme="light"] .app-sidebar { box-shadow: inset -1px 0 var(--line); }
html[data-theme="light"] .stat-card,
html[data-theme="light"] .console-panel,
html[data-theme="light"] .activity-section,
html[data-theme="light"] .workspace-plan-card { box-shadow: 0 1px 0 rgba(24,26,21,.025); }
html[data-theme="light"] .stat-card:hover,
html[data-theme="light"] .console-panel:hover { border-color: #b7bbaf; }
html[data-theme="light"] .queue-item:hover { background: var(--sidebar-hover); }
html[data-theme="light"] .queue-count { background: #efe5cd; color: #795d26; }
html[data-theme="light"] .workspace-plan-tabs button.active { border-color: #c5c8bf; background: var(--sidebar-active); }
html[data-theme="light"] .workspace-plan-card > button { border-color: #c8cac1; background: #eff0e9; color: var(--text); }
html[data-theme="light"] .workspace-plan-card > button:hover { border-color: #abb09f; background: #e7e9df; }
html[data-theme="light"] .workspace-plan-card li { color: #484b43; }
html[data-theme="light"] .account-menu { box-shadow: 0 22px 60px rgba(43,47,37,.16); }
html[data-theme="light"] .account-options .upgrade-option { color: #53663e; }
html[data-theme="light"] .employee-avatar.coral { background: #f0d9d2; color: #8b4938; }
html[data-theme="light"] .employee-avatar.violet { background: #e0dcf1; color: #514880; }
html[data-theme="light"] .employee-avatar.mint { background: #d7e9e0; color: #356b56; }
html[data-theme="light"] .workforce-labels { color: #777a71; }
html[data-theme="light"] .idle-status { color: #8a6a24; }
html[data-theme="light"] .app-page.sidebar-collapsed .sidebar-link::after,
html[data-theme="light"] .app-page.sidebar-collapsed .account-trigger::after { border-color: #c8cbc1; background: #fbfbf7; color: #20211e; box-shadow: 0 14px 38px rgba(35,39,30,.16); }

@media (max-width: 1000px) {
  .app-page.sidebar-collapsed .sidebar-link { width: auto; padding: 10px 12px; }
  .app-page.sidebar-collapsed .account-trigger { width: 100%; }
}

/* Header action, neutral navigation, and precise approval state */
.header-hire {
  min-height: 40px;
  margin-left: auto;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 9px;
  font-size: 12px;
  white-space: nowrap;
}
.header-hire span { color: var(--console-accent); font-size: 17px; line-height: 1; }
.page-header .console-hire { display: none; }

.workspace-home {
  display: grid;
  place-items: center;
  background: var(--console-accent-soft);
  color: var(--console-accent);
}
.workspace-home svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }

.sidebar-link.active::before { display: none; }
.sidebar-link.active { background: var(--sidebar-active); box-shadow: none; }

.sidebar-link .badge,
.app-page.sidebar-collapsed .sidebar-link .badge {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 20px;
  min-width: 20px;
  height: 20px;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: visible;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  background: #d95b61;
  color: #fff;
  box-shadow: 0 0 0 2px var(--sidebar-bg);
  font-size: 9px;
  font-weight: 750;
  line-height: 1;
  transform: translateY(-50%);
}
.app-page.sidebar-collapsed .sidebar-link .badge { top: 5px; right: -2px; transform: none; }

@media (max-width: 700px) {
  .header-hire { min-height: 36px; padding-inline: 11px; font-size: 10px; }
}

/* Final UI precision: plan art, compact pricing rhythm, and stable shell controls */
.plan-sigil {
  width: 112px;
  height: 90px;
  margin: 0 0 20px;
  display: block;
  flex: 0 0 auto;
  color: var(--console-accent);
  opacity: .84;
}
.plan-sigil svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}
.plan-sigil path,
.plan-sigil.tier-enterprise path {
  fill: none;
  stroke: currentColor;
  stroke-width: 3.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.plan-sigil.tier-start { width: 94px; }
.plan-sigil.tier-plus { width: 106px; }
.plan-sigil.tier-pro { width: 116px; }
.plan-sigil.tier-max { width: 130px; height: 100px; }
.plan-sigil.tier-enterprise { width: 104px; height: 90px; }
.plan-sigil.tier-enterprise svg { width: 100%; height: 100%; }

.workspace-plan-card {
  min-height: 0;
  padding: 28px 25px 30px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}
.workspace-plan-card h2 { margin: 0; line-height: 1.1; }
.workspace-plan-audience { min-height: 0; margin: 7px 0 0; line-height: 1.45; }
.workspace-plan-price { margin: 22px 0 10px; line-height: 1; }
.workspace-plan-card > p:not(.workspace-plan-audience):not(.workspace-plan-price) {
  min-height: 48px;
  margin: 0 0 18px;
}
.workspace-plan-card > button { margin: 0; flex: 0 0 auto; }
.workspace-plan-card ul { margin: 22px 0 0; padding-top: 20px; }

.workspace-home,
.sidebar-workspace-selector .workspace-home,
.sidebar-workspace-selector.open .workspace-home {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
}
.workspace-home svg { width: 20px; height: 20px; }
.sidebar-workspace-selector .workspace-btn {
  overflow: hidden;
  transition: background-color 170ms ease, border-color 170ms ease, color 170ms ease;
}
.sidebar-workspace-selector.open .workspace-btn,
.sidebar-workspace-selector .workspace-btn:hover {
  border-color: transparent;
  background: var(--sidebar-hover);
}
.app-page.sidebar-collapsed .sidebar-workspace-selector .workspace-btn {
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  height: 43px;
  min-height: 43px;
  margin-inline: auto;
  padding: 0;
  justify-content: center;
  border-color: transparent;
  border-radius: 8px;
  background: transparent;
}
.app-page.sidebar-collapsed .sidebar-workspace-selector.open .workspace-btn,
.app-page.sidebar-collapsed .sidebar-workspace-selector .workspace-btn:hover {
  background: var(--sidebar-hover);
}

.header-hire,
.header-hire:hover,
.header-hire:focus-visible,
.header-hire:active {
  animation: none !important;
  transform: none !important;
  box-shadow: none !important;
  opacity: 1;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease !important;
}
.header-hire::before,
.header-hire::after { content: none !important; display: none !important; animation: none !important; }
html[data-theme="dark"] .header-hire,
html[data-theme="dark"] .header-hire:hover,
html[data-theme="dark"] .header-hire:focus-visible {
  border-color: #eeeee8;
  background: #eeeee8;
  color: #171814;
}
html[data-theme="light"] .header-hire,
html[data-theme="light"] .header-hire:hover,
html[data-theme="light"] .header-hire:focus-visible {
  border-color: #20211d;
  background: #20211d;
  color: #f7f7f2;
}

/* Stable sidebar geometry: only the frame and labels move */
.app-page,
.app-sidebar {
  transition: grid-template-columns var(--motion-duration-slow) var(--motion-ease-enter), width var(--motion-duration-slow) var(--motion-ease-enter), background-color var(--motion-duration-fast) var(--motion-ease-standard);
}
.sidebar-link,
.sidebar-workspace-selector .workspace-btn,
.account-trigger {
  box-sizing: border-box;
  transition: background-color 170ms ease, border-color 170ms ease, color 170ms ease;
}
.sidebar-link svg,
.workspace-home,
.account-avatar {
  transform: none !important;
  transition: color 170ms ease, background-color 170ms ease, border-color 170ms ease;
}
.sidebar-link,
.app-page.sidebar-collapsed .sidebar-link {
  width: 100%;
  margin-inline: 0;
  padding: 10px 12px;
  justify-content: flex-start;
  gap: 12px;
}
.sidebar-workspace-selector .workspace-btn,
.app-page.sidebar-collapsed .sidebar-workspace-selector .workspace-btn {
  width: 100%;
  min-width: 0;
  max-width: none;
  height: 43px;
  min-height: 43px;
  margin-inline: 0;
  padding: 6px 12px;
  justify-content: flex-start;
  gap: 10px;
}
.account-trigger,
.app-page.sidebar-collapsed .account-trigger {
  width: 100%;
  margin-inline: 0;
  padding: 7px 4px;
  justify-content: flex-start;
  gap: 10px;
}
.app-page.sidebar-collapsed .sidebar-link > span:not(.badge),
.app-page.sidebar-collapsed .sidebar-workspace-selector .ws-name,
.app-page.sidebar-collapsed .sidebar-workspace-selector .ws-caret,
.app-page.sidebar-collapsed .account-copy,
.app-page.sidebar-collapsed .account-caret {
  width: 0;
  max-width: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
}

/* Smaller plan marks and a tighter, centered plan heading */
.plan-sigil { width: 88px; height: 70px; margin-bottom: 18px; }
.plan-sigil path,
.plan-sigil.tier-enterprise path { stroke-width: 2.65; }
.plan-sigil.tier-start { width: 76px; }
.plan-sigil.tier-plus { width: 86px; }
.plan-sigil.tier-pro { width: 94px; }
.plan-sigil.tier-max { width: 106px; height: 80px; }
.plan-sigil.tier-enterprise { width: 84px; height: 72px; }
.workspace-plans-head {
  max-width: 820px;
  margin: 8px auto 34px;
  text-align: center;
}
.workspace-plans-head .panel-kicker { margin-bottom: 10px; }
.workspace-plans-head h1 {
  margin: 0;
  font-size: clamp(40px, 4vw, 52px);
  line-height: .98;
}
.workspace-plans-head > p:not(.panel-kicker) {
  max-width: 720px;
  margin: 15px auto 0;
  line-height: 1.55;
}
.workspace-plan-tabs { margin-top: 26px; }

/* Light-mode controls retain their hierarchy on hover and click */
html[data-theme="light"] .app-main .btn-primary,
html[data-theme="light"] .app-main .cta-primary {
  border-color: #aeb99a;
  background: #e5eadb;
  color: #28321f;
  box-shadow: none;
}
html[data-theme="light"] .app-main .btn-primary:hover:not(:disabled),
html[data-theme="light"] .app-main .btn-primary:active:not(:disabled),
html[data-theme="light"] .app-main .cta-primary:hover,
html[data-theme="light"] .app-main .cta-primary:active {
  border-color: #9eac86;
  background: #dce4cf;
  color: #222b1b;
  box-shadow: none;
}
html[data-theme="light"] .app-main .btn-secondary:hover:not(:disabled),
html[data-theme="light"] .app-main .btn-secondary:active:not(:disabled),
html[data-theme="light"] .settings-tab:hover,
html[data-theme="light"] .sidebar-toggle:hover,
html[data-theme="light"] .workspace-btn:hover,
html[data-theme="light"] .account-options a:hover,
html[data-theme="light"] .account-options button:hover {
  border-color: #c3c7bb;
  background: #e8eae3;
  color: #242620;
  box-shadow: none;
}

/* 2026-08-22 shell recovery and Atlas model library */
.app-page {
  width: 100%;
  min-height: 100dvh;
}
.app-page.sidebar-collapsed { --app-sidebar-track: 68px; }
.app-header {
  width: 100%;
  min-width: 0;
  padding: 0 22px;
}
.app-header .header-inner {
  width: 100%;
  min-height: 69px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0;
}
.app-header .brand {
  min-width: max-content;
  display: inline-flex;
  align-items: baseline;
  color: var(--text);
  text-decoration: none;
}
.app-header .brand-arrow {
  width: auto;
  height: auto;
  border: 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 18px;
  line-height: 1;
}
.app-header .brand-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.045em;
}
.header-hire { margin-left: auto; }
.app-sidebar { min-width: 0; overflow-x: visible; }
.app-main {
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  overflow-x: hidden;
}
.app-page-content { width: 100%; min-width: 0; }
.page-header h1 {
  margin: 0 0 8px;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 3vw, 48px);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -.04em;
  transform: none;
}
.page-subtitle { color: var(--muted); font-family: var(--font-sans); }

.console-models {
  min-width: 0;
  padding-top: 8px;
}
.model-status-note { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.console-section-head {
  margin-bottom: 13px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}
.console-section-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.console-section-head a {
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
  transition: color 170ms ease, transform 170ms ease;
}
.console-section-head a:hover { color: var(--text);  }
.console-model-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.console-model-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
  transition: border-color var(--motion-duration-fast) var(--motion-ease-standard), background-color var(--motion-duration-fast) var(--motion-ease-standard);
}
.console-model-card:hover { border-color: color-mix(in srgb, var(--console-accent) 46%, var(--line)); }
.console-model-visual {
  height: 142px;
  padding: 20px;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line);
  background: #9ccbeb;
}
.console-vector .console-model-visual { background: #aae6b6; }
.console-apex .console-model-visual { background: #d96b63; }
.console-model-visual svg {
  width: 112px;
  height: 112px;
  overflow: visible;
  filter: drop-shadow(0 7px 13px rgba(17,18,16,.08));
}
.console-model-visual path,
.console-model-visual circle {
  fill: none;
  stroke: #20211e;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.console-model-visual .model-surface { fill: rgba(255,255,255,.08); }
.console-model-visual .model-node { fill: #f7f6f0; }
.console-compas .model-accent { stroke: #df4138; }
.console-apex .model-surface { fill: #d96b63; }
.console-model-copy { padding: 16px 17px 17px; }
.console-model-copy > div { display: flex; align-items: center; gap: 9px; }
.console-model-copy h3 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.02em; }
.console-model-copy > div > span {
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--console-accent-soft);
  color: var(--console-accent);
  font-size: 9px;
  font-weight: 650;
}
.console-model-copy > p { min-height: 34px; margin: 8px 0 12px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.console-model-copy ul { margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }
.console-model-copy li {
  padding: 4px 7px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: color-mix(in srgb, var(--card) 72%, var(--sidebar-hover));
  color: var(--muted);
  font-size: 9px;
  line-height: 1;
}
html[data-theme="light"] .console-model-card { box-shadow: 0 1px 0 rgba(24,26,21,.025); }
html[data-theme="light"] .console-model-copy li { background: #f0f1eb; }

@media (max-width: 980px) {
  .console-model-grid { grid-template-columns: 1fr; }
  .console-model-card { display: grid; grid-template-columns: 180px minmax(0, 1fr); }
  .console-model-visual { height: 100%; min-height: 170px; border-right: 1px solid var(--line); border-bottom: 0; }
}
@media (max-width: 700px) {
  .app-page, .app-page.sidebar-collapsed { grid-template-columns: 1fr; }
  .console-model-card { grid-template-columns: 1fr; }
  .console-model-visual { height: 135px; min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
}

/* Complete model geometry and stable workspace shell. */
.console-model-visual { overflow: hidden; }
.console-model-visual svg,
.console-model-visual svg * { overflow: visible; }
.console-model-visual svg { padding: 2px; }
.dashboard-content,
.console-workspace-grid,
.console-models,
.activity-section { min-width: 0; }
.header-hire { flex: 0 0 auto; }

/* Functional model browser and employee controls */
.console-model-card { cursor: pointer; }
.console-model-card:focus-visible {
  outline: 2px solid var(--console-accent);
  outline-offset: 4px;
}

/* Keep roster feedback in the Tensor palette—no blue sheen. */
.roster-card::before { display: none !important; }
.roster-card:hover {
  border-color: color-mix(in srgb, var(--console-accent) 38%, var(--line));
  box-shadow: 0 18px 42px rgba(14, 18, 12, .18) !important;
}
.badge-tag {
  border-color: color-mix(in srgb, var(--console-accent) 35%, var(--line));
  background: var(--console-accent-soft);
  color: var(--console-accent);
}

.employee-item.employee-editor-trigger {
  width: 100%;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.employee-item.employee-editor-trigger::before { background: var(--console-accent); }
.employee-item.employee-editor-trigger:focus-visible {
  outline: 2px solid var(--console-accent);
  outline-offset: 2px;
}
.employee-edit-cue {
  min-width: 46px;
  color: var(--muted);
  font-size: 10px;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 160ms ease, transform var(--motion-duration-fast) var(--motion-ease-standard);
}
.employee-item:hover .employee-edit-cue,
.employee-item:focus-visible .employee-edit-cue { opacity: 1; transform: none; }

.app-logo { padding: 0; overflow: hidden; background: transparent; }
.app-logo svg { width: 24px; height: 24px; }
.app-logo-stripe { border-color: color-mix(in srgb, #635bff 46%, var(--line)); }
.app-logo-x { color: var(--text); }
.app-logo-gmail { background: color-mix(in srgb, #fff 92%, var(--card)); }

body.modal-open { overflow: hidden; }
.model-detail-overlay,
.employee-editor-overlay {
  z-index: 220;
  background: rgba(4, 5, 4, .68);
  backdrop-filter: blur(13px);
  animation: consoleBackdropIn var(--motion-duration-fast) var(--motion-ease-standard) both;
}
@keyframes consoleBackdropIn { from { opacity: 0; } to { opacity: 1; } }
.model-detail-dialog,
.employee-editor-dialog {
  width: min(920px, calc(100vw - 36px));
  max-width: 920px;
  padding: 30px;
  overflow: auto;
}
.model-detail-head,
.employee-editor-head {
  display: flex;
  align-items: center;
  gap: 22px;
  padding-right: 44px;
}
.model-detail-head h2,
.employee-editor-head h2 { margin: 3px 0 4px; font-size: 30px; }
.model-detail-head p:last-child,
.employee-editor-head p:last-child { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.model-detail-logo {
  width: 116px;
  height: 116px;
  flex: 0 0 116px;
  display: grid;
  place-items: center;
}
.model-detail-logo svg { width: 112px; height: 112px; overflow: visible; }
.model-detail-logo svg path,
.model-detail-logo svg circle {
  fill: none;
  stroke: var(--text);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.model-detail-logo .model-node { fill: var(--bg); }
.model-detail-logo .model-surface { fill: var(--console-accent-soft); }
.model-detail-logo .model-accent { stroke: #d94b43; }
.model-detail-body {
  display: grid;
  grid-template-columns: 1.2fr .85fr .85fr;
  gap: 24px;
  margin-top: 27px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
}
.model-detail-label { margin: 0 0 13px; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; }
.model-price-grid { margin: 0; display: grid; }
.model-price-grid > div { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 47px; border-bottom: 1px solid var(--line-soft); }
.model-price-grid dt { color: var(--muted); font-size: 12px; }
.model-price-grid dd { margin: 0; font-size: 13px; font-weight: 650; }
.model-price-grid small { color: var(--muted); font-size: 9px; font-weight: 500; }
.model-employee-fit { display: flex; flex-wrap: wrap; gap: 7px; }
.model-employee-fit span { padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--console-accent-soft); color: var(--text); font-size: 10px; }
.model-capabilities { margin: 0; padding: 0; display: grid; gap: 12px; list-style: none; color: var(--muted); font-size: 11px; }
.model-capabilities li { display: flex; gap: 8px; line-height: 1.45; }
.model-capabilities span { color: var(--console-accent); }
.model-detail-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 27px; padding-top: 19px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.model-detail-footer button {
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid color-mix(in srgb, var(--console-accent) 48%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--console-accent) 42%, #10130e);
  color: #f6f7f1;
  cursor: pointer;
}

.employee-editor-dialog { max-width: 780px; }
.employee-editor-avatar { width: 64px; height: 64px; flex: 0 0 64px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--console-accent-soft); color: var(--console-accent); font-family: var(--font-display); font-size: 25px; }
.employee-editor-form { display: grid; gap: 16px; margin-top: 25px; }
.employee-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.employee-editor-form > label,
.employee-editor-grid label { display: grid; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 600; }
.employee-editor-form input,
.employee-editor-form select,
.employee-editor-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  padding: 11px 12px;
  font: 500 12px/1.45 var(--font-body);
  resize: vertical;
}
.employee-editor-form input:focus,
.employee-editor-form select:focus,
.employee-editor-form textarea:focus { outline: 1px solid var(--console-accent); border-color: var(--console-accent); }
.employee-file-drop { padding: 15px; border: 1px dashed color-mix(in srgb, var(--console-accent) 44%, var(--line)); border-radius: 9px; background: var(--console-accent-soft); cursor: pointer; }
.employee-file-drop input { position: absolute; opacity: 0; pointer-events: none; }
.employee-file-drop span { color: var(--text); font-size: 11px; }
.employee-file-drop small { color: var(--muted); font-size: 9px; }
.employee-permission-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 0; border-block: 1px solid var(--line-soft); }
.employee-permission-row span { display: grid; gap: 4px; }
.employee-permission-row strong { font-size: 11px; }
.employee-permission-row small { color: var(--muted); font-size: 9px; }
.employee-permission-row input { width: 18px; height: 18px; accent-color: var(--console-accent); }
.employee-editor-actions { display: flex; justify-content: flex-end; gap: 9px; }

html[data-theme="light"] .model-detail-overlay,
html[data-theme="light"] .employee-editor-overlay { background: rgba(28, 31, 24, .34); }
html[data-theme="light"] .roster-card:hover { box-shadow: 0 16px 34px rgba(36, 41, 29, .09) !important; }

@media (max-width: 760px) {
  .model-detail-dialog, .employee-editor-dialog { padding: 22px; }
  .model-detail-head, .employee-editor-head { align-items: flex-start; }
  .model-detail-logo { width: 78px; height: 78px; flex-basis: 78px; }
  .model-detail-logo svg { width: 76px; height: 76px; }
  .model-detail-body { grid-template-columns: 1fr; }
  .employee-editor-grid { grid-template-columns: 1fr; }
  .employee-edit-cue { display: none; }
}

/* Production interaction and surface pass */
:root,
html[data-theme="dark"] {
  --bg: #10110f;
  --card: #181916;
  --line: #30312d;
  --line-soft: #252621;
  --console-accent-soft: #1d1f1a;
  --sidebar-bg: #0d0e0c;
  --sidebar-hover: #191a17;
  --sidebar-active: #292a27;
  --motion-fast: 150ms;
  --motion-base: 240ms;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

html[data-theme="light"] {
  --console-accent-soft: #edf0e7;
  --sidebar-active: #e0e2db;
}

.app-header .brand { gap: 7px; }
.app-header .brand-arrow {
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  color: var(--console-accent);
}
.app-header .brand-name { color: var(--text); }

button,
a,
input,
select,
textarea,
.employee-item,
.roster-card,
.approval-card,
.audit-entry {
  transition-property: color, background-color, border-color, opacity, transform;
  transition-duration: var(--motion-fast);
  transition-timing-function: var(--ease-out);
}

.modal-overlay {
  background: rgba(5, 6, 5, .68);
  backdrop-filter: blur(10px);
  animation: consoleBackdropIn var(--motion-base) var(--ease-out) both;
}
@keyframes consoleBackdropIn { from { opacity: 0; } to { opacity: 1; } }

#hireModal .modal-content {
  width: min(680px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  background: var(--bg);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .34);
}
#hireModal .wizard-header {
  position: relative;
  flex: 0 0 auto;
  padding: 27px 36px 24px;
  background: var(--bg);
}
#hireModal .wizard-header h2 {
  background: none;
  color: var(--text);
  -webkit-text-fill-color: currentColor;
  font-size: 25px;
}
#hireModal .wizard-step.active {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 28px 36px;
  overscroll-behavior: contain;
}
#hireModal .wizard-footer {
  position: relative;
  flex: 0 0 auto;
  z-index: 3;
  padding: 17px 36px;
  background: var(--bg);
  box-shadow: 0 -1px 0 var(--line);
}
#hireModal .form-group input,
#hireModal .form-group textarea,
#hireModal .form-group select,
#hireModal .test-input,
.employee-editor-form input,
.employee-editor-form select,
.employee-editor-form textarea {
  background: var(--card);
  border-color: var(--line);
  box-shadow: none !important;
  caret-color: var(--console-accent);
}
#hireModal .form-group input:focus,
#hireModal .form-group textarea:focus,
#hireModal .form-group select:focus,
#hireModal .test-input:focus,
.employee-editor-form input:focus,
.employee-editor-form select:focus,
.employee-editor-form textarea:focus,
.audit-search:focus,
.audit-filter:focus {
  outline: 2px solid color-mix(in srgb, var(--console-accent) 48%, transparent);
  outline-offset: 1px;
  border-color: var(--console-accent);
  box-shadow: none !important;
}
#hireModal .file-upload:hover,
#hireModal .channel-option input:checked + .channel-label,
.employee-file-drop:hover {
  border-color: color-mix(in srgb, var(--console-accent) 62%, var(--line));
  background: var(--console-accent-soft);
  box-shadow: none !important;
  transform: none;
}
#hireModal .test-badge,
#hireModal .test-message.user {
  background: var(--console-accent-soft);
  color: var(--console-accent);
}
#hireModal .test-message.ai { background: var(--card); color: var(--text); }
#hireModal .btn-send-test,
#hireModal .btn-primary,
.approval-detail-actions .cta-primary {
  background: var(--text) !important;
  border-color: var(--text) !important;
  color: var(--bg) !important;
  box-shadow: none !important;
}
#hireModal .btn-secondary,
.approval-detail-actions .cta-secondary {
  background: var(--card) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}
#hireModal .btn-primary:hover:not(:disabled),
#hireModal .btn-secondary:hover:not(:disabled),
#hireModal .btn-send-test:hover,
.approval-detail-actions .cta:hover {
  transform: translateY(-1px);
  filter: none;
}

.approvals-list { gap: 12px; }
.approval-card {
  padding: 0;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: none !important;
}
.approval-open {
  width: 100%;
  padding: 20px 20px 16px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.approval-open:hover { background: color-mix(in srgb, var(--text) 3%, transparent); }
.approval-identity { display: flex; align-items: center; gap: 13px; min-width: 0; }
.app-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}
.app-logo svg { width: 100%; height: 100%; display: block; }
.app-logo-x { background: #050505; color: #fff; padding: 8px; }
.app-logo-gmail { padding: 7px; }
.approval-reason { max-width: 760px; margin: 15px 0 0; color: var(--muted); line-height: 1.55; }
.approval-review-cue { display: inline-flex; gap: 7px; margin-top: 15px; color: var(--text); font-size: 11px; font-weight: 650; }
.approval-review-cue b { color: var(--console-accent); }
.approval-actions { padding: 14px 20px 18px; border-top: 1px solid var(--line-soft); }
.approval-risk { background: transparent; border: 1px solid var(--line); color: var(--muted); }

.approval-detail-dialog {
  width: min(760px, calc(100vw - 30px));
  max-height: calc(100dvh - 30px);
  padding: 30px;
  overflow-y: auto;
  border-radius: 18px;
  background: var(--bg);
}
.approval-detail-head { display: flex; align-items: center; gap: 15px; padding-right: 45px; }
.approval-detail-head h2 { margin: 4px 0; font-size: 27px; }
.approval-detail-head p:last-child { margin: 0; color: var(--muted); font-size: 12px; }
.approval-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 24px; }
.approval-detail-grid section { min-height: 126px; padding: 17px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.approval-detail-grid span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.approval-detail-grid p { margin: 12px 0 0; color: var(--text); font-size: 12px; line-height: 1.6; }
.approval-detail-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }

/* Audit has one layout contract: a compact source column plus a fixed metadata
   rail.  Keeping this scoped prevents generic activity rules from collapsing a
   row into separate narrow grid columns on phones. */
#page-audit { width: min(980px, 100%); margin-inline: auto; padding-bottom: 96px; }
#page-audit .audit-controls { display: grid; grid-template-columns: minmax(0, 1fr) 150px; align-items: stretch; gap: 10px; margin-bottom: 16px; }
#page-audit .audit-search,
#page-audit .audit-filter { min-width: 0; min-height: 42px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); font-family: inherit; font-size: 14px; box-shadow: none !important; }
#page-audit .audit-timeline { overflow: hidden; border: 0; border-radius: 0; background: transparent; }
#page-audit .audit-timeline::before,
#page-audit .audit-entry::before { display: none; }
#page-audit .audit-entry { display: flex !important; flex-wrap: wrap; align-items: center; gap: 3px 12px; min-height: 0 !important; height: auto !important; margin: 0; padding: 11px 2px; border: 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 68%, transparent); border-radius: 0; background: transparent; box-shadow: none !important; }
#page-audit .audit-entry:last-child { border-bottom: 0; }
#page-audit .audit-origin { display: flex; flex: 1 1 0; align-items: center; gap: 9px; min-width: 0; }
#page-audit .audit-origin .app-logo { width: 28px; height: 28px; flex: 0 0 28px; padding: 0 !important; border: 0 !important; border-radius: 0; background: transparent !important; box-shadow: none !important; }
#page-audit .audit-origin .app-logo svg { width: 28px; height: 28px; }
#page-audit .audit-origin .app-logo-tensor > span { width: 28px; height: 28px; font-size: 12px; }
#page-audit .audit-origin > div { display: grid; min-width: 0; gap: 2px; }
#page-audit .audit-action { overflow-wrap: anywhere; margin: 0; color: var(--text); font-size: 13px; font-weight: 650; line-height: 1.25; }
#page-audit .audit-source strong,
#page-audit .audit-source span,
#page-audit .audit-source { overflow: hidden; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
#page-audit .audit-time { flex: 1 1 calc(100% - 39px); margin: 0 0 0 37px; color: var(--muted); font: 600 9px/1.3 "IBM Plex Mono", monospace; }
#page-audit .audit-status { flex: 0 0 auto; min-width: 0; margin: 0 0 0 auto; padding: 3px 6px; border: 1px solid var(--line); border-radius: 999px; background: transparent !important; box-shadow: none !important; font-size: 7px; font-weight: 700; letter-spacing: .045em; }
#page-audit .audit-status.recorded { color: var(--muted); border-color: var(--line); }
#page-audit .audit-entry-details { flex: 0 0 calc(100% - 37px); min-width: 0; margin: 3px 0 0 37px; }
#page-audit .audit-entry-details summary { width: max-content; max-width: 100%; color: var(--console-accent); cursor: pointer; font-size: 9px; font-weight: 650; }
#page-audit .audit-entry-details p { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
#page-audit .audit-entry-details[open] p { animation: auditDetailsIn 160ms ease-out both; }
@keyframes auditDetailsIn { from { opacity: 0; transform: translateY(-2px); } to { opacity: 1; transform: translateY(0); } }
#page-audit .audit-loading { display: grid; gap: 0; }
#page-audit .audit-loading i { display: block; height: 67px; border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent); background: linear-gradient(100deg, color-mix(in srgb, var(--surface) 90%, var(--line)) 30%, color-mix(in srgb, var(--text) 6%, var(--surface)) 48%, color-mix(in srgb, var(--surface) 90%, var(--line)) 66%); background-size: 240% 100%; animation: tensor-conversation-shimmer 1.5s ease-in-out infinite; }
#page-audit .audit-loading i:nth-child(2) { animation-delay: 75ms; }
#page-audit .audit-loading i:nth-child(3) { animation-delay: 150ms; }
@media (max-width: 680px) {
  #page-audit { width: 100%; padding-bottom: calc(132px + env(safe-area-inset-bottom)); }
  #page-audit .audit-controls { grid-template-columns: minmax(0, 1fr) 112px; gap: 8px; }
  #page-audit .audit-search,
  #page-audit .audit-filter { min-height: 40px; font-size: 12px !important; }
  #page-audit .audit-entry { gap: 3px 9px; padding: 10px 0; }
  #page-audit .audit-origin .app-logo { width: 27px; height: 27px; flex-basis: 27px; }
  #page-audit .audit-origin .app-logo svg { width: 27px; height: 27px; }
  #page-audit .audit-action { font-size: 12px; }
  #page-audit .audit-source strong,
  #page-audit .audit-source span { white-space: normal; }
  #page-audit .audit-time { margin-left: 36px; font-size: 9px; }
  #page-audit .audit-entry-details p { font-size: 10px; }
}

.employee-item,
.roster-card,
.employee-file-drop,
.model-card { box-shadow: none !important; }
.roster-card:hover,
.employee-item:hover { transform: translateY(-1px); box-shadow: none !important; }

html[data-theme="light"] .cta:hover,
html[data-theme="light"] .btn-primary:hover,
html[data-theme="light"] .btn-secondary:hover,
html[data-theme="light"] .workspace-plan-card button:hover,
html[data-theme="light"] .model-detail-footer button:hover {
  color: var(--text);
  border-color: var(--line);
  background: #e7e8e1;
  box-shadow: none;
}
html[data-theme="light"] .cta-primary:hover,
html[data-theme="light"] #hireModal .btn-primary:hover,
html[data-theme="light"] #hireModal .btn-send-test:hover,
html[data-theme="light"] .approval-detail-actions .cta-primary:hover {
  color: #f8f8f4 !important;
  background: #24251f !important;
  border-color: #24251f !important;
}

@media (max-width: 720px) {
  #hireModal .wizard-header,
  #hireModal .wizard-step.active,
  #hireModal .wizard-footer { padding-inline: 22px; }
  .approval-detail-grid { grid-template-columns: 1fr; }
}

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

/* Plans remain individually scannable, matching the public plan presentation. */
.workspace-plan-grid,
.workspace-plan-grid.enterprise {
  gap: 14px;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}
.workspace-plan-card,
.workspace-plan-grid.enterprise .workspace-plan-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}
.workspace-plan-card + .workspace-plan-card { border-left: 1px solid var(--line); }
.workspace-plan-card:hover { border-color: color-mix(in srgb, var(--console-accent) 42%, var(--line)); }

/* Tensor model family: large, monochrome geometry with compact operational facts. */
.console-model-card { min-height: 292px !important; }
.model-card-visual { display: grid; height: 104px; place-items: center; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 74%, var(--card)); }
.model-card-visual .model-symbol { width: 66px; height: 66px; stroke-width: 1.45; }
.model-card-visual .model-symbol circle { fill: var(--surface); }
.console-model-copy { min-height: 188px !important; padding: 17px 19px !important; }
.console-model-copy > p { max-width: 38ch; margin-top: 8px !important; }
.model-card-facts { display: grid; gap: 5px; margin: 13px 0 0; }
.model-card-facts > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 6px; border-top: 1px solid var(--line-soft); }
.model-card-facts dt { color: var(--muted); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.model-card-facts dd { margin: 0; color: var(--text); font-size: 10px; font-weight: 600; text-align: right; }
.model-card-facts > div:first-child dd { color: var(--console-accent); font-size: 11px; letter-spacing: .08em; }
.model-card-disclosure { padding-top: 10px; }
.model-detail-dialog { width: min(780px, calc(100vw - 30px)); max-width: 780px; }
.model-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }
.model-pricing-grid,.model-feature-grid { margin: 0; border-top: 1px solid var(--line); }
.model-pricing-grid > div,.model-feature-grid > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; min-height: 47px; border-bottom: 1px solid var(--line); }
.model-pricing-grid dt,.model-feature-grid dt { color: var(--muted); font-size: 12px; }
.model-pricing-grid dd,.model-feature-grid dd { margin: 0; color: var(--text); font-size: 13px; font-weight: 600; text-align: right; }
.model-pricing-grid dd small { color: var(--muted); font-size: 9px; font-weight: 500; }
.model-feature-grid .model-speed-stars { color: var(--console-accent); letter-spacing: .14em; }
@media (max-width: 980px) {
  .console-model-card { display: block; min-height: 0 !important; }
  .model-card-visual { height: 96px; border-right: 0; border-bottom: 1px solid var(--line); }
  .console-model-copy { min-height: 0 !important; }
}
@media (max-width: 620px) {
  .model-detail-grid { grid-template-columns: 1fr; gap: 22px; }
  .model-card-visual .model-symbol { width: 58px; height: 58px; }
}

/* Employee customer-conversation log: backend records only, compact on mobile. */
.employee-conversations-list { display: grid; gap: 7px; margin-top: 16px; }
.employee-conversation-row { display: flex; justify-content: space-between; gap: 14px; width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: transparent; text-align: left; }
.employee-conversation-row:hover, .employee-conversation-row:focus-visible { border-color: var(--console-accent); background: var(--sidebar-hover); outline: 0; }
.employee-conversation-row span { min-width: 0; display: grid; gap: 3px; }
.employee-conversation-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.employee-conversation-row small, .employee-conversation-row time, .employee-conversation-state { color: var(--muted); font-size: 11px; }
.employee-conversation-row time { flex: 0 0 auto; text-align: right; }
.employee-conversation-detail { display: grid; gap: 9px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.employee-conversation-message { max-width: 88%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.employee-conversation-message.is-employee { justify-self: end; border-color: color-mix(in srgb, var(--console-accent) 34%, var(--line)); }
.employee-conversation-message strong { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.employee-conversation-message p { margin: 0 0 7px; font-size: 13px; line-height: 1.5; }
.employee-conversation-message p:last-child { margin-bottom: 0; }
.employee-conversation-message pre { overflow-x: auto; margin: 7px 0; padding: 9px; border-radius: 6px; background: var(--sidebar-hover); }
.employee-conversation-message code { font: 11px/1.45 var(--font-mono); }
@media (max-width: 560px) { .employee-conversation-row { align-items: flex-start; flex-direction: column; gap: 4px; } .employee-conversation-row time { text-align: left; } .employee-conversation-message { max-width: 100%; } }

/* Tensor model and runtime intent controls: compact, neutral, and explicit
   about the distinction between saved configuration and backend enforcement. */
.employee-instructions-card .tensor-select {
  width: 100%;
  min-height: 48px;
  border: 1px solid color-mix(in srgb, var(--console-accent) 34%, var(--line));
  border-radius: 10px;
  color: var(--text);
  background-color: color-mix(in srgb, var(--surface) 92%, var(--console-accent-soft));
  padding: 0 42px 0 14px;
  font-weight: 600;
  letter-spacing: -.01em;
  cursor: pointer;
}
.employee-instructions-card .tensor-select:hover { border-color: color-mix(in srgb, var(--console-accent) 66%, var(--line)); background-color: color-mix(in srgb, var(--surface) 84%, var(--console-accent-soft)); }
.employee-instructions-card .tensor-select:focus-visible { outline: 2px solid color-mix(in srgb, var(--console-accent) 62%, transparent); outline-offset: 2px; }
.model-detail-availability { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.model-detail-logo { display: grid; place-items: center; min-width: 58px; min-height: 36px; color: var(--console-accent); font-size: 10px; font-weight: 700; letter-spacing: .03em; text-align: center; }
.copilot-composer > .copilot-composer-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 7px;
  padding: 0;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
}
.copilot-composer-controls > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.copilot-composer-controls select {
  min-width: 0;
  max-width: 52%;
  height: 27px;
  padding: 0 24px 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface);
  font: 600 10px/1 var(--font-sans);
}
.copilot-composer-controls select:focus-visible { outline: 2px solid color-mix(in srgb, var(--console-accent) 62%, transparent); outline-offset: 1px; }
.copilot-composer > .copilot-composer-input { display: flex; align-items: flex-end; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.copilot-composer > .copilot-composer-input:focus-within { border-color: color-mix(in srgb, var(--console-accent) 62%, var(--line)) !important; box-shadow: none !important; }
.copilot-permission-note { margin-top: 6px !important; color: var(--muted) !important; }
@media (max-width: 520px) {
  .copilot-composer-controls { overflow-x: auto; padding-bottom: 2px !important; }
  .copilot-composer-controls select { flex: 0 0 auto; max-width: none; }
}

/* Focused Models and Tensor OS refinement. */
.console-model-grid { gap: 12px; }
.console-model-card {
  position: relative;
  min-height: 176px !important;
  border-radius: 12px;
  background: color-mix(in srgb, var(--card) 96%, var(--surface));
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, transform 150ms var(--motion-ease-enter);
}
.console-model-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; background: transparent; transition: background-color 150ms ease; }
.console-model-card:hover { border-color: color-mix(in srgb, var(--console-accent) 50%, var(--line)); background: color-mix(in srgb, var(--card) 92%, var(--console-accent-soft)); transform: translateY(-1px); }
.console-model-card:hover::before, .console-model-card:focus-visible::before { background: var(--console-accent); }
.console-model-card:focus-visible { outline: 2px solid color-mix(in srgb, var(--console-accent) 75%, transparent); outline-offset: 3px; }
.console-model-copy { display: flex; min-height: 176px; flex-direction: column; padding: 20px !important; }
.console-model-copy > div { gap: 8px; }
.model-symbol { width: 38px; height: 38px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; color: var(--text); }
.model-symbol circle { fill: var(--card); }
.console-model-copy h3 { font-size: 18px !important; font-weight: 620; }
.console-model-copy > div > span { padding: 0; border: 0; border-radius: 0; color: var(--console-accent); background: transparent; font-size: 10px; letter-spacing: .02em; }
.console-model-copy > p { min-height: 0 !important; max-width: 31ch; margin: 11px 0 0 !important; font-size: 12px !important; line-height: 1.5 !important; }
.console-model-copy ul { display: none; }
.model-card-disclosure { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 18px; color: var(--muted); font-size: 10px; font-weight: 600; }
.model-card-disclosure b { color: var(--console-accent); font-size: 14px; font-weight: 500; transition: transform 150ms var(--motion-ease-enter); }
.console-model-card:hover .model-card-disclosure b { transform: translateX(3px); }
.model-detail-dialog { width: min(620px, calc(100vw - 30px)); max-width: 620px; padding: 28px; }
.model-detail-head { align-items: flex-start; gap: 16px; padding-right: 34px; }
.model-detail-head h2 { margin: 3px 0 6px; font: 500 31px/1.05 Georgia, serif; }
.model-detail-head p:not(.panel-kicker) { max-width: 46ch; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.model-detail-logo { min-width: 58px; min-height: 58px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--console-accent); font-size: 9px; }
.model-detail-logo .model-symbol { width: 40px; height: 40px; color: var(--text); }
.model-detail-logo .model-symbol circle { fill: var(--surface); }
.model-detail-body { display: grid; gap: 22px; margin-top: 28px; }
.model-detail-body section { padding-top: 0; border: 0; }
.model-detail-label { margin: 0 0 10px; color: var(--muted); font: 650 10px/1.2 var(--font-sans); letter-spacing: .1em; text-transform: uppercase; }
.model-employee-fit { display: flex; flex-wrap: wrap; gap: 6px; }
.model-employee-fit span { padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); background: var(--surface); font-size: 11px; }
.model-capabilities { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.model-capabilities li { display: flex; gap: 9px; color: var(--muted); font-size: 12px; }
.model-capabilities li span { color: var(--console-accent); }
.model-detail-employees { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.model-detail-employees li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 12px; }
.model-detail-employees small { color: var(--muted); font-size: 10px; }
.model-detail-footer { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }

.copilot-composer { padding-top: 12px; }
.copilot-composer > .copilot-composer-input {
  display: block;
  padding: 11px 11px 8px;
  border-radius: 14px;
  background: var(--surface);
}
.copilot-composer textarea { display: block; width: 100%; min-height: 58px; padding: 3px 2px 7px; font-size: 14px; line-height: 1.45; }
.copilot-composer-bottom { display: flex; align-items: center; gap: 3px; min-height: 34px; }
.copilot-composer .copilot-attach { width: 31px; height: 31px; flex-basis: 31px; border-radius: 7px !important; color: var(--muted) !important; font-size: 22px; }
.copilot-composer .copilot-attach:hover, .copilot-composer .copilot-attach:focus-visible { color: var(--console-accent) !important; background: var(--sidebar-hover) !important; transform: none; }
.copilot-runtime-menu { position: relative; display: block; flex: 0 0 auto; }
.copilot-runtime-menu + .copilot-runtime-menu { margin-left: -2px; }
.copilot-runtime-trigger {
  display: inline-flex !important; align-items: center; gap: 4px; width: auto !important; height: 29px !important; flex: 0 0 auto !important;
  padding: 0 6px !important; border: 0 !important; border-radius: 6px !important; color: var(--muted) !important; background: transparent !important;
  font: 600 10px/1 var(--font-sans) !important; white-space: nowrap;
}
.copilot-runtime-trigger:hover, .copilot-runtime-trigger[aria-expanded="true"] { color: var(--text) !important; background: var(--sidebar-hover) !important; }
.copilot-runtime-trigger:disabled { cursor: wait; opacity: .62; }
.copilot-runtime-trigger svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.copilot-runtime-trigger:first-child svg { width: 14px; height: 14px; }
.copilot-permission-trigger { width: 29px !important; padding: 0 !important; justify-content: center; }
.copilot-permission-trigger svg { width: 15px !important; height: 15px !important; }
.copilot-runtime-popover {
  position: absolute; z-index: 30; bottom: calc(100% + 8px); left: 0; display: grid; width: min(272px, calc(100vw - 42px)); gap: 2px;
  padding: 5px; border: 1px solid var(--line) !important; border-radius: 10px; background: var(--popover-bg) !important; box-shadow: 0 14px 34px rgba(0,0,0,.24) !important;
  animation: tensor-item-enter 140ms var(--motion-ease-enter) both;
}
.copilot-model-popover { left: auto; right: 0; width: min(218px, calc(100vw - 42px)); }
.copilot-runtime-popover[hidden] { display: none; }
.copilot-runtime-popover button {
  display: grid !important; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; height: auto !important; min-height: 34px;
  padding: 8px 9px !important; border: 0 !important; border-radius: 7px !important; color: var(--muted) !important; background: transparent !important; text-align: left;
}
.copilot-runtime-popover button:hover, .copilot-runtime-popover button:focus-visible { color: var(--text) !important; background: var(--sidebar-hover) !important; outline: 0; }
.copilot-runtime-popover button[aria-checked="true"] { color: var(--text) !important; }
.copilot-runtime-popover button[aria-checked="true"]::after { content: "✓"; grid-column: 2; grid-row: 1 / span 2; color: var(--console-accent); font-size: 12px; }
.copilot-runtime-popover strong { font-size: 11px; font-weight: 650; }
.copilot-runtime-popover small { grid-column: 1; margin: 1px 0 0 !important; color: var(--muted) !important; font-size: 9px !important; line-height: 1.35; }
.autonomous-warning { display: inline-flex; align-items: center; margin-left: 4px; color: #c29f6b; font-size: 10px; cursor: help; }
.autonomous-warning:focus-visible { outline: 1px solid color-mix(in srgb, #c29f6b 65%, transparent); outline-offset: 2px; border-radius: 2px; }
.copilot-title-updated { display: inline-block; animation: tensor-title-settle 220ms var(--motion-ease-enter) both; }
@keyframes tensor-title-settle { from { opacity: .35; transform: translateY(2px); } to { opacity: 1; transform: translateY(0); } }
.copilot-composer .copilot-send { width: 34px; height: 31px; flex: 0 0 34px; margin-left: auto; border-radius: 8px !important; font-size: 15px; font-weight: 700; }
.copilot-composer .copilot-send:disabled { color: var(--muted) !important; background: var(--sidebar-hover) !important; opacity: 1; }
.copilot-composer #copilotStatus { margin: 6px 1px 0; min-height: 12px; }
@media (max-width: 540px) {
  .console-model-card, .console-model-copy { min-height: 158px !important; }
  .copilot-runtime-trigger { padding-inline: 4px !important; }
  .copilot-composer textarea { min-height: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  .console-model-card, .model-card-disclosure b, .copilot-runtime-popover, .copilot-title-updated { transition: none !important; animation: none !important; }
}

.account-option-idrok svg,
.idrok-link-mark,
.idrok-wordmark svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.account-option-idrok { color: var(--console-accent); }
.idrok-link-mark { width: 14px; height: 14px; margin-right: 5px; vertical-align: -2px; }

/* Collapsed workspace popover lives above the application canvas. */
@media (min-width: 1001px) {
  .app-page.sidebar-collapsed .app-sidebar {
    overflow: visible;
  }
  .app-page.sidebar-collapsed .sidebar-workspace-selector {
    position: static;
    z-index: auto;
  }
  .app-page.sidebar-collapsed .sidebar-workspace-selector .workspace-menu {
    position: fixed;
    z-index: 2200;
    top: 88px;
    right: auto;
    left: calc(var(--app-sidebar-track) + 10px);
    width: min(286px, calc(100vw - var(--app-sidebar-track) - 28px));
    max-height: min(440px, calc(100vh - 112px));
    overflow-y: auto;
    transform-origin: top left;
  }
}

/* Operational discovery and trust surfaces */
.roster-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(190px, 220px) auto;
  align-items: end;
  gap: 12px;
  margin: 0 0 18px;
}

.roster-search,
.roster-filter {
  min-height: 52px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  transition:
    border-color var(--motion-duration-fast) var(--motion-ease-standard),
    background-color var(--motion-duration-fast) var(--motion-ease-standard),
    box-shadow var(--motion-duration-fast) var(--motion-ease-standard);
}

.roster-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
}

.roster-search svg { flex: 0 0 auto; }

.roster-search input,
.roster-filter select {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.roster-search input::placeholder { color: var(--muted); }

.roster-filter {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
}

.roster-filter > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.roster-filter select { cursor: pointer; }

.roster-search:focus-within,
.roster-filter:focus-within {
  border-color: color-mix(in srgb, var(--console-accent) 58%, var(--border));
  box-shadow: none;
}
.roster-search:hover,
.roster-filter:hover { border-color: color-mix(in srgb, var(--console-accent) 40%, var(--border)); background: color-mix(in srgb, var(--card) 88%, transparent); }

.roster-result-count {
  min-width: 96px;
  padding: 0 2px 14px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.roster-card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: auto;
}

.roster-compare-button {
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  transition:
    color var(--motion-duration-fast) var(--motion-ease-standard),
    background-color var(--motion-duration-fast) var(--motion-ease-standard),
    border-color var(--motion-duration-fast) var(--motion-ease-standard),
    transform var(--motion-duration-instant) var(--motion-ease-standard);
}

.roster-compare-button:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 5%, transparent);
}

.roster-compare-button:active { transform: scale(.97); }

.roster-compare-button[aria-pressed="true"] {
  color: var(--console-accent);
  border-color: color-mix(in srgb, var(--console-accent) 44%, var(--border));
  background: color-mix(in srgb, var(--console-accent) 9%, transparent);
}

.roster-compare-tray {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: -2px 0 18px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: color-mix(in srgb, var(--card) 94%, var(--console-accent) 6%);
}

.roster-compare-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.roster-compare-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: var(--card);
  font-size: 11px;
  font-weight: 750;
}

.roster-compare-chip button,
.roster-compare-clear {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
}

.roster-compare-clear {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 750;
}

.roster-no-results {
  padding: 34px 18px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}

.roster-compare-tray[hidden],
.roster-no-results[hidden],
[data-roster-card][hidden] { display: none !important; }

html[data-theme="dark"] .roster-filter select option {
  color: var(--text);
  background: #181916;
}

/* Employee states and avatar editing */
.employee-item::before,
.employee-item.employee-editor-trigger::before {
  display: none !important;
  content: none !important;
}

.employee-status {
  border: 1px solid var(--border);
  box-shadow: none !important;
}

.employee-status.active {
  color: var(--semantic-success);
  border-color: color-mix(in srgb, var(--semantic-success) 32%, var(--line));
  background: color-mix(in srgb, var(--semantic-success) 9%, transparent);
}

.employee-status.paused {
  color: var(--semantic-inactive);
  border-color: color-mix(in srgb, var(--semantic-inactive) 30%, var(--line));
  background: color-mix(in srgb, var(--semantic-inactive) 8%, transparent);
}

.employee-avatar-picker {
  width: min(286px, calc(100vw - 40px));
  overflow: visible;
  z-index: 240;
}

.employee-emoji-options {
  grid-template-columns: repeat(5, 42px);
  justify-content: start;
  overflow: visible;
}

.employee-emoji-options button {
  width: 42px;
  height: 42px;
  border: 1px solid transparent;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  font-size: 21px;
  line-height: 1;
}

.employee-emoji-options button:hover,
.employee-emoji-options button:focus-visible {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--text) 6%, transparent);
}

.employee-emoji-options button.is-selected {
  outline: 0;
  color: var(--text);
  border-color: color-mix(in srgb, var(--console-accent) 45%, var(--border));
  background: color-mix(in srgb, var(--console-accent) 10%, transparent);
  transform: none;
}

/* Approval and audit provenance */
.approval-card::before,
.approval-open::before { display: none !important; }

.approval-reason {
  padding-left: 0 !important;
  border-left: 0 !important;
  background: transparent !important;
}

.approval-review-cue b { color: var(--muted); }

.app-logo {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--card) 92%, #fff 8%);
}

.app-logo svg {
  width: 28px;
  height: 28px;
  display: block;
}

.app-logo-tensor span {
  color: var(--console-accent);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
}

.approval-count,
.sidebar-notification {
  background: #c86f72 !important;
  border-color: #da8588 !important;
  box-shadow: none !important;
}

@media (max-width: 900px) {
  .roster-toolbar { grid-template-columns: 1fr 190px; }
  .roster-result-count { grid-column: 1 / -1; padding: 0; text-align: left; }
}

@media (max-width: 640px) {
  .roster-toolbar { grid-template-columns: 1fr; }
  .roster-result-count { grid-column: auto; }
  .roster-compare-tray { align-items: flex-start; }
  .roster-card-actions { grid-template-columns: 1fr; }
  .employee-emoji-options { grid-template-columns: repeat(5, minmax(36px, 1fr)); }
  .employee-emoji-options button { width: 100%; }
}

/* Billing is a calm, single-column account flow. */
#page-billing {
  width: min(980px, 100%);
  margin-inline: auto;
  padding-bottom: 90px;
}
#page-billing .billing-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
#page-billing .billing-summary-card { min-height: 164px; }
#page-billing .billing-console-grid {
  grid-template-columns: 1fr;
  gap: 16px;
}
#page-billing .billing-panel { width: 100%; }
#page-billing button {
  transition: transform var(--motion-duration-fast) var(--motion-ease-standard), border-color var(--motion-duration-fast) var(--motion-ease-standard), background-color var(--motion-duration-fast) var(--motion-ease-standard), color var(--motion-duration-fast) var(--motion-ease-standard);
}
#page-billing button:not(:disabled):hover { transform: translateY(-1px); }
#page-billing button:not(:disabled):active { transform: translateY(0) scale(.985); }
#page-billing .billing-purchase-summary button,
#page-billing .billing-form-actions button {
  color: #11130e;
  background: var(--console-accent);
  border-color: var(--console-accent);
}
#page-billing .billing-purchase-summary button:focus-visible,
#page-billing .billing-form-actions button:focus-visible,
#page-billing .billing-history header button:focus-visible,
#page-billing .credit-package-grid button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--console-accent) 70%, white);
  outline-offset: 2px;
}
html[data-theme="light"] #page-billing .billing-purchase-summary button,
html[data-theme="light"] #page-billing .billing-form-actions button {
  color: #fff;
  background: #53663e;
  border-color: #53663e;
}
@media (max-width: 760px) {
  #page-billing .billing-page-head { align-items: flex-start; }
  #page-billing .billing-balance { min-width: 0; text-align: left; }
  #page-billing .billing-summary-grid { grid-template-columns: 1fr; }
  #page-billing .billing-summary-card { min-height: 142px; }
  #page-billing .credit-package-grid,
  #page-billing .billing-form { grid-template-columns: 1fr; }
  #page-billing .billing-field-wide { grid-column: auto; }
}

/* Remove legacy electric-blue and glow treatments across the console. */
.ws-avatar,
.ws-item-avatar,
.employee-avatar,
.badge-tag,
.test-badge {
  background: var(--console-accent-soft);
  color: var(--console-accent);
}

.sidebar-link {
  transition-property: color, background-color, border-color, opacity, transform;
  transition-duration: var(--motion-fast);
  transition-timing-function: var(--ease-out);
}
.sidebar-link.active {
  color: var(--text);
  background: var(--sidebar-active);
  box-shadow: none;
}
.sidebar-link:hover { transform: translateX(1px); }

.stat-card,
.roster-card,
.employee-item,
.channel-label,
.radio-option,
.file-upload,
.btn-primary,
.btn-secondary {
  transition-property: color, background-color, border-color, opacity, transform;
  transition-duration: var(--motion-fast);
  transition-timing-function: var(--ease-out);
}
.stat-card::before,
.roster-card::before { display: none; }
.stat-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--text) 16%, var(--line));
  box-shadow: none;
}
.employee-item::before { background: var(--console-accent); }

.settings-tab.active,
.radio-option input[type="radio"]:checked + label,
.radio-option input[type="radio"]:checked ~ label strong {
  color: var(--console-accent);
  border-bottom-color: var(--console-accent);
}
.file-upload:hover,
.channel-option input:checked + .channel-label {
  border-color: var(--console-accent);
  background: var(--console-accent-soft);
  box-shadow: none;
}
.audit-status.pending {
  color: var(--console-accent);
  background: transparent;
}
.test-message.user {
  color: var(--text);
  background: var(--console-accent-soft);
}
.btn-send-test {
  color: var(--bg);
  background: var(--text);
  box-shadow: none;
}
.btn-send-test:hover { background: color-mix(in srgb, var(--text) 88%, var(--bg)); }

html[data-theme="light"] .sidebar-link.active { color: #252720; background: #e0e2db; }
html[data-theme="light"] .sidebar-link:hover { color: #252720; background: #eceee8; }

/* ============================================================
   Compact console shell, workspace copilot, and profile tools
   ============================================================ */
.app-page.sidebar-collapsed { --app-sidebar-track: 68px; }
.app-header .header-inner { height: 63px; padding: 0 24px; }
.app-header .brand { min-width: 0; white-space: nowrap; }
.app-header .brand-name {
  display: inline-block;
  max-width: 120px;
  margin-left: 7px;
  overflow: hidden;
  opacity: 1;
  transform: translateX(0);
  transition: max-width 320ms cubic-bezier(.2,.75,.25,1), margin 320ms cubic-bezier(.2,.75,.25,1), opacity var(--motion-duration-fast) var(--motion-ease-standard), transform 320ms cubic-bezier(.2,.75,.25,1);
}
.app-page.sidebar-collapsed .app-header .brand-name {
  max-width: 0;
  margin-left: 0;
  opacity: 0;
  transform: translateX(-8px);
}
.app-sidebar { padding-top: 14px; }
.sidebar-top,
.workspace-selector,
.sidebar-menu,
.sidebar-account { transition: padding 360ms cubic-bezier(.2,.75,.25,1), margin 360ms cubic-bezier(.2,.75,.25,1); }
.sidebar-link,
.workspace-btn,
.account-trigger { min-height: 44px; }
.sidebar-link > svg,
.workspace-home,
.account-avatar,
.sidebar-toggle svg { flex: 0 0 auto; transform: none !important; }
.app-page.sidebar-collapsed .app-sidebar { padding-inline: 8px; }
.app-page.sidebar-collapsed .sidebar-menu { padding-inline: 0; }
.app-page.sidebar-collapsed .sidebar-link,
.app-page.sidebar-collapsed .workspace-btn,
.app-page.sidebar-collapsed .account-trigger { width: 52px; min-width: 52px; justify-content: center; padding-inline: 0; margin-inline: 0; }
.app-page.sidebar-collapsed .sidebar-top { padding-inline: 0; }
.app-page.sidebar-collapsed .sidebar-toggle { margin-inline: auto; }
.app-main { padding: 28px clamp(24px, 3vw, 48px) 54px; }
.app-page-content { width: 100%; max-width: 1280px; margin-inline: auto; }
.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: clamp(32px, 3vw, 42px); line-height: .98; }
.page-subtitle { margin-top: 10px; font-size: 15px; }
.dashboard-content { gap: 26px; }
.console-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.stat-card { min-height: 126px; padding: 18px; border-width: 1px; }
.stat-label { font-size: 13px; }
.stat-value { margin-top: 24px; font-size: 30px; line-height: 1; }
.stat-note { margin-top: 12px; font-size: 12px; }
.credit-stat-card { position: relative; }
.stat-inline-action {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--console-accent);
  background: transparent;
  font: 600 11px/1 "Inter", sans-serif;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.stat-inline-action:hover { color: var(--text); background: var(--console-accent-soft); border-color: var(--console-accent); transform: translateY(-1px); }
.console-workspace-grid { gap: 16px; }
.console-panel { border-width: 1px; }
.console-models { margin-top: 0; }
.console-section-head { margin-bottom: 14px; }
.console-model-grid { gap: 14px; }
.console-model-card { min-height: 248px; border-width: 1px; }
.console-model-visual { min-height: 106px; height: 106px; }
.console-model-visual svg { width: 82px; height: 82px; }
.console-model-copy { padding: 16px; }
.console-model-copy h3 { font-size: 20px; }
.console-model-copy p { min-height: 36px; font-size: 12px; line-height: 1.45; }
.console-model-copy li { font-size: 10px; }

.account-copy { min-width: 0; }
.account-copy small { display: block; }
.account-credit-summary { margin-top: 2px; color: var(--console-accent) !important; font-size: 10px !important; }
.account-menu-head > div { display: grid; gap: 2px; }
.account-menu-credits { color: var(--console-accent) !important; }

.workspace-item { width: 100%; border: 0; color: inherit; text-align: left; }
.workspace-item.active { background: var(--sidebar-active); }
.workspace-create-dialog { width: min(520px, calc(100vw - 32px)); padding: 34px; }
.workspace-create-dialog h2 { margin: 7px 0 8px; font: 500 clamp(28px, 4vw, 38px)/1.05 Georgia, serif; }
.workspace-create-dialog > p:not(.panel-kicker) { color: var(--muted); font-size: 14px; line-height: 1.55; }
.workspace-create-dialog form { display: grid; gap: 18px; margin-top: 26px; }
.workspace-create-dialog label { display: grid; gap: 8px; color: var(--muted); font: 600 13px/1.3 "Inter", sans-serif; }
.workspace-create-dialog input,
.workspace-create-dialog textarea {
  width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); background: var(--surface); font: 500 14px/1.45 "Inter", sans-serif; outline: none; box-shadow: none;
}
.workspace-create-dialog input:focus,
.workspace-create-dialog textarea:focus { border-color: var(--console-accent); }

.employee-editor-dialog { width: min(780px, calc(100vw - 30px)); }
.employee-editor-head { align-items: center; }
.employee-editor-head h2 { font-size: 28px; }
.employee-editor-head p:not(.panel-kicker) { font-size: 14px; line-height: 1.5; }
.employee-avatar-editor { display: grid; justify-items: center; gap: 8px; }
.employee-editor-avatar { overflow: hidden; font-size: 28px; }
.employee-editor-avatar img,
.employee-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.employee-avatar-upload { position: relative; color: var(--console-accent); font: 600 10px/1 "Inter", sans-serif; cursor: pointer; }
.employee-avatar-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.employee-icon-fieldset { margin: 0; padding: 0; border: 0; }
.employee-icon-fieldset legend,
.employee-editor-form > label,
.employee-editor-grid label { color: var(--muted); font-size: 13px; font-weight: 600; }
.employee-emoji-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.employee-emoji-options button {
  display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line); border-radius: 9px;
  color: var(--text); background: var(--surface); font-size: 18px; cursor: pointer; box-shadow: none;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}
.employee-emoji-options button:hover,
.employee-emoji-options button.selected { border-color: var(--console-accent); background: var(--console-accent-soft); transform: translateY(-1px); }
.employee-editor-form input,
.employee-editor-form textarea,
.employee-editor-form select { font-size: 14px; }
.employee-file-list { display: grid; gap: 7px; margin: -6px 0 3px; padding: 0; list-style: none; }
.employee-file-list li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.employee-file-list span { display: grid; gap: 2px; min-width: 0; }
.employee-file-list b { overflow: hidden; color: var(--text); font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.employee-file-list small { color: var(--muted); font-size: 10px; }
.employee-file-list button { width: 28px; height: 28px; border: 0; color: var(--muted); background: transparent; font-size: 18px; cursor: pointer; }
.employee-editor-actions .cta { min-width: 150px; color: var(--text); }
.employee-editor-actions .cta-primary { color: var(--bg); background: var(--text); }

#hireModal .modal-content,
#hireModal .form-fieldset,
#hireModal .form-group input,
#hireModal .form-group textarea,
#hireModal .form-group select,
#hireModal .file-upload,
#hireModal .channel-label,
#hireModal .radio-option { border-width: 1px !important; box-shadow: none !important; }
#hireModal input[type="checkbox"],
#hireModal input[type="radio"] { accent-color: var(--console-accent); }
#hireModal .wizard-step { overflow: visible; }
#hireModal .channel-label,
#hireModal .radio-option { min-height: 48px; }

.copilot-launcher {
  position: fixed; z-index: 1050; right: 22px; bottom: 22px; display: grid; width: 52px; height: 52px; place-items: center;
  border: 1px solid color-mix(in srgb, var(--console-accent) 48%, var(--line)); border-radius: 50%; color: var(--bg);
  background: var(--console-accent); cursor: pointer; box-shadow: 0 12px 34px rgba(0,0,0,.24);
  transition: transform var(--motion-duration-base) var(--motion-ease-enter), background-color var(--motion-duration-fast) var(--motion-ease-standard), color var(--motion-duration-fast) var(--motion-ease-standard);
}
.copilot-launcher:hover { transform: translateY(-3px) rotate(-3deg); }
.copilot-launcher.is-open { transform: scale(.9); opacity: 0; pointer-events: none; }
.copilot-launcher svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.copilot-scrim { position: fixed; z-index: 1055; inset: 0; background: rgba(0,0,0,.28); opacity: 0; pointer-events: none; transition: opacity 260ms ease; }
.copilot-scrim.is-open { opacity: 1; pointer-events: auto; }
.copilot-drawer {
  position: fixed; z-index: 1060; top: 0; right: 0; bottom: 0; display: grid; grid-template-rows: auto auto minmax(0,1fr) auto auto;
  width: min(420px, 94vw); padding: 22px; border-left: 1px solid var(--line); color: var(--text); background: var(--bg);
  box-shadow: -24px 0 70px rgba(0,0,0,.3); transform: translate3d(102%,0,0); visibility: hidden;
  transition: transform var(--motion-duration-drawer) var(--motion-ease-enter), visibility 0s linear var(--motion-duration-drawer); will-change: transform;
}
.copilot-drawer.is-open { transform: translate3d(0,0,0); visibility: visible; transition-delay: 0s; }
.copilot-drawer header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.copilot-drawer h2 { margin: 4px 0 0; font: 500 29px/1 Georgia, serif; }
.copilot-drawer header button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: var(--surface); font-size: 22px; cursor: pointer; }
.copilot-balance { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; color: var(--muted); font-size: 12px; }
.copilot-balance strong { color: var(--console-accent); }
.copilot-messages { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; padding: 12px 2px 18px; }
.copilot-message { max-width: 88%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; color: var(--text); background: var(--card); font-size: 13px; line-height: 1.5; animation: copilotMessageIn 280ms ease both; }
.copilot-message.user { align-self: flex-end; border-color: color-mix(in srgb, var(--console-accent) 35%, var(--line)); border-radius: 14px 14px 4px 14px; background: var(--console-accent-soft); }
@keyframes copilotMessageIn { from { opacity: 0; transform: translateY(5px); } }
.copilot-suggestions { display: flex; flex-wrap: wrap; gap: 7px; padding-bottom: 12px; }
.copilot-suggestions button { padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: transparent; font-size: 11px; cursor: pointer; }
.copilot-suggestions button:hover { color: var(--text); border-color: var(--console-accent); background: var(--console-accent-soft); }
.copilot-composer { padding-top: 13px; border-top: 1px solid var(--line); }
.copilot-composer > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.copilot-composer > div { display: flex; align-items: flex-end; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.copilot-composer textarea { flex: 1; min-height: 44px; resize: none; border: 0; outline: 0; color: var(--text); background: transparent; font: 500 13px/1.45 "Inter", sans-serif; box-shadow: none; }
.copilot-composer button { display: grid; flex: 0 0 36px; height: 36px; place-items: center; border: 0; border-radius: 9px; color: var(--bg); background: var(--console-accent); font-size: 19px; cursor: pointer; }
.copilot-composer small { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; }

html[data-theme="light"] .stat-inline-action:hover,
html[data-theme="light"] .employee-emoji-options button:hover,
html[data-theme="light"] .copilot-suggestions button:hover { color: #252720; background: #e9ece2; }
html[data-theme="light"] .employee-editor-actions .cta-primary,
html[data-theme="light"] .workspace-create-dialog .cta-primary { color: #f6f6f2; background: #252720; }
html[data-theme="light"] .copilot-drawer { background: #f5f5f1; }

@media (max-width: 1280px) {
  .console-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .app-page, .app-page.sidebar-collapsed { grid-template-columns: 1fr; }
  .app-main { padding: 24px 18px 72px; }
  .console-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-page.sidebar-collapsed .app-header .brand-name { max-width: 120px; margin-left: 7px; opacity: 1; transform: none; }
}
@media (max-width: 620px) {
  .console-metrics { grid-template-columns: 1fr; }
  .employee-editor-grid { grid-template-columns: 1fr; }
  .employee-editor-actions { flex-direction: column-reverse; }
  .employee-editor-actions .cta { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .app-page, .app-header .brand-name, .copilot-drawer, .copilot-scrim, .copilot-launcher, .copilot-message { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}

/* ============================================================
   Production interaction pass: billing, modals, and copilot rail
   ============================================================ */
.modal-overlay {
  z-index: 1200 !important;
  pointer-events: auto;
}
.modal-overlay .modal-content,
.modal-overlay form,
.modal-overlay input,
.modal-overlay textarea,
.modal-overlay select,
.modal-overlay button,
.copilot-drawer,
.copilot-drawer form,
.copilot-drawer textarea,
.copilot-drawer button {
  pointer-events: auto;
}
input,
textarea {
  -webkit-user-select: text;
  user-select: text;
  caret-color: var(--console-accent);
}

/* The hiring workflow uses one quiet, consistent outline. */
#hireModal .form-fieldset,
#hireModal .form-group input,
#hireModal .form-group textarea,
#hireModal .form-group select,
#hireModal .file-upload,
#hireModal .channel-label,
#hireModal .radio-option {
  border: 1px solid var(--line) !important;
  outline: 0 !important;
  box-shadow: none !important;
  filter: none !important;
}
#hireModal .form-fieldset::before,
#hireModal .form-fieldset::after,
#hireModal .radio-option::before,
#hireModal .channel-label::before { box-shadow: none !important; }
#hireModal .form-group input:focus,
#hireModal .form-group textarea:focus,
#hireModal .form-group select:focus,
#hireModal .file-upload:focus-within {
  border-color: color-mix(in srgb, var(--console-accent) 72%, var(--line)) !important;
}

.employee-custom-emoji {
  display: grid;
  grid-template-columns: minmax(0, 260px) 1fr;
  align-items: center;
  gap: 6px 14px;
  margin-top: 9px;
}
.employee-custom-emoji input {
  grid-row: 1 / 3;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  box-shadow: none;
}
.employee-custom-emoji input:focus { border-color: var(--console-accent); }
.employee-custom-emoji small { color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.45; }
#employeeEditorPause {
  border: 1px solid color-mix(in srgb, #d18d70 66%, var(--line)) !important;
  color: #e0a085 !important;
  background: color-mix(in srgb, #a7482c 10%, transparent) !important;
  box-shadow: none !important;
}
#employeeEditorPause:hover {
  border-color: #d18d70 !important;
  color: #f0b49b !important;
  background: color-mix(in srgb, #a7482c 18%, transparent) !important;
  transform: translateY(-1px);
}
html[data-theme="light"] #employeeEditorPause {
  color: #8e402c !important;
  background: #fff7f2 !important;
  border-color: #c6816c !important;
}

/* Billing console */
.billing-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.billing-summary-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.billing-summary-card,
.billing-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: var(--card);
  box-shadow: none;
}
.billing-summary-card { display: grid; align-content: start; gap: 7px; min-width: 0; min-height: 122px; padding: 14px; }
.billing-summary-card > span { color: var(--muted); font: 600 10px/1.2 "IBM Plex Mono", monospace; letter-spacing: .055em; text-transform: uppercase; }
.billing-summary-card > strong { overflow-wrap: anywhere; color: var(--text); font: 600 18px/1.15 "Inter", sans-serif; letter-spacing: -.022em; }
.billing-summary-card > small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.billing-summary-card.billing-balance-card { border-color: color-mix(in srgb, var(--semantic-success) 30%, var(--line)); }
.billing-summary-card.billing-balance-card > strong { color: var(--semantic-success); font-size: 27px; letter-spacing: -.04em; }
.billing-console-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 24px; }
.billing-panel { padding: 18px 0; border-width: 1px 0 0; border-radius: 0; background: transparent; }
.billing-panel > header { display: flex; align-items: start; justify-content: space-between; gap: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.billing-panel h2 { margin: 3px 0 0; font: 600 18px/1.15 "Inter", sans-serif; letter-spacing: -.018em; }
.billing-secure,
.billing-saved { padding: 6px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.billing-saved { color: var(--console-accent); }
.billing-panel-copy { margin: 12px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.credit-package-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
#page-billing .credit-custom { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 3px 12px; align-items: center; margin-top: 10px; font-size: 12px; color: var(--text); }
#page-billing .credit-custom[hidden] { display: none; }
#page-billing .credit-custom small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; min-height: 14px; }
#page-billing .credit-custom-input { display: flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
#page-billing .credit-custom-input:focus-within { border-color: var(--console-accent); }
#page-billing .credit-custom-input b { color: var(--muted); font-weight: 500; }
#page-billing .credit-custom-input input { width: 100%; min-width: 0; border: 0; padding: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; box-shadow: none; }
.credit-package-grid button {
  display: grid; gap: 3px; min-height: 72px; padding: 10px; border: 1px solid var(--line); border-radius: 9px;
  color: var(--text); text-align: left; background: var(--surface); box-shadow: none; cursor: pointer;
}
.credit-package-grid button:hover,
.credit-package-grid button.selected { border-color: var(--console-accent); background: var(--console-accent-soft); transform: translateY(-1px); }
.credit-package-grid strong { font-size: 16px; }
.credit-package-grid span,
.credit-package-grid small { color: var(--muted); font-size: 10px; }
.billing-purchase-summary { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.billing-purchase-summary span { color: var(--muted); font-size: 10px; }
.billing-purchase-summary strong { font-size: 13px; }
.billing-purchase-summary button,
.billing-form-actions button,
.billing-history header button {
  grid-column: 2; grid-row: 1 / 3; align-self: stretch; padding: 8px 11px; border: 1px solid var(--console-accent); border-radius: 8px;
  color: var(--bg); background: var(--console-accent); font-size: 11px; font-weight: 700; box-shadow: none; cursor: pointer;
}
.billing-purchase-summary button:disabled { opacity: .42; cursor: not-allowed; }
.billing-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.billing-form label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 600; }
.billing-form input,
.billing-form select { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: var(--surface); outline: none; box-shadow: none; }
.billing-form input:focus,
.billing-form select:focus { border-color: var(--console-accent); }
.billing-field-wide { grid-column: 1 / -1; }
.billing-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.billing-form-actions small { color: var(--muted); font-size: 10px; }
.billing-form-actions button { grid-column: auto; grid-row: auto; min-height: 38px; }
.billing-history { margin-top: 12px; }
.billing-history header button { grid-column: auto; grid-row: auto; color: var(--text); background: transparent; border-color: var(--line); }
.billing-history-row { display: grid; grid-template-columns: 112px 1.4fr 1fr 84px 70px; gap: 12px; align-items: center; padding: 12px 2px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.billing-history-row strong { color: var(--text); }
.billing-status-paid { justify-self: end; color: var(--console-accent); }

/* Copilot Drawer & Composer with Neutral Grey Border (No Green Frame) */
.copilot-drawer { pointer-events: none; color: var(--text); background: #151613; }
.copilot-drawer.is-open { pointer-events: auto; }
.copilot-composer {
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.copilot-composer > div {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #363831 !important;
  border-radius: 12px;
  background: #181916 !important;
  transition: border-color var(--motion-duration-fast) var(--motion-ease-standard), box-shadow var(--motion-duration-fast) var(--motion-ease-standard);
}
.copilot-composer textarea {
  color: #f2f1eb;
  caret-color: #dcdbd4;
}
.copilot-composer textarea::placeholder {
  color: #8f9189;
  opacity: 1;
}
.copilot-composer > div:focus-within {
  border-color: #606259 !important;
  box-shadow: 0 0 0 1px #606259 !important;
}
html[data-theme="light"] .copilot-composer > div {
  background: #fff !important;
  border-color: #cbcdc4 !important;
}
html[data-theme="light"] .copilot-composer textarea {
  color: #252720;
}
html[data-theme="light"] .copilot-composer > div:focus-within {
  border-color: #8c8f85 !important;
  box-shadow: 0 0 0 1px #8c8f85 !important;
}

@media (max-width: 860px) {
  .billing-summary-grid,
  .billing-console-grid { grid-template-columns: 1fr; }
  .credit-package-grid { grid-template-columns: repeat(3, minmax(110px, 1fr)); overflow-x: auto; }
  .billing-history-row { grid-template-columns: 88px 1fr auto; }
  .billing-history-row span:nth-child(3), .billing-history-row span:nth-child(4) { display: none; }
}
@media (max-width: 620px) {
  .billing-page-head { align-items: start; flex-direction: column; }
  .billing-balance { text-align: left; }
  .billing-form { grid-template-columns: 1fr; }
  .billing-field-wide { grid-column: auto; }
  .employee-custom-emoji { grid-template-columns: 1fr; }
  .employee-custom-emoji input { grid-row: auto; }
}

/* ============================================================
   Tensor application motion + coordinated assistant panels
   ============================================================ */
.app-page {
  --app-sidebar-track: 260px;
  --ai-sidebar-size: clamp(420px, 30vw, 520px);
  --ai-sidebar-track: 54px;
  --ai-history-size: clamp(260px, 19vw, 300px);
  display: grid;
  grid-template-columns: var(--app-sidebar-track) minmax(0, 1fr) var(--ai-sidebar-track);
  grid-template-rows: 100vh;
  height: 100vh;
  width: 100vw;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--bg);
  transition: grid-template-columns var(--motion-duration-drawer) var(--motion-ease-enter);
}

.app-page.sidebar-collapsed { --app-sidebar-track: 68px; }
.app-page.copilot-open,
body.copilot-open { --ai-sidebar-track: var(--ai-sidebar-size); }
.app-sidebar {
  grid-column: 1;
  grid-row: 1;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  padding: 12px 10px 16px;
  border-right: 1px solid var(--line);
  background: var(--sidebar-bg);
  z-index: 10;
}

.app-main {
  grid-column: 2;
  grid-row: 1;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  width: 100%;
  margin-right: 0 !important;
  padding: 28px clamp(24px, 3.5vw, 56px) 64px;
  background: var(--bg);
  container: tensor-workspace / inline-size;
}

.app-page-content.active { display: block !important; opacity: 1 !important; }

.modal-overlay {
  opacity: 0;
  transition: opacity var(--motion-duration-base) var(--motion-ease-standard);
}
.modal-overlay.is-present { opacity: 1; }
.modal-overlay .modal-content,
.workspace-create-dialog,
.model-detail-dialog,
.employee-editor-dialog {
  opacity: 0;
  transform: translate3d(0, var(--motion-distance-md), 0) scale(.985);
  transition:
    opacity var(--motion-duration-base) var(--motion-ease-enter),
    transform var(--motion-duration-base) var(--motion-ease-enter);
}
.modal-overlay.is-present .modal-content,
.modal-overlay.is-present .workspace-create-dialog,
.modal-overlay.is-present .model-detail-dialog,
.modal-overlay.is-present .employee-editor-dialog {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.copilot-drawer {
  transition:
    transform var(--motion-duration-drawer) var(--motion-ease-enter),
    opacity var(--motion-duration-base) var(--motion-ease-standard),
    visibility 0s linear var(--motion-duration-drawer);
}
.copilot-drawer.is-open { transition-delay: 0s; }
.copilot-drawer header { gap: 16px; }
.copilot-message {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  animation: tensor-item-enter var(--motion-duration-base) var(--motion-ease-enter) both;
}
.copilot-message.is-thinking { display: inline-flex; align-items: center; gap: 5px; width: fit-content; color: var(--muted); }
.copilot-message.is-thinking::after { content: ""; width: 18px; height: 4px; border-radius: 99px; background: currentColor; animation: tensor-loading 850ms var(--motion-ease-standard) infinite alternate; }
.copilot-message.error { border-color: color-mix(in srgb, #d87366 55%, var(--line)); }
.copilot-retry { margin-top: 8px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: transparent; }
.copilot-composer .copilot-attach { color: var(--muted); background: transparent; border: 1px solid var(--line); }
.copilot-composer .copilot-send:disabled { opacity: .4; cursor: not-allowed; }
.copilot-composer.is-busy .copilot-send { color: transparent; }
.copilot-composer.is-busy .copilot-send::after { content: ""; width: 10px; height: 10px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; color: var(--bg); animation: tensor-spin 700ms linear infinite; }

@media (min-width: 1001px) {
  .app-page.copilot-open,
  body.copilot-open { --ai-sidebar-track: var(--ai-sidebar-size); }
  .app-main { margin-right: 0 !important; }
  .copilot-drawer {
    position: relative;
    z-index: 20;
    grid-column: 3;
    grid-row: 1;
    top: 0;
    right: auto;
    bottom: 0;
    width: 100%;
    min-width: 0;
    height: 100%;
    opacity: 0;
    overflow: hidden;
    box-shadow: none;
    border-left: 1px solid var(--line);
    transform: translate3d(18px, 0, 0);
  }
  .copilot-drawer.is-open { opacity: 1; transform: translate3d(0, 0, 0); }
  .copilot-history-drawer {
    position: fixed;
    z-index: 35;
    top: 0;
    right: 54px;
    bottom: 0;
    width: min(var(--ai-history-size), calc(var(--ai-sidebar-size) - 64px));
  }
  .copilot-scrim,
  .copilot-scrim.is-open { opacity: 0; pointer-events: none; }
}

@container tensor-workspace (max-width: 980px) {
  .console-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-main-grid { grid-template-columns: 1fr; }
  .console-model-grid { grid-template-columns: 1fr; }
  .console-model-card { grid-template-columns: 150px minmax(0, 1fr); }
}

@container tensor-workspace (max-width: 640px) {
  .console-metrics { grid-template-columns: 1fr; }
  .console-model-card { grid-template-columns: 1fr; }
}

@media (max-width: 1000px) {
  .app-page {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    --ai-sidebar-track: 0px;
  }
  .mobile-topbar {
    display: flex;
    grid-column: 1;
    grid-row: 1;
  }
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform var(--motion-duration-drawer) var(--motion-ease-enter);
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
  }
  .app-page.sidebar-open .app-sidebar {
    transform: translateX(0);
  }
  .app-main {
    grid-column: 1;
    grid-row: 2;
    padding: 20px 16px 60px;
  }
  .copilot-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 100vw);
    z-index: 100;
    transform: translateX(100%);
    border-left: 1px solid var(--line);
  }
  .copilot-drawer.is-open {
    transform: translateX(0);
  }
  .copilot-history-drawer {
    position: fixed;
    z-index: 110;
    top: 0;
    right: 54px;
    bottom: 0;
    width: min(320px, calc(100vw - 54px));
  }
  .copilot-scrim.is-open {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 90;
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 620px) {
  .copilot-drawer { width: 100vw; padding: 18px; }
  .copilot-drawer h2 { font-size: 25px; }
  .copilot-launcher { right: 16px; bottom: 16px; }
}

/* 2026-08 Tensor OS refinement: compact workspace, neutral fields, stable editors. */
html:not([data-theme="light"]) :where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="range"]),
  textarea,
  select
) {
  color-scheme: dark;
  color: #f1f0e9 !important;
  background: #181916 !important;
  border: 1px solid #34362f !important;
  box-shadow: none !important;
}
html:not([data-theme="light"]) .workspace-create-dialog :where(input, textarea) {
  border-color: color-mix(in srgb, var(--console-accent) 54%, #34362f) !important;
}
html:not([data-theme="light"]) :where(input, textarea, select)::placeholder { color: #85877e !important; }
html:not([data-theme="light"]) :where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="range"]),
  textarea,
  select
):focus {
  outline: none !important;
  border-color: color-mix(in srgb, var(--console-accent) 78%, #34362f) !important;
  box-shadow: none !important;
}

.app-main {
  grid-column: 2;
  grid-row: 1;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  width: 100%;
  padding: 30px clamp(24px, 3.5vw, 56px) 60px;
}
.app-page-content { width: 100%; max-width: 1440px; margin-inline: 0; }
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}
.page-header-info { min-width: 0; }
.page-header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.header-doc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 9px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--card);
  text-decoration: none;
  transition: all var(--motion-duration-fast);
}
.header-doc-btn:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--text) 25%, var(--line));
}
.header-hire {
  min-height: 38px;
  padding: 0 16px;
  font-size: 13px;
}
.page-header h1 { font-size: clamp(30px, 3vw, 42px); line-height: 1.05; }
.page-header p { margin-top: 8px; font-size: 14px; color: var(--muted); }
.console-dashboard-shell { gap: 20px; }
.console-metrics { gap: 10px; }
.stat-card { min-height: 108px; padding: 14px; }
.stat-card-label { font-size: 11px; }
.stat-card-value { margin-top: 17px; font-size: 27px; }
.stat-card-note { margin-top: 5px; font-size: 10px; }
.dashboard-main-grid { gap: 12px; }
.console-models-head { margin-bottom: 10px; }
.console-model-grid { gap: 10px; }
.console-model-card { min-height: 210px; }
.console-model-visual { min-height: 88px; padding: 10px; }
.console-model-visual svg { width: 68px; height: 68px; }
.console-model-copy { padding: 13px; }
.console-model-copy h3 { font-size: 16px; }
.console-model-copy p { min-height: 30px; margin-top: 5px; font-size: 10px; line-height: 1.45; }
.console-model-copy li { font-size: 9px; }

.copilot-resize-handle { display: none; }

/* Tensor OS conversation history: assistant-scoped, never another workspace track. */
.copilot-drawer { grid-template-rows: auto auto minmax(0, 1fr) auto auto auto; }
.copilot-header {
  position: relative;
  min-height: 106px;
  align-items: flex-start !important;
  padding: 3px 46px 14px 0 !important;
}
.copilot-header h2 {
  margin: 0 !important;
  font-size: 25px;
  line-height: 1.05;
}
.copilot-runtime-state {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.copilot-control-rail {
  position: absolute;
  z-index: 60;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.copilot-control-rail button {
  display: grid;
  width: 32px !important;
  height: 32px !important;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  color: var(--muted) !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 18px !important;
  line-height: 1;
  transition:
    color var(--motion-duration-fast) var(--motion-ease-standard),
    border-color var(--motion-duration-fast) var(--motion-ease-standard),
    background-color var(--motion-duration-fast) var(--motion-ease-standard),
    transform var(--motion-duration-fast) var(--motion-ease-standard);
}
.copilot-control-rail button:hover,
.copilot-control-rail button:focus-visible,
.copilot-control-rail button[aria-expanded="true"] {
  color: var(--text) !important;
  border-color: color-mix(in srgb, var(--console-accent) 42%, var(--line)) !important;
  background: var(--surface) !important;
}
.copilot-control-rail button:active { transform: scale(.96); }
.copilot-history-toggle,
.copilot-history-new,
.copilot-history-close,
.copilot-history-open,
.copilot-history-more,
.copilot-history-menu button,
.copilot-history-state button,
.copilot-history-rename button {
  font: inherit;
  cursor: pointer;
  box-shadow: none;
}
.copilot-history-trigger { position: relative; }
.copilot-history-trigger svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.copilot-history-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 15px;
  padding: 1px 4px;
  border-radius: 999px;
  color: #f5f5ef;
  background: color-mix(in srgb, var(--console-accent) 72%, #252622);
  font-size: 8px;
  line-height: 13px;
  text-align: center;
}
.copilot-history-count:empty { display: none; }
.copilot-history-drawer {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  color: var(--text);
  background: var(--bg);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 42px rgba(0, 0, 0, .2);
  transform: translate3d(calc(100% + 54px), 0, 0);
  pointer-events: none;
  contain: paint;
  transition:
    transform var(--motion-duration-drawer) var(--motion-ease-enter),
    opacity var(--motion-duration-base) var(--motion-ease-standard),
    visibility 0s linear var(--motion-duration-drawer);
}
.copilot-history-drawer.is-open {
  visibility: visible;
  opacity: 1;
  transform: translate3d(0, 0, 0);
  pointer-events: auto;
  transition-delay: 0s;
}
.copilot-history-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 18px 14px 14px;
  border-bottom: 1px solid var(--line);
}
.copilot-history-drawer-head h2 { margin: 0; font: 500 22px/1.1 Georgia, serif; }
.copilot-history-drawer-head small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.copilot-history-drawer-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.copilot-history-new {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  font-size: 10px;
  font-weight: 650;
  transition: color var(--motion-duration-fast), border-color var(--motion-duration-fast), background-color var(--motion-duration-fast), transform var(--motion-duration-fast);
}
.copilot-history-new:hover,
.copilot-history-new:focus-visible {
  color: var(--text);
  border-color: color-mix(in srgb, var(--console-accent) 52%, var(--line));
  background: var(--console-accent-soft);
}
.copilot-history-new:active { transform: scale(.97); }
.copilot-history-close {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 18px;
  line-height: 1;
}
.copilot-history-close:hover,
.copilot-history-close:focus-visible { color: var(--text); background: var(--surface); }
.copilot-history-body {
  min-height: 0;
  padding: 10px 9px 18px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.copilot-history-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.copilot-history-list[aria-busy="true"] { opacity: .62; }
.copilot-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  border-radius: 10px;
  transition: background-color var(--motion-duration-fast) var(--motion-ease-standard);
}
.copilot-history-item:hover,
.copilot-history-item:focus-within { background: var(--surface); }
.copilot-history-item.is-active { background: var(--console-accent-soft); }
.copilot-history-open {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 9px 4px 9px 8px;
  border: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}
.copilot-history-open > span:last-child { min-width: 0; }
.copilot-history-open strong,
.copilot-history-open small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.copilot-history-open strong { font-size: 11px; font-weight: 620; }
.copilot-history-open small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.copilot-history-active {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: transparent;
}
.copilot-history-item.is-active .copilot-history-active { background: var(--console-accent); }
.copilot-history-more {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 9px;
  letter-spacing: -1px;
}
.copilot-history-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 150ms ease, color 150ms ease, background-color 150ms ease;
}

.copilot-history-more:hover,
.copilot-history-more:focus-visible {
  opacity: 1;
  color: var(--text);
  background: color-mix(in srgb, var(--text) 8%, transparent);
}

.copilot-history-item {
  position: relative !important;
}

.copilot-history-more {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 26px !important;
  height: 26px !important;
  border: 0 !important;
  border-radius: 6px !important;
  background: transparent !important;
  color: var(--muted) !important;
  cursor: pointer !important;
  opacity: 0.7 !important;
  transition: opacity 120ms ease, color 120ms ease, background-color 120ms ease !important;
}

.copilot-history-more:hover {
  opacity: 1 !important;
  color: var(--text) !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.copilot-history-menu {
  position: absolute !important;
  top: 34px !important;
  right: 6px !important;
  z-index: 9999 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  width: 130px !important;
  min-width: 130px !important;
  max-width: 130px !important;
  padding: 4px !important;
  background: #181915 !important;
  border: 1px solid #33342d !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

.copilot-history-menu[hidden] {
  display: none !important;
}

.copilot-history-menu .history-action-btn {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  width: 100% !important;
  height: 30px !important;
  min-height: 30px !important;
  max-height: 30px !important;
  padding: 0 8px !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 6px !important;
  color: #a1a09a !important;
  background: transparent !important;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  text-align: left !important;
  box-sizing: border-box !important;
  transition: color 120ms ease, background-color 120ms ease !important;
}

.copilot-history-menu .history-action-btn svg {
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  min-height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
  flex-shrink: 0 !important;
  stroke: currentColor !important;
  stroke-width: 1.5 !important;
  fill: none !important;
  transition: stroke 120ms ease !important;
}

.copilot-history-menu .history-action-btn span {
  font-size: 12px !important;
  line-height: 1 !important;
  color: inherit !important;
}

.copilot-history-menu .history-action-btn:hover {
  color: #f3f2eb !important;
  background: #252620 !important;
}

.copilot-history-menu .history-action-btn.action-delete:hover {
  color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.12) !important;
}

.copilot-history-menu .history-action-btn.action-delete:hover svg {
  stroke: #ef4444 !important;
}
.copilot-history-state {
  min-height: 52px;
  padding: 16px 9px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}
.copilot-history-state.is-loading { display: flex; align-items: center; gap: 7px; }
.copilot-history-state.is-loading > span {
  width: 10px;
  height: 10px;
  border: 1px solid var(--line);
  border-top-color: var(--console-accent);
  border-radius: 50%;
  animation: tensor-spin var(--motion-duration-slow) linear infinite;
}
.copilot-history-state.is-error { color: #d58b81; }
.copilot-history-state button { margin-left: 7px; }
.copilot-history-rename {
  padding: 7px;
  border-radius: 8px;
  background: var(--surface);
  animation: tensor-item-enter var(--motion-duration-fast) var(--motion-ease-enter) both;
}
.copilot-history-rename label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.copilot-history-rename input {
  width: 100%;
  height: 28px;
  padding: 0 7px;
  border: 1px solid color-mix(in srgb, var(--console-accent) 48%, var(--line)) !important;
  border-radius: 6px;
  font-size: 10px;
}
.copilot-history-rename > div { display: flex; gap: 5px; margin-top: 5px; }

html[data-theme="light"] .copilot-history-item.is-active { background: #e9ece2; }
html[data-theme="light"] .copilot-history-new:hover,
html[data-theme="light"] .copilot-history-new:focus-visible { color: #252720; background: #e9ece2; }

@media (min-width: 1500px) {
  .copilot-history-drawer { box-shadow: none; }
}

@media (min-width: 1001px) and (max-width: 1499px) {
  .copilot-history-drawer { width: 280px; }
}

@media (prefers-reduced-motion: reduce) {
  .copilot-history-drawer,
  .copilot-history-item,
  .copilot-history-menu,
  .copilot-history-rename { transition-duration: 1ms !important; animation-duration: 1ms !important; }
  .copilot-history-state.is-loading > span { animation: none; }
}

/* 2026-08-24 Tensor OS permanent right rail + expanding conversation surface. */
.copilot-drawer {
  padding: 0;
  background: var(--sidebar-bg);
}

.copilot-panel-content {
  position: absolute;
  inset: 0 54px 0 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  min-width: 0;
  padding: 18px 18px 16px;
  overflow: hidden;
  background: #151613;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(14px, 0, 0);
  transition:
    opacity var(--motion-duration-base) var(--motion-ease-standard),
    transform var(--motion-duration-drawer) var(--motion-ease-enter),
    visibility 0s linear var(--motion-duration-drawer);
}

.copilot-drawer.is-open .copilot-panel-content {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0);
  transition-delay: 0s;
}

.copilot-header {
  min-height: 0;
  padding: 1px 0 7px !important;
  border: 0 !important;
}

.copilot-header h2 {
  margin: 0 !important;
  font: 500 25px/1.08 Georgia, serif;
}

.copilot-messages {
  padding: 4px 1px 14px;
}

.copilot-control-rail {
  position: absolute;
  z-index: 60;
  top: 14px;
  right: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.copilot-control-rail button {
  width: 34px !important;
  height: 34px !important;
  background: transparent !important;
}

.copilot-composer { padding-top: 8px; }
.copilot-composer small:empty { display: none; }
.copilot-composer .copilot-send,
.copilot-composer .copilot-send:hover,
.copilot-composer .copilot-send:focus-visible {
  width: 42px;
  flex-basis: 42px;
  color: #f3f2ec !important;
  background: #242620 !important;
  font: 700 12px/1 "IBM Plex Mono", monospace;
}

html[data-theme="light"] .copilot-panel-content { background: #f5f5f1; }
html[data-theme="light"] .copilot-composer .copilot-send,
html[data-theme="light"] .copilot-composer .copilot-send:hover,
html[data-theme="light"] .copilot-composer .copilot-send:focus-visible {
  color: #f6f6f2 !important;
  background: #242620 !important;
}

@media (min-width: 1001px) {
  .copilot-launcher { display: none; }
  .copilot-drawer,
  .copilot-drawer.is-open {
    display: block;
    position: relative;
    grid-column: 3;
    grid-row: 1;
    width: 100%;
    height: 100%;
    padding: 0;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    box-shadow: none;
  }
  .copilot-history-drawer {
    right: 100% !important;
    left: auto !important;
  }
}

@media (max-width: 1000px) {
  .app-page,
  .app-page.copilot-open,
  body.copilot-open { --ai-sidebar-track: 0px; }
  .copilot-panel-content { padding: 18px 16px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .copilot-panel-content { transition-duration: 1ms !important; }
}

/* History Drawer Layout & Positioning */
.copilot-drawer {
  isolation: isolate;
  overflow: visible !important;
}

.copilot-drawer > .copilot-history-drawer {
  position: absolute !important;
  z-index: 85 !important;
  top: 0 !important;
  bottom: 0 !important;
  right: 100% !important;
  left: auto !important;
  width: 300px !important;
  height: 100% !important;
  min-width: 300px !important;
  max-width: 300px !important;
  color: var(--text);
  background: #141512 !important;
  border: 0;
  border-right: 1px solid var(--line) !important;
  border-left: 1px solid var(--line) !important;
  box-shadow: -16px 0 36px rgba(0, 0, 0, 0.35) !important;
  transform: translate3d(100%, 0, 0) !important;
  transition: transform var(--motion-duration-drawer) var(--motion-ease-enter), opacity var(--motion-duration-base) var(--motion-ease-standard) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.copilot-drawer > .copilot-history-drawer.is-open {
  transform: translate3d(0, 0, 0) !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.copilot-history-drawer,
.copilot-history-drawer button,
.copilot-history-drawer input {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.copilot-history-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 150ms ease, color 150ms ease, background-color 150ms ease;
}

.copilot-history-delete-btn:hover {
  opacity: 1;
  color: #e55353;
  background: rgba(229, 83, 83, 0.12);
}

.copilot-history-drawer-head {
  align-items: center;
  padding: 17px 14px 13px;
  background: #121310;
}

.copilot-history-drawer-head h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-weight: 500;
  line-height: 1;
}

.copilot-history-drawer-head small {
  margin-top: 5px;
  font-size: 10px;
  line-height: 1.3;
}

.copilot-history-body { padding: 9px 8px 18px; }
.copilot-history-open strong { font-size: 11px; line-height: 1.3; }
.copilot-history-open small { font-size: 9px; line-height: 1.3; }

html[data-theme="light"] .copilot-drawer > .copilot-history-drawer,
html[data-theme="light"] .copilot-history-drawer-head {
  background: #f3f3ee;
}

@media (max-width: 1000px) {
  .copilot-drawer > .copilot-history-drawer {
    width: calc(100% - 54px) !important;
  }
}

.employee-editor-overlay { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
.employee-editor-dialog {
  max-height: calc(100dvh - 30px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  contain: paint;
}
.employee-avatar-editor { position: relative; isolation: isolate; }
.employee-avatar-edit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
}
.employee-avatar-edit svg { width: 13px; height: 13px; }
.employee-avatar-edit:hover,
.employee-avatar-edit:focus-visible { color: var(--text); background: color-mix(in srgb, var(--console-accent) 9%, transparent); }
.employee-avatar-picker[hidden] { display: none !important; }
.employee-avatar-picker {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  left: 50%;
  width: 238px;
  padding: 10px;
  transform: translateX(-50%);
  background: #181916;
  border: 1px solid #34362f;
  border-radius: 13px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, .28);
}
.employee-emoji-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
.employee-emoji-options button {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  font-size: 21px;
  line-height: 1;
  background: transparent !important;
  border: 0 !important;
  border-radius: 8px;
  box-shadow: none !important;
  transition: transform var(--motion-duration-fast) var(--motion-ease-standard), color var(--motion-duration-fast) var(--motion-ease-standard);
}
.employee-emoji-options button:hover,
.employee-emoji-options button:focus-visible { transform: translate3d(0, -1px, 0) scale(1.12); outline: 1px solid color-mix(in srgb, var(--console-accent) 65%, transparent); }
.employee-emoji-options button.selected { outline: 1px solid var(--console-accent); }
.employee-avatar-sources { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.employee-avatar-sources label {
  display: grid;
  min-height: 31px;
  place-items: center;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
  background: transparent;
  border: 1px solid #34362f;
  border-radius: 8px;
}
.employee-avatar-sources label:hover { color: var(--text); border-color: color-mix(in srgb, var(--console-accent) 58%, #34362f); }
.employee-avatar-sources input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

@media (min-width: 1180px) {
  .copilot-resize-handle {
    display: block;
    position: absolute;
    z-index: 8;
    top: 0;
    bottom: 0;
    left: -5px;
    width: 10px;
    cursor: col-resize;
    touch-action: none;
  }
  .copilot-resize-handle::after {
    content: "";
    position: absolute;
    top: 34%;
    bottom: 34%;
    left: 4px;
    width: 2px;
    border-radius: 99px;
    background: var(--line);
    opacity: .55;
    transition: opacity var(--motion-duration-fast) var(--motion-ease-standard), background-color var(--motion-duration-fast) var(--motion-ease-standard);
  }
  .copilot-resize-handle:hover::after,
  .copilot-resize-handle:focus-visible::after,
  .app-page.copilot-resizing .copilot-resize-handle::after { background: var(--console-accent); opacity: 1; }
  .app-page.copilot-resizing { cursor: col-resize; user-select: none; transition: none !important; }
  .app-page.copilot-resizing .copilot-drawer { transition: none !important; }
}

@media (max-width: 620px) {
  .employee-editor-dialog { max-height: calc(100dvh - 16px); }
  .employee-avatar-picker { left: 0; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .employee-emoji-options button,
  .copilot-resize-handle::after { transition: none !important; }
}

/* ============================================================
   Learning center, attachment tray, and collapsed rail polish
   ============================================================ */
.learning-page {
  display: none;
  max-width: 1160px;
  padding-bottom: 72px;
}
.learning-page.active { display: block; }
.learning-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  column-gap: clamp(32px, 7vw, 96px);
  align-items: end;
  padding: clamp(24px, 4vw, 54px) 0 clamp(34px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
}
.learning-hero .console-eyebrow { grid-column: 1 / -1; margin-bottom: 18px; }
.learning-hero h1 {
  max-width: 690px;
  margin: 0;
  font: 500 clamp(39px, 5.3vw, 68px)/.98 Georgia, serif;
  letter-spacing: -.045em;
}
.learning-hero > p:not(.console-eyebrow) {
  max-width: 500px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}
.learning-search {
  grid-column: 2;
  grid-row: 2 / span 2;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  transition: border-color var(--motion-duration-fast) var(--motion-ease-standard);
}
.learning-search:focus-within { border-color: color-mix(in srgb, var(--console-accent) 70%, var(--line)); }
.learning-search svg { width: 18px; height: 18px; flex: 0 0 auto; stroke: var(--muted); stroke-width: 1.7; }
.learning-search input {
  width: 100%;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 13px;
}
.learning-paths {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.learning-paths article { position: relative; min-height: 270px; padding: 25px; background: var(--card); }
.learning-paths article + article { border-left: 1px solid var(--line); }
.learning-number { position: absolute; top: 22px; right: 23px; color: var(--muted); font: 600 10px/1 "Inter", sans-serif; letter-spacing: .12em; }
.learning-paths h2 { max-width: 250px; margin: 34px 0 11px; font: 500 24px/1.12 Georgia, serif; }
.learning-paths article > p:not(.panel-kicker) { max-width: 300px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.learning-paths a { position: absolute; right: 25px; bottom: 23px; left: 25px; display: flex; justify-content: space-between; color: var(--text); font-size: 12px; text-decoration: none; }
.learning-paths a span { color: var(--console-accent); transition: transform var(--motion-duration-fast) var(--motion-ease-standard); }
.learning-paths a:hover span { transform: translateX(3px); }
.learning-library { margin-top: clamp(42px, 7vw, 80px); }
.learning-library > header { display: flex; align-items: end; justify-content: space-between; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.learning-library h2 { margin: 5px 0 0; font: 500 31px/1.1 Georgia, serif; }
.learning-library > header > span { color: var(--muted); font-size: 11px; }
.learning-list a {
  display: grid;
  grid-template-columns: minmax(150px, .65fr) minmax(280px, 1.5fr) auto;
  gap: 28px;
  align-items: center;
  min-height: 74px;
  padding: 0 4px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  transition: padding var(--motion-duration-fast) var(--motion-ease-standard), background-color var(--motion-duration-fast) var(--motion-ease-standard);
}
.learning-list a:hover { padding-inline: 12px; background: color-mix(in srgb, var(--console-accent) 5%, transparent); }
.learning-list span { color: var(--muted); font-size: 11px; }
.learning-list strong { font-size: 13px; font-weight: 600; }
.learning-list small { color: var(--muted); font-size: 10px; white-space: nowrap; }
.learning-empty { margin: 32px 0; color: var(--muted); font-size: 13px; }

/* One quiet frame around the composer; controls inside remain frameless. */
.copilot-composer > div,
html[data-theme="light"] .copilot-composer > div {
  border-width: 1px !important;
  box-shadow: none !important;
}
.copilot-composer > div:focus-within,
html[data-theme="light"] .copilot-composer > div:focus-within {
  border-color: color-mix(in srgb, var(--console-accent) 62%, var(--line)) !important;
  box-shadow: none !important;
}
.copilot-composer textarea,
.copilot-composer textarea:focus {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.copilot-composer .copilot-attach,
.copilot-composer .copilot-attach:hover,
.copilot-composer .copilot-attach:focus-visible {
  width: 32px;
  height: 36px;
  flex-basis: 32px;
  border: 0 !important;
  outline: 0;
  box-shadow: none !important;
  color: var(--console-accent) !important;
  background: transparent !important;
  font-size: 23px;
}
.copilot-composer .copilot-attach:hover { transform: scale(1.08); }
.copilot-composer .copilot-send { border: 0 !important; box-shadow: none !important; }
.copilot-attachments { display: grid; gap: 7px; max-height: 144px; margin: 8px 0 3px; overflow-y: auto; }
.copilot-attachments[hidden] { display: none; }
.copilot-file {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 28px;
  gap: 10px;
  align-items: center;
  min-height: 50px;
  padding: 6px 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}
.copilot-file > img,
.copilot-file-glyph { width: 38px; height: 38px; border-radius: 7px; }
.copilot-file > img { display: block; object-fit: cover; }
.copilot-file-glyph { display: grid; place-items: center; color: var(--console-accent); background: var(--console-accent-soft); font-size: 8px; font-weight: 700; letter-spacing: .06em; }
.copilot-file-copy { display: grid; gap: 2px; min-width: 0; }
.copilot-file-copy strong { overflow: hidden; color: var(--text); font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.copilot-file-copy small { color: var(--muted); font-size: 9px; }
.copilot-file > button { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 18px; box-shadow: none; cursor: pointer; }
.copilot-message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 88%;
  margin-top: 8px;
}
.copilot-message-attachments.is-user {
  align-self: flex-end;
  justify-content: flex-end;
  margin: 0 0 -4px;
  animation: copilotMessageIn 280ms ease both;
}
.copilot-message-thumb {
  display: block;
  overflow: hidden;
  width: 132px;
  height: 96px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.copilot-message-attachments:has(> .copilot-message-thumb:only-child) .copilot-message-thumb { width: auto; max-width: 220px; height: 140px; }
.copilot-message-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 220ms ease; }
.copilot-message-attachments:has(> .copilot-message-thumb:only-child) .copilot-message-thumb img { width: auto; max-width: 220px; }
.copilot-message-thumb:hover img { transform: scale(1.02); }
.copilot-message-attachment {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 240px;
  min-width: 0;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}
.copilot-message-attachment .att-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  color: var(--muted);
  background: color-mix(in srgb, var(--text) 6%, transparent);
}
.copilot-message-attachment .att-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.copilot-message-attachment .att-icon svg circle { fill: currentColor; stroke: none; }
.copilot-message-attachment .att-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.copilot-message-attachment strong { overflow: hidden; color: var(--text); font-size: 12px; font-weight: 550; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.copilot-message-attachment small { color: var(--muted); font-size: 10.5px; line-height: 1.3; letter-spacing: .01em; }

.copilot-session {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin-top: 7px;
}
.copilot-session > span:first-child {
  max-width: 190px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.copilot-mode {
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1px solid color-mix(in srgb, var(--console-accent) 28%, var(--line));
  border-radius: 999px;
  color: var(--console-accent);
  background: color-mix(in srgb, var(--console-accent) 7%, transparent);
  font: 650 8px/1.2 "Inter", sans-serif;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.copilot-mode[data-mode="adviser"] { color: #d7ad68; border-color: color-mix(in srgb, #d7ad68 32%, var(--line)); background: color-mix(in srgb, #d7ad68 7%, transparent); }
.copilot-mode[data-mode="cowork"] { color: #89ad9e; border-color: color-mix(in srgb, #89ad9e 32%, var(--line)); background: color-mix(in srgb, #89ad9e 7%, transparent); }
.copilot-mode[data-mode="autonomous"] { color: #b3c98d; border-color: color-mix(in srgb, #b3c98d 32%, var(--line)); background: color-mix(in srgb, #b3c98d 7%, transparent); }

.copilot-composer { position: relative; }
.copilot-composer > .copilot-command-menu {
  position: absolute;
  z-index: 12;
  right: 0;
  bottom: calc(100% - 4px);
  left: 0;
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line) !important;
  border-radius: 12px;
  background: var(--popover-bg) !important;
  box-shadow: 0 16px 42px rgba(0,0,0,.28) !important;
  transform-origin: bottom center;
  animation: tensor-item-enter var(--motion-duration-fast) var(--motion-ease-enter) both;
}
.copilot-composer > .copilot-command-menu[hidden] { display: none; }
.copilot-composer > .copilot-command-menu button {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  height: auto;
  min-height: 42px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  text-align: left;
  box-shadow: none;
}
.copilot-composer > .copilot-command-menu button[aria-selected="true"] { background: var(--sidebar-hover); }
.copilot-composer > .copilot-command-menu strong { color: var(--console-accent); font-size: 11px; font-weight: 700; }
.copilot-composer > .copilot-command-menu span { color: var(--muted); font-size: 10px; }

@media (min-width: 1001px) {
  .app-page.sidebar-collapsed .account-menu {
    position: fixed;
    z-index: 1300;
    left: calc(var(--app-sidebar-track) + 10px);
    bottom: 14px;
    width: min(320px, calc(100vw - var(--app-sidebar-track) - 26px));
    transform-origin: bottom left;
  }
  .app-page.sidebar-collapsed .sidebar-workspace-selector .workspace-btn::after {
    content: attr(data-tooltip);
    position: fixed;
    z-index: 1400;
    top: 103px;
    left: calc(var(--app-sidebar-track) + 10px);
    width: max-content;
    max-width: 230px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background: var(--popover-bg);
    font: 600 10px/1.25 "Inter", sans-serif;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-5px);
    transition: opacity var(--motion-duration-fast) var(--motion-ease-standard), transform var(--motion-duration-fast) var(--motion-ease-standard);
  }
  .app-page.sidebar-collapsed .sidebar-workspace-selector .workspace-btn:hover::after,
  .app-page.sidebar-collapsed .sidebar-workspace-selector .workspace-btn:focus-visible::after { opacity: 1; transform: translateX(0); }
}

@media (max-width: 760px) {
  .learning-hero { display: block; }
  .learning-search { margin-top: 24px; }
  .learning-paths { grid-template-columns: 1fr; }
  .learning-paths article + article { border-top: 1px solid var(--line); border-left: 0; }
  .learning-list a { grid-template-columns: 1fr auto; gap: 7px 16px; padding-block: 14px; }
  .learning-list a strong { grid-column: 1 / -1; grid-row: 1; }
  .learning-list a span { grid-row: 2; }
  .learning-list a small { grid-row: 2; }
}

@media (prefers-reduced-motion: reduce) {
  .learning-paths a span,
  .learning-list a,
  .copilot-composer .copilot-attach,
  .copilot-composer > .copilot-command-menu,
  .app-page.sidebar-collapsed .sidebar-workspace-selector .workspace-btn::after { transition: none !important; }
}

/* Tensor application shell polish --------------------------------------- */
:root {
  --tensor-scrollbar-size: 4px;
  --tensor-scrollbar-thumb: color-mix(in srgb, var(--muted) 36%, transparent);
  --tensor-scrollbar-thumb-hover: color-mix(in srgb, var(--console-accent) 48%, var(--muted));
  --sidebar-icon-column: 44px;
}

html { color-scheme: dark; background: var(--bg); }
html[data-theme="light"] { color-scheme: light; }
html,
body { background: var(--bg); }

/* Keep native scrolling, but make every application surface feel native to
   the current Tensor theme instead of exposing the browser's bright track. */
:where(html, body, .app-main, .app-sidebar, .copilot-messages, .copilot-history-body, .modal-content, .employee-editor-dialog) {
  scrollbar-width: thin;
  scrollbar-color: var(--tensor-scrollbar-thumb) transparent;
}

:where(html, body, .app-main, .app-sidebar, .copilot-messages, .copilot-history-body, .modal-content, .employee-editor-dialog)::-webkit-scrollbar {
  width: var(--tensor-scrollbar-size);
  height: var(--tensor-scrollbar-size);
}

:where(html, body, .app-main, .app-sidebar, .copilot-messages, .copilot-history-body, .modal-content, .employee-editor-dialog)::-webkit-scrollbar-track {
  background: transparent;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
.app-main::-webkit-scrollbar-track { background: var(--bg); }

:where(html, body, .app-main, .app-sidebar, .copilot-messages, .copilot-history-body, .modal-content, .employee-editor-dialog)::-webkit-scrollbar-thumb {
  min-height: 32px;
  border-radius: 999px;
  background: var(--tensor-scrollbar-thumb);
}

:where(html, body, .app-main, .app-sidebar, .copilot-messages, .copilot-history-body, .modal-content, .employee-editor-dialog)::-webkit-scrollbar-thumb:hover {
  background: var(--tensor-scrollbar-thumb-hover);
}

.app-main,
.app-sidebar,
.copilot-messages,
.copilot-history-body {
  overscroll-behavior: contain;
}

/* One shared icon rail keeps Workspace, navigation, badges, and the account
   control perfectly aligned in both expanded and collapsed states. */
.app-sidebar {
  padding-inline: 10px;
  padding-bottom: 12px;
}

.sidebar-menu {
  gap: 4px;
  margin-top: 2px;
}

.sidebar-link,
.sidebar-workspace-selector .workspace-btn,
.sidebar-account .account-trigger {
  display: grid;
  grid-template-columns: var(--sidebar-icon-column) minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 4px;
  width: 100%;
  padding-inline: 0 10px;
}

.sidebar-link > svg,
.sidebar-workspace-selector .workspace-home,
.sidebar-account .account-avatar {
  justify-self: center;
}

.sidebar-link .badge,
.sidebar-workspace-selector .ws-caret,
.sidebar-account .account-caret {
  justify-self: end;
  margin-left: 0;
}

.sidebar-account {
  margin-top: auto;
  padding-top: 12px;
}

.sidebar-account .account-trigger {
  min-height: 52px;
  border-radius: 11px;
}

.app-page.sidebar-collapsed .app-sidebar {
  padding-inline: 8px;
}

.app-page.sidebar-collapsed .sidebar-link,
.app-page.sidebar-collapsed .sidebar-workspace-selector .workspace-btn,
.app-page.sidebar-collapsed .sidebar-account .account-trigger {
  grid-template-columns: 52px 0 0;
  column-gap: 0;
  width: 52px;
  min-width: 52px;
  padding-inline: 0;
  overflow: hidden;
}

.app-page.sidebar-collapsed .sidebar-account {
  width: 52px;
  margin-inline: auto;
}

.app-page.sidebar-collapsed .sidebar-account .account-avatar,
.app-page.sidebar-collapsed .sidebar-workspace-selector .workspace-home,
.app-page.sidebar-collapsed .sidebar-link > svg {
  justify-self: center;
}

/* The assistant is the primary right panel. History remains absolutely
   contained inside it, so toggling History never mutates the workspace grid. */
.copilot-drawer,
.copilot-panel-content,
.copilot-drawer > .copilot-history-drawer {
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
}

.copilot-panel-content {
  transform: translate3d(10px, 0, 0);
  transition:
    opacity var(--motion-duration-base) var(--motion-ease-standard),
    transform var(--motion-duration-drawer) var(--motion-ease-enter),
    visibility 0s linear var(--motion-duration-drawer);
}

.copilot-drawer.is-open .copilot-panel-content {
  transform: translate3d(0, 0, 0);
  transition-delay: 0s;
}

.copilot-control-rail button {
  transition:
    color var(--motion-duration-fast) var(--motion-ease-standard),
    background-color var(--motion-duration-fast) var(--motion-ease-standard),
    border-color var(--motion-duration-fast) var(--motion-ease-standard),
    transform var(--motion-duration-instant) var(--motion-ease-standard);
}

.copilot-control-rail button:active { transform: scale(.94); }

.copilot-drawer > .copilot-history-drawer {
  contain: layout paint style;
  transform: translate3d(calc(100% + 12px), 0, 0);
  will-change: transform;
  transition:
    transform var(--motion-duration-drawer) var(--motion-ease-enter),
    opacity var(--motion-duration-base) var(--motion-ease-standard),
    visibility 0s linear var(--motion-duration-drawer);
}

.copilot-drawer > .copilot-history-drawer.is-open {
  transform: translate3d(0, 0, 0);
  box-shadow: -14px 0 34px rgba(0, 0, 0, .2);
  transition-delay: 0s;
}

.copilot-history-drawer .copilot-history-drawer-head,
.copilot-history-drawer .copilot-history-body {
  opacity: 0;
  transform: translate3d(8px, 0, 0);
  transition:
    opacity var(--motion-duration-base) var(--motion-ease-standard),
    transform var(--motion-duration-slow) var(--motion-ease-enter);
}

.copilot-history-drawer.is-open .copilot-history-drawer-head,
.copilot-history-drawer.is-open .copilot-history-body {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.copilot-history-drawer.is-open .copilot-history-drawer-head { transition-delay: 55ms; }
.copilot-history-drawer.is-open .copilot-history-body { transition-delay: 85ms; }

/* Theme-complete Tensor OS surfaces. These rules intentionally come last:
   older console passes used fixed dark colors in the drawer and code blocks. */
.copilot-composer .copilot-send,
.copilot-composer .copilot-send:hover,
.copilot-composer .copilot-send:focus-visible {
  display: grid;
  width: 38px;
  height: 36px;
  flex-basis: 38px;
  place-items: center;
  color: var(--console-accent) !important;
  background: var(--surface) !important;
  border: 1px solid color-mix(in srgb, var(--console-accent) 32%, var(--line)) !important;
  border-radius: 8px;
}
.copilot-composer .copilot-send:hover,
.copilot-composer .copilot-send:focus-visible { background: var(--console-accent-soft) !important; border-color: var(--console-accent) !important; }
.copilot-composer .copilot-send svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.copilot-composer .copilot-send:disabled { color: var(--muted) !important; background: var(--surface) !important; border-color: var(--line) !important; }
.copilot-composer.is-busy .copilot-send { color: var(--console-accent) !important; }

html[data-theme="light"] .copilot-drawer,
html[data-theme="light"] .copilot-panel-content,
html[data-theme="light"] .copilot-drawer > .copilot-history-drawer {
  color: var(--text);
  background: var(--bg) !important;
}
html[data-theme="light"] .copilot-history-drawer { border-color: var(--line) !important; box-shadow: -14px 0 34px rgba(43, 49, 34, .14) !important; }
html[data-theme="light"] .copilot-history-item:hover,
html[data-theme="light"] .copilot-history-item:focus-within { background: var(--sidebar-hover); }
html[data-theme="light"] .copilot-history-item.is-active { background: var(--console-accent-soft); }
html[data-theme="light"] .copilot-message.assistant pre,
html[data-theme="light"] .test-message-content pre {
  border-color: #c9cec0;
  background: #e9ede2;
  color: #26301d;
}
html[data-theme="light"] .copilot-message.assistant pre[data-language]::before,
html[data-theme="light"] .test-message-content pre[data-language]::before { color: #657059; }
html[data-theme="light"] .copilot-message.assistant pre code,
html[data-theme="light"] .test-message-content pre code { color: inherit; }
html[data-theme="light"] .markdown-code-copy { color: #58654a; }
html[data-theme="light"] .markdown-code-copy:hover,
html[data-theme="light"] .markdown-code-copy:focus-visible { color: var(--text); background: rgba(66, 79, 47, .08); }

@media (prefers-reduced-motion: reduce) {
  .copilot-panel-content,
  .copilot-drawer > .copilot-history-drawer,
  .copilot-history-drawer .copilot-history-drawer-head,
  .copilot-history-drawer .copilot-history-body,
  .copilot-control-rail button {
    transition: none !important;
  }
}

/* Final operational-surface refinements.
   Kept at the end of the cascade so employee, approval, audit, and roster
   states share one restrained visual language. */
.employee-item::before,
.approval-card::before,
.approval-open::before {
  content: none !important;
  display: none !important;
}

.employee-status {
  min-width: 72px;
  padding: 5px 9px;
  color: var(--muted);
  background: color-mix(in srgb, var(--text) 4%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-align: center;
  text-transform: uppercase;
}

.employee-status.active {
  color: var(--semantic-success);
  background: color-mix(in srgb, var(--semantic-success) 7%, transparent);
  border-color: color-mix(in srgb, var(--semantic-success) 28%, transparent);
}

.employee-status.paused {
  color: var(--semantic-inactive);
  background: color-mix(in srgb, var(--semantic-inactive) 8%, transparent);
  border-color: color-mix(in srgb, var(--semantic-inactive) 28%, transparent);
}

.employee-avatar-picker {
  z-index: 240;
  width: min(286px, calc(100vw - 40px));
  overflow: visible;
}

.employee-emoji-options {
  grid-template-columns: repeat(5, 42px);
  justify-content: center;
  gap: 7px;
  overflow: visible;
}

.employee-emoji-options button {
  width: 42px;
  height: 42px;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 22px;
  border: 1px solid transparent !important;
  transform: none;
}

.employee-emoji-options button:hover,
.employee-emoji-options button:focus-visible {
  transform: translate3d(0, -1px, 0);
  background: color-mix(in srgb, var(--text) 6%, transparent) !important;
  border-color: color-mix(in srgb, var(--text) 12%, transparent) !important;
  outline: none;
}

.employee-emoji-options button.selected,
.employee-emoji-options button.is-selected {
  background: color-mix(in srgb, var(--console-accent) 11%, transparent) !important;
  border-color: color-mix(in srgb, var(--console-accent) 50%, transparent) !important;
  outline: none;
}

.app-logo svg {
  width: 28px;
  height: 28px;
}

.app-logo-tensor > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--console-accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 750;
}

.approval-reason {
  padding-left: 0;
  background: transparent;
  border-left: 0;
}

.approval-review-cue b { color: var(--console-accent); }

.roster-clear-compare {
  color: var(--muted);
  background: transparent;
  border: 0;
}

.roster-clear-compare:hover,
.roster-clear-compare:focus-visible {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 5%, transparent);
}

html[data-theme="light"] .employee-avatar-picker {
  background: #f4f4ef;
  border-color: #d8d9d1;
  box-shadow: 0 18px 44px rgba(35, 36, 31, .14);
}

@media (max-width: 620px) {
  .employee-avatar-picker {
    position: fixed;
    top: auto;
    right: 14px;
    bottom: 18px;
    left: 14px;
    width: auto;
    transform: none;
  }

  .employee-emoji-options {
    grid-template-columns: repeat(5, minmax(42px, 1fr));
  }
}

/* Clean controls and consistent provenance UI */
.roster-search input,
.roster-filter select {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  appearance: none;
  -webkit-appearance: none;
}

.roster-search input:focus,
.roster-search input:focus-visible,
.roster-filter select:focus,
.roster-filter select:focus-visible {
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.employee-editor-head { overflow: visible; }

.employee-avatar-picker {
  right: auto;
  left: calc(100% - 14px);
  transform: none;
  transform-origin: 18px 0;
}

.app-logo {
  padding: 6px;
  background: color-mix(in srgb, var(--card) 90%, var(--text) 10%);
}

.app-logo svg {
  width: 100%;
  height: 100%;
}

.app-logo-stripe,
.app-logo-telegram { padding: 3px; }

.app-logo-x {
  padding: 9px;
  color: #fff;
  background: #050505;
}

.app-logo-gmail,
.app-logo-hubspot,
.app-logo-drive {
  padding: 6px;
  background: #fff;
}

.audit-status {
  min-width: 66px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .06em;
  text-align: center;
  text-transform: capitalize;
}

.audit-status.success {
  color: #9dad7d;
  border-color: rgba(157, 173, 125, .34);
  background: rgba(157, 173, 125, .08) !important;
}

.audit-status.denied {
  color: #d1847c;
  border-color: rgba(209, 132, 124, .34);
  background: rgba(209, 132, 124, .08) !important;
}

.audit-status.pending {
  color: #c7a766;
  border-color: rgba(199, 167, 102, .34);
  background: rgba(199, 167, 102, .08) !important;
}

@media (max-width: 620px) {
  .employee-avatar-picker {
    right: 14px;
    left: 14px;
    transform: none;
  }
}

/* Telegram integration — Hire wizard / Workplace */
.telegram-channel-button {
  width: 100%;
  appearance: none;
  color: inherit;
  font: inherit;
}

.telegram-channel-icon,
.telegram-panel-mark {
  display: grid;
  place-items: center;
}

.telegram-channel-icon svg,
.telegram-panel-mark svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.telegram-channel-icon {
  color: var(--console-accent);
}

.telegram-channel-button .channel-identity {
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telegram-connect-panel[hidden],
.telegram-connect-panel [hidden] {
  display: none !important;
}

.telegram-connect-panel {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--card) 88%, var(--bg));
  animation: telegramPanelEnter var(--motion-duration-base, 240ms) var(--motion-ease-enter, cubic-bezier(.16,1,.3,1)) both;
}

@keyframes telegramPanelEnter {
  from { opacity: 0; transform: translate3d(0, -5px, 0); }
}

.telegram-connect-head,
.telegram-connect-head > div,
.telegram-connect-actions,
.telegram-connection-result,
.telegram-connected-summary {
  display: flex;
  align-items: center;
}

.telegram-connect-head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.telegram-connect-head > div {
  min-width: 0;
  gap: 11px;
}

.telegram-panel-mark {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: 1px solid color-mix(in srgb, var(--console-accent) 40%, var(--line));
  border-radius: 10px;
  color: var(--console-accent);
  background: var(--console-accent-soft);
}

.telegram-connect-head h3 {
  margin: 0;
  color: var(--text);
  font: 650 15px/1.25 "Inter", sans-serif;
}

.telegram-connect-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.telegram-panel-close {
  display: grid;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font: 400 20px/1 sans-serif;
  cursor: pointer;
  transition: color var(--motion-duration-fast, 140ms) var(--motion-ease-standard, ease), background-color var(--motion-duration-fast, 140ms) var(--motion-ease-standard, ease), transform var(--motion-duration-fast, 140ms) var(--motion-ease-standard, ease);
}

.telegram-panel-close:hover {
  color: var(--text);
  background: var(--surface);
}

.telegram-panel-close:active { transform: scale(.96); }

.telegram-connect-form {
  display: grid;
  gap: 10px;
}

.telegram-connect-form > label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.telegram-token-field {
  display: flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg) 70%, var(--card));
  transition: border-color var(--motion-duration-fast, 140ms) var(--motion-ease-standard, ease), background-color var(--motion-duration-fast, 140ms) var(--motion-ease-standard, ease);
}

.telegram-token-field:focus-within {
  border-color: color-mix(in srgb, var(--console-accent) 66%, var(--line));
  background: var(--bg);
}

#hireModal .telegram-token-field input {
  min-width: 0;
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 0 !important;
  outline: 0;
  color: var(--text);
  background: transparent !important;
  box-shadow: none !important;
  font: 500 13px/1 "Inter", sans-serif;
}

#hireModal .telegram-token-field input::placeholder { color: var(--muted); }

.telegram-token-field button {
  flex: 0 0 auto;
  margin-right: 5px;
  padding: 7px 9px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.telegram-token-field button:hover {
  color: var(--text);
  background: var(--surface);
}

.telegram-connect-actions {
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 3px;
}

#hireModal .telegram-connect-actions button {
  min-height: 39px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: none;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: color var(--motion-duration-fast, 140ms) var(--motion-ease-standard, ease), background-color var(--motion-duration-fast, 140ms) var(--motion-ease-standard, ease), border-color var(--motion-duration-fast, 140ms) var(--motion-ease-standard, ease), transform var(--motion-duration-fast, 140ms) var(--motion-ease-standard, ease);
}

#hireModal .telegram-connect-actions button:active:not(:disabled) { transform: scale(.98); }

#hireModal .telegram-test-button,
#hireModal #telegramTestBot {
  color: var(--text);
  background: var(--surface);
}

#hireModal .telegram-test-button:hover,
#hireModal #telegramTestBot:hover {
  border-color: color-mix(in srgb, var(--text) 24%, var(--line));
  background: color-mix(in srgb, var(--surface) 82%, var(--text) 6%);
}

#hireModal .telegram-connect-button {
  color: #10130d;
  border-color: var(--console-accent);
  background: var(--console-accent);
}

#hireModal .telegram-connect-button:disabled,
#hireModal .telegram-connect-actions button:disabled {
  color: var(--muted);
  border-color: var(--line);
  background: var(--surface);
  cursor: not-allowed;
  opacity: .55;
}

.telegram-connection-result {
  gap: 10px;
  margin-top: 13px;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--console-accent) 38%, var(--line));
  border-radius: 10px;
  background: var(--console-accent-soft);
}

.telegram-result-indicator,
.telegram-connected-dot {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--console-accent);
}

.telegram-connection-result div,
.telegram-connected-summary div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.telegram-connection-result strong,
.telegram-connected-summary strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telegram-connection-result span:not(.telegram-result-indicator),
.telegram-connected-summary span:not(.telegram-connected-dot) {
  color: var(--muted);
  font-size: 10px;
}

.telegram-connection-status {
  min-height: 16px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.telegram-connect-panel[data-state="invalid"] .telegram-connection-status,
.telegram-connect-panel[data-state="error"] .telegram-connection-status {
  color: #d1847c;
}

.telegram-connect-panel[data-state="testing"] .telegram-connection-status,
.telegram-connect-panel[data-state="testing-connected"] .telegram-connection-status,
.telegram-connect-panel[data-state="connecting"] .telegram-connection-status,
.telegram-connect-panel[data-state="disconnecting"] .telegram-connection-status {
  color: var(--console-accent);
}

.telegram-manage-view { display: grid; gap: 14px; }
.telegram-connected-summary { gap: 10px; }

.telegram-manage-details {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--line);
}

.telegram-manage-details > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.telegram-manage-details dt {
  color: var(--muted);
  font-size: 11px;
}

.telegram-manage-details dd {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  font-weight: 650;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#hireModal .telegram-disconnect-button {
  color: #d1847c;
  border-color: color-mix(in srgb, #d1847c 42%, var(--line));
  background: transparent;
}

#hireModal .telegram-disconnect-button:hover {
  background: color-mix(in srgb, #d1847c 9%, transparent);
}

.telegram-connect-panel button:focus-visible,
.telegram-channel-button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--console-accent) 72%, white);
  outline-offset: 2px;
}

html[data-theme="light"] #hireModal .telegram-connect-button {
  color: white;
  border-color: #53663e;
  background: #53663e;
}

@media (max-width: 620px) {
  .telegram-connect-panel { padding: 15px; }
  .telegram-connect-head { align-items: flex-start; }
  .telegram-connect-head p { max-width: 230px; }
  .telegram-connect-actions { display: grid; grid-template-columns: 1fr; }
  #hireModal .telegram-connect-actions button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .telegram-connect-panel { animation: none; }
}

/* Hire flow: untinted product marks and production test sandbox */
#hireModal .channel-icon.workplace-brand {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#hireModal .channel-icon.workplace-brand svg {
  display: block;
  width: 31px;
  height: 31px;
  overflow: visible;
}

#hireModal .channel-icon.workplace-brand-wide svg { width: 43px; }

#hireModal .channel-input:checked + .channel-label .channel-icon.workplace-brand {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#hireModal .telegram-panel-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#hireModal .telegram-panel-mark svg { width: 32px; height: 32px; }

#hireModal .test-section {
  display: grid;
  gap: 16px;
  padding-bottom: 4px;
}

#hireModal .test-step-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

#hireModal .test-step-intro h3 {
  margin: 5px 0 5px;
  color: var(--text);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 650;
  letter-spacing: -.035em;
}

#hireModal .test-step-kicker {
  color: var(--console-accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

#hireModal .test-live-indicator {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 11px;
}

#hireModal .test-live-indicator i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  transition: background-color var(--motion-duration-fast, 140ms) var(--motion-ease-standard, ease), transform var(--motion-duration-fast, 140ms) var(--motion-ease-standard, ease);
}

#hireModal .test-live-indicator[data-state="testing"] i {
  background: var(--console-accent);
  animation: test-indicator-pulse 1s ease-in-out infinite;
}

#hireModal .test-live-indicator[data-state="connected"] i { background: #56a36f; }
#hireModal .test-live-indicator[data-state="error"] i { background: #d76a70; }

@keyframes test-indicator-pulse {
  50% { opacity: .45; transform: scale(.75); }
}

@media (prefers-reduced-motion: reduce) {
  #hireModal .test-live-indicator[data-state="testing"] i { animation: none; }
}

#hireModal .test-review-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

#hireModal .test-review-grid > div {
  display: grid;
  min-width: 0;
  gap: 7px;
  padding: 13px 15px;
  border-right: 1px solid var(--line);
}

#hireModal .test-review-grid > div:last-child { border-right: 0; }
#hireModal .test-review-grid span { color: var(--muted); font-size: 10px; }
#hireModal .test-review-grid strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#hireModal .test-checklist {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

#hireModal .test-checklist .checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

#hireModal .test-checklist input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--console-accent);
  opacity: 1;
}

#hireModal .test-checklist label {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#hireModal .test-sandbox {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

#hireModal .test-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}

#hireModal .test-header > div { display: flex; align-items: center; gap: 8px; }
#hireModal .test-header h4 { margin: 0; color: var(--text); font-size: 12px; }
#hireModal .test-header-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--console-accent); }
#hireModal .test-badge { color: var(--muted); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }

#hireModal .test-messages {
  min-height: 178px;
  max-height: 280px;
  overflow-y: auto;
  padding: 13px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent;
}

#hireModal .test-chat-area { display: grid; gap: 9px; margin-top: 9px; }
#hireModal .test-message {
  width: fit-content;
  max-width: min(86%, 560px);
  padding: 9px 11px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  font-size: 11px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

#hireModal .test-message p { margin: 0; }
#hireModal .test-message.user { justify-self: end; border-color: color-mix(in srgb, var(--console-accent) 35%, var(--line)); }
#hireModal .test-message.ai { justify-self: start; }
#hireModal .test-message.pending { color: var(--muted); }
#hireModal .test-message.error { color: #d1847c; border-color: color-mix(in srgb, #d1847c 40%, var(--line)); }

#hireModal .test-request-status {
  min-height: 16px;
  margin: 0;
  padding: 0 14px 7px;
  color: var(--muted);
  font-size: 10px;
}

#hireModal .test-request-status[data-state="success"] { color: var(--console-accent); }
#hireModal .test-request-status[data-state="error"] { color: #d1847c; }

#hireModal .test-input-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
}

#hireModal .test-input {
  min-width: 0;
  height: 40px;
  padding: 0 13px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: var(--surface);
  font: inherit;
  font-size: 11px;
}

#hireModal .test-input:focus { border-color: color-mix(in srgb, var(--console-accent) 65%, var(--line)); }
#hireModal .btn-send-test { min-width: 84px; height: 40px; border-radius: 10px; }
#hireModal .btn-send-test:disabled { cursor: wait; opacity: .58; }

@media (max-width: 720px) {
  #hireModal .test-review-grid { grid-template-columns: 1fr; }
  #hireModal .test-review-grid > div { border-right: 0; border-bottom: 1px solid var(--line); }
  #hireModal .test-review-grid > div:last-child { border-bottom: 0; }
  #hireModal .test-checklist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  #hireModal .test-step-intro { display: grid; gap: 10px; }
  #hireModal .test-live-indicator { justify-self: start; }
  #hireModal .test-checklist { grid-template-columns: 1fr; }
  #hireModal .test-input-group { grid-template-columns: 1fr; }
  #hireModal .btn-send-test { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  #hireModal .test-section *,
  #hireModal .test-sandbox * { scroll-behavior: auto !important; }
}

/* Onboarding / Getting Started section */
.onboarding-section {
  margin-top: 24px;
}

.onboarding-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  padding: 16px;
}

.onboarding-step-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--surface-card, #171815);
}

.onboarding-step-card .step-badge {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #252621;
  color: var(--console-accent);
  font-size: 11px;
  font-weight: 700;
}

.onboarding-step-card .step-info strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.onboarding-step-card .step-info p {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.onboarding-step-card button {
  align-self: flex-start;
  margin-top: auto;
}

/* ==========================================================================
   5-STAGE HIRE AI EMPLOYEE WIZARD & EMPLOYEE WORKSPACE STYLES
   ========================================================================== */

.hire-wizard-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 11, 9, 0.82);
  backdrop-filter: blur(12px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.hire-wizard-modal {
  position: relative;
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #141512;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  color: #f3f2ec;
}

.hire-wizard-modal .modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8c8e86;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 160ms ease;
  z-index: 10;
}
.hire-wizard-modal .modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f3f2ec;
}

.hire-wizard-header {
  padding: 20px 24px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: #171815;
}

.hire-step-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--console-accent, #99c2a2);
  text-transform: uppercase;
}

.hire-wizard-body {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.hire-wizard-step {
  display: none;
}
.hire-wizard-step.active {
  display: block;
}

.step-head {
  margin-bottom: 20px;
}
.step-head h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 600;
  color: #f3f2ec;
  letter-spacing: -0.02em;
}
.step-head p {
  margin: 0;
  font-size: 13px;
  color: #8c8e86;
  line-height: 1.45;
}

.hire-step-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.hire-step-form label {
  font-size: 12px;
  font-weight: 600;
  color: #c2c4bc;
}
.hire-step-form label .req {
  color: #e06c75;
}

.hire-step-form input[type="text"],
.hire-step-form input[type="password"],
.hire-step-form select,
.hire-step-form textarea {
  width: 100%;
  padding: 10px 14px;
  background: #1c1d19;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #f3f2ec;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 160ms ease;
}
.hire-step-form input:focus,
.hire-step-form select:focus,
.hire-step-form textarea:focus {
  border-color: var(--console-accent, #99c2a2);
}

.rules-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.rules-header small {
  font-size: 11px;
  color: #71736b;
}

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.rule-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: #1a1b17;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  font-size: 12px;
  color: #d0d2c9;
}
.rule-item button {
  background: transparent;
  border: 0;
  color: #71736b;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
}
.rule-item button:hover {
  color: #e06c75;
}

.btn-add-rule {
  align-self: flex-start;
  margin-top: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  color: var(--console-accent, #99c2a2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 160ms ease;
}
.btn-add-rule:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--console-accent, #99c2a2);
}

.section-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #8c8e86;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.section-label small {
  color: var(--console-accent, #99c2a2);
  text-transform: none;
  font-weight: 400;
}

.knowledge-methods {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.knowledge-dropzone {
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  transition: all 160ms ease;
}
.knowledge-dropzone:hover {
  border-color: var(--console-accent, #99c2a2);
  background: rgba(255, 255, 255, 0.04);
}
.dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.dropzone-icon {
  font-size: 24px;
}
.dropzone-inner p {
  margin: 0;
  font-size: 13px;
  color: #c2c4bc;
}
.dropzone-inner small {
  font-size: 10px;
  color: #71736b;
  letter-spacing: 0.04em;
}
.btn-link {
  background: transparent;
  border: 0;
  color: var(--console-accent, #99c2a2);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.added-knowledge-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.knowledge-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #1a1b17;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  font-size: 12px;
}
.knowledge-item .info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.knowledge-item button {
  background: transparent;
  border: 0;
  color: #71736b;
  cursor: pointer;
}
.knowledge-item button:hover {
  color: #e06c75;
}

.workplace-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.telegram-workplace-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #1a1b17;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  transition: all 160ms ease;
}
.telegram-workplace-card:hover {
  border-color: #229ED9;
  background: rgba(34, 158, 217, 0.04);
}
.telegram-workplace-card .card-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.tg-logo {
  width: 36px;
  height: 36px;
}
.brand-info strong {
  display: block;
  font-size: 15px;
  color: #f3f2ec;
}
.brand-info span {
  font-size: 12px;
  color: #8c8e86;
}
.btn-connect-card {
  padding: 8px 16px;
  background: #229ED9;
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 160ms ease;
}
.btn-connect-card:hover {
  opacity: 0.9;
}

.telegram-connect-box,
.telegram-verified-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 8px 0;
}
.connect-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.connect-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}
.tg-logo-sm {
  width: 28px;
  height: 28px;
}
.token-help-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #8c8e86;
}
.token-help-link a {
  color: var(--console-accent, #99c2a2);
  text-decoration: none;
}
.token-help-link a:hover {
  text-decoration: underline;
}

.telegram-verified-box {
  align-items: center;
  text-align: center;
  padding: 20px 0;
}
.verified-header {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.tg-logo-lg {
  width: 48px;
  height: 48px;
}
.badge-live {
  font-size: 11px;
  font-weight: 700;
  color: #4cd964;
  letter-spacing: 0.06em;
}
.verified-identity strong {
  display: block;
  font-size: 18px;
  color: #f3f2ec;
}
.verified-identity span {
  font-size: 13px;
  color: #8c8e86;
}
.connected-note {
  margin: 0;
  font-size: 13px;
  color: #c2c4bc;
}
.btn-disconnect {
  color: #e06c75 !important;
  border-color: rgba(224, 108, 117, 0.24) !important;
}

.hire-wizard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: #171815;
}
.footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-error-msg {
  color: #e06c75;
  font-size: 12px;
  margin: 8px 0 0;
}

/* ==========================================================================
   REFINED EMPLOYEES & CONTROL CENTER WORKSPACE STYLES
   ========================================================================== */

/* Employee Cards Grid */
.employee-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.employee-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  background: #111111;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 160ms ease;
  position: relative;
}
.employee-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.employee-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.emp-card-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.emp-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  font-size: 14px;
  flex-shrink: 0;
  overflow: hidden;
  color: #f3f2ec;
}

.emp-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* A failed remote avatar must reveal the same default identity, rather than a
   broken-image marker. This is shared by roster, dashboard, detail, and
   employee settings renderers. */
.employee-avatar-fallback[hidden] { display: none !important; }
.emp-card-avatar,
.workforce-person .employee-avatar,
.employee-name-avatar,
#empTabSettings .employee-settings-avatar { position: relative; overflow: hidden; }
.workforce-person .employee-avatar img,
.employee-name-avatar img { width: 100%; height: 100%; object-fit: cover; }

.emp-card-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.emp-card-title-group h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: #f3f2ec;
  letter-spacing: -0.01em;
}
.emp-card-role {
  font-size: 13px;
  color: #8c8e86;
}

.emp-card-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 0;
  border-radius: 4px;
}
.emp-card-status-badge.live { color: #f3f2ec; }
.emp-card-status-badge.paused { color: #8c8e86; }
.emp-card-status-badge i {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: currentColor;
}

.employee-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.emp-card-tg-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #c2c4bc;
}
.emp-card-tg-row svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: #8c8e86;
}

.emp-card-task-snippet {
  margin: 0;
  font-size: 13px;
  color: #8c8e86;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.employee-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
}

.emp-card-autonomy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #8c8e86;
}

.emp-card-manage-link {
  color: #f3f2ec;
  font-weight: 400;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: opacity 140ms ease;
  opacity: 0.7;
}
.employee-card:hover .emp-card-manage-link {
  opacity: 1;
}
.employee-card:hover .emp-card-manage-link {

}

/* Dedicated Employee Detail Hero & Control Strip */
.employee-detail-hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.btn-back-link {
  align-self: flex-start;
  background: transparent;
  border: 0;
  color: #8c8e86;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 140ms ease;
  font-weight: 500;
}
.btn-back-link:hover {
  color: #f3f2ec;
}

.hero-control-strip {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.hero-identity-group {
  display: flex;
  align-items: center;
  gap: 20px;
}

.emp-hero-avatar-wrapper {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  font-size: 20px;
  color: #f3f2ec;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}
.emp-hero-avatar-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.emp-hero-avatar-wrapper:hover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
}

.hero-identity-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meta-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.meta-title-row h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
  color: #f3f2ec;
  letter-spacing: -0.01em;
}

.badge-role {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #8c8e86;
}

.badge-status-live {
  font-size: 11px;
  font-weight: 700;
  color: #4cd964;
  letter-spacing: 0.04em;
}

.meta-sub-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #8c8e86;
}

.emp-tg-link {
  color: #229ED9;
}

.emp-bullet-sep {
  color: rgba(255, 255, 255, 0.2);
}

.emp-autonomy-tag {
  color: #c2c4bc;
}

.hero-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Tabs Navigation */
.employee-detail-tabs {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 24px;
}
.employee-detail-tabs::-webkit-scrollbar {
  display: none;
}

.emp-tab {
  background: transparent;
  border: 0;
  color: #8c8e86;
  font-size: 13px;
  font-weight: 500;
  padding: 0 0 12px 0;
  cursor: pointer;
  white-space: nowrap;
  transition: color 140ms ease;
  position: relative;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.emp-tab:hover {
  color: #c2c4bc;
}
.emp-tab.active {
  color: #f3f2ec;
  border-bottom-color: var(--console-accent, #99c2a2);
}

/* Panel Body & Cards */
.employee-detail-body {
  padding-top: 4px;
}

.emp-panel {
  display: none;
}
.emp-panel.active {
  display: block;
}

.emp-card-section {
  background: #141512;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.section-title-group {
  margin-bottom: 18px;
}
.section-title-group h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  color: #f3f2ec;
}

.form-hint {
  margin: 0;
  font-size: 13px;
  color: #8c8e86;
  line-height: 1.45;
}

/* Custom Textareas & Inputs */
.tensor-textarea,
.tensor-input {
  width: 100%;
  padding: 12px 14px;
  background: #0f100e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #f3f2ec;
  font-size: 13px;
  line-height: 1.5;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.tensor-textarea:focus,
.tensor-input:focus {
  outline: none;
  border-color: var(--console-accent, #99c2a2);
  box-shadow: 0 0 0 3px rgba(153, 194, 162, 0.15);
}

.form-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

/* Autonomy Option Cards */
.autonomy-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.autonomy-option-card {
  padding: 18px;
  background: #0f100e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: all 140ms ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.autonomy-option-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.02);
}
.autonomy-option-card.active {
  border-color: var(--console-accent, #99c2a2);
  background: rgba(153, 194, 162, 0.05);
}

.autonomy-option-card .opt-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.autonomy-option-card .opt-radio {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 140ms ease;
}
.autonomy-option-card.active .opt-radio {
  border-color: var(--console-accent, #99c2a2);
  background: var(--console-accent, #99c2a2);
}
.autonomy-option-card.active .opt-radio::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0f100e;
}

.autonomy-option-card strong {
  font-size: 14px;
  color: #f3f2ec;
}
.autonomy-option-card p {
  margin: 0;
  font-size: 12px;
  color: #8c8e86;
  line-height: 1.45;
}

/* Custom Toggle Switches */
.capabilities-toggles-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.tensor-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #0f100e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  gap: 16px;
}

.toggle-info strong {
  display: block;
  font-size: 13px;
  color: #f3f2ec;
  margin-bottom: 2px;
}
.toggle-info p {
  margin: 0;
  font-size: 12px;
  color: #8c8e86;
}

.tensor-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.tensor-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 22px;
  transition: 160ms ease;
}
.switch-slider::before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #f3f2ec;
  border-radius: 50%;
  transition: 160ms ease;
}
.tensor-switch input:checked + .switch-slider {
  background-color: var(--console-accent, #99c2a2);
}
.tensor-switch input:checked + .switch-slider::before {
  transform: translateX(18px);
  background-color: #0f100e;
}

/* Editorial Overview Grid */
.editorial-overview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.ed-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 24px;
}
.ed-card.span-60 { width: calc(60% - 10px); }
.ed-card.span-40 { width: calc(40% - 10px); }
.ed-card.span-50 { width: calc(50% - 10px); }

@media (max-width: 768px) {
  .ed-card.span-60, .ed-card.span-40, .ed-card.span-50 {
    width: 100%;
  }
}

.ed-eyebrow {
  font-size: 11px;
  font-weight: 600;
  color: #8c8e86;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.ed-card h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: #f3f2ec;
}
.ed-value {
  margin: 0;
  font-size: 13px;
  color: #c2c4bc;
  line-height: 1.5;
}
.ed-subtext {
  margin: 0;
  font-size: 12px;
  color: #6e7068;
}
.btn-text-link {
  background: transparent;
  border: 0;
  color: var(--console-accent, #99c2a2);
  padding: 0;
  font-size: 13px;
  cursor: pointer;
  align-self: flex-start;
  margin-top: 4px;
}
.btn-text-link:hover {
  text-decoration: underline;
}

/* Knowledge Split Layout */
.knowledge-split-layout {
  display: grid;
  grid-template-columns: 4fr 6fr;
  gap: 32px;
  align-items: stretch;
}
@media (max-width: 900px) {
  .knowledge-split-layout { grid-template-columns: 1fr; }
}

.knowledge-config-pane {
  display: flex;
  flex-direction: column;
}

.knowledge-test-pane {
  display: flex;
  flex-direction: column;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  min-height: 500px;
}
.test-pane-header {
  padding: 16px 20px 8px;
}
.test-runtime-status { margin: 0 auto 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.test-pane-eyebrow {
  font-size: 10px;
  font-weight: 700;
  color: #71736b;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: block;
}
.test-pane-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: #f3f2ec;
}
.test-input-group {
  padding: 0 20px 16px;
  background: #111;
}
.test-textarea {
  width: 100%;
  background: #141512;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f3f2ec;
  font-size: 13px;
  padding: 12px;
  border-radius: 6px;
  resize: vertical;
  min-height: 60px;
}
.test-textarea:focus {
  outline: none;
  border-color: var(--console-accent, #99c2a2);
}
.test-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0;
}
.test-actions {
  display: flex;
  justify-content: flex-end;
  padding: 12px 20px;
}
.btn-run-test {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f3f2ec;
  color: #000;
  border: 0;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.btn-run-test:hover {
  background: #fff;
}
.test-preview-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: #0d0e0c;
  overflow-y: auto;
}
.test-response-identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.response-name {
  color: #f3f2ec;
  font-size: 14px;
  font-weight: 500;
}
.response-role {
  color: #8c8e86;
  font-size: 12px;
}
.test-preview-content {
  font-size: 13px;
  line-height: 1.5;
  color: #c2c4bc;
}
.test-preview-content .placeholder-text {
  color: #555;
  font-style: italic;
}
.test-preview-content.typing::after {
  content: '▋';
  animation: blink 1s step-start infinite;
}

.knowledge-sources-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.knowledge-source-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #0f100e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}
.knowledge-source-item .source-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.knowledge-source-item .source-icon {
  font-size: 16px;
}
.knowledge-source-item strong {
  font-size: 13px;
  color: #f3f2ec;
}
.knowledge-source-item small {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 3px;
  color: #71736b;
  font-size: 11px;
}
.knowledge-source-status::before {
  content: "·";
  margin-right: 6px;
  color: #53554f;
}
.knowledge-source-error {
  color: #d1847c;
}
.btn-remove-source {
  background: transparent;
  border: 0;
  color: #8c8e86;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  transition: color 140ms ease;
}
.btn-remove-source:hover {
  color: #e06c75;
}

/* Telegram Tab */
.telegram-manage-card {
  max-width: 600px;
}
.tg-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 16px;
}
.tg-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tg-logo-md {
  width: 36px;
  height: 36px;
}
.tg-banner-left h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #f3f2ec;
}
.tg-handle-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: #229ED9;
}
.tg-settings-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tg-settings-info .info-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.tg-settings-info .info-label {
  color: #8c8e86;
}
.tg-settings-info .info-val {
  color: #f3f2ec;
}
.tg-settings-info #empTgIdentityInfo {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.telegram-management-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
}
.telegram-management-actions[hidden] { display: none !important; }

/* Danger Zone */
.danger-zone {
  margin-top: 28px;
  padding: 20px;
  border: 1px solid rgba(224, 108, 117, 0.25);
  border-radius: 10px;
  background: rgba(224, 108, 117, 0.04);
}
.danger-zone h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: #e06c75;
}
.danger-zone p {
  margin: 0 0 14px;
  font-size: 12px;
  color: #8c8e86;
  line-height: 1.45;
}

.btn-danger {
  padding: 8px 16px;
  background: #e06c75;
  color: #fff;
  border: 0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 140ms ease;
}
.btn-danger:hover {
  opacity: 0.9;
}

/* Delete Modal */
.delete-confirm-modal {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: #141512;
  border: 1px solid rgba(224, 108, 117, 0.3);
  border-radius: 14px;
  padding: 24px;
  color: #f3f2ec;
}

/* Compact Empty States */
.empty-state-compact {
  text-align: center;
  padding: 36px 20px;
}
.empty-icon-sm {
  font-size: 28px;
  margin-bottom: 10px;
  opacity: 0.7;
}
.empty-state-compact h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: #f3f2ec;
}
.empty-state-compact p {
  margin: 0;
  font-size: 13px;
  color: #8c8e86;
}

/* Inline Rule Box */
.inline-rule-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  background: #191b17;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}
.inline-rule-box input {
  width: 100%;
  padding: 8px 12px;
  background: #0f100e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #f3f2ec;
  font-size: 13px;
}
.inline-rule-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.btn-sm {
  padding: 5px 12px !important;
  font-size: 12px !important;
}

#btnSaveInlineRule,
#btnSaveEmpEditRule {
  background: #ffffff !important;
  color: #000000 !important;
  font-weight: 600 !important;
  border: 0 !important;
  border-radius: 6px !important;
  transition: opacity 160ms ease, transform 160ms ease !important;
}
#btnSaveInlineRule:hover:not(:disabled),
#btnSaveEmpEditRule:hover:not(:disabled) {
  background: #ffffff !important;
  color: #000000 !important;
  opacity: 0.92 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15) !important;
}

/* Stable Sized Wizard Modal */
.hire-wizard-modal {
  position: relative;
  width: 100%;
  max-width: 620px;
  height: 580px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: #141512;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  color: #f3f2ec;
}

.hire-wizard-body {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.hire-wizard-step {
  display: none;
  opacity: 0;
  transition: opacity 120ms ease;
}
.hire-wizard-step.active {
  display: block;
  opacity: 1;
}

/* White Next Button Style */
.hire-wizard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: #171815;
}

.footer-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hire-next-btn {
  background: #ffffff !important;
  color: #000000 !important;
  font-weight: 600 !important;
  border: 0 !important;
  border-radius: 8px !important;
  padding: 9px 20px !important;
  margin-left: auto !important;
  transition: opacity 160ms ease, transform 160ms ease !important;
}
.hire-next-btn:hover {
  background: #ffffff !important;
  color: #000000 !important;
  opacity: 0.92 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15) !important;
}
.hire-next-btn[aria-busy="true"], .hire-next-btn[aria-busy="true"]:hover {
  background: #ffffff !important;
  color: #000000 !important;
  opacity: 1 !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Knowledge Dropzone & Textarea */
.knowledge-section.full-width {
  width: 100%;
}

.knowledge-dropzone {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #0f100e;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  transition: border-color 160ms ease, background 160ms ease;
}
.knowledge-dropzone:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.02);
}

.dropzone-files-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dropzone-file-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 13px;
  color: #f3f2ec;
}

.dropzone-file-chip .chip-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.dropzone-file-chip button {
  background: transparent;
  border: 0;
  color: #8c8e86;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
}
.dropzone-file-chip button:hover {
  color: #e06c75;
}

.knowledge-textarea-full {
  width: 100%;
  min-height: 140px;
  padding: 14px 16px;
  background: #0f100e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #f3f2ec;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.knowledge-textarea-full:focus {
  outline: none;
  border-color: var(--console-accent, #99c2a2);
  box-shadow: 0 0 0 3px rgba(153, 194, 162, 0.15);
}

.avatar-modal-content {
  width: 100%;
  max-width: 420px;
  background: #141512;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 24px;
  position: relative;
  color: #f3f2ec;
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.emoji-opt {
  font-size: 24px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  cursor: pointer;
  transition: all 140ms ease;
}
.emoji-opt:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.1);
}


/* Avatar Dropdown Menu */
.avatar-dropdown-container {
  position: relative;
  display: inline-block;
}
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  background: #1a1b18;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  min-width: 160px;
  padding: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  flex-direction: column;
}
.dropdown-item {
  background: transparent;
  border: none;
  text-align: left;
  padding: 8px 12px;
  font-size: 13px;
  color: #c2c4bc;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
}
.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f3f2ec;
}
.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 4px 0;
}
.dropdown-item.destructive {
  color: #e06c75;
}
.dropdown-item.destructive:hover {
  background: rgba(224, 108, 117, 0.1);
  color: #f0838b;
}

/* Refined Employee Card Telegram Icon */
.tg-square-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: rgba(42, 171, 238, 0.1);
  border-radius: 3px;
  margin-right: 6px;
}
.tg-square-icon svg {
  fill: #2AABEE;
  width: 10px;
  height: 10px;
}

/* Overview Specification Rail */
.overview-spec-rail {
  display: grid;
  grid-template-columns: 30% 24% 28% 18%;
  gap: 24px;
  background: #141512;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 24px 0;
  align-items: flex-start;
}
.spec-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.spec-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #71736b;
}
.spec-value {
  font-size: 13px;
  color: #f3f2ec;
  line-height: 1.5;
}
.spec-sub {
  font-size: 12px;
  color: #8c8e86;
  line-height: 1.4;
}
.spec-action {
  font-size: 12px;
  font-weight: 500;
  margin-top: 4px;
  color: var(--console-accent, #99c2a2);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  text-align: left;
}
.spec-action:hover {
  text-decoration: underline;
}

@media (max-width: 1024px) {
  .overview-spec-rail {
    grid-template-columns: 1fr 1fr;
    row-gap: 32px;
  }
}
@media (max-width: 600px) {
  .overview-spec-rail {
    grid-template-columns: 1fr;
    row-gap: 24px;
  }
}

/* Knowledge Chat Console Redesign */
.knowledge-test-pane {
  display: flex;
  flex-direction: column;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  height: 600px; /* Gives useful vertical height */
  max-height: 70vh;
}
.test-pane-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #141512;
}
.test-pane-eyebrow {
  font-size: 10px;
  font-weight: 700;
  color: #71736b;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: block;
}
.test-conversation-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: #0d0e0c;
}
.test-chat-empty-state {
  margin-top: 16px;
}
.test-message {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.test-message-header {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #71736b;
}
.test-message-content {
  font-size: 13px;
  color: #f3f2ec;
  line-height: 1.5;
  word-wrap: break-word;
}
.test-message-content p { margin: 0 0 9px; }
.test-message-content p:last-child { margin-bottom: 0; }
.test-message-content h1, .test-message-content h2, .test-message-content h3 { margin: 14px 0 7px; color: var(--text); line-height: 1.3; }
.test-message-content h1 { font-size: 16px; }.test-message-content h2 { font-size: 14px; }.test-message-content h3 { font-size: 13px; }
.test-message-content ul, .test-message-content ol { margin: 7px 0 10px; padding-left: 19px; }
.test-message-content li + li { margin-top: 4px; }
.test-message-content blockquote { margin: 8px 0; padding-left: 10px; border-left: 2px solid var(--line); color: var(--muted); }
.test-message-content code { padding: 1px 4px; border-radius: 4px; background: var(--sidebar-hover); font-family: var(--font-mono); font-size: .9em; }
.test-message-content pre { position: relative; margin: 10px 0; padding: 12px 12px 43px; overflow: auto; border: 1px solid color-mix(in srgb, var(--line) 88%, transparent); border-radius: 7px; background: #191a17; background-image: none; box-shadow: none; color: #e5e5de; text-decoration: none; white-space: pre; line-height: 1.55; }
.test-message-content pre[data-language] { padding-top: 30px; }
.test-message-content pre[data-language]::before { content: attr(data-language); position: absolute; top: 10px; left: 12px; color: var(--muted); font: 600 9px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.test-message-content pre code { padding: 0; border: 0; background: transparent; background-image: none; box-shadow: none; text-decoration: none; }
.test-message-content a { color: var(--console-accent); text-underline-offset: 2px; }
.copilot-message.assistant { white-space: normal; }
.copilot-message.assistant:not(.is-thinking):not(.copilot-execution-panel) { align-self: stretch; max-width: 100%; padding: 14px 5px 16px; border: 0; border-radius: 0; background: transparent; font-size: 14px; line-height: 1.66; }
.copilot-message.assistant p { margin: 0 0 10px; }
.copilot-message.assistant p:last-child { margin-bottom: 0; }
.copilot-message.assistant h1, .copilot-message.assistant h2, .copilot-message.assistant h3 { margin: 19px 0 8px; color: var(--text); font-weight: 620; letter-spacing: -.012em; line-height: 1.28; }
.copilot-message.assistant h1 { font-size: 19px; }.copilot-message.assistant h2 { font-size: 16px; }.copilot-message.assistant h3 { font-size: 14px; }
.copilot-message.assistant ul, .copilot-message.assistant ol { margin: 10px 0 13px; padding-left: 22px; }
.copilot-message.assistant li { padding-left: 2px; }.copilot-message.assistant li + li { margin-top: 5px; }
.copilot-message.assistant strong { font-weight: 650; color: var(--text); }
.copilot-message.assistant blockquote { margin: 13px 0; padding: 2px 0 2px 13px; border-left: 2px solid color-mix(in srgb, var(--console-accent) 56%, var(--line)); color: var(--muted); }
.copilot-message.assistant code { padding: 2px 5px; border: 1px solid color-mix(in srgb, var(--line) 82%, transparent); border-radius: 4px; background: var(--sidebar-hover); font-family: var(--font-mono); font-size: .88em; }
.copilot-message.assistant pre { position: relative; margin: 15px 0; padding: 14px 14px 46px; overflow: auto; border: 1px solid color-mix(in srgb, var(--line) 88%, transparent); border-radius: 8px; background: #191a17; background-image: none; box-shadow: none; color: #e5e5de; text-decoration: none; white-space: pre; line-height: 1.55; }
.copilot-message.assistant pre[data-language] { padding-top: 32px; }
.copilot-message.assistant pre[data-language]::before { content: attr(data-language); position: absolute; top: 9px; left: 12px; color: var(--muted); font: 600 9px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.copilot-message.assistant pre code { padding: 0; border: 0; background: transparent; background-image: none; box-shadow: none; text-decoration: none; }
.markdown-code-copy { position: absolute; right: 8px; bottom: 7px; display: grid; width: 28px; height: 28px; place-items: center; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; }
.markdown-code-copy svg { display: block; width: 14px; height: 14px; }
.markdown-code-copy:hover, .markdown-code-copy:focus-visible { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); outline: none; }
.markdown-code-copy[data-copied="true"] { color: var(--console-accent); }
.copilot-message.assistant a { color: var(--console-accent); text-underline-offset: 2px; }
.test-message-ai .test-message-header {
  color: #8c8e86;
}
.test-message-system-error { padding: 9px 11px; border: 1px solid color-mix(in srgb, #d1847c 44%, var(--line)); border-radius: 8px; background: color-mix(in srgb, #d1847c 7%, transparent); }
.test-message-system-error .test-message-header { color: #d1847c; }
.test-message-system-error .test-message-content { color: var(--muted); }
.test-composer {
  padding: 16px 20px;
  background: #141512;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 12px;
  align-items: flex-end;
}
.chat-input {
  flex: 1;
  background: transparent;
  border: 0;
  color: #f3f2ec;
  font-size: 13px;
  resize: none;
  min-height: 20px;
  max-height: 120px;
  padding: 6px 0;
}
.chat-input:focus {
  outline: none;
}
.btn-run-test {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #f3f2ec;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 140ms ease;
  height: 32px;
}
.btn-run-test:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

.knowledge-split-layout {
  display: grid;
  grid-template-columns: 4fr 6fr;
  gap: 32px;
  align-items: stretch;
}
@media (max-width: 900px) {
  .knowledge-split-layout {
    grid-template-columns: 1fr;
  }
}

/* --- UI REFINEMENTS (APPENDED OVERRIDES) --- */

/* 1. Employee Cards */
.tg-square-icon {
  width: 28px !important;
  height: 28px !important;
  background: #2AABEE !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-right: 0 !important;
}
.tg-square-icon svg {
  width: 14px !important;
  height: 14px !important;
  fill: #ffffff !important;
}
.emp-card-tg-row {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}
.tg-label {
  font-size: 13px !important;
  color: #a3a59e !important;
  font-weight: 500 !important;
}

/* 2. Overview Rail */
.overview-spec-rail {
  grid-template-columns: 1.25fr 1fr 1.2fr 0.65fr !important;
  background: #11120f !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  border-radius: 12px !important;
  padding: 28px 32px !important;
  gap: 36px !important;
  align-items: flex-start !important;
}
.spec-col {
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  padding-right: 36px;
  gap: 14px !important;
}
.spec-col:last-child {
  border-right: none;
  padding-right: 0;
}
.spec-label {
  margin-bottom: 0 !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em !important;
  color: #71736b !important;
  text-transform: uppercase !important;
  line-height: 1 !important;
}
@media (max-width: 1024px) {
  .overview-spec-rail { grid-template-columns: 1fr 1fr !important; }
  .spec-col { border-right: none; padding-right: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.04); padding-bottom: 24px; }
  .spec-col:nth-last-child(-n+2) { border-bottom: none; padding-bottom: 0; }
}
@media (max-width: 600px) {
  .overview-spec-rail { grid-template-columns: 1fr !important; }
  .spec-col:nth-last-child(-n+2) { border-bottom: 1px solid rgba(255, 255, 255, 0.04); padding-bottom: 24px; }
  .spec-col:last-child { border-bottom: none; padding-bottom: 0; }
}

/* 3. Knowledge Upload Polish */
.polished-dropzone {
  border: 1px dashed rgba(255, 255, 255, 0.15) !important;
  background: #141512 !important;
  border-radius: 8px;
  padding: 32px 20px !important;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
  margin-bottom: 0 !important;
}
.polished-dropzone:hover { background: #1a1b18 !important; }
.dz-text { font-size: 13px; color: #f3f2ec; font-weight: 500; margin-bottom: 4px; }
.dz-sub { font-size: 11px; color: #71736b; font-weight: 500; letter-spacing: 0.05em; }

/* 4. Knowledge Chat Layout & Style */
.knowledge-split-layout {
  grid-template-columns: 43% 57% !important;
}
.knowledge-test-pane {
  background: #080808 !important;
  height: 540px !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
}
.test-pane-header {
  background: #0d0e0c !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.test-pane-subtitle {
  font-size: 12px;
  color: #71736b;
  font-weight: 500;
}
.test-conversation-area {
  background: transparent !important;
  padding: 24px !important;
}
.test-composer {
  background: transparent !important;
  border-top: none !important;
  padding: 0 24px 24px !important;
}
.composer-inner-box {
  display: flex;
  align-items: center;
  background: #141512;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 8px 8px 12px;
  gap: 12px;
  transition: border-color 0.2s ease;
}
.composer-inner-box:focus-within {
  border-color: rgba(255, 255, 255, 0.15);
}
.chat-input {
  padding: 0 !important;
  font-size: 13px;
  line-height: 1.5;
  background: transparent;
  color: #f3f2ec;
  border: none;
  resize: none;
  flex: 1;
  min-height: 20px;
}
.chat-input:focus {
  outline: none;
}
.btn-send-inline {
  background: color-mix(in srgb, var(--console-accent) 10%, transparent);
  color: var(--console-accent);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.btn-send-inline:hover {
  background: color-mix(in srgb, var(--console-accent) 20%, transparent);
}
.btn-send-inline:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.test-chat-empty-state {
  margin: auto 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tg-square-icon {
  background: transparent !important;
  border-radius: 0 !important;
}
.tg-square-icon svg {
  width: 20px !important;
  height: 20px !important;
  fill: none !important;
}
.tg-square-icon svg {
  width: 24px !important;
  height: 24px !important;
  fill: initial !important;
}
.knowledge-split-layout {
  grid-template-columns: 55% 45% !important; /* more space for left side to upload */
}

/* Main Chat Thinking Animation */
.copilot-message.is-thinking::after {
  content: none !important;
  animation: none !important;
}
.thinking-anim-seq {
  display: inline-flex;
  align-items: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: var(--console-accent); /* Tensor olive accent */
  font-weight: bold;
  letter-spacing: 2px;
}
.thinking-anim-seq::before {
  content: "-";
  animation: tensor-think-logo 1.2s infinite steps(1);
}
@keyframes tensor-think-logo {
  0% { content: "-"; }
  33% { content: "--"; }
  66% { content: "-->"; }
}

/* Idrok only shows activity while an actual chat request is outstanding. SSE
   deltas replace it immediately; a completed-only response never imitates a
   token stream. */
.copilot-message.is-thinking { display: inline-flex !important; align-items: center; gap: 8px; width: fit-content; min-height: 24px; padding: 2px 0 !important; color: var(--muted); font-size: 11px; line-height: 1.4; }
.copilot-activity-mark { width: 14px; height: 5px; border-radius: 999px; background: color-mix(in srgb, var(--console-accent) 72%, var(--muted)); animation: idrok-activity-pulse 950ms var(--motion-ease-standard) infinite alternate; }
.copilot-activity-label { white-space: nowrap; }
@keyframes idrok-activity-pulse { from { opacity: .36; transform: scaleX(.72); } to { opacity: .9; transform: scaleX(1); } }
.copilot-hiring-review { border-color: color-mix(in srgb, var(--line) 82%, var(--console-accent) 18%); }
.copilot-hiring-review-eyebrow { color: color-mix(in srgb, var(--console-accent) 72%, var(--muted)); }
.copilot-hiring-review-instructions::before { content: "Initial brief"; display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .045em; text-transform: uppercase; }
.copilot-hiring-review[data-state="pending"] .copilot-hiring-review-status::before { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 6px 1px 0; border-radius: 50%; background: currentColor; animation: idrok-activity-pulse 950ms var(--motion-ease-standard) infinite alternate; }
@media (prefers-reduced-motion: reduce) { .copilot-activity-mark, .copilot-hiring-review[data-state="pending"] .copilot-hiring-review-status::before { animation: none; } }

/* Additional Polish for Knowledge Chat */
.knowledge-test-pane {
  border-radius: 12px !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}
.test-message-content {
  font-size: 14px !important;
  line-height: 1.6 !important;
  color: #e8e9e4 !important;
}
.test-message-header {
  font-size: 10px !important;
  letter-spacing: 0.15em !important;
  margin-bottom: 4px !important;
}
.composer-inner-box {
  padding: 10px 10px 10px 16px !important;
  background: #11120f !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 12px !important;
}
.composer-inner-box:focus-within {
  border-color: rgba(153, 194, 162, 0.4) !important; /* Olive glow */
  box-shadow: 0 0 0 2px rgba(153, 194, 162, 0.1) !important;
}
.chat-input {
  font-size: 14px !important;
}

/* 50/50 Layout and Run Button Polish */
.knowledge-split-layout {
  grid-template-columns: 1fr 1fr !important; /* exactly 50/50 */
}
.test-pane-header {
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: center !important;
}
.btn-chat-simulate {
  background: color-mix(in srgb, var(--console-accent) 10%, transparent);
  color: var(--console-accent);
  border: 1px solid color-mix(in srgb, var(--console-accent) 20%, transparent);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-chat-simulate:hover {
  background: rgba(153, 194, 162, 0.2);
  border-color: rgba(153, 194, 162, 0.3);
}
.btn-chat-simulate svg {
  margin-top: -1px;
}

/* Ultimate Polish for Knowledge Chat UI */
.knowledge-test-pane {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}
.test-pane-header {
  background: transparent !important;
  border: none !important;
  padding: 0 0 16px 0 !important;
}
.test-composer {
  padding: 16px 0 0 0 !important;
}
.composer-inner-box {
  background: #141512 !important; /* system input surface */
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 12px !important;
  padding: 12px 12px 12px 16px !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2) !important;
}
.composer-inner-box:focus-within {
  border-color: rgba(153, 194, 162, 0.4) !important; /* Tensor olive */
  box-shadow: 0 0 0 2px rgba(153, 194, 162, 0.1), 0 2px 12px rgba(0,0,0,0.2) !important;
}
.chat-input {
  font-size: 14px !important;
  line-height: 1.5 !important;
  min-height: 24px !important;
}
.test-conversation-area {
  padding: 0 !important;
}

/* Restore and Polish the Outer Chat Frame */
.knowledge-test-pane {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important; /* This is the outer frame */
  border-radius: 12px !important;
  padding: 0 !important;
  box-shadow: none !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.test-pane-header {
  padding: 16px 20px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
}

.test-conversation-area {
  padding: 20px !important;
  flex: 1 !important;
}

.test-composer {
  padding: 16px 20px 20px 20px !important;
}

.composer-inner-box {
  background: #0d0e0c !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important; /* This is the inner text box frame */
  border-radius: 8px !important;
  padding: 10px 10px 10px 14px !important;
  box-shadow: none !important;
}

.composer-inner-box:focus-within {
  border-color: rgba(153, 194, 162, 0.4) !important;
  box-shadow: 0 0 0 1px rgba(153, 194, 162, 0.2) !important;
}


/* Fix chat input width */
.test-composer {
  width: 100% !important;
  box-sizing: border-box !important;
}
.composer-inner-box {
  width: 100% !important;
  box-sizing: border-box !important;
  display: flex !important;
}
.chat-input {
  flex: 1 !important;
  width: 100% !important;
}

/* The outer conversation surface is the only frame in the knowledge tester. */
#empTabKnowledge .composer-inner-box,
#empTabKnowledge .composer-inner-box:focus-within {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 8px 0 !important;
}

#empTabKnowledge .composer-content {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
  min-height: 42px;
  padding: 8px 0;
}
#empTabKnowledge .test-composer {
  padding: 12px 20px 14px !important;
  border-top: 1px solid rgba(255, 255, 255, .08);
  background: #141512 !important;
}
#empTabKnowledge .composer-content .chat-input {
  min-width: 0;
  min-height: 24px;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
#empTabKnowledge .composer-content .chat-input::placeholder { color: #85877f; }
#empTabKnowledge .composer-content:focus-within { outline: 1px solid rgba(153, 194, 162, .38); outline-offset: 5px; border-radius: 3px; }

/* Instructions are an employee's operating brief, not a generic settings form. */
#empTabInstructions .employee-instructions-card { max-width: 900px; padding: 0; overflow: hidden; }
#empTabInstructions .instructions-intro { padding: 26px 28px 22px; border-bottom: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .012); }
#empTabInstructions .section-eyebrow { display: block; margin-bottom: 7px; color: var(--console-accent, #99c2a2); font: 600 10px/1.2 "IBM Plex Mono", monospace; letter-spacing: .1em; text-transform: uppercase; }
#empTabInstructions .instructions-intro h2 { margin: 0 0 6px; color: #f3f2ec; font-size: 20px; letter-spacing: -.035em; }
#empTabInstructions .instructions-intro p { max-width: 580px; margin: 0; color: #8c8e86; font-size: 13px; line-height: 1.5; }
#empTabInstructions .form-group { margin: 0; padding: 22px 28px; }
#empTabInstructions .form-group + .form-group { border-top: 1px solid rgba(255, 255, 255, .06); }
#empTabInstructions .form-group > label,
#empTabInstructions .rules-header label { color: #e6e5de; font-size: 13px; font-weight: 600; }
#empTabInstructions .tensor-textarea { min-height: 142px; margin-top: 10px; resize: vertical; background: #10110e; }
#empTabInstructions .form-actions-row { margin: 0; padding: 16px 28px 20px; border-top: 1px solid rgba(255, 255, 255, .06); }
@media (max-width: 600px) {
  #empTabInstructions .instructions-intro, #empTabInstructions .form-group, #empTabInstructions .form-actions-row { padding-left: 18px; padding-right: 18px; }
}

/* Dashboard: AI workforce command center */
#page-dashboard [hidden] { display: none !important; }

#page-dashboard .page-header {
  align-items: flex-end;
  margin-bottom: 22px;
}

.dashboard-owner {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

#page-dashboard .page-header h1 {
  font-size: clamp(26px, 3vw, 34px);
  letter-spacing: -0.04em;
}

.dashboard-onboarding-command,
.dashboard-operations-summary {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.dashboard-data-notice {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.dashboard-data-notice h2 {
  margin: 5px 0 8px;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
}

.dashboard-data-notice > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.billing-not-configured {
  max-width: 680px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.billing-not-configured h2 {
  margin: 5px 0 8px;
  color: var(--text);
  font-size: 17px;
}

.billing-not-configured > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.billing-summary-grid[hidden],
.billing-console-grid[hidden],
.billing-history[hidden] { display: none !important; }

.telegram-connection-form {
  display: grid;
  gap: 9px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--surface-card, var(--card));
}

.telegram-connection-form[hidden] { display: none !important; }
.telegram-connection-form:not([hidden]) { animation: telegram-connection-form-in 150ms ease-out; }
.telegram-connection-form label { color: var(--text); font-size: 12px; font-weight: 600; }
.telegram-connection-form input {
  width: 100%;
  min-height: 40px;
  box-sizing: border-box;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  color: var(--text);
  background: var(--bg);
}
.telegram-connection-form input:focus { border-color: var(--console-accent); }
.telegram-connection-form p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.telegram-connection-form .telegram-connection-feedback { min-height: 16px; color: var(--text); }
.telegram-form-actions { margin-top: 3px; }
@keyframes telegram-connection-form-in {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .telegram-connection-form:not([hidden]) { animation: none; }
}

.dashboard-onboarding-command {
  display: grid;
  grid-template-columns: minmax(260px, .9fr) minmax(0, 1.35fr);
  gap: 32px;
  padding: 28px;
}

.onboarding-command-copy {
  align-self: center;
}

.onboarding-command-copy h2,
.operations-summary-head h2 {
  margin: 5px 0 10px;
  color: var(--text);
  font-size: 22px;
  letter-spacing: -0.025em;
}

.onboarding-command-copy > p:not(.panel-kicker) {
  max-width: 410px;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.onboarding-journey {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 1px;
  list-style: none;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  overflow: hidden;
  background: var(--line-soft);
}

.onboarding-journey li {
  min-height: 118px;
  padding: 17px;
  background: var(--surface-card, var(--card));
}

.onboarding-journey span {
  display: block;
  margin-bottom: 18px;
  color: var(--console-accent);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
}

.onboarding-journey strong,
.onboarding-journey small {
  display: block;
}

.onboarding-journey strong { color: var(--text); font-size: 13px; }
.onboarding-journey small { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.4; }

.dashboard-operations-summary { padding: 18px 20px; }

.operations-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.operations-summary-head h2 { font-size: 17px; margin-bottom: 0; }
.operations-summary-head a,
.operations-attention a { color: var(--muted); font-size: 12px; text-decoration: none; }
.operations-summary-head a:hover,
.operations-attention a:hover { color: var(--text); }

.operations-attention {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.operations-attention p { flex: 1; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.operations-attention p strong { color: var(--text); font-weight: 500; }

.attention-indicator {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
}
.attention-indicator.attention-action { border-color: color-mix(in srgb, #d8b56a 45%, var(--line)); color: #d8b56a; }
.attention-indicator.attention-setup { border-color: color-mix(in srgb, #c29f6b 45%, var(--line)); color: #c29f6b; }
.attention-indicator.attention-error { border-color: color-mix(in srgb, #cf7066 45%, var(--line)); color: #cf7066; }
.attention-indicator.attention-clear { border-color: color-mix(in srgb, var(--console-accent) 42%, var(--line)); color: var(--console-accent); }

#dashboardMetrics.dashboard-stats-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  margin: 0 !important;
}

.workforce-workplace { color: var(--muted); }
.workforce-status { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); white-space: nowrap; }
.workforce-status i { display: inline-grid; width: 6px; height: 6px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: currentColor; color: #11120f; font-size: 9px; font-style: normal; font-weight: 800; line-height: 1; }
.workforce-status-live { color: var(--console-accent); }
.workforce-status-connected { color: var(--console-accent); }
.workforce-status-paused { color: var(--semantic-inactive); }
.workforce-status-setup { color: #c29f6b; }
.workforce-status-disconnected { color: #cf7066; }
.workforce-status-error { color: #cf7066; }
.workforce-status-unknown { color: var(--muted); }
.workforce-status-connected i { width: 14px; height: 14px; border: 1px solid currentColor; background: transparent; color: currentColor; }
.workforce-status-live i {
  animation: tensor-live-dot 3.2s ease-in-out infinite;
  transform-origin: center;
}
.telegram-setup-notice {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-left: 2px solid #cf7066;
  background: rgba(207, 112, 102, .07);
  color: #d9887e;
  font-size: 12px;
  line-height: 1.45;
}
.hero-tg-info { display: inline-flex; width: 18px; height: 18px; flex: 0 0 auto; }
.hero-tg-info svg { display: block; width: 100%; height: 100%; }
@keyframes tensor-live-dot {
  0%, 100% { opacity: .72; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.22); }
}
@media (prefers-reduced-motion: reduce) {
  .workforce-status-live i { animation: none; }
}

@media (max-width: 1300px) {
  #dashboardMetrics.dashboard-stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}

@media (max-width: 650px) {
  #dashboardMetrics.dashboard-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (max-width: 820px) {
  .dashboard-onboarding-command { grid-template-columns: 1fr; gap: 22px; padding: 22px; }
}

@media (max-width: 560px) {
  #page-dashboard .page-header { align-items: flex-start; }
  .dashboard-onboarding-command { padding: 18px; }
  .onboarding-journey { grid-template-columns: 1fr; }
  .onboarding-journey li { min-height: auto; }
  .operations-summary-head, .operations-attention { align-items: flex-start; flex-direction: column; }
  .operations-attention { gap: 9px; }
}

/* Final model-card precedence: later console refinements must not flatten this surface. */
.console-model-card { display: block; min-height: 292px !important; }
.model-card-visual { display: grid; height: 104px; place-items: center; border-right: 0; border-bottom: 1px solid var(--line); }
.model-card-visual .model-symbol { width: 66px; height: 66px; }
.console-model-copy { display: flex; min-height: 188px !important; padding: 17px 19px !important; }
.model-card-facts { display: grid; }
.model-detail-dialog { width: min(780px, calc(100vw - 30px)); max-width: 780px; }
.model-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }
@media (max-width: 620px) {
  .console-model-card { min-height: 0 !important; }
  .model-card-visual { height: 96px; }
  .model-card-visual .model-symbol { width: 58px; height: 58px; }
  .console-model-copy { min-height: 0 !important; }
  .model-detail-grid { grid-template-columns: 1fr; gap: 22px; }
}

/* Model identity palette: muted material colors, never decorative gradients. */
.console-model-card { --model-tone: #7d9db2; --model-tone-deep: #607d91; border-color: color-mix(in srgb, var(--model-tone) 26%, var(--line)); }
.console-compas { --model-tone: #8cadc1; --model-tone-deep: #66859a; }
.console-vector { --model-tone: #92b69b; --model-tone-deep: #6d9178; }
.console-apex { --model-tone: #c1847b; --model-tone-deep: #98635d; }
.model-card-visual { background: var(--model-tone-deep); }
.model-card-visual .model-symbol { color: #f3f2ec; }
.model-card-visual .model-symbol circle { fill: color-mix(in srgb, var(--model-tone-deep) 82%, #f3f2ec); }
.console-model-card::before { background: var(--model-tone); opacity: 0; }
.console-model-card:hover {
  border-color: var(--model-tone);
  background: var(--card);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--model-tone) 58%, transparent), 0 14px 30px rgba(0,0,0,.16);
}
.console-model-card:hover::before,
.console-model-card:focus-visible::before { background: var(--model-tone); opacity: 1; }
.console-model-card:focus-visible { border-color: var(--model-tone); outline-color: color-mix(in srgb, var(--model-tone) 72%, transparent); }
.console-model-card .model-card-facts > div:first-child dd,
.console-model-card .model-card-disclosure b,
.console-model-card .console-model-copy > div > span { color: var(--model-tone); }
@media (prefers-reduced-motion: reduce) {
  .console-model-card { transition: none; }
}

/* Final model-detail presentation: quiet icon treatment and technical alignment. */
.model-card-visual .model-symbol { color: #111210; stroke-width: 1.65; }
.model-card-visual .model-symbol circle { fill: var(--model-tone-deep); }
.model-detail-dialog { width: min(1100px, calc(100vw - 36px)); max-width: 1100px; }
.model-detail-head { min-height: 146px; align-items: flex-start; gap: 26px; }
.model-detail-logo { width: 142px; min-width: 142px; height: 118px; min-height: 118px; padding: 0; border: 0; border-radius: 0; background: transparent; }
.model-detail-logo .model-symbol { width: 76px; height: 76px; color: #ecebe4; stroke-width: 1.55; }
.model-detail-logo .model-symbol circle { fill: transparent; }
.model-detail-head h2 { font-size: 42px; letter-spacing: -.04em; }
.model-detail-head p:not(.panel-kicker) { max-width: 620px; font-size: 16px; line-height: 1.5; }
.model-detail-body { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; margin-top: 24px; }
.model-detail-grid { display: contents; }
.model-detail-body > section { min-width: 0; }
.model-detail-body > section .model-detail-label { min-height: 30px; }
.model-pricing-grid > div,.model-feature-grid > div { min-height: 48px; }
.model-pricing-grid dt,.model-feature-grid dt { font-size: 13px; }
.model-pricing-grid dd,.model-feature-grid dd { font-size: 14px; }
.model-employee-fit { display: grid; gap: 8px; }
.model-employee-fit span { width: fit-content; max-width: 100%; padding: 8px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-capabilities { gap: 13px; padding-top: 2px; }
.model-capabilities li { align-items: flex-start; font-size: 13px; line-height: 1.45; }
.model-detail-footer { grid-column: 1 / -1; }
@media (max-width: 900px) {
  .model-detail-body { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
  .model-detail-dialog { width: min(780px, calc(100vw - 30px)); }
}
@media (max-width: 620px) {
  .model-detail-head { min-height: 0; gap: 15px; }
  .model-detail-logo { width: 72px; min-width: 72px; height: 72px; min-height: 72px; }
  .model-detail-logo .model-symbol { width: 54px; height: 54px; }
  .model-detail-head h2 { font-size: 32px; }
  .model-detail-head p:not(.panel-kicker) { font-size: 13px; }
  .model-detail-body { grid-template-columns: 1fr; gap: 24px; }
}

/* Final light-theme surface pass: onboarding stays part of the workspace, not a dark island. */
.copilot-messages { padding-right: 14px; scrollbar-gutter: stable; }
.copilot-messages::-webkit-scrollbar { width: 10px; }
.copilot-messages::-webkit-scrollbar-track { background: transparent; }

html[data-theme="light"] .account-trigger:hover,
html[data-theme="light"] .sidebar-account.is-open .account-trigger { background: #e8ece3; }
html[data-theme="light"] .account-avatar {
  border: 2px solid var(--console-accent);
  background: #edf1e7;
  color: #3e4d2b;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--console-accent) 12%, transparent);
}
html[data-theme="light"] .account-copy strong { color: var(--text); }
html[data-theme="light"] .account-copy small { color: var(--muted); }

html[data-theme="light"] .hire-wizard-modal,
html[data-theme="light"] .hire-wizard-header,
html[data-theme="light"] .hire-wizard-body,
html[data-theme="light"] .hire-wizard-footer { background: var(--card); color: var(--text); }
html[data-theme="light"] .hire-wizard-modal { border-color: #cfd4c8; box-shadow: 0 24px 54px rgba(38, 46, 30, .18); }
html[data-theme="light"] .hire-wizard-header,
html[data-theme="light"] .hire-wizard-footer { border-color: var(--line); }
html[data-theme="light"] .hire-wizard-modal .modal-close { color: #62695d; }
html[data-theme="light"] .hire-wizard-modal .modal-close:hover { color: var(--text); background: #e8ece3; }
html[data-theme="light"] .step-head h2,
html[data-theme="light"] .brand-info strong,
html[data-theme="light"] .verified-identity strong { color: var(--text); }
html[data-theme="light"] .step-head p,
html[data-theme="light"] .brand-info span,
html[data-theme="light"] .verified-identity span,
html[data-theme="light"] .token-help-link { color: var(--muted); }
html[data-theme="light"] .hire-step-form label,
html[data-theme="light"] .dropzone-inner p,
html[data-theme="light"] .connected-note { color: #41483d; }
html[data-theme="light"] .hire-step-form input[type="text"],
html[data-theme="light"] .hire-step-form input[type="password"],
html[data-theme="light"] .hire-step-form select,
html[data-theme="light"] .hire-step-form textarea {
  background: #fffefa;
  border-color: #cbd1c5;
  color: #20251d;
}
html[data-theme="light"] .hire-step-form input::placeholder,
html[data-theme="light"] .hire-step-form textarea::placeholder { color: #7a8175; }
html[data-theme="light"] .hire-step-form input:focus,
html[data-theme="light"] .hire-step-form select:focus,
html[data-theme="light"] .hire-step-form textarea:focus { border-color: var(--console-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--console-accent) 17%, transparent); }
html[data-theme="light"] .rule-item,
html[data-theme="light"] .knowledge-item,
html[data-theme="light"] .telegram-workplace-card,
html[data-theme="light"] .dropzone-file-chip { background: #f7f8f3; border-color: #d5d9ce; color: var(--text); }
html[data-theme="light"] .knowledge-dropzone { background: #fafbf7; border-color: #cbd1c5; }
html[data-theme="light"] .knowledge-dropzone:hover { background: #f1f4eb; border-color: var(--console-accent); }
html[data-theme="light"] .btn-add-rule { color: #465b2f; border-color: #aebba0; }
html[data-theme="light"] .btn-add-rule:hover { color: #354724; background: #edf1e7; border-color: var(--console-accent); }
html[data-theme="light"] .hire-next-btn,
html[data-theme="light"] .hire-next-btn:hover,
html[data-theme="light"] .hire-next-btn[aria-busy="true"],
html[data-theme="light"] .hire-next-btn[aria-busy="true"]:hover {
  background: var(--console-accent) !important;
  border-color: var(--console-accent) !important;
  color: #fff !important;
  box-shadow: none !important;
}
html[data-theme="light"] .hire-next-btn:hover:not(:disabled) { background: #526438 !important; border-color: #526438 !important; }
html[data-theme="light"] .hire-wizard-modal button:not(:disabled):not(.hire-next-btn):hover { color: inherit; }
html[data-theme="light"] .btn-connect-card { background: #1e8bc4; color: #fff; }
html[data-theme="light"] .knowledge-textarea-full,
html[data-theme="light"] .composer-inner-box {
  background: #fffefa !important;
  border-color: #cbd1c5 !important;
  color: var(--text) !important;
  box-shadow: none !important;
}
html[data-theme="light"] .composer-inner-box:focus-within { border-color: var(--console-accent) !important; box-shadow: 0 0 0 2px color-mix(in srgb, var(--console-accent) 16%, transparent) !important; }

/* Keep Tensor OS reading width aligned to its composer; the scrollbar owns the final gutter. */
.copilot-messages { padding-right: 5px; }
.copilot-panel-content { padding-right: 0; }
.copilot-composer { margin-right: 0; }

/* Workspace and account menus are application-layer popovers, never clipped by the main canvas. */
.app-sidebar,
.sidebar-workspace-selector { overflow: visible !important; }
.sidebar-workspace-selector { z-index: 2147483645; }
.sidebar-workspace-selector .workspace-menu { z-index: 2147483646 !important; }
.sidebar-workspace-selector.open .workspace-menu { display: block; }
.workspace-item.new { color: var(--console-accent); }
.workspace-item.new .ws-item-icon { color: inherit; font-size: 20px; line-height: 1; }

/* Account controls use the same quiet, high-contrast light surface as the rest of the sidebar. */
html[data-theme="light"] .account-menu {
  background: #fcfcf8 !important;
  border-color: #cdd3c5 !important;
  box-shadow: 0 24px 64px rgba(42, 51, 32, .18) !important;
}
html[data-theme="light"] .account-menu-head,
html[data-theme="light"] .account-option-divider,
html[data-theme="light"] .account-menu-actions { border-color: #dce0d7; }
html[data-theme="light"] .account-options a,
html[data-theme="light"] .account-options button,
html[data-theme="light"] .account-menu-actions a { color: #2b3028; }
html[data-theme="light"] .account-options small,
html[data-theme="light"] .account-menu-head small { color: #71786d; }
html[data-theme="light"] .account-option-icon { color: #59684a; }
html[data-theme="light"] .account-options a:hover,
html[data-theme="light"] .account-options button:hover,
html[data-theme="light"] .account-menu-actions a:hover,
html[data-theme="light"] .account-plan:hover { color: #26311d; background: #e9eee2; }
html[data-theme="light"] .account-options .upgrade-option { color: #40542b; }
html[data-theme="light"] .account-options .upgrade-option small { border-color: #aab99a; color: #40542b; background: #f1f4eb; }

/* Employee workspace: every management panel is a light workspace surface, not a leftover dark card. */
html[data-theme="light"] .btn-back-link { color: #626a5f; }
html[data-theme="light"] .btn-back-link:hover { color: #2d3822; }
html[data-theme="light"] .emp-hero-avatar-wrapper {
  background: #e8eee0;
  border-color: #aebd9b;
  color: #3c4d29;
}
html[data-theme="light"] .meta-title-row h1,
html[data-theme="light"] .section-title-group h3,
html[data-theme="light"] .tg-banner-left h3,
html[data-theme="light"] .toggle-info strong,
html[data-theme="light"] .autonomy-option-card strong,
html[data-theme="light"] .ed-card h3,
html[data-theme="light"] .response-name,
html[data-theme="light"] .knowledge-source-item strong { color: var(--text); }
html[data-theme="light"] .badge-role { border-color: #cbd2c2; color: #566051; background: #f4f6f0; }
html[data-theme="light"] .meta-sub-row,
html[data-theme="light"] .form-hint,
html[data-theme="light"] .toggle-info p,
html[data-theme="light"] .autonomy-option-card p,
html[data-theme="light"] .ed-value,
html[data-theme="light"] .ed-subtext,
html[data-theme="light"] .response-role { color: var(--muted); }
html[data-theme="light"] .emp-bullet-sep { color: #a9afa2; }
html[data-theme="light"] .emp-autonomy-tag { color: #46513d; }
html[data-theme="light"] .employee-detail-tabs { border-color: #d5d9d0; }
html[data-theme="light"] .emp-tab { color: #6a7166; }
html[data-theme="light"] .emp-tab:hover,
html[data-theme="light"] .emp-tab.active { color: #26301e; }
html[data-theme="light"] .emp-card-section,
html[data-theme="light"] .knowledge-test-pane,
html[data-theme="light"] .employee-card,
html[data-theme="light"] .employee-item,
html[data-theme="light"] .roster-card { background: #fcfcf8; border-color: #d2d7cc; color: var(--text); }
html[data-theme="light"] .tensor-textarea,
html[data-theme="light"] .tensor-input,
html[data-theme="light"] .test-textarea,
html[data-theme="light"] .knowledge-source-item,
html[data-theme="light"] .autonomy-option-card,
html[data-theme="light"] .tensor-toggle-row,
html[data-theme="light"] .test-input-group,
html[data-theme="light"] .test-preview-area { background: #f6f8f2; border-color: #d4d9ce; color: var(--text); }
html[data-theme="light"] .tensor-textarea:focus,
html[data-theme="light"] .tensor-input:focus,
html[data-theme="light"] .test-textarea:focus { border-color: var(--console-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--console-accent) 16%, transparent); }
html[data-theme="light"] .autonomy-option-card:hover { border-color: #aab99a; background: #eef2e8; }
html[data-theme="light"] .autonomy-option-card.active { border-color: var(--console-accent); background: #e8eee0; }
html[data-theme="light"] .autonomy-option-card .opt-radio { border-color: #9ba58f; }
html[data-theme="light"] .autonomy-option-card.active .opt-radio { background: var(--console-accent); border-color: var(--console-accent); }
html[data-theme="light"] .autonomy-option-card.active .opt-radio::after,
html[data-theme="light"] .tensor-switch input:checked + .switch-slider::before { background: #fff; }
html[data-theme="light"] .switch-slider { background: #c5cbc0; }
html[data-theme="light"] .test-pane-header,
html[data-theme="light"] .test-composer { background: #fcfcf8 !important; border-color: #d6dad1 !important; }
html[data-theme="light"] .test-preview-content { color: #465043; }
html[data-theme="light"] .test-divider,
html[data-theme="light"] .tg-status-banner,
html[data-theme="light"] .tg-settings-info #empTgIdentityInfo { background: #daddd4; }
html[data-theme="light"] .tg-settings-info .info-label { color: #687064; }
html[data-theme="light"] .tg-settings-info .info-val { color: var(--text); }
html[data-theme="light"] #empTabInstructions .employee-instructions-card { max-width: none; width: 100%; }
html[data-theme="light"] #empTabInstructions .instructions-intro { background: #f5f7f1; border-color: #d8ddd4; }
html[data-theme="light"] #empTabInstructions .instructions-intro h2,
html[data-theme="light"] #empTabInstructions .form-group > label,
html[data-theme="light"] #empTabInstructions .rules-header label { color: var(--text); }
html[data-theme="light"] #empTabInstructions .instructions-intro p { color: var(--muted); }
html[data-theme="light"] #empTabInstructions .form-group + .form-group,
html[data-theme="light"] #empTabInstructions .form-actions-row { border-color: #d8ddd4; }
html[data-theme="light"] #empTabInstructions .tensor-textarea { background: #fffefa; }
html[data-theme="light"] .inline-rule-box,
html[data-theme="light"] .inline-rule-box input,
html[data-theme="light"] .rules-list .rule-item { background: #f6f8f2; border-color: #d0d6ca; color: var(--text); }
html[data-theme="light"] .inline-rule-box input { color: var(--text); }
html[data-theme="light"] .inline-rule-actions .btn-secondary { background: #fdfdf9 !important; border-color: #cbd2c3 !important; color: #344128 !important; }
html[data-theme="light"] .inline-rule-actions .btn-primary { background: var(--console-accent) !important; border-color: var(--console-accent) !important; color: #fff !important; }
html[data-theme="light"] .inline-rule-actions .btn-primary:hover { background: #526438 !important; border-color: #526438 !important; color: #fff !important; }
html[data-theme="light"] .empty-state-compact h3,
html[data-theme="light"] .delete-confirm-modal { color: var(--text); }
html[data-theme="light"] .empty-state-compact p,
html[data-theme="light"] .danger-zone p { color: var(--muted); }
html[data-theme="light"] .delete-confirm-modal { background: #fcfcf8; border-color: #d9b7b2; }
html[data-theme="light"] .danger-zone { background: #fff7f5; border-color: #e5c3be; }
html[data-theme="light"] .form-divider { border-color: #d9ddd4 !important; }

/* Instructions occupy the same complete management canvas as authority and settings. */
#empTabInstructions .employee-instructions-card { max-width: none; width: 100%; }

/* Light account identity: one deliberate olive ring, no inner duplicate or option separators. */
html[data-theme="light"] .account-avatar { box-shadow: none; }
html[data-theme="light"] .account-menu-head { border-bottom: 0; }
html[data-theme="light"] .account-option-divider { display: none; }
html[data-theme="light"] .account-option-idrok { color: #161a14; }
html[data-theme="light"] .account-option-idrok svg { stroke-width: 2.8; stroke-linecap: butt; stroke-linejoin: miter; }

/* Employee detail controls form a single top operating row; each panel owns its own clean surface. */
.employee-detail-nav-row { display: flex; align-items: center; gap: 22px; min-width: 0; }
.employee-detail-nav-row .employee-detail-tabs { flex: 1; margin: 0; border: 0; min-width: 0; }
.employee-detail-nav-row .emp-tab { padding: 8px 0; margin: 0; border-bottom-width: 2px; }
.employee-detail-nav-row .hero-actions-group { margin-left: auto; flex: 0 0 auto; }
.employee-detail-nav-row #empDetailStatusBadge { padding: 7px 10px; border: 1px solid var(--console-accent); border-radius: 8px; background: var(--console-accent-soft); }
.employee-detail-hero .hero-control-strip { justify-content: flex-start; }
@media (max-width: 920px) {
  .employee-detail-nav-row { align-items: flex-start; flex-wrap: wrap; gap: 12px 18px; }
  .employee-detail-nav-row .employee-detail-tabs { order: 3; flex-basis: 100%; }
  .employee-detail-nav-row .hero-actions-group { margin-left: auto; }
}

html[data-theme="light"] .employee-card { color: #252b22; }
html[data-theme="light"] .employee-card:hover { border-color: #aebc9d; }
html[data-theme="light"] .emp-card-avatar { background: #e8eee0; border-color: #b8c5aa; color: #354626; }
html[data-theme="light"] .emp-card-title-group h3,
html[data-theme="light"] .emp-card-manage-link { color: #252b22; }
html[data-theme="light"] .emp-card-role,
html[data-theme="light"] .emp-card-autonomy,
html[data-theme="light"] .emp-card-tg-row .tg-label { color: #596154 !important; }
html[data-theme="light"] .employee-card-footer { border-color: #d8ddd4; }

/* Knowledge preview is a framed light testing workspace, separate from the source list. */
html[data-theme="light"] #empTabKnowledge .knowledge-test-pane {
  border: 1px solid #cbd2c2 !important;
  border-radius: 12px !important;
  background: #fcfcf8 !important;
  box-shadow: 0 10px 24px rgba(44, 53, 34, .06) !important;
}
html[data-theme="light"] #empTabKnowledge .test-conversation-area,
html[data-theme="light"] #empTabKnowledge .test-preview-area { background: #f7f9f4 !important; color: #384235; }
html[data-theme="light"] #empTabKnowledge .test-composer,
html[data-theme="light"] #empTabKnowledge .composer-content { background: #fcfcf8 !important; border-color: #d5dbcf !important; }
html[data-theme="light"] #empTabKnowledge .test-textarea { background: #fffefa !important; color: #252b22 !important; border-color: #cbd2c2 !important; }

/* Telegram retains one outer management surface instead of stacked decorative boxes. */
html[data-theme="light"] .telegram-manage-card { max-width: none; }
html[data-theme="light"] .telegram-manage-card .tg-status-banner,
html[data-theme="light"] .telegram-manage-card .tg-settings-info,
html[data-theme="light"] .telegram-manage-card #empTgIdentityInfo { background: transparent; }
html[data-theme="light"] .telegram-manage-card .tg-status-banner,
html[data-theme="light"] .telegram-manage-card #empTgIdentityInfo { border-color: #d8ddd4; }

html[data-theme="light"] .workforce-status-setup,
html[data-theme="light"] .emp-card-status-badge.workforce-status-setup { color: #73571d; }
html[data-theme="light"] .console-model-card .model-card-facts > div:first-child dd { color: #151814; }
html[data-theme="dark"] .console-model-card .model-card-facts > div:first-child dd { color: #f3f2ec; }

/* A hover is a confirmation, not a darker visual state. */
html[data-theme="light"] .header-hire,
html[data-theme="light"] .header-hire:hover,
html[data-theme="light"] .header-hire:focus-visible,
html[data-theme="light"] .header-hire:active {
  background: #526438;
  border-color: #526438;
  color: #fff;
}
html[data-theme="light"] .header-hire:hover,
html[data-theme="light"] .header-hire:focus-visible { background: #5d7040; border-color: #5d7040; }

/* The operating header is text-led; list surfaces retain their status markers. */
.employee-detail-nav-row { width: 100%; gap: 18px; }
.employee-detail-nav-row #empDetailStatusBadge > i { display: none; }
.employee-detail-nav-row .hero-actions-group { gap: 8px; }
.employee-detail-nav-row .employee-detail-tabs { align-self: center; }
.employee-detail-nav-row #btnToggleEmpStatus { min-width: 80px; }

/* Employee knowledge: source upload and preview share one accurate light system. */
html[data-theme="light"] #empTabKnowledge .knowledge-dropzone.polished-dropzone {
  background: #f7f9f4 !important;
  border-color: #bdc7b1 !important;
}
html[data-theme="light"] #empTabKnowledge .knowledge-dropzone.polished-dropzone:hover {
  background: #f0f4ea !important;
  border-color: var(--console-accent) !important;
}
html[data-theme="light"] #empTabKnowledge .knowledge-dropzone .dz-text { color: #283023 !important; }
html[data-theme="light"] #empTabKnowledge .knowledge-dropzone .dz-sub { color: #697265 !important; }
html[data-theme="light"] #empTabKnowledge .knowledge-dropzone .dropzone-file-chip {
  background: #fffefa !important;
  border-color: #d3d9ca !important;
  color: #273024 !important;
}
html[data-theme="light"] #empTabKnowledge .test-composer {
  padding: 14px 18px 18px !important;
  background: #fcfcf8 !important;
  border-top: 1px solid #d7dcd2 !important;
}
html[data-theme="light"] #empTabKnowledge .composer-content {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 9px 8px 13px;
  background: #fffefa !important;
  border: 1px solid #cbd3c4 !important;
  border-radius: 9px;
}
html[data-theme="light"] #empTabKnowledge .composer-content:focus-within {
  border-color: var(--console-accent) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--console-accent) 14%, transparent);
}
html[data-theme="light"] #empTabKnowledge .test-textarea {
  min-height: 24px;
  background: transparent !important;
  border: 0 !important;
  color: #20271d !important;
}
html[data-theme="light"] #empTabKnowledge .test-textarea::placeholder { color: #778072; }
html[data-theme="light"] #empTabKnowledge .btn-send-inline {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: #526438;
  color: #fff;
}
html[data-theme="light"] #empTabKnowledge .btn-send-inline:hover:not(:disabled) { background: #465630; }
html[data-theme="light"] #empTabKnowledge .btn-send-inline:focus-visible { outline: 2px solid #7b9060; outline-offset: 2px; }

/* Status is a compact, text-forward control. The color and border carry state
   without the generic black marker competing with the label. */
.emp-card-status-badge.workforce-status,
.employee-detail-nav-row #empDetailStatusBadge {
  gap: 0;
  padding: 6px 9px;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: transparent;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .01em;
}
.employee-detail-nav-row #empDetailStatusBadge {
  padding: 9px 11px;
  border-color: currentColor;
  background: transparent;
}
.workforce-status-setup { color: #c58a16; }
.workforce-status-error,
.workforce-status-disconnected { color: #c34d47; }
.workforce-status-connected { color: #397b4f; }
.workforce-status-live { color: #2f8050; }
.workforce-status-live::after {
  content: "";
  width: 5px;
  height: 5px;
  margin-left: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: tensor-live-dot 3.2s ease-in-out infinite;
}
html[data-theme="light"] .workforce-status-setup,
html[data-theme="light"] .emp-card-status-badge.workforce-status-setup { color: #9a6911; }
html[data-theme="light"] .workforce-status-error,
html[data-theme="light"] .workforce-status-disconnected { color: #aa3834; }
html[data-theme="light"] .workforce-status-connected { color: #286e43; }
html[data-theme="light"] .workforce-status-live { color: #256e42; }

/* The composer is its own control, so it needs no dividing rule above it. */
#empTabKnowledge .test-composer { border-top: 0 !important; }
html[data-theme="light"] #empTabKnowledge .test-composer { border-top: 0 !important; }
@media (prefers-reduced-motion: reduce) {
  .workforce-status-live::after { animation: none; }
}

/* Light-mode navigation must remain legible at a glance, including its quiet
   secondary labels. */
html[data-theme="light"] .app-sidebar .sidebar-link,
html[data-theme="light"] .app-sidebar .sidebar-link svg,
html[data-theme="light"] .app-sidebar .workspace-btn,
html[data-theme="light"] .app-sidebar .workspace-btn svg,
html[data-theme="light"] .app-sidebar .account-copy strong,
html[data-theme="light"] .app-sidebar .account-copy small {
  color: #20251d;
}
html[data-theme="light"] .app-sidebar .sidebar-link:not(.active):hover,
html[data-theme="light"] .app-sidebar .sidebar-link:not(.active):focus-visible { color: #11150f; }

/* Templates are deliberately presented as a two-up reference grid on desktop;
   the responsive system collapses this only when handheld space requires it. */
#page-roster .roster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
#page-roster .roster-toolbar {
  grid-template-columns: minmax(0, 1fr) 150px;
  align-items: center;
  margin: 0 0 16px;
}
#page-roster .roster-filter { display: flex; padding-inline: 12px; }
#page-roster .roster-result-count { display: none !important; }

/* Workspace settings keep their existing sections, but surface them as a
   concise top row so Appearance and related controls are discoverable first. */
@media (min-width: 761px) {
  #page-settings .settings-console { display: block; min-height: 0; }
  #page-settings .settings-tabs {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    padding: 9px 12px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }
  #page-settings .settings-tab,
  #page-settings .settings-docs-link {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    min-height: 34px;
    padding: 7px 10px;
  }
  #page-settings .settings-tab small { display: none; }
  #page-settings .settings-tab span,
  #page-settings .settings-docs-link span { font-size: 11px; }
  #page-settings .settings-docs-link {
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
  }
  #page-settings .settings-docs-link:hover,
  #page-settings .settings-docs-link:focus-visible { color: var(--text); background: var(--sidebar-hover); outline: 0; }
  #page-settings .settings-content { max-width: none; padding: 28px; }
  #page-settings .settings-panel { max-width: 840px; }
}

/* Dashboard metric strip: these six summaries are information, not buttons.
   Removing their card frames gives each summary more usable horizontal room
   when the application sidebar and Tensor OS are both open. */
#dashboardMetrics.dashboard-stats-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: clamp(14px, 2.1cqw, 28px) !important;
  align-items: end;
  margin: 0 !important;
}
#dashboardMetrics.dashboard-stats-grid .stat-card {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: end;
  gap: 8px;
  min-width: 0;
  min-height: 76px !important;
  max-height: none !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}
#dashboardMetrics.dashboard-stats-grid .stat-card::before { display: none !important; }
#dashboardMetrics .stat-card-meta {
  grid-column: 1 / -1;
  grid-row: 1;
  display: block;
  min-width: 0;
}
#dashboardMetrics .stat-card-meta .stat-label {
  min-height: 0;
  margin: 0 !important;
  overflow: visible !important;
  color: var(--muted) !important;
  font-size: clamp(11px, 1.25cqw, 14px) !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  text-overflow: clip !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
}
#dashboardMetrics .stat-value {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  max-width: none !important;
  margin: 0 !important;
  color: var(--text) !important;
  font-size: clamp(25px, 2.55cqw, 35px) !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  letter-spacing: -.055em;
  white-space: nowrap;
}
#dashboardMetrics .metric-icon {
  position: static !important;
  grid-column: 2;
  grid-row: 2;
  display: grid;
  width: clamp(22px, 2.15cqw, 30px) !important;
  height: clamp(22px, 2.15cqw, 30px) !important;
  place-items: center;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}
#dashboardMetrics .metric-icon svg {
  width: 100% !important;
  height: 100% !important;
}

/* This is the constrained central column at desktop widths. Keep all six
   metrics in one row, but reduce only their own type and icon geometry. */
@container tensor-workspace (max-width: 1180px) {
  #dashboardMetrics.dashboard-stats-grid { gap: clamp(8px, 1.25cqw, 14px) !important; }
  #dashboardMetrics.dashboard-stats-grid .stat-card { gap: clamp(5px, .65cqw, 8px); min-height: 62px !important; }
  #dashboardMetrics .stat-card-meta .stat-label { font-size: clamp(9px, 1.1cqw, 12px) !important; }
  #dashboardMetrics .stat-value { font-size: clamp(19px, 2.15cqw, 25px) !important; }
  #dashboardMetrics .metric-icon { width: clamp(18px, 2cqw, 24px) !important; height: clamp(18px, 2cqw, 24px) !important; }
}

/* The instruction tab is an employee operating brief: one readable document
   with a compact, factual summary—not a generic settings form. */
#empTabInstructions .instruction-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  gap: 18px;
}
#empTabInstructions .employee-instructions-card {
  max-width: none;
  border-color: var(--line);
  background: var(--card);
}
#empTabInstructions .instructions-intro {
  padding: 24px 26px 20px;
  border-color: var(--line);
  background: color-mix(in srgb, var(--console-accent) 3%, var(--card));
}
#empTabInstructions .section-eyebrow { color: var(--console-accent); }
#empTabInstructions .instructions-intro h2 { color: var(--text); font-size: 24px; }
#empTabInstructions .instructions-intro p { color: var(--muted); }
#empTabInstructions .form-group { padding: 20px 26px; border-color: var(--line-soft); }
#empTabInstructions .instruction-section-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
#empTabInstructions .instruction-section-heading > div { min-width: 0; }
#empTabInstructions .instruction-section-heading label {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}
#empTabInstructions .instruction-section-heading .form-hint { margin: 3px 0 0; }
#empTabInstructions .instruction-section-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 9px;
  font: 700 17px/1 "IBM Plex Mono", monospace;
}
#empTabInstructions .instruction-section-icon.directive { color: var(--semantic-ai); background: color-mix(in srgb, var(--semantic-ai) 10%, transparent); }
#empTabInstructions .instruction-section-icon.model { color: var(--semantic-ai); background: color-mix(in srgb, var(--semantic-ai) 10%, transparent); }
#empTabInstructions .instruction-section-icon.guardrails { color: var(--semantic-success); background: color-mix(in srgb, var(--semantic-success) 9%, transparent); }
#empTabInstructions .tensor-textarea {
  min-height: 126px;
  margin: 14px 0 0;
  border-color: var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font: 500 12px/1.6 var(--font-sans, sans-serif);
}
#empTabInstructions .tensor-textarea:focus { border-color: var(--semantic-ai); box-shadow: 0 0 0 3px color-mix(in srgb, var(--semantic-ai) 12%, transparent); }
#empTabInstructions .instruction-model .tensor-select { margin-top: 14px; border-color: color-mix(in srgb, var(--semantic-ai) 44%, var(--line)); background: color-mix(in srgb, var(--semantic-ai) 5%, var(--surface)); }
#empTabInstructions .instruction-model #empEditModelState { margin: 8px 0 0 46px; }
#empTabInstructions .instruction-guardrails .rules-header { align-items: flex-start; }
#empTabInstructions .instruction-guardrails .rules-list { margin: 14px 0 0 46px; }
#empTabInstructions .instruction-guardrails .btn-add-rule { margin: 8px 0 0 46px; }
#empTabInstructions .form-actions-row { padding: 15px 26px 20px; border-color: var(--line-soft); }

#empTabInstructions .employee-summary-card {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
#empTabInstructions .employee-summary-card h3 { margin: 0 0 12px; color: var(--text); font-size: 15px; }
#empTabInstructions .employee-summary-card dl { margin: 0; }
#empTabInstructions .employee-summary-card dl > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  border-top: 1px solid var(--line-soft);
}
#empTabInstructions .employee-summary-card dt,
#empTabInstructions .employee-summary-card dd { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 11px; }
#empTabInstructions .employee-summary-card dt { color: var(--muted); }
#empTabInstructions .employee-summary-card dd { max-width: 145px; color: var(--text); font-weight: 600; text-align: right; justify-content: flex-end; }
#empTabInstructions .summary-mark { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; font: 700 12px/1 "IBM Plex Mono", monospace; }
#empTabInstructions .summary-mark.integration { color: var(--semantic-telegram); background: color-mix(in srgb, var(--semantic-telegram) 10%, transparent); }
#empTabInstructions .summary-mark.model { color: var(--semantic-ai); background: color-mix(in srgb, var(--semantic-ai) 10%, transparent); }
#empTabInstructions .summary-mark.guardrails { color: var(--semantic-success); background: color-mix(in srgb, var(--semantic-success) 9%, transparent); }
#empTabInstructions .summary-mark.neutral { color: var(--semantic-inactive); background: color-mix(in srgb, var(--semantic-inactive) 8%, transparent); }

@media (max-width: 1000px) {
  #empTabInstructions .instruction-workspace { grid-template-columns: 1fr; }
  #empTabInstructions .employee-summary-card { display: none; }
}
@media (max-width: 600px) {
  #empTabInstructions .instructions-intro, #empTabInstructions .form-group, #empTabInstructions .form-actions-row { padding-left: 18px; padding-right: 18px; }
  #empTabInstructions .instruction-guardrails .rules-list, #empTabInstructions .instruction-guardrails .btn-add-rule, #empTabInstructions .instruction-model #empEditModelState { margin-left: 0; }
}

/* Final settings rail: five primary controls share the row; documentation is
   a deliberate destination at the outer edge, not a sixth cramped icon. */
#page-settings .settings-console { position: relative; display: block; min-height: 0; }
#page-settings .settings-tabs {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  padding: 10px 60px 12px 0;
  gap: 10px;
  overflow: visible;
  border: 0;
  background: var(--bg);
}
#page-settings .settings-tab {
  display: grid;
  flex: 1 1 0;
  width: auto;
  min-width: 38px;
  max-width: 48px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
}
#page-settings .settings-tab span,
#page-settings .settings-tab small,
#page-settings .settings-docs-corner span { display: none; }
#page-settings .settings-tab svg,
#page-settings .settings-docs-corner svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
#page-settings .settings-tab.active { color: var(--console-accent); border-color: color-mix(in srgb, var(--console-accent) 52%, var(--line)); background: transparent; }
#page-settings .settings-tab:hover,
#page-settings .settings-tab:focus-visible { color: var(--text); background: var(--sidebar-hover); outline: 0; }
#page-settings .settings-docs-corner {
  position: absolute;
  z-index: 13;
  top: 8px;
  right: 0;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--console-accent);
  background: transparent;
  text-decoration: none;
}
#page-settings .settings-docs-corner span {
  display: inline;
  font: 650 11px/1 var(--font-sans, sans-serif);
}
#page-settings .settings-docs-corner { width: 72px; gap: 5px; border-radius: 999px; }
#page-settings .settings-docs-corner:hover,
#page-settings .settings-docs-corner:focus-visible { color: var(--text); background: var(--sidebar-hover); outline: 0; }
#page-settings .settings-content { max-width: 880px; padding: 17px 0 42px; }

/* Once Tensor OS is open, its three conversation controls belong together in
   the header. The slim edge trigger is reserved for opening the panel. */
.copilot-drawer.is-open .copilot-control-rail { display: none; }
.copilot-header-actions { gap: 4px; }
.copilot-header-close { font-size: 23px; }

/* Desktop conversation controls are plain header actions, matching the
   frameless handset controls. Keep the welcome copy visible in its empty
   conversation state as well. */
@media (min-width: 761px) {
  .copilot-header-actions .copilot-header-icon,
  .copilot-header-actions .copilot-history-top.copilot-header-icon,
  .copilot-header-actions .copilot-header-close,
  .copilot-header-actions .copilot-header-icon:hover,
  .copilot-header-actions .copilot-header-icon:focus-visible,
  .copilot-header-actions .copilot-header-icon[aria-expanded="true"] {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  .copilot-empty-guide {
    align-self: center;
    width: min(100%, 330px);
    margin: auto;
    text-align: center;
  }
  .copilot-empty-guide p {
    display: block;
    margin: 0 0 8px;
    color: var(--console-accent);
    font: 600 10px/1.2 var(--font-mono, monospace);
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  .copilot-empty-guide h3 {
    display: block;
    margin: 0;
    color: var(--text);
    font: 500 22px/1.2 Georgia, serif;
  }
}

@media (max-width: 680px) {
  #page-settings .settings-tabs {
    top: 0;
    width: calc(100% + (var(--mobile-gutter) * 2));
    margin: -52px calc(var(--mobile-gutter) * -1) 0;
    padding: 8px calc(var(--mobile-gutter) + 78px) 10px var(--mobile-gutter) !important;
    gap: 5px;
  }
  #page-settings .settings-tab { min-width: 34px; max-width: 42px; height: 40px; min-height: 40px; }
  #page-settings .settings-docs-corner { top: -44px; right: 0; width: 68px; height: 42px; font-size: 10px; }
  #page-settings .settings-content { padding: 16px 0 92px !important; }
}

/* Latest Tensor OS and account surface refinements. */
.copilot-empty-guide { display: grid; gap: 7px; align-content: center; }
.copilot-empty-guide > div { display: none !important; }
.copilot-runtime-menu + .copilot-runtime-menu { margin-left: -4px; }
.copilot-runtime-trigger,
.copilot-runtime-trigger:hover,
.copilot-runtime-trigger:focus-visible { height: 27px !important; padding-inline: 4px !important; border: 0 !important; background: transparent !important; box-shadow: none !important; }
.copilot-runtime-popover { padding: 4px !important; border-color: color-mix(in srgb, var(--line) 72%, transparent) !important; }
.copilot-runtime-popover button { min-height: 29px !important; padding: 5px 7px !important; }
.copilot-model-popover { width: min(132px, calc(100vw - 32px)) !important; }
.copilot-model-popover small { display: none; }
.copilot-model-popover button { grid-template-columns: 1fr auto; }
.copilot-composer .copilot-send,
.copilot-composer .copilot-send:hover,
.copilot-composer .copilot-send:focus-visible { width: 32px !important; height: 32px !important; flex-basis: 32px !important; border: 0 !important; border-radius: 50% !important; color: var(--console-accent) !important; background: transparent !important; box-shadow: none !important; }
html[data-theme="light"] .copilot-composer .copilot-send,
html[data-theme="light"] .copilot-composer .copilot-send:hover,
html[data-theme="light"] .copilot-composer .copilot-send:focus-visible { color: #526438 !important; background: transparent !important; }
.copilot-composer .copilot-send:disabled { border: 0 !important; background: transparent !important; }
.copilot-composer textarea { max-height: 180px; }
#page-dashboard .dashboard-owner { color: var(--text); font-size: clamp(16px, 1.65vw, 20px); font-weight: 600; letter-spacing: -.025em; }
#page-employees .page-header h1 { font-size: clamp(23px, 2.5vw, 30px); }
#page-employees .page-header-info { gap: 0; }

/* Narrow-workspace dashboard and Tensor OS runtime menus.  The dashboard is
   a container, so these rules react to the actual remaining workspace when
   both sidebars are visible—not just to the browser's overall width. */
@container tensor-workspace (max-width: 1180px) {
  #page-dashboard .dashboard-stats-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: clamp(7px, 1cqw, 12px) !important;
  }
  #page-dashboard .dashboard-stats-grid .stat-card {
    min-width: 0;
    min-height: 104px !important;
    padding: clamp(10px, 1.25cqw, 14px) !important;
  }
  #page-dashboard .stat-card-meta { align-items: flex-start; }
  #page-dashboard .stat-card-meta .stat-label {
    min-height: 2.4em;
    font-size: clamp(10px, 1.05cqw, 12px) !important;
    line-height: 1.2 !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }
  #page-dashboard .stat-value {
    max-width: calc(100% - clamp(33px, 3.3cqw, 40px));
    padding-right: 0;
    font-size: clamp(20px, 2.25cqw, 26px) !important;
    line-height: 1 !important;
    white-space: nowrap;
    letter-spacing: -.055em;
  }
  #page-dashboard .metric-icon {
    right: clamp(10px, 1.25cqw, 14px) !important;
    bottom: clamp(10px, 1.25cqw, 14px) !important;
    width: clamp(30px, 3.15cqw, 36px) !important;
    height: clamp(30px, 3.15cqw, 36px) !important;
    border-radius: clamp(8px, .9cqw, 10px) !important;
  }
  #page-dashboard .metric-icon svg {
    width: clamp(15px, 1.6cqw, 18px) !important;
    height: clamp(15px, 1.6cqw, 18px) !important;
  }
}

/* The mode and model menus are dense, left-aligned choice lists. Descriptions
   remain visible, so each option is understandable before it is chosen. */
.copilot-runtime-popover.copilot-permission-popover {
  width: min(296px, calc(100vw - 32px)) !important;
  gap: 3px;
  padding: 6px !important;
}
.copilot-runtime-popover.copilot-model-popover {
  width: min(224px, calc(100vw - 32px)) !important;
  gap: 3px;
  padding: 6px !important;
}
.copilot-runtime-popover.copilot-permission-popover button,
.copilot-runtime-popover.copilot-model-popover button {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 48px !important;
  padding: 8px 10px !important;
  text-align: left;
}
.copilot-runtime-popover.copilot-permission-popover strong,
.copilot-runtime-popover.copilot-model-popover strong {
  grid-column: 1;
  font-size: 11px;
  line-height: 1.25;
}
.copilot-runtime-popover.copilot-permission-popover small,
.copilot-runtime-popover.copilot-model-popover small {
  display: block !important;
  grid-column: 1;
  margin: 2px 0 0 !important;
  font-size: 9px !important;
  line-height: 1.35;
  text-align: left;
}
.copilot-runtime-popover.copilot-permission-popover button[aria-checked="true"]::after,
.copilot-runtime-popover.copilot-model-popover button[aria-checked="true"]::after {
  align-self: center;
}
.credit-package-grid button.is-selected { border-color: var(--console-accent); background: var(--console-accent-soft); transform: translateY(-1px); }
.billing-payment-empty { display: grid; gap: 6px; padding: 15px 0 17px; }
.billing-payment-empty strong { color: var(--text); font-size: 13px; }
.billing-payment-empty p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
#page-billing .billing-page-head h1 { font-size: clamp(23px, 2.5vw, 30px); }

/* Desktop settings is an editing surface, not a full-width control tray.
   Keep the same icon language as mobile, but group it deliberately beside the
   content instead of distributing individual controls across the viewport. */
@media (min-width: 761px) {
  #page-settings { width: min(100%, 1080px); margin-inline: auto; }
  #page-settings > .page-header { width: min(100%, 960px); margin-bottom: 20px; }
  #page-settings .page-header h1 { font-size: clamp(34px, 3.2vw, 48px); }
  #page-settings .page-header .page-subtitle { max-width: 360px; text-align: right; }
  #page-settings .settings-console { width: min(100%, 960px); margin: 0; min-height: 0; border: 0; border-radius: 0; background: transparent; overflow: visible; }
  #page-settings .settings-tabs {
    position: sticky;
    top: 12px;
    justify-content: flex-start;
    width: max-content;
    margin: 0;
    padding: 0 0 14px;
    gap: 7px;
    background: var(--bg);
  }
  #page-settings .settings-tab { flex: 0 0 42px; width: 42px; max-width: 42px; height: 42px; min-height: 42px; }
  #page-settings .settings-docs-corner { top: 0; right: 0; min-height: 34px; padding-inline: 7px; }
  #page-settings .settings-content { width: min(100%, 780px); max-width: 780px; padding: 16px 0 52px; }
  #page-settings .settings-panel { width: 100%; max-width: none; padding: 0; }
  #page-settings .settings-panel-head { padding-bottom: 18px; }
  #page-settings .settings-panel.active { animation: settings-in 180ms var(--motion-ease-enter) both; }
}

/* The desktop assistant changes only its right track. The workspace stays
   composited and the panel settles from the edge without a hard jump. */
@media (min-width: 1001px) {
  .app-page { transition: grid-template-columns 320ms var(--motion-ease-enter); }
  .app-page.copilot-resizing { transition: none !important; }
  .copilot-drawer { will-change: opacity, transform; transition: opacity 180ms var(--motion-ease-standard), transform 320ms var(--motion-ease-enter); }
  .copilot-panel-content { will-change: opacity, transform; transition: opacity 180ms var(--motion-ease-standard), transform 320ms var(--motion-ease-enter), visibility 0s linear 320ms; }
  .copilot-drawer.is-open .copilot-panel-content { transition-delay: 30ms; }
}

/* Desktop settings stays as one calm, left-aligned working column. */
@media (min-width: 761px) {
  #page-settings {
    width: min(100%, 840px);
    margin-inline: 0;
  }
  #page-settings > .page-header {
    display: block;
    width: min(100%, 780px);
    margin: 0 0 16px;
  }
  #page-settings .page-header h1 {
    font-size: clamp(36px, 3vw, 44px);
  }
  #page-settings .page-header .page-subtitle {
    display: block;
    max-width: none;
    margin: 6px 0 0;
    text-align: left;
  }
  #page-settings .settings-console {
    width: min(100%, 780px);
    margin: 0;
  }
  #page-settings .settings-tabs {
    padding-bottom: 16px;
  }
  #page-settings .settings-content {
    width: 100%;
    max-width: none;
    padding: 12px 0 52px;
  }
}

/* Employee workspace: a small operating bar keeps navigation, identity, and
   live controls at the page edge without competing with the Tensor header. */
#page-employee-detail .employee-detail-hero { gap: 14px; margin-top: 2px; }
#page-employee-detail .hero-control-strip {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
#page-employee-detail .hero-left-stack { display: grid; justify-items: start; gap: 10px; min-width: 0; }
#page-employee-detail .btn-back-link { min-height: 24px; padding: 0; }
#page-employee-detail .hero-identity-group { gap: 12px; }
#page-employee-detail .emp-hero-avatar-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 18px;
}
#page-employee-detail .hero-actions-group { display: flex; align-items: center; gap: 7px; margin: 0; padding-top: 1px; }
#page-employee-detail #btnToggleEmpStatus,
#page-employee-detail #empDetailStatusBadge {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  font: 650 11px/1 var(--font-sans, sans-serif);
  white-space: nowrap;
}
#page-employee-detail #empDetailStatusBadge { border-color: currentColor; }
#page-employee-detail .employee-detail-nav-row { width: 100%; display: block; }
#page-employee-detail .employee-detail-tabs {
  display: flex;
  width: max-content;
  max-width: 100%;
  gap: 7px;
  margin: 0;
  padding: 0 0 12px;
  overflow-x: auto;
  border: 0;
}
#page-employee-detail .emp-tab {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
}
#page-employee-detail .emp-tab span { display: none; }
#page-employee-detail .emp-tab svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#page-employee-detail .emp-tab.active { border-color: color-mix(in srgb, var(--console-accent) 55%, var(--line)); color: var(--console-accent); background: transparent; }
#page-employee-detail .emp-tab:hover,
#page-employee-detail .emp-tab:focus-visible { border-color: var(--line); color: var(--text); background: var(--sidebar-hover); outline: 0; }
#page-employee-detail .employee-panel-title { margin-bottom: 18px; }
#page-employee-detail .employee-panel-title h2 { margin: 0 0 5px; }

@media (max-width: 760px) {
  #page-employee-detail .hero-control-strip { align-items: flex-start; gap: 10px; }
  #page-employee-detail .hero-left-stack { gap: 8px; }
  #page-employee-detail .btn-back-link { min-height: 28px; font-size: 11px; }
  #page-employee-detail .hero-identity-group { gap: 9px; }
  #page-employee-detail .emp-hero-avatar-wrapper { width: 44px; height: 44px; border-radius: 50%; font-size: 16px; }
  #page-employee-detail .hero-actions-group { gap: 5px; }
  #page-employee-detail #btnToggleEmpStatus,
  #page-employee-detail #empDetailStatusBadge { min-height: 32px; max-width: 88px; padding-inline: 8px; font-size: 9px; overflow: hidden; text-overflow: ellipsis; }
  #page-employee-detail .employee-detail-tabs { gap: 5px; padding-bottom: 10px; }
  #page-employee-detail .emp-tab { width: 35px; min-width: 35px; height: 35px; min-height: 35px; }
  #page-employee-detail .emp-tab svg { width: 16px; height: 16px; }
  #page-employee-detail .employee-panel-title { margin-bottom: 14px; }
}

/* Final compact employee header: controls occupy the first available line and
   the section rail begins immediately beneath it to preserve panel space. */
#page-employee-detail { margin-top: -16px; }
#page-employee-detail .employee-detail-hero { gap: 6px; margin-bottom: 10px; }
#page-employee-detail .hero-control-strip { align-items: center; min-height: 52px; }
#page-employee-detail .hero-left-stack { display: flex; align-items: center; gap: 8px; }
#page-employee-detail .btn-back-link { min-height: 32px; }
#page-employee-detail .hero-identity-group { gap: 8px; }
#page-employee-detail .emp-hero-avatar-wrapper { width: 46px; height: 46px; border-radius: 50%; }
#page-employee-detail .hero-actions-group { margin-left: auto; padding: 0; }
#page-employee-detail #empDetailStatusBadge {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  padding-inline: 11px;
}
#page-employee-detail #btnToggleEmpStatus {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
  font-size: 0;
  display: grid;
  place-items: center;
  line-height: 0;
  position: relative;
}
#page-employee-detail #btnToggleEmpStatus::before {
  content: "";
  width: 14px;
  height: 14px;
  color: currentColor;
  background: currentColor;
  border-radius: 1px;
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  margin: 0;
  transform: translate(-50%, -50%);
}
#page-employee-detail #btnToggleEmpStatus.is-resume::before {
  width: 15px;
  height: 16px;
  border: 0;
  border-radius: 0;
  background: currentColor;
  clip-path: polygon(100% 50%, 0 0, 0 100%);
  /* A play triangle's visual mass sits slightly left of its box; one pixel
     restores its optical center rather than merely centering its bounds. */
  transform: translate(calc(-50% + 1px), -50%);
}

/* Directives are compact code-like prompts, keeping long employee briefs
   legible without turning the instructions page into an oversized document. */
#empTabInstructions .tensor-textarea {
  min-height: 118px;
  font: 500 12px/1.6 var(--font-mono, "IBM Plex Mono", monospace);
  letter-spacing: .01em;
}

/* Desktop keeps the employee's circular identity as part of the profile bio
   at the left. The separate handset rule moves this exact control to the
   mobile header only below the phone breakpoint. */
@media (min-width: 761px) {
  #page-employee-detail .hero-control-strip { padding-right: 0; }
  #page-employee-detail .hero-identity-group {
    display: flex;
    align-items: center;
    min-height: 46px;
  }
  #page-employee-detail .avatar-dropdown-container {
    position: relative !important;
    top: auto;
    right: auto;
    flex: 0 0 auto;
    z-index: 2;
  }
  #page-employee-detail .emp-hero-avatar-wrapper {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    overflow: hidden;
  }
  #page-employee-detail .emp-hero-avatar-wrapper img { border-radius: 50%; }
}

#page-employee-detail .employee-detail-nav-row { margin-top: 0; }
#page-employee-detail .employee-detail-tabs { padding-bottom: 6px; }

@media (max-width: 760px) {
  #page-employee-detail { margin-top: -18px; }
  #page-employee-detail .hero-control-strip { min-height: 46px; gap: 7px; }
  #page-employee-detail .hero-left-stack { gap: 6px; }
  #page-employee-detail .btn-back-link { min-height: 30px; }
  #page-employee-detail .hero-identity-meta { display: none; }
  #page-employee-detail .emp-hero-avatar-wrapper { width: 42px; height: 42px; }
  #page-employee-detail .hero-actions-group { gap: 5px; }
  #page-employee-detail #empDetailStatusBadge { max-width: none; min-height: 32px; padding-inline: 8px; font-size: 9px; }
  #page-employee-detail #btnToggleEmpStatus { width: 32px; min-width: 32px; height: 32px; min-height: 32px; }
  #page-employee-detail .employee-detail-tabs { padding-bottom: 5px; }
}

/* Laptop knowledge workspace: source upload and prompt configuration remain
   on the left, with the employee test chat independently visible on the right. */
@media (min-width: 761px) {
  #empTabKnowledge .knowledge-split-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 24px;
    align-items: stretch;
  }
  #empTabKnowledge .knowledge-config-pane,
  #empTabKnowledge .knowledge-test-pane {
    width: 100%;
    min-width: 0;
  }
  #empTabKnowledge .knowledge-config-pane > .emp-card-section { width: 100%; }
  #empTabKnowledge .knowledge-test-pane { min-height: 460px; }
}

@media (max-width: 760px) {
  #page-employee-detail .hero-control-strip { padding-right: 48px; }
  #page-employee-detail .hero-identity-group { min-height: 42px; }
  #page-employee-detail .emp-hero-avatar-wrapper { width: 42px; height: 42px; }
  #empTabKnowledge .knowledge-split-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px;
  }
  #empTabKnowledge .knowledge-config-pane,
  #empTabKnowledge .knowledge-test-pane { width: 100%; min-width: 0; }
  #empTabKnowledge .knowledge-test-pane { min-height: 420px; }
}

/* Semantic color system: color communicates state, never a decorative surface.
   The dashboard remains neutral in both themes; these values are used only for
   compact status marks, integration/model cues, and data indicators. */
:root,
html[data-theme="dark"] {
  --semantic-success: #78b88a;
  --semantic-warning: #c6a15b;
  --semantic-danger: #c66f68;
  --semantic-telegram: #7197b8;
  --semantic-ai: #927db0;
  --semantic-data: #6fa9a1;
  --semantic-inactive: #93958f;
}

html[data-theme="light"] {
  --semantic-success: #397b4f;
  --semantic-warning: #9a6911;
  --semantic-danger: #aa3834;
  --semantic-telegram: #426f98;
  --semantic-ai: #72558e;
  --semantic-data: #347c76;
  --semantic-inactive: #6f726b;
}

.workforce-status-live,
.workforce-status-connected { color: var(--semantic-success); }
.workforce-status-paused,
.workforce-status-checking,
.workforce-status-unknown { color: var(--semantic-inactive); }
.workforce-status-setup { color: var(--semantic-warning); }
.workforce-status-error,
.workforce-status-disconnected { color: var(--semantic-danger); }

/* These are intentionally small tinted controls, never colored card bodies. */
.emp-card-status-badge.workforce-status,
.employee-detail-nav-row #empDetailStatusBadge {
  gap: 6px;
  border-color: color-mix(in srgb, currentColor 42%, var(--line));
  background: color-mix(in srgb, currentColor 7%, transparent);
}
.workforce-status::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
}
.workforce-status-live::after { display: none; }
.workforce-status-live::before { animation: semantic-live-pulse 3.2s ease-in-out infinite; }
@keyframes semantic-live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 0%, transparent); }
  50% { box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 15%, transparent); }
}

/* Telegram identity may use blue, but a verified Connected state uses the
   same success-green semantic as every other authoritative connection. */
.tg-handle-sub,
.telegram-connect-panel[data-state="testing"] .telegram-connection-status,
.telegram-connect-panel[data-state="testing-connected"] .telegram-connection-status,
.telegram-connect-panel[data-state="connecting"] .telegram-connection-status,
.telegram-connect-panel[data-state="disconnecting"] .telegram-connection-status {
  color: var(--semantic-telegram);
}
#empTgConnectionState.workforce-status-connected {
  color: var(--semantic-success);
  border-color: color-mix(in srgb, var(--semantic-success) 42%, var(--line));
  background: color-mix(in srgb, var(--semantic-success) 7%, transparent);
}

/* Model and reasoning cues are violet, without turning model cards violet. */
.copilot-runtime-trigger#copilotModel,
.copilot-model-popover button[aria-checked="true"],
.console-model-card .console-model-copy > div > span,
.console-model-card .model-card-disclosure b {
  color: var(--semantic-ai);
}
.console-model-card {
  --model-tone: var(--semantic-ai);
  --model-tone-deep: color-mix(in srgb, var(--surface) 88%, var(--semantic-ai));
  border-color: var(--line);
}
.model-card-visual { background: var(--surface); }
.console-model-card:hover {
  border-color: color-mix(in srgb, var(--semantic-ai) 38%, var(--line));
  background: var(--card);
  box-shadow: none;
}
.console-model-card:hover::before,
.console-model-card:focus-visible::before { opacity: 0; }

/* Cyan remains reserved for data/analytics affordances when present. */
.analytics-accent,
[data-analytics-accent] { color: var(--semantic-data); }

@media (prefers-reduced-motion: reduce) {
  .workforce-status-live::before { animation: none; }
}

/* Dashboard implementation of the semantic system. These rules sit last so
   legacy neutral styles cannot accidentally present unavailable as amber. */
.workforce-status-unknown,
.workforce-status-checking,
.workforce-status-paused { color: var(--semantic-inactive) !important; }
.workforce-status-setup { color: var(--semantic-warning) !important; }
.workforce-status-error,
.workforce-status-disconnected { color: var(--semantic-danger) !important; }
.workforce-status-connected,
.workforce-status-live { color: var(--semantic-success) !important; }

.workforce-row > .workforce-status {
  width: fit-content;
  padding: 5px 8px;
  border: 1px solid color-mix(in srgb, currentColor 32%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 7%, transparent);
  font-size: 10px;
  font-weight: 650;
}
.workforce-integration { color: var(--semantic-telegram); font-weight: 650; }

.attention-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-color: color-mix(in srgb, var(--semantic-inactive) 36%, var(--line));
  background: color-mix(in srgb, var(--semantic-inactive) 6%, transparent);
  color: var(--semantic-inactive);
}
.attention-indicator::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.attention-indicator.attention-action,
.attention-indicator.attention-setup {
  border-color: color-mix(in srgb, var(--semantic-warning) 42%, var(--line));
  background: color-mix(in srgb, var(--semantic-warning) 8%, transparent);
  color: var(--semantic-warning);
}
.attention-indicator.attention-error {
  border-color: color-mix(in srgb, var(--semantic-danger) 42%, var(--line));
  background: color-mix(in srgb, var(--semantic-danger) 8%, transparent);
  color: var(--semantic-danger);
}
.attention-indicator.attention-clear {
  border-color: color-mix(in srgb, var(--semantic-success) 42%, var(--line));
  background: color-mix(in srgb, var(--semantic-success) 8%, transparent);
  color: var(--semantic-success);
}

/* The two operational dashboard metrics have a small semantic marker while
   balances, employee count, spend, and the neutral card bodies stay neutral. */
#statLive,
#statApprovals {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
#statLive { color: var(--semantic-success) !important; }
#statApprovals { color: var(--semantic-warning) !important; }
#statLive::before,
#statApprovals::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

/* Desktop dashboard hierarchy: compact metrics and operational tables mirror
   the same calm, scan-first structure in both themes. */
#page-dashboard .dashboard-stats-grid { gap: 16px !important; }
#page-dashboard .dashboard-stats-grid .stat-card {
  position: relative;
  min-height: 112px !important;
  max-height: none !important;
  padding: 16px 18px !important;
  justify-content: space-between !important;
}
#page-dashboard .stat-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
#page-dashboard .stat-card-meta .stat-label { margin: 0 !important; }
#page-dashboard .stat-card-meta .stat-label {
  min-width: 0;
  overflow: visible !important;
  color: var(--muted) !important;
  font-size: 12px !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}
/* Values stay prominent but no longer overpower their compact metric cards. */
#page-dashboard .stat-value { font-size: 27px !important; }
#page-dashboard .metric-icon {
  display: grid;
  place-items: center;
  position: absolute;
  right: 18px;
  bottom: 16px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, currentColor 12%, transparent);
}
#page-dashboard .metric-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#page-dashboard .metric-icon-neutral { background: color-mix(in srgb, var(--muted) 7%, transparent); color: var(--muted); }
#page-dashboard .metric-icon-success { background: color-mix(in srgb, var(--semantic-success) 10%, transparent); color: var(--semantic-success); }
#page-dashboard .metric-icon-warning { background: color-mix(in srgb, var(--semantic-warning) 11%, transparent); color: var(--semantic-warning); }
#page-dashboard .metric-icon-data { background: color-mix(in srgb, var(--semantic-data) 10%, transparent); color: var(--semantic-data); }

#page-dashboard .dashboard-operations-summary {
  padding: 20px 26px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
#page-dashboard .dashboard-operations-summary:has(.attention-indicator.attention-setup),
#page-dashboard .dashboard-operations-summary:has(.attention-indicator.attention-action) {
  border-color: color-mix(in srgb, var(--semantic-warning) 46%, var(--line));
}
#page-dashboard .dashboard-operations-summary:has(.attention-indicator.attention-error) {
  border-color: color-mix(in srgb, var(--semantic-danger) 46%, var(--line));
}
#page-dashboard .operations-summary-head { padding-bottom: 12px; }
#page-dashboard .operations-attention { margin-top: 0; padding-top: 16px; }

#page-dashboard .workforce-row { min-height: 72px; }
#page-dashboard .workforce-integration {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
#page-dashboard .workforce-integration::before {
  content: none;
}
#page-dashboard .workforce-integration svg {
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
}
#page-dashboard .workforce-row > .workforce-status { justify-self: start; }

@media (max-width: 1300px) {
  #page-dashboard .dashboard-stats-grid { gap: 12px !important; }
}

/* Billing uses the same restrained semantic language as the dashboard. */
#page-billing .billing-summary-card,
#page-billing .billing-panel { border-color: var(--line); }
#page-billing .billing-summary-card.billing-balance-card > strong { color: var(--semantic-success); }
#page-billing .billing-summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
#page-billing .billing-summary-top > span { color: var(--muted); font-size: 12px; }
#page-billing .billing-summary-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  font: 700 14px/1 "IBM Plex Mono", monospace;
}
#page-billing .billing-icon-warning { color: var(--semantic-warning); background: color-mix(in srgb, var(--semantic-warning) 10%, transparent); }
#page-billing .billing-icon-data { color: var(--semantic-data); background: color-mix(in srgb, var(--semantic-data) 10%, transparent); }
#page-billing .billing-icon-inactive { color: var(--semantic-inactive); background: color-mix(in srgb, var(--semantic-inactive) 8%, transparent); }
#page-billing .billing-not-configured {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: none;
  gap: 16px;
  padding: 14px 0 14px 14px;
  margin: 12px 0;
  border: 0;
  border-left: 2px solid color-mix(in srgb, var(--semantic-data) 70%, var(--line));
  border-radius: 0;
  background: transparent;
}
#page-billing .billing-not-configured .panel-kicker { color: var(--muted); }
#page-billing .billing-not-configured .cta { flex: 0 0 auto; }
#page-billing .billing-not-configured[hidden] { display: none !important; }
#page-billing .billing-saved[data-state="local"] {
  color: var(--muted);
  border-color: var(--line);
  background: transparent;
}
#page-billing .billing-saved[data-state="missing"] {
  color: var(--semantic-warning);
  border-color: color-mix(in srgb, var(--semantic-warning) 35%, var(--line));
  background: color-mix(in srgb, var(--semantic-warning) 7%, transparent);
}
#page-billing .billing-saved[data-state="saved"] {
  color: var(--semantic-success);
  border-color: color-mix(in srgb, var(--semantic-success) 35%, var(--line));
  background: color-mix(in srgb, var(--semantic-success) 7%, transparent);
}
#page-billing .billing-secure { color: var(--semantic-telegram); border-color: color-mix(in srgb, var(--semantic-telegram) 28%, var(--line)); }
#page-billing .credit-package-grid button { position: relative; background: var(--card); border-color: var(--line); }
#page-billing .credit-package-grid button:hover { border-color: color-mix(in srgb, var(--semantic-success) 42%, var(--line)); background: color-mix(in srgb, var(--semantic-success) 4%, var(--card)); }
#page-billing .credit-package-grid button.is-selected {
  border-color: var(--semantic-success);
  background: color-mix(in srgb, var(--semantic-success) 8%, var(--card));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--semantic-success) 24%, transparent);
}
#page-billing .credit-package-grid button.is-selected::after {
  content: "";
  position: absolute;
  top: 13px;
  right: 13px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--card);
  border-radius: 50%;
  background: var(--semantic-success);
  box-shadow: 0 0 0 1px var(--semantic-success);
}
#page-billing .billing-purchase-summary button,
#page-billing .billing-form-actions button { background: var(--semantic-success); border-color: var(--semantic-success); color: #fff; }
#page-billing .billing-purchase-summary button:hover:not(:disabled),
#page-billing .billing-form-actions button:hover { background: color-mix(in srgb, var(--semantic-success) 86%, #000); border-color: color-mix(in srgb, var(--semantic-success) 86%, #000); }
#page-billing .billing-payment-method { border-color: var(--line); }
#page-billing .billing-payment-empty strong::before { content: "•"; color: var(--semantic-data); margin-right: 7px; }

#page-billing button:disabled {
  cursor: not-allowed;
  opacity: .48;
  filter: saturate(.45);
}
#page-billing .billing-history-empty[hidden],
#page-billing .billing-history-list[hidden] { display: none !important; }
#page-billing .billing-history-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
#page-billing .billing-history-list li {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 4px 12px; align-items: baseline;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 12px;
}
#page-billing .billing-history-list li small { grid-column: 1 / -1; color: var(--muted); }
#page-billing .billing-history-empty {
  margin-top: 12px;
  padding: 16px;
  border: 1px dashed color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* Billing states from the server: provider confirmation, past due, ending plan, task allowance. */
#page-billing .billing-status-notice {
  --tone: var(--semantic-data);
  display: flex; align-items: center; gap: 12px; margin: 12px 0; padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--tone) 26%, var(--line)); border-radius: 10px;
  background: color-mix(in srgb, var(--tone) 6%, transparent);
}
#page-billing .billing-status-notice[hidden] { display: none !important; }
#page-billing .billing-status-notice[data-tone="success"] { --tone: var(--semantic-success); }
#page-billing .billing-status-notice[data-tone="warning"] { --tone: var(--semantic-warning); }
#page-billing .billing-status-notice[data-tone="danger"] { --tone: var(--semantic-danger); }
#page-billing .billing-status-notice[data-tone="info"] { --tone: var(--muted); }
#page-billing .billing-status-icon {
  display: grid; place-items: center; flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%;
  color: var(--tone); background: color-mix(in srgb, var(--tone) 13%, transparent);
}
#page-billing .billing-status-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#page-billing .billing-status-spinner { width: 13px; height: 13px; border: 2px solid color-mix(in srgb, var(--tone) 30%, transparent); border-top-color: var(--tone); border-radius: 50%; animation: billing-spin .8s linear infinite; }
@keyframes billing-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #page-billing .billing-status-spinner { animation-duration: 2.4s; } }
#page-billing .billing-status-copy { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
#page-billing .billing-status-copy strong { color: var(--text); font-size: 13px; font-weight: 600; }
#page-billing .billing-status-copy p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
#page-billing .billing-status-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; flex: 0 0 auto; }
#page-billing .billing-status-actions a,
#page-billing .billing-status-actions button {
  display: inline-flex; align-items: center; min-height: 30px; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px;
  color: var(--text); background: var(--card); font: 600 11px/1 "Inter", sans-serif; text-decoration: none; cursor: pointer; white-space: nowrap;
}
#page-billing .billing-status-actions a:hover,
#page-billing .billing-status-actions button:hover { border-color: color-mix(in srgb, var(--tone) 45%, var(--line)); }

#page-billing .billing-period-meter { display: block; height: 4px; margin-top: 4px; overflow: hidden; border-radius: 99px; background: color-mix(in srgb, var(--line) 80%, transparent); }
#page-billing .billing-period-meter[hidden] { display: none; }
#page-billing .billing-period-meter i { display: block; height: 100%; border-radius: inherit; background: var(--semantic-success); transition: width 400ms var(--motion-ease-standard); }
#page-billing .billing-period-meter[data-level="warning"] i { background: var(--semantic-warning); }
#page-billing .billing-period-meter[data-level="serious"] i,
#page-billing .billing-period-meter[data-level="critical"] i { background: var(--semantic-danger); }

#page-billing .credit-package-grid button.is-unavailable { opacity: .55; }
#page-billing .billing-payment-empty.is-on-file strong::before { content: "●"; color: var(--semantic-success); font-size: 8px; vertical-align: 2px; }
#page-billing .billing-plan-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
#page-billing .billing-plan-actions[hidden] { display: none; }
#page-billing .billing-plan-actions a { color: var(--text); font-size: 12px; font-weight: 600; text-decoration: none; }
#page-billing .billing-plan-actions a:hover { text-decoration: underline; text-underline-offset: 3px; }
#page-billing .billing-text-button { padding: 4px 0; border: 0; color: var(--semantic-danger); background: transparent; font-size: 12px; font-weight: 600; cursor: pointer; }
#page-billing .billing-text-button[hidden] { display: none; }
#page-billing .billing-text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
#page-billing .billing-optional { color: var(--muted); font-style: normal; font-weight: 500; opacity: .8; }

#page-billing .billing-history-list li {
  grid-template-columns: 104px minmax(0, 1fr) auto 84px 30px; gap: 12px; align-items: center; padding: 10px 10px 10px 12px;
}
#page-billing .billing-history-date { color: var(--muted); font-size: 12px; white-space: nowrap; }
#page-billing .billing-history-item { display: grid; gap: 2px; min-width: 0; }
#page-billing .billing-history-item strong { overflow: hidden; color: var(--text); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
#page-billing .billing-history-list li .billing-history-item small { grid-column: auto; color: var(--muted); font: 500 10px/1.2 "IBM Plex Mono", monospace; }
#page-billing .billing-history-status { justify-self: start; padding: 3px 7px; border-radius: 99px; color: var(--muted); background: color-mix(in srgb, var(--line) 55%, transparent); font-size: 10px; font-weight: 600; white-space: nowrap; }
#page-billing .billing-history-status[data-tone="success"] { color: var(--semantic-success); background: color-mix(in srgb, var(--semantic-success) 11%, transparent); }
#page-billing .billing-history-status[data-tone="danger"] { color: var(--semantic-danger); background: color-mix(in srgb, var(--semantic-danger) 11%, transparent); }
#page-billing .billing-history-amount { justify-self: end; color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; }
#page-billing .billing-history-invoice { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid transparent; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; }
#page-billing .billing-history-invoice:hover { border-color: var(--line); color: var(--text); }
#page-billing .billing-history-invoice svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 760px) {
  #page-billing .billing-status-notice { flex-wrap: wrap; align-items: flex-start; }
  #page-billing .billing-status-copy { flex-basis: calc(100% - 40px); }
  #page-billing .billing-status-actions { justify-content: flex-start; padding-left: 40px; }
  #page-billing .billing-history-list li { grid-template-columns: minmax(0, 1fr) auto 30px; grid-template-areas: "item amount invoice" "meta status invoice"; row-gap: 4px; }
  #page-billing .billing-history-item { grid-area: item; }
  #page-billing .billing-history-amount { grid-area: amount; }
  #page-billing .billing-history-invoice { grid-area: invoice; }
  #page-billing .billing-history-date { grid-area: meta; font-size: 11px; }
  #page-billing .billing-history-status { grid-area: status; justify-self: end; }
}

/* Billing confirmation dialog (plan switch, cancel). */
.billing-confirm { width: min(420px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 14px; color: var(--text); background: var(--popover-bg, var(--card)); box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.billing-confirm::backdrop { background: rgba(8, 9, 8, .48); backdrop-filter: blur(2px); }
.billing-confirm form { display: grid; gap: 10px; padding: 20px; }
.billing-confirm h2 { margin: 0; font: 600 17px/1.25 "Inter", sans-serif; letter-spacing: -.015em; }
.billing-confirm p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.billing-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.billing-confirm-actions button { min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: transparent; font: 600 12px/1 "Inter", sans-serif; cursor: pointer; }
.billing-confirm-actions .billing-confirm-ok { color: var(--bg); background: var(--text); border-color: var(--text); }
.billing-confirm-actions .billing-confirm-ok.is-danger { color: #fff; background: var(--semantic-danger); border-color: var(--semantic-danger); }
.billing-confirm-actions button:focus-visible { outline: 2px solid color-mix(in srgb, var(--text) 50%, transparent); outline-offset: 2px; }

/* Explore plans: where the workspace stands now. */
.workspace-plans-head > p.workspace-plan-current { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 14px auto 0; padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: 12px; }
.workspace-plans-head > p.workspace-plan-current[hidden] { display: none; }
.workspace-plans-head > p.workspace-plan-current strong { color: var(--text); font-weight: 600; }
.workspace-plans-head > p.workspace-plan-current a { margin-left: 4px; color: var(--text); text-underline-offset: 3px; }
.workspace-plan-card button[aria-disabled="true"] { cursor: default; }

/* Toast with one follow-up link (plan limits). */
.app-toast.has-action { display: flex; align-items: center; gap: 12px; max-width: min(440px, calc(100vw - 32px)); line-height: 1.45; }
.app-toast-action { flex: 0 0 auto; padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); font-weight: 600; text-decoration: none; white-space: nowrap; }
.app-toast-action:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }

/* Idrok effort levels above the plan's cap. */
.copilot-reasoning-popover [data-copilot-effort].is-locked strong,
.copilot-reasoning-popover [data-copilot-effort].is-locked small { opacity: .5; }
.copilot-reasoning-popover [data-copilot-effort].is-locked small::before { content: ""; display: inline-block; width: 7px; height: 8px; margin-right: 4px; border: 1.5px solid currentColor; border-radius: 2px; vertical-align: -1px; }

.usage-counts-note { margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }

@media (max-width: 760px) {
  #page-billing .billing-page-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
  #page-billing .billing-page-head h1 { max-width: none; font-size: 28px; }
  #page-billing .billing-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 9px; }
  #page-billing .billing-summary-card { min-height: 108px; padding: 12px; }
  #page-billing .billing-summary-card > strong { font-size: 16px; }
  #page-billing .billing-summary-card.billing-balance-card > strong { font-size: 24px; }
  #page-billing .billing-summary-card > small { font-size: 10px; }
  #page-billing .billing-not-configured { align-items: flex-start; flex-direction: column; gap: 10px; padding: 13px; }
  #page-billing .billing-not-configured h2 { font-size: 15px; }
  #page-billing .billing-console-grid { gap: 18px; }
  #page-billing .billing-panel { padding: 15px 0; }
  #page-billing .billing-panel > header { gap: 10px; padding-bottom: 10px; }
  #page-billing .billing-panel h2 { font-size: 17px; }
  #page-billing .credit-package-grid { gap: 7px; }
  #page-billing .credit-package-grid button { min-height: 64px; padding: 8px; }
  #page-billing .credit-package-grid strong { font-size: 15px; }
  #page-billing .billing-purchase-summary { grid-template-columns: minmax(0, 1fr) auto; }
  #page-billing .billing-purchase-summary button { min-width: 84px; }
  #page-billing .billing-form { gap: 9px; margin-top: 12px; }
  #page-billing .billing-form-actions { align-items: stretch; flex-direction: column; }
  #page-billing .billing-form-actions button { width: 100%; }
  #page-billing .billing-secure,
  #page-billing .billing-saved { padding: 5px 7px; font-size: 9px; }
}

@media (min-width: 761px) and (max-width: 1080px) {
  #page-billing .billing-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* Desktop employee profile header: one deliberate hierarchy rather than a
   compact settings toolbar. Back leads; identity follows; operations sit to
   the right; the unchanged workspace tabs remain fully legible below. */
@media (min-width: 761px) {
  #page-employee-detail { margin-top: 0; }
  #page-employee-detail .employee-detail-hero { gap: 16px; margin-bottom: 24px; }
  #page-employee-detail .hero-control-strip { align-items: flex-start; min-height: 98px; }
  #page-employee-detail .hero-left-stack {
    display: grid;
    align-items: start;
    gap: 13px;
  }
  #page-employee-detail .btn-back-link {
    min-height: auto;
    padding: 0;
    color: var(--muted);
    font-size: 13px;
  }
  #page-employee-detail .btn-back-link:hover { color: var(--text); }
  #page-employee-detail .hero-identity-group {
    min-height: 58px;
    gap: 15px;
  }
  #page-employee-detail .emp-hero-avatar-wrapper {
    width: 58px;
    height: 58px;
    border-color: color-mix(in srgb, var(--console-accent) 38%, var(--line));
    background: color-mix(in srgb, var(--console-accent) 7%, var(--surface));
    font-size: 20px;
  }
  #page-employee-detail .hero-identity-meta { gap: 0; }
  #page-employee-detail .meta-title-row { min-height: 58px; gap: 12px; }
  #page-employee-detail .meta-title-row h1 {
    color: var(--text);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -.035em;
  }
  #page-employee-detail .badge-role {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-color: color-mix(in srgb, var(--console-accent) 30%, var(--line));
    border-radius: 999px;
    background: color-mix(in srgb, var(--console-accent) 6%, transparent);
    color: var(--text);
    font-size: 10px;
    font-weight: 650;
    letter-spacing: .02em;
    text-transform: none;
  }
  #page-employee-detail .hero-actions-group {
    align-items: center;
    gap: 9px;
    padding-top: 43px;
  }
  #page-employee-detail #empDetailStatusBadge {
    min-height: 38px;
    padding-inline: 12px;
    border-radius: 9px;
    background: color-mix(in srgb, currentColor 6%, transparent);
  }
  #page-employee-detail #btnToggleEmpStatus {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    border-radius: 9px;
  }
  #page-employee-detail .employee-detail-nav-row { display: block; }
  #page-employee-detail .employee-detail-tabs {
    width: 100%;
    max-width: none;
    gap: 22px;
    padding: 0;
    overflow: visible;
    border-bottom: 1px solid var(--line);
  }
  #page-employee-detail .emp-tab {
    width: auto;
    min-width: 0;
    height: 42px;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 0 10px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: var(--muted);
  }
  #page-employee-detail .emp-tab span { display: inline; font-size: 12px; }
  #page-employee-detail .emp-tab svg { width: 17px; height: 17px; }
  #page-employee-detail .emp-tab.active {
    border-color: var(--console-accent);
    color: var(--text);
    background: transparent;
  }
  #page-employee-detail .emp-tab:hover,
  #page-employee-detail .emp-tab:focus-visible {
    border-color: color-mix(in srgb, var(--console-accent) 48%, var(--line));
    color: var(--text);
    background: transparent;
  }
}

/* Final employee-settings control pass: the settings workspace gets its own
   switch anatomy and compact action hierarchy instead of inheriting legacy
   generic controls. */
#empTabSettings .employee-settings-preferences-grid .tensor-select,
#empTabSettings .employee-access-label .tensor-select {
  appearance: none;
  padding-right: 34px;
  background-color: transparent !important;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%) !important;
  background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px !important;
  background-size: 5px 5px, 5px 5px !important;
  background-repeat: no-repeat !important;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
#empTabSettings .employee-settings-preferences-grid .tensor-select:hover,
#empTabSettings .employee-access-label .tensor-select:hover { border-color: color-mix(in srgb, var(--console-accent) 52%, var(--line)); }
#empTabSettings .employee-settings-preferences-grid .tensor-select:focus,
#empTabSettings .employee-access-label .tensor-select:focus { outline: none; border-color: var(--console-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--console-accent) 13%, transparent); }

#empTabSettings .employee-alert-option {
  grid-template-columns: 40px minmax(0, 1fr);
  min-height: 66px;
  border-color: color-mix(in srgb, var(--line) 88%, transparent);
  background: color-mix(in srgb, var(--surface) 94%, var(--sidebar-hover));
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
#empTabSettings .employee-alert-option:hover { border-color: color-mix(in srgb, var(--console-accent) 38%, var(--line)); transform: translateY(-1px); }
#empTabSettings .employee-alert-option:has(input:checked) { border-color: color-mix(in srgb, var(--console-accent) 44%, var(--line)); background: color-mix(in srgb, var(--console-accent) 5%, var(--surface)); }
#empTabSettings .employee-alert-option .switch-slider {
  position: relative !important;
  inset: auto !important;
  display: block !important;
  width: 38px !important;
  height: 22px !important;
  border: 1px solid color-mix(in srgb, var(--muted) 42%, var(--line)) !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--muted) 13%, var(--surface)) !important;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.1) !important;
}
#empTabSettings .employee-alert-option .switch-slider::before { content: none !important; }
#empTabSettings .employee-alert-option .switch-slider::after {
  content: "" !important;
  position: absolute !important;
  top: 3px !important;
  left: 3px !important;
  width: 14px !important;
  height: 14px !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: #fff !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.22) !important;
  transform: none !important;
}
#empTabSettings .employee-alert-option input:checked + .switch-slider { border-color: var(--console-accent) !important; background: var(--console-accent) !important; }
#empTabSettings .employee-alert-option input:checked + .switch-slider::after { transform: translateX(16px) !important; }
#empTabSettings .employee-alert-option input:focus-visible + .switch-slider { outline: 2px solid var(--semantic-data); outline-offset: 3px; }
#empTabSettings .employee-alert-option strong { font-size: 12px; letter-spacing: -.005em; }
#empTabSettings .employee-alert-option small { font-size: 10.5px; }

#empTabSettings .employee-settings-save-row { padding-top: 2px; }
#empTabSettings .employee-settings-save-row .btn-secondary,
#empTabSettings .employee-settings-access-card .btn-secondary,
#empTabSettings .employee-lifecycle-actions .btn-secondary {
  border-color: color-mix(in srgb, var(--line) 90%, transparent);
  background: transparent;
  color: var(--text);
  box-shadow: none;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
#empTabSettings .employee-settings-save-row .btn-secondary:hover,
#empTabSettings .employee-settings-access-card .btn-secondary:hover,
#empTabSettings .employee-lifecycle-actions .btn-secondary:hover { border-color: color-mix(in srgb, var(--console-accent) 55%, var(--line)); background: color-mix(in srgb, var(--console-accent) 6%, transparent); transform: translateY(-1px); }
#empTabSettings .employee-lifecycle-card { grid-template-columns: minmax(245px, .95fr) minmax(0, 2fr); }
#empTabSettings .employee-lifecycle-actions { gap: 10px; }
#empTabSettings .employee-lifecycle-actions .btn-secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; border-radius: 8px; }
#empTabSettings .employee-settings-access-card .btn-secondary { min-width: 102px; border-radius: 7px; }

#empTabSettings .employee-danger-zone { border-color: color-mix(in srgb, var(--semantic-danger) 34%, var(--line)); background: color-mix(in srgb, var(--semantic-danger) 3%, var(--surface)); }
#empTabSettings .employee-danger-action { border-color: color-mix(in srgb, var(--semantic-danger) 32%, var(--line)); background: color-mix(in srgb, var(--surface) 92%, transparent); transition: border-color 160ms ease, background 160ms ease, transform 160ms ease; }
#empTabSettings .employee-danger-action:hover { border-color: color-mix(in srgb, var(--semantic-danger) 62%, var(--line)); background: color-mix(in srgb, var(--semantic-danger) 7%, var(--surface)); transform: translateY(-1px); }
#empTabSettings .employee-danger-action:first-of-type span { color: var(--semantic-warning); }
#empTabSettings .employee-danger-action:last-of-type span { color: var(--semantic-danger); }
@media (max-width: 760px) { #empTabSettings .employee-lifecycle-card { grid-template-columns: 1fr; } }

/* Employee conversations: a factual channel inbox and a calm thread reader.
   This mirrors the operational hierarchy without inventing message states or
   reply capabilities that the channel API has not confirmed. */
#empTabConversations .employee-conversation-workspace { display: grid; grid-template-columns: minmax(310px, 34%) minmax(0, 1fr); gap: 16px; min-height: 620px; }
#empTabConversations .employee-conversation-inbox,
#empTabConversations .employee-conversation-detail { min-width: 0; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
#empTabConversations .employee-conversation-inbox { display: flex; flex-direction: column; padding: 16px; overflow: hidden; }
#empTabConversations .employee-conversation-workspace,
#empTabConversations .employee-conversation-inbox,
#empTabConversations .conversation-search-row { overflow: visible; }
#empTabConversations .conversation-search-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
#empTabConversations .conversation-search-row label { display: flex; align-items: center; gap: 8px; min-width: 0; height: 36px; padding: 0 9px; border: 0; border-radius: 8px; color: var(--muted); }
#empTabConversations .conversation-search-row label { border: 1px solid color-mix(in srgb, var(--line) 88%, transparent); background: color-mix(in srgb, var(--sidebar-hover) 34%, transparent); }
#empTabConversations .conversation-search-row label:focus-within { border-color: color-mix(in srgb, var(--console-accent) 42%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--console-accent) 8%, transparent); }
#empTabConversations .conversation-search-row label span { font-size: 19px; line-height: 1; }
#empTabConversations .conversation-search-row input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: 500 12px var(--font-sans); }
#empTabConversations .conversation-filter-trigger { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 68px; height: 36px; padding: 0 10px; border: 1px solid color-mix(in srgb, var(--line) 88%, transparent); border-radius: 9px; background: color-mix(in srgb, var(--sidebar-hover) 34%, transparent); color: var(--text); font: 590 11px var(--font-sans); cursor: pointer; }
#empTabConversations .conversation-filter-trigger svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transition: transform 180ms ease; }
#empTabConversations .conversation-filter-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
#empTabConversations .conversation-filter-trigger:hover, #empTabConversations .conversation-filter-trigger[aria-expanded="true"] { border-color: color-mix(in srgb, var(--console-accent) 38%, var(--line)); background: color-mix(in srgb, var(--console-accent) 7%, var(--sidebar-hover)); }
#empTabConversations .conversation-filter-menu,
.conversation-filter-menu.is-floating { position: absolute; z-index: 12; top: calc(100% + 7px); right: 0; display: grid; min-width: 132px; padding: 5px; border: 1px solid color-mix(in srgb, var(--line) 72%, transparent); border-radius: 13px; background: color-mix(in srgb, var(--surface) 82%, transparent); box-shadow: 0 12px 28px color-mix(in srgb, #000 22%, transparent), inset 0 1px 0 color-mix(in srgb, #fff 17%, transparent); -webkit-backdrop-filter: blur(22px) saturate(130%); backdrop-filter: blur(22px) saturate(130%); }
.conversation-filter-menu.is-floating { right: auto; transform-origin: top right; animation: conversation-filter-in 150ms cubic-bezier(.2,.8,.2,1); }
#empTabConversations .conversation-filter-menu[hidden], .conversation-filter-menu.is-floating[hidden] { display: none; }
#empTabConversations .conversation-filter-option, .conversation-filter-menu.is-floating .conversation-filter-option { display: flex; align-items: center; justify-content: space-between; min-height: 32px; padding: 0 9px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font: 560 11px var(--font-sans); text-align: left; cursor: pointer; }
#empTabConversations .conversation-filter-option::after, .conversation-filter-menu.is-floating .conversation-filter-option::after { content: "✓"; opacity: 0; color: var(--console-accent); font-size: 12px; font-weight: 700; }
#empTabConversations .conversation-filter-option:hover, #empTabConversations .conversation-filter-option.active, .conversation-filter-menu.is-floating .conversation-filter-option:hover, .conversation-filter-menu.is-floating .conversation-filter-option.active { color: var(--text); background: color-mix(in srgb, var(--console-accent) 9%, transparent); }
#empTabConversations .conversation-filter-option.active::after, .conversation-filter-menu.is-floating .conversation-filter-option.active::after { opacity: 1; }
@keyframes conversation-filter-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
#empTabConversations .employee-conversations-list { display: flex; flex: 1; flex-direction: column; gap: 0; margin: 30px 0 0; overflow-y: auto; border-top: 1px solid color-mix(in srgb, var(--line) 76%, transparent); }
#empTabConversations .employee-conversation-row { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; width: 100%; min-height: 76px; padding: 13px 2px; border: 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 76%, transparent); border-radius: 0; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
#empTabConversations .employee-conversation-row.has-no-preview { min-height: 60px; padding-block: 8px; }
#empTabConversations .employee-conversation-row:hover { background: color-mix(in srgb, var(--console-accent) 4%, transparent); }
#empTabConversations .employee-conversation-row.is-selected { margin-inline: -8px; padding-inline: 8px; border: 0; border-radius: 9px; background: color-mix(in srgb, var(--console-accent) 8%, transparent); box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 10%, transparent); }
#empTabConversations .conversation-avatar { display: grid; width: 44px; height: 44px; place-items: center; align-self: center; border-radius: 50%; background: color-mix(in srgb, var(--semantic-inactive) 16%, var(--surface)); color: var(--text); font: 650 12px var(--font-sans); }
#empTabConversations .conversation-row-copy { display: grid; min-width: 0; align-content: center; gap: 5px; }
#empTabConversations .conversation-row-copy > span { display: flex; align-items: center; gap: 8px; min-width: 0; }
#empTabConversations .conversation-row-copy strong { overflow: hidden; color: var(--text); font-size: 13px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
#empTabConversations .conversation-channel { display: inline-flex; align-items: center; gap: 3px; color: var(--semantic-telegram); font-size: 10px; font-style: normal; font-weight: 550; white-space: nowrap; }
#empTabConversations .conversation-channel i { display: grid; width: 15px; height: 15px; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--semantic-telegram) 15%, transparent); font-style: normal; font-size: 10px; }
#empTabConversations .conversation-row-copy em { overflow: hidden; color: var(--muted); font-size: 10.5px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
#empTabConversations .conversation-row-meta { display: none; }
#empTabConversations .conversation-status { display: inline-flex; align-items: center; gap: 5px; color: var(--semantic-inactive); font-size: 10px; font-style: normal; font-weight: 650; white-space: nowrap; }
#empTabConversations .conversation-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
#empTabConversations .conversation-status-open { color: var(--semantic-success); }
#empTabConversations .conversation-status-escalated { color: var(--semantic-warning); }
#empTabConversations .conversation-status-closed { color: var(--semantic-inactive); }
#empTabConversations .conversation-status-unread { color: var(--semantic-data); }
#empTabConversations .employee-conversation-list-empty { display: grid; gap: 5px; padding: 32px 16px; color: var(--muted); text-align: center; }
#empTabConversations .employee-conversation-list-empty strong { color: var(--text); font-size: 12px; }
#empTabConversations .employee-conversation-list-empty span { font-size: 11px; line-height: 1.5; }
#empTabConversations .employee-conversation-detail { display: flex; flex-direction: column; min-height: 620px; overflow: hidden; }
#empTabConversations .employee-conversation-empty { display: grid; place-content: center; justify-items: center; flex: 1; gap: 8px; padding: 28px; color: var(--muted); text-align: center; }
#empTabConversations .employee-conversation-empty > span { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--semantic-inactive); font-size: 22px; }
#empTabConversations .employee-conversation-empty h3 { margin: 4px 0 0; color: var(--text); font-size: 15px; }
#empTabConversations .employee-conversation-empty p { max-width: 280px; margin: 0; font-size: 12px; line-height: 1.5; }
#empTabConversations .employee-conversation-loading { display: grid; place-content: center; flex: 1; color: var(--muted); font-size: 12px; }
#empTabConversations .conversation-count { position: absolute; top: calc(100% + 7px); right: 0; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; line-height: 1; pointer-events: none; white-space: nowrap; }
#empTabConversations .employee-thread-header-loading { min-height: 58px; }
#empTabConversations .employee-conversation-loading-stream { justify-content: flex-end; min-height: 0; }
#empTabConversations .employee-conversation-loading-bubbles { display: grid; gap: 9px; width: min(72%, 360px); padding-bottom: 8px; }
#empTabConversations .employee-conversation-loading-bubbles i { display: block; height: 38px; border: 1px solid color-mix(in srgb, var(--line) 80%, transparent); border-radius: 13px 13px 13px 4px; background: linear-gradient(100deg, color-mix(in srgb, var(--sidebar-hover) 62%, var(--surface)) 30%, color-mix(in srgb, var(--text) 7%, var(--surface)) 48%, color-mix(in srgb, var(--sidebar-hover) 62%, var(--surface)) 66%); background-size: 240% 100%; animation: tensor-conversation-shimmer 1.5s ease-in-out infinite; }
#empTabConversations .employee-conversation-loading-bubbles i:nth-child(2) { width: 74%; height: 54px; }
#empTabConversations .employee-conversation-loading-bubbles i:nth-child(3) { width: 48%; margin-left: auto; border-radius: 13px 13px 4px 13px; }
@keyframes tensor-conversation-shimmer { from { background-position: 100% 0; } to { background-position: -120% 0; } }

/* Remote avatars keep their measured frame and initials until the real image
   has decoded. This prevents blank circles, flicker, and layout movement. */
.employee-avatar-image,
#empTabConversations .conversation-avatar-image { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 180ms ease; }
.employee-avatar-image.is-loaded,
#empTabConversations .conversation-avatar-image.is-loaded { opacity: 1; }
.account-avatar,
.settings-avatar,
.mobile-profile-avatar,
[data-profile-avatar] { position: relative; overflow: hidden; }
.account-avatar-fallback { display: grid; width: 100%; height: 100%; place-items: center; }
.account-avatar-image { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 180ms ease; }
.account-avatar-image.is-loaded { opacity: 1; }
.employee-avatar-fallback.is-loading,
#empTabConversations .conversation-avatar-fallback.is-loading,
.account-avatar-fallback.is-loading { background: linear-gradient(100deg, color-mix(in srgb, var(--surface) 76%, var(--line)) 30%, color-mix(in srgb, var(--text) 7%, var(--surface)) 48%, color-mix(in srgb, var(--surface) 76%, var(--line)) 66%); background-size: 220% 100%; animation: tensor-avatar-shimmer 1.5s ease-in-out infinite; }
@keyframes tensor-avatar-shimmer { from { background-position: 100% 0; } to { background-position: -120% 0; } }

/* Employee controls are deliberately quick and tactile without changing their
   existing hierarchy or motion-heavy page transitions. */
#page-employee-detail button:not([disabled]),
#page-employee-detail [role="button"]:not([aria-disabled="true"]) { transition: transform 140ms ease, opacity 140ms ease, background-color 160ms ease, border-color 160ms ease; }
#page-employee-detail button:not([disabled]):active,
#page-employee-detail [role="button"]:not([aria-disabled="true"]):active { transform: scale(.985); }
@media (hover: hover) {
  #page-employee-detail button:not([disabled]):hover,
  #page-employee-detail [role="button"]:not([aria-disabled="true"]):hover { transform: translateY(-1px); }
}
@media (prefers-reduced-motion: reduce) {
  #empTabConversations .employee-conversation-loading-bubbles i,
  .employee-avatar-fallback.is-loading,
  #empTabConversations .conversation-avatar-fallback.is-loading { animation: none; }
  .employee-avatar-image,
  #empTabConversations .conversation-avatar-image,
  .account-avatar-image,
  #page-employee-detail button,
  #page-employee-detail [role="button"] { transition: none; }
}

/* Conversation inbox and audit history load in their final layout, avoiding
   an empty/error-looking flash before authorized data arrives. */
#empTabConversations .employee-conversation-list-loading { display: grid; gap: 0; }
#empTabConversations .employee-conversation-skeleton-row { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; min-height: 76px; padding: 13px 2px; border-bottom: 1px solid color-mix(in srgb, var(--line) 76%, transparent); }
#empTabConversations .employee-conversation-skeleton-avatar,
#empTabConversations .employee-conversation-skeleton-copy i { display: block; background: linear-gradient(100deg, color-mix(in srgb, var(--surface) 91%, var(--line)) 28%, color-mix(in srgb, var(--text) 6%, var(--surface)) 48%, color-mix(in srgb, var(--surface) 91%, var(--line)) 68%); background-size: 185% 100%; animation: tensor-conversation-shimmer 920ms ease-in-out infinite; }
#empTabConversations .employee-conversation-skeleton-avatar { width: 44px; height: 44px; align-self: center; border-radius: 50%; box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 10%, transparent); }
#empTabConversations .employee-conversation-skeleton-copy { display: grid; align-content: center; gap: 7px; min-width: 0; }
#empTabConversations .employee-conversation-skeleton-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
#empTabConversations .employee-conversation-skeleton-name { width: min(45%, 138px); height: 12px; border-radius: 99px; }
#empTabConversations .employee-conversation-skeleton-time { width: 30px; height: 9px; border-radius: 99px; }
#empTabConversations .employee-conversation-skeleton-preview { width: min(82%, 252px); height: 10px; border-radius: 99px; }
#empTabConversations .employee-conversation-skeleton-status { width: 42px; height: 8px; border-radius: 99px; }
#empTabConversations .employee-conversation-skeleton-row:nth-child(2) .employee-conversation-skeleton-avatar,
#empTabConversations .employee-conversation-skeleton-row:nth-child(2) .employee-conversation-skeleton-copy i { animation-delay: 70ms; }
#empTabConversations .employee-conversation-skeleton-row:nth-child(3) .employee-conversation-skeleton-avatar,
#empTabConversations .employee-conversation-skeleton-row:nth-child(3) .employee-conversation-skeleton-copy i { animation-delay: 140ms; }
#empTabConversations .employee-conversation-skeleton-row:nth-child(4) .employee-conversation-skeleton-avatar,
#empTabConversations .employee-conversation-skeleton-row:nth-child(4) .employee-conversation-skeleton-copy i { animation-delay: 210ms; }

@media (prefers-reduced-motion: reduce) {
  #empTabConversations .employee-conversation-skeleton-avatar,
  #empTabConversations .employee-conversation-skeleton-copy i,
  #page-audit .audit-loading i { animation: none; }
}
#empTabConversations .employee-thread-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 24px 16px; border-bottom: 1px solid var(--line); }
#empTabConversations .employee-thread-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
#empTabConversations .employee-thread-title h3 { margin: 0; color: var(--text); font-size: 17px; }
#empTabConversations .employee-thread-title p { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 5px 0 0; }
#empTabConversations .employee-thread-updated { color: var(--muted); font-size: 10px; text-align: right; }
#empTabConversations .employee-thread-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 14px 24px; border-bottom: 1px solid var(--line); }
#empTabConversations .employee-thread-facts > div { min-width: 0; padding: 0 14px; border-left: 1px solid var(--line); }
#empTabConversations .employee-thread-facts > div:first-child { padding-left: 0; border-left: 0; }
#empTabConversations .employee-thread-facts dt { margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
#empTabConversations .employee-thread-facts dd { overflow: hidden; margin: 0; color: var(--text); font-size: 11px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
#empTabConversations .employee-conversation-stream { display: flex; flex: 1; flex-direction: column; gap: 15px; padding: 20px 24px; overflow-x: hidden; overflow-y: auto; background: color-mix(in srgb, var(--sidebar-hover) 26%, var(--surface)); }
#empTabConversations .employee-conversation-message { box-sizing: border-box; width: fit-content; min-width: 0; max-width: min(72%, 620px); margin: 0; padding: 10px 12px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow-wrap: anywhere; }
#empTabConversations .employee-conversation-message.is-employee { align-self: flex-end; border-color: color-mix(in srgb, var(--semantic-success) 38%, var(--line)); background: color-mix(in srgb, var(--semantic-success) 8%, var(--surface)); }
#empTabConversations .employee-conversation-message > div { color: var(--text); font-size: 12px; line-height: 1.5; }
#empTabConversations .employee-conversation-text { display: block; min-width: 0; max-width: 100%; overflow-wrap: anywhere; word-break: normal; }
#empTabConversations .employee-conversation-text > * { min-width: 0; max-width: 100%; }
#empTabConversations .employee-conversation-message p { margin: 0 0 6px; }
#empTabConversations .employee-conversation-message p:last-child { margin-bottom: 0; }
#empTabConversations .employee-conversation-message small { display: block; margin-top: 7px; color: var(--muted); font-size: 9.5px; text-align: right; }
#empTabConversations .employee-conversation-text .employee-conversation-time { display: block; width: max-content; margin: 6px 0 1px auto; color: color-mix(in srgb, var(--muted) 88%, transparent); font-size: 9px; font-variant-numeric: tabular-nums; line-height: 1; white-space: nowrap; }
#empTabConversations .employee-conversation-message > .employee-conversation-time { margin: 7px 0 1px auto; }
#empTabConversations .employee-conversation-memory-context { margin-top: 8px; padding: 6px 7px; border-left: 2px solid var(--line); border-radius: 0 5px 5px 0; background: color-mix(in srgb, var(--sidebar-hover) 48%, transparent); color: var(--muted); font-size: 10px; line-height: 1.4; }
#empTabConversations .employee-conversation-memory-context.is-supplied { border-left-color: var(--console-accent); color: color-mix(in srgb, var(--text) 76%, var(--muted)); }
#empTabConversations .employee-conversation-memory-context.is-not_recorded { border-left-color: var(--muted); }
#empTabConversations .employee-thread-composer { display: grid; gap: 3px; margin: 0 24px 18px; padding: 11px 13px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); }
#empTabConversations .employee-thread-composer span { color: var(--text); font-size: 11px; font-weight: 600; }
#empTabConversations .employee-thread-composer small { font-size: 10px; }
@media (max-width: 920px) { #empTabConversations .employee-conversation-workspace { grid-template-columns: 1fr; } #empTabConversations .employee-conversation-inbox { min-height: 300px; } #empTabConversations .employee-conversation-detail { min-height: 500px; } }
@media (max-width: 620px) { #empTabConversations .employee-conversation-inbox { padding: 13px; } #empTabConversations .employee-thread-header, #empTabConversations .employee-thread-facts, #empTabConversations .employee-conversation-stream { padding-inline: 15px; } #empTabConversations .employee-thread-header { align-items: flex-start; flex-direction: column; gap: 8px; } #empTabConversations .employee-thread-updated { text-align: left; } #empTabConversations .employee-thread-facts { grid-template-columns: 1fr 1fr; gap: 12px 0; } #empTabConversations .employee-thread-facts > div:nth-child(3) { padding-left: 0; border-left: 0; } #empTabConversations .employee-conversation-message { max-width: 92%; } #empTabConversations .employee-thread-composer { margin-inline: 15px; } }

/* Final instruction visibility pass: preserve the operating-brief layout while
   making labels, facts, and semantic model/permission signals unmistakable. */
#empTabInstructions .employee-instructions-card,
#empTabInstructions .employee-summary-card { border-color: color-mix(in srgb, var(--line) 92%, var(--text)); }
#empTabInstructions .instructions-intro { background: color-mix(in srgb, var(--console-accent) 5%, var(--card)); }
#empTabInstructions .section-eyebrow { color: var(--console-accent); font-weight: 750; letter-spacing: .12em; }
#empTabInstructions .instructions-intro h2 { font-weight: 680; letter-spacing: -.025em; }
#empTabInstructions .instructions-intro p,
#empTabInstructions .instruction-section-heading .form-hint,
#empTabInstructions .instruction-model #empEditModelState { color: color-mix(in srgb, var(--text) 68%, var(--muted)); font-weight: 500; }
#empTabInstructions .instruction-section-heading label { color: var(--text); font-weight: 720; letter-spacing: -.01em; }
#empTabInstructions .instruction-section-icon { box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 16%, transparent); }
#empTabInstructions .instruction-section-icon.directive { color: var(--semantic-ai); background: color-mix(in srgb, var(--semantic-ai) 14%, transparent); }
#empTabInstructions .instruction-section-icon.model { color: var(--semantic-ai); background: color-mix(in srgb, var(--semantic-ai) 14%, transparent); }
#empTabInstructions .instruction-section-icon.guardrails { color: var(--semantic-success); background: color-mix(in srgb, var(--semantic-success) 13%, transparent); }
#empTabInstructions .tensor-textarea { border-color: color-mix(in srgb, var(--line) 84%, var(--text)); background: color-mix(in srgb, var(--surface) 94%, var(--card)); color: var(--text); font-weight: 540; }
#empTabInstructions .tensor-textarea::placeholder { color: color-mix(in srgb, var(--muted) 88%, transparent); }
#empTabInstructions .instruction-model .tensor-select { border-color: color-mix(in srgb, var(--semantic-ai) 67%, var(--line)); background: color-mix(in srgb, var(--semantic-ai) 9%, var(--surface)); color: var(--text); font-weight: 650; }
#empTabInstructions .instruction-model .tensor-select:hover { border-color: var(--semantic-ai); background: color-mix(in srgb, var(--semantic-ai) 13%, var(--surface)); }
#empTabInstructions .instruction-model #empEditModelState { color: color-mix(in srgb, var(--semantic-ai) 62%, var(--text)); }
#empTabInstructions .rules-list .rule-item { border-color: color-mix(in srgb, var(--line) 84%, var(--text)); background: color-mix(in srgb, var(--surface) 92%, var(--card)); color: var(--text); font-weight: 540; }
#empTabInstructions .rules-list .rule-item button { color: var(--muted); }
#empTabInstructions .rules-list .rule-item button:hover { color: var(--semantic-danger); }
#empTabInstructions .instruction-guardrails .btn-add-rule { color: color-mix(in srgb, var(--text) 88%, var(--console-accent)); font-weight: 650; }
#empTabInstructions .autonomy-option-card { border-color: color-mix(in srgb, var(--line) 84%, var(--text)); background: color-mix(in srgb, var(--surface) 92%, var(--card)); }
#empTabInstructions .autonomy-option-card strong { color: var(--text); font-weight: 700; }
#empTabInstructions .autonomy-option-card p { color: color-mix(in srgb, var(--text) 63%, var(--muted)); }
#empTabInstructions .autonomy-option-card.active { border-color: color-mix(in srgb, var(--semantic-success) 68%, var(--line)); background: color-mix(in srgb, var(--semantic-success) 8%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--semantic-success) 18%, transparent); }
#empTabInstructions .employee-summary-card h3 { font-weight: 700; }
#empTabInstructions .employee-summary-card dl > div { border-color: color-mix(in srgb, var(--line) 88%, var(--text)); }
#empTabInstructions .employee-summary-card dt { color: color-mix(in srgb, var(--text) 66%, var(--muted)); font-weight: 550; }
#empTabInstructions .employee-summary-card dd { color: var(--text); font-weight: 700; }
#empTabInstructions .summary-mark { box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 15%, transparent); }
html[data-theme="light"] #empTabInstructions .instructions-intro { background: #fbfcf8; }
html[data-theme="light"] #empTabInstructions .tensor-textarea { background: #fffefa; border-color: #bfc8b6; }
html[data-theme="light"] #empTabInstructions .instruction-model .tensor-select { background: #faf8ff; border-color: #ad9adf; }

/* Employee activity is an audit-derived operations log: compact filters,
   neutral evidence rows, and color only for the event category or state. */
#empTabActivity .employee-activity-workspace { padding: 20px 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
#empTabActivity .employee-activity-toolbar { display: grid; grid-template-columns: minmax(230px, 1fr) auto auto; gap: 10px; align-items: center; }
#empTabActivity .employee-activity-search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); }
#empTabActivity .employee-activity-search:focus-within { border-color: color-mix(in srgb, var(--console-accent) 55%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--console-accent) 10%, transparent); }
#empTabActivity .employee-activity-search span { font-size: 19px; }
#empTabActivity .employee-activity-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: 500 12px var(--font-sans); }
#empTabActivity .employee-activity-filters { display: flex; gap: 7px; overflow-x: auto; }
#empTabActivity .employee-activity-filter,
#empTabActivity .employee-activity-range { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--text); font: 550 11px var(--font-sans); white-space: nowrap; }
#empTabActivity .employee-activity-filter { cursor: pointer; }
#empTabActivity .employee-activity-filter span { display: grid; min-width: 15px; height: 15px; place-items: center; border-radius: 50%; background: var(--sidebar-hover); color: var(--muted); font-size: 9px; }
#empTabActivity .employee-activity-filter.active { border-color: color-mix(in srgb, var(--console-accent) 56%, var(--line)); background: color-mix(in srgb, var(--console-accent) 7%, transparent); }
#empTabActivity .employee-activity-filter.active span { color: var(--console-accent); }
#empTabActivity .employee-activity-range { color: var(--muted); }
#empTabActivity .employee-activity-range select { border: 0; outline: 0; background: transparent; color: var(--text); font: 550 11px var(--font-sans); }
#empTabActivity .employee-activity-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0 20px; }
#empTabActivity .employee-activity-metric { display: flex; align-items: center; gap: 12px; min-height: 78px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 9px; background: color-mix(in srgb, var(--surface) 94%, var(--sidebar-hover)); }
#empTabActivity .activity-metric-icon { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 50%; font-size: 19px; }
#empTabActivity .metric-data .activity-metric-icon { color: var(--semantic-telegram); background: color-mix(in srgb, var(--semantic-telegram) 12%, transparent); }
#empTabActivity .metric-warning .activity-metric-icon { color: var(--semantic-warning); background: color-mix(in srgb, var(--semantic-warning) 12%, transparent); }
#empTabActivity .metric-inactive .activity-metric-icon { color: var(--semantic-inactive); background: color-mix(in srgb, var(--semantic-inactive) 12%, transparent); }
#empTabActivity .metric-danger .activity-metric-icon { color: var(--semantic-danger); background: color-mix(in srgb, var(--semantic-danger) 12%, transparent); }
#empTabActivity .employee-activity-metric small { display: block; color: var(--text); font-size: 11px; font-weight: 600; }
#empTabActivity .employee-activity-metric strong { display: inline-block; margin-top: 4px; color: var(--text); font-size: 23px; line-height: 1; }
#empTabActivity .employee-activity-metric em { margin-left: 7px; color: var(--muted); font-size: 9px; font-style: normal; }
#empTabActivity .employee-activity-day { margin-top: 18px; }
#empTabActivity .employee-activity-day > header { display: flex; justify-content: space-between; margin-bottom: 8px; }
#empTabActivity .employee-activity-day h3 { margin: 0; color: var(--text); font-size: 14px; }
#empTabActivity .employee-activity-day > header span { color: var(--muted); font-size: 11px; }
#empTabActivity .employee-activity-table { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
#empTabActivity .employee-activity-row { display: grid; grid-template-columns: 94px 32px minmax(150px, .85fr) minmax(220px, 2fr) minmax(100px, .7fr) 92px; align-items: center; gap: 9px; min-height: 43px; padding: 7px 12px; border-top: 1px solid var(--line); }
#empTabActivity .employee-activity-row:first-child { border-top: 0; }
#empTabActivity .employee-activity-row time { color: var(--muted); font-size: 10px; }
#empTabActivity .activity-event-icon { display: grid; width: 23px; height: 23px; place-items: center; border-radius: 50%; color: var(--semantic-inactive); font-size: 13px; }
#empTabActivity .event-messages { color: var(--semantic-telegram); background: color-mix(in srgb, var(--semantic-telegram) 10%, transparent); }
#empTabActivity .event-approvals { color: var(--semantic-warning); background: color-mix(in srgb, var(--semantic-warning) 10%, transparent); }
#empTabActivity .event-connections { color: var(--semantic-success); background: color-mix(in srgb, var(--semantic-success) 10%, transparent); }
#empTabActivity .event-errors { color: var(--semantic-danger); background: color-mix(in srgb, var(--semantic-danger) 10%, transparent); }
#empTabActivity .employee-activity-row strong { color: var(--text); font-size: 11px; }
#empTabActivity .employee-activity-row p { overflow: hidden; margin: 0; color: var(--muted); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
#empTabActivity .activity-source { color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#empTabActivity .activity-status { justify-self: end; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--semantic-inactive); font-size: 9px; font-weight: 650; text-transform: capitalize; white-space: nowrap; }
#empTabActivity .status-messages { color: var(--semantic-telegram); } #empTabActivity .status-approvals { color: var(--semantic-warning); } #empTabActivity .status-connections { color: var(--semantic-success); } #empTabActivity .status-errors { color: var(--semantic-danger); }
#empTabActivity .event-execution, #empTabActivity .status-execution { color: var(--console-accent); }
#empTabActivity .execution-job-row { cursor: pointer; }
#empTabActivity .execution-job-row:focus-visible { outline: 2px solid var(--console-accent); outline-offset: -2px; }
#empTabActivity .execution-job-detail { padding: 10px 12px 12px 138px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10.5px; line-height: 1.5; }
#empTabActivity .execution-job-detail p { margin: 0 0 5px; white-space: normal; }
#empTabActivity .execution-job-transitions strong { color: var(--text); font-size: 10px; }
#empTabActivity .execution-job-transitions ol { display: grid; gap: 3px; margin: 6px 0 0; padding: 0; list-style: none; }
#empTabActivity .execution-job-transitions li { display: flex; justify-content: space-between; gap: 12px; }
#empTabActivity .execution-job-transitions time { color: var(--muted); white-space: nowrap; }
#empTabActivity .employee-activity-more { margin-top: 12px; }
#empTabActivity .employee-activity-empty { display: grid; min-height: 270px; place-content: center; justify-items: center; gap: 8px; color: var(--muted); text-align: center; }
#empTabActivity .employee-activity-empty span { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--semantic-inactive); font-size: 20px; }
#empTabActivity .employee-activity-empty h3 { margin: 3px 0 0; color: var(--text); font-size: 15px; } #empTabActivity .employee-activity-empty p { max-width: 300px; margin: 0; font-size: 11px; line-height: 1.5; }
@media (max-width: 1120px) { #empTabActivity .employee-activity-toolbar { grid-template-columns: 1fr; } #empTabActivity .employee-activity-filters { padding-bottom: 2px; } #empTabActivity .employee-activity-range { width: max-content; } #empTabActivity .employee-activity-row { grid-template-columns: 76px 28px minmax(130px, 1fr) minmax(150px, 1.5fr) 84px; } #empTabActivity .activity-source { display: none; } }
@media (max-width: 700px) { #empTabActivity .employee-activity-workspace { padding: 15px; } #empTabActivity .employee-activity-metrics { grid-template-columns: 1fr 1fr; } #empTabActivity .employee-activity-row { grid-template-columns: 62px 26px minmax(0, 1fr) auto; } #empTabActivity .employee-activity-row p { display: none; } #empTabActivity .activity-status { font-size: 8px; } }
@media (max-width: 700px) { #empTabActivity .execution-job-detail { padding-left: 12px; } #empTabActivity .execution-job-transitions li { display: block; } #empTabActivity .execution-job-transitions time { display: block; } }

/* Desktop activity refinement: a dense, high-contrast audit surface where
   the main event table stays visually dominant over its supporting metrics. */
@media (min-width: 761px) {
  #empTabActivity .employee-activity-workspace { padding: 20px 22px 22px; border-color: color-mix(in srgb, var(--line) 82%, var(--text)); }
  #empTabActivity .employee-activity-toolbar { grid-template-columns: minmax(310px, 1.35fr) auto auto; padding-bottom: 16px; border-bottom: 1px solid color-mix(in srgb, var(--line) 86%, var(--text)); }
  #empTabActivity .employee-activity-search { height: 40px; border-color: color-mix(in srgb, var(--line) 86%, var(--text)); background: color-mix(in srgb, var(--surface) 92%, var(--sidebar-hover)); }
  #empTabActivity .employee-activity-search input::placeholder { color: color-mix(in srgb, var(--text) 58%, var(--muted)); }
  #empTabActivity .employee-activity-filter { min-height: 38px; border-color: color-mix(in srgb, var(--line) 86%, var(--text)); color: color-mix(in srgb, var(--text) 78%, var(--muted)); }
  #empTabActivity .employee-activity-filter:hover { border-color: color-mix(in srgb, var(--console-accent) 52%, var(--line)); color: var(--text); }
  #empTabActivity .employee-activity-filter.active { color: var(--text); border-color: color-mix(in srgb, var(--console-accent) 70%, var(--line)); background: color-mix(in srgb, var(--console-accent) 10%, var(--surface)); }
  #empTabActivity .employee-activity-range { min-height: 38px; border-color: color-mix(in srgb, var(--line) 86%, var(--text)); color: var(--text); }
  #empTabActivity .employee-activity-metrics { gap: 10px; margin: 15px 0 19px; }
  #empTabActivity .employee-activity-metric { position: relative; min-height: 83px; padding: 14px 15px; border-color: color-mix(in srgb, var(--line) 84%, var(--text)); overflow: hidden; }
  #empTabActivity .employee-activity-metric::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 2px; background: var(--semantic-inactive); opacity: .72; }
  #empTabActivity .metric-data::after { background: var(--semantic-telegram); } #empTabActivity .metric-warning::after { background: var(--semantic-warning); } #empTabActivity .metric-danger::after { background: var(--semantic-danger); }
  #empTabActivity .activity-metric-icon { width: 41px; height: 41px; flex-basis: 41px; font-size: 20px; box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 24%, transparent); }
  #empTabActivity .employee-activity-metric small { color: color-mix(in srgb, var(--text) 82%, var(--muted)); font-size: 11px; letter-spacing: -.005em; }
  #empTabActivity .employee-activity-metric strong { font-size: 26px; font-weight: 690; }
  #empTabActivity .employee-activity-metric em { color: color-mix(in srgb, var(--text) 57%, var(--muted)); font-size: 9.5px; }
  #empTabActivity .employee-activity-day { margin-top: 16px; }
  #empTabActivity .employee-activity-day > header { align-items: baseline; padding: 0 2px; }
  #empTabActivity .employee-activity-day h3 { font-size: 14px; font-weight: 690; }
  #empTabActivity .employee-activity-day > header span { color: color-mix(in srgb, var(--text) 60%, var(--muted)); font-size: 10px; }
  #empTabActivity .employee-activity-table { border-color: color-mix(in srgb, var(--line) 84%, var(--text)); }
  #empTabActivity .employee-activity-table-head,
  #empTabActivity .employee-activity-row { grid-template-columns: 94px 32px minmax(160px, .9fr) minmax(260px, 2.1fr) minmax(105px, .7fr) 92px; }
  #empTabActivity .employee-activity-table-head { display: grid; align-items: center; gap: 9px; min-height: 30px; padding: 0 12px; border-bottom: 1px solid color-mix(in srgb, var(--line) 84%, var(--text)); background: color-mix(in srgb, var(--sidebar-hover) 58%, var(--surface)); color: color-mix(in srgb, var(--text) 55%, var(--muted)); font: 700 8.5px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
  #empTabActivity .employee-activity-table-head span:nth-child(2) { font-size: 0; } #empTabActivity .employee-activity-table-head span:nth-child(2)::after { content: "Kind"; font-size: 8.5px; }
  #empTabActivity .employee-activity-row { min-height: 45px; padding-block: 8px; border-color: color-mix(in srgb, var(--line) 78%, var(--text)); }
  #empTabActivity .employee-activity-row:hover { background: color-mix(in srgb, var(--console-accent) 4%, transparent); }
  #empTabActivity .employee-activity-row time { color: color-mix(in srgb, var(--text) 64%, var(--muted)); font-size: 10.5px; }
  #empTabActivity .employee-activity-row strong { font-size: 11.5px; font-weight: 660; }
  #empTabActivity .employee-activity-row p { color: color-mix(in srgb, var(--text) 66%, var(--muted)); font-size: 10.5px; }
  #empTabActivity .activity-source { color: color-mix(in srgb, var(--text) 72%, var(--muted)); font-size: 10.5px; }
  #empTabActivity .activity-status { min-width: 74px; justify-content: center; border-color: color-mix(in srgb, currentColor 42%, var(--line)); background: color-mix(in srgb, currentColor 8%, transparent); font-size: 9.5px; }
  #empTabActivity .employee-activity-table-empty { display: grid; min-height: 124px; place-content: center; justify-items: center; gap: 6px; color: color-mix(in srgb, var(--text) 64%, var(--muted)); text-align: center; }
  #empTabActivity .employee-activity-table-empty strong { color: var(--text); font-size: 12px; }
  #empTabActivity .employee-activity-table-empty span { max-width: 430px; font-size: 10.5px; }
}

/* Final dashboard metric geometry. The outer cards remain, while the label
   area stays visually plain. Currency values reserve a real icon column so
   neither Account balance nor Today's spend can run beneath its icon. */
#dashboardMetrics.dashboard-stats-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: clamp(10px, 1.35cqw, 16px) !important;
  align-items: stretch;
}
#dashboardMetrics.dashboard-stats-grid .stat-card {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(0, 1fr);
  align-items: end;
  gap: 8px;
  min-width: 0;
  min-height: 104px !important;
  max-height: none !important;
  padding: clamp(12px, 1.35cqw, 16px) !important;
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  background: var(--card) !important;
  overflow: hidden !important;
}
#dashboardMetrics.dashboard-stats-grid .stat-card::before { display: none !important; }
#dashboardMetrics .stat-card-meta {
  grid-column: 1 / -1;
  grid-row: 1;
  display: block;
  min-width: 0;
}
#dashboardMetrics .stat-card-meta .stat-label {
  margin: 0 !important;
  min-height: 0 !important;
  overflow: visible !important;
  color: var(--muted) !important;
  font-size: clamp(10px, 1.08cqw, 12px) !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  text-overflow: clip !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
}
#dashboardMetrics .stat-value {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  margin: 0 !important;
  font-size: clamp(22px, 2.25cqw, 28px) !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  letter-spacing: -.055em;
  white-space: nowrap;
}
#dashboardMetrics .metric-icon {
  position: static !important;
  grid-column: 2;
  grid-row: 2;
  display: grid;
  width: clamp(40px, 4.1cqw, 52px) !important;
  height: clamp(40px, 4.1cqw, 52px) !important;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px !important;
}
#dashboardMetrics .metric-icon svg { width: 54% !important; height: 54% !important; }

@container tensor-workspace (max-width: 1180px) {
  #dashboardMetrics.dashboard-stats-grid { gap: clamp(6px, .9cqw, 10px) !important; }
  #dashboardMetrics.dashboard-stats-grid .stat-card {
    gap: clamp(4px, .6cqw, 7px);
    min-height: 88px !important;
    padding: clamp(9px, 1cqw, 12px) !important;
    border-radius: 10px !important;
  }
  #dashboardMetrics .stat-card-meta .stat-label { font-size: clamp(9px, .98cqw, 11px) !important; }
  #dashboardMetrics .stat-value { font-size: clamp(18px, 1.95cqw, 23px) !important; }
  #dashboardMetrics .metric-icon { width: clamp(34px, 3.35cqw, 42px) !important; height: clamp(34px, 3.35cqw, 42px) !important; }
}

/* The knowledge preview shares the source pane's grid-row height. Chat
   history owns the flexible middle region, so long replies scroll there
   instead of extending the right-hand card down the page. */
#empTabKnowledge .knowledge-split-layout { align-items: stretch !important; }
#empTabKnowledge .knowledge-test-pane {
  display: flex !important;
  flex-direction: column !important;
  align-self: stretch;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: hidden !important;
}
#empTabKnowledge .test-conversation-area {
  /* A zero flex basis makes this the remaining space in the fixed preview
     card. Its messages therefore scroll here instead of increasing card
     height. */
  flex: 1 1 0;
  height: 0;
  min-height: 0 !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}
#empTabKnowledge .knowledge-preview-suggestions,
#empTabKnowledge .test-composer { flex: 0 0 auto; }

/* Desktop preview responses scroll inside one stable console rather than
   increasing the page length. The phone layout intentionally remains fluid. */
@media (min-width: 761px) {
  #empTabKnowledge .knowledge-split-layout { align-items: start !important; }
  #empTabKnowledge .knowledge-test-pane {
    align-self: start !important;
    height: 620px !important;
    min-height: 620px !important;
    max-height: 620px !important;
  }
  #empTabKnowledge .test-conversation-area {
    flex: 1 1 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
  }
}

/* One composer frame only: the inner textarea is deliberately borderless. */
#empTabKnowledge .test-composer {
  margin: 0 20px 18px;
  padding: 8px 12px !important;
  border: 1px solid color-mix(in srgb, var(--console-accent) 45%, var(--line)) !important;
  border-radius: 12px !important;
  background: transparent !important;
}
#empTabKnowledge .composer-content,
#empTabKnowledge .composer-content:focus-within,
#empTabKnowledge .composer-inner-box,
#empTabKnowledge .composer-inner-box:focus-within,
#empTabKnowledge .test-textarea,
#empTabKnowledge .test-textarea:focus {
  padding: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
#empTabKnowledge .composer-content { min-height: 34px; }

/* Step 01A — employee memory stays a compact operational library. The
   contract-pending surface is intentional: no record styling is rendered
   until the server supplies real employee-scoped records. */
.memory-workspace { max-width: 1120px; margin: 0 auto; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--card) 92%, transparent); }
.memory-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.memory-header h2 { margin: 2px 0 5px; font-size: 22px; letter-spacing: -.03em; }
.memory-header p { max-width: 660px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.memory-eyebrow { color: var(--console-accent) !important; font: 500 10px/1.2 var(--font-mono, monospace) !important; letter-spacing: .1em; text-transform: uppercase; }
.memory-contract-badge { flex: 0 0 auto; padding: 5px 8px; border: 1px solid color-mix(in srgb, var(--line) 82%, var(--text)); border-radius: 999px; color: var(--muted); font: 500 10px/1 var(--font-mono, monospace); text-transform: uppercase; }
.memory-toolbar { display: grid; grid-template-columns: minmax(180px, 1fr) 150px 130px auto; gap: 8px; margin-top: 20px; }
.memory-toolbar input, .memory-toolbar select { min-width: 0; width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: 12px var(--font-sans, inherit); }
.memory-toolbar button { min-height: 36px; padding: 8px 12px; font-size: 12px; }
.memory-toolbar :disabled { cursor: not-allowed; opacity: .56; }
.memory-feedback { min-height: 18px; margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.memory-list-shell { margin-top: 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.memory-contract-empty { display: flex; align-items: flex-start; gap: 12px; padding: 24px 4px; }
.memory-empty-mark { display: grid; width: 28px; height: 28px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--console-accent); }
.memory-contract-empty h3 { margin: 0 0 4px; color: var(--text); font-size: 13px; }
.memory-contract-empty p, .memory-contract-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.memory-contract-note { margin-top: 12px; }
.memory-eligibility-guidance { display: flex; gap: 8px 12px; align-items: baseline; margin: 12px 0 0; padding: 9px 10px; border-left: 2px solid var(--console-accent); background: color-mix(in srgb, var(--console-accent) 7%, transparent); color: var(--muted); font-size: 12px; line-height: 1.45; }.memory-eligibility-guidance strong { color: var(--text); white-space: nowrap; font-size: 11px; }.memory-preview-guidance { margin: -4px 20px 12px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.memory-history-toggle { display: inline-flex; gap: 7px; align-items: center; margin-top: 10px; color: var(--muted); font-size: 12px; }
.memory-editor { display: grid; gap: 10px; margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--bg) 72%, var(--card)); }
.memory-editor label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; }
.memory-editor input, .memory-editor select, .memory-editor textarea { width: 100%; box-sizing: border-box; padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--text); font: 13px var(--font-sans, inherit); }
.memory-editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }.memory-editor-actions { display: flex; justify-content: flex-end; gap: 8px; }
.memory-record { padding: 14px 2px; border-bottom: 1px solid var(--line); }.memory-record:last-child { border-bottom: 0; }.memory-record-top { display: flex; justify-content: space-between; gap: 10px; }.memory-record h3 { margin: 9px 0 4px; color: var(--text); font-size: 14px; }.memory-content { margin: 0; color: var(--text); font-size: 13px; line-height: 1.5; white-space: pre-wrap; }.memory-type, .memory-state-badge { display: inline-block; padding: 3px 6px; border-radius: 4px; font: 500 10px/1 var(--font-mono, monospace); text-transform: uppercase; }.memory-type { background: color-mix(in srgb, var(--line) 72%, transparent); color: var(--muted); }.memory-state-badge { margin-left: 5px; }.memory-confirmed .memory-state-badge { background: color-mix(in srgb, var(--console-accent) 19%, transparent); color: var(--console-accent); }.memory-suggested .memory-state-badge { background: color-mix(in srgb, #d9a441 18%, transparent); color: #b17812; }.memory-unverified .memory-state-badge { background: color-mix(in srgb, var(--muted) 17%, transparent); color: var(--muted); }.memory-meta { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 10px; color: var(--muted); font-size: 11px; }.memory-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }.memory-actions button { padding: 3px 5px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font: 11px var(--font-sans, inherit); cursor: pointer; }.memory-actions button:hover { background: var(--bg); color: var(--text); }.memory-state { margin: 0; padding: 18px 0; color: var(--muted); font-size: 13px; }.memory-load-more { margin-top: 12px; }
@media (max-width: 700px) { .memory-workspace { padding: 16px; border-radius: 11px; } .memory-header { gap: 10px; } .memory-header h2 { font-size: 20px; } .memory-toolbar { grid-template-columns: 1fr 1fr; } .memory-toolbar .memory-search-field { grid-column: 1 / -1; } .memory-toolbar button { grid-column: 1 / -1; } .memory-contract-empty { padding: 18px 0; } .memory-eligibility-guidance { display: grid; gap: 3px; } }

/* Run keeps the same code-editor-like black and white treatment in either
   application theme. */
#empTabKnowledge .btn-chat-simulate,
#empTabKnowledge .btn-chat-simulate:hover,
#empTabKnowledge .btn-chat-simulate:focus-visible,
html[data-theme="light"] #empTabKnowledge .btn-chat-simulate,
html[data-theme="light"] #empTabKnowledge .btn-chat-simulate:hover,
html[data-theme="light"] #empTabKnowledge .btn-chat-simulate:focus-visible {
  border-color: #050605 !important;
  background: #050605 !important;
  color: #fff !important;
  box-shadow: none !important;
}
#empTabKnowledge .btn-chat-simulate:focus-visible { outline: 2px solid #7ca16d !important; outline-offset: 2px; }

/* Employee workspaces use neutral space-gray surfaces in dark mode. Olive is
   reserved for deliberate actions, active states, and small status signals. */
html[data-theme="dark"] #page-employee-detail {
  --employee-surface: var(--bg);
  --employee-elevated: var(--bg);
  --employee-input: var(--bg);
  --employee-line: #414141;
}
html[data-theme="dark"] #page-employee-detail .emp-card-section,
html[data-theme="dark"] #empTabInstructions .employee-instructions-card,
html[data-theme="dark"] #empTabInstructions .employee-summary-card,
html[data-theme="dark"] #empTabKnowledge .knowledge-config-pane > .emp-card-section,
html[data-theme="dark"] #empTabKnowledge .knowledge-test-pane,
html[data-theme="dark"] #empTabTelegram .telegram-manage-card,
html[data-theme="dark"] #empTabSettings .employee-settings-card,
html[data-theme="dark"] #empTabSettings .employee-danger-zone,
html[data-theme="dark"] #empTabConversations .employee-conversation-inbox,
html[data-theme="dark"] #empTabConversations .employee-conversation-detail,
html[data-theme="dark"] #empTabActivity .employee-activity-workspace {
  background: var(--employee-surface) !important;
  border-color: var(--employee-line) !important;
  box-shadow: none !important;
}
html[data-theme="dark"] #empTabInstructions .instructions-intro,
html[data-theme="dark"] #empTabInstructions .form-group,
html[data-theme="dark"] #empTabAuthority .autonomy-option-card,
html[data-theme="dark"] #empTabSettings .employee-settings-subcard,
html[data-theme="dark"] #empTabConversations .employee-thread-composer,
html[data-theme="dark"] #empTabActivity .employee-activity-search {
  background: var(--employee-elevated) !important;
  border-color: var(--employee-line) !important;
}
html[data-theme="dark"] #empTabInstructions .tensor-textarea,
html[data-theme="dark"] #empTabInstructions .tensor-select,
html[data-theme="dark"] #empTabKnowledge .knowledge-dropzone.polished-dropzone,
html[data-theme="dark"] #empTabKnowledge .composer-content,
html[data-theme="dark"] #empTabSettings input,
html[data-theme="dark"] #empTabSettings textarea,
html[data-theme="dark"] #empTabSettings select,
html[data-theme="dark"] #empTabTelegram input {
  background: var(--employee-input) !important;
  border-color: var(--employee-line) !important;
}

/* Instructions is an operating brief: a single spacious editor paired with
   concise employee facts and configuration cards. */
@media (min-width: 1001px) {
  #empTabInstructions .instruction-workspace {
    grid-template-columns: minmax(0, 1.85fr) minmax(360px, .95fr) !important;
    align-items: start;
    gap: 16px;
  }
  #empTabInstructions .employee-instructions-card {
    display: flex;
    min-height: 0;
    flex-direction: column;
    background: var(--bg) !important;
    border-color: var(--line) !important;
  }
  #empTabInstructions .instructions-intro {
    padding: 22px 24px 0;
    border: 0;
    background: transparent !important;
  }
  #empTabInstructions .instructions-intro h2 { font-size: 25px; }
  #empTabInstructions .instructions-intro p { max-width: none; font-size: 13px; }
  #empTabInstructions .instruction-directive {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    padding: 20px 24px 14px;
    border: 0;
    background: transparent;
  }
  #empTabInstructions .instruction-directive .instruction-section-heading { display: none; }
  #empTabInstructions .instruction-directive .tensor-textarea {
    flex: 0 0 auto;
    min-height: 240px;
    height: 240px;
    margin: 0;
    padding: 16px;
    border-color: var(--line);
    border-radius: 9px;
    background: var(--bg) !important;
    font: 500 12px/1.55 "IBM Plex Mono", monospace;
  }
  #empTabInstructions .directive-count { margin-top: 10px; font-size: 11px; text-align: left; }
  #empTabInstructions .form-actions-row { padding: 0 24px 20px; border: 0; }

  #empTabInstructions .instruction-aside { display: grid; align-content: start; gap: 14px; }
  #empTabInstructions .employee-summary-card,
  #empTabInstructions .instruction-aside .form-group {
    margin: 0;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg) !important;
  }
  #empTabInstructions .employee-summary-card h3 { margin-bottom: 12px; font-size: 17px; }
  #empTabInstructions .employee-summary-card dl > div { min-height: 56px; }
  #empTabInstructions .employee-summary-card dt,
  #empTabInstructions .employee-summary-card dd { font-size: 12px; }
  #empTabInstructions .summary-mark,
  #empTabInstructions .instruction-section-icon {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: transparent !important;
    color: var(--muted) !important;
    box-shadow: none !important;
  }
  #empTabInstructions .summary-mark svg,
  #empTabInstructions .instruction-section-icon svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  #empTabInstructions .instruction-aside .instruction-section-heading label { font-size: 16px; }
  #empTabInstructions .instruction-aside .instruction-section-heading .form-hint { font-size: 11px; }
  #empTabInstructions .instruction-model .tensor-select {
    height: 52px;
    margin-top: 14px;
    padding-inline: 15px;
    border-color: var(--line);
    background: var(--bg) !important;
    font-size: 14px;
  }
  #empTabInstructions .instruction-model #empEditModelState { margin: 9px 0 0; color: var(--muted) !important; }
  #empTabInstructions .instruction-guardrails .rules-list,
  #empTabInstructions .instruction-guardrails .btn-add-rule { margin-left: 0; }
  #empTabInstructions .instruction-guardrails .rules-list { margin-top: 14px; }
  #empTabInstructions .rules-list .rule-item { min-height: 46px; border-color: var(--line); background: var(--bg); }
  #empTabInstructions .instruction-guardrails .btn-add-rule { margin-top: 10px; }
}

/* Activity is a compact employee audit surface: controls first, then factual
   counters and one evidence table. */
@media (min-width: 761px) {
  #empTabActivity .employee-activity-workspace {
    padding: 20px 22px 22px;
    background: var(--bg) !important;
  }
  #empTabActivity .employee-activity-toolbar {
    grid-template-columns: minmax(280px, 1fr) auto auto;
    gap: 12px;
    padding-bottom: 18px;
  }
  #empTabActivity .employee-activity-search,
  #empTabActivity .employee-activity-filter,
  #empTabActivity .employee-activity-range {
    min-height: 38px;
    border-radius: 7px;
    background: var(--bg);
  }
  #empTabActivity .employee-activity-search svg,
  #empTabActivity .employee-activity-range svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  #empTabActivity .employee-activity-range { gap: 10px; padding-inline: 13px; }
  #empTabActivity .employee-activity-range select { min-width: 118px; cursor: pointer; }
  #empTabActivity .employee-activity-metrics { gap: 12px; margin: 18px 0 20px; }
  #empTabActivity .employee-activity-metric {
    min-height: 92px;
    padding: 15px 18px;
    background: var(--bg);
  }
  #empTabActivity .employee-activity-metric::after { display: none; }
  #empTabActivity .activity-metric-icon {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    border-radius: 8px;
    background: transparent !important;
    box-shadow: none;
  }
  #empTabActivity .activity-metric-icon svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  #empTabActivity .employee-activity-metric small { font-size: 12px; }
  #empTabActivity .metric-data small { color: var(--semantic-telegram); }
  #empTabActivity .metric-warning small { color: var(--semantic-success); }
  #empTabActivity .metric-inactive small { color: #8ca7ff; }
  #empTabActivity .metric-danger small { color: var(--semantic-danger); }
  #empTabActivity .employee-activity-metric strong { margin-top: 6px; font-size: 25px; }
  #empTabActivity .employee-activity-metric em { display: block; margin: 4px 0 0; font-size: 10px; }
  #empTabActivity .employee-activity-day { margin-top: 18px; }
  #empTabActivity .employee-activity-table-empty { min-height: 230px; }
  #empTabActivity .employee-activity-empty-icon {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    margin-bottom: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
  }
  #empTabActivity .employee-activity-empty-icon svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
}

/* Final Knowledge-preview reading pass. The response is progressively
   revealed before its final safe Markdown render, so it must remain readable
   and contained within this console at every viewport size. */
#empTabKnowledge .test-message,
#empTabKnowledge .test-message-content {
  min-width: 0;
  max-width: 100%;
}
#empTabKnowledge .test-message-content {
  overflow-wrap: anywhere;
  word-break: normal;
}
#empTabKnowledge .test-preview-typing { white-space: pre-wrap; }
#empTabKnowledge .test-preview-typing::after {
  content: "▋";
  display: inline-block;
  margin-left: 2px;
  color: var(--console-accent);
  animation: tensor-preview-caret 900ms step-end infinite;
}
@keyframes tensor-preview-caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  #empTabKnowledge .test-preview-typing::after { animation: none; }
}

@media (max-width: 760px) {
  /* This is a real chat viewport on phones: a long reply scrolls inside the
     preview rather than enlarging the employee-detail page. The custom
     property is updated from VisualViewport while the iOS keyboard is open. */
  #empTabKnowledge .knowledge-test-pane {
    height: clamp(280px, calc(var(--tensor-knowledge-preview-viewport-height, 100dvh) - 156px), 520px) !important;
    min-height: 0 !important;
    max-height: 520px !important;
  }
  html.tensor-knowledge-preview-keyboard-open #empTabKnowledge .knowledge-test-pane {
    height: clamp(280px, calc(var(--tensor-knowledge-preview-viewport-height, 100dvh) - 116px), 420px) !important;
  }
  #empTabKnowledge .test-conversation-area {
    min-width: 0;
    padding: 14px !important;
    gap: 16px;
    -webkit-overflow-scrolling: touch;
  }
  #empTabKnowledge .test-message-content {
    width: 100%;
    font-size: 14px !important;
    line-height: 1.58 !important;
  }
  #empTabKnowledge .test-message-content pre {
    max-width: 100%;
    overflow-x: auto;
  }
  #empTabKnowledge .test-composer {
    margin: 0 14px 14px;
    scroll-margin-bottom: 12px;
  }
  html.tensor-knowledge-preview-keyboard-open #empTabKnowledge .knowledge-preview-suggestions { display: none; }
}

/* Conversation history uses the same stable-console rule as Knowledge
   Preview. On desktop the right-hand thread is a fixed working surface; only
   its message stream scrolls, so a long customer exchange never lengthens the
   employee page or shifts the inbox beside it. */
@media (min-width: 921px) {
  #empTabConversations .employee-conversation-workspace {
    height: 620px;
    min-height: 620px;
    max-height: 620px;
    align-items: stretch;
  }
  #empTabConversations .employee-conversation-detail {
    height: 620px;
    min-height: 620px;
    max-height: 620px;
  }
  #empTabConversations .employee-thread-header,
  #empTabConversations .employee-thread-facts,
  #empTabConversations .employee-thread-composer { flex: 0 0 auto; }
  #empTabConversations .employee-conversation-stream {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  /* Keep both panes as equally calm working surfaces. The conversation
     identity and verified facts stay available, but use only the vertical
     space they need so the actual channel history remains the focus. */
  #empTabConversations .employee-thread-header {
    gap: 12px;
    padding: 14px 18px 10px;
  }
  #empTabConversations .employee-thread-title { gap: 9px; }
  #empTabConversations .employee-thread-title .conversation-avatar {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    font-size: 11px;
  }
  #empTabConversations .employee-thread-title h3 { font-size: 15px; }
  #empTabConversations .employee-thread-title p { gap: 7px; margin-top: 3px; }
  #empTabConversations .employee-thread-updated { font-size: 9px; }
  #empTabConversations .employee-thread-facts { padding: 9px 18px; }
  #empTabConversations .employee-thread-facts > div { padding-inline: 11px; }
  #empTabConversations .employee-thread-facts dt { margin-bottom: 3px; }
  #empTabConversations .employee-conversation-stream {
    gap: 11px;
    padding: 14px 18px;
  }
  #empTabConversations .employee-thread-composer {
    gap: 2px;
    margin: 0 18px 12px;
    padding: 8px 10px;
  }

  /* The dark global form treatment must not create a second rectangle inside
     the one visible conversation search control. */
  #empTabConversations .conversation-search-row input {
    appearance: none;
    -webkit-appearance: none;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
  }
  #empTabConversations .conversation-filter-tabs {
    gap: 5px;
    overflow-x: hidden;
    justify-content: space-between;
  }
  #empTabConversations .conversation-filter-tab {
    gap: 5px;
    min-height: 30px;
    padding: 5px 7px;
    font-size: 10px;
  }
  #empTabConversations .conversation-filter-tab span {
    min-width: 15px;
    height: 15px;
  }
}

/* Phone conversations are one Telegram-like surface at a time. The inbox has
   no enclosing card, and choosing an account replaces it with a full-width
   thread. The fixed inner stream keeps long verified histories contained. */
@media (max-width: 760px) {
  #empTabConversations .employee-conversation-workspace,
  #empTabConversations .employee-conversation-inbox,
  #empTabConversations .employee-conversation-detail {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  #empTabConversations .employee-conversation-workspace {
    display: block;
    min-height: 0;
    gap: 0;
  }
  #empTabConversations .employee-conversation-inbox,
  #empTabConversations .employee-conversation-detail {
    width: 100%;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  #empTabConversations .employee-conversation-inbox {
    height: min(620px, calc(100dvh - 212px));
    min-height: 360px;
    padding: 0;
  }
  #empTabConversations .conversation-search-row {
    grid-template-columns: minmax(0, 1fr) auto;
    padding-bottom: 12px;
  }
  #empTabConversations .conversation-search-row .conversation-filter-trigger { display: inline-flex; }
  #empTabConversations .employee-conversations-list { border-top: 0; }
  #empTabConversations .employee-conversation-row {
    grid-template-columns: 48px minmax(0, 1fr);
    min-height: 72px;
    gap: 11px;
    padding: 12px 2px;
  }
  #empTabConversations .employee-conversation-row.is-selected {
    margin-inline: 0;
    padding-inline: 2px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
  }
  #empTabConversations .conversation-avatar { width: 46px; height: 46px; font-size: 13px; }
  #empTabConversations .conversation-row-copy strong { font-size: 13px; }
  #empTabConversations .conversation-row-copy em { font-size: 11px; }
  #empTabConversations .conversation-row-meta { display: none; }
  #empTabConversations .conversation-status { font-size: 9px; }

  #empTabConversations .employee-conversation-workspace.is-thread-open .employee-conversation-inbox,
  #empTabConversations .employee-conversation-workspace:not(.is-thread-open) .employee-conversation-detail { display: none; }
  #empTabConversations .employee-conversation-workspace.is-thread-open .employee-conversation-detail {
    display: flex;
    height: min(680px, calc(100dvh - 160px));
    min-height: 400px;
    max-height: 680px;
  }
  #empTabConversations .employee-thread-header {
    position: relative;
    min-height: 70px;
    padding: 13px 108px 13px 0;
    border-bottom: 1px solid var(--line);
  }
  #empTabConversations .employee-thread-title { gap: 10px; }
  #empTabConversations .employee-thread-title h3 { font-size: 16px; }
  #empTabConversations .employee-thread-updated { font-size: 9px; }
  #empTabConversations .employee-thread-back {
    position: absolute;
    top: 15px;
    right: 0;
    min-height: 30px;
    padding: 0;
    border: 0;
    color: var(--console-accent);
    background: transparent;
    font: 650 11px var(--font-sans);
  }
  #empTabConversations .employee-thread-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 0;
    padding: 12px 0;
  }
  #empTabConversations .employee-thread-facts > div { padding: 0 10px; }
  #empTabConversations .employee-thread-facts > div:nth-child(3) { padding-left: 0; border-left: 0; }
  #empTabConversations .employee-conversation-stream {
    min-height: 0;
    padding: 16px 0;
    background: transparent;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  #empTabConversations .employee-conversation-message { max-width: 88%; overflow-wrap: anywhere; }
  #empTabConversations .employee-thread-composer { margin: 0 0 12px; }
}

/* Conversation detail is a chat first. The only persistent header identity is
   the normalized channel contact; fuller customer information lives one tap
   away in the dedicated profile view. */
#empTabConversations .employee-thread-header {
  position: static;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 64px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
}
#empTabConversations .employee-thread-back {
  position: static;
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0;
  border: 0;
  color: var(--console-accent);
  background: transparent;
  font: 650 12px var(--font-sans);
}
#empTabConversations .employee-thread-header .employee-thread-back { margin-left: auto; }
#empTabConversations .employee-thread-profile {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  padding: 3px 5px;
  border: 0;
  border-radius: 9px;
  color: var(--text);
  background: transparent;
  font: 650 15px var(--font-sans);
  text-align: left;
  cursor: pointer;
}
#empTabConversations .employee-thread-profile:hover,
#empTabConversations .employee-thread-profile:focus-visible { background: var(--sidebar-hover); outline: 0; }
#empTabConversations .conversation-identity-copy { position: relative; display: flex; align-items: center; min-width: 0; height: 34px; }
#empTabConversations .conversation-identity-name { overflow: hidden; line-height: 34px; text-overflow: ellipsis; white-space: nowrap; }
#empTabConversations .conversation-source-icon { position: absolute; bottom: -1px; left: 1px; display: grid; width: 11px; height: 11px; place-items: center; color: var(--semantic-telegram); }
#empTabConversations .conversation-source-icon svg { width: 100%; height: 100%; fill: currentColor; }
#empTabConversations .conversation-avatar { overflow: hidden; }
#empTabConversations .conversation-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
#empTabConversations .conversation-avatar-sm { width: 34px; height: 34px; font-size: 11px; }
#empTabConversations .conversation-avatar-lg { width: 96px; height: 96px; font-size: 26px; }
#empTabConversations .employee-conversation-stream { padding: 18px 22px; }
#empTabConversations .employee-conversation-media { display: block; width: min(100%, 320px); max-height: 360px; margin-top: 8px; border-radius: 8px; object-fit: cover; }
#empTabConversations .employee-conversation-media.is-sticker { width: min(180px, 100%); max-height: 220px; object-fit: contain; }
#empTabConversations .employee-conversation-media.is-video-note { width: min(220px, 100%); aspect-ratio: 1; border-radius: 50%; object-fit: cover; }
#empTabConversations .employee-conversation-audio { display: block; width: min(280px, 100%); margin-top: 8px; }
#empTabConversations .employee-conversation-attachment { display: block; min-width: min(240px, 100%); margin-top: 8px; padding: 11px 12px; border: 1px solid color-mix(in srgb, var(--line) 85%, var(--console-accent)); border-radius: 9px; color: var(--text); background: color-mix(in srgb, var(--sidebar-hover) 52%, transparent); font-size: 12px; font-weight: 600; text-decoration: none; }
#empTabConversations .employee-conversation-attachment:hover { border-color: var(--console-accent); }
#empTabConversations .employee-conversation-quote { overflow: hidden; margin: 0 0 8px; padding: 6px 9px; border-left: 2px solid var(--console-accent); color: var(--muted); font-size: 11px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
#empTabConversations .employee-conversation-forward { display: block; margin-bottom: 5px; color: var(--console-accent); font-size: 9.5px; }
#empTabConversations .employee-conversation-caption { margin-top: 7px; color: var(--text); font-size: 12px; line-height: 1.45; }
#empTabConversations .employee-conversation-unavailable { color: var(--muted); font-size: 11px; font-style: italic; }
#empTabConversations .employee-customer-header { justify-content: flex-start; }
#empTabConversations .employee-customer-profile { display: grid; justify-items: center; gap: 7px; padding: 28px 22px 22px; text-align: center; }
#empTabConversations .employee-customer-profile h3 { margin: 5px 0 0; color: var(--text); font-size: 21px; }
#empTabConversations .employee-customer-profile p { margin: 0; color: var(--muted); font-size: 13px; }
#empTabConversations .employee-customer-profile small { color: var(--muted); font-size: 11px; }
#empTabConversations .employee-customer-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0 22px 22px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
#empTabConversations .employee-customer-facts > div { min-width: 0; padding: 13px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
#empTabConversations .employee-customer-facts dt { margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
#empTabConversations .employee-customer-facts dd { overflow: hidden; margin: 0; color: var(--text); font-size: 13px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 760px) {
  #empTabConversations .employee-thread-header { min-height: 58px; padding: 9px 0; gap: 8px; }
  #empTabConversations .employee-thread-back { min-height: 36px; font-size: 11px; }
  #empTabConversations .employee-thread-profile { gap: 8px; padding: 2px 3px; font-size: 14px; }
  #empTabConversations .conversation-avatar-sm { width: 32px; height: 32px; }
  #empTabConversations .employee-conversation-stream { padding: 14px 0; }
  #empTabConversations .employee-customer-profile { padding: 25px 0 20px; }
  #empTabConversations .employee-customer-facts { grid-template-columns: 1fr; margin: 0 0 16px; }
}

/* Employee Activity control and metric refinement. These rules deliberately
   own the complete visible control surface so global form styles cannot add a
   second input/select frame inside it. */
#empTabActivity .employee-activity-toolbar {
  align-items: center;
}
#empTabActivity .employee-activity-search,
#empTabActivity .employee-activity-range {
  box-sizing: border-box;
  min-height: 42px;
  border: 1px solid color-mix(in srgb, var(--line) 88%, var(--text));
  border-radius: 8px;
  background: transparent !important;
  box-shadow: none !important;
}
#empTabActivity .employee-activity-search {
  gap: 10px;
  padding-inline: 13px;
}
#empTabActivity .employee-activity-search svg,
#empTabActivity .employee-activity-range svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#empTabActivity .employee-activity-search input {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 100%;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--text);
  font: 500 13px var(--font-sans);
}
#empTabActivity .employee-activity-search input::placeholder { color: var(--muted); opacity: 1; }
#empTabActivity .employee-activity-search input::-webkit-search-decoration,
#empTabActivity .employee-activity-search input::-webkit-search-cancel-button { appearance: none; }
#empTabActivity .employee-activity-search:focus-within,
#empTabActivity .employee-activity-range:focus-within {
  border-color: color-mix(in srgb, var(--console-accent) 62%, var(--line));
  box-shadow: none !important;
}
#empTabActivity .employee-activity-range {
  position: relative;
  gap: 10px;
  min-width: 166px;
  padding: 0 32px 0 13px;
  color: var(--text);
  cursor: pointer;
}
#empTabActivity .employee-activity-range select {
  appearance: none !important;
  -webkit-appearance: none !important;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 40px;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--text);
  cursor: pointer;
  font: 600 13px var(--font-sans);
}
#empTabActivity .employee-activity-range::after {
  position: absolute;
  top: 50%;
  right: 15px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  content: "";
  pointer-events: none;
  transform: translateY(-65%) rotate(45deg);
}
#empTabActivity .employee-activity-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 20px;
}
#empTabActivity .employee-activity-metric {
  align-items: center;
  min-width: 0;
  min-height: 92px;
  padding: 16px;
  gap: 13px;
  border: 1px solid color-mix(in srgb, var(--line) 88%, var(--text));
  border-radius: 9px;
  background: transparent !important;
}
#empTabActivity .employee-activity-metric::after { display: none; }
#empTabActivity .activity-metric-icon {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
}
#empTabActivity .activity-metric-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#empTabActivity .metric-data .activity-metric-icon { color: #7197B8; }
#empTabActivity .metric-warning .activity-metric-icon { color: #C6A15B; }
#empTabActivity .metric-inactive .activity-metric-icon { color: #6FA9A1; }
#empTabActivity .metric-danger .activity-metric-icon { color: #C66F68; }
#empTabActivity .employee-activity-metric > div { min-width: 0; }
#empTabActivity .employee-activity-metric small {
  display: block;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
}
#empTabActivity .employee-activity-metric strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 25px;
  font-weight: 680;
  line-height: 1;
}
#empTabActivity .employee-activity-metric em { display: none; }

@media (max-width: 700px) {
  #empTabActivity .employee-activity-workspace { padding-inline: 15px; }
  #empTabActivity .employee-activity-toolbar { grid-template-columns: minmax(0, 1fr); }
  #empTabActivity .employee-activity-search,
  #empTabActivity .employee-activity-range { width: 100%; min-width: 0; }
  #empTabActivity .employee-activity-metrics { gap: 10px; }
  #empTabActivity .employee-activity-metric { min-height: 86px; padding: 14px 12px; gap: 10px; }
  #empTabActivity .employee-activity-metric small { font-size: 11px; }
  #empTabActivity .employee-activity-metric strong { font-size: 23px; }
}

/* Customer profiles are an operational reference, not a full-height profile
   page. Keep the real contact facts compact and allow the mobile page itself
   to scroll above the fixed workspace dock. */
@media (max-width: 760px) {
  #empTabConversations .employee-conversation-detail.is-customer-profile {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    padding-bottom: calc(104px + env(safe-area-inset-bottom));
  }
  #empTabConversations .employee-customer-header {
    min-height: 42px;
    padding: 0 0 7px;
    border-bottom: 1px solid var(--line);
  }
  #empTabConversations .employee-customer-header .employee-thread-back {
    min-height: 34px;
    margin-left: auto;
    font-size: 11px;
  }
  #empTabConversations .employee-customer-profile {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    align-items: center;
    justify-items: stretch;
    column-gap: 12px;
    row-gap: 1px;
    padding: 13px 0 12px;
    text-align: left;
  }
  #empTabConversations .employee-customer-profile .conversation-avatar-lg {
    grid-row: 1 / span 3;
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
    margin: 0;
    font-size: 14px;
  }
  #empTabConversations .employee-customer-profile h3 {
    overflow: hidden;
    margin: 0;
    color: var(--text);
    font-size: 16px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #empTabConversations .employee-customer-profile p {
    overflow-wrap: anywhere;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.3;
  }
  #empTabConversations .employee-customer-profile small {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.25;
  }
  #empTabConversations .employee-customer-facts {
    display: grid;
    grid-template-columns: 1fr;
    margin: 0;
    border: 0;
    border-top: 1px solid var(--line);
  }
  #empTabConversations .employee-customer-facts > div {
    display: grid;
    grid-template-columns: minmax(104px, .88fr) minmax(0, 1.12fr);
    align-items: baseline;
    gap: 12px;
    min-height: 42px;
    padding: 9px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
  }
  #empTabConversations .employee-customer-facts dt {
    margin: 0;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.25;
    letter-spacing: .06em;
  }
  #empTabConversations .employee-customer-facts dd {
    overflow: visible;
    margin: 0;
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
    text-align: right;
    text-overflow: clip;
    white-space: normal;
  }
  #empTabConversations .employee-conversation-stream {
    gap: 10px;
    padding-top: 11px;
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
    scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }
  #empTabConversations .employee-conversation-message {
    max-width: 90%;
    padding: 9px 10px 7px;
    border-radius: 9px;
  }
  #empTabConversations .employee-conversation-message > div {
    font-size: 12px;
    line-height: 1.45;
  }
  #empTabConversations .employee-conversation-message p { margin-bottom: 5px; }
  #empTabConversations .employee-conversation-media { max-width: 100%; max-height: 300px; }
  #empTabConversations .employee-conversation-attachment { min-width: 0; max-width: 100%; }
}

/* The Knowledge preview is a reading surface in light mode. Earlier dark
   console rules used a hard-coded pale response color, so explicitly restore
   dark ink for every rendered response part. */
html[data-theme="light"] #empTabKnowledge .test-conversation-area,
html[data-theme="light"] #empTabKnowledge .test-message-content,
html[data-theme="light"] #empTabKnowledge .test-message-content h1,
html[data-theme="light"] #empTabKnowledge .test-message-content h2,
html[data-theme="light"] #empTabKnowledge .test-message-content h3,
html[data-theme="light"] #empTabKnowledge .test-message-content li,
html[data-theme="light"] #empTabKnowledge .test-message-content strong {
  color: #171c15 !important;
}
html[data-theme="light"] #empTabKnowledge .test-message-header { color: #56604f !important; }
html[data-theme="light"] #empTabKnowledge .test-message-content blockquote { color: #465044 !important; }
html[data-theme="light"] #empTabKnowledge .test-message-content code {
  color: #20281d !important;
  background: #edf1e8 !important;
}
html[data-theme="light"] #empTabKnowledge .test-message-content pre {
  color: #161d14 !important;
  border-color: #cbd3c4 !important;
  background: #f0f4ec !important;
}

/* Settings is an operational control panel, not a stack of marketing cards.
   These endpoint rules deliberately stay scoped to its workspace so legacy
   editor and dashboard controls retain their existing geometry. */
#empTabSettings .employee-settings-card,
#empTabSettings .employee-danger-zone { border-radius: 14px; }
#empTabSettings .employee-settings-heading { margin-bottom: 14px; }
#empTabSettings .employee-settings-heading h3,
#empTabSettings .employee-danger-zone h3 { font-size: 15px; }
#empTabSettings .employee-profile-settings-grid { grid-template-columns: 138px minmax(0, 1fr); gap: 18px; }
#empTabSettings .employee-avatar-setting-row { gap: 9px; }
#empTabSettings .employee-settings-avatar { width: 54px; height: 54px; flex-basis: 54px; }
#empTabSettings .employee-avatar-setting-row .btn-secondary { min-height: 32px; padding: 6px 11px; font-size: 11px; }
#empTabSettings .employee-settings-preferences-grid { gap: 11px; }
#empTabSettings .employee-alerts-grid { gap: 6px; }
#empTabSettings .employee-alert-option { min-height: 54px; padding: 8px 10px; }
#empTabSettings .employee-alert-option:hover { transform: none; }
#empTabSettings .employee-lifecycle-actions { gap: 7px; }
#empTabSettings .employee-lifecycle-actions .btn-secondary { min-height: 35px; }
#empTabSettings .employee-settings-details > div { min-height: 34px; }
#empTabSettings .employee-danger-action { padding: 9px 10px; }

/* Confirmed avatar crop. It uses an image inside a clipped square stage with a
   circular guide; the export is square so every existing avatar surface can
   continue to render it as a circle. */
.employee-avatar-crop-overlay { z-index: 2147483647 !important; place-items: center; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }
.employee-avatar-crop-dialog { width: min(420px, 100%); padding: 18px; border: 1px solid color-mix(in srgb, var(--line) 88%, #fff); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: 0 24px 70px rgba(0,0,0,.34); }
.employee-avatar-crop-header { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.employee-avatar-crop-header .panel-kicker { margin: 0 0 4px; color: var(--console-accent); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.employee-avatar-crop-header h2 { margin: 0; font-size: 19px; letter-spacing: -.025em; }
.employee-avatar-crop-header p:not(.panel-kicker) { max-width: 275px; margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.employee-avatar-crop-close { display: grid; width: 30px; height: 30px; flex: 0 0 30px; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); font-size: 21px; line-height: 1; cursor: pointer; }
.employee-avatar-crop-close:hover,
.employee-avatar-crop-close:focus-visible { border-color: var(--console-accent); color: var(--text); outline: 0; }
.employee-avatar-crop-stage { position: relative; width: min(248px, 70vw); aspect-ratio: 1; margin: 20px auto 16px; overflow: hidden; border-radius: 50%; background: color-mix(in srgb, var(--text) 8%, var(--surface)); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.employee-avatar-crop-stage:active { cursor: grabbing; }
.employee-avatar-crop-stage img { position: absolute; max-width: none; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.employee-avatar-crop-stage img:not([src]) { display: none; }
.employee-avatar-crop-guide { position: absolute; inset: 0; border: 1px solid rgba(255,255,255,.92); border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); pointer-events: none; }
.employee-avatar-crop-zoom { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; align-items: center; color: var(--muted); font-size: 11px; font-weight: 650; }
.employee-avatar-crop-zoom input { width: 100%; accent-color: var(--console-accent); }
.employee-avatar-crop-status { min-height: 16px; margin: 10px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.employee-avatar-crop-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.employee-avatar-crop-actions .btn-secondary,
.employee-avatar-crop-actions .cta { min-height: 36px; padding: 7px 13px; font-size: 12px; }
body.employee-avatar-crop-open .mobile-bottom-nav,
body.employee-avatar-crop-open .mobile-topbar,
body.employee-avatar-crop-open .mobile-account-sheet { display: none !important; }
html[data-theme="light"] .employee-avatar-crop-dialog { background: #fbfbf8; border-color: #d8dad1; box-shadow: 0 24px 70px rgba(37,42,31,.18); }
html[data-theme="light"] .employee-avatar-crop-stage { background: #e7e9e3; }
@media (max-width: 760px) {
  #empTabSettings .employee-settings-card, #empTabSettings .employee-danger-zone { padding: 15px; }
  #empTabSettings .employee-profile-settings-grid { grid-template-columns: 1fr; gap: 14px; }
  /* The Change control belongs beside the avatar, never inside a 58px column.
     Keep its file guidance below the entire row so narrow iPhones cannot
     collide or clip either control. */
  #empTabSettings .employee-avatar-setting { display: block; min-width: 0; }
  #empTabSettings .employee-avatar-setting-row { display: flex; width: 100%; margin-top: 7px; }
  #empTabSettings .employee-avatar-setting small { margin: 7px 0 0; font-size: 10px; }
  #empTabSettings .employee-settings-save-row { justify-content: stretch; }
  #empTabSettings .employee-settings-save-row .cta,
  #empTabSettings .employee-settings-save-row .btn-secondary { width: 100%; }
  .employee-avatar-crop-dialog { padding: 16px; border-radius: 16px; }
  .employee-avatar-crop-stage { width: min(248px, 72vw); margin-top: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .employee-avatar-crop-overlay *, .employee-avatar-crop-dialog * { transition-duration: 0s !important; animation-duration: 0s !important; }
}

/* Dashboard summaries are intentionally lightweight, so a brief check gets a
   neutral motion cue from the canonical semantic status map above. */
.workforce-status-checking::before {
  animation: tensor-status-check 1.1s ease-in-out infinite;
  box-shadow: none !important;
}
@keyframes tensor-status-check {
  0%, 100% { opacity: .42; transform: scale(.82); }
  50% { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .workforce-status-checking::before { animation: none; }
}

/* AI Chat route — final cascade owner. Earlier drawer styling intentionally
   remains for the compact mobile assistant, but must not leak into desktop
   pages or compete with the dedicated three-column chat composition. */
@media (min-width: 681px) {
  body.app-page { --ai-sidebar-track: 0px !important; grid-template-columns: var(--app-sidebar-track) minmax(0, 1fr) !important; }
  body:not(.ai-chat-route) .copilot-drawer { display: none !important; }
  body:not(.ai-chat-route) .copilot-launcher, body:not(.ai-chat-route) .copilot-scrim { display: none !important; }
  body.ai-chat-route .app-main { padding: 0 !important; overflow: hidden !important; }
  body.ai-chat-route #page-ai-chat, body.ai-chat-route .ai-chat-mount { display: block !important; width: 100%; height: 100%; min-height: 0; }
  body.ai-chat-route .copilot-drawer,
  body.ai-chat-route .copilot-drawer.is-open { position: static !important; display: grid !important; grid-template-columns: 276px minmax(0, 1fr) !important; width: 100% !important; height: 100% !important; min-height: 0 !important; inset: auto !important; transform: none !important; visibility: visible !important; border: 0 !important; border-radius: 0 !important; background: var(--bg) !important; box-shadow: none !important; }
  body.ai-chat-route .copilot-history-drawer,
  body.ai-chat-route .copilot-history-drawer.is-open { position: static !important; display: flex !important; grid-column: 1 !important; grid-row: 1 !important; width: auto !important; min-width: 0 !important; height: auto !important; max-height: none !important; inset: auto !important; transform: none !important; visibility: visible !important; border: 0 !important; border-right: 1px solid var(--line) !important; border-radius: 0 !important; background: var(--surface) !important; box-shadow: none !important; opacity: 1 !important; }
  body.ai-chat-route .copilot-panel-content { position: static !important; display: flex !important; grid-column: 2 !important; grid-row: 1 !important; min-width: 0 !important; min-height: 0 !important; inset: auto !important; padding: 26px clamp(28px, 5vw, 76px) 22px !important; transform: none !important; background: var(--bg) !important; }
  body.ai-chat-route .copilot-control-rail, body.ai-chat-route .copilot-resize-handle, body.ai-chat-route .copilot-header-close { display: none !important; }
  body.ai-chat-route .copilot-history-body { min-height: 0 !important; }
  body.ai-chat-route .copilot-messages { width: min(900px, 100%) !important; max-width: 900px !important; margin-inline: auto !important; }
  body.ai-chat-route .copilot-header, body.ai-chat-route .copilot-composer { width: min(900px, 100%) !important; margin-inline: auto !important; }
}
@media (min-width: 681px) and (max-width: 1120px) {
  body.ai-chat-route .copilot-drawer, body.ai-chat-route .copilot-drawer.is-open { grid-template-columns: minmax(0, 1fr) !important; }
  body.ai-chat-route .copilot-history-drawer, body.ai-chat-route .copilot-history-drawer.is-open { display: none !important; }
  body.ai-chat-route .copilot-panel-content { grid-column: 1 !important; }
}

/* Final route state owner: this deliberately follows the legacy drawer rules
   above so those rules cannot reserve a hidden History column. */
@media (min-width: 681px) {
  body.ai-chat-route .copilot-drawer,
  body.ai-chat-route .copilot-drawer.is-open {
    grid-template-columns: 0 minmax(0, 1fr) !important;
    overflow: hidden !important;
    transition: grid-template-columns 250ms cubic-bezier(.22, .61, .36, 1) !important;
  }
  body.ai-chat-route.ai-chat-history-open .copilot-drawer,
  body.ai-chat-route.ai-chat-history-open .copilot-drawer.is-open { grid-template-columns: clamp(276px, 19vw, 300px) minmax(0, 1fr) !important; }
  body.ai-chat-route .copilot-history-drawer,
  body.ai-chat-route .copilot-history-drawer.is-open {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    overflow: hidden !important;
    visibility: hidden !important;
    opacity: 0 !important;
    transform: translateX(-18px) !important;
    pointer-events: none !important;
    transition: transform 250ms cubic-bezier(.22, .61, .36, 1), opacity 180ms ease, visibility 0s linear 250ms !important;
  }
  body.ai-chat-route.ai-chat-history-open .copilot-history-drawer,
  body.ai-chat-route.ai-chat-history-open .copilot-history-drawer.is-open {
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateX(0) !important;
    pointer-events: auto !important;
    transition-delay: 0s !important;
  }
  body.ai-chat-route .copilot-panel-content {
    grid-column: 2 !important;
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
    padding: 20px clamp(24px, 4vw, 72px) 18px !important;
  }
  body.ai-chat-route .copilot-header { display: flex !important; flex: 0 0 auto !important; min-height: 48px !important; padding: 0 0 12px !important; }
  body.ai-chat-route .copilot-header-copy,
  body.ai-chat-route .copilot-header-copy h2,
  body.ai-chat-route .copilot-header-actions,
  body.ai-chat-route #copilotHistoryToggle { display: flex !important; visibility: visible !important; }
  body.ai-chat-route .copilot-header-copy { align-items: center !important; }
  body.ai-chat-route .copilot-header-copy h2 { font: 500 25px/1.1 Georgia, serif !important; }
  body.ai-chat-route .copilot-runtime-state { display: none !important; }
  body.ai-chat-route .copilot-header-actions { position: static !important; margin-left: auto !important; gap: 6px !important; }
  body.ai-chat-route .copilot-header-icon { display: grid !important; width: 32px !important; height: 32px !important; }
  body.ai-chat-route .copilot-header-close { display: none !important; }
  body.ai-chat-route .copilot-messages { flex: 1 1 auto !important; min-height: 0 !important; overflow-y: auto !important; }
  body.ai-chat-route .copilot-composer { position: relative !important; flex: 0 0 auto !important; width: min(920px, 100%) !important; max-width: 920px !important; margin: 0 auto !important; padding: 12px 0 max(6px, env(safe-area-inset-bottom)) !important; }
  body.ai-chat-route .copilot-history-drawer-head { display: flex !important; align-items: center !important; min-height: 64px !important; padding: 16px 16px 10px !important; }
  body.ai-chat-route .copilot-history-drawer-head h2 { font: 650 18px/1.1 Inter, sans-serif !important; }
  body.ai-chat-route .copilot-history-drawer-head small,
  body.ai-chat-route .copilot-history-close { display: none !important; }
  body.ai-chat-route .copilot-history-drawer-actions { margin-left: auto !important; }
  body.ai-chat-route .copilot-history-search { display: grid !important; width: 30px; height: 30px; place-items: center; padding: 0; border: 0; color: var(--muted); background: transparent; opacity: .58; }
  body.ai-chat-route .copilot-history-search svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
  body.ai-chat-route .copilot-history-new { display: flex !important; align-items: center; gap: 8px; width: calc(100% - 20px); min-height: 38px; margin: 0 10px 8px; padding: 0 9px; border: 0; border-radius: 8px; color: var(--text); background: transparent; font-size: 13px; font-weight: 500; text-align: left; }
  body.ai-chat-route .copilot-history-new:hover,
  body.ai-chat-route .copilot-history-new:focus-visible { background: color-mix(in srgb, var(--text) 7%, transparent); }
  body.ai-chat-route .copilot-history-new span { color: var(--muted); font-size: 18px; }
  body.ai-chat-route .copilot-history-body { display: flex !important; flex: 1 1 auto !important; min-height: 0 !important; padding: 8px 10px 14px !important; overflow: hidden !important; }
  body.ai-chat-route .copilot-history-list { flex: 1 1 auto !important; min-height: 0 !important; overflow-y: auto !important; gap: 2px !important; }
  body.ai-chat-route .copilot-history-group { margin: 15px 8px 6px; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .02em; }
  body.ai-chat-route .copilot-history-group:first-child { margin-top: 4px; }
  body.ai-chat-route .copilot-history-item { grid-template-columns: minmax(0, 1fr) 26px !important; min-height: 40px; border-radius: 8px !important; }
  body.ai-chat-route .copilot-history-open { display: flex !important; min-width: 0 !important; min-height: 40px; padding: 0 5px 0 10px !important; }
  body.ai-chat-route .copilot-history-open strong { overflow: hidden; color: var(--text); font-size: 13px !important; font-weight: 500 !important; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
  body.ai-chat-route .copilot-history-open small,
  body.ai-chat-route .copilot-history-active { display: none !important; }
  body.ai-chat-route .copilot-history-more { opacity: 0 !important; }
  body.ai-chat-route .copilot-history-item:hover .copilot-history-more,
  body.ai-chat-route .copilot-history-item:focus-within .copilot-history-more { opacity: .8 !important; }
}
@media (min-width: 681px) and (max-width: 1120px) {
  body.ai-chat-route .copilot-drawer,
  body.ai-chat-route.ai-chat-history-open .copilot-drawer { grid-template-columns: minmax(0, 1fr) !important; }
  body.ai-chat-route .copilot-history-drawer { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  body.ai-chat-route .copilot-drawer,
  body.ai-chat-route .copilot-history-drawer { transition-duration: 0s !important; }
}

/* AI Chat history column: final layout owner. The column is a fixed grid track
   with a fixed-height header stack. Search sits directly under the header and
   only the conversation list scrolls, so showing, typing in or clearing the
   search can never resize the drawer, the grid row or the chat beside it. */
@media (min-width: 681px) {
  body.ai-chat-route .copilot-drawer { grid-template-rows: minmax(0, 1fr) !important; }
  body.ai-chat-route .copilot-history-drawer,
  body.ai-chat-route .copilot-history-drawer.is-open {
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    contain: layout paint;
  }
  body.ai-chat-route .copilot-history-drawer-head,
  body.ai-chat-route .copilot-history-new { flex: 0 0 auto !important; }
  body.ai-chat-route .copilot-history-search-field {
    box-sizing: border-box !important;
    flex: 0 0 auto !important;
    grid-template-columns: minmax(0, 1fr) 28px !important;
    gap: 4px !important;
    width: auto !important;
    height: 40px !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 12px 10px !important;
    padding: 0 6px 0 12px !important;
    border: 1px solid var(--line) !important;
    border-radius: 12px !important;
    background: var(--card, var(--surface)) !important;
    box-shadow: none !important;
    overflow: hidden;
  }
  body.ai-chat-route .copilot-history-search-field[hidden] { display: none !important; }
  body.ai-chat-route .copilot-history-search-field:focus-within {
    border-color: color-mix(in srgb, var(--accent) 48%, var(--line)) !important;
  }
  body.ai-chat-route .copilot-history-search-field input {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    color: var(--text) !important;
    font: 13px/1 Inter, sans-serif !important;
  }
  body.ai-chat-route .copilot-history-search-field input:focus,
  body.ai-chat-route .copilot-history-search-field input:focus-visible { outline: 0 !important; box-shadow: none !important; }
  body.ai-chat-route .copilot-history-search-field button { width: 28px !important; height: 28px !important; flex: 0 0 28px; }
  body.ai-chat-route .copilot-history-body {
    display: flex !important;
    flex: 1 1 0 !important;
    flex-direction: column !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
  body.ai-chat-route .copilot-history-state { flex: 0 0 auto; }
  body.ai-chat-route .copilot-history-list {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
  }
  /* A list is busy only on the first, uncached open. It stays clickable so a
     rapid switch to another conversation is never swallowed. */
  body.ai-chat-route .copilot-history-list[aria-busy="true"] { pointer-events: auto !important; }
}

/* Idrok history follows the Superclerk list rhythm: regular-weight one-line
   titles, quiet sentence-case section labels, and a soft active row. It is the
   final owner of these rules, so earlier responsive layers cannot drift it. */
body.ai-chat-route .copilot-history-group { margin: 22px 10px 6px; padding: 0; color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; }
body.ai-chat-route .copilot-history-group:first-child { margin-top: 6px; }
body.ai-chat-route .copilot-history-item { min-height: 38px; border-radius: 9px !important; }
body.ai-chat-route .copilot-history-open { min-height: 38px; padding: 0 8px 0 11px !important; }
body.ai-chat-route .copilot-history-open strong { color: var(--text); font-size: 14px !important; font-weight: 400 !important; line-height: 1.3; }

/* Idrok response hierarchy: conversation stays spacious, normal questions get
   one transient thinking cue, and workspace work leaves a readable audit trail. */
body.ai-chat-route .copilot-message.assistant:not(.copilot-execution-panel) {
  align-self: flex-start;
  width: min(100%, 720px);
  max-width: 100%;
  padding: 3px 0 12px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--text);
  font-size: 15px !important;
  line-height: 1.6 !important;
  box-shadow: none !important;
}
body.ai-chat-route .copilot-message.user {
  width: auto;
  max-width: min(78%, 620px);
  padding: 10px 13px !important;
  border: 1px solid color-mix(in srgb, var(--console-accent) 24%, var(--line)) !important;
  border-radius: 14px 14px 4px 14px !important;
  background: color-mix(in srgb, var(--console-accent-soft) 70%, var(--surface)) !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
}
body.ai-chat-route .copilot-message.assistant.copilot-execution-panel {
  width: min(100%, 720px);
  margin: 8px 0 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
}
/* Plain chat is intentionally represented by a single unobtrusive animation. */
body.ai-chat-route .copilot-execution-panel.is-ephemeral {
  width: auto;
  margin: 5px 0 9px;
  padding: 1px 0;
  border: 0;
  background: transparent;
}
body.ai-chat-route .copilot-execution-panel.is-ephemeral .copilot-execution-identity,
body.ai-chat-route .copilot-execution-panel.is-ephemeral .copilot-execution-elapsed,
body.ai-chat-route .copilot-execution-panel.is-ephemeral .copilot-execution-steps { display: none; }
body.ai-chat-route .copilot-execution-panel.is-ephemeral .copilot-execution-heading { gap: 7px; color: var(--muted); font-size: 12px; }
body.ai-chat-route .copilot-execution-panel.is-ephemeral .copilot-activity-mark {
  width: 7px; height: 7px; border-radius: 50%; background: var(--console-accent);
  animation: idrokThinkingPulse 1.15s ease-in-out infinite;
}
body.ai-chat-route .copilot-execution-panel.is-ephemeral .copilot-execution-title { color: var(--muted); }
@keyframes idrokThinkingPulse { 0%, 100% { opacity: .35; transform: scale(.72); } 50% { opacity: 1; transform: scale(1); } }

body.ai-chat-route .copilot-execution-panel.is-operational .copilot-execution-title { color: var(--text); font-weight: 620; }
body.ai-chat-route .copilot-execution-panel.is-operational .copilot-execution-steps { margin-left: 2px; padding-left: 2px; border-left: 1px solid color-mix(in srgb, var(--line) 82%, transparent); }
body.ai-chat-route .copilot-execution-panel.is-operational .copilot-execution-steps li { padding-left: 16px; }

body.ai-chat-route .copilot-action-review {
  width: min(100%, 720px);
  margin: 10px 0 14px;
  padding: 18px;
  border-radius: 14px;
  border-color: color-mix(in srgb, var(--text) 14%, var(--line));
  background: var(--surface);
}
body.ai-chat-route .copilot-action-review-head { gap: 10px; }
body.ai-chat-route .copilot-action-review-icon { width: 30px; height: 30px; border-radius: 8px; color: var(--console-accent); background: var(--console-accent-soft); }
body.ai-chat-route .copilot-action-review h3 { font-size: 15px; font-weight: 680; }
body.ai-chat-route .copilot-action-review-badge { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
body.ai-chat-route .copilot-action-review-objective { margin-top: 15px; padding: 11px 12px; border-radius: 9px; background: color-mix(in srgb, var(--text) 3%, transparent); font-size: 13px; }
body.ai-chat-route .copilot-action-review-label { margin-top: 15px; }
body.ai-chat-route .copilot-action-review-effects { font-size: 13px; }
body.ai-chat-route .copilot-action-review-safety { margin: 13px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.45; }
body.ai-chat-route .copilot-action-review-details { margin-top: 13px; }
body.ai-chat-route .copilot-action-review-actions { gap: 9px; margin-top: 16px; }
body.ai-chat-route .copilot-action-review-actions button { min-height: 38px; padding: 0 15px; border-radius: 999px; font-size: 13px; }
body.ai-chat-route .copilot-action-review-actions button[data-confirmed="true"] { background: var(--text); color: var(--bg); }
@media (max-width: 680px) {
  body.ai-chat-route .copilot-message.assistant:not(.copilot-execution-panel),
  body.ai-chat-route .copilot-message.assistant.copilot-execution-panel,
  body.ai-chat-route .copilot-action-review { width: 100%; }
  body.ai-chat-route .copilot-action-review { padding: 14px; }
  body.ai-chat-route .copilot-action-review-badge { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { body.ai-chat-route .copilot-execution-panel.is-ephemeral .copilot-activity-mark { animation: none; } }

/* Conversation activity follows the message itself, without a status card. */
body.ai-chat-route .copilot-message.assistant.copilot-execution-panel.is-operational {
  width: 100%; margin: 14px 0 5px; padding: 0; border: 0; border-radius: 0;
  background: transparent; box-shadow: none;
}
body.ai-chat-route .copilot-execution-identity-line { margin-bottom: 17px; }
body.ai-chat-route .copilot-execution-identity { gap: 9px; color: var(--muted); font-size: 14px; font-weight: 500; }
body.ai-chat-route .copilot-execution-idrok-mark { width: 24px; height: 24px; color: var(--text); }
body.ai-chat-route .copilot-execution-heading { gap: 9px; color: var(--muted); font-size: 13px; }
body.ai-chat-route .copilot-execution-panel.is-operational .copilot-execution-title { color: var(--muted); font-weight: 400; }
body.ai-chat-route .copilot-execution-panel.is-operational .copilot-activity-mark,
body.ai-chat-route .copilot-execution-panel.is-operational .copilot-execution-elapsed { display: none; }
body.ai-chat-route .copilot-execution-chevron { order: -1; margin: 0 2px 3px; transform: rotate(45deg); }
body.ai-chat-route .copilot-execution-details[open] > summary .copilot-execution-chevron { transform: rotate(45deg); }
body.ai-chat-route .copilot-execution-details:not([open]) > summary .copilot-execution-chevron { transform: rotate(-45deg); }
body.ai-chat-route .copilot-message.assistant.copilot-execution-panel.is-operational .copilot-execution-steps {
  gap: 10px; margin: 13px 0 0 5px; padding: 0 0 0 16px; border-left: 1px solid var(--line); font-size: 13px;
}
body.ai-chat-route .copilot-message.assistant.copilot-execution-panel.is-operational .copilot-execution-steps li { padding-left: 8px; }
body.ai-chat-route .copilot-execution-panel.is-ephemeral .copilot-execution-identity-line,
body.ai-chat-route .copilot-execution-panel.is-ephemeral .copilot-execution-chevron { display: none; }
body.ai-chat-route .copilot-form.is-busy #copilotStatus,
body.ai-chat-route .copilot-composer.is-busy #copilotStatus { display: none; }
body.ai-chat-route .copilot-message.assistant.is-streaming:empty { display: none; }
body.ai-chat-route .copilot-message.assistant.is-streaming:has(.copilot-generation-state),
body.ai-chat-route .copilot-execution-panel.is-ephemeral.has-response { display: none !important; }
body.ai-chat-route .copilot-action-review { width: 100%; background: transparent; }
body.ai-chat-route .copilot-action-review-fields { gap: 12px; margin: 19px 0 0; }
body.ai-chat-route .copilot-action-review-fields > div { grid-template-columns: minmax(90px, 130px) minmax(0, 1fr); gap: 12px; }
body.ai-chat-route .copilot-action-review-fields dt,
body.ai-chat-route .copilot-action-review-fields dd { font-size: 13px; line-height: 1.5; }
body.ai-chat-route .copilot-action-review-safety { padding: 0; border: 0; }

/* A moving highlight makes active work visible without inventing steps. */
body.ai-chat-route .copilot-execution-panel[data-execution-state="running"] .copilot-execution-title {
  background: linear-gradient(100deg, var(--muted) 20%, var(--text) 48%, var(--muted) 76%);
  background-size: 220% 100%;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: idrok-working-shimmer 1.6s ease-in-out infinite;
}
body.ai-chat-route .copilot-execution-panel.is-operational[data-execution-state="running"] .copilot-execution-title { color: transparent; }
body.ai-chat-route .copilot-execution-panel[data-execution-state="running"] .copilot-execution-steps .is-pending::before {
  animation: idrokThinkingPulse 1.15s ease-in-out infinite;
}
@keyframes idrok-working-shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }

/* The stop control remains a single square inside the send button's circle. */
html body.ai-chat-route .copilot-composer.is-busy .copilot-send,
html body.ai-chat-route .copilot-composer.is-busy .copilot-send:hover,
html body.ai-chat-route .copilot-composer.is-busy .copilot-send:focus-visible {
  width: 34px !important; height: 34px !important; flex-basis: 34px !important;
  border-radius: 50% !important; color: var(--bg) !important; background: var(--text) !important;
}
html body.ai-chat-route .copilot-composer.is-busy .copilot-send::after { display: none !important; content: none !important; animation: none !important; }
html body.ai-chat-route .copilot-composer.is-busy .copilot-send .copilot-stop-icon { display: block; width: 20px; height: 20px; fill: currentColor; stroke: none; }
@media (prefers-reduced-motion: reduce) {
  body.ai-chat-route .copilot-execution-panel[data-execution-state="running"] .copilot-execution-title { animation: none; color: var(--muted); background: none; }
  body.ai-chat-route .copilot-execution-panel.is-operational[data-execution-state="running"] .copilot-execution-title { color: var(--muted); }
  body.ai-chat-route .copilot-execution-panel[data-execution-state="running"] .copilot-execution-steps .is-pending::before { animation: none; }
}

/* Approval review follows the same column and rhythm as the answer. */
body.ai-chat-route .copilot-action-review {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 6px 0 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: transparent;
}
body.ai-chat-route .copilot-action-review-head { align-items: center; gap: 10px; }
body.ai-chat-route .copilot-action-review-icon { width: 26px; height: 26px; background: transparent; }
body.ai-chat-route .copilot-action-review h3 { font-size: 16px; }
body.ai-chat-route .copilot-action-review-fields { gap: 12px; margin-top: 19px; }
body.ai-chat-route .copilot-action-review-fields dt { text-transform: none; }
body.ai-chat-route .copilot-action-review-safety { margin-top: 16px; }
body.ai-chat-route .copilot-action-draft-content { margin-top: 15px; color: var(--text); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
body.ai-chat-route .copilot-action-draft-content p { margin: 0 0 10px; }
body.ai-chat-route .copilot-action-draft-content > :last-child { margin-bottom: 0; }
body.ai-chat-route .copilot-action-review-actions { margin-top: 18px; }
body.ai-chat-route .copilot-action-review-actions button { min-height: 40px; padding-inline: 18px; }
body.ai-chat-route .copilot-message.assistant:not(.copilot-execution-panel) { width: 100%; }
@media (max-width: 680px) {
  body.ai-chat-route .copilot-action-review { padding: 15px; }
  body.ai-chat-route .copilot-action-review-head { flex-wrap: wrap; }
  body.ai-chat-route .copilot-action-review-badge { white-space: normal; }
  body.ai-chat-route .copilot-action-review-fields > div { grid-template-columns: minmax(72px, 100px) minmax(0, 1fr); }
}

body.ai-chat-route .copilot-execution-step-data { flex: 0 0 100%; padding-left: 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
body.ai-chat-route .has-integration .copilot-execution-step-data { padding-left: 26px; }
body.ai-chat-route .copilot-execution-step-data summary { cursor: pointer; }
body.ai-chat-route .copilot-execution-step-data p { margin: 6px 0 0; white-space: pre-wrap; }
body.ai-chat-route .copilot-employee-choice-label { margin: 16px 0 4px; color: var(--muted); font-size: 12px; }
body.ai-chat-route .copilot-employee-choice-request { margin: 0; color: var(--text); font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
body.ai-chat-route .copilot-employee-choice-question { margin: 16px 0 8px; color: var(--text); font-size: 14px; }
body.ai-chat-route .copilot-employee-choice-options { display: flex; flex-wrap: wrap; gap: 8px; }
body.ai-chat-route .copilot-employee-choice-options button { display: grid; gap: 3px; max-width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: var(--surface); text-align: left; cursor: pointer; }
body.ai-chat-route .copilot-employee-choice-options button:hover { border-color: var(--console-accent); }
body.ai-chat-route .copilot-employee-choice-options button:focus-visible { outline: 2px solid var(--console-accent); outline-offset: 2px; }
body.ai-chat-route .copilot-employee-choice-options strong { font-size: 13px; }
body.ai-chat-route .copilot-employee-choice-options small { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }

/* Compact in-conversation activity and review surfaces. */
body.ai-chat-route .copilot-action-review { width: min(100%, 560px); padding: 14px 16px; margin: 4px 0 12px; }
body.ai-chat-route .copilot-action-review h3 { font-size: 14px; }
body.ai-chat-route .copilot-action-review-fields { gap: 7px; margin-top: 12px; }
body.ai-chat-route .copilot-action-review-fields dt, body.ai-chat-route .copilot-action-review-fields dd { font-size: 12px; }
body.ai-chat-route .copilot-action-review-safety { margin-top: 12px; }
body.ai-chat-route .copilot-action-review-actions { margin-top: 12px; }
body.ai-chat-route .copilot-action-review-actions button { min-height: 34px; }
body.ai-chat-route .copilot-action-review:not([data-state="proposed"]):not(.copilot-employee-choice) .copilot-action-review-fields { display: none; }
body.ai-chat-route .copilot-employee-choice-options { display: grid; gap: 6px; max-width: 280px; }
body.ai-chat-route .copilot-employee-choice-options input,
body.ai-chat-route .copilot-employee-choice-options select { width: 100%; min-height: 34px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: var(--surface); font: inherit; font-size: 12px; }
body.ai-chat-route .copilot-execution-panel[data-execution-state="running"] .copilot-execution-steps li.is-pending::before { animation: idrokThinkingPulse 1.15s ease-in-out infinite; }
body.ai-chat-route .copilot-execution-steps li.is-complete::before { content: "✓"; top: 0; width: auto; height: auto; border: 0; background: transparent; color: var(--console-accent); font-size: 12px; }
@media (prefers-reduced-motion: reduce) { body.ai-chat-route .copilot-execution-steps li.is-pending::before { animation: none; } }

/* In-conversation approval: neutral surfaces and the same rhythm as the reply. */
body.ai-chat-route .copilot-action-review,
body.ai-chat-route .copilot-hiring-review {
  display: block; box-sizing: border-box; align-self: flex-start;
  width: 100%; max-width: 100%; margin: 6px 0 18px; padding: 20px;
  border: 1px solid var(--line); border-radius: 14px;
  background: #1b1b1b; color: var(--text); box-shadow: none; animation: none;
}
html[data-theme="light"] body.ai-chat-route .copilot-action-review,
html[data-theme="light"] body.ai-chat-route .copilot-hiring-review { background: #fff; border-color: #e4e4e4; }
body.ai-chat-route .copilot-hiring-review-copy { display: flex; align-items: center; gap: 10px; min-width: 0; }
body.ai-chat-route .copilot-hiring-review-copy .copilot-execution-idrok-mark { flex: none; width: 26px; height: 26px; }
body.ai-chat-route .copilot-hiring-review h3, body.ai-chat-route .copilot-action-review h3 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.35; }
body.ai-chat-route .copilot-hiring-review-eyebrow, body.ai-chat-route .copilot-action-review-badge {
  margin: 0 0 0 auto; color: var(--muted); font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none; text-align: right;
}
body.ai-chat-route .copilot-hiring-review-details, body.ai-chat-route .copilot-action-review-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 18px 0 0; }
body.ai-chat-route .copilot-hiring-review-details > div, body.ai-chat-route .copilot-action-review-fields > div { display: grid; grid-template-columns: minmax(90px, 130px) minmax(0, 1fr); gap: 12px; }
body.ai-chat-route .copilot-hiring-review-details dt, body.ai-chat-route .copilot-action-review-fields dt { color: var(--muted); font-size: 13px; line-height: 1.5; text-transform: none; }
body.ai-chat-route .copilot-hiring-review-details dd, body.ai-chat-route .copilot-action-review-fields dd { min-width: 0; margin: 0; color: var(--text); font-size: 13px; font-weight: 400; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
body.ai-chat-route .copilot-hiring-review-status, body.ai-chat-route .copilot-action-review-safety { margin: 16px 0 0; padding: 0; border: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
body.ai-chat-route .copilot-hiring-review-actions, body.ai-chat-route .copilot-action-review-actions { display: flex; justify-content: flex-start; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
body.ai-chat-route .copilot-hiring-review-actions button, body.ai-chat-route .copilot-action-review-actions button { flex: 0 0 auto; min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 13px; }
body.ai-chat-route .copilot-hiring-review-actions button[data-copilot-hiring-confirm], body.ai-chat-route .copilot-action-review-actions button[data-confirmed="true"] { background: var(--text); color: var(--card); }
html[data-theme="light"] body.ai-chat-route .copilot-hiring-review-actions button[data-copilot-hiring-confirm], html[data-theme="light"] body.ai-chat-route .copilot-action-review-actions button[data-confirmed="true"] { background: #080808; color: #fff; }
body.ai-chat-route .copilot-action-review:not([data-state="proposed"]):not(.copilot-employee-choice) .copilot-action-review-fields { display: grid; }
@media (max-width: 680px) {
  body.ai-chat-route .copilot-action-review, body.ai-chat-route .copilot-hiring-review { padding: 16px; }
  body.ai-chat-route .copilot-hiring-review-copy, body.ai-chat-route .copilot-action-review-head { flex-wrap: wrap; }
  body.ai-chat-route .copilot-hiring-review-details > div, body.ai-chat-route .copilot-action-review-fields > div { grid-template-columns: minmax(75px, 100px) minmax(0, 1fr); gap: 10px; }
  body.ai-chat-route .copilot-hiring-review-actions button, body.ai-chat-route .copilot-action-review-actions button { min-height: 44px; }
}

.copilot-pending-approval { flex: 0 1 auto; min-height: 0; width: min(920px, 100%); max-height: min(40dvh, 360px); margin: 0 auto; overflow: auto; overscroll-behavior: contain; }
.copilot-pending-approval[hidden] { display: none !important; }
body.ai-chat-route .copilot-pending-approval .copilot-action-review { margin: 8px 0; }
.copilot-action-acknowledgement { align-self: flex-end; max-width: min(85%, 520px); margin: 10px 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px 14px 4px 14px; background: var(--surface); color: var(--text); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
html[data-theme="light"] .copilot-action-acknowledgement { background: #f7f7f7; border-color: #e4e4e4; color: #1c1c1c; }
.copilot-action-conversation-result { align-self: flex-start; margin: 8px 0 16px; color: var(--text); font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
@media (max-width: 680px) { .copilot-pending-approval { max-height: 35dvh; } }

/* Approval card: one calm frame, app logo, label/value rows, clear decision. */
body.ai-chat-route .copilot-action-review { padding: 18px 20px 18px; border-color: color-mix(in srgb, var(--text) 11%, var(--line)); box-shadow: 0 1px 2px color-mix(in srgb, #000 4%, transparent); }
body.ai-chat-route .copilot-action-review-icon.has-logo { width: 22px; height: 22px; border-radius: 0; background: transparent; }
body.ai-chat-route .copilot-action-review-icon.has-logo img { display: block; width: 20px; height: 20px; object-fit: contain; }
body.ai-chat-route .copilot-action-review h3 { font-size: 15.5px; font-weight: 620; letter-spacing: -.005em; }
body.ai-chat-route .copilot-action-review-badge { font-size: 13px; }
body.ai-chat-route .copilot-action-review[data-state="proposed"] .copilot-action-review-badge { color: color-mix(in srgb, var(--text) 62%, var(--muted)); }
body.ai-chat-route .copilot-action-review[data-state="failed"] .copilot-action-review-badge,
body.ai-chat-route .copilot-action-review[data-state="uncertain"] .copilot-action-review-badge { color: #b46f5d; }
body.ai-chat-route .copilot-action-review dl, body.ai-chat-route .copilot-action-review-fields { gap: 0; margin: 14px 0 0; }
body.ai-chat-route .copilot-action-review dl > div, body.ai-chat-route .copilot-action-review-fields > div { grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 6px 0; align-items: baseline; }
body.ai-chat-route .copilot-action-review dt, body.ai-chat-route .copilot-action-review-fields dt { color: var(--muted); font-size: 13.5px; line-height: 1.45; text-transform: none; }
body.ai-chat-route .copilot-action-review dd, body.ai-chat-route .copilot-action-review-fields dd { color: var(--text); font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
body.ai-chat-route .copilot-action-review-safety { margin: 12px 0 0; padding-top: 0; border-top: 0; font-size: 13px; }
body.ai-chat-route .copilot-action-review-actions { align-items: center; gap: 6px; margin-top: 16px; }
body.ai-chat-route .copilot-action-review-actions button { min-height: 38px; padding: 0 20px; font-size: 14px; font-weight: 560; transition: background-color .15s ease, color .15s ease, opacity .15s ease, transform .1s ease; }
body.ai-chat-route .copilot-action-review-actions button[data-confirmed="true"]:hover:not(:disabled) { opacity: .86; }
body.ai-chat-route .copilot-action-review-actions button:active:not(:disabled) { transform: scale(.98); }
body.ai-chat-route .copilot-action-review-actions button[data-confirmed="false"] { color: color-mix(in srgb, var(--text) 72%, var(--muted)); }
html:not([data-theme="light"]) body.ai-chat-route .copilot-action-review { border-color: color-mix(in srgb, var(--text) 9%, var(--line)); box-shadow: none; }
@media (max-width: 680px) {
  body.ai-chat-route .copilot-action-review { padding: 14px 15px; }
  body.ai-chat-route .copilot-action-review dl > div, body.ai-chat-route .copilot-action-review-fields > div { grid-template-columns: 1fr; gap: 1px; padding: 5px 0; }
  body.ai-chat-route .copilot-action-review dt, body.ai-chat-route .copilot-action-review-fields dt { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { body.ai-chat-route .copilot-action-review-actions button { transition: none; } }
/* Hiring approval uses the same card as action approvals. */
body.ai-chat-route .copilot-hiring-review { padding: 18px 20px; border-color: color-mix(in srgb, var(--text) 11%, var(--line)); box-shadow: 0 1px 2px color-mix(in srgb, #000 4%, transparent); }
html:not([data-theme="light"]) body.ai-chat-route .copilot-hiring-review { border-color: color-mix(in srgb, var(--text) 9%, var(--line)); box-shadow: none; }
body.ai-chat-route .copilot-hiring-review-copy .copilot-execution-idrok-mark { width: 22px; height: 22px; }
body.ai-chat-route .copilot-hiring-review h3 { font-size: 15.5px; font-weight: 620; letter-spacing: -.005em; }
body.ai-chat-route .copilot-hiring-review-eyebrow { font-size: 13px; }
body.ai-chat-route .copilot-hiring-review[data-state="proposed"] .copilot-hiring-review-eyebrow,
body.ai-chat-route .copilot-hiring-review[data-state="error"] .copilot-hiring-review-eyebrow { color: color-mix(in srgb, var(--text) 62%, var(--muted)); }
body.ai-chat-route .copilot-hiring-review-details { gap: 0; margin: 14px 0 0; }
body.ai-chat-route .copilot-hiring-review-details > div { grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 6px 0; align-items: baseline; }
body.ai-chat-route .copilot-hiring-review-details dt { font-size: 13.5px; line-height: 1.45; }
body.ai-chat-route .copilot-hiring-review-details dd { font-size: 14px; line-height: 1.5; }
body.ai-chat-route .copilot-hiring-review-status { margin: 12px 0 0; font-size: 13px; }
body.ai-chat-route .copilot-hiring-review-actions { align-items: center; gap: 6px; margin-top: 16px; }
body.ai-chat-route .copilot-hiring-review-actions button { min-height: 38px; padding: 0 20px; font-size: 14px; font-weight: 560; transition: background-color .15s ease, color .15s ease, opacity .15s ease, transform .1s ease; }
body.ai-chat-route .copilot-hiring-review-actions button[data-copilot-hiring-confirm]:hover:not(:disabled) { opacity: .86; }
body.ai-chat-route .copilot-hiring-review-actions button:active:not(:disabled) { transform: scale(.98); }
body.ai-chat-route .copilot-hiring-review-actions button[data-copilot-hiring-dismiss] { color: color-mix(in srgb, var(--text) 72%, var(--muted)); }
body.ai-chat-route .copilot-hiring-review-actions button[data-copilot-hiring-dismiss]:hover:not(:disabled) { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
body.ai-chat-route .copilot-pending-approval .copilot-hiring-review { margin: 8px 0; }
@media (max-width: 680px) {
  body.ai-chat-route .copilot-hiring-review { padding: 14px 15px; }
  body.ai-chat-route .copilot-hiring-review-details > div { grid-template-columns: 1fr; gap: 1px; padding: 5px 0; }
  body.ai-chat-route .copilot-hiring-review-details dt { font-size: 12px; }
}
/* Decision boxes: approvals with editable fields, and questions. */
body.ai-chat-route .copilot-decision-summary { margin: 10px 0 0; color: var(--text); font-size: 14px; line-height: 1.5; }
body.ai-chat-route .copilot-decision-question { margin: 12px 0 0; color: var(--text); font-size: 14.5px; font-weight: 560; line-height: 1.45; }
body.ai-chat-route .copilot-decision-context { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
body.ai-chat-route .copilot-decision-options { display: grid; gap: 6px; margin: 12px 0 0; }
body.ai-chat-route .copilot-decision-option { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; width: 100%; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--text) 12%, var(--line)); border-radius: 10px; background: transparent; color: var(--text); font: 500 14px/1.35 var(--font-sans, Inter, sans-serif); text-align: left; cursor: pointer; }
body.ai-chat-route .copilot-decision-option:hover:not(:disabled) { background: color-mix(in srgb, var(--text) 4%, transparent); }
body.ai-chat-route .copilot-decision-option[aria-checked="true"], body.ai-chat-route .copilot-decision-option[aria-pressed="true"] { border-color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
body.ai-chat-route .copilot-decision-option:disabled { cursor: default; opacity: .75; }
body.ai-chat-route .copilot-decision-recommended { color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; }
body.ai-chat-route .copilot-decision-option-description { grid-column: 1 / -1; color: var(--muted); font-size: 12.5px; font-weight: 400; }
body.ai-chat-route .copilot-decision-input { box-sizing: border-box; width: 100%; margin: 0; padding: 8px 10px; border: 1px solid color-mix(in srgb, var(--text) 14%, var(--line)); border-radius: 8px; background: var(--surface); color: var(--text); font: 400 14px/1.45 var(--font-sans, Inter, sans-serif); resize: vertical; }
html[data-theme="light"] body.ai-chat-route .copilot-decision-input { background: #fff; }
body.ai-chat-route .copilot-decision-input:focus { outline: none; border-color: color-mix(in srgb, var(--text) 45%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 8%, transparent); }
body.ai-chat-route textarea.copilot-decision-input:not(.copilot-decision-feedback):not([data-copilot-box-input="edit"]) { margin-top: 10px; }
body.ai-chat-route .copilot-decision-feedback { margin-top: 12px; }
body.ai-chat-route .copilot-decision-list { margin: 0; padding-left: 18px; }
body.ai-chat-route .copilot-decision-list li + li { margin-top: 2px; }
body.ai-chat-route .copilot-action-review-actions button[data-primary="true"] { background: var(--text); color: var(--bg); }
html[data-theme="light"] body.ai-chat-route .copilot-action-review-actions button[data-primary="true"] { background: #111; color: #fff; }
body.ai-chat-route .copilot-action-review-actions button[data-primary="true"]:hover:not(:disabled) { opacity: .86; }
body.ai-chat-route .copilot-action-review-actions button:not([data-primary]):not([data-confirmed]) { color: color-mix(in srgb, var(--text) 72%, var(--muted)); }
body.ai-chat-route .copilot-action-review-actions button:not([data-primary]):not([data-confirmed]):hover:not(:disabled) { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
body.ai-chat-route .copilot-decision-box[data-risk="high"] .copilot-action-review-badge { color: #c2513f; }
body.ai-chat-route .copilot-decision-box[data-risk="high"] .copilot-action-review-actions button[data-primary="true"] { background: #c2513f; color: #fff; }
.copilot-action-result-link { color: inherit; font-weight: 560; text-decoration: underline; text-underline-offset: 3px; }
body.ai-chat-route .copilot-decision-box .copilot-action-review-fields > div:has(.copilot-decision-input) { align-items: start; }
body.ai-chat-route .copilot-decision-box .copilot-action-review-fields > div:has(.copilot-decision-input) dt { padding-top: 9px; }
@media (min-width: 681px) { .copilot-pending-approval:has(.copilot-decision-box) { flex-shrink: 0; max-height: min(58dvh, 540px); } }
@media (max-width: 680px) {
  .copilot-pending-approval:has(.copilot-decision-box) { flex-shrink: 0; }
  body.ai-chat-route .copilot-decision-box .copilot-action-review-actions { gap: 2px; }
  body.ai-chat-route .copilot-decision-box .copilot-action-review-actions button { flex: 0 0 auto; min-height: 40px; padding: 0 12px; font-size: 13.5px; }
}
/* A tall pending card scrolls, but its decision buttons stay in view. */
body.ai-chat-route .copilot-pending-approval .copilot-action-review-actions, body.ai-chat-route .copilot-pending-approval .copilot-hiring-review-actions { position: sticky; bottom: -18px; z-index: 1; margin-bottom: -18px; padding: 10px 0 18px; background: inherit; }
@media (max-width: 680px) {
  .copilot-pending-approval { max-height: 52dvh; }
  body.ai-chat-route .copilot-pending-approval .copilot-action-review-actions, body.ai-chat-route .copilot-pending-approval .copilot-hiring-review-actions { bottom: -14px; margin-bottom: -14px; padding-bottom: 14px; }
}

/* Compact decision card: a narrow frame, hairline rows and small buttons so
   a pending box takes little of the chat while staying easy to read. */
body.ai-chat-route .copilot-action-review, body.ai-chat-route .copilot-hiring-review { width: 100%; margin: 4px 0 10px; padding: 12px 14px; border-radius: 12px; background: var(--card); }
body.ai-chat-route .copilot-action-review-head { gap: 8px; }
body.ai-chat-route .copilot-action-review-icon { width: 22px; height: 22px; border-radius: 6px; }
body.ai-chat-route .copilot-action-review-icon svg { width: 13px; height: 13px; }
body.ai-chat-route .copilot-action-review-icon.has-logo img { width: 18px; height: 18px; }
body.ai-chat-route .copilot-action-review h3, body.ai-chat-route .copilot-hiring-review h3 { font-size: 14px; font-weight: 600; letter-spacing: 0; }
body.ai-chat-route .copilot-action-review-badge { flex: none; margin-left: auto; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--text) 6%, transparent); font-size: 11.5px; font-weight: 520; line-height: 1.5; white-space: nowrap; }
body.ai-chat-route .copilot-decision-box[data-risk="high"] .copilot-action-review-badge { background: color-mix(in srgb, #c2513f 12%, transparent); }
body.ai-chat-route .copilot-decision-summary { margin: 6px 0 0; font-size: 13.5px; line-height: 1.45; }
body.ai-chat-route .copilot-action-review dl, body.ai-chat-route .copilot-action-review-fields, body.ai-chat-route .copilot-hiring-review-details { margin: 10px 0 0; }
body.ai-chat-route .copilot-action-review dl > div, body.ai-chat-route .copilot-action-review-fields > div, body.ai-chat-route .copilot-hiring-review-details > div { grid-template-columns: 96px minmax(0, 1fr); gap: 10px; padding: 6px 0; border-top: 1px solid color-mix(in srgb, var(--text) 7%, transparent); }
body.ai-chat-route .copilot-action-review dt, body.ai-chat-route .copilot-action-review-fields dt, body.ai-chat-route .copilot-hiring-review-details dt { font-size: 12.5px; line-height: 1.5; }
body.ai-chat-route .copilot-action-review dd, body.ai-chat-route .copilot-action-review-fields dd, body.ai-chat-route .copilot-hiring-review-details dd { font-size: 13px; line-height: 1.5; }
body.ai-chat-route .copilot-decision-list { padding-left: 16px; }
body.ai-chat-route .copilot-decision-list li + li { margin-top: 0; }
body.ai-chat-route .copilot-action-review-safety, body.ai-chat-route .copilot-hiring-review-status { margin: 4px 0 0; padding-top: 8px; border-top: 1px solid color-mix(in srgb, var(--text) 7%, transparent); color: var(--muted); font-size: 12px; line-height: 1.45; }
body.ai-chat-route .copilot-action-review-actions, body.ai-chat-route .copilot-hiring-review-actions { gap: 4px; margin-top: 10px; }
body.ai-chat-route .copilot-action-review-actions button, body.ai-chat-route .copilot-hiring-review-actions button { min-height: 30px; padding: 0 11px; border-radius: 8px; font-size: 13px; font-weight: 560; }
body.ai-chat-route .copilot-action-review-actions button:first-child, body.ai-chat-route .copilot-hiring-review-actions button:first-child { padding: 0 14px; }
/* Editing and answering */
body.ai-chat-route .copilot-decision-input { padding: 5px 9px; border-radius: 7px; font-size: 13px; line-height: 1.45; }
body.ai-chat-route .copilot-decision-box .copilot-action-review-fields > div:has(.copilot-decision-input) { padding: 5px 0; }
body.ai-chat-route .copilot-decision-box .copilot-action-review-fields > div:has(.copilot-decision-input) dt { padding-top: 6px; }
body.ai-chat-route textarea.copilot-decision-input:not(.copilot-decision-feedback):not([data-copilot-box-input="edit"]) { margin-top: 6px; }
body.ai-chat-route .copilot-decision-feedback { margin-top: 8px; }
body.ai-chat-route .copilot-decision-question { margin: 8px 0 0; font-size: 14px; font-weight: 560; }
body.ai-chat-route .copilot-decision-context { margin: 2px 0 0; font-size: 12.5px; }
body.ai-chat-route .copilot-decision-options { gap: 4px; margin: 10px 0 0; }
body.ai-chat-route .copilot-decision-option { gap: 1px 10px; padding: 7px 10px; border-radius: 8px; font-size: 13px; }
body.ai-chat-route .copilot-decision-recommended { font-size: 11.5px; }
body.ai-chat-route .copilot-decision-option-description { font-size: 12px; line-height: 1.4; }
body.ai-chat-route .copilot-pending-approval .copilot-action-review-actions, body.ai-chat-route .copilot-pending-approval .copilot-hiring-review-actions { bottom: -12px; margin-bottom: -12px; padding: 8px 0 12px; }
@media (max-width: 680px) {
  body.ai-chat-route .copilot-action-review, body.ai-chat-route .copilot-hiring-review { width: 100%; padding: 11px 12px; }
  body.ai-chat-route .copilot-action-review dl > div, body.ai-chat-route .copilot-action-review-fields > div, body.ai-chat-route .copilot-hiring-review-details > div { grid-template-columns: 82px minmax(0, 1fr); gap: 8px; padding: 5px 0; }
  body.ai-chat-route .copilot-action-review dt, body.ai-chat-route .copilot-action-review-fields dt, body.ai-chat-route .copilot-hiring-review-details dt { font-size: 12px; }
  body.ai-chat-route .copilot-decision-box .copilot-action-review-actions button { min-height: 32px; padding: 0 10px; font-size: 13px; }
  body.ai-chat-route .copilot-decision-box .copilot-action-review-actions button:first-child { padding: 0 13px; }
  body.ai-chat-route .copilot-pending-approval .copilot-action-review-actions, body.ai-chat-route .copilot-pending-approval .copilot-hiring-review-actions { bottom: -11px; margin-bottom: -11px; padding-bottom: 11px; }
}

/* Idrok chat: proportions matched to the reference conversation layout.
   One column (chat area minus 45px gutters, capped) holds header, transcript, approval card and composer; the header shares its left edge. */
@media (min-width: 761px) {
  body.ai-chat-route .copilot-drawer .copilot-panel-content { padding: 0 0 20px !important; }
  body.ai-chat-route .copilot-messages,
  body.ai-chat-route .copilot-composer,
  body.ai-chat-route .copilot-attachments,
  body.ai-chat-route .copilot-pending-approval { margin-inline: auto !important; box-sizing: border-box; }
  body.ai-chat-route .copilot-messages, body.ai-chat-route .copilot-composer, body.ai-chat-route .copilot-attachments, body.ai-chat-route .copilot-pending-approval { width: min(calc(100% - 90px), 960px) !important; max-width: none !important; }
  body.ai-chat-route .copilot-drawer .copilot-header { width: 100% !important; max-width: none !important; min-height: 0 !important; margin: 0 !important; padding: 12px 18px !important; border: 0 !important; justify-content: flex-start !important; }
  body.ai-chat-route .copilot-header-copy { display: grid !important; grid-template-columns: auto auto minmax(0, 1fr); grid-template-rows: auto auto; align-items: center !important; justify-content: flex-start !important; column-gap: 12px; row-gap: 1px; margin: 0 !important; }
  body.ai-chat-route .copilot-header-copy #copilotHistoryToggle { grid-column: 1; grid-row: 1 / span 2; }
  body.ai-chat-route .copilot-header-copy .idrok-brain-logo { grid-column: 2; grid-row: 1 / span 2; width: 30px !important; height: 30px !important; }
  body.ai-chat-route .copilot-header-copy h2 { grid-column: 3; grid-row: 1; align-self: end; font: 600 16px/1.2 Inter, system-ui, sans-serif !important; letter-spacing: 0; }
  body.ai-chat-route .copilot-header-copy .copilot-runtime-state { grid-column: 3; grid-row: 2; position: static !important; display: block !important; width: auto !important; height: auto !important; min-width: 0; margin: 0 !important; padding: 0 !important; overflow: visible !important; clip: auto !important; clip-path: none !important; }
  body.ai-chat-route .copilot-runtime-state #copilotContext,
  body.ai-chat-route .copilot-runtime-state .copilot-mode { display: none !important; }
  body.ai-chat-route .copilot-runtime-state #copilotTitle { display: block; overflow: hidden; color: var(--muted); font: 500 13px/1.3 Inter, system-ui, sans-serif; text-overflow: ellipsis; white-space: nowrap; }
  body.ai-chat-route .copilot-history-state[hidden] { display: none !important; }
  body.ai-chat-route .copilot-messages { padding: 18px 0 24px !important; font-size: 15px; line-height: 1.6; }
  body.ai-chat-route .copilot-message.assistant .copilot-message-content { font-size: 15px !important; line-height: 1.62 !important; }
  body.ai-chat-route .copilot-execution-panel { font-size: 14px; }
  body.ai-chat-route .copilot-execution-steps li { min-height: 24px; font-size: 14px; }
  body.ai-chat-route .copilot-execution-duration { font: 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }
  body.ai-chat-route .copilot-composer { padding: 10px 0 0 !important; }
  body.ai-chat-route .copilot-composer > .copilot-composer-input { min-height: 84px !important; padding: 14px 16px 10px !important; border-radius: 22px !important; border: 1px solid color-mix(in srgb, var(--line) 85%, var(--text) 8%) !important; box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 8px 24px rgba(0, 0, 0, .06) !important; }
  body.ai-chat-route .copilot-composer textarea { font-size: 15px !important; line-height: 1.5 !important; }
}

/* Idrok chat: wordmark only, neutral black-and-white accents, reference-style composer toolbar and thinking row. */
body.ai-chat-route .copilot-drawer { --console-accent: var(--text); }
body.ai-chat-route .copilot-execution-panel.is-thinking { margin: 6px 0 10px; padding: 0; border: 0; background: transparent; box-shadow: none; }
body.ai-chat-route .copilot-execution-panel.is-thinking .copilot-execution-identity-line,
body.ai-chat-route .copilot-execution-panel.is-thinking .copilot-execution-chevron,
body.ai-chat-route .copilot-execution-panel.is-thinking .copilot-activity-mark,
body.ai-chat-route .copilot-execution-panel.is-thinking .copilot-execution-elapsed,
body.ai-chat-route .copilot-execution-panel.is-thinking .copilot-execution-steps { display: none !important; }
body.ai-chat-route .copilot-execution-panel.is-thinking .copilot-execution-heading { display: inline-flex; align-items: center; padding: 0; color: var(--muted); font-size: 15px; }
body.ai-chat-route .copilot-execution-panel.is-thinking .copilot-execution-title { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; }
.copilot-thinking-dots { display: inline-flex; gap: 3px; }
.copilot-thinking-dots i { display: block; width: 4px; height: 4px; border-radius: 50%; background: var(--muted); opacity: .25; animation: idrokDots 1.2s ease-in-out infinite; }
.copilot-thinking-dots i:nth-child(2) { animation-delay: .15s; }
.copilot-thinking-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes idrokDots { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .copilot-thinking-dots i { animation: none; opacity: .6; } }

body.ai-chat-route .copilot-composer-bottom { display: flex !important; align-items: center; gap: 14px; padding: 0 !important; }
body.ai-chat-route .copilot-attach { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 24px; font-weight: 300; line-height: 1; }
body.ai-chat-route .copilot-attach:hover { color: var(--text); background: color-mix(in srgb, var(--text) 7%, transparent); }
.copilot-full-access { display: none; }
body.ai-chat-route .copilot-full-access { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font: 500 14px/1 Inter, system-ui, sans-serif; }
body.ai-chat-route .copilot-switch { position: relative; width: 38px; height: 22px; padding: 0; border: 1px solid color-mix(in srgb, var(--line) 80%, var(--text) 10%); border-radius: 999px; background: color-mix(in srgb, var(--text) 5%, transparent); cursor: pointer; transition: background .18s ease, border-color .18s ease; }
body.ai-chat-route .copilot-switch span { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--card, #fff); box-shadow: 0 1px 2px rgba(0, 0, 0, .28); transition: transform .18s ease; }
body.ai-chat-route .copilot-switch[aria-checked="true"] { border-color: var(--text); background: var(--text); }
body.ai-chat-route .copilot-switch[aria-checked="true"] span { transform: translateX(16px); background: var(--bg, #fff); }
body.ai-chat-route .copilot-switch:disabled { opacity: .5; cursor: wait; }
body.ai-chat-route .copilot-switch:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
body.ai-chat-route .copilot-runtime-trigger#copilotModel { border: 0; background: transparent; color: var(--muted); font: 500 14px/1 Inter, system-ui, sans-serif; padding: 6px 4px; }
body.ai-chat-route .copilot-runtime-trigger#copilotModel:hover { color: var(--text); }
body.ai-chat-route .copilot-runtime-trigger#copilotModel span { font: inherit; font-size: 14px; }
body.ai-chat-route .copilot-runtime-trigger#copilotModel svg { width: 14px; height: 14px; }
body.ai-chat-route .copilot-composer-hint { margin-left: auto; color: color-mix(in srgb, var(--muted) 70%, transparent); font: 400 14px/1 Inter, system-ui, sans-serif; white-space: nowrap; }
body.ai-chat-route .copilot-send { flex: none; width: 40px !important; height: 40px !important; border-radius: 50% !important; background: var(--text) !important; color: var(--bg, #fff) !important; }
body.ai-chat-route .copilot-send:disabled { opacity: .28; }
@media (max-width: 760px) { body.ai-chat-route .copilot-composer-hint { display: none; } body.ai-chat-route .copilot-composer-bottom { gap: 10px; } }

/* Idrok chat: model switcher as a compact menu opening above the trigger. */
body.ai-chat-route .copilot-runtime-popover.copilot-model-popover { top: auto !important; right: auto !important; bottom: calc(100% + 12px) !important; left: -6px !important; display: grid; gap: 2px !important; width: 196px !important; padding: 6px !important; border: 1px solid color-mix(in srgb, var(--line) 85%, var(--text) 8%) !important; border-radius: 14px !important; background: var(--card, var(--bg)) !important; box-shadow: 0 12px 32px rgba(0, 0, 0, .16), 0 2px 6px rgba(0, 0, 0, .06) !important; animation: idrokMenuIn .14s ease-out; }
body.ai-chat-route .copilot-model-popover[hidden] { display: none !important; }
body.ai-chat-route .copilot-runtime-popover.copilot-model-popover button { display: grid !important; grid-template-columns: minmax(0, 1fr) 16px !important; align-items: center; column-gap: 10px; min-height: 40px !important; padding: 0 10px !important; border: 0; border-radius: 9px !important; background: transparent; color: var(--text) !important; text-align: left !important; cursor: pointer; }
body.ai-chat-route .copilot-runtime-popover.copilot-model-popover button:hover,
body.ai-chat-route .copilot-runtime-popover.copilot-model-popover button:focus-visible { background: color-mix(in srgb, var(--text) 6%, transparent) !important; outline: 0; }
body.ai-chat-route .copilot-runtime-popover.copilot-model-popover strong { grid-column: 1; justify-self: start; text-align: left; font: 500 14px/1.2 Inter, system-ui, sans-serif; letter-spacing: 0; }
body.ai-chat-route .copilot-runtime-popover.copilot-model-popover small { display: block !important; grid-column: 2; grid-row: 1; margin: 0 !important; color: var(--muted) !important; font: 400 12.5px/1.2 Inter, system-ui, sans-serif !important; }
body.ai-chat-route .copilot-runtime-popover.copilot-model-popover button::after { content: ""; grid-column: 2; grid-row: 1; width: 14px; height: 14px; background: transparent; -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='m5 12.5 4.5 4.5L19 7.5'/></svg>") center / contain no-repeat; mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='m5 12.5 4.5 4.5L19 7.5'/></svg>") center / contain no-repeat; font-size: 0; }
body.ai-chat-route .copilot-runtime-popover.copilot-model-popover button[aria-checked="true"]::after { background: var(--text); }
body.ai-chat-route .copilot-runtime-trigger#copilotModel svg { transition: transform .15s ease; }
body.ai-chat-route .copilot-runtime-trigger#copilotModel[aria-expanded="true"] svg { transform: rotate(180deg); }
body.ai-chat-route .copilot-runtime-trigger#copilotModel[aria-expanded="true"] { color: var(--text); }
@keyframes idrokMenuIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { body.ai-chat-route .copilot-runtime-popover.copilot-model-popover { animation: none; } }

/* Idrok chat: assistant identity row and a borderless, animated action timeline. */
body.ai-chat-route .copilot-execution-identity-line { margin: 0 0 8px; }
body.ai-chat-route .copilot-execution-identity { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font: 500 14px/1 Inter, system-ui, sans-serif; }
body.ai-chat-route .copilot-execution-identity .copilot-execution-idrok-mark { display: block !important; width: 20px; height: 20px; color: var(--text); }
body.ai-chat-route .copilot-execution-time { color: color-mix(in srgb, var(--muted) 75%, transparent); font-weight: 400; }
body.ai-chat-route .copilot-execution-time::before { content: "·"; margin-right: 8px; }
body.ai-chat-route .copilot-execution-steps li:not(.has-integration):not(.is-current):not(.copilot-execution-waiting) { position: relative; padding-left: 26px !important; }
body.ai-chat-route .copilot-execution-steps li:not(.has-integration):not(.is-current):not(.copilot-execution-waiting)::before,
body.ai-chat-route .copilot-execution-steps li.copilot-execution-waiting::before { content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; margin: 0; border: 0; background: var(--muted); -webkit-mask: var(--step-icon) center / contain no-repeat; mask: var(--step-icon) center / contain no-repeat; }
body.ai-chat-route .copilot-execution-steps li { --step-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='m8 12.5 2.7 2.7L16 9.5'/></svg>"); animation: idrokStepIn .22s ease-out; }
body.ai-chat-route .copilot-execution-steps li.is-failed { --step-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='m9 9 6 6M15 9l-6 6'/></svg>"); }
body.ai-chat-route .copilot-execution-steps li.is-failed::before { background: #b3261e !important; }
body.ai-chat-route .copilot-execution-steps li.is-pending,
body.ai-chat-route .copilot-execution-steps li.copilot-execution-waiting { --step-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'><path d='M12 3a9 9 0 1 0 9 9' /></svg>"); }
body.ai-chat-route .copilot-execution-steps li.is-pending:not(.copilot-execution-waiting)::before { animation: idrokSpin .9s linear infinite; background: var(--text) !important; }
body.ai-chat-route .copilot-execution-steps li.copilot-execution-waiting::before { --step-icon: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'><circle cx='12' cy='12' r='9' stroke-dasharray='3 4'/></svg>"); }
body.ai-chat-route .copilot-execution-steps li.is-complete::before { transition: background .2s ease; }
body.ai-chat-route .copilot-execution-steps .copilot-execution-step-detail { padding-left: 0; }
@keyframes idrokStepIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
@keyframes idrokSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { body.ai-chat-route .copilot-execution-steps li, body.ai-chat-route .copilot-execution-steps li::before { animation: none !important; } }

/* Keep the composer toolbar on one line when the chat column is narrow. */
body.ai-chat-route .copilot-full-access span:first-child { white-space: nowrap; }
@media (max-width: 1180px) { body.ai-chat-route .copilot-composer-hint { display: none; } }
/* Thinking and Effort sit right beside Send; the free space goes before the hint (or before the controls when the hint is hidden). */
body.ai-chat-route .copilot-composer-bottom > .copilot-send { margin-left: 8px !important; }
body.ai-chat-route .copilot-composer-bottom > .copilot-reasoning-controls { margin-left: 14px; }
@media (max-width: 1180px) { body.ai-chat-route .copilot-composer-bottom > .copilot-reasoning-controls { margin-left: auto; } }
@media (max-width: 760px) { body.ai-chat-route .copilot-composer-bottom > .copilot-send { margin-left: 0 !important; } }

/* Idrok activity rows: app logos, Idrok's own workspace look-ups, and short
   details inline after the step name. */
body.ai-chat-route .copilot-execution-steps .copilot-execution-step-icon.copilot-execution-idrok-mark { display: block; width: 16px; height: 16px; color: var(--text); align-self: center; }
body.ai-chat-route .copilot-execution-steps .copilot-execution-step-detail.is-inline { flex: 0 1 auto; min-width: 0; padding: 0 !important; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
body.ai-chat-route .copilot-execution-steps .copilot-execution-step-label { flex: 0 0 auto; }

/* Composer: response style (Fast / Thinking) and effort, styled like the model menu. */
body.ai-chat-route .copilot-reasoning-controls { display: flex; flex: none; align-items: center; gap: 2px; margin-left: 10px; }
body.ai-chat-route .copilot-reasoning-controls .copilot-runtime-menu { position: relative; }
body.ai-chat-route .copilot-runtime-trigger.copilot-reasoning-trigger { display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: 500 14px/1 Inter, system-ui, sans-serif; padding: 6px 6px; cursor: pointer; }
body.ai-chat-route .copilot-runtime-trigger.copilot-reasoning-trigger:hover:not(:disabled),
body.ai-chat-route .copilot-runtime-trigger.copilot-reasoning-trigger[aria-expanded="true"] { color: var(--text); background: color-mix(in srgb, var(--text) 5%, transparent); }
body.ai-chat-route .copilot-runtime-trigger.copilot-reasoning-trigger:disabled { cursor: default; opacity: .55; }
body.ai-chat-route .copilot-runtime-trigger.copilot-reasoning-trigger span { font: inherit; font-size: 14px; }
body.ai-chat-route .copilot-runtime-trigger.copilot-reasoning-trigger svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s ease; }
body.ai-chat-route .copilot-runtime-trigger.copilot-reasoning-trigger svg.copilot-reasoning-icon { width: 15px; height: 15px; }
body.ai-chat-route .copilot-runtime-trigger.copilot-reasoning-trigger[aria-expanded="true"] svg:not(.copilot-reasoning-icon) { transform: rotate(180deg); }
body.ai-chat-route .copilot-runtime-trigger.copilot-reasoning-trigger[data-thinking="thinking"] { color: var(--text); }
body.ai-chat-route .copilot-effort-prefix { color: color-mix(in srgb, var(--muted) 75%, transparent); }
body.ai-chat-route .copilot-runtime-trigger.copilot-reasoning-trigger:hover .copilot-effort-prefix { color: var(--muted); }
body.ai-chat-route .copilot-runtime-popover.copilot-model-popover.copilot-reasoning-popover { right: -4px !important; left: auto !important; width: 200px !important; }
@media (max-width: 1180px) { body.ai-chat-route .copilot-reasoning-controls { margin-left: auto; } }
@media (max-width: 520px) {
  body.ai-chat-route .copilot-effort-prefix { display: none; }
  body.ai-chat-route .copilot-runtime-trigger.copilot-reasoning-trigger { padding: 6px 4px; }
}
@media (prefers-reduced-motion: reduce) { body.ai-chat-route .copilot-runtime-trigger.copilot-reasoning-trigger svg { transition: none; } }
body.ai-chat-route .copilot-runtime-popover.copilot-model-popover.copilot-reasoning-popover { width: 236px !important; }
body.ai-chat-route .copilot-runtime-popover.copilot-reasoning-popover button { grid-template-columns: minmax(0, 1fr) auto 14px !important; }
body.ai-chat-route .copilot-runtime-popover.copilot-reasoning-popover small { grid-column: 2 !important; white-space: nowrap; }
body.ai-chat-route .copilot-runtime-popover.copilot-reasoning-popover button::after { grid-column: 3 !important; }
/* Uzbek descriptions are longer: give the labels room instead of letting them overlap. */
html[lang="uz"] body.ai-chat-route .copilot-runtime-popover.copilot-model-popover.copilot-reasoning-popover { width: min(300px, calc(100vw - 32px)) !important; }
html[lang="uz"] body.ai-chat-route .copilot-runtime-popover.copilot-reasoning-popover button { grid-template-columns: max-content minmax(0, 1fr) 14px !important; }
html[lang="uz"] body.ai-chat-route .copilot-runtime-popover.copilot-reasoning-popover small { justify-self: end; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 520px) {
  body.ai-chat-route .copilot-reasoning-controls { gap: 0; margin-left: auto; }
  body.ai-chat-route .copilot-runtime-trigger.copilot-reasoning-trigger { gap: 3px; padding: 6px 5px; }
  body.ai-chat-route #copilotThinking span, body.ai-chat-route .copilot-reasoning-trigger svg:not(.copilot-reasoning-icon) { display: none; }
  body.ai-chat-route #copilotThinking[data-thinking="thinking"] svg.copilot-reasoning-icon { fill: color-mix(in srgb, currentColor 22%, transparent); }
  body.ai-chat-route .copilot-execution-steps .copilot-execution-step-detail.is-inline { order: 3; flex: 0 0 100%; padding: 2px 0 0 26px !important; white-space: normal; }
}
/* Rows with a short detail keep one line; the detail shortens with an ellipsis. */
body.ai-chat-route .copilot-message.assistant.copilot-execution-panel .copilot-execution-steps li.has-inline-detail { flex-wrap: nowrap; }
body.ai-chat-route .copilot-execution-steps li.has-inline-detail .copilot-execution-duration { flex: none; }
@media (max-width: 520px) { body.ai-chat-route .copilot-message.assistant.copilot-execution-panel .copilot-execution-steps li.has-inline-detail { flex-wrap: wrap; } }
/* The composer switches its right-side controls to compact form by its own width. */
body.ai-chat-route .copilot-composer-input { container: idrok-composer / inline-size; }
@container idrok-composer (max-width: 600px) {
  .copilot-composer-hint { display: none !important; }
  .copilot-reasoning-controls { gap: 0 !important; margin-left: auto !important; }
  .copilot-runtime-trigger.copilot-reasoning-trigger { gap: 3px !important; padding: 6px 5px !important; }
  .copilot-effort-prefix, #copilotThinking span, .copilot-reasoning-trigger svg:not(.copilot-reasoning-icon) { display: none !important; }
  #copilotThinking[data-thinking="thinking"] svg.copilot-reasoning-icon { fill: color-mix(in srgb, currentColor 22%, transparent); }
}

/* Idrok decision flow: an approved box glides into the conversation, the
   steps Idrok takes next slide in one by one with their logos, and the
   running step pulses until the backend reports it done. */
body.ai-chat-route .copilot-action-review.is-arriving { animation: idrokCardArrive 480ms cubic-bezier(.2, .8, .2, 1) both; }
@keyframes idrokCardArrive { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: none; } }
body.ai-chat-route .copilot-decision-box[data-state="deciding"] .copilot-action-review-badge { animation: idrokBadgeBreathe 1.4s ease-in-out infinite; }
@keyframes idrokBadgeBreathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
body.ai-chat-route .copilot-action-acknowledgement.is-pending { color: var(--muted); animation: idrokBadgeBreathe 1.4s ease-in-out infinite; }
body.ai-chat-route .copilot-execution-steps li.is-entering { animation: idrokStepIn 420ms cubic-bezier(.2, .8, .2, 1) both; }
@keyframes idrokStepIn { from { opacity: 0; transform: translateY(6px); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }
body.ai-chat-route .copilot-execution-panel[data-execution-state="running"] .copilot-execution-steps li.is-pending.has-integration .copilot-execution-step-icon { animation: idrokLogoPulse 1.2s ease-in-out infinite; }
@keyframes idrokLogoPulse { 0%, 100% { opacity: .45; transform: scale(.9); } 50% { opacity: 1; transform: scale(1); } }
body.ai-chat-route .copilot-execution-panel[data-execution-state="running"] .copilot-execution-steps li.is-pending .copilot-execution-step-label {
  background: linear-gradient(90deg, var(--muted) 0%, var(--muted) 30%, var(--text) 50%, var(--muted) 70%, var(--muted) 100%);
  background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: idrokShimmer 1.7s linear infinite;
}
@keyframes idrokShimmer { from { background-position: 110% 0; } to { background-position: -110% 0; } }
body.ai-chat-route .copilot-message.is-continuation-entering { animation: idrokStepIn 360ms cubic-bezier(.2, .8, .2, 1) both; }
@media (prefers-reduced-motion: reduce) {
  body.ai-chat-route :is(.copilot-action-review.is-arriving, .copilot-execution-steps li.is-entering, .copilot-message.is-continuation-entering) { animation: none; }
  body.ai-chat-route :is(.copilot-decision-box[data-state="deciding"] .copilot-action-review-badge, .copilot-action-acknowledgement.is-pending, .copilot-execution-steps li.is-pending .copilot-execution-step-icon, .copilot-execution-steps li.is-pending .copilot-execution-step-label) { animation: none; }
}

/* Idrok plan checklist (multi-step work); step state comes from Idrok's update_plan. */
.copilot-plan { align-self: flex-start; box-sizing: border-box; width: min(100%, 470px); margin: 4px 0 6px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--line) 88%, var(--text) 12%); border-radius: 10px; background: color-mix(in srgb, var(--surface) 96%, var(--card)); color: var(--text); font-size: 12px; line-height: 1.4; }
.copilot-plan header { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.copilot-plan header span { color: var(--muted, var(--text)); opacity: .75; }
.copilot-plan ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.copilot-plan li { display: grid; grid-template-columns: 14px 1fr; column-gap: 8px; align-items: start; }
.copilot-plan li small { grid-column: 2; opacity: .7; }
.copilot-plan li i { width: 10px; height: 10px; margin-top: 3px; border-radius: 50%; border: 1.5px solid currentColor; opacity: .5; box-sizing: border-box; }
.copilot-plan li[data-status="in_progress"] i { opacity: 1; border-color: var(--accent, currentColor); border-right-color: transparent; animation: copilot-plan-spin 1s linear infinite; }
.copilot-plan li[data-status="done"] i { opacity: 1; background: currentColor; }
.copilot-plan li[data-status="failed"] i { opacity: 1; border-color: #d24b4b; background: #d24b4b; }
.copilot-plan li[data-status="skipped"] span { text-decoration: line-through; opacity: .6; }
@keyframes copilot-plan-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .copilot-plan li[data-status="in_progress"] i { animation: none; } }

/* Automations: the olive used by Activate and the Active state. */
#page-automations { --a-olive: #647945; --a-olive-hover: #566a39; --a-olive-soft: #6f8648; --a-olive-bright: #7a9154; }

/* Automation runs: history, step results, decisions. */
.automation-runs-panel { position: absolute; right: 16px; bottom: 48px; z-index: 6; width: min(440px, calc(100% - 32px)); max-height: min(70vh, 640px); overflow: auto; box-sizing: border-box; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card, var(--surface)); color: var(--text); box-shadow: 0 12px 32px rgba(0,0,0,.18); font-size: 13px; }
.automation-run-list, .automation-run-steps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.automation-run { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.automation-run-row { display: grid; grid-template-columns: 10px 1fr; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.automation-run-copy { display: grid; gap: 2px; }
.automation-run-copy small { opacity: .75; }
.automation-run-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: currentColor; opacity: .45; }
.automation-run.is-completed .automation-run-dot, .automation-run-steps li.is-completed::before { background: #2f9e62; opacity: 1; }
.automation-run.is-failed .automation-run-dot, .automation-run.is-rejected .automation-run-dot { background: #d24b4b; opacity: 1; }
.automation-run.is-running .automation-run-dot, .automation-run.is-queued .automation-run-dot { background: var(--accent, #4b7bd2); opacity: 1; animation: automation-run-pulse 1.2s ease-in-out infinite; }
.automation-run.is-waiting_approval .automation-run-dot, .automation-run.is-waiting_review .automation-run-dot { background: #d29a2f; opacity: 1; }
.automation-run-detail { padding: 0 10px 10px; border-top: 1px solid var(--line); }
.automation-run-steps li { padding: 8px 0 0; }
.automation-run-step-head { display: flex; justify-content: space-between; gap: 8px; }
.automation-run-step-head span { opacity: .7; white-space: nowrap; }
.automation-run-steps p, .automation-run-steps details { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.automation-run-error { color: #d24b4b; }
.automation-run-fix, .automation-preview-fix { color: var(--text); font-weight: 600; }
.automation-run-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.automation-runs-note { margin: 8px 0 0; opacity: .75; }
.automation-preview-output p { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0 0; }
.automation-draft-badge.is-active { color: #2f9e62; }
@keyframes automation-run-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .automation-run.is-running .automation-run-dot, .automation-run.is-queued .automation-run-dot { animation: none; } }
@media (max-width: 680px) { .automation-runs-panel { left: 16px; right: 16px; width: auto; bottom: 16px; } }

/* Idrok permission picker: a labelled choice beside +, opening above like the model menu. */
#copilotPermission.copilot-runtime-trigger { width: auto !important; gap: 6px; padding: 6px 6px !important; border: 0 !important; background: transparent !important; color: var(--muted) !important; font: 500 14px/1 Inter, system-ui, sans-serif; white-space: nowrap; }
#copilotPermission.copilot-runtime-trigger:hover,
#copilotPermission.copilot-runtime-trigger[aria-expanded="true"] { color: var(--text) !important; }
#copilotPermission.copilot-runtime-trigger svg { width: 14px !important; height: 14px !important; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s ease; }
#copilotPermission.copilot-runtime-trigger .copilot-permission-icon { width: 15px !important; height: 15px !important; }
#copilotPermission.copilot-runtime-trigger[aria-expanded="true"] svg:last-child { transform: rotate(180deg); }
#copilotPermission.copilot-runtime-trigger[data-permission="autonomous"] .copilot-permission-icon { color: var(--semantic-success, #2f9e5b); }
#copilotPermission.copilot-runtime-trigger span { font: inherit !important; font-size: 14px !important; color: inherit; }
#copilotPermissionMenu.copilot-runtime-popover { top: auto !important; right: auto !important; bottom: calc(100% + 12px) !important; left: -6px !important; display: grid; gap: 2px !important; width: min(300px, calc(100vw - 32px)) !important; padding: 6px !important; border: 1px solid color-mix(in srgb, var(--line) 85%, var(--text) 8%) !important; border-radius: 14px !important; background: var(--card, var(--bg)) !important; box-shadow: 0 12px 32px rgba(0, 0, 0, .16), 0 2px 6px rgba(0, 0, 0, .06) !important; animation: idrokMenuIn .14s ease-out; }
#copilotPermissionMenu.copilot-runtime-popover[hidden] { display: none !important; }
#copilotPermissionMenu.copilot-runtime-popover button { display: grid !important; grid-template-columns: minmax(0, 1fr) 16px !important; align-items: center; column-gap: 10px; min-height: 0 !important; padding: 9px 10px !important; border: 0; border-radius: 9px !important; background: transparent; color: var(--text) !important; text-align: left !important; cursor: pointer; }
#copilotPermissionMenu.copilot-runtime-popover button:hover,
#copilotPermissionMenu.copilot-runtime-popover button:focus-visible { background: color-mix(in srgb, var(--text) 6%, transparent) !important; outline: 0; }
#copilotPermissionMenu.copilot-runtime-popover strong { grid-column: 1; grid-row: 1; justify-self: start; text-align: left; font: 500 14px/1.25 Inter, system-ui, sans-serif !important; letter-spacing: 0; }
#copilotPermissionMenu.copilot-runtime-popover small { display: block !important; justify-self: start; text-align: left !important; grid-column: 1; grid-row: 2; margin: 3px 0 0 !important; color: var(--muted) !important; font: 400 12.5px/1.4 Inter, system-ui, sans-serif !important; }
#copilotPermissionMenu.copilot-runtime-popover button::after { content: ""; grid-column: 2; grid-row: 1 / span 2; width: 14px; height: 14px; background: transparent; -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='m5 12.5 4.5 4.5L19 7.5'/></svg>") center / contain no-repeat; mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='m5 12.5 4.5 4.5L19 7.5'/></svg>") center / contain no-repeat; font-size: 0; }
#copilotPermissionMenu.copilot-runtime-popover button[aria-checked="true"]::after { background: var(--text); }
@media (max-width: 520px) { #copilotPermission.copilot-runtime-trigger span { display: none; } }

/* Idrok sidebar: settings entry pinned to the bottom of the chat list. */
.copilot-history-drawer > .copilot-history-body { flex: 1 1 auto; min-height: 0; }
.copilot-history-foot { flex: none; margin-top: auto; padding: 8px 10px 10px; border-top: 1px solid color-mix(in srgb, var(--line) 80%, transparent); }
.copilot-history-settings { display: flex; align-items: center; gap: 9px; width: 100%; height: 32px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: 500 13px/1 Inter, system-ui, sans-serif; text-align: left; cursor: pointer; }
.copilot-history-settings svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.copilot-history-settings:hover, .copilot-history-settings.is-active { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); }
.copilot-history-settings:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; }

/* Idrok settings: replaces the conversation while open (Claude-style settings page). */
.copilot-panel-content.is-settings-open > :is(.copilot-messages, .copilot-pending-approval, .copilot-attachments, .copilot-composer) { display: none !important; }
.copilot-settings { container-type: inline-size; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; color: var(--text); font-family: Inter, system-ui, sans-serif; animation: idrokSettingsIn .18s ease-out; }
.copilot-settings[hidden] { display: none !important; }
@keyframes idrokSettingsIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .copilot-settings { animation: none; } }
.copilot-settings-head { display: flex; align-items: flex-start; gap: 10px; max-width: 860px; margin: 0 auto; padding: 18px 20px 14px; }
.copilot-settings-back { display: grid; place-items: center; flex: none; width: 30px; height: 30px; margin-top: 1px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.copilot-settings-back:hover { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); }
.copilot-settings-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.copilot-settings-heading { flex: 1; min-width: 0; }
.copilot-settings-heading h2 { margin: 0; color: var(--text); font: 600 20px/1.25 Inter, system-ui, sans-serif; letter-spacing: -.01em; }
.copilot-settings-heading p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.copilot-settings-saved { flex: none; margin-top: 7px; color: var(--muted); font-size: 12px; opacity: 0; transition: opacity .2s ease; }
.copilot-settings-saved.is-visible { opacity: 1; }
.copilot-settings-layout { display: grid; gap: 14px; max-width: 860px; margin: 0 auto; padding: 0 20px 32px; }
.copilot-settings-tabs { display: flex; gap: 2px; overflow-x: auto; padding-bottom: 8px; border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent); scrollbar-width: none; }
.copilot-settings-tabs::-webkit-scrollbar { display: none; }
.copilot-settings-tabs button { flex: none; height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: 500 13px/1 Inter, system-ui, sans-serif; text-align: left; cursor: pointer; white-space: nowrap; }
.copilot-settings-tabs button:hover { color: var(--text); background: color-mix(in srgb, var(--text) 4%, transparent); }
.copilot-settings-tabs button[aria-selected="true"] { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
.copilot-settings-tabs button:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; }
.copilot-settings-body { display: grid; gap: 26px; min-width: 0; }
@container (min-width: 680px) {
  .copilot-settings-head { padding: 26px 28px 20px; }
  .copilot-settings-layout { grid-template-columns: 168px minmax(0, 1fr); gap: 32px; padding: 0 28px 40px; }
  .copilot-settings-tabs { flex-direction: column; align-self: start; position: sticky; top: 0; padding: 0; border: 0; }
  .copilot-settings-tabs button { height: 32px; }
}
.copilot-settings-group h3 { margin: 0; color: var(--text); font: 600 14px/1.3 Inter, system-ui, sans-serif; }
.copilot-settings-group > p { margin: 3px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.copilot-settings-group > :not(h3):not(p) { margin-top: 12px; }
.copilot-settings-group > .copilot-settings-field + .copilot-settings-field { margin-top: 16px; }
.copilot-settings-field { position: relative; display: grid; gap: 6px; }
.copilot-settings-field > label { color: var(--text); font-size: 13px; font-weight: 500; }
.copilot-settings-field > small { margin-top: -2px; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.copilot-settings :is(input[type="text"], textarea, select) { width: 100%; box-sizing: border-box; padding: 9px 11px; border: 1px solid color-mix(in srgb, var(--line) 90%, var(--text) 6%); border-radius: 9px; background: var(--card, var(--bg)); color: var(--text); font: 400 14px/1.45 Inter, system-ui, sans-serif; box-shadow: none; outline: 0; transition: border-color .15s ease, box-shadow .15s ease; }
.copilot-settings textarea { min-height: 76px; resize: vertical; padding-bottom: 24px; }
.copilot-settings select { height: 38px; padding-top: 0; padding-bottom: 0; cursor: pointer; }
.copilot-settings :is(input[type="text"], textarea, select):focus { border-color: color-mix(in srgb, var(--text) 45%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 7%, transparent); }
.copilot-settings ::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.copilot-settings-count { position: absolute; right: 10px; bottom: 7px; color: color-mix(in srgb, var(--muted) 80%, transparent); font-size: 11px; pointer-events: none; }
.copilot-settings-choices { display: grid; gap: 6px; }
.copilot-settings-choices.is-inline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.copilot-settings-choice { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--line) 90%, var(--text) 4%); border-radius: 10px; background: var(--card, var(--bg)); cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.copilot-settings-choice:hover { border-color: color-mix(in srgb, var(--line) 60%, var(--text) 25%); }
.copilot-settings-choice input { flex: none; width: 15px; height: 15px; margin: 2px 0 0; accent-color: var(--text); cursor: pointer; }
.copilot-settings-choice span { display: grid; gap: 2px; min-width: 0; }
.copilot-settings-choice strong { color: var(--text); font-size: 13.5px; font-weight: 500; line-height: 1.3; }
.copilot-settings-choice small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.copilot-settings-choice:has(input:checked) { border-color: var(--text); background: color-mix(in srgb, var(--text) 3%, var(--card, var(--bg))); }
.copilot-settings-choice:has(input:focus-visible) { outline: 2px solid var(--text); outline-offset: 2px; }
.copilot-settings-choice.is-locked { opacity: .55; cursor: not-allowed; }
.copilot-settings-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--line) 90%, var(--text) 4%); border-radius: 10px; background: var(--card, var(--bg)); }
.copilot-settings-row-copy { display: grid; gap: 3px; min-width: 0; }
.copilot-settings-row-copy strong { color: var(--text); font-size: 13.5px; font-weight: 500; }
.copilot-settings-row-copy small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.copilot-settings .copilot-switch { position: relative; flex: none; width: 36px; height: 21px; padding: 0; border: 1px solid color-mix(in srgb, var(--line) 80%, var(--text) 10%); border-radius: 999px; background: color-mix(in srgb, var(--text) 6%, transparent); cursor: pointer; transition: background .18s ease, border-color .18s ease; }
.copilot-settings .copilot-switch span { position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: var(--card, #fff); box-shadow: 0 1px 2px rgba(0, 0, 0, .28); transition: transform .18s ease; }
.copilot-settings .copilot-switch[aria-checked="true"] { border-color: var(--text); background: var(--text); }
.copilot-settings .copilot-switch[aria-checked="true"] span { transform: translateX(15px); background: var(--bg, #fff); }
.copilot-settings .copilot-switch:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.copilot-settings-facts { display: grid; gap: 7px; margin: 12px 0 0; padding: 0; list-style: none; }
.copilot-settings-facts li { position: relative; padding-left: 20px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.copilot-settings-facts li::before { content: ""; position: absolute; left: 2px; top: 4px; width: 11px; height: 11px; background: var(--semantic-success, #2f9e5b); -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='m5 12.5 4.5 4.5L19 7.5'/></svg>") center / contain no-repeat; mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='m5 12.5 4.5 4.5L19 7.5'/></svg>") center / contain no-repeat; }
.copilot-settings-note { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.copilot-settings-note button { padding: 0; border: 0; background: none; color: var(--text); font: inherit; text-decoration: underline; cursor: pointer; }
.copilot-settings-skeleton { display: grid; gap: 12px; }
.copilot-settings-skeleton span { height: 44px; border-radius: 10px; background: color-mix(in srgb, var(--text) 5%, transparent); }
.copilot-settings-skeleton span:first-child { width: 40%; height: 16px; }

.copilot-settings .copilot-settings-head { border: 0 !important; box-shadow: none !important; background: transparent !important; }
.copilot-settings .copilot-settings-back { border: 0 !important; box-shadow: none !important; }
.copilot-settings-layout { padding-top: 4px; }
.copilot-settings-choices { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.copilot-settings-choices.is-stacked { grid-template-columns: minmax(0, 1fr); }
.copilot-settings-choice { padding: 9px 12px; }
#copilotPermissionMenu.copilot-runtime-popover button { align-content: center; row-gap: 0 !important; height: auto !important; }
/* Narrow composer (tablet with the chat list open): the permission keeps its icon only. */
.copilot-composer { container: idrok-composer / inline-size; }
@container idrok-composer (max-width: 560px) { #copilotPermission.copilot-runtime-trigger > span { display: none; } }

/* Phone: the Idrok chat list is a simple column (it was a grid whose
   leftover height went to "New chat"), with outline icons and full titles. */
@media (max-width: 680px) {
  .copilot-history-drawer.copilot-history-panel { display: flex !important; flex-direction: column !important; }
  .copilot-history-drawer .copilot-history-drawer-actions svg { fill: none !important; stroke: currentColor !important; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; width: 18px !important; height: 18px !important; }
  .copilot-history-drawer .copilot-history-drawer-actions button { display: grid !important; place-items: center; width: 32px !important; height: 32px !important; padding: 0 !important; border: 0 !important; border-radius: 8px !important; background: transparent !important; color: var(--muted) !important; box-shadow: none !important; }
  .copilot-history-drawer #copilotHistoryNew { flex: none; display: flex !important; align-items: center; gap: 8px; height: 36px !important; min-height: 36px !important; margin: 4px 10px 6px !important; padding: 0 10px !important; border: 0 !important; border-radius: 8px !important; background: transparent !important; color: var(--text) !important; font: 500 14px/1 Inter, system-ui, sans-serif !important; text-align: left; box-shadow: none !important; }
  .copilot-history-drawer #copilotHistoryNew:active { background: color-mix(in srgb, var(--text) 6%, transparent) !important; }
  .copilot-history-drawer .copilot-history-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  .copilot-history-drawer .copilot-history-open { grid-template-columns: minmax(0, 1fr) !important; }
  .copilot-history-drawer .copilot-history-open > span { min-width: 0; width: 100%; }
  .copilot-history-drawer .copilot-history-open strong { font: 400 14px/1.3 Inter, system-ui, sans-serif !important; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 680px) { #copilotPermissionMenu.copilot-runtime-popover { width: min(300px, calc(100vw - 56px)) !important; max-width: none !important; max-height: none !important; right: auto !important; left: -6px !important; } }
@media (max-width: 680px) { #copilotModelMenu.copilot-runtime-popover { width: 200px !important; max-width: none !important; max-height: none !important; right: auto !important; left: -6px !important; } }

/* Idrok settings: writing rows, appearance (font cards, size, live preview) and the browser-only note. */
.copilot-settings-label { color: var(--text); font-size: 13px; font-weight: 500; }
.copilot-settings-group > .copilot-settings-field + .copilot-settings-field { margin-top: 14px; }
.copilot-settings-choices.is-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@container (max-width: 480px) { .copilot-settings-choices.is-row { grid-template-columns: minmax(0, 1fr); } }
.copilot-settings-banner { margin: 0; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--line) 85%, var(--text) 6%); border-radius: 10px; background: color-mix(in srgb, var(--text) 3%, transparent); color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.copilot-settings-fonts { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.copilot-settings-font { position: relative; display: grid; justify-items: start; gap: 2px; padding: 12px; border: 1px solid color-mix(in srgb, var(--line) 90%, var(--text) 4%); border-radius: 10px; background: var(--card, var(--bg)); cursor: pointer; transition: border-color .15s ease; }
.copilot-settings-font:hover { border-color: color-mix(in srgb, var(--line) 60%, var(--text) 25%); }
.copilot-settings-font input { position: absolute; opacity: 0; pointer-events: none; }
.copilot-settings-font:has(input:checked) { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.copilot-settings-font:has(input:focus-visible) { outline: 2px solid var(--text); outline-offset: 2px; }
.copilot-settings-font-sample { margin-bottom: 6px; color: var(--text); font-size: 26px; line-height: 1; }
.copilot-settings-font strong { color: var(--text); font-size: 13px; font-weight: 500; }
.copilot-settings-font small { color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.copilot-settings-segmented { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid color-mix(in srgb, var(--line) 90%, var(--text) 4%); border-radius: 10px; background: color-mix(in srgb, var(--text) 3%, transparent); }
.copilot-settings-segmented label { position: relative; cursor: pointer; }
.copilot-settings-segmented input { position: absolute; opacity: 0; pointer-events: none; }
.copilot-settings-segmented span { display: block; padding: 6px 14px; border-radius: 7px; color: var(--muted); font-size: 13px; font-weight: 500; }
.copilot-settings-segmented label[data-size="small"] span { font-size: 12px; }
.copilot-settings-segmented label[data-size="large"] span { font-size: 15px; }
.copilot-settings-segmented input:checked + span { background: var(--card, var(--bg)); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 0 0 1px color-mix(in srgb, var(--line) 80%, transparent); }
.copilot-settings-segmented input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 1px; }
.copilot-settings-preview { display: grid; gap: 12px; padding: 16px; border: 1px dashed color-mix(in srgb, var(--line) 90%, var(--text) 6%); border-radius: 12px; }
.copilot-settings-preview-user { justify-self: end; max-width: 80%; padding: 8px 12px; border: 1px solid color-mix(in srgb, var(--line) 85%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--text) 4%, var(--card, var(--bg))); color: var(--text); }
.copilot-settings-preview-idrok { display: flex; align-items: flex-start; gap: 10px; color: var(--text); }
.copilot-settings-preview-idrok .idrok-brain-logo { flex: none; width: 20px; height: 20px; margin-top: 1px; }
.copilot-settings-preview-idrok p { margin: 0; }

/* Chat font and text size (Idrok settings > Appearance) on the conversation and its preview. */
:is(#copilotMessages, .copilot-settings-preview) { --idrok-chat-font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; --idrok-chat-size: 14px; }
:is(#copilotMessages, .copilot-settings-preview)[data-chat-font="system"] { --idrok-chat-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
:is(#copilotMessages, .copilot-settings-preview)[data-chat-font="sans"] { --idrok-chat-font: "Space Grotesk", Inter, system-ui, sans-serif; }
:is(#copilotMessages, .copilot-settings-preview)[data-chat-font="serif"] { --idrok-chat-font: "Iowan Old Style", "Palatino Linotype", Georgia, ui-serif, serif; }
:is(#copilotMessages, .copilot-settings-preview)[data-chat-font="mono"] { --idrok-chat-font: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }
:is(#copilotMessages, .copilot-settings-preview)[data-text-size="small"] { --idrok-chat-size: 13px; }
:is(#copilotMessages, .copilot-settings-preview)[data-text-size="large"] { --idrok-chat-size: 16px; }
.copilot-settings-preview :is(.copilot-settings-preview-user, p) { font-family: var(--idrok-chat-font); font-size: var(--idrok-chat-size); line-height: 1.6; }
#copilotMessages:is([data-chat-font]:not([data-chat-font="default"]), [data-text-size]:not([data-text-size="default"])) .copilot-message:is(.user, .assistant),
#copilotMessages:is([data-chat-font]:not([data-chat-font="default"]), [data-text-size]:not([data-text-size="default"])) .copilot-message.assistant :is(p, li, td, th, blockquote, strong, em, a) { font-family: var(--idrok-chat-font) !important; font-size: var(--idrok-chat-size) !important; }
#copilotMessages[data-text-size]:not([data-text-size="default"]) .copilot-message.assistant :is(p, li) { line-height: 1.62 !important; }
.copilot-settings-font[data-font="system"] .copilot-settings-font-sample { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.copilot-settings-font[data-font="default"] .copilot-settings-font-sample { font-family: Inter, system-ui, sans-serif; }
.copilot-settings-font[data-font="sans"] .copilot-settings-font-sample { font-family: "Space Grotesk", Inter, sans-serif; }
.copilot-settings-font[data-font="serif"] .copilot-settings-font-sample { font-family: "Iowan Old Style", "Palatino Linotype", Georgia, ui-serif, serif; }
.copilot-settings-font[data-font="mono"] .copilot-settings-font-sample { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 23px; }

/* ---------- Idrok settings page (v2): a page of its own, full width, setting rows ---------- */
.copilot-panel-content.is-settings-open > .copilot-header { display: none !important; }
.copilot-settings .copilot-settings-head { position: sticky; top: 0; z-index: 2; max-width: none; margin: 0; padding: 22px max(24px, calc((100% - 1120px) / 2 + 24px)) 16px !important; border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent) !important; background: var(--bg, var(--card)) !important; }
.copilot-settings-heading h2 { font-size: 22px; }
.copilot-settings-banner { display: inline-block; margin: 10px 0 0; padding: 6px 10px; font-size: 12px; }
.copilot-settings-layout { max-width: 1120px; padding: 20px 24px 48px; }
.copilot-settings-body { gap: 0; }
.copilot-settings-group { padding: 4px 0 18px; }
.copilot-settings-group + .copilot-settings-group { padding-top: 22px; border-top: 1px solid color-mix(in srgb, var(--line) 80%, transparent); }
.copilot-settings-group-head h3 { margin: 0; color: var(--text); font: 600 15px/1.3 Inter, system-ui, sans-serif; }
.copilot-settings-group-head p { margin: 3px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.copilot-settings-group > .copilot-settings-group-body { margin-top: 6px; }
.copilot-settings-group-body > .copilot-settings-choices, .copilot-settings-group-body > .copilot-settings-facts { margin-top: 10px; }
.copilot-settings-item { display: grid; gap: 8px; padding: 14px 0; border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.copilot-settings-item:first-child { border-top: 0; }
.copilot-settings-item-copy { display: grid; align-content: start; gap: 3px; min-width: 0; }
.copilot-settings-item-label { color: var(--text); font-size: 13.5px; font-weight: 500; line-height: 1.35; }
.copilot-settings-item-copy small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.copilot-settings-item-control { display: grid; justify-items: start; gap: 6px; min-width: 0; }
.copilot-settings-item-control > :is(input[type="text"], select) { max-width: 420px; }
.copilot-settings-item-control > .copilot-switch { margin-top: 2px; }
.copilot-settings-textarea { position: relative; width: 100%; }
.copilot-settings-textarea textarea { display: block; }
.copilot-settings-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.copilot-settings-pill { position: relative; cursor: pointer; }
.copilot-settings-pill input { position: absolute; opacity: 0; pointer-events: none; }
.copilot-settings-pill span { display: inline-flex; align-items: center; height: 32px; padding: 0 13px; border: 1px solid color-mix(in srgb, var(--line) 90%, var(--text) 6%); border-radius: 8px; background: var(--card, var(--bg)); color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; transition: border-color .15s ease, color .15s ease, background .15s ease; }
.copilot-settings-pill:hover span { border-color: color-mix(in srgb, var(--line) 60%, var(--text) 25%); color: var(--text); }
.copilot-settings-pill input:checked + span { border-color: var(--text); background: color-mix(in srgb, var(--text) 6%, var(--card, var(--bg))); color: var(--text); box-shadow: inset 0 0 0 .5px var(--text); }
.copilot-settings-pill input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }
.copilot-settings-pill input:disabled + span { opacity: .5; cursor: not-allowed; }
.copilot-settings-pill-hint { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.copilot-settings-fonts { width: 100%; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.copilot-settings-font { align-content: start; min-height: 0; padding: 12px 12px 11px; }
.copilot-settings-font strong, .copilot-settings-font small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copilot-settings-font-sample { margin-bottom: 8px; font-size: 24px; }
.copilot-settings-font[data-font="mono"] .copilot-settings-font-sample { font-size: 21px; }
.copilot-settings-preview { width: 100%; box-sizing: border-box; background: color-mix(in srgb, var(--text) 1.5%, transparent); }
@container (min-width: 760px) {
  .copilot-settings .copilot-settings-head { padding-left: max(32px, calc((100% - 1120px) / 2 + 32px)) !important; padding-right: max(32px, calc((100% - 1120px) / 2 + 32px)) !important; }
  .copilot-settings-layout { grid-template-columns: 184px minmax(0, 1fr); gap: 44px; padding: 24px 32px 56px; }
  .copilot-settings-tabs { top: 16px; }
  .copilot-settings-item { grid-template-columns: minmax(170px, 240px) minmax(0, 1fr); gap: 32px; padding: 16px 0; }
}
.copilot-settings .copilot-settings-group-head { display: block !important; padding: 0 !important; border: 0 !important; background: none !important; }
.copilot-settings .copilot-settings-head { align-items: flex-start; }
.copilot-settings-back { margin-top: 0; }
.copilot-settings-banner { padding: 4px 9px; border-radius: 999px; }
@container (min-width: 760px) { .copilot-settings-item { grid-template-columns: 210px minmax(0, 1fr); } }
.copilot-settings-fonts { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
@container (max-width: 480px) { .copilot-settings-banner { border-radius: 10px; } }

/* ---------- Idrok settings (v3): settings sidebar in the chat list's place ---------- */
.copilot-history-drawer.is-settings-mode > :not(.copilot-settings-sidenav) { display: none !important; }
.copilot-settings-sidenav[hidden] { display: none !important; }
.copilot-history-drawer.is-settings-mode > .copilot-settings-sidenav { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; height: 100%; padding: 14px 10px 12px; overflow-y: auto; box-sizing: border-box; }
.copilot-settings-sidenav-head { display: grid; gap: 10px; padding: 0 6px 14px; }
.copilot-settings-sidenav-back { display: inline-flex; align-items: center; gap: 4px; justify-self: start; height: 28px; padding: 0 8px 0 4px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font: 500 13px/1 Inter, system-ui, sans-serif; cursor: pointer; }
.copilot-settings-sidenav-back:hover { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); }
.copilot-settings-sidenav-back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.copilot-settings-sidenav-head h2 { margin: 0; padding-left: 2px; color: var(--text); font: 600 20px/1.2 Inter, system-ui, sans-serif; letter-spacing: -.01em; }
.copilot-settings-sidenav-list { display: grid; gap: 2px; }
.copilot-settings-sidenav-list button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); text-align: left; cursor: pointer; transition: background .14s ease, color .14s ease; }
.copilot-settings-sidenav-list button:hover { background: color-mix(in srgb, var(--text) 5%, transparent); color: var(--text); }
.copilot-settings-sidenav-list button[aria-selected="true"] { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
.copilot-settings-sidenav-list button:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; }
.copilot-settings-sidenav-list svg { flex: none; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.copilot-settings-sidenav-list span { display: grid; gap: 2px; min-width: 0; }
.copilot-settings-sidenav-list strong { color: inherit; font: 500 13.5px/1.25 Inter, system-ui, sans-serif; }
.copilot-settings-sidenav-list small { overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.copilot-settings-sidenav-foot { margin: auto 0 0; padding: 12px 8px 0; color: var(--muted); font-size: 12px; line-height: 1.45; }

/* The page beside it: one column, grouped boxes. */
.copilot-settings.has-sidenav { padding: 0; }
.copilot-settings-page { position: relative; max-width: 860px; margin: 0 auto; padding: 40px 40px 64px; }
.copilot-settings-page-head h2 { margin: 0; color: var(--text); font: 600 26px/1.2 Inter, system-ui, sans-serif; letter-spacing: -.015em; }
.copilot-settings-page-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.copilot-settings-page > .copilot-settings-saved { position: absolute; top: 48px; right: 40px; margin: 0; }
.copilot-settings-page > .copilot-settings-body { margin-top: 28px; gap: 28px; }
.copilot-settings-page .copilot-settings-group, .copilot-settings-page .copilot-settings-group + .copilot-settings-group { padding: 0; border: 0; }
.copilot-settings-page .copilot-settings-group-head { margin: 0 0 10px 2px; }
.copilot-settings-page .copilot-settings-group-head h3 { font-size: 14px; }
.copilot-settings-page .copilot-settings-group > .copilot-settings-group-body { margin: 0; padding: 0 20px; border: 1px solid color-mix(in srgb, var(--line) 85%, var(--text) 5%); border-radius: 12px; background: var(--card, var(--bg)); }
.copilot-settings-page .copilot-settings-group-body > .copilot-settings-choices, .copilot-settings-page .copilot-settings-group-body > .copilot-settings-facts { margin: 0; padding: 16px 0; }
.copilot-settings-page .copilot-settings-item { padding: 16px 0; border-top-color: color-mix(in srgb, var(--line) 70%, transparent); }
@container (min-width: 640px) { .copilot-settings-page .copilot-settings-item { grid-template-columns: 200px minmax(0, 1fr); gap: 28px; } }
.copilot-settings-page .copilot-settings-choices.is-stacked { gap: 8px; }

/* Profile summary, quick-add instructions, plain text and reset. */
.copilot-settings-summary { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; padding: 16px 20px; border: 1px solid color-mix(in srgb, var(--line) 85%, var(--text) 5%); border-radius: 12px; background: color-mix(in srgb, var(--text) 2.5%, var(--card, var(--bg))); }
.copilot-settings-summary-avatar { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--text); color: var(--bg, #fff); font: 600 16px/1 Inter, system-ui, sans-serif; }
.copilot-settings-summary > div { display: grid; gap: 3px; flex: 1; min-width: 0; }
.copilot-settings-summary strong { color: var(--text); font-size: 14.5px; font-weight: 600; }
.copilot-settings-summary small { color: var(--muted); font-size: 12.5px; }
.copilot-settings-status { flex: none; padding: 4px 10px; border: 1px solid color-mix(in srgb, var(--line) 90%, var(--text) 6%); border-radius: 999px; color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; }
.copilot-settings-status.is-on { border-color: color-mix(in srgb, var(--semantic-success, #2f9e5b) 45%, transparent); color: var(--semantic-success, #2f9e5b); }
.copilot-settings-suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.copilot-settings-suggestions button { height: 30px; padding: 0 11px; border: 1px dashed color-mix(in srgb, var(--line) 70%, var(--text) 20%); border-radius: 999px; background: transparent; color: var(--muted); font: 500 12.5px/1 Inter, system-ui, sans-serif; cursor: pointer; }
.copilot-settings-suggestions button:hover:not(:disabled) { border-style: solid; color: var(--text); }
.copilot-settings-suggestions button:disabled { opacity: .45; cursor: default; text-decoration: line-through; }
.copilot-settings-plain { margin: 0; color: var(--text); font-size: 13.5px; line-height: 1.5; }
.copilot-settings-danger { height: 34px; padding: 0 14px; border: 1px solid color-mix(in srgb, #c4483c 45%, var(--line)); border-radius: 8px; background: transparent; color: #c4483c; font: 500 13px/1 Inter, system-ui, sans-serif; cursor: pointer; }
.copilot-settings-danger:hover, .copilot-settings-danger.is-armed { background: #c4483c; border-color: #c4483c; color: #fff; }
.copilot-settings .copilot-settings-page-head { display: block !important; padding: 0 !important; border: 0 !important; background: none !important; }

/* ---------- Idrok settings (v4): sidebar groups, Appearance, Plugins ---------- */
.copilot-settings-sidenav-group { margin: 14px 10px 4px; color: var(--muted); font: 600 11px/1.2 Inter, system-ui, sans-serif; letter-spacing: .04em; text-transform: uppercase; opacity: .8; }
.copilot-settings-sidenav-list > .copilot-settings-sidenav-group:first-child { margin-top: 2px; }
.copilot-settings-sidenav-list button:focus { outline: none; }
.copilot-settings-sidenav-list button:focus-visible { outline: 0; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--text) 45%, transparent); }
.copilot-settings-sidenav-list button[aria-selected="true"] svg { color: var(--text); }
.copilot-settings-summary-avatar.is-empty { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--muted); }
.copilot-settings-summary-avatar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.copilot-settings .copilot-settings-group.is-plain > .copilot-settings-group-body { padding: 0; border: 0; border-radius: 0; background: none; }
.copilot-settings-footnote { margin: -8px 2px 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.copilot-settings-secondary { height: 34px; padding: 0 14px; border: 1px solid color-mix(in srgb, var(--line) 85%, var(--text) 10%); border-radius: 8px; background: var(--card, var(--bg)); color: var(--text); font: 500 13px/1 Inter, system-ui, sans-serif; cursor: pointer; }
.copilot-settings-secondary:disabled { color: var(--muted); cursor: not-allowed; opacity: .7; }

/* Appearance: live preview first, then theme, font and size cards. */
.copilot-settings .copilot-settings-preview { position: relative; display: grid; gap: 14px; margin: 0; padding: 40px 22px 22px; border: 1px solid color-mix(in srgb, var(--line) 85%, var(--text) 5%); border-radius: 14px; background: var(--bg); }
.copilot-settings-preview figcaption { position: absolute; top: 13px; left: 16px; color: var(--muted); font: 600 11px/1 Inter, system-ui, sans-serif; letter-spacing: .04em; text-transform: uppercase; }
.copilot-settings .copilot-settings-preview-user { max-width: 72%; padding: 9px 14px; border: 0; border-radius: 16px; background: color-mix(in srgb, var(--text) 6%, var(--card, var(--bg))); }
.copilot-settings-preview-idrok > div { min-width: 0; }
.copilot-settings-preview-idrok ul { margin: 6px 0 0; padding-left: 18px; }
.copilot-settings-preview :is(li) { font-family: var(--idrok-chat-font); font-size: var(--idrok-chat-size); line-height: 1.6; color: var(--text); }
.copilot-settings-preview-idrok .idrok-brain-logo { width: 22px; height: 22px; margin-top: 2px; }

.copilot-settings-themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.copilot-settings-theme { position: relative; display: grid; gap: 9px; cursor: pointer; }
.copilot-settings-theme input, .copilot-settings-sizes input { position: absolute; opacity: 0; pointer-events: none; }
.copilot-settings-theme-art { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 11px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--line) 85%, var(--text) 8%); transition: box-shadow .15s ease; --art-bg: #f5f5f1; --art-side: #ebebe6; --art-ink: #d6d6cf; --art-bubble: #e4e4de; }
.copilot-settings-theme[data-theme-card="dark"] .copilot-settings-theme-art { --art-bg: #171815; --art-side: #111210; --art-ink: #3a3b37; --art-bubble: #2a2b27; }
.copilot-settings-theme-art { background: var(--art-bg); }
.copilot-settings-theme[data-theme-card="auto"] .copilot-settings-theme-art { background: linear-gradient(115deg, #f5f5f1 0 50%, #171815 50% 100%); }
.copilot-settings-theme-art i { position: absolute; display: block; border-radius: 4px; background: var(--art-ink); }
.copilot-settings-theme-art .is-side { top: 0; bottom: 0; left: 0; width: 24%; border-radius: 0; background: var(--art-side); }
.copilot-settings-theme[data-theme-card="auto"] .is-side { background: #ebebe6; }
.copilot-settings-theme-art .is-line { top: 16%; left: 6%; width: 12%; height: 6%; }
.copilot-settings-theme-art .is-line.is-short { top: 28%; width: 9%; }
.copilot-settings-theme-art .is-bubble { top: 22%; right: 8%; width: 34%; height: 13%; border-radius: 6px; background: var(--art-bubble); }
.copilot-settings-theme-art .is-reply { top: 48%; left: 32%; width: 52%; height: 7%; }
.copilot-settings-theme-art .is-reply.is-short { top: 61%; width: 36%; }
.copilot-settings-theme[data-theme-card="auto"] :is(.is-bubble, .is-reply) { background: #9a9a93; opacity: .55; }
.copilot-settings-theme:hover .copilot-settings-theme-art { box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 35%, var(--line)); }
.copilot-settings-theme:has(input:checked) .copilot-settings-theme-art { box-shadow: 0 0 0 2px var(--text); }
.copilot-settings-theme:has(input:focus-visible) .copilot-settings-theme-art { outline: 2px solid var(--text); outline-offset: 3px; }
.copilot-settings-theme-name { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; font-weight: 500; }
.copilot-settings-theme-name i { flex: none; width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--line) 50%, var(--text) 35%); }
.copilot-settings-theme:has(input:checked) .copilot-settings-theme-name i { box-shadow: inset 0 0 0 4.5px var(--text); }

.copilot-settings .copilot-settings-fonts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; width: 100%; }
.copilot-settings .copilot-settings-font { justify-items: center; gap: 3px; padding: 18px 8px 14px; border: 0; border-radius: 12px; background: var(--integration-tile, color-mix(in srgb, var(--text) 4.5%, var(--card, var(--bg)))); text-align: center; box-shadow: none; }
.copilot-settings .copilot-settings-font:hover { background: color-mix(in srgb, var(--text) 7.5%, var(--card, var(--bg))); }
.copilot-settings .copilot-settings-font:has(input:checked) { background: var(--card, var(--bg)); box-shadow: 0 0 0 2px var(--text); }
.copilot-settings .copilot-settings-font-sample { margin-bottom: 8px; font-size: 30px; }
.copilot-settings .copilot-settings-font[data-font="mono"] .copilot-settings-font-sample { font-size: 26px; }
.copilot-settings .copilot-settings-font :is(strong, small) { max-width: 100%; overflow: visible; white-space: normal; }

.copilot-settings-sizes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.copilot-settings-sizes label { position: relative; cursor: pointer; }
.copilot-settings-sizes span { display: grid; grid-template-columns: 34px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; column-gap: 10px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--text) 4.5%, var(--card, var(--bg))); transition: background .15s ease, box-shadow .15s ease; }
.copilot-settings-sizes label:hover span { background: color-mix(in srgb, var(--text) 7.5%, var(--card, var(--bg))); }
.copilot-settings-sizes b { grid-row: 1 / span 2; display: grid; place-items: center; height: 34px; color: var(--text); font: 600 15px/1 Inter, system-ui, sans-serif; }
.copilot-settings-sizes label[data-size="small"] b { font-size: 12px; }
.copilot-settings-sizes label[data-size="large"] b { font-size: 20px; }
.copilot-settings-sizes strong { color: var(--text); font-size: 13px; font-weight: 500; }
.copilot-settings-sizes small { color: var(--muted); font-size: 12px; }
.copilot-settings-sizes input:checked + span { background: var(--card, var(--bg)); box-shadow: 0 0 0 2px var(--text); }
.copilot-settings-sizes input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 3px; }
@container (max-width: 620px) {
  .copilot-settings .copilot-settings-fonts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .copilot-settings-themes { gap: 8px; }
  .copilot-settings-sizes span { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 10px 6px; }
  .copilot-settings-sizes b { grid-row: auto; height: 26px; }
}
/* Without the sidebar (tablet, phone) the same cards sit in the tab layout. */
.copilot-settings:not(.has-sidenav) .copilot-settings-fonts { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)) !important; }
.copilot-settings:not(.has-sidenav) .copilot-settings-body > .copilot-settings-preview { margin-bottom: 18px; }

/* Plugins */
.copilot-plugins-how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: none; }
.copilot-plugins-how li { display: grid; align-content: start; gap: 4px; padding: 14px 16px 15px; border-radius: 12px; background: color-mix(in srgb, var(--text) 4.5%, var(--card, var(--bg))); }
.copilot-plugins-how span { display: grid; place-items: center; width: 22px; height: 22px; margin-bottom: 6px; border-radius: 50%; background: var(--text); color: var(--bg); font: 600 11.5px/1 Inter, system-ui, sans-serif; }
.copilot-plugins-how strong { color: var(--text); font-size: 13.5px; font-weight: 600; }
.copilot-plugins-how small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.copilot-plugins-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.copilot-plugins-search { display: flex; align-items: center; gap: 8px; flex: 1 1 200px; min-width: 0; height: 36px; padding: 0 12px; border: 1px solid color-mix(in srgb, var(--line) 85%, var(--text) 8%); border-radius: 9px; background: var(--card, var(--bg)); }
.copilot-plugins-search svg { flex: none; width: 15px; height: 15px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.copilot-plugins-search input { flex: 1; min-width: 0; height: 100%; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; color: var(--text); font: 400 13.5px/1 Inter, system-ui, sans-serif; outline: none; }
.copilot-plugins-filters { display: flex; flex-wrap: wrap; gap: 4px; }
.copilot-plugins-filters button { height: 30px; padding: 0 11px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: 500 12.5px/1 Inter, system-ui, sans-serif; cursor: pointer; }
.copilot-plugins-filters button:hover { background: color-mix(in srgb, var(--text) 5%, transparent); color: var(--text); }
.copilot-plugins-filters button[aria-pressed="true"] { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
.copilot-plugins-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.copilot-plugin { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 64px; padding: 12px 14px; border-radius: 12px; background: var(--integration-tile); transition: background-color .14s ease; }
.copilot-plugin:hover { background: var(--integration-tile-hover); }
.copilot-plugin .integration-logo { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; overflow: hidden; }
.copilot-plugin .integration-logo img { width: 30px; height: 30px; object-fit: contain; }
.copilot-plugin .integration-logo.is-fill img { width: 100%; height: 100%; object-fit: cover; }
.copilot-plugin .integration-logo.is-brand i { display: block; width: 22px; height: 22px; background: #fff; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; }
.copilot-plugin-copy { min-width: 0; }
.copilot-plugin h4 { margin: 0; color: var(--text); font: 600 13.5px/1.3 Inter, system-ui, sans-serif; }
.copilot-plugin p { display: -webkit-box; margin: 2px 0 0; overflow: hidden; color: var(--muted); font-size: 12.5px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.copilot-plugin-status { align-self: start; padding: 3px 8px; border-radius: 6px; background: var(--card, var(--bg)); color: var(--muted); font: 600 11px/1.4 Inter, system-ui, sans-serif; white-space: nowrap; text-decoration: none; }
.copilot-plugin-status.is-live { display: inline-flex; align-items: center; gap: 5px; color: var(--text); }
.copilot-plugin-status.is-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #2f9e5b; }
.copilot-plugins-empty { grid-column: 1 / -1; margin: 0; padding: 22px; border-radius: 12px; background: var(--integration-tile); color: var(--muted); font-size: 13px; text-align: center; }
.copilot-plugins-custom { display: flex; align-items: center; gap: 10px; }
.copilot-plugins-custom .copilot-plugin-status { align-self: center; background: color-mix(in srgb, var(--text) 6%, transparent); }
@container (max-width: 620px) {
  .copilot-plugins-how, .copilot-plugins-grid { grid-template-columns: minmax(0, 1fr); }
}
.copilot-settings .copilot-settings-font-sample { display: grid; place-items: center; height: 36px; line-height: 1; }
.automation-run.is-waiting_delay .automation-run-dot { background: #8a8f98; opacity: 1; }
.automation-run-trigger { margin: 0 0 10px; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--text) 4%, transparent); }
.automation-run-trigger span { display: block; margin-bottom: 2px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.automation-run-trigger p { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; color: var(--text); font-size: 12.5px; line-height: 1.45; max-height: 7.5em; overflow-y: auto; }

/* Idrok steps about a TensorOS page show that page's sidebar icon. */
body.ai-chat-route .copilot-execution-steps .copilot-execution-section-icon { display: grid; place-items: center; width: 16px; height: 16px; color: var(--text); }
body.ai-chat-route .copilot-execution-steps .copilot-execution-section-icon svg { display: block; width: 16px; height: 16px; }

/* Appearance, compact: theme first, then the chat preview, font and size. */
.copilot-settings-appearance { display: grid; gap: 22px; }
.copilot-settings-appearance .copilot-settings-group-head { margin-bottom: 8px !important; }
.copilot-settings-appearance .copilot-settings-group-head h3 { font-size: 13.5px !important; }
.copilot-settings-appearance .copilot-settings-group-head p { margin-top: 2px; font-size: 12.5px; }
.copilot-settings-appearance .copilot-settings-themes { grid-template-columns: repeat(3, minmax(0, 168px)); gap: 12px; }
.copilot-settings-appearance .copilot-settings-theme { gap: 7px; }
.copilot-settings-appearance .copilot-settings-theme-art { aspect-ratio: 16 / 10; border-radius: 9px; }
.copilot-settings-appearance .copilot-settings-theme-name { gap: 7px; font-size: 12.5px; }
.copilot-settings-appearance .copilot-settings-theme-name i { width: 13px; height: 13px; }
.copilot-settings .copilot-settings-appearance .copilot-settings-preview { gap: 10px; padding: 14px 16px; border-radius: 12px; }
.copilot-settings-appearance .copilot-settings-preview figcaption { display: none; }
.copilot-settings .copilot-settings-appearance .copilot-settings-preview-user { padding: 7px 12px; border-radius: 14px; }
.copilot-settings-appearance .copilot-settings-preview-idrok { gap: 10px; }
.copilot-settings-appearance .copilot-settings-preview-idrok .idrok-brain-logo { width: 18px; height: 18px; margin-top: 3px; }
.copilot-settings-appearance .copilot-settings-preview-idrok ul { margin-top: 4px; }
.copilot-settings .copilot-settings-appearance .copilot-settings-fonts { grid-template-columns: repeat(5, minmax(0, 104px)); gap: 8px; }
.copilot-settings .copilot-settings-appearance .copilot-settings-font { gap: 1px; padding: 10px 6px 9px; border-radius: 10px; }
.copilot-settings .copilot-settings-appearance .copilot-settings-font-sample { height: 28px; margin-bottom: 4px; font-size: 22px; }
.copilot-settings .copilot-settings-appearance .copilot-settings-font[data-font="mono"] .copilot-settings-font-sample { font-size: 19px; }
.copilot-settings-appearance .copilot-settings-font strong { font-size: 12.5px; }
.copilot-settings-appearance .copilot-settings-font small { font-size: 11px; }
.copilot-settings-appearance .copilot-settings-font:has(input:checked) { box-shadow: 0 0 0 1.5px var(--text) !important; }
.copilot-settings-appearance .copilot-settings-theme:has(input:checked) .copilot-settings-theme-art { box-shadow: 0 0 0 1.5px var(--text), 0 0 0 4px color-mix(in srgb, var(--text) 10%, transparent); }
.copilot-settings-appearance .copilot-settings-sizes { display: inline-grid; grid-template-columns: repeat(3, auto); gap: 2px; padding: 3px; border-radius: 10px; background: color-mix(in srgb, var(--text) 5%, var(--card, var(--bg))); }
.copilot-settings-appearance .copilot-settings-sizes span { display: flex; align-items: baseline; gap: 7px; padding: 6px 14px; border-radius: 7px; background: transparent; }
.copilot-settings-appearance .copilot-settings-sizes label:hover span { background: color-mix(in srgb, var(--text) 4%, transparent); }
.copilot-settings-appearance .copilot-settings-sizes b { height: auto; font-size: 13px; }
.copilot-settings-appearance .copilot-settings-sizes label[data-size="small"] b { font-size: 11px; }
.copilot-settings-appearance .copilot-settings-sizes label[data-size="large"] b { font-size: 16px; }
.copilot-settings-appearance .copilot-settings-sizes strong { font-size: 12.5px; }
.copilot-settings-appearance .copilot-settings-sizes small { display: none; }
.copilot-settings-appearance .copilot-settings-sizes input:checked + span { background: var(--card, var(--bg)); box-shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 0 0 1px color-mix(in srgb, var(--line) 80%, transparent); }
@container (max-width: 620px) {
  .copilot-settings-appearance .copilot-settings-themes { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .copilot-settings .copilot-settings-appearance .copilot-settings-fonts { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)) !important; }
  .copilot-settings-appearance .copilot-settings-sizes span { display: flex; padding: 6px 10px; }
}
.copilot-settings .copilot-settings-preview-idrok .idrok-brain-logo { flex: 0 0 20px !important; align-self: flex-start !important; width: 20px !important; height: 22px !important; margin: 1px 0 0 !important; -webkit-mask-size: contain !important; mask-size: contain !important; }
/* Phones: Thinking and Effort menus keep their full width, anchored to the composer's right side. */
@media (max-width: 680px) { :is(#copilotThinkingMenu, #copilotEffortMenu).copilot-runtime-popover { width: min(236px, calc(100vw - 48px)) !important; max-width: none !important; max-height: min(60vh, 420px) !important; overflow-y: auto !important; left: auto !important; right: -4px !important; } }

/* Phones: Idrok's header is one compact row (mark beside the name), with equal-size icons. */
@media (max-width: 680px) {
  html body .copilot-header { align-items: center !important; min-height: 48px; }
  html body .copilot-header .copilot-header-copy { display: flex !important; align-items: center !important; gap: 8px !important; min-width: 0; }
  html body .copilot-header .copilot-header-copy .idrok-brain-logo { flex: 0 0 24px !important; align-self: center !important; width: 24px !important; height: 26px !important; margin: 0 !important; }
  html body .copilot-header .copilot-header-copy h2 { margin: 0 !important; line-height: 1.1 !important; }
  html body .copilot-header #copilotHistoryToggle { top: 50% !important; transform: translateY(-50%) !important; }
  html body .copilot-header #copilotHistoryToggle svg { width: 18px !important; height: 18px !important; }
}

/* Phones: the composer row is icons only (+, permission, model, thinking, effort, send), one line, 36px targets.
   Labels stay readable to screen readers; carets are dropped. */
@media (max-width: 680px) {
  html body .copilot-composer .copilot-composer-bottom { flex-wrap: nowrap !important; align-items: center !important; gap: 2px !important; min-height: 36px; }
  html body .copilot-composer .copilot-reasoning-controls { display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; align-items: center !important; gap: 2px !important; margin-left: auto !important; }
  html body .copilot-composer :is(#copilotPermission, #copilotModel, #copilotThinking, #copilotEffort).copilot-runtime-trigger { position: relative !important; display: inline-grid !important; place-items: center !important; width: 36px !important; min-width: 36px !important; max-width: 36px !important; height: 36px !important; padding: 0 !important; gap: 0 !important; border-radius: 10px !important; color: var(--muted) !important; }
  html body .copilot-composer :is(#copilotPermission, #copilotModel, #copilotThinking, #copilotEffort).copilot-runtime-trigger[aria-expanded="true"] { background: color-mix(in srgb, var(--text) 8%, transparent) !important; color: var(--text) !important; }
  html body .copilot-composer :is(#copilotPermission, #copilotModel, #copilotThinking, #copilotEffort) > span { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; }
  html body .copilot-composer :is(#copilotPermission, #copilotModel, #copilotThinking, #copilotEffort) > svg:not(.copilot-permission-icon):not(.copilot-reasoning-icon) { display: none !important; }
  html body .copilot-composer :is(#copilotPermission .copilot-permission-icon, #copilotThinking .copilot-reasoning-icon) { width: 18px !important; height: 18px !important; margin: 0 !important; }
  html body .copilot-composer :is(#copilotModel, #copilotEffort)::before { content: ""; width: 18px; height: 18px; background: currentColor; -webkit-mask: var(--idrok-icon) center / contain no-repeat; mask: var(--idrok-icon) center / contain no-repeat; }
  html body .copilot-composer #copilotModel { --idrok-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l1.8 4.6L18.5 9l-4.7 1.6L12 15.2l-1.8-4.6L5.5 9l4.7-1.4L12 3z'/%3E%3Cpath d='M18.5 15l.8 2 2 .8-2 .8-.8 2-.8-2-2-.8 2-.8.8-2z'/%3E%3C/svg%3E"); }
  html body .copilot-composer #copilotEffort { --idrok-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 17a8 8 0 1 1 15 0'/%3E%3Cpath d='M12 13l3.5-3.5'/%3E%3Ccircle cx='12' cy='13' r='1.2'/%3E%3C/svg%3E"); }
  html body .copilot-composer .copilot-attach { width: 36px !important; height: 36px !important; }
  html body .copilot-composer #copilotSend { width: 36px !important; height: 36px !important; margin-left: 4px !important; }
  /* The chat history button belongs to desktop; on phones the header keeps + and close only. */
  html body.app-page .copilot-drawer .copilot-header #copilotHistoryToggle.copilot-history-trigger, html body.app-page .copilot-header #copilotHistoryToggle { display: none !important; }
}
@media (max-width: 680px) { html body .copilot-header .copilot-header-copy { cursor: pointer; -webkit-tap-highlight-color: transparent; } }

/* Models outside the plan stay visible but locked. */
.copilot-model-popover [data-copilot-model].is-locked { cursor: not-allowed; }
.copilot-model-popover [data-copilot-model].is-locked strong { color: var(--muted) !important; }
.copilot-model-lock { margin-left: 8px; color: var(--muted); font-size: 11.5px; font-style: normal; font-weight: 450; }
.copilot-model-lock[hidden] { display: none; }
.employee-model-option.is-locked { opacity: .5; cursor: not-allowed; }

/* Idrok settings › Usage: the free monthly Pulses for Idrok chat. */
.copilot-idrok-usage { display: grid; gap: 10px; padding: 16px 0 18px; }
.copilot-idrok-usage-link { margin: 6px 0 0; padding-bottom: 16px; font-size: 13px; }
.copilot-idrok-usage-link a { color: var(--text); text-underline-offset: 2px; }
.copilot-idrok-usage-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.copilot-idrok-usage-value strong { color: var(--text); font: 650 30px/1.1 Inter, system-ui, sans-serif; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.copilot-idrok-usage-value span { color: var(--muted); font-size: 14px; }
.copilot-idrok-usage-value em { margin-left: auto; color: var(--muted); font-size: 13px; font-style: normal; font-variant-numeric: tabular-nums; }
.copilot-idrok-usage-meter { height: 8px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb, var(--text) 9%, transparent); }
.copilot-idrok-usage-meter span { display: block; height: 100%; border-radius: inherit; background: var(--text); transition: width 600ms cubic-bezier(.2, .8, .2, 1); }
.copilot-idrok-usage.is-warning .copilot-idrok-usage-meter span { background: var(--semantic-warning, #c98a12); }
.copilot-idrok-usage.is-serious .copilot-idrok-usage-meter span,
.copilot-idrok-usage.is-critical .copilot-idrok-usage-meter span { background: var(--semantic-danger, #d64545); }
.copilot-idrok-usage-detail { margin: 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .copilot-idrok-usage-meter span { transition: none; } }

/* Pulse packs: the Pulses are the headline, the price sits below. */
#page-billing .credit-package-grid button { gap: 4px; }
#page-billing .credit-package-grid strong { display: flex; flex-direction: column; gap: 1px; letter-spacing: 0; }
#page-billing .credit-package-grid strong b { letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* Phones: every composer button matches the permission button (36px target,
   18px outline icon, muted until pressed or open). Thinking and Effort menus
   use the permission menu's layout: name over description, check on the right. */
@media (max-width: 680px) {
  html body .copilot-composer .copilot-composer-bottom button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
  html body .copilot-composer #copilotAttach.copilot-attach { position: relative !important; display: inline-block !important; flex: 0 0 36px !important; width: 36px !important; height: 36px !important; padding: 0 !important; border-radius: 10px !important; background: transparent !important; color: var(--muted) !important; font-size: 0 !important; line-height: 0 !important; transform: none !important; }
  html body .copilot-composer #copilotAttach.copilot-attach::before { content: ""; position: absolute; top: 50%; left: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M12 4.5v15M4.5 12h15'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M12 4.5v15M4.5 12h15'/%3E%3C/svg%3E") center / contain no-repeat; }
  html body .copilot-composer :is(#copilotAttach, #copilotPermission, #copilotThinking, #copilotEffort):active { background: color-mix(in srgb, var(--text) 8%, transparent) !important; color: var(--text) !important; }
  html body .copilot-composer #copilotThinking .copilot-reasoning-icon { width: 18px !important; height: 18px !important; }
  html body .copilot-composer #copilotSend:active:not(:disabled) { transform: scale(.94); }

  html body :is(#copilotThinkingMenu, #copilotEffortMenu).copilot-runtime-popover { top: auto !important; right: -6px !important; bottom: calc(100% + 12px) !important; left: auto !important; display: grid; gap: 2px !important; width: min(232px, calc(100vw - 56px)) !important; max-height: min(60vh, 420px) !important; padding: 6px !important; border: 1px solid color-mix(in srgb, var(--line) 85%, var(--text) 8%) !important; border-radius: 14px !important; background: var(--card, var(--bg)) !important; box-shadow: 0 12px 32px rgba(0, 0, 0, .16), 0 2px 6px rgba(0, 0, 0, .06) !important; }
  html body :is(#copilotThinkingMenu, #copilotEffortMenu).copilot-runtime-popover[hidden] { display: none !important; }
  html body :is(#copilotThinkingMenu, #copilotEffortMenu).copilot-runtime-popover button { display: grid !important; grid-template-columns: minmax(0, 1fr) 16px !important; align-content: center; align-items: center; column-gap: 10px; row-gap: 0 !important; height: auto !important; min-height: 0 !important; padding: 9px 10px !important; border-radius: 9px !important; text-align: left !important; }
  html body :is(#copilotThinkingMenu, #copilotEffortMenu).copilot-runtime-popover strong { grid-column: 1 !important; grid-row: 1 !important; justify-self: start; text-align: left; font: 500 14px/1.25 Inter, system-ui, sans-serif !important; }
  html body :is(#copilotThinkingMenu, #copilotEffortMenu).copilot-runtime-popover small { display: block !important; grid-column: 1 !important; grid-row: 2 !important; justify-self: start; margin: 3px 0 0 !important; color: var(--muted) !important; font: 400 12.5px/1.4 Inter, system-ui, sans-serif !important; text-align: left !important; white-space: normal !important; }
  html body :is(#copilotThinkingMenu, #copilotEffortMenu).copilot-runtime-popover button::after { grid-column: 2 !important; grid-row: 1 / span 2 !important; }
}
/* Phones: a long employee status ("Status unavailable") fits or ends with an ellipsis, never cut mid-word. */
@media (max-width: 680px) { html body .employee-roster-row .emp-card-status-badge { max-width: 140px !important; white-space: nowrap !important; text-overflow: ellipsis !important; } }
/* Phones: while the chat list is open, the chat beside it is dimmed (taps there close the list). */
@media (max-width: 680px) {
  html body .copilot-drawer.is-open::after { content: ""; position: absolute; inset: 0; z-index: 84; background: rgba(0, 0, 0, .32); opacity: 0; pointer-events: none; transition: opacity 220ms ease; }
  html body .copilot-drawer.is-open:has(> .copilot-history-panel.is-open)::after { opacity: 1; }
  html body .copilot-drawer.is-open:has(> .copilot-history-panel.is-open:not(.is-settings-mode)) > .copilot-panel-content { pointer-events: none; }
}
@media (max-width: 680px) and (prefers-reduced-motion: reduce) { html body .copilot-drawer.is-open::after { transition: none; } }

/* ===== Phones, Idrok: one continuous surface ===== */
@media (max-width: 680px) {
  html body .copilot-drawer { --idrok-surface: #ffffff; }
  html[data-theme="dark"] body .copilot-drawer { --idrok-surface: #151515; }
  /* Behind Idrok is Idrok's own colour, so the strip uncovered while the
     keyboard opens or closes never shows another page. */
  html.tensoros-copilot-open, html.tensoros-copilot-open body.app-page { background: #ffffff !important; }
  html[data-theme="dark"].tensoros-copilot-open, html[data-theme="dark"].tensoros-copilot-open body.app-page { background: #151515 !important; }
  html.tensoros-copilot-open body.app-page :is(.mobile-bottom-nav, .mobile-topbar, .copilot-launcher) { visibility: hidden !important; }

  /* Header: one slim row in the chat's colour, more room for the conversation. */
  html body.ai-chat-route .copilot-drawer .copilot-panel-content { padding-top: max(4px, env(safe-area-inset-top)) !important; padding-bottom: max(8px, env(safe-area-inset-bottom)) !important; }
  html body.copilot-keyboard-open.ai-chat-route .copilot-drawer .copilot-panel-content { padding-bottom: 8px !important; }
  html body.ai-chat-route .copilot-drawer .copilot-header { min-height: 44px !important; height: 44px !important; padding: 0 2px !important; }
  html body.ai-chat-route .copilot-header-copy .idrok-brain-logo { width: 22px !important; height: 22px !important; }
  html body.ai-chat-route .copilot-header-copy h2 { font-size: 22px !important; line-height: 1 !important; }
  html body.ai-chat-route .copilot-messages { padding-top: 4px !important; }

  /* Text box: a clear, quiet card. */
  html body.ai-chat-route .copilot-composer > .copilot-composer-input { min-height: 0 !important; padding: 10px 8px 6px 14px !important; border: 1px solid #e3e4df !important; border-radius: 22px !important; background: #ffffff !important; box-shadow: 0 1px 2px rgba(20, 22, 18, .04), 0 8px 24px rgba(20, 22, 18, .07) !important; }
  html body.ai-chat-route .copilot-composer > .copilot-composer-input:focus-within { border-color: #cfd1ca !important; }
  html[data-theme="dark"] body.ai-chat-route .copilot-composer > .copilot-composer-input { border-color: #2f302d !important; background: #1d1d1c !important; box-shadow: 0 8px 24px rgba(0, 0, 0, .35) !important; }
  html[data-theme="dark"] body.ai-chat-route .copilot-composer > .copilot-composer-input:focus-within { border-color: #3d3e3a !important; }
  html body.ai-chat-route .copilot-composer #copilotInput { min-height: 26px !important; padding: 2px 4px 2px 0 !important; font: 400 16px/1.45 Inter, system-ui, sans-serif !important; }
  html body.ai-chat-route .copilot-composer .copilot-composer-bottom { margin-top: 4px !important; }
  html body.ai-chat-route .copilot-composer #copilotSend { width: 34px !important; height: 34px !important; }
  /* The busy hint repeats what the stop button says; screen readers still hear it. */
  html body .copilot-composer #copilotStatus { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; }

  /* Thinking: Idrok's mark turning beside a softly sweeping "Idrok is thinking" and the time so far. */
  html body .copilot-messages .copilot-execution-panel.is-thinking { display: flex !important; align-items: center !important; width: auto !important; max-width: 100% !important; margin: 10px 0 14px !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; }
  html body .copilot-messages .copilot-execution-panel.is-thinking :is(.copilot-execution-identity-line, .copilot-execution-chevron, .copilot-thinking-dots, .copilot-execution-steps) { display: none !important; }
  html body .copilot-messages .copilot-execution-panel.is-thinking .copilot-execution-heading { display: inline-flex !important; align-items: center !important; gap: 10px !important; min-width: 0; padding: 0 !important; border: 0 !important; background: transparent !important; }
  html body .copilot-messages .copilot-execution-panel.is-thinking .copilot-activity-mark { display: block !important; flex: none; width: 18px !important; height: 18px !important; margin: 0 !important; border: 0 !important; border-radius: 0 !important; background: var(--text) !important; -webkit-mask: url("./idrok-cubic-mark.png") center / contain no-repeat; mask: url("./idrok-cubic-mark.png") center / contain no-repeat; animation: idrokThinkTurn 2.4s cubic-bezier(.65, 0, .35, 1) infinite; }
  html body .copilot-messages .copilot-execution-panel.is-thinking .copilot-execution-title { display: inline !important; color: transparent !important; font: 500 15px/1.3 Inter, system-ui, sans-serif !important; letter-spacing: 0 !important; white-space: nowrap; background: linear-gradient(90deg, var(--muted) 0%, var(--muted) 38%, var(--text) 50%, var(--muted) 62%, var(--muted) 100%); background-size: 260% 100%; -webkit-background-clip: text; background-clip: text; animation: idrokThinkSweep 1.9s linear infinite; }
  html body .copilot-messages .copilot-execution-panel.is-thinking .copilot-execution-elapsed { display: inline !important; color: var(--muted) !important; font: 400 12.5px/1 Inter, system-ui, sans-serif !important; font-variant-numeric: tabular-nums; opacity: .75; }

  /* Chat list: × closes it; it follows the finger when swiped. */
  html body .copilot-history-drawer-head #copilotHistoryClose { display: inline-grid !important; place-items: center !important; }
  html body .copilot-history-drawer-head #copilotHistoryClose svg { display: none !important; }
  html body .copilot-history-drawer-head #copilotHistoryClose::before { content: ""; width: 18px; height: 18px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E") center / contain no-repeat; }
  html body .copilot-drawer > .copilot-history-panel { transition: transform 320ms cubic-bezier(.22, 1, .36, 1), opacity 200ms ease, visibility 0s linear 320ms !important; }
  html body .copilot-drawer.is-open > .copilot-history-panel.is-open { transition: transform 320ms cubic-bezier(.22, 1, .36, 1), opacity 200ms ease, visibility 0s !important; }
  html body .copilot-drawer > .copilot-history-panel.is-dragging { visibility: visible !important; opacity: 1 !important; transition: none !important; }
  html body .copilot-drawer.is-open.is-history-dragging::after { opacity: var(--copilot-history-progress, 0) !important; transition: none !important; }

  /* Chat options: the same card as Idrok's other menus. */
  html body .copilot-history-item .copilot-history-menu { top: 38px !important; right: 4px !important; width: 172px !important; min-width: 172px !important; max-width: 172px !important; padding: 6px !important; gap: 2px !important; border: 1px solid color-mix(in srgb, var(--line) 85%, var(--text) 8%) !important; border-radius: 14px !important; background: var(--card, var(--bg)) !important; box-shadow: 0 12px 32px rgba(0, 0, 0, .16), 0 2px 6px rgba(0, 0, 0, .06) !important; animation: idrokMenuIn .14s ease-out; }
  html body .copilot-history-item .copilot-history-menu .history-action-btn { gap: 10px !important; height: 42px !important; min-height: 42px !important; max-height: 42px !important; padding: 0 10px !important; border-radius: 9px !important; color: var(--text) !important; font: 500 14.5px/1 Inter, system-ui, sans-serif !important; }
  html body .copilot-history-item .copilot-history-menu .history-action-btn span { font-size: 14.5px !important; }
  html body .copilot-history-item .copilot-history-menu .history-action-btn svg { width: 17px !important; height: 17px !important; min-width: 17px !important; min-height: 17px !important; max-width: 17px !important; max-height: 17px !important; stroke-width: 1.7 !important; }
  html body .copilot-history-item .copilot-history-menu .history-action-btn:is(:hover, :active) { background: color-mix(in srgb, var(--text) 6%, transparent) !important; color: var(--text) !important; }
  html body .copilot-history-item .copilot-history-menu .history-action-btn.action-delete,
  html body .copilot-history-item .copilot-history-menu .history-action-btn.action-delete:is(:hover, :active) { color: #d92d20 !important; }
  html body .copilot-history-item .copilot-history-menu .history-action-btn.action-delete svg { stroke: currentColor !important; }
  html[data-theme="dark"] body .copilot-history-item .copilot-history-menu .history-action-btn.action-delete { color: #ff6b5f !important; }
  html body .copilot-history-item .copilot-history-menu.is-confirm { width: 240px !important; min-width: 240px !important; max-width: 240px !important; padding: 14px !important; }
  html body .copilot-history-menu.is-confirm .copilot-history-confirm-title { color: var(--text) !important; font: 600 15px/1.3 Inter, system-ui, sans-serif !important; }
  html body .copilot-history-menu.is-confirm .copilot-history-confirm-copy { color: var(--muted) !important; font: 400 13px/1.4 Inter, system-ui, sans-serif !important; }
  html body .copilot-history-menu.is-confirm .copilot-history-confirm-actions button { height: 40px !important; border-radius: 11px !important; font: 600 14px/1 Inter, system-ui, sans-serif !important; }
  html body .copilot-history-menu.is-confirm [data-history-delete-cancel] { background: color-mix(in srgb, var(--text) 7%, transparent) !important; color: var(--text) !important; }
}
@media (max-width: 680px) and (prefers-reduced-motion: reduce) {
  html body .copilot-messages .copilot-execution-panel.is-thinking :is(.copilot-activity-mark, .copilot-execution-title) { animation: none !important; }
  html body .copilot-messages .copilot-execution-panel.is-thinking .copilot-execution-title { color: var(--muted) !important; background: none !important; }
}
@keyframes idrokThinkTurn { 0% { transform: rotate(0deg) scale(.92); } 50% { transform: rotate(180deg) scale(1); } 100% { transform: rotate(360deg) scale(.92); } }
@keyframes idrokThinkSweep { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* Chat options: delete asks once inside the menu, then the row folds away. */
.copilot-history-menu.is-confirm { width: 224px !important; min-width: 224px !important; max-width: 224px !important; padding: 12px !important; gap: 0 !important; }
.copilot-history-confirm-title { margin: 0 0 3px; color: #f3f2eb; font: 600 13px/1.3 Inter, system-ui, sans-serif; }
.copilot-history-confirm-copy { margin: 0; color: #a1a09a; font: 400 12px/1.4 Inter, system-ui, sans-serif; }
.copilot-history-confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.copilot-history-confirm-actions button { height: 32px; border: 0; border-radius: 8px; background: #252620; color: #f3f2eb; font: 600 12.5px/1 Inter, system-ui, sans-serif; cursor: pointer; }
.copilot-history-confirm-actions button.is-danger { background: #dc2626 !important; color: #ffffff !important; }
.copilot-history-confirm-actions button.is-danger:hover { background: #c81e1e !important; }
.copilot-history-item.is-removing { height: 0 !important; min-height: 0 !important; margin-top: 0 !important; margin-bottom: 0 !important; padding-top: 0 !important; padding-bottom: 0 !important; overflow: hidden !important; opacity: 0; transform: translateX(-18px); pointer-events: none; transition: height 260ms cubic-bezier(.4, 0, .2, 1) 40ms, padding 260ms ease 40ms, margin 260ms ease 40ms, opacity 180ms ease, transform 220ms ease !important; }
@media (prefers-reduced-motion: reduce) { .copilot-history-item.is-removing { transition: none !important; } }

/* ===== Phones, Idrok settings: a list of sections, each its own page ===== */
@media (max-width: 680px) {
  html body .copilot-settings-phone { padding: 0 2px 28px; animation: idrokSettingsIn .24s cubic-bezier(.22, 1, .36, 1); }
  html body .copilot-settings-phone.is-section { animation-name: idrokSettingsPush; }
  html body .copilot-settings-phone-head { position: sticky; top: 0; z-index: 3; padding: 0 !important; border: 0 !important; display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; align-items: center; min-height: 48px; margin: 0 0 4px; background: var(--idrok-surface, var(--bg)); }
  html body .copilot-settings-phone-head h2 { grid-column: 2; margin: 0; overflow: hidden; color: var(--text); font: 600 17px/1.2 Inter, system-ui, sans-serif !important; letter-spacing: -.01em; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
  html body .copilot-settings-phone-head .copilot-settings-back { grid-column: 1; display: inline-grid; place-items: center; width: 36px; height: 36px; margin: 0; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--text); }
  html body .copilot-settings-phone-head .copilot-settings-back:active { background: color-mix(in srgb, var(--text) 7%, transparent); }
  html body .copilot-settings-phone-head .copilot-settings-back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  html body .copilot-settings-phone-head .copilot-settings-saved { grid-column: 3; justify-self: end; color: var(--muted); font: 500 12px/1 Inter, system-ui, sans-serif; }
  html body .copilot-settings-phone .copilot-settings-banner { margin: 4px 2px 0; }
  html body .copilot-settings-menu-group { margin: 18px 0 0; padding: 0; border: 0; }
  html body .copilot-settings-menu-group h3 { margin: 0 6px 8px; color: var(--muted); font: 600 12.5px/1.2 Inter, system-ui, sans-serif; letter-spacing: .01em; }
  html body .copilot-settings-group-rows { overflow: hidden; border: 1px solid color-mix(in srgb, var(--line) 90%, transparent); border-radius: 16px; background: color-mix(in srgb, var(--text) 2.5%, var(--idrok-surface, var(--bg))); }
  html body .copilot-settings-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 16px; align-items: center; gap: 12px; width: 100%; min-height: 62px; margin: 0; padding: 10px 14px; border: 0; border-radius: 0; background: transparent; color: var(--text); text-align: left; -webkit-tap-highlight-color: transparent; }
  html body .copilot-settings-row + .copilot-settings-row { box-shadow: inset 0 1px 0 color-mix(in srgb, var(--line) 85%, transparent); }
  html body .copilot-settings-row:active { background: color-mix(in srgb, var(--text) 5%, transparent); }
  html body .copilot-settings-row-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: color-mix(in srgb, var(--text) 7%, transparent); }
  html body .copilot-settings-row-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  html body .copilot-settings-row-copy { display: grid; gap: 2px; min-width: 0; }
  html body .copilot-settings-row-copy strong { overflow: hidden; font: 500 15px/1.25 Inter, system-ui, sans-serif; text-overflow: ellipsis; white-space: nowrap; }
  html body .copilot-settings-row-copy small { overflow: hidden; color: var(--muted); font: 400 12.5px/1.3 Inter, system-ui, sans-serif; text-overflow: ellipsis; white-space: nowrap; }
  html body .copilot-settings-row-chevron { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  html body .copilot-settings-phone-foot { margin: 20px 0 0; color: var(--muted); font: 400 12px/1.4 Inter, system-ui, sans-serif; text-align: center; }
}
@keyframes idrokSettingsIn { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes idrokSettingsPush { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { html body .copilot-settings-phone { animation: none !important; } }

/* Hire wizard: Role, Knowledge, Permissions, Review, Channel. One calm card
   with a five-part progress line, option cards for choices and a review list.
   Scoped to #hireWizardModal so the older layered wizard rules never leak in. */
#hireWizardModal {
  --hw-field: #fff;
  --hw-line: #dcdfd6;
  --hw-line-strong: #c9cdc1;
  --hw-accent: var(--console-accent);
  --hw-accent-text: #4f6234;
  --hw-selected: color-mix(in srgb, var(--console-accent) 7%, #fff);
  --hw-hover: #f5f6f2;
  --hw-danger: #b42318;
}
html[data-theme="dark"] #hireWizardModal {
  --hw-field: #1c1d1a;
  --hw-line: #2f302c;
  --hw-line-strong: #3d3e39;
  --hw-accent: #9fb27c;
  --hw-accent-text: #b8c99a;
  --hw-selected: color-mix(in srgb, #9fb27c 9%, #1c1d1a);
  --hw-hover: #20211e;
  --hw-danger: #ff8a7f;
}
#hireWizardModal .hire-wizard-modal { background: var(--card) !important; color: var(--text) !important; }
#hireWizardModal .hire-wizard-header {
  display: flex !important; flex-direction: column; gap: 10px;
  padding: 20px 64px 16px 28px !important;
  border-bottom: 1px solid var(--hw-line) !important;
  background: var(--card) !important;
}
#hireWizardModal .hire-step-badge {
  margin: 0 !important; color: var(--muted) !important;
  font-size: 12px !important; font-weight: 600 !important; letter-spacing: 0 !important; text-transform: none !important;
}
#hireWizardModal .hire-progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 0; padding: 0; list-style: none; }
#hireWizardModal .hire-progress li { height: 3px; border-radius: 3px; background: var(--hw-line); transition: background-color 220ms ease; }
#hireWizardModal .hire-progress li.is-done,
#hireWizardModal .hire-progress li.is-current { background: var(--hw-accent); }
#hireWizardModal .hire-wizard-modal .modal-close {
  top: 14px !important; right: 16px !important; width: 32px !important; height: 32px !important;
  display: grid; place-items: center; border-radius: 8px !important;
  color: var(--muted) !important; background: transparent !important; font-size: 22px !important; line-height: 1 !important;
}
#hireWizardModal .hire-wizard-modal .modal-close:hover { color: var(--text) !important; background: var(--hw-hover) !important; }
#hireWizardModal .hire-wizard-body { padding: 24px 28px 28px !important; background: var(--card) !important; scrollbar-gutter: auto; }
#hireWizardModal .hire-wizard-step.active { animation: hireStepIn 220ms cubic-bezier(.2, .8, .2, 1); }
@keyframes hireStepIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
#hireWizardModal .step-head { margin: 0 0 22px !important; }
#hireWizardModal .step-head h2,
#hireWizardModal .hire-hired h2 { margin: 0 0 6px !important; color: var(--text) !important; font-size: 22px !important; font-weight: 650 !important; line-height: 1.25 !important; letter-spacing: 0 !important; }
#hireWizardModal .step-head p,
#hireWizardModal .hire-hired p { margin: 0 !important; color: var(--muted) !important; font-size: 14px !important; line-height: 1.5 !important; }

#hireWizardModal .hire-step-form { display: block; }
#hireWizardModal .hire-field { display: grid; gap: 8px; margin: 0 0 20px; }
#hireWizardModal .hire-field[hidden] { display: none; }
#hireWizardModal .hire-field:last-child { margin-bottom: 0; }
#hireWizardModal .hire-label { margin: 0 !important; color: var(--text) !important; font-size: 13px !important; font-weight: 600 !important; letter-spacing: 0 !important; text-transform: none !important; }
#hireWizardModal .hire-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
#hireWizardModal .hire-count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
#hireWizardModal input[type="text"],
#hireWizardModal textarea {
  width: 100% !important; min-height: 44px !important; margin: 0 !important; padding: 11px 14px !important;
  border: 1px solid var(--hw-line-strong) !important; border-radius: 10px !important;
  background: var(--hw-field) !important; color: var(--text) !important; box-shadow: none !important;
  font: inherit !important; font-size: 14px !important; line-height: 1.5 !important;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
#hireWizardModal textarea { min-height: 112px !important; resize: vertical; }
#hireWizardModal input[type="text"]::placeholder,
#hireWizardModal textarea::placeholder { color: color-mix(in srgb, var(--muted) 82%, transparent) !important; }
#hireWizardModal input[type="text"]:focus,
#hireWizardModal textarea:focus { outline: none !important; border-color: var(--hw-accent) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--hw-accent) 18%, transparent) !important; }

/* Option cards (role, model, working mode) */
#hireWizardModal .hire-role-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
#hireWizardModal .hire-model-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
#hireWizardModal .hire-role-option,
#hireWizardModal .hire-model-option,
#hireWizardModal .hire-mode-option {
  position: relative; display: grid; align-content: start; gap: 2px; min-width: 0; margin: 0;
  padding: 12px; border: 1px solid var(--hw-line) !important; border-radius: 12px !important;
  background: var(--hw-field) !important; color: var(--text) !important; text-align: left; font: inherit; cursor: pointer;
  box-shadow: none !important; transform: none !important;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}
#hireWizardModal .hire-role-option:hover,
#hireWizardModal .hire-model-option:hover,
#hireWizardModal .hire-mode-option:hover { border-color: var(--hw-line-strong) !important; background: var(--hw-hover) !important; }
#hireWizardModal [role="radio"][aria-checked="true"] { border-color: var(--hw-accent) !important; background: var(--hw-selected) !important; box-shadow: inset 0 0 0 1px var(--hw-accent) !important; }
#hireWizardModal [role="radio"]:focus-visible { outline: 2px solid var(--hw-accent); outline-offset: 2px; }
#hireWizardModal .hire-role-option svg { width: 20px; height: 20px; margin-bottom: 8px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); }
#hireWizardModal .hire-role-option[aria-checked="true"] svg { color: var(--hw-accent-text); }
#hireWizardModal .hire-role-option strong,
#hireWizardModal .hire-model-option strong,
#hireWizardModal .hire-mode-option strong { color: var(--text); font-size: 14px; font-weight: 600; line-height: 1.3; }
#hireWizardModal .hire-role-option small,
#hireWizardModal .hire-model-option small,
#hireWizardModal .hire-mode-option small { color: var(--muted); font-size: 12px; line-height: 1.4; }
#hireWizardModal .hire-model-option { padding: 10px 12px; }

#hireWizardModal .hire-mode-list { display: grid; gap: 8px; }
#hireWizardModal .hire-mode-option { grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 12px; padding: 14px 16px; }
#hireWizardModal .hire-mode-option > span:last-child { display: grid; gap: 3px; }
#hireWizardModal .hire-mode-option em { margin-left: 6px; padding: 2px 7px; border-radius: 999px; background: color-mix(in srgb, var(--hw-accent) 13%, transparent); color: var(--hw-accent-text); font-size: 11px; font-style: normal; font-weight: 600; vertical-align: 1px; }
#hireWizardModal .hire-radio { width: 18px; height: 18px; margin-top: 1px; border: 1.5px solid var(--hw-line-strong); border-radius: 50%; transition: border-color 150ms ease, box-shadow 150ms ease; }
#hireWizardModal .hire-mode-option[aria-checked="true"] .hire-radio { border-color: var(--hw-accent); box-shadow: inset 0 0 0 4px var(--hw-field), inset 0 0 0 9px var(--hw-accent); }

/* Rules */
#hireWizardModal .rules-list { display: grid; gap: 6px; margin: 0; }
#hireWizardModal .rules-list:empty { display: none; }
#hireWizardModal .rule-item { display: flex; align-items: center; gap: 10px; min-height: 40px; margin: 0; padding: 8px 8px 8px 14px; border: 1px solid var(--hw-line) !important; border-radius: 10px; background: var(--surface) !important; color: var(--text) !important; font-size: 14px; }
#hireWizardModal .rule-item span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
#hireWizardModal .rule-item button { flex: 0 0 auto; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
#hireWizardModal .rule-item button:hover { background: var(--hw-hover); color: var(--text); }
#hireWizardModal .inline-rule-box { display: grid !important; grid-template-columns: minmax(0, 1fr) auto !important; gap: 8px !important; margin: 0 !important; padding: 0 !important; border: 0 !important; background: transparent !important; }
#hireWizardModal .inline-rule-actions { display: flex; margin: 0 !important; }
#hireWizardModal #btnSaveInlineRule { min-height: 44px !important; padding: 0 16px !important; border: 1px solid var(--hw-line-strong) !important; border-radius: 10px !important; background: var(--hw-field) !important; color: var(--text) !important; font-size: 14px !important; font-weight: 600 !important; box-shadow: none !important; }
#hireWizardModal #btnSaveInlineRule:hover { background: var(--hw-hover) !important; }

/* Knowledge */
#hireWizardModal .hire-dropzone {
  display: grid !important; justify-items: center; gap: 4px; min-height: 0 !important; padding: 24px 16px !important;
  border: 1px dashed var(--hw-line-strong) !important; border-radius: 12px !important; background: var(--surface) !important;
  text-align: center; cursor: pointer; transition: border-color 150ms ease, background-color 150ms ease;
}
#hireWizardModal .hire-dropzone:hover,
#hireWizardModal .hire-dropzone.dragover { border-color: var(--hw-accent) !important; background: var(--hw-selected) !important; }
#hireWizardModal .hire-dropzone:focus-visible { outline: 2px solid var(--hw-accent); outline-offset: 2px; }
#hireWizardModal .hire-dropzone svg { width: 22px; height: 22px; margin-bottom: 6px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#hireWizardModal .hire-dropzone .dropzone-title { margin: 0 !important; color: var(--text) !important; font-size: 14px !important; font-weight: 400 !important; }
#hireWizardModal .hire-dropzone .dropzone-title strong { color: var(--hw-accent-text); font-weight: 600; }
#hireWizardModal .hire-dropzone .dropzone-sub { color: var(--muted) !important; font-size: 12px !important; letter-spacing: 0 !important; }
#hireWizardModal .hire-file-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
#hireWizardModal .hire-file-list[hidden] { display: none; }
#hireWizardModal .hire-file { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto 28px; align-items: center; gap: 10px; min-height: 44px; padding: 6px 8px 6px 12px; border: 1px solid var(--hw-line); border-radius: 10px; background: var(--hw-field); animation: hireStepIn 200ms ease; }
#hireWizardModal .hire-file svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linejoin: round; }
#hireWizardModal .hire-file-name { min-width: 0; overflow: hidden; color: var(--text); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
#hireWizardModal .hire-file small { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
#hireWizardModal .hire-file button { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
#hireWizardModal .hire-file button:hover { background: var(--hw-hover); color: var(--text); }

/* Review */
#hireWizardModal .hire-review { margin: 0; border: 1px solid var(--hw-line); border-radius: 12px; background: var(--hw-field); }
#hireWizardModal .hire-review-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: baseline; gap: 14px; padding: 14px 16px; }
#hireWizardModal .hire-review-row + .hire-review-row { border-top: 1px solid var(--hw-line); }
#hireWizardModal .hire-review dt { color: var(--muted); font-size: 13px; }
#hireWizardModal .hire-review dd { min-width: 0; margin: 0; color: var(--text); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
#hireWizardModal .hire-review-row.is-long dd { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; color: var(--muted); }
#hireWizardModal .hire-text-btn { padding: 4px 6px; margin: -4px -6px; border: 0; border-radius: 6px; background: transparent; color: var(--hw-accent-text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
#hireWizardModal .hire-text-btn:hover { background: var(--hw-hover); }
#hireWizardModal .hire-text-btn:disabled { opacity: .6; cursor: default; }

/* Channel */
#hireWizardModal .hire-hired { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; align-items: start; margin: 0 0 22px; }
#hireWizardModal .hire-hired-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: color-mix(in srgb, var(--hw-accent) 14%, transparent); }
#hireWizardModal .hire-hired-mark svg { width: 20px; height: 20px; fill: none; stroke: var(--hw-accent-text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 20; animation: hireCheck 420ms 120ms ease-out both; }
@keyframes hireCheck { from { stroke-dashoffset: 20; } to { stroke-dashoffset: 0; } }
#hireWizardModal .hire-channel { border: 1px solid var(--hw-line); border-radius: 12px; background: var(--hw-field); overflow: hidden; }
#hireWizardModal .hire-channel-head { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 16px; }
#hireWizardModal .hire-channel-head .tg-logo { width: 36px; height: 36px; }
#hireWizardModal .hire-channel-copy { display: grid; gap: 2px; min-width: 0; }
#hireWizardModal .hire-channel-copy strong { color: var(--text); font-size: 14px; font-weight: 600; }
#hireWizardModal .hire-channel-copy small { color: var(--muted); font-size: 12px; line-height: 1.4; }
#hireWizardModal .hire-channel-action { min-height: 36px !important; padding: 0 14px !important; border: 1px solid var(--hw-line-strong) !important; border-radius: 9px !important; background: var(--hw-field) !important; color: var(--text) !important; font-size: 13px !important; font-weight: 600 !important; box-shadow: none !important; }
#hireWizardModal .hire-channel-action:hover { background: var(--hw-hover) !important; }
#hireWizardModal .hire-channel-action[hidden],
#hireWizardModal .hire-channel-status[hidden] { display: none !important; }
#hireWizardModal .hire-channel-status { display: inline-flex; align-items: center; gap: 6px; color: var(--semantic-success); font-size: 13px; font-weight: 600; }
#hireWizardModal .hire-channel-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
#hireWizardModal .hire-channel-connect { display: grid; gap: 8px; padding: 14px 16px 16px; border-top: 1px solid var(--hw-line); animation: hireStepIn 200ms ease; }
#hireWizardModal .hire-channel-connect[hidden],
#hireWizardModal .hire-channel-connected[hidden] { display: none; }
#hireWizardModal .hire-token-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
#hireWizardModal #btnHireConnectTelegram { min-height: 44px !important; padding: 0 16px !important; border: 0 !important; border-radius: 10px !important; background: var(--console-accent) !important; color: #fff !important; font-size: 14px !important; font-weight: 600 !important; white-space: nowrap; box-shadow: none !important; transform: none !important; }
#hireWizardModal #btnHireConnectTelegram:disabled { opacity: .75; }
#hireWizardModal .hire-channel-connected { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--hw-line); background: var(--surface); }
#hireWizardModal .hire-channel-connected > div { display: grid; gap: 2px; min-width: 0; }
#hireWizardModal .hire-channel-connected strong { color: var(--text); font-size: 14px; font-weight: 600; }
#hireWizardModal .hire-channel-connected span { color: var(--muted); font-size: 13px; }
#hireWizardModal #btnDisconnectTelegram { color: var(--hw-danger); }
#hireWizardModal .hire-help { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
#hireWizardModal .hire-help[hidden] { display: none; }
#hireWizardModal .hire-help a { color: var(--hw-accent-text); font-weight: 600; text-decoration: none; }
#hireWizardModal .hire-help a:hover { text-decoration: underline; }
#hireWizardModal > .hire-wizard-modal #hireConnectedNote { margin-top: 12px; }
#hireWizardModal .step-error-msg { margin: 14px 0 0 !important; padding: 10px 12px !important; border: 0 !important; border-radius: 9px !important; background: color-mix(in srgb, var(--hw-danger) 9%, transparent) !important; color: var(--hw-danger) !important; font-size: 13px !important; line-height: 1.45 !important; }
#hireWizardModal .step-error-msg[hidden] { display: none !important; }

/* Footer */
#hireWizardModal .hire-wizard-footer { display: flex !important; align-items: center; gap: 10px !important; padding: 14px 28px !important; border-top: 1px solid var(--hw-line) !important; background: var(--card) !important; }
#hireWizardModal #btnHirePrev { width: 44px !important; min-width: 44px !important; height: 44px !important; min-height: 44px !important; padding: 0 !important; border: 1px solid var(--hw-line-strong) !important; border-radius: 10px !important; background: var(--hw-field) !important; color: var(--text) !important; font-size: 18px !important; box-shadow: none !important; }
#hireWizardModal #btnHirePrev:hover { background: var(--hw-hover) !important; }
#hireWizardModal .footer-right { display: flex !important; flex: 1 1 auto; justify-content: flex-end; gap: 8px !important; margin-left: auto; }
#hireWizardModal .hire-next-btn { min-width: 112px !important; min-height: 44px !important; padding: 0 20px !important; border-radius: 10px !important; font-size: 14px !important; font-weight: 600 !important; white-space: nowrap; transform: none !important; box-shadow: none !important; }
html[data-theme="light"] #hireWizardModal .hire-next-btn:hover { background: color-mix(in srgb, var(--console-accent) 88%, #000) !important; }

@media (prefers-reduced-motion: reduce) {
  #hireWizardModal .hire-wizard-step.active,
  #hireWizardModal .hire-file,
  #hireWizardModal .hire-channel-connect,
  #hireWizardModal .hire-hired-mark svg { animation: none; }
}

@media (min-width: 681px) {
  #hireWizardModal .hire-wizard-modal { width: min(640px, calc(100vw - 48px)) !important; max-width: none !important; height: min(700px, calc(100dvh - 64px)) !important; max-height: none !important; border-radius: 16px !important; }
}

/* Phones: a full-height sheet with 16px fields so iOS never zooms on focus. */
@media (max-width: 680px) {
  #hireWizardModal.hire-wizard-overlay { align-items: end !important; padding: 0 !important; }
  #hireWizardModal .hire-wizard-modal {
    width: 100vw !important; max-width: none !important;
    height: calc(100dvh - max(12px, env(safe-area-inset-top))) !important; max-height: none !important;
    border: 0 !important; border-radius: 18px 18px 0 0 !important;
  }
  #hireWizardModal .hire-wizard-header { padding: 16px 56px 14px 20px !important; }
  #hireWizardModal .hire-wizard-modal .modal-close { top: 10px !important; right: 10px !important; width: 36px !important; height: 36px !important; }
  #hireWizardModal .hire-wizard-body { padding: 20px 20px 24px !important; }
  #hireWizardModal .step-head { margin-bottom: 18px !important; }
  #hireWizardModal .step-head h2,
  #hireWizardModal .hire-hired h2 { font-size: 21px !important; }
  #hireWizardModal input[type="text"],
  #hireWizardModal textarea { font-size: 16px !important; }
  #hireWizardModal .hire-role-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #hireWizardModal .hire-role-option svg { margin-bottom: 6px; }
  #hireWizardModal .hire-review-row { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; }
  #hireWizardModal .hire-review dt { grid-column: 1; }
  #hireWizardModal .hire-review dd { grid-column: 1 / -1; grid-row: 2; }
  #hireWizardModal .hire-review .hire-text-btn { grid-column: 2; grid-row: 1; }
  #hireWizardModal .hire-token-row { grid-template-columns: minmax(0, 1fr); }
  #hireWizardModal .hire-wizard-footer { padding: 12px 20px max(12px, env(safe-area-inset-bottom)) !important; }
  #hireWizardModal .footer-right > button,
  #hireWizardModal .hire-next-btn { min-height: 44px !important; padding: 0 20px !important; font-size: 15px !important; }
}
#hireWizardModal .hire-model-option.is-locked { cursor: not-allowed; opacity: .55; }
#hireWizardModal .hire-model-option.is-locked:hover { border-color: var(--hw-line) !important; background: var(--hw-field) !important; }

/* Admin: founder console. Neutral cards on the page surface; the chart hue is
   the only colour for data, status words carry their own dot + label. */
#page-admin {
  --admin-chart: #5b7d24;
  --admin-line: var(--line);
  --admin-soft: color-mix(in srgb, var(--text) 4%, var(--card));
  --admin-ok: var(--semantic-success);
  --admin-warn: var(--semantic-warning);
  --admin-bad: var(--semantic-danger);
}
html[data-theme="dark"] #page-admin { --admin-chart: #7a9e3c; }
#page-admin .admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
#page-admin .admin-head-actions { display: flex; align-items: center; gap: 8px; }
#page-admin .admin-range { display: inline-flex; padding: 3px; border: 1px solid var(--admin-line); border-radius: 10px; background: var(--card); }
#page-admin .admin-range[hidden] { display: none; }
#page-admin .admin-range button { min-width: 44px; height: 30px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
#page-admin .admin-range button[aria-pressed="true"] { background: var(--admin-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--admin-line); }
#page-admin .admin-refresh { display: inline-flex; align-items: center; gap: 6px; height: 38px; }
#page-admin .admin-refresh svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#page-admin .admin-refresh.is-loading svg { animation: adminSpin 900ms linear infinite; }
@keyframes adminSpin { to { transform: rotate(360deg); } }

#page-admin .admin-tabs { display: flex; align-items: center; gap: 4px; margin: 18px 0 18px; border-bottom: 1px solid var(--admin-line); }
#page-admin .admin-tabs a { position: relative; padding: 10px 12px; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; }
#page-admin .admin-tabs a:hover { color: var(--text); }
#page-admin .admin-tabs a[aria-current="page"] { color: var(--text); }
#page-admin .admin-tabs a[aria-current="page"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--text); }
#page-admin .admin-updated { margin-left: auto; color: var(--muted); font-size: 12px; }

#page-admin .admin-card { min-width: 0; padding: 18px; border: 1px solid var(--admin-line); border-radius: 14px; background: var(--card); }
#page-admin .admin-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
#page-admin .admin-card-head h3 { margin: 0; color: var(--text); font-size: 14px; font-weight: 650; }
#page-admin .admin-card-head > strong { color: var(--text); font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
#page-admin .admin-muted { margin: 0; color: var(--muted); font-size: 13px; }
#page-admin .admin-link { color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; }
#page-admin .admin-link:hover { color: var(--text); }

#page-admin .admin-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
@media (max-width: 1280px) { #page-admin .admin-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
#page-admin .admin-kpi,
#page-admin .admin-health { display: grid; gap: 6px; padding: 16px 18px; }
#page-admin .admin-kpi span,
#page-admin .admin-health span { color: var(--muted); font-size: 13px; font-weight: 500; }
#page-admin .admin-kpi strong,
#page-admin .admin-health strong { color: var(--text); font-size: 24px; font-weight: 650; line-height: 1.15; letter-spacing: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#page-admin .admin-kpi small,
#page-admin .admin-health small { color: var(--muted); font-size: 12px; line-height: 1.4; }
#page-admin .admin-kpi.is-warn small { color: var(--admin-warn); }
#page-admin .admin-health small { display: block; }
#page-admin .admin-health b { font-weight: inherit; }
#page-admin .admin-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: currentColor; vertical-align: 1px; }
#page-admin .admin-health.is-ok small { color: var(--admin-ok); }
#page-admin .admin-health.is-warn small { color: var(--admin-warn); }

#page-admin .admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px; margin-bottom: 12px; }
#page-admin .admin-grid-charts { align-items: stretch; }
#page-admin .admin-stack { display: grid; gap: 12px; min-width: 0; }

/* Charts: thin columns from one baseline, 4px rounded tops, 2px gaps. */
#page-admin .admin-chart { display: grid; gap: 8px; }
#page-admin .admin-chart .admin-card-head { margin-bottom: 4px; }
#page-admin .admin-plot { position: relative; height: 128px; padding-top: 18px; border-bottom: 1px solid var(--admin-line); }
#page-admin .admin-plot::before { content: ""; position: absolute; left: 0; right: 0; top: 18px; border-top: 1px solid color-mix(in srgb, var(--admin-line) 70%, transparent); }
#page-admin .admin-axis-max { position: absolute; top: 0; left: 0; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
#page-admin .admin-bars { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 100%; }
#page-admin .admin-bar { position: relative; display: flex; align-items: flex-end; justify-content: center; flex: 1 1 0; min-width: 0; height: 100%; outline: none; cursor: default; }
#page-admin .admin-bar i { display: block; width: 100%; max-width: 24px; border-radius: 4px 4px 0 0; background: var(--admin-chart); transition: opacity 120ms ease; }
#page-admin .admin-bars:hover .admin-bar i { opacity: .45; }
#page-admin .admin-bars .admin-bar:hover i,
#page-admin .admin-bar:focus-visible i { opacity: 1; }
#page-admin .admin-bar:focus-visible { box-shadow: inset 0 -2px 0 var(--text); }
#page-admin .admin-bars.is-dense { gap: 1px; }
#page-admin .admin-axis-x { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
#page-admin .admin-tip { position: fixed; z-index: 400; padding: 6px 9px; border-radius: 7px; background: var(--text); color: var(--card); font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }
#page-admin .admin-tip[hidden] { display: none; }

#page-admin .admin-meter-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
#page-admin .admin-meter-list li { display: grid; grid-template-columns: 88px minmax(0, 1fr) 40px; align-items: center; gap: 12px; font-size: 13px; color: var(--text); }
#page-admin .admin-meter-list strong { text-align: right; font-variant-numeric: tabular-nums; }
#page-admin .admin-meter { height: 6px; border-radius: 6px; background: var(--admin-soft); overflow: hidden; }
#page-admin .admin-meter i { display: block; height: 100%; border-radius: 6px; background: var(--admin-chart); }
#page-admin .admin-meter.is-wide { margin-top: 14px; }

#page-admin .admin-mini-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
#page-admin .admin-mini-table th { padding: 0 0 8px; color: var(--muted); font-weight: 500; text-align: right; }
#page-admin .admin-mini-table td { padding: 9px 0; border-top: 1px solid var(--admin-line); color: var(--text); text-align: right; }
#page-admin .admin-mini-table th:first-child,
#page-admin .admin-mini-table td:first-child { text-align: left; }

#page-admin .admin-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; margin: 0; }
#page-admin .admin-facts dt { margin-bottom: 3px; color: var(--muted); font-size: 12px; }
#page-admin .admin-facts dd { margin: 0; color: var(--text); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#page-admin .admin-facts dd small { color: var(--muted); font-size: 12px; font-weight: 500; }

#page-admin .admin-avatar { display: inline-grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; background: var(--admin-soft); color: var(--text); font-size: 12px; font-weight: 650; box-shadow: inset 0 0 0 1px var(--admin-line); }
#page-admin .admin-avatar.is-large { width: 52px; height: 52px; font-size: 17px; }
#page-admin .admin-person { display: grid; gap: 2px; min-width: 0; }
#page-admin .admin-person strong { overflow: hidden; color: var(--text); font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
#page-admin .admin-person small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
#page-admin .admin-people { display: grid; margin: 0; padding: 0; list-style: none; }
#page-admin .admin-people a { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 8px; margin: 0 -8px; border-radius: 9px; color: inherit; text-decoration: none; }
#page-admin .admin-people a:hover { background: var(--admin-soft); }
#page-admin .admin-person-value { display: grid; gap: 2px; text-align: right; font-variant-numeric: tabular-nums; }
#page-admin .admin-person-value strong { color: var(--text); font-size: 14px; }
#page-admin .admin-person-value small { color: var(--muted); font-size: 12px; }

#page-admin .admin-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; vertical-align: 2px; background: var(--admin-soft); color: var(--muted); box-shadow: inset 0 0 0 1px var(--admin-line); }
#page-admin .admin-badge.is-paid { background: color-mix(in srgb, var(--admin-chart) 14%, var(--card)); color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--admin-chart) 40%, var(--admin-line)); }
#page-admin .admin-status { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
#page-admin .admin-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }
#page-admin .admin-status.is-live, #page-admin .admin-status.is-active, #page-admin .admin-status.is-completed, #page-admin .admin-status.is-connected { color: var(--admin-ok); }
#page-admin .admin-status.is-error, #page-admin .admin-status.is-failed, #page-admin .admin-status.is-refunded, #page-admin .admin-status.is-revoked { color: var(--admin-bad); }
#page-admin .admin-status.is-paused, #page-admin .admin-status.is-pending, #page-admin .admin-status.is-ready, #page-admin .admin-status.is-draft { color: var(--admin-warn); }

#page-admin .admin-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
#page-admin .admin-search { position: relative; flex: 1 1 260px; }
#page-admin .admin-search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
#page-admin .admin-search input,
#page-admin .admin-toolbar select,
#page-admin .admin-field input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--admin-line); border-radius: 10px; background: var(--card); color: var(--text); font: inherit; font-size: 14px; }
#page-admin .admin-search input { padding-left: 36px; }
#page-admin .admin-toolbar select { width: auto; min-width: 132px; }
#page-admin .admin-toolbar .btn-secondary { height: 40px; }
#page-admin .admin-search input:focus,
#page-admin .admin-toolbar select:focus,
#page-admin .admin-field input:focus { outline: none; border-color: var(--text); }
#page-admin .admin-count { margin: 0 0 8px; color: var(--muted); font-size: 13px; }

#page-admin .admin-table-wrap { padding: 0; overflow-x: auto; }
#page-admin .admin-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
#page-admin .admin-table th { position: sticky; top: 0; padding: 12px 14px; border-bottom: 1px solid var(--admin-line); background: var(--card); color: var(--muted); font-weight: 500; text-align: left; white-space: nowrap; }
#page-admin .admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--admin-line); color: var(--text); white-space: nowrap; }
#page-admin .admin-table tr:last-child td { border-bottom: 0; }
#page-admin .admin-table tbody tr { cursor: pointer; transition: background-color 120ms ease; }
#page-admin .admin-table tbody tr:hover,
#page-admin .admin-table tbody tr:focus-visible { background: var(--admin-soft); outline: none; }
#page-admin .admin-user-cell { display: flex; align-items: center; gap: 10px; min-width: 220px; max-width: 320px; }
#page-admin .admin-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }

#page-admin .admin-back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; }
#page-admin .admin-back:hover { color: var(--text); }
#page-admin .admin-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#page-admin .admin-profile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 16px; margin-bottom: 12px; }
#page-admin .admin-profile h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 4px; color: var(--text); font-size: 20px; font-weight: 650; }
#page-admin .admin-profile p { margin: 0 0 4px; color: var(--text); font-size: 14px; overflow-wrap: anywhere; }
#page-admin .admin-profile small { color: var(--muted); font-size: 12px; }
#page-admin .admin-profile-action { display: grid; justify-items: end; gap: 8px; min-width: 0; }
#page-admin .admin-gift { display: grid; gap: 10px; width: min(360px, 100%); padding: 14px; border: 1px solid var(--admin-line); border-radius: 12px; background: var(--admin-soft); }
#page-admin .admin-gift p { margin: 0; color: var(--text); font-size: 14px; }
#page-admin .admin-gift p.admin-muted { color: var(--muted); font-size: 12px; }
#page-admin .admin-gift-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
#page-admin .admin-gift-presets button { height: 34px; border: 1px solid var(--admin-line); border-radius: 8px; background: var(--card); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
#page-admin .admin-gift-presets button[aria-pressed="true"] { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
#page-admin .admin-field { display: grid; gap: 5px; }
#page-admin .admin-field span { color: var(--text); font-size: 12px; font-weight: 600; }
#page-admin .admin-field small { color: var(--muted); font-weight: 400; }
#page-admin .admin-gift-actions { display: flex; justify-content: flex-end; gap: 8px; }
#page-admin .admin-gift-actions button,
#page-admin .admin-gift-open { height: 38px; }
#page-admin .admin-gift-msg { margin: 0; font-size: 13px; }
#page-admin .admin-gift-msg.is-ok { color: var(--admin-ok); }
#page-admin .admin-gift-msg.is-error { color: var(--admin-bad); }

#page-admin .admin-rows { display: grid; margin: 0; padding: 0; list-style: none; }
#page-admin .admin-rows li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--admin-line); }
#page-admin .admin-rows li:first-child { border-top: 0; padding-top: 0; }
#page-admin .admin-row-meta { display: inline-flex; align-items: center; gap: 12px; flex: 0 0 auto; color: var(--muted); font-size: 12px; }

#page-admin .admin-empty { display: grid; justify-items: center; gap: 12px; padding: 48px 16px; color: var(--muted); font-size: 14px; text-align: center; }
#page-admin .admin-empty p { margin: 0; }
#page-admin .admin-empty.is-error p { color: var(--text); }
#page-admin .admin-spinner { width: 18px; height: 18px; border: 2px solid var(--admin-line); border-top-color: var(--text); border-radius: 50%; animation: adminSpin 800ms linear infinite; }
#page-admin .is-skeleton span, #page-admin .is-skeleton strong, #page-admin .is-skeleton small { display: block; height: 10px; border-radius: 5px; background: var(--admin-soft); }
#page-admin .is-skeleton strong { width: 60%; height: 22px; }
#page-admin .is-skeleton small { width: 80%; }
#page-admin .admin-skeleton-block { min-height: 200px; background: linear-gradient(90deg, var(--card), var(--admin-soft), var(--card)); background-size: 200% 100%; animation: adminShimmer 1.4s ease infinite; }
@keyframes adminShimmer { to { background-position: -200% 0; } }

@media (max-width: 1000px) {
  #page-admin .admin-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px) {
  #page-admin .admin-head-actions { width: 100%; justify-content: space-between; }
  #page-admin .admin-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #page-admin .admin-kpi, #page-admin .admin-health { padding: 14px; }
  #page-admin .admin-kpi strong, #page-admin .admin-health strong { font-size: 20px; }
  #page-admin .admin-card { padding: 14px; border-radius: 12px; }
  #page-admin .admin-updated { display: none; }
  #page-admin .admin-toolbar select { flex: 1 1 40%; }
  #page-admin .admin-toolbar .btn-secondary { flex: 1 1 100%; }
  #page-admin .admin-search input, #page-admin .admin-field input { font-size: 16px; }
  /* Users become stacked cards on phones. */
  #page-admin .admin-table-wrap { border: 0; background: transparent; overflow: visible; }
  #page-admin .admin-table thead { display: none; }
  #page-admin .admin-table, #page-admin .admin-table tbody { display: grid; gap: 8px; }
  #page-admin .admin-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; padding: 14px; border: 1px solid var(--admin-line); border-radius: 12px; background: var(--card); }
  #page-admin .admin-table td { padding: 0; border: 0; white-space: normal; }
  #page-admin .admin-table td:first-child { grid-column: 1 / -1; }
  #page-admin .admin-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; color: var(--muted); font-size: 11px; }
  #page-admin .admin-user-cell { min-width: 0; max-width: none; }
  #page-admin .admin-profile { grid-template-columns: auto minmax(0, 1fr); }
  #page-admin .admin-profile-action { grid-column: 1 / -1; justify-items: stretch; }
  #page-admin .admin-gift { width: 100%; }
  #page-admin .admin-facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  #page-admin .admin-refresh.is-loading svg, #page-admin .admin-spinner, #page-admin .admin-skeleton-block { animation: none; }
}
/* Hire wizard: connections the backend does not support yet, shown as a roadmap. */
#hireWizardModal .hire-soon { margin-top: 14px; }
#hireWizardModal .hire-soon-label { margin: 0 0 8px; color: var(--muted); font-size: 12px; font-weight: 600; }
#hireWizardModal .hire-soon-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
#hireWizardModal .hire-soon-list li { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 1px dashed var(--hw-line-strong); border-radius: 10px; color: var(--muted); font-size: 13px; font-weight: 500; cursor: default; user-select: none; }
#hireWizardModal .hire-soon-list svg { flex: 0 0 auto; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
#hireWizardModal .hire-channel[data-view="connect"] ~ .hire-soon { display: none; }
#page-admin .admin-health strong { font-size: 20px; overflow-wrap: normal; word-break: normal; hyphens: none; }

/* Admin v2: a section sidebar inside the page and full-width sections, so
   lists never leave uneven gaps beside shorter cards. */
#page-admin .admin-layout { display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 20px; }
#page-admin .admin-nav { position: sticky; top: 16px; display: grid; gap: 2px; padding: 8px; border: 1px solid var(--admin-line); border-radius: 14px; background: var(--card); }
#page-admin .admin-nav a { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; border-radius: 9px; color: var(--muted); font-size: 14px; font-weight: 500; text-decoration: none; transition: background-color 120ms ease, color 120ms ease; }
#page-admin .admin-nav a svg { flex: 0 0 auto; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#page-admin .admin-nav a:hover { background: var(--admin-soft); color: var(--text); }
#page-admin .admin-nav a[aria-current="page"] { background: var(--admin-soft); color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 1px var(--admin-line); }
#page-admin .admin-nav .admin-updated { display: block; margin: 8px 10px 4px; color: var(--muted); font-size: 12px; }
#page-admin .admin-body { min-width: 0; }
#page-admin .admin-body > * + * { margin-top: 12px; }
#page-admin .admin-body > .admin-kpis,
#page-admin .admin-body > .admin-grid { margin-bottom: 0; }
#page-admin .admin-kpis.is-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#page-admin .admin-kpis.is-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#page-admin .admin-kpi .admin-meter { margin-top: 4px; }

#page-admin .admin-section.is-flush { padding: 0; overflow: hidden; }
#page-admin .admin-section.is-flush > .admin-card-head { margin: 0; padding: 16px 18px 12px; }
#page-admin .admin-pad { padding: 0 18px 18px; }
#page-admin .admin-table-scroll { overflow-x: auto; }
#page-admin .admin-section .admin-table th { position: static; padding: 10px 18px; border-top: 1px solid var(--admin-line); background: var(--admin-soft); font-size: 12px; }
#page-admin .admin-section .admin-table td { padding: 12px 18px; }
#page-admin .admin-table .is-num { text-align: right; }
#page-admin .admin-table tbody tr:not([data-admin-user]) { cursor: default; }
#page-admin .admin-table tbody tr:not([data-admin-user]):hover { background: transparent; }
#page-admin .admin-strong { color: var(--text); font-weight: 600; }
#page-admin .admin-warn-text { color: var(--admin-warn); font-weight: 600; }
#page-admin .admin-clamp { display: -webkit-box; max-width: 360px; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; }
#page-admin .admin-group-title { margin: 20px 0 10px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
#page-admin .admin-body > .admin-group-title:first-child { margin-top: 0; }

/* Customer journey: five steps across, each with its share of sign-ups. */
#page-admin .admin-funnel { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
#page-admin .admin-funnel li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "step copy pct" "bar bar bar"; align-items: center; gap: 8px 10px; padding: 12px; border-radius: 10px; background: var(--admin-soft); }
#page-admin .admin-funnel-step { grid-area: step; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--card); color: var(--muted); font-size: 11px; font-weight: 700; box-shadow: inset 0 0 0 1px var(--admin-line); }
#page-admin .admin-funnel li > div:not(.admin-meter) { grid-area: copy; display: grid; min-width: 0; }
#page-admin .admin-funnel strong { color: var(--text); font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
#page-admin .admin-funnel small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
#page-admin .admin-funnel .admin-meter { grid-area: bar; background: var(--card); }
#page-admin .admin-funnel em { grid-area: pct; color: var(--muted); font-size: 12px; font-style: normal; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Chart and its breakdown side by side inside one card. */
#page-admin .admin-split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr); gap: 24px; }
#page-admin .admin-split-side { padding-left: 24px; border-left: 1px solid var(--admin-line); }

/* Activity feed */
#page-admin .admin-feed { margin: 0; padding: 0 0 6px; list-style: none; }
#page-admin .admin-feed-day { padding: 10px 18px 6px; border-top: 1px solid var(--admin-line); background: var(--admin-soft); color: var(--muted); font-size: 12px; font-weight: 600; }
#page-admin .admin-feed-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--admin-line); }
#page-admin .admin-feed-day + .admin-feed-item { border-top: 0; }
#page-admin .admin-feed-item[data-admin-user] { cursor: pointer; }
#page-admin .admin-feed-item[data-admin-user]:hover,
#page-admin .admin-feed-item[data-admin-user]:focus-visible { background: var(--admin-soft); outline: none; }
#page-admin .admin-feed-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--admin-soft); color: var(--muted); box-shadow: inset 0 0 0 1px var(--admin-line); }
#page-admin .admin-feed-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#page-admin .admin-feed-icon.is-payment, #page-admin .admin-feed-icon.is-gift { color: var(--text); }
#page-admin .admin-feed-meta { display: grid; justify-items: end; gap: 2px; font-variant-numeric: tabular-nums; }
#page-admin .admin-feed-meta strong { color: var(--text); font-size: 13px; }
#page-admin .admin-feed-meta small { color: var(--muted); font-size: 12px; }

/* Gift and announcement composers with a live preview of what users see. */
#page-admin .admin-gift-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); gap: 24px; align-items: start; }
#page-admin .admin-gift-form { display: grid; gap: 12px; min-width: 0; }
#page-admin .admin-gift-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--admin-line); border-radius: 10px; background: var(--card); color: var(--text); font: inherit; font-size: 14px; line-height: 1.5; resize: vertical; }
#page-admin .admin-gift-form textarea:focus { outline: none; border-color: var(--text); }
#page-admin .admin-gift-q { margin: 0; color: var(--text); font-size: 15px; }
#page-admin .admin-gift-preview { display: grid; gap: 8px; }
#page-admin .admin-gift-preview-label { color: var(--muted); font-size: 12px; font-weight: 600; }
#page-admin .admin-gift-preview-card { display: grid; justify-items: center; gap: 8px; padding: 22px 18px; border: 1px solid var(--admin-line); border-radius: 16px; background: var(--admin-soft); text-align: center; }
#page-admin .admin-gift-preview-card strong { color: var(--text); font-size: 16px; font-weight: 650; }
#page-admin .admin-gift-preview-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-line; }
#page-admin .admin-gift-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: color-mix(in srgb, var(--admin-chart) 16%, var(--card)); color: var(--text); }
#page-admin .admin-gift-mark svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#page-admin .admin-gift-open { display: inline-flex; align-items: center; gap: 8px; align-self: center; }
#page-admin .admin-gift-open svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#page-admin .admin-profile { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
#page-admin .admin-msg { margin: 0; font-size: 13px; }
#page-admin .admin-msg.is-ok { color: var(--admin-ok); }
#page-admin .admin-msg.is-error { color: var(--admin-bad); }
#page-admin .admin-btn-sm { min-height: 30px; padding: 0 10px; font-size: 13px; white-space: nowrap; }
#page-admin .admin-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); word-break: break-all; }
#page-admin .admin-tab-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent, #2f6fed); color: #fff; font-size: 12px; font-weight: 600; line-height: 20px; text-align: center; }
#page-admin .admin-banner { padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, var(--admin-ok) 10%, var(--card)); }
#page-admin .admin-segment { display: inline-flex; flex-wrap: wrap; gap: 6px; }
#page-admin .admin-segment button,
#page-admin .admin-chips button { min-height: 34px; padding: 0 12px; border: 1px solid var(--admin-line); border-radius: 999px; background: var(--card); color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
#page-admin .admin-segment button small,
#page-admin .admin-chips button small { margin-left: 4px; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
#page-admin .admin-segment button[aria-checked="true"],
#page-admin .admin-chips button[aria-pressed="true"] { border-color: var(--text); color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
#page-admin .admin-chips { display: flex; flex-wrap: wrap; gap: 6px; }
#page-admin .admin-search.is-wide { display: block; margin-bottom: 10px; }
#page-admin .admin-pick { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
#page-admin .admin-pick button { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 12px; padding: 10px 12px; border: 1px solid var(--admin-line); border-radius: 10px; background: var(--card); text-align: left; cursor: pointer; }
#page-admin .admin-pick button:hover { background: var(--admin-soft); }
#page-admin .admin-pick-go { color: var(--text); font-size: 13px; font-weight: 600; }
#page-admin .admin-facts.is-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
#page-admin .admin-facts.is-row > div { display: grid; gap: 4px; padding: 12px; border-radius: 10px; background: var(--admin-soft); }
#page-admin .admin-facts.is-row span { color: var(--muted); font-size: 12px; }
#page-admin .admin-facts.is-row strong { color: var(--text); font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }

@media (max-width: 1100px) {
  #page-admin .admin-layout { grid-template-columns: 176px minmax(0, 1fr); gap: 18px; }
  #page-admin .admin-funnel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #page-admin .admin-kpis.is-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #page-admin .admin-split { grid-template-columns: minmax(0, 1fr); }
  #page-admin .admin-split-side { padding: 18px 0 0; border-left: 0; border-top: 1px solid var(--admin-line); }
  #page-admin .admin-gift-body { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  /* The section list becomes a sticky row of tabs above the content. */
  #page-admin .admin-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 14px; }
  #page-admin .admin-nav { top: 0; z-index: 5; display: flex; gap: 4px; overflow-x: auto; padding: 6px; scrollbar-width: none; }
  #page-admin .admin-nav::-webkit-scrollbar { display: none; }
  #page-admin .admin-nav a { flex: 0 0 auto; min-height: 34px; padding: 0 12px; }
  #page-admin .admin-nav .admin-updated { display: none; }
}
@media (max-width: 680px) {
  #page-admin .admin-nav a svg { display: none; }
  #page-admin .admin-kpis.is-four,
  #page-admin .admin-kpis.is-three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #page-admin .admin-funnel { grid-template-columns: minmax(0, 1fr); }
  #page-admin .admin-section.is-flush > .admin-card-head { padding: 14px 14px 10px; }
  #page-admin .admin-pad { padding: 0 14px 14px; }
  /* Tables become stacked rows inside their section on phones. */
  #page-admin .admin-section .admin-table thead { display: none; }
  #page-admin .admin-section .admin-table,
  #page-admin .admin-section .admin-table tbody { display: block; }
  #page-admin .admin-section .admin-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; margin: 0; padding: 12px 14px; border: 0; border-top: 1px solid var(--admin-line); border-radius: 0; background: transparent; }
  #page-admin .admin-section .admin-table td { padding: 0; border: 0; white-space: normal; text-align: left; }
  #page-admin .admin-section .admin-table td:first-child { grid-column: 1 / -1; }
  #page-admin .admin-section .admin-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; color: var(--muted); font-size: 11px; }
  #page-admin .admin-section .admin-table td:first-child::before { display: none; }
  #page-admin .admin-feed-item { padding: 10px 14px; }
  #page-admin .admin-feed-day { padding: 8px 14px 6px; }
  #page-admin .admin-profile .admin-gift-open { grid-column: 1 / -1; justify-content: center; }
}

/* Account messages: a single calm card for a Pulse gift or announcement. */
.account-message-layer { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 20px; background: rgba(12, 13, 11, .42); opacity: 0; transition: opacity 200ms ease; }
.account-message-layer.is-open { opacity: 1; }
.account-message { display: grid; justify-items: center; gap: 10px; width: min(400px, 100%); padding: 28px 24px 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); color: var(--text); text-align: center; box-shadow: 0 24px 60px rgba(20, 24, 16, .22); transform: translateY(10px) scale(.98); transition: transform 260ms cubic-bezier(.2, .8, .2, 1); }
.account-message-layer.is-open .account-message { transform: none; }
.account-message-mark { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 4px; border-radius: 50%; background: color-mix(in srgb, var(--text) 6%, var(--card)); color: var(--text); }
.account-message-mark.is-gift { background: color-mix(in srgb, #5b7d24 16%, var(--card)); }
.account-message-mark svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.account-message-layer.is-open .account-message-mark.is-gift svg { animation: accountGiftIn 600ms 120ms cubic-bezier(.2, .8, .2, 1) both; }
@keyframes accountGiftIn { from { transform: translateY(4px) rotate(-8deg) scale(.86); } 60% { transform: rotate(4deg) scale(1.06); } to { transform: none; } }
.account-message-kicker { margin: 0; color: var(--muted); font-size: 12px; font-weight: 600; }
.account-message h2 { margin: 0; color: var(--text); font-size: 21px; font-weight: 650; line-height: 1.25; letter-spacing: 0; }
.account-message-body { margin: 0; color: var(--text); font-size: 15px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.account-message-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.account-message-actions { display: flex; justify-content: center; gap: 8px; width: 100%; margin-top: 8px; }
.account-message-actions > * { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 18px; border-radius: 10px; font-size: 14px; font-weight: 600; text-decoration: none; }
@media (max-width: 680px) {
  .account-message-layer { align-items: end; padding: 12px 12px max(12px, env(safe-area-inset-bottom)); }
  .account-message-actions > * { flex: 1 1 0; }
}
@media (prefers-reduced-motion: reduce) {
  .account-message-layer, .account-message { transition: none; }
  .account-message-layer.is-open .account-message-mark.is-gift svg { animation: none; }
}
/* Journey as full-width rows: label, share bar, count and percentage. */
#page-admin .admin-funnel { grid-template-columns: minmax(0, 1fr) !important; gap: 6px; }
#page-admin .admin-funnel li { grid-template-columns: 22px minmax(150px, 220px) minmax(0, 1fr) 56px 48px; grid-template-areas: none; gap: 14px; padding: 10px 12px; }
#page-admin .admin-funnel-step { grid-area: auto; }
#page-admin .admin-funnel li > div:not(.admin-meter) { grid-area: auto; display: contents; }
#page-admin .admin-funnel li > div:not(.admin-meter) strong { order: 4; text-align: right; font-size: 15px; }
#page-admin .admin-funnel li > div:not(.admin-meter) small { order: 2; color: var(--text); font-size: 14px; }
#page-admin .admin-funnel .admin-meter { grid-area: auto; order: 3; height: 8px; }
#page-admin .admin-funnel em { grid-area: auto; order: 5; text-align: right; }
#page-admin .admin-funnel-step { order: 1; }
@media (max-width: 680px) {
  #page-admin .admin-funnel li { grid-template-columns: 22px minmax(0, 1fr) 44px 40px; gap: 8px 10px; }
  #page-admin .admin-funnel .admin-meter { grid-column: 2 / -1; grid-row: 2; order: 6; }
}
/* With the section sidebar, six tiles sit in two rows of three unless the screen is very wide. */
#page-admin .admin-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 1680px) { #page-admin .admin-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
#page-admin .admin-kpi strong { overflow-wrap: normal; word-break: keep-all; }
@media (max-width: 680px) { #page-admin .admin-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) {
  #page-admin .admin-head-actions { display: flex !important; width: 100%; justify-content: space-between; gap: 8px; margin-top: 12px; }
  #page-admin .admin-range[hidden] { display: none !important; }
  #page-admin .admin-head-actions .admin-refresh { margin-left: auto; height: 36px; }
}

/* Activity: Approvals ("Needs you"), Tasks ("Work") and Audit ("History")
   share one header and tab row. */
.activity-head { margin-bottom: 14px !important; }
.activity-tabs { display: flex; gap: 4px; margin: 0 0 20px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.activity-tabs::-webkit-scrollbar { display: none; }
.activity-tabs a { position: relative; display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; padding: 10px 12px; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; }
.activity-tabs a:hover { color: var(--text); }
.activity-tabs a[aria-current="page"] { color: var(--text); }
.activity-tabs a[aria-current="page"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--text); }
.activity-tab-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }
.activity-tab-count[hidden] { display: none; }

/* History rows: the employee's initials, a plain sentence, and a status only when it matters. */
#page-audit .audit-avatar { display: inline-grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; background: color-mix(in srgb, var(--text) 6%, var(--card)); color: var(--text); font-size: 12px; font-weight: 650; box-shadow: inset 0 0 0 1px var(--line); }
#page-audit .audit-origin { align-items: center; }
#page-audit .audit-action { font-weight: 550; }
#page-audit .audit-source { color: var(--muted); }
#page-billing .billing-refund-note { margin: 14px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
#page-billing .billing-refund-note a { color: var(--text); font-weight: 600; text-decoration: none; }
#page-billing .billing-refund-note a:hover { text-decoration: underline; }

/* Admin · Feedback: inbox states and the right-side detail inspector. */
#page-admin .admin-fb-state.is-submitted { color: var(--text); }
#page-admin .admin-fb-state.is-under_review,
#page-admin .admin-fb-state.is-awaiting_review { color: var(--admin-warn); }
#page-admin .admin-fb-state.is-planned { color: var(--admin-chart); }
#page-admin .admin-fb-state.is-resolved,
#page-admin .admin-fb-state.is-granted { color: var(--admin-ok); }
#page-admin .admin-fb-state.is-closed,
#page-admin .admin-fb-state.is-not_eligible { color: var(--muted); }
#page-admin .admin-fb-title { display: -webkit-box; min-width: 180px; max-width: 300px; overflow: hidden; color: var(--text); font-weight: 600; line-height: 1.4; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
#page-admin .admin-table td:has(.admin-fb-title) { white-space: normal; }
#page-admin .admin-table tbody tr[aria-current="true"] { background: var(--admin-soft); box-shadow: inset 2px 0 0 var(--text); }
#page-admin .admin-field textarea { width: 100%; min-height: 64px; padding: 10px 12px; border: 1px solid var(--admin-line); border-radius: 10px; background: var(--card); color: var(--text); font: inherit; font-size: 14px; line-height: 1.45; resize: vertical; }
#page-admin .admin-field textarea:focus { outline: none; border-color: var(--text); }
#page-admin .admin-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#page-admin .admin-fb-layer { position: fixed; inset: 0; z-index: 1100; pointer-events: none; }
#page-admin .admin-fb-layer[hidden] { display: none; }
#page-admin .admin-fb-scrim { position: absolute; inset: 0; border: 0; padding: 0; background: rgba(12, 13, 11, .18); pointer-events: auto; cursor: default; animation: adminFbFade 180ms ease; }
#page-admin .admin-fb-panel { position: absolute; top: 12px; right: 12px; bottom: 12px; display: flex; flex-direction: column; width: min(440px, calc(100vw - 24px)); border: 1px solid var(--admin-line); border-radius: 16px; background: var(--card); color: var(--text); box-shadow: 0 24px 60px rgba(15, 18, 12, .2); pointer-events: auto; outline: none; animation: adminFbIn 220ms cubic-bezier(.2, .8, .2, 1); }
#page-admin .admin-fb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 18px 14px; border-bottom: 1px solid var(--admin-line); }
#page-admin .admin-fb-head h3 { margin: 0; color: var(--text); font-size: 17px; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
#page-admin .admin-fb-kicker { margin: 0 0 4px; color: var(--muted); font-size: 12px; font-weight: 500; }
#page-admin .admin-fb-close { display: grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; margin: -4px -6px 0 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
#page-admin .admin-fb-close:hover { background: var(--admin-soft); color: var(--text); }
#page-admin .admin-fb-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
#page-admin .admin-fb-body { display: grid; align-content: start; gap: 16px; flex: 1 1 auto; min-height: 0; padding: 16px 18px 20px; overflow-y: auto; overscroll-behavior: contain; }
#page-admin .admin-fb-msg { padding: 9px 12px; border-radius: 10px; background: var(--admin-soft); }
#page-admin .admin-fb-who { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#page-admin .admin-fb-who .admin-user-cell { min-width: 0; max-width: none; }
#page-admin .admin-fb-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin: 0; padding: 14px; border-radius: 12px; background: var(--admin-soft); }
#page-admin .admin-fb-facts .is-wide { grid-column: 1 / -1; }
#page-admin .admin-fb-facts dt { margin-bottom: 3px; color: var(--muted); font-size: 12px; }
#page-admin .admin-fb-facts dd { margin: 0; color: var(--text); font-size: 13px; font-weight: 550; overflow-wrap: anywhere; }
#page-admin .admin-fb-block { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--admin-line); }
#page-admin .admin-fb-block h4 { margin: 0; color: var(--text); font-size: 13px; font-weight: 650; }
#page-admin .admin-fb-block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#page-admin .admin-fb-ineligible { padding: 0; border: 0; background: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; }
#page-admin .admin-fb-ineligible:disabled { opacity: .5; cursor: default; }
#page-admin .admin-fb-answers { display: grid; gap: 12px; margin: 0; }
#page-admin .admin-fb-answers dt { margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 500; }
#page-admin .admin-fb-answers dd { margin: 0; color: var(--text); font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
#page-admin .admin-fb-actions button:disabled { cursor: default; }
#page-admin .admin-fb-actions button[aria-pressed="true"] { border-color: var(--text); color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
#page-admin .admin-fb-actions button[aria-pressed="true"]:disabled { opacity: 1; }
#page-admin .admin-fb-actions button:disabled:not([aria-pressed="true"]) { opacity: .55; }
#page-admin .admin-fb-granted { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--admin-ok); font-size: 14px; font-weight: 600; }
#page-admin .admin-fb-granted svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#page-admin .admin-fb-quote { margin: 0; padding: 10px 12px; border-left: 2px solid var(--admin-line); color: var(--text); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
#page-admin .admin-fb-notes { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
#page-admin .admin-fb-notes li { padding: 10px 12px; border-radius: 10px; background: var(--admin-soft); }
#page-admin .admin-fb-notes p { margin: 0 0 4px; color: var(--text); font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
#page-admin .admin-fb-notes small { color: var(--muted); font-size: 11.5px; }
#page-admin .admin-fb-body .admin-rows li:first-child { padding-top: 10px; border-top: 1px solid var(--admin-line); }
#page-admin .admin-fb-body .admin-empty { padding: 32px 8px; }
@keyframes adminFbIn { from { opacity: 0; transform: translateX(16px); } }
@keyframes adminFbUp { from { opacity: 0; transform: translateY(24px); } }
@keyframes adminFbFade { from { opacity: 0; } }
/* The inbox becomes stacked rows below 860px: title first, then who, date, status and reward. */
@media (max-width: 860px) {
  #page-admin .admin-fb-inbox .admin-table thead { display: none; }
  #page-admin .admin-fb-inbox .admin-table, #page-admin .admin-fb-inbox .admin-table tbody { display: block; }
  #page-admin .admin-fb-inbox .admin-table tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; padding: 14px 18px; border-top: 1px solid var(--admin-line); }
  #page-admin .admin-fb-inbox .admin-table td { padding: 0; border: 0; white-space: normal; text-align: left; }
  #page-admin .admin-fb-inbox .admin-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; color: var(--muted); font-size: 11px; }
  #page-admin .admin-fb-inbox .admin-table td:nth-child(3) { order: -2; grid-column: 1 / -1; }
  #page-admin .admin-fb-inbox .admin-table td:nth-child(2) { order: -1; grid-column: 1 / -1; }
  #page-admin .admin-fb-inbox .admin-table td:nth-child(2)::before,
  #page-admin .admin-fb-inbox .admin-table td:nth-child(3)::before { display: none; }
  #page-admin .admin-fb-inbox .admin-table td:first-child { grid-column: auto; }
  #page-admin .admin-fb-inbox .admin-table td:first-child::before { display: block; }
  #page-admin .admin-fb-inbox .admin-table td:first-child .admin-sub { display: inline; margin-left: 6px; }
  #page-admin .admin-fb-inbox .admin-fb-title { min-width: 0; max-width: none; }
}
@media (max-width: 680px) {
  #page-admin .admin-fb-inbox .admin-table tr { padding: 12px 14px; gap: 8px 10px; }
  #page-admin .admin-fb-inbox .admin-table td:first-child .admin-sub { display: block; margin-left: 0; }
  #page-admin .admin-fb-title { max-width: none; white-space: normal; }
  #page-admin .admin-fb-scrim { background: rgba(12, 13, 11, .36); }
  #page-admin .admin-fb-panel { top: auto; left: 8px; right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); width: auto; max-height: 86dvh; animation-name: adminFbUp; }
  #page-admin .admin-fb-head { padding: 16px 16px 12px; }
  #page-admin .admin-fb-body { padding: 14px 16px 18px; }
  #page-admin .admin-field textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  #page-admin .admin-fb-panel, #page-admin .admin-fb-scrim { animation: none; }
}

/* Admin · sign-ups that never opened TensorOS */
#page-admin .admin-badge.is-pending { background: transparent; color: var(--muted); box-shadow: none; border: 1px dashed color-mix(in srgb, var(--muted) 55%, transparent); }
#page-admin .admin-msg.is-warn.admin-banner { background: color-mix(in srgb, var(--semantic-warning, #c98a12) 10%, transparent); color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--semantic-warning, #c98a12) 30%, transparent); }

/* Admin Billing: purchases coloured by what happened (paid / didn't pay / problem). */
#page-admin { --admin-p-paid: var(--admin-ok, #2f7d4f); --admin-p-open: var(--admin-warn, #b7791f); --admin-p-error: var(--admin-bad, #c2412d); --admin-p-refund: var(--muted); }
#page-admin .admin-pstate { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0 10px 0 6px; border-radius: 999px; font-size: 12.5px; font-weight: 650; white-space: nowrap; color: var(--admin-p-tone); background: color-mix(in srgb, var(--admin-p-tone) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--admin-p-tone) 28%, transparent); }
#page-admin .admin-pstate svg { flex: 0 0 auto; width: 16px; height: 16px; padding: 2px; border-radius: 50%; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
#page-admin .admin-pstate.is-paid { --admin-p-tone: var(--admin-p-paid); }
#page-admin .admin-pstate.is-paid svg { background: var(--admin-p-paid); stroke: var(--card, #fff); }
#page-admin .admin-pstate.is-open { --admin-p-tone: var(--admin-p-open); }
#page-admin .admin-pstate.is-error { --admin-p-tone: var(--admin-p-error); }
#page-admin .admin-pstate.is-error svg { background: var(--admin-p-error); stroke: var(--card, #fff); }
#page-admin .admin-pstate.is-refund { --admin-p-tone: var(--admin-p-refund); }
/* Rows: a coloured edge and a faint tint so the list reads at a glance. */
#page-admin .admin-prow > td:first-child { box-shadow: inset 3px 0 0 var(--admin-p-row); }
#page-admin .admin-prow { background: color-mix(in srgb, var(--admin-p-row) 4%, transparent); }
#page-admin .admin-prow.is-paid { --admin-p-row: var(--admin-p-paid); }
#page-admin .admin-prow.is-open { --admin-p-row: var(--admin-p-open); }
#page-admin .admin-prow.is-error { --admin-p-row: var(--admin-p-error); background: color-mix(in srgb, var(--admin-p-error) 6%, transparent); }
#page-admin .admin-prow.is-refund { --admin-p-row: var(--admin-p-refund); }
#page-admin .admin-prow .admin-sub { margin-top: 4px; }
/* Summary cards. */
#page-admin .admin-pkpi { position: relative; overflow: hidden; }
#page-admin .admin-pkpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--admin-p-tone); }
#page-admin .admin-pkpi.is-paid { --admin-p-tone: var(--admin-p-paid); }
#page-admin .admin-pkpi.is-open { --admin-p-tone: var(--admin-p-open); }
#page-admin .admin-pkpi.is-error { --admin-p-tone: var(--admin-p-error); }
#page-admin .admin-pkpi > span .admin-pstate { margin-left: -2px; }
#page-admin .admin-pkpi strong { color: var(--text); }
/* Legend and filter chips. */
#page-admin .admin-plegend { display: grid; gap: 8px; margin: 0; padding: 4px 18px 14px; list-style: none; }
#page-admin .admin-plegend li { display: grid; grid-template-columns: 120px minmax(0, 1fr); align-items: center; gap: 12px; color: var(--muted); font-size: 13px; line-height: 1.45; }
#page-admin .admin-plegend li .admin-pstate { justify-self: start; }
#page-admin .admin-pfilter { padding: 0 18px 14px; }
#page-admin .admin-pfilter button.is-paid[aria-pressed="true"] { border-color: var(--admin-p-paid); color: var(--admin-p-paid); box-shadow: inset 0 0 0 1px var(--admin-p-paid); }
#page-admin .admin-pfilter button.is-open[aria-pressed="true"] { border-color: var(--admin-p-open); color: var(--admin-p-open); box-shadow: inset 0 0 0 1px var(--admin-p-open); }
#page-admin .admin-pfilter button.is-error[aria-pressed="true"] { border-color: var(--admin-p-error); color: var(--admin-p-error); box-shadow: inset 0 0 0 1px var(--admin-p-error); }
@media (max-width: 680px) {
  #page-admin .admin-plegend li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  #page-admin .admin-prow { box-shadow: inset 3px 0 0 var(--admin-p-row); }
  #page-admin .admin-prow > td:first-child { box-shadow: none; }
}
#page-admin .admin-pref { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 6px; }
