/* Account center, admin console and the admin data screen share one console language (tokens from landing.css):
   hairline cards, colour only for status, tables for lists, tabular numbers, no decorative gradients or icon tiles. */

/* ---------- Console frame: top bar + content ---------- */
.console { display: flex; flex-direction: column; min-height: 100dvh; font-variant-numeric: tabular-nums; }
.console-bar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 1rem 1.5rem;
  min-height: 4rem; padding: .6rem var(--pad);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.console-bar .brand { margin-right: auto; }
.bar-actions, .console-bar .header-actions { display: flex; align-items: center; gap: .5rem; }
.brand-sub { margin-left: .35rem; padding-left: .6rem; border-left: 1px solid var(--line); color: var(--muted); font-size: .8125rem; font-weight: 500; }
.session-pill {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 2.25rem; padding: .25rem .9rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: .8125rem;
}
.status-dot { width: .5rem; height: .5rem; flex: none; border-radius: 50%; background: var(--line-strong); }
.status-dot.is-active { background: var(--live); box-shadow: 0 0 0 4px var(--live-soft); }
.console-foot {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1.5rem; margin-top: auto;
  padding: 1.5rem var(--pad) 2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .8125rem;
}
.console-foot nav { display: flex; gap: 1.25rem; }
.console-foot a { display: inline-flex; align-items: center; min-height: 2.5rem; }
.console-foot a:hover { color: var(--text); }

.loading-state { display: flex; align-items: center; gap: .75rem; padding: 1.25rem 0; color: var(--muted); font-size: .9375rem; }
.loading-state p { margin: 0; }
.spinner { width: 1.1rem; height: 1.1rem; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.notice {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem 1.5rem; margin-bottom: 1.5rem;
  padding: .875rem 1.1rem; border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); border-radius: var(--radius-md);
  background: var(--warn-soft); color: var(--text); font-size: .875rem;
}
.notice p { margin: 0; }
.empty-state { display: grid; justify-items: start; gap: .5rem; max-width: 34rem; padding: 1.5rem 0; border-block: 1px solid var(--line); }
.empty-state h2 { margin: 0; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.empty-state p { margin: 0 0 .75rem; color: var(--muted); font-size: .875rem; }

/* margin reset: landing.css gives its hero .badge a bottom margin. */
.badge {
  display: inline-flex; align-items: center; gap: .375rem; margin: 0; padding: .125rem .5rem; border-radius: 999px;
  background: var(--surface-soft); color: var(--text); font-size: .75rem; font-weight: 500; white-space: nowrap;
}
.badge.is-accent { background: var(--accent-soft); color: var(--accent); }
.card-meta { margin: .4rem 0 0; color: var(--muted); font-size: .8125rem; line-height: 1.7; }
.card {
  min-width: 0; padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--card-edge);
}
.card h2 { margin: 0; font-size: 1.125rem; line-height: 1.35; letter-spacing: -.02em; font-weight: 600; }
.kv { display: grid; margin: 1rem 0 0; }
.kv > div { display: grid; grid-template-columns: minmax(6.5rem, 34%) minmax(0, 1fr); gap: 1rem; padding-block: .7rem; border-top: 1px solid var(--line); font-size: .875rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; }
.kv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; }

