/*
 * Dashboard skin + motion (index.html only; the public form keeps styles.css).
 * Design language: DESIGN.md (racing-editorial: near-black canvas, one red
 * accent used scarcely, sharp 0px corners, uppercase tracked labels,
 * brightness-step depth instead of shadows). RTS keeps its own mark and name.
 * fx.js feeds the cursor variables: --gx/--gy on :root, --mx/--my/--spot on
 * hovered surfaces, --tx/--ty on tilting cards and magnetic buttons.
 */
@property --spot {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}

:root {
  --bg: #181818;
  --panel: #1d1d1d;
  --panel2: #242424;
  --line: #303030;
  --muted: #969696;
  --faint: #666666;
  --text: #ffffff;
  --red: #da291c;
  --red-press: #b01e0a;
  --redsoft: #2a1513;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gx: 50vw;
  --gy: -20vh;
  font-family: "Inter", -apple-system, system-ui, sans-serif;
}
body {
  background: var(--bg);
}

/* ── type ─────────────────────────────────────────────────────────────── */
h1,
h2,
h3,
.number {
  font-family: "Inter", -apple-system, system-ui, sans-serif;
}
h1 {
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.36px;
}
h2,
h3 {
  font-weight: 500;
  letter-spacing: 0;
}
.panel-head h2 {
  font-size: 16px;
  font-weight: 600;
}
.eyebrow,
.nav-label,
.metric-label,
th {
  text-transform: uppercase;
  letter-spacing: 1.1px;
  font-size: 11px;
  font-weight: 600;
}
.number {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -1.2px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.number span {
  font-family: inherit;
}

/* ── sharp geometry ───────────────────────────────────────────────────── */
.panel,
.metrics,
.nav-item,
.secondary,
.primary,
.subtle,
.banner,
.board-col,
.deal,
.qa-card,
.slot,
.toast,
dialog,
.search-open,
.tabs,
.tabs button,
.calendar-day,
.expense-category {
  border-radius: 0 !important;
}
input,
select,
textarea {
  border-radius: 4px;
}
.pill {
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  font-size: 10px;
  font-weight: 600;
}

/* ── buttons: uppercase, tracked, magnetic, red sheen ─────────────────── */
.secondary,
.primary,
.subtle {
  text-transform: uppercase;
  letter-spacing: 1.4px;
  font-size: 12px;
  font-weight: 700;
  min-height: 42px;
  padding: 10px 22px;
  position: relative;
  overflow: hidden;
  transform: translate(var(--tx, 0px), var(--ty, 0px));
  transition:
    transform 0.35s var(--ease),
    background 0.2s,
    border-color 0.2s,
    color 0.2s;
}
.secondary {
  background: transparent;
  border-color: #4a4a4a;
}
.secondary:hover {
  background: transparent;
  border-color: #fff;
}
.primary {
  background: var(--red);
  border-color: var(--red);
}
.primary:hover {
  background: linear-gradient(180deg, #a00c01, var(--red) 64%);
}
.primary:active {
  background: var(--red-press);
}
.primary::after,
.secondary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.22) 50%, transparent 65%);
  transform: translateX(-120%);
  pointer-events: none;
}
.primary:hover::after,
.secondary:hover::after {
  transform: translateX(120%);
  transition: transform 0.7s var(--ease);
}
.text-btn {
  transition: color 0.2s;
}
.text-btn:hover {
  color: #fff;
}
.search-open {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  min-height: 34px;
  padding: 6px 12px;
}
.demo-tag {
  border-radius: 9999px;
  letter-spacing: 1.1px;
}

/* ── sidebar nav: red rule slides in, cursor light ─────────────────────── */
.sidebar {
  background: #141414;
}
.nav-item {
  position: relative;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  overflow: hidden;
  background: radial-gradient(160px circle at var(--mx, -200px) var(--my, 50%), rgba(255, 255, 255, calc(var(--spot) * 0.07)), transparent 70%);
  transition:
    color 0.2s,
    --spot 0.3s,
    padding-left 0.3s var(--ease);
}
.nav-item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--red);
  transform: scaleY(0);
  transform-origin: 50% 50%;
  transition: transform 0.35s var(--ease);
}
.nav-item:hover {
  color: #fff;
  background: radial-gradient(160px circle at var(--mx, -200px) var(--my, 50%), rgba(255, 255, 255, calc(var(--spot) * 0.07)), transparent 70%);
  padding-left: 17px;
}
.nav-item:hover::before {
  transform: scaleY(0.5);
}
.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(218, 41, 28, 0.16), transparent 85%);
  box-shadow: none;
}
.nav-item.active::before {
  transform: scaleY(1);
}
.nav-item.active svg {
  color: var(--red);
}
.brand-mark {
  transition: transform 0.6s var(--ease), color 0.3s;
}
.brand:hover .brand-mark {
  transform: rotate(120deg);
}

