:root,
[data-theme="light"] {
  --bg: #f4efe6;
  --surface: #faf7f1;
  --surface-2: #ebe4d6;
  --border: #cfc4b0;
  --text: #1a1712;
  --muted: #5c564c;
  --primary: #2f5a56;
  --primary-hover: #244744;
  --danger: #9b2c2c;
  --success: #2d6a4f;
  --warn: #8a6a1f;
  --radius: 4px;
  --font: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-display: "Source Serif 4", Georgia, "Iowan Old Style", serif;
  --shadow: none;
  --hover-fill: #e4dccb;
  --alert-info-bg: rgba(47, 90, 86, 0.1);
  --alert-info-border: rgba(47, 90, 86, 0.32);
  --alert-info-text: #1e3d3a;
  --alert-error-bg: rgba(155, 44, 44, 0.08);
  --alert-error-border: rgba(155, 44, 44, 0.32);
  --alert-error-text: #7a1f1f;
  --alert-ok-bg: rgba(45, 106, 79, 0.12);
  --alert-ok-border: rgba(45, 106, 79, 0.35);
  --alert-ok-text: #1d4a36;
  --alert-warn-bg: rgba(138, 106, 31, 0.12);
  --alert-warn-border: rgba(138, 106, 31, 0.4);
  --alert-warn-text: #6a5116;
  --on-primary: #f4efe6;
  --color-scheme: light;
}

[data-theme="dark"] {
  --bg: #161410;
  --surface: #221e18;
  --surface-2: #2c271f;
  --border: #4a4338;
  --text: #efe8dc;
  --muted: #b0a794;
  --primary: #7ea8a3;
  --primary-hover: #9abbb7;
  --danger: #e08a8a;
  --success: #7dba96;
  --warn: #d4b56a;
  --shadow: none;
  --hover-fill: #352f26;
  --alert-info-bg: rgba(126, 168, 163, 0.14);
  --alert-info-border: rgba(126, 168, 163, 0.4);
  --alert-info-text: #c5ddd9;
  --alert-error-bg: rgba(224, 138, 138, 0.12);
  --alert-error-border: rgba(224, 138, 138, 0.35);
  --alert-error-text: #f0c0c0;
  --alert-ok-bg: rgba(125, 186, 150, 0.12);
  --alert-ok-border: rgba(125, 186, 150, 0.35);
  --alert-ok-text: #b7dfc6;
  --alert-warn-bg: rgba(212, 181, 106, 0.12);
  --alert-warn-border: rgba(212, 181, 106, 0.4);
  --alert-warn-text: #ead6a4;
  --on-primary: #161410;
  --color-scheme: dark;
}

