/* Revisit_Pilot: indigo, lavender and apricot. Shared semantic color tokens. */
:root {
  color-scheme: light;
  /* Shared geometry: controls, field groups and content surfaces. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --control-height: 44px;
  --control-radius: 10px;
  --surface-padding: 24px;
  --ink: #252540;
  --muted: #646177;
  --paper: #f7f6fc;
  --surface: #ffffff;
  --surface-soft: #f1eff9;
  --sidebar: #eeebf8;
  --line: #ddd8ed;
  --input-line: #9384b1;
  --accent: #5943bb;
  --accent-hover: #483399;
  --on-accent: #ffffff;
  --highlight: #ffcea4;
  --hero: #e9e2fc;
  --hero-line: #d5c9f4;
  --hero-text: #574b7d;
  --orbit: #9581c1;
  --hover: #e2dcf2;
  --focus: #7453d5;
  --focus-halo: #e5ddfa;
  --badge-bg: #ebe5fb;
  --badge-text: #62479e;
  --success-bg: #e7f1eb;
  --success-text: #326c4f;
  --warning-bg: #fbeddc;
  --warning-text: #885620;
  --error-bg: #fbe9e8;
  --danger: #a13745;
  --danger-button: #a13745;
  --auth-bg: #302451;
  --auth-text: #f5f0ff;
  --auth-muted: #d0c5e5;
  --shadow: #24203926;
  --backdrop: #18122980;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 14px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #efedf8;
  --muted: #b0aac6;
  --paper: #121220;
  --surface: #1c1b30;
  --surface-soft: #242139;
  --sidebar: #181726;
  --line: #37324d;
  --input-line: #716484;
  --accent: #b7a2ff;
  --accent-hover: #cbbbff;
  --on-accent: #21183f;
  --highlight: #ffcea4;
  --hero: #302345;
  --hero-line: #544063;
  --hero-text: #d3c4e7;
  --orbit: #8f739f;
  --hover: #342b4c;
  --focus: #cbbbff;
  --focus-halo: #3e3059;
  --badge-bg: #382c51;
  --badge-text: #d5c4ff;
  --success-bg: #20372f;
  --success-text: #a3dbb6;
  --warning-bg: #413024;
  --warning-text: #f3c48e;
  --error-bg: #432635;
  --danger: #ffb2bf;
  --danger-button: #e6a2b0;
  --auth-bg: #20172f;
  --auth-text: #f5f0ff;
  --auth-muted: #d0c5e5;
  --shadow: #00000040;
  --backdrop: #080610b3;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  border: 0;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
a {
  color: var(--accent);
}
.layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
  max-width: 1920px;
  margin-inline: auto;
}
.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 32px 22px;
  display: flex;
  flex-direction: column;
  gap: 36px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.7px;
}
.mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--auth-bg);
  color: var(--highlight);
  border-radius: 11px;
  flex-shrink: 0;
  object-fit: contain;
}
.workspace {
  padding: 15px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}
.workspace strong {
  display: block;
  font-size: 13px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.7px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin: 0 0 10px;
}
.workspace small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.nav button {
  text-align: left;
  padding: 13px 14px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  gap: 14px;
}
.nav button.active {
  background: var(--accent);
  color: var(--on-accent);
}
.nav button:hover:not(.active) {
  background: var(--hover);
}
.nav-icon {
  font-size: 17px;
  line-height: 1;
}
.sidebar-bottom {
  margin-top: auto;
}
.sandbox {
  border: 1px solid var(--hero-line);
  border-radius: 10px;
  padding: 14px;
  font-size: 11px;
  line-height: 1.7;
  background: var(--hero);
}
.sandbox strong {
  display: block;
  font-size: 12px;
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
}
.user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}
.avatar {
  background: var(--hero);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-size: 11px;
}
.user small {
  display: block;
  font-size: 10px;
  color: var(--muted);
}
.user .link {
  margin-left: auto;
}
.main {
  padding: 0 42px 40px;
  min-width: 0;
}
.topbar {
  height: 83px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  gap: 10px;
}
.topbar strong {
  color: var(--ink);
  font-weight: 500;
}
.pill {
  font-size: 10px;
  border-radius: 20px;
  padding: 5px 10px;
  background: var(--badge-bg);
  color: var(--badge-text);
  display: inline-block;
  white-space: nowrap;
}
.pill.active,
.pill.sent,
.pill.confirmed {
  background: var(--success-bg);
  color: var(--success-text);
}
.pill.failed,
.pill.ambiguous,
.pill.cancelled,
.pill.suppressed {
  background: var(--error-bg);
  color: var(--danger);
}
.pill.pending,
.pill.retry,
.pill.draft,
.pill.paused {
  background: var(--warning-bg);
  color: var(--warning-text);
}
.heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: 35px 0 25px;
}
.heading h1 {
  font-size: 29px;
  letter-spacing: -1px;
  font-weight: 600;
  margin: 0 0 8px;
}
.heading p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  line-height: 1.6;
}
.btn {
  background: var(--accent);
  color: var(--on-accent);
  padding: 11px 16px;
  border-radius: 7px;
  font-weight: 600;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover {
  background: var(--accent-hover);
}
.btn.secondary {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn.secondary:hover {
  background: var(--hover);
}
.btn.small {
  font-size: 11px;
  padding: 8px 11px;
}
.btn.danger {
  background: var(--danger-button);
}
.link {
  padding: 3px 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.hero {
  background: var(--hero);
  border: 1px solid var(--hero-line);
  border-radius: 12px;
  padding: 27px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.hero h2 {
  font-size: 23px;
  letter-spacing: -0.5px;
  margin: 0 0 10px;
  font-weight: 600;
}
.hero p {
  max-width: 480px;
  color: var(--hero-text);
  font-size: 12px;
  line-height: 1.7;
  margin: 0 0 17px;
}
.hero-art {
  width: 150px;
  height: 112px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  position: relative;
}
.orbit {
  width: 100px;
  height: 100px;
  border: 1px solid var(--orbit);
  border-radius: 50%;
  display: grid;
  place-items: center;
  transform: rotate(-15deg);
  font-size: 55px;
  color: var(--accent);
}
.orbit:before,
.orbit:after {
  content: "";
  position: absolute;
  width: 130px;
  height: 58px;
  border: 1px solid var(--orbit);
  border-radius: 50%;
  transform: rotate(38deg);
}
.orbit:after {
  transform: rotate(-35deg);
}
.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 13px;
  margin: 24px 0;
}
.metric {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.metric-label {
  color: var(--muted);
  font-size: 11px;
  display: flex;
  justify-content: space-between;
}
.metric strong {
  font-size: 30px;
  font-weight: 600;
  display: block;
  margin: 10px 0;
  letter-spacing: -1px;
}
.metric small {
  color: var(--muted);
  font-size: 10px;
}
.grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 22px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 23px;
  margin-bottom: 22px;
  min-width: 0;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}
.card h2 {
  font-size: 15px;
  margin: 0;
  font-weight: 600;
}
.card h3 {
  font-size: 14px;
  margin: 0 0 8px;
}
.muted {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.small-note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}
.campaign-row {
  padding: 17px 0;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.campaign-row:first-of-type {
  border-top: 0;
}
.campaign-row p {
  margin: 6px 0 0;
}
.campaign-row strong {
  font-size: 12px;
}
.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.activity {
  display: flex;
  gap: 12px;
  margin: 18px 0;
  align-items: flex-start;
}
.activity-icon {
  background: var(--badge-bg);
  color: var(--badge-text);
  border-radius: 50%;
  width: 27px;
  height: 27px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
}
.activity strong {
  font-size: 11px;
  font-weight: 600;
  display: block;
}
.activity p {
  font-size: 10px;
  color: var(--muted);
  margin: 4px 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.money-line {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.flow {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 11px;
  padding: 16px 0 0;
  color: var(--muted);
}
.flow span {
  background: var(--surface-soft);
  padding: 6px 9px;
  border-radius: 4px;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}
th {
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 1px;
  padding: 13px 10px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}
td {
  padding: 16px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
td small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}
tr:last-child td {
  border-bottom: 0;
}
.empty {
  padding: 30px;
  text-align: center;
  color: var(--muted);
  line-height: 1.8;
  font-size: 13px;
}
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.toolbar input {
  max-width: 280px;
}
.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-6) var(--space-4);
}
.form-grid .full {
  grid-column: 1/-1;
}
.form-grid > div > .small-note:last-child {
  margin-bottom: 0;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}
input,
textarea,
select {
  width: 100%;
  min-height: var(--control-height);
  padding: 11px 12px;
  border: 1px solid var(--input-line);
  border-radius: var(--control-radius);
  background: var(--surface);
  color: var(--ink);
  outline: 0;
}
/* Keep native selection/keyboard/mobile behavior, with one predictable indicator. */
select:not([multiple]):not([size]) {
  -webkit-appearance: none;
  appearance: none;
  padding-inline-end: 44px;
  background-image: url("/static/chevron-down.svg");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
  text-overflow: ellipsis;
  cursor: pointer;
}
select:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}
@media (forced-colors: active) {
  select:not([multiple]):not([size]) {
    -webkit-appearance: auto;
    appearance: auto;
    background-image: none;
    padding-inline-end: 12px;
  }
  select:focus {
    outline: 2px solid Highlight;
    outline-offset: 2px;
  }
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--focus-halo);
}
textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}
form > .btn,
form > .actions {
  margin-top: var(--space-6);
}
form > .actions > .btn {
  margin-top: 0;
}
.notice {
  padding: 13px 16px;
  background: var(--surface-soft);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.7;
  margin: 16px 0;
}
.notice.error {
  background: var(--error-bg);
  color: var(--danger);
}
.upload {
  border: 1px dashed var(--input-line);
  padding: 24px;
  background: var(--surface-soft);
  border-radius: 10px;
  margin: 18px 0;
}
.upload input {
  background: transparent;
  border: 0;
  padding: 10px 0;
}
.mapping {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  margin: 20px 0;
}
.message {
  white-space: pre-wrap;
  padding: 20px;
  background: var(--surface-soft);
  border-radius: 8px;
  font-family: inherit;
  line-height: 1.8;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.inbox-row {
  border-top: 1px solid var(--line);
  padding: 17px 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.inbox-row h3 {
  margin-bottom: 6px;
}
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.auth-story {
  background: var(--auth-bg);
  color: var(--auth-text);
  padding: 65px 12%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-story .brand {
  margin-bottom: 70px;
}
.auth-story h1 {
  font-size: 49px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -2px;
}
.auth-story p {
  color: var(--auth-muted);
  font-size: 15px;
  line-height: 1.8;
}
.auth-story .eyebrow {
  color: var(--highlight);
}
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 35px;
}
.auth-form {
  width: 100%;
  max-width: 370px;
}
.auth-form h2 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -1px;
}
.auth-form label {
  margin-top: 18px;
}
.auth-form .btn {
  width: 100%;
  padding: 14px;
}
.auth-form .small-note {
  margin-top: 20px;
}
.auth-form .brand {
  display: none;
}
.public-page {
  max-width: 600px;
  margin: 8vh auto;
  padding: 25px;
}
.public-page .brand {
  margin-bottom: 30px;
}
dialog {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: var(--space-8);
  width: min(640px, 94vw);
  max-height: 88vh;
  color: var(--ink);
  box-shadow: 0 25px 90px var(--shadow);
}
dialog::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(3px);
}
dialog h2 {
  font-size: 22px;
  letter-spacing: -0.5px;
  margin: 0 0 var(--space-4);
  padding-right: var(--space-8);
}
.close {
  position: absolute;
  right: 12px;
  top: 8px;
  font-size: 26px;
  background: none;
  color: var(--muted);
  padding: 7px;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 13px 20px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 8px 40px var(--shadow);
  max-width: 90vw;
  font-size: 12px;
  z-index: 100;
  display: none;
}
#toast.visible {
  display: block;
}
#toast.error {
  background: var(--danger-button);
}
.loading {
  padding: 60px;
  text-align: center;
  color: var(--muted);
}
.footer-note {
  font-size: 10px;
  color: var(--muted);
  padding-top: 15px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
@media (min-width: 1500px) {
  .main {
    padding-left: 65px;
    padding-right: 65px;
  }
  .heading {
    margin-top: 45px;
  }
  .hero {
    padding: 35px 40px;
  }
  .hero h2 {
    font-size: 28px;
  }
}
@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 200px 1fr;
  }
  .sidebar {
    padding: 28px 14px;
  }
  .main {
    padding: 0 25px 30px;
  }
  .metrics {
    gap: 8px;
  }
  .metric {
    padding: 14px;
  }
  .grid-two {
    grid-template-columns: 1fr;
  }
  .hero-art {
    width: 110px;
  }
  .metrics small {
    font-size: 9px;
  }
}
@media (max-width: 900px) {
  .layout {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 17px;
    gap: 17px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .sidebar > .workspace,
  .sidebar-bottom {
    display: none;
  }
  .brand {
    font-size: 19px;
  }
  .nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
    gap: 6px;
  }
  .nav button {
    padding: 9px 11px;
    white-space: nowrap;
    font-size: 11px;
  }
  .nav-icon {
    display: none;
  }
  .main {
    padding: 0 18px 25px;
  }
  .topbar {
    height: 54px;
    font-size: 10px;
  }
  .heading {
    margin: 24px 0 20px;
    align-items: flex-start;
  }
  .heading h1 {
    font-size: 24px;
  }
  .heading p {
    font-size: 11px;
  }
  .heading > .btn {
    font-size: 10px;
    padding: 10px;
  }
  .hero {
    padding: 23px;
  }
  .hero-art {
    display: none;
  }
  .hero h2 {
    font-size: 22px;
  }
  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .metric strong {
    font-size: 26px;
  }
  .metric-label {
    font-size: 10px;
  }
  .card {
    padding: 18px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .full {
    grid-column: auto;
  }
  .mapping {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .auth-page {
    display: block;
  }
  .auth-story {
    display: none;
  }
  .auth-form .brand {
    display: flex;
  }
  .auth-panel {
    min-height: 100vh;
  }
  .auth-form h2 {
    font-size: 28px;
  }
  .campaign-row,
  .inbox-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }
  .footer-note {
    display: block;
  }
  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media (max-width: 900px) {
  .footer-note span {
    display: block;
    margin-bottom: 5px;
  }
  .heading {
    flex-wrap: wrap;
  }
  .heading > div:first-child {
    flex: 1 1 240px;
  }
}

/* The same control is available before sign-in, in the workspace and on public links. */
.theme-switcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.theme-switcher select {
  width: 112px;
  flex: 0 0 112px;
  font-size: 14px;
}
.topbar-tools {
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand-theme-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand-theme-header .brand {
  margin: 0;
  white-space: nowrap;
}
.brand-theme-header > .theme-switcher {
  flex: 0 0 auto;
  margin: 0 0 0 auto;
}
.auth-form > .brand-theme-header,
.public-page > .brand-theme-header {
  margin-bottom: 24px;
}
.sidebar > .brand-theme-header > .theme-switcher {
  display: none;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
::selection {
  background: var(--hero-line);
  color: var(--ink);
}
@media (max-width: 900px) {
  .topbar {
    min-height: 72px;
    height: auto;
    padding: 12px 0;
    flex-wrap: wrap;
  }
  .topbar-tools {
    gap: 10px;
  }
  .topbar-tools .pill {
    display: none;
  }
}

/* Fluid layout: narrow/short windows, touch devices, and wide desktop monitors. */
.main,
.hero > div,
.heading > div,
.campaign-row > div,
.inbox-row > div,
.form-grid > div,
.mapping > div,
.metric,
.activity > div,
.auth-panel,
.auth-form {
  min-width: 0;
}
.heading,
.topbar,
.topbar-tools,
.toolbar {
  flex-wrap: wrap;
}
.heading > div:first-child {
  flex: 1 1 280px;
}
.topbar {
  height: auto;
  min-height: 83px;
  padding-block: 16px;
}
:where(
  h1,
  h2,
  h3,
  p,
  td,
  label,
  .notice,
  .workspace,
  .inbox-row,
  .campaign-row,
  .user
) {
  overflow-wrap: anywhere;
}
input,
textarea,
select {
  min-width: 0;
  max-width: 100%;
}
input[type="file"] {
  white-space: normal;
}
.table-wrap {
  max-width: 100%;
  overscroll-behavior-inline: contain;
}
.table-wrap:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.record-table {
  table-layout: fixed;
}
.record-table td .actions {
  gap: 10px;
}
.auth-page {
  max-width: 1920px;
  margin-inline: auto;
}
.auth-story {
  padding-inline: clamp(32px, 6vw, 120px);
}
.auth-story h1 {
  font-size: clamp(32px, 3.5vw, 56px);
}
dialog {
  max-height: calc(100dvh - 24px);
  overscroll-behavior: contain;
  padding-top: 44px;
}
#toast {
  overflow-wrap: anywhere;
}
@media (max-width: 1100px) and (min-width: 901px) {
  .sidebar .brand {
    font-size: 18px;
    gap: 8px;
  }
  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .sidebar {
    overflow: visible;
  }
  .nav button {
    justify-content: center;
    padding-inline: 8px;
  }
  .btn,
  .nav button,
  button.link,
  .close {
    min-height: 44px;
    min-width: 44px;
  }
  button.link,
  a.link {
    display: inline-flex;
    align-items: center;
  }
  input,
  textarea,
  select {
    font-size: 16px;
    min-height: 44px;
  }
  .topbar {
    min-height: 72px;
  }
  .auth-panel {
    padding: 24px;
  }
  .sidebar > .brand-theme-header > .theme-switcher {
    display: inline-flex;
  }
  .topbar-tools > .theme-switcher {
    display: none;
  }
  .topbar {
    min-height: 44px;
    padding-block: 12px;
  }
  .public-page {
    margin-block: 20px;
    padding: 18px;
  }
}
@media (max-width: 600px) {
  .record-table,
  .record-table tbody {
    display: block;
  }
  .record-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
    overflow: hidden;
  }
  .record-table tbody {
    display: grid;
    gap: 16px;
  }
  .record-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 8px;
  }
  .record-table td {
    display: block;
    padding: 9px;
    border: 0;
    min-width: 0;
  }
  .record-table td:first-child,
  .record-table td:last-child {
    grid-column: 1 / -1;
  }
  .record-table td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
    margin-bottom: 8px;
  }
  dialog {
    padding: 40px 18px 20px;
    width: calc(100% - 24px);
  }
  .upload {
    padding: 16px;
  }
  .mapping {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 380px) {
  .main {
    padding-inline: 14px;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero {
    padding: 20px;
  }
  .card {
    padding: 14px;
  }
  .heading h1 {
    font-size: 23px;
  }
}
@media (pointer: coarse) {
  .btn,
  .nav button,
  button.link,
  .close,
  .theme-switcher select {
    min-height: 44px;
  }
}

/* Product experience: a clear next action, considered typography and quiet surfaces. */
.nav button {
  align-items: center;
  border-radius: 12px;
}
.nav button.active {
  background: var(--badge-bg);
  color: var(--badge-text);
}
.nav-icon {
  display: inline-flex;
  flex-shrink: 0;
}
.btn {
  min-height: var(--control-height);
  border-radius: 10px;
  white-space: normal;
  text-align: center;
}
.card {
  border-radius: 18px;
  padding: var(--surface-padding);
}
.heading {
  margin: 40px 0 28px;
}
.heading h1 {
  font-size: clamp(26px, 2.4vw, 36px);
  letter-spacing: -1.2px;
  line-height: 1.15;
}
.heading .eyebrow {
  margin-bottom: 12px;
}
.heading h1:focus {
  outline: none;
}
.metric {
  border-radius: 16px;
}
.metric strong {
  font-variant-numeric: tabular-nums;
}
.next-step {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: 28px;
  padding: 32px;
  margin-bottom: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
}
.next-copy {
  align-self: center;
  padding: 8px;
  min-width: 0;
}
.next-copy h2 {
  font-size: clamp(26px, 2.5vw, 38px);
  letter-spacing: -1.2px;
  line-height: 1.12;
  max-width: 520px;
  margin: 18px 0;
  font-weight: 600;
}
.next-copy > p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.8;
  max-width: 520px;
  font-size: 14px;
  margin-bottom: 24px;
}
.next-copy .btn {
  padding: 13px 18px;
}
.next-number {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 32px 20px;
  background: var(--hero);
  border-radius: 18px;
}
.next-number > strong {
  font-size: clamp(72px, 9vw, 132px);
  font-weight: 550;
  line-height: 1;
  letter-spacing: -6px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.next-number > span {
  font-size: 12px;
  line-height: 1.5;
}
.next-number > .small-note {
  color: var(--hero-text);
  font-size: 10px;
}
.setup-path {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  margin-bottom: 32px;
  background: var(--surface);
}
.setup-path > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.setup-path > div strong {
  font-size: 13px;
}
.setup-path ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  gap: 16px;
}
.setup-path li {
  min-width: 0;
}
.setup-path button {
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  color: var(--ink);
  text-align: left;
  padding: 8px;
  width: 100%;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.5;
}
.setup-path button:hover {
  background: var(--surface-soft);
}
.setup-path small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}
.step-dot {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  flex-shrink: 0;
}
.done .step-dot {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: transparent;
}
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 30px 0 18px;
}
.section-heading h2 {
  font-size: 16px;
  letter-spacing: -0.3px;
  font-weight: 600;
  margin: 0;
}
.section-heading > span {
  color: var(--muted);
  font-size: 11px;
}
.campaign-outcomes {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.campaign-outcomes span {
  margin-inline: 5px;
  color: var(--muted);
}
.template-shelf {
  margin-bottom: 32px;
}
.template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.template-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  min-width: 0;
  padding: 24px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}
