/* Quiet desktop workspace: neutral surfaces, native text, and a focused conversation. */
@font-face {
  font-family: "D2Coding";
  src: url("/fonts/D2Coding-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "D2Coding";
  src: url("/fonts/D2Coding-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --canvas: #181818;
  --paper: #222222;
  --sidebar: #222222;
  --elevated: #2b2b2b;
  --bubble: #2c2c2c;
  --line: #353535;
  --line-strong: #484848;
  --control-line: #535353;
  --ink: #ececec;
  --muted: #a1a1a1;
  --accent: #ececec;
  --accent-soft: #343434;
  --green: #86a88a;
  --amber: #d4b481;
  --red: #e5a09a;
  --sans: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
  --mono: "D2Coding", "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-family: var(--sans);
  font-size: 15px;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 2px solid #bfbfbf;
  outline-offset: 3px;
}
button svg, svg.icon { width: 20px; height: 20px; flex: none; }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
::selection { color: #fff; background: #505050; }
input, textarea { caret-color: var(--ink); }
::placeholder { color: var(--muted); opacity: 1; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Account entry uses the same quiet neutral palette as the workspace. */
.auth-shell { display: flex; align-items: center; flex-direction: column; min-height: 100dvh; padding: 40px 24px 24px; }
.auth-brand { align-self: flex-start; color: var(--ink); font-size: 21px; font-weight: 600; letter-spacing: -.5px; }
.auth-brand > span { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; font-weight: 400; letter-spacing: 0; }
.auth-card { width: min(100%, 400px); margin: auto 0; padding-block: 36px; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 35px; border-bottom: 1px solid var(--line); }
.auth-tabs > button { flex: 1; min-height: 42px; margin-bottom: -1px; padding: 10px 5px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 13px; }
.auth-tabs > button[aria-selected="true"] { border-bottom-color: var(--ink); color: var(--ink); }
.auth-tabs > button:hover { color: #fff; }
.auth-card h1, .auth-connection h1 { overflow: visible; font-size: 25px; font-weight: 550; line-height: 1.5; letter-spacing: -.6px; white-space: normal; }
.auth-description { margin: 10px 0 29px; color: var(--muted); font-size: 14px; line-height: 1.8; word-break: keep-all; }
.auth-field { margin-bottom: 19px; }
.auth-field > label { display: block; margin-bottom: 8px; color: #d4d4d4; font-size: 13px; }
.auth-field input { width: 100%; min-width: 0; min-height: 46px; padding: 11px 13px; border: 1px solid var(--control-line); border-radius: 9px; background: var(--paper); color: var(--ink); font-size: 16px; line-height: 1.5; }
.auth-field input:focus { border-color: #999; }
.auth-field .field-help { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.auth-password-field { position: relative; }
.auth-password-field input { padding-right: 65px; }
.auth-password-field button { position: absolute; inset: 6px 6px 6px auto; min-width: 48px; padding: 4px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; }
.auth-password-field button:hover { background: var(--elevated); color: var(--ink); }
.auth-submit { width: 100%; min-height: 46px; margin-top: 5px; font-size: 14px; }
.auth-error { margin: 10px 0 16px; color: var(--red); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.auth-limit-note, .auth-service-note { margin: 18px 0 0; color: var(--muted); font-size: 12px; line-height: 1.8; word-break: keep-all; }
.auth-service-note { padding-top: 17px; border-top: 1px solid var(--line); color: #949494; font-size: 11px; }
.auth-footer { max-width: 520px; margin: 24px 0 0; color: #8d8d8d; font-size: 11px; line-height: 1.8; text-align: center; word-break: keep-all; }
.auth-connection { width: min(100%, 420px); margin: auto 0; padding-block: 70px; text-align: center; }
.auth-connection p { margin: 13px 0 24px; color: var(--muted); font-size: 14px; line-height: 1.8; word-break: keep-all; }
.auth-loading-dot { display: inline-block; width: 8px; height: 8px; margin-bottom: 22px; border-radius: 50%; background: var(--muted); animation: auth-breathe 1.6s ease-in-out infinite; }
@keyframes auth-breathe { 50% { opacity: .25; } }
.account-info { display: flex; align-items: center; gap: 10px; margin-top: 19px; }
.account-copy { flex: 1; min-width: 0; }
.account-copy strong, .account-copy span, .account-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { font-size: 12px; font-weight: 500; line-height: 1.8; }
.account-copy span { color: var(--muted); font-size: 10px; line-height: 1.8; }
.account-copy small { margin-top: 2px; color: #8f8f8f; font-size: 10px; }
.logout-button { flex: none; padding: 7px 8px; border: 1px solid var(--line-strong); border-radius: 7px; background: transparent; color: var(--muted); font-size: 11px; }
.logout-button:hover { background: var(--elevated); color: var(--ink); }
.member-capability-note { margin: 0 0 23px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 8px; color: #bcbcbc; font-size: 12px; line-height: 1.8; }
@media (max-width: 520px) {
  .auth-shell { padding: 25px 24px 22px; }
  .auth-card { padding-block: 32px; }
  .auth-tabs { margin-bottom: 27px; }
  .auth-card h1, .auth-connection h1 { font-size: 23px; }
  .auth-description { margin-bottom: 24px; font-size: 13px; }
  .auth-footer { margin-top: 12px; font-size: 10px; }
}

/* Navigation stays in place while the conversation scrolls independently. */
.app-shell { display: flex; height: 100dvh; min-height: 440px; overflow: hidden; }
.sidebar { display: flex; flex: none; flex-direction: column; width: 270px; padding: 25px 14px 20px; border-right: 1px solid var(--line); background: var(--sidebar); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 12px 23px; }
.brand strong { display: block; font-size: 22px; font-weight: 600; line-height: 1.3; letter-spacing: -.5px; }
.brand > div > span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.brand-mark, .welcome-symbol, .terminal-caption, .composer-prompt { display: none; }
.new-chat { display: flex; align-items: center; justify-content: flex-start; gap: 11px; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 9px; background: transparent; font-size: 15px; font-weight: 500; text-align: left; }
.new-chat svg { width: 20px; height: 20px; }
.new-chat:hover { background: #2c2c2c; }
.sidebar-heading { display: flex; justify-content: space-between; margin: 28px 12px 12px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.sidebar-heading span { font-variant-numeric: tabular-nums; }
#chat-list { flex: 1; min-height: 0; overflow: auto; margin: 0 -4px; padding: 0 4px; }
.list-empty { padding: 5px 12px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.chat-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; margin-bottom: 3px; padding: 10px 12px; border: 0; border-radius: 9px; background: transparent; text-align: left; }
.chat-item svg { flex: none; width: 16px; height: 16px; margin-top: 3px; color: var(--muted); }
.chat-item:hover { background: #2b2b2b; }
.chat-item.active { background: #363636; }
.chat-item.active svg { color: var(--ink); }
.chat-item > span { flex: 1; min-width: 0; }
.chat-item strong { display: block; overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 400; line-height: 1.55; text-overflow: ellipsis; white-space: nowrap; }
.chat-item small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.sidebar-bottom { margin-top: 18px; padding: 16px 12px 0; border-top: 1px solid var(--line); }
.connection-button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 2px 0; border: 0; background: none; text-align: left; font-size: 12px; line-height: 1.6; }
.connection-button svg { width: 16px; height: 16px; margin-left: auto; color: var(--muted); }
.connection-button:hover { color: #fff; }
.status-dot { display: inline-block; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.status-dot.connected, .status-dot.running { background: var(--green); }
.status-dot.waiting { background: var(--amber); }
.status-dot.error { background: var(--red); }
.sidebar-bottom p { margin: 11px 0 0; color: var(--muted); font-size: 11px; line-height: 1.8; }
.main { position: relative; display: flex; flex: 1; flex-direction: column; min-width: 0; background: var(--canvas); }
.topbar { display: flex; align-items: center; flex: none; gap: 15px; height: 66px; padding: 0 28px; }
.title-group { display: flex; align-items: center; flex: 1; gap: 13px; min-width: 0; }
h1 { overflow: hidden; margin: 0; font-size: 15px; font-weight: 500; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.run-status { display: flex; align-items: center; flex: none; gap: 6px; padding: 4px 0; color: var(--muted); font-size: 11px; line-height: 1.5; white-space: nowrap; }
.top-actions { display: flex; align-items: center; flex: none; gap: 4px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; padding: 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); }
.icon-button:hover { background: var(--elevated); color: var(--ink); }
.settings-button { display: flex; align-items: center; gap: 7px; height: 35px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; }
.settings-button:hover { background: var(--elevated); color: var(--ink); }
.settings-button svg { width: 17px; height: 17px; }
.workspace-bar { display: flex; align-items: center; justify-content: space-between; flex: none; gap: 20px; min-height: 38px; padding: 8px 29px; border-bottom: 1px solid #2c2c2c; background: var(--canvas); font-size: 11px; line-height: 1.7; }
.workspace-path { display: flex; align-items: center; flex: 1; gap: 8px; min-width: 0; color: var(--muted); }
.workspace-path svg { flex: none; width: 15px; height: 15px; }
.workspace-path span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-meta { display: flex; align-items: center; flex: 0 1 auto; gap: 14px; min-width: 0; max-width: 50%; color: var(--muted); font-variant-numeric: tabular-nums; }
#model-label { overflow: hidden; min-width: 0; text-overflow: ellipsis; white-space: nowrap; }
#budget-label { flex: none; padding-left: 14px; border-left: 1px solid var(--line); }
.access-picker { position: relative; flex: none; }
.access-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 3px 7px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #b9b9b9; font-size: 11px; white-space: nowrap; }
.access-toggle:hover, .access-toggle[aria-expanded="true"] { background: var(--elevated); color: var(--ink); }
.access-toggle svg { width: 13px; height: 13px; }
.access-indicator { width: 5px; height: 5px; border-radius: 50%; background: #858585; }
.access-toggle[data-mode="full"] { border-color: #685338; background: #30291f; color: #e4c499; }
.access-toggle[data-mode="full"] .access-indicator { background: #d3ab74; }
.access-menu { position: absolute; z-index: 20; top: calc(100% + 9px); right: 0; width: min(332px, calc(100vw - 50px)); padding: 7px; border: 1px solid var(--line-strong); border-radius: 12px; background: #292929; box-shadow: 0 12px 36px #0007; }
.access-menu-heading { margin: 3px 9px 6px; color: var(--muted); font-size: 11px; font-weight: 500; }
.access-menu .model-option { min-height: 60px; }
.access-menu-note { margin: 7px 9px 5px; padding-top: 10px; border-top: 1px solid var(--line-strong); color: var(--muted); font-size: 10px; line-height: 1.7; }
.permission-full-access { border-color: #796044; color: #e4c499; }
.permission-card > .permission-full-note { margin: 10px 0 0; color: #aaa196; font-size: 11px; line-height: 1.7; }
.content-stage { position: relative; display: flex; flex: 1; min-height: 0; min-width: 0; }
.chat-stage { display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 0; }
.conversation-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 36px; scroll-behavior: auto; scrollbar-gutter: stable; }

/* The empty state makes room for a first request, with quiet optional prompts. */
.welcome { max-width: 820px; margin: 0 auto; padding-top: clamp(48px, 13vh, 132px); padding-bottom: 36px; }
.welcome h2 { margin: 0 0 16px; font-size: 32px; font-weight: 550; line-height: 1.4; letter-spacing: -.9px; }
.welcome > p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.85; word-break: keep-all; }
.suggestions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 30px; }
.suggestion { display: flex; align-items: flex-start; flex-direction: column; gap: 13px; min-width: 0; padding: 17px 16px; border: 1px solid var(--line); border-radius: 12px; background: transparent; text-align: left; }
.suggestion:hover { background: var(--paper); border-color: var(--line-strong); }
.suggestion svg { width: 20px; height: 20px; color: var(--muted); }
.suggestion strong { display: block; font-size: 13px; font-weight: 500; line-height: 1.55; }
.suggestion small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.75; }
.welcome-hint { display: flex; align-items: center; gap: 9px; margin-top: 23px; color: var(--muted); font-size: 12px; line-height: 1.8; word-break: keep-all; }
.small-line { width: 13px; height: 1px; flex: none; background: var(--line-strong); }

/* User requests are compact bubbles; the assistant reads like a document. */
.thread, .permission-stack, .activity-section { max-width: 820px; margin: 0 auto; }
.thread { padding-top: 30px; }
.message { min-width: 0; padding: 0 0 34px; }
.message-header { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.5; }
.message-avatar { display: none; }
.message time { color: var(--muted); font-size: 11px; font-weight: 400; font-variant-numeric: tabular-nums; }
.message-body { min-width: 0; color: var(--ink); font-size: 16px; line-height: 1.8; overflow-wrap: anywhere; }
.message.user { display: flex; flex-direction: column; align-items: flex-end; }
.message.user .message-header { display: none; }
.message.user .message-body { width: fit-content; max-width: min(88%, 680px); padding: 14px 19px; border-radius: 22px; background: var(--bubble); white-space: pre-wrap; }
.message.system .message-body { padding: 11px 14px; border-left: 2px solid var(--line-strong); border-radius: 0 7px 7px 0; background: var(--paper); color: var(--muted); font-size: 12px; }
.message.system .message-header { display: none; }
.message-body > *:first-child { margin-top: 0; }
.message-body > *:last-child { margin-bottom: 0; }
.message-body h1, .message-body h2, .message-body h3, .message-body h4 { overflow: visible; margin: 25px 0 10px; color: var(--ink); font-size: 20px; font-weight: 600; line-height: 1.55; white-space: normal; letter-spacing: -.3px; }
.message-body h2 { font-size: 19px; }
.message-body h3, .message-body h4 { font-size: 17px; }
.message-body p { margin: 0 0 16px; }
.message-body ul, .message-body ol { margin: 12px 0 18px; padding-left: 24px; }
.message-body li { margin: 6px 0; }
.message-body li::marker { color: #c6c6c6; }
.message-body a { color: #dedede; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.message-body a:hover { color: #fff; }
.message-body pre { overflow: auto; max-width: 100%; margin: 16px 0; padding: 17px 18px; border: 1px solid var(--line); border-radius: 10px; background: #202020; color: #dedede; font-size: 13px; line-height: 1.8; tab-size: 2; }
.message-body code, .activity-data, pre.tool-input { font-family: var(--mono); }
.message-body pre code { font-size: inherit; }
.message-body :not(pre) > code { padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--elevated); color: #dedede; font-size: .9em; }
.message-body blockquote { margin: 16px 0; padding: 3px 16px; border-left: 2px solid #666; color: #bababa; }
.message-body table { display: block; overflow-x: auto; max-width: 100%; margin: 16px 0; border-collapse: collapse; font-size: 13px; line-height: 1.75; }
.message-body th, .message-body td { min-width: 80px; padding: 10px 13px; border: 1px solid var(--line); text-align: left; }
.message-body th { background: var(--elevated); font-weight: 600; }
.message-body td { background: var(--paper); }
.message-body img { max-width: 100%; height: auto; border-radius: 8px; }
.message-body hr { margin: 24px 0; border: 0; border-top: 1px solid var(--line); }
.stream-cursor::after { display: inline-block; width: 7px; height: 15px; margin-left: 6px; background: #bbb; vertical-align: middle; content: ""; }

/* Approval decisions are explicit while logs stay secondary to the answer. */
.permission-card { margin: 0 0 20px; padding: 19px 20px; border: 1px solid #5d5446; border-radius: 12px; background: #252320; }
.permission-card h3 { margin: 0 0 7px; color: #e6d2b6; font-size: 14px; line-height: 1.6; }
.permission-card > p { margin: 0 0 14px; color: #bbb3a8; font-size: 13px; line-height: 1.8; }
.tool-input { overflow: auto; max-height: 220px; margin: 13px 0; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 7px; background: #1c1c1c; color: #dedede; font-size: 12px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.permission-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.permission-card label.question-label { display: block; margin: 17px 0 8px; font-size: 13px; line-height: 1.8; }
.question-options { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 9px; }
.question-option { padding: 7px 10px; border: 1px solid #6e665b; border-radius: 7px; background: var(--elevated); font-size: 12px; line-height: 1.6; }
.question-option:hover { border-color: #aaa; }
.question-option.selected { border-color: #bbb; background: #424242; color: #fff; }
.question-answer { width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid #6e665b; border-radius: 7px; background: var(--canvas); color: var(--ink); font-size: 13px; line-height: 1.6; }
.activity-section { margin-bottom: 26px; }
.activity-section > details { border-top: 1px solid var(--line); font-size: 12px; }
.activity-section summary { padding: 14px 1px; color: var(--muted); cursor: pointer; line-height: 1.7; }
.activity-section summary:hover { color: var(--ink); }
.activity-section summary::marker { color: var(--muted); }
.activity-section summary span + span { margin-left: 9px; color: var(--muted); font-variant-numeric: tabular-nums; }
.activity-row { padding: 11px 12px; border-bottom: 1px solid var(--line); }
.activity-row[open] { background: var(--paper); }
.activity-row summary { padding: 0; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.activity-data { overflow: auto; max-height: 300px; margin: 10px 0 0; padding: 13px; border: 1px solid var(--line); border-radius: 7px; background: var(--canvas); color: #bfbfbf; font-size: 12px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Explicit plans and browser evidence stay in the scrolling conversation. */
.agent-work { max-width: 820px; margin: 0 auto 22px; }
.agent-work-details { min-width: 0; border-top: 1px solid var(--line); }
.agent-work-details > summary { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 2px; list-style: none; cursor: pointer; color: #b8b8b8; }
.agent-work-details > summary::-webkit-details-marker { display: none; }
.agent-work-details > summary:hover { color: var(--ink); }
.agent-work-details > summary:focus-visible, .source-title:focus-visible { outline: 2px solid #cca97b; outline-offset: 3px; border-radius: 4px; }
.agent-work-details > summary > svg { flex: none; width: 17px; height: 17px; }
.agent-summary-copy { min-width: 0; flex: 1; }
.agent-summary-heading { display: block; font-size: 12px; line-height: 1.8; font-weight: 550; }
.agent-summary-count { margin-left: 8px; color: #929292; font-size: 11px; font-weight: 400; font-variant-numeric: tabular-nums; }
.agent-summary-current { display: block; overflow: hidden; color: #909090; font-size: 11px; line-height: 1.75; text-overflow: ellipsis; white-space: nowrap; }
.agent-summary-chevron { opacity: .6; }
.agent-work-details[open] .agent-summary-chevron { transform: rotate(180deg); }
.plan-items { margin: 3px 0 18px; padding: 0 0 0 4px; list-style: none; }
.plan-item { position: relative; display: flex; gap: 11px; min-width: 0; padding: 7px 0; color: #b4b4b4; font-size: 12px; line-height: 1.7; }
.plan-item:not(:last-child)::after { position: absolute; left: 8px; top: 26px; bottom: -7px; width: 1px; background: #383838; content: ''; }
.plan-mark { position: relative; z-index: 1; display: inline-flex; flex: none; align-items: center; justify-content: center; width: 17px; height: 17px; margin-top: 2px; border: 1px solid #555; border-radius: 50%; background: var(--canvas); color: #888; line-height: 1; font-size: 12px; }
.plan-item.in_progress { color: #e1ccb0; }
.plan-item.in_progress .plan-mark { border-color: #b8996d; color: #dbb980; font-size: 22px; }
.plan-item.completed .plan-mark { color: #aac0ad; border-color: #58675b; }
.plan-item-copy { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.plan-item-status { display: inline-block; margin-left: 9px; color: #8f8f8f; font-size: 10px; white-space: nowrap; }
.source-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 3px 0; }
.source-card { min-width: 0; padding: 11px 12px; border: 1px solid #343434; border-radius: 9px; background: #1d1d1d; }
.source-title { display: -webkit-box; overflow: hidden; color: #d1d1d1; font-size: 12px; line-height: 1.7; text-decoration: none; overflow-wrap: anywhere; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.source-title:hover { color: #edcfaa; text-decoration: underline; }
.source-meta, .source-retry, .sources-note { margin: 5px 0 0; color: #909090; font-size: 10px; line-height: 1.7; overflow-wrap: anywhere; }
.source-error .source-meta, .source-retry { color: #bca78e; }
.sources-note { margin: 7px 0 15px; }
.agent-capabilities { color: var(--muted); font-size: 12px; line-height: 1.8; }
@media (max-width: 480px) { .source-cards { grid-template-columns: minmax(0, 1fr); } .agent-work-details > summary { gap: 8px; } }

/* A soft rounded composer puts attachments and model choice beside sending. */
.composer-area { flex: none; padding: 13px 36px 16px; background: var(--canvas); }
.composer { position: relative; max-width: 820px; margin: 0 auto; border: 1px solid #414141; border-radius: 22px; background: var(--elevated); }
.composer:focus-within { border-color: #646464; }
.composer-input { position: relative; }
.composer textarea { display: block; width: 100%; min-height: 72px; max-height: 200px; resize: none; padding: 17px 19px 7px; border: 0; outline: none; border-radius: 22px 22px 0 0; background: transparent; color: var(--ink); font-size: 16px; line-height: 1.65; }
.composer textarea:focus-visible { outline: none; }
.composer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 11px 11px; }
.composer-tools { display: flex; flex: 1; align-items: center; justify-content: flex-start; gap: 8px; min-width: 0; }
#composer-hint { flex: 1; min-width: 0; color: var(--muted); font-size: 10px; line-height: 1.7; text-align: left; }
.attach-button { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; padding: 7px; border: 0; border-radius: 50%; background: transparent; color: #d0d0d0; }
.attach-button:hover { background: #3b3b3b; color: #fff; }
.attach-button svg { width: 22px; height: 22px; }
.attach-button > span { display: none; }
.send-button { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #ededed; color: #252525; }
.send-button:hover { background: #fff; }
.send-button svg { width: 20px; height: 20px; stroke-width: 1.9; }
.send-button:disabled { background: #454545; color: #a1a1a1; opacity: 1; }
/* Secondary information stays available without taking space from the conversation. */
.workspace-info { position: relative; display: flex; align-items: center; flex: 0 0 28px; height: 22px; margin-left: -10px; }
.usage-toggle { width: 28px; height: 28px; padding: 5px; }
.usage-toggle svg { width: 17px; height: 17px; }
.usage-toggle[aria-expanded="true"] { background: var(--elevated); color: var(--ink); }
.usage-panel { position: absolute; z-index: 10; top: calc(100% + 10px); right: 0; width: min(350px, calc(100vw - 36px)); max-height: calc(100dvh - 125px); overflow: auto; padding: 17px 18px; border: 1px solid var(--line-strong); border-radius: 13px; background: #272727; box-shadow: 0 12px 35px #0005; white-space: normal; }
.usage-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.usage-panel h2 { margin: 0; color: var(--ink); font-size: 14px; font-weight: 550; line-height: 1.6; }
.usage-panel > header .icon-button { margin: -6px -7px -6px 0; }
.usage-panel h3 { margin: 17px 0 7px; color: #d1d1d1; font-size: 12px; font-weight: 500; line-height: 1.7; }
.usage-panel p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.85; text-align: left; overflow-wrap: anywhere; word-break: keep-all; }
.usage-panel .cost-summary { color: #dedede; font-variant-numeric: tabular-nums; }
.usage-panel .composer-note { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-strong); font-size: 11px; }
.running-hint { display: flex; align-items: center; gap: 8px; max-width: 820px; margin: 0 auto 12px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.running-hint > span:not(.status-dot) { min-width: 0; overflow-wrap: anywhere; }
.stop-button { display: flex; align-items: center; flex: none; gap: 7px; margin-left: auto; padding: 7px 10px; border: 1px solid var(--control-line); border-radius: 8px; background: var(--paper); font-size: 11px; }
.stop-button:hover { border-color: #aaa; color: #fff; }
.stop-square { flex: none; width: 7px; height: 7px; border-radius: 1px; background: currentColor; }
.notice { display: flex; align-items: center; flex: none; gap: 12px; padding: 11px 28px; border-bottom: 1px solid #59413e; background: #2c2423; color: var(--red); font-size: 12px; line-height: 1.8; }
.notice > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.notice .icon-button { color: inherit; }

.model-picker { position: relative; min-width: 0; }
.model-toggle { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; max-width: 240px; min-height: 36px; padding: 7px 9px; border: 0; border-radius: 8px; background: transparent; color: #d0d0d0; font-size: 13px; white-space: nowrap; }
.model-toggle:hover, .model-toggle[aria-expanded=true] { background: #3b3b3b; color: #fff; }
#composer-model-name { overflow: hidden; text-overflow: ellipsis; }
.model-toggle svg { width: 14px; height: 14px; }
.model-menu { position: absolute; z-index: 15; right: 0; bottom: calc(100% + 12px); width: min(340px, calc(100vw - 40px)); max-height: min(340px, 50dvh); overflow-y: auto; padding: 7px; border: 1px solid var(--line-strong); border-radius: 14px; background: #292929; box-shadow: 0 12px 36px #0007; text-align: left; }
.model-menu-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px 10px; color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.5; }
.model-option { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 58px; padding: 10px; border: 0; border-radius: 9px; background: transparent; text-align: left; }
.model-option:hover, .model-option:focus-visible { background: #373737; }
.model-option[aria-selected=true], .model-option[aria-checked=true], .model-option.selected { background: #3c3c3c; }
.model-option-copy { flex: 1; min-width: 0; }
.model-option-title, .model-option strong { display: block; color: var(--ink); font-size: 13px; font-weight: 500; line-height: 1.5; }
.model-option-detail, .model-option small { display: block; margin-top: 4px; color: #aaa; font-size: 11px; line-height: 1.65; overflow-wrap: anywhere; }
.model-option-check { flex: none; color: #eee; visibility: hidden; }
.model-option[aria-checked=true] .model-option-check { visibility: visible; }
.model-option svg { width: 17px; height: 17px; }
.model-refresh { display: inline-flex; align-items: center; gap: 6px; padding: 5px 7px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 11px; }
.model-refresh:hover { background: #414141; color: var(--ink); }
.model-refresh svg { width: 14px; height: 14px; }
.model-menu-note { margin: 4px 9px 7px; padding-top: 9px; border-top: 1px solid #424242; color: var(--muted); font-size: 11px; line-height: 1.65; }

/* File cards and previews share the same neutral surfaces as the chat. */
.files-toggle { display: inline-flex; align-items: center; gap: 7px; min-height: 35px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; }
.files-toggle:hover, .files-toggle[aria-expanded=true] { background: var(--elevated); color: var(--ink); }
.files-toggle svg { width: 17px; height: 17px; }
#files-total { color: var(--muted); font-size: 11px; }
#files-total:empty { display: none; }
.files-panel { display: flex; flex: none; flex-direction: column; width: 306px; min-height: 0; border-left: 1px solid var(--line); background: var(--sidebar); }
.files-panel-header { display: flex; align-items: flex-start; gap: 8px; padding: 22px 17px 18px; }
.files-panel-header > div { flex: 1; min-width: 0; }
.files-panel-header h2 { margin: 0; font-size: 15px; font-weight: 500; line-height: 1.6; }
.files-panel-header p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.8; word-break: keep-all; }
.files-panel-header .icon-button { margin: -5px -6px 0 0; }
.files-toolbar { display: flex; align-items: center; gap: 5px; padding: 0 13px 8px; border-bottom: 1px solid var(--line); }
.files-tabs { display: flex; flex: 1; gap: 5px; }
.files-tabs button { padding: 8px 7px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 12px; }
.files-tabs button[aria-selected=true] { border-bottom-color: #ccc; color: var(--ink); }
.files-tabs span { color: var(--muted); font-size: 11px; }
.files-toolbar > .icon-button svg { width: 16px; height: 16px; }
.files-library { flex: 1; min-height: 0; overflow: auto; padding: 8px 15px; }
.files-empty { display: flex; flex-direction: column; align-items: flex-start; padding: 32px 3px; }
.files-empty > svg { width: 26px; height: 26px; margin-bottom: 19px; color: var(--muted); }
.files-empty strong { font-size: 13px; line-height: 1.8; }
.files-empty p { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.9; word-break: keep-all; }
.library-file { padding: 14px 0; border-bottom: 1px solid var(--line); }
.library-file-preview { display: flex; align-items: center; gap: 11px; width: 100%; padding: 0; border: 0; background: none; text-align: left; }
.library-file-preview:hover strong { color: #fff; }
.file-thumbnail, .file-type { flex: none; width: 46px; height: 46px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--elevated); }
.file-thumbnail { object-fit: cover; }
.file-type { display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.library-file-details { display: flex; flex: 1; flex-direction: column; gap: 6px; min-width: 0; }
.library-file-details strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: var(--ink); font-size: 12px; font-weight: 400; line-height: 1.7; overflow-wrap: anywhere; }
.library-file-details > span { color: var(--muted); font-size: 11px; line-height: 1.6; }
.library-file-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; }
.file-download, .file-reuse { display: inline-flex; align-items: center; gap: 6px; padding: 4px 2px; border: 0; background: transparent; color: var(--muted); font-size: 11px; text-decoration: none; }
.file-download:hover, .file-reuse:hover { color: #fff; }
.file-download svg { width: 13px; height: 13px; }
.files-status { flex: none; min-height: 20px; margin: 0; padding: 8px 17px 13px; color: var(--muted); font-size: 11px; line-height: 1.8; overflow-wrap: anywhere; }
.files-status:empty { min-height: 0; padding-block: 4px; }
.attachment-tray { padding: 11px 12px 0; border-bottom: 1px solid #414141; border-radius: 22px 22px 0 0; }
.attachment-tray-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; color: var(--muted); font-size: 11px; line-height: 1.7; }
#attachment-count { color: var(--ink); }
#attachment-total { margin-left: 8px; }
#clear-attachments { padding: 3px 0; border: 0; background: none; color: var(--muted); font-size: 11px; }
#clear-attachments:hover { color: var(--ink); }
.attachment-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 7px; max-height: 186px; overflow-y: auto; padding: 2px; }
.pending-file { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 7px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--paper); }
.pending-file.error { border-color: #946c66; }
.pending-file > .file-thumbnail, .pending-file > .file-type { width: 36px; height: 36px; font-size: 10px; }
.pending-file-info { flex: 1; min-width: 0; }
.pending-file-info strong { display: block; overflow: hidden; font-size: 11px; font-weight: 400; line-height: 1.7; text-overflow: ellipsis; white-space: nowrap; }
.pending-file-status { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.7; overflow-wrap: anywhere; }
.pending-file.error .pending-file-status { color: var(--red); }
.pending-file.ready .pending-file-status { color: #b8b8b8; }
.file-remove { flex: none; padding: 5px; }
.file-remove svg { width: 14px; height: 14px; }
.file-retry { padding: 5px 3px; border: 0; background: none; color: var(--amber); font-size: 11px; }
.upload-progress { position: absolute; inset: auto 0 0; width: 100%; height: 2px; border: 0; border-radius: 0; accent-color: #ccc; }
.upload-progress::-webkit-progress-bar { background: var(--line); }
.upload-progress::-webkit-progress-value { background: #ccc; }
.attachment-status { margin: 8px 1px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.message-attachments { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 0 0; }
.message.user .message-attachments { justify-content: flex-end; }
.message-file { display: flex; align-items: center; gap: 9px; max-width: 100%; padding: 8px 11px 8px 8px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--paper); text-align: left; }
.message-file:hover { border-color: #8b8b8b; }
.message-file > span:last-child { flex: 1; min-width: 0; }
.message-file strong { display: block; overflow: hidden; max-width: 230px; color: var(--ink); font-size: 12px; font-weight: 400; line-height: 1.7; text-overflow: ellipsis; white-space: nowrap; }
.message-file small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.message-file .file-thumbnail, .message-file .file-type { width: 38px; height: 38px; }
.attachment-notes { margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.8; }
.attachment-notes summary { cursor: pointer; }
.attachment-notes ul { margin: 9px 0 0; padding-left: 20px; }
.attachment-notes li { margin-block: 7px; overflow-wrap: anywhere; }
.file-drop-overlay { position: absolute; z-index: 10; inset: 10px; display: grid; place-items: center; border: 2px dashed #aaa; border-radius: 16px; background: #181818f2; pointer-events: none; }
.file-drop-overlay > div { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 20px; text-align: center; }
.file-drop-overlay svg { width: 40px; height: 40px; color: var(--ink); }
.file-drop-overlay strong { font-size: 20px; font-weight: 500; line-height: 1.8; }
.file-drop-overlay span { color: var(--muted); font-size: 12px; line-height: 1.8; }
.file-preview-dialog { width: min(1100px, calc(100% - 48px)); height: min(840px, calc(100dvh - 48px)); max-width: none; max-height: none; padding: 0; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--canvas); color: var(--ink); }
.file-preview-dialog[open] { display: flex; flex-direction: column; }
.file-preview-dialog::backdrop { background: #000b; }
.file-preview-header { display: flex; align-items: center; flex: none; gap: 12px; padding: 17px 20px; border-bottom: 1px solid var(--line); background: var(--paper); }
.file-preview-header > div { flex: 1; min-width: 0; }
.file-preview-header h2 { overflow: hidden; margin: 0; font-size: 15px; font-weight: 500; line-height: 1.6; text-overflow: ellipsis; white-space: nowrap; }
.file-preview-header p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.file-preview-header > a { flex: none; color: var(--ink); text-decoration: none; }
.file-preview-header > a svg { width: 16px; height: 16px; }
.file-preview-content { position: relative; display: flex; align-items: center; justify-content: center; flex: 1; min-height: 0; overflow: auto; }
.preview-image, .preview-video { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.preview-audio { width: min(620px, 90%); }
.preview-pdf { width: 100%; height: 100%; border: 0; background: var(--canvas); }
.preview-text { align-self: stretch; width: 100%; min-height: 100%; margin: 0; padding: 25px; font: 13px/1.9 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2; }
.preview-markdown { align-self: stretch; width: 100%; max-width: 850px; padding: 28px 32px; font-size: 15px; line-height: 1.85; }
.preview-loading { padding: 24px; color: var(--muted); line-height: 1.8; }
.preview-unsupported { max-width: 440px; padding: 30px; text-align: center; }
.preview-unsupported svg { width: 44px; height: 44px; color: var(--muted); }
.preview-unsupported h3 { margin: 20px 0 12px; font-size: 17px; line-height: 1.7; }
.preview-unsupported p { color: var(--muted); font-size: 13px; line-height: 1.9; }
.file-preview-note { flex: none; min-height: 0; margin: 0; padding: 12px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.8; }
.file-preview-note:empty { padding: 0; border: 0; }

/* Settings are a restrained native-style sheet, with labels kept explicit. */
.settings-dialog { width: min(640px, calc(100% - 32px)); max-height: calc(100dvh - 50px); padding: 0; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--paper); color: var(--ink); }
.settings-dialog::backdrop { background: #0009; }
#settings-form { display: flex; flex-direction: column; max-height: calc(100dvh - 54px); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; flex: none; gap: 15px; padding: 24px 27px 21px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 0 0 8px; font-size: 20px; font-weight: 600; line-height: 1.5; letter-spacing: -.5px; }
.dialog-header p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.dialog-body { overflow: auto; padding: 24px 27px; }
.dialog-body fieldset { min-width: 0; margin: 0 0 29px; padding: 0; border: 0; }
.dialog-body fieldset:last-of-type { margin-bottom: 0; }
.dialog-body legend { display: block; width: 100%; margin-bottom: 16px; padding: 0 0 10px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 14px; font-weight: 500; line-height: 1.5; }
.dialog-body label:not(.radio-option):not(.checkbox-label) { display: block; margin: 0 0 8px; font-size: 12px; line-height: 1.6; }
.dialog-body input:not([type=radio]):not([type=checkbox]) { width: 100%; min-width: 0; height: 42px; padding: 10px 12px; border: 1px solid var(--control-line); border-radius: 8px; background: var(--canvas); color: var(--ink); font-size: 13px; }
.dialog-body input::placeholder { color: var(--muted); }
.field-help { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.85; overflow-wrap: anywhere; }
.key-check-row { display: flex; align-items: center; gap: 12px; margin-top: 13px; }
.key-check-row > span { color: var(--muted); font-size: 11px; line-height: 1.8; }
.secondary-button, .primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 12px; border: 1px solid var(--control-line); border-radius: 8px; font-size: 12px; line-height: 1.5; }
.secondary-button { background: var(--elevated); }
.secondary-button:hover { border-color: #808080; background: #383838; }
.primary-button { border-color: #ededed; background: #ededed; color: #202020; font-weight: 500; }
.primary-button:hover { border-color: #fff; background: #fff; }
.input-action { display: flex; gap: 8px; }
.input-action input { flex: 1; }
.input-action button { flex: none; }
.input-action button svg { width: 16px; height: 16px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.checkbox-label { display: flex; align-items: flex-start; gap: 9px; margin-top: 18px; font-size: 12px; line-height: 1.8; cursor: pointer; }
.checkbox-label input, .radio-option input { flex: none; width: 14px; height: 14px; margin: 3px 0 0; accent-color: #d9d9d9; }
.checkbox-label small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.85; overflow-wrap: anywhere; }
.radio-option { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; padding: 13px; border: 1px solid var(--control-line); border-radius: 8px; cursor: pointer; }
.radio-option:hover { border-color: #888; }
.radio-option:has(input:checked) { border-color: #8a8a8a; background: #303030; }
.radio-option strong { display: block; font-size: 13px; font-weight: 400; line-height: 1.6; }
.radio-option small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.85; }
.dialog-footer { display: flex; justify-content: flex-end; flex: none; gap: 8px; padding: 17px 27px; border-top: 1px solid var(--line); }
.dialog-footer button { padding: 9px 17px; }
.inline-error { margin: 17px 0 0; color: var(--red); font-size: 12px; line-height: 1.8; }
#saved-key-label { margin-left: 5px; color: #bcbcbc; font-size: 11px; font-weight: 400; }
.toast { position: fixed; z-index: 20; bottom: 26px; left: 50%; max-width: 90vw; transform: translateX(-50%); padding: 13px 20px; border: 1px solid #5a5a5a; border-radius: 11px; background: #333; color: var(--ink); box-shadow: 0 8px 24px #0005; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.mobile-only, .sidebar-backdrop { display: none; }

@media (min-width: 1101px) {
  .files-open .conversation-scroll, .files-open .composer-area { padding-inline: 25px; }
  .files-open .welcome h2 { font-size: 28px; }
  .files-open .suggestions { display: flex; flex-direction: column; margin-top: 25px; }
  .files-open .suggestion { flex-direction: row; align-items: center; gap: 12px; padding: 12px 14px; }
  .files-open #composer-hint { display: none; }
}
@media (max-width: 1100px) {
  .sidebar { width: 240px; padding: 23px 12px 18px; }
  .brand { padding-inline: 10px; }
  .brand strong { font-size: 21px; }
  .topbar { padding-inline: 23px; }
  .workspace-bar { padding-inline: 24px; }
  .conversation-scroll { padding-inline: 25px; }
  .composer-area { padding: 13px 25px 15px; }
  .suggestion { padding: 15px 13px; }
  .run-meta { gap: 10px; }
  #budget-label { padding-left: 10px; }
  .welcome h2 { font-size: 30px; }
  #composer-hint { display: none; }
  .files-panel { position: absolute; z-index: 9; inset: 0 0 0 auto; width: min(360px, 100%); border-left-color: var(--control-line); box-shadow: -14px 0 30px #0003; }
}
@media (min-width: 801px) and (max-height: 800px) {
  .welcome { padding-top: 30px; padding-bottom: 20px; }
  .welcome h2 { margin-bottom: 12px; font-size: 28px; }
  .welcome > p { line-height: 1.75; }
  .suggestions { margin-top: 24px; }
  .suggestion { flex-direction: row; align-items: flex-start; gap: 10px; padding-block: 15px; }
  .suggestion svg { width: 18px; height: 18px; margin-top: 2px; }
  .suggestion small { margin-top: 4px; }
  .welcome-hint { margin-top: 18px; }
}
@media (max-width: 800px) {
  .sidebar { position: fixed; z-index: 12; inset: 0 auto 0 0; width: 270px; transform: translateX(-100%); transition: transform .16s ease-out; }
  .sidebar.open { transform: translateX(0); }
  .mobile-only { display: inline-flex; }
  .brand { padding-bottom: 25px; }
  .brand .icon-button { margin-left: auto; }
  .sidebar-backdrop:not([hidden]) { position: fixed; z-index: 11; inset: 0; display: block; border: 0; background: #0008; }
  .topbar { height: 60px; padding-inline: 17px; gap: 10px; }
  .title-group { gap: 9px; }
  .top-actions { gap: 2px; }
  .workspace-bar { gap: 10px; padding: 8px 22px; }
  #budget-label { display: none; }
  .conversation-scroll { padding-inline: 24px; }
  .welcome { padding-top: 54px; }
  .composer-area { padding: 12px 24px 15px; }
  .model-picker { position: static; }
  .model-menu { right: 10px; bottom: 58px; max-height: min(340px, 50dvh); }
}
@media (max-width: 600px) {
  .files-toggle { gap: 5px; min-height: 33px; padding-inline: 8px; }
  .files-panel { width: 100%; border-left: 0; }
  .files-panel-header { padding-top: 17px; }
  .files-library { padding-inline: 20px; }
  .library-file-preview > .file-thumbnail, .library-file-preview > .file-type { width: 56px; height: 56px; }
  .attachment-list { max-height: 145px; }
  .file-preview-dialog { width: calc(100% - 18px); height: calc(100dvh - 18px); border-radius: 12px; }
  .file-preview-header { gap: 8px; padding: 13px; }
  .file-preview-header h2 { font-size: 13px; }
  .file-preview-header > a { width: 34px; height: 34px; padding: 0; font-size: 0; }
  .file-preview-header > a span { display: none; }
  .preview-text { padding: 16px; font-size: 12px; }
  .preview-markdown { padding: 18px; font-size: 14px; }
  .file-preview-note { padding: 10px 14px; }
  #file-preview-copy { padding: 8px; font-size: 10px; }
}
@media (max-width: 520px) {
  .topbar { gap: 6px; padding-inline: 10px; }
  .topbar h1 { font-size: 14px; }
  .topbar > .icon-button { padding: 6px; }
  .title-group { gap: 7px; }
  .run-status { gap: 5px; font-size: 10px; }
  .settings-button { justify-content: center; width: 34px; height: 34px; padding: 0; }
  .settings-button span { display: none; }
  .top-actions .icon-button { padding: 6px; }
  .top-actions .icon-button svg { width: 17px; height: 17px; }
  .workspace-bar { padding: 8px 18px; font-size: 10px; }
  .workspace-bar .run-meta { display: none; }
  .access-toggle { padding-inline: 5px; font-size: 10px; }
  .access-menu { right: -28px; width: min(332px, calc(100vw - 36px)); }
  .run-meta { display: block; overflow: hidden; max-width: 110px; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .conversation-scroll { padding-inline: 19px; scrollbar-gutter: auto; }
  .welcome { padding-top: 34px; padding-bottom: 25px; }
  .welcome h2 { font-size: clamp(24px, 6vw, 28px); line-height: 1.45; letter-spacing: -.7px; }
  .welcome > p { font-size: 14px; line-height: 1.85; }
  .welcome > p br { display: none; }
  .suggestions { display: flex; flex-direction: column; gap: 8px; margin-top: 23px; }
  .suggestion { flex-direction: row; align-items: center; gap: 13px; padding: 13px 14px; }
  .suggestion strong { font-size: 13px; }
  .suggestion small { margin-top: 3px; font-size: 11px; }
  .suggestion svg { width: 19px; height: 19px; }
  .welcome-hint { align-items: flex-start; margin-top: 17px; font-size: 11px; }
  .small-line { margin-top: 10px; }
  .thread { padding-top: 24px; }
  .message { padding-bottom: 29px; }
  .message-body { font-size: 15px; line-height: 1.8; }
  .message.user .message-body { max-width: 93%; padding: 12px 16px; border-radius: 20px; }
  .message-body h1 { font-size: 19px; }
  .message-body h2 { font-size: 18px; }
  .message-body h3, .message-body h4 { font-size: 16px; }
  .message-body pre { padding: 13px; font-size: 12px; }
  .composer-area { padding: 10px 12px 12px; }
  .composer textarea { min-height: 68px; padding: 15px 16px 6px; font-size: 15px; }
  .composer-bottom { gap: 7px; padding: 5px 9px 9px; }
  .composer-tools { gap: 5px; }
  .model-toggle { max-width: 190px; gap: 5px; padding-inline: 7px; font-size: 12px; }
  .model-menu { right: 8px; width: min(340px, calc(100vw - 44px)); }
  .notice { padding: 9px 15px; font-size: 12px; }
  .permission-card { padding: 16px 14px; }
  .permission-card h3 { font-size: 13px; }
  .permission-card > p { font-size: 12px; }
  .settings-dialog { width: calc(100% - 22px); max-height: calc(100dvh - 24px); border-radius: 13px; }
  #settings-form { max-height: calc(100dvh - 28px); }
  .dialog-header { padding: 20px 18px 18px; }
  .dialog-body { padding: 21px 18px; }
  .dialog-footer { padding: 14px 18px; }
  .dialog-header h2 { font-size: 18px; }
  .dialog-header p { font-size: 11px; }
  .field-grid { gap: 12px; }
  .key-check-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .key-check-row > span:empty { display: none; }
  .running-hint { align-items: flex-start; font-size: 11px; }
  .running-hint > .status-dot { margin-top: 7px; }
}
@media (max-width: 390px) {
  .files-toggle { gap: 4px; padding-inline: 6px; }
  .files-toggle > span:first-of-type { display: none; }
}
@media (max-width: 360px) {
  .top-actions { gap: 0; }
  .top-actions .icon-button { padding: 5px; }
  .title-group { gap: 5px; }
  .run-meta { max-width: 94px; }
  .field-grid { grid-template-columns: 1fr; gap: 16px; }
  .input-action { gap: 6px; }
  .input-action button { padding-inline: 9px; }
  .model-toggle { max-width: 166px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; animation: none !important; }
}

/* Bungae identity keeps the original quiet workspace and puts motion in one place. */
.auth-brand { display: flex; align-items: center; gap: 9px; }
.auth-brand > div > span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 400; letter-spacing: 0; }
.auth-card-mascot { display: block; width: 102px; height: 102px; margin: -12px 0 6px; }
.auth-card h1 { font-size: 24px; }
.bungae-avatar { flex: none; width: 30px; height: 30px; margin-left: -4px; }
.message-author { color: #ddd; font-weight: 600; }
.message-model { color: #909090; font-size: 11px; font-weight: 400; }
.work-result { display: flex; align-items: center; gap: 12px; max-width: 820px; margin: 0 auto 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; color: #c4c7c0; font-size: 12px; line-height: 1.65; }
.work-result > span { flex: 1; }
.work-result[data-status="error"] { color: var(--red); }
.work-result .icon-button { padding: 4px; }
@media (max-width: 600px) {
  .auth-card h1 { font-size: 22px; }
  .message-header { gap: 7px; }
  .message-model { font-size: 10px; }
  .work-result { gap: 8px; font-size: 11px; }
}