html {
  color-scheme: var(--color-scheme, light);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

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

code {
  background: var(--surface-2);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.check-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 12rem;
  overflow-y: auto;
  padding: 0.5rem 0.65rem;
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.check-list label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  cursor: pointer;
}

.cap-hidden {
  display: none !important;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  background: var(--primary);
  color: var(--on-primary);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0;
  border-radius: 3px;
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.brand-mark-vote {
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.4rem;
  margin: 0 auto 0.65rem;
}

.header h1,
.vote-card h1,
.login-card h1,
.canvass-brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.landing-brand span:last-child,
.brand > div > h1 {
  font-family: var(--font-display);
}

.muted {
  color: var(--muted);
  margin: 0.25rem 0 0;
}

.grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

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

.card-head h2 {
  margin: 0;
}

.actions {
  display: flex;
  gap: 0.5rem;
}

.upload-zone {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0 0.75rem;
  padding: 1.25rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.upload-zone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: 3px;
  padding: 0.5rem 0.95rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.btn.primary {
  background: var(--primary);
  color: var(--on-primary);
}

.btn.primary:hover {
  background: var(--primary-hover);
}

.btn.secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn.secondary:hover {
  background: var(--hover-fill);
}

.btn.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.btn.danger:hover {
  background: var(--alert-error-bg);
}

.btn.ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--border);
}

.btn.small {
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
}

.btn.large {
  padding: 0.9rem 1.25rem;
  font-size: 1.05rem;
  width: 100%;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.feature-disabled {
  opacity: 0.55;
  filter: grayscale(0.25);
}

fieldset.feature-disabled {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.feature-disabled .btn,
.feature-disabled input,
.feature-disabled textarea,
.feature-disabled select {
  cursor: not-allowed;
}

.feature-disabled .ballot-q-heading .badge {
  margin-left: 0.45rem;
  vertical-align: middle;
}

.hint {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.75rem;
}

.alert {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: var(--alert-info-bg);
  border: 1px solid var(--alert-info-border);
  color: var(--alert-info-text);
}

.alert.success {
  background: var(--alert-ok-bg);
  border-color: var(--alert-ok-border);
  color: var(--alert-ok-text);
}

.alert.error {
  background: var(--alert-error-bg);
  border-color: var(--alert-error-border);
  color: var(--alert-error-text);
}

.hidden {
  display: none !important;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.82rem;
}

tr:last-child td {
  border-bottom: none;
}

td.center,
.center {
  text-align: center;
}

.link-cell {
  max-width: 220px;
}

.link-cell a {
  word-break: break-all;
  font-size: 0.85rem;
}

.copy-btn {
  white-space: nowrap;
}

.phone-line {
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.95rem;
}

tr.test-user-row {
  background: var(--alert-info-bg);
}

tr.test-user-row td:first-child {
  border-left: 3px solid var(--primary);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  white-space: nowrap;
}

.footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.85rem;
}

/* --- Member vote page --- */
.vote-body {
  background: var(--bg);
}

.vote-page {
  max-width: 440px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.vote-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.vote-header .brand-mark {
  margin-bottom: 0.35rem;
}

.vote-card {
  box-shadow: none;
}

.vote-card h1 {
  font-size: 1.75rem;
}

.greeting {
  color: var(--muted);
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.detail-block {
  margin: 1.25rem 0;
  padding: 0.9rem 1rem;
  background: var(--surface-2);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.detail-block .label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.detail {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  white-space: pre-line;
}

.detail.sub {
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.party-message {
  margin: 0.85rem 0 0;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.35;
}

.early-dates-list {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.45;
}

.early-dates-list li {
  margin: 0.15rem 0;
}

.party-message.party-hold {
  background: var(--alert-info-bg);
  border: 1px solid var(--alert-info-border);
  color: var(--alert-info-text);
}

.party-message.party-challenge {
  background: var(--alert-error-bg);
  border: 1px solid var(--alert-error-border);
  color: var(--alert-error-text);
}

.cta-stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.cta-stack.cta-secondary {
  margin-top: 1.25rem;
}

.register-block {
  margin-top: 1.35rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.register-block-top {
  margin-top: 1rem;
  margin-bottom: 0.25rem;
  padding-top: 0;
  padding-bottom: 1.25rem;
  border-top: none;
  border-bottom: 1px solid var(--border);
}

.register-label {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.vote-optout {
  margin-top: 1.75rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.vote-optout .btn.ghost {
  color: var(--muted);
}

.vote-optout-confirm {
  margin-top: 0.65rem;
}

.vote-optout-confirm .sms-form-actions {
  justify-content: center;
}

#count-line {
  margin-top: 0.75rem;
}

/* Ballot / referendum admin card */
.ballot-card {
  border-color: var(--primary);
  background: var(--surface);
}

.ballot-date {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  text-align: right;
}

.ballot-q-heading {
  margin: 1.25rem 0 0.35rem;
  font-size: 1rem;
}

.ballot-questions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.85rem;
  max-height: 28rem;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.vote-questions {
  max-height: none;
  overflow: visible;
}

.ballot-q {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
}

.ballot-q-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.65rem;
  margin-bottom: 0.35rem;
}

.ballot-q-num {
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--primary);
}

.ballot-q-cat {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ballot-q-endorse {
  display: block;
  width: 100%;
  margin: 0.55rem 0 0;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--alert-ok-text);
  background: var(--alert-ok-bg);
  border: 1px solid var(--alert-ok-border);
  border-radius: var(--radius);
  padding: 0.65rem 0.85rem;
  white-space: normal;
  word-break: break-word;
  box-sizing: border-box;
}

.ballot-q-top {
  flex-wrap: wrap;
}

.field-endorse textarea,
textarea.endorse-input {
  min-height: 4.5rem;
  font-weight: 600;
}

.riding-combobox {
  position: relative;
}

.riding-suggestions {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: 100%;
  max-height: 200px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
  box-shadow: var(--shadow);
  display: none;
}

.riding-suggestions.open {
  display: block;
}

.riding-suggestions button {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  padding: 0.45rem 0.75rem;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text);
}

.riding-suggestions button:hover {
  background: var(--surface-2);
}

.msg-char {
  font-size: 0.8rem;
  color: var(--muted);
}

.msg-char.warn {
  color: var(--danger);
  font-weight: 700;
}

.ballot-q-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text);
}

.ballot-q-options {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.ref-heading {
  margin: 1.25rem 0 0.35rem;
  font-size: 1.05rem;
}

.vote-page .ballot-questions {
  text-align: left;
}

/* SMS test form */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-ok {
  background: var(--alert-ok-bg);
  color: var(--alert-ok-text);
  border: 1px solid var(--alert-ok-border);
}

.badge-mock {
  background: var(--alert-warn-bg);
  color: var(--alert-warn-text);
  border: 1px solid var(--alert-warn-border);
}

.badge-info {
  background: var(--alert-info-bg);
  color: var(--alert-info-text);
  border: 1px solid var(--alert-info-border);
}

.badge-warn {
  background: var(--alert-error-bg);
  color: var(--alert-error-text);
  border: 1px solid var(--alert-error-border);
}

.sms-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.field input,
.field textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.85rem;
  width: 100%;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--alert-info-bg);
}

.password-wrap {
  position: relative;
  display: block;
}

.password-wrap input {
  padding-right: 2.75rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  width: 2.1rem;
  height: 2.1rem;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--text);
  background: var(--hover-fill);
  outline: none;
}

.password-eye {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
  background: currentColor;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M1 12s4-7 11-7 11 7 11 7-4 7-11 7S1 12 1 12z'/><circle cx='12' cy='12' r='3'/></svg>") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M1 12s4-7 11-7 11 7 11 7-4 7-11 7S1 12 1 12z'/><circle cx='12' cy='12' r='3'/></svg>") center / contain no-repeat;
}

.password-toggle.is-on .password-eye {
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M17.94 17.94A10.94 10.94 0 0 1 12 19c-7 0-11-7-11-7a21.8 21.8 0 0 1 5.06-5.94'/><path d='M9.9 4.24A10.94 10.94 0 0 1 12 5c7 0 11 7 11 7a21.8 21.8 0 0 1-2.16 3.19'/><path d='M14.12 14.12a3 3 0 0 1-4.24-4.24'/><line x1='1' y1='1' x2='23' y2='23'/></svg>") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M17.94 17.94A10.94 10.94 0 0 1 12 19c-7 0-11-7-11-7a21.8 21.8 0 0 1 5.06-5.94'/><path d='M9.9 4.24A10.94 10.94 0 0 1 12 5c7 0 11 7 11 7a21.8 21.8 0 0 1-2.16 3.19'/><path d='M14.12 14.12a3 3 0 0 1-4.24-4.24'/><line x1='1' y1='1' x2='23' y2='23'/></svg>") center / contain no-repeat;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(10, 16, 24, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  width: min(420px, 100%);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.15rem 1.25rem;
}

.modal-card h2 {
  margin: 0 0 0.85rem;
  font-size: 1.15rem;
}

.sms-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.btn.send-api {
  white-space: nowrap;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.35rem;
}

.tab {
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.55rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius) var(--radius) 0 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.tab:hover {
  color: var(--text);
  background: var(--surface-2);
}

.tab.active {
  color: var(--primary);
  background: var(--surface);
  border-color: var(--border);
  border-bottom-color: var(--surface);
  margin-bottom: -1px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem 1rem;
}

.editor-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.editor-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  background: var(--surface-2);
}

