/* AI Assistant Cloud — control panel
   Sans for reading, mono for anything the customer copies or a machine produced. */

@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --ink:      #0e1525;
  --ink-2:    #313d55;
  --muted:    #6b7689;
  --paper:    #f4f5f8;
  --surface:  #ffffff;
  --line:     #e3e7ef;
  --line-2:   #eef1f6;
  --iris:     #5b5bd6;
  --iris-dk:  #4a4ac0;
  --iris-lt:  #eeeefc;
  --signal:   #0fa47f;
  --signal-lt:#e8f7f2;
  --amber:    #d98a0b;
  --amber-lt: #fdf5e6;
  --danger:   #d0342c;
  --danger-lt:#fdeeed;
  --sans: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r: 10px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--iris); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; letter-spacing: -.015em; font-weight: 600; }
h1 { font-size: 23px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }

:focus-visible { outline: 2px solid var(--iris); outline-offset: 2px; border-radius: 4px; }

/* ── Shell ─────────────────────────────────────────────────────────── */

.shell { display: flex; min-height: 100vh; }

.rail {
  width: 232px; flex: 0 0 232px; background: var(--ink); color: #cbd3e1;
  padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.rail-brand {
  display: flex; align-items: center; gap: 9px; color: #fff;
  font-weight: 600; font-size: 15.5px; padding: 4px 8px 20px; letter-spacing: -.01em;
}
.rail-brand .dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--iris);
  box-shadow: 0 0 0 4px rgba(91,91,214,.22);
}
.rail-group {
  font: 500 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .12em;
  color: #64708a; padding: 16px 8px 7px;
}
.rail a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 7px; color: #cbd3e1; font-size: 14px;
  font-weight: 500; margin-bottom: 1px;
}
.rail a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.rail a.on { background: var(--iris); color: #fff; }
.rail a .count { font: 500 11px var(--mono); opacity: .65; }
.rail-foot { margin-top: 22px; padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,.09); }
.rail-foot .who { font-size: 13px; color: #9aa5ba; margin-bottom: 3px; }
.rail-foot .who strong { color: #fff; display: block; font-weight: 500; }

.main { flex: 1; min-width: 0; }
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 15px 30px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.topbar .crumb { font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.wrap { padding: 26px 30px 60px; max-width: 1140px; }

/* ── Cards ─────────────────────────────────────────────────────────── */

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); margin-bottom: 18px;
}
.card-h {
  padding: 15px 20px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.card-h p { margin: 3px 0 0; color: var(--muted); font-size: 13.5px; }
.card-b { padding: 20px; }
.card-b.tight { padding: 14px 20px; }

.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0,1fr) 380px; gap: 18px; align-items: start; }

/* ── Stats ─────────────────────────────────────────────────────────── */

.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.stat .k { font: 500 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.stat .v { font-size: 27px; font-weight: 600; letter-spacing: -.02em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

.meter { height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; margin-top: 11px; }
.meter i { display: block; height: 100%; background: var(--iris); border-radius: 99px; transition: width .3s; }
.meter.warn i { background: var(--amber); }
.meter.over i { background: var(--danger); }

/* ── Buttons ───────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--iris); color: #fff; border: 1px solid var(--iris);
  padding: 9px 16px; border-radius: 8px; font: 600 14px var(--sans);
  cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--iris-dk); border-color: var(--iris-dk); text-decoration: none; color: #fff; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--paper); color: var(--ink); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: #b02a23; border-color: #b02a23; }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 7px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ── Forms ─────────────────────────────────────────────────────────── */

.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
label { display: block; font-size: 13.5px; font-weight: 500; margin-bottom: 5px; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 5px; line-height: 1.45; }

input[type=text], input[type=email], input[type=password], input[type=url],
input[type=number], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  font: 14px var(--sans); background: var(--surface); color: var(--ink);
}
textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--iris); box-shadow: 0 0 0 3px var(--iris-lt);
}
input[disabled], textarea[disabled] { background: var(--paper); color: var(--muted); }
select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='%236b7689' d='M6 8.5 2 4h8z'/></svg>");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.check { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; }
.check input { margin: 2px 0 0; width: 16px; height: 16px; accent-color: var(--iris); flex: 0 0 auto; }
.check .t { font-size: 14px; font-weight: 500; }
.check .d { font-size: 12.5px; color: var(--muted); margin-top: 1px; }

.colorline { display: flex; align-items: center; gap: 9px; }
.colorline input[type=color] {
  width: 38px; height: 34px; padding: 2px; border: 1px solid var(--line);
  border-radius: 7px; background: #fff; cursor: pointer; flex: 0 0 auto;
}
.colorline input[type=text] { font: 13px var(--mono); }

input[type=range] { width: 100%; accent-color: var(--iris); }
.rangeval { font: 500 12px var(--mono); color: var(--muted); float: right; }

/* ── Tables ────────────────────────────────────────────────────────── */

