/* ========================================
   ui.css — Tinypost admin UI components
   ======================================== */



/* ── Avatar settings ────────────────── */
.avatar-section {
  margin-bottom: var(--space-6);
}

.avatar-row {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
  margin: 0;
}

.avatar-placeholder {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background: var(--input-bg);
  color: var(--divider);
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-placeholder svg {
  width: 100%;
  height: 100%;
}

.avatar-detail {
  min-width: 0;
}

.avatar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-2);
}

.avatar-actions a {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.avatar-remove {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: #c0392b;
}

.avatar-detail .text-muted {
  font-size: var(--text-sm);
  margin-bottom: 0;
}

/* ── Top nav ────────────────────────── */
.top-nav {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-muted);
}

.top-nav a,
.top-nav .link-button {
  color: var(--text-muted);
  text-decoration: none;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.inline {
  display: inline;
}

/* ── Auth pages ─────────────────────── */
.page-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-4) var(--space-4) var(--space-10);
  text-align: center;
  gap: var(--space-1);
}

.public-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body:has(.public-page) {
  background: var(--bg);
  color: var(--text);
}

.public-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4);
}

.public-header .top-nav-dark {
  position: static;
}

.public-header .top-nav-dark a {
  color: var(--text-muted);
}

.public-header .top-nav-dark a:hover {
  color: var(--text-bright);
}

.public-content {
  max-width: 640px;
  padding: var(--space-8) var(--space-4);
  margin: 0 auto;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.public-content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: var(--space-4);
  text-align: center;
}

.public-content h2 {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}

.public-content .panel {
  padding: var(--space-8);
}

.public-content p {
  font-size: var(--text-lg);
  line-height: 1.7;
}

.home-footer {
  position: fixed;
  bottom: var(--space-6);
  left: 0;
  right: 0;
  text-align: center;
}

.home-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.home-footer a:hover {
  color: var(--text);
}

.home-footer-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
  display: block;
  margin: 0 auto;
}

.home-footer-nav {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
}

.home-footer-nav a {
  margin: 0 var(--space-2);
}

.public-page .home-footer {
  position: static;
  padding: var(--space-8) 0;
}

.logo {
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0;
  background: linear-gradient(90deg, var(--brand-1), var(--brand-2), var(--brand-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

.logo.logo-sm {
  font-size: 1.65rem;
  text-decoration: none;
}

.form-help {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
  margin-bottom: 0;
}

.form-narrow {
  width: 100%;
  max-width: 340px;
  margin-bottom: var(--space-4);
}

.form-narrow .pill-input input {
  flex: 1;
}

.pill-input {
  display: flex;
  align-items: center;
  background: var(--input-bg);
  border: 1px solid var(--divider);
  border-radius: var(--radius-pill);
  padding: var(--space-1) var(--space-1) var(--space-1) var(--space-4);
  font-family: var(--font-mono);
}

.pill-input-suffix {
  font-size: var(--text-base);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  margin-right: var(--space-4);
}

.pill-input input,
.panel .pill-input input[type="text"] {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 0;
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  min-width: 0;
}

.pill-input-right input {
  text-align: right;
}

.pill-input input:focus {
  outline: none;
  border: none;
}

.pill-input input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset;
  -webkit-text-fill-color: var(--text-bright);
}

.pill-input button {
  border-radius: var(--radius-pill);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--bg);
  background: var(--text-bright);
  transition: opacity var(--speed-fast);
}

.pill-input button:hover {
  opacity: 0.8;
}

/* ── Home page ─────────────────────── */
.home-nav {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  font-size: var(--text-sm);
}

.home-nav a {
  color: var(--text-muted);
  text-decoration: none;
}

.home-nav a:hover {
  color: var(--text);
}

.home-tagline {
  color: var(--text-muted);
  margin-bottom: var(--space-3);
  font-size: 1.1rem;
}

/* ── Email form ─────────────────────── */
.email-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  max-width: 350px;
}

input.email-input {
  width: 100%;
  border: none;
  border-bottom: 2px dashed var(--text-muted);
  border-radius: 0;
  background: transparent;
  text-align: center;
  font-size: var(--text-2xl);
  font-weight: 600;
  padding: var(--space-2) 0;
  margin-bottom: var(--space-4);
}

input.email-input:focus {
  outline: none;
  border-color: transparent;
  border-bottom-color: var(--text-bright);
}

.address-input {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  border-bottom: 2px dashed var(--text-muted);
  margin-bottom: var(--space-4);
  padding: 0 var(--space-3);
}

