/* TitanSend styles. Mobile first; two columns from 1024px.
   Colours follow the TitanSend brand: navy/purple header, lavender page,
   white cards, purple (#7C3AED) and pink accents. Contrast checked for
   WCAG AA in light and dark mode. */

:root {
  color-scheme: light;
  --bg: #F5F3FF;
  --surface: #FFFFFF;
  --surface-2: #FAF8FF;
  --surface-3: #EDE9FE;
  --border: #E4DEFB;
  --border-strong: #8B78E6;
  /* form fields: 3.5:1 against white */
  --btn-border: #C4B5FD;
  --text: #1F2937;
  --text-2: #4B4668;
  --muted: #625C80;
  --accent: #7C3AED;
  --accent-strong: #6D28D9;
  --accent-soft: #EDE9FE;
  --grad: linear-gradient(135deg, #7C3AED, #DB2777);
  --grad-hover: linear-gradient(135deg, #6D28D9, #BE185D);
  --header: linear-gradient(135deg, #1E1B4B 0%, #312E81 60%, #4C1D95 100%);
  --ok: #047857;
  --ok-soft: #ECFDF5;
  --warn: #B45309;
  --warn-soft: #FFFBEB;
  --opened: #EA580C;
  --danger: #B91C1C;
  --danger-soft: #FEF2F2;
  --focus: #7C3AED;
  --shadow: 0 1px 6px rgba(124, 58, 237, .08);
  --radius: 16px;
  --radius-sm: 10px;
  /* chart */
  --series-1: #7C3AED;
  --grid: #EDE9FE;
  --axis: #C4B5FD;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0F0F1A;
    --surface: #1E1B4B;
    --surface-2: #262260;
    --surface-3: #2D2A5E;
    --border: #37326E;
    --border-strong: #7B6BD6;
    --btn-border: #4C4690;
    --text: #EDE9FE;
    --text-2: #C4B5FD;
    --muted: #A7A1D1;
    --accent: #A78BFA;
    --accent-strong: #C4B5FD;
    --accent-soft: #2D2A5E;
    --ok: #34D399;
    --ok-soft: #103A34;
    --warn: #FBBF24;
    --warn-soft: #3A2E12;
    --opened: #FB923C;
    --danger: #F87171;
    --danger-soft: #3B1A2A;
    --focus: #A78BFA;
    --shadow: none;
    --series-1: #A78BFA;
    --grid: #2D2A5E;
    --axis: #4C4690;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0F0F1A;
  --surface: #1E1B4B;
  --surface-2: #262260;
  --surface-3: #2D2A5E;
  --border: #37326E;
  --border-strong: #7B6BD6;
  --btn-border: #4C4690;
  --text: #EDE9FE;
  --text-2: #C4B5FD;
  --muted: #A7A1D1;
  --accent: #A78BFA;
  --accent-strong: #C4B5FD;
  --accent-soft: #2D2A5E;
  --ok: #34D399;
  --ok-soft: #103A34;
  --warn: #FBBF24;
  --warn-soft: #3A2E12;
  --opened: #FB923C;
  --danger: #F87171;
  --danger-soft: #3B1A2A;
  --focus: #A78BFA;
  --shadow: none;
  --series-1: #A78BFA;
  --grid: #2D2A5E;
  --axis: #4C4690;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.25;
}

h2 {
  font-size: 1.06rem;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: .5rem;
}

h3 {
  font-size: .95rem;
  font-weight: 650;
  margin-bottom: .4rem;
}

p {
  margin: .5rem 0;
}

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

code {
  font-size: .9em;
  background: var(--surface-3);
  padding: .05em .3em;
  border-radius: 4px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 100;
  background: var(--surface);
  padding: .5rem .75rem;
  border-radius: 8px;
}

.skip-link:focus {
  left: 8px;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-thumb {
  background: rgba(124, 58, 237, .3);
  border-radius: 3px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------- Top bar (brand header) ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--header);
  border-bottom: 1px solid rgba(167, 139, 250, .2);
  color: #fff;
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: .7rem 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  text-decoration: none;
}

.brand-name {
  font-weight: 750;
  font-size: 1.3rem;
  letter-spacing: -.01em;
  color: #C4B5FD;
  background: linear-gradient(135deg, #A78BFA, #F472B6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.header-stats {
  display: none;
  align-items: center;
  gap: 1.1rem;
  margin-right: .5rem;
  font-size: .88rem;
  color: rgba(255, 255, 255, .92);
}

.header-stats span {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.header-stats strong {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.header-stats .ri-check-double-line {
  color: #34D399;
}

.header-stats .ri-time-line {
  color: #C4B5FD;
}

@media (min-width: 768px) {
  .header-stats {
    display: flex;
  }
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-size: 1.2rem;
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}

.topbar .icon-btn {
  color: rgba(255, 255, 255, .88);
}

.topbar .icon-btn:hover {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

.topbar :focus-visible {
  outline-color: #fff;
}

.menu-wrap {
  position: relative;
}

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(30, 27, 75, .2);
  padding: .3rem;
  display: flex;
  flex-direction: column;
}

.menu button {
  display: flex;
  align-items: center;
  gap: .5rem;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: .55rem .7rem;
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
}

.menu button:hover,
.menu button:focus-visible {
  background: var(--surface-3);
}

.menu button[aria-checked="true"]::after {
  content: "✓";
  margin-left: auto;
  font-weight: 700;
}

.menu .danger {
  color: var(--danger);
}

/* ---------- Announcement bell + panel ---------- */
#announceButton {
  position: relative;
}

.notif-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #F43F5E;
  box-shadow: 0 0 0 2px #2E2A6E;
}

.announce-panel {
  width: min(270px, 80vw);
  padding: .85rem;
  gap: .6rem;
}

.announce-text {
  margin: 0;
  font-size: .9rem;
  line-height: 1.4;
  color: var(--text);
}

.announce-actions {
  display: flex;
  justify-content: flex-end;
}

/* Keep the panel's primary button looking like a button despite generic .menu button rules. */
.announce-panel .btn {
  width: auto;
  padding: .4rem .9rem;
}

.announce-panel .btn-primary {
  background: var(--grad);
  color: #fff;
  border: 0;
}

.announce-panel .btn-primary:hover,
.announce-panel .btn-primary:focus-visible {
  background: var(--grad-hover);
}

/* ---------- Footer Features: Available now / Coming soon ---------- */
.faq .feat-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin: .9rem 0 .3rem;
  font-size: .92rem;
  font-weight: 700;
  color: #fff;
}

.feat-badge {
  font-size: .66rem;
  font-weight: 700;
  padding: .1rem .45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  color: #FDE68A;
  white-space: nowrap;
}

.faq dt .feat-badge {
  margin-left: .4rem;
}

/* ---------- Notices ---------- */
.notices {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 0 16px;
}

.notice {
  margin-top: .75rem;
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  background: var(--accent-soft);
  color: var(--text);
  border: 1px solid var(--btn-border);
  border-radius: 12px;
  padding: .7rem .85rem;
}

.notice>i {
  font-size: 1.2rem;
  margin-top: .1rem;
  color: var(--accent);
}

.notice.notice-error {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
}

.notice.notice-error>i {
  color: var(--danger);
}

.notice.notice-warn {
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
}

.notice.notice-warn>i {
  color: var(--warn);
}

.notice p {
  margin: 0;
  flex: 1;
}

.notice .notice-actions {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin-top: .4rem;
}

/* ---------- Tabs ---------- */
.tabs-wrap {
  position: sticky;
  top: 58px;
  z-index: 25;
  background: var(--bg);
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: .9rem 16px 0;
}

.global-search-wrap {
  width: min(100% - 2rem, 820px);
  margin: .8rem auto 0;
  position: relative;
}
.global-search-wrap > i {
  position: absolute;
  left: .9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.global-search-wrap input {
  width: 100%;
  min-height: 46px;
  padding: .65rem .8rem .65rem 2.7rem;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  max-width: 520px;
  box-shadow: var(--shadow);
}

.tabs [role="tab"] {
  border: 0;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-weight: 600;
  padding: .55rem .55rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: .9rem;
  line-height: 1.25;
}

.tabs [role="tab"][aria-selected="true"] {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.tabs #tab-extractor { white-space: nowrap; }
.tabs #tab-extractor i { margin-right: .25rem; }

@media (max-width: 380px) {
  .tabs [role="tab"] { font-size: .76rem; padding-inline: .3rem; }
}

/* ---------- Layout ---------- */
main {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px 2rem;
}

.flow {
  list-style: none;
  counter-reset: flow;
  margin: .9rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .9rem;
  font-size: .82rem;
  color: var(--muted);
}

.flow li {
  counter-increment: flow;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.flow li::before {
  content: counter(flow);
  display: inline-grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: .72rem;
  font-weight: 700;
}

.layout {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

/* Scoutier-inspired dashboard flow, restyled with TitanSend's own tokens. */
#panel-dashboard .dashboard-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  width: min(100%, 820px);
  margin: 1.1rem auto 0;
}

#panel-dashboard .dashboard-heading h1 {
  margin: 0;
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
}

#panel-dashboard .dashboard-heading h1 i { color: var(--accent); }

#panel-dashboard .layout {
  width: min(100%, 820px);
  margin: .75rem auto 0;
  grid-template-columns: minmax(0, 1fr);
}

#panel-dashboard .col { display: contents; }

#panel-dashboard .card {
  border-radius: 18px;
  padding: clamp(.85rem, 2vw, 1.1rem);
}

#panel-dashboard .campaign-card { padding: .75rem .9rem; }
.campaign-options { margin-top: .45rem; }
.campaign-options summary { color: var(--muted); font-size: .85rem; cursor: pointer; }
.campaign-options .badge { margin-left: .35rem; }

.recipient-mode { width: fit-content; margin: 0 0 .75rem; }
.recipient-mode .seg { min-width: 6rem; }

.multi-message {
  margin: .2rem 0 1rem;
  padding: .7rem .8rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}
.multi-message-toggle { display: flex; align-items: center; gap: .7rem; cursor: pointer; }
.multi-message-toggle input { width: 1.2rem; height: 1.2rem; accent-color: var(--accent); }
.multi-message-toggle span { display: grid; line-height: 1.35; }
.multi-message-toggle small { color: var(--muted); }
.message-variants { margin-top: .7rem; }
.variant-card { padding: .75rem; margin-top: .6rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.variant-card .card-head { margin-bottom: .4rem; }
.variant-card textarea { min-height: 5rem; }
.compose-suggestions { display: flex; flex-wrap: wrap; gap: .4rem; margin: .45rem 0; }
.compose-tool { margin: .1rem 0 .75rem; }
.writing-tools { margin-top: .8rem; }
.writing-tools .btn-row { margin-top: .6rem; }
.generate-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; margin-bottom: .65rem; }
.upload-controls { align-items: center; justify-content: space-between; margin-top: .55rem; }
.upload-controls .small { overflow-wrap: anywhere; }
.template-actions .btn { color: var(--accent-strong); }

.url-scout {
  display: grid;
  gap: .65rem;
  margin: .7rem 0;
  padding: .75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.url-scout-progress { width: 100%; height: .55rem; accent-color: var(--accent); }

.sender-rotation {
  margin: .75rem 0;
  padding: .75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.sender-rotation-head,
.sender-rotation-current {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .55rem;
}

.sender-rotation .hint { margin: .45rem 0; }
.sender-rotation textarea { min-height: 4rem; }
.sender-rotation-current { margin-top: .55rem; font-size: .88rem; }
.sender-rotation-current strong { overflow-wrap: anywhere; }

/* ---------- Email Extractor ---------- */
.extractor-page {
  width: min(100%, 820px);
  margin: 0 auto;
  padding-top: 1rem;
  display: grid;
  gap: 1rem;
}

.extractor-title {
  display: grid;
  gap: .35rem;
}

.extractor-title h1 {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: clamp(1.35rem, 4vw, 1.8rem);
  letter-spacing: -.02em;
}

.extractor-title h1 i { color: var(--accent); }
.extractor-title p { margin: 0; max-width: 68ch; }

.extractor-locked {
  width: min(100%, 620px);
  margin: 2rem auto;
  padding: clamp(1.25rem, 5vw, 2.25rem);
  text-align: center;
}

.extractor-locked-icon {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin: 0 auto .75rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 1.5rem;
}

.extractor-locked h1 {
  margin: 0 0 .5rem;
  font-size: clamp(1.2rem, 4vw, 1.6rem);
}

.extractor-locked p {
  margin: 0;
  color: var(--muted);
}

.extractor-file-row {
  align-items: center;
  margin-top: .65rem;
}

.extractor-file-row .small { flex: 1 1 100%; }
.extractor-file-row .text-danger { color: var(--danger); }
.extractor-bulk-description { margin: -.25rem 0 .75rem; }

.extractor-extra-pages {
  min-width: 0;
  margin: 0 0 1rem;
  padding: .8rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.extractor-extra-pages legend {
  padding: 0 .25rem;
  font-weight: 650;
}

.extractor-extra-pages > .hint { margin: 0 0 .55rem; }

.extractor-path-presets,
.extractor-selected-paths {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.extractor-path-presets .chip,
.extractor-selected-paths .chip {
  min-height: 34px;
}

.extractor-path-presets .chip[aria-pressed="true"],
.extractor-path-presets .chip.is-selected {
  color: var(--surface);
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.extractor-selected-paths:empty { display: none; }
.extractor-selected-paths:not(:empty) { margin-top: .5rem; }
.extractor-add-path-row { margin-top: .6rem; }
.extractor-policy-check { margin-bottom: 0; }

.extractor-scope {
  color: var(--text-2);
  margin: -.15rem 0 .85rem;
}

.extractor-country { max-width: 420px; margin-bottom: .85rem; }

.extractor-progress-bar {
  display: block;
  width: 100%;
  height: 12px;
  margin: .25rem 0 1rem;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  accent-color: var(--accent);
  background: var(--surface-3);
}

.extractor-progress-bar::-webkit-progress-bar { background: var(--surface-3); border-radius: 999px; }
.extractor-progress-bar::-webkit-progress-value { background: var(--grad); border-radius: 999px; }
.extractor-progress-bar::-moz-progress-bar { background: var(--accent); border-radius: 999px; }

.extractor-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
}

.extractor-stats .tile { min-width: 0; }
.extractor-stats .tile strong { font-variant-numeric: tabular-nums; }

.extractor-debug {
  margin-top: .85rem;
  padding: .8rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.extractor-debug-head,
.extractor-debug-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
}

.extractor-debug-head h2,
.extractor-debug-head h3 {
  margin: 0;
  font-size: 1rem;
}

.extractor-debug-head h2 i,
.extractor-debug-head h3 i { color: var(--accent); }

.extractor-debug-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
  margin-top: .65rem;
}

.extractor-debug-metrics .tile {
  text-align: left;
  padding: .55rem .65rem;
  background: var(--surface);
}

.extractor-debug-metrics .tile span {
  display: block;
  text-transform: uppercase;
  letter-spacing: .035em;
  font-size: .7rem;
}

.extractor-debug-metrics .tile strong { font-size: 1rem; }
.extractor-debug > .small { margin: .55rem 0 0; }
.extractor-debug-actions { justify-content: flex-end; margin-top: .55rem; }

.extractor-log-panel {
  margin-top: .65rem;
  padding: .65rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.extractor-log-panel > .hint { margin: 0; }

.extractor-log-list {
  max-height: 15rem;
  overflow: auto;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: .8rem;
}

.extractor-log-list li {
  padding: .4rem 0;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
}

.extractor-log-list li:last-child { border-bottom: 0; }

.extractor-results-scroll { max-height: min(62vh, 720px); }

.extractor-table { min-width: 650px; table-layout: fixed; }
.extractor-table th:first-child { width: 34%; }
.extractor-table th:nth-child(2) { width: 38%; }
.extractor-table th:nth-child(3) { width: 28%; }
.extractor-table td { overflow-wrap: anywhere; vertical-align: top; }
.extractor-table a { overflow-wrap: anywhere; }
.extractor-row-note { display: block; margin-top: .25rem; color: var(--muted); font-size: .78rem; }

.extractor-export-row { margin-top: .9rem; }
.extractor-export-row .btn { flex: 1 1 140px; }

@media (max-width: 480px) {
  .extractor-stats { gap: .4rem; }
  .extractor-stats .tile { padding: .6rem .35rem; }
  .extractor-stats .tile strong { font-size: 1.1rem; }
  .extractor-stats .tile span { font-size: .74rem; }
  .extractor-debug-metrics { gap: .4rem; }
  .extractor-debug-metrics .tile { padding: .5rem .4rem; }
  .extractor-debug-metrics .tile strong { font-size: .95rem; }
  .extractor-debug-metrics .tile span { font-size: .64rem; }
}

.col {
  display: grid;
  gap: 1rem;
  align-content: start;
  min-width: 0;
}

@media (min-width: 1024px) {
  .layout {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: start;
  }
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  min-width: 0;
}

@media (min-width: 640px) {
  .card {
    padding: 1.25rem;
  }
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .75rem;
}

.card-head h2 i {
  color: var(--accent);
}

.step {
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  flex: none;
}

.badge {
  font-size: .75rem;
  font-weight: 600;
  padding: .15rem .55rem;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  white-space: nowrap;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge:empty {
  display: none;
}

.badge.badge-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge.badge-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.hint {
  color: var(--muted);
  font-size: .85rem;
}

.note {
  color: var(--text-2);
  font-size: .85rem;
  display: flex;
  gap: .4rem;
  align-items: flex-start;
}

.small {
  font-size: .82rem;
}

.muted {
  color: var(--muted);
}

.danger {
  color: var(--danger) !important;
}

/* ---------- Forms ---------- */
.label {
  display: block;
  font-weight: 600;
  font-size: .88rem;
  margin: .75rem 0 .35rem;
}

.label:first-child {
  margin-top: 0;
}

.field {
  display: grid;
  gap: .3rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: .6rem;
}

input[type="text"],
input[type="email"],
input[type="search"],
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: .6rem .75rem;
  min-height: 44px;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

#recipients {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .85rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--focus);
  outline-offset: 0;
  border-color: transparent;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, .15);
}

select {
  appearance: auto;
}

.check {
  display: flex;
  gap: .55rem;
  align-items: flex-start;
  margin: .75rem 0;
  font-size: .9rem;
  cursor: pointer;
}

.check input {
  width: 18px;
  height: 18px;
  margin-top: .15rem;
  accent-color: var(--accent);
  flex: none;
}

.row {
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}

.row+.row,
.row+.btn-row,
.btn-row+.row {
  margin-top: .5rem;
}

.grow {
  flex: 1 1 160px;
  min-width: 0;
}

.grid-3 {
  display: grid;
  gap: .25rem .75rem;
}

@media (min-width: 640px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.field-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  margin-top: .4rem;
}

.tag-row {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 44px;
  padding: .5rem .95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--btn-border);
  background: var(--surface);
  color: var(--accent-strong);
  font: inherit;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  background: var(--surface-3);
  border-color: var(--accent);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: .5;
  cursor: not-allowed;
}

.btn-small {
  min-height: 38px;
  padding: .35rem .75rem;
  font-size: .84rem;
}

.btn-primary {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 8px rgba(124, 58, 237, .3);
}

.btn-primary:hover {
  background: var(--grad-hover);
  border-color: transparent;
}

.btn-primary:disabled {
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--surface-3);
  border-color: transparent;
}

.btn-block {
  width: 100%;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .75rem;
}

.card-head+.row {
  margin-top: 0;
}

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent-strong);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.chip {
  border: 1px solid var(--btn-border);
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-radius: 999px;
  padding: .2rem .6rem;
  font: inherit;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  min-height: 32px;
}

.chip:hover {
  border-color: var(--accent);
}

.seg-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.seg {
  border: 0;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: .84rem;
  font-weight: 600;
  padding: .35rem .8rem;
  border-radius: 999px;
  cursor: pointer;
  min-height: 34px;
}

.seg[aria-pressed="true"],
.seg[aria-checked="true"] {
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: 0 0 0 1px var(--btn-border);
  font-weight: 700;
}

.seg span {
  color: var(--muted);
  font-weight: 500;
}

/* ---------- Details (collapsible sub-sections) ---------- */
details.sub {
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: .9rem;
  background: var(--surface-2);
}

details.sub>summary {
  list-style: none;
  cursor: pointer;
  padding: .65rem .85rem;
  font-weight: 600;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-height: 44px;
}

details.sub>summary::-webkit-details-marker {
  display: none;
}

details.sub>summary::after {
  content: "\ea4e";
  font-family: remixicon;
  font-weight: 400;
  color: var(--accent);
  transition: transform .15s;
}

details.sub[open]>summary::after {
  transform: rotate(180deg);
}

details.sub> :not(summary) {
  margin-left: .85rem;
  margin-right: .85rem;
}

details.sub> :last-child {
  margin-bottom: .85rem;
}

/* ---------- Recipient counts & reports ---------- */
.counts {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .9rem;
  margin: .6rem 0 0;
  font-size: .86rem;
  color: var(--text-2);
}

.count {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}

.count strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.count-ok i {
  color: var(--ok);
}

.count-bad i {
  color: var(--danger);
}

.count-warn i {
  color: var(--warn);
}

.alert {
  border-radius: 10px;
  padding: .6rem .8rem;
  font-size: .88rem;
}

.alert-error {
  background: var(--danger-soft);
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
}

.alert-warn {
  background: var(--warn-soft);
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
}

.alert-ok {
  background: var(--ok-soft);
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent);
}

.report {
  margin-top: .75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .75rem .85rem;
  font-size: .88rem;
}

details.sub .report {
  background: var(--surface);
}

.report h4 {
  margin: 0 0 .35rem;
  font-size: .9rem;
}

.report ul {
  margin: .35rem 0;
  padding-left: 1.1rem;
}

.report li {
  overflow-wrap: anywhere;
}

.report .btn-row {
  margin-top: .5rem;
}

.drop {
  margin-top: .6rem;
  border: 2px dashed var(--btn-border);
  border-radius: 12px;
  padding: 1rem;
  display: grid;
  justify-items: center;
  gap: .35rem;
  text-align: center;
  background: var(--surface);
}

.drop.dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.drop p {
  margin: 0;
  color: var(--text-2);
  font-size: .9rem;
}

.drop-icon {
  font-size: 1.6rem;
  color: var(--accent);
}

/* ---------- Templates ---------- */
.template-list {
  display: grid;
  gap: .6rem;
  margin-top: .25rem;
}

@media (min-width: 640px) {
  .template-list {
    grid-template-columns: 1fr 1fr;
  }
}

.template {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .75rem;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: .35rem;
  min-width: 0;
}

.template-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .5rem;
}

.template-name {
  font-weight: 650;
  overflow-wrap: anywhere;
}

.template-cat {
  font-size: .72rem;
  font-weight: 600;
  padding: .1rem .5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  white-space: nowrap;
}

.template-snippet {
  color: var(--muted);
  font-size: .84rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.template-actions {
  display: flex;
  gap: .35rem;
  margin-top: auto;
}

/* ---------- Checks ---------- */
.check-list {
  list-style: none;
  padding: 0;
  margin: .5rem 0 0;
  display: grid;
  gap: .4rem;
}

.check-list li {
  display: flex;
  gap: .45rem;
  font-size: .88rem;
  align-items: flex-start;
}

.check-list i {
  margin-top: .12rem;
}

.check-list .lvl-warn i {
  color: var(--warn);
}

.check-list .lvl-info i {
  color: var(--accent);
}

.check-list .lvl-ok i {
  color: var(--ok);
}

/* ---------- Preview ---------- */
.preview {
  margin-top: .75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.preview-row {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: .5rem;
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}

.preview-key {
  color: var(--muted);
}

.preview-val {
  overflow-wrap: anywhere;
  font-weight: 600;
}

.preview-body {
  padding: .75rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: .9rem;
  max-height: 320px;
  overflow: auto;
  background: var(--surface-2);
}

.preview-empty {
  color: var(--muted);
  font-style: italic;
}

.values {
  list-style: none;
  padding: 0;
  margin: .6rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.values li {
  font-size: .78rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .15rem .6rem;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.values .src-fallback {
  border-style: dashed;
  border-color: var(--btn-border);
}

.values .src-guess {
  background: var(--warn-soft);
}

.summary-list {
  margin-top: .6rem;
  display: grid;
  gap: .3rem;
  font-size: .85rem;
  color: var(--text-2);
}

/* ---------- Accordion card (Preview & test) ---------- */
.card-accordion {
  padding: 0;
}

.accordion>summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem;
  min-height: 56px;
  border-radius: var(--radius);
}

.accordion>summary::-webkit-details-marker {
  display: none;
}

.accordion>summary:hover .accordion-hint {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.accordion-hint {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  color: var(--accent-strong);
  font-size: .84rem;
  font-weight: 600;
  white-space: nowrap;
}

.accordion-hint::before {
  content: "\ea4e";
  font-family: remixicon;
  font-weight: 400;
  font-size: 1.1rem;
  transition: transform .15s;
}

.accordion[open] .accordion-hint::before {
  transform: rotate(180deg);
}

.accordion .when-open,
.accordion[open] .when-closed {
  display: none;
}

.accordion[open] .when-open {
  display: inline;
}

.accordion-body {
  padding: 0 1rem 1rem;
}

@media (min-width: 640px) {
  .accordion>summary {
    padding: 1.1rem 1.25rem;
  }

  .accordion-body {
    padding: 0 1.25rem 1.25rem;
  }
}

.subhead {
  margin: 1.1rem 0 .4rem;
  font-size: .9rem;
}

.check-top {
  margin-top: 0;
}

/* ---------- Live Dashboard (brand gradient card) ---------- */
.live-dash {
  background: linear-gradient(135deg, #4C1D95 0%, #7C3AED 55%, #DB2777 100%);
  color: #fff;
  border: 0;
  box-shadow: 0 8px 24px rgba(124, 58, 237, .25);
}

.live-dash h2,
.live-dash h2 i {
  color: #fff;
}

.live-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin-top: 1rem;
}

.live-tile {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 12px;
  padding: .7rem .5rem;
  text-align: center;
  min-width: 0;
}

.live-tile strong {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.live-tile span {
  font-size: .8rem;
  font-weight: 600;
}

.live-tile-wide {
  grid-column: auto;
}

.live-tile-wide strong {
  font-size: 1.6rem;
}

.live-ring {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 1rem auto .35rem;
}

.live-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  display: block;
}

.live-ring circle {
  fill: none;
  stroke-width: 3;
}

.ring-track {
  stroke: rgba(255, 255, 255, .25);
}

.ring-fill {
  stroke: #fff;
  stroke-linecap: round;
  transition: stroke-dasharray .3s ease;
}

.live-ring-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1rem;
}

.live-progress-copy { display: flex; justify-content: space-between; margin: .75rem 0 .3rem; color: #fff; font-size: .84rem; font-weight: 600; }
.live-progress-track { width: 100%; height: 9px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.2); }
.live-progress-fill { display: block; width: 0; height: 100%; border-radius: inherit; background: #fff; transition: width .25s ease; }

@media (max-width: 390px) {
  .live-grid { gap: .35rem; }
  .live-tile { padding: .6rem .25rem; }
  .live-tile strong,
  .live-tile-wide strong { font-size: 1.18rem; }
  .live-tile span { font-size: .7rem; }
}

.live-note {
  text-align: center;
  font-size: .8rem;
  margin: .35rem 0 0;
  color: #fff;
}

/* ---------- Generated Emails ---------- */
.empty {
  text-align: center;
  padding: 1.25rem .5rem;
}

.empty-icon {
  font-size: 2rem;
  color: var(--accent);
}

.empty-title {
  font-weight: 650;
  margin: .25rem 0 0;
}

.ge-intro {
  font-size: .86rem;
  color: var(--text-2);
  margin: 0 0 .35rem;
}

.ge-summary {
  font-size: .82rem;
  color: var(--muted);
  margin: 0 0 .75rem;
}

.ge-tools {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin-bottom: .6rem;
}

.fchips {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.fchip {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  padding: .3rem .7rem;
  border-radius: 8px;
  min-height: 36px;
  cursor: pointer;
}

.fchip:hover {
  border-color: var(--btn-border);
}

.fchip[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
  font-weight: 700;
}

.ge-next {
  margin-left: auto;
}

.ge-search {
  flex: 1 1 100%;
  min-height: 40px !important;
  padding: .45rem .7rem !important;
  font-size: .88rem !important;
}

@media (min-width: 560px) {
  .ge-search {
    flex: 1 1 180px;
    order: 3;
  }
}

/* Lock Mode: control row above the queue, and the dimmed, paused edit column. */
.lock-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin-bottom: .6rem;
}

.lock-row .small {
  flex: 1 1 12rem;
}

#lockToggle[aria-pressed="true"] {
  border-color: var(--warn);
  color: var(--warn);
}

#editColumn.locked {
  opacity: .68;
}

#panel-dashboard #editColumn.locked {
  display: contents;
  opacity: 1;
}

#panel-dashboard #editColumn.locked > .card { opacity: .68; }

#editColumn.locked .card {
  position: relative;
}

.ge-list {
  list-style: none;
  margin: 0 -.25rem;
  padding: .15rem 0;
}

@media (min-width: 1024px) {
  .ge-list {
    max-height: 34rem;
    overflow-y: auto;
  }
}

/* Simple numbered email list with no table-like dividers. */
.ge-row {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  align-items: center;
  column-gap: .45rem;
  padding: .4rem .4rem;
}
.ge-row.is-selected { background: var(--accent-soft); outline: 2px solid var(--accent); outline-offset: -2px; }
.ge-done { cursor: default; }
.restore-opened { min-width: 36px; padding-inline: .45rem; color: var(--accent-strong); }
.queue-selection-actions { align-items: center; padding: .55rem 0; }
.ge-row.is-opened .ge-link { color: var(--opened); }
.ge-row.is-pending .ge-link { color: var(--ok); }

@media (max-width: 480px) {
  .tabs-wrap { top: 54px; padding-top: .45rem; }
  .global-search-wrap { width: calc(100% - 1.4rem); margin-top: .6rem; }
  #panel-dashboard .layout { width: calc(100% - 1rem); }
  #panel-dashboard .card { padding: .85rem; }
  .ge-row { grid-template-columns: 1.5rem minmax(0, 1fr) auto; column-gap: .25rem; padding-right: .35rem; }
  .restore-opened { min-width: 32px; }
  .generate-actions .btn { min-width: 0; }
}

.ge-num {
  color: var(--muted);
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  padding-top: .45rem;
}

/* "Did you send the email to …?" prompt above the list */
.confirm-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .75rem;
  margin-bottom: .6rem;
  background: var(--accent-soft);
  border: 1px solid var(--btn-border);
  border-radius: 12px;
  padding: .6rem .75rem;
}

