/* ============================================================================
   WebStackIndex — "Crisp SaaS" design system
   Single custom stylesheet (replaces Bootstrap 5). Values are taken verbatim
   from design_handoff_option_a/README.md and the inline styles in
   "Option A.dc.html". Fonts (Instrument Sans + JetBrains Mono) are linked in
   base.html.
   ============================================================================ */

/* ----- Design tokens ----------------------------------------------------- */
:root {
  /* Typography */
  --font-ui: 'Instrument Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Text colors */
  --ink: #17171c;        /* primary text, detected field values */
  --ink-2: #2d2d36;      /* form labels, strong values */
  --body: #43434d;       /* body copy, secondary button text */
  --muted: #6b6b76;      /* descriptions, inactive nav */
  --faint: #8a8a94;      /* eyebrows, column headers, meta */
  --faintest: #9b9ba4;   /* placeholders, fine print */
  --empty: #c2c2ca;      /* undetected field em-dashes */

  /* Accent (indigo) */
  --accent: #4f46e5;
  --accent-tint-bg: #eef2ff;     /* badges, selected chips */
  --accent-tint-border: #e0e7ff; /* badge borders */
  --accent-soft-border: #c7d2fe; /* accent-secondary button borders */
  --accent-btn-bg: #fbfbff;      /* accent-secondary button fill */

  /* Surfaces */
  --page-bg: #ebebed;    /* spec page only */
  --app-bg: #f6f6f8;     /* detail/account content wells */
  --panel-bg: #fcfcfd;   /* sidebars, detail header, summary panes */
  --card-border: #e8e8ec;
  --row-rule: #f1f1f4;
  --input-border: #dcdce2;
  --row-hover: #f7f7fa;

  /* Status */
  --success-bg: #e8f5ec; --success-fg: #176b3c;
  --warn-bg: #fdf0dc;    --warn-fg: #8f5e0a;
  --danger-bg: #fdeaea;  --danger-fg: #a13434;
  --destructive: #b3433b;
  --admin-bg: #ececf0;   --admin-fg: #55555f;

  /* Radii */
  --r-card: 12px;
  --r-card-lg: 14px;
  --r-modal: 16px;
  --r-btn: 9px;
  --r-chip: 7px;
  --r-pill: 99px;

  /* Shadows */
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-float: 0 4px 16px rgba(23, 23, 28, 0.06);
  --shadow-modal: 0 20px 60px rgba(23, 23, 28, 0.3);
}

/* ----- Reset / base ------------------------------------------------------ */
* { box-sizing: border-box; }

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

body {
  font-family: var(--font-ui);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
  background: #fff;            /* app pages are white; wells set their own bg */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

input, button, select, textarea { font-family: var(--font-ui); }

input[type=checkbox] { accent-color: var(--accent); margin: 0; }

.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* Eyebrow / column header label */
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ----- App top bar ------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 26px;
  height: 56px;
  padding: 0 22px;
  background: #fff;
  border-bottom: 1px solid var(--card-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: grid;
  place-items: center;
}

.brand-name { font-weight: 700; font-size: 15px; color: var(--ink); }

/* Admin chrome variant: black mark + ADMIN chip */
.topbar--admin .brand-mark { background: var(--ink); }

.admin-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--admin-bg);
  color: var(--admin-fg);
}

.nav-tabs { display: flex; gap: 4px; font-size: 13.5px; }

.nav-tab {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  transition: background 130ms ease, color 130ms ease;
}
.nav-tab:hover { background: var(--row-rule); text-decoration: none; }
.nav-tab.active { background: #f1f1f5; color: var(--ink); font-weight: 600; }

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--r-pill);
  background: #e4e4ec;
  color: var(--admin-fg);
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 700;
}

/* ----- Pills ------------------------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: var(--r-pill);
}
.pill--accent {
  color: var(--accent);
  background: var(--accent-tint-bg);
  border: 1px solid var(--accent-tint-border);
}

/* ----- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: var(--r-btn);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 130ms ease, border-color 130ms ease, color 130ms ease;
}
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #4338ca; }

.btn-secondary { background: #fff; color: var(--body); border-color: var(--input-border); }
.btn-secondary:hover { background: var(--app-bg); }

.btn-accent {
  background: var(--accent-btn-bg);
  color: var(--accent);
  border-color: var(--accent-soft-border);
}
.btn-accent:hover { background: var(--accent-tint-bg); }

.btn--sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn--lg { padding: 13px 22px; font-size: 14px; border-radius: 11px; }
.btn--block { width: 100%; }

/* ----- Inputs ------------------------------------------------------------ */
.input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--input-border);
  border-radius: var(--r-btn);
  font-size: 13.5px;
  color: var(--ink);
  background: #fff;
}
.input::placeholder { color: var(--faintest); }
.input:focus { outline: none; border-color: var(--accent); }
.input--sm { padding: 7px 10px; font-size: 13px; border-radius: 8px; }

