/* =====================================================================
   BotClarify — shared design system
   ===================================================================== */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: #e3e6eb;
  --border-strong: #d0d5dd;
  --text: #15181e;
  --text-2: #4a5160;
  --muted: #7a8291;
  --primary: #4f46e5;
  --primary-600: #4338ca;
  --primary-soft: #eef2ff;
  --success: #067a4e;
  --success-soft: #e6f6ee;
  --warn: #9a6200;
  --warn-soft: #fef4e2;
  --danger: #c02626;
  --danger-soft: #fdeceb;
  --info: #0b6fa8;
  --info-soft: #e7f2fa;
  --sidebar: #171b24;
  --sidebar-2: #222836;
  --sidebar-text: #aab2c2;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 4px 16px rgba(16, 24, 40, .08);
  --shadow-lg: 0 16px 48px rgba(16, 24, 40, .16);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.011em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 10px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px;
}
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: -.01em; }
.brand-sub { font-size: 11px; color: var(--sidebar-text); margin-top: -2px; }

.org-switch { margin: 4px 12px 12px; }
.org-switch select {
  width: 100%; background: var(--sidebar-2); border: 1px solid #333a4a; color: #fff;
  border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: var(--font);
}
.org-switch label { display: block; font-size: 11px; color: var(--sidebar-text); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .05em; }

.nav { padding: 4px 10px; flex: 1; }
.nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: #6b7487; margin: 16px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; color: var(--sidebar-text);
  font-size: 13.5px; cursor: pointer; border: none; background: none; width: 100%;
  text-align: left; font-family: var(--font); margin-bottom: 2px;
}
.nav-item:hover { background: var(--sidebar-2); color: #fff; text-decoration: none; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 550; }
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .9; }
.nav-item .count { margin-left: auto; font-size: 11px; background: rgba(255,255,255,.12); padding: 1px 7px; border-radius: 20px; }

.sidebar-foot { padding: 12px; border-top: 1px solid #2a3040; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: var(--primary); color: #fff; display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
}
.user-chip .who { min-width: 0; }
.user-chip .who b { display: block; font-size: 13px; color: #fff; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .who span { display: block; font-size: 11.5px; color: var(--sidebar-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Content area ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 14px 26px; display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 20;
}
.topbar .title { flex: 1; min-width: 0; }
.topbar .title p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.page { padding: 22px 26px 48px; max-width: 1360px; width: 100%; }
.page-section { display: none; }
.page-section.active { display: block; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  margin-bottom: 18px; overflow: hidden;
}
.card-head {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.card-head h2, .card-head h3 { flex: 1; min-width: 140px; }
.card-head .sub { color: var(--muted); font-size: 12.5px; font-weight: 400; margin-top: 1px; }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }

/* ---------- Stat tiles ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 15px 16px; box-shadow: var(--shadow-sm);
}
.stat .label { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 7px; }
.stat .value { font-size: 26px; font-weight: 680; letter-spacing: -.02em; margin-top: 6px; }
.stat .value small { font-size: 13px; font-weight: 500; color: var(--muted); }
.stat .foot { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat .icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.stat .icon svg { width: 15px; height: 15px; }

/* ---------- Progress bars ---------- */
.meter { height: 6px; background: #eceef2; border-radius: 4px; overflow: hidden; margin-top: 8px; }
.meter > i { display: block; height: 100%; background: var(--primary); border-radius: 4px; transition: width .3s; }
.meter.warn > i { background: #e0a020; }
.meter.danger > i { background: var(--danger); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
  text-align: left; font-weight: 600; color: var(--text-2); font-size: 12px;
  text-transform: uppercase; letter-spacing: .04em;
  padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover { background: var(--surface-2); }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-main { font-weight: 550; }
.cell-sub { color: var(--muted); font-size: 12px; }

/* ---------- Status badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; padding: 2.5px 9px; border-radius: 20px;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
  white-space: nowrap;
}
.badge.ok, .badge.ready, .badge.active, .badge.paid { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge.warn, .badge.processing, .badge.invited, .badge.pending, .badge.trial { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.ocr_processing { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.ocr_retry { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.tiny { font-size: 10.5px; padding: 1px 6px; font-weight: 600; }
.badge.err, .badge.failed, .badge.suspended, .badge.disabled, .badge.overdue { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.info, .badge.admin { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.purple { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--font); font-size: 13.5px; font-weight: 550;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { filter: brightness(.94); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 550; margin-bottom: 6px; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
/* Uses :not(...) rather than listing each type: an <input> with no type
   attribute never matches input[type=text], which is what once left a few
   fields rendered narrow instead of filling their row. */
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=submit]):not([type=button]):not([type=range]):not([type=color]),
select, textarea {
  width: 100%; font-family: var(--font); font-size: 13.5px; color: var(--text);
  /* Read through custom properties so a caller can widen one side without
     having to out-specify the seven :not() clauses above — a plain
     ".search-box input { padding-left: 32px }" loses that fight and lets the
     magnifier sit on top of the first letter. */
  padding: 9px var(--input-pr, 11px) 9px var(--input-pl, 11px);
  border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface); outline: none; transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.13); }