.confirm-bar>i {
  color: var(--accent);
  font-size: 1.2rem;
}

.confirm-bar p {
  margin: 0;
  flex: 1 1 12rem;
  font-size: .88rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.confirm-actions {
  display: flex;
  gap: .35rem;
  margin-left: auto;
}

.ge-link {
  display: inline-block;
  padding: .3rem 0;
  line-height: 1.35;
  font-size: .92rem;
  font-weight: 500;
  color: var(--accent-strong);
  text-decoration: none;
  overflow-wrap: anywhere;
  border-radius: 4px;
}

.ge-link:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* A clicked ("opened") link turns orange; unclicked links stay accent-coloured. */
.is-opened .ge-link {
  color: var(--opened);
  font-weight: 600;
}

/* A clicked address is locked: shown orange but not a clickable link. */
.ge-done {
  cursor: default;
}

.ge-link.ge-done:hover {
  text-decoration: none;
}

/* Comfortable tap targets on touch screens and at phone widths */
@media (pointer: coarse),
(max-width: 599px) {

  .fchip,
  .confirm-bar .btn {
    min-height: 44px;
  }
}

.ge-empty {
  grid-column: 1 / -1;
  padding: 1.1rem .75rem;
  text-align: center;
  color: var(--muted);
  font-size: .88rem;
}

/* 24-hour and analytics tiles */
.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
  margin: 0 0 .75rem;
}

