/* ============================================================
   THEME SYSTEM (Light / Dark)
   ============================================================ */
:root,
[data-theme="light"] {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --panel-soft: #f9fafb;
  --text: #0b1020;
  --muted: #4b5563;
  --muted-2: #6b7280;

  /* friendly teal */
  --primary: #14b8a6;
  --primary-hover: #0d9488;
  --primary-active: #0f766e;

  /* accent for future donate/support buttons */
  --accent-donate: #f59e0b;
  --accent-donate-hover: #d97706;

  --ok: #10b981;
  --ok-hover: #059669;
  --violet: #8b5cf6;
  --violet-hover: #7c3aed;

  --border: #e5e7eb;
  --ring: rgba(20, 184, 166, 0.35);
  --input: #f3f4f6;
  --shadow: 0 8px 24px rgba(2, 6, 23, 0.08);
}

[data-theme="dark"] {
  --bg: #0b0f1a;
  --panel: #111827;
  --panel-soft: #0f1626;
  --text: #e5e7eb;
  --muted: #cbd5e1;
  --muted-2: #94a3b8;

  --primary: #14b8a6;
  --primary-hover: #0d9488;
  --primary-active: #0f766e;

  --accent-donate: #f59e0b;
  --accent-donate-hover: #d97706;

  --ok: #10b981;
  --ok-hover: #059669;
  --violet: #8b5cf6;
  --violet-hover: #7c3aed;

  --border: #243047;
  --ring: rgba(20, 184, 166, 0.45);
  --input: #0f1626;
  --shadow: 0 12px 28px rgba(2, 6, 23, 0.35);
}

/* ============================================================
   GLOBAL
   ============================================================ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, Segoe UI, Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

h1, h2, h3 { margin: 0 0 .35rem; font-weight: 700; }
h2 { font-size: 1.25rem; line-height: 1.35; }

/* главный контейнер генератора */
#barcode-generator {
  max-width: 800px;
  margin: 20px auto 28px;
  color: var(--text);
  padding: 0px 12px 0; /* добавили воздушность сверху */
  text-align: center;
}

/* панель */
.panel {
  background: var(--panel);
  padding: 20px;
  border-radius: 14px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-align: left;
}

.sub {
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

/* вкладки */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* preview box */
#barcode-generator [id$="_box"] {
  min-height: 280px;
  background: var(--panel-soft);
  border-radius: 12px;
  border: 1px solid var(--border);
}
#barcode-generator [id$="_box"] svg {
  width: 100%;
  height: 240px;
  display: block;
}
#barcode-generator [id$="_box"] svg,
#barcode-generator [id$="_box"] canvas {
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

/* ============================================================
   INPUTS & SELECTS
   ============================================================ */
input, select {
  width: 100%;
  background: var(--input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
input::placeholder { color: var(--muted-2); }
input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 6px var(--ring);
}

/* ============================================================
   BUTTONS — премиальный стиль
   ============================================================ */
button {
  appearance: none;
  border: none;
  outline: none;
  cursor: pointer;
  min-height: 46px;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  font-family: inherit;
  line-height: 1.2;
  color: #fff;
  background: var(--primary);
  transition: all .22s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
}
button:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, .12);
}
button:active {
  background: var(--primary-active);
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
}
button:disabled {
  background: var(--panel-soft);
  color: var(--muted-2);
  border: 1px solid var(--border);
  cursor: not-allowed;
  opacity: 1;
  box-shadow: none;
}
button:disabled:hover,
button:disabled:active {
  background: var(--panel-soft);
  color: var(--muted-2);
  transform: none;
  box-shadow: none;
}

/* центровка кнопки Generate */
.tab-content button.mt {
  display: block;
  margin: 16px auto;
}

/* варианты на будущее */
.share-btn { background: var(--ok); }
.share-btn:hover { background: var(--ok-hover); }
.share-pdf-btn { background: var(--violet); }
.share-pdf-btn:hover { background: var(--violet-hover); }

/* ============================================================
   BOXES, ERRORS, SPACING
   ============================================================ */
.mt { margin-top: 10px; }
.mb { margin-bottom: 10px; }