table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font: 500 10.5px/1 var(--mono); text-transform: uppercase;
  letter-spacing: .1em; color: var(--muted); padding: 11px 20px;
  border-bottom: 1px solid var(--line); background: #fafbfd;
}
td { padding: 13px 20px; border-bottom: 1px solid var(--line-2); font-size: 14px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfe; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* ── Badges & pills ────────────────────────────────────────────────── */

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
  border-radius: 99px; font-size: 12px; font-weight: 500;
  background: var(--line-2); color: var(--ink-2);
}
.badge.ok    { background: var(--signal-lt); color: #0a7b5f; }
.badge.warn  { background: var(--amber-lt);  color: #9a6206; }
.badge.off   { background: #f1f2f6; color: var(--muted); }
.badge.iris  { background: var(--iris-lt); color: var(--iris-dk); }
.badge.bad   { background: var(--danger-lt); color: var(--danger); }
.badge .pip  { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.live .pip { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

.mono { font-family: var(--mono); font-size: 13px; }

/* ── Tabs ──────────────────────────────────────────────────────────── */

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 22px; overflow-x: auto; }
.tabs a {
  padding: 10px 15px; font-size: 14px; font-weight: 500; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--iris); border-bottom-color: var(--iris); }

/* ── The install snippet — the moment the product starts working ───── */

.snippet {
  background: #0e1525; border-radius: var(--r); padding: 18px 18px 16px; position: relative;
}
.snippet code {
  display: block; font: 13px/1.65 var(--mono); color: #b9c7e4;
  word-break: break-all; white-space: pre-wrap; padding-right: 84px;
}
.snippet code .tag { color: #6f8bc7; }
.snippet code .attr { color: #8ad0b2; }
.snippet code .val { color: #e4d9a8; }
.snippet .copy {
  position: absolute; top: 13px; right: 13px; background: rgba(255,255,255,.1);
  color: #dbe4f5; border: 0; padding: 6px 12px; border-radius: 7px;
  font: 500 12.5px var(--sans); cursor: pointer;
}
.snippet .copy:hover { background: rgba(255,255,255,.19); }
.snippet .copy.done { background: var(--signal); color: #fff; }

.conn {
  display: flex; align-items: center; gap: 9px; padding: 11px 16px;
  border: 1px solid var(--line); border-radius: var(--r); background: #fafbfd; font-size: 13.5px;
}
.conn .pip { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.conn.live { background: var(--signal-lt); border-color: #c6ece0; }
.conn.live .pip { background: var(--signal); animation: pulse 1.8s ease-in-out infinite; }

/* ── Notices ───────────────────────────────────────────────────────── */

.notice { padding: 12px 16px; border-radius: 9px; font-size: 14px; margin-bottom: 16px; border: 1px solid; }
.notice.success { background: var(--signal-lt); border-color: #c6ece0; color: #0a6b53; }
.notice.error   { background: var(--danger-lt); border-color: #f6cfcc; color: #99251f; }
.notice.info    { background: var(--iris-lt); border-color: #dcdcfa; color: #3f3fa8; }
.notice.warn    { background: var(--amber-lt); border-color: #f6e3bd; color: #8a5a05; }

.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty p { margin: 0 0 16px; font-size: 14px; }

.impersonating {
  background: var(--amber); color: #fff; padding: 8px 30px; font-size: 13.5px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.impersonating a { color: #fff; text-decoration: underline; font-weight: 500; }

/* ── Modal ─────────────────────────────────────────────────────────── */

.modal-bg {
  position: fixed; inset: 0; background: rgba(14,21,37,.5); display: none;
  z-index: 900; padding: 30px 20px; overflow-y: auto;
}
.modal-bg.on { display: block; }
.modal {
  background: var(--surface); border-radius: 13px; max-width: 560px; margin: 20px auto;
  box-shadow: 0 20px 50px rgba(14,21,37,.24);
}
.modal-h { padding: 17px 22px; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: center; }
.modal-h button { background: none; border: 0; font-size: 22px; color: var(--muted); cursor: pointer; line-height: 1; }
.modal-b { padding: 22px; }
.modal-f { padding: 15px 22px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 9px; }

/* ── Crawl progress ────────────────────────────────────────────────── */

.crawlbar { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.crawlbar i { display: block; height: 100%; background: var(--iris); width: 0; transition: width .4s; }
.crawlstat { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 9px; }
.crawlstat b { color: var(--ink); font-family: var(--mono); font-weight: 500; }

/* ── Conversation transcript ───────────────────────────────────────── */

.turn { display: flex; gap: 11px; margin-bottom: 15px; }
.turn .who {
  width: 30px; height: 30px; border-radius: 8px; flex: 0 0 auto; display: grid;
  place-items: center; font: 600 11px var(--mono); background: var(--line-2); color: var(--ink-2);
}
.turn.user .who { background: var(--iris); color: #fff; }
.turn.error .who { background: var(--danger-lt); color: var(--danger); }
.turn .body { flex: 1; min-width: 0; }
.turn .body .txt { font-size: 14px; white-space: pre-wrap; word-wrap: break-word; }
.turn .body .when { font-size: 11.5px; color: var(--muted); margin-top: 4px; font-family: var(--mono); }

/* ── Auth screens ──────────────────────────────────────────────────── */

.authpage { min-height: 100vh; display: grid; place-items: center; padding: 30px 20px; }
.authbox { width: 100%; max-width: 400px; }
.authbox .brand { display: flex; align-items: center; gap: 9px; justify-content: center; margin-bottom: 22px; font-weight: 600; font-size: 17px; }
.authbox .brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--iris); box-shadow: 0 0 0 4px rgba(91,91,214,.18); }
.authbox .card { padding: 28px; }
.authbox h1 { font-size: 20px; margin-bottom: 5px; }
.authbox .lede { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.authbox .alt { text-align: center; margin-top: 17px; font-size: 13.5px; color: var(--muted); }

/* ── Utilities ─────────────────────────────────────────────────────── */

.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex.between { justify-content: space-between; }
.flex.wrap { flex-wrap: wrap; }
.mt0 { margin-top: 0; } .mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb0 { margin-bottom: 0; } .mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
hr.sep { border: 0; border-top: 1px solid var(--line-2); margin: 20px 0; }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 9px;
  font-size: 14px; z-index: 950; opacity: 0; transition: .25s; pointer-events: none;
}
.toast.on { transform: translateX(-50%) translateY(0); opacity: 1; }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .rail { width: 100%; flex: none; height: auto; position: static; display: flex;
          flex-wrap: wrap; gap: 4px; padding: 12px; }
  .rail-brand { width: 100%; padding-bottom: 10px; }
  .rail-group { display: none; }
  .rail a { flex: 0 0 auto; }
  .rail-foot { width: 100%; }
  .wrap, .topbar { padding-left: 18px; padding-right: 18px; }
  .g2, .g3, .g4, .split, .row2, .row3 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ── Public pages: pricing and landing ─────────────────────────────── */

.publicpage { background: var(--surface); }

.pubnav {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 30px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px); z-index: 20;
}
.pubbrand { display: flex; align-items: center; gap: 9px; font-weight: 600; color: var(--ink); font-size: 16px; }
.pubbrand:hover { text-decoration: none; }
.pubbrand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--iris); box-shadow: 0 0 0 4px rgba(91,91,214,.18); }
.pubnav nav { gap: 18px; }

.pubfoot {
  border-top: 1px solid var(--line); margin-top: 60px; padding: 22px 30px;
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 13px; color: var(--muted); flex-wrap: wrap;
}

.hero { text-align: center; padding: 68px 24px 8px; max-width: 760px; margin: 0 auto; }
.hero h1 { font-size: 40px; line-height: 1.12; letter-spacing: -.03em; margin-bottom: 14px; }
.hero p { color: var(--muted); font-size: 17px; margin: 0 auto; max-width: 560px; }
.herosteps {
  display: flex; justify-content: center; gap: 26px; flex-wrap: wrap;
  margin-top: 30px; font-size: 13.5px; color: var(--ink-2);
}
.herosteps > div { display: flex; align-items: center; gap: 8px; }
.herosteps .n {
  width: 21px; height: 21px; border-radius: 50%; background: var(--iris-lt);
  color: var(--iris-dk); display: grid; place-items: center;
  font: 600 11px var(--mono); flex: 0 0 auto;
}

.plansec { padding: 54px 24px 20px; max-width: 1080px; margin: 0 auto; }
.planhead { text-align: center; margin-bottom: 30px; }
.planhead h2 { font-size: 25px; margin-bottom: 6px; }

.plangrid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); align-items: stretch; }

.plancard {
  background: var(--surface); border: 1px solid var(--line); border-radius: 13px;
  padding: 24px 22px; display: flex; flex-direction: column; position: relative;
}
.plancard.featured { border-color: var(--iris); box-shadow: 0 0 0 3px var(--iris-lt); }
.planflag {
  position: absolute; top: -10px; left: 22px; background: var(--iris); color: #fff;
  font: 500 11px var(--sans); padding: 3px 10px; border-radius: 99px; letter-spacing: .01em;
}
.plancard h3 { font-size: 17px; margin-bottom: 3px; }
.plantag { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.planprice {
  font-size: 27px; font-weight: 600; letter-spacing: -.02em;
  padding-bottom: 16px; border-bottom: 1px solid var(--line-2); margin-bottom: 16px;
}
.planfeat { list-style: none; margin: 0 0 20px; padding: 0; flex: 1; }
.planfeat li { position: relative; padding: 0 0 9px 21px; font-size: 13.5px; color: var(--ink-2); }
.planfeat li::before {
  content: ''; position: absolute; left: 2px; top: 6px; width: 5px; height: 9px;
  border: solid var(--signal); border-width: 0 2px 2px 0; transform: rotate(45deg);
}

@media (max-width: 700px) {
  .hero { padding-top: 44px; }
  .hero h1 { font-size: 30px; }
  .pubnav, .pubfoot { padding-left: 18px; padding-right: 18px; }
}