.tile {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .6rem .4rem;
  text-align: center;
  min-width: 0;
}

.tile strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.tile span {
  font-size: .78rem;
  color: var(--muted);
}

/* ---------- Analytics ---------- */
.table-scroll {
  overflow-x: auto;
}

.summary-table,
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

.summary-table th,
.summary-table td,
.data-table th,
.data-table td {
  padding: .5rem .5rem;
  border-bottom: 1px solid var(--border);
  text-align: right;
}

.summary-table th:first-child,
.summary-table td:first-child,
.data-table th:first-child,
.data-table td:first-child {
  text-align: left;
}

.summary-table thead th,
.data-table thead th {
  color: var(--muted);
  font-weight: 600;
  font-size: .8rem;
}

.summary-table td,
.data-table td {
  font-variant-numeric: tabular-nums;
}

.summary-table tbody th {
  font-weight: 600;
}

.chart-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .5rem;
}

.chart {
  position: relative;
  min-height: 220px;
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart .gridline {
  stroke: var(--grid);
  stroke-width: 1;
}

.chart .baseline {
  stroke: var(--axis);
  stroke-width: 1;
}

.chart .tick {
  fill: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.chart .bar {
  fill: var(--series-1);
}

.chart .bar-hit {
  fill: transparent;
  cursor: default;
}

.chart .bar-hit:hover+.bar,
.chart .bar-hit:focus+.bar {
  opacity: .8;
}

.chart .bar-hit:focus {
  outline: none;
}

.chart .bar-hit:focus-visible {
  stroke: var(--focus);
  stroke-width: 2;
}

.chart .value-label {
  fill: var(--text);
  font-size: 11px;
  font-weight: 600;
}

.chart-empty {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 200px;
  padding: 1rem;
  border: 1px dashed var(--btn-border);
  border-radius: 12px;
  color: var(--muted);
  font-size: .9rem;
}

.chart-empty i {
  font-size: 1.6rem;
  display: block;
  margin-bottom: .25rem;
  color: var(--accent);
}

.tooltip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .45rem .6rem;
  font-size: .82rem;
  box-shadow: 0 8px 24px rgba(30, 27, 75, .2);
  max-width: 240px;
}

.tooltip strong {
  display: block;
  font-size: 1rem;
}

.tooltip .tt-key {
  display: inline-block;
  width: 12px;
  height: 2px;
  background: var(--series-1);
  vertical-align: middle;
  margin-right: .35rem;
}

.quality {
  display: grid;
  gap: .5rem;
}

.quality-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
}

