:root {
  /* Default: dark. Palettes: dark / light. Distinct from personal :8765. */
  color-scheme: dark;
  --bg: #0c1211;
  --glow: #163028;
  --surface: #141c1a;
  --surface-2: #1c2824;
  --border: #2a3d37;
  --text: #e6f0ed;
  --muted: #8fa39b;
  --primary: #2ec4a6;
  --primary-hover: #4fd4b8;
  --on-primary: #06211b;
  --success: #3ecf8e;
  --warning: #f5b942;
  --danger: #ff6b6b;
  --log-bg: #0b0d12;
  --row-hover: rgba(255, 255, 255, 0.03);
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

html[data-theme="dark"],
html[data-theme="moss"],
html[data-theme="slate"],
html[data-theme="navy"],
html[data-theme="ember"] {
  color-scheme: dark;
  --bg: #0c1211;
  --glow: #163028;
  --surface: #141c1a;
  --surface-2: #1c2824;
  --border: #2a3d37;
  --text: #e6f0ed;
  --muted: #8fa39b;
  --primary: #2ec4a6;
  --primary-hover: #4fd4b8;
  --on-primary: #06211b;
  --success: #3ecf8e;
  --warning: #f5b942;
  --danger: #ff6b6b;
  --log-bg: #0b0d12;
  --row-hover: rgba(255, 255, 255, 0.03);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

html[data-theme="light"],
html[data-theme="paper"] {
  color-scheme: light;
  --bg: #efeae2;
  --glow: #e4d9c4;
  --surface: #fbf8f3;
  --surface-2: #f0eee8;
  --border: #d4cdc0;
  --text: #1f1b16;
  --muted: #6e675c;
  --primary: #1d6b5a;
  --primary-hover: #268572;
  --on-primary: #ffffff;
  --success: #1a8a58;
  --warning: #b06a10;
  --danger: #c4453c;
  --log-bg: #f4efe6;
  --row-hover: rgba(31, 27, 22, 0.04);
  --shadow: 0 10px 28px rgba(40, 30, 16, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, var(--glow) 0%, var(--bg) 45%);
  color: var(--text);
  min-height: 100vh;
}

.layout {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 20px 16px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.header-brand {
  min-width: 0;
}

.header-guide {
  display: inline-block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
  border-bottom: 1px dashed var(--border);
}

.header-guide:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.setup-guide-line {
  margin: 0 0 12px;
}

.setup-guide-line .header-guide {
  margin-top: 0;
}

.guide-layout {
  max-width: 760px;
  margin: 0 auto;
}

.guide-toc ol {
  margin: 8px 0 0;
  padding-left: 1.2rem;
}

.guide-toc a {
  color: var(--primary);
  text-decoration: none;
}

.guide-toc a:hover {
  text-decoration: underline;
}

.guide-article h2 {
  margin-top: 0;
}

.guide-steps,
.guide-article ul {
  padding-left: 1.2rem;
}

.guide-steps li,
.guide-article li {
  margin: 0.45rem 0;
}

.guide-article code {
  font-size: 0.88em;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.instance-badge {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  letter-spacing: 0.04em;
}

.instance-badge.instance-server {
  border-color: var(--warning);
  color: var(--warning);
}

.login-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.login-card {
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
}

.setup-card {
  max-width: 560px;
}

.setup-card select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 1rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--muted);
}

.login-form input,
.admin-form select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 1rem;
}

.user-chip {
  display: none;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.user-chip.visible {
  display: flex;
}

h1, h2 {
  margin: 0;
}

h1 {
  font-size: 1.8rem;
}

h2 {
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.header-actions .btn {
  padding: 9px 14px;
  font-size: 0.76rem;
  border-radius: 8px;
}

.header-actions .user-chip {
  font-size: 0.72rem;
  gap: 6px;
}

.header-actions .theme-swatch {
  width: 13px;
  height: 13px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow: auto;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  margin: 0;
  max-height: none;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-head h2 {
  margin: 0;
}

.index-republish-panel {
  width: min(460px, 100%);
  margin-top: 18vh;
}

.index-republish-panel p {
  margin: 0 0 18px;
  line-height: 1.45;
}

.index-republish-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

body.modal-open {
  overflow: hidden;
}

.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.actions-text p {
  margin: 8px 0 0;
  max-width: 560px;
}

.actions-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.stat-label {
  color: var(--muted);
  font-size: 0.85rem;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  margin-top: 6px;
}

.two-col {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
}

@media (max-width: 900px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

tbody tr:hover {
  background: var(--row-hover);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-neutral {
  background: var(--surface-2);
  color: var(--muted);
}

.badge-running {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  color: var(--primary);
}

.badge-completed {
  background: rgba(62, 207, 142, 0.15);
  color: var(--success);
}

.badge-failed {
  background: rgba(255, 107, 107, 0.15);
  color: var(--danger);
}

.badge-queued {
  background: rgba(245, 185, 66, 0.15);
  color: var(--warning);
}

.status-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 0.82rem;
  line-height: 1.35;
  max-width: 11rem;
  white-space: normal;
}

.status-pill .status-sub {
  opacity: 0.75;
  font-size: 0.75rem;
}

.status-pill.status-empty {
  color: var(--muted);
}

.status-pill.status-waiting {
  background: color-mix(in srgb, var(--warning) 16%, transparent);
  color: var(--warning);
  border: 1px solid color-mix(in srgb, var(--warning) 40%, transparent);
  animation: pulse-wait 2.4s ease-in-out infinite;
}

.status-pill.status-running {
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  color: var(--primary-hover);
  border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent);
}

.status-pill.status-ready {
  color: var(--success);
}

.status-pill.status-failed {
  color: var(--danger);
}

.step-error {
  max-width: 18rem;
  white-space: normal;
  line-height: 1.35;
}

.brand-status.brand-waiting {
  color: var(--warning);
}

.brand-status.brand-waiting .dot {
  background: var(--warning);
  animation: pulse-wait 2.4s ease-in-out infinite;
}

.brand-status.brand-running {
  color: var(--primary-hover);
}

.brand-status.brand-running .dot {
  background: var(--primary-hover);
}

@keyframes pulse-wait {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

.status-ready {
  color: var(--success);
}

.status-planned {
  color: var(--muted);
}

.steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.steps-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.steps-list li:last-child {
  border-bottom: none;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.section-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.owner-filter {
  display: inline-flex;
  align-items: center;
}

.owner-filter select {
  min-width: 9rem;
  max-width: 13rem;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
}

.btn-compact {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  min-height: 0;
}

.list-more {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.list-more[hidden] {
  display: none;
}

.job-panel.hidden {
  display: none;
}

.log {
  margin: 0;
  background: var(--log-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  min-height: 140px;
  max-height: 320px;
  overflow: auto;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.85rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.error-text {
  color: var(--danger);
  margin: 10px 0 0;
}

.hidden {
  display: none;
}

.job-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.brands-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.brand-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 0;
}

.brand-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 12rem;
}

.brand-domain {
  font-weight: 600;
  font-size: 0.98rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.brand-slug {
  color: var(--muted);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.brand-index-error {
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
}

.brand-registrar,
.sheet-registrar {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.2;
  opacity: 0.9;
}

.sheet-domain {
  font-weight: 500;
}

.setup-registrar-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
}

.setup-registrar-extras {
  margin: 4px 0 10px;
}

.setup-add-registrar-panel {
  max-width: 28rem;
}

.site-form-registrar-ro {
  margin: 0;
  grid-column: 1 / -1;
}

.brand-actions > .btn-delete {
  flex-shrink: 0;
}

.cell-delete {
  text-align: right;
  width: 2.2rem;
}

.admin-role-select {
  min-width: 7.5rem;
  padding: 0.3rem 0.45rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
}

.admin-role-select:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-delete {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1;
  width: 26px;
  height: 26px;
}

.btn-delete:hover:not(:disabled) {
  border-color: #c45b5b;
  background: rgba(196, 91, 91, 0.16);
  color: #c45b5b;
}

.brand-meta {
  color: var(--muted);
  font-size: 0.75rem;
}

.home-copy-chip,
.show-toc-chip,
.faq-chip,
.analytics-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border: 1px solid color-mix(in srgb, var(--warning) 55%, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--warning) 16%, var(--surface));
  color: var(--warning);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.home-copy-chip input[type="checkbox"],
.show-toc-chip input[type="checkbox"],
.faq-chip input[type="checkbox"],
.analytics-chip input[type="checkbox"] {
  margin: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--warning);
}

.home-copy-chip.is-pending {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--warning) 35%, transparent);
}

.home-copy-chip.is-on,
.show-toc-chip.is-on,
.faq-chip.is-on,
.analytics-chip.is-on {
  border-color: color-mix(in srgb, var(--success) 50%, var(--border));
  background: rgba(62, 207, 142, 0.16);
  color: var(--success);
}

.home-copy-chip.is-on input[type="checkbox"],
.show-toc-chip.is-on input[type="checkbox"],
.faq-chip.is-on input[type="checkbox"],
.analytics-chip.is-on input[type="checkbox"] {
  accent-color: var(--success);
}

.faq-chip label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.faq-chip select {
  font: inherit;
  font-weight: 700;
  color: inherit;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 6px;
  padding: 0 2px;
}

.home-copy-toggle,
.show-toc-toggle,
.analytics-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  user-select: none;
}

.home-copy-toggle input[type="checkbox"],
.show-toc-toggle input[type="checkbox"],
.analytics-toggle input[type="checkbox"] {
  margin: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.home-copy-toggle:has(input:checked),
.show-toc-toggle:has(input:checked),
.analytics-toggle:has(input:checked) {
  color: var(--primary);
}

.brand-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 10px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}

.chip-label-short {
  display: none;
}

/* Split-screen / mid widths: stack so domain never overlaps chips/buttons */
@media (max-width: 1100px) {
  .brand-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .brand-info {
    flex: 0 0 auto;
    width: 100%;
  }

  .brand-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .chip-label-full {
    display: none;
  }

  .chip-label-short {
    display: inline;
  }
}

@media (max-width: 640px) {
  .brand-actions .btn-primary,
  .brand-actions .btn-ghost,
  .brand-actions button {
    font-size: 0.82rem;
  }
}


.brand-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.brand-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.brand-done {
  background: rgba(62, 207, 142, 0.15);
  color: var(--success);
}

.brand-new {
  background: rgba(154, 164, 184, 0.16);
  color: var(--muted);
}

.brand-pending {
  background: rgba(245, 185, 66, 0.15);
  color: var(--warning);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.btn-icon:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--surface-2);
}

.btn-icon:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-schedule.is-on {
  border-color: rgba(62, 207, 142, 0.55);
  background: rgba(62, 207, 142, 0.15);
  color: var(--success);
}

.btn-schedule.is-on:hover:not(:disabled) {
  border-color: var(--success);
  background: rgba(62, 207, 142, 0.25);
}

.schedule-popover {
  position: fixed;
  z-index: 80;
  min-width: 260px;
  max-width: min(320px, calc(100vw - 16px));
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.schedule-popover.hidden {
  display: none;
}

.schedule-popover-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.schedule-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  cursor: pointer;
}

.schedule-when {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--muted);
}

.schedule-when input[type="datetime-local"] {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.85rem;
}

.schedule-popover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.btn-publish {
  padding: 7px 16px;
  border-radius: 8px;
  border: none;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.btn-publish:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-publish:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-publish.btn-published {
  background: rgba(62, 207, 142, 0.15);
  color: var(--success);
}

.btn-publish.btn-published:hover:not(:disabled) {
  background: rgba(62, 207, 142, 0.25);
}

.btn-redo {
  font-size: 0.82rem;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}

.btn-redo:hover {
  border-color: var(--warning);
  color: var(--warning);
}

.btn-regen4 {
  font-size: 0.82rem;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}

.btn-regen4:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-regen4:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-brief:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-step1 {
  font-size: 0.82rem;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--primary) 55%, transparent);
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  color: var(--primary-hover);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.btn-step1:hover:not(:disabled) {
  background: color-mix(in srgb, var(--primary) 24%, transparent);
}

.btn-step1:disabled,
.btn-step1.btn-step1-running {
  opacity: 0.7;
  cursor: not-allowed;
}

.slug-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.slug-pick select {
  min-width: 11rem;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.site-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}

.site-mode {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px 8px;
  margin: 0;
}

.site-mode legend {
  padding: 0 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.site-mode-option {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0;
  color: var(--text);
  font-weight: 600;
}

.site-mode-option input {
  margin-top: 4px;
  width: auto;
  accent-color: var(--primary);
}

.site-mode-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.site-mode-title {
  font-weight: 600;
}

.site-mode-option .field-hint {
  display: block;
  font-weight: 400;
}

.site-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}

@media (max-width: 800px) {
  .site-form-grid {
    grid-template-columns: 1fr;
  }
}

.site-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--muted);
}

