/* Property Agent console. System fonts only: the page loads nothing from outside (see the CSP). */
:root {
  --bg: #f4f6fa; --panel: #fff; --sunken: #f8fafc; --hover: #f3f6fb; --band: rgba(15, 23, 42, .04);
  --text: #0e1726; --text-2: #344054; --muted: #667085; --faint: #98a2b3;
  --line: #e3e8ef; --line-2: #edf0f5; --line-strong: #d0d6e0;
  --accent: #2f62e9; --accent-2: #2450c8; --accent-soft: #edf2fe; --accent-line: #c8d7fb; --accent-ink: #1c3f9f;
  --ok: #067647; --ok-soft: #ecfdf3; --ok-line: #abefc6; --ok-dot: #17b26a;
  --warn: #b54708; --warn-soft: #fffaeb; --warn-line: #fedf89; --warn-dot: #f79009;
  --err: #b42318; --err-soft: #fef3f2; --err-line: #fecdca; --err-dot: #f04438;
  --side: #0b1222; --side-2: #131c31; --side-line: rgba(255, 255, 255, .07); --side-text: #c3cad8; --side-muted: #6c7791;
  /* chart series: categorical slots 1 and 2 of the validated palette (checked against the white surface) */
  --series-1: #2a78d6; --series-2: #eb6834;
  --font: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", SFMono-Regular, Consolas, Menlo, monospace;
  --radius: 8px; --radius-lg: 12px; --radius-xl: 16px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 10px -2px rgba(16, 24, 40, .07);
  --shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, .22), 0 8px 16px -8px rgba(16, 24, 40, .08);
  --ring: 0 0 0 4px rgba(47, 98, 233, .15);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.015em; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); text-decoration: underline; }
code, pre, kbd { font-family: var(--mono); font-size: 12.5px; }
pre { white-space: pre-wrap; word-break: break-word; margin: 0; }
kbd { display: inline-block; font-size: 10.5px; line-height: 16px; padding: 0 5px; border: 1px solid var(--line-strong);
  border-bottom-width: 2px; border-radius: 4px; background: var(--panel); color: var(--text-2); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--err); }