.quality-grid .tile {
  text-align: left;
  padding: .6rem .7rem;
}

.quality-grid .tile strong {
  font-size: 1.15rem;
}

.domain-list {
  list-style: none;
  margin: .25rem 0 0;
  padding: 0;
  display: grid;
  gap: .45rem;
}

.domain-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .15rem .5rem;
  font-size: .88rem;
}

.domain-list .d-name {
  overflow-wrap: anywhere;
}

.domain-list .d-count {
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}

.domain-list .d-bar {
  grid-column: 1 / -1;
  height: 6px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
}

.domain-list .d-bar span {
  display: block;
  height: 100%;
  background: var(--series-1);
  border-radius: 999px;
}

.activity {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .45rem;
}

.activity li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .6rem;
  font-size: .88rem;
}

.activity time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: .8rem;
  padding-top: .05rem;
}

.activity span {
  overflow-wrap: anywhere;
}

/* ---------- Footer (brand gradient) ---------- */
.footer {
  background: var(--header);
  color: rgba(255, 255, 255, .85);
  margin-top: 1rem;
  border-top: 1px solid rgba(167, 139, 250, .2);
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.25rem 16px 2rem;
}

.footer a,
.footer .link-btn {
  color: #DDD6FE;
}

.footer .muted {
  color: rgba(255, 255, 255, .72);
}