.address-input input.email-input {
  width: 6ch;
  min-width: 3ch;
  flex: 0 0 auto;
  text-align: right;
  border-bottom: none;
  margin-bottom: 0;
  padding-left: 0;
  padding-right: 0;
}

.address-suffix {
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  padding: var(--space-2) 0;
}

.welcome-photo-upload {
  position: relative;
  display: inline-block;
  cursor: pointer;
  margin-bottom: var(--space-4);
}

.welcome-photo-upload:hover .welcome-photo-placeholder {
  border-color: var(--text-muted);
}

.welcome-photo-placeholder {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: var(--input-bg);
  border: 2px dashed var(--divider);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: border-color var(--speed-fast);
}

.welcome-photo-person {
  width: 56px;
  height: 56px;
}

.welcome-photo-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.welcome-photo-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--text-bright);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-photo-badge svg {
  width: 16px;
  height: 16px;
}

textarea.welcome-bio[name] {
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
  background: var(--bg);
  text-align: left;
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  resize: none;
}

textarea.welcome-bio[name]:focus {
  outline: none;
  border-color: var(--divider);
}

.welcome-add-bio {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.welcome-bio-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
}

.welcome-blog-url {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.welcome-preview-title {
  margin-bottom: var(--space-6);
}

.welcome-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-8) var(--space-4);
}

.welcome-preview-actions {
  text-align: center;
  padding: var(--space-8) 0;
}

.welcome-skip {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-decoration: none;
}

.welcome-skip:hover {
  color: var(--text);
}

input.email-input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--bg) inset;
  -webkit-text-fill-color: var(--text-bright);
}

@media (prefers-color-scheme: dark) {
  input.email-input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #1e2730 inset;
    -webkit-text-fill-color: #eee;
  }
}

.btn--outline {
  padding: var(--space-2) var(--space-6);
  border: 1px solid var(--divider);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--text-base);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: opacity var(--speed-fast);
}

.btn--outline:hover {
  opacity: 0.8;
}

/* ── Passcode ───────────────────────── */
.passcode-inputs {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
}

.passcode-inputs input[type="text"] {
  width: 3rem;
  height: 3.5rem;
  text-align: center;
  font-size: var(--text-2xl);
  font-family: var(--font-mono);
  background: transparent;
  border: none;
  border-bottom: 2px dashed var(--text-muted);
  border-radius: 0;
  padding: 0;
}

.passcode-inputs input[type="text"]:focus {
  outline: none;
  border-color: transparent;
  border-bottom-color: var(--text-bright);
}

.passcode-form .btn {
  margin-top: var(--space-6);
}

/* ── Buttons ────────────────────────── */
.btn {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--bg);
  background: var(--text-bright);
  border: none;
  border-radius: var(--radius-pill);
  text-decoration: none;
  cursor: pointer;
  transition: opacity var(--speed-fast);
}

.btn:hover {
  opacity: 0.8;
}

.icon {
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: -2px;
}

.btn--sm {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
}

.btn--lg {
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-base);
}

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

.btn--outline {
  color: var(--text);
  background: none;
  border: 1px solid var(--text-muted);
}

.btn--outline:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.btn--primary {
  background: color-mix(in srgb, var(--brand-1), var(--brand-2) 40%);
  color: #fff;
}

/* ── Panel page ────────────────────── */
.panel-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-8);
  background: var(--card-bg);
}

.panel-back {
  display: block;
  font-size: var(--text-lg);
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: var(--space-5);
}

.panel-back:hover {
  color: var(--text-bright);
}

.panel-title {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-2);
  text-align: center;
}

.panel-subtitle {
  font-size: var(--text-base);
  color: var(--text-muted);
  text-align: center;
  margin-bottom: var(--space-5);
}

.panel-title + .panel {
  margin-top: var(--space-5);
}

/* ── Panel ──────────────────────────── */
.panel {
  max-width: var(--measure);
  margin: 0 auto;
  background: var(--bg);
  color: var(--text);
  border-radius: var(--radius-lg);
  padding: var(--space-9);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  width: 100%;
}

.panel--narrow {
  max-width: var(--measure-narrow);
  padding: var(--space-6);
}

.panel--narrow p.panel-notice {
  margin: calc(-1 * var(--space-6)) calc(-1 * var(--space-6)) var(--space-6);
  padding: var(--space-3) var(--space-6);
}

.panel + .panel {
  margin-top: var(--space-8);
}