.template-card:hover {
  background: var(--surface-soft);
  border-color: var(--input-line);
}
.template-number {
  color: var(--accent);
  font-size: 11px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.template-card > strong {
  font-size: 18px;
  letter-spacing: -0.4px;
  font-weight: 600;
  line-height: 1.3;
}
.template-card > span:not(.template-number) {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.template-card small {
  color: var(--accent);
  font-size: 11px;
  margin-top: auto;
  padding-top: 10px;
}
.quiet-note {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
  padding: 0 10px;
}
.quiet-note svg {
  flex-shrink: 0;
}
dialog {
  border-radius: 22px;
}
dialog.dialog-studio {
  width: min(1040px, calc(100% - 48px));
}
.dialog-studio > #modal-content > h2 {
  font-size: 28px;
  letter-spacing: -0.8px;
  margin: 0 0 12px;
}
.studio-grid,
.review-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  margin-top: 26px;
}
.studio-grid > *,
.review-grid > * {
  min-width: 0;
}
.studio-grid textarea {
  min-height: 210px;
  line-height: 1.75;
}
.studio-grid label {
  font-size: 12px;
}
.studio-preview {
  padding: 22px;
  background: var(--surface-soft);
  border-radius: 18px;
}
.email-sheet {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow-wrap: anywhere;
}
.email-sheet h3 {
  font-size: 20px;
  line-height: 1.4;
  letter-spacing: -0.4px;
  margin: 24px 0 16px;
}
.email-sheet .message {
  font-family: inherit;
  font-size: 13px;
  line-height: 1.85;
  background: none;
  border: 0;
  padding: 0;
}
.email-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
}
.email-meta small,
.email-signature small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 4px;
  line-height: 1.6;
}
.email-cta {
  display: inline-block;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 4px;
  margin-top: 10px;
}
.email-signature {
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding-top: 16px;
  font-size: 12px;
  font-weight: 600;
}
.audience-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}
.audience-counts > div {
  min-width: 0;
  background: var(--surface-soft);
  border-radius: 14px;
  padding: 20px;
}
.audience-counts strong {
  display: block;
  font-size: 34px;
  font-weight: 550;
  letter-spacing: -1px;
  margin-bottom: 8px;
}
.audience-counts span {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  display: block;
}
.review-grid h3 {
  font-size: 16px;
}
.reason-list {
  list-style: none;
  padding: 0;
}
.reason-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  font-size: 12px;
}
.reason-list strong {
  font-variant-numeric: tabular-nums;
}
.audience-details {
  margin-block: 24px;
  padding: 18px 0;
  border-block: 1px solid var(--line);
}
summary {
  cursor: pointer;
  font-size: 13px;
  line-height: 1.5;
  padding: 6px 0;
}
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.audience-details .table-wrap {
  margin-top: 20px;
}
.review-actions {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.dialog-feedback:not(:empty) {
  color: var(--danger);
  background: var(--error-bg);
  border-radius: 10px;
  margin-top: 18px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.6;
}
@media (max-width: 1100px) {
  .next-step {
    gap: 20px;
    padding: 24px;
  }
  .template-card {
    padding: 18px;
  }
}
@media (max-width: 820px) {
  .studio-grid,
  .review-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
  .template-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .template-card {
    padding: 22px;
  }
  .setup-path ol {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
}
@media (max-width: 600px) {
  .next-step {
    grid-template-columns: minmax(0, 1fr);
    padding: 20px;
    border-radius: 18px;
  }
  .next-copy {
    padding: 0;
  }
  .next-number {
    padding: 24px;
  }
  .next-number > strong {
    font-size: 72px;
    letter-spacing: -3px;
  }
  .next-copy h2 {
    font-size: 29px;
  }
  .next-copy .btn {
    width: 100%;
  }
  :root {
    --surface-padding: 18px;
  }
  .setup-path {
    padding: 18px;
  }
  dialog.dialog-studio {
    width: calc(100% - 24px);
  }
  .studio-preview,
  .email-sheet {
    padding: 16px;
  }
  .audience-counts {
    gap: 8px;
  }
  .audience-counts > div {
    padding: 12px 8px;
  }
  .audience-counts strong {
    font-size: 28px;
  }
  .audience-counts span {
    font-size: 10px;
  }
  .review-actions .btn {
    flex: 1 1 160px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  #view {
    animation: arrive 160ms ease-out;
  }
  .btn,
  .template-card,
  .nav button {
    transition:
      background-color 120ms ease,
      border-color 120ms ease;
  }
  @keyframes arrive {
    from {
      opacity: 0.65;
      transform: translateY(3px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
.email-cta svg {
  vertical-align: middle;
  margin-left: 4px;
}

/* Visit requests, agreed appointments, and the customer status page. */
.booking-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.booking-summary > div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  min-width: 0;
}
.booking-summary strong {
  display: block;
  font-size: 32px;
  letter-spacing: -1px;
  font-weight: 550;
}
.booking-summary span {
  display: block;
  color: var(--muted);
  margin-top: 8px;
  font-size: 12px;
}
.booking-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.booking-filters [aria-pressed="true"] {
  background: var(--badge-bg);
  color: var(--badge-text);
  border-color: var(--badge-bg);
}
.pill.requested {
  background: var(--warning-bg);
  color: var(--warning-text);
}
.notification-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-block: 18px;
  border-bottom: 1px solid var(--line);
}
.notification-row > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.notification-row strong {
  font-size: 13px;
}
.notification-row small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 8px;
}
.visit-details {
  margin-block: 28px;
}
.visit-details > div {
  border-bottom: 1px solid var(--line);
  padding-block: 18px;
}
.visit-details dt {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 8px;
}
.visit-details dd {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
[data-time-input] + .small-note {
  display: block;
  margin-top: var(--space-2);
}
.time-choice:empty {
  display: none;
}
.time-choice:not(:empty) {
  margin-top: var(--space-4);
}
@media (min-width: 1101px) {
  .metrics {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .booking-summary {
    gap: 8px;
  }
  .booking-summary > div {
    padding: 14px 10px;
  }
  .booking-summary span {
    font-size: 10px;
    line-height: 1.5;
  }
  .notification-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Shared vertical rhythm and flex sizing, used on every route. */
.user > div {
  flex: 1;
  min-width: 0;
}
.user .avatar,
.user > .link {
  flex-shrink: 0;
}
.user small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card > :last-child,
#modal-content > :last-child:not(.dialog-feedback),
form > :last-child {
  margin-bottom: 0;
}
.dialog-feedback:empty {
  display: none;
}
#modal-content > .muted + form,
#modal-content > .muted + .review-grid {
  margin-top: var(--space-6);
}
.auth-form h2 {
  margin-block: var(--space-6) var(--space-3);
}
.auth-form > .eyebrow {
  margin-bottom: 0;
}
.auth-form > .muted {
  margin-bottom: var(--space-6);
}
#settings-form {
  max-width: 560px;
}
#settings-form > .muted {
  margin-bottom: var(--space-6);
}
@media (max-width: 600px) {
  .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-2);
  }
  .nav button {
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-1);
    min-height: 64px;
  }
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: var(--space-3);
  }
  .topbar-tools > span {
    display: none;
  }
  .heading {
    margin-block: var(--space-8) var(--space-6);
  }
}