.box {
  margin-top: 12px;
  background: var(--panel-soft);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.err {
  color: #fca5a5;
  font-size: 13px;
  margin: 6px 0 0;
}

/* ============================================================
   DOWNLOAD BUTTONS GROUP
   ============================================================ */
.download-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}
.download-buttons button {
  min-width: 160px;
  text-align: center;
  background: var(--panel-soft);
  color: var(--muted-2);
  border: 1px solid var(--border);
  box-shadow: none;
}
.download-buttons button:hover {
  background: var(--primary-hover);
  color: #fff;
  border-color: var(--primary-hover);
  box-shadow: 0 6px 12px rgba(0, 0, 0, .12);
}
.download-buttons button:active {
  background: var(--primary-active);
  color: #fff;
  border-color: var(--primary-active);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
}

.tool-input-hint {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
}

.theme-emoji { transition: transform .25s ease; }
[data-theme="dark"] .theme-emoji { transform: rotate(20deg) scale(1.05); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .tab-content { padding: 15px; }
  .download-buttons { flex-direction: column; }
  .download-buttons button {
    width: 100%;
    font-size: 16px;
    padding: 16px 20px;
    border-radius: 12px;
  }
  select, input {
    font-size: 18px;
    min-height: 56px;
  }
  h2 { font-size: 20px; }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 14px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.site-brand img {
  width: 42px;
  height: 42px;
  display: block;
}

.site-brand-text {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

#themeToggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  background: #1f2937;
  color: #fff;
  border: 0;
  box-shadow: none;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  letter-spacing: .1px;
  transition: all .25s ease;
}

#themeToggle:hover {
  background: #111827;
  transform: none;
  box-shadow: none;
}

#themeToggle:active {
  background: #0f172a;
  transform: none;
  box-shadow: none;
}

.tool-stage {
  padding: 14px 0 28px;
}

#barcode-generator {
  margin-top: 0;
}

.page-content {
  background: var(--panel);
  border-top: 1px solid var(--border);
}

.content-shell {
  max-width: 700px;
  margin: 0 auto;
  padding: 24px 12px 18px;
}

.content-shell h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.15;
  margin-bottom: 16px;
}

.content-shell h2 {
  margin-top: 26px;
  margin-bottom: 12px;
  font-size: 20px;
}

.content-shell p,
.content-shell li {
  color: var(--text);
  line-height: 1.7;
}

.content-shell p {
  margin: 0 0 18px;
}

.content-list {
  margin: 0 0 28px;
  padding-left: 22px;
}

.content-list li + li {
  margin-top: 12px;
}

.bookmark-box {
  max-width: 680px;
  margin: 30px auto 20px auto;
  padding: 14px 20px;
  text-align: center;
  border-radius: 10px;
  transition: all .3s ease;
}

.bookmark-copy {
  margin-bottom: 10px;
  font-size: 15px;
}

.bookmark-box p {
  color: inherit;
}

#bookmarkBtn {
  background: #14b8a6;
  color: #fff;
  border: none;
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .3s ease;
  box-shadow: none;
}

#bookmarkMsg {
  margin-top: 8px;
  font-size: 13px;
  color: inherit;
  display: none;
}

body.is-light .bookmark-box {
  background: #f7fdfa;
  border: 1px solid #c8f4ec;
  color: #064e3b;
}

body.is-dark .bookmark-box {
  background: rgba(20,184,166,0.06);
  border: 1px solid #14b8a6;
  color: #e6fffa;
}

body.is-dark #bookmarkBtn:hover,
body.is-light #bookmarkBtn:hover {
  background: #0d9488;
  transform: none;
  box-shadow: none;
}

.share-buttons {
  text-align: center;
  margin: 40px 0;
}

.share-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  transition: color 0.3s ease;
}

body.is-light .share-title {
  color: #0b1020 !important;
}

body.is-dark .share-title {
  color: #e5e7eb !important;
}

.share-icons {
  display: inline-flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.share-icons img {
  filter: invert(0);
  transition: filter 0.25s ease, transform 0.25s ease;
}

body.is-dark .share-icons img {
  filter: invert(1);
}

.share-icons a:hover img {
  transform: scale(1.15);
  filter: invert(44%) sepia(95%) saturate(356%) hue-rotate(125deg) brightness(90%) contrast(92%);
}

.page-footer {
  max-width: none;
  margin: 0;
  padding: 18px 12px 34px;
  background: var(--panel);
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted-2);
}

