/* TrixOS owner console: same tokens as the panel (TailAdmin palette, Outfit). No inline styles (CSP). */
@font-face {
  font-family: 'Outfit Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(outfit.woff2) format('woff2-variations');
}

:root {
  --font: 'Outfit Variable', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'JetBrains Mono', 'Cascadia Code', Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);

  --bg: #f9fafb;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --text: #101828;
  --text-2: #344054;
  --muted: #667085;
  --brand: #465fff;
  --brand-ink: #3641f5;
  --brand-soft: #ecf3ff;
  --brand-soft-ink: #3641f5;
  --ok: #039855;
  --ok-soft: #ecfdf3;
  --warn: #b54708;
  --warn-soft: #fffaeb;
  --warn-dot: #f79009;
  --bad: #d92d20;
  --bad-soft: #fef3f2;
  --gray-soft: #f2f4f7;
  --focus: 0 0 0 4px rgba(70, 95, 255, 0.14);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 12px 16px -4px rgba(16, 24, 40, 0.08), 0 4px 6px -2px rgba(16, 24, 40, 0.03);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0c111d;
    --surface: #101828;
    --surface-2: #161f2f;
    --border: #1d2939;
    --border-strong: #344054;
    --text: #f2f4f7;
    --text-2: #d0d5dd;
    --muted: #98a2b3;
    --brand: #6278ff;
    --brand-ink: #9cb9ff;
    --brand-soft: rgba(70, 95, 255, 0.14);
    --brand-soft-ink: #9cb9ff;
    --ok: #32d583;
    --ok-soft: rgba(18, 183, 106, 0.12);
    --warn: #fdb022;
    --warn-soft: rgba(247, 144, 9, 0.12);
    --bad: #f97066;
    --bad-soft: rgba(240, 68, 56, 0.12);
    --gray-soft: rgba(255, 255, 255, 0.06);
    --shadow: none;
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0c111d;
  --surface: #101828;
  --surface-2: #161f2f;
  --border: #1d2939;
  --border-strong: #344054;
  --text: #f2f4f7;
  --text-2: #d0d5dd;
  --muted: #98a2b3;
  --brand: #6278ff;
  --brand-ink: #9cb9ff;
  --brand-soft: rgba(70, 95, 255, 0.14);
  --brand-soft-ink: #9cb9ff;
  --ok: #32d583;
  --ok-soft: rgba(18, 183, 106, 0.12);
  --warn: #fdb022;
  --warn-soft: rgba(247, 144, 9, 0.12);
  --bad: #f97066;
  --bad-soft: rgba(240, 68, 56, 0.12);
  --gray-soft: rgba(255, 255, 255, 0.06);
  --shadow: none;
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1,
h2 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}
h1 {
  font-size: 24px;
  line-height: 1.25;
}
h2 {
  font-size: 16px;
}
p {
  margin: 0;
}
a {
  color: var(--brand-ink);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
code,
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12.5px;
}
.right {
  text-align: right;
}
.center {
  text-align: center;
}
.inline {
  display: inline;
  margin: 0;
}
.ic {
  width: 16px;
  height: 16px;
  flex: none;
}
:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 8px;
}

/* logos: light / dark */
.logo-dark {
  display: none;
}
:root[data-theme='dark'] .logo-light {
  display: none;
}
:root[data-theme='dark'] .logo-dark {
  display: inline-block;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .logo-light {
    display: none;
  }
  :root:not([data-theme='light']) .logo-dark {
    display: inline-block;
  }
}