input[type=file] { width: 100%; font-size: 13px; padding: 8px; border: 1px dashed var(--border-strong); border-radius: 8px; background: var(--surface-2); }
textarea { resize: vertical; min-height: 78px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }
/* Written as "label.check", not ".check": these labels sit inside .field, and
   ".field label { display:block }" outranks a bare ".check", which would undo
   display:flex and drop the checkbox onto its own line. */
label.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 400; margin-bottom: 0; color: var(--text); }
.check input { width: auto; }

/* ---------- Toolbars and filters ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .grow { flex: 1; min-width: 180px; }
.search-box { position: relative; flex: 1; min-width: 200px; max-width: 340px; }
.search-box svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); }
.search-box input { --input-pl: 32px; }

/* ---------- Empty states ---------- */
.empty { text-align: center; padding: 42px 20px; color: var(--muted); }
.empty svg { width: 34px; height: 34px; opacity: .4; margin-bottom: 10px; }
.empty b { display: block; color: var(--text-2); font-size: 14px; margin-bottom: 4px; }

/* ---------- Folder tree ---------- */
.tree { font-size: 13.5px; }
.tree-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border-radius: 8px; cursor: pointer; color: var(--text-2);
}
.tree-item:hover { background: var(--surface-2); }
.tree-item.active { background: var(--primary-soft); color: var(--primary-600); font-weight: 600; }
.tree-item svg { width: 15px; height: 15px; flex: none; }
.tree-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-item .count { font-size: 11.5px; color: var(--muted); }
.tree-item .lock { color: var(--warn); display: inline-flex; }
.tree-item .lock svg { width: 13px; height: 13px; }
.perm-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 4px; }
label.perm-row { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 7px; font-size: 13.5px; font-weight: 400; margin-bottom: 0; color: var(--text); }
.perm-row:hover { background: var(--surface-2); }
.perm-row input { width: auto; flex: none; }
.perm-row .who { flex: 1; min-width: 0; }
.perm-row .who b { display: block; font-weight: 550; color: var(--text); }
.perm-row .who span { color: var(--muted); font-size: 12px; }
.tree-item .row-act { opacity: 0; display: flex; gap: 2px; }
.tree-item:hover .row-act { opacity: 1; }
.icon-btn {
  border: none; background: none; cursor: pointer; padding: 3px; border-radius: 5px;
  color: var(--muted); display: grid; place-items: center;
}
.icon-btn:hover { background: #e9ebef; color: var(--text); }
.icon-btn svg { width: 14px; height: 14px; }
.split { display: grid; grid-template-columns: 250px 1fr; gap: 18px; align-items: start; }

/* ---------- Chat ---------- */
.chat-layout { display: flex; flex-direction: column; height: calc(100vh - 62px); }
.chat-scroll { flex: 1; overflow-y: auto; padding: 24px 26px; }
.chat-inner { max-width: 820px; margin: 0 auto; }
.msg { display: flex; gap: 12px; margin-bottom: 22px; align-items: flex-start; }
/* Questions on the right, answers on the left: reads as a two-person chat. */
.msg.user { flex-direction: row-reverse; }
.msg .bubble-avatar {
  width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
}
.msg.user .bubble-avatar { background: var(--primary); color: #fff; }
.msg.bot .bubble-avatar { background: #1b2030; color: #fff; }
.msg .body { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.msg.user .body { flex: 0 1 auto; max-width: min(78%, 560px); align-items: flex-end; }
/* The answer is capped too, otherwise it runs the full width and stops reading
   like a message next to the question opposite it. */
.msg.bot .body { align-items: flex-start; max-width: min(88%, 660px); }
.msg .who { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.msg .text {
  white-space: pre-wrap; word-wrap: break-word; font-size: 14.5px; line-height: 1.65;
  padding: 10px 13px; border-radius: 12px; border: 1px solid transparent;
}
/* A squared-off corner on the sender's side points the bubble at its avatar. */
.msg.user .text {
  background: var(--primary-soft); border-color: #dfe3fb;
  border-bottom-right-radius: 3px; text-align: left;
}
.msg.bot .text { background: var(--surface-2); border-color: var(--border); border-bottom-left-radius: 3px; }
.msg .srcs:not(:empty) { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.src-chip {
  font-size: 11.5px; background: var(--surface); border: 1px solid var(--border);
  padding: 3px 9px; border-radius: 20px; color: var(--text-2); display: inline-flex; gap: 5px; align-items: center;
}
.src-chip svg { width: 12px; height: 12px; color: var(--muted); }
.composer { border-top: 1px solid var(--border); background: var(--surface); padding: 14px 26px 18px; }
.composer-inner { max-width: 820px; margin: 0 auto; }
.composer-box {
  display: flex; gap: 10px; align-items: flex-end;
  border: 1px solid var(--border-strong); border-radius: 12px; padding: 8px 8px 8px 14px; background: var(--surface);
}
.composer-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.13); }
.composer-box textarea {
  border: none; padding: 6px 0; min-height: 24px; max-height: 160px; resize: none; font-size: 14.5px;
}
.composer-box textarea:focus { box-shadow: none; }
.composer .meta { font-size: 12px; color: var(--muted); margin-top: 8px; display: flex; gap: 12px; flex-wrap: wrap; }
.typing span { display: inline-block; width: 6px; height: 6px; margin-right: 3px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25 } 30% { opacity: 1 } }

/* ---------- Simple bar chart ---------- */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 130px; padding-top: 8px; }
.bars .bar { flex: 1; background: var(--primary-soft); border-radius: 3px 3px 0 0; position: relative; min-height: 2px; }
.bars .bar > i { display: block; width: 100%; background: var(--primary); border-radius: 3px 3px 0 0; height: 100%; }
.bars .bar:hover > i { background: var(--primary-600); }
.chart-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16,20,28,.5); backdrop-filter: blur(2px);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px; max-height: 88vh; display: flex; flex-direction: column;
}
.modal.wide { max-width: 760px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.modal-head h3 { flex: 1; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- Toast ---------- */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #1b2030; color: #fff; padding: 11px 15px; border-radius: 10px;
  box-shadow: var(--shadow-lg); font-size: 13.5px; max-width: 380px;
  display: flex; gap: 9px; align-items: flex-start; animation: slideIn .2s;
}
.toast.ok { background: #0b5f3f; }
.toast.err { background: #9b1c1c; }
.toast svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
@keyframes slideIn { from { opacity: 0; transform: translateX(16px) } }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side {
  background: linear-gradient(150deg, #1e1b4b, #312e81 55%, #4c1d95);
  color: #fff; padding: 48px 46px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-side h2 { font-size: 27px; line-height: 1.3; margin-bottom: 14px; }
.auth-side p { color: #c7c9f0; font-size: 14.5px; max-width: 420px; }
.auth-feature { display: flex; gap: 12px; margin-top: 18px; align-items: flex-start; }
.auth-feature .ico { width: 30px; height: 30px; border-radius: 8px; background: rgba(255,255,255,.13); display: grid; place-items: center; flex: none; }
.auth-feature .ico svg { width: 15px; height: 15px; }
.auth-feature b { display: block; font-size: 14px; }
.auth-feature span { color: #b9bced; font-size: 13px; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 396px; }
.auth-card h1 { margin-bottom: 6px; }
.auth-card > p.lead { color: var(--muted); margin-bottom: 24px; }
.auth-alt { text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--muted); }
.alert { padding: 11px 13px; border-radius: 9px; font-size: 13.5px; margin-bottom: 15px; display: none; }
.alert.show { display: block; }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.success { background: var(--success-soft); color: var(--success); }
.alert.info { background: var(--info-soft); color: var(--info); }

/* ---------- Utilities ---------- */
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-0 { margin-top: 0 } .mt-1 { margin-top: 8px } .mt-2 { margin-top: 16px } .mt-3 { margin-top: 24px }
.mb-0 { margin-bottom: 0 } .mb-1 { margin-bottom: 8px } .mb-2 { margin-bottom: 16px }
.hidden { display: none !important; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.loading-line { height: 2px; background: linear-gradient(90deg, transparent, var(--primary), transparent); background-size: 50% 100%; animation: sweep 1s infinite linear; }
@keyframes sweep { from { background-position: -100% 0 } to { background-position: 200% 0 } }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .nav-item { width: auto; }
  .nav-group { width: 100%; margin: 8px 10px 2px; }
  .split { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .page, .topbar, .chat-scroll, .composer { padding-left: 16px; padding-right: 16px; }
}

/* ---------- Pricing page ---------- */
.pricing-head { text-align: center; max-width: 640px; margin: 0 auto 28px; }
.pricing-head h1 { font-size: 30px; margin-bottom: 10px; }
.pricing-head p { color: var(--muted); font-size: 15px; }
/* Declared after ".pricing-head p" and with a tag in the selector: the two
   otherwise tie on specificity and the plain colour would win on source order. */
.pricing-head p.pricing-cta {
  display: inline-block; margin: 16px auto 0; padding: 11px 22px;
  background: var(--primary-soft); color: var(--primary);
  border-radius: 999px; font-size: 14.5px; font-weight: 600; line-height: 1.5;
}
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; align-items: start; }
.plan-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 24px; box-shadow: var(--shadow-sm); position: relative; display: flex; flex-direction: column;
}
.plan-card.featured { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12), var(--shadow); }
.plan-card .tag {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; font-size: 11.5px; font-weight: 600;
  padding: 3px 12px; border-radius: 20px; white-space: nowrap;
}
.plan-card h3 { font-size: 17px; }
.plan-card .blurb { color: var(--muted); font-size: 13px; min-height: 36px; margin-top: 4px; }
.plan-price { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin: 14px 0 2px; }
.plan-price small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan-feats { list-style: none; padding: 0; margin: 18px 0; font-size: 13.5px; flex: 1; }
.plan-feats li { display: flex; gap: 9px; align-items: flex-start; padding: 5px 0; color: var(--text-2); }
.plan-feats svg { width: 15px; height: 15px; color: var(--success); flex: none; margin-top: 2px; }
.plan-feats li.off { color: var(--muted); }
.plan-feats li.off svg { color: var(--muted); }
.pay-method { display: flex; gap: 10px; align-items: center; padding: 11px 13px; border: 1px solid var(--border-strong); border-radius: 9px; cursor: pointer; margin-bottom: 8px; }
.pay-method:hover { background: var(--surface-2); }
.pay-method.sel { border-color: var(--primary); background: var(--primary-soft); }
.pay-method input { width: auto; flex: none; }
.pay-method .who b { display: block; font-size: 13.5px; }
.pay-method .who span { font-size: 12px; color: var(--muted); }

  flex: 1; border: none; background: none; color: var(--sidebar-text); cursor: pointer;
  font-family: var(--font); font-size: 12px; font-weight: 650; padding: 5px 0; border-radius: 6px; letter-spacing: .03em;
}

/* ---------- Trial banner ---------- */
.trial-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 20px; font-size: 13.5px;
  background: var(--info-soft); color: var(--info);
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.trial-bar.warn { background: var(--warn-soft); color: var(--warn); }
.trial-bar.danger { background: var(--danger-soft); color: var(--danger); }
.trial-bar svg { width: 16px; height: 16px; }
.trial-bar > span:nth-child(2) { flex: 1; min-width: 200px; }
.trial-bar .btn { margin-left: auto; }
.shell.has-trial-bar { min-height: calc(100vh - 40px); }