/* Account access reuses the public-page, card, form and dialog components. */
.recovery-link {
  margin-block: var(--space-4) 0;
  font-size: 12px;
}
.account-security .card-header {
  flex-wrap: wrap;
}
.account-address {
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.account-security > .actions {
  margin-block: var(--space-6) var(--space-4);
}
.security-history {
  border-top: 1px solid var(--line);
  margin-top: var(--space-6);
  padding-top: var(--space-4);
}
.security-history ul {
  list-style: none;
  padding: 0;
  margin-bottom: 0;
}
.security-history li {
  padding-block: var(--space-4);
  border-bottom: 1px solid var(--line);
}
.security-history li:last-child {
  border: 0;
}
.security-history strong,
.security-history small {
  display: block;
  font-size: 12px;
  line-height: 1.7;
}
.security-history small {
  color: var(--muted);
  margin-top: var(--space-2);
}
.account-page h1 {
  font-size: clamp(26px, 3vw, 32px);
  letter-spacing: -1px;
  line-height: 1.2;
  margin-block: var(--space-6) var(--space-4);
}
.account-page form {
  margin-top: var(--space-6);
}
.account-page .card > .small-note:last-child {
  margin-top: var(--space-6);
}

.account-page form > .btn:first-child {
  margin-top: 0;
}

/* Customer capabilities use the shared surface, form and action spacing. */
.customer-link-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  border-top: 1px solid var(--line);
  margin-top: var(--space-6);
  padding-top: var(--space-6);
}
.customer-link-summary > div {
  flex: 1 1 240px;
}
.customer-link-summary p {
  margin: var(--space-2) 0 0;
}
.link-status {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: var(--space-4);
  margin: var(--space-6) 0;
}
.link-status p {
  margin: var(--space-2) 0 0;
}
.link-expiry {
  border-top: 1px solid var(--line);
  padding-top: var(--space-4);
  margin-top: var(--space-6);
}
#customer-link-url {
  width: 100%;
}