p.panel-notice {
  display: block;
  margin: calc(-1 * var(--space-9)) calc(-1 * var(--space-9)) var(--space-6);
  padding: var(--space-3) var(--space-9);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  text-align: center;
}

.panel input[type="text"],
.panel input[type="email"],
.panel input[type="password"],
.panel input[type="url"],
.panel input[type="number"],
.panel textarea,
.panel select {
  border-radius: var(--radius-sm);
  background-color: var(--bg);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

.panel select {
  padding-right: var(--space-8);
}

@media (max-width: 640px) {
  .panel-page {
    padding: var(--space-5);
  }

  .panel {
    padding: var(--space-5);
    border-radius: var(--radius-md);
  }

  p.panel-notice {
    margin: calc(-1 * var(--space-5)) calc(-1 * var(--space-5)) var(--space-6);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
  }
}

.panel-divider {
  border-top: 1px solid color-mix(in srgb, var(--divider), transparent 50%);
  margin-top: var(--space-8);
  padding-top: var(--space-8);
}

/* ── Color field ───────────────────── */
.color-field {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.color-field input[type="color"] {
  width: 40px;
  height: 40px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-md);
  padding: 2px;
  cursor: pointer;
  background: none;
  flex-shrink: 0;
}

.color-field input[type="text"] {
  width: 120px;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-family: var(--font-mono);
}

/* ── Domain settings ────────────────── */
.domain-label {
  display: block;
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.domain-active-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-base);
}

.domain-active-icon {
  font-size: var(--text-lg);
  line-height: 1;
}

.domain-badge-active {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--success);
  border: 1px solid var(--success);
  border-radius: var(--radius-pill);
  padding: var(--space-1) var(--space-3);
}

.domain-active-remove {
  margin-left: auto;
}

.domain-status {
  font-size: var(--text-sm);
}

.domain-instructions {
  margin: var(--space-4) 0;
  font-size: var(--text-sm);
}

.domain-instructions pre {
  font-size: var(--text-xs);
  margin-bottom: var(--space-3);
}

.domain-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.domain-pending-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-lg);
}

.domain-badge-pending {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: #e67e22;
  border: 1px solid #e67e22;
  border-radius: var(--radius-pill);
  padding: var(--space-1) var(--space-3);
}

.domain-divider {
  border: none;
  border-top: 1px solid var(--divider);
  margin: var(--space-4) 0;
}

.dns-record {
  background: var(--input-bg);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
}

.dns-record-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.dns-record-type {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.dns-record-host {
  font-size: var(--text-sm);
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.dns-record-value-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.dns-record-value {
  flex: 1;
  font-size: var(--text-sm);
  word-break: break-all;
}

.dns-copy {
  flex-shrink: 0;
}

.domain-remove {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
}

/* ── Upgrade prompt ─────────────────── */
.upgrade-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.plan-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  border: 1px solid var(--divider);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color var(--speed-fast);
}

.plan-card:hover {
  border-color: var(--text-muted);
}

.plan-card--selected {
  border-color: var(--text-bright);
}

.plan-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.plan-card-radio {
  width: 20px;
  height: 20px;
  border: 2px solid var(--text-muted);
  border-radius: var(--radius-full);
  flex-shrink: 0;
  position: relative;
}

.plan-card--selected .plan-card-radio {
  border-color: var(--text-bright);
}

.plan-card--selected .plan-card-radio::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--text-bright);
}

.plan-card-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.plan-card-name {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--text-bright);
}

.plan-card-price {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.upgrade-badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--success);
  background: color-mix(in srgb, var(--success), transparent 85%);
  border-radius: var(--radius-pill);
  padding: var(--space-1) var(--space-3);
  margin-left: var(--space-2);
  vertical-align: middle;
}

.btn--full {
  width: 100%;
  text-align: center;
}

.upgrade-footnote {
  text-align: center;
  font-size: var(--text-sm);
  margin-top: var(--space-1);
  margin-bottom: 0;
}

.panel--narrow-width {
  max-width: var(--measure-narrow);
  width: 100%;
  margin-top: var(--space-4);
}


.subscription-label {
  font-size: var(--text-sm);
  margin-bottom: var(--space-1);
}

.subscription-plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.subscription-details-row {
  display: flex;
  justify-content: space-between;
}

.text-right {
  text-align: right;
}

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

.upgrade-gate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.upgrade-gate-link {
  font-weight: var(--weight-medium);
  white-space: nowrap;
}

