:root {
  --navy-950: #071527;
  --navy-900: #0b1d32;
  --navy-850: #10263f;
  --ink: #152234;
  --muted: #68768a;
  --muted-2: #8c98a9;
  --line: #e4e9ef;
  --line-dark: #d7dee7;
  --surface: #ffffff;
  --surface-soft: #f6f8fa;
  --surface-blue: #f1f6fa;
  --canvas: #eef2f5;
  --cyan: #35c7c1;
  --cyan-dark: #169c99;
  --cyan-soft: #e8f8f7;
  --blue: #2f6feb;
  --amber: #ca8725;
  --amber-soft: #fff5e5;
  --red: #c95050;
  --green: #20a36d;
  --shadow-sm: 0 1px 2px rgba(12, 30, 51, .05), 0 5px 18px rgba(12, 30, 51, .04);
  --shadow-md: 0 18px 48px rgba(12, 30, 51, .12);
  --radius: 12px;
  --radius-lg: 18px;
  font-family: Inter, "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--canvas); font-size: 14px; line-height: 1.6; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(53, 199, 193, .2);
  outline-offset: 1px;
}
[hidden] { display: none !important; }

.boot-screen {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-content: center;
  justify-items: center; background: var(--navy-950); color: #fff;
}
.boot-logo { width: 76px; height: 76px; object-fit: contain; }
.boot-mark {
  width: 58px; height: 58px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.26);
  color: var(--red); font-size: 26px; font-weight: 600;
}
.boot-copy { margin-top: 26px; font-size: 12px; font-weight: 700; letter-spacing: .28em; }
.boot-line { width: 150px; height: 2px; margin-top: 18px; background: rgba(255,255,255,.12); overflow: hidden; }
.boot-line span { display: block; height: 100%; width: 42%; background: var(--cyan); animation: boot 1s ease-in-out infinite alternate; }
.boot-error-detail { max-width: 520px; margin: 18px 24px 0; color: #aeb9c6; text-align: center; font-size: 12px; }
.boot-reload-button {
  margin-top: 20px; padding: 8px 18px; border: 1px solid rgba(255,255,255,.24); border-radius: 7px;
  background: transparent; color: #fff; cursor: pointer;
}
.boot-reload-button:hover { border-color: var(--cyan); color: var(--cyan); }
@keyframes boot { from { transform: translateX(-100%); } to { transform: translateX(240%); } }

.app-shell { min-height: 100vh; display: flex; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 20; width: 244px; display: flex; flex-direction: column;
  background:
    radial-gradient(circle at 0 0, rgba(53,199,193,.12), transparent 32%),
    linear-gradient(180deg, var(--navy-900), var(--navy-950));
  color: rgba(255,255,255,.74); border-right: 1px solid rgba(255,255,255,.06);
}
.brand { height: 92px; display: flex; align-items: center; gap: 14px; padding: 0 24px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-logo { width: 38px; height: 38px; object-fit: contain; flex: 0 0 auto; }
.brand-type { display: flex; flex-direction: column; line-height: 1.25; }
.brand-type strong { color: #fff; letter-spacing: .1em; font-size: 12px; }
.brand-type span { margin-top: 4px; color: rgba(255,255,255,.4); font-size: 8px; letter-spacing: .24em; }
.sidebar-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 16px 14px 10px; padding: 4px; border-radius: 9px; background: rgba(255,255,255,.055); }
.sidebar-tabs button { min-width: 0; height: 34px; padding: 0 7px; border: 0; border-radius: 6px; background: transparent; color: rgba(255,255,255,.5); font-size: 10px; cursor: pointer; }
.sidebar-tabs button.active { background: rgba(53,199,193,.13); color: #fff; }
.sidebar-tabs button span { display: inline-grid; place-items: center; min-width: 17px; height: 17px; margin-left: 3px; border-radius: 9px; background: rgba(255,255,255,.09); font-size: 8px; }
.sidebar-panel { min-height: 0; flex: 1; display: flex; flex-direction: column; padding: 0 14px 16px; }
.sidebar-new-conversation { height: 40px; flex: 0 0 auto; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid rgba(255,255,255,.11); border-radius: 8px; background: rgba(255,255,255,.055); color: rgba(255,255,255,.84); font-size: 10px; cursor: pointer; }
.sidebar-new-conversation:hover { border-color: rgba(53,199,193,.35); background: rgba(53,199,193,.09); color: #fff; }
.sidebar-new-conversation span { color: var(--cyan); font-size: 16px; font-weight: 300; }
.conversation-list, .sidebar-mcp-list { min-height: 0; margin-top: 13px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.16) transparent; }
.conversation-group + .conversation-group { margin-top: 17px; }
.conversation-group-label { display: block; padding: 0 8px 6px; color: rgba(255,255,255,.27); font-size: 8px; font-weight: 700; letter-spacing: .14em; }
.conversation-list-item { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; padding: 10px 9px; border: 0; border-radius: 7px; background: transparent; color: rgba(255,255,255,.55); cursor: pointer; text-align: left; }
.conversation-list-item:hover { background: rgba(255,255,255,.045); color: rgba(255,255,255,.82); }
.conversation-list-item.active { background: rgba(53,199,193,.1); color: #fff; }
.conversation-list-item strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 500; }
.conversation-list-item time { grid-column: 1; color: rgba(255,255,255,.26); font-size: 8px; }
.conversation-status { grid-row: 1 / 3; grid-column: 2; align-self: center; width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.2); }
.conversation-status.pending { background: var(--amber); }
.conversation-status.failed, .conversation-status.unanswerable, .conversation-status.cancelled { background: var(--red); }
.conversation-status.completed { background: var(--cyan); }
.sidebar-empty { padding: 22px 9px; color: rgba(255,255,255,.34); font-size: 9px; text-align: center; }
.sidebar-panel-head { min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-panel-head > div { display: flex; flex-direction: column; min-width: 0; }
.sidebar-panel-head strong { color: rgba(255,255,255,.8); font-size: 10px; }
.sidebar-panel-head small { color: rgba(255,255,255,.3); font-size: 8px; }
.sidebar-icon-button { width: 30px; height: 30px; border: 1px solid rgba(255,255,255,.09); border-radius: 6px; background: transparent; color: rgba(255,255,255,.55); cursor: pointer; }
.sidebar-mcp-item { display: grid; grid-template-columns: 18px 28px 1fr; align-items: center; gap: 8px; padding: 9px 7px; border-radius: 7px; color: rgba(255,255,255,.65); cursor: pointer; }
.sidebar-mcp-item:hover { background: rgba(255,255,255,.045); }
.sidebar-mcp-item input { accent-color: var(--cyan-dark); }
.sidebar-mcp-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 6px; background: rgba(255,255,255,.07); color: rgba(255,255,255,.72); font-size: 8px; font-weight: 700; }
.sidebar-mcp-copy { min-width: 0; display: flex; flex-direction: column; }
.sidebar-mcp-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; font-weight: 500; }
.sidebar-mcp-copy small { color: rgba(255,255,255,.3); font-size: 8px; }
.sidebar-mcp-item.disabled { opacity: .47; cursor: not-allowed; }
.main-nav { padding: 28px 14px; }
.nav-section-label { padding: 0 13px 9px; color: rgba(255,255,255,.28); font-size: 9px; font-weight: 700; letter-spacing: .18em; }
.nav-settings-label { margin-top: 26px; }
.nav-item {
  position: relative; width: 100%; height: 46px; border: 0; border-radius: 8px; display: flex; align-items: center;
  gap: 13px; padding: 0 13px; background: transparent; color: rgba(255,255,255,.58); cursor: pointer; text-align: left;
  transition: .18s ease;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-item.active { color: #fff; background: rgba(53,199,193,.1); }
.nav-item.active::before { content: ""; position: absolute; left: -14px; width: 3px; height: 24px; border-radius: 0 3px 3px 0; background: var(--cyan); }
.nav-icon { width: 20px; color: rgba(255,255,255,.55); font-size: 16px; text-align: center; }
.nav-item.active .nav-icon { color: var(--cyan); }
.nav-count { margin-left: auto; min-width: 21px; height: 20px; display: grid; place-items: center; padding: 0 5px; border-radius: 10px; background: rgba(255,255,255,.09); font-size: 10px; }
.sidebar-bottom { margin-top: auto; padding: 20px; }
.system-mini { display: flex; align-items: center; gap: 11px; padding: 15px 4px; border-top: 1px solid rgba(255,255,255,.07); }
.system-mini > div { display: flex; flex-direction: column; }
.system-mini strong { color: rgba(255,255,255,.75); font-size: 11px; font-weight: 500; }
.system-mini span:not(.status-dot) { color: rgba(255,255,255,.3); font-size: 9px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); box-shadow: 0 0 0 4px rgba(255,255,255,.04); }
.status-dot.online { background: var(--cyan); box-shadow: 0 0 0 4px rgba(53,199,193,.1); }
.test-badge { padding: 9px 11px; border: 1px solid rgba(255,255,255,.08); border-radius: 6px; color: rgba(255,255,255,.32); font-size: 8px; letter-spacing: .16em; text-align: center; }
.test-badge span { color: var(--cyan); font-weight: 700; }

.workspace { flex: 1; min-width: 0; margin-left: 244px; }
.topbar {
  position: sticky; top: 0; z-index: 15; height: 92px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 34px 0 40px; background: rgba(255,255,255,.94); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.topbar-title { display: flex; align-items: center; gap: 12px; }
.eyebrow, .overline { color: var(--cyan-dark); font-size: 9px; font-weight: 700; letter-spacing: .17em; text-transform: uppercase; }
.topbar-title h1 { margin: 2px 0 0; font-size: 20px; line-height: 1.3; font-weight: 600; letter-spacing: .02em; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.mode-switch { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.mode-switch button { height: 31px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 11px; cursor: pointer; }
.mode-switch button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 5px rgba(12,30,51,.1); }
.mini-lock, .mini-globe { margin-right: 4px; color: var(--cyan-dark); font-size: 8px; }
.owner-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--navy-850); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.main-content { padding: 36px 40px 54px; }
.page { display: none; max-width: 1500px; margin: 0 auto; }
.page.active { display: block; animation: pageIn .24s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.ask-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; max-width: 1120px; margin: 0 auto; }
.ask-primary { min-width: 0; }
.conversation-toolbar { min-height: 37px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.conversation-toolbar > span { display: flex; flex-direction: column; color: var(--muted); font-size: 9px; }
.conversation-toolbar > span > strong { max-width: min(620px, 65vw); overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.conversation-toolbar > span > small { color: var(--muted); font-size: 9px; }
.conversation-toolbar b { margin-left: 5px; color: var(--ink); font-weight: 600; }
.conversation-thread { display: flex; flex-direction: column; gap: 16px; }
.conversation-thread:not(:empty) { margin-bottom: 20px; }
.conversation-turn { display: flex; flex-direction: column; gap: 16px; }
.conversation-message { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.conversation-message > header { min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 16px; border-bottom: 1px solid var(--line); font-size: 9px; }
.conversation-message > header strong { font-size: 10px; }
.conversation-message > header time, .conversation-message > header span { color: var(--muted-2); }
.user-message { width: min(78%, 760px); margin-left: auto; border-color: #cdd9e4; background: var(--navy-850); color: #fff; }
.user-message > header { border-bottom-color: rgba(255,255,255,.1); }
.user-message > header time { color: rgba(255,255,255,.45); }
.user-message > div { padding: 16px 18px; font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.assistant-message { background: #fff; }
.assistant-message .answer-body { padding-top: 20px; padding-bottom: 20px; }
.assistant-message.terminal-message { border-color: #ecd5d5; background: #fffafa; }
.turn-status-label { padding: 3px 7px; border-radius: 9px; background: #fff0f0; color: var(--red) !important; font-size: 8px; }
.admin-settings-button { height: 34px; padding: 0 12px; font-size: 10px; }

.composer-card { position: relative; margin-top: 0; padding: 23px 24px 18px; border: 1px solid var(--line-dark); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.composer-card:focus-within { border-color: #b6d9d7; box-shadow: 0 0 0 3px rgba(53,199,193,.07), var(--shadow-sm); }
.composer-head { display: flex; justify-content: space-between; align-items: center; }
.composer-head label { color: var(--ink); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.composer-head span { color: var(--muted-2); font-size: 9px; }
#question-input { width: 100%; min-height: 112px; padding: 12px 0; border: 0; outline: 0; resize: vertical; background: transparent; color: var(--ink); font-size: 15px; line-height: 1.85; }
#question-input::placeholder { color: #a4adba; }
.selected-mcp-chips { min-height: 30px; display: flex; flex-wrap: wrap; gap: 7px; padding: 8px 0 13px; }
.mcp-chip { display: inline-flex; align-items: center; gap: 6px; height: 27px; padding: 0 9px; border: 1px solid #d5e3e7; border-radius: 5px; background: #f6fbfb; color: #34515b; font-size: 9px; }
.mcp-chip i { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.mcp-chip.offline i { background: var(--red); }
.mcp-chip button { border: 0; background: transparent; color: var(--muted-2); cursor: pointer; padding: 0 0 0 2px; }
.composer-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-top: 15px; border-top: 1px solid var(--line); }
.composer-tools { display: flex; align-items: center; gap: 14px; min-width: 0; }
.subtle-button, .secondary-button { border: 1px solid var(--line-dark); border-radius: 7px; background: #fff; cursor: pointer; }
.subtle-button { height: 34px; padding: 0 11px; color: #4f5f73; font-size: 10px; }
.subtle-button span { margin-right: 5px; color: var(--cyan-dark); }
.subtle-button b { display: inline-grid; place-items: center; min-width: 17px; height: 17px; margin-left: 5px; border-radius: 9px; background: var(--navy-850); color: #fff; font-size: 8px; }
.privacy-note { color: var(--muted-2); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.privacy-note span { color: var(--cyan-dark); margin-right: 4px; }
.primary-button { height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 17px; padding: 0 19px; border: 0; border-radius: 7px; background: var(--navy-850); color: #fff; font-size: 11px; font-weight: 600; cursor: pointer; box-shadow: 0 7px 16px rgba(11,29,50,.14); transition: .18s ease; }
.primary-button:hover { background: #173452; transform: translateY(-1px); }
.primary-button:disabled { opacity: .55; cursor: wait; transform: none; }
.send-arrow { color: var(--cyan); font-size: 15px; }
.mcp-picker { position: absolute; z-index: 25; top: calc(100% - 12px); left: 24px; width: min(520px, calc(100% - 48px)); border: 1px solid var(--line-dark); border-radius: 10px; background: #fff; box-shadow: var(--shadow-md); overflow: hidden; }
.picker-head, .picker-foot { display: flex; justify-content: space-between; align-items: center; padding: 15px 17px; }
.picker-head { border-bottom: 1px solid var(--line); }
.picker-head > div { display: flex; flex-direction: column; }
.picker-head strong { font-size: 12px; }
.picker-head span { color: var(--muted); font-size: 9px; }
.icon-button { width: 30px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; }
.icon-button:hover { background: var(--surface-soft); }
.picker-list { max-height: 310px; padding: 6px; overflow: auto; }
.picker-item { display: grid; grid-template-columns: 22px 34px 1fr auto; align-items: center; gap: 10px; padding: 11px; border-radius: 7px; cursor: pointer; }
.picker-item:hover { background: var(--surface-soft); }
.picker-item input { accent-color: var(--cyan-dark); }
.picker-dept-icon { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid #dce5ea; border-radius: 7px; background: var(--surface-blue); color: var(--navy-850); font-size: 10px; font-weight: 700; }
.picker-item > div:nth-child(3) { display: flex; flex-direction: column; min-width: 0; }
.picker-item strong { font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-item small { color: var(--muted); font-size: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.health-label { padding: 3px 7px; border-radius: 9px; background: #eaf7f1; color: var(--green); font-size: 8px; }
.health-label.offline { background: #fff0f0; color: var(--red); }
.health-label.unconfigured { background: var(--amber-soft); color: var(--amber); }
.picker-foot { border-top: 1px solid var(--line); background: var(--surface-soft); }
.text-button, .text-icon-button { padding: 0; border: 0; background: transparent; color: var(--cyan-dark); font-size: 10px; cursor: pointer; }
.small-primary { height: 32px; padding: 0 13px; border: 0; border-radius: 6px; background: var(--navy-850); color: #fff; font-size: 10px; cursor: pointer; }

.ask-aside { display: flex; flex-direction: column; gap: 16px; }
.aside-card { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.7); box-shadow: var(--shadow-sm); }
.department-overview { padding: 19px 18px 8px; }
.aside-heading { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; }
.aside-heading h3 { margin: 1px 0 0; font-size: 13px; }
.text-icon-button { width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); }
.aside-department { display: grid; grid-template-columns: 34px minmax(0, 1fr) 8px; gap: 10px; align-items: center; padding: 12px 2px; border-top: 1px solid var(--line); }
.aside-department-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-blue); color: var(--navy-850); font-size: 9px; font-weight: 700; }
.aside-department > div:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }
.aside-department strong { font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aside-department small { color: var(--muted-2); font-size: 8px; }
.health-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); }
.health-dot.ready { background: var(--green); box-shadow: 0 0 0 3px rgba(32,163,109,.08); }
.health-dot.offline { background: var(--red); }
.workflow-card { margin-top: 24px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.section-heading { display: flex; justify-content: space-between; align-items: center; }
.section-heading h3 { margin: 1px 0 0; font-size: 15px; }
.processing-pill { display: flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 11px; background: var(--cyan-soft); color: var(--cyan-dark); font-size: 8px; font-weight: 700; }
.processing-pill span { width: 6px; height: 6px; border: 1px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.processing-pill.done { background: #ebf7f1; color: var(--green); }
.processing-pill.done span { border: 0; animation: none; }
.processing-pill.done span::after { content: "✓"; }
@keyframes spin { to { transform: rotate(360deg); } }
.staff-flow { display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 20px; }
.staff-step { position: relative; padding: 0 8px; text-align: center; }
.staff-step:not(:last-child)::after { content: ""; position: absolute; top: 15px; left: calc(50% + 21px); right: calc(-50% + 21px); height: 1px; background: var(--line-dark); }
.staff-step.done:not(:last-child)::after { background: #9fdedb; }
.staff-step-icon { position: relative; z-index: 1; width: 31px; height: 31px; margin: 0 auto 7px; display: grid; place-items: center; border: 1px solid var(--line-dark); border-radius: 50%; background: #fff; color: var(--muted-2); font-size: 9px; }
.staff-step.running .staff-step-icon { border-color: var(--cyan); color: var(--cyan-dark); box-shadow: 0 0 0 4px var(--cyan-soft); }
.staff-step.done .staff-step-icon { border-color: var(--cyan); background: var(--cyan); color: #fff; }
.staff-step.failed .staff-step-icon { border-color: var(--red); color: var(--red); }
.staff-step strong { display: block; font-size: 8px; line-height: 1.35; }
.staff-step small { display: block; margin-top: 3px; color: var(--muted-2); font-size: 7px; line-height: 1.35; }

.result-section { margin-top: 24px; }
.result-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); overflow: hidden; }
.result-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.result-head-title { display: flex; align-items: center; gap: 12px; }
.result-symbol { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 9px; background: var(--cyan-soft); color: var(--cyan-dark); font-size: 15px; }
.result-head h3 { margin: 0; font-size: 14px; }
.result-head p { margin: 2px 0 0; color: var(--muted); font-size: 9px; }
.result-meta { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.result-meta span { padding: 4px 8px; border-radius: 10px; background: var(--surface-soft); color: var(--muted); font-size: 8px; }
.answer-body { padding: 25px 26px; color: #263548; font-size: 13px; line-height: 1.9; }
.visualization-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(520px, 100%), 1fr)); gap: 16px; padding: 0 24px 24px; }
.chart-card { min-width: 0; margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.chart-card figcaption { margin-bottom: 10px; color: var(--navy-900); font-size: 12px; font-weight: 700; }
.chart-card canvas { width: 100%; display: block; border-radius: 6px; background: #fff; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 7px 14px; margin-top: 10px; color: var(--muted); font-size: 9px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { width: 9px; height: 9px; border-radius: 50%; }
.answer-body h2, .answer-body h3, .answer-body h4 { color: var(--navy-900); line-height: 1.45; }
.answer-body h2 { margin: 24px 0 9px; font-size: 17px; }
.answer-body h3 { margin: 22px 0 8px; padding-left: 10px; border-left: 2px solid var(--cyan); font-size: 14px; }
.answer-body h4 { font-size: 13px; }
.answer-body p { margin: 0 0 13px; }
.answer-body ul, .answer-body ol { margin: 8px 0 15px; padding-left: 22px; }
.answer-body li + li { margin-top: 4px; }
.answer-body a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.answer-body blockquote { margin: 14px 0; padding: 8px 14px; border-left: 3px solid #b8d5e9; background: #f7fbfe; color: var(--muted); }
.answer-body blockquote > :last-child { margin-bottom: 0; }
.answer-body code { padding: 2px 4px; border-radius: 3px; background: var(--surface-soft); color: #365773; font-size: .9em; }
.answer-body pre { max-width: 100%; margin: 14px 0; padding: 14px 16px; overflow: auto; border-radius: 7px; background: #0c1c2d; color: #c8d8e6; }
.answer-body pre code { padding: 0; background: transparent; color: inherit; font: 11px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; }
.answer-body table { width: 100%; margin: 13px 0 18px; border-collapse: collapse; font-size: 12px; }
.answer-body th, .answer-body td { padding: 9px 11px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.answer-body th { background: var(--surface-soft); color: var(--navy-850); font-size: 10px; letter-spacing: .02em; }
.answer-body hr { margin: 22px 0; border: 0; border-top: 1px solid var(--line); }
.answer-body .katex { display: inline-flex; max-width: 100%; align-items: center; vertical-align: middle; }
.answer-body .katex-display { display: flex; max-width: 100%; justify-content: center; margin: 17px 0; overflow-x: auto; overflow-y: hidden; }
.answer-body math { font-size: 1.08em; }
.answer-body .math-fallback { color: var(--red); }
.result-warnings { padding: 0 22px 18px; }
.warning-item { margin-top: 7px; padding: 9px 11px; border-left: 2px solid var(--amber); background: var(--amber-soft); color: #815e27; font-size: 9px; }
.department-results { border-top: 1px solid var(--line); }
.department-result { border-bottom: 1px solid var(--line); }
.department-result:last-child { border-bottom: 0; }
.department-result > summary { display: grid; grid-template-columns: 29px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 14px 22px; cursor: pointer; list-style: none; }
.department-result > summary::-webkit-details-marker { display: none; }
.department-result-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 6px; background: var(--surface-blue); font-size: 8px; font-weight: 700; }
.department-result-title { display: flex; flex-direction: column; }
.department-result-title strong { font-size: 9px; }
.department-result-title small { color: var(--muted-2); font-size: 8px; }
.department-result-meta { color: var(--muted); font-size: 8px; }
.result-state { padding: 3px 7px; border-radius: 9px; background: #ebf7f1; color: var(--green); font-size: 8px; }
.result-state.failed { background: #fff0f0; color: var(--red); }
.payload-view { margin: 0; max-height: 430px; padding: 18px 22px; overflow: auto; border-top: 1px solid var(--line); background: #0c1c2d; color: #b8c9d8; font: 10px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-word; }
.error-card { padding: 24px; border: 1px solid #f0caca; border-radius: var(--radius); background: #fff7f7; color: #963f3f; }

.page-header-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 27px; }
.page-header-row .overline { margin: 0 0 4px; }
.page-header-row h2 { margin: 0; color: var(--navy-900); font-family: Georgia, "Yu Mincho", serif; font-size: 31px; font-weight: 500; }
.page-header-row p:not(.overline) { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.secondary-button { height: 37px; padding: 0 14px; color: var(--muted); font-size: 10px; }
.secondary-button:hover { border-color: #b8c7d4; color: var(--ink); }
.metrics-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 19px; }
.metric-card { padding: 18px 20px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow-sm); }
.metric-card span { display: block; color: var(--muted); font-size: 9px; }
.metric-card strong { margin-right: 6px; color: var(--navy-900); font: 500 28px Georgia, serif; }
.metric-card small { color: var(--muted-2); font-size: 8px; }
.table-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; box-shadow: var(--shadow-sm); }
.table-head, .audit-row { display: grid; grid-template-columns: 150px 1.1fr 1.5fr 100px 90px; gap: 14px; align-items: center; padding: 0 20px; }
.table-head { height: 43px; background: var(--surface-soft); color: var(--muted-2); font-size: 8px; font-weight: 700; letter-spacing: .06em; }
.audit-row { min-height: 56px; border-top: 1px solid var(--line); font-size: 9px; }
.audit-row time { color: var(--muted); }
.audit-event { font-weight: 600; }
.audit-departments { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-result { display: inline-flex; align-items: center; gap: 5px; color: var(--green); }
.audit-result::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.audit-result.failed { color: var(--red); }
.empty-state { padding: 48px 20px; color: var(--muted); text-align: center; }

.department-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.summary-item { display: flex; align-items: center; gap: 13px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.7); }
.summary-item span:first-child { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 7px; background: var(--surface-blue); color: var(--cyan-dark); }
.summary-item div { display: flex; flex-direction: column; }
.summary-item strong { font-size: 15px; line-height: 1.2; }
.summary-item small { color: var(--muted); font-size: 8px; }
.department-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.department-card { position: relative; min-height: 229px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); overflow: hidden; }
.department-card-head { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; }
.department-large-icon { width: 43px; height: 43px; display: grid; place-items: center; border: 1px solid #dce7ec; border-radius: 10px; background: var(--surface-blue); color: var(--navy-850); font-size: 11px; font-weight: 700; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 11px; background: #eaf7f1; color: var(--green); font-size: 8px; }
.status-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-badge.offline { background: #fff0f0; color: var(--red); }
.status-badge.unconfigured, .status-badge.degraded { background: var(--amber-soft); color: var(--amber); }
.department-card h3 { position: relative; z-index: 1; margin: 15px 0 5px; font-size: 13px; }
.department-card > p { position: relative; z-index: 1; min-height: 38px; margin: 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.department-card-meta { position: relative; z-index: 1; display: flex; gap: 12px; margin-top: 14px; color: var(--muted-2); font-size: 8px; }
.department-card-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.department-card-actions { position: relative; z-index: 1; display: flex; gap: 8px; margin-top: 17px; }
.department-card-actions button { height: 31px; padding: 0 11px; border: 1px solid var(--line-dark); border-radius: 6px; background: #fff; color: var(--muted); font-size: 9px; cursor: pointer; }
.department-card-actions button:first-child { border-color: var(--navy-850); background: var(--navy-850); color: #fff; }
.public-label { padding: 2px 6px; border-radius: 8px; background: var(--surface-soft); }
.public-label.allowed { background: #edf7fd; color: var(--blue); }

.overview-sections { display: flex; flex-direction: column; gap: 16px; }
.overview-section { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); overflow: hidden; }
.overview-section > h3 { margin: 0; padding: 17px 20px; border-bottom: 1px solid var(--line); font-size: 13px; }
.overview-definition-list { margin: 0; padding: 0 20px; }
.overview-definition-list > div { display: grid; grid-template-columns: 190px 1fr; gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.overview-definition-list > div:last-child { border-bottom: 0; }
.overview-definition-list dt { font-size: 10px; font-weight: 700; }
.overview-definition-list dd { margin: 0; color: var(--muted); font-size: 10px; }
.overview-table { display: grid; }
.overview-table > div { display: grid; grid-template-columns: 220px 1fr; gap: 20px; min-height: 45px; align-items: center; padding: 0 20px; border-bottom: 1px solid var(--line); }
.overview-table > div:last-child { border-bottom: 0; }
.overview-table-head { background: var(--surface-soft); color: var(--muted-2); font-size: 8px; font-weight: 700; }
.overview-table strong { font-size: 9px; }
.overview-table span { color: var(--muted); font-size: 9px; }
.overview-table-head span { color: var(--muted-2); }
.overview-mode-grid { display: grid; grid-template-columns: 1fr 1fr; }
.overview-mode-grid > div { padding: 18px 20px; }
.overview-mode-grid > div + div { border-left: 1px solid var(--line); }
.overview-mode-grid strong { font-size: 10px; }
.overview-mode-grid p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }

.settings-header { align-items: center; }
.save-actions { display: flex; align-items: center; gap: 12px; }
#save-state { color: var(--muted); font-size: 9px; }
.compact-button { height: 38px; }
.settings-shell { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 22px; }
.settings-nav { align-self: start; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.7); overflow: hidden; }
.settings-nav button { width: 100%; min-height: 62px; display: grid; grid-template-columns: 29px 1fr; gap: 10px; align-items: center; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.settings-nav button:last-child { border-bottom: 0; }
.settings-nav button:hover { background: rgba(255,255,255,.7); }
.settings-nav button.active { background: #fff; box-shadow: inset 2px 0 var(--cyan); }
.settings-nav button > span { color: var(--muted-2); font: 10px Georgia, serif; }
.settings-nav button.active > span { color: var(--cyan-dark); }
.settings-nav button div { display: flex; flex-direction: column; font-size: 10px; font-weight: 600; }
.settings-nav button small { color: var(--muted-2); font-size: 8px; font-weight: 400; }
.settings-content { min-width: 0; }
.settings-panel { display: none; }
.settings-panel.active { display: block; animation: pageIn .2s ease; }
.panel-title { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 15px; }
.panel-title > div { display: flex; align-items: center; gap: 10px; }
.panel-title h3 { margin: 0; font-size: 16px; }
.panel-title p { margin: 0; color: var(--muted); font-size: 9px; }
.settings-number { color: var(--cyan-dark); font: 12px Georgia, serif; }
.form-card, .prompt-editor-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.form-card { padding: 22px; }
.form-grid { display: grid; gap: 18px 20px; }
.form-grid.two { grid-template-columns: repeat(2, 1fr); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { color: #536176; font-size: 9px; font-weight: 600; }
.field input, .field select, .endpoint-input { width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--line-dark); border-radius: 6px; background: #fff; color: var(--ink); font-size: 10px; }
.field input:focus, .field select:focus, .endpoint-input:focus { border-color: var(--cyan); }
.info-banner { display: flex; gap: 12px; margin-top: 15px; padding: 13px 15px; border: 1px solid #cce9e7; border-radius: 9px; background: var(--cyan-soft); }
.info-banner > span { width: 20px; height: 20px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #9fd8d5; border-radius: 50%; color: var(--cyan-dark); font-size: 9px; }
.info-banner div { display: flex; flex-direction: column; }
.info-banner strong { font-size: 9px; }
.info-banner p { margin: 2px 0 0; color: var(--muted); font-size: 8px; }
.info-banner.subtle { border-color: var(--line); background: rgba(255,255,255,.5); }
.info-banner code { font-size: 8px; }
.orchestrator-link-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 15px; padding: 15px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.55); }
.orchestrator-link-card strong { display: block; margin-bottom: 3px; font-size: 10px; }
.orchestrator-link-card p { margin: 0; color: var(--muted); font-size: 8px; }
.orchestrator-link-card a { flex: 0 0 auto; text-decoration: none; white-space: nowrap; }

.model-settings-list { display: flex; flex-direction: column; gap: 10px; }
.model-row { border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow-sm); overflow: hidden; }
.model-row-head { min-height: 62px; display: grid; grid-template-columns: 35px minmax(150px, .8fr) 150px 95px 25px; gap: 12px; align-items: center; padding: 10px 15px; cursor: pointer; }
.model-role-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-blue); color: var(--cyan-dark); font-size: 9px; font-weight: 700; }
.model-role-name { display: flex; flex-direction: column; }
.model-role-name strong { font-size: 10px; }
.model-role-name small { color: var(--muted); font-size: 8px; }
.model-provider-label { color: var(--muted); font-size: 9px; }
.model-state { padding: 3px 7px; border-radius: 9px; background: var(--surface-soft); color: var(--muted); font-size: 8px; text-align: center; }
.model-state.enabled { background: var(--cyan-soft); color: var(--cyan-dark); }
.model-chevron { color: var(--muted-2); transition: transform .2s; }
.model-row.open .model-chevron { transform: rotate(180deg); }
.model-row-body { display: none; padding: 18px; border-top: 1px solid var(--line); background: #fbfcfd; }
.model-row.open .model-row-body { display: block; }
.model-enable-line { display: flex; align-items: center; gap: 9px; margin-bottom: 15px; color: var(--muted); font-size: 9px; }
.model-enable-line input { accent-color: var(--cyan-dark); }
.secret-note { display: flex; gap: 8px; margin-top: 13px; color: var(--muted); font-size: 8px; }
.secret-note > span { color: var(--cyan-dark); }
.secret-note p { margin: 0; }

.prompt-role-tabs { display: flex; gap: 6px; margin-bottom: 10px; overflow-x: auto; }
.prompt-role-tabs button { height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.6); color: var(--muted); font-size: 9px; white-space: nowrap; cursor: pointer; }
.prompt-role-tabs button.active { border-color: var(--navy-850); background: var(--navy-850); color: #fff; }
.prompt-editor-card { overflow: hidden; }
.prompt-editor-head, .prompt-editor-foot { display: flex; justify-content: space-between; align-items: center; padding: 14px 17px; }
.prompt-editor-head { border-bottom: 1px solid var(--line); }
.prompt-editor-head > div { display: flex; flex-direction: column; }
.prompt-editor-head strong { font-size: 11px; }
.prompt-editor-head span { color: var(--muted-2); font-size: 8px; }
#prompt-editor { width: 100%; min-height: 260px; display: block; padding: 20px; border: 0; outline: 0; resize: vertical; color: #263548; font: 11px/1.8 ui-monospace, SFMono-Regular, Menlo, monospace; }
.prompt-editor-foot { border-top: 1px solid var(--line); background: var(--surface-soft); color: var(--muted-2); font-size: 8px; }
.prompt-editor-foot b { font-weight: 500; }

.mcp-settings-list { display: flex; flex-direction: column; gap: 10px; }
.mcp-setting-row { display: grid; grid-template-columns: 38px minmax(130px, .7fr) minmax(220px, 1.4fr) 90px 85px; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow-sm); }
.mcp-setting-row > div:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }
.mcp-setting-row strong { font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcp-setting-row small { color: var(--muted-2); font-size: 8px; }
.mcp-setting-check { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 8px; white-space: nowrap; }
.mcp-setting-check input { accent-color: var(--cyan-dark); }
.toggle-list { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); overflow: hidden; }
.toggle-row { min-height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 30px; padding: 14px 19px; border-bottom: 1px solid var(--line); cursor: pointer; }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row > div { display: flex; flex-direction: column; }
.toggle-row strong { font-size: 10px; }
.toggle-row span { color: var(--muted); font-size: 8px; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-row i { position: relative; width: 35px; height: 20px; flex: 0 0 auto; border-radius: 10px; background: #cbd3dc; transition: .2s; }
.toggle-row i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .2s; }
.toggle-row input:checked + i { background: var(--cyan-dark); }
.toggle-row input:checked + i::after { transform: translateX(15px); }
.danger-toggle input:checked + i { background: var(--red); }
.boundary-diagram { display: grid; grid-template-columns: 1fr 80px 1fr; align-items: center; gap: 12px; margin-top: 15px; }
.boundary-zone { padding: 17px; border: 1px solid var(--line); border-radius: 9px; background: #fff; display: flex; flex-direction: column; }
.boundary-zone > span { margin-bottom: 5px; color: var(--cyan-dark); font-size: 8px; font-weight: 700; letter-spacing: .14em; }
.boundary-zone strong { font-size: 10px; }
.boundary-zone small { color: var(--muted); font-size: 8px; }
.public-zone { border-color: #d8e7f5; background: #f7fbff; }
.public-zone > span { color: var(--blue); }
.boundary-arrow { color: var(--muted); font-size: 15px; text-align: center; }
.boundary-arrow span { display: block; color: var(--muted-2); font-size: 8px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; background: rgba(5,18,32,.58); backdrop-filter: blur(5px); }
.modal { width: min(760px, 100%); max-height: min(760px, calc(100vh - 48px)); border-radius: 14px; background: #fff; box-shadow: 0 28px 80px rgba(0,0,0,.28); overflow: hidden; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 1px 0 0; font-size: 15px; }
.modal-body { max-height: 650px; padding: 20px; overflow: auto; }
.inspection-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 17px; }
.inspection-item { padding: 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); }
.inspection-item span { display: block; color: var(--muted-2); font-size: 8px; }
.inspection-item strong { font-size: 10px; }
.tool-list { display: flex; flex-direction: column; gap: 7px; }
.tool-item { padding: 11px 13px; border: 1px solid var(--line); border-radius: 7px; }
.tool-item strong { font: 10px ui-monospace, monospace; color: var(--navy-850); }
.tool-item p { margin: 3px 0 0; color: var(--muted); font-size: 8px; }
.modal-loading { padding: 60px; color: var(--muted); text-align: center; }
.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast { min-width: 260px; max-width: 420px; padding: 12px 14px; border-left: 3px solid var(--cyan); border-radius: 7px; background: var(--navy-850); color: #fff; box-shadow: var(--shadow-md); font-size: 10px; animation: toastIn .22s ease; }
.toast.error { border-left-color: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
.mobile-only { display: none; }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 75% 10%, #193b54 0, var(--navy-900) 42%, #071421 100%); }
.auth-shell[hidden] { display: none; }
.auth-card { width: min(440px, 100%); padding: 34px; border: 1px solid rgba(255,255,255,.12); border-radius: 18px; background: rgba(255,255,255,.98); box-shadow: 0 30px 80px rgba(0,0,0,.36); }
.auth-brand { display: grid; grid-template-columns: 42px 1fr; margin-bottom: 28px; align-items: center; }
.auth-logo { grid-row: 1 / 3; width: 38px; height: 38px; object-fit: contain; }
.auth-brand strong { font-size: 14px; letter-spacing: .08em; }
.auth-brand small { color: var(--muted); font-size: 8px; letter-spacing: .14em; }
.auth-tabs { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.auth-tabs button { padding: 10px 4px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font: inherit; font-size: 9px; cursor: pointer; }
.auth-tabs button.active { border-color: var(--cyan-dark); color: var(--navy-850); font-weight: 700; }
.auth-panel { display: none; gap: 14px; }
.auth-panel.active { display: grid; }
.auth-panel h1 { margin: 0; font-size: 21px; }
.auth-panel > p { margin: -5px 0 4px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.auth-panel label, .account-form label { display: grid; gap: 6px; color: var(--muted); font-size: 9px; }
.auth-panel input, .account-form input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--navy-850); font: inherit; }
.auth-panel input:focus, .account-form input:focus { outline: 2px solid rgba(19,153,180,.2); border-color: var(--cyan-dark); }
.auth-panel .primary-button { justify-content: center; margin-top: 4px; }
.auth-privacy { padding: 9px 11px; border-radius: 7px; background: var(--surface-soft); }
.auth-message { min-height: 18px; margin: 18px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.auth-message.error { color: var(--red); }
.auth-message.success { color: #14704a; }
.account-form { display: grid; gap: 13px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.account-form h4 { margin: 0; }
.account-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 20px; }
.danger-button { color: var(--red); border-color: #efc8c8; }

@media (max-width: 1120px) {
  .ask-layout { grid-template-columns: 1fr; }
  .ask-aside { display: block; }
  .department-grid { grid-template-columns: 1fr; }
  .mcp-setting-row { grid-template-columns: 38px minmax(130px,.7fr) minmax(180px,1.2fr); }
  .mcp-setting-row .mcp-setting-check { grid-column: auto; }
}

@media (max-width: 820px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s; }
  .sidebar.open { transform: translateX(0); box-shadow: 18px 0 50px rgba(0,0,0,.25); }
  .workspace { margin-left: 0; }
  .mobile-only { display: grid; }
  .topbar { height: 78px; padding: 0 18px; }
  .main-content { padding: 24px 18px 40px; }
  .owner-avatar { display: none; }
  .settings-shell { grid-template-columns: 1fr; }
  .settings-nav { display: flex; overflow-x: auto; }
  .settings-nav button { min-width: 150px; border-bottom: 0; border-right: 1px solid var(--line); }
  .form-grid.two { grid-template-columns: 1fr; }
  .model-row-head { grid-template-columns: 35px 1fr 25px; }
  .model-provider-label, .model-state { display: none; }
  .mcp-setting-row { grid-template-columns: 38px 1fr; }
  .mcp-setting-row .endpoint-input { grid-column: 1 / -1; }
  .table-head { display: none; }
  .audit-row { grid-template-columns: 1fr 1fr; padding: 13px; }
  .audit-departments { grid-column: 1 / -1; }
}

@media (max-width: 580px) {
  .topbar-actions { gap: 8px; }
  .mode-switch button { padding: 0 8px; font-size: 9px; }
  .topbar-title .eyebrow { display: none; }
  .topbar-title h1 { font-size: 17px; }
  .composer-card { padding: 18px; }
  .conversation-toolbar { align-items: flex-start; }
  .conversation-toolbar > span { max-width: 190px; }
  .user-message { width: 92%; }
  .composer-footer { align-items: stretch; flex-direction: column; }
  .composer-tools { justify-content: space-between; }
  .privacy-note { display: none; }
  .primary-button { width: 100%; }
  .staff-flow { grid-template-columns: 1fr; gap: 9px; }
  .staff-step { display: grid; grid-template-columns: 31px 1fr; gap: 10px; padding: 0; text-align: left; }
  .staff-step:not(:last-child)::after { top: 30px; left: 15px; right: auto; width: 1px; height: 19px; }
  .staff-step-icon { grid-row: 1 / 3; margin: 0; }
  .ask-aside { grid-template-columns: 1fr; }
  .metrics-row, .department-summary { grid-template-columns: 1fr; }
  .page-header-row { align-items: flex-start; flex-direction: column; }
  .settings-header { align-items: stretch; }
  .save-actions { justify-content: flex-end; }
  .panel-title { align-items: flex-start; flex-direction: column; gap: 3px; }
  .boundary-diagram { grid-template-columns: 1fr; }
  .boundary-arrow { transform: rotate(90deg); }
  .inspection-grid { grid-template-columns: 1fr; }
  .overview-definition-list > div, .overview-table > div { grid-template-columns: 1fr; gap: 4px; padding-top: 13px; padding-bottom: 13px; }
  .overview-table-head { display: none !important; }
  .overview-mode-grid { grid-template-columns: 1fr; }
  .overview-mode-grid > div + div { border-left: 0; border-top: 1px solid var(--line); }
}

/* Actual execution progress; temporary and removed at completion. */
.live-progress-flow { display: grid; grid-template-columns: 1fr; gap: 12px; max-height: 420px; overflow: auto; }
.live-progress-step { min-width: 0; padding: 12px; border: 1px solid #dce3ed; border-radius: 8px; }
.live-progress-step strong, .live-progress-step small, .live-progress-context { display: block; overflow-wrap: anywhere; }
.live-progress-context { margin-top: 3px; color: var(--muted); font-size: 12px; }
.live-progress-details { margin: 10px 0 0; }
.live-progress-details > div { padding: 7px 0; border-top: 1px solid #edf1f6; }
.live-progress-details dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.live-progress-details dd { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.live-progress-more { margin-top: 8px; }
.live-progress-more > summary { color: var(--accent); cursor: pointer; font-size: 13px; font-weight: 700; }
.processing-history { margin-top: 4px; }
.processing-history > summary { color: var(--accent); cursor: pointer; font-size: 13px; font-weight: 700; }
.processing-history-list { display: grid; gap: 10px; margin-top: 10px; }
.processing-history-step { min-width: 0; padding: 11px; border: 1px solid #e3e8ef; border-radius: 8px; background: #fbfcfe; }
.processing-history-step strong, .processing-history-step small { display: block; overflow-wrap: anywhere; }
.assistant-message > .processing-history { margin-top: 14px; }

/* JSON attachment drag and drop */
.composer-card.file-drag-over { border-color: #00857f; box-shadow: 0 0 0 3px rgba(0,133,127,.25); background: #eefaf8; }
.question-drop-hint { margin: 8px 0 0; font-size: 13px; color: var(--ink); }
.question-drop-hint:empty { display: none; }
