:root {
  color-scheme: light dark;
  --ink: #131718;
  --ink-soft: #1b2122;
  --ink-card: #202728;
  --ink-line: rgba(238, 231, 219, 0.14);
  --paper: #f4eee4;
  --paper-bright: #fffaf1;
  --paper-muted: #d6cec1;
  --paper-ink: #1c2020;
  --paper-soft-ink: #565954;
  --coral: #ff6b4a;
  --coral-dark: #b83c28;
  --cobalt: #6671ff;
  --mint: #b9e8be;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ink);
}

html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--paper);
  background:
    radial-gradient(circle at 12% -4%, rgba(102, 113, 255, 0.18), transparent 30rem),
    radial-gradient(circle at 92% 16%, rgba(255, 107, 74, 0.09), transparent 28rem),
    var(--ink);
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid var(--cobalt);
  outline-offset: 3px;
}

.app-shell {
  width: min(1480px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 36px 22px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  border-bottom: 1px solid var(--ink-line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--paper);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 8px);
  grid-template-rows: repeat(2, 8px);
  gap: 3px;
  width: 25px;
  height: 25px;
  padding: 3px;
  border: 1px solid rgba(244, 238, 228, 0.5);
  transform: rotate(-10deg);
}

.brand-mark span {
  display: block;
  background: var(--paper);
}

.brand-mark span:nth-child(2),
.brand-mark span:nth-child(3) {
  background: var(--coral);
}

.brand-word {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--paper-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.11em;
}

.vk-mode-pill {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: #ffffff;
  background: #005bd1;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

html[data-vk-mode="true"] .vk-mode-pill {
  display: inline-flex;
}

html[data-vk-mode="true"] .locale-picker {
  display: none;
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.privacy-label-short {
  display: none;
}

.privacy-dot,
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(185, 232, 190, 0.1);
}

.version-label {
  opacity: 0.58;
}

.locale-picker {
  position: relative;
  z-index: 61;
}

.locale-picker-summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 9px 0 7px;
  border: 1px solid rgba(244, 238, 228, 0.2);
  border-radius: 999px;
  color: var(--paper-muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 11px;
  font-weight: 750;
  list-style: none;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease;
}

.locale-picker-summary:focus,
.locale-picker-summary:focus-visible {
  outline: none;
}

html[data-input-modality="keyboard"] .locale-picker-summary:focus {
  outline: 2px solid var(--cobalt);
  outline-offset: 2px;
}

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

.locale-picker-summary:hover,
.locale-picker[open] .locale-picker-summary {
  border-color: rgba(244, 238, 228, 0.42);
  color: var(--paper);
  background: rgba(255, 255, 255, 0.07);
}

.locale-current-code,
.locale-choice-code {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(244, 238, 228, 0.16);
  border-radius: 50%;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.05);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.06em;
}

.locale-picker-chevron {
  display: block;
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  transform-origin: center;
  transition: transform 160ms ease;
}

.locale-picker[open] .locale-picker-chevron {
  transform: rotate(180deg);
}

.locale-picker-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  width: 224px;
  padding: 7px;
  border: 1px solid rgba(244, 238, 228, 0.16);
  border-radius: 15px;
  color: var(--paper);
  background: rgba(27, 33, 34, 0.98);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px);
}

.locale-picker-menu button {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 7px 9px;
  border: 0;
  border-radius: 10px;
  color: inherit;
  background: transparent;
  text-align: left;
  transition: color 160ms ease, background-color 160ms ease;
}

.locale-picker-menu button:hover,
.locale-picker-menu button[aria-pressed="true"] {
  background: rgba(255, 107, 74, 0.12);
}

.locale-choice-code {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.locale-picker-menu button[aria-pressed="true"] .theme-choice-check {
  opacity: 1;
}

.tour-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px 0 7px;
  border: 1px solid rgba(244, 238, 228, 0.2);
  border-radius: 999px;
  color: var(--paper-muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0;
  transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease;
}

.tour-trigger:hover {
  border-color: rgba(244, 238, 228, 0.42);
  color: var(--paper);
  background: rgba(255, 255, 255, 0.07);
}

.tour-trigger-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #171b1c;
  background: var(--mint);
  font-size: 12px;
  font-weight: 900;
}

.theme-picker {
  position: relative;
  z-index: 60;
}

.theme-picker-summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid rgba(244, 238, 228, 0.2);
  border-radius: 999px;
  color: var(--paper-muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0;
  list-style: none;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease;
}

.theme-picker-summary:focus,
.theme-picker-summary:focus-visible {
  outline: none;
}

html[data-input-modality="keyboard"] .theme-picker-summary:focus {
  outline: 2px solid var(--cobalt);
  outline-offset: 2px;
}

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

.theme-picker-summary:hover,
.theme-picker[open] .theme-picker-summary {
  border-color: rgba(244, 238, 228, 0.42);
  color: var(--paper);
  background: rgba(255, 255, 255, 0.07);
}

.theme-current-icon,
.theme-icon {
  width: 18px;
  height: 18px;
}

.theme-current-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.theme-icon {
  display: none;
}

html[data-theme-preference="auto"] .theme-icon--auto,
html[data-theme-preference="light"] .theme-icon--light,
html[data-theme-preference="dark"] .theme-icon--dark {
  display: block;
}

.theme-picker-chevron {
  display: block;
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  transform-origin: center;
  transition: transform 160ms ease;
}

.theme-picker[open] .theme-picker-chevron {
  transform: rotate(180deg);
}

.theme-picker-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  width: 248px;
  padding: 7px;
  border: 1px solid rgba(244, 238, 228, 0.16);
  border-radius: 15px;
  color: var(--paper);
  background: rgba(27, 33, 34, 0.98);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px);
}

.theme-picker-menu button {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 7px 9px;
  border: 0;
  border-radius: 10px;
  color: inherit;
  background: transparent;
  text-align: left;
  transition: color 160ms ease, background-color 160ms ease;
}

.theme-picker-menu button:hover,
.theme-picker-menu button[aria-pressed="true"] {
  background: rgba(255, 107, 74, 0.12);
}

.theme-choice-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(244, 238, 228, 0.16);
  border-radius: 9px;
  color: var(--paper-muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 18px;
}

.theme-choice-copy {
  display: grid;
  gap: 2px;
}

.theme-choice-copy strong {
  color: inherit;
  font-size: 13px;
  line-height: 1.25;
}

.theme-choice-copy small {
  color: #9ca39f;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
}

.theme-choice-check {
  color: var(--coral);
  font-size: 15px;
  font-weight: 900;
  opacity: 0;
}

.theme-picker-menu button[aria-pressed="true"] .theme-choice-check {
  opacity: 1;
}

.workspace {
  padding: 54px 0 44px;
}

.workspace-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 36px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--coral);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1.2;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 680px;
  margin-bottom: 0;
  font-size: clamp(2.7rem, 5vw, 5.4rem);
  font-weight: 760;
  letter-spacing: -0.065em;
  line-height: 0.96;
}