/* ── Export / danger zones ───────────── */
.export-zone {
  width: 100%;
  max-width: var(--measure-narrow);
  margin: var(--space-8) auto 0;
  border: 1px solid var(--divider);
  border-radius: var(--radius-md);
  padding: var(--space-6);
}

.export-zone h3 {
  margin-bottom: var(--space-3);
}

.export-zone p {
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}

.danger-zone {
  width: 100%;
  max-width: var(--measure-narrow);
  margin: var(--space-8) auto 0;
  border: 1px solid #c0392b;
  border-radius: var(--radius-md);
  padding: var(--space-6);
}

.danger-zone h3 {
  color: #c0392b;
  margin-bottom: var(--space-3);
}

.danger-zone p {
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}

.btn--danger {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: #fff;
  background: #c0392b;
  border: none;
  border-radius: var(--radius-pill);
  text-decoration: none;
  cursor: pointer;
  transition: opacity var(--speed-fast);
}

.btn--danger:hover {
  opacity: 0.8;
  color: #fff;
}

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

.delete-site-link {
  font-size: var(--text-sm);
  color: color-mix(in srgb, #c0392b, var(--text-muted) 40%);
  text-decoration: none;
}

.delete-site-link:hover {
  text-decoration: underline;
}

/* ── Alerts ─────────────────────────── */
.error,
.success {
  font-size: var(--text-sm);
  display: inline-block;
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-pill);
}

.error {
  color: var(--error);
  background: color-mix(in srgb, var(--error), transparent 88%);
}

.success {
  color: color-mix(in srgb, var(--success), black 20%);
  background: color-mix(in srgb, var(--success), transparent 80%);
}

/* ── Editor ─────────────────────────── */
.editor-page {
  background: var(--bg);
  color: var(--text);
}

main.editor {
  max-width: var(--editor-measure);
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

@media (min-width: 641px) {
  main.editor {
    padding-inline: 0;
  }
}

.editor form {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.editor-error {
  color: #c0392b;
  margin-bottom: var(--space-4);
}

.editor .editor-title {
  border: none;
  border-radius: 0;
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  color: var(--text-bright);
  background: transparent;
  padding: 0;
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
}

.editor .editor-title::placeholder {
  color: var(--text);
  opacity: 0.5;
}

.editor .editor-body {
  flex: 1;
  min-height: 60vh;
  font-size: var(--text-lg);
  line-height: var(--leading-loose);
  color: var(--text);
  background: transparent;
}

.editor .editor-body .ProseMirror {
  outline: none;
  min-height: 60vh;
}

.editor .editor-body .ProseMirror img {
  margin-top: var(--space-4);
  margin-bottom: var(--space-4);
}

.editor-toast {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: var(--card-bg);
  color: var(--text-muted);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.editor-toast-visible {
  opacity: 1;
}

.editor-page .jot-bubble-menu {
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  gap: 6px;
}

.editor-page .jot-bubble-divider {
  margin: 0 4px;
}

.editor .editor-body.drag-over {
  border: 1px dashed var(--divider);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.editor-actions {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--bg);
  padding: var(--space-4) max(var(--space-4), calc((100vw - var(--editor-measure)) / 2));
}

.editor-draft,
.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: 0;
}

input[type="checkbox"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--text-muted);
  border-radius: 3px;
  background: var(--bg);
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

input[type="checkbox"]:checked {
  background: var(--text-muted);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2.5 6l2.5 2.5 4.5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.editor-send {
  position: fixed;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  padding: var(--space-4) max(var(--space-4), calc((100vw - var(--editor-measure)) / 2 + var(--space-4)));
}

.editor-sent {
  font-size: var(--text-sm);
  color: var(--text-muted);
  padding: var(--space-2) 0;
  display: inline-block;
}

.draft-label {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  vertical-align: middle;
  border: 1px solid color-mix(in srgb, var(--text-muted), transparent 60%);
  border-radius: var(--radius-pill);
  padding: var(--space-1) var(--space-3);
  margin-left: var(--space-3);
  background: var(--input-bg);
}

.back-link {
  margin-right: auto;
}

/* ── Admin menu ─────────────────────── */
.admin-menu {
  position: fixed;
  top: var(--space-4);
  left: var(--space-4);
  right: var(--space-4);
  z-index: 100;
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-4);
  pointer-events: none;
}

@media (min-width: 641px) {
  .admin-menu {
    top: var(--space-6);
  }
}

.admin-menu > * {
  pointer-events: auto;
}

.admin-avatar,
.admin-initials {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.admin-avatar img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
  margin: 0;
}

.admin-avatar:hover,
.admin-initials:hover {
  box-shadow: 0 0 0 1px var(--bg), 0 0 0 2px var(--text-muted);
}

.admin-initials {
  background: var(--input-bg);
  border: 1px solid var(--divider);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--text-muted);
  text-decoration: none;
  user-select: none;
}

.admin-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: var(--space-4);
  background: var(--card-bg);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16);
  min-width: 160px;
  padding: var(--space-3) 0;
}