.site-form label.hidden {
  display: none;
}

.site-form .site-mode-option {
  flex-direction: row;
  align-items: flex-start;
  color: var(--text);
  font-weight: 600;
}

.site-form input,
.site-form select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 1rem;
}

.site-form select:disabled {
  opacity: 1;
  color: var(--text);
  cursor: default;
}

.site-form input::placeholder,
.login-form input::placeholder,
.admin-form input::placeholder {
  font-style: italic;
  font-size: 0.82rem;
  color: var(--muted);
  opacity: 1;
}

.site-form input:disabled {
  opacity: 0.55;
}

.site-form-divider {
  border: 0;
  height: 2px;
  background: var(--muted);
  margin: 12px 0 8px;
  width: 100%;
}

.field-hint {
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
}

.field-hint code {
  font-size: 0.78rem;
}

.check-row {
  display: flex;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 10px;
  color: var(--text);
  font-size: 0.9rem;
}

.check-row input[type="checkbox"] {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.site-form-cf {
  grid-column: 1 / -1;
  padding: 14px 16px;
  border: 2px solid var(--warning);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--warning) 12%, var(--surface));
  color: var(--text);
  font-weight: 600;
}

.site-form-cf input {
  font-weight: 400;
}

.site-form-cf .field-hint {
  font-weight: 400;
}