.link-copy-actions {
  margin-top: var(--space-4);
  margin-bottom: var(--space-4);
}

.google-entry {
  margin-top: 24px;
}
.google-button {
  gap: 12px;
  white-space: normal;
}
.google-button svg {
  flex: 0 0 20px;
}
.google-entry .google-button {
  width: 100%;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  margin: 24px 0;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}
.google-connection {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 24px;
}
.google-connection p {
  overflow-wrap: anywhere;
}

/* Delivery review uses the shared surfaces, spacing and controls. */
.delivery-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.delivery-summary > div {
  padding: var(--surface-padding);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: grid;
  gap: var(--space-2);
}
.delivery-summary strong {
  font-size: 32px;
  letter-spacing: -1px;
}
.delivery-summary span {
  font-weight: 600;
}
.delivery-summary small,
.delivery-history small {
  color: var(--muted);
}
.delivery-usage {
  margin-bottom: var(--space-6);
}
.delivery-filters,
.history-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-4) 0;
}
.delivery-filters [aria-pressed="true"],
.history-filters [aria-pressed="true"] {
  color: var(--accent);
  background: var(--hero);
  border-color: var(--hero-line);
}
.delivery-filters button,
.history-filters button {
  gap: var(--space-2);
}
.delivery-row > div:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.delivery-row .actions {
  flex-wrap: wrap;
}
.delivery-status {
  margin: var(--space-3) 0 0;
}
.delivery-status .pill {
  white-space: normal;
}
.delivery-pagination {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-4);
}
.delivery-explanation {
  line-height: 1.7;
  margin: var(--space-6) 0;
}
.delivery-receipt {
  margin: var(--space-6) 0;
  padding: var(--space-4);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow-wrap: anywhere;
}
.delivery-history {
  padding-left: 22px;
  margin: var(--space-4) 0 var(--space-6);
}
.delivery-history li {
  padding-left: var(--space-2);
  margin-bottom: var(--space-4);
  overflow-wrap: anywhere;
}
.delivery-history strong,
.delivery-history small {
  display: block;
}
.delivery-history small {
  margin-top: var(--space-1);
}
@media (max-width: 600px) {
  .delivery-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-2);
  }
  .delivery-summary > div {
    gap: var(--space-1);
    padding: var(--space-3);
  }
  .delivery-summary strong {
    font-size: 28px;
  }
  .delivery-summary span {
    font-size: 13px;
  }
  .delivery-summary small {
    display: none;
  }
}