.page-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin: 0 0 10px;
}

.page-footer-nav a {
  color: var(--muted-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

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

.page-footer p {
  margin: 0;
  font-size: 14px;
}

body.page-terms .content-shell,
body.page-privacy .content-shell,
body.page-refund-policy .content-shell {
  padding-top: 40px;
}

body.page-terms .content-shell a[href^="mailto:"],
body.page-privacy .content-shell a[href^="mailto:"],
body.page-refund-policy .content-shell a[href^="mailto:"] {
  display: inline-flex;
  align-items: center;
  color: #fff;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 2px 10px;
  font-weight: 600;
  text-decoration: none;
  transition: color .2s ease, border-color .2s ease, text-decoration-color .2s ease, background .2s ease;
}

body.page-terms .content-shell a[href^="mailto:"]:hover,
body.page-privacy .content-shell a[href^="mailto:"]:hover,
body.page-refund-policy .content-shell a[href^="mailto:"]:hover {
  color: #fff;
  background: #0f172a;
  border-color: rgba(20, 184, 166, 0.35);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

@media (max-width: 768px) {
  .site-header-inner {
    padding: 12px;
  }

  .site-brand img {
    width: 36px;
    height: 36px;
  }

  .site-brand-text {
    font-size: 16px;
  }

  #themeToggle {
    padding: 10px 14px;
    font-size: 14px;
  }

  .content-shell {
    padding-top: 24px;
  }

  .content-shell h1 {
    font-size: 2rem;
  }

  .share-icons {
    gap: 14px;
  }
}

.task-page-shell {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 12px;
}

.home-intro,
.page-intro {
  max-width: 800px;
  margin: 0 auto 14px;
  text-align: left;
}

.home-intro h1,
.page-intro h1 {
  font-size: clamp(2rem, 3.5vw, 2.7rem);
  line-height: 1.12;
  margin-bottom: 12px;
}

.home-intro p,
.page-intro p {
  max-width: 700px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.mode-switch {
  margin: 0 auto 20px;
  text-align: left;
}

.mode-switch-label {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

.mode-switch-nav {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px;
  border-radius: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  box-shadow: none;
}

.mode-switch-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  transition: background .2s ease, color .2s ease;
}

.mode-switch-link:hover {
  background: var(--panel-soft);
  color: var(--text);
}

.mode-switch-link[aria-current="page"] {
  background: var(--panel);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border);
}

.next-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.quiet-card {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  box-shadow: none;
  text-align: left;
}

.quiet-card h3 {
  font-size: 17px;
  margin-bottom: 6px;
  line-height: 1.35;
}

.quiet-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.content-link-panel {
  margin: 0 0 26px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-soft);
}

.content-link-panel--compact {
  padding: 16px;
}

.content-link-panel h2 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.35;
}

.content-link-panel p {
  margin: 0 0 14px;
  color: var(--muted);
}

.content-link-label {
  margin: 0 0 8px !important;
  color: var(--text) !important;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

.content-link-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
}

.content-link-nav .mode-switch-link {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
}

.content-link-nav .mode-switch-link:hover {
  background: var(--input);
  color: var(--text);
}

.faq-block {
  margin: 0 0 26px;
}

.faq-list {
  display: grid;
  gap: 14px;
}

.faq-item {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-soft);
}

.faq-question {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.4;
}

.faq-answer {
  margin: 0 !important;
  color: var(--muted);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}

.button-link--secondary {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
}

.button-link--secondary:hover {
  background: var(--input);
  color: var(--text);
}

.primary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 22px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

.primary-cta:disabled {
  background: var(--panel-soft);
  color: var(--muted-2);
  border: 1px solid var(--border);
  opacity: 1;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.form-panel,
.status-panel,
.pro-panel {
  max-width: 800px;
}

.status-panel,
.pro-panel {
  box-shadow: none;
}

.pro-panel {
  background: var(--panel-soft);
}

.field-group + .field-group {
  margin-top: 18px;
}

.panel > h2 {
  font-size: clamp(1.24rem, 2vw, 1.4rem);
  line-height: 1.3;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

.field-help,
.file-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  max-width: 56ch;
}

.file-note {
  min-height: 1.6em;
}

.bulk-source-panel {
  margin-top: 14px;
}

.inline-suggestion {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-soft);
}