h1 em {
  color: var(--paper-muted);
  font-style: normal;
}

.intro-copy {
  width: min(320px, 100%);
  margin-bottom: 4px;
  color: var(--paper-muted);
  font-size: 16px;
  line-height: 1.55;
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(284px, 370px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.controls-panel {
  padding: 28px 26px 26px;
  border: 1px solid var(--ink-line);
  border-radius: 22px;
  background: rgba(28, 34, 35, 0.86);
  box-shadow: var(--shadow);
}

.step-block {
  display: grid;
  gap: 18px;
}

.step-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.step-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 1px solid rgba(244, 238, 228, 0.28);
  border-radius: 50%;
  color: var(--paper-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.step-heading .eyebrow {
  margin-bottom: 4px;
}

.step-heading h2,
.pattern-header h2 {
  margin-bottom: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.dropzone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 216px;
  padding: 28px 18px;
  border: 1px dashed rgba(244, 238, 228, 0.35);
  border-radius: 17px;
  color: var(--paper-muted);
  text-align: center;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: var(--coral);
  background: rgba(255, 107, 74, 0.08);
  transform: translateY(-2px);
}

.dropzone strong {
  color: var(--paper);
  font-size: 16px;
  font-weight: 700;
}

.dropzone > span:not(.dropzone-icon) {
  font-size: 14px;
  line-height: 1.35;
}

.dropzone small {
  margin-top: 4px;
  color: #969e9a;
  font-size: 12px;
}

.dropzone-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin-bottom: 3px;
  border-radius: 14px;
  color: var(--coral);
  background: rgba(255, 107, 74, 0.12);
}

.dropzone-icon svg {
  width: 28px;
  height: 28px;
}

.source-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px;
  border: 1px solid rgba(244, 238, 228, 0.2);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.04);
}

.source-card img {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  object-fit: cover;
}

.source-info {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.source-info strong,
.source-info span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-info strong {
  color: var(--paper);
  font-size: 14px;
}

.source-info span {
  color: #9ca39f;
  font-size: 12px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  color: #aeb5af;
  background: transparent;
  font-size: 24px;
  line-height: 1;
}

.icon-button:hover {
  color: var(--coral);
  background: rgba(255, 107, 74, 0.12);
}

.field-note {
  margin-bottom: 0;
  color: #9ca39f;
  font-size: 13px;
  line-height: 1.45;
}

.field-note.is-error {
  color: #ffae97;
}

.ai-helper {
  display: block;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(126, 136, 255, 0.35);
  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0, rgba(102, 113, 255, 0.2), transparent 13rem),
    rgba(102, 113, 255, 0.07);
}

.ai-helper-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "badge target target"
    "title title chevron";
  align-items: center;
  gap: 10px 14px;
  min-height: 96px;
  padding: 15px 16px;
  list-style: none;
  cursor: pointer;
}

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

.ai-helper-title {
  grid-area: title;
  min-width: 0;
  color: var(--paper);
  font-size: 15px;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.ai-helper-chevron {
  grid-area: chevron;
  justify-self: end;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(244, 238, 228, 0.14);
  border-radius: 50%;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.045);
  transition: transform 160ms ease;
}

.ai-helper-chevron svg {
  display: block;
  width: 16px;
  height: 16px;
}

.ai-helper[open] .ai-helper-chevron {
  transform: rotate(180deg);
}

.ai-helper-body {
  display: grid;
  gap: 13px;
  margin: 0 16px;
  padding: 15px 0 16px;
  border-top: 1px solid rgba(244, 238, 228, 0.12);
}

.ai-helper-badge {
  grid-area: badge;
  justify-self: start;
  padding: 5px 7px;
  border: 1px solid rgba(185, 232, 190, 0.3);
  border-radius: 999px;
  color: var(--mint);
  background: rgba(185, 232, 190, 0.07);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.ai-helper-target {
  grid-area: target;
  justify-self: end;
  color: #b8c0ff;
  font-size: 11px;
  font-weight: 750;
  text-align: right;
}

.ai-helper-copy,
.ai-helper-steps,
.ai-helper-privacy,
.ai-prompt-status {
  margin-bottom: 0;
}

.ai-helper-copy {
  color: #c6cdc8;
  font-size: 13px;
  line-height: 1.5;
}

.ai-helper-steps {
  display: grid;
  gap: 7px;
  padding-left: 21px;
  color: #d8ddd8;
  font-size: 12px;
  line-height: 1.45;
}

.ai-helper-steps li::marker {
  color: var(--coral);
  font-weight: 800;
}

.copy-prompt-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 45px;
  padding: 0 14px;
  border: 0;
  border-radius: 11px;
  color: #171b1c;
  background: var(--paper);
  font-size: 13px;
  font-weight: 800;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.copy-prompt-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.copy-prompt-button:hover {
  background: var(--paper-bright);
  transform: translateY(-1px);
}

.copy-prompt-button.is-copied {
  color: #17331d;
  background: var(--mint);
}

.ai-prompt-details {
  min-width: 0;
  border-top: 1px solid rgba(244, 238, 228, 0.12);
}

.ai-prompt-details summary {
  padding: 12px 0 0;
  color: #b8c0ff;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
  cursor: pointer;
}

.ai-prompt-details[open] summary {
  margin-bottom: 10px;
}

.ai-prompt-details textarea {
  display: block;
  width: 100%;
  min-height: 260px;
  padding: 12px;
  resize: vertical;
  border: 1px solid rgba(244, 238, 228, 0.18);
  border-radius: 10px;
  color: #e4e7e3;
  background: rgba(9, 12, 13, 0.58);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  line-height: 1.55;
}

.ai-helper-privacy {
  padding-left: 10px;
  border-left: 2px solid rgba(255, 107, 74, 0.65);
  color: #aab2ad;
  font-size: 11px;
  line-height: 1.45;
}

.ai-prompt-status {
  min-height: 0;
  color: var(--mint);
  font-size: 11px;
  line-height: 1.4;
}

.ai-prompt-status:empty {
  display: none;
}

.ai-prompt-status.is-error {
  color: #ffae97;
}

.rule {
  height: 1px;
  margin: 28px 0;
  background: var(--ink-line);
}

.control-disclosure {
  border: 1px solid rgba(244, 238, 228, 0.17);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.035);
}

.control-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 0 13px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
}

.control-disclosure > summary::-webkit-details-marker { display: none; }
.control-disclosure > summary span:last-child { color: #929b96; font-size: 10px; font-weight: 650; }
.control-disclosure-body { padding: 4px 13px 14px; }

.photo-prep-grid { display: grid; gap: 12px; }

.compact-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 10px;
  color: #c8cfca;
  font-size: 11px;
}

.compact-field output { color: var(--coral); font-weight: 800; }
.compact-field input { grid-column: 1 / -1; width: 100%; accent-color: var(--coral); }