/* ── surfaces: cursor spotlight + light-tracing border ─────────────────── */
.panel,
.metric,
.board-col,
.deal,
.qa-card,
.slot,
.attention-item,
.calendar-day,
.expense-category {
  position: relative;
  transition: --spot 0.35s var(--ease), background-color 0.25s;
}
.panel {
  background:
    radial-gradient(520px circle at var(--mx, 50%) var(--my, -300px), rgba(218, 41, 28, calc(var(--spot) * 0.07)), transparent 60%),
    var(--panel);
}
.metrics {
  background: var(--panel);
}
.metric {
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, -300px), rgba(218, 41, 28, calc(var(--spot) * 0.12)), transparent 65%);
}
.deal,
.qa-card,
.slot,
.calendar-day,
.expense-category,
.attention-item {
  background-image: radial-gradient(240px circle at var(--mx, 50%) var(--my, -300px), rgba(218, 41, 28, calc(var(--spot) * 0.1)), transparent 65%);
}
.panel::after,
.metric::after,
.deal::after,
.qa-card::after,
.board-col::after {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, -300px), rgba(218, 41, 28, 0.85), transparent 60%);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: var(--spot);
  pointer-events: none;
  transition: --spot 0.35s var(--ease);
}
.fx-hot {
  --spot: 1;
}

/* metric number drifts toward the cursor */
.metric .number {
  display: inline-block;
  transform: translate(var(--tx, 0px), var(--ty, 0px));
  transition: transform 0.45s var(--ease);
}

/* cards tilt toward the cursor */
.deal,
.qa-card {
  transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px));
  transition:
    transform 0.4s var(--ease),
    --spot 0.35s var(--ease),
    border-color 0.2s;
  will-change: transform;
}
.deal.fx-hot,
.qa-card.fx-hot {
  --lift: -2px;
  border-color: #4a4a4a;
}

/* table rows: red rule slides in from the left */
tbody tr {
  position: relative;
  transition: background-color 0.2s;
}
tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.025);
}
tbody tr td:first-child {
  box-shadow: inset 0 0 0 var(--red);
  transition: box-shadow 0.3s var(--ease);
}
tbody tr:hover td:first-child {
  box-shadow: inset 2px 0 0 var(--red);
}

/* ── ambient light that follows the cursor across the page ────────────── */
.main-shell {
  background: radial-gradient(900px circle at var(--gx) var(--gy), rgba(218, 41, 28, 0.06), transparent 60%) fixed;
}

