/* Cursive Generator design system ported from html-template/Cursive generator */
:root {
  --bg-primary: #FAFAF9;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F4F4F5;
  --border-default: #E4E4E7;
  --border-strong: #D4D4D8;
  --text-main: #18181B;
  --text-muted: #71717A;
  --text-soft: #A1A1AA;
  --brand-primary: #4F46E5;
  --brand-primary-hov: #4338CA;
  --brand-soft: #EEF2FF;
  --brand-ring: rgba(79, 70, 229, .22);
  --status-success: #16A34A;
  --status-success-bg: #DCFCE7;
  --status-error: #DC2626;
  --status-error-bg: #FEE2E2;
  --shadow-sm: 0 1px 2px 0 rgba(24, 24, 27, .04);
  --shadow-md: 0 4px 10px -2px rgba(24, 24, 27, .06), 0 2px 4px -2px rgba(24, 24, 27, .04);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --font-sys: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --fs-h1: 32px;
  --fs-h2: 24px;
  --fs-h3: 20px;
  --fs-body-lg: 18px;
  --fs-body-md: 16px;
  --fs-body-sm: 14px;
  --fs-caption: 12px;
  --t-fast: 150ms;
  --t-base: 200ms;
  --ease: cubic-bezier(.4, 0, .2, 1);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg-primary: #09090B;
  --bg-surface: #18181B;
  --bg-subtle: #27272A;
  --border-default: #27272A;
  --border-strong: #3F3F46;
  --text-main: #FAFAFA;
  --text-muted: #A1A1AA;
  --text-soft: #71717A;
  --brand-primary: #818CF8;
  --brand-primary-hov: #A5B4FC;
  --brand-soft: #1E1B4B;
  --brand-ring: rgba(129, 140, 248, .28);
  --status-success: #4ADE80;
  --status-success-bg: #052e16;
  --status-error: #F87171;
  --status-error-bg: #450A0A;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, .4);
  --shadow-md: 0 4px 10px -2px rgba(0, 0, 0, .5), 0 2px 4px -2px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sys);
  font-size: var(--fs-body-md);
  line-height: 1.55;
  color: var(--text-main);
  background: var(--bg-primary);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--t-base) var(--ease), color var(--t-base) var(--ease);
}

button,
textarea,
select,
input {
  font: inherit;
}

button {
  touch-action: manipulation;
}

::selection {
  background: var(--brand-ring);
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0 64px;
}

/* ── Appearance admin previews ── */
.appearance-preview-logo    { display: block; max-height: 40px; margin-top: 8px; border-radius: var(--radius-sm); }
.appearance-preview-favicon { display: block; width: 32px; height: 32px; margin-top: 8px; }
.nav-editor-table  { width: 100%; border-collapse: collapse; }
.nav-editor-table th,
.nav-editor-table td { padding: 4px 6px; vertical-align: middle; }
.nav-editor-input  { width: 100%; padding: 5px 8px; border: 1px solid var(--border-default); border-radius: var(--radius-sm); font: inherit; font-size: var(--fs-body-sm); color: var(--text-main); background: var(--bg-surface); }
.nav-row-actions   { display: flex; gap: 4px; white-space: nowrap; }

/* ── FAQ editor ── */
.faq-editor-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; margin-top: 1rem; }
.faq-editor-count  { font-size: var(--fs-body-sm); color: var(--text-muted); }
.faq-editor-table  { width: 100%; border-collapse: collapse; }
.faq-editor-table th,
.faq-editor-table td { padding: 4px 6px; vertical-align: top; }
.faq-editor-input  { width: 100%; padding: 5px 8px; border: 1px solid var(--border-default); border-radius: var(--radius-sm); font: inherit; font-size: var(--fs-body-sm); color: var(--text-main); background: var(--bg-surface); }
.faq-editor-answer { resize: vertical; min-height: 48px; }
.faq-row-actions   { display: flex; gap: 4px; white-space: nowrap; padding-top: 6px; }
.brand-logo-img    { border-radius: 7px; object-fit: contain; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
}

.site-header--sticky {
  position: sticky;
  top: 8px;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text-main);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

/* Full uploaded logo — reserved width per breakpoint */
.brand-mark--logo {
  width: 180px;
  height: auto;
}

.brand-logo-full {
  width: 100%;
  height: auto;
  max-height: 36px;
  object-fit: contain;
  object-position: left center;
  border-radius: 0;
}

/* Service name after the logo */
.brand-service-name {
  font-size: var(--fs-body-md);
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  padding-left: 12px;
  border-left: 1.5px solid var(--border-default);
  line-height: 1.2;
  letter-spacing: -.01em;
}

.brand-copy {
  display: grid;
  line-height: 1.1;
}

.brand-copy strong {
  font-size: 16px;
  letter-spacing: 0;
}

.brand-copy small {
  color: var(--text-muted);
  font-size: 11px;
}

.top-nav {
  display: flex;
  gap: 4px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.top-nav::-webkit-scrollbar {
  display: none;
}

.top-nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 6px 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--fs-body-sm);
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--t-base) var(--ease);
}

.top-nav a.active,
.top-nav a:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-button,
.language-links a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}

.language-links {
  display: flex;
  gap: 4px;
}

.language-links a {
  min-width: 44px;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--fs-body-sm);
  font-weight: 600;
}

.language-links a.active {
  color: var(--brand-primary);
  background: var(--brand-soft);
  border-color: transparent;
}

.theme-switch {
  position: relative;
  width: 60px;
  height: 32px;
  padding: 0;
  cursor: pointer;
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: 999px;
}

.theme-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--text-main);
  background: var(--bg-surface);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: left var(--t-base) var(--ease);
}

[data-theme="dark"] .theme-knob {
  left: 31px;
}

main {
  display: block;
  padding-top: 40px;
}

/* ── Breadcrumbs ── */
.breadcrumbs {
  padding: 10px 0 2px;
}

.breadcrumbs ol {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--fs-body-sm);
  color: var(--text-muted);
}

.breadcrumbs li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.breadcrumbs li:not(:last-child)::after {
  content: '/';
  color: var(--text-soft);
  font-size: .7rem;
  margin-left: 2px;
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}

.breadcrumbs a:hover {
  color: var(--brand-primary);
}

.breadcrumbs li[aria-current="page"] {
  color: var(--text-main);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}