.inline-suggestion-copy {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.inline-suggestion-button {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: none;
}

.inline-suggestion-button:hover,
.inline-suggestion-button:active {
  background: var(--input);
  color: var(--text);
  transform: none;
  box-shadow: none;
}

.upload-followup-step {
  margin: 16px 0 12px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--border) 55%, var(--primary) 45%);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel-soft) 75%, var(--panel) 25%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--panel) 55%, transparent);
}

.upload-followup-step-title,
.upload-followup-step-copy {
  margin: 0;
}

.upload-followup-step-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.upload-followup-step-copy {
  margin-top: 4px;
  color: color-mix(in srgb, var(--text) 78%, var(--muted) 22%);
  font-size: 14px;
  line-height: 1.55;
}

.upload-followup-step + .field-group {
  margin-top: 10px;
}

.file-trigger {
  cursor: pointer;
}

.file-trigger input {
  display: none;
}

textarea {
  width: 100%;
  background: var(--input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

textarea::placeholder {
  color: var(--muted-2);
}

textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 6px var(--ring);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.choice-grid--compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice-grid--single {
  grid-template-columns: minmax(0, 220px);
}

.choice-item {
  display: block;
  position: relative;
}

.choice-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 12px;
  border-radius: 12px;
  background: var(--input);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.choice-item input:checked + .choice-card {
  background: var(--panel);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.14);
}

.advanced-panel {
  margin-top: 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: transparent;
  overflow: hidden;
}

.advanced-panel-title {
  padding: 14px 16px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

.advanced-panel--static {
  background: var(--panel-soft);
}

.advanced-panel summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  color: var(--muted);
  font-weight: 600;
}

.advanced-panel summary::-webkit-details-marker {
  display: none;
}

.advanced-panel summary::after {
  content: "+";
  color: var(--muted-2);
  font-size: 18px;
  line-height: 1;
}

.advanced-panel[open] {
  background: var(--panel-soft);
}

.advanced-panel[open] summary {
  color: var(--text);
}

.advanced-panel[open] summary::after {
  content: "−";
}

.advanced-body {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.advanced-panel--static .advanced-body {
  border-top: 1px solid var(--border);
}

.range-control {
  display: grid;
  gap: 10px;
}

.range-control input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.range-value {
  margin-top: 0;
}

.advanced-panel + button {
  margin-top: 22px;
}

.status-kicker {
  margin: 0 0 8px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.status-panel h2,
.pro-panel h2 {
  margin-bottom: 8px;
  font-size: clamp(1.24rem, 2vw, 1.4rem);
  line-height: 1.3;
}

.status-panel p:not(.status-kicker),
.pro-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  max-width: 58ch;
}

.status-meta {
  margin-top: 12px !important;
}

.status-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.status-list li + li {
  margin-top: 6px;
}

.sheet-preview {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.sheet-preview h3 {
  margin: 0 0 6px;
  font-size: 17px;
  line-height: 1.35;
}

.sheet-preview p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.6;
}

.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.preview-actions button {
  width: 220px;
  max-width: 100%;
}

.preview-cta {
  min-width: 170px;
}

.next-step-hint {
  margin: 14px 0 0;
  max-width: 40ch;
  font-size: 15px !important;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
}

.next-step-hint + .primary-cta {
  margin-top: 14px;
}

.sheet-preview img {
  display: block;
  width: min(100%, 460px);
  height: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.action-row button {
  min-width: 170px;
}

body.unlock-modal-open {
  overflow: hidden;
}

button.secondary-action {
  background: var(--panel-soft);
  color: var(--muted-2);
  border: 1px solid var(--border);
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: none;
}

button.secondary-action:hover,
button.secondary-action:active {
  background: var(--panel-soft);
  color: var(--muted-2);
  transform: none;
  box-shadow: none;
}

button.secondary-action:disabled {
  background: var(--panel-soft);
  color: var(--muted-2);
  border: 1px solid var(--border);
  opacity: 1;
  box-shadow: none;
}

button.ghost-action {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: none;
}

button.ghost-action:hover,
button.ghost-action:active {
  background: var(--panel-soft);
  color: var(--text);
  transform: none;
  box-shadow: none;
}

.unlock-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px 12px;
}

.unlock-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 16, 32, 0.54);
}