/* ── racing stripe on page change ─────────────────────────────────────── */
.fx-stripe {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, transparent, var(--red) 30%, #ff5a4c 50%, var(--red) 70%, transparent);
  transform: translateX(-100%);
  z-index: 100;
  pointer-events: none;
}
.fx-stripe.run {
  animation: fx-stripe 0.9s var(--ease) forwards;
}
@keyframes fx-stripe {
  0% {
    transform: translateX(-100%);
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  100% {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* ── page entrance: header, metrics and panels rise in sequence ────────── */
.fx-enter .page-head,
.fx-enter .metric,
.fx-enter .panel,
.fx-enter .board-col,
.fx-enter .banner {
  animation: fx-rise 0.6s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 55ms);
}
@keyframes fx-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.fx-enter .page-head h1 {
  animation: fx-wipe 0.8s var(--ease) both;
}
@keyframes fx-wipe {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

/* toast slides up */
.toast {
  border-left: 2px solid var(--red);
}

/* ── touch screens and reduced motion: keep the skin, drop the motion ──── */
@media (hover: none), (pointer: coarse) {
  .deal,
  .qa-card,
  .metric .number,
  .secondary,
  .primary,
  .subtle {
    transform: none;
  }
  .nav-item:hover {
    padding-left: 13px;
  }
}
@media (max-width: 700px) {
  h1 {
    font-size: 28px;
  }
  .number {
    font-size: 30px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .fx-enter *,
  .fx-stripe {
    animation: none !important;
  }
  .deal,
  .qa-card,
  .metric .number,
  .secondary,
  .primary,
  .subtle {
    transform: none !important;
  }
  .primary::after,
  .secondary::after {
    display: none;
  }
}

/* ── client ranking: a timing tower ───────────────────────────────────── */
.race {
  container-type: inline-size;
  border-top: 1px solid var(--line);
}
.race-head,
.race-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 2.2fr) 112px minmax(150px, 1.5fr) 118px 92px 52px;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
}
.race-head {
  padding-block: 10px;
  background: #141414;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}
.race-row {
  position: relative;
  padding-block: 14px;
  border-bottom: 1px solid #262626;
  background-image: radial-gradient(320px circle at var(--mx, 50%) var(--my, -300px), rgba(218, 41, 28, calc(var(--spot) * 0.09)), transparent 65%);
  transition: --spot 0.35s var(--ease), background-color 0.2s;
}
.race-row:last-child {
  border-bottom: 0;
}
.race-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--red);
  transform: scaleY(0);
  transition: transform 0.35s var(--ease);
}
.race-row:hover::before,
.race-row.p1::before {
  transform: scaleY(1);
}
.race-row.p1 {
  background-color: rgba(218, 41, 28, 0.06);
}
.race-pos {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -1.2px;
  line-height: 1;
  color: #5c5c5c;
  font-variant-numeric: tabular-nums;
}
.race-pos small {
  font-size: 12px;
  letter-spacing: 0;
  margin-right: 1px;
  font-weight: 600;
}
.race-row.p1 .race-pos {
  color: var(--red);
}
.race-row.p2 .race-pos,
.race-row.p3 .race-pos {
  color: #fff;
}
.race-who {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.race-who > span:last-child {
  min-width: 0;
}
.race-who strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.race-who small {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.race-who:hover strong {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-underline-offset: 4px;
}
.race-face {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #2a2a2a;
  color: #d8d8d8;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px #3a3a3a;
  transition: box-shadow 0.3s var(--ease), transform 0.4s var(--ease);
}
.race-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.race-row.p1 .race-face {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--red);
}
.race-row:hover .race-face {
  transform: scale(1.06);
}
.race-face.large {
  width: 88px;
  height: 88px;
  font-size: 24px;
}
.race-amount {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.race-amount strong {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.race-amount small,
.race-since small,
.race-steps small {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.race-bar {
  display: block;
  height: 4px;
  margin-top: 8px;
  background: #2a2a2a;
  overflow: hidden;
}
.race-bar b {
  display: block;
  height: 100%;
  width: var(--w, 0%);
  background: linear-gradient(90deg, #a00c01, var(--red));
  transform-origin: left;
  animation: race-bar 0.9s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}
.by-newest .race-bar b {
  background: #5a5a5a;
}
@keyframes race-bar {
  from {
    transform: scaleX(0);
  }
}
.race-since strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #d8d8d8;
}
.by-newest .race-since strong {
  color: #fff;
}
.race-new {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  background: var(--red);
  padding: 1px 6px;
  border-radius: 9999px;
  margin-right: 4px;
}
.race-steps {
  display: flex;
  align-items: center;
  gap: 3px;
}
.race-steps i {
  width: 7px;
  height: 16px;
  background: #333;
}
.race-steps i.on {
  background: #e8e8e8;
}
.race-steps small {
  margin-left: 6px;
}
.race-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.race-sort button {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}
.toolbar .race-sort {
  flex-shrink: 0;
}

/* rows slide into their new places when the ranking changes */
.fx-shuffle .race-row {
  animation: fx-rise 0.5s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
.fx-enter .race-row {
  animation: fx-rise 0.6s var(--ease) both;
  animation-delay: calc(200ms + var(--i, 0) * 55ms);
}

/* narrow panels (Overview) and tablets: drop stage and setup */
@container (max-width: 780px) {
  .race-head,
  .race-row {
    grid-template-columns: 46px minmax(0, 1.6fr) minmax(118px, 1fr) 128px 44px;
    gap: 12px;
    padding-inline: 18px;
  }
  .race-stage,
  .race-steps,
  .race-head span:nth-child(3),
  .race-head span:nth-child(6) {
    display: none;
  }
  .race-pos {
    font-size: 26px;
  }
}
/* phones: position and client on top, value and date underneath */
@container (max-width: 520px) {
  .race-head {
    display: none;
  }
  .race-row {
    grid-template-columns: 40px minmax(0, 1fr) 112px;
    grid-template-areas:
      "pos who who"
      "pos worth since";
    row-gap: 10px;
    padding-inline: 14px;
  }
  .race-pos {
    grid-area: pos;
    align-self: start;
    padding-top: 8px;
  }
  .race-who {
    grid-area: who;
  }
  .race-worth {
    grid-area: worth;
  }
  .race-since {
    grid-area: since;
    text-align: right;
  }
  /* the name opens the client; no separate Open button on phones */
  .race-row > span:last-child {
    display: none;
  }
}

/* client detail: photo and value */
.client-hero {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
}
.client-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.client-photo-actions label {
  cursor: pointer;
}
.client-photo-actions:has(input:focus-visible) label {
  outline: 2px solid var(--red);
  outline-offset: 4px;
}
.client-meta {
  margin-bottom: 8px;
}
@media (prefers-reduced-motion: reduce) {
  .race-bar b,
  .fx-shuffle .race-row,
  .fx-enter .race-row {
    animation: none !important;
  }
}

/* ── Team Alerts ──────────────────────────────────────────────────────── */
#main:has(.alerts-shell),
#main:has(.docs-shell) {
  container-type: inline-size;
}
.alerts-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 20px;
  align-items: start;
}
.alert-side {
  display: grid;
  gap: 20px;
}
.alert-templates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.tpl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
  border-radius: 0;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.tpl:hover {
  border-color: var(--red);
  transform: translateY(-1px);
}
.lv-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d2d2d2;
}
.lv-dot.lv-heads { background: #f2b636; }
.lv-dot.lv-urgent { background: var(--red); }
.lv-dot.lv-win { background: #2e9e5b; }
.level-pick {
  border: 0;
  padding: 0;
  margin: 0;
}
.level-pick legend {
  font-size: 13px;
  color: #bcb9c7;
  margin-bottom: 8px;
}
.level-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
}
.level-opt {
  position: relative;
  cursor: pointer;
}
.level-opt input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}
.level-opt span {
  display: block;
  text-align: center;
  padding: 11px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--muted);
  border-left: 1px solid var(--line);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.level-opt:first-child span { border-left: 0; }
.level-opt input:checked + span { color: #fff; background: #3a3a3a; }
.level-opt.lv-heads input:checked + span { background: #5a4513; }
.level-opt.lv-urgent input:checked + span { background: var(--red); }
.level-opt.lv-win input:checked + span { background: #1d5a37; }
.level-opt input:focus-visible + span { outline: 2px solid var(--red); outline-offset: -2px; }
.alert-more summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}
.alert-more .check-line { align-items: flex-start; }
.dest-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #bcb9c7;
  margin-bottom: 10px;
}
.dest-group + .dest-group { margin-top: 14px; }
.dest-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.dest-label svg,
.prev-label svg,
.dest-ic svg {
  width: 14px;
  height: 14px;
}
.dest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dest-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  background: var(--panel2);
  cursor: pointer;
  font-size: 13px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.dest-chip input { width: 15px; height: 15px; accent-color: var(--red); }
.dest-chip small { color: var(--faint); font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px; }
.dest-chip:has(input:checked) { border-color: var(--red); background: var(--redsoft); }
.dest-chip.warn { border-style: dashed; }
.alert-send .primary { width: 100%; justify-content: center; padding: 15px; }
.alert-send .primary:disabled { opacity: 0.55; cursor: not-allowed; }

/* previews */
#alert-preview {
  display: grid;
  gap: 16px;
}
.prev-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.alert-prev.tg {
  background: #0e1621;
  padding: 14px;
}
.tg-bubble {
  position: relative;
  max-width: 92%;
  background: #182533;
  color: #f5f5f5;
  padding: 9px 12px 20px;
  border-radius: 12px 12px 12px 4px;
  font-size: 13.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.tg-text { margin-top: 6px; }
.tg-time { position: absolute; right: 10px; bottom: 4px; font-size: 10px; color: #6d7f8f; }
.tg-btn {
  max-width: 92%;
  margin-top: 4px;
  text-align: center;
  padding: 8px;
  background: #1f2f3f;
  color: #8ccbff;
  border-radius: 8px;
  font-size: 13px;
}
.alert-prev.dc {
  background: #313338;
  padding: 14px;
}
.dc-msg {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  color: #dbdee1;
  font-size: 13.5px;
}
.dc-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #181818;
  color: var(--red);
  display: grid;
  place-items: center;
  font-size: 16px;
}
.dc-name { font-weight: 600; color: #fff; }
.dc-name span { font-size: 9px; background: #5865f2; color: #fff; padding: 1px 4px; border-radius: 3px; margin-left: 4px; vertical-align: 2px; }
.dc-ping { color: #c9cdfb; background: rgba(88, 101, 242, 0.3); display: inline-block; padding: 0 3px; border-radius: 3px; margin: 2px 0; }
.dc-embed {
  margin-top: 6px;
  background: #2b2d31;
  border-left: 4px solid #d2d2d2;
  border-radius: 4px;
  padding: 10px 14px;
  overflow-wrap: anywhere;
}
.dc-embed.lv-heads { border-left-color: #f2b636; }
.dc-embed.lv-urgent { border-left-color: var(--red); }
.dc-embed.lv-win { border-left-color: #2e9e5b; }
.dc-title { font-weight: 700; color: #fff; margin-bottom: 6px; }
.dc-text { line-height: 1.45; }
.dc-foot { margin-top: 8px; font-size: 11px; color: #949ba4; }

.dest-list { display: grid; }
.dest-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.dest-row:first-child { border-top: 0; }
.dest-row small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; overflow-wrap: anywhere; }
.dest-ic { width: 30px; height: 30px; display: grid; place-items: center; background: var(--panel2); }
.dest-ic.telegram { color: #2aabee; }
.dest-ic.discord { color: #8c96ff; }
.howto { margin: 0; padding-left: 18px; display: grid; gap: 10px; font-size: 13px; color: #cfcfcf; line-height: 1.5; }
.howto code { background: var(--panel2); padding: 1px 5px; }
.alert-history { display: grid; }
.hist-row {
  display: grid;
  grid-template-columns: 150px 92px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.hist-row:first-child { border-top: 0; }
.hist-row time { color: var(--muted); font-size: 12px; }
.hist-row small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.confirm-list { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; }

@container (max-width: 980px) {
  .alerts-shell { grid-template-columns: minmax(0, 1fr); }
}
@container (max-width: 600px) {
  .level-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .level-opt:nth-child(3) span { border-left: 0; }
  .level-opt:nth-child(n + 3) span { border-top: 1px solid var(--line); }
  .hist-row { grid-template-columns: minmax(0, 1fr) auto; }
  .hist-row time { grid-column: 1 / -1; }
  .hist-row .pill { justify-self: start; }
  #alert-form .form-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ── Documents ────────────────────────────────────────────────────────── */
.alert-banner { justify-content: space-between; flex-wrap: wrap; }
.docs-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}
/* document types: a strip of cards across the top */
.doc-rail {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 3fr 4fr;
  gap: 20px;
}
.doc-group-label {
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px 2px;
}
.doc-group { display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-content: start; }
.doc-group-label { grid-column: 1 / -1; }
.doc-pick {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  text-align: left;
  padding: 11px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid transparent;
  color: var(--text);
  border-radius: 0;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}
.doc-pick:hover { background: var(--panel2); transform: translateX(2px); }
.doc-pick.active { border-left-color: var(--red); background: var(--panel2); }
.doc-pick strong { display: block; font-size: 13px; font-weight: 600; }
.doc-pick small { display: block; font-size: 11px; color: var(--muted); line-height: 1.35; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.doc-code {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--red);
  border: 1px solid var(--line);
  height: 26px;
  display: grid;
  place-items: center;
  align-self: start;
}
.doc-next { text-align: right; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.doc-next strong { font-size: 13px; letter-spacing: 0.3px; color: var(--text); text-transform: none; }
.doc-form { margin-top: 4px; }
.doc-fill select { border-color: var(--red); }
.input-unit { position: relative; display: block; }
.input-unit .unit { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); font-size: 13px; pointer-events: none; }
.input-unit .unit.r { left: auto; right: 12px; }
.input-unit:has(.unit:not(.r)) input { padding-left: 26px; }
.doc-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.doc-legal { margin: 18px 0 0; font-size: 11px; color: var(--faint); line-height: 1.5; }
.doc-preview {
  position: sticky;
  top: 16px;
}
.doc-preview-head {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
#doc-paper {
  container-type: inline-size; /* cqi = the sheet's width, so 100cqi is 210 mm */
  max-height: calc(100vh - 120px);
  overflow: auto;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9);
}

/* the paper: sizes in cqi so the page scales like the PDF */
.doc-paper {
  background: #fff;
  color: #181818;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 1.62cqi;
  line-height: 1.5;
  min-height: calc(100cqi * 297 / 210);
  display: flex;
  flex-direction: column;
  position: relative;
}
/* A4 page edges every 297 mm, like the PDF's pages */
.doc-paper::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to top, rgba(218, 41, 28, 0.45) 1px, transparent 1px) 0 0 / 100% calc(100cqi * 297 / 210);
}
.doc-band {
  background: #181818;
  border-bottom: 0.45cqi solid var(--red);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4.6cqi 8.6cqi;
}
.doc-brand { display: flex; align-items: center; gap: 1.6cqi; font-weight: 700; letter-spacing: 0.4cqi; font-size: 1.55cqi; text-transform: uppercase; }
.doc-brand i { width: 3.4cqi; height: 3cqi; background: var(--red); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.doc-kind { font-size: 2.6cqi; }
.doc-meta { display: flex; justify-content: space-between; gap: 4cqi; padding: 5cqi 8.6cqi 2.6cqi; }
.doc-meta small { display: block; font-size: 1.1cqi; letter-spacing: 0.35cqi; text-transform: uppercase; color: #6e6e6e; font-weight: 700; margin-bottom: 0.8cqi; }
.doc-to strong { font-size: 1.95cqi; }
.doc-to div { font-size: 1.55cqi; }
.doc-ref { text-align: right; }
.doc-ref strong { font-size: 1.75cqi; }
.doc-ref div { color: #6e6e6e; font-size: 1.55cqi; }
.doc-facts {
  margin: 0 8.6cqi 3cqi;
  background: #f6f6f6;
  border-left: 0.6cqi solid var(--red);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14cqi, 1fr));
  gap: 1.8cqi 2.4cqi;
  padding: 2.4cqi 2.6cqi;
}
.doc-facts dt { font-size: 1.05cqi; letter-spacing: 0.3cqi; text-transform: uppercase; color: #6e6e6e; font-weight: 700; }
.doc-facts dd { margin: 0.4cqi 0 0; font-weight: 700; font-size: 1.5cqi; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-body { padding: 0 8.6cqi; flex: 1; }
.doc-body h3 {
  font-family: inherit;
  font-size: 1.45cqi;
  font-weight: 700;
  letter-spacing: 0.45cqi;
  text-transform: uppercase;
  margin: 3.4cqi 0 1.2cqi;
  color: #181818;
}
.doc-body h3 span { color: var(--red); margin-right: 1.6cqi; letter-spacing: 0; }
.doc-body h3 span:empty { display: none; }
.doc-body p { margin: 0 0 1.2cqi; color: #181818; line-height: 1.5; }
.doc-body ul { margin: 0 0 1.4cqi; padding: 0; list-style: none; display: grid; gap: 0.5cqi; }
.doc-body li { position: relative; padding-left: 3cqi; }
.doc-body li::before { content: ""; position: absolute; left: 0.3cqi; top: 0.75em; width: 0.8cqi; height: 0.8cqi; background: var(--red); }
/* the paper is not a dashboard table: undo the global td/th/tr styles */
.doc-body table { width: 100%; border-collapse: collapse; margin: 1cqi 0 2cqi; font-size: 1.5cqi; white-space: normal; }
.doc-body th { background: #181818; color: #fff; text-align: left; font-size: 1.2cqi; font-weight: 700; letter-spacing: 0.1cqi; padding: 1.2cqi 1.4cqi; border: 0; }
.doc-body td { padding: 1.2cqi 1.4cqi; border: 0; color: #181818; font-size: 1.5cqi; box-shadow: none !important; }
.doc-body tbody tr:hover { background: none; }
.doc-body tbody tr:nth-child(even) td { background: #f6f6f6; }
.doc-body tfoot td { color: #6e6e6e; text-align: right; padding: 0.8cqi 1.4cqi; }
.doc-body tfoot td.r { color: #181818; font-weight: 700; width: 28%; }
.doc-body tfoot tr:first-child td { border-top: 1px solid #dedede; }
.doc-body .r { text-align: right; }
.doc-total {
  margin: 1cqi 0 3cqi auto;
  width: 48%;
  background: #181818;
  border-left: 0.7cqi solid var(--red);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2cqi 2.4cqi;
}
.doc-total span { font-size: 1.2cqi; letter-spacing: 0.35cqi; text-transform: uppercase; font-weight: 700; color: #c8c8c8; }
.doc-total strong { font-size: 2.6cqi; }
.doc-note { color: #6e6e6e; font-style: italic; font-size: 1.35cqi; }
.doc-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 6cqi; padding: 3cqi 8.6cqi 4cqi; }
.doc-sign small { display: block; font-size: 1.1cqi; letter-spacing: 0.3cqi; text-transform: uppercase; color: #6e6e6e; font-weight: 700; }
.doc-sign .line { border-bottom: 1px solid #181818; height: 7cqi; margin-bottom: 1.4cqi; }
.doc-sign strong { display: block; font-size: 1.6cqi; }
.doc-sign span { display: block; color: #6e6e6e; font-size: 1.4cqi; }
.doc-foot {
  display: flex;
  justify-content: space-between;
  margin: 2cqi 8.6cqi 0;
  padding: 1.6cqi 0 2.6cqi;
  border-top: 1px solid #dedede;
  color: #6e6e6e;
  font-size: 1.2cqi;
}
.doc-history { display: grid; }
.doc-hist-row {
  display: grid;
  grid-template-columns: 44px 190px minmax(120px, 0.8fr) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.doc-hist-row:first-child { border-top: 0; }
.doc-hist-row .doc-code { align-self: center; }
.doc-hist-row time { font-size: 12px; white-space: nowrap; }

@container (max-width: 1100px) {
  .doc-rail { grid-template-columns: minmax(0, 1fr); }
}
@container (max-width: 900px) {
  .docs-shell { grid-template-columns: minmax(0, 1fr); }
  .doc-preview { position: static; }
  #doc-paper { max-height: none; max-width: 760px; margin: 0 auto; }
}
@container (max-width: 760px) {
  .doc-rail { display: flex; overflow-x: auto; gap: 14px; padding-bottom: 6px; scroll-snap-type: x proximity; }
  .doc-group { display: flex; gap: 6px; }
  .doc-group-label { display: none; }
  .doc-pick { flex: 0 0 200px; scroll-snap-align: start; }
  .doc-form { grid-template-columns: minmax(0, 1fr); }
  .doc-hist-row { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .doc-hist-row > span:nth-of-type(2), .doc-hist-row > span:nth-of-type(3) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tpl, .doc-pick { transition: none; }
}

/* ── Recruiting: hiring funnel, health cards, source / gender bars ────── */
#main:has(.funnel) { container-type: inline-size; }
.panel:has(.funnel) { margin-bottom: 20px; }
.funnel {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border: 1px solid var(--line);
}
.fstep {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 16px 18px 18px;
  border-left: 1px solid var(--line);
}
.fstep:first-child { border-left: 0; }
/* chevron between steps */
.fstep + .fstep::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 22px;
  width: 12px;
  height: 12px;
  background: var(--panel);
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  transform: rotate(45deg);
}
.fstep-label { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.fstep-n { font-size: 34px; font-weight: 600; line-height: 1.05; font-variant-numeric: tabular-nums; }
.fstep-bar { height: 4px; background: var(--panel2); overflow: hidden; }
.fstep-bar b { display: block; height: 100%; width: var(--w); background: #e8e8e8; transition: width 0.8s var(--ease); }
.fstep:last-child .fstep-bar b { background: #2e9e5b; }
.fstep-conv { font-size: 12px; color: var(--muted); }
.fstep.worst { background: var(--redsoft); }
.fstep.worst .fstep-conv { color: #ff8a80; font-weight: 600; }
.fstep.worst .fstep-bar b { background: var(--red); }
.funnel-note { margin: 10px 0 0; font-size: 11px; color: var(--faint); }

.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.hcard {
  border: 1px solid var(--line);
  border-top: 3px solid var(--faint);
  background: var(--panel2);
  padding: 14px 16px 14px;
  display: grid;
  gap: 10px;
  align-content: start;
}
.hcard.s-ok { border-top-color: #2e9e5b; }
.hcard.s-low, .hcard.s-high { border-top-color: var(--red); }
.hcard-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.hcard-label { font-size: 13px; font-weight: 600; line-height: 1.3; }
.hchip {
  flex: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 3px 7px;
  background: #333;
  color: var(--muted);
  white-space: nowrap;
}
.s-ok .hchip { background: rgba(46, 158, 91, 0.18); color: #6fd39a; }
.s-low .hchip, .s-high .hchip { background: rgba(218, 41, 28, 0.2); color: #ff8a80; }
.hcard-val { font-size: 32px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 8px; }
.hcard-val small { font-size: 16px; color: var(--muted); font-weight: 500; margin-left: -6px; }
.hearly { font-size: 10px; letter-spacing: 0.8px; text-transform: uppercase; color: #f2b636; font-weight: 600; }
.s-none .hcard-val { color: var(--faint); }
.hgauge { position: relative; height: 6px; background: #151515; }
.hgauge i { position: absolute; top: 0; bottom: 0; background: rgba(46, 158, 91, 0.35); }
.hgauge b { position: absolute; top: -4px; width: 3px; height: 14px; margin-left: -1.5px; background: #fff; }
.s-low .hgauge b, .s-high .hgauge b { background: var(--red); }
.hcard-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--muted); }
.hcard-foot span:last-child { text-align: right; white-space: nowrap; }
.hcard-hint { margin: 0; font-size: 12px; color: #ffb3ab; line-height: 1.4; }
.health-notes { margin-top: 14px; }

.mix-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.mix-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.mix-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mix-legend i { width: 10px; height: 10px; display: inline-block; }
.mix-row {
  display: grid;
  grid-template-columns: minmax(90px, 140px) minmax(0, 1fr);
  grid-template-areas: "name track" "name stats";
  column-gap: 16px;
  row-gap: 6px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.mix-legend + .mix-row { border-top: 0; }
.mix-name { grid-area: name; display: grid; align-content: center; gap: 2px; }
.mix-name strong { font-size: 14px; overflow-wrap: anywhere; }
.mix-name small { font-size: 11px; color: var(--muted); }
.mix-track { grid-area: track; }
.mix-bar { display: flex; height: 12px; width: var(--len); min-width: 4px; background: var(--panel2); transition: width 0.6s var(--ease); }
.mix-bar i, .mix-legend i { display: block; }
.mix-bar i { width: var(--w); height: 100%; }
:is(.mix-bar, .mix-legend) .hi { background: #2e9e5b; }
:is(.mix-bar, .mix-legend) .sl { background: #e8e8e8; }
:is(.mix-bar, .mix-legend) .rv { background: #555; }
:is(.mix-bar, .mix-legend) .ko { background: var(--red); }
.mix-stats { grid-area: stats; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--muted); }
.mix-stats b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

@container (max-width: 980px) {
  .funnel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fstep:nth-child(4) { border-left: 0; }
  .fstep:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .fstep:nth-child(4)::before { display: none; }
  .mix-grid { grid-template-columns: minmax(0, 1fr); }
}
@container (max-width: 560px) {
  .funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fstep:nth-child(4) { border-left: 1px solid var(--line); }
  .fstep:nth-child(4)::before { display: block; }
  .fstep:nth-child(odd) { border-left: 0; }
  .fstep:nth-child(odd)::before { display: none; }
  .fstep:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .fstep-n { font-size: 28px; }
  .mix-row { grid-template-columns: minmax(0, 1fr); grid-template-areas: "name" "track" "stats"; }
}
@media (prefers-reduced-motion: reduce) {
  .fstep-bar b, .mix-bar { transition: none; }
}

/* Page header buttons wrap instead of running off the right edge. */
.page-head .head-actions { flex-wrap: wrap; justify-content: flex-end; min-width: 0; }

/* ── Payment methods: on the invoice sheet ── */
.doc-pay { display: grid; gap: 1.6cqi; margin: 0.4cqi 0 2.4cqi; }
.doc-pay-card { background: #f6f6f6; border-left: 0.6cqi solid var(--red); padding: 2.2cqi 2.6cqi 2cqi; break-inside: avoid; }
.doc-pay-card > strong { display: block; font-size: 1.95cqi; margin-bottom: 1.2cqi; color: #181818; }
.doc-pay-card dl { margin: 0; display: grid; gap: 0.7cqi; }
.doc-pay-card dl div { display: grid; grid-template-columns: 19cqi minmax(0, 1fr); gap: 1.4cqi; align-items: baseline; }
.doc-pay-card dt { font-size: 1.1cqi; font-weight: 700; letter-spacing: 0.25cqi; text-transform: uppercase; color: #6e6e6e; }
.doc-pay-card dd { margin: 0; font-weight: 700; color: #181818; overflow-wrap: anywhere; }
.doc-pay-card dd.mono { font-family: "Courier New", Courier, monospace; font-size: 1.75cqi; letter-spacing: 0.02em; }
.doc-pay-warn { margin: 1.2cqi 0 0 !important; font-size: 1.3cqi; font-style: italic; color: var(--red) !important; }

/* ── Payment methods: invoice form picker ── */
.doc-paywith { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 8px; }
.doc-paywith legend, .doc-paywith > span { padding: 0; margin-bottom: 8px; font-size: 12px; color: var(--muted); display: flex; gap: 10px; align-items: baseline; }
.doc-paywith-empty { border: 1px dashed var(--line); padding: 12px 14px; font-size: 13px; color: var(--muted); }
.doc-paywith-opt { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); background: var(--panel2); cursor: pointer; }
.doc-paywith-opt:has(input:checked) { border-color: var(--red); }
.doc-paywith-opt input { accent-color: var(--red); width: 16px; height: 16px; margin: 0; }
.doc-paywith-opt strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.doc-paywith-opt small { display: block; color: var(--faint); font-size: 11.5px; overflow-wrap: anywhere; }
.pay-kind { font-size: 9.5px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; padding: 3px 7px; border: 1px solid #3a3a40; color: #d8d8de; white-space: nowrap; }
.pay-kind.crypto { border-color: #5a4513; color: #f0c25a; }

/* ── Payment methods: manager dialog ── */
.pay-intro { margin: 0 0 14px; font-size: 13px; }
.pay-list { display: grid; gap: 8px; margin-bottom: 16px; }
.pay-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); background: var(--panel2); }
.pay-row-main strong { display: block; font-size: 13.5px; overflow-wrap: anywhere; }
.pay-row-main small { display: block; color: var(--faint); font-size: 12px; overflow-wrap: anywhere; }
.pay-default { font: inherit; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; padding: 5px 9px; background: transparent; color: var(--muted); border: 1px solid var(--line); cursor: pointer; white-space: nowrap; }
.pay-default.on { color: #fff; border-color: var(--red); background: rgba(218, 41, 28, 0.16); }
.text-btn.danger { color: #ff6b5e; }
.pay-empty { border: 1px dashed var(--line); padding: 16px; color: var(--muted); font-size: 13px; }
.pay-add, .pay-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pay-safe { margin: 0; font-size: 12px; color: #f0c25a; }
.pay-error { margin: 0; padding: 10px 12px; border: 1px solid var(--red); background: rgba(218, 41, 28, 0.12); color: #ffb3ab; font-size: 13px; }
.pay-check { display: flex !important; flex-direction: row !important; align-items: center; gap: 10px; color: var(--muted); }
.pay-check input { accent-color: var(--red); width: 16px; height: 16px; margin: 0; flex: none; }
#doc-pay-form input.mono { font-family: "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: 0.02em; }
@media (max-width: 640px) {
  .pay-row { grid-template-columns: auto minmax(0, 1fr); }
  .pay-row .pay-default { grid-column: 1 / -1; justify-self: start; }
  .pay-row .text-btn { justify-self: start; }
}

/* ── Sign-in screens (account-view.js) ── */
body.auth-screen .app { grid-template-columns: minmax(0, 1fr); }
body.auth-screen :is(.sidebar, .topbar, footer, .scrim) { display: none !important; }
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 18px; padding: 40px 16px; }
.auth-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-top: 2px solid var(--red); padding: 30px 30px 26px; display: grid; gap: 14px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 2px; font-size: 13px; margin-bottom: 6px; }
.auth-brand .brand-mark { color: var(--red); font-size: 18px; }
.auth-brand .brand-sub { color: var(--muted); margin-left: 6px; font-weight: 500; }
.auth-card h1 { font-size: 24px; margin: 0; letter-spacing: -0.01em; }
.auth-sub { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.auth-note { margin: 0; padding: 10px 12px; border-left: 2px solid var(--red); background: var(--panel2); font-size: 13px; color: #e8e8e8; }
.auth-form { display: grid; gap: 14px; }
.auth-form .field small, .set-body .field small { color: var(--faint); font-size: 11.5px; line-height: 1.45; }
.auth-form button[type="submit"] { width: 100%; justify-content: center; margin-top: 4px; }
.auth-error, .form-error { margin: 0; padding: 10px 12px; border: 1px solid var(--red); background: rgba(218, 41, 28, 0.12); color: #ffb3ab; font-size: 13px; }
.auth-error[hidden], .form-error[hidden] { display: none; }
.auth-alt { justify-self: start; font-size: 13px; }
.auth-help { margin: 0; font-size: 12px; color: var(--faint); }
.auth-foot { margin: 0; font-size: 10.5px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--faint); }
.auth-spin { width: 28px; height: 28px; border: 2px solid var(--line); border-top-color: var(--red); border-radius: 50%; animation: auth-spin 0.8s linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .auth-spin { animation: none; } }
button.avatar { border: 0; cursor: pointer; font: inherit; font-size: 11px; font-weight: 600; }
button.avatar:hover { background: var(--red); color: #fff; }

/* ── Settings: tabs, account, people ── */
.set-tabs { margin: 0 0 18px; width: max-content; max-width: 100%; overflow-x: auto; }
.set-grid { align-items: start; }
.set-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.set-actions p { flex-basis: 100%; margin: 4px 0 0; font-size: 12.5px; }
.set-actions code, .set-body code { overflow-wrap: anywhere; }
.users-table td { vertical-align: top; }
.user-handle { display: block; font-size: 12px; margin-top: 2px; }
.user-acts { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: flex-end; }
.role-table td:last-child { font-size: 12.5px; line-height: 1.5; }
.role-notes { display: grid; gap: 4px; }
.role-notes p { margin: 0; font-size: 12.5px; color: var(--muted); }
.setup-share p { margin: 0; font-size: 13.5px; line-height: 1.5; }
.setup-share input { font-family: "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12px; }
.setup-code { overflow-wrap: anywhere; background: var(--panel2); padding: 1px 5px; }
@media (max-width: 640px) {
  .auth-card { padding: 24px 18px 20px; }
  .user-acts { justify-content: flex-start; }
  .users-table thead { display: none; }
  .users-table tr { display: grid; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .users-table td { border: 0; padding: 0 4px; }
}
.set-body p.muted { font-size: 13px; line-height: 1.5; margin: 0; }
.set-body .panel-head > button { flex: none; }
@media (max-width: 640px) {
  .set-body .panel-head { flex-wrap: wrap; gap: 12px; }
}