.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 100%;
  margin: 0 auto;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: repeating-linear-gradient(45deg, transparent 0 10px, var(--bg-subtle) 10px 11px);
}

.ad-top {
  max-width: 728px;
  height: 90px;
  margin: 20px auto;
}

.ad-rect {
  max-width: 336px;
  height: 280px;
  margin: 32px auto;
}

.ad-content {
  max-width: 336px;
  height: 280px;
  margin: 24px auto;
}

.tool-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 24px;
}

.tool-pane,
.tool-preview {
  min-width: 0;
}

.tool-pane {
  display: grid;
  gap: 14px;
}

.tool-preview {
  padding: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.intro h1 {
  margin: 0 0 8px;
  color: var(--text-main);
  font-size: var(--fs-h1);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.15;
}

.intro p {
  max-width: 680px;
  margin: 0;
  color: var(--text-muted);
}

.composer {
  display: grid;
  gap: 12px;
}

textarea {
  width: 100%;
  min-height: 70px;
  padding: 12px 14px;
  resize: vertical;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  outline: none;
  line-height: 1.5;
  transition: all var(--t-base) var(--ease);
}

textarea:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px var(--brand-ring);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}

.limits,
.decorators,
.tabs,
.download-row,
.color-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.decorators {
  margin-left: auto;
  gap: 2px;
  max-width: 100%;
}

#charCount {
  min-width: 56px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 13px;
}

.limit-pill,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: var(--fs-caption);
  font-weight: 600;
  letter-spacing: .02em;
}

.limit-pill.over {
  color: var(--status-error);
  background: var(--status-error-bg);
  border-color: transparent;
}

.limit-pill.active {
  color: var(--brand-primary);
  background: var(--brand-soft);
  border-color: transparent;
}

.badge.brand {
  color: var(--brand-primary);
  background: var(--brand-soft);
  border-color: transparent;
}

.decorator {
  min-width: 38px;
  height: 36px;
  padding: 0 7px;
  color: var(--text-main);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  transition: background var(--t-base) var(--ease), color var(--t-base) var(--ease);
}

.decorator:hover {
  background: var(--bg-subtle);
}

.decorator.active {
  color: var(--brand-primary);
  background: var(--brand-soft);
}

.tool-mode-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tool-mode-nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: var(--fs-body-sm);
  font-weight: 700;
}

.tool-mode-nav a:hover,
.tool-mode-nav a.active {
  color: var(--brand-primary);
  background: var(--brand-soft);
  border-color: transparent;
}

.retention-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.retention-toggle {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--fs-body-sm);
  font-weight: 700;
}

.retention-toggle b {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  color: var(--brand-primary);
  background: var(--brand-soft);
  border-radius: 999px;
  font-size: 11px;
}

.retention-toggle:hover {
  border-color: var(--border-strong);
  background: var(--bg-subtle);
}

.retention-panel {
  padding: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.history-panel {
  margin-top: -2px;
}

.retention-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.retention-panel-head h2,
.retention-panel-head h3 {
  margin: 0;
  font-size: var(--fs-h3);
}

.retention-panel-head p {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: var(--fs-body-sm);
}

.history-list,
.favorites-grid {
  display: grid;
  gap: 10px;
}

.history-item,
.favorite-card {
  display: grid;
  gap: 9px;
  padding: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}

.history-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.history-item strong,
.history-item p,
.favorite-source {
  overflow-wrap: anywhere;
}

.history-item span,
.favorite-source {
  color: var(--text-muted);
  font-size: var(--fs-caption);
}

.history-item p {
  margin: 4px 0 0;
  color: var(--text-main);
  font-size: var(--fs-body-sm);
}

.favorites-panel {
  margin-top: -18px;
}

.favorites-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.favorites-actions,
.favorite-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.favorite-actions {
  justify-content: flex-end;
}

.favorite-card .style-output {
  min-height: 48px;
}

.retention-empty {
  color: var(--text-muted);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.retention-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}

.retention-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.block {
  margin-bottom: 40px;
}

.block-head {
  margin-bottom: 16px;
}

.block-head.compact {
  margin-bottom: 12px;
}

.block-head.compact h2 {
  font-size: var(--fs-h3);
}

.block-head h2,
.article h2,
.tag-clouds h2,
.faq {
  padding-top: 40px;
}

.faq h2 {
  margin: 0 0 4px;
  color: var(--text-main);
  font-size: var(--fs-h2);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
}

.block-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-body-sm);
}

.intent-hint {
  margin-top: 6px !important;
  color: var(--brand-primary) !important;
}

.font-filters {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  margin: -4px 0 16px;
}

.font-filters label {
  display: grid;
  gap: 5px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.font-filters select {
  min-width: 150px;
  height: 38px;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0 32px 0 10px;
  font: inherit;
  text-transform: none;
}

.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  height: 38px;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0 12px;
  font-weight: 600;
  cursor: pointer;
}

.filter-chip.active,
.filter-chip:hover {
  color: var(--brand-primary);
  border-color: color-mix(in srgb, var(--brand-primary) 45%, var(--border-default));
  background: var(--brand-soft);
}