#admin-toggle:checked ~ .admin-dropdown {
  display: block;
}

.admin-dropdown a,
.admin-dropdown button {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-base);
  color: var(--text);
  text-decoration: none;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
}

.admin-dropdown-divider {
  border: none;
  border-top: 1px solid var(--divider);
  margin: var(--space-2) 0;
}

.admin-dropdown a:hover,
.admin-dropdown button:hover {
  background: var(--input-bg);
  color: var(--text-bright);
}

.admin-dropdown form button {
  padding-top: var(--space-2);
}

.admin-dropdown-email {
  display: block;
  padding: 0 var(--space-5) var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.top-nav .admin-menu {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  margin: 0;
  max-width: none;
  pointer-events: auto;
}

/* ── Settings extras ────────────────── */
.settings-form fieldset {
  border: none;
  padding: 0;
}

.settings-form fieldset legend {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-bright);
  margin-bottom: var(--space-2);
}


.subscribers-table {
  width: 100%;
  margin-top: var(--space-6);
  font-size: var(--text-sm);
}

.subscribers-table th {
  text-align: left;
  font-weight: var(--weight-medium);
  color: var(--text-muted);
}

.subscribers-table thead tr {
  border-bottom: 1px solid color-mix(in srgb, var(--divider), transparent 80%);
}

.subscribers-table td,
.subscribers-table th {
  padding: var(--space-2) var(--space-3);
  border-bottom: none;
}

.subscribers-table td:last-child {
  text-align: right;
}

.link-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: inherit;
  padding: 0;
  text-decoration: underline;
}

/* ── Following editor ──────────────── */
.following-list {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-5);
}

.following-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  border-bottom: 1px solid color-mix(in srgb, var(--divider), transparent 50%);
}

.following-entry:last-child {
  border-bottom: none;
}

.following-entry-info {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
  flex: 1;
}

.following-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  object-fit: cover;
}

.following-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: #fff;
}

.following-entry-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.following-entry-name {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--text-bright);
}

.following-entry-post {
  font-size: var(--text-sm);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.following-remove {
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--text-lg);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}

.following-remove:hover {
  color: var(--text-bright);
}

.following-add-form {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.following-add-form input[type="url"] {
  flex: 1;
  min-width: 0;
}

.following-add-form .btn--outline {
  flex-shrink: 0;
}

.following-add-form--stacked {
  flex-direction: column;
  align-items: stretch;
}

.following-add-form--stacked .btn--outline {
  align-self: flex-start;
}

.following-hint {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-2);
  margin-bottom: 0;
}

/* ── Subscribe pages ────────────────── */
.subscribe-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
}

.subscribe-identity {
  text-align: center;
  margin-bottom: var(--space-6);
}

.subscribe-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  object-fit: cover;
  margin: 0 auto var(--space-3);
}

.subscribe-name {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--site-text);
}

.subscribe-card {
  max-width: 420px;
  width: 100%;
}

.subscribe-card h1 {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--site-text-bright);
  margin-bottom: var(--space-4);
}

.subscribe-card p {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--site-text-muted);
  margin-bottom: 0;
}

.subscribe-btn {
  margin-top: var(--space-6);
}

.subscribe-unsub {
  display: block;
  margin-top: var(--space-6);
  font-size: var(--text-sm);
  color: var(--site-text-muted);
  text-decoration: none;
}

.subscribe-unsub:hover {
  color: var(--site-text);
}

