/* Roomier: black surfaces, readable type, and comfortable controls for every agent. */
:root:not([data-theme="light"]) {
  color-scheme: dark;
  --bg: #080809; --side-bg: #101012; --panel: #1b1b1e;
  --text: #ededef; --text-2: #a3a3ac; --text-3: #7e7e88;
  --hairline: #ffffff12; --fill: #ffffff0d; --fill-2: #ffffff08;
  --bubble-user: #252528; --bubble-in: #1b1b1e; --bubble-in-text: #ededef;
  --code-bg: #141416; --accent: #f5f5f5; --accent-press: #dedee2; --on-accent: #101011;
  --blue: #99caff; --blue-press: #b4d8ff; --frost: #080809;
  --card-shadow: 0 8px 32px #0005;
}
:root { --display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
body { font-family: var(--display); font-size: 16px; line-height: 1.6; }
button, input, textarea, select { font-family: inherit; }
.ui-icon { width: 20px; height: 20px; flex-shrink: 0; display: block; pointer-events: none; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
#sidebar { width: 264px; min-width: 264px; }
#side-top { padding: 20px 14px 12px; }
.side-titlebar { margin-bottom: 17px; }
.side-titlebar h1 { font-size: 22px; font-weight: 550; letter-spacing: -.5px; }
#sidebar-collapse, #new-chat-btn { width: 40px; height: 40px; border-radius: 9px; background: transparent; }
#new-chat-btn:hover, #sidebar-collapse:hover { background: var(--fill); }
#mode-btn { border: 0; background: transparent; box-shadow: none; font-size: 14px; min-height: 42px; padding: 9px 10px; }
#mode-btn .mode-ico { display: inline-flex; align-items: center; }
#mode-btn .chev { margin-left: auto; }
#search { min-height: 44px; border-radius: 11px; background: var(--fill); font-size: 15px; }
#tools-disclosure, #saved-messages { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px; font-size: 14px; }
#tools-disclosure::after { margin-left: auto; font-size: 16px; }
#tools-disclosure .ui-icon, #saved-messages .ui-icon { width: 19px; height: 19px; }
#tool-dock { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 3px; padding-block: 5px; }
.dock-btn { flex-direction: row; gap: 9px; min-height: 42px; padding: 7px 8px; border-radius: 9px; }
.dock-ico { width: 23px; height: 25px; border-radius: 0; background: none; }
.dock-ico svg { width: 20px; height: 20px; }
.dock-label { font-size: 12px; font-weight: 450; letter-spacing: 0; }
#side-scroll section h3 { font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; margin-block: 17px 8px; }
.row { border-radius: 10px; padding: 12px; }
.row.active { background: var(--fill); }
.row-title { font-size: 14px; font-weight: 450; }
.row-sub { font-size: 12px; margin-top: 4px; }
.row-menu { top: 8px; width: 30px; height: 30px; }
#chat-rail { display: none; width: 65px; min-width: 65px; background: var(--side-bg); border-right: 1px solid var(--hairline); padding: 74px 10px 15px; flex-direction: column; gap: 12px; }
#chat-rail button { width: 44px; height: 44px; display: grid; place-items: center; color: var(--text-2); border: 0; background: none; border-radius: 9px; cursor: pointer; }
#chat-rail button:hover { background: var(--fill); color: var(--text); }
#app.sidebar-collapsed #chat-rail { display: flex; }
.sidebar-reveal { width: 44px; height: 44px; top: 15px; left: 10px; border: 0; box-shadow: none; background: transparent; }
#conv-header { min-height: 74px; gap: 7px; padding: 12px 23px; background: var(--bg); border-bottom: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
#conv-title { font-size: 18px; font-weight: 550; }
#conv-subtitle { margin-top: 5px; }
.agent-chip { min-height: 28px; font-size: 12px; padding: 4px 8px; border-radius: 8px; background: transparent; }
#rec-btn, #jump-btn, #info-btn { min-width: 42px; height: 42px; border-radius: 9px; background: transparent; padding: 0; }
#rec-btn > span { display: none; }
#rec-btn svg, #jump-btn svg, #info-btn svg { width: 21px; height: 21px; }
#settings-strip { padding: 4px 23px 12px; gap: 10px; border-bottom: 1px solid var(--hairline); align-items: center; }
.settings-summary { min-height: 38px; font-size: 13px; padding: 8px 11px; border-radius: 9px; gap: 7px; background: var(--fill-2); }
.settings-summary .setting-chevron { margin-left: 2px; width: 14px; height: 14px; }
#context-button { display: inline-flex; gap: 7px; align-items: center; min-height: 40px; font-size: 13px; padding: 8px; }
#context-button svg { width: 17px; height: 17px; }
#context-drawer { padding: 20px 24px; }
#messages { padding: 25px 30px 30px; min-height: 0; }
.msg-col { width: 100%; max-width: 740px; }
.thread-item, .steered-message { display: flex; flex-direction: column; min-width: 0; }
.thread-item { margin-bottom: 24px; }
.day-sep { margin: 6px 0 22px; font-size: 12px; font-weight: 400; }
.bubble.user { max-width: 82%; padding: 13px 19px; border-radius: 24px; font-size: 16px; line-height: 1.6; margin-bottom: 2px; }
.prose { padding: 0; margin-bottom: 10px; }
.prose .md { font-size: 17px; line-height: 1.75; }
.md p { margin: 12px 0; }
.prose .md h1 { font-size: 28px; }
.prose .md h2 { font-size: 25px; }
.prose .md h3 { font-size: 21px; }
.prose .md h4 { font-size: 18px; }
.prose .md h1, .prose .md h2, .prose .md h3, .prose .md h4 { font-weight: 550; line-height: 1.4; letter-spacing: -.3px; margin: 24px 0 12px; }
.prose .md > :first-child { margin-top: 0; }
.md li { margin-block: 8px; }
.md ul, .md ol { margin-block: 16px; padding-left: 24px; }
.md pre { font-size: 13px; line-height: 1.65; padding: 16px; }
.md code { font-size: .85em; }
.md pre code { font-size: inherit; }
.codewrap pre { padding-top: 36px; }
.md hr { margin-block: 23px; }
.msg-actions { font-size: 12px; font-weight: 450; gap: 8px; margin: 0 0 14px; }
.msg-actions time { margin-left: auto; font-size: 11px; }
.reply-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 15px; }
.message-tools { opacity: 1; margin: 0; gap: 4px; flex-wrap: wrap; }
.user-tools { align-self: flex-end; margin: 3px 0 4px; }
.reply-tools .msg-copy, .reply-tools .msg-reply, .reply-tools .msg-speak, .message-tools button {
  display: inline-grid; place-items: center; width: 38px; height: 38px; min-height: 38px; padding: 0;
  opacity: 1; border: 0; border-radius: 8px; background: none; color: var(--text-2); cursor: pointer;
}
.reply-tools button:hover, .message-tools button:hover, .message-tools button[aria-pressed="true"] { background: var(--fill); color: var(--text); }
.message-tools .ui-icon, .reply-tools .ui-icon { width: 18px; height: 18px; }
.message-tools button[aria-pressed="true"] .ui-icon { fill: var(--fill); }
.message-editor { margin-top: 12px; width: 100%; }
.message-editor textarea { font-size: 16px; }
.message-editor button { width: auto; padding: 9px 13px; }
.steps > summary, .extra > summary { font-size: 12px; padding: 7px 11px; }
.steps > summary { display: inline-flex; align-items: center; gap: 7px; }
.steps > summary .ui-icon { width: 15px; height: 15px; }
#work-progress { font-size: 13px; padding: 12px 25px; }
#composer-wrap { border: 0; background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; padding: 14px 24px calc(20px + env(safe-area-inset-bottom)); }
#composer { max-width: 780px; padding: 8px; gap: 5px; align-items: flex-end; border-radius: 30px; background: var(--panel); box-shadow: none; }
#composer:focus-within { border-color: var(--text-3); box-shadow: none; }
#chat-input { font: 16px/1.6 var(--display); padding: 8px 5px; min-width: 0; min-height: 42px; border-radius: 12px; }
#compose-menu-btn, #mic-btn { display: grid; place-items: center; width: 42px; min-width: 42px; height: 42px; padding: 0; margin: 0; border: 0; background: none; border-radius: 50%; color: var(--text-2); cursor: pointer; }
#compose-menu-btn:hover, #compose-menu-btn[aria-expanded="true"], #mic-btn:hover { color: var(--text); background: var(--fill); }
#compose-menu-btn .ui-icon, #mic-btn .ui-icon { width: 22px; height: 22px; }
#send-btn { width: 40px; height: 40px; margin: 1px; }
#send-btn .ui-icon { width: 22px; height: 22px; }
#compose-tools { position: absolute; bottom: calc(100% + 5px); left: max(24px, calc((100% - 780px)/2)); min-width: 210px; max-width: calc(100% - 30px); padding: 7px; border-radius: 14px; background: var(--panel); border: 1px solid var(--hairline); box-shadow: var(--card-shadow); z-index: 42; }
#compose-tools #attach-btn, #compose-tools #pdf-btn { display: flex; align-items: center; gap: 12px; width: 100%; height: 44px; padding: 10px 12px; border: 0; border-radius: 9px; font-size: 14px; background: none; color: var(--text); cursor: pointer; }
#compose-tools button:hover { background: var(--fill); }
#backend-btn { display: none; } /* Agent selection and configuration are in the header. */
#queue-tray, #send-options, #attach-chips, #dictate-bar { max-width: 780px; margin-inline: auto; }
.welcome-logo { background: transparent; color: var(--text); border-radius: 0; }
#welcome { background: none; }
.welcome-inner h2 { font-size: 32px; font-weight: 500; }
.primary-btn { font-size: 14px; min-height: 42px; }
.setup-card { border-radius: 18px; padding: 25px; }
.cfg-select { min-height: 40px; font-size: 14px; }
.cfg-label { font-size: 13px; }
.sheet-inner { border-radius: 20px; }
.preview-caption { padding: 10px 14px; font-size: 13px; }
.inline-preview { margin-block: 23px; }
@media (min-width:761px) {
  #app.sidebar-collapsed #conv-header, #app.sidebar-collapsed #results-header,
  #app.sidebar-collapsed .has-back > header { padding-left: 23px; }
}
@media (max-width:860px) {
  .settings-summary { font-size: 12px; gap: 6px; }
  .settings-summary .setting-approval { display: none; }
}
@media (max-width:760px) {
  #sidebar { width: 100%; min-width: 0; }
  #chat-rail, #app.sidebar-collapsed #chat-rail { display: none; }
  #conv-header { padding: 10px 10px 10px 55px; min-height: 73px; gap: 1px; }
  #conv-title { font-size: 17px; }
  #back-btn { width: 44px; height: 44px; left: 7px; top: calc(14px + env(safe-area-inset-top)); border: 0; background: none; }
  #rec-btn, #jump-btn, #info-btn { min-width: 36px; width: 36px; height: 42px; }
  #conv-subtitle { margin-top: 2px; }
  #settings-strip { padding: 3px 12px 10px; gap: 6px; }
  .settings-summary { max-width: calc(100% - 43px); min-width: 0; padding: 8px 10px; }
  .settings-summary b { max-width: 155px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #context-button { width: 36px; padding: 9px; margin-left: auto; }
  #context-button > span { display: none; }
  #messages { padding: 23px 20px calc(22px + var(--kb,0px)); }
  .thread-item { margin-bottom: 23px; }
  .bubble.user { max-width: 88%; padding: 12px 17px; font-size: 16px; }
  .prose .md { font-size: 16px; line-height: 1.75; }
  .prose .md h1 { font-size: 26px; }
  .prose .md h2 { font-size: 23px; }
  .prose .md h3 { font-size: 20px; }
  .reply-tools { gap: 2px; }
  .reply-tools .msg-copy, .reply-tools .msg-reply, .reply-tools .msg-speak, .message-tools button { width: 38px; height: 40px; }
  .msg-actions time { display: none; }
  #composer-wrap { padding: 10px 12px calc(14px + env(safe-area-inset-bottom)); }
  #composer { gap: 2px; padding: 7px; }
  #chat-input { font-size: 16px; max-height: 128px; padding: 8px 5px; }
  #compose-menu-btn, #mic-btn { width: 38px; min-width: 38px; height: 42px; }
  #compose-tools { left: 12px; }
  #work-progress { padding: 10px 15px; }
  .setup-card { padding: 18px; }
  .preview-caption { font-size: 12px; }
}
@media (prefers-reduced-motion:reduce) { .bubble, .prose { animation: none; } }

/* Roomier across navigation, libraries, boards, setup, and settings. */
:root { --page-width: 1040px; --control-height: 44px; }
.mode-ico, .idea-mode-chip, .m-icon { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
#mode-btn { min-height: 48px; font-size: 16px; font-weight: 500; gap: 12px; }
#mode-btn .mode-ico, .mode-item .mode-ico { font-size: 21px; width: 26px; min-width: 26px; display: inline-flex; align-items: center; justify-content: center; }
#mode-btn .chev .ui-icon { width: 17px; height: 17px; }
#mode-menu { padding: 8px; border-radius: 15px; }
.mode-item { min-height: 48px; padding: 11px 12px; font-size: 15px; gap: 12px; }
.mode-item.on { background: var(--fill); font-weight: 500; }
.mode-item .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mode-foot { margin-top: 8px; padding-top: 8px; gap: 8px; }
.mode-foot button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 44px; font-size: 14px; }
.mode-foot .ui-icon { width: 17px; height: 17px; }
#search { min-height: 46px; }
#tool-dock { gap: 5px; }
.dock-btn { min-height: 48px; }
.dock-label { font-size: 13px; }
#tools-disclosure, #saved-messages { font-size: 15px; min-height: 48px; }
#side-scroll section h3 { font-size: 13px; margin-block: 23px 9px; padding-inline: 12px; }
#side-scroll .sidebar-section-toggle { display: flex; align-items: center; flex: 1; gap: 8px; min-width: 0; min-height: 44px; padding: 0; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
#side-scroll .sidebar-section-toggle:hover { color: var(--text); }
.sidebar-section-toggle .ui-icon { width: 15px; height: 15px; }
.sidebar-section-toggle[aria-expanded="false"] .ui-icon { transform: rotate(-90deg); }
#side-scroll .row { padding: 14px 12px; margin-block: 4px; }
#side-scroll .row-title { font-size: 15px; line-height: 1.5; }
#side-scroll .row-sub { font-size: 12px; line-height: 1.6; }
.proj-k { min-height: 30px; font-size: 12px; padding: 4px 7px; }
#main { min-width: 0; }
#main .has-back, #search-results { min-height: 0; min-width: 0; background: var(--bg); }
#main .page-header { display: flex; flex-shrink: 0; flex-wrap: wrap; align-items: center; gap: 12px; padding: 23px 28px; min-height: 98px; background: var(--bg); border-bottom: 1px solid var(--hairline); }
#main .page-header > div { flex: 1; min-width: 0; }
#main .page-header > .page-actions { flex: 0 1 auto; display: flex; flex-wrap: wrap; gap: 10px; }
#main .page-header h2 { margin: 0; font-family: var(--display); font-size: 25px; font-weight: 500; line-height: 1.4; letter-spacing: -.4px; }
#main .page-header .muted { font-size: 14px; line-height: 1.55; margin-top: 5px; color: var(--text-2); }
#main .page-header button { min-height: var(--control-height); padding: 10px 14px; border-radius: 10px; font-size: 14px; font-weight: 450; flex-shrink: 0; }
#main .page-header button[id$="back-btn"] { display: grid; place-items: center; width: 44px; padding: 0; background: none; border: 0; }
#main .page-header button[id$="back-btn"] svg { width: 22px; height: 22px; }
#main .page-header button:hover { background: var(--fill); }
#main .page-header button.primary-btn { background: var(--accent); color: var(--on-accent); }
#main .page-header .primary-btn:hover { background: var(--accent-press); }
#board-body, #knowledge-list, #flow-body, #automations-body, #results-list { width: 100%; max-width: var(--page-width); margin-inline: auto; padding: 28px 32px 40px; min-height: 0; }
#workspace-body { max-width: 1200px; width: 100%; margin-inline: auto; padding: 28px 32px 40px; gap: 16px; grid-template-columns: repeat(auto-fill,minmax(min(280px,100%),1fr)); }
#workspace-search { font-size: 15px; min-height: 44px; border-radius: 11px; padding: 10px 13px; }
.k-row, .workspace-card, .auto-card, .plugin-row { padding: 18px; border-radius: 14px; box-shadow: none; background: var(--panel); gap: 15px; }
.workspace-card { min-height: 104px; }
.workspace-icon, .k-ico { display: grid; place-items: center; flex-shrink: 0; color: var(--text-2); }
.workspace-icon .ui-icon { width: 28px; height: 28px; }
.workspace-meta { gap: 5px; }
.workspace-meta b, .k-row .k-name { font-size: 16px; font-weight: 500; }
.workspace-meta span, .k-row .k-meta { font-size: 13px; line-height: 1.5; }
.k-row .k-del { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; padding: 0; }
.k-row .k-del .ui-icon { width: 18px; height: 18px; }
#ideas-compose, #ideas-filters, #ideas-list { max-width: 920px; }
#ideas-compose { padding: 28px 32px 12px; gap: 12px; }
#idea-input { min-height: 125px; padding: 17px 18px; font-size: 16px; line-height: 1.7; background: var(--panel); border-color: var(--hairline); border-radius: 16px; }
#ideas-compose-row { gap: 12px; }
#idea-type-pick { font-size: 15px; min-height: 44px; padding: 10px 14px; }
#idea-add-btn { flex: 0 0 auto; min-width: 100px; margin-left: auto; }
#ideas-filters { padding: 12px 32px; gap: 8px; }
.idea-filter-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 8px 12px; border-radius: 10px; font-size: 14px; opacity: 1; color: var(--text-2); border-color: var(--hairline); }
.idea-filter-chip.active { color: var(--on-accent); background: var(--accent); }
.idea-filter-chip .ui-icon { width: 17px; height: 17px; }
#ideas-list { padding: 8px 32px 40px; }
.idea-group-h { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 500; text-transform: none; letter-spacing: 0; opacity: 1; color: var(--text-2); margin: 20px 0 10px; }
.idea-group-h .ui-icon { width: 18px; height: 18px; }
.idea-item { gap: 12px; padding: 16px 0; align-items: flex-start; }
.idea-item .idea-text { font-size: 16px; line-height: 1.7; padding-top: 6px; }
.idea-type-sel, .idea-mode-sel { min-height: 38px; font-size: 13px; padding: 8px 10px; }
.idea-check, .idea-del { display: grid; place-items: center; min-width: 38px; height: 40px; opacity: 1; color: var(--text-2); padding: 0; }
.idea-del .ui-icon { width: 18px; height: 18px; }
.empty-check { width: 18px; height: 18px; border: 1.5px solid var(--text-3); border-radius: 5px; }
.idea-check[aria-pressed="true"] { color: var(--ok); }
.auto-section { margin-bottom: 35px; }
.auto-section > h3, .flow-group-h, .bd-section h4 { font-size: 16px; font-weight: 500; text-transform: none; letter-spacing: 0; opacity: 1; color: var(--text-2); margin-bottom: 14px; }
.auto-section > h3 span { font-size: 13px; }
.auto-card { margin-bottom: 14px; }
.auto-main { gap: 7px; }
.auto-main b, .run-main b { font-size: 16px; font-weight: 500; }
.auto-main > span, .run-main > span { font-size: 13px; line-height: 1.6; }
.auto-actions { gap: 7px; }
.auto-actions button { min-height: 40px; font-size: 14px; padding: 9px 12px; }
.run-row { gap: 15px; padding: 18px 4px; align-items: flex-start; }
.run-state { width: 32px; height: 32px; flex-shrink: 0; }
.run-main { gap: 6px; }
.flow-summary { font-size: 19px; font-weight: 500; color: var(--text); opacity: 1; margin: 0 0 25px; }
.flow-group { margin-bottom: 26px; }
.flow-item { padding: 17px 19px; border-radius: 12px; gap: 7px; margin-bottom: 12px; background: var(--panel); }
.flow-title { font-size: 16px; line-height: 1.6; }
.flow-meta { font-size: 13px; line-height: 1.6; opacity: 1; color: var(--text-2); overflow-wrap: anywhere; }
.bd-top, .bd-section { max-width: none; }
.bd-section { margin-top: 30px; }
.bd-top { padding: 17px; border: 1px solid var(--hairline); border-radius: 14px; background: var(--panel); }
#bd-note { font-size: 16px; line-height: 1.6; min-height: 44px; }
.bd-item { gap: 12px; padding: 15px 10px; margin-bottom: 8px; border: 1px solid var(--hairline); border-radius: 13px; background: var(--panel); }
.bd-title { font-size: 16px; min-height: 36px; }
.bd-notes { font-size: 14px; min-height: 32px; }
.bd-notes:placeholder-shown { opacity: .7; }
.bd-status, .bd-del { width: 36px; height: 36px; }
.bd-del { display: grid; place-items: center; opacity: .8; padding: 0; }
.bd-del .ui-icon { width: 18px; height: 18px; }
.bd-due { font-size: 14px; min-height: 36px; width: 130px; padding: 5px; }
.bd-add { padding: 4px 0 0 0; }
.bd-add input { min-height: 44px; font-size: 15px; padding: 10px 14px; background: var(--fill-2); border-radius: 10px; }
#browser-nav { padding: 14px 24px; gap: 9px; flex-shrink: 0; flex-wrap: wrap; background: var(--bg); }
#browser-nav button { min-height: 42px; min-width: 40px; display: grid; place-items: center; font-size: 14px; }
#browser-url { font: 15px/1.5 var(--display); min-height: 44px; padding: 10px 13px; }
#browser-stage { background: var(--bg); }
#browser-empty { padding: 32px; text-align: center; font-size: 16px; line-height: 1.7; color: var(--text-2); }
.result-hit { padding: 20px; border-radius: 12px; margin-bottom: 12px; background: var(--panel); }
.hit-meta { font-size: 13px; line-height: 1.6; }
.chat-search-hit p { font-size: 16px; line-height: 1.75; }
#results-header .search-controls { flex-basis: 100%; gap: 12px; padding-top: 8px; }
.search-controls select { font-size: 15px; min-height: 42px; }
.k-empty, .workspace-empty, .ideas-empty, .flow-empty, .auto-empty { padding: 44px 20px; font-size: 16px; line-height: 1.7; }

/* Setup and sheets share the same type scale, field spacing, and touch sizes. */
.setup-col { max-width: 720px; width: 100%; }
.setup-card { width: 100%; padding: 28px; margin-top: 10px; box-shadow: none; }
.setup-card h4 { font-size: 16px; line-height: 1.5; letter-spacing: 0; text-transform: none; color: var(--text); font-weight: 500; margin: 26px 0 14px; }
.agent-list { border-radius: 13px; }
.agent-pick { min-height: 78px; padding: 17px 19px; gap: 14px; }
.agent-pick .a-text { min-width: 0; gap: 5px; }
.agent-pick .a-name { font-size: 17px; }
.agent-pick .a-sub { font-size: 14px; line-height: 1.5; }
.agent-cfg { padding: 18px; border-radius: 13px; margin-bottom: 12px; }
.agent-cfg .cfg-head { font-size: 16px; margin-bottom: 15px; }
.agent-cfg .cfg-grid, #agent-panel .cfg-grid { grid-template-columns: minmax(95px,max-content) minmax(0,1fr); gap: 14px 18px; }
.cfg-label { font-size: 14px; line-height: 1.6; }
.cfg-select { font-size: 15px; padding: 10px 12px; min-height: 44px; }
.seg { flex-wrap: wrap; }
.seg button { min-height: 40px; font-size: 14px; padding: 8px 13px; }
.lead-pick { min-height: 40px; font-size: 14px; }
.hint { font-size: 13px; line-height: 1.65; margin-top: 13px; color: var(--text-2); }
#agent-panel, #info-panel, #jump-panel { padding: 22px 25px; border-radius: 15px; max-height: min(75dvh,740px); overflow: auto; }
.panel-head { gap: 10px; flex-wrap: wrap; font-size: 16px; margin-bottom: 15px; }
.panel-sub { font-size: 13px; }
.panel-close, .sheet-close { display: grid; place-items: center; width: 42px; min-width: 42px; height: 42px; padding: 0; border-radius: 10px; }
.panel-close .ui-icon, .sheet-close .ui-icon { width: 21px; height: 21px; }
.sheet-head > b .ui-icon, .row-title > .ui-icon { display: inline-block; vertical-align: -4px; margin-right: 6px; }
.info-grid { gap: 12px 20px; font-size: 14px; line-height: 1.65; }
.info-actions { gap: 9px; margin-top: 20px; }
.info-actions button, .info-actions a { min-height: 42px; display: inline-flex; align-items: center; font-size: 14px; padding: 9px 14px; border-radius: 10px; }
#recorder-sheet, #rec-detail-sheet, #mode-sheet, #pdf-sheet, #usage-sheet, #codex-sheet { position: fixed; padding: 24px; }
.sheet-inner { width: min(740px,100%); max-height: min(840px,100%); border: 1px solid var(--hairline); border-radius: 20px; }
.sheet-head { flex-shrink: 0; flex-wrap: wrap; gap: 9px 14px; padding: 18px 23px; }
.sheet-head > b { font-size: 21px; font-weight: 500; line-height: 1.4; flex: 1; }
.sheet-head > .grow { display: none; }
.sheet-head > .panel-sub { order: 3; flex-basis: 100%; margin: 0; font-size: 14px; line-height: 1.6; }
.sheet-body { padding: 24px; min-height: 0; font-size: 15px; line-height: 1.7; }
#app :is(.sheet-body,.setup-card,#agent-panel) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),textarea,select) { font-size: 16px; min-width: 0; }
.codex-field, .pdf-row, .rec-opts label { font-size: 14px; gap: 8px; font-weight: 450; margin-block: 18px; }
.codex-field input, .codex-field select, .pdf-input, .rec-opts input, .rec-opts select, #plugin-search { min-height: 44px; padding: 11px 13px; border-radius: 11px; }
.codex-field textarea, .pdf-textarea { padding: 14px; line-height: 1.7; border-radius: 12px; }
.codex-actions, .rec-detail-actions { flex-wrap: wrap; gap: 10px; margin-top: 21px; }
.codex-actions button, .plugin-row button, .rec-detail-actions button { min-height: 42px; font-size: 14px; border-radius: 10px; padding: 9px 14px; }
.auto-check { flex-wrap: wrap; min-height: 42px; font-size: 15px; gap: 10px; }
.auto-check input { width: 18px; height: 18px; }
.auto-check small { font-size: 12px; }
.auto-grid { gap: 16px; }
.plugin-tools { flex-wrap: wrap; gap: 12px; }
.plugin-tools input { min-width: 0; }
.plugin-tools span { font-size: 13px; }
.plugin-row { flex-wrap: wrap; }
.plugin-main b { font-size: 16px; }
.plugin-main span { font-size: 13px; line-height: 1.6; }
.mode-row { gap: 13px; padding: 19px 0; }
.mode-row .m-main { min-width: 0; gap: 10px; }
#mode-sheet .mode-row input.m-icon { flex: 0 0 48px; width: 48px; height: 48px; font-size: 24px; padding: 6px; border-radius: 12px; text-align: center; }
.mode-row input.m-name, .mode-row input.m-brief { padding: 10px 12px; min-height: 44px; border-radius: 10px; background: var(--bg); }
.mode-row .m-del { width: 36px; min-width: 36px; height: 44px; padding: 0; display: grid; place-items: center; }
.mode-row .m-del .ui-icon { width: 18px; height: 18px; }
.rec-cards { gap: 13px; }
.rec-card { min-height: 90px; padding: 19px; gap: 17px; border-radius: 14px; }
.rc-ico { display: grid; place-items: center; width: 35px; flex-shrink: 0; color: var(--text-2); }
.rc-ico .ui-icon { width: 27px; height: 27px; }
.rc-text { font-size: 17px; line-height: 1.6; }
.rc-text .muted { font-size: 14px; line-height: 1.6; }
.rec-h { font-size: 15px; letter-spacing: 0; text-transform: none; }
.rec-summary { font-size: 16px; line-height: 1.75; }
.pdf-files, .usage-note, .rec-note { font-size: 14px; line-height: 1.7; }
.usage-scroll { width: 100%; overflow-x: auto; border: 1px solid var(--hairline); border-radius: 12px; }
.usage-table { min-width: 620px; font-size: 14px; }
.usage-table th, .usage-table td { padding: 14px; }
.usage-table th { font-size: 12px; letter-spacing: 0; text-transform: none; }
.usage-table td.num { font-variant-numeric: tabular-nums; }
.welcome-inner { max-width: 690px; padding: 36px; }
.welcome-inner h2 { margin-block: 16px; font-size: 34px; }
.welcome-inner > p { font-size: 17px; line-height: 1.7; }
#welcome-continue { margin-top: 32px; }
.cont-row { padding: 17px 18px; margin-top: 10px; }
.c-title { font-size: 16px; }.c-sub { font-size: 13px; }

@media (max-width:760px) {
  #side-top { padding: 22px 18px 14px; }
  #side-scroll { padding-inline: 12px; }
  #main .page-header { padding: 17px 16px; min-height: 92px; gap: 9px 12px; }
  #main .page-header > div { flex: 1 1 calc(100% - 58px); }
  #main .page-header > .page-actions { flex: 1 1 100%; padding-top: 4px; }
  #main .page-header h2 { font-size: 23px; }
  #main .page-header .muted { font-size: 13px; line-height: 1.6; }
  #main .page-header > div + button { margin-left: 56px; }
  #main #results-header { padding-left: 56px; }
  #workspace-search { order: 3; margin: 3px 0 0 56px; width: calc(100% - 56px); font-size: 16px; }
  #board-body, #knowledge-list, #flow-body, #automations-body, #results-list, #workspace-body { padding: 22px 18px 32px; }
  #workspace-body { grid-template-columns: minmax(0,1fr); }
  .k-row { flex-wrap: wrap; gap: 9px; padding: 14px; }
  .k-row .k-name { flex: 1 1 calc(100% - 91px); }
  .k-row .k-meta { order: 4; width: calc(100% - 34px); margin-left: 29px; }
  .k-row .k-del { width: 36px; height: 36px; }
  #ideas-compose { padding: 22px 18px 10px; }
  #ideas-filters { padding: 12px 18px; }
  #ideas-list { padding: 4px 18px 32px; }
  #idea-input, #idea-type-pick, .idea-type-sel, .idea-mode-sel { font-size: 16px; }
  .idea-item { display: grid; grid-template-columns: 34px minmax(0,1fr) 36px; gap: 8px; }
  .idea-check { grid-column: 1; grid-row: 1; min-width: 34px; }
  .idea-item .idea-text { grid-column: 2; grid-row: 1; padding-top: 5px; }
  .idea-del { grid-column: 3; grid-row: 1; min-width: 36px; }
  .idea-type-sel, .idea-mode-sel { grid-column: 2; max-width: 100%; width: fit-content; min-height: 40px; }
  .idea-mode-chip { grid-column: 1; grid-row: 2; align-self: center; justify-self: center; }
  .auto-card { padding: 17px; gap: 14px; flex-direction: column; align-items: stretch; }
  .auto-actions { justify-content: flex-start; }
  .auto-grid { grid-template-columns: minmax(0,1fr); gap: 0; }
  .auto-main > span, .run-main > span { white-space: normal; overflow-wrap: anywhere; }
  .bd-item { display: grid; grid-template-columns: 34px minmax(0,1fr) 32px; gap: 8px; padding: 13px 10px; }
  .bd-status { grid-column: 1; grid-row: 1; width: 32px; height: 32px; }
  .bd-mid { grid-column: 2; grid-row: 1; }
  .bd-del { grid-column: 3; grid-row: 1; width: 32px; height: 34px; }
  .bd-due { grid-column: 2; min-height: 42px; font-size: 16px; width: 100%; }
  .bd-title, .bd-notes, .bd-add input, #bd-note { font-size: 16px; }
  #browser-nav { padding: 12px 14px; gap: 7px; }
  #browser-url { order: 5; flex-basis: calc(100% - 57px); width: 0; font-size: 16px; }
  #browser-go-btn { order: 6; }
  #browser-close-btn { display: grid; margin-left: auto; }
  .setup-card { padding: 19px 16px; margin-top: 0; }
  .agent-pick { padding: 15px; }
  .agent-pick .a-name { font-size: 16px; }
  .agent-pick .a-sub { font-size: 13px; }
  .agent-cfg { padding: 15px 13px; }
  .agent-cfg .cfg-grid, #agent-panel .cfg-grid { grid-template-columns: minmax(0,1fr); gap: 8px; }
  .cfg-label:not(:first-child) { margin-top: 8px; }
  .cfg-select { max-width: 100%; }
  #agent-panel, #info-panel, #jump-panel { padding: 18px; width: calc(100% - 24px); }
  .panel-head .panel-sub { flex-basis: calc(100% - 48px); }
  .info-grid { grid-template-columns: minmax(0,1fr); gap: 3px; }
  .info-grid dt:not(:first-child) { margin-top: 12px; }
  #recorder-sheet, #rec-detail-sheet, #mode-sheet, #pdf-sheet, #usage-sheet, #codex-sheet { padding: calc(12px + env(safe-area-inset-top)) 10px calc(12px + env(safe-area-inset-bottom)); }
  .sheet-inner { max-height: 100%; border-radius: 17px; }
  .sheet-head { padding: 15px 17px; gap: 8px; }
  .sheet-head > b { font-size: 21px; }
  .sheet-head > .panel-sub { font-size: 13px; }
  .sheet-body { padding: 19px 17px; }
  .mode-row { gap: 8px; }
  #mode-sheet .mode-row input.m-icon { flex-basis: 42px; width: 42px; height: 44px; font-size: 22px; }
  .mode-row .m-del { width: 30px; min-width: 30px; }
  .rec-card { padding: 17px 14px; gap: 12px; }
  .rc-text { font-size: 16px; }.rc-text .muted { font-size: 13px; }
  .rc-ico { width: 28px; }
  .plugin-tools input { flex-basis: 100%; }
  #app.preview-open #main { min-width: 0; }
  .welcome-inner { padding: 25px 20px; }
}