.clear-filters {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.clear-filters:hover {
  color: var(--brand-primary);
  border-color: color-mix(in srgb, var(--brand-primary) 45%, var(--border-default));
  background: var(--brand-soft);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  min-height: 0;
}

.results-toggle {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.results-toggle .secondary-btn {
  align-self: center;
  min-width: 132px;
}

.result-empty {
  grid-column: 1 / -1;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
}

.result-card {
  position: relative;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--t-base) var(--ease);
}

.favorite-star {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.favorite-star:hover,
.favorite-star.active {
  color: #ca8a04;
  background: #fef3c7;
  border-color: transparent;
}

.result-card:hover {
  border-color: var(--border-strong);
}

.result-card.intent-match {
  border-color: color-mix(in srgb, var(--brand-primary) 40%, var(--border-default));
  background: color-mix(in srgb, var(--brand-soft) 22%, var(--bg-surface));
}

.style-name {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.style-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: -4px;
}

.style-preview-name {
  color: var(--text-main);
  font-size: 18px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.style-meta span {
  color: var(--text-soft);
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  font-size: 10px;
  line-height: 1.4;
}

.intent-badge {
  color: var(--brand-primary);
  background: var(--brand-soft);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
}

.style-output {
  flex: 1;
  color: var(--text-main);
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 20px;
  line-height: 1.4;
}

.copy-btn,
.secondary-btn {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  align-self: flex-end;
  padding: 6px 12px;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--fs-body-sm);
  font-weight: 500;
  line-height: 1;
  transition: all var(--t-base) var(--ease);
}

.copy-btn::before {
  content: "⧉";
  font-size: 15px;
}

.copy-btn:hover,
.secondary-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
}

.copy-btn:active,
.secondary-btn:active,
.decorator:active,
.tab:active {
  transform: scale(.95);
}

.copy-btn.copied {
  color: var(--status-success);
  background: var(--status-success-bg);
  border-color: transparent;
}

.copy-btn.copied::before {
  content: "✓";
}

.secondary-btn.primary {
  color: #fff;
  background: var(--brand-primary);
  border-color: transparent;
}

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

.signature-block {
  padding: 22px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.signature-controls {
  display: grid;
  grid-template-columns: minmax(110px, .55fr) minmax(220px, 1.4fr) minmax(130px, .65fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.signature-controls label {
  display: grid;
  gap: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.signature-controls label span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.signature-controls select {
  height: 38px;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0 10px;
}

.signature-bg-toggle {
  min-height: 38px;
  align-content: center;
}

.signature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.signature-card {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}

.signature-card:hover,
.signature-card.selected {
  border-color: color-mix(in srgb, var(--brand-primary) 55%, var(--border-default));
}

.signature-card.selected {
  box-shadow: 0 0 0 4px var(--brand-ring);
}

.signature-card:active {
  transform: scale(.99);
}

.signature-canvas {
  width: 100%;
  aspect-ratio: 3 / 1;
  display: block;
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}

.signature-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.worksheet-block {
  padding: 22px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.worksheet-layout {
  display: grid;
  grid-template-columns: minmax(240px, .75fr) minmax(0, 1.25fr);
  gap: 16px;
  align-items: start;
}

.worksheet-controls {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}

.worksheet-controls label {
  display: grid;
  gap: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.worksheet-controls select {
  min-height: 38px;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0 10px;
}

.worksheet-preview-card {
  min-width: 0;
  padding: 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}

.worksheet-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.worksheet-preview-head h3 {
  margin: 0;
  font-size: var(--fs-h3);
}

.worksheet-preview {
  overflow: auto;
  max-height: 520px;
  background: #fff;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}

.worksheet-svg {
  width: 100%;
  min-width: 360px;
  display: block;
}

.worksheet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.alphabet-block,
.letter-detail-block {
  padding: 22px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.alphabet-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
  gap: 18px;
  align-items: start;
}

.alphabet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 10px;
}

.alphabet-tile {
  display: grid;
  gap: 6px;
}

.alphabet-letter {
  min-height: 76px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 8px;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--t-base) var(--ease), border-color var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}

.alphabet-letter:hover,
.alphabet-letter.active {
  background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand-primary) 48%, var(--border-default));
}

.alphabet-letter:active {
  transform: scale(.97);
}

.alphabet-script {
  font-size: 30px;
  line-height: 1;
}

.alphabet-plain {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.alphabet-tile a {
  min-height: 22px;
  color: var(--brand-primary);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.alphabet-tile a:hover,
.alphabet-panel-head a:hover,
.neighbor-letters a:hover {
  text-decoration: underline;
}

.alphabet-panel {
  position: sticky;
  top: 14px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  transition: max-height var(--t-base) var(--ease), opacity var(--t-base) var(--ease);
}

.alphabet-panel.open {
  max-height: 620px;
  opacity: 1;
}

.alphabet-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 8px;
}

.alphabet-panel-head h3 {
  margin: 0;
  font-size: var(--fs-h3);
  line-height: 1.2;
}

.alphabet-panel-head a,
.neighbor-letters a {
  color: var(--brand-primary);
  font-size: var(--fs-body-sm);
  font-weight: 700;
  text-decoration: none;
}

.alphabet-variants {
  display: grid;
  gap: 8px;
  padding: 0 14px 14px;
}

.alphabet-variant,
.letter-style-card {
  display: grid;
  grid-template-columns: minmax(80px, auto) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}

.variant-symbol,
.letter-symbol-pair {
  color: var(--text-main);
  font-size: 26px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.variant-name {
  color: var(--text-muted);
  font-size: var(--fs-body-sm);
}

.alphabet-copy {
  align-self: center;
  white-space: nowrap;
}

.letter-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.letter-style-card {
  grid-template-columns: 1fr;
  align-items: start;
}

.letter-style-card .copy-btn {
  justify-self: end;
}

.neighbor-letters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.neighbor-letters a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}

@media (prefers-reduced-motion: reduce) {
  .alphabet-panel,
  .alphabet-letter {
    transition: none;
  }
}

.preview-export {
  display: grid;
  grid-template-columns: minmax(190px, .85fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.social-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.tabs {
  display: inline-flex;
  padding: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  gap: 2px;
}

.tab {
  min-height: 34px;
  padding: 6px 14px;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--fs-body-sm);
  font-weight: 500;
  transition: all var(--t-base) var(--ease);
}

.tab.active {
  color: var(--text-main);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.phone-frame {
  position: relative;
  flex-shrink: 0;
  width: min(220px, 100%);
  height: 440px;
  overflow: hidden;
  background: var(--bg-primary);
  border: 10px solid var(--text-main);
  border-radius: 36px;
  box-shadow: var(--shadow-md);
}

.phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 2;
  width: 90px;
  height: 22px;
  background: var(--text-main);
  border-bottom-right-radius: 12px;
  border-bottom-left-radius: 12px;
  transform: translateX(-50%);
}

.phone-preview {
  height: 100%;
  overflow-y: auto;
  padding: 40px 12px 14px;
  color: var(--text-main);
  background: var(--bg-primary);
}

.profile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 14px;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.avatar {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--brand-soft), var(--bg-subtle));
  border: 2px solid var(--brand-primary);
  border-radius: 50%;
}

.profile-stats {
  flex: 1;
  display: flex;
  justify-content: space-around;
  text-align: center;
}

.profile-stats span {
  display: grid;
  gap: 2px;
}

.profile-stats b {
  font-size: 12px;
}

.profile-stats small {
  color: var(--text-muted);
  font-size: 10px;
}

.profile-name {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
}

#previewText {
  margin: 0;
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.profile-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.profile-actions button {
  flex: 1;
  min-height: 32px;
  color: white;
  background: var(--brand-primary);
  border: 0;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
}

.profile-actions button + button {
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
}

.phone-preview.tiktok {
  text-align: center;
}

.phone-preview.tiktok .profile-top,
.phone-preview.tiktok .profile-row,
.phone-preview.tiktok .profile-actions {
  display: none;
}

.phone-preview.tiktok .avatar {
  display: block;
  width: 80px;
  height: 80px;
  margin: 0 auto 10px;
  background: linear-gradient(135deg, #ff0050, #00f2ea);
  border: 0;
}

.phone-preview.tiktok .profile-name::before {
  content: "@dreamer";
  display: block;
  margin: 4px 0 12px;
  font-size: 14px;
}

.phone-preview.x {
  padding-top: 98px;
}

.phone-preview.x::before {
  content: "";
  position: absolute;
  top: 22px;
  left: 0;
  width: 100%;
  height: 72px;
  background: linear-gradient(135deg, #1d9bf0, var(--brand-primary));
}

.export-panel {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-title h3 {
  margin: 0;
  color: var(--text-main);
  font-size: var(--fs-h3);
  font-weight: 600;
}

.export-preview {
  min-height: 128px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 18px;
  color: #4F46E5;
  background: #EEF2FF;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  font-size: 44px;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
  transition: all var(--t-base) var(--ease);
}

.range-label {
  display: block;
}

.range-label span {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--text-main);
  font-size: var(--fs-body-sm);
  font-weight: 500;
}

.range-label b {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 500;
}

.ds-range {
  width: 100%;
  appearance: none;
  cursor: pointer;
  background: transparent;
}

.ds-range::-webkit-slider-runnable-track {
  height: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: 999px;
}

.ds-range::-moz-range-track {
  height: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: 999px;
}

.ds-range::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -7px;
  appearance: none;
  background: var(--brand-primary);
  border: 2px solid var(--bg-surface);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

.ds-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--brand-primary);
  border: 2px solid var(--bg-surface);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

.color-row label {
  display: grid;
  gap: 6px;
  color: var(--text-main);
  font-size: var(--fs-body-sm);
  font-weight: 500;
}

.color-row input[type="color"] {
  width: 44px;
  height: 34px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}

.check {
  display: flex !important;
  grid-auto-flow: column;
  align-items: center;
  min-height: 44px;
  color: var(--text-muted) !important;
}

.seo-content {
  max-width: 800px;
  margin: 56px auto 0;
}

.article {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.article p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.7;
}

.tag-clouds {
  display: grid;
  gap: 18px;
  margin: 32px 0;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag-list a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  color: var(--text-muted);
  text-decoration: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  font-size: var(--fs-body-sm);
}

.tag-list a:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

.faq-box {
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}

details {
  border-bottom: 1px solid var(--border-default);
}

details:last-child {
  border-bottom: 0;
}

summary {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  cursor: pointer;
  color: var(--text-main);
  font-weight: 600;
  list-style: none;
}

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

summary::after {
  content: "⌄";
  color: var(--text-muted);
  transition: transform var(--t-base) var(--ease);
}

details[open] summary::after {
  transform: rotate(180deg);
}

details p {
  margin: 0;
  padding: 0 18px 16px;
  color: var(--text-muted);
  line-height: 1.6;
}

.site-footer {
  margin-top: 48px;
  padding: 32px 24px 20px;
  background: var(--bg-surface);
  border: 0px solid var(--border-default);
  border-radius: var(--radius-xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-default);
}

.footer-grid h3 {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: var(--fs-caption);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.footer-grid a {
  display: block;
  margin: 8px 0;
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--fs-body-sm);
}

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

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 16px;
  color: var(--text-soft);
  font-size: 12px;
}

.content-page,
.not-found {
  width: min(800px, calc(100% - 32px));
  margin: 48px auto;
}

.sitemap-list {
  display: grid;
  gap: 10px;
}

.primary-link {
  color: var(--brand-primary);
}

.admin-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 64px;
}

.admin-header,
.admin-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px;
  margin-bottom: 16px;
}

.admin-header h1 {
  margin: 0;
  font-size: var(--fs-h2);
}

.admin-header p,
.admin-login p {
  margin: 4px 0 0;
  color: var(--text-muted);
}

.admin-card {
  padding: 16px;
}

.admin-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.admin-nav a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  padding: 0 12px;
  color: var(--text-muted);
  text-decoration: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.admin-nav a.active,
.admin-nav a:hover {
  color: var(--brand-primary);
  background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand-primary) 35%, var(--border-default));
}

