:root {
  --bg: #f4f5f2;
  --surface: #fffefa;
  --surface-2: #eef2ee;
  --surface-3: #e8eee7;
  --ink: #1d2420;
  --muted: #637069;
  --line: #d8ded5;
  --line-strong: #c6cec4;
  --red: #c63d32;
  --red-dark: #9d3029;
  --green: #19764f;
  --teal: #126b72;
  --amber: #a96719;
  --charcoal: #202721;
  --shadow: 0 18px 45px rgba(29, 36, 32, 0.1);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

.boot-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.boot-card {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid var(--surface-3);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.noscript {
  margin: 0;
  padding: 14px;
  background: #fff7e8;
  color: #6f4410;
  text-align: center;
}

.site-shell {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 245, 242, 0.94);
  backdrop-filter: blur(14px);
}

.header-inner,
.hero,
.content-inner,
.footer-inner {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

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

.brand-mark {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: var(--radius);
  background: var(--red);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12);
}

.brand-mark::before {
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid #fff;
  content: "";
}

.brand-text strong,
.footer-brand strong {
  display: block;
  font-size: 17px;
  line-height: 1.05;
}

.brand-text span,
.footer-brand span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.nav-link,
.footer-link {
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 750;
  text-decoration: none;
}

.nav-link {
  padding: 9px 11px;
  font-size: 14px;
}

.nav-link:hover,
.nav-link.active {
  background: var(--surface-2);
  color: var(--ink);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(390px, 1.05fr);
  gap: 30px;
  align-items: stretch;
  padding: 42px 0 24px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  color: var(--red-dark);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  content: "";
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

.hero h1,
.page-hero h1 {
  max-width: 760px;
  margin: 14px 0 16px;
  font-size: 54px;
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-lede,
.page-hero p {
  max-width: 700px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.trust-pill {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.trust-pill svg,
.button svg,
.icon-button svg,
.segment-button svg,
.meta-item svg,
.result-note svg,
.editor-note svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.tool-panel,
.preview-panel,
.content-card,
.contact-panel,
.legal-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(29, 36, 32, 0.06);
}

.tool-panel {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 18px;
}

.tool-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.tool-heading h2,
.section-heading h2,
.content-card h3,
.contact-panel h2,
.legal-panel h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.tool-heading p,
.section-heading p,
.content-card p,
.contact-panel p,
.legal-panel p,
.quality-subtitle,
.empty-preview p,
.result-note {
  color: var(--muted);
  line-height: 1.55;
}

.tool-heading p,
.section-heading p,
.contact-panel p,
.legal-panel p {
  margin: 7px 0 0;
}

.status-chip {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: #e5f3ec;
  color: #146541;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.download-form {
  display: grid;
  gap: 12px;
}

.field-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.url-input,
.form-input,
.form-textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

.url-input {
  min-height: 52px;
  padding: 0 14px;
  font-weight: 650;
}

.form-input {
  min-height: 46px;
  padding: 0 12px;
}

.form-textarea {
  min-height: 138px;
  resize: vertical;
  padding: 12px;
}

.url-input:focus,
.form-input:focus,
.form-textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(18, 107, 114, 0.14);
}

.button,
.icon-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.button {
  padding: 0 15px;
}

.button.primary {
  border-color: var(--red-dark);
  background: var(--red);
  color: #fff;
}

.button.secondary {
  background: var(--surface-2);
}

.button.ghost {
  background: transparent;
}

.button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button:not(:disabled):hover,
.icon-button:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(29, 36, 32, 0.08);
}

.icon-button {
  width: 42px;
  padding: 0;
}

.result-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 42px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.result-note.good {
  border-color: #b7dec8;
  background: #eef9f2;
  color: #155f3d;
}

.result-note.error {
  border-color: #edc2bd;
  background: #fff1ef;
  color: #8e2c25;
}

.quality-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quality-button {
  display: grid;
  gap: 7px;
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.quality-button:hover,
.quality-button.active {
  border-color: var(--teal);
  background: #edf7f6;
}

.quality-button.unavailable {
  background: #f6f6f3;
  color: var(--muted);
}

.quality-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 850;
}

.quality-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.quality-status.available {
  color: var(--green);
}

.quality-status.unavailable {
  color: var(--amber);
}

.quality-subtitle {
  margin: 0;
  font-size: 13px;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.preview-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.preview-frame {
  position: relative;
  display: grid;
  min-height: 280px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #202721;
  aspect-ratio: 16 / 9;
}

.thumbnail-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #111613;
}

.empty-preview {
  display: grid;
  width: min(420px, calc(100% - 36px));
  place-items: center;
  gap: 12px;
  color: #f7fbf5;
  text-align: center;
}

.empty-visual {
  display: grid;
  width: 132px;
  height: 82px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.32);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    #2b342e;
  background-size: 22px 22px;
}

.empty-visual svg {
  width: 34px;
  height: 34px;
}

.empty-preview strong {
  display: block;
  font-size: 18px;
}

.empty-preview p {
  margin: 0;
  color: rgba(247, 251, 245, 0.72);
}

.preview-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.meta-item {
  display: grid;
  min-height: 82px;
  align-content: center;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.meta-item span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.meta-item strong {
  font-size: 18px;
  line-height: 1.15;
}

.ad-slot {
  display: grid;
  min-height: 92px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: #f8f8f5;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

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

.editor-panel,
.canvas-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(29, 36, 32, 0.06);
}

.editor-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.editor-group {
  display: grid;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.editor-group h3 {
  margin: 0;
  font-size: 16px;
}

.muted-group {
  background: var(--surface-2);
}

.mini-help,
.editor-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

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

.segment-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 850;
}

.segment-button.active {
  border-color: var(--teal);
  background: #e7f5f3;
  color: var(--teal);
}

.segment-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.compact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.color-input {
  width: 100%;
  min-height: 46px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #ffffff;
}

.color-input.wide {
  max-width: 180px;
}

.switch-inline {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.switch-inline input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.preset-grid {
  display: grid;
  gap: 8px;
}

.preset-button,
.layer-button {
  display: grid;
  width: 100%;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink);
  text-align: left;
}

.preset-button {
  padding: 10px;
}

.preset-button strong,
.layer-button span {
  font-size: 14px;
  line-height: 1.25;
}

.preset-button span,
.layer-button small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.preset-button.active,
.layer-button.active {
  border-color: var(--teal);
  background: #e7f5f3;
  box-shadow: inset 4px 0 0 var(--teal);
}

.layer-list {
  display: grid;
  gap: 7px;
}

.layer-button {
  padding: 9px 10px;
}

.actions-row.tight {
  gap: 7px;
}

.actions-row.tight .button {
  min-height: 38px;
  padding: 0 11px;
  font-size: 13px;
}

.canvas-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 16px;
}

.canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.canvas-wrap {
  display: grid;
  min-height: 360px;
  overflow: auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(45deg, rgba(255,255,255,0.08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.08) 25%, transparent 25%),
    #202721;
  background-size: 28px 28px;
}

.editor-canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  cursor: crosshair;
  user-select: none;
  touch-action: none;
}

