:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --ink: #15211b;
  --muted: #67736d;
  --line: #e5eae7;
  --green: #157347;
  --green-soft: #e9f6ef;
  --amber: #a3620a;
  --amber-soft: #fff5df;
  --red: #b42318;
  --red-soft: #fff0ee;
  --blue: #245c96;
  --blue-soft: #edf5ff;
  --sidebar: #12231b;
  --shadow: 0 8px 30px rgba(23, 43, 33, 0.07);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.auth-gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 10%, #254334 0, #12231b 42%, #0c1711 100%); }
.auth-card { width: min(420px, 100%); padding: 36px; border: 1px solid rgba(142, 225, 174, 0.2); border-radius: 18px; background: rgba(255, 255, 255, 0.97); box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34); }
.auth-brand-mark { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 13px; color: #10241a; background: #8ee1ae; font-size: 18px; font-weight: 850; }
.auth-eyebrow { margin: 20px 0 4px; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: 1.4px; }
.auth-card h1 { margin: 0; font-size: 25px; letter-spacing: -0.7px; }
.auth-description { margin: 8px 0 24px; color: var(--muted); font-size: 13px; }
.auth-field span { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 750; }
.auth-field input { width: 100%; height: 46px; padding: 0 13px; border: 1px solid #cbd5cf; border-radius: 9px; color: var(--ink); background: #fff; outline: none; }
.auth-field input:focus { border-color: #5fad7d; box-shadow: 0 0 0 4px rgba(95, 173, 125, 0.15); }
.auth-error { margin: 9px 0 0; color: var(--red); font-size: 12px; }
.auth-submit { width: 100%; min-height: 43px; margin-top: 16px; }
.auth-submit:disabled { cursor: wait; opacity: 0.7; }
.auth-hint { display: block; margin-top: 18px; color: var(--muted); text-align: center; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 16px; color: #eaf2ee; background: var(--sidebar); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 26px; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; color: #10241a; background: #8ee1ae; font-weight: 800; letter-spacing: -0.5px; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 16px; }
.brand span { color: #91a59a; font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; }
nav { display: grid; gap: 5px; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px; border: 0; border-radius: 9px; color: #aebdb5; background: transparent; text-align: left; }
.nav-item span { width: 20px; color: #7f968a; font-size: 17px; text-align: center; }
.nav-item em { min-width: 22px; margin-left: auto; padding: 1px 6px; border-radius: 20px; color: #183623; background: #8ee1ae; font-size: 11px; font-style: normal; text-align: center; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(142, 225, 174, 0.12); }
.nav-item.active span { color: #8ee1ae; }
.safety-card { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 12px; border: 1px solid rgba(142, 225, 174, 0.17); border-radius: 10px; background: rgba(142, 225, 174, 0.07); }
.safety-card strong, .safety-card small { display: block; }
.safety-card small { color: #91a59a; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: #62d78f; box-shadow: 0 0 0 5px rgba(98, 215, 143, 0.12); }
.main { min-width: 0; }
.topbar { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 30px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.86); backdrop-filter: blur(12px); }
.topbar h1 { margin: 0; font-size: 21px; letter-spacing: -0.4px; }
.topbar p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; align-items: end; gap: 9px; }
.connection { padding: 7px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.connection.online { color: var(--green); background: var(--green-soft); }
.connection.offline { color: var(--red); background: var(--red-soft); }
.content { padding: 26px 30px 48px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.toolbar h2 { margin: 0; font-size: 16px; }
.toolbar p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.toolbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.channel-switcher { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #f3f5f4; }
.channel-switcher .button { min-height: 28px; }
.button { min-height: 34px; padding: 7px 13px; border: 1px solid transparent; border-radius: 7px; font-weight: 650; }
.button.primary { color: #fff; background: var(--green); }
.button.secondary { border-color: var(--line); color: var(--ink); background: #fff; }
.button.warning { border-color: #f0d092; color: var(--amber); background: var(--amber-soft); }
.button.danger { border-color: #f2b8b2; color: var(--red); background: var(--red-soft); }
.button.small { min-height: 28px; padding: 4px 9px; font-size: 12px; }
.button:hover { filter: brightness(0.97); }
.grid { display: grid; gap: 15px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.stat, .panel { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.stat { padding: 17px 18px; }
.stat label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.stat strong { display: block; margin-top: 7px; font-size: 26px; line-height: 1.1; letter-spacing: -1px; }
.stat small { color: var(--muted); }
.stat .good { color: var(--green); }
.stat .warn { color: var(--amber); }
.two-columns { grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr); }
.panel { min-width: 0; overflow: hidden; }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel-header h3 { margin: 0; font-size: 14px; }
.panel-header span { color: var(--muted); font-size: 11px; }
.panel-heading-actions { display: flex; align-items: center; gap: 8px; }
.panel-heading-actions .chip { color: inherit; }
.panel-body { padding: 15px 16px; }
.settings-grid { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr); gap: 16px; }
.form-field { display: block; }
.form-field > span { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; }
.form-field input, .form-field select { width: 100%; height: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; outline: none; }
.form-field textarea { width: 100%; resize: vertical; padding: 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; outline: none; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: #5fad7d; box-shadow: 0 0 0 3px rgba(95, 173, 125, 0.13); }
.form-field input:read-only { color: var(--muted); background: #f3f5f4; }
.form-field small { display: block; margin-top: 5px; color: var(--muted); }
.inline-fields { display: grid; grid-template-columns: minmax(100px, 0.35fr) minmax(180px, 0.65fr); gap: 8px; }
.settings-actions { display: flex; align-items: center; gap: 8px; grid-column: 1/-1; }
.settings-actions button:disabled { cursor: not-allowed; opacity: 0.5; }
.settings-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-column: 1/-1; border: 1px solid var(--line); border-radius: 9px; background: #fafbfa; }
.settings-summary > div { min-width: 0; padding: 11px 13px; border-right: 1px solid var(--line); }
.settings-summary > div:last-child { border-right: 0; }
.settings-summary span, .settings-summary strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-summary span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.35px; }
.settings-summary strong { margin-top: 3px; font-size: 12px; }
.model-list { grid-column: 1/-1; color: var(--muted); font-size: 12px; }
.model-list summary { cursor: pointer; }
.model-list div { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
th { color: var(--muted); background: #fafbfa; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.35px; }
td { font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfb; }
.selected-row { background: #f2f7ff; }
.selected-row:hover { background: #edf4ff; }
.title-cell strong, .title-cell small { display: block; }
.title-cell small { max-width: 520px; margin-top: 3px; color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.chip { display: inline-flex; align-items: center; white-space: nowrap; padding: 3px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.chip.green { color: var(--green); background: var(--green-soft); }
.chip.amber { color: var(--amber); background: var(--amber-soft); }
.chip.red { color: var(--red); background: var(--red-soft); }
.chip.blue { color: var(--blue); background: var(--blue-soft); }
.chip.gray { color: #5e6963; background: #eef1ef; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.notice { margin-bottom: 15px; padding: 11px 13px; border: 1px solid #f0d092; border-radius: 9px; color: #754609; background: var(--amber-soft); }
.timeline { display: grid; gap: 12px; }
.timeline-item { position: relative; padding-left: 22px; }
.timeline-item::before { position: absolute; top: 6px; left: 2px; width: 8px; height: 8px; border-radius: 50%; background: #83c99e; content: ""; }
.timeline-item::after { position: absolute; top: 17px; bottom: -14px; left: 5px; width: 1px; background: var(--line); content: ""; }
.timeline-item:last-child::after { display: none; }
.timeline-item strong, .timeline-item small { display: block; }
.timeline-item small { color: var(--muted); }
.code-box { max-height: 320px; overflow: auto; margin: 0; padding: 14px; border-radius: 9px; color: #d9eee0; background: #14231b; font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; }
.empty-state { padding: 50px; border: 1px dashed #cad3ce; border-radius: 12px; color: var(--muted); text-align: center; background: rgba(255, 255, 255, 0.6); }
.drawer { position: fixed; z-index: 50; inset: 0; display: none; }
.drawer.open { display: block; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(8, 20, 13, 0.35); }
.drawer-panel { position: absolute; top: 0; right: 0; width: min(680px, 90vw); height: 100%; margin: 0; background: #fff; box-shadow: -20px 0 50px rgba(0, 0, 0, 0.16); }
.drawer-panel header { display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.drawer-panel h2 { margin: 0; font-size: 16px; }
.drawer-panel header button { border: 0; background: transparent; font-size: 26px; }
.drawer-panel pre { height: calc(100% - 64px); overflow: auto; margin: 0; padding: 20px; white-space: pre-wrap; word-break: break-word; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.chat-dialog { position: fixed; z-index: 70; inset: 0; display: none; padding: 24px; place-items: center; }
.chat-dialog.open { display: grid; }
.chat-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(7, 18, 12, 0.56); backdrop-filter: blur(3px); }
.chat-window { position: relative; display: grid; width: min(1080px, 96vw); height: min(820px, calc(100vh - 48px)); min-height: 560px; grid-template-rows: auto auto minmax(0, 1fr) auto; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 16px; background: #f8faf9; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28); }
.chat-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 18px; border-bottom: 1px solid var(--line); background: #fff; }
.chat-title-row { display: flex; align-items: center; gap: 11px; }
.chat-logo { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; color: #10241a; background: #8ee1ae; font-weight: 800; }
.chat-title-row h2 { margin: 0; font-size: 15px; }
.chat-title-row p { margin: 1px 0 0; color: var(--muted); font-size: 11px; }
.chat-header-actions { display: flex; align-items: center; gap: 7px; }
.chat-profile-field { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.chat-profile-field select { max-width: 150px; height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: #fff; outline: none; }
.chat-profile-field select:focus { border-color: #5fad7d; box-shadow: 0 0 0 3px rgba(95, 173, 125, 0.13); }
.chat-icon-button { display: grid; width: 32px; height: 32px; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #fff; font-size: 19px; }
.chat-icon-button:hover { color: var(--ink); background: #f5f7f6; }
.chat-guardrail { display: flex; align-items: center; gap: 9px; padding: 9px 18px; border-bottom: 1px solid #f0d092; color: #754609; background: var(--amber-soft); font-size: 11px; }
.chat-guardrail strong { white-space: nowrap; }
.chat-messages { display: flex; min-height: 0; flex-direction: column; gap: 15px; overflow-y: auto; padding: 22px clamp(18px, 5vw, 72px); scroll-behavior: smooth; }
.chat-message { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.chat-message.user { align-items: flex-end; }
.chat-message-meta { display: flex; align-items: center; gap: 7px; padding: 0 4px; color: var(--muted); font-size: 10px; }
.chat-message-bubble { max-width: min(760px, 86%); padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px 12px 12px 3px; background: #fff; box-shadow: 0 3px 14px rgba(23, 43, 33, 0.04); }
.chat-message.assistant .chat-message-bubble { width: min(880px, 94%); max-width: min(880px, 94%); }
.chat-message.user .chat-message-bubble { border-color: #157347; border-radius: 12px 12px 3px 12px; color: #fff; background: var(--green); }
.chat-message.error .chat-message-bubble { border-color: #f2b8b2; color: var(--red); background: var(--red-soft); }
.chat-message-bubble p { margin: 0; word-break: break-word; }
.chat-message-bubble details { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.chat-message.user .chat-message-bubble details { border-color: rgba(255, 255, 255, 0.25); }
.chat-message-bubble summary { cursor: pointer; font-size: 11px; font-weight: 700; }
.chat-message-bubble pre { max-height: 260px; overflow: auto; margin: 8px 0 0; padding: 10px; border-radius: 7px; color: #d9eee0; background: #14231b; white-space: pre-wrap; word-break: break-word; font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.chat-markdown { min-width: 0; color: inherit; font-size: 13px; line-height: 1.65; }
.chat-markdown > :first-child { margin-top: 0; }
.chat-markdown > :last-child { margin-bottom: 0; }
.chat-markdown p { margin: 8px 0; }
.chat-markdown h1, .chat-markdown h2, .chat-markdown h3, .chat-markdown h4, .chat-markdown h5, .chat-markdown h6 { margin: 15px 0 7px; line-height: 1.35; }
.chat-markdown h1 { font-size: 19px; }
.chat-markdown h2 { font-size: 17px; }
.chat-markdown h3 { font-size: 15px; }
.chat-markdown h4, .chat-markdown h5, .chat-markdown h6 { font-size: 13px; }
.chat-markdown ul, .chat-markdown ol { margin: 7px 0; padding-left: 22px; }
.chat-markdown li + li { margin-top: 3px; }
.chat-markdown blockquote { margin: 9px 0; padding: 7px 11px; border-left: 3px solid #83c99e; color: #486154; background: #f2f8f4; }
.chat-markdown blockquote p { margin: 0; }
.chat-markdown hr { height: 1px; margin: 13px 0; border: 0; background: var(--line); }
.chat-markdown a { color: #1769aa; text-decoration: underline; text-underline-offset: 2px; }
.chat-message.user .chat-markdown a { color: #fff; }
.chat-markdown code:not(pre code), .chat-result-card code:not(pre code) { padding: 1px 5px; border-radius: 4px; color: #1b5d37; background: #edf6f0; font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.chat-message.user .chat-markdown code:not(pre code) { color: #fff; background: rgba(255, 255, 255, 0.16); }
.markdown-table-wrapper, .chat-data-table-wrapper { max-width: 100%; overflow: auto; margin: 9px 0; border: 1px solid var(--line); border-radius: 8px; }
.markdown-table, .chat-data-table { min-width: 100%; width: max-content; max-width: none; background: #fff; }
.markdown-table th, .markdown-table td, .chat-data-table th, .chat-data-table td { max-width: 280px; padding: 7px 9px; white-space: nowrap; }
.markdown-table td, .chat-data-table td { font-size: 11px; }
.chat-command-plan, .chat-execution-results, .chat-failure { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.chat-command-plan > h3, .chat-execution-results > h3, .chat-failure > h3 { margin: 0 0 8px; font-size: 12px; }
.chat-command-card { display: grid; gap: 5px; padding: 9px 10px; border: 1px solid #dfe7e2; border-radius: 8px; background: #f8faf9; }
.chat-command-card + .chat-command-card { margin-top: 7px; }
.chat-command-card > code { overflow-x: auto; padding: 7px 8px; border-radius: 6px; color: #d9eee0; background: #14231b; white-space: pre; font: 10px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.chat-command-card > small { color: var(--muted); }
.chat-command-title, .chat-result-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.chat-command-title > strong, .chat-result-heading > strong { min-width: 0; font-size: 11px; }
.chat-result-heading > span { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.chat-result-card { padding: 10px; border: 1px solid #dfe7e2; border-radius: 9px; background: #fff; }
.chat-result-card + .chat-result-card { margin-top: 9px; }
.chat-data-section { margin-top: 10px; }
.chat-data-section h4, .chat-stderr h4 { margin: 0 0 6px; font-size: 11px; }
.chat-kv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; overflow: hidden; margin: 7px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--line); }
.chat-kv-grid > div { min-width: 0; padding: 7px 8px; background: #fafbfa; }
.chat-kv-grid dt { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.chat-kv-grid dd { overflow-wrap: anywhere; margin: 2px 0 0; font-size: 11px; font-weight: 650; }
.chat-kv-grid dd code { white-space: pre-wrap; }
.chat-empty-result { margin-top: 8px; padding: 12px; border: 1px dashed #cad3ce; border-radius: 8px; color: var(--muted); text-align: center; background: #fafbfa; font-size: 11px; }
.chat-result-note { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.chat-stderr { margin-top: 10px; color: var(--red); }
.chat-command-details, .chat-raw-details, .chat-nested-result { margin-top: 9px !important; }
.chat-raw-details:not([open]) { color: var(--muted); }
.chat-result-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.chat-typing { display: inline-flex; gap: 4px; padding: 3px 0; }
.chat-typing i { width: 6px; height: 6px; border-radius: 50%; background: #7c9487; animation: chat-bounce 1.1s infinite ease-in-out; }
.chat-typing i:nth-child(2) { animation-delay: 0.14s; }
.chat-typing i:nth-child(3) { animation-delay: 0.28s; }
@keyframes chat-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.45; } 30% { transform: translateY(-4px); opacity: 1; } }
.chat-composer { padding: 13px 16px 15px; border-top: 1px solid var(--line); background: #fff; }
.chat-examples { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 9px; }
.chat-examples span { margin-right: 2px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; }
.chat-examples button { padding: 3px 8px; border: 1px solid var(--line); border-radius: 20px; color: var(--muted); background: #fff; font-size: 10px; }
.chat-examples button:hover { border-color: #9bc8ad; color: var(--green); }
#chat-form > textarea { width: 100%; min-height: 68px; max-height: 180px; resize: vertical; padding: 11px 12px; border: 1px solid #cfd8d3; border-radius: 10px; color: var(--ink); background: #fff; outline: none; }
#chat-form > textarea:focus, #chat-input:focus { border-color: #5fad7d; box-shadow: 0 0 0 3px rgba(95, 173, 125, 0.13); }
.chat-composer-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 8px; }
.chat-input-details { min-width: 240px; color: var(--muted); font-size: 11px; }
.chat-input-details summary { cursor: pointer; font-weight: 700; }
#chat-input { width: min(620px, 70vw); margin-top: 7px; resize: vertical; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; outline: none; font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.chat-send-group { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.chat-send-group small { color: var(--muted); white-space: nowrap; font-size: 10px; }
.chat-send-group button:disabled { cursor: wait; opacity: 0.6; }
body.chat-open { overflow: hidden; }
.profile-dialog { position: fixed; z-index: 80; inset: 0; display: none; padding: 24px; place-items: center; }
.profile-dialog.open { display: grid; }
.profile-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(7, 18, 12, 0.56); backdrop-filter: blur(3px); }
.profile-window { position: relative; width: min(560px, 94vw); overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 14px; background: #fff; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28); }
.profile-window > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 17px 19px; border-bottom: 1px solid var(--line); }
.profile-window h2 { margin: 0; font-size: 16px; }
.profile-window header p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
#profile-form { display: grid; gap: 15px; padding: 19px; }
#profile-form footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 3px; }
.fixed-task-window { width: min(760px, 94vw); }
#fixed-task-form { display: grid; gap: 15px; padding: 19px; }
#fixed-task-form footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 3px; }
.fixed-task-version { max-width: 220px; }
.timer-window { width: min(680px, 94vw); }
#timer-form { display: grid; gap: 15px; padding: 19px; }
#timer-form footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 3px; }
.timer-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.timer-enabled-field { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fafbfa; }
.timer-enabled-field input { width: 17px; height: 17px; margin-top: 1px; accent-color: var(--green); }
.timer-enabled-field span, .timer-enabled-field strong, .timer-enabled-field small { display: block; }
.timer-enabled-field strong { font-size: 12px; }
.timer-enabled-field small { margin-top: 2px; color: var(--muted); }
.timer-safety-note { padding: 9px 11px; border-left: 3px solid #83c99e; color: #486154; background: #f2f8f4; font-size: 11px; line-height: 1.55; }
.timer-table { overflow-x: auto; }
.timer-table table { min-width: 1220px; }
.timer-table td small { color: var(--muted); }
.timer-notice { border-color: #b9dac5; color: #28543a; background: var(--green-soft); }
.dialog-spacer { flex: 1; }
.profile-form-error { margin: 0; padding: 9px 11px; border: 1px solid #f2b8b2; border-radius: 8px; color: var(--red); background: var(--red-soft); font-size: 12px; }
.profile-endpoint strong, .profile-endpoint small { display: block; }
.profile-endpoint small { color: var(--muted); }
.profile-error { display: block; max-width: 360px; margin-top: 4px; color: var(--red); font-size: 11px; }
body.profile-open, body.fixed-task-open, body.timer-open { overflow: hidden; }
.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: 440px; padding: 11px 15px; border-radius: 8px; color: #fff; background: #1d3226; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: 0.2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--red); }
@media (max-width: 1000px) { .stats { grid-template-columns: repeat(2, 1fr); } .two-columns { grid-template-columns: 1fr; } .settings-summary { grid-template-columns: repeat(2, 1fr); } .settings-summary > div:nth-child(2) { border-right: 0; } .settings-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); } }
@media (max-width: 760px) { .app-shell { display: block; } .sidebar { position: static; width: 100%; height: auto; } nav { grid-template-columns: repeat(2, 1fr); } .safety-card { margin-top: 16px; } .topbar { align-items: flex-start; padding: 18px; } .top-actions { flex-wrap: wrap; justify-content: flex-end; } .content { padding: 18px; } .stats { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .settings-grid { grid-template-columns: 1fr; } .settings-summary { grid-template-columns: 1fr; } .settings-summary > div { border-right: 0; border-bottom: 1px solid var(--line); } .settings-summary > div:last-child { border-bottom: 0; } }
@media (max-width: 700px) { .chat-dialog { padding: 0; } .chat-window { width: 100vw; height: 100vh; min-height: 0; border: 0; border-radius: 0; } .chat-header { align-items: flex-start; padding: 12px; } .chat-header-actions .chip, .chat-profile-field span { display: none; } .chat-profile-field select { max-width: 112px; } .chat-title-row p { display: none; } .chat-guardrail { align-items: flex-start; padding: 8px 12px; } .chat-messages { padding: 16px 12px; } .chat-message-bubble, .chat-message.assistant .chat-message-bubble { width: auto; max-width: 96%; } .chat-kv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .chat-composer { padding: 10px 12px; } .chat-examples { overflow-x: auto; flex-wrap: nowrap; } .chat-examples button { flex: 0 0 auto; } .chat-composer-bottom { align-items: stretch; flex-direction: column; } .chat-input-details { min-width: 0; } #chat-input { width: 100%; } .chat-send-group { justify-content: flex-end; margin-left: 0; } }
@media (max-width: 620px) { .profile-dialog { padding: 0; } .profile-window { width: 100vw; min-height: 100vh; border: 0; border-radius: 0; } }
@media (max-width: 620px) { .timer-form-grid { grid-template-columns: 1fr; } }
