/* MailHub — midnight theme (default) with light override */
:root {
  --bg: #0b1020;
  --surface: #121a2e;
  --surface-2: #18223b;
  --border: #24304d;
  --text: #e6e9f2;
  --muted: #9aa4bf;
  --accent: #7c9bff;
  --accent-strong: #5b7cff;
  --accent-text: #0b1020;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 12px;
  --shadow: 0 8px 24px rgb(0 0 0 / 0.35);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}

:root[data-theme='light'] {
  --bg: #f5f6fb;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --border: #d9deea;
  --text: #141a2b;
  --muted: #5b6480;
  --accent: #3d5afe;
  --accent-strong: #2a45e0;
  --accent-text: #ffffff;
  --ok: #0f9f6e;
  --warn: #b7791f;
  --danger: #d64545;
  --shadow: 0 8px 24px rgb(20 26 43 / 0.08);
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--accent);
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0 0 0.5rem;
}
h1 {
  font-size: 1.5rem;
}
h2 {
  font-size: 1.15rem;
}
h3 {
  font-size: 1rem;
}
p {
  margin: 0 0 0.75rem;
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 0.875rem;
}
.mono {
  font-family: var(--mono);
  font-size: 0.85rem;
}

.boot,
.noscript {
  display: grid;
  place-items: center;
  min-height: 100dvh;
}

/* ---------- Layout ---------- */
.shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  width: 100%; /* #app keeps .boot (place-items: center); short pages must not shrink the shell */
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 0.75rem;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0.25rem 0.5rem 1rem;
}
.brand img {
  width: 28px;
  height: 28px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}
.nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nav a[aria-current='page'] {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav .icon {
  width: 1.25rem;
  text-align: center;
}
.nav .label-short {
  display: none;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem;
  border-top: 1px solid var(--border);
}

.main {
  padding: 1.5rem clamp(1rem, 3vw, 2.5rem) 4rem;
  max-width: 1100px;
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

/* The hidden attribute must win over component display rules (.btn, .badge…) */
[hidden] {
  display: none !important;
}

/* Shown only on small screens (where the sidebar footer is hidden).
   .btn.mobile-only out-ranks the later `.btn { display: inline-flex }`. */
.mobile-only,
.btn.mobile-only {
  display: none;
}

/* Mobile: bottom tab bar */
@media (max-width: 800px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: fixed;
    inset: auto 0 0 0;
    height: auto;
    flex-direction: row;
    padding: 0.25rem 0.25rem calc(0.25rem + env(safe-area-inset-bottom));
    border-right: none;
    border-top: 1px solid var(--border);
    z-index: 10;
  }
  .brand,
  .sidebar-footer {
    display: none;
  }
  .nav {
    flex-direction: row;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .nav a {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.4rem 0.15rem;
    font-size: 0.68rem;
    white-space: nowrap;
  }
  .nav .label-long {
    display: none;
  }
  .nav .label-short {
    display: inline;
  }
  .nav a[aria-current='page'] {
    box-shadow: inset 0 3px 0 var(--accent);
  }
  .nav .icon {
    font-size: 1.1rem;
  }
  .main {
    padding-bottom: 6rem;
  }
  .main .mobile-only,
  .main .btn.mobile-only {
    display: inline-flex;
  }
}

/* ---------- Components ---------- */
.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  margin-bottom: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}
.card + .card {
  margin-top: 1rem;
}
.grid .card + .card {
  margin-top: 0;
}

.kpi {
  font-size: 2rem;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
  white-space: nowrap;
  flex-shrink: 0;
  overflow-wrap: normal;
}
.badge.ok {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 40%, transparent);
}
.badge.warn {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 40%, transparent);
}
.badge.danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover {
  border-color: var(--accent);
}
.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
.btn.primary:hover {
  background: var(--accent-strong);
}
.btn.danger {
  color: var(--danger);
}
.btn.ghost {
  background: transparent;
}
.btn.block {
  width: 100%;
}