.prep-actions,
.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-action {
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid rgba(244, 238, 228, 0.18);
  border-radius: 9px;
  color: #d7ddd8;
  background: rgba(255, 255, 255, 0.04);
  font-size: 11px;
  font-weight: 800;
}

.compact-action:hover:not(:disabled) { border-color: var(--coral); color: var(--paper); }
.compact-action:disabled { cursor: not-allowed; opacity: 0.42; }
.project-status { min-height: 0; margin: -4px 0 0; color: var(--mint); font-size: 11px; line-height: 1.4; }
.project-status:empty { display: none; }
.project-status.is-error { color: #ffae97; }

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--paper);
  font-size: 14px;
  font-weight: 650;
}

.field-value {
  color: var(--coral);
  font-size: 13px;
  font-weight: 750;
}

.range-label {
  margin-top: 4px;
}

.select-shell {
  position: relative;
  color: var(--paper);
}

.select-control {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-height: 46px;
  padding: 0 48px 0 15px;
  border: 1px solid rgba(244, 238, 228, 0.19);
  border-radius: 11px;
  color: inherit;
  background: #171c1d;
  font-size: 14px;
}

.select-control::-ms-expand {
  display: none;
}

.select-chevron {
  position: absolute;
  top: 50%;
  right: 16px;
  width: 16px;
  height: 16px;
  pointer-events: none;
  transform: translateY(-50%);
}

.select-control:hover {
  border-color: rgba(244, 238, 228, 0.38);
}

.range-control {
  width: 100%;
  height: 5px;
  margin: 1px 0 0;
  accent-color: var(--coral);
}

.color-choice-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.color-presets {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.color-presets button {
  min-width: 0;
  min-height: 40px;
  padding: 0 6px;
  border: 1px solid rgba(244, 238, 228, 0.18);
  border-radius: 9px;
  color: #b9c0bc;
  background: rgba(255, 255, 255, 0.035);
  font-size: 12px;
  font-weight: 800;
  transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease;
}

.color-presets button:hover,
.color-presets button.is-active {
  border-color: var(--coral);
  color: var(--paper);
  background: rgba(255, 107, 74, 0.13);
}

.color-number-control {
  display: grid;
  grid-template-columns: auto 56px;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding-left: 10px;
  border: 1px solid rgba(244, 238, 228, 0.18);
  border-radius: 9px;
  color: #aeb5b1;
  background: rgba(255, 255, 255, 0.035);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.color-number-control input {
  width: 56px;
  height: 100%;
  padding: 0 5px;
  border: 0;
  border-left: 1px solid rgba(244, 238, 228, 0.14);
  border-radius: 0 8px 8px 0;
  color: var(--paper);
  background: #171c1d;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.color-guidance {
  margin: -7px 0 0;
  color: #aeb5b1;
  font-size: 11px;
  line-height: 1.45;
}

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

.choice-fieldset legend {
  margin-bottom: 8px;
  color: var(--paper);
  font-size: 14px;
  font-weight: 650;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.segmented-control button {
  min-width: 0;
  min-height: 42px;
  padding: 6px 7px;
  border: 1px solid rgba(244, 238, 228, 0.18);
  border-radius: 9px;
  color: #aeb5b1;
  background: rgba(255, 255, 255, 0.035);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
}

.segmented-control button:hover,
.segmented-control button[aria-pressed="true"] {
  border-color: var(--coral);
  color: var(--paper);
  background: rgba(255, 107, 74, 0.13);
}

.range-scale {
  display: flex;
  justify-content: space-between;
  margin-top: -8px;
  color: #8f9793;
  font-size: 10px;
}

.algorithm-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 13px 14px;
  border-left: 2px solid var(--cobalt);
  border-radius: 0 9px 9px 0;
  color: #c7cec7;
  background: rgba(102, 113, 255, 0.08);
  font-size: 13px;
  line-height: 1.45;
}

.note-mark {
  color: var(--cobalt);
  font-size: 17px;
}

.auto-update-note {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid rgba(185, 232, 190, 0.2);
  border-radius: 11px;
  color: #cbd2cd;
  background: rgba(185, 232, 190, 0.055);
  font-size: 12px;
  line-height: 1.4;
}

.auto-update-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8d9691;
}

.auto-update-note.is-ready .auto-update-dot {
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(185, 232, 190, 0.1);
}

.auto-update-note.is-busy .auto-update-dot {
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(255, 107, 74, 0.1);
  animation: pulse 900ms ease-in-out infinite alternate;
}

.pattern-panel {
  min-width: 0;
  min-height: 690px;
  padding: 30px;
  border-radius: 22px;
  color: var(--paper-ink);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.pattern-header,
.pattern-toolbar,
.legend-heading,
.pattern-actions,
.pattern-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pattern-header {
  align-items: flex-start;
  margin-bottom: 26px;
}

.pattern-header .eyebrow {
  color: var(--coral-dark);
}

.pattern-header h2 {
  max-width: 420px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border: 1px solid rgba(28, 32, 32, 0.12);
  border-radius: 999px;
  color: var(--paper-soft-ink);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-chip .status-dot {
  width: 6px;
  height: 6px;
  background: #9aa09a;
  box-shadow: none;
}

.status-chip.is-ready .status-dot {
  background: #4b9e60;
  box-shadow: 0 0 0 4px rgba(75, 158, 96, 0.12);
}

.status-chip.is-busy .status-dot {
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(255, 107, 74, 0.12);
  animation: pulse 900ms ease-in-out infinite alternate;
}

@keyframes pulse {
  from { opacity: 0.42; }
  to { opacity: 1; }
}

.pattern-toolbar {
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(28, 32, 32, 0.12);
}

.view-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 9px;
  background: rgba(28, 32, 32, 0.08);
}

.view-button {
  min-width: 74px;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  color: var(--paper-soft-ink);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.view-button.is-active {
  color: var(--paper-ink);
  background: var(--paper-bright);
  box-shadow: 0 2px 8px rgba(28, 32, 32, 0.09);
}

.display-options {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pattern-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.zoom-control {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid rgba(28, 32, 32, 0.12);
  border-radius: 10px;
  background: rgba(28, 32, 32, 0.06);
}

.zoom-button {
  display: grid;
  place-items: center;
  min-width: 32px;
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  color: var(--paper-ink);
  background: transparent;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  transition: color 160ms ease, background 160ms ease, opacity 160ms ease;
}

.zoom-button:hover:not(:disabled) {
  color: #5058bd;
  background: var(--paper-bright);
}

.zoom-button:disabled {
  cursor: not-allowed;
  opacity: 0.32;
}

.zoom-value {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 98px;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.zoom-fit-label {
  color: var(--paper-soft-ink);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0;
}

.check-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--paper-soft-ink);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.check-control input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--coral-dark);
}

.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 510px;
  padding: 40px 20px;
  text-align: center;
}

.empty-state strong {
  margin-top: 28px;
  color: var(--paper-ink);
  font-size: 18px;
}

.empty-state > span {
  width: min(360px, 100%);
  margin-top: 9px;
  color: var(--paper-soft-ink);
  font-size: 14px;
  line-height: 1.5;
}

.empty-grid {
  display: grid;
  grid-template-columns: repeat(6, 28px);
  gap: 6px;
  transform: rotate(-4deg);
}

.empty-grid span {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(28, 32, 32, 0.18);
  background: rgba(255, 250, 241, 0.45);
}

.empty-grid span:nth-child(3n) {
  background: rgba(102, 113, 255, 0.12);
}

.empty-grid span.accent {
  border-color: rgba(255, 107, 74, 0.52);
  background: rgba(255, 107, 74, 0.36);
}

.pattern-result {
  padding-top: 22px;
}

.pattern-meta {
  justify-content: flex-start;
  margin-bottom: 14px;
  color: var(--paper-soft-ink);
  font-size: 13px;
  font-weight: 650;
}

.meta-divider {
  color: rgba(28, 32, 32, 0.3);
}

.square-badge {
  margin-left: auto;
  padding: 5px 8px;
  border: 1px solid rgba(102, 113, 255, 0.25);
  border-radius: 999px;
  color: #5058bd;
  background: rgba(102, 113, 255, 0.08);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.canvas-shell {
  display: grid;
  place-items: center;
  place-items: safe center;
  height: clamp(390px, 55vw, 710px);
  min-height: 390px;
  padding: 16px;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: rgba(28, 32, 32, 0.32) transparent;
  border: 1px solid rgba(28, 32, 32, 0.13);
  border-radius: 13px;
  background:
    linear-gradient(rgba(28, 32, 32, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 32, 32, 0.04) 1px, transparent 1px),
    #e8dfd2;
  background-size: 18px 18px;
}

.canvas-shell.is-pannable {
  cursor: grab;
}

.canvas-shell.is-dragging {
  cursor: grabbing;
  user-select: none;
}

#patternCanvas {
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  flex: none;
  border: 1px solid rgba(28, 32, 32, 0.28);
  box-shadow: 0 9px 20px rgba(28, 32, 32, 0.12);
}

.canvas-hint {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 9px 2px 0;
  color: #595d58;
  font-size: 11px;
  line-height: 1.4;
}

.canvas-hint span::before {
  content: "↳";
  margin-right: 5px;
  color: var(--coral-dark);
  font-weight: 900;
}

.editor-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 9px;
  align-items: center;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid rgba(28, 32, 32, 0.13);
  border-radius: 12px;
  background: rgba(255, 250, 241, 0.5);
}