.saved-mappings,
.save-mapping {
  margin-block: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}
.saved-mappings h3,
.save-mapping h3 {
  margin-top: 0;
}
.saved-mappings .actions {
  margin-top: 12px;
}
.save-mapping input {
  margin-bottom: 12px;
}
@media (max-width: 600px) {
  .saved-mappings,
  .save-mapping {
    padding: 16px;
  }
}

.import-summary {
  margin-block: var(--space-6);
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}
.import-summary h3 {
  margin-top: 0;
}
.import-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  margin-block: var(--space-4);
}
.import-counts strong {
  display: block;
  font-size: 28px;
  color: var(--accent);
}
.import-counts span {
  display: block;
  font-size: 13px;
  color: var(--muted);
}
.import-action {
  display: block;
  margin-block: var(--space-2);
  font-size: 13px;
}
.import-changes summary {
  cursor: pointer;
  color: var(--accent);
  padding-block: var(--space-2);
}
.import-changes dl {
  margin-block: var(--space-2);
}
.import-changes dl > div + div {
  margin-top: var(--space-3);
}
.import-changes dt {
  font-weight: 600;
}
.import-changes dd {
  margin: 0;
}
.import-changes dd span {
  display: block;
}

.import-rows td {
  vertical-align: top;
}
.import-rows .small-note {
  display: block;
  margin-block: var(--space-2);
}

