/* ques-bank licence desk — static admin console.
   Palette: ink green, ledger paper, pine for actions, brass for marks.
   No external fonts, images or requests. */

:root {
  --ink: #141b16;
  --ink-soft: #3f4b43;
  --muted: #647067;
  --paper: #eef0e8;
  --card: #fbfcf8;
  --line: #d9ded2;
  --line-strong: #b7c1b3;
  --pine: #0d5a43;
  --pine-deep: #083c2d;
  --pine-wash: #e3efe8;
  --gold: #d9a441;
  --gold-wash: #f6ecd4;
  --rust: #9e3a29;
  --rust-wash: #f6e5df;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 6px;
  --shadow: 0 1px 0 rgba(20, 27, 22, .04), 0 10px 26px -22px rgba(20, 27, 22, .45);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(26px, 3vw, 32px); line-height: 1.08; letter-spacing: -.025em; font-weight: 600; }
h2 { font-size: 16px; line-height: 1.3; letter-spacing: -.01em; font-weight: 600; }
a { color: var(--pine); }
button { font-family: inherit; }
code, .mono { font-family: var(--mono); }
code { font-size: .92em; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--pine);
  outline-offset: 2px;
}
.topbar :where(a, button):focus-visible { outline-color: var(--gold); }

/* ── Shared type ────────────────────────────────────────────────────── */
.eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.4;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.lede { margin-top: 8px; color: var(--ink-soft); max-width: 62ch; }
.hint { color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.label-soft { color: var(--muted); font-size: 9px; letter-spacing: .06em; }
.count {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  color: var(--muted);
  white-space: nowrap;
}

/* ── Sign in ────────────────────────────────────────────────────────── */
.gate {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 20px;
  overflow: hidden;
}
.gate::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px);
  background-size: 100% 32px;
  opacity: .45;
  pointer-events: none;
}
.gate-card {
  position: relative;
  width: min(460px, 100%);
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 36px 90px -64px rgba(20, 27, 22, .8);
}
.gate-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 24px;
  background: var(--ink);
  color: #f3f5ee;
}
.gate-head h1 { font-size: 24px; margin-top: 3px; }
.gate-head .eyebrow { color: #a9b8ad; }
.gate-body { display: grid; gap: 16px; padding: 22px 24px 24px; }
.gate-lede { color: var(--ink-soft); font-size: 13px; line-height: 1.55; }
.gate-note {
  text-align: center;
  color: var(--muted);
  font-size: 11.5px;
  font-family: var(--mono);
  letter-spacing: .01em;
}
.gate-foot {
  position: relative;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.brand-mark {
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--gold);
  color: var(--ink);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -.04em;
}
.brand-mark-lg { width: 38px; height: 38px; font-size: 14px; }

/* ── Top bar ────────────────────────────────────────────────────────── */
.topbar { background: var(--ink); color: #f3f5ee; }
.topbar-inner {
  max-width: 1240px;
  min-height: 64px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-word {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.015em;
}
.brand-desk {
  padding-left: 9px;
  border-left: 1px solid #3a463d;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #a9b8ad;
}
.tabs { display: flex; gap: 2px; flex: 1; }
.tab {
  padding: 22px 11px 19px;
  border-bottom: 3px solid transparent;
  color: #b8c4ba;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.tab:hover { color: #fff; }
.tab[aria-current="page"] { color: #fff; border-bottom-color: var(--gold); }
.session { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.conn {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 260px;
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 10.5px;
  color: #a9b8ad;
}
.conn #conn-base { overflow: hidden; text-overflow: ellipsis; }
.dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: #7fc39a;
  box-shadow: 0 0 0 3px rgba(127, 195, 154, .15);
}

/* ── Page frame ─────────────────────────────────────────────────────── */
.page { max-width: 1240px; margin: 0 auto; padding: 30px 24px 52px; }
.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.view-head .eyebrow { margin-bottom: 7px; }
.head-actions { display: flex; gap: 8px; flex: none; }
.view > .banner { margin-bottom: 14px; }
.foot {
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 24px 30px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--pine); border-color: var(--pine); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--pine-deep); border-color: var(--pine-deep); }
.btn-secondary { background: var(--card); border-color: var(--line-strong); color: var(--ink); }
.btn-secondary:hover:not(:disabled) { border-color: var(--ink); }
.btn-plain { color: var(--ink-soft); }
.btn-plain:hover:not(:disabled) { background: #e5e8dd; color: var(--ink); }
.btn-ghost { padding: 7px 11px; border-color: #3b473e; color: #e8ede6; font-size: 12px; }
.btn-ghost:hover:not(:disabled) { border-color: #6f7d72; color: #fff; }
.btn-danger { background: var(--rust); border-color: var(--rust); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #7f2d1f; border-color: #7f2d1f; }
.btn-mini {
  min-height: 30px;
  padding: 5px 8px;
  border-color: var(--line);
  background: var(--card);
  color: var(--ink-soft);
  font-size: 11.5px;
}
.btn-mini:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); }
.btn-block { width: 100%; padding: 11px; font-size: 13.5px; }

/* ── Cards, tables ──────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.table-card { overflow: hidden; }
.table-wrap { overflow-x: auto; }
.ledger { width: 100%; border-collapse: collapse; font-size: 13px; }
.ledger th {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: #f3f5ee;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .1em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.ledger td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.ledger tbody tr:last-child td { border-bottom: 0; }
.ledger tbody tr:hover { background: #f6f8f1; }
.ledger .num { text-align: right; font-variant-numeric: tabular-nums; }
.ledger .actions-col, .ledger td.actions { text-align: right; }
.ledger td.actions { white-space: nowrap; }
.loading-row td {
  padding: 26px 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-align: center;
  text-transform: uppercase;
}
.empty {
  padding: 30px 18px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.lic-id { font-family: var(--mono); font-size: 11.5px; color: var(--pine); overflow-wrap: anywhere; }
.lic-kind, .source {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.phone-list { display: grid; gap: 2px; font-family: var(--mono); font-size: 12px; }
.sub { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.valid {
  display: grid;
  gap: 1px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 10.5px;
  white-space: nowrap;
}
.valid .arrow { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; max-width: 190px; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 11px;
  line-height: 1.5;
  white-space: nowrap;
}
.chip-subject { background: var(--pine-wash); color: var(--pine-deep); }
.chip-feature { border: 1px solid var(--line-strong); color: var(--ink-soft); }
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-active { background: var(--pine-wash); color: var(--pine-deep); }
.status-revoked { background: var(--rust-wash); color: var(--rust); }
.status-neutral { background: #eef0e8; color: var(--ink-soft); }
.status-muted { background: #eef0e8; color: var(--muted); }
.row-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; width: 176px; margin-left: auto; }
.row-actions.single { grid-template-columns: 1fr; width: 82px; }

/* ── Banners, toast ─────────────────────────────────────────────────── */
.banner {
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 12.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.banner-error { background: var(--rust-wash); border-color: #dfb7ac; color: #6f261a; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 30;
  max-width: min(580px, calc(100vw - 32px));
  padding: 10px 16px;
  transform: translateX(-50%);
  border-left: 3px solid var(--pine);
  border-radius: 3px;
  background: var(--ink);
  color: #f2f5ef;
  box-shadow: 0 16px 38px -16px rgba(0, 0, 0, .55);
  font-size: 13px;
  animation: toast-in .16s ease-out;
}
.toast-error { border-left-color: #e0705a; }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 6px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ── Forms ──────────────────────────────────────────────────────────── */
.field { display: grid; gap: 5px; min-width: 0; align-content: start; }
fieldset.field { border: 0; margin: 0; padding: 0; }
legend.label { padding: 0; }
.label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
input[type="text"], input[type="tel"], input[type="url"], input[type="password"],
input[type="number"], input[type="datetime-local"], select, textarea {
  width: 100%;
  min-height: 37px;
  padding: 8px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
}
input[readonly] { background: #f1f3eb; color: var(--muted); }
input:focus, select:focus, textarea:focus {
  border-color: var(--pine);
  box-shadow: 0 0 0 3px var(--pine-wash);
  outline: none;
}
.inline-input { display: flex; align-items: center; gap: 7px; }
.inline-input input { width: 84px; flex: none; }
.seg { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.checks { display: flex; flex-wrap: wrap; gap: 5px 13px; padding-top: 3px; }
.check, .radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 12.5px;
  cursor: pointer;
}
input[type="checkbox"], input[type="radio"] {
  width: 15px;
  height: 15px;
  margin: 0;
  flex: none;
  accent-color: var(--pine);
}

/* Token field */
.tokens {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-height: 37px;
  padding: 4px 5px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: #fff;
}
.tokens:focus-within { border-color: var(--pine); box-shadow: 0 0 0 3px var(--pine-wash); }
.token {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 2px 3px 2px 7px;
  border-radius: 3px;
  background: var(--pine-wash);
  color: var(--pine-deep);
  font-size: 11.5px;
}
.token-x {
  padding: 1px 4px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--pine);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.token-x:hover { background: #cfe3d6; }
.tokens .token-input {
  flex: 1;
  min-width: 90px;
  min-height: 26px;
  padding: 2px 4px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: 12.5px;
  background: transparent;
}
.tokens .token-input:focus { outline: none; box-shadow: none; }
.token-suggestions { display: flex; flex-wrap: wrap; gap: 4px; width: 100%; }
.token-add {
  padding: 2px 6px;
  border: 1px dashed var(--line-strong);
  border-radius: 3px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
  cursor: pointer;
}
.token-add:hover { border-color: var(--pine); color: var(--pine); }

/* ── Issue ticket ───────────────────────────────────────────────────── */
.ticket { margin-bottom: 14px; overflow: hidden; }
.ticket-stub {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px dashed var(--line-strong);
  background: linear-gradient(180deg, #f7f8f2, #fbfcf8);
}
.ticket-stub h2 { margin-top: 3px; font-size: 18px; }
.ticket-code { font-size: 9.5px; letter-spacing: .12em; color: var(--muted); }
.ticket-body { padding: 16px 18px 18px; }
.issue-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 13px 14px;
}
.issue-phone { grid-column: span 3; }
.issue-exam { grid-column: span 2; }
.issue-subjects { grid-column: span 3; }
.issue-features { grid-column: span 4; }
.issue-duration { grid-column: span 4; }
.issue-kind { grid-column: span 3; }
.issue-seats { grid-column: span 2; }
.issue-note { grid-column: span 5; }
#issue-form.is-group .issue-note { grid-column: span 3; }
.date-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  max-width: 560px;
  margin-top: 14px;
}
.ticket-print {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 18px;
  padding: 11px 18px;
  background: var(--ink);
  background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 7px);
}
.print-line {
  color: #b9c6bb;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.print-dates { color: var(--gold); font-size: 12px; }
.ticket-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px 15px;
  border-top: 1px dashed var(--line-strong);
}
.ticket-foot .banner { flex: 1; }
.ticket-foot .btn { flex: none; margin-left: auto; }

/* ── How this works ─────────────────────────────────────────────────── */
.how {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px 20px;
  margin-bottom: 22px;
  padding: 12px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(251, 252, 248, .55);
}
.how h2 {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.how p { color: var(--ink-soft); font-size: 12px; line-height: 1.5; }

/* ── Filters ────────────────────────────────────────────────────────── */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 14px;
}
.filters .field { width: 190px; }
.filters .btn { margin-bottom: 0; }

/* ── Dialogs ────────────────────────────────────────────────────────── */
.dialog {
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 30px 80px -30px rgba(8, 20, 14, .7);
  overflow: auto;
}
.dialog::backdrop { background: rgba(18, 26, 21, .58); }
.dialog form { display: grid; }
.dialog-head { padding: 19px 20px 0; }
.dialog-head .eyebrow { margin-bottom: 5px; }
.dialog-head h2 { font-size: 20px; letter-spacing: -.02em; }
.dialog-desc { padding: 8px 20px 0; color: var(--ink-soft); font-size: 13.5px; line-height: 1.5; }
.dialog-fields { display: grid; gap: 12px; padding: 14px 20px 0; }
.dialog-fields:empty { display: none; }
.dialog-error { margin: 14px 20px 0; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 20px; }
.dialog-wide { width: min(680px, calc(100vw - 32px)); }
.plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px 14px;
  padding: 16px 20px 0;
}
.plan-grid .plan-subjects,
.plan-grid .plan-features,
.plan-grid .plan-active,
.plan-grid .plan-price-hint { grid-column: 1 / -1; }
.plan-active { margin-top: 2px; }
.plan-price-hint { margin: 0; }
#plan-error { margin: 14px 20px 0; }

/* ── Small screens ──────────────────────────────────────────────────── */
@media (max-width: 1020px) {
  .issue-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .issue-phone { grid-column: span 3; }
  .issue-exam { grid-column: span 3; }
  .issue-subjects { grid-column: span 3; }
  .issue-features { grid-column: span 3; }
  .issue-duration { grid-column: span 3; }
  .issue-kind { grid-column: span 3; }
  .issue-seats { grid-column: span 2; }
  .issue-note { grid-column: span 6; }
  #issue-form.is-group .issue-note { grid-column: span 4; }
}

@media (max-width: 820px) {
  .topbar-inner { padding: 12px 16px 0; gap: 8px 16px; }
  .tabs {
    order: 3;
    flex: 0 0 100%;
    margin: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { padding: 12px 12px 10px; font-size: 10px; }
  .session { margin-left: auto; }
  .conn { max-width: 150px; }
  .brand-desk { display: none; }
  .page { padding: 22px 16px 40px; }
  .view-head { align-items: flex-start; flex-direction: column; gap: 14px; margin-bottom: 18px; }
  .head-actions { width: 100%; }
  .how { grid-template-columns: 1fr; }
  .how h2 { margin-bottom: 1px; }
  .how p { font-size: 12.5px; }
  .foot { padding: 16px 16px 26px; flex-direction: column; gap: 4px; }
}

@media (max-width: 680px) {
  .issue-grid { grid-template-columns: 1fr; }
  .issue-grid > * { grid-column: auto !important; }
  .issue-features .checks { gap: 6px 14px; }
  .date-row { grid-template-columns: 1fr; max-width: none; }
  .ticket-foot { flex-direction: column; align-items: stretch; }
  .ticket-foot .btn { width: 100%; margin-left: 0; order: 2; }
  .filters { align-items: stretch; }
  .filters .field { width: 100%; }
  .filters .btn { flex: 1; }
  .gate { padding: 20px 12px; }
  .gate-head { padding: 18px; }
  .gate-body { padding: 18px; }
  .plan-grid { grid-template-columns: 1fr; }
  .plan-grid > * { grid-column: 1 / -1 !important; }

  /* Keep the plan dialog's save row on screen while the fields scroll. */
  #plan-dialog { overflow: hidden; }
  #plan-dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); }
  #plan-dialog .plan-grid { overflow-y: auto; padding-bottom: 16px; }
  #plan-dialog .dialog-head, #plan-dialog .dialog-foot, #plan-dialog #plan-error { flex: none; }
  #plan-dialog .dialog-foot { border-top: 1px solid var(--line); background: var(--card); }

  /* Touch-sized controls; 16px stops iOS Safari zooming on focus. */
  input[type="text"], input[type="tel"], input[type="url"], input[type="password"],
  input[type="number"], input[type="datetime-local"], select, textarea {
    min-height: 44px;
    font-size: 16px;
  }
  .tokens { min-height: 44px; }
  .tokens .token-input { min-height: 30px; font-size: 16px; }
  .btn { min-height: 40px; }
  .btn-block { min-height: 46px; }
  .ticket-foot .btn { min-height: 46px; }
  .check, .radio { min-height: 32px; }
  .check input, .radio input { width: 18px; height: 18px; }
  .token-x { padding: 4px 6px; }

  /* Ledger rows become labelled cards. */
  .ledger, .ledger tbody, .ledger tr, .ledger td { display: block; width: 100%; }
  .ledger thead { display: none; }
  .ledger tr {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }
  .ledger tr:last-child { border-bottom: 0; }
  .ledger tbody tr:hover { background: transparent; }
  .ledger td {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px;
    padding: 5px 0;
    border: 0;
  }
  .ledger td::before {
    content: attr(data-label);
    grid-column: 1;
    grid-row: 1;
    padding-top: 2px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  .ledger td > .cell { grid-column: 2; grid-row: 1; min-width: 0; }
  .ledger td.actions { grid-template-columns: 1fr; padding-top: 10px; text-align: left; white-space: normal; }
  .ledger td.actions::before { display: none; }
  .ledger td.actions > .cell { grid-column: 1; grid-row: auto; }
  .ledger td.actions .row-actions { display: flex; flex-wrap: wrap; width: 100%; margin: 0; }
  .ledger td.actions .btn-mini { min-height: 38px; padding: 8px 11px; font-size: 12px; flex: 1 1 auto; }
  .ledger .num { text-align: left; }
  .chips { max-width: none; }
  .empty { padding: 24px 14px; }
  .dialog-foot { flex-wrap: wrap; }
  .dialog-foot .btn { flex: 1; min-height: 44px; }
  .toast { bottom: 14px; width: calc(100vw - 28px); text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}


/* Role editor on the users screen */
.role-select {
  font: inherit; font-size: 12.5px; padding: 5px 8px; border-radius: 8px;
  border: 1px solid var(--line, #d8d4c8); background: var(--card, #fff);
  color: inherit;
}