.field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 5px;
}

/* ----- Chips ------------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  background: #f1f1f5;
  border: 1px solid #e4e4ea;
  border-radius: var(--r-chip);
  padding: 3px 9px;
  color: var(--admin-fg);
  white-space: nowrap;
}
/* Selectable filter chip (e.g. HTTP-status row) */
.chip--select {
  cursor: pointer;
  background: #fff;
  border-color: var(--input-border);
  color: var(--muted);
  font-weight: 600;
  padding: 4px 10px;
}
.chip--select.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-tint-bg);
}
/* Small mono technology chip in result rows */
.tech-chip {
  font-size: 11px;
  background: #f4f4f6;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 2px 7px;
  color: #51515c;
  white-space: nowrap;
}

/* ----- Status badges ----------------------------------------------------- */
.badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}
.badge--ok     { background: var(--success-bg); color: var(--success-fg); }
.badge--warn   { background: var(--warn-bg);    color: var(--warn-fg); }
.badge--danger { background: var(--danger-bg);  color: var(--danger-fg); }
.badge--muted  { background: var(--admin-bg);   color: var(--admin-fg); }

/* ----- Cards / panels ---------------------------------------------------- */
.card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}
.panel { background: var(--panel-bg); }

/* ----- Table primitives -------------------------------------------------- */
/* Column-header row: 11px uppercase above a 1px card-border rule */
.col-head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--faint);
  border-bottom: 1px solid var(--card-border);
}
/* Data row divider + hover */
.row-rule { border-bottom: 1px solid var(--row-rule); }
.row-click { cursor: pointer; transition: background 130ms ease; }
.row-click:hover { background: var(--row-hover); }

/* ----- Meter (usage / coverage / hit-rate) ------------------------------- */
.meter {
  height: 5px;
  border-radius: var(--r-pill);
  background: #f1f1f5;
  overflow: hidden;
}
.meter > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: var(--r-pill);
}

/* ----- Flash messages ---------------------------------------------------- */
.flash-stack { display: flex; flex-direction: column; gap: 8px; padding: 14px 22px 0; }
.flash {
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--r-btn);
  border: 1px solid var(--card-border);
  background: #fff;
  color: var(--body);
}
.flash--success { background: var(--success-bg); color: var(--success-fg); border-color: transparent; }
.flash--warning { background: var(--warn-bg);    color: var(--warn-fg);    border-color: transparent; }
.flash--danger,
.flash--error   { background: var(--danger-bg);  color: var(--danger-fg);  border-color: transparent; }

/* ----- Main content wrapper --------------------------------------------- */
.app-main { min-width: 0; }

/* ===== Browse ============================================================= */

/* Top-level flex layout: sidebar + main pane, fills below the 56px top bar */
.browse-layout {
  display: flex;
  min-height: calc(100vh - 56px);
}

/* ── Facet sidebar ─────────────────────────────────────────────────────── */
.browse-sidebar {
  width: 262px;
  flex-shrink: 0;
  border-right: 1px solid var(--card-border);
  background: var(--panel-bg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

/* Each filter section stacks eyebrow label + control(s) */
.browse-sidebar__section {
  display: flex;
  flex-direction: column;
}

.browse-sidebar__section .eyebrow {
  margin-bottom: 7px;
}

/* HTTP status chip row */
.http-status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Boolean checkbox facet list */
.facet-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
  color: var(--body);
}

.facet-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

/* Sidebar footer actions */
.browse-sidebar__footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.browse-sidebar__clear {
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}

/* ── Main results pane ──────────────────────────────────────────────────── */
.browse-main {
  flex: 1;
  padding: 18px 24px 22px;
  min-width: 0;
}

/* Headline row: count + active-filter chips + right-aligned buttons */
.browse-headline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.browse-headline__count {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.browse-headline__actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

/* Pagination footer */
.browse-pagination {
  display: flex;
  align-items: center;
  margin-top: 14px;
}

.browse-pagination__label {
  font-size: 12.5px;
  color: var(--faint);
}

/* ── Results table ──────────────────────────────────────────────────────── */
/*
  We keep <table><thead><tbody><tr><td> tags intact (required by
  hx-select="tbody tr"). Layout is achieved with CSS grid on <tr>.

  6-column grid: Domain · Status · Server · Title · Fetch · Technologies
*/
.results-table {
  display: block;
  width: 100%;
}

.results-table thead,
.results-table tbody {
  display: block;
}

/* Shared 6-column grid template */
.results-table thead tr,
.results-table tbody tr.results-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) 60px 100px minmax(220px, 1.7fr) 64px minmax(230px, 1.5fr);
  gap: 12px;
  align-items: center;
  padding: 0 10px;
}

