:root {
  color-scheme: light;
  --bg: #f7f4ef;
  --bg-2: #efe7de;
  --surface: #ffffff;
  --surface-2: #f6f1ea;
  --text: #191b22;
  --muted: #5f6572;
  --line: #e4ded7;
  --accent: rgb(99, 100, 255);
  --brand: var(--accent);
  --brand-2: var(--accent);
  --danger: #e74c5b;
  --ok: #2cb67d;
  --warn: #f0b429;
  --shadow: 0 24px 70px rgba(21, 23, 28, 0.12);
  --radius: 18px;
  --radius-lg: 28px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: "Space Grotesk", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11121a;
  --bg-2: #0e1117;
  --surface: #131a23;
  --surface-2: #10161f;
  --text: #eef1f6;
  --muted: #a2aab6;
  --line: #252c36;
  --accent: rgb(99, 100, 255);
  --brand: var(--accent);
  --brand-2: var(--accent);
  --danger: #ff6a7c;
  --ok: #5dd69b;
  --warn: #ffd166;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  background:
    radial-gradient(1100px 520px at 10% -10%, rgba(99, 100, 255, 0.22), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(99, 100, 255, 0.16), transparent 55%),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--text);
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  z-index: -1;
}

body::before {
  top: 10%;
  left: -120px;
  background: color-mix(in srgb, var(--accent) 25%, transparent);
}

body::after {
  bottom: -120px;
  right: -120px;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(900px 520px at 10% -10%, rgba(32, 36, 50, 0.35), transparent 60%),
    radial-gradient(820px 520px at 90% 0%, rgba(14, 18, 26, 0.55), transparent 58%),
    radial-gradient(520px 360px at 70% 85%, rgba(99, 100, 255, 0.05), transparent 62%),
    var(--bg);
  background-repeat: no-repeat;
}

html[data-theme="dark"] body::before,
html[data-theme="dark"] body::after {
  opacity: 0.06;
}