.unlock-modal__dialog {
  position: relative;
  width: min(100%, 520px);
  padding: 22px 20px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.22);
}

.unlock-modal__kicker {
  margin-bottom: 10px;
}

.unlock-modal__title {
  margin: 0 0 8px;
  font-size: clamp(1.28rem, 2vw, 1.45rem);
  line-height: 1.3;
}

.unlock-modal__copy {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.unlock-modal__current-plan {
  margin: 10px 0 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.pricing-grid {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.pricing-card {
  padding: 16px 16px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-soft);
}

.pricing-card--featured {
  background: var(--panel);
}

.pricing-card--active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}

.pricing-card__eyebrow,
.pricing-card__meta {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.pricing-card__eyebrow {
  color: var(--muted-2);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.pricing-card__name {
  margin: 8px 0 4px;
  font-size: 18px;
  line-height: 1.3;
}

.pricing-card__price {
  margin: 0;
  color: var(--text);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
}

.pricing-card__price span {
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
}

.pricing-card__list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.pricing-card__meta {
  margin-top: 12px;
  color: var(--text);
  font-weight: 600;
  min-height: 1.45em;
}

.pricing-card__button {
  margin-top: 14px;
  width: 100%;
}

.unlock-license {
  margin-top: 14px;
}

.unlock-license__toggle {
  width: 100%;
}

.unlock-license__panel {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-soft);
}

.unlock-license__actions {
  margin-top: 14px;
  padding-top: 0;
  border-top: 0;
}

.unlock-modal__status {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
}

.unlock-modal__status[data-tone="success"] {
  color: var(--text);
}

.unlock-modal__status[data-tone="info"] {
  color: var(--text);
}

.unlock-modal__status[data-tone="error"] {
  color: #f87171;
}

.unlock-modal__actions {
  margin-top: 18px;
}

.source-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.source-switch-button {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--panel-soft);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: none;
}

.source-switch-button:hover,
.source-switch-button:active {
  background: var(--input);
  color: var(--text);
  transform: none;
  box-shadow: none;
}

.source-switch-button.is-active {
  background: var(--panel);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.14);
}

.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;
}

.content-shell h2:first-child {
  margin-top: 0;
}

.form-panel > .primary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
  width: 220px;
  max-width: 100%;
}

.page-labels #labelsPreview {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.page-labels #labelsPreview img {
  margin-left: auto;
  margin-right: auto;
}

.page-labels .preview-actions,
.page-labels #labelsResult .action-row {
  justify-content: center;
}

.page-labels #labelsNextStep,
.page-labels #labelsResult,
.page-labels .pro-panel {
  text-align: center;
}

.page-labels #labelsNextStep,
.page-labels #labelsResult p,
.page-labels .pro-panel p {
  margin-left: auto;
  margin-right: auto;
}

.page-labels #labelsCreateBtn,
.page-labels .pro-panel > button:last-child {
  display: flex;
  margin-left: auto;
  margin-right: auto;
}

.page-labels #labelsResult .status-list {
  max-width: 48ch;
  margin-left: auto;
  margin-right: auto;
  padding-left: 0;
  list-style: none;
  text-align: center;
}

.page-labels #labelsResult .status-meta {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
}

.page-labels #labelsResult .status-list li {
  line-height: 1.6;
}

.page-labels #labelsResult .status-list li + li {
  margin-top: 8px;
}

.pro-panel > button:last-child {
  margin-top: 16px;
}

@media (max-width: 768px) {
  .task-page-shell {
    padding: 0 12px;
  }

  .mode-switch-nav {
    width: 100%;
  }

  .mode-switch-link {
    flex: 1 1 calc(50% - 8px);
  }

  .next-steps {
    grid-template-columns: 1fr;
  }

  .choice-grid,
  .choice-grid--compact {
    grid-template-columns: 1fr;
  }

  textarea {
    font-size: 18px;
    min-height: 180px;
  }

  .action-row {
    flex-direction: column;
  }

  .action-row button,
  .button-link,
  .preview-actions button,
  .form-panel > .primary-cta {
    width: 100%;
  }

  .source-switch {
    width: 100%;
  }

  .source-switch-button {
    flex: 1 1 100%;
  }

  .inline-suggestion {
    align-items: stretch;
  }

  .inline-suggestion-button {
    width: 100%;
  }
}