.admin-card h2 {
  margin: 0 0 12px;
  font-size: var(--fs-h3);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.admin-grid.two {
  align-items: start;
}

.admin-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric span {
  color: var(--text-muted);
  font-size: var(--fs-body-sm);
}

.metric strong {
  display: block;
  font-size: 36px;
  line-height: 1.1;
}

.admin-login {
  max-width: 420px;
}

.admin-card label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--text-main);
  font-size: var(--fs-body-sm);
  font-weight: 500;
}

.admin-card input,
.admin-card select,
.admin-card textarea {
  min-height: 42px;
  padding: 8px 10px;
  color: var(--text-main);
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}

.admin-card textarea {
  width: 100%;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 12px;
}

.admin-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.admin-section-head p {
  margin: 4px 0 0;
  color: var(--text-muted);
}

.admin-mini-metric {
  padding: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}

.admin-mini-metric span,
.analytics-row span {
  color: var(--text-muted);
  font-size: var(--fs-body-sm);
}

.admin-mini-metric strong {
  display: block;
  font-size: 24px;
}

.analytics-lists {
  margin-top: 16px;
}

.analytics-lists h3 {
  margin: 0 0 8px;
  font-size: var(--fs-body-md);
}

.analytics-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid var(--border-default);
}

.compact-form {
  display: grid;
  grid-template-columns: 80px 1fr 120px auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 16px;
}

.language-admin-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.language-admin-list a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 10px;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}

.language-admin-list a.active {
  color: var(--brand-primary);
  background: var(--brand-soft);
  border-color: transparent;
}