.footer code {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

.footer :focus-visible {
  outline-color: #fff;
}

.privacy {
  display: flex;
  gap: .5rem;
  align-items: flex-start;
  font-size: .88rem;
}

.privacy i {
  color: #F9A8D4;
  margin-top: .1rem;
}

.faq {
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 12px;
  padding: 0 .85rem;
  margin-bottom: 1rem;
}

.faq summary {
  cursor: pointer;
  font-weight: 650;
  padding: .7rem 0;
  min-height: 44px;
  color: #fff;
}

.faq dl {
  margin: 0 0 .85rem;
}

.faq dt {
  font-weight: 600;
  margin-top: .6rem;
  color: #fff;
}

.faq dd {
  margin: .15rem 0 0;
  font-size: .9rem;
}

/* ---------- Dialogs ---------- */
.dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  background: var(--surface);
  color: var(--text);
  width: min(640px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
}

.dialog::backdrop {
  background: rgba(15, 15, 26, .6);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem .75rem .75rem 1.1rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.dialog-body {
  padding: 1rem 1.1rem;
  display: grid;
  gap: 1.1rem;
}

.dialog-body section+section {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  padding: .75rem 1.1rem 1rem;
  border-top: 1px solid var(--border);
}

.usage {
  margin: .25rem 0 0;
  padding-left: 1.1rem;
  font-size: .88rem;
  color: var(--text-2);
}

/* ---------- Toasts ---------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 60;
  display: grid;
  gap: .5rem;
  width: min(520px, calc(100vw - 32px));
  pointer-events: none;
}

.toasts>* {
  pointer-events: auto;
}

.toast {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: #1E1B4B;
  color: #F5F3FF;
  border: 1px solid rgba(167, 139, 250, .35);
  border-radius: 12px;
  padding: .65rem .8rem;
  box-shadow: 0 10px 30px rgba(15, 15, 26, .3);
  font-size: .9rem;
}

.toast p {
  margin: 0;
  flex: 1;
}

.toast button {
  border: 0;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font: inherit;
  font-weight: 650;
  padding: .35rem .7rem;
  border-radius: 8px;
  cursor: pointer;
  min-height: 36px;
}

.toast button:hover {
  background: rgba(255, 255, 255, .2);
}

.toast.toast-error {
  background: #7F1D1D;
  border-color: rgba(248, 113, 113, .4);
}

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

@media (forced-colors: active) {
  .brand-name {
    -webkit-text-fill-color: CanvasText;
    color: CanvasText;
    background: none;
  }

  .live-dash {
    background: Canvas;
    color: CanvasText;
    border: 1px solid CanvasText;
  }

  .ring-fill {
    stroke: Highlight;
  }

  .ring-track {
    stroke: GrayText;
  }

  .chart .bar {
    fill: CanvasText;
  }

  .domain-list .d-bar span {
    background: Highlight;
  }
}

.auto-scout {
  margin: .75rem 0;
  padding: .75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.auto-scout-head,
.auto-scout-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}

.auto-scout-head {
  justify-content: space-between;
  margin-bottom: .65rem;
}

.auto-scout-row {
  margin-top: .55rem;
  font-size: .85rem;
}

.auto-scout-toggle {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 44px;
  cursor: pointer;
}

.auto-scout-toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.auto-scout-switch {
  position: relative;
  display: inline-block;
  width: 2.6rem;
  height: 1.45rem;
  border-radius: 999px;
  background: var(--border);
  transition: background .15s ease;
}

.auto-scout-switch::after {
  content: "";
  position: absolute;
  top: .15rem;
  left: .15rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: #fff;
  transition: transform .15s ease;
}

.auto-scout-toggle input:checked+.auto-scout-switch {
  background: var(--accent);
}

.auto-scout-toggle input:checked+.auto-scout-switch::after {
  transform: translateX(1.15rem);
}

.auto-scout-toggle input:focus-visible+.auto-scout-switch {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.auto-scout-presets {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}

.auto-scout-custom {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}

.auto-scout-custom input,
.auto-scout-number {
  width: 4.25rem;
  min-height: 36px;
  padding: .3rem;
  text-align: center;
}

@media (max-width: 480px) {
  .auto-scout-row {
    align-items: flex-start;
  }
}