.select-inline {
  font: inherit;
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  max-width: 220px;
}

.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.geo-targeting {
  margin-top: 0.85rem;
}

.geo-field {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.65rem;
}

.geo-field .field-label,
.field-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.facet-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  max-height: 8.5rem;
  overflow: auto;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.facet-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
}

.facet-item input {
  margin: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.stat-tile {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 0.85rem;
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.stat-label {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}

.field select {
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.85rem;
  width: 100%;
}

.field select[multiple] {
  min-height: 6rem;
}

/* Collapsible campaign editor sections */
.collapse-section {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.collapse-section.hidden {
  display: none !important;
}

.collapse-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  background: var(--surface-2);
  font-weight: 700;
  color: var(--text);
}

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

.collapse-summary::before {
  content: '▸';
  display: inline-block;
  color: var(--primary);
  transition: transform 0.15s ease;
  font-size: 0.85rem;
  width: 1rem;
}

.collapse-section[open] > .collapse-summary::before {
  transform: rotate(90deg);
}

.collapse-summary:hover {
  background: var(--hover-fill);
}

.collapse-title {
  flex: 1;
}

.collapse-meta {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: right;
  max-width: 55%;
}

.collapse-body {
  padding: 1rem 1.15rem 1.15rem;
  border-top: 1px solid var(--border);
}

/* --- Marketing landing (public) --- */
body.landing {
  background: var(--bg);
}

.landing-nav {
  max-width: 920px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
}

.landing-brand .brand-mark {
  width: 2rem;
  height: 2rem;
  font-size: 1.05rem;
}

.landing-nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.landing-nav-links a:not(.btn) {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.landing-nav-links a:not(.btn):hover {
  color: var(--primary);
}

.landing-nav-links a[aria-current="page"] {
  color: var(--text);
}

.landing-hero {
  max-width: 920px;
  margin: 0 auto;
  padding: 3.25rem 1.25rem 1.75rem;
  text-align: left;
}

.landing-hero h1 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5vw, 3.15rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.025em;
  max-width: 14ch;
}

.landing-lead {
  margin: 0 0 1.5rem;
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 36rem;
  line-height: 1.55;
}

.landing-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.landing-note {
  font-size: 0.95rem;
  max-width: 32rem;
}

.landing-section {
  max-width: 920px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
}

.landing-section h2 {
  margin: 0 0 1.15rem;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 600;
  text-align: left;
}

.landing-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
  padding-top: 2.25rem;
  border-top: 1px solid var(--border);
}

@media (min-width: 760px) {
  .landing-split {
    grid-template-columns: 1fr 0.9fr;
    gap: 2.75rem;
  }
}

.landing-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.landing-list li {
  padding: 0.95rem 0;
  border-top: 1px solid var(--border);
}

.landing-list li:last-child {
  border-bottom: 1px solid var(--border);
}

.landing-list h3 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.landing-list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.landing-preview {
  display: none;
}

@media (min-width: 760px) {
  .landing-preview {
    display: block;
    position: sticky;
    top: 1.5rem;
  }
}

.preview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.3rem 1.4rem;
}