.admin-flash {
  padding: 12px 14px;
  margin-bottom: 16px;
  color: var(--status-success);
  background: var(--status-success-bg);
  border-radius: var(--radius-md);
}

.admin-flash.error {
  color: var(--status-error);
  background: var(--status-error-bg);
}

.admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.admin-actions.inline {
  margin-bottom: 0;
}

.admin-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 14px 0 16px;
  border-bottom: 1px solid var(--border-default);
  margin-bottom: 4px;
}

.admin-filter-bar .filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--fs-caption);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
  margin: 0;
}

.admin-filter-bar .filter-field select,
.admin-filter-bar .filter-field input[type="date"] {
  font-size: var(--fs-body-sm);
  padding: 6px 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  height: 34px;
  min-width: 130px;
}

.admin-filter-bar .filter-actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding-bottom: 0;
}

.admin-table th.sortable:hover {
  color: var(--text-primary);
}

.admin-table th.sort-asc,
.admin-table th.sort-desc {
  color: var(--text-primary);
}

.admin-table th.sortable {
  white-space: nowrap;
}

.sort-icon {
  display: inline;
  font-style: normal;
  opacity: .45;
  font-size: .8em;
  margin-left: 3px;
}

.admin-table th.sort-asc .sort-icon,
.admin-table th.sort-desc .sort-icon {
  opacity: 1;
}

.admin-col-id {
  color: var(--text-muted);
  font-size: var(--fs-caption);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  width: 1%;
}

.admin-table-count {
  font-size: var(--fs-body-sm);
  color: var(--text-muted);
  margin: 8px 0 4px;
}

.admin-table-count strong {
  color: var(--text-primary);
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-body-sm);
}

.admin-table th,
.admin-table td {
  padding: 10px 8px;
  text-align: left;
  border-top: 1px solid var(--border-default);
  vertical-align: middle;
}

.admin-table th {
  color: var(--text-muted);
  font-size: var(--fs-caption);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.admin-row-actions {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
  align-items: center;
  white-space: nowrap;
}

.admin-row-actions form {
  margin: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-secondary);
  color: var(--text-muted);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
  text-decoration: none;
  padding: 0;
  font: inherit;
}

.icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
  background: var(--bg-primary);
}

.icon-btn--danger {
  color: var(--text-muted);
}

.icon-btn--danger:hover {
  color: #e53e3e;
  border-color: #e53e3e;
  background: #fff5f5;
}

.icon-btn--publish {
  color: #16a34a;
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.icon-btn--publish:hover {
  color: #15803d;
  border-color: #16a34a;
  background: #dcfce7;
}

.editor-footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.editor-footer-actions form {
  margin: 0;
}

.publish-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #15803d !important;
  border-color: #16a34a !important;
  background: #f0fdf4 !important;
}

.publish-btn:hover {
  background: #dcfce7 !important;
}

.editor-published-note {
  font-size: .85rem;
  color: #16a34a;
}

.page-editor {
  margin: 16px 0;
  scroll-margin-top: 16px;
  padding: 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}

.page-editor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.editor-check {
  align-content: center;
}

.translation-form {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  gap: 8px;
  align-items: end;
  min-width: 280px;
}

.analytics-chart {
  margin-top: 16px;
  padding: 14px;
  color: var(--brand-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}

.analytics-chart-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--text-main);
}

.analytics-chart-head span {
  color: var(--text-muted);
  font-size: var(--fs-body-sm);
}

.analytics-chart svg {
  width: 100%;
  height: auto;
  display: block;
  color: var(--brand-primary);
}

.analytics-chart circle {
  fill: var(--bg-surface);
  stroke: currentColor;
  stroke-width: 3;
}