/* Header row */
.results-table thead tr {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--card-border);
}

.results-table thead th {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--faint);
  /* Reset table default */
  text-align: left;
  padding: 0;
}

.results-table thead th a {
  color: var(--faint);
  text-decoration: none;
  white-space: nowrap;
}

.results-table thead th a:hover {
  color: var(--body);
  text-decoration: none;
}

/* Data rows */
.results-table tbody tr.results-row {
  height: 46px;
  border-bottom: 1px solid var(--row-rule);
  cursor: pointer;
  transition: background 130ms ease;
}

.results-table tbody tr.results-row:hover {
  background: var(--row-hover);
}

/* All cells: clip to column width */
.results-table tbody td {
  min-width: 0;
  overflow: hidden;
  padding: 0;
}

/* Domain cell: mono, bold, ellipsis */
.results-table .cell-domain {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* Server cell */
.results-table .cell-server {
  font-size: 12.5px;
  color: #55555f;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* Title cell */
.results-table .cell-title {
  font-size: 13px;
  color: var(--body);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* Fetch time cell */
.results-table .cell-fetch {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
  white-space: nowrap;
}

/* Technologies cell */
.results-table .cell-tech {
  display: flex;
  gap: 5px;
  overflow: hidden;
}

/* Empty value em-dash */
.cell-empty {
  color: var(--empty);
}

.cell-rank {
  color: var(--empty);
  font-size: 0.8em;
  font-weight: 400;
}

/* Empty-state and load-more rows: NOT grid rows */
.results-table tbody tr.results-row--full {
  display: block;
  text-align: center;
  padding: 14px;
}

.results-table tbody tr.results-row--full td {
  display: block;
}

/* ===== /Browse ============================================================ */


/* ===== Domain detail ====================================================== */

/* A) Detail header band */
.detail-header {
  background: var(--panel-bg);
  border-bottom: 1px solid var(--card-border);
  padding: 20px 26px 18px;
}

.detail-breadcrumb {
  font-size: 12px;
  color: var(--faint);
  margin-bottom: 10px;
}
.detail-breadcrumb a {
  color: var(--accent);
  font-weight: 600;
}

.detail-titlerow {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.detail-domain {
  font-family: var(--font-mono);
  font-size: 23px;
  font-weight: 700;
}

.detail-pagetitle {
  font-size: 13px;
  color: var(--muted);
}

.detail-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.detail-meta {
  display: flex;
  gap: 22px;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.detail-meta strong {
  color: var(--ink-2);
  font-weight: 600;
}

/* B) Body: rail + cards */
.detail-body {
  display: flex;
  background: var(--app-bg);
}

/* Group rail (left) */
.group-rail {
  width: 236px;
  flex-shrink: 0;
  border-right: 1px solid var(--card-border);
  background: var(--panel-bg);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 0;
  align-self: flex-start;
}

.group-rail__item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 7px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--body);
  font-weight: 500;
}
.group-rail__item:hover {
  text-decoration: none;
}
.group-rail__item.active {
  background: var(--accent-tint-bg);
  color: var(--accent);
  font-weight: 600;
}

.group-rail__name {
  flex: 1;
  min-width: 0;
}

.group-rail__count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faintest);
}

.group-rail__note {
  margin-top: 14px;
  border-top: 1px solid #ededf1;
  padding-top: 12px;
  font-size: 12px;
  color: var(--faint);
}

/* Field-group cards (right) */
.group-cards {
  flex: 1;
  padding: 20px 26px 26px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.group-card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  scroll-margin-top: 70px;
}
.group-card.hidden-group {
  display: none;
}

.group-card__head {
  display: flex;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--row-rule);
}

