/* Workspace design: shared tokens and controls for every Toolyard page. */
:root {
  color-scheme: dark;
  --bg: #101114;
  --bg-elev: #17181c;
  --bg-elev-2: #202127;
  --border: #292b32;
  --text: #ececf0;
  --muted: #989ba8;
  --accent: #706bd6;
  --accent-hover: #827ce8;
  --link: #b3adf6;
  --allowed: #79bc9d;
  --danger: #e89595;
  --pending: #d6b47b;
  --sidebar-width: 224px;
}
body { font-size: 13px; letter-spacing: -.01em; line-height: 1.5; }
[hidden] { display: none !important; }
.ui-icon { display: inline-block; flex: 0 0 auto; vertical-align: middle; }
h1, h2, h3, h4, p { overflow-wrap: anywhere; }
h1 { font-size: 23px; font-weight: 600; letter-spacing: -.6px; margin: 0; }
h2 { font-size: 19px; font-weight: 600; letter-spacing: -.4px; margin: 0 0 8px; }
h3 { font-size: 15px; font-weight: 550; margin: 0 0 8px; }
.meta { color: var(--muted); line-height: 1.6; }
button, .button-link {
  min-height: 32px; padding: 6px 11px; font-size: 12px; font-weight: 450;
  border-radius: 6px; box-shadow: none; transition: background .12s, border-color .12s;
}
button:hover { background: #282a32; border-color: #41444f; }
button.primary { font-weight: 550; }
button.danger { border-color: var(--border); }
button.danger:hover { border-color: #8e5358; background: #382326; }
button:disabled { opacity: .45; }
.button-link { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border); background: var(--bg-elev-2); color: var(--text); white-space: nowrap; }
.button-link:hover { background: #282a32; text-decoration: none; }
button .ui-icon { width: 15px; height: 15px; margin-right: 5px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; padding: 6px; background: transparent; border-color: transparent; }
.icon-button .ui-icon { margin: 0; }
.text-button { color: var(--link); background: transparent; border-color: transparent; }
input, textarea, select { border-radius: 6px; border-color: var(--border); min-height: 34px; background: #141519; }
input[type=radio], input[type=checkbox] { width: 16px; height: 16px; min-height: 0; accent-color: #9992ef; flex-shrink: 0; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid #928bdf; outline-offset: 1px; }
textarea { resize: vertical; line-height: 1.6; }
code { font-size: 12px; }
.card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 8px; padding: 20px; margin-bottom: 18px; box-shadow: none; min-width: 0; }
.card h2 { font-size: 16px; }
.card > p.meta { margin-top: 0; }
.badge { border-radius: 4px; font-size: 11px; padding: 2px 7px; }
.badge.allowed, .badge.pending, .badge.denied { border-color: var(--border); background: #ffffff04; }
.empty { color: var(--muted); padding: 32px 16px; }
.app-shell { min-height: 100dvh; }
.app-shell > header {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); height: 100dvh;
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  padding: 20px 12px 14px; background: #15161a; border-right: 1px solid var(--border);
  border-bottom: 0; overflow-y: auto; z-index: 40;
}
.app-shell .brand { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 600; letter-spacing: -.4px; padding: 2px 8px; background: transparent; border: 0; text-align: left; }
.brand-symbol { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 7px; background: #746edf; color: white; font-size: 23px; font-weight: 600; }
.stage-label { display: flex; align-items: center; gap: 6px; margin: 4px 10px 12px; color: #aaa6c7; font-size: 11px; }
.stage-dot { width: 5px; height: 5px; border-radius: 50%; background: #aaa0ef; }
.app-shell header > nav { display: flex; flex-direction: column; align-items: stretch; gap: 3px; flex: 1; margin: 0; width: 100%; }
.app-shell header nav button { display: flex; align-items: center; gap: 9px; text-align: left; padding: 8px 10px; min-height: 36px; border: 0; color: #a7a9b4; background: transparent; font-size: 13px; }
.app-shell header nav button .ui-icon { margin: 0; color: #9093a2; }
.app-shell header nav button:hover { background: #212228; color: var(--text); }
.app-shell header nav button.active { color: #eeecff; background: #292736; font-weight: 500; }
.app-shell header nav button.active .ui-icon { color: #b8b1f4; }
.nav-text { flex: 1; }
.nav-count { font-size: 11px; background: #ffffff09; border-radius: 4px; padding: 0 5px; color: #c5c2d4; }
.nav-label { color: #7c7f8d; font-size: 11px; font-weight: 500; margin: 16px 10px 5px; text-transform: none; letter-spacing: 0; }
.sidebar-footer { margin-top: auto; padding: 16px 6px 0; border-top: 1px solid var(--border); }
.sidebar-footer .stream-status { font-size: 11px; margin-bottom: 14px; display: inline-flex; align-items: center; gap: 6px; }
.sidebar-account { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.sidebar-account .user-chip { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; }
.account-copy { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.app-shell > main { margin: 0 0 0 var(--sidebar-width); width: calc(100% - var(--sidebar-width)); max-width: none; padding: 32px 40px 72px; min-width: 0; }
.workspace-page { max-width: 1240px; margin: 0 auto; }
.workspace-page-heading { margin: 0 0 24px; }
.workspace-page-heading p { font-size: 13px; margin: 7px 0 0; }
.section-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--border); margin: 0 0 26px; overflow-x: auto; }
.section-tabs button { background: transparent; border: 0; border-radius: 0; padding: 8px 0 12px; color: var(--muted); white-space: nowrap; }
.section-tabs button:hover { color: var(--text); }
.section-tabs button.active { color: var(--text); box-shadow: 0 2px 0 #a29bdd; }
.page-primary-card { background: transparent; border: 0; padding: 0; }
.page-primary-card .agent-add-bar { justify-content: flex-end; margin-bottom: 16px; }
.table-scroll { overflow-x: auto; max-width: 100%; border: 1px solid var(--border); border-radius: 7px; }
.table-scroll table { margin: 0 !important; }
table { font-size: 12px; }
th, td { padding: 12px 14px; }
th { text-transform: none; font-weight: 500; font-size: 11px; background: #1a1b20; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #ffffff02; }
.table-scroll code { overflow-wrap: anywhere; }
.audit-table { min-width: 900px; }
.users-table { min-width: 1000px; }
.audit-filters { gap: 8px; margin-bottom: 16px; }
.audit-filters input { min-width: 0; }
.policy-seg { white-space: nowrap; }
.policy-seg button { min-height: 29px; }
.workbench { grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 18px; }
.workbench .tool-list { max-height: calc(100dvh - 255px); min-height: 220px; }
.workbench .tool-list .item { display: block; width: 100%; text-align: left; background: transparent; font-weight: 400; }
.workbench .tool-list .item.active { background: #2a2737; border-color: transparent; }
.workbench .tool-list .item .name { overflow-wrap: anywhere; }
.workbench .pane { min-width: 0; padding: 22px; }
.workbench .pane .desc { line-height: 1.7; }
.workbench .field { margin-top: 16px; }
.connection-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 18px; align-items: center; padding: 18px 0; border-top: 1px solid var(--border); }
.connection-name { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.connection-name strong { font-size: 14px; font-weight: 550; overflow-wrap: anywhere; }
.connection-manage summary { cursor: pointer; padding: 6px 8px; color: var(--muted); font-size: 12px; }
.connection-manage[open] { grid-column: 1/-1; }
.connection-panel { margin-top: 10px; padding: 18px; background: #1b1c22; border: 1px solid var(--border); border-radius: 7px; }
.connection-controls { display: flex; gap: 20px; flex-wrap: wrap; }
.connection-controls > div { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.connection-setup { border: 1px solid var(--border); border-radius: 7px; margin: 14px 0; background: var(--bg-elev); }
.connection-setup > summary { cursor: pointer; padding: 15px 18px; font-weight: 500; color: #b7b9c4; }
.connection-setup > .card { margin: 0; border: 0; border-top: 1px solid var(--border); border-radius: 0 0 7px 7px; }
.connection-setup .catalog-grid { grid-template-columns: repeat(auto-fill,minmax(230px,1fr)); }
.modal-bg { backdrop-filter: blur(4px); background: #00000080; z-index: 80; }
.modal { background: #1b1c21; border-color: #393b46; border-radius: 10px; padding: 24px; max-height: calc(100dvh - 48px); overflow-y: auto; box-shadow: 0 20px 80px #0006; }
.mobile-account { display: flex; gap: 10px; align-items: center; border-top: 1px solid var(--border); padding-top: 16px; margin-top: 12px; }
.mobile-account > span { flex: 1; }
/* Settings use a quiet second column, with one focused panel at a time. */
.page-settings { max-width: 1140px; }
.settings-layout { display: grid; grid-template-columns: 198px minmax(0, 1fr); gap: 44px; align-items: start; }
.settings-nav { position: sticky; top: 28px; }
.settings-nav > input { background: transparent; margin: 0 0 15px; font-size: 12px; }
.settings-nav nav { display: flex; flex-direction: column; gap: 4px; }
.settings-nav nav { scrollbar-width: none; }
.settings-nav nav::-webkit-scrollbar { display: none; }
.pricing-status { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.pricing-status p { flex-basis: 100%; margin: 0; }
.pricing-filters { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(160px, 2fr); gap: 12px; margin: 18px 0; }
.pricing-filters label { min-width: 0; display: grid; gap: 6px; font-size: 12px; }
.pricing-filters input, .pricing-filters select { width: 100%; min-width: 0; }
.pricing-table td:not(:first-child), .pricing-table th:not(:first-child) { white-space: nowrap; text-align: right; }
.pricing-table td:first-child { min-width: 200px; }
.pricing-table code { font-size: 11px; }
.pricing-pagination { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.pricing-source { margin-top: 16px; }
.settings-nav nav button { display: flex; align-items: center; text-align: left; gap: 9px; border: 0; padding: 9px 10px; font-size: 12px; }
.settings-nav nav button .ui-icon { margin: 0; width: 16px; height: 16px; }
.settings-nav nav button.active { color: #d4cef8; background: #282535; }
.settings-draft-dot { margin-left: auto; width: 5px; height: 5px; background: #d6b47b; border-radius: 50%; }
.settings-stage-note { padding: 20px 8px; margin-top: 20px; border-top: 1px solid var(--border); }
.settings-stage-note .meta { font-size: 11px; }
.settings-content { min-width: 0; max-width: 780px; }
.settings-panel-heading { margin-bottom: 28px; }
.settings-panel-heading h2 { font-size: 20px; margin-bottom: 6px; }
.settings-panel-heading p { margin: 0; font-size: 13px; }
.settings-section { border: 0; border-top: 1px solid var(--border); padding: 24px 0 12px; margin: 0 0 20px; background: transparent; }
.settings-section-head { margin-bottom: 14px; }
.settings-section-head h3 { margin: 0 0 5px; }
.settings-section-head p { margin: 0; }
.settings-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
.settings-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 16px 0; }
.settings-row + .settings-row { border-top: 1px solid #ffffff06; }
.settings-row-copy { flex: 1 1 50%; min-width: 0; }
.settings-row-title { font-weight: 500; font-size: 13px; }
.settings-row-copy p { margin: 5px 0 0; max-width: 350px; font-size: 12px; }
.settings-row-control { flex: 0 1 260px; min-width: 0; width: 260px; }
.settings-row-control > textarea { font-family: inherit; min-height: 96px; }
.settings-row-control:has(.settings-switch) { flex: 0 0 32px; width: 32px; }
.settings-switch { display: inline-flex; position: relative; cursor: pointer; margin-top: 3px; }
.settings-switch input { position: absolute; inset: 0; opacity: 0; width: 32px; height: 18px; margin: 0; cursor: pointer; }
.switch-track { display: block; width: 32px; height: 18px; border-radius: 999px; background: #363842; border: 1px solid #494b55; pointer-events: none; }
.switch-track::after { content: ''; display: block; width: 12px; height: 12px; margin: 2px; border-radius: 50%; background: #c1c3cd; transition: transform .15s; }
.settings-switch input:checked + .switch-track { background: #726bca; border-color: #837bd9; }
.settings-switch input:checked + .switch-track::after { transform: translateX(14px); background: white; }
.settings-switch input:focus-visible + .switch-track { outline: 2px solid var(--link); outline-offset: 3px; }
.settings-choices { display: flex; flex-direction: column; gap: 9px; margin: 18px 0; }
.settings-choice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--border); border-radius: 7px; background: #15161b; cursor: pointer; }
.settings-choice:hover { border-color: #494653; }
.settings-choice.selected { background: #221f30; border-color: #655b95; }
.settings-choice input { margin: 3px 0 0; }
.settings-choice strong { font-weight: 500; display: block; }
.settings-choice small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.settings-savebar { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--border); padding: 18px 0; margin-bottom: 30px; }
.settings-status { color: var(--muted); font-size: 12px; }
.error, .settings-status.error { color: #e7a1a1; }
.settings-status.saved { color: var(--allowed); }
.settings-savebar .row { flex-shrink: 0; }
.settings-time-range { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.settings-time-range label { flex: 1; min-width: 94px; }
.settings-time-range input { padding: 5px; }
.settings-row-control .text-button { font-size: 11px; padding-left: 0; }
.settings-notice { background: #1b1c24; border: 1px solid var(--border); padding: 14px; border-radius: 7px; font-size: 12px; margin: 15px 0; }
.settings-notice button { margin-left: 10px; }
.settings-advanced { border-top: 1px solid var(--border); padding-top: 15px; margin-top: 8px; }
.settings-advanced summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.settings-section-actions { display: flex; justify-content: flex-end; margin: 16px 0; }
.settings-empty { padding: 36px 20px; background: #15161b; border: 1px dashed #32343c; border-radius: 7px; text-align: center; }
.settings-empty > .ui-icon { color: var(--muted); margin-bottom: 15px; width: 24px; height: 24px; }
.settings-empty h3 { margin: 0 0 6px; }
.settings-empty p { margin: 0; }
.settings-secret-form { border: 1px solid var(--border); border-radius: 7px; padding: 20px; margin: 18px 0; background: #18191f; }
.settings-secret-field { display: block; margin: 14px 0; font-size: 12px; }
.settings-secret-field input { margin-top: 7px; }
.settings-reference { border-top: 1px solid var(--border); padding-top: 20px; margin-top: 24px; }
.settings-secret-list .badge { margin-left: 8px; }
.settings-import { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.settings-import label { flex: 1; min-width: 180px; font-size: 12px; }
.settings-import input, .settings-import select { margin-top: 8px; }
.settings-content > div > .card { background: transparent; border: 0; border-top: 1px solid var(--border); padding: 24px 0; border-radius: 0; }
/* Inbox and question review retain the same spacing and control language. */
.ib { max-width: 1040px; margin: 0 auto; }
.ib-head { margin: 0 0 26px; }
.ib-head h2 { font-size: 23px; font-weight: 600; }
.ib-chips { gap: 6px; margin-bottom: 20px; }
.ib-chip { background: transparent; border: 0; border-radius: 5px; color: var(--muted); padding: 6px 10px; }
.ib-chip.on { color: #d3cef6; background: #282535; }
.ib-chip .n { background: transparent; color: inherit; margin-left: 5px; }
.ib-list { gap: 0; border-top: 1px solid var(--border); }
.ib-card { padding: 18px 16px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; box-shadow: none; }
.ib-card:hover { background: #18191f; transform: none; }
.ib-card h3 { font-size: 14px; line-height: 1.6; }
.ib-card .ib-flags { opacity: .8; }
.ib-detail { max-width: 820px; animation: none; }
.ib-dtop { background: var(--bg); top: 0; border: 0; }
.ib-dbody { padding: 10px 0; }
.ib-dh h2 { font-size: 25px; line-height: 1.35; margin-top: 20px; }
.ib-sec { margin: 26px 0; border: 0; background: transparent; }
.ib-eyebrow { color: #a09cab; font-size: 10px; font-weight: 600; letter-spacing: .07em; }
.ib-readbar, .ib-jumpsm, .ib-jump { display: none !important; }
.ib-voice { box-shadow: none; }
.optional-audio { margin: 18px 0; color: var(--muted); }
.optional-audio summary { cursor: pointer; font-size: 12px; }
.answer-section { border: 1px solid #34313f; border-radius: 8px; background: #18181e; padding: 24px; }
.answer-options { padding: 0; margin: 16px 0; border: 0; min-width: 0; }
.answer-options legend { font-size: 14px; font-weight: 550; margin-bottom: 14px; padding: 0; }
.answer-option { display: flex; align-items: flex-start; gap: 11px; padding: 13px 14px; margin: 8px 0; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; background: #1c1d23; }
.answer-option:hover { border-color: #555264; }
.answer-option.selected { border-color: #7c76cf; background: #292638; }
.answer-option input { margin: 3px 0 0; }
.answer-option strong { font-weight: 500; }
.answer-option small { display: block; font-size: 12px; color: var(--muted); line-height: 1.5; margin-top: 4px; }
.answer-option .option-recommended { display: inline; margin-left: 10px; color: #b6aef7; font-size: 10px; }
.answer-section > label { display: block; margin: 20px 0 8px; font-weight: 500; }
.answer-section textarea { padding: 12px; min-height: 110px; background: #131418; }
.answer-section .ib-btns { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; }
.answer-error { color: #e7a1a1; margin: 10px 0; }
.ib-result { white-space: pre-wrap; overflow-wrap: anywhere; }
.task-context { margin-top: 12px; }
.ib-empty { padding: 60px 24px; border: 1px dashed var(--border); border-radius: 8px; }
.ib-dbody > section:empty { display: none; }
@media (max-width: 1150px) and (min-width: 769px) {
  :root { --sidebar-width: 200px; }
  .app-shell > main { padding: 28px 26px 70px; }
  .settings-layout { grid-template-columns: 170px minmax(0,1fr); gap: 28px; }
  .settings-row { flex-wrap: wrap; gap: 12px; }
  .settings-row-control { flex-basis: 100%; width: 100%; }
  .settings-row-control:has(.settings-switch) { flex-basis: 32px; }
}
@media (max-width: 768px) {
  .pricing-filters { grid-template-columns: minmax(0,1fr); }
  .app-shell > header { position: relative; width: 100%; height: auto; padding: calc(12px + env(safe-area-inset-top,0px)) 16px 12px; flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--border); gap: 10px; overflow: visible; }
  .app-shell header > nav, .sidebar-footer { display: none; }
  .app-shell .brand { padding: 0; min-height: 32px; }
  .stage-label { margin: 0 0 0 auto; font-size: 10px; }
  .app-shell > main { margin: 0; width: 100%; padding: 24px 16px calc(100px + env(safe-area-inset-bottom,0px)); }
  .workspace-page-heading { margin-bottom: 20px; }
  .workspace-page-heading h1 { font-size: 22px; }
  .workspace-page-heading p { font-size: 12px; }
  .section-tabs { gap: 20px; margin-bottom: 22px; }
  .card { padding: 16px; }
  .page-primary-card { padding: 0; }
  .table-scroll { overflow-x: auto; }
  .table-scroll table { min-width: 620px; }
  .table-scroll .audit-table { min-width: 900px; }
  .table-scroll .users-table { min-width: 1000px; }
  .workbench { grid-template-columns: minmax(0,1fr); }
  .workbench .tool-list { max-height: 210px; min-height: 0; }
  .workbench .pane { padding: 16px; }
  .connection-row { gap: 8px; }
  .connection-panel { padding: 14px; }
  .connection-controls { gap: 16px; }
  .connection-setup .catalog-grid { grid-template-columns: minmax(0,1fr); }
  .modal { width: calc(100% - 24px); padding: 20px; max-height: calc(100dvh - 32px); }
  .bottom-nav { display: block; background: #17181cf5; border-color: var(--border); backdrop-filter: blur(14px); }
  .bottom-nav .row > button { flex: 1; }
  .bottom-nav button .ui-icon { width: 20px; height: 20px; margin: 0 0 4px; }
  .bottom-nav button.active { color: #b6afff; }
  .bottom-nav .badge-count { background: #746bcc; border-color: var(--bg); }
  .settings-layout { grid-template-columns: minmax(0,1fr); gap: 26px; }
  .settings-nav { position: static; min-width: 0; }
  .settings-nav > input { margin-bottom: 12px; }
  .settings-nav nav { flex-direction: row; overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap; gap: 4px; padding-bottom: 0; }
  .settings-nav nav button { flex-shrink: 0; white-space: nowrap; min-height: 38px; }
  .settings-stage-note { display: none; }
  .settings-panel-heading { margin-bottom: 20px; }
  .settings-section { padding-top: 20px; }
  .settings-row { flex-wrap: wrap; gap: 12px; }
  .settings-row-control { flex: 1 1 100%; width: 100%; }
  .settings-row-control:has(.settings-switch) { flex: 0 0 32px; }
  .settings-row-copy { min-width: 170px; }
  .settings-savebar { align-items: flex-start; flex-direction: column; gap: 14px; }
  .settings-savebar > .row { width: 100%; justify-content: flex-end; }
  .settings-savebar button { min-height: 40px; }
  .settings-import label { min-width: 100%; }
  .settings-empty { padding: 28px 16px; }
  .ib-head h2, .ib-dh h2 { font-size: 23px; }
  .ib-chips { overflow: auto; flex-wrap: nowrap; gap: 0; }
  .ib-chip { flex-shrink: 0; }
  .ib-card { padding: 16px 4px; }
  .ib-dbody { padding: 0; }
  .answer-section { padding: 17px; }
  .answer-section .ib-btns { flex-wrap: wrap; }
  .answer-section .ib-btns button { min-height: 42px; }
  .answer-section .ib-btns .primary { flex: 1; }
  .answer-option { padding: 13px 10px; }
  .ib-trow { overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

.login-brand { display: flex; align-items: center; gap: 10px; justify-content: center; }
#secret-edit-value { margin-top: 8px; }