.editor-tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.editor-tools button,
.editor-history button {
  min-height: 36px;
  padding: 0 9px;
  border: 1px solid rgba(28, 32, 32, 0.15);
  border-radius: 8px;
  color: var(--paper-soft-ink);
  background: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  font-weight: 800;
}

.editor-tools button[aria-pressed="true"] { border-color: #5058bd; color: #fff; background: #5058bd; }
.editor-history { display: flex; gap: 4px; }
.editor-history button { min-width: 36px; padding: 0; font-size: 18px; }
.editor-history button:disabled { opacity: 0.38; }

.editor-color {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--paper-soft-ink);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.editor-color select {
  max-width: 145px;
  min-height: 36px;
  border: 1px solid rgba(28, 32, 32, 0.17);
  border-radius: 8px;
  color: var(--paper-ink);
  background: #fffaf1;
  font-size: 11px;
}

.editor-status { min-height: 0; margin: 7px 2px 0; color: var(--paper-soft-ink); font-size: 11px; }
.editor-status:empty { display: none; }

.pattern-insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 14px;
}

.pattern-insights article {
  display: grid;
  align-content: start;
  min-height: 94px;
  padding: 12px;
  border: 1px solid rgba(28, 32, 32, 0.12);
  border-radius: 11px;
  background: rgba(255, 250, 241, 0.48);
}

.pattern-insights span { color: var(--paper-soft-ink); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.pattern-insights strong { margin-top: 6px; color: var(--paper-ink); font-size: 18px; line-height: 1.1; }
.pattern-insights small { margin-top: 5px; color: var(--paper-soft-ink); font-size: 10px; line-height: 1.35; }

#patternCanvas.is-editing { cursor: crosshair; }

.pattern-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin: 16px 0 28px;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid rgba(28, 32, 32, 0.18);
  border-radius: 10px;
  color: var(--paper-ink);
  background: rgba(255, 250, 241, 0.62);
  font-size: 13px;
  font-weight: 750;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.secondary-button svg {
  width: 17px;
  height: 17px;
}

.secondary-button:hover:not(:disabled) {
  border-color: var(--coral-dark);
  background: var(--paper-bright);
  transform: translateY(-1px);
}

.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.secondary-button--pdf {
  border-color: #5058bd;
  color: #fff;
  background: #5058bd;
}

.secondary-button--pdf:hover:not(:disabled) {
  border-color: #3f46a8;
  color: #fff;
  background: #3f46a8;
}

.secondary-button--pdf.is-busy {
  cursor: wait;
}

.secondary-button--vk-story {
  display: none;
  border-color: #005bd1;
  color: #ffffff;
  background: #005bd1;
}

html[data-vk-mode="true"] .secondary-button--vk-story {
  display: inline-flex;
}

.secondary-button--vk-story:hover:not(:disabled) {
  border-color: #004cad;
  color: #ffffff;
  background: #004cad;
}

.secondary-button--vk-story.is-busy {
  cursor: wait;
}

.export-status {
  min-height: 20px;
  margin: -16px 0 24px;
  color: var(--paper-soft-ink);
  font-size: 12px;
  line-height: 1.5;
}

.export-status:empty {
  display: none;
}

.export-status.is-error {
  color: #a33b2f;
}

.export-status a {
  color: #5058bd;
  font-weight: 800;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.legend-section {
  padding-top: 22px;
  border-top: 1px solid rgba(28, 32, 32, 0.12);
}

.legend-heading {
  align-items: flex-end;
  margin-bottom: 15px;
}

.legend-heading .eyebrow {
  margin-bottom: 7px;
  color: var(--coral-dark);
}

.legend-heading h3 {
  margin-bottom: 0;
  font-size: 19px;
  letter-spacing: -0.03em;
}

.legend-heading > span {
  color: var(--paper-soft-ink);
  font-size: 12px;
  font-weight: 700;
}

.legend-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  max-height: 520px;
  padding-right: 4px;
  overflow-y: auto;
}

.legend-row {
  display: grid;
  grid-template-columns: 27px 27px minmax(45px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 6px 8px;
  border: 1px solid rgba(28, 32, 32, 0.11);
  border-radius: 9px;
  background: rgba(255, 250, 241, 0.54);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.legend-row:hover,
.legend-row:focus-visible {
  border-color: rgba(80, 88, 189, 0.62);
  background: rgba(255, 250, 241, 0.86);
}

.legend-swatch {
  width: 27px;
  height: 27px;
  border: 1px solid rgba(28, 32, 32, 0.2);
  border-radius: 6px;
}

.legend-symbol {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(28, 32, 32, 0.15);
  border-radius: 6px;
  color: var(--paper-ink);
  background: var(--paper-bright);
  font-family: Georgia, serif;
  font-size: 16px;
  font-weight: 700;
}

.legend-code {
  color: var(--paper-ink);
  font-size: 12px;
  font-weight: 800;
}

.legend-name {
  overflow: hidden;
  color: var(--paper-soft-ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-result-bar {
  display: none;
}

.legend-count {
  color: var(--paper-soft-ink);
  font-size: 11px;
  font-weight: 700;
}

.legend-note {
  margin: 14px 0 0;
  color: var(--paper-soft-ink);
  font-size: 12px;
  line-height: 1.45;
}

.seo-guide {
  margin-top: 72px;
  padding: 42px;
  border: 1px solid var(--ink-line);
  border-radius: 22px;
  background: rgba(28, 34, 35, 0.62);
}

.seo-guide-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  align-items: end;
  gap: 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--ink-line);
}

.seo-guide-heading h2 {
  max-width: 720px;
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.7rem);
  letter-spacing: -0.055em;
  line-height: 1;
}

.seo-guide-heading > p {
  margin-bottom: 0;
  color: var(--paper-muted);
  font-size: 16px;
  line-height: 1.6;
}

.seo-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--ink-line);
}