/* ---------- Account center: section nav + data sections (settings-page pattern: Vercel / Stripe) ---------- */
.account-main { width: 100%; max-width: var(--max); margin-inline: auto; padding: clamp(1.5rem, 3vw, 2.5rem) var(--pad) 4rem; }
.page-head { margin-bottom: 1.75rem; }
.page-head h1 { margin: 0; font-family: var(--font-display); font-size: clamp(2rem, 3.2vw, 2.75rem); line-height: 1.15; font-weight: 600; }
.page-meta { margin: .35rem 0 0; color: var(--muted); font-size: .875rem; }
.account-layout { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.section-nav { position: sticky; top: 5.5rem; display: grid; gap: .125rem; }
.section-nav a {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 2.25rem; padding: 0 .75rem;
  border-radius: var(--radius-sm); color: var(--muted); font-size: .875rem;
}
.section-nav a:hover { background: var(--surface-soft); color: var(--text); }
.section-nav a[aria-current="true"] { background: var(--surface-soft); color: var(--text); font-weight: 500; box-shadow: inset 2px 0 0 var(--accent); }
.nav-count:not(:empty) { min-width: 1.25rem; padding: 0 .375rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .75rem; font-weight: 500; text-align: center; }
.account-sections { display: grid; gap: 1rem; min-width: 0; }
.account-sections .panel { scroll-margin-top: 5.5rem; }
/* Console blocks (r14 editorial): a rule on top, no box. */
.panel { min-width: 0; padding: 1.25rem 0 1.75rem; border-top: 1px solid var(--line); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 2.5rem; margin-bottom: .75rem; }
.panel-head h2 { margin: 0; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.panel-note { max-width: 46rem; margin: -.25rem 0 1rem; color: var(--muted); font-size: .8125rem; line-height: 1.6; }
.panel-foot { margin: .75rem 0 0; color: var(--muted); font-size: .75rem; }
.panel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-top: 1rem; }
.panel-actions .form-status { min-height: 0; }
.panel .kv { margin: 0; }
.panel .kv > div:first-child { border-top: 0; }
.sub-head { display: flex; align-items: baseline; gap: .5rem; margin: 1.5rem 0 .625rem; font-size: .875rem; font-weight: 600; }
.sub-count { color: var(--muted); font-size: .8125rem; font-weight: 400; }
.stat-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; border-block: 1px solid var(--line); }
.stat-strip > div { min-width: 0; padding: .875rem 1rem; }
.stat-strip > div:first-child { padding-left: 0; }
.stat-strip > div + div { border-left: 1px solid var(--line); }
.stat-strip dt { color: var(--muted); font-size: .75rem; }
.stat-strip dd { margin: .25rem 0 0; font-size: 1.375rem; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; }
.stat-strip dd[data-state] { font-size: .9375rem; line-height: 1.85; }
.stat-strip dd[data-state="on"] { color: var(--live); }
.stat-strip dd[data-state="off"] { color: var(--muted); }
.card-list { display: grid; gap: .625rem; margin: 0; padding: 0; list-style: none; }
.card-list { gap: 0; }
.card-list > li:not(.list-empty) { display: grid; gap: .375rem; padding: .875rem 0; border-top: 1px solid var(--line); }
.card-list-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.card-list-head strong { font-size: .9375rem; font-weight: 600; }
.card-list p { margin: 0; color: var(--text); font-size: .875rem; line-height: 1.7; }
.card-list-meta { color: var(--muted); font-size: .75rem; }
.list-empty { padding: 1rem 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
.stack-cell strong { display: block; font-weight: 500; }
.stack-cell span { display: block; color: var(--muted); font-size: .75rem; }
.value-cell { max-width: 26rem; overflow-wrap: anywhere; }
td.muted { color: var(--muted); font-size: .8125rem; }
td.nowrap { white-space: nowrap; }
.usage-cell { display: flex; align-items: center; gap: .625rem; white-space: nowrap; }
.meter { --p: 0; position: relative; width: 6rem; height: .375rem; border-radius: 999px; background: var(--surface-soft); overflow: hidden; }
.meter::before { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--p) * 1%); border-radius: inherit; background: var(--text); }