/* ── Toggle switch ─────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  cursor: pointer;
}

.toggle-text {
  flex: 1;
  min-width: 0;
}

.toggle-label {
  display: block;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-bright);
}

.toggle-desc {
  display: block;
  font-size: var(--text-sm);
  font-weight: 300;
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  position: relative;
  width: 44px;
  height: 26px;
  background: var(--divider);
  border-radius: 13px;
  flex-shrink: 0;
  transition: background var(--speed-fast);
}

.toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: var(--bg);
  border-radius: var(--radius-full);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform var(--speed-fast);
}

.toggle-input:checked + .toggle-track {
  background: var(--success);
}

.toggle-input:checked + .toggle-track .toggle-knob {
  transform: translateX(18px);
}

/* ── Settings hub ──────────────────── */
.settings-identity {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-9);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  max-width: var(--measure-narrow);
  width: 100%;
  text-decoration: none;
  color: inherit;
  margin-bottom: var(--space-6);
  transition: box-shadow var(--speed-fast);
}

.settings-identity:hover {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.14);
}

.settings-identity .avatar-preview,
.settings-identity .avatar-placeholder {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.settings-identity-text {
  flex: 1;
  min-width: 0;
}

.settings-identity-title {
  display: block;
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--text-bright);
}

.settings-identity-bio {
  display: block;
  font-size: var(--text-sm);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-chevron {
  font-size: var(--text-2xl);
  color: var(--text-muted);
  flex-shrink: 0;
  line-height: 1;
}

.settings-list {
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  max-width: var(--measure-narrow);
  width: 100%;
  overflow: hidden;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid color-mix(in srgb, var(--divider), transparent 50%);
  text-decoration: none;
  color: inherit;
  transition: background var(--speed-fast);
}

a.settings-row:hover {
  background: var(--input-bg);
}

.settings-row--last {
  border-bottom: none;
}

.settings-row--static {
  cursor: default;
}

.settings-row-form {
  display: block;
}

.settings-row-button {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
}

.settings-row-button:hover {
  background: var(--input-bg);
}

.settings-row-label {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-bright);
}

.settings-row-value {
  margin-left: auto;
  font-size: var(--text-sm);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  text-align: right;
}

/* ── Theme cards ───────────────────── */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.theme-card {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.theme-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-card-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  background: var(--preview-bg);
  border: 2px solid var(--divider);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  transition: border-color var(--speed-fast), box-shadow var(--speed-fast);
}

.theme-card--selected .theme-card-preview {
  border-color: var(--text-bright);
  box-shadow:
    0 0 0 1px var(--bg),
    0 0 0 3px var(--text-bright);
}

.theme-card:hover .theme-card-preview {
  border-color: var(--text-muted);
}

.theme-card--selected:hover .theme-card-preview {
  border-color: var(--text-bright);
}

.theme-card-avatar {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--preview-muted);
  opacity: 0.5;
}

.theme-card-title {
  width: 50%;
  height: 6px;
  border-radius: 3px;
  background: var(--preview-text);
}

.theme-card-line {
  width: 70%;
  height: 4px;
  border-radius: 2px;
  background: var(--preview-muted);
  opacity: 0.4;
}

.theme-card-line--short {
  width: 50%;
}

.theme-card-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
}

.theme-card--selected .theme-card-label {
  color: var(--text-bright);
}

/* ── Accent color picker ──────────── */
.accent-section-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.accent-grid {
  display: grid;
  grid-template-columns: repeat(8, auto);
  justify-content: start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.accent-swatch {
  cursor: pointer;
}

.accent-swatch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.accent-swatch-circle {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--swatch-color);
  border: 2px solid transparent;
  transition: border-color var(--speed-fast), box-shadow var(--speed-fast);
}

.accent-swatch input:checked + .accent-swatch-circle {
  box-shadow:
    0 0 0 2px var(--bg),
    0 0 0 4px var(--swatch-color);
}

.accent-swatch:hover .accent-swatch-circle {
  border-color: color-mix(in srgb, var(--swatch-color), transparent 50%);
}

.accent-custom {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}

.accent-custom-picker {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  padding: 0;
  cursor: pointer;
  background: none;
  flex-shrink: 0;
  overflow: hidden;
}

.accent-custom-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}

.accent-custom-picker::-webkit-color-swatch {
  border: none;
  border-radius: var(--radius-sm);
}

.accent-custom-picker::-moz-color-swatch {
  border: none;
  border-radius: var(--radius-sm);
}

.accent-custom-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .settings-identity {
    padding: var(--space-5);
  }

  .settings-row {
    padding: var(--space-4) var(--space-5);
  }

  .settings-row-value {
    max-width: 120px;
  }

  .theme-grid {
    gap: var(--space-3);
  }

  .accent-grid {
    grid-template-columns: repeat(4, 1fr);
    justify-items: center;
  }

  .accent-swatch-circle {
    width: 44px;
    height: 44px;
  }
}