.seo-steps li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  padding: 28px 22px;
  background: rgba(28, 34, 35, 0.96);
}

.seo-steps li > span {
  color: var(--coral);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.seo-steps h3 {
  margin-bottom: 9px;
  font-size: 17px;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.seo-steps p {
  margin-bottom: 0;
  color: #9ca39f;
  font-size: 14px;
  line-height: 1.55;
}

.seo-faq {
  padding-top: 30px;
  border-top: 1px solid var(--ink-line);
}

.seo-faq > h3 {
  margin-bottom: 18px;
  font-size: 20px;
  letter-spacing: -0.03em;
}

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

.seo-faq details {
  padding: 17px 18px;
  border: 1px solid rgba(244, 238, 228, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.seo-faq summary {
  color: var(--paper);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.35;
  cursor: pointer;
}

.seo-faq details p {
  margin: 12px 0 0;
  color: #9ca39f;
  font-size: 14px;
  line-height: 1.55;
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  padding-top: 19px;
  border-top: 1px solid var(--ink-line);
  color: #7f8984;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
}

.footer-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer a {
  color: inherit;
  text-underline-offset: 3px;
  transition: color 160ms ease;
}

.footer a:hover,
.footer a:focus-visible {
  color: var(--coral);
}

body.onboarding-open {
  overflow: hidden;
}

.onboarding-dialog {
  width: min(580px, calc(100vw - 32px));
  max-width: none;
  max-height: min(720px, calc(100dvh - 32px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 24px;
  color: var(--paper-ink);
  background: var(--paper);
  box-shadow: 0 30px 120px rgba(0, 0, 0, 0.48);
}

.onboarding-dialog::backdrop {
  background: rgba(7, 10, 11, 0.76);
  backdrop-filter: blur(9px);
}

.onboarding-dialog.is-fallback {
  position: fixed;
  inset: 16px;
  z-index: 1000;
}

.onboarding-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  min-width: 0;
  max-height: min(720px, calc(100dvh - 32px));
}

.onboarding-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  min-width: 0;
  padding: 24px 28px 17px;
  border-bottom: 1px solid rgba(28, 32, 32, 0.11);
}

.onboarding-header .eyebrow {
  margin-bottom: 5px;
  color: var(--coral-dark);
}

.onboarding-header h2 {
  margin-bottom: 0;
  font-size: 18px;
  letter-spacing: -0.025em;
}

.onboarding-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid rgba(28, 32, 32, 0.14);
  border-radius: 50%;
  color: var(--paper-soft-ink);
  background: rgba(28, 32, 32, 0.04);
}

.onboarding-close svg {
  display: block;
  width: 16px;
  height: 16px;
}

.onboarding-close:hover {
  color: var(--paper-ink);
  background: rgba(28, 32, 32, 0.09);
}

.onboarding-stage {
  min-height: 0;
  min-width: 0;
  padding: 20px 32px 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.onboarding-step[hidden] {
  display: none;
}

.onboarding-step.is-active {
  animation: onboarding-in 240ms ease-out both;
}

@keyframes onboarding-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.onboarding-visual {
  position: relative;
  display: grid;
  place-items: center;
  height: 154px;
  margin-bottom: 22px;
  overflow: hidden;
  border: 1px solid rgba(28, 32, 32, 0.12);
  border-radius: 17px;
  background:
    linear-gradient(rgba(28, 32, 32, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 32, 32, 0.05) 1px, transparent 1px),
    rgba(255, 250, 241, 0.72);
  background-size: 19px 19px;
}

.onboarding-visual::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(102, 113, 255, 0.1);
  filter: blur(2px);
  transform: translate(125px, -72px);
}

.onboarding-visual--ai::after {
  background: rgba(255, 107, 74, 0.13);
}

.onboarding-visual--export::after {
  background: rgba(185, 232, 190, 0.26);
}

.onboarding-visual svg {
  position: relative;
  z-index: 1;
  width: 82px;
  height: 82px;
  stroke: var(--paper-ink);
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.onboarding-visual svg .is-cobalt {
  fill: rgba(102, 113, 255, 0.68);
  stroke: #5058bd;
}

.onboarding-visual svg .is-coral {
  fill: rgba(255, 107, 74, 0.62);
  stroke: var(--coral-dark);
}

.onboarding-visual-code,
.onboarding-visual-label {
  position: absolute;
  z-index: 2;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.onboarding-visual-code {
  top: 14px;
  left: 16px;
  color: var(--coral-dark);
}

.onboarding-visual-label {
  right: 16px;
  bottom: 14px;
  color: var(--paper-soft-ink);
}

.onboarding-kicker {
  margin-bottom: 7px;
  color: #5058bd;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.onboarding-step h3 {
  margin-bottom: 12px;
  color: var(--paper-ink);
  font-size: clamp(1.7rem, 5vw, 2.15rem);
  letter-spacing: -0.045em;
  line-height: 1.04;
}

.onboarding-copy {
  margin-bottom: 16px;
  color: #50544f;
  font-size: 16px;
  line-height: 1.55;
}

.onboarding-callout {
  margin-bottom: 0;
  padding: 12px 14px;
  border-left: 3px solid var(--cobalt);
  border-radius: 0 10px 10px 0;
  color: #484d48;
  background: rgba(102, 113, 255, 0.08);
  font-size: 14px;
  line-height: 1.45;
}

.onboarding-callout--privacy {
  border-left-color: var(--coral-dark);
  background: rgba(255, 107, 74, 0.08);
}

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

.onboarding-chips span {
  padding: 7px 9px;
  border: 1px solid rgba(80, 88, 189, 0.2);
  border-radius: 999px;
  color: #5058bd;
  background: rgba(102, 113, 255, 0.07);
  font-size: 13px;
  font-weight: 750;
}

.onboarding-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 14px 28px;
  border-top: 1px solid rgba(28, 32, 32, 0.1);
  color: var(--paper-soft-ink);
  font-size: 12px;
  font-weight: 750;
}

.onboarding-dots {
  display: flex;
  gap: 7px;
}

.onboarding-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(28, 32, 32, 0.18);
  transition: width 160ms ease, border-radius 160ms ease, background-color 160ms ease;
}

.onboarding-dots span.is-active {
  width: 23px;
  border-radius: 999px;
  background: var(--coral-dark);
}

.onboarding-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 0 28px 24px;
}

.onboarding-nav-actions {
  display: flex;
  gap: 9px;
  margin-left: auto;
}

.onboarding-skip,
.onboarding-back,
.onboarding-next {
  min-height: 44px;
  padding: 0 15px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 800;
}

.onboarding-skip {
  border: 0;
  color: var(--paper-soft-ink);
  background: transparent;
}

.onboarding-skip:hover {
  color: var(--paper-ink);
}

.onboarding-back {
  border: 1px solid rgba(28, 32, 32, 0.16);
  color: var(--paper-ink);
  background: rgba(255, 250, 241, 0.7);
}

.onboarding-back:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.onboarding-next {
  min-width: 104px;
  border: 0;
  color: #1b1513;
  background: var(--coral);
}

.onboarding-next:hover {
  background: #ff8064;
}

html[data-theme="light"] {
  --shadow: 0 24px 70px rgba(42, 38, 32, 0.13);
  background: #e9e5dd;
}

html[data-theme="light"] body {
  color: #202526;
  background:
    radial-gradient(circle at 12% -4%, rgba(102, 113, 255, 0.14), transparent 30rem),
    radial-gradient(circle at 92% 16%, rgba(255, 107, 74, 0.12), transparent 28rem),
    #e9e5dd;
}

html[data-theme="light"] .topbar,
html[data-theme="light"] .footer {
  border-color: rgba(28, 32, 32, 0.15);
}

html[data-theme="light"] .brand {
  color: #202526;
}

html[data-theme="light"] .brand-mark {
  border-color: rgba(28, 32, 32, 0.42);
}

html[data-theme="light"] .brand-mark span {
  background: #202526;
}

html[data-theme="light"] .brand-mark span:nth-child(2),
html[data-theme="light"] .brand-mark span:nth-child(3) {
  background: var(--coral-dark);
}

html[data-theme="light"] .topbar-meta,
html[data-theme="light"] .intro-copy,
html[data-theme="light"] h1 em {
  color: #5a615e;
}

html[data-theme="light"] .privacy-dot {
  background: #3f9155;
  box-shadow: 0 0 0 4px rgba(63, 145, 85, 0.11);
}

html[data-theme="light"] .locale-picker-summary,
html[data-theme="light"] .tour-trigger,
html[data-theme="light"] .theme-picker-summary {
  border-color: rgba(28, 32, 32, 0.18);
  color: #515956;
  background: rgba(255, 255, 255, 0.46);
}

html[data-theme="light"] .locale-picker-summary:hover,
html[data-theme="light"] .locale-picker[open] .locale-picker-summary,
html[data-theme="light"] .tour-trigger:hover,
html[data-theme="light"] .theme-picker-summary:hover,
html[data-theme="light"] .theme-picker[open] .theme-picker-summary {
  border-color: rgba(28, 32, 32, 0.36);
  color: #202526;
  background: rgba(255, 255, 255, 0.8);
}

html[data-theme="light"] .theme-picker-menu {
  border-color: rgba(28, 32, 32, 0.14);
  color: #202526;
  background: rgba(255, 250, 241, 0.98);
  box-shadow: 0 18px 55px rgba(42, 38, 32, 0.2);
}

html[data-theme="light"] .locale-picker-menu {
  border-color: rgba(28, 32, 32, 0.14);
  color: #202526;
  background: rgba(255, 250, 241, 0.98);
  box-shadow: 0 18px 55px rgba(42, 38, 32, 0.2);
}

html[data-theme="light"] .locale-current-code,
html[data-theme="light"] .locale-choice-code {
  border-color: rgba(28, 32, 32, 0.14);
  color: #515956;
  background: rgba(28, 32, 32, 0.04);
}

html[data-theme="light"] .locale-picker-menu button:hover,
html[data-theme="light"] .locale-picker-menu button[aria-pressed="true"] {
  background: rgba(184, 60, 40, 0.1);
}

html[data-theme="light"] .theme-picker-menu button:hover,
html[data-theme="light"] .theme-picker-menu button[aria-pressed="true"] {
  background: rgba(184, 60, 40, 0.1);
}

html[data-theme="light"] .theme-choice-icon {
  border-color: rgba(28, 32, 32, 0.14);
  color: #515956;
  background: rgba(28, 32, 32, 0.04);
}

html[data-theme="light"] .theme-choice-copy small {
  color: #656c68;
}

html[data-theme="light"] .theme-choice-check {
  color: var(--coral-dark);
}

html[data-theme="light"] .workspace-intro .eyebrow,
html[data-theme="light"] .controls-panel .eyebrow {
  color: var(--coral-dark);
}

html[data-theme="light"] .controls-panel {
  color: var(--paper-ink);
  border-color: rgba(28, 32, 32, 0.13);
  background: rgba(255, 250, 241, 0.9);
}

html[data-theme="light"] .step-number {
  border-color: rgba(28, 32, 32, 0.22);
  color: #5b625e;
}

html[data-theme="light"] .dropzone {
  border-color: rgba(28, 32, 32, 0.3);
  color: #5d6561;
  background: rgba(255, 255, 255, 0.28);
}

html[data-theme="light"] .dropzone:hover,
html[data-theme="light"] .dropzone.is-dragging {
  border-color: var(--coral-dark);
  background: rgba(255, 107, 74, 0.08);
}

html[data-theme="light"] .dropzone strong,
html[data-theme="light"] .source-info strong,
html[data-theme="light"] .field-label,
html[data-theme="light"] .ai-helper-title,
html[data-theme="light"] .ai-helper-chevron {
  color: var(--paper-ink);
}

html[data-theme="light"] .ai-helper-chevron {
  border-color: rgba(28, 32, 32, 0.13);
  background: rgba(28, 32, 32, 0.045);
}

html[data-theme="light"] .dropzone small,
html[data-theme="light"] .source-info span,
html[data-theme="light"] .field-note {
  color: #686f6b;
}

html[data-theme="light"] .field-note.is-error,
html[data-theme="light"] .ai-prompt-status.is-error {
  color: #a33b2f;
}

html[data-theme="light"] .source-card {
  border-color: rgba(28, 32, 32, 0.15);
  background: rgba(28, 32, 32, 0.035);
}

html[data-theme="light"] .icon-button {
  color: #646b67;
}

html[data-theme="light"] .ai-helper {
  border-color: rgba(80, 88, 189, 0.3);
  background:
    radial-gradient(circle at 100% 0, rgba(102, 113, 255, 0.14), transparent 13rem),
    rgba(102, 113, 255, 0.055);
}

html[data-theme="light"] .ai-helper-body,
html[data-theme="light"] .ai-prompt-details {
  border-color: rgba(28, 32, 32, 0.12);
}

html[data-theme="light"] .ai-helper-badge {
  border-color: rgba(47, 122, 66, 0.24);
  color: #2f7a42;
  background: rgba(47, 122, 66, 0.07);
}

html[data-theme="light"] .ai-helper-target,
html[data-theme="light"] .ai-prompt-details summary {
  color: #454da7;
}

html[data-theme="light"] .ai-helper-copy,
html[data-theme="light"] .ai-helper-steps {
  color: #4d5551;
}

html[data-theme="light"] .copy-prompt-button {
  color: #fffaf1;
  background: #252a2b;
}

html[data-theme="light"] .copy-prompt-button:hover {
  background: #111516;
}

html[data-theme="light"] .copy-prompt-button.is-copied {
  color: #17331d;
  background: #9bd4a5;
}

html[data-theme="light"] .ai-prompt-details textarea {
  border-color: rgba(28, 32, 32, 0.18);
  color: #252a28;
  background: rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .ai-helper-privacy {
  color: #5c645f;
}

html[data-theme="light"] .ai-prompt-status {
  color: #28743a;
}

html[data-theme="light"] .rule,
html[data-theme="light"] .controls-panel .step-block:last-child {
  border-color: rgba(28, 32, 32, 0.13);
}

html[data-theme="light"] .rule {
  background: rgba(28, 32, 32, 0.13);
}

html[data-theme="light"] .select-control {
  border-color: rgba(28, 32, 32, 0.2);
  background: rgba(255, 255, 255, 0.74);
}

html[data-theme="light"] .select-shell {
  color: var(--paper-ink);
}

html[data-theme="light"] .select-control:hover {
  border-color: rgba(28, 32, 32, 0.4);
}

html[data-theme="light"] .color-presets button,
html[data-theme="light"] .color-number-control {
  border-color: rgba(28, 32, 32, 0.17);
  color: #555d59;
  background: rgba(28, 32, 32, 0.035);
}

html[data-theme="light"] .color-presets button:hover,
html[data-theme="light"] .color-presets button.is-active {
  border-color: var(--coral-dark);
  color: var(--paper-ink);
  background: rgba(255, 107, 74, 0.1);
}

html[data-theme="light"] .control-disclosure,
html[data-theme="light"] .compact-action,
html[data-theme="light"] .segmented-control button {
  border-color: rgba(28, 32, 32, 0.18);
  color: #545b58;
  background: rgba(255, 255, 255, 0.44);
}

html[data-theme="light"] .control-disclosure > summary,
html[data-theme="light"] .choice-fieldset legend,
html[data-theme="light"] .compact-field { color: #303534; }
html[data-theme="light"] .segmented-control button:hover,
html[data-theme="light"] .segmented-control button[aria-pressed="true"] {
  border-color: var(--coral-dark);
  color: #fff;
  background: var(--coral-dark);
}

html[data-theme="light"] .color-number-control input {
  border-color: rgba(28, 32, 32, 0.13);
  color: var(--paper-ink);
  background: rgba(255, 255, 255, 0.78);
}

html[data-theme="light"] .color-guidance,
html[data-theme="light"] .range-scale {
  color: #626965;
}

html[data-theme="light"] .algorithm-note {
  color: #4e5651;
  background: rgba(80, 88, 189, 0.07);
}

html[data-theme="light"] .auto-update-note {
  border-color: rgba(47, 122, 66, 0.2);
  color: #4d5551;
  background: rgba(47, 122, 66, 0.055);
}

html[data-theme="light"] .footer {
  color: #616965;
}

html[data-theme="light"] .seo-guide {
  border-color: rgba(28, 32, 32, 0.13);
  background: rgba(255, 250, 241, 0.72);
}

html[data-theme="light"] .seo-guide-heading,
html[data-theme="light"] .seo-faq {
  border-color: rgba(28, 32, 32, 0.13);
}

html[data-theme="light"] .seo-guide-heading > p,
html[data-theme="light"] .seo-steps p,
html[data-theme="light"] .seo-faq details p {
  color: #59615d;
}

html[data-theme="light"] .seo-steps {
  background: rgba(28, 32, 32, 0.12);
}

html[data-theme="light"] .seo-steps li {
  background: rgba(255, 250, 241, 0.97);
}

html[data-theme="light"] .seo-steps li > span {
  color: var(--coral-dark);
}

html[data-theme="light"] .seo-faq details {
  border-color: rgba(28, 32, 32, 0.14);
  background: rgba(255, 255, 255, 0.5);
}

html[data-theme="light"] .seo-faq summary {
  color: var(--paper-ink);
}

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

@media (max-width: 980px) {
  .app-shell {
    padding-right: 20px;
    padding-left: 20px;
  }

  .workspace {
    padding-top: 38px;
  }

  .workspace-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
  }

  .intro-copy {
    max-width: 510px;
  }

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

  .controls-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .controls-panel .rule {
    display: none;
  }

  .controls-panel .step-block:last-child {
    padding-left: 24px;
    border-left: 1px solid var(--ink-line);
  }

  .pattern-panel {
    min-height: auto;
  }

  .seo-guide {
    margin-top: 48px;
    padding: 30px;
  }

  .seo-guide-heading {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .seo-steps,
  .seo-faq-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 650px) {
  .app-shell {
    padding-top: 0;
    padding-right: max(14px, env(safe-area-inset-right));
    padding-bottom: max(18px, env(safe-area-inset-bottom));
    padding-left: max(14px, env(safe-area-inset-left));
  }

  .topbar {
    min-height: 68px;
  }

  .topbar-meta {
    gap: 8px;
  }

  .privacy-pill {
    padding: 6px 8px;
    border: 1px solid rgba(185, 232, 190, 0.2);
    border-radius: 999px;
    color: var(--mint);
    font-size: 9px;
    line-height: 1;
  }

  .vk-mode-pill {
    min-width: 38px;
    min-height: 38px;
    padding: 0 8px;
  }

  .privacy-label-full,
  .privacy-dot {
    display: none;
  }

  .privacy-label-short {
    display: inline;
  }

  .version-label {
    display: none;
  }

  .tour-trigger {
    width: 38px;
    min-height: 38px;
    padding: 0;
    justify-content: center;
  }

  .tour-trigger-label {
    display: none;
  }

  .tour-trigger-icon {
    width: 22px;
    height: 22px;
  }

  .locale-picker-summary {
    justify-content: center;
    width: 38px;
    min-height: 38px;
    padding: 0;
  }

  .locale-picker-label,
  .locale-picker-chevron {
    display: none;
  }

  .locale-current-code {
    width: 24px;
    height: 24px;
  }

  .locale-picker-menu {
    width: min(224px, calc(100vw - 28px));
  }

  .theme-picker-summary {
    justify-content: center;
    width: 38px;
    min-height: 38px;
    padding: 0;
  }

  .theme-current-icon,
  .theme-icon {
    width: 20px;
    height: 20px;
  }

  .theme-picker-label,
  .theme-picker-chevron {
    display: none;
  }

  .theme-picker-menu {
    width: min(248px, calc(100vw - 28px));
  }

  .onboarding-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 20px;
  }

  .onboarding-shell {
    max-height: calc(100dvh - 16px);
  }

  .onboarding-header {
    padding: 18px 20px 14px;
  }

  .onboarding-stage {
    padding: 16px 20px 10px;
  }

  .onboarding-visual {
    height: 126px;
    margin-bottom: 18px;
  }

  .onboarding-visual svg {
    width: 68px;
    height: 68px;
  }

  .onboarding-step h3 {
    font-size: 1.65rem;
  }

  .onboarding-copy {
    font-size: 15px;
  }

  .onboarding-progress {
    padding: 12px 20px;
  }

  .onboarding-navigation {
    padding: 0 20px 18px;
  }

  .workspace {
    padding-top: 32px;
  }

  h1 {
    font-size: clamp(2.55rem, 14vw, 4rem);
  }

  .controls-panel {
    display: block;
    padding: 22px 18px;
  }

  .controls-panel .step-block:last-child {
    padding-left: 0;
    border-left: 0;
  }

  .controls-panel .rule {
    display: block;
    margin: 24px 0;
  }

  .ai-helper {
    padding: 0;
  }

  .ai-helper-summary {
    min-height: 72px;
    padding: 13px 14px;
  }

  .ai-helper-body {
    margin-right: 14px;
    margin-left: 14px;
  }

  .copy-prompt-button {
    min-height: 48px;
    font-size: 14px;
  }

  .ai-prompt-details textarea {
    min-height: 230px;
    font-size: 12px;
  }

  .pattern-panel {
    padding: 22px 16px;
    border-radius: 18px;
  }

  .pattern-header {
    flex-direction: column;
    gap: 13px;
    margin-bottom: 20px;
  }

  .pattern-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    margin: 0 -6px;
    padding: 10px 8px 12px;
    border: 1px solid rgba(28, 32, 32, 0.12);
    border-radius: 12px;
    background: rgba(244, 238, 228, 0.96);
    box-shadow: 0 8px 24px rgba(28, 32, 32, 0.08);
    backdrop-filter: blur(10px);
  }

  .pattern-toolbar-actions {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
  }

  .view-button,
  .zoom-button {
    min-height: 44px;
  }

  .zoom-button {
    min-width: 44px;
  }

  .zoom-value {
    min-width: 96px;
  }

  .display-options {
    width: auto;
  }

  .check-control {
    min-height: 44px;
  }

  .empty-state {
    min-height: 420px;
  }

  .canvas-shell {
    height: min(64vh, 520px);
    min-height: 280px;
    padding: 8px;
  }

  .canvas-hint {
    flex-direction: column;
    gap: 4px;
    font-size: 10px;
  }

  .pattern-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .secondary-button--pdf {
    grid-column: 1 / -1;
  }

  .square-badge {
    margin-left: 0;
  }

  .secondary-button {
    min-width: 0;
    min-height: 48px;
    padding: 0 10px;
    font-size: 14px;
  }

  .pattern-meta {
    flex-wrap: wrap;
    gap: 8px 12px;
  }

  .export-status {
    margin-top: -16px;
    font-size: 13px;
  }

  .legend-list {
    grid-template-columns: 1fr;
  }

  .legend-name {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .mobile-result-bar:not(.is-hidden) {
    position: fixed;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 66px;
    padding: 10px 12px 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 16px;
    color: var(--paper);
    background: rgba(24, 29, 30, 0.96);
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(12px);
  }

  .mobile-result-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
    text-align: left;
  }

  .mobile-result-copy small {
    color: var(--mint);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 0.12em;
  }

  .mobile-result-copy strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-result-action {
    flex: 0 0 auto;
    padding: 10px 12px;
    border-radius: 10px;
    color: #171b1c;
    background: var(--coral);
    font-size: 12px;
    font-weight: 850;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
    font-size: 9px;
  }

  .editor-toolbar {
    grid-template-columns: 1fr;
  }

  .editor-tools {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .editor-color {
    min-width: 0;
  }

  .editor-color select {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .editor-history {
    justify-content: flex-end;
  }

  .pattern-insights {
    grid-template-columns: 1fr;
  }

  .pattern-insights article {
    min-height: 0;
  }
}

@media (max-width: 650px) and (min-height: 700px) {
  .pattern-toolbar {
    position: sticky;
    top: max(8px, env(safe-area-inset-top));
    z-index: 5;
  }
}

@media (max-width: 380px) {
  .privacy-pill {
    display: none;
  }

  .onboarding-header {
    gap: 10px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .onboarding-header > div {
    min-width: 0;
  }

  .onboarding-header h2 {
    font-size: 15px;
    line-height: 1.15;
  }

  .onboarding-close {
    width: 36px;
    height: 36px;
  }

  .onboarding-stage,
  .onboarding-progress {
    padding-right: 16px;
    padding-left: 16px;
  }

  .onboarding-navigation {
    gap: 8px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .onboarding-nav-actions {
    gap: 7px;
  }

  .onboarding-visual-label {
    right: 12px;
    font-size: 8px;
  }

  .onboarding-skip,
  .onboarding-back,
  .onboarding-next {
    padding-right: 8px;
    padding-left: 8px;
    font-size: 12px;
  }

  .onboarding-next {
    min-width: 90px;
  }

  .ai-helper-summary {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "badge chevron"
      "title chevron"
      "target target";
    gap: 8px 12px;
  }

  .ai-helper-target {
    justify-self: start;
    text-align: left;
  }

  .ai-helper-chevron {
    align-self: center;
  }

  .color-choice-row {
    grid-template-columns: 1fr;
  }

  .color-number-control {
    grid-template-columns: 1fr 70px;
  }

  .color-number-control input {
    width: 70px;
  }

  .pattern-actions {
    grid-template-columns: 1fr;
  }

  .secondary-button--pdf {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .onboarding-step.is-active {
    animation: none;
  }

  .theme-picker-chevron,
  .theme-picker-summary,
  .locale-picker-chevron,
  .locale-picker-summary,
  .locale-picker-menu button,
  .theme-picker-menu button {
    transition: none;
  }
}
