:root {
  --navy: #183247;
  --navy-deep: #112637;
  --copper: #9d5c39;
  --copper-light: #faf0e9;
  --ink: #243a49;
  --muted: #657583;
  --line: #dce3e8;
  --bg: #f5f7f9;
  --paper: #fff;
  --blue: #275b7b;
  --green: #256b50;
  --green-light: #eaf5ee;
  --red: #9d3030;
  --red-light: #fff0f0;
  --radius: 13px;
  font: 15px/1.55 Arial, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--blue); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .58; }
input:disabled, textarea:disabled, select:disabled { background: #edf1f4; color: var(--muted); }
:focus-visible { outline: 3px solid #b4774e; outline-offset: 3px; }
h1,h2,h3,h4,p { margin: 0; }
h1 { font-size: clamp(1.8rem, 3vw, 2.25rem); color: var(--navy); line-height: 1.2; font-weight: 650; letter-spacing: -.6px; }
h2 { font-size: 1.3rem; color: var(--navy); line-height: 1.3; }
h3 { font-size: 1.04rem; color: var(--navy); }
p + p { margin-top: 12px; }
small, .small { font-size: .83rem; }
code,pre { font-family: Consolas, "Courier New", monospace; font-size: .85rem; }
code { overflow-wrap: anywhere; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; padding: 16px; margin: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); line-height: 1.6; }
hr { height: 1px; border: 0; background: var(--line); margin: 22px 0; }
[hidden] { display: none !important; }
.skip-link { position: fixed; left: 12px; top: -100px; z-index: 100; padding: 10px 15px; background: var(--paper); border: 1px solid var(--navy); border-radius: 7px; }
.skip-link:focus { top: 12px; }
.initial-state { max-width: 650px; margin: 15vh auto; padding: 30px; }
.brand-mark { font-size: 1.05rem; font-weight: 750; letter-spacing: 1px; color: var(--navy); white-space: nowrap; }
.brand-mark span { color: var(--copper); padding: 0 4px; }
.eyebrow { font-size: .7rem; letter-spacing: 1.5px; font-weight: 700; text-transform: uppercase; color: var(--copper); }
.muted { color: var(--muted); }
.mt-8 { margin-top: 8px; }
.mt-15 { margin-top: 15px; }
.mt-18 { margin-top: 18px; }
.mt-20 { margin-top: 20px; }
.mt-25 { margin-top: 25px; }
.password-description { margin: 8px 0 20px; }
.bot-card .bot-mode { margin-top: 9px; margin-bottom: 0; }
.lede { color: var(--muted); max-width: 740px; margin-top: 10px; }
.loading { color: var(--muted); padding: 24px 0; }
.loading::before { content: ""; width: 14px; height: 14px; margin-right: 9px; border: 2px solid var(--line); border-top-color: var(--copper); border-radius: 50%; display: inline-block; vertical-align: -2px; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.button { border: 1px solid var(--navy); border-radius: 7px; color: white; background: var(--navy); padding: 10px 17px; font-weight: 600; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; transition: background .12s; }
.button:hover:not(:disabled) { background: #264b63; }
.button.secondary { color: var(--navy); border-color: var(--line); background: white; }
.button.secondary:hover:not(:disabled) { background: var(--bg); border-color: #a8b6c1; }
.button.danger { color: var(--red); background: white; border-color: #e4c3c3; }
.button.danger:hover:not(:disabled) { background: var(--red-light); }
.button.compact { font-size: .84rem; padding: 6px 11px; min-height: 34px; }
.text-button { border: 0; color: var(--blue); background: none; padding: 5px 0; text-decoration: underline; text-underline-offset: 3px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions.end { justify-content: flex-end; }
.stack { display: grid; gap: 18px; }
.stack.tight { gap: 10px; }
.two-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field-label { font-size: .87rem; font-weight: 600; color: var(--navy); }
.field-hint { color: var(--muted); font-size: .8rem; line-height: 1.45; }
input:not([type="checkbox"]), textarea, select { width: 100%; border: 1px solid #bdcbd5; border-radius: 7px; min-height: 43px; padding: 10px 12px; background: white; color: var(--ink); }
textarea { min-height: 112px; resize: vertical; }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--navy); margin: 0; flex: 0 0 auto; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; }
.check input { margin-top: 3px; }
fieldset { border: 1px solid var(--line); border-radius: 9px; padding: 14px 16px; margin: 0; min-width: 0; }
legend { font-size: .86rem; color: var(--navy); padding: 0 6px; font-weight: 600; }
.checks { display: grid; gap: 11px; }
.form-error { color: var(--red); background: var(--red-light); border: 1px solid #eccaca; border-radius: 8px; padding: 10px 13px; font-size: .9rem; }
.note { padding: 14px 16px; border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 8px; color: var(--muted); background: #f5f9fb; font-size: .88rem; }
.note.warning { background: #fcf6ed; border-color: #efdfc7; border-left-color: #aa7532; color: #795222; }
.note.success { background: var(--green-light); border-color: #c5e3d0; border-left-color: var(--green); color: var(--green); }
.note.error { background: var(--red-light); border-color: #edc9c9; border-left-color: var(--red); color: var(--red); }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 38px 25px; }
.auth-wrap { width: min(990px,100%); }
.auth-mast { display: flex; justify-content: space-between; align-items: center; padding: 0 2px 25px; gap: 16px; }
.auth-mast small { color: var(--muted); }
.auth-frame { display: grid; grid-template-columns: 1fr 1.12fr; background: var(--paper); border-radius: 17px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 12px 35px #16344e0a; }
.auth-context { padding: 45px 38px; background: var(--navy); color: #d3e0e9; position: relative; overflow: hidden; }
.auth-context::after { content: ""; width: 190px; height: 190px; border: 1px solid #ffffff16; border-radius: 50%; position: absolute; right: -90px; bottom: -80px; box-shadow: 0 0 0 40px #ffffff05,0 0 0 80px #ffffff03; }
.auth-context .eyebrow { color: #dbaa83; }
.auth-context h1 { color: white; font-size: 2.4rem; margin: 16px 0 20px; max-width: 10ch; }
.auth-context p { font-size: .92rem; }
.auth-route { display: grid; gap: 15px; margin: 30px 0; }
.auth-route div { border-top: 1px solid #ffffff22; padding-top: 13px; display: flex; align-items: baseline; gap: 16px; }
.auth-route span { font: .75rem Consolas,monospace; color: #dbaa83; }
.auth-route strong { color: #e4edf3; font-weight: 500; font-size: .9rem; }
.auth-form { padding: 43px 39px; }
.auth-form h2 { font-size: 1.5rem; margin-bottom: 8px; }
.auth-form form { margin-top: 25px; }
.auth-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 21px; font-size: .86rem; }
.workspace { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0,1fr); }
.sidebar { background: var(--paper); border-right: 1px solid var(--line); padding: 29px 20px 22px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand-mark { padding: 0 12px; font-size: 1rem; }
.sidebar-caption { padding: 6px 12px 25px; font-size: .75rem; color: var(--muted); }
.nav { display: grid; gap: 5px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: .9rem; }
.nav a:hover { background: var(--bg); color: var(--navy); }
.nav a[aria-current="page"] { background: #eef3f6; color: var(--navy); font-weight: 600; box-shadow: inset 3px 0 var(--copper); }
.nav-mark { width: 24px; height: 24px; border: 1px solid currentColor; border-radius: 6px; display: inline-grid; place-items: center; font: .72rem Consolas,monospace; opacity: .8; }
.nav-separator { height: 1px; background: var(--line); margin: 15px 10px; }
.sidebar-bottom { margin-top: auto; padding: 24px 12px 0; }
.sidebar-bottom p { font-size: .73rem; color: var(--muted); }
.sidebar-bottom .eyebrow { margin-bottom: 8px; }
.main-column { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); background: #ffffffbb; padding: 17px 36px; min-height: 76px; }
.topbar-title { color: var(--muted); font-size: .8rem; }
.identity { display: flex; align-items: center; gap: 11px; }
.avatar { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 50%; color: var(--copper); background: var(--copper-light); font-size: .8rem; font-weight: 700; flex: 0 0 auto; }
.identity strong { display: block; font-size: .85rem; font-weight: 600; }
.identity small { display: block; font-size: .73rem; color: var(--muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.mobile-menu { display: none; }
.content { max-width: 1300px; margin: 0 auto; padding: 35px 36px 55px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 27px; }
.page-heading .eyebrow { margin-bottom: 8px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; min-width: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.card-head h2,.card-head h3 { margin-bottom: 5px; }
.card .note { margin-top: 16px; }
.service-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 19px; }
.service-card { padding: 24px; position: relative; }
.service-symbol { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; background: #eef3f6; color: var(--blue); font: 700 .94rem Consolas,monospace; margin-bottom: 19px; }
.service-card p { color: var(--muted); font-size: .88rem; margin-top: 9px; min-height: 42px; }
.service-card .actions { margin-top: 18px; }
.badge { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); border-radius: 99px; padding: 3px 10px; font-size: .74rem; white-space: nowrap; }
.badge.good { background: var(--green-light); border-color: #cce5d4; color: var(--green); }
.badge.warn { background: #fbf4e8; border-color: #efdfc2; color: #8d6027; }
.badge.error { background: var(--red-light); border-color: #eccbcb; color: var(--red); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin-bottom: 23px; }
.metric { border: 1px solid var(--line); background: white; border-radius: 10px; padding: 17px 20px; }
.metric strong { display: block; font-size: 1.6rem; line-height: 1.2; color: var(--navy); margin-top: 6px; }
.metric span { color: var(--muted); font-size: .79rem; }
.empty { border: 1px dashed #cbd6de; border-radius: 10px; padding: 27px 23px; text-align: center; color: var(--muted); background: #fbfcfd; }
.empty h3 { margin-bottom: 7px; }
.empty p { font-size: .88rem; max-width: 560px; margin: 0 auto; }
.empty .actions { justify-content: center; margin-top: 15px; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .84rem; }
th { text-align: left; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { vertical-align: top; padding: 15px 12px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
td strong,td small { display: block; }
td small { color: var(--muted); margin-top: 3px; }
.bot-layout { display: grid; grid-template-columns: 275px minmax(0,1fr); gap: 20px; align-items: start; }
.bot-list { display: grid; gap: 10px; }
.bot-card { text-align: left; display: block; width: 100%; border: 1px solid var(--line); background: white; border-radius: 10px; padding: 17px; color: var(--ink); }
.bot-card:hover { border-color: #a7b9c6; }
.bot-card.selected { border-color: var(--copper); box-shadow: inset 3px 0 var(--copper); background: #fdfaf8; }
.bot-card strong { display: block; color: var(--navy); margin-bottom: 3px; }
.bot-card small { display: block; color: var(--muted); margin-bottom: 10px; }
.bot-panel { min-width: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 3px; margin: 0 0 22px; border-bottom: 1px solid var(--line); }
.tabs button { padding: 11px 14px; background: none; color: var(--muted); border: 0; border-bottom: 2px solid transparent; font-size: .85rem; }
.tabs button[aria-selected="true"] { color: var(--navy); border-bottom-color: var(--copper); font-weight: 600; }
.chat-workspace { display: grid; grid-template-columns: minmax(180px,.8fr) minmax(0,2fr); gap: 20px; }
.chat-list { max-height: 540px; overflow-y: auto; display: grid; align-content: start; gap: 5px; }
.chat-item { text-align: left; padding: 12px 13px; border: 1px solid transparent; border-radius: 8px; background: var(--bg); color: var(--ink); overflow-wrap: anywhere; }
.chat-item.selected { border-color: #a6bac9; background: #eef4f8; }
.chat-item small { display: block; color: var(--muted); }
.message-list { display: grid; gap: 11px; max-height: 420px; overflow-y: auto; padding-right: 5px; }
.message { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: #fcfdfe; }
.message p { font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 7px; font-size: .76rem; color: var(--muted); }
.compose { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 20px; }
.draft-preview { background: #faf6f1; border: 1px solid #e8d6c7; border-radius: 10px; padding: 18px; }
.draft-preview p { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 9px; }
.knowledge-item,.job { padding: 17px 0; border-bottom: 1px solid var(--line); }
.knowledge-item:last-child,.job:last-child { border-bottom: 0; }
.knowledge-item p { margin-top: 7px; color: var(--muted); font-size: .87rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.guide-list { display: grid; gap: 13px; }
details.guide { border: 1px solid var(--line); background: white; border-radius: 11px; padding: 0 22px; }
details.guide summary { cursor: pointer; padding: 20px 0; font-weight: 600; color: var(--navy); }
details.guide[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.guide-body { display: grid; gap: 20px; padding-bottom: 24px; }
.guide-body p { margin-top: 7px; white-space: pre-line; color: var(--muted); font-size: .89rem; overflow-wrap: anywhere; }
.endpoint-url { display: flex; gap: 10px; align-items: center; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); margin: 15px 0; }
.endpoint-url code { flex: 1; }
.dialog { width: min(660px,calc(100vw - 30px)); border: 1px solid var(--line); border-radius: 15px; padding: 0; box-shadow: 0 20px 70px #0f253f35; max-height: calc(100dvh - 42px); overflow-y: auto; }
.dialog::backdrop { background: #11263780; backdrop-filter: blur(2px); }
.dialog-head { padding: 20px 24px; display: flex; justify-content: space-between; gap: 20px; align-items: center; border-bottom: 1px solid var(--line); }
.dialog-close { border: 0; background: var(--bg); border-radius: 6px; width: 31px; height: 31px; color: var(--muted); font-size: 1.2rem; }
.dialog-body { padding: 24px; }
.dialog .actions { margin-top: 20px; }
.qr-wrap { display: grid; justify-items: center; gap: 15px; text-align: center; }
.qr-wrap img { width: min(245px,100%); aspect-ratio: 1; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; background: white; padding: 9px; }
.notifications { position: fixed; right: 24px; bottom: 22px; z-index: 100; display: grid; gap: 10px; width: min(430px,calc(100vw - 36px)); }
.toast { padding: 13px 17px; border: 1px solid #c9d9d1; border-left: 4px solid var(--green); background: white; border-radius: 8px; box-shadow: 0 6px 20px #11263715; font-size: .87rem; color: var(--ink); }
.toast.error { border-color: #e3cccc; border-left-color: var(--red); }
@media(max-width:1050px) {
  .workspace { grid-template-columns: 215px minmax(0,1fr); }
  .sidebar { padding-left: 13px; padding-right: 13px; }
  .topbar { padding: 16px 26px; }
  .content { padding: 29px 26px 45px; }
  .bot-layout { grid-template-columns: 225px minmax(0,1fr); }
  .two-columns { grid-template-columns: 1fr; }
}
@media(max-width:780px) {
  .workspace { display: block; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: -260px; width: 244px; z-index: 30; transition: left .16s; box-shadow: 15px 0 40px #11263725; }
  .workspace.menu-open .sidebar { left: 0; }
  .mobile-menu { display: inline-flex; }
  .topbar { padding: 12px 18px; gap: 10px; }
  .topbar-title { display: none; }
  .identity small { max-width: 140px; }
  .identity .avatar { display: none; }
  .content { padding: 25px 18px 45px; }
  .page-heading { gap: 15px; }
  .page-heading .actions { justify-content: flex-end; }
  .bot-layout { grid-template-columns: 1fr; }
  .bot-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .chat-workspace { grid-template-columns: 1fr; }
  .chat-list { max-height: 180px; }
  .auth-page { padding: 20px 16px; }
  .auth-frame { grid-template-columns: 1fr; }
  .auth-context { padding: 27px; }
  .auth-context h1 { max-width: none; font-size: 1.9rem; margin: 12px 0; }
  .auth-route { display: none; }
  .auth-form { padding: 28px; }
  .auth-mast { padding-bottom: 17px; }
}
@media(max-width:520px) {
  .service-grid,.metrics,.bot-list { grid-template-columns: 1fr; }
  .metrics { gap: 9px; }
  .metric { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; }
  .metric strong { margin: 0; font-size: 1.3rem; }
  .card,.service-card { padding: 19px; }
  .page-heading { flex-direction: column; }
  .page-heading .actions { justify-content: flex-start; }
  .auth-mast small { display: none; }
  .dialog-body,.dialog-head { padding: 20px; }
  .endpoint-url { align-items: flex-start; }
  .identity strong { max-width: 145px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