.form {
  display: grid;
  gap: 0.9rem;
}
.field {
  display: grid;
  gap: 0.3rem;
}
.field label {
  font-weight: 600;
  font-size: 0.9rem;
}
.field .hint {
  font-size: 0.8rem;
  color: var(--muted);
}
.field .error {
  font-size: 0.8rem;
  color: var(--danger);
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
.nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.row.end {
  justify-content: flex-end;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.alert.danger {
  border-color: color-mix(in srgb, var(--danger) 50%, transparent);
  color: var(--danger);
}
.alert.warn {
  border-color: color-mix(in srgb, var(--warn) 50%, transparent);
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.list li:last-child {
  border-bottom: none;
}

.steps {
  margin: 0;
  padding-left: 1.25rem;
}
.steps li {
  margin-bottom: 0.4rem;
}

pre.code {
  max-height: 320px;
  overflow: auto;
  padding: 0.75rem;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Auth pages */
.auth {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 1.5rem 1rem;
}
.auth .card {
  width: min(420px, 100%);
  box-shadow: var(--shadow);
}
.auth .brand {
  justify-content: center;
  padding-bottom: 0.5rem;
}

/* Toasts */
.toasts {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  gap: 0.5rem;
  z-index: 50;
}
.toast {
  padding: 0.65rem 1rem;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  max-width: 360px;
}
.toast.danger {
  border-color: var(--danger);
}
.toast.ok {
  border-color: var(--ok);
}
@media (max-width: 800px) {
  .toasts {
    bottom: calc(5rem + env(safe-area-inset-bottom));
    left: 1rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .toast {
    animation: slide-in 160ms ease-out;
  }
  @keyframes slide-in {
    from {
      transform: translateY(8px);
      opacity: 0;
    }
  }
}

.grid.kpis {
  grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr));
}
.grid.kpis .card {
  padding: 0.9rem 1rem;
}

/* ---------- M2: queue, threads, meetings, accounts ---------- */
.badges {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.badge.acct::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--dot, var(--muted));
}
.badge.acct-gmail {
  --dot: #ea4335;
}
.badge.acct-icloud {
  --dot: #3b9eff;
}
.badge.acct-corporateoutlook {
  --dot: #0f6cbd;
}
.badge.acct-whatsapp {
  --dot: #25d366;
}
.badge.you {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.danger-text {
  color: var(--danger);
}
.warn-text {
  color: var(--warn);
}
.kpi.warn {
  color: var(--warn);
}
a.kpi-card {
  display: block;
  color: inherit;
  text-decoration: none;
}
a.kpi-card:hover,
a.kpi-card:focus-visible {
  border-color: var(--accent);
}
.section-gap {
  margin-top: 1.5rem;
}
.small.back {
  display: inline-block;
  margin-bottom: 0.5rem;
  text-decoration: none;
}

.btn.sm {
  min-height: 2rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.85rem;
}
.btn.ghost.danger {
  color: var(--danger);
}

/* Tabs, chips, filters */
.tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs button {
  flex-shrink: 0;
  padding: 0.6rem 0.85rem;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.tabs button:hover {
  color: var(--text);
}
.tabs button[aria-selected='true'] {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.tabs button:focus-visible,
.chip:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.chip {
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.chip:hover {
  color: var(--text);
}
.chip[aria-pressed='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.toggle input {
  width: 1.1rem;
  min-height: 1.1rem;
  margin: 0;
  accent-color: var(--accent);
}
.filters .search {
  flex: 1 1 220px;
  min-width: 0;
}

/* Thread list */
.card.flush {
  padding: 0;
  overflow: hidden;
}
.card.flush > .empty,
.card.flush > div > .empty,
.card.flush > div > .alert,
.card.flush > div > p {
  margin: 1.1rem 1.25rem;
}
.thread-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.thread-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.card:not(.flush) .thread-row {
  padding-inline: 0;
}
.thread-row:last-child {
  border-bottom: none;
}
.thread-row.stalled {
  box-shadow: inset 3px 0 0 var(--warn);
}
.card:not(.flush) .thread-row.stalled {
  box-shadow: none;
}
.thread-row.pending {
  opacity: 0.55;
}
.thread-link {
  flex: 1 1 320px;
  min-width: 0;
  display: grid;
  gap: 0.2rem;
  color: inherit;
  text-decoration: none;
}
.thread-link:hover .thread-subject {
  color: var(--accent);
}
.thread-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}
.thread-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.thread-sender {
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.thread-age {
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
}
.thread-subject,
.thread-preview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.thread-subject {
  font-weight: 500;
}
.thread-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

/* Snooze dropdown */
.menu {
  position: relative;
}
.menu summary {
  list-style: none;
}
.menu summary::-webkit-details-marker {
  display: none;
}
.menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  display: grid;
  min-width: 8.5rem;
  padding: 0.3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.menu-list button {
  padding: 0.5rem 0.7rem;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.menu-list button:hover,
.menu-list button:focus-visible {
  background: var(--surface-2);
}

.empty {
  text-align: center;
  color: var(--muted);
}
.empty p:first-child {
  color: var(--text);
  font-weight: 600;
}
.load-more {
  margin-top: 1rem;
}

/* Thread view */
.thread-header {
  margin-bottom: 0.5rem;
}
.participants {
  margin: 0.5rem 0 0;
}
.alert.summary {
  margin-top: 0.75rem;
}
.thread-toolbar {
  margin: 1rem 0 1.25rem;
  gap: 0.4rem;
}
.messages {
  list-style: none;
  margin: 0;
  padding: 0;
}
.message.out {
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}
.message-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem 1rem;
  margin-bottom: 0.25rem;
}
.message-from {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.5rem;
  min-width: 0;
}
.message-subject {
  font-weight: 600;
  margin-top: 0.25rem;
}
.body-text {
  margin: 0.75rem 0 0.5rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.95rem;
}
.attachments {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0 0;
  padding: 0;
}
.attachments .badge {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Agenda */
.agenda-day h2 {
  font-size: 1rem;
  color: var(--muted);
}
.agenda {
  list-style: none;
  margin: 0;
  padding: 0;
}
.event {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr) auto;
  gap: 0.4rem 1rem;
  align-items: start;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.event:last-child {
  border-bottom: none;
}
.event-time {
  font-weight: 600;
  padding-top: 0.1rem;
  font-variant-numeric: tabular-nums;
}
.event-main {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}
.event-title {
  font-weight: 600;
}
.event.cancelled .event-title,
.event.cancelled .event-time {
  text-decoration: line-through;
  color: var(--muted);
}
.btn.join {
  text-decoration: none;
  white-space: nowrap;
}
@media (max-width: 560px) {
  .event {
    grid-template-columns: minmax(0, 1fr);
  }
  .btn.join {
    justify-self: start;
  }
}

/* Today */
.account-status-main {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}
details.status-card {
  padding: 0.75rem 1.25rem;
}
details.status-card[open] {
  padding-bottom: 1.1rem;
}
details.status-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  list-style: none;
}
details.status-card summary::-webkit-details-marker {
  display: none;
}
.status-title {
  font-weight: 600;
}
.status-title::before {
  content: '▸';
  display: inline-block;
  width: 1.1rem;
  color: var(--muted);
}
details[open] .status-title::before {
  content: '▾';
}
details.status-card[open] > summary {
  margin-bottom: 0.75rem;
}
details.status-card .page-header {
  margin: 1rem 0 0.25rem;
}

/* Settings: accounts & cleanup */
.account-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.account-row {
  display: grid;
  gap: 0.6rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
}
.account-row:first-child {
  padding-top: 0.25rem;
}
.account-row:last-child {
  border-bottom: none;
}
.account-head {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}
.account-result.alert.ok {
  border-color: color-mix(in srgb, var(--ok) 50%, transparent);
}
.rules {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
}
textarea {
  min-height: 6rem;
  resize: vertical;
  font-family: var(--mono);
  font-size: 0.85rem;
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.table th,
.table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.table th {
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.table tr:last-child td {
  border-bottom: none;
}
.table .nowrap {
  white-space: nowrap;
}
.table td {
  overflow-wrap: normal;
}
.table .subject-cell {
  min-width: 14rem;
  overflow-wrap: anywhere;
}

/* ---------- M3: ingest & sync, device tokens ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.dropzone {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  padding: 1.75rem 1rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  text-align: center;
  cursor: pointer;
  transition: border-color 120ms, background 120ms;
}
.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg));
}
.form:has(#ingest-files:focus-visible) .dropzone {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.dropzone-icon {
  font-size: 1.75rem;
  line-height: 1;
  color: var(--accent);
}
.file-list .list li {
  padding: 0.4rem 0;
}
.file-name {
  min-width: 0;
  overflow-wrap: anywhere;
}
.file-meta {
  flex-shrink: 0;
  gap: 0.5rem;
}
.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.table .errors-cell {
  min-width: 12rem;
  overflow-wrap: anywhere;
}
.error-list {
  margin: 0;
  padding-left: 1rem;
}
.code-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.5rem;
  margin: 0.4rem 0 0.5rem;
  min-width: 0;
}
.code-block pre.code {
  margin: 0;
  overflow-wrap: anywhere;
}
.code-copy {
  display: flex;
  padding-top: 0.3rem;
}
.steps.sub {
  margin-top: 0.4rem;
  list-style: lower-alpha;
}
.steps > li > .alert,
.steps > li > .copy-line,
.steps > li > .token-control {
  margin-top: 0.4rem;
}
.copy-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}
.copy-line .mono {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.95rem;
}
.token-control {
  display: grid;
  gap: 0.6rem;
}
.secret-slot:empty {
  display: none;
}
.card > .secret-slot {
  margin-bottom: 1rem;
}
.secret-box {
  display: grid;
  gap: 0.5rem;
  padding: 0.9rem 1rem;
  border: 1px solid color-mix(in srgb, var(--warn) 60%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--warn) 9%, var(--surface));
}
.secret-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.secret-box pre.code.secret-value {
  margin: 0;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
  user-select: all;
}
.secret-box p {
  margin: 0;
}
.badge.scope-bridge {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.badge.scope-ingest {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 40%, transparent);
}
.token-row.revoked .account-head {
  opacity: 0.65;
}
.source-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}
.source-count {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
#ingest-sources .page-header {
  margin-bottom: 0.5rem;
}
@media (min-width: 801px) {
  .token-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
}
.field-pair {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  align-items: start;
}
@media (max-width: 560px) {
  .code-block {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.35rem;
  }
  .code-copy {
    justify-content: flex-end;
    padding-top: 0;
  }
}