.group-card__name {
  font-size: 13.5px;
  font-weight: 700;
}

.group-card__count {
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
}

.group-card__collapse {
  margin-left: auto;
  font-size: 12px;
  color: var(--faint);
  cursor: pointer;
}

/* Field row: 3-column grid */
.field-row {
  display: grid;
  grid-template-columns: 240px 1fr 150px;
  gap: 14px;
  align-items: center;
  padding: 9px 18px;
  border-bottom: 1px solid #f6f6f8;
}

.field-key {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.field-value {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.field-value--empty {
  color: var(--empty);
}

.field-evidence {
  font-size: 11.5px;
  color: var(--faintest);
  text-align: right;
}

/* "Show remaining N groups" link */
.show-remaining {
  align-self: center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}
.show-remaining:hover {
  text-decoration: none;
}

/* C) De-emphasized provenance + raw blobs */
.aux-card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
}

.aux-card__head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 12px 18px;
  border-bottom: 1px solid var(--row-rule);
}

.field-row--aux {
  grid-template-columns: 240px 1fr;
}

.aux-blob {
  margin: 0;
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--body);
  max-height: 400px;
  overflow: auto;
  white-space: pre;
}

/* ===== /Domain detail ===================================================== */

/* ===== Auth screens (handoff screen 02) ================================== */
/* Centered card on the app-bg well, filling the area under the 56px top bar. */
.auth-wrap {
  background: var(--app-bg);
  min-height: calc(100vh - 56px);
  display: grid;
  place-items: center;
  padding: 40px 22px;
}

.auth-card-outer {
  width: 100%;
  max-width: 360px;
}

.auth-card {
  width: 100%;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 28px 28px 24px;
  box-shadow: var(--shadow-float);
}

.auth-card--center { text-align: center; }

/* Brand mark: 30x30 rounded square with "D". */
.auth-brand {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
}

.auth-title {
  font-size: 19px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 5px;
}
.auth-title--gap { margin-bottom: 22px; }   /* login: no subcopy under title */
.auth-title--sm { font-size: 17px; }
.auth-title--left { text-align: left; }

.auth-subcopy {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 22px;
  line-height: 1.5;
}
.auth-subcopy--left { text-align: left; margin-bottom: 18px; }

/* OAuth buttons + "or" divider. */
.auth-oauth {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.auth-oauth__btn {
  border: 1px solid var(--input-border);
  border-radius: 9px;
  padding: 9px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
}
.auth-oauth__btn:hover { background: var(--app-bg); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.auth-divider__line { flex: 1; height: 1px; background: var(--card-border); }
.auth-divider__or { font-size: 11.5px; color: var(--faintest); }

.auth-field { margin-bottom: 13px; }
.auth-field:last-of-type { margin-bottom: 20px; }

.auth-label-row { display: flex; align-items: baseline; margin-bottom: 5px; }
.auth-label-row .field-label { margin-bottom: 0; }
.auth-forgot {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.auth-error {
  color: var(--danger-fg);
  font-size: 12.5px;
  margin: -8px 0 12px;
}

.auth-terms {
  font-size: 11.5px;
  color: var(--faintest);
  text-align: center;
  margin-top: 14px;
  line-height: 1.5;
}

.auth-altline {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 16px;
}
.auth-altline a { font-weight: 600; }

.auth-back { margin-top: 14px; text-align: center; }
.auth-back a { font-size: 12.5px; color: var(--accent); font-weight: 600; }

/* Reset-sent: green check circle. */
.auth-check {
  width: 38px;
  height: 38px;
  border-radius: 99px;
  background: var(--success-bg);
  color: var(--success-fg);
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 700;
  margin: 0 auto 14px;
}
.auth-strong { color: var(--ink-2); }
.auth-resend { font-size: 12.5px; color: var(--faint); margin-top: 16px; }
.auth-resend a { font-weight: 600; }

/* ===== /Auth screens ===================================================== */

/* ===== Account (handoff screen 05) ====================================== */
/* Content well below the 56px top bar. Two-column grid: 340px profile/plan
   rail + fluid usage/keys column. Values verbatim from Option A.dc.html.
   Only #ededf1 and #f4f4f6 are hardcoded (per spec); the rest are tokens. */
.account-well {
  background: var(--app-bg);
  padding: 26px;
  min-height: calc(100vh - 56px);
}

.account-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 18px;
  align-items: start;
}

.account-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.account-card { padding: 20px; }

/* Section titles shared across cards */
.account-section-title { font-size: 13.5px; font-weight: 700; }

/* ── Profile card ──────────────────────────────────────────────────────── */
.account-profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.account-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--r-pill);
  background: #e4e4ec;
  color: var(--admin-fg);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
}