/* ───── top bar ───── */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.top-inner {
  max-width: 1240px;
  margin: 0 auto;
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand:hover {
  text-decoration: none;
}
.brand .logo {
  height: 26px;
  width: auto;
}
.brand-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-soft-ink);
  background: var(--brand-soft);
  padding: 2px 8px;
  border-radius: 999px;
}
.nav {
  display: flex;
  gap: 4px;
  flex: 1;
}
.nav-link {
  color: var(--muted);
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.nav-link:hover {
  color: var(--text);
  background: var(--gray-soft);
  text-decoration: none;
}
.nav-link[aria-current='page'] {
  color: var(--brand-soft-ink);
  background: var(--brand-soft);
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.who {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-weight: 500;
  padding: 0 6px;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color 150ms var(--ease), transform 120ms var(--ease);
}
.icon-btn:hover {
  color: var(--text);
}
.icon-btn:active {
  transform: scale(0.96);
}
.ic-moon {
  display: none;
}
:root[data-theme='dark'] .ic-sun {
  display: none;
}
:root[data-theme='dark'] .ic-moon {
  display: block;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .ic-sun {
    display: none;
  }
  :root:not([data-theme='light']) .ic-moon {
    display: block;
  }
}

/* ───── layout ───── */
.main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-head p {
  margin-top: 4px;
}
.page-head .meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 6px;
}
.grid-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 20px;
  align-items: start;
}
.col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ───── cards ───── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px;
  min-width: 0;
}
.card-narrow {
  max-width: 640px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.card-danger .stack > form + form {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.card-danger form.stack {
  align-items: flex-start;
}
.card-danger form.stack > .field,
.card-danger form.stack > p {
  align-self: stretch;
}

/* ───── stats ───── */
.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.stat {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  color: inherit;
  box-shadow: var(--shadow);
  transition: border-color 150ms var(--ease), transform 150ms var(--ease);
}
a.stat:hover {
  text-decoration: none;
  border-color: var(--border-strong);
}
a.stat:active {
  transform: scale(0.99);
}
.stat-ic {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--gray-soft);
  color: var(--muted);
  flex: none;
}
.stat-ic .ic {
  width: 18px;
  height: 18px;
}
.stat-ic-brand {
  background: var(--brand-soft);
  color: var(--brand-soft-ink);
}
.stat-ic-ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.stat-ic-warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.stat-ic-bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.stat-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.stat-label {
  color: var(--muted);
  font-size: 12.5px;
}
.stat-value {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.stat-hint {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ───── filters ───── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}
.search {
  position: relative;
  flex: 1 1 260px;
  display: flex;
  align-items: center;
}
.search .ic {
  position: absolute;
  left: 11px;
  color: var(--muted);
}
.search input {
  padding-left: 34px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  margin: 0;
}

/* ───── form controls ───── */
input,
select,
textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 8px 12px;
  width: 100%;
  min-height: 40px;
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
select {
  width: auto;
  padding-right: 32px;
  cursor: pointer;
}
textarea {
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--focus);
}
input:disabled {
  background: var(--surface-2);
  color: var(--muted);
}
input[type='checkbox'] {
  min-height: 0;
  width: auto;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field > span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}
.field em {
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.form-grid > input[type='hidden'] {
  display: none;
}
.span-2 {
  grid-column: span 2;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.code-input {
  font-family: var(--mono);
  font-size: 20px;
  letter-spacing: 0.3em;
  text-align: center;
}

/* ───── buttons ───── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font: 500 14px/1 var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease), transform 120ms var(--ease);
}
.btn:hover {
  text-decoration: none;
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.btn-sm {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}
.btn-block {
  width: 100%;
}
.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover {
  background: #3641f5;
}
.btn-ghost {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text-2);
}
.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}
.btn-warn {
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 30%, transparent);
  color: var(--warn);
}
.btn-danger {
  background: var(--bad);
  color: #fff;
}
.btn-danger:hover {
  background: #b42318;
}
.btn-danger-soft {
  background: var(--bad-soft);
  border-color: color-mix(in srgb, var(--bad) 35%, transparent);
  color: var(--bad);
}
.btn-danger-soft:hover {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
}
.link-btn {
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 4px;
}
.link-btn:hover {
  color: var(--text);
  text-decoration: underline;
}

/* ───── badges ───── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  white-space: nowrap;
  background: var(--gray-soft);
  color: var(--text-2);
}
.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}
.badge-ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.badge-warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.badge-bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.badge-brand {
  background: var(--brand);
  color: #fff;
}
.badge-brand-soft {
  background: var(--brand-soft);
  color: var(--brand-soft-ink);
}

/* ───── tables ───── */
.table-wrap {
  overflow-x: auto;
  margin: 0 -20px;
  padding: 0 20px;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.table th {
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table tbody tr:last-child td {
  border-bottom: 0;
}
.table tbody tr {
  transition: background-color 120ms var(--ease);
}
.table tbody tr:hover {
  background: var(--surface-2);
}
.table th:first-child,
.table td:first-child {
  padding-left: 0;
}
.table th:last-child,
.table td:last-child {
  padding-right: 0;
}
.table .sub {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.table .details {
  color: var(--text-2);
  max-width: 420px;
  word-break: break-word;
}
.row-link {
  font-weight: 600;
  color: var(--text);
}
.empty {
  color: var(--muted);
  text-align: center;
  padding: 28px 12px !important;
}
.usage {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 96px;
}
.usage-num {
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}
.usage-num b {
  color: var(--text);
  font-weight: 600;
}
.bar {
  width: 96px;
  height: 6px;
  display: block;
}
.bar-bg {
  fill: var(--gray-soft);
}
.bar-ok .bar-fg {
  fill: var(--brand);
}
.bar-warn .bar-fg {
  fill: var(--warn-dot);
}
.bar-bad .bar-fg {
  fill: var(--bad);
}
.card-head .usage {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.pager-btns {
  display: flex;
  gap: 8px;
}
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin: -4px 0 14px;
}
.tab {
  padding: 8px 12px;
  color: var(--muted);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover {
  color: var(--text);
  text-decoration: none;
}
.tab[aria-current='page'] {
  color: var(--brand-ink);
  border-bottom-color: var(--brand);
}

/* ───── notices ───── */
.notice {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13.5px;
  border: 1px solid transparent;
}
.notice-ok {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 25%, transparent);
}
.notice-error {
  background: var(--bad-soft);
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 25%, transparent);
}

/* ───── one-time key ───── */
.key-card {
  border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent);
  background: var(--brand-soft);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.key-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--brand-soft-ink);
}
.key-head .ic {
  width: 20px;
  height: 20px;
  margin-top: 2px;
}
.key-head h2 {
  color: var(--text);
}
.key-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.key {
  font-size: 17px;
  letter-spacing: 0.04em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  user-select: all;
  word-break: break-all;
}

/* ───── history ───── */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.timeline li {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.timeline li:last-child {
  border-bottom: 0;
}
.t-kind {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
}
.t-details {
  color: var(--text-2);
  word-break: break-word;
}
.t-when {
  color: var(--muted);
  white-space: nowrap;
  font-size: 12px;
}

/* ───── sign-in ───── */
.auth-main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-card .logo {
  height: 32px;
  width: auto;
  align-self: flex-start;
  margin-bottom: 8px;
}
.auth-card h1 {
  font-size: 22px;
}
.auth-foot {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.auth-foot .ic {
  width: 14px;
  height: 14px;
  margin-top: 2px;
}
.enroll {
  display: flex;
  gap: 16px;
  align-items: center;
}
.qr {
  width: 152px;
  height: 152px;
  flex: none;
  background: #fff;
  border-radius: 12px;
  padding: 6px;
  border: 1px solid var(--border);
}
.qr svg {
  width: 100%;
  height: 100%;
  display: block;
}
.enroll-secret {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  min-width: 0;
}
.secret {
  font-size: 13px;
  line-height: 1.7;
}
.secret span {
  white-space: nowrap;
}

/* ───── customers, tickets (0.10.0) ───── */
.stats {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.stats-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.nav-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  vertical-align: 1px;
}
.ic-xs {
  width: 13px;
  height: 13px;
  vertical-align: -2px;
  margin-right: 4px;
  flex: none;
}
.domain {
  display: inline-flex;
  align-items: center;
  font-weight: 500;
  word-break: break-all;
}
.badge-gray {
  background: var(--gray-soft);
  color: var(--muted);
}
.btn-xs {
  padding: 4px 9px;
  font-size: 12px;
  border-radius: 7px;
  gap: 4px;
}
.btn-xs .ic {
  width: 13px;
  height: 13px;
}
.cell-actions {
  white-space: nowrap;
  width: 1%;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.ticket-type {
  display: inline-flex;
  align-items: center;
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap;
}
.ticket-type-feature .ic {
  color: var(--warn-dot);
}
.ticket-type-billing .ic {
  color: var(--ok);
}
.ticket-type-support .ic {
  color: var(--brand);
}
.prio {
  font-weight: 600;
  text-transform: capitalize;
}
.prio-warn {
  color: var(--warn);
}
.prio-bad {
  color: var(--bad);
}
.unread-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  margin-right: 6px;
  vertical-align: 1px;
}
.row-unread .row-link {
  font-weight: 600;
}
.thread {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.msg {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--surface);
  max-width: 92%;
}
.msg-owner {
  align-self: flex-end;
  background: var(--brand-soft);
  border-color: transparent;
}
.msg-internal {
  background: var(--warn-soft);
  border: 1px dashed var(--warn-dot);
}
.msg-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}
.msg-head .muted {
  margin-left: auto;
}
.msg-body {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
  color: var(--text);
}
.facts {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
  font-size: 13.5px;
}
.facts dt {
  color: var(--muted);
}
.facts dd {
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ───── responsive ───── */
@media (max-width: 1100px) {
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .grid-detail {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 720px) {
  .stats-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .msg {
    max-width: 100%;
  }
  .nav {
    overflow-x: auto;
  }
  .top-inner {
    padding: 0 16px;
    gap: 12px;
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .nav {
    order: 3;
    flex-basis: 100%;
    overflow-x: auto;
  }
  .top-actions {
    margin-left: auto;
  }
  .who span,
  .hide-sm {
    display: none;
  }
  .main {
    padding: 20px 16px 48px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .card {
    padding: 16px;
  }
  .table-wrap {
    margin: 0 -16px;
    padding: 0 16px;
  }
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .span-2 {
    grid-column: auto;
  }
  .filters select {
    flex: 1 1 140px;
  }
  .timeline li {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .stat-hint {
    white-space: normal;
  }
  /* license list as stacked cards */
  .table-cards thead {
    display: none;
  }
  .table-cards,
  .table-cards tbody {
    display: block;
  }
  .table-cards tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
  }
  .table-cards tbody tr:hover {
    background: none;
  }
  .table-cards td {
    display: block;
    padding: 0 !important;
    border: 0;
    min-width: 0;
  }
  .table-cards td.cell-main,
  .table-cards td.empty {
    grid-column: 1 / -1;
  }
  .table-cards td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 3px;
  }
  .table-wrap:has(.table-cards) {
    overflow: visible;
    margin: 0;
    padding: 0;
  }
  .enroll {
    flex-direction: column;
    align-items: flex-start;
  }
  .auth-card {
    padding: 24px;
  }
}

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

/* ───── client portal (0.11.0): the customer's own messages on the right ───── */
.msg-mine {
  align-self: flex-end;
  background: var(--brand-soft);
  border-color: transparent;
}
.facts dd.pre {
  white-space: pre-wrap;
}

/* ───── billing (0.12.0) ───── */
.notice-warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 25%, transparent);
}
.notice a:not(.btn) {
  color: inherit;
  text-decoration: underline;
}
.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.warn-text {
  color: var(--warn);
}
.table tfoot td {
  border-bottom: 0;
  padding-top: 6px;
  padding-bottom: 6px;
}
.table tfoot tr.total td {
  font-weight: 600;
  border-top: 1px solid var(--border);
}
.mail-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mail-list li {
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.mail-list li:last-child {
  border-bottom: 0;
}
.mail-list summary {
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  font-size: 13.5px;
}
.mail-body {
  margin: 10px 0;
  padding: 12px;
  border-radius: 10px;
  background: var(--surface-2, var(--bg));
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12.5px;
  max-height: 360px;
  overflow: auto;
}
.dunning-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}
.pay-form {
  display: inline;
}
.facts dd {
  overflow-wrap: anywhere;
}
.table th.right,
.table td.right {
  text-align: right;
}
.table td a.mono {
  white-space: nowrap;
}