@media (max-width: 900px) {
  .brand-mark--logo { width: 120px; }

  .tool-shell {
    grid-template-columns: 1fr;
  }

  .signature-controls {
    grid-template-columns: 1fr 1fr;
  }

  .alphabet-layout {
    grid-template-columns: 1fr;
  }

  .worksheet-layout {
    grid-template-columns: 1fr;
  }

  .alphabet-panel {
    position: static;
  }

  .preview-export {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .export-panel {
    width: 100%;
  }

  .tool-preview .social-panel {
    width: 100%;
  }
}

@media (max-width: 700px) {
  :root {
    --fs-h1: 24px;
    --fs-h2: 20px;
    --fs-h3: 18px;
  }

  .page-shell {
    width: min(100% - 24px, 1180px);
    padding-top: 12px;
  }

  .site-header {
    padding: 12px;
  }

  .brand-mark--logo { width: 90px; }
  .brand-service-name { font-size: var(--fs-body-sm); padding-left: 8px; }

  .brand-copy {
    display: none;
  }

  .top-nav {
    order: 3;
    width: 100%;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .retention-panel-head,
  .history-item {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .favorites-actions,
  .favorite-actions {
    justify-content: stretch;
  }

  .favorites-actions .secondary-btn,
  .favorite-actions .secondary-btn {
    flex: 1 1 120px;
  }

  .decorators {
    margin-left: 0;
  }

  .ad-top {
    height: 54px;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .alphabet-block,
  .letter-detail-block,
  .signature-block,
  .worksheet-block {
    padding: 16px;
  }

  .signature-controls {
    grid-template-columns: 1fr;
  }

  .signature-actions {
    justify-content: stretch;
  }

  .signature-actions .secondary-btn,
  .worksheet-actions .secondary-btn {
    flex: 1 1 150px;
  }

  .worksheet-actions {
    justify-content: stretch;
  }

  .alphabet-grid {
    grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
    gap: 8px;
  }

  .alphabet-letter {
    min-height: 62px;
  }

  .alphabet-script {
    font-size: 24px;
  }

  .alphabet-variant {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .alphabet-copy {
    justify-self: end;
  }

  .phone-frame {
    width: min(280px, 100%);
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

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

  .admin-grid.four,
  .compact-form,
  .page-editor-grid,
  .translation-form {
    grid-template-columns: 1fr;
  }

  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ==========================================================================
   REDESIGN THEME  —  [data-ui="redesign"]
   All selectors scoped so the default theme is completely untouched.
   ========================================================================== */

/* ── Background & shell ── */
[data-ui="redesign"] body {
  background: #F4F2FF;
  transition: none;
}
[data-ui="redesign"] body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 65% 55% at 8% 12%, rgba(167,139,250,.55) 0%, rgba(196,181,253,.25) 40%, transparent 65%),
    radial-gradient(ellipse 60% 50% at 92% 88%, rgba(240,171,252,.60) 0%, rgba(249,168,212,.25) 40%, transparent 65%),
    #F4F2FF;
  pointer-events: none;
}
[data-ui="redesign"] .page-shell {
  background: transparent;
}

/* ── Header ── */
[data-ui="redesign"] .site-header {
  background: rgba(248,247,255,.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(109,40,217,.1);
  box-shadow: none;
}
[data-ui="redesign"] .brand strong { color: #4F46E5; }
[data-ui="redesign"] .top-nav a { color: #6B7280; }
[data-ui="redesign"] .top-nav a:hover,
[data-ui="redesign"] .top-nav a.active { color: #4F46E5; }
[data-ui="redesign"] .theme-switch {
  border-color: rgba(109,40,217,.2);
  color: #6D28D9;
}

/* ── Hero block ── */
.hero-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 24px 32px;
  gap: 0;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  color: #6B7280;
  margin-bottom: 28px;
}
.hero-badge-pill {
  background: linear-gradient(135deg, #6D28D9, #7C3AED);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 2px 9px;
  border-radius: 99px;
}
.hero-title {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 800;
  line-height: 1.1;
  color: #111;
  letter-spacing: -.02em;
  margin-bottom: 28px;
}
.hero-gradient {
  font-style: italic;
  background: linear-gradient(90deg, #6D28D9 0%, #7C3AED 45%, #EC4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
@keyframes sgDraw {
  to { stroke-dashoffset: 0; }
}

.hero-svg-wrap {
  position: relative;
  margin: 0 auto 24px;
  width: min(520px, 88vw);
  display: flex;
  flex-direction: column;
  align-items: center;
}

#heroSvg:hover { opacity: .92; }
.hero-sub {
  max-width: 520px;
  color: #6B7280;
  font-size: 1rem;
  line-height: 1.65;
  margin-bottom: 36px;
}
.hero-ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.hero-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #5B21B6 0%, #7C3AED 60%, #9333EA 100%);
  color: #fff;
  font-weight: 600;
  font-size: .95rem;
  padding: 13px 28px;
  border-radius: 99px;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(109,40,217,.35);
  transition: box-shadow .2s, transform .2s;
}
.hero-btn-primary:hover {
  box-shadow: 0 6px 28px rgba(109,40,217,.5);
  transform: translateY(-1px);
}
.hero-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: #374151;
  font-weight: 600;
  font-size: .95rem;
  padding: 13px 24px;
  border-radius: 99px;
  border: 1.5px solid #E5E7EB;
  text-decoration: none;
  transition: border-color .2s, color .2s;
}
.hero-btn-secondary:hover { border-color: #7C3AED; color: #7C3AED; }

/* ── Font result cards hover effects ── */
[data-ui="redesign"] .result-card {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  will-change: transform;
}
[data-ui="redesign"] .result-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 8px 28px rgba(79,70,229,.14);
  border-color: rgba(109,40,217,.25);
}
[data-ui="redesign"] .result-card .copy-btn {
  background: linear-gradient(135deg, #6D28D9, #EC4899);
  color: #fff;
  border: none;
}
[data-ui="redesign"] .result-card .copy-btn:hover {
  opacity: .88;
}

/* ── Footer redesign ── */
.site-footer--redesign {
  padding: 40px 24px 24px;
  background: transparent;
}
.footer-redesign-inner {
  width: 100%;
  border: 1.5px solid rgba(229,231,235,.9);
  border-radius: 16px;
  background: rgba(255,255,255,.7);
  padding: 36px 40px 24px;
  box-sizing: border-box;
}
.footer-redesign-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 28px;
}
.footer-redesign-cols h3 {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #9CA3AF;
  margin-bottom: 14px;
}
.footer-redesign-cols a {
  display: block;
  color: #374151;
  text-decoration: none;
  font-size: .9rem;
  line-height: 2;
  transition: color .15s;
}
.footer-redesign-cols a:hover { color: #7C3AED; }
.footer-redesign-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 20px;
  border-top: 1px solid #F3F4F6;
  font-size: .78rem;
  color: #9CA3AF;
}

/* ── Admin theme picker ── */
.theme-picker {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: var(--fs-body-sm);
  color: var(--text-muted);
  font-weight: 500;
}
.theme-option input { display: none; }
.theme-option.active,
.theme-option:has(input:checked) { color: var(--text-primary); }
.theme-swatch {
  display: flex;
  flex-direction: column;
  width: 100px;
  height: 68px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--border-default);
  transition: border-color .15s;
}
.theme-option.active .theme-swatch,
.theme-option:has(input:checked) .theme-swatch { border-color: #7C3AED; }
.theme-swatch--default .sw-header { background: #1e293b; height: 18px; }
.theme-swatch--default .sw-body { flex: 1; background: #f1f5f9; }
.theme-swatch--redesign .sw-header {
  background: linear-gradient(90deg, rgba(129,140,248,.5), rgba(240,171,252,.5));
  height: 18px;
}
.theme-swatch--redesign .sw-body {
  flex: 1;
  background: linear-gradient(135deg, #F8F7FF, #EDE9FE 80%);
}

@media (max-width: 600px) {
  .hero-block { padding: 48px 16px 40px; }
  .footer-redesign-inner { padding: 24px 20px 16px; }
  .footer-redesign-cols { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-redesign-bottom { flex-direction: column; }
}

/* ==========================================================================
   DARK THEME — redesign overrides
   All hardcoded light colors from [data-ui="redesign"] replaced for dark mode
   ========================================================================== */

/* ── Background ── */
[data-theme="dark"][data-ui="redesign"] body {
  background: var(--bg-primary);
  transition: background-color var(--t-base) var(--ease);
}
[data-theme="dark"][data-ui="redesign"] body::before {
  background:
    radial-gradient(ellipse 65% 55% at 8% 12%, rgba(99,56,200,.18) 0%, transparent 65%),
    radial-gradient(ellipse 60% 50% at 92% 88%, rgba(139,66,180,.14) 0%, transparent 65%),
    var(--bg-primary);
}

/* ── Header ── */
[data-theme="dark"][data-ui="redesign"] .site-header {
  background: rgba(18,18,23,.85);
  border-color: rgba(129,140,248,.12);
}
[data-theme="dark"][data-ui="redesign"] .brand strong { color: #818CF8; }
[data-theme="dark"][data-ui="redesign"] .top-nav a { color: var(--text-muted); }
[data-theme="dark"][data-ui="redesign"] .top-nav a:hover,
[data-theme="dark"][data-ui="redesign"] .top-nav a.active { color: #818CF8; }
[data-theme="dark"][data-ui="redesign"] .theme-switch {
  border-color: rgba(129,140,248,.25);
  color: #818CF8;
}

/* ── Hero ── */
[data-theme="dark"] .hero-badge {
  background: rgba(109,40,217,.15);
  border-color: rgba(129,140,248,.2);
  color: var(--text-muted);
}
[data-theme="dark"] .hero-badge-pill {
  background: linear-gradient(135deg, #4C1D95, #5B21B6);
}
[data-theme="dark"] .hero-title { color: var(--text-main); }
[data-theme="dark"] .hero-sub   { color: var(--text-muted); }
[data-theme="dark"] .hero-btn-secondary {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
  color: var(--text-main);
}
[data-theme="dark"] .hero-btn-secondary:hover {
  border-color: #818CF8;
  color: #818CF8;
}

/* ── Footer redesign ── */
[data-theme="dark"] .footer-redesign-inner {
  background: rgba(24,24,27,.85);
  border-color: var(--border-strong);
}
[data-theme="dark"] .footer-redesign-cols h3 { color: var(--text-soft); }
[data-theme="dark"] .footer-redesign-cols a  { color: var(--text-muted); }
[data-theme="dark"] .footer-redesign-cols a:hover { color: #818CF8; }
[data-theme="dark"] .footer-redesign-bottom {
  border-top-color: var(--border-default);
  color: var(--text-soft);
}

/* ── Admin: Bulk selection toolbar ── */
.admin-col-cb {
  width: 36px;
  text-align: center;
  padding: 0 4px !important;
}
.admin-col-cb input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--accent, #6366F1);
}

.bulk-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}
.bulk-toolbar[hidden] { display: none; }
.bulk-count {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  min-width: 110px;
}
.bulk-toolbar form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.bulk-select {
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: .85rem;
  cursor: pointer;
}
.bulk-apply-btn { font-size: .85rem; padding: 5px 14px; }
.bulk-deselect-btn { font-size: .8rem; padding: 4px 10px; color: var(--text-muted); }

/* ── Admin: SEO text length column ── */
.admin-col-seo-len {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
}
.seo-len--empty { color: #9CA3AF; }
.seo-len--low   { color: var(--status-error); }
.seo-len--mid   { color: #D97706; }
.seo-len--ok    { color: var(--status-success); }

/* ── Admin: Bot Visits ── */
.admin-grid.three { grid-template-columns: repeat(3, 1fr); }

.bot-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 4px;
}
.bot-summary-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
}
.bot-summary-card strong { font-size: .85rem; color: var(--text-main); }
.bot-visits-count { font-size: .8rem; font-weight: 700; color: var(--accent, #6366F1); }
.bot-last-seen { font-size: .72rem; color: var(--text-muted); }

.bot-visits-table .bot-visit-url {
  font-family: monospace;
  font-size: .78rem;
  white-space: normal;
  overflow-wrap: anywhere;
}
.bot-visits-table .bot-visit-ua {
  font-size: .72rem;
  color: var(--text-muted);
}

.bot-type-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 99px;
  font-size: .7rem;
  font-weight: 600;
  white-space: nowrap;
  width: fit-content;
}
.bot-type-badge--search  { background: #EFF6FF; color: #2563EB; }
.bot-type-badge--ai      { background: #F5F3FF; color: #7C3AED; }
.bot-type-badge--seo     { background: #ECFDF5; color: #059669; }
.bot-type-badge--social  { background: #FFF7ED; color: #C2410C; }
.bot-type-badge--monitor { background: #F0FDF4; color: #166534; }
.bot-type-badge--tool    { background: #F9FAFB; color: #374151; }

.bot-add-help-box {
  position: absolute;
  z-index: 200;
  width: 360px;
  background: linear-gradient(135deg, #f5f3ff 0%, #eff6ff 100%);
  border: 1px solid #c4b5fd;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 20px rgba(109,40,217,.1);
  padding: .85rem 1rem;
  color: var(--text-main);
  font-size: var(--fs-body-sm);
  line-height: 1.5;
  margin-top: .35rem;
}
.bot-add-help-box code {
  font-family: monospace;
  font-size: .8rem;
  background: var(--bg-subtle);
  padding: 1px 4px;
  border-radius: 3px;
}

/* ── Admin: Activity Log ── */
.admin-log-table td { font-size: .8rem; vertical-align: top; }
.log-time  { color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.log-ip    { color: var(--text-muted); white-space: nowrap; font-family: monospace; }
.log-details { color: var(--text-muted); font-family: monospace; word-break: break-all; }

.log-action-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
  background: var(--bg-subtle);
  color: var(--text-soft);
}
.log-action--login .log-action-badge          { background: var(--status-success-bg); color: var(--status-success); }
.log-action--login_failed .log-action-badge   { background: var(--status-error-bg);   color: var(--status-error); }
.log-action--logout .log-action-badge         { background: var(--bg-subtle); color: var(--text-muted); }
.log-action--delete_page .log-action-badge    { background: var(--status-error-bg);   color: var(--status-error); }
.log-action--publish_page .log-action-badge,
.log-action--publish_all .log-action-badge    { background: #EFF6FF; color: #2563EB; }
.log-action--save_site_noindex .log-action-badge { background: #FEF3C7; color: #D97706; }

/* ── Admin: Site indexing toggle ── */
.admin-noindex-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  background: var(--status-error-bg);
  color: var(--status-error);
  font-size: var(--fs-body-sm);
  flex-wrap: wrap;
}
.admin-noindex-banner svg {
  flex-shrink: 0;
}
.admin-noindex-banner a {
  margin-left: auto;
  color: var(--status-error);
  font-weight: 600;
  text-decoration: underline;
}

.admin-card--noindex.is-active {
  border: 2px solid var(--status-error);
}

.noindex-toggle-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.noindex-toggle-head > div { flex: 1; }
.noindex-toggle-head p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: var(--fs-body-sm);
}

.noindex-status-badge {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
}
.noindex-status-badge--on {
  background: var(--status-success-bg);
  color: var(--status-success);
}
.noindex-status-badge--off {
  background: var(--status-error-bg);
  color: var(--status-error);
}

.noindex-check {
  font-size: var(--fs-body-sm) !important;
}

.secondary-btn.noindex-btn--danger {
  background: var(--status-error-bg);
  color: var(--status-error);
  border-color: var(--status-error);
}
.secondary-btn.noindex-btn--danger:hover {
  background: var(--status-error);
  color: #fff;
}

/* ── Content Editor ─────────────────────────────────────── */
.content-editor-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.content-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  background: var(--surface-2, #f5f5f5);
  border-bottom: 1px solid var(--border);
}
.content-editor-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  min-width: 30px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--text-base);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
  transition: background .12s, border-color .12s;
}
.content-editor-toolbar button:hover {
  background: var(--surface-1, #fff);
  border-color: var(--border);
}
.ce-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
  flex-shrink: 0;
}
.ce-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-1, #fff);
  color: var(--text-base);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
  transition: background .12s;
}
.ce-upload-btn:hover {
  background: var(--primary-light, #ede9fe);
}
.ce-upload-btn input[type="file"] {
  display: none;
}
.content-editor-textarea {
  display: block;
  width: 100%;
  min-height: 280px;
  padding: 12px;
  border: none;
  resize: vertical;
  font-size: var(--fs-body-sm, .875rem);
  font-family: 'Courier New', monospace;
  line-height: 1.6;
  color: var(--text-base);
  background: var(--surface-1, #fff);
  box-sizing: border-box;
}
.content-editor-textarea:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--primary, #7c3aed);
}
.ce-uploading-msg {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: none;
}
.ce-uploading-msg.visible {
  display: block;
}

/* ── Contact page ── */

/* Main centering */
.contact-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem 4rem;
  min-height: 60vh;
}

/* Card */
.contact-card {
  width: 100%;
  max-width: 820px;
  background: rgba(15, 12, 32, 0.75);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 20px;
  padding: 3rem 3.5rem 3.5rem;
  text-align: center;
  box-shadow:
    0 0 0 1px rgba(139, 92, 246, 0.07) inset,
    0 8px 48px rgba(0, 0, 0, 0.45),
    0 0 80px rgba(139, 92, 246, 0.1);
}

/* Top icon circle */
.contact-card-icon {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  border: 2px solid #8b5cf6;
  background: rgba(139, 92, 246, 0.12);
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.75rem;
  color: #c4b5fd;
}

/* Title */
.contact-card-title {
  font-size: clamp(1.5rem, 4vw, 2.125rem);
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
  margin: 0 0 .7rem;
  font-family: 'Courier New', Courier, monospace;
  line-height: 1.2;
}

/* Subtitle */
.contact-card-subtitle {
  color: rgba(255, 255, 255, 0.5);
  font-size: .9375rem;
  margin: 0 0 2.25rem;
  line-height: 1.55;
}

/* Error box */
.contact-errors {
  background: rgba(220, 38, 38, 0.14);
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 10px;
  padding: .8rem 1.1rem;
  margin-bottom: 1.25rem;
  color: #fca5a5;
  font-size: var(--fs-body-sm);
  text-align: left;
}

.contact-errors p { margin: 0; }

/* Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.contact-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

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

/* Wrapper: icon + input */
.contact-input-wrapper {
  position: relative;
}

.contact-input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #8b5cf6;
  pointer-events: none;
  display: flex;
}

.contact-input-icon--top {
  top: 1.05rem;
  transform: none;
}

.contact-field input,
.contact-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: .875rem .875rem .875rem 3rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 10px;
  font: inherit;
  font-size: .9375rem;
  color: #fff;
  transition: border-color .2s, box-shadow .2s;
  caret-color: #a78bfa;
}

.contact-field input::placeholder,
.contact-field textarea::placeholder {
  color: rgba(255, 255, 255, 0.28);
}

.contact-field input:focus,
.contact-field textarea:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
  background: rgba(255, 255, 255, 0.07);
}

.contact-field.has-error input,
.contact-field.has-error textarea {
  border-color: #f87171;
}

.contact-field.has-error input:focus,
.contact-field.has-error textarea:focus {
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.18);
}

.contact-field textarea {
  resize: vertical;
  min-height: 160px;
  padding-top: .875rem;
}

.contact-field-error {
  font-size: .8rem;
  color: #f87171;
  padding-left: .2rem;
}

/* Submit button */
.contact-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  margin: .75rem auto 0;
  padding: 1rem 3rem;
  min-width: 260px;
  background: linear-gradient(90deg, #4338ca 0%, #7c3aed 55%, #9333ea 100%);
  color: #fff;
  font: inherit;
  font-size: .9375rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 28px rgba(139, 92, 246, 0.45);
  transition: opacity .2s, transform .15s, box-shadow .2s;
}

.contact-submit:hover {
  opacity: .9;
  transform: translateY(-2px);
  box-shadow: 0 6px 36px rgba(139, 92, 246, 0.55);
}

.contact-submit:active {
  transform: translateY(0);
}

/* Success state */
.contact-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  padding: 1rem 0 .5rem;
}

.contact-success h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.25rem, 3.5vw, 1.75rem);
  letter-spacing: .08em;
  text-transform: uppercase;
  font-family: 'Courier New', Courier, monospace;
}

.contact-success p {
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
  font-size: .9375rem;
}

.contact-success .primary-btn {
  display: inline-flex;
  align-items: center;
  padding: .75rem 2.25rem;
  background: linear-gradient(90deg, #4338ca, #7c3aed);
  color: #fff;
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
  transition: opacity .2s, transform .15s;
}

.contact-success .primary-btn:hover {
  opacity: .88;
  transform: translateY(-1px);
}

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Responsive */
@media (max-width: 680px) {
  .contact-card {
    padding: 2rem 1.5rem 2.5rem;
    border-radius: 16px;
  }
  .contact-form-row {
    grid-template-columns: 1fr;
  }
  .contact-submit {
    min-width: 100%;
    width: 100%;
  }
}