/* ---------- Admin (r7: top tabs + bento) ---------- */
.tabs { display: flex; gap: .2rem; padding: .25rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft); overflow-x: auto; scrollbar-width: none; }
.tabs a {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 2.25rem; padding: 0 .9rem; border-radius: 999px;
  color: var(--muted); font-size: .875rem; font-weight: 500; white-space: nowrap; transition: color .2s var(--ease), background-color .2s var(--ease);
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.tabs svg { width: 1rem; height: 1rem; flex: none; }
.admin-main { width: 100%; max-width: 88rem; margin-inline: auto; padding: clamp(1.5rem, 3vw, 2.5rem) var(--pad) 3rem; }
.page-hero { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 1rem 2rem; margin-bottom: 1.75rem; }
.page-hero .crumb { margin: 0 0 .375rem; color: var(--muted); font-size: .8125rem; }
.page-hero .crumb a:hover { text-decoration: underline; text-underline-offset: 3px; }
.page-hero h1 { margin: 0; font-family: var(--font-display); font-size: clamp(2rem, 3.2vw, 2.75rem); line-height: 1.15; font-weight: 600; }
.page-lead { max-width: 40rem; margin: .35rem 0 0; color: var(--muted); font-size: .875rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.admin-status { display: flex; align-items: center; gap: .6rem; margin: 0 0 1.25rem; padding: .5rem 0; color: var(--muted); font-size: .875rem; }
.admin-status::before { content: ""; width: .9rem; height: .9rem; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; }
.admin-gate { display: grid; justify-items: center; gap: .4rem; max-width: 30rem; margin: 2rem auto; padding: 2.5rem 0; border-block: 1px solid var(--line); text-align: center; }
.admin-gate h2 { margin: .75rem 0 0; font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; }
.admin-gate p { margin: 0 0 1rem; color: var(--muted); font-size: .9rem; }
.admin-gate-mark { width: 3rem; height: 3rem; }
.admin-gate-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem 1rem; }

.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1.25rem 2.5rem; }
.tile { display: flex; flex-direction: column; grid-column: span 12; min-width: 0; padding: 1.25rem 0 1.5rem; border-top: 1px solid var(--line); }
.tile-title { margin: 0; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.tile-8 { grid-column: span 8; }
.tile-4 { grid-column: span 4; }
.tile-6 { grid-column: span 6; }
.admin-section { margin-top: 1.25rem; }
.section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1.5rem; margin-bottom: 1rem; }
.section-heading h2 { margin: 0; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.section-heading p { margin: .25rem 0 0; color: var(--muted); font-size: .8125rem; }
.section-heading time, .surface-label, .table-note { color: var(--muted); font-size: .75rem; }
.surface-label { padding: .15rem .6rem; border: 1px solid var(--line); border-radius: 999px; }

/* Metrics are numbers separated by hairlines, not tinted boxes: label above, number, optional secondary line. */
.summary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 1rem 1.25rem; }
.summary-card { display: grid; align-content: start; gap: .3rem; padding: 0 1.25rem 0 0; border-right: 1px solid var(--line); }
.summary-card:last-child { border-right: 0; }
.summary-card > span { color: var(--muted); font-size: .75rem; letter-spacing: .04em; }
.summary-card strong { font-size: 1.875rem; line-height: 1.1; font-weight: 600; letter-spacing: -.045em; }
.summary-card small { color: var(--muted); font-size: .8125rem; }
.tile-kpis .summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: .75rem 1rem; }
.metric-grid .summary-card { padding-right: 1rem; }
.metric-grid .summary-card strong { font-size: 1.375rem; }
.tile-health .metric-grid { margin-top: auto; padding-top: 1.25rem; }