.preview-kicker {
  margin: 0 0 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.preview-hi {
  margin: 0 0 0.15rem;
  font-family: var(--font-display);
  color: var(--muted);
}

.preview-card h3 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
}

.preview-row {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.preview-row .label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.preview-row p {
  margin: 0;
  font-weight: 600;
}

.preview-btn {
  display: block;
  margin-top: 1rem;
  text-align: center;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  padding: 0.7rem 0.85rem;
  border-radius: 3px;
}

.landing-how {
  max-width: 640px;
  padding-top: 0.5rem;
}

.landing-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.landing-steps li {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.85rem;
  align-items: start;
  padding: 1.1rem 0;
  border-top: 1px solid var(--border);
}

.landing-steps li:last-child {
  border-bottom: 1px solid var(--border);
}

.landing-step-num {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.3;
}

.landing-steps h3 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}

.landing-steps p {
  margin: 0;
}

.landing-footer {
  max-width: 920px;
  margin: 0 auto;
  text-align: left;
  padding: 1.75rem 1.25rem 3rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.95rem;
}

.landing-footer p {
  margin: 0.35rem 0;
}

.brand-mark-sm {
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.95rem;
  margin: 0 0 0.65rem;
  display: inline-flex;
}

/* --- Public workflow guide --- */
.guide-page {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
}

.guide-hero {
  padding: 2.5rem 0 0.25rem;
}