.account-name { font-size: 14.5px; font-weight: 700; }
.account-email { font-size: 12.5px; color: var(--faint); }

.account-facts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
}

.account-fact { display: flex; }
.account-fact__label { color: var(--faint); }
.account-fact__value { margin-left: auto; color: var(--ink-2); font-weight: 600; }

.account-edit { margin-top: 18px; }

.account-signout {
  margin-top: 12px;
  text-align: center;
}
.account-signout__btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.account-signout__btn:hover { color: var(--ink-2); text-decoration: underline; }

/* ── Plan card ─────────────────────────────────────────────────────────── */
.account-plan-head {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}
.account-plan-pill {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
}
.account-plan-body {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

/* ── Usage card ────────────────────────────────────────────────────────── */
.account-usage-head {
  display: flex;
  align-items: baseline;
  margin-bottom: 14px;
}
.account-resets {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
}

.account-usage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

.account-tile {
  border: 1px solid #ededf1;
  border-radius: 10px;
  padding: 14px;
}
.account-tile__label { font-size: 12px; color: var(--faint); margin-bottom: 6px; }
.account-tile__count { font-size: 22px; font-weight: 700; }
.account-tile__meter { margin-top: 10px; }
.account-tile__caption { font-size: 11.5px; color: var(--faintest); margin-top: 6px; }

/* ── API keys card ─────────────────────────────────────────────────────── */
.account-keys-head {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}
.account-newkey { margin-left: auto; }

/* Show-once banner for a freshly created key */
.account-newkey-banner {
  border: 1px solid var(--accent-tint-border);
  background: var(--accent-tint-bg);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
}
.account-newkey-banner__title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}
.account-newkey-banner__key {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  word-break: break-all;
  background: #fff;
  border: 1px solid var(--accent-tint-border);
  border-radius: 7px;
  padding: 8px 10px;
}
.account-newkey-banner__note {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.5;
}

/* Column header + rows share a 5-column grid */
.account-keys-colhead,
.account-keys-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr 110px 110px 60px;
  gap: 12px;
  align-items: center;
  padding: 0 10px;
}
.account-keys-colhead {
  padding: 0 10px 8px;
}
.account-keys-row {
  height: 44px;
  border-bottom: 1px solid #f4f4f6;
  font-size: 13px;
}

.account-keys-name { font-weight: 600; }
.account-keys-key {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.account-keys-created,
.account-keys-used { color: var(--faint); font-size: 12.5px; }

.account-keys-revoke { text-align: right; }
.account-keys-revoke__btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--destructive);
}
.account-keys-revoke__btn:hover { text-decoration: underline; }

.account-keys-empty {
  padding: 16px 10px;
  font-size: 13px;
  color: var(--faint);
  border-bottom: 1px solid #f4f4f6;
}

.account-keys-footnote {
  font-size: 12px;
  color: var(--faintest);
  margin-top: 12px;
}

/* ===== /Account ========================================================== */

/* ===== Tiering locks (Step 7) ============================================ */
/* Dormant when TIERING_ENABLED is off — nothing below renders unless a
   template emits .tier-* / .facet-group--locked markup, which is gated on
   `tiering_enabled and not user_is_pro(...)`. */

/* Inline PRO chip on locked buttons. Never disabled/grayed — the button still
   reads as active and clicking opens the upgrade modal. */
.tier-pro-chip {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-tint-bg);
  border: 1px solid var(--accent-tint-border);
  border-radius: 5px;
  padding: 1px 5px;
  margin-left: 6px;
}

.tier-locked-btn { cursor: pointer; }

/* Locked (non-core) facet group: dashed border + muted options + upgrade link. */
.facet-group--locked {
  border: 1px dashed #d4d4dc;
  border-radius: 10px;
  padding: 12px 12px 10px;
}
.facet-group--locked .facet-list label { color: var(--faint); }
.facet-group--locked .facet-list input { cursor: not-allowed; }

.facet-group__upgrade {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}
.facet-group__upgrade:hover { text-decoration: underline; }
/* ===== /Tiering locks ==================================================== */