/* History filters reuse native selects and the shared responsive form grid. */
.history-filters {
  margin-bottom: 16px;
}

/* Keep the brand and theme selector together, including narrow 320px phones. */
@media (max-width: 600px) {
  .brand-theme-header .brand {
    font-size: 16px;
    gap: 8px;
  }
  .brand-theme-header .mark {
    width: 28px;
    height: 28px;
  }
  .brand-theme-header .theme-label {
    display: none;
  }
}

/* Compact appearance switch and mobile navigation (owner request, 26 October). */
button.theme-toggle {display:inline-flex;align-items:center;justify-content:center;gap:3px;width:72px;min-width:72px;min-height:44px;padding:6px 2px;margin:0;flex:0 0 auto;border:0;border-radius:10px;background:transparent;color:var(--ink);box-shadow:none;cursor:pointer}
.theme-toggle svg {width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}
.theme-track {display:block;width:28px;height:18px;border:1px solid var(--muted);border-radius:12px;padding:2px;flex:none}
.theme-track>span {display:block;width:12px;height:12px;border-radius:50%;background:currentColor;transition:transform .15s ease}
.theme-toggle[aria-checked="true"] .theme-track>span {transform:translateX(10px)}
button.theme-toggle:focus-visible {background:var(--line);outline:none;box-shadow:none}
button.menu-toggle {display:none;align-items:center;justify-content:center;width:44px;min-width:44px;height:44px;padding:10px;margin:0;border:0;border-radius:10px;background:transparent;color:var(--ink);box-shadow:none}
.menu-toggle svg {width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round}
button.menu-toggle:focus-visible {background:var(--line);outline:none;box-shadow:none}
@media(hover:hover) and (pointer:fine) {button.theme-toggle:hover,button.menu-toggle:hover {background:var(--line)}}
@media(prefers-reduced-motion:reduce) {.theme-track>span {transition:none}}
@media(max-width:900px) {button.menu-toggle {display:inline-flex} [data-nav-panel]:not(.nav-open) {display:none!important}}