.guide-hero h1 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.6rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.guide-toc {
  margin: 1.25rem 0 1.75rem;
  padding: 1rem 1.15rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.guide-toc h2 {
  margin: 0 0 0.55rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.guide-toc ol {
  margin: 0;
  padding-left: 1.25rem;
}

.guide-toc li {
  margin: 0.3rem 0;
}

.guide-toc a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.guide-toc a:hover,
.guide-toc a:focus-visible {
  text-decoration: underline;
}

.guide-step {
  padding: 1.75rem 0 0.5rem;
  border-top: 1px solid var(--border);
}

.guide-step-head {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.85rem;
  align-items: start;
  margin-bottom: 0.9rem;
}

.guide-step h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
}

.guide-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  align-items: center;
}

.guide-badge {
  display: inline-block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.1rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
}

.guide-instructions {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.guide-instructions li {
  margin: 0.35rem 0;
}

.guide-watch {
  margin: 0 0 1.15rem;
  padding: 0.7rem 0.85rem;
  background: var(--alert-warn-bg);
  border: 1px solid var(--alert-warn-border);
  color: var(--alert-warn-text);
  border-radius: var(--radius);
  font-size: 0.95rem;
}

.guide-shot {
  margin: 0 0 1.35rem;
}

.guide-shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.guide-shot-narrow {
  max-width: 440px;
}

.guide-shot figcaption {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* --- Site prefs: lang flip + ⋯ theme menu --- */
.site-prefs {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.site-pref-btn {
  appearance: none;
  border: 1px solid var(--border);
  margin: 0;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.6rem;
  border-radius: 3px;
  cursor: pointer;
  line-height: 1.2;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.site-pref-btn:hover {
  color: var(--text);
  background: var(--hover-fill);
  border-color: var(--border);
}

.site-lang-flip {
  min-width: 2.5rem;
  text-align: center;
}

.site-menu {
  position: relative;
  display: inline-flex;
}

.site-menu-trigger {
  min-width: 2.35rem;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
}

.site-menu-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 9.5rem;
  padding: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(26, 23, 18, 0.12);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.site-menu-item {
  appearance: none;
  border: 0;
  margin: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
}

a.site-menu-item {
  text-decoration: none;
  color: inherit;
  display: block;
  box-sizing: border-box;
}

.admin-menu-account {
  display: none;
}

.site-menu-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.45rem 0.75rem 0.55rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-menu-meta strong {
  color: var(--text);
  font-size: 0.95rem;
}

.site-menu-sep {
  height: 1px;
  background: var(--border);
  margin: 0.25rem 0.35rem;
}

.site-menu-item:hover {
  background: var(--hover-fill);
}

.site-menu-item.is-active,
.site-menu-item[aria-pressed='true'] {
  background: var(--alert-info-bg);
  color: var(--alert-info-text);
}

.landing-nav-links .site-prefs {
  margin-left: 0.1rem;
}

/* Top-right cluster on pages without landing nav */
.login-prefs,
.page-corner-prefs {
  position: fixed;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.vote-prefs {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 0.75rem;
  padding: 0 0.15rem;
}

.header-actions .site-prefs {
  order: 10;
}

.header-actions {
  flex-wrap: wrap;
}

input,
textarea,
select {
  color-scheme: var(--color-scheme, light);
}

/* --- Login / reset --- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
}

.login-card .brand-mark {
  margin: 0 auto 1rem;
}

.login-card h1 {
  text-align: center;
  margin: 0 0 0.25rem;
}

.login-card .muted {
  text-align: center;
  margin-bottom: 1.25rem;
}

.login-card .field {
  margin-bottom: 0.85rem;
}

.login-card .btn.primary {
  width: 100%;
  margin-top: 0.5rem;
}

.login-back {
  text-align: center;
  margin: 1rem 0 0;
}

.login-back .btn {
  text-decoration: none;
}

.login-forgot {
  text-align: center;
  margin: 0.75rem 0 0;
}

/* --- Canvass (mobile intake) --- */
.canvass-body {
  background: var(--bg);
}

.canvass-page {
  max-width: 440px;
  margin: 0 auto;
  padding: 1rem 1rem 5.5rem;
}

.canvass-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.canvass-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.canvass-brand > div {
  min-width: 0;
}

.canvass-brand h1 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.15;
  white-space: nowrap;
}

.canvass-brand .muted {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.canvass-brand .brand-mark {
  width: 2.35rem;
  height: 2.35rem;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.canvass-header-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
}

.canvass-header-desk {
  display: none !important;
}

.canvass-menu-account {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.canvass-page .site-menu-panel {
  min-width: 13.5rem;
}

.canvass-card {
  padding: 1.15rem 1.15rem 1.25rem;
  margin-bottom: 1rem;
}

.canvass-card h2 {
  margin: 0 0 0.35rem;
}

.canvass-lead {
  margin: 0 0 1rem;
}

.canvass-card .field {
  margin-bottom: 0.9rem;
}

.canvass-card .field input,
.canvass-card .field select {
  font-size: 16px;
  min-height: 48px;
  padding: 0.75rem 0.9rem;
}

.canvass-card .field textarea {
  font-size: 16px;
  width: 100%;
  min-height: 72px;
  padding: 0.75rem 0.9rem;
  resize: vertical;
}

.canvass-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
  margin-top: 0.35rem;
}

.canvass-form-actions .canvass-submit {
  flex: 1 1 12rem;
  position: static;
}

.canvass-walk-house {
  cursor: pointer;
}

.canvass-walk-house:hover,
.canvass-walk-house:focus-within {
  border-color: var(--text);
}

.lean-badge.outcome-contacted {
  background: var(--alert-ok-bg);
  color: var(--alert-ok-text);
}

.lean-badge.outcome-not_home,
.lean-badge.outcome-come_back {
  background: var(--hover-fill);
  color: var(--muted);
}

.lean-badge.outcome-moved,
.lean-badge.outcome-refused,
.lean-badge.outcome-do_not_knock {
  background: var(--alert-error-bg);
  color: var(--alert-error-text);
}

.canvass-optional {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.canvass-riding {
  margin-top: 0.35rem;
}

.canvass-submit {
  margin-top: 0.35rem;
  min-height: 52px;
  position: sticky;
  bottom: 0.75rem;
}

.canvass-recent {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.canvass-recent li {
  padding: 0.7rem 0.8rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.canvass-recent strong {
  display: block;
}

.canvass-recent-meta,
.canvass-recent-place {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.canvass-empty {
  margin: 0.75rem 0 0;
}

.canvass-address-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.canvass-address-row input {
  flex: 1;
  min-width: 0;
}

.canvass-address-row .btn {
  flex-shrink: 0;
  white-space: nowrap;
  min-height: 48px;
}

@media (max-width: 420px) {
  .canvass-address-row {
    flex-direction: column;
  }
}

.canvass-address-status {
  margin-top: 0.35rem;
}

.canvass-address-status.error {
  color: var(--danger);
}

.canvass-contact,
.canvass-occupants {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 0.85rem 0.35rem;
  margin: 0 0 1rem;
}

.canvass-contact legend,
.canvass-occupants legend {
  padding: 0 0.35rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.canvass-occupants-lead {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

.canvass-occupant-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.canvass-occupant {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem 0.5rem;
  padding: 0.65rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.canvass-occupant-name,
.canvass-occupant-phone,
.canvass-occupant-email {
  grid-column: 1;
  margin-bottom: 0;
}

.canvass-occupant-lean,
.canvass-occupant-consent {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.canvass-occ-remove {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  min-width: 2.75rem;
  min-height: 48px;
  font-size: 1.25rem;
  line-height: 1;
}

.canvass-add-occupant {
  width: 100%;
  min-height: 44px;
  margin: 0.75rem 0 0.5rem;
}

.lean-switch {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
}

.lean-switch-2 {
  grid-template-columns: 1fr 1fr;
}

.lean-opt {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 0;
  padding: 0.4rem 0.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  border-right: 1px solid var(--border);
  color: var(--muted);
}

.lean-opt:last-child {
  border-right: none;
}

.lean-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.lean-opt.is-on.lean-undecided {
  background: var(--hover-fill);
  color: var(--text);
}

.lean-opt.is-on.lean-for {
  background: var(--alert-ok-bg);
  color: var(--alert-ok-text);
}

.lean-opt.is-on.lean-against {
  background: var(--alert-error-bg);
  color: var(--alert-error-text);
}

.lean-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.12rem 0.4rem;
  border-radius: 3px;
  vertical-align: middle;
}

.lean-badge.lean-for {
  background: var(--alert-ok-bg);
  color: var(--alert-ok-text);
}

.lean-badge.lean-against {
  background: var(--alert-error-bg);
  color: var(--alert-error-text);
}

.lean-badge.lean-undecided {
  background: var(--hover-fill);
  color: var(--muted);
}

.lean-badge.consent-yes {
  background: var(--alert-ok-bg);
  color: var(--alert-ok-text);
}

.lean-badge.consent-no {
  background: var(--alert-error-bg);
  color: var(--alert-error-text);
}

.lean-badge.consent-unknown {
  background: var(--hover-fill);
  color: var(--muted);
}

.canvass-recent-house .canvass-recent-members {
  list-style: none;
  margin: 0.45rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.canvass-recent-person {
  margin-right: 0.35rem;
}

.canvass-recent-role {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

/* --- Admin mobile: stacked lists, bottom tabs, compact header --- */
@media (max-width: 720px) {
  body:has(.admin-page) {
    overflow-x: hidden;
  }

  .admin-page {
    padding: 0.9rem 0.85rem 5.75rem;
    max-width: none;
  }

  .admin-page .header {
    margin-bottom: 1rem;
    gap: 0.5rem;
    align-items: center;
  }

  .admin-page .header .brand .muted {
    display: none;
  }

  .admin-page .header h1 {
    font-size: 1.25rem;
  }

  .admin-header-desk {
    display: none !important;
  }

  .admin-menu-account {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
  }

  .admin-page .site-menu-panel {
    min-width: 13.5rem;
  }

  .admin-page .tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: flex;
    gap: 0;
    margin: 0;
    padding: 0.2rem 0.15rem calc(0.2rem + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: none;
  }

  .admin-page .tab {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
    border: none;
    border-radius: 3px;
    padding: 0.55rem 0.12rem 0.5rem;
    font-size: 0.72rem;
    line-height: 1.15;
    text-align: center;
  }

  .admin-page .tab.active {
    color: var(--primary);
    background: var(--surface-2);
    border: none;
    margin: 0;
  }

  .admin-page .card {
    padding: 1rem 0.95rem;
  }

  .admin-page .card-head {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-page .card-head .actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .admin-page .card-head .select-inline,
  .admin-page .select-inline {
    width: 100%;
    max-width: none;
  }

  .admin-page .card-head .actions .btn {
    flex: 1 1 auto;
  }

  .admin-page .form-grid {
    grid-template-columns: 1fr;
  }

  .admin-page .upload-zone .btn.primary {
    width: 100%;
  }

  .admin-page .sms-form-actions {
    align-items: stretch;
  }

  .admin-page .sms-form-actions .btn {
    width: 100%;
  }

  .admin-page .stats-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }

  .admin-page .table-wrap {
    overflow-x: visible;
    border: none;
    background: transparent;
  }

  .admin-page .table-stack {
    display: block;
    width: 100%;
  }

  .admin-page .table-stack thead {
    display: none;
  }

  .admin-page .table-stack tbody {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .admin-page .table-stack tr {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.7rem 0.85rem;
  }

  .admin-page .table-stack tr.test-user-row {
    border-left: 3px solid var(--primary);
  }

  .admin-page .table-stack td {
    display: block;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border);
    max-width: none;
    overflow-wrap: anywhere;
  }

  .admin-page .table-stack td:last-child {
    border-bottom: none;
  }

  .admin-page .table-stack td::before {
    content: attr(data-label);
    display: block;
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 0.12rem;
  }

  .admin-page .table-stack td:not([data-label])::before,
  .admin-page .table-stack td[data-label='']::before {
    content: none;
  }

  .admin-page .table-stack td.row-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.4rem;
    padding-top: 0.65rem;
    white-space: normal;
  }

  .admin-page .table-stack td.row-actions::before {
    content: none;
  }

  .admin-page .table-stack td.row-actions .btn {
    flex: 1 1 auto;
  }

  .admin-page .table-stack tr.stack-empty,
  .admin-page .table-stack td[colspan] {
    display: block;
    border: none;
    padding: 0.85rem 0.25rem;
    text-align: center;
  }

  .admin-page .table-stack td[colspan]::before {
    content: none;
  }

  .admin-page .table-stack .link-cell {
    max-width: none;
  }

  .admin-page .table-stack .link-cell a {
    word-break: break-all;
    text-align: left;
  }

  .admin-page .check-list label {
    align-items: flex-start;
  }

  .admin-page .footer {
    margin-bottom: 0.5rem;
  }
}