a { color: inherit; }
button, input, select, textarea { font: inherit; }
code { font-family: var(--mono); font-size: 0.95em; color: var(--accent); }
.mono { font-family: var(--mono); }
.small { font-size: 0.92rem; }
.container { max-width: 1300px; margin: 0 auto; padding: 0 28px; }
.section { padding: 48px 0; }
.muted { color: var(--muted); }
.lead { font-size: clamp(1.2rem, 1.8vw, 1.5rem); line-height: 1.55; margin: 0.6rem 0 0; }
.sublead { font-size: 1rem; color: var(--muted); line-height: 1.7; margin: 0.8rem 0 0; }
h1 { font-size: clamp(2.6rem, 4vw, 3.6rem); letter-spacing: -0.02em; margin: 0; }
.beta-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  margin-left: 0;
  transform: translateY(-25px);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  vertical-align: middle;
}
.brand-name .beta-badge {
  padding: 4px 8px;
  font-size: 0.55rem;
  margin-left: 8px;
}
h2 { font-size: clamp(1.6rem, 2.4vw, 2rem); margin: 0 0 14px; }
h3 { font-size: 1.05rem; margin: 0 0 10px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 65%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.topbar-inner { display: flex; align-items: center; gap: 20px; padding: 18px 24px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { filter: drop-shadow(0 16px 30px rgba(0, 0, 0, 0.16)); }
.brand-name { font-weight: 700; letter-spacing: 0.01em; }
.nav { display: none; gap: 18px; margin-left: 10px; align-items: center; }
.nav a { color: var(--muted); text-decoration: none; font-size: 0.98rem; line-height: 1; display: inline-flex; align-items: center; padding-top: 2px; }
.nav .nav-link { background: none; border: 0; padding: 0; color: var(--muted); font-size: 0.98rem; cursor: pointer; line-height: 1; display: inline-flex; align-items: center; font: inherit; }
.nav a:hover { color: var(--text); }
.nav .nav-link:hover { color: var(--text); }
.nav-cta { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn .icon { width: 22px; height: 22px; display: block; fill: currentColor; }
.btn .icon-text {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}
.theme-toggle .icon { color: var(--text); }
.topbar-status { display: flex; justify-content: flex-end; text-align: right; margin: 6px 0 12px; overflow-wrap: anywhere; word-break: break-word; }

@media (max-width: 720px) {
  .topbar-inner { gap: 12px; padding: 14px 16px; }
  .nav-cta { width: 100%; justify-content: flex-start; gap: 8px; }
}

@media (min-width: 880px) {
  .nav { display: flex; }
}

.hero { padding: 0; }
.hero-grid { display: grid; gap: 28px; }
@media (min-width: 980px) {
  .hero-grid { grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
  .hero-copy { order: 1; }
  .hero-logo-wrap { order: 2; }
}
.hero-full .hero-grid { grid-template-columns: 1fr; }
.hero-copy { padding: 6px 0; }
.hero-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-copy .hero-logo { display: none; }
.hero-logo {
  display: block;
  width: clamp(180px, 26vw, 300px);
  height: auto;
  margin: 6px auto 22px;
  filter: drop-shadow(0 16px 30px rgba(14, 18, 30, 0.2));
}
@media (min-width: 980px) {
  .hero-copy .hero-logo { display: none; }
  .hero-logo-wrap .hero-logo { margin: 0; }
}
.selfhost-hero .hero-copy .hero-logo { display: none; }
@media (min-width: 980px) {
  .selfhost-hero .hero-grid { grid-template-columns: 1.1fr 0.9fr; gap: 36px; align-items: center; }
  .selfhost-hero .hero-card { order: 2; }
  .selfhost-hero .hero-copy { order: 1; }
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 26px; }
.trust { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 28px; }
@media (min-width: 700px) {
  .trust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 980px) {
  .trust { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.hero-cards .trust { margin-top: 0; }
.trust-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 94%, transparent), color-mix(in srgb, var(--surface-2) 88%, transparent));
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 16px 40px rgba(20, 20, 28, 0.1);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.trust-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 70%, transparent);
  opacity: 0.75;
}
.trust-item:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  box-shadow: 0 22px 44px rgba(20, 20, 28, 0.12);
}
.trust-title { font-weight: 650; margin-bottom: 6px; }
.trust-text { color: var(--muted); font-size: 0.96rem; line-height: 1.5; }
.trust-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.trust-icon svg { width: 18px; height: 18px; fill: currentColor; }
.trust-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.trust-head .trust-title { margin: 0; }

.hero-card { display: flex; flex-direction: column; gap: 18px; margin-top: 35px; }
.card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, transparent), color-mix(in srgb, var(--surface-2) 88%, transparent));
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card-title { font-weight: 650; margin-bottom: 12px; }
.card-note { margin-top: 12px; }
.hero-cards { margin-top: 50px; }