.site-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.site-form-actions .btn-primary {
  margin-left: auto;
}

.batch-modal-panel {
  width: min(560px, 100%);
}

.batch-domains {
  display: block;
  width: 100%;
  min-height: 180px;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  line-height: 1.4;
  resize: vertical;
}

.batch-csv-ops {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}

.batch-csv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

#batchSitesOk {
  white-space: pre-wrap;
}

.brand-draft {
  background: rgba(154, 164, 184, 0.22);
  color: var(--muted);
  border: 1px dashed var(--border);
}

.content-only-banner {
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid var(--warning);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--warning) 12%, var(--surface));
  color: var(--text);
  font-weight: 600;
}

.content-only-banner.warn-banner {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
}

.content-only-banner.sandbox-banner {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
}

.btn-custom-assets.has-custom {
  border-color: var(--primary);
  color: var(--primary);
}

.custom-assets-panel {
  width: min(760px, 100%);
}

.custom-assets-slots {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

.custom-asset-slot {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.custom-asset-slot.is-custom {
  border-color: var(--primary);
}

.custom-asset-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: 6px;
  border-radius: 8px;
  background: repeating-conic-gradient(var(--surface-2) 0% 25%, var(--surface) 0% 50%) 50% / 16px 16px;
}

.custom-asset-thumb {
  display: block;
  max-width: 100%;
  max-height: 96px;
  object-fit: contain;
}

.custom-asset-thumb-favicon {
  width: 48px;
  height: 48px;
}

.custom-asset-empty {
  color: var(--muted);
  font-size: 0.85rem;
}

.custom-asset-label {
  font-weight: 600;
}

.custom-asset-meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 2px 0 4px;
  word-break: break-all;
}