#workspace-menu {display:flex;flex:1;flex-direction:column;gap:28px;min-height:0}
#workspace-menu>.sidebar-bottom {margin-top:auto}
@media(max-width:900px) {
 .sidebar {position:relative;display:flex;flex-direction:row;align-items:center;padding:12px 16px;gap:4px}
 .sidebar>.brand-theme-header {flex:1;min-width:0;gap:4px}
 .sidebar>.brand-theme-header>.theme-switcher {display:inline-flex}
 #workspace-menu {position:absolute;left:0;right:0;top:100%;z-index:30;max-height:calc(100dvh - 76px);overflow:auto;padding:16px;background:var(--sidebar);border-bottom:1px solid var(--line);box-shadow:0 12px 20px #0002;gap:16px}
 #workspace-menu>.workspace {display:none}
 #workspace-menu .nav {display:flex;flex-direction:column;gap:4px}
 #workspace-menu .nav button {justify-content:flex-start;font-size:15px;min-height:44px}
 #workspace-menu .nav-icon {display:inline-flex}
 #workspace-menu>.sidebar-bottom {display:block;margin:0;padding-top:12px;border-top:1px solid var(--line)}
 #workspace-menu .sandbox {display:none}
}
@media(max-width:380px) {.sidebar {padding-inline:12px}.sidebar .brand {font-size:15px;gap:5px}.sidebar .mark {width:26px;height:26px}}

@media(max-width:900px) {#workspace-menu .nav button {flex-direction:row;align-items:center;gap:12px}}

/* Keep provider guidance clear of the floating Help control on narrow screens. */
.provider-mode-note {
  padding-inline-end: 48px;
}