.chart { position: relative; flex: 1; min-height: 14rem; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 11px; font-family: var(--font); }
/* One neutral family; only today's bar carries the accent. */
.chart .bar { fill: var(--line-strong); opacity: .55; }
.chart .bar.is-today { fill: var(--accent); opacity: 1; }
.chart .line { fill: none; stroke: var(--text); stroke-width: 2; stroke-linejoin: round; }
.chart .area { fill: url(#trend-fill); }
.chart stop { stop-color: var(--text); }
.chart .dot { fill: var(--text); }
.chart-legend { display: flex; gap: 1.5rem; margin-top: .6rem; color: var(--muted); font-size: .75rem; }
.chart-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.chart-legend span::before { content: ""; width: .8em; height: .8em; border-radius: .2em; background: var(--line-strong); }
.chart-legend span + span::before { height: 2px; background: var(--text); }

.table-scroll-hint { display: none; margin: 0 0 .5rem; color: var(--muted); font-size: .75rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th { padding: .5rem 1rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .6875rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; text-align: left; white-space: nowrap; }
td { padding: .6rem 1rem; border-top: 1px solid var(--line); vertical-align: middle; }
tr:first-child td { border-top: 0; }
tr > :first-child { padding-left: 0; }
tr > :last-child { padding-right: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--surface-soft) 55%, transparent); }
.user-cell { min-width: 12rem; }
.user-cell strong { display: block; font-weight: 560; }
.user-cell span { display: block; color: var(--muted); font-size: .8125rem; }
.user-link { color: var(--text); }
.user-link:hover strong { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.table-badge { display: inline-flex; align-items: center; gap: .375rem; padding: .125rem .5rem; border-radius: 999px; background: var(--live-soft); color: var(--live); font-size: .75rem; font-weight: 500; white-space: nowrap; }
.table-badge::before { content: ""; width: .375rem; height: .375rem; border-radius: 50%; background: currentColor; }
.table-badge.is-muted { background: var(--surface-soft); color: var(--muted); }
.table-badge.is-warn { background: var(--warn-soft); color: var(--warn); }
.table-badge.is-danger { background: var(--danger-soft); color: var(--danger); }
.hash-cell { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.empty-cell { padding: 2.5rem 1rem; color: var(--muted); text-align: center; }

.user-filters { display: grid; grid-template-columns: minmax(0, 1fr) 12rem auto; align-items: end; gap: .75rem; padding: 0 0 1.25rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.user-filters label, .settings-form label { display: grid; gap: .35rem; color: var(--muted); font-size: .8125rem; font-weight: 500; }
input, select {
  width: 100%; min-height: 2.75rem; padding: .55rem .8rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font-size: .9rem;
}
.user-filters input, .user-filters select { background: var(--surface); }
input:focus-visible, select:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: transparent; }
input:disabled, select:disabled { opacity: .6; cursor: not-allowed; }
.filter-actions { display: flex; align-items: center; gap: .75rem; }
.filter-reset { display: inline-flex; align-items: center; min-height: 2.5rem; color: var(--muted); font-size: .8125rem; white-space: nowrap; }
.filter-reset:hover { color: var(--text); }
.list-result { margin: 0; font-size: .875rem; font-weight: 560; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; color: var(--muted); font-size: .8125rem; }
.pagination .btn[aria-disabled="true"] { pointer-events: none; }

.user-hero { display: flex; align-items: center; gap: 1.25rem; }
.user-hero .avatar { display: grid; place-items: center; width: 3rem; height: 3rem; flex: none; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-soft); color: var(--text); font-size: 1.125rem; font-weight: 600; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.settings-form { display: grid; gap: .9rem; margin-top: 1rem; }
.field-help { color: var(--muted); font-size: .75rem; font-weight: 400; }
.settings-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.form-status { min-height: 1.5rem; margin: 0; color: var(--muted); font-size: .8125rem; }
.form-status[data-state="dirty"] { color: var(--warn); }
.form-status[data-state="success"] { color: var(--live); }
.form-status[data-state="error"] { color: var(--danger); }

.readiness-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0 1.5rem; }
.tile-health .readiness-grid { grid-template-columns: 1fr; }
.readiness-item { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.readiness-item strong { font-size: .9rem; font-weight: 560; }
.readiness-item span { display: inline-flex; align-items: center; gap: .4rem; color: var(--live); font-size: .8125rem; font-weight: 600; }
.readiness-item span::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 20%, transparent); }
.readiness-item.is-degraded span { color: var(--warn); }
.readiness-item[data-state="not-ready"] span { color: var(--danger); }
.readiness-item[data-state="unknown"] span { color: var(--muted); }
.panel-footnote { margin: .9rem 0 0; color: var(--muted); font-size: .75rem; }

@media (max-width: 1100px) {
  .tile-8, .tile-4, .tile-6 { grid-column: span 12; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1023px) {
  .console-bar { flex-wrap: wrap; }
  .admin-bar .tabs { order: 3; width: 100%; }
  .account-layout { grid-template-columns: 1fr; gap: 1.25rem; }
  .section-nav {
    top: 4rem; z-index: 30; display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none;
    margin-inline: calc(-1 * var(--pad)); padding: .5rem var(--pad); background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .section-nav a { flex: none; border: 1px solid var(--line); border-radius: 999px; }
  .section-nav a[aria-current="true"] { border-color: var(--text); box-shadow: none; }
  .account-sections .panel { scroll-margin-top: 8rem; }
  .stat-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-strip > div:nth-child(4) { border-left: 0; }
  .stat-strip > div:nth-child(n + 4) { border-top: 1px solid var(--line); }
}
@media (max-width: 767px) {
  .console-bar .brand-sub, .session-pill span:last-child { display: none; }
  .panel { padding: 1rem 0 1.25rem; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip > div:nth-child(odd) { border-left: 0; }
  .stat-strip > div:nth-child(4) { border-left: 1px solid var(--line); }
  .stat-strip > div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .kv-grid { grid-template-columns: 1fr; }
  .user-filters { grid-template-columns: 1fr; }
  .table-scroll-hint { display: block; }
  .summary-grid, .tile-kpis .summary-grid, .screen-bento .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-card:nth-child(even) { border-right: 0; }
  .summary-card strong { font-size: 1.5rem; }
  .tile { padding: 1rem 0 1.25rem; }
  /* Icon-only tabs: five 44px targets fit a 390px phone; the label stays for screen readers. */
  .tabs { justify-content: space-between; }
  .tabs a { justify-content: center; min-width: 2.75rem; padding: 0 .6rem; }
  .tabs a span { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .spinner, .admin-status::before { animation: none; }
}

/* ---------- Data screen tab: admin components plus a live line, clock and change flash ---------- */
.live-line { display: flex; align-items: center; gap: .5rem; }
.live-dot { width: .5rem; height: .5rem; flex: none; border-radius: 50%; background: var(--line-strong); }
.live-dot[data-state="live"] { background: var(--live); box-shadow: 0 0 0 3px var(--live-soft); }
.live-dot[data-state="stale"] { background: var(--warn); }
.live-dot[data-state="error"] { background: var(--danger); }
.screen-clock { color: var(--muted); font-size: 1.25rem; }
.kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-grid .summary-card strong { font-size: clamp(2rem, 3vw, 3.25rem); }
.summary-card.is-alert strong { color: var(--danger); }
.summary-card.is-changed { animation: kpi-flash 1.2s var(--ease); }
@keyframes kpi-flash { from { color: var(--accent); } }
th.num, td.num { text-align: right; }
/* A wall display (always dark, tokens in landing.css) gets the full width and a fixed-height chart so the whole
   board fits 1920×1080; from 1440px the four small panels share one row. */
[data-admin-page="screen"] .admin-main { max-width: 120rem; padding-block: 1.25rem; }
[data-admin-page="screen"] .page-hero { margin-bottom: 1rem; }
[data-admin-page="screen"] .screen-bento { gap: 1rem; }
[data-admin-page="screen"] .tile { padding: 1rem 0 1.25rem; }
[data-admin-page="screen"] .chart { flex: 0 0 auto; height: clamp(8rem, 16vh, 12rem); min-height: 0; }
[data-admin-page="screen"] td { padding-block: .35rem; }
[data-admin-page="screen"] .readiness-item { padding-block: .4rem; }
[data-admin-page="screen"] .metric-grid { grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); }
:fullscreen .console-bar, :fullscreen .page-hero, :fullscreen .console-foot { display: none; }
@media (min-width: 1440px) {
  .screen-bento .tile-6 { grid-column: span 3; }
}

/* Phones: account table rows stack, each cell labelled by its column header (data-label set by account-console.js). */
@media (max-width: 767px) {
  .account-sections thead { display: none; }
  .account-sections tbody, .account-sections tr, .account-sections td { display: block; }
  .account-sections tr { padding: .6rem 0; border-top: 1px solid var(--line); }
  .account-sections tr:first-child { border-top: 0; }
  .account-sections td { padding: .15rem 0; border: 0; }
  .account-sections td[data-label] { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: .5rem; align-items: baseline; }
  .account-sections td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .75rem; }
  .account-sections td.usage-cell { display: grid; }
  .account-sections .value-cell { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .summary-card.is-changed { animation: none; }
}

/* ---------- Account center r15 (P2): actions on the existing rows, lines not boxes ---------- */
/* Plan name in the display serif; the strip itself is the memory stat strip. */
.plan-strip dd[data-plan-name] { font-family: var(--font-display); font-size: 2rem; font-weight: 400; letter-spacing: 0; }
.plan-usage { display: flex; align-items: center; gap: .625rem; margin: .875rem 0 0; font-size: .875rem; }
.plan-usage .meter { width: 10rem; }
/* Memory settings: label rows separated by hairlines, a native checkbox drawn as a switch. */
.settings-form.memory-settings { gap: 0; margin-top: 0; border-bottom: 1px solid var(--line); }
.settings-form .switch-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-top: 1px solid var(--line); color: var(--text); font-size: .875rem; font-weight: 500; }
.switch-row > span { display: grid; gap: .15rem; }
.memory-settings .form-status { padding: .35rem 0; }
.memory-settings .form-status:empty { display: none; }
.account-sections input[type="checkbox"][role="switch"] {
  appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 2.5rem; min-height: 0; height: 1.5rem; margin: 0; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface-soft); cursor: pointer; transition: background-color .2s var(--ease), border-color .2s var(--ease);
}
.account-sections input[type="checkbox"][role="switch"]::before {
  content: ""; position: absolute; top: .125rem; left: .125rem; width: 1.125rem; height: 1.125rem; border-radius: 50%; background: var(--line-strong); transition: transform .2s var(--ease), background-color .2s var(--ease);
}
.account-sections input[type="checkbox"][role="switch"]:checked { border-color: var(--live); background: var(--live); }
.account-sections input[type="checkbox"][role="switch"]:checked::before { background: var(--surface); transform: translateX(1rem); }
.account-sections input[type="checkbox"][role="switch"]:disabled { opacity: .6; cursor: wait; }
/* Row actions: small line buttons plus an inline status that only shows on failure. */
.action-cell { white-space: nowrap; }
.action-cell .btn + .btn { margin-left: .375rem; }
.account-sections td .btn-sm { min-height: 2.5rem; padding: .4rem .9rem; }
.action-cell .form-status, .card-list-actions .form-status { min-height: 0; white-space: normal; }
.action-cell .form-status:not(:empty) { display: block; margin-top: .35rem; }
.fact-edit { display: flex; align-items: center; gap: .5rem; min-width: 16rem; }
.profile-form { display: grid; gap: .75rem; max-width: 32rem; }
.profile-field { display: grid; gap: .25rem; }
.profile-field input, .profile-field textarea { width: 100%; min-height: 2.5rem; font: inherit; }
.profile-field textarea { resize: vertical; }
.fact-edit input { min-height: 2.5rem; }
.btn-danger { color: var(--danger); }
.card-list-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.card-sources { color: var(--muted); font-size: .75rem; }
.card-sources summary { width: max-content; min-height: 2rem; line-height: 2rem; cursor: pointer; }
.card-sources ul { display: grid; gap: .5rem; margin: .25rem 0 .5rem; padding: 0 0 0 1rem; border-left: 1px solid var(--line); list-style: none; color: var(--text); font-size: .8125rem; line-height: 1.6; }
.card-sources li span { display: block; color: var(--muted); font-size: .75rem; }
.diary-entry summary { min-height: 2rem; cursor: pointer; font-weight: 500; }
.diary-entry p { max-width: 46rem; margin: .5rem 0 .25rem; white-space: pre-wrap; font-size: .875rem; line-height: 1.7; }
@media (max-width: 767px) {
  .account-sections td.action-cell { white-space: normal; }
  .plan-usage .meter { width: 6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .account-sections input[type="checkbox"][role="switch"], .account-sections input[type="checkbox"][role="switch"]::before { transition: none; }
}
.plan-strip + .panel-note { margin-top: .75rem; }
@media (max-width: 767px) {
  .plan-strip dd { font-size: 1.125rem; }
  .plan-strip dd[data-plan-name] { font-size: 1.75rem; }
}
@media (max-width: 767px) {
  /* Stacked rows: the key line of a stacked cell stays under its value, and action cells are just the buttons. */
  .account-sections td.stack-cell[data-label] span { grid-column: 2; }
  .account-sections td.action-cell[data-label] { display: block; padding-top: .5rem; }
  .account-sections td.action-cell[data-label]::before { display: none; }
}

/* ---------- Avatar (r18): circular crop of the stored 512×512 WebP; the initial stands in when there is none ---------- */
.avatar-row dd { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }
.avatar-face { display: grid; place-items: center; width: 4rem; height: 4rem; flex: none; border: 1px solid var(--line); background: var(--surface-soft); color: var(--text); font-family: var(--font-display); font-size: 1.75rem; line-height: 1; }
.avatar-face, .user-hero .avatar { overflow: hidden; border-radius: 50%; }
.avatar-face img, .user-hero .avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar-controls { display: grid; gap: .4rem; min-width: 0; }
.avatar-controls .form-status { min-height: 0; }
.avatar-controls .form-status:empty { display: none; }
.account-ops { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.account-ops .sub-head { margin-top: 0; }