.spacer { flex: 1; }
.tnum { font-variant-numeric: tabular-nums; }
::selection { background: #cddbfd; }

/* icons: inline SVG, stroked in the text colour */
.ico { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- controls */
button, .button { font: inherit; font-size: 13.5px; font-weight: 550; line-height: 20px; border: 1px solid var(--line-strong);
  background: var(--panel); color: var(--text-2); padding: 7px 14px; border-radius: var(--radius); cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  box-shadow: var(--shadow-xs); transition: background .12s, border-color .12s, color .12s, box-shadow .12s; white-space: nowrap; }
button:hover, .button:hover { background: var(--sunken); border-color: #b9c1cd; color: var(--text); text-decoration: none; }
button:active, .button:active { transform: translateY(.5px); }
button:disabled { opacity: .5; cursor: default; }
button.small, .button.small { font-size: 12.5px; padding: 4px 10px; gap: 5px; border-radius: 7px; }
button.small .ico, .button.small .ico { width: 14px; height: 14px; }
.primary, .button.primary { background: linear-gradient(180deg, #3d6ef0 0%, var(--accent) 100%); border-color: var(--accent-2); color: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .1), inset 0 1px 0 rgba(255, 255, 255, .16); }
.primary:hover, .button.primary:hover { background: var(--accent-2); border-color: var(--accent-ink); color: #fff; }
.danger { color: var(--err); }
.danger:hover { border-color: var(--err-line); background: var(--err-soft); color: var(--err); }
.danger.armed, .danger.armed:hover { background: var(--err); border-color: var(--err); color: #fff; }
.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.ghost:hover { background: var(--band); border-color: transparent; }
.block { display: flex; width: 100%; }
.icon-btn { padding: 7px; }
.icon-btn .ico { width: 18px; height: 18px; }
button:focus-visible, .button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }
input, select, textarea { font: inherit; font-size: 14px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 8px 11px; background: #fff; color: var(--text); width: 100%; box-shadow: var(--shadow-xs);
  transition: border-color .12s, box-shadow .12s; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: #b9c1cd; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input:disabled, select:disabled, textarea:disabled { background: var(--sunken); color: var(--muted); }
textarea { resize: vertical; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 10px center / 16px no-repeat; }
select:disabled { background-color: var(--sunken); cursor: default; }
label { display: block; margin: 14px 0; font-weight: 550; font-size: 13.5px; color: var(--text-2); }
label > input, label > select, label > textarea { margin-top: 6px; font-weight: 400; }
label.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 550; }
label.check input { width: auto; margin: 1px 0 0; box-shadow: none; }
label.check small { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
/* on/off switch */
input[type="checkbox"].switch { appearance: none; -webkit-appearance: none; width: 36px; height: 20px; padding: 0; border: 0; border-radius: 999px;
  background: #cfd5df; position: relative; cursor: pointer; flex-shrink: 0; transition: background .15s; box-shadow: inset 0 1px 2px rgba(16, 24, 40, .12); }
input[type="checkbox"].switch::before { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .25); transition: transform .15s; }
input[type="checkbox"].switch:checked { background: var(--accent); }
input[type="checkbox"].switch:checked::before { transform: translateX(16px); }
input[type="checkbox"].switch:focus-visible { box-shadow: var(--ring); }
input[type="checkbox"].switch:disabled { opacity: .5; cursor: default; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------------------------------------------------------------- cards and panels */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 22px;
  margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.card h2 { margin: 0 0 4px; font-size: 15.5px; font-weight: 650; }
.card h2 + .hint, .card h2 + p.muted { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card-title { display: flex; align-items: flex-start; gap: 14px; padding: 20px 24px; border-bottom: 1px solid var(--line-2); }
.card-title h2 { margin: 0; }
.card-title .hint { margin: 2px 0 0; max-width: 640px; }
.card:not(.form) > .card-title { margin: -20px -22px 18px; padding: 20px 22px; }
.card.panel { padding: 0; margin: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); min-height: 56px; }
.panel-head h2 { margin: 0; font-size: 14.5px; font-weight: 650; }
.panel-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--sunken); color: var(--muted); border: 1px solid var(--line-2); }
.panel-ico .ico { width: 16px; height: 16px; }
.panel-head > a { margin-left: auto; font-size: 13px; font-weight: 550; display: inline-flex; align-items: center; gap: 4px; }
.panel-head > a .ico { width: 14px; height: 14px; }
.panel-head > .panel-toggle { margin-left: auto; color: var(--muted); }
.panel-body { padding: 16px 18px; }
.panel.attention { border-color: var(--warn-line); box-shadow: 0 0 0 4px rgba(247, 144, 9, .07), var(--shadow-sm); }
.panel.attention .panel-head { background: linear-gradient(180deg, #fff8e8, #fffbf2); border-bottom-color: #fbe3a6; }
.panel.attention .panel-ico { background: #fef0c7; color: var(--warn); border-color: #fde59a; }

/* ---------------------------------------------------------------- status pills */
.status, .pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 550; line-height: 18px;
  padding: 1px 9px; border-radius: 999px; background: #f2f4f7; color: #475467; white-space: nowrap; vertical-align: middle;
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .05); }
.status > i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.pill { margin-left: 8px; }
.s-ok, .pill.ok { background: var(--ok-soft); color: var(--ok); box-shadow: inset 0 0 0 1px #d1fadf; }
.s-ok > i { background: var(--ok-dot); }
.s-warn, .pill.warn { background: var(--warn-soft); color: var(--warn); box-shadow: inset 0 0 0 1px #fef0c7; }
.s-warn > i { background: var(--warn-dot); }
.s-bad, .pill.bad { background: var(--err-soft); color: var(--err); box-shadow: inset 0 0 0 1px #fee4e2; }
.s-bad > i { background: var(--err-dot); }
.s-live { background: var(--accent-soft); color: var(--accent-2); box-shadow: inset 0 0 0 1px #dfe8fd; }
.s-live > i { animation: pulse 1.2s infinite; }
.ok-text { color: var(--ok); } .warn-text { color: var(--warn); } .bad-text { color: var(--err); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #98a2b3; margin-right: 8px; vertical-align: middle; flex-shrink: 0; }
.dot.ok { background: var(--ok-dot); } .dot.bad { background: var(--err-dot); } .dot.warn { background: var(--warn-dot); }
.dot.live { background: #7c9cf5; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* tints: the same name always gets the same soft colour (avatars, connector tiles) */
.tint-0 { background: #e6eefe; color: #2450c8; } .tint-1 { background: #eee9fe; color: #5b3fd0; }
.tint-2 { background: #ddf4f1; color: #0f6b63; } .tint-3 { background: #fdf0de; color: #9a5406; }
.tint-4 { background: #fde8ee; color: #ad2257; } .tint-5 { background: #e9edf3; color: #3b4a62; }

/* ---------------------------------------------------------------- notices */
.alert { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); background: var(--panel);
  border-radius: var(--radius-lg); padding: 13px 16px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.alert > .ico { width: 18px; height: 18px; margin-top: 1px; }
.alert p { margin: 2px 0 0; color: var(--text-2); }
.alert.warn { background: var(--warn-soft); border-color: var(--warn-line); }
.alert.warn > .ico { color: var(--warn); }
.alert.info { background: var(--accent-soft); border-color: var(--accent-line); }
.alert.info > .ico { color: var(--accent); }
.alert.bad { background: var(--err-soft); border-color: var(--err-line); }
.alert.bad > .ico { color: var(--err); }
.empty-state { color: var(--muted); font-size: 13.5px; text-align: center; padding: 28px 16px; }
.empty-state .ico { display: block; margin: 0 auto 10px; width: 40px; height: 40px; padding: 10px; border-radius: 12px;
  color: var(--faint); background: var(--sunken); border: 1px solid var(--line-2); }
.empty-state a { font-weight: 550; }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }

/* ---------------------------------------------------------------- sign-in page */
.login { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100%; background: var(--panel); }
.login-aside { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  padding: 44px 56px; color: var(--side-text);
  background:
    radial-gradient(700px 420px at 85% 0%, rgba(61, 110, 240, .35) 0%, rgba(61, 110, 240, 0) 70%),
    radial-gradient(600px 400px at 0% 100%, rgba(235, 104, 52, .14) 0%, rgba(235, 104, 52, 0) 70%),
    linear-gradient(180deg, #0d1529 0%, #0a1020 100%); }
.login-aside::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M40 0H0v40' fill='none' stroke='%23ffffff' stroke-opacity='.05'/%3E%3C/svg%3E");
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%); mask-image: linear-gradient(180deg, #000 0%, transparent 85%); }
.login-aside > * { position: relative; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand b { display: block; font-size: 15px; font-weight: 650; color: #fff; }
.login-brand small { display: block; color: #8d98b0; font-size: 12.5px; }
.login-pitch h2 { color: #fff; font-size: 32px; line-height: 1.18; font-weight: 650; letter-spacing: -.025em; margin: 0 0 30px; max-width: 480px; }
.login-pitch ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; max-width: 460px; }
.login-pitch li { display: flex; gap: 14px; align-items: flex-start; font-size: 13.5px; color: #9aa5bd; line-height: 1.5; }
.login-pitch li > span:first-child { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); color: #a9c0fb; }
.login-pitch li .ico { width: 18px; height: 18px; }
.login-pitch li b { display: block; color: #eef2f8; font-weight: 600; font-size: 14px; margin-bottom: 1px; }
.login-foot { margin: 0; font-size: 12.5px; color: #6c7791; }
.login-main { display: grid; place-items: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 380px; }
.login-card .login-brand { margin-bottom: 28px; }
.login-card .login-brand b { color: var(--text); }
.login-card .login-brand small { color: var(--muted); }
.mobile-only { display: none; }
.login-card h1 { margin: 0 0 4px; font-size: 28px; font-weight: 700; letter-spacing: -.025em; }
.login-card > p.muted { margin: 0 0 22px; }
.login-card label { margin: 16px 0; }
.login-card input { padding: 10px 12px; }
.login-card button { width: 100%; margin-top: 10px; padding: 10px 14px; font-size: 14px; }
.login-card .error:empty { display: none; }
.logo { width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; color: #fff; flex-shrink: 0;
  background: linear-gradient(140deg, #5a86f6 0%, #2f62e9 45%, #1c3f9f 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 4px 12px -4px rgba(47, 98, 233, .6); }
.logo .ico { width: 19px; height: 19px; }

/* ---------------------------------------------------------------- app shell */
.shell { display: flex; height: 100%; }
.side { width: 264px; flex-shrink: 0; color: var(--side-text); display: flex; flex-direction: column; padding: 18px 14px 12px;
  background: linear-gradient(180deg, #0d1529 0%, #0a1020 100%); border-right: 1px solid #0a0f1d; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px 20px; color: #fff; }
.brand:hover { color: #fff; text-decoration: none; }
.brand b { display: block; font-size: 14.5px; font-weight: 650; letter-spacing: -.01em; }
.brand small { display: block; font-size: 12px; color: #8590a8; }
.new-chat { justify-content: flex-start; width: 100%; margin-bottom: 18px; padding: 8px 12px; color: #fff;
  background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04); }
.new-chat:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .16); color: #fff; }
.new-chat .ico { width: 18px; height: 18px; padding: 2px; border-radius: 5px; background: var(--accent); color: #fff; stroke-width: 2.4; }
.navlinks { display: flex; flex-direction: column; gap: 2px; padding-bottom: 14px; border-bottom: 1px solid var(--side-line); }
.navlinks a { position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--side-text);
  font-weight: 550; font-size: 13.5px; }
.navlinks a .ico { width: 17px; height: 17px; color: #7d89a3; }
.navlinks a:hover { background: rgba(255, 255, 255, .05); color: #fff; text-decoration: none; }
.navlinks a.on { background: rgba(255, 255, 255, .08); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05); }
.navlinks a.on::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #6e95f7; }
.navlinks a.on .ico { color: #a9c0fb; }
.navlinks .count { margin-left: auto; }
.side-lists { flex: 1; overflow-y: auto; margin: 0 -14px; padding: 0 14px 8px; min-height: 0;
  scrollbar-width: thin; scrollbar-color: #2a3550 transparent; }
.list-title { display: flex; align-items: center; gap: 6px; margin: 20px 10px 6px; font-size: 11px; font-weight: 650;
  text-transform: uppercase; letter-spacing: .08em; color: var(--side-muted); }
.list-title.attention { color: #fbbf24; }
.count { background: #f79009; color: #1f1300; border-radius: 999px; font-size: 10.5px; font-weight: 700; padding: 0 6px;
  letter-spacing: 0; line-height: 17px; min-width: 18px; text-align: center; }
.list a { display: flex; align-items: center; padding: 6px 10px; border-radius: 7px; color: var(--side-text);
  font-size: 13px; white-space: nowrap; overflow: hidden; }
.list a span.t { overflow: hidden; text-overflow: ellipsis; }
.list a .when { margin-left: auto; padding-left: 8px; color: var(--side-muted); font-size: 11.5px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.list a:hover { background: rgba(255, 255, 255, .05); color: #fff; text-decoration: none; }
.list a.on { background: rgba(255, 255, 255, .09); color: #fff; }
.list .dot { margin-right: 10px; background: #475569; width: 6px; height: 6px; }
.list .dot.ok { background: #32d583; } .list .dot.warn { background: #fdb022; box-shadow: 0 0 0 3px rgba(253, 176, 34, .15); }
.list .dot.bad { background: #f97066; } .list .dot.live { background: #8eabf8; }
.list .empty { color: var(--side-muted); font-size: 12.5px; padding: 2px 10px; }
.side-foot { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--side-line); padding-top: 12px; }
#me { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 9px; color: #e2e8f0; }
#me:hover { background: rgba(255, 255, 255, .05); text-decoration: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; flex-shrink: 0;
  font-size: 13px; font-weight: 650; text-transform: uppercase; }
.avatar:not([class*="tint-"]) { background: #334155; color: #fff; }
.avatar .ico { width: 18px; height: 18px; }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.avatar.lg { width: 42px; height: 42px; font-size: 16px; }
.avatar.xl { width: 54px; height: 54px; font-size: 20px; }
.side .avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .1); }
.who { min-width: 0; }
.who b { display: block; font-size: 13px; font-weight: 600; color: #f1f5f9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { display: block; font-size: 12px; color: #8590a8; }
.side .ghost { color: #8590a8; }
.side .ghost:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.frame { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { height: 60px; flex-shrink: 0; display: flex; align-items: center; gap: 14px; padding: 0 28px;
  background: rgba(255, 255, 255, .9); border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
#menu { display: none; color: var(--text-2); }
.crumb { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--text); }
.crumb .sep { color: #c5ccd8; }
.crumb b { color: var(--text); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usage { display: flex; align-items: center; gap: 16px; flex-shrink: 0; padding-right: 14px; border-right: 1px solid var(--line-2); }
.meter { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.meter .bar { width: 60px; margin: 0; }
.meter b { font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; min-width: 30px; }
.live-ind { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 550; color: var(--ok);
  background: var(--ok-soft); border: 1px solid var(--ok-line); border-radius: 999px; padding: 2px 10px; flex-shrink: 0; }
.live-ind:empty { display: none; }
.live-ind i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok-dot); box-shadow: 0 0 0 3px rgba(23, 178, 106, .18); animation: pulse 1.6s infinite; }
.live-ind.off { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }
.live-ind.off i { background: var(--warn-dot); box-shadow: 0 0 0 3px rgba(247, 144, 9, .18); }
.chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px 3px 3px;
  font-size: 13px; font-weight: 550; color: var(--text-2); background: var(--panel); box-shadow: var(--shadow-xs);
  white-space: nowrap; overflow: hidden; max-width: 40vw; flex-shrink: 0; }
.chip > .dot { margin: 0 0 0 9px; }
.chip:hover { border-color: var(--line-strong); color: var(--text); text-decoration: none; }
.chip-av { position: relative; width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; flex-shrink: 0;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; }
.chip-av .dot { position: absolute; right: -1px; bottom: -1px; margin: 0; width: 9px; height: 9px; box-shadow: 0 0 0 2px #fff; }
.chip-t { overflow: hidden; text-overflow: ellipsis; }
.chip .plan { color: var(--muted); font-weight: 500; font-size: 11.5px; text-transform: capitalize; padding-left: 8px; border-left: 1px solid var(--line); }
main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.page { flex: 1; overflow-y: auto; padding: 30px max(32px, calc((100% - 1200px) / 2)) 56px; animation: rise .22s ease-out; }
.page.narrow { padding-left: max(32px, calc((100% - 920px) / 2)); padding-right: max(32px, calc((100% - 920px) / 2)); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 700; margin: 0; line-height: 1.25; letter-spacing: -.022em; }
.page-head .sub { margin: 6px 0 0; color: var(--muted); max-width: 760px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; font-size: 13px; font-weight: 550; margin-bottom: 10px; color: var(--muted); }
.back:hover { color: var(--text); }

/* ---------------------------------------------------------------- overview */
.hero { margin-bottom: 22px; }
.eyebrow { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.hero h1 { font-size: 28px; font-weight: 700; letter-spacing: -.028em; margin: 4px 0 6px; line-height: 1.2; }
.hero-sub { margin: 0; color: var(--muted); font-size: 14.5px; display: flex; flex-wrap: wrap; align-items: center; gap: 0 2px; min-height: 22px; }
.hero-sub .sep { color: #c5ccd8; margin: 0 8px; }
.hero-sub b { font-weight: 650; }
.card.ask { padding: 0; overflow: hidden; margin-bottom: 22px; transition: border-color .12s, box-shadow .12s; box-shadow: var(--shadow); }
.ask:focus-within { border-color: var(--accent); box-shadow: var(--ring), var(--shadow); }
.ask-field { display: flex; align-items: flex-start; gap: 4px; padding: 14px 16px 0; }
.ask-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; margin-top: 2px;
  background: linear-gradient(140deg, #edf2fe, #dfe8fd); color: var(--accent); }
.ask textarea { display: block; border: 0; box-shadow: none; resize: none; min-height: 64px; padding: 6px 8px;
  font-size: 15.5px; border-radius: 0; }
.ask textarea:focus { box-shadow: none; }
.ask-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px 14px 16px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.quick button { font-size: 12.5px; font-weight: 550; padding: 4px 11px 4px 9px; border-radius: 999px; color: var(--text-2);
  background: var(--sunken); border-color: var(--line); box-shadow: none; white-space: normal; text-align: left; gap: 6px; }
.quick button .ico { width: 14px; height: 14px; color: var(--muted); }
.quick button:hover { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-2); }
.quick button:hover .ico { color: var(--accent); }
.ask-send { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.kbd-hint { font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px 15px;
  box-shadow: var(--shadow-sm); color: var(--text); display: block; min-width: 0; transition: border-color .12s, box-shadow .12s, transform .12s; }
a.kpi:hover { border-color: var(--line-strong); box-shadow: var(--shadow); text-decoration: none; color: var(--text); transform: translateY(-1px); }
.kpi-top { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; font-weight: 550; }
.kpi-label { flex: 1; min-width: 0; }
.kpi-go { color: var(--faint); opacity: 0; transition: opacity .12s; }
a.kpi:hover .kpi-go { opacity: 1; }
.kpi-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--sunken);
  color: var(--muted); border: 1px solid var(--line-2); flex-shrink: 0; }
.kpi-ico .ico { width: 17px; height: 17px; }
.kpi.t-warn .kpi-ico { background: #fef0c7; color: var(--warn); border-color: #fde59a; }
.kpi.t-live .kpi-ico { background: var(--accent-soft); color: var(--accent); border-color: #dfe8fd; }
.kpi.t-ok .kpi-ico { background: var(--ok-soft); color: var(--ok); border-color: #d1fadf; }
.kpi.t-bad .kpi-ico { background: var(--err-soft); color: var(--err); border-color: #fee4e2; }
.kpi.t-warn { border-color: #fbe3a6; box-shadow: 0 0 0 3px rgba(247, 144, 9, .06), var(--shadow-sm); }
.kpi-num { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; margin-top: 12px; }
.kpi-num small { font-size: 15px; font-weight: 550; color: var(--faint); letter-spacing: 0; margin-left: 4px; }
.kpi-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi.t-warn .kpi-sub { color: var(--warn); } .kpi.t-bad .kpi-sub { color: var(--err); }
.overview { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; color: var(--text); border-top: 1px solid var(--line-2); min-width: 0; }
.row:first-child { border-top: 0; }
a.row { transition: background .1s; }
a.row:hover { background: var(--hover); text-decoration: none; color: var(--text); }
.row .grow { flex: 1; min-width: 0; }
.row .grow b { display: block; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .grow small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .end { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.row .end small { color: var(--faint); font-size: 12px; }
.row-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--sunken); color: var(--muted); border: 1px solid var(--line-2); }
.row-ico.routine { background: var(--accent-soft); color: var(--accent); border-color: #dfe8fd; }
.row-ico.warn { background: #fef0c7; color: var(--warn); border-color: #fde59a; }
.acct { display: flex; align-items: center; gap: 12px; }
.acct b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct small { display: block; color: var(--muted); font-size: 12.5px; text-transform: none; }
.acct .grow { flex: 1; min-width: 0; }
.acct > .avatar:not([class*="tint-"]) { background: var(--sunken); color: var(--muted); border: 1px solid var(--line); }
.acct-hero { padding: 14px; margin: 4px 0 2px; border-radius: 12px; background: var(--sunken); border: 1px solid var(--line-2); }
.acct-hero b { font-size: 15px; }
.plan-badge { font-size: 12px; font-weight: 650; text-transform: capitalize; color: var(--accent-ink); background: var(--accent-soft);
  border: 1px solid var(--accent-line); border-radius: 999px; padding: 2px 10px; flex-shrink: 0; }
.subhead { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin: 20px 0 6px; }
.conn-list .row { padding: 9px 0; gap: 10px; }
.conn-list .row .grow b { font-size: 13.5px; }
.conn-ico { width: 28px; height: 28px; border-radius: 8px; display: inline-grid; place-items: center; flex-shrink: 0;
  font-size: 12.5px; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .05); }

/* ring meters */
.rings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.ring { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 12px; min-width: 0; }
.ring > span { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.ring-dial { position: relative; width: 52px; height: 52px; flex-shrink: 0; }
.ring-dial svg { width: 100%; height: 100%; display: block; }
.ring-dial b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; color: var(--text); }
.ring-track { fill: none; stroke: var(--accent-soft); stroke-width: 6; }
.ring-fill { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; transition: stroke-dasharray .4s; }
.ring.warn .ring-track { stroke: #fef0c7; } .ring.warn .ring-fill { stroke: var(--warn-dot); }
.ring.bad .ring-track { stroke: #fee4e2; } .ring.bad .ring-fill { stroke: var(--err-dot); }
.rings.big .ring { flex-direction: column; text-align: center; padding: 16px 12px; gap: 10px; }
.rings.big .ring-dial { width: 84px; height: 84px; }
.rings.big .ring-dial b { font-size: 17px; }

/* the activity chart: stacked columns, hairline grid, a tooltip per day */
.chart-legend { display: flex; align-items: center; gap: 16px; font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; }
.chart-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend .muted { font-size: 12px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw.s1, .key.s1 { background: var(--series-1); } .sw.s2, .key.s2 { background: var(--series-2); }
.chart-plot { position: relative; height: 170px; margin: 26px 0 8px 30px; }
.chart-grid .gl { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line-2); }
.chart-grid .gl:first-child { border-top-color: var(--line-strong); }
.chart-grid .gl span { position: absolute; left: -30px; width: 22px; text-align: right; top: -8px; font-size: 11px; color: var(--faint);
  font-variant-numeric: tabular-nums; }
.chart-cols { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); }
.chart-cols .col { all: unset; box-sizing: border-box; height: 100%; display: flex; flex-direction: column; justify-content: flex-end;
  align-items: center; gap: 2px; border-radius: 6px 6px 0 0; cursor: default; }
.chart-cols .col:hover, .chart-cols .col:focus-visible { background: var(--band); }
.chart-cols .col:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.chart-cols .seg { display: block; width: min(24px, 60%); flex-shrink: 0; min-height: 2px; transition: filter .1s; }
.chart-cols .seg:first-of-type { border-radius: 4px 4px 0 0; }
.chart-cols .seg.s1 { background: var(--series-1); } .chart-cols .seg.s2 { background: var(--series-2); }
.chart-cols .col:hover .seg, .chart-cols .col:focus-visible .seg { filter: brightness(1.08) saturate(1.05); }
.chart-cols .col em { font-style: normal; font-size: 11px; font-weight: 650; color: var(--text-2); line-height: 14px; margin-bottom: 2px;
  font-variant-numeric: tabular-nums; }
.chart-x { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); margin-left: 30px; font-size: 11px; color: var(--faint);
  text-align: center; white-space: nowrap; }
.chart-x span { overflow: visible; }
.chart-tip { position: absolute; top: 4px; z-index: 2; pointer-events: none; min-width: 140px; white-space: nowrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 9px 12px;
  opacity: 0; transition: opacity .1s; }
.chart-tip.on { opacity: 1; }
.tip-date { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; font-weight: 550; }
.tip-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; line-height: 20px; color: var(--muted); }
.tip-row b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; min-width: 14px; }
.key { width: 12px; height: 2px; border-radius: 2px; display: inline-block; flex-shrink: 0; }
.chart-table .tablewrap { box-shadow: none; max-height: 260px; overflow-y: auto; }
.chart-empty { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); pointer-events: none; white-space: nowrap;
  font-size: 13px; color: var(--muted); background: var(--panel); padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line-2); }

/* stat strips (routines, a routine's runs) */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line-2);
  border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.stat { background: var(--panel); padding: 14px 18px; min-width: 0; }
.stat > span { display: block; font-size: 12.5px; color: var(--muted); font-weight: 550; }
.stat > b { display: block; font-family: var(--display); font-size: 21px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat > small { display: block; font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat.t-bad > b { color: var(--err); }

/* ---------------------------------------------------------------- tables */
.tablewrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card .tablewrap { box-shadow: none; border-radius: 10px; }
table.grid { width: 100%; min-width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.grid th, table.grid td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.grid th { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap;
  background: var(--sunken); border-bottom-color: var(--line); padding-top: 10px; padding-bottom: 10px; }
table.grid tbody tr { transition: background .1s; }
table.grid tbody tr:hover td { background: #fafbfd; }
table.grid tbody tr:last-child td { border-bottom: 0; }
/* data columns stay on one line; the name and the buttons may wrap */
table.grid td:nth-child(n+2) { white-space: nowrap; }
table.grid td:nth-child(n+2) > div { white-space: normal; max-width: 300px; }
table.grid td:nth-child(n+2) .row-actions { white-space: normal; }
table.grid td strong { font-weight: 600; color: var(--text); }
table.grid td .sub { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
table.grid td.name { min-width: 220px; }
table.grid td.name .sub { white-space: normal; max-width: 460px; }
table.grid tr.is-off td.name strong { color: var(--muted); }
table.grid tr.is-off .row-ico { filter: grayscale(1); opacity: .7; }
.rname { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rname > div { min-width: 0; }
.sched { display: inline-flex; align-items: center; gap: 6px; font-weight: 550; color: var(--text-2); }
.sched .ico { width: 14px; height: 14px; color: var(--faint); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
table.grid .row-actions { flex-wrap: nowrap; }
.person { display: inline-flex; align-items: center; gap: 10px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 0 16px; font-size: 13.5px; margin-top: 16px; }
.kv > div { padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
.kv div:nth-child(odd) { color: var(--muted); }
.bar { height: 6px; background: var(--accent-soft); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.bar > i.warn { background: var(--warn-dot); } .bar > i.bad { background: var(--err-dot); }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
/* the grid's own margin collapses with the labels around it, so the spacing matches a plain label */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin: 14px 0; }
.two > label { margin: 0; }
.cols-2 { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.cols-2 > .card { margin-bottom: 0; }
.cols-2 + .card { margin-top: 20px; }
details > summary { cursor: pointer; }
ul.skips { margin: 0; padding-left: 18px; } ul.skips li { margin: 4px 0; }

/* ---------------------------------------------------------------- forms in sections */
.card.form { padding: 0; overflow: hidden; }
.fsec { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 32px; padding: 22px 24px; border-top: 1px solid var(--line-2); }
.card.form > .fsec:first-child { border-top: 0; }
.fsec-head h3 { margin: 0; font-size: 14px; font-weight: 650; }
.fsec-head p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.fsec-body > :first-child { margin-top: 0; }
.fsec-body > :last-child { margin-bottom: 0; }
.form-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 14px 24px; background: var(--sunken);
  border-top: 1px solid var(--line-2); }
.form-foot > p { margin: 0 auto 0 0; }
details.advanced { margin-top: 14px; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 14px; background: var(--sunken); }
details.advanced > summary { font-weight: 550; font-size: 13px; color: var(--muted); }
details.advanced[open] > summary { margin-bottom: 4px; }

/* settings: a section list beside the cards */
.settings { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; align-items: start; }
.subnav { position: sticky; top: 0; display: flex; flex-direction: column; gap: 2px; }
.subnav button { justify-content: flex-start; background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2);
  font-weight: 550; padding: 7px 10px; }
.subnav button .ico { color: var(--faint); }
.subnav button:hover { background: var(--panel); border-color: var(--line); color: var(--text); }
.settings-body > .card { scroll-margin-top: 16px; }
.roles-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.role-card { border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px; background: var(--sunken); }
.role-card p { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.role-tag { display: inline-block; font-size: 12px; font-weight: 650; border-radius: 999px; padding: 1px 9px; }
.role-tag.r-admin { background: var(--accent-soft); color: var(--accent-ink); }
.role-tag.r-member { background: var(--ok-soft); color: var(--ok); }
.role-tag.r-viewer { background: #f2f4f7; color: #475467; }
.add-person { margin-top: 18px; padding: 16px 18px 18px; border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--sunken); }
.add-person h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 650; }
.add-person h3 .ico { width: 16px; height: 16px; color: var(--accent); }
.add-person .hint { margin-top: 2px; }

/* account: adding a connector */
.conn-add { margin: 0 0 16px; padding: 16px 18px 18px; border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--sunken); }
.conn-add h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 14px; font-weight: 650; }
.conn-add h3 .ico { width: 16px; height: 16px; color: var(--accent); }
.conn-kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.conn-kind { justify-content: flex-start; align-items: flex-start; gap: 12px; text-align: left; white-space: normal; padding: 12px 14px;
  border-radius: 10px; border-color: var(--line); font-weight: 400; }
.conn-kind:hover { background: var(--panel); border-color: var(--accent-line); }
.conn-kind b { display: block; font-weight: 650; color: var(--text); }
.conn-kind small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.45; margin-top: 2px; }
.conn-kind.on, .conn-kind.on:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.conn-kind-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--sunken); border: 1px solid var(--line-2); color: var(--muted); }
.conn-kind.on .conn-kind-ico { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.conn-kind-ico .ico { width: 16px; height: 16px; }
.conn-pane { margin-top: 16px; }
.conn-pane > p:first-child { margin: 0; color: var(--text-2); }
.conn-pane .alert { margin-top: 14px; }
.lopt { font-weight: 400; font-size: 12.5px; color: var(--faint); }

/* settings: which browser the checks run in */
.conn-kinds.stack { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.br-status { margin-top: 12px; }
.br-status .hint { display: flex; gap: 10px; align-items: flex-start; margin: 0; }
.br-status .hint .status { flex-shrink: 0; }
.br-notes { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; display: grid; gap: 4px; }
.br-notes li::marker { color: var(--faint); }
.secret-note { display: flex; gap: 8px; align-items: flex-start; }
.secret-note .ico { width: 14px; height: 14px; margin-top: 2px; flex-shrink: 0; color: var(--faint); }
table.grid td .sub.mono-sub { font-family: var(--mono); font-size: 12px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#term-host { margin-left: 4px; }

/* ---------------------------------------------------------------- conversation */
.conv { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.conv-head { display: flex; align-items: center; gap: 14px; padding: 12px 28px; border-bottom: 1px solid var(--line);
  background: var(--panel); flex-wrap: wrap; }
.conv-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--sunken); color: var(--muted); border: 1px solid var(--line-2); }
.conv-ico.routine { background: var(--accent-soft); color: var(--accent); border-color: #dfe8fd; }
.conv-ico .ico { width: 18px; height: 18px; }
.conv-title { min-width: 0; }
.conv-line { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.conv-head h1 { font-size: 16.5px; font-weight: 650; margin: 0; cursor: text; letter-spacing: -.012em; }
.conv-head h1[title]:hover { color: var(--accent-2); }
.conv-head input { max-width: 420px; padding: 4px 8px; }
.conv-info { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 550; line-height: 18px;
  border-radius: 999px; padding: 1px 9px; background: #f2f4f7; color: #475467; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge:empty { display: none; }
.badge.running, .badge.starting, .badge.finishing { background: var(--accent-soft); color: var(--accent-2); }
.badge.running::before, .badge.starting::before, .badge.finishing::before { animation: pulse 1.2s infinite; }
.badge.waiting { background: var(--warn-soft); color: var(--warn); }
.badge.waiting::before { background: var(--warn-dot); }
.badge.error, .badge.interrupted { background: var(--err-soft); color: var(--err); }
.badge.done, .badge.idle { background: var(--ok-soft); color: var(--ok); }
.badge.done::before, .badge.idle::before { background: var(--ok-dot); }
.msgs { flex: 1; overflow-y: auto; padding: 28px 24px 36px; background: var(--bg); }
.msgs-inner { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; padding-left: 46px; }
.msg-user { align-self: flex-end; background: linear-gradient(180deg, #3d6ef0, var(--accent)); color: #fff; border-radius: 16px 16px 4px 16px;
  padding: 10px 15px; max-width: 78%; white-space: pre-wrap; word-break: break-word; box-shadow: 0 2px 6px -2px rgba(47, 98, 233, .45);
  margin: 10px 0 4px; font-size: 14.5px; }
.msg-user:first-child { margin-top: 0; }
.msg-user .by { display: block; font-size: 11.5px; color: #cfdcfd; margin-bottom: 2px; font-weight: 550; }
.msg-text { position: relative; line-height: 1.65; word-break: break-word; background: var(--panel); border: 1px solid var(--line);
  border-radius: 4px 16px 16px 16px; padding: 13px 18px; box-shadow: var(--shadow-sm); align-self: stretch; font-size: 14.5px; }
/* the agent's mark beside each of its answers */
.msgs-inner > .msg-text::before { content: ""; position: absolute; left: -46px; top: 0; width: 32px; height: 32px; border-radius: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21h18M5 21V8l7-5 7 5v13M9 21v-6h6v6M10 10h4'/%3E%3C/svg%3E") center / 17px no-repeat,
    linear-gradient(140deg, #5a86f6 0%, #2f62e9 45%, #1c3f9f 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 2px 6px -2px rgba(47, 98, 233, .5); }
.msg-text p { margin: 0 0 10px; } .msg-text p:last-child { margin-bottom: 0; }
.msg-text ul, .msg-text ol { margin: 4px 0 10px; padding-left: 22px; }
.msg-text li { margin: 2px 0; }
.msg-text h1, .msg-text h2, .msg-text h3, .msg-text h4 { font-size: 15px; margin: 16px 0 6px; font-weight: 650; }
.msg-text > :first-child { margin-top: 0; }
.msg-text strong { font-weight: 650; }
.msg-text pre { background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 12px 14px; margin: 10px 0; overflow-x: auto; white-space: pre; }
.msg-text code { background: #f1f4f9; border: 1px solid var(--line-2); border-radius: 5px; padding: 0 5px; font-size: 12.5px; }
.msg-text pre code { background: none; border: 0; padding: 0; color: inherit; }
.msg-text table { border-collapse: collapse; margin: 10px 0; font-size: 13.5px; display: block; overflow-x: auto; }
.msg-text th, .msg-text td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.msg-text th { background: var(--sunken); font-weight: 650; }
.streaming::after { content: "▍"; color: var(--accent); animation: pulse 1s infinite; }
details.think { background: transparent; border: 0; padding: 4px 2px; font-size: 13px; }
details.think summary { display: inline-flex; align-items: center; gap: 6px; color: #5b3fd0; font-weight: 550; list-style: none;
  padding: 3px 10px; border-radius: 999px; background: #f4f1fe; border: 1px solid #e4dcfd; }
details.think summary::-webkit-details-marker { display: none; }
details.think summary::before { content: "✦"; font-size: 11px; }
details.think .think-text { white-space: pre-wrap; color: var(--text-2); margin: 8px 0 2px; padding: 10px 14px; background: var(--panel);
  border: 1px solid var(--line); border-left: 3px solid #c4b5fd; border-radius: 0 10px 10px 0; line-height: 1.6; }
details.think.empty summary { background: none; border: 0; color: var(--muted); font-weight: 400; font-size: 12.5px; cursor: default; padding: 3px 0; }
.tool { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; box-shadow: var(--shadow-xs); }
.tool > summary { padding: 7px 10px 7px 8px; display: flex; gap: 10px; align-items: center; list-style: none; border-radius: 10px; min-width: 0; }
.tool > summary::-webkit-details-marker { display: none; }
.tool > summary:hover { background: var(--hover); }
.tool[open] > summary { border-radius: 10px 10px 0 0; }
.tico { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--sunken); color: var(--muted); border: 1px solid var(--line-2); }
.tico .ico { width: 14px; height: 14px; }
.tool .tname { font-weight: 600; white-space: nowrap; color: var(--text); }
.tool .tsum { font-family: var(--mono); font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; min-width: 0; flex: 1; }
.tool .tstat { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 550; color: var(--muted);
  white-space: nowrap; background: #f2f4f7; border-radius: 999px; padding: 0 8px; line-height: 18px; flex-shrink: 0; }
.tool .tstat.run { color: var(--accent-2); background: var(--accent-soft); }
.tool .tstat.run::before { content: ""; width: 8px; height: 8px; border: 1.6px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .8s linear infinite; }
.tool .tstat.err { color: var(--err); background: var(--err-soft); }
.tool .tstat.ok { color: var(--ok); background: var(--ok-soft); }
.tool .tbody { padding: 2px 12px 12px; border-top: 1px solid var(--line-2); }
.tlabel { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 10px 0 0; }
.tool .tbody pre { background: var(--sunken); border: 1px solid var(--line-2); border-radius: 8px; padding: 9px 11px;
  max-height: 360px; overflow: auto; margin-top: 6px; font-size: 12px; }
.tool .sub { margin: 0 12px 10px 20px; border-left: 2px solid var(--accent-line); padding-left: 12px; display: flex; flex-direction: column; gap: 8px; }
.tool .sub:empty { display: none; }
.perm { border: 1px solid var(--warn-line); background: linear-gradient(180deg, #fffaf0 0%, #fff 64px); border-radius: 14px;
  padding: 14px 18px 16px; box-shadow: 0 0 0 4px rgba(247, 144, 9, .07), var(--shadow); margin: 6px 0; animation: rise .2s ease-out; }
.perm-eyebrow { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--warn); margin-bottom: 8px; }
.perm-eyebrow .ico { width: 15px; height: 15px; }
.perm-title { display: flex; align-items: center; gap: 10px; }
.perm h3 { margin: 0; font-size: 15px; font-weight: 650; }
.perm-desc { margin-top: 6px; color: var(--text-2); font-size: 13.5px; }
.perm pre { background: var(--sunken); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; max-height: 280px;
  overflow: auto; margin: 10px 0; font-size: 12.5px; }
.perm .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.perm .actions input { width: 260px; flex: 1; }
.perm.question { border-color: var(--accent-line); background: linear-gradient(180deg, #f3f6fe 0%, #fff 64px);
  box-shadow: 0 0 0 4px rgba(47, 98, 233, .06), var(--shadow); }
.perm.question .perm-eyebrow { color: var(--accent); }
.perm.decided { border-color: var(--line); background: var(--panel); box-shadow: var(--shadow-xs); padding: 12px 16px; }
.perm.decided .perm-eyebrow { color: var(--faint); }
.perm.decided pre { max-height: 120px; opacity: .85; }
.perm-outcome { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted);
  padding: 2px 10px 2px 8px; border-radius: 999px; background: #f2f4f7; margin-top: 2px; }
.perm-outcome .ico { width: 14px; height: 14px; }
.perm.d-ok .perm-outcome { color: var(--ok); background: var(--ok-soft); }
.perm.d-bad .perm-outcome { color: var(--err); background: var(--err-soft); }
.perm .q { margin: 12px 0; } .perm .q .opt { display: flex; gap: 10px; align-items: baseline; font-weight: 400; margin: 6px 0;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); cursor: pointer; }
.perm .q .opt:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.perm .q .opt input { width: auto; box-shadow: none; }
.line { font-size: 12.5px; color: var(--muted); padding: 4px 2px; }
.line > summary { color: var(--muted); }
.line.warn { color: var(--warn); } .line.err { color: var(--err); }
.result { display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; padding: 8px 0 6px; font-size: 12.5px; color: var(--muted); }
.result-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 9px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-xs); }
.result-chip .ico { width: 14px; height: 14px; color: var(--ok-dot); }
.result.err { color: var(--err); }
.result.err .result-chip { border-color: var(--err-line); background: var(--err-soft); }
.result.err .result-chip .ico { color: var(--err); }
.errbox { border: 1px solid var(--err-line); background: var(--err-soft); color: var(--err); border-radius: 10px;
  padding: 11px 14px; font-size: 13.5px; }
.composer { border-top: 1px solid var(--line); background: var(--panel); padding: 14px 24px 10px; }
.composer.muted { text-align: center; padding: 14px 24px; }
.composer form { max-width: 900px; margin: 0 auto; display: flex; gap: 8px; align-items: flex-end; border: 1px solid var(--line-strong);
  border-radius: 14px; padding: 6px 6px 6px 6px; box-shadow: var(--shadow-sm); transition: border-color .12s, box-shadow .12s; background: var(--panel); }
.composer form:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.composer textarea { min-height: 40px; max-height: 240px; border: 0; box-shadow: none; resize: none; padding: 9px 10px; font-size: 14.5px; }
.composer textarea:focus { box-shadow: none; }
.composer form button { border-radius: 10px; }
.composer-hint { max-width: 900px; margin: 7px auto 0; font-size: 11.5px; color: var(--faint); text-align: center; }

/* ---------------------------------------------------------------- modal + terminal */
.modal { position: fixed; inset: 0; background: rgba(10, 16, 32, .55); backdrop-filter: blur(3px); display: flex; align-items: center;
  justify-content: center; z-index: 30; padding: 16px; }
.modal-box { background: var(--panel); border-radius: 16px; padding: 20px 24px 22px; width: 100%; max-width: 920px; max-height: 92vh;
  overflow-y: auto; box-shadow: var(--shadow-lg); animation: rise .18s ease-out; }
.modal-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line-2); }
.modal-head h2 { margin: 0; font-size: 17px; font-weight: 650; }
.modal-head p { margin: 1px 0 0; }
.modal-head > button { margin-left: auto; }
.modal-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
  border: 1px solid #dfe8fd; flex-shrink: 0; }
.modal-ico .ico { width: 19px; height: 19px; }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 6px 0 16px; }
.steps li { counter-increment: step; position: relative; margin: 12px 0; padding-left: 38px; min-height: 26px; line-height: 26px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 700; color: var(--accent-2); background: var(--accent-soft);
  border: 1px solid var(--accent-line); line-height: 1; }
.inline { display: inline-flex; gap: 6px; align-items: center; } .inline input { width: 260px; }
/* the paste box gets its own line under its step, wide enough for a pasted address */
.steps li > .inline { display: flex; margin-top: 8px; } .steps li > .inline input { width: auto; flex: 1; max-width: 560px; }
.termwrap { background: #0b1020; border-radius: 12px; padding: 10px; overflow-x: auto; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
#term { height: 340px; }

#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.toast { max-width: 420px; background: #101828; color: #fff; padding: 11px 15px; border-radius: 11px;
  box-shadow: var(--shadow-lg); font-size: 13.5px; animation: rise .18s ease-out; border: 1px solid rgba(255, 255, 255, .08); }
.toast.err { background: var(--err); }

/* ---------------------------------------------------------------- smaller screens */
@media (max-width: 1180px) {
  .overview { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .usage { display: none; }
  .settings { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .subnav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .fsec { grid-template-columns: 200px minmax(0, 1fr); gap: 24px; }
}
@media (max-width: 860px) {
  .login { grid-template-columns: minmax(0, 1fr); background: radial-gradient(900px 400px at 50% -10%, #e3ebfd 0%, rgba(227, 235, 253, 0) 70%), var(--bg); }
  .login-aside { display: none; }
  .login-main { align-items: start; padding-top: 12vh; }
  .login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 26px 24px 20px; box-shadow: var(--shadow-lg); }
  .mobile-only { display: flex; }
  .login-card h1 { font-size: 24px; }
  #menu { display: inline-flex; }
  .side { position: fixed; top: 0; bottom: 0; left: 0; z-index: 20; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 8px 0 32px rgba(0, 0, 0, .3); }
  .side.open ~ .frame::after { content: ""; position: fixed; inset: 0; background: rgba(10, 16, 32, .5); z-index: 15; }
  .top { padding: 0 12px; gap: 8px; height: 56px; }
  .chip { max-width: 52vw; }
  .chip .plan { display: none; }
  .two, .cols-2 { grid-template-columns: 1fr; }
  .cols-2 > .card + .card { margin-top: 0; }
  .kv { grid-template-columns: 1fr; }
  .kv div:nth-child(odd) { border-bottom: 0; padding-bottom: 0; font-size: 12.5px; }
  .page, .page.narrow { padding: 20px 14px 36px; }
  .page-head { margin-bottom: 18px; }
  .page-head h1 { font-size: 21px; }
  .hero h1 { font-size: 23px; }
  .hero-sub { font-size: 13.5px; }
  .kpis { gap: 10px; }
  .kpi { padding: 13px 14px; }
  .kpi-num { font-size: 26px; margin-top: 10px; }
  .kpi-ico { width: 28px; height: 28px; }
  .kpi-sub { white-space: normal; }
  .ask-bar { flex-direction: column; align-items: stretch; padding: 8px 12px 12px; }
  .ask-field { padding: 12px 12px 0; }
  .ask textarea { min-height: 58px; }
  .quick { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .quick button { white-space: nowrap; }
  .ask-send { justify-content: stretch; }
  .ask-send button { flex: 1; }
  .kbd-hint, .composer-hint { display: none; }
  .card { padding: 16px; }
  .card:not(.form) > .card-title { margin: -16px -16px 16px; padding: 16px; }
  .card-title { padding: 16px; }
  .fsec { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 18px 16px; }
  .form-foot { padding: 12px 16px; }
  .roles-grid { grid-template-columns: minmax(0, 1fr); }
  .rings.big .ring-dial { width: 70px; height: 70px; }
  .row { padding: 10px 14px; }
  .conv-head { padding: 10px 14px; gap: 10px; }
  .conv-ico { display: none; }
  .msgs { padding: 16px 12px 24px; }
  .msgs-inner { padding-left: 0; }
  .msgs-inner > .msg-text::before { display: none; }
  .composer { padding: 10px 12px; }
  .msg-user { max-width: 88%; }
  .modal-box { padding: 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .chart-plot { height: 150px; }
}
@media (max-width: 640px) {
  .conn-kinds { grid-template-columns: minmax(0, 1fr); }
  table.grid td .sub.mono-sub { max-width: 100%; }
  :not(.chart-table) > .tablewrap { overflow: visible; }
  :not(.chart-table) > .tablewrap > table.grid thead { display: none; }
  :not(.chart-table) > .tablewrap > table.grid, :not(.chart-table) > .tablewrap > table.grid tbody { display: block; }
  :not(.chart-table) > .tablewrap > table.grid tr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
    padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
  :not(.chart-table) > .tablewrap > table.grid tbody tr:last-child { border-bottom: 0; }
  :not(.chart-table) > .tablewrap > table.grid td { display: block; padding: 0; border: 0; background: none !important; min-width: 0; }
  :not(.chart-table) > .tablewrap > table.grid td:first-child { flex: 1 1 100%; }
  :not(.chart-table) > .tablewrap > table.grid td:nth-child(n+2) > div { max-width: none; }
  :not(.chart-table) > .tablewrap > table.grid td:last-child:not(:first-child) { margin-left: auto; }
  :not(.chart-table) > .tablewrap > table.grid td:has(> .row-actions:not(:empty)) { flex: 1 1 100%; margin-left: 0; }
  :not(.chart-table) > .tablewrap > table.grid .row-actions { justify-content: flex-start; flex-wrap: wrap; }
  :not(.chart-table) > .tablewrap > table.grid td.name { min-width: 0; }
}
@media (max-width: 560px) {
  .live-ind { display: none; }
  .tool .tsum { display: none; }
}

/* browser: the live view of the window on the server */
.live-page .page-head { margin-bottom: 14px; }
.live-note:not(:empty) { margin-bottom: 14px; }
.live-card { padding: 0; overflow: hidden; }
.live-bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line-2); background: var(--sunken); }
.live-tabs { display: flex; gap: 4px; overflow-x: auto; min-width: 0; flex: 1; scrollbar-width: thin; }
.live-tab { display: inline-flex; align-items: center; gap: 6px; max-width: 220px; padding: 5px 10px; border: 1px solid transparent;
  border-radius: var(--radius); background: transparent; color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.live-tab span { overflow: hidden; text-overflow: ellipsis; }
.live-tab:hover { background: var(--hover); }
.live-tab.on { background: var(--panel); border-color: var(--line); color: var(--text); box-shadow: var(--shadow-xs); }
.live-tab.add { padding: 5px 7px; color: var(--muted); }
.live-tab .ico { width: 14px; height: 14px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn-dot); flex: none; }
.live-bar.tools { background: var(--panel); }
.live-bar .back .ico { transform: scaleX(-1); }
.live-addr { flex: 1; min-width: 0; height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--sunken); font: inherit; font-size: 13px; color: var(--text); }
.live-addr:focus { outline: none; border-color: var(--accent-line); box-shadow: var(--ring); background: var(--panel); }
.live-stage { background: var(--sunken); display: flex; justify-content: center; }
.live-screen { position: relative; width: 100%; aspect-ratio: 1280 / 800; background: var(--panel); outline: none; overflow: hidden; }
.live-screen:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.live-img { display: block; width: 100%; height: 100%; cursor: pointer; user-select: none; }
.live-screen.off .live-img { visibility: hidden; }
.live-empty:empty { display: none; }
.live-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 24px; }
.live-empty .ico { width: 28px; height: 28px; color: var(--faint); }
.live-empty b { display: block; color: var(--text); margin: 8px 0 2px; }
.live-empty p { margin: 0; max-width: 46ch; }
.live-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border-top: 1px solid var(--line-2); }
@media (max-width: 640px) {
  .live-foot > .muted:last-child { display: none; }
}