.custom-asset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.custom-asset-buttons .is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.custom-assets-library-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.library-picker {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.library-card {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.library-card.is-foreign {
  opacity: 0.75;
}

.library-preview {
  min-height: 64px;
}

.library-meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.library-lang {
  display: inline-block;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-weight: 600;
  text-transform: uppercase;
}

.library-lang.is-foreign {
  border-color: var(--danger);
  color: var(--danger);
}

.library-saved-tag {
  align-self: center;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
}

.custom-asset-buttons .is-active {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-danger-text {
  color: var(--danger);
}

.custom-assets-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 640px) {
  .custom-asset-slot {
    grid-template-columns: 1fr;
  }
}

.interrupted-jobs {
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.interrupted-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

body.setup-readonly .login-form {
  opacity: 0.72;
}

#setupReadonlyNote {
  margin-bottom: 16px;
}

.kw-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kw-block-label {
  font-size: 0.9rem;
  color: var(--muted);
}

.kw-translate-warn {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--warning) 55%, var(--border));
  background: color-mix(in srgb, var(--warning) 16%, var(--surface));
  color: var(--warning);
  font-size: 0.86rem;
  line-height: 1.35;
}

.home-copy-block .site-form-grid {
  margin-top: 4px;
}

.kw-table {
  width: 100%;
  border-collapse: collapse;
}

.kw-table th {
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0 8px 6px 0;
}

.kw-table td {
  padding: 4px 8px 4px 0;
  vertical-align: middle;
}

.kw-table td.kw-freq-cell {
  width: 7.25rem;
}

.kw-table td.kw-del-cell {
  width: 2.4rem;
  padding-right: 0;
}

.kw-table .kw-phrase {
  width: 100%;
}

.kw-table .kw-freq {
  width: 100%;
  text-align: center;
}

.kw-del {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.kw-del:hover {
  border-color: var(--danger, #c45c4a);
  color: var(--danger, #c45c4a);
}

.kw-add {
  align-self: flex-start;
  padding: 6px 10px;
}

a {
  color: var(--primary);
}

.theme-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.theme-swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--border);
  padding: 0;
  cursor: pointer;
  background: var(--swatch, var(--primary));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.theme-swatch[data-theme="light"] {
  box-shadow: inset 0 0 0 1px #1f1b16;
}

.theme-swatch[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--text);
}

.theme-picker-fixed {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 20;
  padding: 6px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
}