.editor-empty {
  display: grid;
  width: min(420px, calc(100% - 36px));
  place-items: center;
  gap: 12px;
  padding: 26px;
  color: #f7fbf5;
  text-align: center;
}

.editor-empty strong {
  font-size: 18px;
}

.editor-empty p {
  margin: 0;
  color: rgba(247, 251, 245, 0.72);
}

.editor-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.content-section {
  padding: 28px 0;
}

.content-section.compact {
  padding-top: 12px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.section-heading p {
  max-width: 740px;
}

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

.content-card {
  padding: 18px;
}

.content-card h3 {
  font-size: 18px;
}

.content-card p {
  margin: 9px 0 0;
}

.guide-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

thead th {
  border-top: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

td {
  line-height: 1.5;
}

.page-hero {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.page-hero .content-inner {
  padding: 46px 0 38px;
}

.page-layout {
  display: grid;
  gap: 18px;
  padding: 28px 0 38px;
}

.legal-panel,
.contact-panel {
  padding: 22px;
}

.legal-panel h2 + p,
.contact-panel h2 + p {
  margin-top: 10px;
}

.legal-list {
  display: grid;
  gap: 13px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.legal-list li {
  padding-left: 16px;
  border-left: 3px solid var(--teal);
  color: var(--muted);
  line-height: 1.55;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(380px, 1.2fr);
  gap: 18px;
}

.contact-form {
  display: grid;
  gap: 14px;
}

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

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

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.faq-item summary {
  cursor: pointer;
  padding: 16px 18px;
  font-weight: 850;
}

.faq-item p {
  margin: 0;
  padding: 0 18px 18px;
  color: var(--muted);
  line-height: 1.55;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr) minmax(220px, 0.6fr);
  gap: 28px;
  padding: 30px 0;
}

.footer-copy {
  max-width: 480px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.footer-column h2 {
  margin: 0 0 12px;
  font-size: 14px;
  text-transform: uppercase;
}

.footer-links {
  display: grid;
  gap: 9px;
}

.footer-link {
  width: fit-content;
  padding: 4px 0;
}

.footer-link:hover {
  color: var(--red-dark);
}

.footer-small {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
}

.toast {
  padding: 13px 14px;
  border: 1px solid #b7dec8;
  border-radius: var(--radius);
  background: #eef9f2;
  box-shadow: var(--shadow);
  color: #155f3d;
  font-weight: 850;
}

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

@media (max-width: 980px) {
  .hero,
  .contact-grid,
  .editor-layout,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 30px;
  }

  .hero h1,
  .page-hero h1 {
    font-size: 42px;
  }

  .content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 12px 0;
  }

  .nav-list {
    justify-content: flex-start;
  }

  .hero h1,
  .page-hero h1 {
    font-size: 34px;
  }

  .hero-lede,
  .page-hero p {
    font-size: 16px;
  }

  .input-row,
  .quality-grid,
  .preview-meta,
  .content-grid,
  .form-grid,
  .compact-grid {
    grid-template-columns: 1fr;
  }

  .input-row .button {
    width: 100%;
  }

  .preview-frame {
    min-height: 210px;
  }

  .canvas-wrap {
    min-height: 240px;
  }

  .segmented-control {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  th,
  td {
    padding: 12px;
  }
}

@media (max-width: 440px) {
  .header-inner,
  .hero,
  .content-inner,
  .footer-inner {
    width: min(100% - 24px, 1180px);
  }

  .actions-row .button {
    width: 100%;
  }
}

/* TubeWax professional editor */
.compact-hero {
  grid-template-columns: minmax(0, 0.78fr) minmax(440px, 1.22fr);
  padding-bottom: 18px;
}

.start-panel {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(29, 36, 32, 0.06);
}

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

.compact-quality .quality-button {
  min-height: 74px;
}

.import-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.import-card {
  display: flex;
  min-height: 74px;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.import-card svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.import-card strong,
.import-card small {
  display: block;
}

.import-card small {
  margin-top: 2px;
  color: var(--muted);
}

.disabled-link {
  pointer-events: none;
  opacity: 0.55;
}

.editor-workspace-section {
  width: min(1440px, calc(100% - 28px));
  margin: 10px auto 28px;
}

.editor-app {
  display: grid;
  min-height: 720px;
  grid-template-columns: 82px minmax(280px, 340px) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #202721;
  box-shadow: var(--shadow);
}

.editor-left {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: #161c18;
}

.editor-tabs {
  display: grid;
  gap: 5px;
  padding: 10px 8px;
}

.editor-tab {
  display: grid;
  min-height: 62px;
  place-items: center;
  gap: 4px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: rgba(247, 251, 245, 0.68);
  font-size: 11px;
  font-weight: 850;
}

.editor-tab svg,
.segment-button svg,
.element-button svg,
.editor-bottom-status svg,
.editor-topbar svg,
.ai-placeholder svg,
.tool-list svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.editor-tab:hover,
.editor-tab.active {
  background: #29332d;
  color: #ffffff;
}

.editor-inspector {
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: #f7f8f4;
}

.inspector-group {
  display: grid;
  gap: 13px;
  padding: 16px;
}

.inspector-group h2 {
  margin: 0;
  font-size: 20px;
}

.inspector-group h3 {
  margin: 4px 0 0;
  font-size: 14px;
}

.mini-help {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.tool-list {
  display: grid;
  gap: 9px;
}

.tool-list span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.mini-form {
  display: grid;
  gap: 10px;
}

.range-control {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 54px;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.range-control input {
  width: 100%;
  accent-color: var(--teal);
}

.range-control strong {
  color: var(--ink);
  font-size: 12px;
  text-align: right;
}

.form-textarea.small {
  min-height: 82px;
}

.element-grid,
.sticker-grid,
.ai-tool-grid {
  display: grid;
  gap: 8px;
}

.element-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.element-button,
.sticker-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-weight: 850;
}

.element-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 13px;
}

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

.sticker-button {
  font-size: 20px;
}

.ai-placeholder {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: #fffdfa;
  color: var(--muted);
  line-height: 1.45;
}

.ai-placeholder strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.layer-stack {
  display: grid;
  gap: 7px;
}

.layer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.layer-row.active {
  border-color: var(--teal);
  background: #e7f5f3;
  box-shadow: inset 4px 0 0 var(--teal);
}

.layer-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 850;
}

.layer-row small {
  color: var(--muted);
  font-size: 12px;
}

.selected-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.editor-stage-shell {
  display: grid;
  min-width: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #202721;
}

.editor-topbar,
.editor-bottom-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #f7fbf5;
}

.editor-topbar > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

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

.editor-topbar span,
.editor-bottom-status {
  color: rgba(247, 251, 245, 0.68);
  font-size: 13px;
}

.stage-scroll {
  display: grid;
  min-height: 460px;
  overflow: auto;
  place-items: center;
  padding: 22px;
  background:
    linear-gradient(45deg, rgba(255,255,255,0.045) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.045) 25%, transparent 25%),
    #202721;
  background-size: 28px 28px;
}

.pro-canvas {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 72vh;
  height: auto;
  background: #111613;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

.editor-empty-state {
  display: grid;
  width: min(460px, calc(100vw - 48px));
  place-items: center;
  gap: 12px;
  padding: 30px;
  color: #f7fbf5;
  text-align: center;
}

.editor-empty-state strong {
  font-size: 20px;
}

.editor-empty-state p {
  margin: 0;
  color: rgba(247, 251, 245, 0.72);
  line-height: 1.5;
}

.editor-bottom-status {
  justify-content: flex-start;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 0;
}

.editor-bottom-status span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

@media (max-width: 1180px) {
  .compact-hero,
  .editor-app {
    grid-template-columns: 1fr;
  }

  .editor-left {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .editor-tabs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .editor-inspector {
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
}

@media (max-width: 720px) {
  .compact-quality,
  .import-grid,
  .element-grid {
    grid-template-columns: 1fr;
  }

  .editor-workspace-section {
    width: min(100% - 16px, 1440px);
  }

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

  .editor-tab {
    min-height: 52px;
  }

  .editor-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .stage-scroll {
    min-height: 320px;
    padding: 12px;
  }

  .range-control {
    grid-template-columns: 1fr;
  }

  .sticker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