.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 50; }
.modal[aria-hidden="false"] { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 10, 16, 0.6); backdrop-filter: blur(4px); }
.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100% - 32px));
  max-height: calc(100vh - 64px);
  overflow: auto;
  overflow-x: hidden;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 8%, var(--surface)), var(--surface) 60%);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 24px 70px color-mix(in srgb, var(--accent) 15%, rgba(0, 0, 0, 0.35));
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}
.modal-grid { display: grid; gap: 22px; margin-top: 24px; }
@media (min-width: 880px) {
  .modal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.modal-steps { margin-top: 20px; }
.modal-steps-primary { font-size: 1.05rem; }
.modal-steps-primary li strong { color: var(--accent); }
.modal-dialog,
.modal-dialog p,
.modal-dialog li,
.modal-dialog code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 640px) {
  .modal-dialog {
    width: calc(100% - 20px);
    max-height: calc(100vh - 24px);
    padding: 20px;
    border-radius: 20px;
  }
  .modal-close {
    top: 10px;
    right: 10px;
  }
  .modal-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .modal-steps-primary { font-size: 1rem; }
  .modal .form { gap: 14px; max-width: 100%; }
  .modal .form .btn { width: 100%; justify-content: center; }
  .confirm-actions { flex-direction: column; align-items: stretch; }
  .confirm-actions .btn { width: 100%; justify-content: center; }
  .captcha-row { flex-direction: column; align-items: stretch; }
  .captcha-row input { max-width: none; }
  .captcha-question { white-space: normal; }
}
.modal .tile {
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
}
.modal-steps-primary li { margin-bottom: 10px; }
.modal-section { margin-top: 18px; }
.modal-confirm { width: min(520px, calc(100% - 32px)); }
.confirm-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; }
.health-summary { display: grid; gap: 8px; }
.health-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  font-weight: 600;
}
.health-status.ok {
  border-color: color-mix(in srgb, var(--ok) 45%, transparent);
  background: color-mix(in srgb, var(--ok) 12%, transparent);
}
.health-status.degraded {
  border-color: color-mix(in srgb, var(--warn) 45%, transparent);
  background: color-mix(in srgb, var(--warn) 12%, transparent);
}
.health-meta { color: var(--muted); }
.health-grid { display: grid; gap: 18px; }
@media (min-width: 880px) {
  .health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.health-list { display: grid; gap: 12px; margin: 0; }
.health-list div { display: grid; gap: 4px; }
.health-list dt { color: var(--muted); font-size: 0.95rem; }
.health-list dd { margin: 0; font-weight: 600; word-break: break-all; }
.health-problems { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }

.app-page .section { padding: 0; }
.app-page .hero { padding-top: 0; }
.app-guest .hero { padding-top: 24px; }
.selfhost-page .section { padding: 28px 0; }
.selfhost-page .hero { margin-top: 16px; }
.app-page .section-divider {
  height: 1px;
  background: color-mix(in srgb, var(--line) 85%, transparent);
  margin: 40px 0;
}
.app-page .scheduled-section { margin-top: 28px; }

.mini-preview {
  background: linear-gradient(120deg, color-mix(in srgb, var(--surface-2) 92%, transparent), color-mix(in srgb, var(--surface) 85%, transparent));
  border: 1px dashed color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.mini-line { height: 10px; background: color-mix(in srgb, var(--text) 12%, transparent); border-radius: 999px; margin: 12px 0; }
.mini-line.w80 { width: 80%; }
.mini-pill {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.88rem;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.grid3 { display: grid; gap: 22px; }
@media (min-width: 900px) {
  .grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.grid2 { display: grid; gap: 22px; }
@media (min-width: 900px) {
  .grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.tile {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 10px 26px rgba(20, 20, 28, 0.06);
}
.tile p { margin: 0; color: var(--muted); line-height: 1.6; }

.steps { margin: 12px 0 0; padding-left: 18px; color: var(--muted); line-height: 1.8; }
.callout {
  margin-top: 16px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--brand) 12%, transparent), color-mix(in srgb, var(--surface-2) 86%, transparent));
  border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent);
  border-radius: var(--radius);
  padding: 16px;
}
.callout-title { font-weight: 650; margin-bottom: 8px; }
.callout-text { color: var(--muted); line-height: 1.6; }

.cta-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--brand) 20%, transparent), color-mix(in srgb, var(--brand-2) 18%, transparent));
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  text-decoration: none;
  cursor: pointer;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--text);
  font-weight: 600;
  font: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.btn:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(22, 22, 28, 0.12);
}
.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  pointer-events: none;
}
.btn-primary {
  background: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  color: #ffffff;
}
.btn-ghost { background: color-mix(in srgb, var(--surface) 50%, transparent); }
.btn-danger {
  background: color-mix(in srgb, var(--danger) 28%, transparent);
  border-color: color-mix(in srgb, var(--danger) 70%, transparent);
  color: color-mix(in srgb, var(--danger) 85%, #ffffff);
}
.btn-danger:hover {
  border-color: color-mix(in srgb, var(--danger) 85%, transparent);
  box-shadow: 0 10px 24px rgba(180, 52, 52, 0.18);
}
.btn-sm { padding: 9px 14px; font-size: 0.95rem; }
.drafts-bar .btn-danger { margin-bottom: 5px; }
.drafts-bar .btn-danger {
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  color: color-mix(in srgb, var(--danger) 70%, var(--text));
}
.drafts-bar .btn-danger:hover {
  border-color: color-mix(in srgb, var(--danger) 55%, transparent);
  box-shadow: 0 8px 18px rgba(180, 52, 52, 0.12);
}

.theme-toggle {
  border-style: solid;
}

.form { margin-top: 20px; display: grid; gap: 18px; max-width: 860px; }
label span { display: block; font-weight: 650; margin-bottom: 8px; }
.captcha-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.captcha-question {
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.captcha-row input { max-width: 140px; }
.drafts-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.drafts-label { display: grid; gap: 6px; }
.drafts-label select { min-width: 240px; }
input, textarea, select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-size: 1.05rem;
}
textarea { resize: vertical; }
.textarea-lg textarea { min-height: 220px; }
.field-meta { display: flex; justify-content: flex-end; margin-top: 8px; }
.counter { font-size: 0.95rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.file-input { display: grid; gap: 6px; }
.file-input input[type="file"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px dashed color-mix(in srgb, var(--line) 70%, transparent);
  color: var(--text);
}
.dropzone {
  position: relative;
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  padding: 90px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.dropzone-inner { display: grid; gap: 4px; text-align: center; }
.dropzone-title { font-weight: 650; }
.dropzone-sub { color: var(--muted); font-size: 0.95rem; }
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.dropzone.is-dragover {
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.dropzone[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
.media-preview { display: grid; gap: 14px; margin-top: 14px; }
.media-item {
  display: grid;
  gap: 10px;
  grid-template-columns: 140px 1fr;
  align-items: start;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
}
.media-thumb {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}
.media-fields { display: grid; gap: 8px; }
.media-alt { width: 100%; }
.media-remove {
  justify-self: flex-start;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
}
.media-remove:hover {
  border-color: color-mix(in srgb, var(--danger) 65%, transparent);
}
.media-divider {
  height: 1px;
  margin: 20px 0;
  background: color-mix(in srgb, var(--line) 70%, transparent);
}
input:focus, textarea:focus, select:focus {
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.row { display: grid; gap: 18px; }
@media (min-width: 820px) {
  .row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.checkbox { display: flex; gap: 12px; align-items: center; }
.checkbox input { width: auto; margin-top: 1px; }
.checkbox span { line-height: 1.4; margin-top: 7px; }
.form-note { margin-top: 12px; }
.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.toggle-row input { transform: none; }
.toggle-row .toggle-switch {
  appearance: none;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  position: relative;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.toggle-row .toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease;
}
.toggle-row .toggle-switch:checked {
  background: color-mix(in srgb, var(--accent) 80%, transparent);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}
.toggle-row .toggle-switch:checked::after {
  transform: translateX(18px);
}
.toggle-row span {
  font-weight: 600;
  margin-bottom: 0;
  display: inline;
}
.toggle-row span[data-i18n="dash_post_now"],
.toggle-row span[data-i18n="dash_sensitive"] {
  margin-top: 7px;
}
.toggle-row:has(.toggle-switch:checked) {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.toggle-row .toggle-switch:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 2px;
}
.input-disabled {
  opacity: 0.55;
  filter: grayscale(0.2);
}
.input-disabled .muted {
  color: color-mix(in srgb, var(--muted) 75%, transparent);
}
.input-disabled input {
  cursor: not-allowed;
}
.upload-progress {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}
.upload-progress[hidden] {
  display: none;
}
.upload-label {
  font-size: 0.95rem;
  color: var(--muted);
}
.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 75%, transparent);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.2s ease;
}

.flash-wrap {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 80;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  max-width: min(460px, calc(100% - 48px));
}
.flash {
  position: relative;
  padding: 18px 50px 25px 50px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  color: var(--text);
  box-shadow: 0 18px 40px rgba(20, 20, 28, 0.16);
  border-top-width: 12px;
}
.flash::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 8px;
  height: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 55%, transparent);
  transform-origin: left;
  animation: flash-progress linear forwards;
  animation-duration: var(--flash-time, 5s);
}
.flash.success {
  border-top-color: color-mix(in srgb, var(--ok) 75%, transparent);
}
.flash.success::after { background: color-mix(in srgb, var(--ok) 70%, transparent); }
.flash.error {
  border-top-color: color-mix(in srgb, var(--danger) 75%, transparent);
}
.flash.error::after { background: color-mix(in srgb, var(--danger) 70%, transparent); }
@media (max-width: 640px) {
  .flash-wrap {
    top: 20px;
    right: 20px;
    max-width: calc(100% - 40px);
  }
}
@keyframes flash-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.92rem;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  margin: 10px 0;
}
.badge.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.badge.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.warnbox {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
  color: var(--text);
}

.checklist { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.8; }
.pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; flex-wrap: wrap; }
.pagehead-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.pagehead { margin-bottom: 26px; }
.pagehead .muted { margin-top: 6px; }
.pagehead + .grid2,
.pagehead + .table-wrap { margin-top: 8px; }
.table-wrap {
  overflow: auto;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  box-shadow: 0 10px 30px rgba(20, 20, 28, 0.08);
}
.table { width: 100%; border-collapse: collapse; min-width: 720px; }
.table th, .table td {
  padding: 16px 18px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
  vertical-align: top;
}
.preview-text { margin-bottom: 8px; }
.media-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.media-thumb-sm {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}
.table-note { margin-top: 18px; }
.table th { color: var(--muted); text-align: left; font-weight: 650; }
.table tr:last-child td { border-bottom: 0; }

@media (max-width: 720px) {
  .table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { min-width: 0; }
  .table th, .table td { padding: 12px 12px; }
}
.actions { white-space: nowrap; text-align: right; }
.actions { display: flex; gap: 8px; justify-content: flex-end; }
.actions form { margin: 0; }
.counter.is-over { color: var(--danger); }
.icon-btn {
  border: 0;
  background: none;
  padding: 0;
  margin-left: 6px;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { color: var(--text); }
.icon-btn .icon { width: 18px; height: 18px; }
.split-wrap { margin-top: 8px; }
.split-panel {
  margin-top: 8px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}
.split-modes { display: grid; gap: 10px; }
.radio-row {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 6px 2px;
}
.radio-row input[type="radio"] { margin: 0; }
.radio-row span { text-align: left; margin-bottom: 0; display: inline; }
.split-note { margin-top: 6px; }
.split-preview { margin-top: 12px; display: grid; gap: 10px; }
.split-item {
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  padding: 10px 12px;
}
.split-item-head { font-weight: 650; margin-bottom: 6px; }
.split-item-body { white-space: pre-wrap; }
.split-item-meta { margin-top: 8px; font-size: 0.95rem; color: var(--muted); }
.split-visibility-label { font-weight: 650; }
.split-visibility { margin-top: 8px; width: 100%; }
.split-interval { margin-top: 10px; display: none; gap: 6px; }
.split-panel.split-series .split-interval { display: grid; }
.ui-highlight {
  animation: ui-highlight 0.8s ease;
}
@keyframes ui-highlight {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  70% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 15%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.footer {
  border-top: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
  margin-top: 40px;
  padding: 20px 0 30px;
  color: var(--muted);
}
.footer-link {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

@keyframes fade-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero, .section, .card, .tile, .cta-banner {
  animation: fade-rise 0.7s ease both;
}
.hero { animation-delay: 0.05s; }
.section { animation-delay: 0.1s; }
.card { animation-delay: 0.12s; }
.tile { animation-delay: 0.14s; }
.cta-banner { animation-delay: 0.18s; }

@media (prefers-reduced-motion: reduce) {
  .hero, .section, .card, .tile, .cta-banner {
    animation: none;
  }
  .btn { transition: none; }
}
