:root {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #152335;
  background: #f3f6fa;
  font-synthesis: none;
  --ink: #152335;
  --muted: #56677d;
  --subtle: #687b91;
  --line: #e2e9f1;
  --white: #fff;
  --green: #08674e;
  --green-bg: #e3f7ee;
  --blue: #285fbd;
  --blue-bg: #edf3ff;
  --orange: #805200;
  --orange-bg: #fff3d7;
  --red: #a4293e;
  --red-bg: #fcebef;
  --sidebar: #111f31;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
[hidden] { display: none !important; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, a, input, select, canvas { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #4a84dc; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(28px, 3.2vw, 37px); line-height: 1.17; letter-spacing: -.047em; font-weight: 770; }
h2 { font-size: 18px; line-height: 1.25; letter-spacing: -.026em; font-weight: 740; }
h3 { font-size: 15px; line-height: 1.35; }
p, .muted { color: var(--muted); }
.icon { display: inline-block; width: 19px; height: 19px; flex: 0 0 auto; vertical-align: middle; }
.brand:hover, .button:hover, .nav-link:hover, .plain-link:hover { text-decoration: none; }
.mono { font: 12px ui-monospace, "SFMono-Regular", Consolas, monospace; font-variant-numeric: tabular-nums; }

.boot { position: fixed; inset: 0; display: grid; place-content: center; color: var(--muted); font-size: 15px; }
.shell { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; min-height: 520px; background: var(--sidebar); color: #eef7ff;
  display: flex; flex-direction: column; padding: 27px 17px 18px; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; color: #f8fbff; }
.brand img { flex: 0 0 auto; }
.brand strong { display: block; font-size: 17px; letter-spacing: -.035em; }
.brand small { display: block; margin-top: 3px; color: #a9bdd1; font-size: 12px; }
.nav-caption { color: #93aac0; margin: 44px 10px 10px; font-weight: 650; font-size: 10px; letter-spacing: .12em; }
#nav { display: grid; gap: 4px; }
.nav-link {
  position: relative; color: #b9cbdc; border: 1px solid transparent; border-radius: 10px; min-height: 45px;
  display: flex; align-items: center; gap: 12px; padding: 0 12px; font-size: 13px; font-weight: 620;
}
.nav-link:hover { background: #1a2c42; color: #eef7ff; }
.nav-link[aria-current] { background: #22384b; border-color: #2e4b5e; color: #f5fbff; }
.nav-link[aria-current] .icon { color: #65e5ba; }
.nav-link[aria-current]::after { content: ""; width: 5px; height: 5px; background: #68e5b8; border-radius: 50%; margin-left: auto; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 9px; }
.sidebar-status { display: flex; align-items: flex-start; gap: 11px; border: 1px solid #2a4055; background: #17293b; padding: 12px; border-radius: 10px; }
.sidebar-status strong, .sidebar-status small { display: block; }
.sidebar-status strong { font-size: 12px; }
.sidebar-status small { margin-top: 4px; color: #a9bdd1; font-size: 11px; }
.status-dot { background: #879aab; width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; display: inline-block; }
.sidebar-status .status-dot { margin-top: 4px; }
.status-dot.good { background: #5ee0ad; box-shadow: 0 0 0 3px #2c5c55; }
.status-dot.warn { background: #f5be61; box-shadow: 0 0 0 3px #5e4c34; }
.side-button { background: none; border: 0; color: #b9cbdc; border-radius: 8px; text-align: left; padding: 10px; display: flex; gap: 10px; align-items: center; font-size: 12px; }
.side-button:hover { background: #1a2c42; color: #fff; }
.side-button .icon { width: 16px; height: 16px; }
.workspace { min-width: 0; }
.top { min-height: 66px; background: var(--white); border-bottom: 1px solid var(--line); padding: 10px clamp(16px, 3vw, 36px); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.crumb, .top-controls, .chat-control { display: flex; gap: 10px; align-items: center; min-width: 0; }
.crumb { color: var(--muted); font-size: 13px; white-space: nowrap; }
.crumb strong { color: var(--ink); font-weight: 700; }
.crumb-separator { color: #8999aa; }
.chat-control label { color: var(--muted); font-size: 12px; }
.chat-control select { max-width: 230px; min-height: 38px; padding: 0 28px 0 11px; background: #f7f9fc; }
.mobile-menu, .veil { display: none !important; }
.main { max-width: 1520px; margin: 0 auto; padding: 27px clamp(16px, 3vw, 36px) 23px; min-height: calc(100dvh - 121px); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 21px; }
.page-head p { font-size: 13px; line-height: 1.5; margin-top: 7px; }
.foot { margin: 0 clamp(16px, 3vw, 36px); padding: 14px 0 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; font-size: 11px; color: var(--subtle); }

.button {
  border: 1px solid transparent; background: transparent; color: inherit; border-radius: 9px; min-height: 38px;
  padding: 8px 12px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  text-align: center; line-height: 1.3; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.button .icon { height: 16px; width: 16px; }
.button.primary { color: white; background: #116b54; border-color: #116b54; }
.button.primary:hover { background: #0b5542; border-color: #0b5542; }
.button.secondary { background: var(--white); border-color: #d8e2ed; }
.button.secondary:hover { background: #edf4fb; border-color: #afbdd1; }
.button.danger { color: var(--red); background: var(--red-bg); border-color: #f6cbd3; }
.button.danger:hover { background: #fbdae2; }
.button.icon-button { width: 38px; padding: 0; }
.button.working .icon { animation: spin 1.1s linear infinite; }
.button:disabled { opacity: .62; cursor: not-allowed; }
@keyframes spin { to { transform: rotate(360deg); } }
.plain-link { display: inline-flex; gap: 5px; color: var(--blue); align-items: center; font-size: 12px; font-weight: 700; padding: 0; background: none; border: 0; text-align: left; }
.plain-link:hover { color: #15458e; }
.plain-link .icon { width: 14px; height: 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; border-radius: 999px; padding: 4px 9px; font-size: 11px; line-height: 1.3; font-weight: 700; background: #ecf1f7; color: #485c73; vertical-align: middle; white-space: nowrap; }
.pill .status-dot { width: 6px; height: 6px; background: currentColor; box-shadow: none; }
.pill.green { color: var(--green); background: var(--green-bg); }
.pill.blue { color: var(--blue); background: var(--blue-bg); }
.pill.gold { color: var(--orange); background: var(--orange-bg); }
.pill.red { color: var(--red); background: var(--red-bg); }
.pill.demo { background: #eafbfa; color: #12635c; border: 1px solid #c5eae5; }

.segmented { display: inline-flex; align-items: center; gap: 3px; border: 1px solid #dce5f0; background: #eaf0f7; padding: 3px; border-radius: 10px; }
.segmented button { cursor: pointer; color: #52677f; background: none; border: 0; border-radius: 7px; padding: 7px 10px; font-size: 11px; font-weight: 720; white-space: nowrap; }
.segmented button:hover { color: #10263a; }
.segmented button[aria-pressed="true"] { background: white; box-shadow: 0 1px 3px #18294416; color: #20334e; }

.hero {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; isolation: isolate;
  color: #f5fbff; gap: 18px; position: relative; overflow: hidden; border-radius: 15px; padding: 21px 24px;
  background: radial-gradient(ellipse at 89% 101%, #235f60, transparent 53%), linear-gradient(104deg, #142941, #1b3e4c);
  border: 1px solid #25485a; margin-bottom: 17px;
}
.hero::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none; width: 530px; height: 280px;
  right: -90px; top: -84px; opacity: .36;
  background: repeating-radial-gradient(circle at 53% 52%, #77b5b559 0 1px, transparent 1px 22px);
  mask-image: linear-gradient(90deg, transparent, #000 40%);
}
.hero-main { display: flex; gap: 14px; align-items: center; }
.hero-symbol { background: #64d6b222; border: 1px solid #78d7b63c; color: #89edcf; display: grid; place-items: center; border-radius: 13px; width: 52px; height: 52px; flex: 0 0 auto; }
.hero-symbol .icon { width: 24px; height: 24px; }
.hero-label { display: block; margin-bottom: 5px; font-weight: 720; font-size: 10px; letter-spacing: .13em; color: #b4cadd; }
.hero h2 { margin: 0 0 5px; font-size: 22px; max-width: 430px; overflow-wrap: anywhere; }
.hero .mono { color: #b8d1dc; }
.hero-side { display: flex; align-items: center; flex-wrap: wrap; gap: 17px; }
.hero-policy { display: grid; gap: 6px; }
.hero-policy .pill { justify-self: start; }
.hero-policy small { color: #d2e1ec; font-size: 12px; }
.hero .button { color: #f1fbff; background: #c8e5ed16; border-color: #a2c2cf55; }
.hero .button:hover { border-color: #b0ded0; background: #aedbcc2c; }

.card { background: var(--white); border: 1px solid var(--line); border-radius: 13px; min-width: 0; box-shadow: 0 2px 3px #17304704; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { padding: 13px 15px; min-height: 100px; display: grid; text-align: left; color: var(--ink); cursor: default; }
button.stat { cursor: pointer; }
button.stat:hover { border-color: #aabcce; }
.stat-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: #4e647b; font-size: 12px; font-weight: 680; }
.stat-top span:first-child { overflow-wrap: anywhere; }
.stat-icon { flex: 0 0 auto; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; }
.stat-icon .icon { height: 17px; width: 17px; }
.stat-icon.blue { color: var(--blue); background: var(--blue-bg); }
.stat-icon.green { color: var(--green); background: var(--green-bg); }
.stat-icon.gold { color: var(--orange); background: var(--orange-bg); }
.stat-icon.red { color: var(--red); background: var(--red-bg); }
.stat-value { font-size: 29px; line-height: 1.13; font-weight: 750; letter-spacing: -.045em; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(252px, 1fr); gap: 15px; margin-bottom: 16px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 11px; padding: 16px 17px 0; }
.card-head p { font-size: 12px; margin-top: 4px; line-height: 1.45; }
.chart-card { overflow: hidden; }
.chart-wrap { margin: 0 12px 6px 10px; position: relative; }
.chart-wrap canvas { width: 100%; height: 192px; display: block; }
.chart-tip { z-index: 2; position: absolute; min-width: 110px; pointer-events: none; border: 1px solid #32495e; background: #182d42; color: #f3f9ff; padding: 8px 11px; border-radius: 8px; font-size: 11px; line-height: 1.55; box-shadow: 0 5px 11px #182d4230; }
.chart-tip strong { display: block; margin-bottom: 2px; }
.chart-tip span { display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 11px; padding: 7px 17px 0; }
.legend button { border: 0; background: none; color: #3d5068; display: inline-flex; align-items: center; gap: 6px; padding: 3px 0; font-size: 10px; font-weight: 650; }
.legend button[aria-pressed="false"] { color: #6f8091; opacity: .72; text-decoration: line-through; }
.series-dot { width: 8px; height: 8px; border-radius: 50%; background: #3473d2; }
.series-dot.deleted { background: #15946e; }
.series-dot.observed { background: #b37004; }
.series-dot.failed { background: #c03956; }
.health-list { margin: 10px 17px 0; padding: 0; }
.health-list > div { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #edf1f6; min-height: 41px; gap: 9px; font-size: 12px; }
.health-list dt { color: var(--muted); }
.health-list dd { margin: 0; font-weight: 690; text-align: right; }
.health-detail { padding: 12px 17px 16px; display: flex; justify-content: space-between; gap: 7px; align-items: center; }
.health-detail .button { font-size: 11px; }
.health-detail small { color: var(--subtle); font-size: 10px; }

.table-card .card-head { padding-bottom: 13px; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: 12px; }
th { background: #f7f9fc; color: #576e84; font-weight: 690; font-size: 11px; text-align: left; white-space: nowrap; }
th, td { padding: 10px 16px; border-top: 1px solid #edf1f6; vertical-align: middle; }
td:nth-child(2) { line-height: 1.42; }
td .pill { margin-right: 3px; }
td .mono { white-space: nowrap; }
tbody tr:hover { background: #f8fbfe; }
.event-date { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
.event-description { min-width: 180px; overflow-wrap: anywhere; }
.event-source { white-space: nowrap; color: var(--muted); }
.empty { padding: 27px 18px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.6; }
.empty-card { min-height: 225px; display: grid; place-items: center; padding: 25px; }
.empty-card > div { max-width: 430px; text-align: center; }
.empty-card .stat-icon { margin: 0 auto 12px; }
.empty-card p { margin-top: 9px; font-size: 13px; line-height: 1.55; }
.empty-card .button { margin-top: 13px; }
.panel-body { padding: 16px 17px; }
.panel-body p { font-size: 13px; line-height: 1.55; }
.panel-body > p + p { margin-top: 7px; }
.banner { margin: 0 0 13px; padding: 11px 14px; color: #805200; background: var(--orange-bg); border: 1px solid #f8e2aa; border-radius: 9px; font-size: 12px; line-height: 1.5; }

.settings-grid { display: grid; grid-template-columns: minmax(225px, .75fr) minmax(0, 1.65fr); gap: 16px; align-items: start; }
.chat-list { display: grid; gap: 6px; padding: 14px 12px 12px; max-height: 60vh; overflow: auto; }
.chat-item { display: flex; text-align: left; align-items: center; min-width: 0; gap: 9px; padding: 10px; background: none; border-radius: 9px; border: 1px solid transparent; color: var(--ink); }
.chat-item:hover { background: #f4f8fd; }
.chat-item[aria-pressed="true"] { background: #e9f3f6; border-color: #d5e8ee; }
.chat-item .icon { color: #3e7789; }
.chat-item span { min-width: 0; overflow-wrap: anywhere; }
.chat-item strong, .chat-item small { display: block; }
.chat-item strong { font-size: 13px; }
.chat-item small { font-size: 11px; color: var(--muted); margin-top: 4px; }
.fields { display: grid; gap: 14px; }
label, legend { font-weight: 680; font-size: 12px; color: #32475e; }
input, select { border: 1px solid #d6e1ed; width: 100%; min-width: 0; border-radius: 8px; color: var(--ink); background: #fff; min-height: 40px; padding: 8px 10px; font-size: 13px; }
input::placeholder { color: #64768c; }
input:focus, select:focus { border-color: #7aabc7; }
.field { display: grid; gap: 6px; }
.field small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.paired { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 7px; }
.mode-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.mode-choice { display: grid; gap: 4px; padding: 10px; background: #fafcfe; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.mode-choice:has(:checked) { border-color: #81b9a9; background: #e9f7ef; }
.mode-choice span:first-of-type { color: var(--ink); }
.mode-choice small { font-size: 10px; line-height: 1.45; color: var(--muted); font-weight: 520; }
.mode-choice input, .switch input { width: auto; min-height: 0; accent-color: #168363; margin: 0; }
.switch { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 9px; padding: 10px 11px; cursor: pointer; }
.switch:has(:checked) { border-color: #a9d1c0; background: #f0faf5; }
.switch.warn:has(:checked) { border-color: #f0c0cd; background: #fff4f6; }
.switch input { margin-top: 3px; }
.switch strong, .switch small { display: block; }
.switch small { margin-top: 4px; font-weight: 500; color: var(--muted); line-height: 1.45; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.form-actions .spacer { margin-right: auto; }
.form-error { color: var(--red) !important; font-size: 12px !important; }
.form-error:empty { display: none; }
.filter-bar { display: flex; align-items: flex-end; gap: 8px; padding: 13px 15px; flex-wrap: wrap; }
.filter-bar .field { flex: 1 1 130px; }
.filter-bar .button { min-height: 40px; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 9px; border-top: 1px solid var(--line); padding: 10px 16px; color: var(--muted); font-size: 12px; }
.pagination .button { min-height: 32px; }
.connect-grid { display: grid; gap: 15px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.connection-card .health-list { margin: 0; }
.connection-card .health-list dd { max-width: 56%; overflow-wrap: anywhere; }
.connection-card .health-detail { padding: 13px 0 0; }
.commands { display: grid; gap: 9px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.commands div { display: flex; align-items: center; gap: 9px; }
code { background: #edf3fa; color: #263f60; border-radius: 5px; padding: 2px 5px; overflow-wrap: anywhere; }

.signin { min-height: 100dvh; display: grid; place-items: center; padding: 18px; background: radial-gradient(ellipse at center 10%, #dbeeea, transparent 62%), #f3f6fa; }
.signin-card { width: min(390px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 17px; padding: 28px; box-shadow: 0 14px 42px #15233513; }
.signin-card h1 { font-size: 25px; margin-top: 17px; }
.signin-card p { font-size: 13px; margin-top: 7px; }
.signin-card form { display: grid; gap: 8px; margin-top: 22px; }
.signin-card button { margin-top: 7px; }
dialog { border: 1px solid var(--line); border-radius: 15px; color: var(--ink); box-shadow: 0 16px 54px #0d1c3950; width: min(530px, calc(100% - 28px)); max-height: calc(100dvh - 28px); padding: 0; }
dialog::backdrop { background: #13263a77; backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding: 14px 17px; }
.modal-head .button { min-height: 32px; width: 32px; }
.member-list { display: grid; gap: 4px; max-height: 240px; overflow: auto; padding: 4px; margin: -4px; }
.members-area { margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--line); }
.member-list button { border: 1px solid var(--line); border-radius: 8px; background: #f8fbfe; padding: 7px 9px; text-align: left; font-size: 12px; color: var(--ink); display: flex; justify-content: space-between; gap: 7px; align-items: center; }
.member-list button:hover { background: var(--green-bg); }
.toast { z-index: 10; position: fixed; right: 18px; bottom: 18px; max-width: min(470px, calc(100% - 36px)); border: 1px solid #c6e0d6; color: #104a3d; background: #e8faf1; box-shadow: 0 7px 25px #173f4330; padding: 12px 16px; border-radius: 10px; font-size: 13px; font-weight: 650; }
.toast.error { color: var(--red); background: #fff0f3; border-color: #f4c4cf; }

@media (max-width: 1180px) {
  .shell { grid-template-columns: 204px minmax(0, 1fr); }
  .main, .top { padding-left: 22px; padding-right: 22px; }
  .foot { margin-left: 22px; margin-right: 22px; }
  .crumb-root { display: none; }
  .crumb-separator { display: none; }
}
@media (max-width: 910px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 235px; min-height: 0; transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility .2s; }
  .sidebar.open { transform: none; visibility: visible; }
  .veil:not([hidden]) { display: block !important; position: fixed; inset: 0; z-index: 4; border: 0; background: #111f3177; }
  .mobile-menu { display: inline-flex !important; }
}
@media (max-width: 650px) {
  .top { min-height: 60px; gap: 7px; padding: 8px 12px; }
  .top-controls { gap: 6px; }
  .chat-control label { display: none; }
  .chat-control select { max-width: min(37vw, 185px); }
  .crumb { gap: 6px; }
  .crumb strong { display: none; }
  .main { padding: 20px 12px 16px; }
  .foot { margin: 0 12px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 11px; margin-bottom: 15px; }
  .hero { padding: 14px; gap: 13px; margin-bottom: 12px; }
  .hero-symbol { width: 42px; height: 42px; }
  .hero h2 { font-size: 18px; }
  .hero-side { width: 100%; justify-content: space-between; gap: 8px; }
  .hero-policy small { font-size: 11px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
  .stat { min-height: 85px; padding: 9px 10px; }
  .stat-value { font-size: 24px; }
  .detail-grid, .settings-grid, .connect-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .chat-list { max-height: 220px; }
  .mode-options { grid-template-columns: minmax(0, 1fr); }
  .mode-choice { grid-template-columns: 15px minmax(0, 1fr); align-items: center; }
  .mode-choice small { grid-column: 2; }
  th, td { padding: 9px 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
