    :root {
      color-scheme: light dark;
      --ink: #121816;
      --ink-soft: #52615c;
      --paper: #f5f7f3;
      --paper-deep: #e8eee8;
      --panel: #fcfefd;
      --panel-soft: #f9fbf8;
      --line: #202a26;
      --muted-line: rgba(32, 42, 38, .16);
      --accent: #0e7a55;
      --accent-strong: #075c3e;
      --accent-soft: #dcefe7;
      --checker: rgba(32, 42, 38, .07);
      --shadow: 0 26px 70px rgba(18, 24, 22, .12);
      --small-shadow: 0 12px 30px rgba(18, 24, 22, .10);
      --radius: 14px;
      --mono: "SFMono-Regular", "Cascadia Mono", "Liberation Mono", Menlo, monospace;
      --sans: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
    }

    @media (prefers-color-scheme: dark) {
      :root {
        --ink: #eef6f2;
        --ink-soft: #aebdb6;
        --paper: #101614;
        --paper-deep: #19211e;
        --panel: #151d1a;
        --panel-soft: #111916;
        --line: #d8e5de;
        --muted-line: rgba(216, 229, 222, .18);
        --accent: #54d6a2;
        --accent-strong: #8ce9c1;
        --accent-soft: rgba(84, 214, 162, .14);
        --checker: rgba(216, 229, 222, .09);
        --shadow: 0 26px 70px rgba(0, 0, 0, .38);
        --small-shadow: 0 12px 34px rgba(0, 0, 0, .28);
      }
    }

    * {
      box-sizing: border-box;
    }

    [hidden] {
      display: none !important;
    }

    html {
      scroll-behavior: smooth;
      overflow-x: clip;
    }

    body {
      margin: 0;
      color: var(--ink);
      overflow-x: clip;
      background:
        linear-gradient(90deg, rgba(18, 24, 22, .035) 1px, transparent 1px),
        linear-gradient(rgba(18, 24, 22, .03) 1px, transparent 1px),
        var(--paper);
      background-size: 40px 40px, 40px 40px, auto;
      font-family: var(--sans);
      min-height: 100vh;
    }

    body::before {
      content: "";
      position: fixed;
      inset: 0;
      pointer-events: none;
      background-image:
        linear-gradient(135deg, transparent 0 38%, rgba(14, 122, 85, .08) 38% 40%, transparent 40% 100%);
      z-index: -1;
    }

    a {
      color: var(--accent-strong);
    }

    button,
    input,
    select {
      font: inherit;
    }

    button {
      cursor: pointer;
      touch-action: manipulation;
    }

    button:focus-visible,
    a:focus-visible,
    input:focus-visible {
      outline: 3px solid var(--accent);
      outline-offset: 2px;
    }

    .shell {
      max-width: 1380px;
      margin: 0 auto;
      padding: 18px;
    }

    section,
    .dropzone,
    .workspace,
    .controls,
    .preview-card {
      scroll-margin-top: 96px;
    }

    .topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 18px;
      min-height: 68px;
      margin-bottom: 14px;
      position: sticky;
      top: 0;
      z-index: 30;
      padding: 8px 0;
      background: color-mix(in srgb, var(--paper) 88%, transparent);
      backdrop-filter: blur(16px);
      border-bottom: 1px solid color-mix(in srgb, var(--muted-line) 58%, transparent);
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
      min-width: 0;
    }

    .mark {
      width: 38px;
      height: 38px;
      border: 1px solid var(--muted-line);
      border-radius: 10px;
      flex: 0 0 auto;
      object-fit: contain;
      padding: 0;
      background: var(--accent-soft);
    }

    .brand strong {
      display: block;
      font-size: 19px;
      letter-spacing: -.02em;
      line-height: 1;
    }

    .brand span {
      display: block;
      color: var(--ink-soft);
      font-size: 12px;
      margin-top: 4px;
    }

    .top-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 14px;
      min-width: 0;
    }

    .language-switch {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 40px;
      min-height: 40px;
      padding: 0 10px;
      border: 1px solid var(--muted-line);
      border-radius: 999px;
      color: var(--ink);
      background: var(--panel-soft);
      font-family: var(--mono);
      font-size: 12px;
      font-weight: 800;
      letter-spacing: .08em;
      text-decoration: none;
    }

    .language-switch:hover {
      border-color: var(--accent);
      background: var(--accent-soft);
    }

    .toplinks {
      display: flex;
      flex-wrap: nowrap;
      justify-content: flex-end;
      gap: 22px;
    }

    .toplinks a {
      color: var(--ink);
      border: 0;
      background: transparent;
      border-radius: 8px;
      padding: 8px 2px;
      text-decoration: none;
      font-size: 14px;
      transition: transform .18s ease, background .18s ease;
      white-space: nowrap;
    }

    .toplinks a:hover {
      color: var(--accent-strong);
      background: transparent;
      transform: translateY(-1px);
    }

    .hero {
      display: grid;
      grid-template-columns: minmax(300px, .72fr) minmax(620px, 1.28fr);
      gap: 18px;
      align-items: stretch;
    }

    .intro {
      border: 1px solid var(--muted-line);
      background: var(--panel);
      box-shadow: var(--shadow);
      border-radius: var(--radius);
      padding: clamp(20px, 2.6vw, 30px);
      min-height: clamp(650px, calc(100dvh - 118px), 760px);
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      gap: 22px;
      overflow: hidden;
      position: relative;
    }

    .intro::after {
      content: "";
      position: absolute;
      width: 240px;
      height: 240px;
      right: -94px;
      bottom: -96px;
      background:
        linear-gradient(90deg, transparent 31%, var(--accent) 31% 34%, transparent 34% 65%, var(--accent) 65% 68%, transparent 68%),
        linear-gradient(0deg, transparent 31%, var(--accent) 31% 34%, transparent 34% 65%, var(--accent) 65% 68%, transparent 68%);
      opacity: .14;
      pointer-events: none;
    }

    .kicker {
      display: inline-flex;
      width: fit-content;
      align-items: center;
      padding: 7px 10px;
      border: 1px solid var(--muted-line);
      border-radius: 999px;
      background: var(--accent-soft);
      font-family: var(--mono);
      font-size: 12px;
      color: var(--accent-strong);
      position: relative;
      z-index: 1;
    }

    h1 {
      font-size: clamp(40px, 4vw, 54px);
      line-height: 1;
      margin: 20px 0 14px;
      max-width: 520px;
      letter-spacing: 0;
      position: relative;
      z-index: 1;
    }

    .lede {
      color: var(--ink-soft);
      font-size: 16px;
      line-height: 1.5;
      max-width: 480px;
      margin: 0;
      position: relative;
      z-index: 1;
    }

    .trust-strip {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 18px;
      position: relative;
      z-index: 1;
    }

    .trust-chip {
      border: 1px solid var(--muted-line);
      border-radius: 999px;
      background: var(--panel-soft);
      color: var(--ink);
      padding: 8px 11px;
      font-size: 12px;
      line-height: 1;
    }

    .intro-support {
      position: relative;
      z-index: 1;
      display: grid;
      gap: 8px;
      max-width: 560px;
    }

    .support-title {
      font-family: var(--mono);
      font-size: 12px;
      color: var(--ink-soft);
      text-transform: uppercase;
    }

    .task-link {
      display: grid;
      grid-template-columns: 42px minmax(0, 1fr) 18px;
      gap: 12px;
      align-items: center;
      border: 1px solid var(--muted-line);
      border-radius: 12px;
      background: color-mix(in srgb, var(--panel) 86%, var(--accent-soft));
      padding: 11px 12px;
      color: var(--ink);
      text-decoration: none;
      transition: transform .16s ease, border-color .16s ease, background .16s ease;
      width: 100%;
      text-align: left;
    }

    .task-link:hover {
      transform: translateY(-1px);
      border-color: color-mix(in srgb, var(--accent) 42%, var(--muted-line));
      background: var(--panel);
    }

    .task-copy strong {
      display: block;
      font-size: 14px;
      line-height: 1.25;
    }

    .task-copy {
      color: var(--ink-soft);
      font-size: 13px;
      line-height: 1.35;
    }

    .task-icon {
      width: 42px;
      height: 42px;
      display: grid;
      place-items: center;
      border-radius: 10px;
      border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--muted-line));
      background: var(--panel);
      color: var(--accent-strong);
      font-weight: 800;
      font-size: 12px;
    }

    .task-arrow {
      color: var(--accent-strong);
      font-weight: 800;
      justify-self: end;
    }

    .workspace {
      display: grid;
      grid-template-columns: minmax(260px, .36fr) minmax(0, .64fr);
      grid-template-rows: minmax(180px, auto) minmax(0, 1fr);
      grid-template-areas:
        "upload upload"
        "controls stage";
      gap: 12px;
      border: 1px solid var(--muted-line);
      background: var(--panel);
      box-shadow: var(--shadow);
      border-radius: var(--radius);
      padding: 12px;
      height: clamp(650px, calc(100dvh - 118px), 760px);
      min-height: 0;
      overflow: hidden;
    }

    .controls {
      grid-area: controls;
      display: flex;
      flex-direction: column;
      gap: 8px;
      min-width: 0;
      min-height: 0;
      overflow: auto;
      padding-right: 2px;
    }

    .dropzone {
      grid-area: upload;
      border: 1.5px dashed var(--muted-line);
      border-radius: var(--radius);
      background:
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, .88), transparent 42%),
        linear-gradient(135deg, var(--accent-soft), transparent 78%),
        var(--panel-soft);
      min-height: 180px;
      display: grid;
      place-items: center;
      padding: 18px;
      text-align: center;
      position: relative;
      transition: transform .18s ease, background .18s ease;
      overflow: hidden;
    }

    .dropzone.is-dragging {
      transform: translateY(-2px);
      background: var(--accent-soft);
    }

    .dropzone:focus {
      outline: none;
    }

    .dropzone:focus-visible {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(14, 122, 85, .18);
    }

    .dropzone input {
      position: absolute;
      width: 1px;
      height: 1px;
      margin: -1px;
      padding: 0;
      border: 0;
      opacity: 0;
      clip-path: inset(50%);
      overflow: hidden;
      white-space: nowrap;
      cursor: pointer;
    }

    .dropzone input::file-selector-button {
      display: none;
    }

    .drop-copy {
      position: relative;
      z-index: 1;
      display: grid;
      justify-items: center;
      gap: 8px;
    }

    .drop-icon {
      width: 50px;
      height: 40px;
      margin: 0 auto 10px;
      color: var(--accent-strong);
    }

    .dropzone strong {
      display: block;
      font-size: 24px;
      letter-spacing: -.03em;
      line-height: 1.05;
    }

    .dropzone span:not(.choose-file) {
      display: block;
      color: var(--ink-soft);
      font-size: 14px;
    }

    .choose-file {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 190px;
      min-height: 44px;
      margin: 4px auto;
      border-radius: 10px;
      background: var(--accent);
      color: #f7fff9;
      font-weight: 800;
      box-shadow: 0 12px 24px rgba(14, 122, 85, .22);
      cursor: pointer;
      position: relative;
      z-index: 2;
      text-decoration: none;
    }

    .file-hint {
      display: block;
      font-size: 12px;
    }

    .panel {
      border: 1px solid var(--muted-line);
      border-radius: var(--radius);
      background: var(--panel-soft);
      padding: 10px;
    }

    .panel-title {
      margin: 0 0 8px;
      font-size: 12px;
      text-transform: uppercase;
      font-family: var(--mono);
      letter-spacing: 0;
      color: var(--ink-soft);
    }

    .preset,
    .format-btn {
      min-height: 36px;
      border: 1px solid var(--muted-line);
      border-radius: 10px;
      background: var(--panel);
      color: var(--ink);
      transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
    }

    .preset {
      font-weight: 700;
      font-variant-numeric: tabular-nums;
      letter-spacing: .01em;
    }

    .preset:hover,
    .format-btn:hover {
      transform: translateY(-1px);
    }

    .preset.is-active,
    .format-btn.is-active {
      background: var(--accent);
      color: #f7fff9;
      border-color: var(--accent);
      box-shadow: 0 8px 18px rgba(14, 122, 85, .22);
    }

    .presets {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 6px;
    }

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

    .custom-panel {
      background: color-mix(in srgb, var(--panel-soft) 78%, var(--paper));
    }

    .custom-fields {
      align-items: end;
      gap: 20px;
      position: relative;
    }

    .custom-fields::after {
      content: "x";
      position: absolute;
      left: 50%;
      bottom: 9px;
      transform: translateX(-50%);
      color: var(--ink-soft);
      font-size: 16px;
      font-weight: 700;
    }

    label {
      display: grid;
      gap: 5px;
      color: var(--ink-soft);
      font-size: 12px;
    }

    input[type="number"],
    select {
      width: 100%;
      border: 1px solid var(--muted-line);
      border-radius: 10px;
      background: var(--panel);
      min-height: 38px;
      padding: 8px 9px;
      color: var(--ink);
    }

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

    .format-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 6px;
      margin-bottom: 8px;
    }

    .switch {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      border: 1px solid var(--muted-line);
      background: var(--panel);
      border-radius: 10px;
      padding: 9px;
      color: var(--ink);
      font-size: 13px;
      margin-top: 8px;
    }

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

    .quality-row.is-disabled {
      opacity: .55;
    }

    .format-help {
      min-height: 18px;
      color: var(--ink-soft);
      font-size: 11px;
      line-height: 1.45;
    }

    .field-help {
      margin: 10px 0 0;
      color: var(--ink-soft);
      font-size: 11px;
      line-height: 1.5;
    }

    .field-help strong {
      color: var(--ink);
    }

    .actions {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      margin-top: 0;
      position: sticky;
      bottom: 0;
      z-index: 3;
      padding-top: 8px;
      background:
        linear-gradient(to bottom, color-mix(in srgb, var(--panel) 12%, transparent), var(--panel) 36%),
        var(--panel);
    }

    .primary,
    .secondary {
      border: 1px solid var(--muted-line);
      border-radius: var(--radius);
      min-height: 44px;
      font-weight: 700;
      transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
    }

    .primary {
      background: var(--accent);
      color: #f7fff9;
      border-color: var(--accent);
      box-shadow: 0 12px 24px rgba(14, 122, 85, .24);
    }

    .secondary {
      background: var(--panel);
      color: var(--ink);
    }

    .primary:hover,
    .secondary:hover {
      transform: translateY(-1px);
      box-shadow: var(--small-shadow);
    }

    .primary:active,
    .secondary:active,
    .segmented button:active,
    .preset:active,
    .format-btn:active {
      transform: translateY(1px);
    }

    .primary:disabled,
    .secondary:disabled {
      cursor: not-allowed;
      opacity: .45;
      transform: none;
      box-shadow: none;
    }

    .status {
      grid-column: 1 / -1;
      color: var(--ink-soft);
      font-size: 12px;
      line-height: 1.45;
      min-height: 28px;
    }

    .stage {
      grid-area: stage;
      display: grid;
      grid-template-rows: minmax(0, 1.15fr) minmax(176px, .45fr);
      gap: 12px;
      min-width: 0;
      min-height: 0;
    }

    .stage.is-waiting {
      grid-template-rows: minmax(0, 1fr);
    }

    .preview-card,
    .results-card {
      border: 1px solid var(--muted-line);
      border-radius: var(--radius);
      background: var(--panel);
      min-width: 0;
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }

    .card-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
      padding: 10px 12px;
      border-bottom: 1px solid var(--muted-line);
      background: var(--paper-deep);
    }

    .card-title {
      margin: 0;
      font-size: 12px;
      font-family: var(--mono);
      text-transform: uppercase;
      color: var(--ink-soft);
    }

    .meta {
      color: var(--ink-soft);
      font-size: 12px;
      text-align: right;
    }

    .preview-wrap {
      flex: 1;
      min-height: 0;
      display: grid;
      place-items: center;
      padding: 14px;
      background:
        radial-gradient(circle at 78% 18%, rgba(14, 122, 85, .08), transparent 30%),
        linear-gradient(180deg, var(--panel) 0%, color-mix(in srgb, var(--accent-soft) 34%, var(--panel)) 100%);
    }

    .canvas-frame {
      position: relative;
      width: 100%;
      height: 100%;
      min-width: 0;
      min-height: 0;
      display: grid;
      place-items: center;
      overflow: hidden;
      filter: drop-shadow(0 16px 30px rgba(18, 24, 22, .18));
    }

    canvas {
      display: block;
      background: var(--panel);
      border: 1px solid var(--muted-line);
      image-rendering: auto;
    }

    .empty {
      width: 100%;
      max-width: min(420px, 100%);
      justify-self: stretch;
      text-align: center;
      color: var(--ink-soft);
      padding: 20px;
    }

    .empty strong {
      display: block;
      color: var(--ink);
      font-size: 25px;
      letter-spacing: -.04em;
      margin-bottom: 8px;
    }

    .results .empty {
      padding: 12px;
    }

    .results .empty strong {
      font-size: 22px;
    }

    .results .empty p {
      display: none;
    }

    .preview-empty {
      max-width: min(720px, 100%);
      padding: 14px;
    }

    .preview-empty strong {
      font-size: 21px;
      letter-spacing: -.03em;
    }

    .preview-empty p {
      margin: 6px auto 0;
      max-width: 480px;
      line-height: 1.45;
    }

    .sample-preview {
      width: 100%;
      max-width: 660px;
      aspect-ratio: 1448 / 1086;
      border: 1px solid var(--muted-line);
      border-radius: 16px;
      box-shadow: 0 18px 34px rgba(18, 24, 22, .14);
      margin: 0 auto 12px;
      position: relative;
      overflow: hidden;
      background: var(--panel);
    }

    .sample-preview img {
      width: 100%;
      height: 100%;
      display: block;
      object-fit: cover;
    }

    .sample-grid-overlay {
      position: absolute;
      inset: 0;
      pointer-events: none;
    }

    .sample-grid-line {
      position: absolute;
      background: rgba(255, 255, 255, .92);
      box-shadow: 0 0 0 1px rgba(14, 122, 85, .18), 0 0 10px rgba(18, 24, 22, .22);
    }

    .sample-grid-line.is-vertical {
      top: 0;
      bottom: 0;
      width: 3px;
      transform: translateX(-50%);
    }

    .sample-grid-line.is-horizontal {
      left: 0;
      right: 0;
      height: 3px;
      transform: translateY(-50%);
    }

    .sample-label {
      position: absolute;
      left: 12px;
      bottom: 12px;
      border-radius: 999px;
      background: rgba(255, 255, 255, .9);
      color: var(--ink);
      border: 1px solid rgba(32, 42, 38, .12);
      box-shadow: 0 8px 18px rgba(18, 24, 22, .10);
      padding: 7px 10px;
      font-size: 12px;
      font-weight: 700;
    }

    .sample-actions {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
      flex-wrap: wrap;
    }

    .sample-actions strong {
      font-size: 18px;
      margin: 0;
    }

    .sample-btn {
      border: 1px solid var(--muted-line);
      background: var(--panel);
      color: var(--accent-strong);
      border-radius: 10px;
      min-height: 38px;
      padding: 0 14px;
      font-weight: 700;
      margin-top: 4px;
    }

    .results {
      flex: 1;
      overflow: auto;
      padding: 12px;
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
      gap: 10px;
      align-content: start;
    }

    .tile {
      border: 1px solid var(--muted-line);
      background: var(--panel);
      border-radius: 10px;
      overflow: hidden;
      min-width: 0;
    }

    .tile img {
      width: 100%;
      aspect-ratio: 1;
      object-fit: contain;
      background:
        linear-gradient(45deg, var(--checker) 25%, transparent 25%),
        linear-gradient(-45deg, var(--checker) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--checker) 75%),
        linear-gradient(-45deg, transparent 75%, var(--checker) 75%);
      background-size: 16px 16px;
      background-position: 0 0, 0 8px, 8px -8px, -8px 0;
      display: block;
    }

    .tile-preview-button {
      display: block;
      width: 100%;
      margin: 0;
      padding: 0;
      border: 0;
      background: transparent;
      color: inherit;
      cursor: pointer;
    }

    .tile-preview-button:focus-visible {
      outline: 3px solid var(--accent);
      outline-offset: -3px;
    }

    .tile-foot {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 6px;
      padding: 7px;
      border-top: 1px solid var(--muted-line);
      font-size: 12px;
    }

    .tile-foot span {
      font-family: var(--mono);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .tile-foot a {
      color: #f7fff9;
      background: var(--accent);
      border-radius: 8px;
      padding: 5px 7px;
      text-decoration: none;
      white-space: nowrap;
    }

    .guide {
      margin-top: 28px;
      display: grid;
      grid-template-columns: 1.15fr .85fr;
      gap: 18px;
    }

    .seo-section {
      margin-top: 18px;
    }

    .content-block {
      border: 1px solid var(--muted-line);
      border-radius: var(--radius);
      background: var(--panel);
      box-shadow: var(--small-shadow);
      padding: clamp(20px, 3vw, 30px);
    }

    .content-block h2 {
      font-size: clamp(27px, 3.6vw, 42px);
      line-height: 1.05;
      letter-spacing: -.05em;
      margin: 0 0 16px;
    }

    .content-block h3 {
      margin: 22px 0 8px;
      font-size: 17px;
    }

    .content-block p,
    .content-block li {
      color: var(--ink-soft);
      line-height: 1.7;
    }

    .content-block ol,
    .content-block ul {
      padding-left: 22px;
      margin: 10px 0;
    }

    .steps-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
      margin-top: 18px;
      counter-reset: split-step;
    }

    .step-card {
      counter-increment: split-step;
      border: 1px solid var(--muted-line);
      border-radius: 12px;
      background: var(--panel-soft);
      padding: 16px;
      min-height: 150px;
    }

    .step-card::before {
      content: counter(split-step);
      width: 32px;
      height: 32px;
      display: grid;
      place-items: center;
      border-radius: 999px;
      background: var(--accent);
      color: #f7fff9;
      font-weight: 800;
      margin-bottom: 12px;
    }

    .step-card h3 {
      margin: 0 0 8px;
      font-size: 16px;
    }

    .step-card p {
      margin: 0;
      line-height: 1.55;
    }

    .topic-rows,
    .facts-grid,
    .format-rows,
    .route-rows {
      display: grid;
      gap: 0;
      margin-top: 14px;
    }

    .topic-row,
    .fact-row,
    .format-row,
    .route-row {
      display: grid;
      grid-template-columns: minmax(150px, .46fr) minmax(0, 1fr);
      gap: 18px;
      padding: 16px 0;
      border-top: 1px solid var(--muted-line);
    }

    .topic-row:first-child,
    .fact-row:first-child,
    .format-row:first-child,
    .route-row:first-child {
      border-top: 0;
      padding-top: 4px;
    }

    .topic-row strong,
    .topic-row h3,
    .fact-row strong,
    .format-row strong,
    .format-row h3,
    .route-row h3,
    .route-row strong {
      letter-spacing: -.02em;
      margin: 0;
      font-size: 16px;
      line-height: 1.35;
    }

    .topic-row p,
    .fact-row p,
    .format-row p,
    .route-row p {
      margin: 0;
    }

    .route-row a {
      text-decoration: none;
      font-family: var(--mono);
      font-size: 13px;
      color: var(--accent-strong);
    }

    .note-line {
      margin-top: 16px;
      color: var(--ink-soft);
      font-size: 13px;
      line-height: 1.6;
    }

    .faq-item {
      border-top: 1px solid var(--muted-line);
      padding: 13px 0;
    }

    .faq-item:first-of-type {
      border-top: 0;
    }

    .faq-item h3 {
      margin-top: 0;
    }

    .footer {
      margin-top: 24px;
      color: var(--ink-soft);
      font-size: 13px;
      text-align: center;
    }

    .footer p {
      margin: 0;
    }

    .footer .footer-feedback {
      margin-top: 8px;
      line-height: 1.65;
    }

    .footer-feedback a {
      color: var(--accent-strong);
      font-weight: 700;
      text-decoration-thickness: 1px;
      text-underline-offset: 3px;
    }

    .footer-feedback a:hover {
      color: var(--accent);
    }

    .footer-feedback a:focus-visible {
      outline: 3px solid var(--accent);
      outline-offset: 3px;
      border-radius: 4px;
    }

    .footer-feedback span {
      display: block;
    }

    .toast {
      position: fixed;
      left: 50%;
      bottom: 18px;
      transform: translateX(-50%) translateY(20px);
      background: var(--ink);
      color: var(--panel);
      border-radius: 999px;
      padding: 10px 14px;
      opacity: 0;
      pointer-events: none;
      transition: opacity .18s ease, transform .18s ease;
      z-index: 40;
      font-size: 13px;
    }

    .toast.is-visible {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }

    @media (max-width: 1060px) {
      .hero,
      .guide {
        grid-template-columns: 1fr;
      }

      .intro {
        min-height: auto;
      }

      h1 {
        font-size: 46px;
      }

      .intro-support {
        max-width: none;
      }

      .workspace {
        grid-template-columns: minmax(250px, .38fr) minmax(0, .62fr);
        height: auto;
        min-height: 640px;
        overflow: visible;
      }

      .controls {
        overflow: visible;
        padding-right: 0;
      }

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

    @media (max-width: 760px) {
      .shell {
        padding: 10px 12px 16px;
      }

      section,
      .dropzone,
      .workspace,
      .controls,
      .preview-card {
        scroll-margin-top: 72px;
      }

      .topbar {
        align-items: center;
        min-height: 54px;
        margin-bottom: 8px;
        padding: 6px 0;
      }

      .brand {
        gap: 10px;
      }

      .mark {
        width: 34px;
        height: 34px;
        border-radius: 9px;
      }

      .brand strong {
        font-size: 18px;
      }

      .brand span,
      .toplinks {
        display: none;
      }

      .hero {
        display: flex;
        flex-direction: column;
        gap: 10px;
      }

      .intro {
        order: 1;
        min-height: auto;
        padding: 14px;
        gap: 10px;
        border-radius: 12px;
        box-shadow: var(--small-shadow);
      }

      .hero-copy {
        order: 1;
        padding: 0;
      }

      .kicker {
        padding: 5px 8px;
        font-size: 11px;
      }

      .intro-support {
        display: none;
      }

      .support-title {
        display: none;
      }

      .task-link {
        grid-template-columns: 36px minmax(0, 1fr);
      }

      .task-arrow {
        display: none;
      }

      .task-copy {
        font-size: 0;
      }

      .task-copy strong {
        font-size: 13px;
      }

      .workspace {
        order: 2;
        display: flex;
        flex-direction: column;
        gap: 10px;
        min-height: auto;
        padding: 8px;
        position: relative;
        z-index: 1;
        overflow: visible;
      }

      .dropzone {
        order: 1;
        min-height: 156px;
        padding: 14px 12px;
      }

      .drop-copy {
        gap: 6px;
      }

      .drop-icon {
        width: 42px;
        height: 34px;
        margin-bottom: 4px;
      }

      .dropzone strong {
        font-size: 22px;
      }

      .dropzone span:not(.choose-file) {
        font-size: 13px;
      }

      .choose-file {
        min-width: 160px;
        min-height: 42px;
        border-radius: 9px;
      }

      .file-hint {
        max-width: 260px;
        font-size: 11px;
      }

      .panel {
        padding: 9px;
        border-radius: 12px;
      }

      .controls {
        display: contents;
      }

      .stage {
        order: 4;
      }

      .presets-panel {
        order: 2;
      }

      .custom-panel {
        order: 3;
      }

      .export-panel {
        order: 5;
      }

      .actions {
        order: 6;
        position: static;
        background: transparent;
        padding-top: 0;
        grid-template-columns: 1fr;
      }

      .actions .status {
        order: -1;
        min-height: 0;
        padding: 9px 10px;
        border: 1px solid var(--muted-line);
        border-radius: 10px;
        background: var(--panel-soft);
        font-size: 12px;
      }

      .primary,
      .secondary,
      .preset,
      .format-btn {
        min-height: 48px;
      }

      .primary,
      .secondary {
        font-size: 16px;
      }

      .stage {
        grid-template-rows: minmax(240px, auto) minmax(220px, auto);
        gap: 10px;
      }

      .preview-card {
        min-height: 280px;
      }

      .sample-preview {
        max-width: 100%;
      }

      .results-card {
        min-height: 260px;
      }

      h1 {
        font-size: clamp(30px, 10vw, 36px);
        line-height: .98;
        margin: 10px 0 8px;
      }

      .intro::after {
        content: none;
      }

      .lede {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        font-size: 14px;
        line-height: 1.42;
      }

      .trust-strip {
        gap: 6px;
        margin-top: 10px;
      }

      .trust-chip {
        padding: 6px 8px;
        font-size: 11px;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      *,
      *::before,
      *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
      }
    }

    @media (max-width: 460px) {
      .shell {
        padding: 8px 10px 14px;
      }

      .topbar {
        min-height: 50px;
      }

      .presets {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
      }

      .topic-row,
      .fact-row,
      .format-row,
      .route-row,
      .task-link,
      .steps-grid {
        grid-template-columns: 1fr;
      }

      h1 {
        font-size: 30px;
      }

      .lede {
        -webkit-line-clamp: 3;
      }

      .dropzone {
        min-height: 146px;
      }

      .drop-icon {
        width: 36px;
        height: 30px;
      }

      .file-hint {
        display: none;
      }

      .card-head {
        align-items: flex-start;
        flex-direction: column;
      }

      .intro-support {
        grid-template-columns: 1fr;
      }

      .meta {
        text-align: left;
      }
    }

    /*
     * Precision upload studio
     * Visual direction adapted from the compact File Upload component by extend-hq on 21st.dev.
     * The implementation stays framework-free and keeps the existing splitter behavior intact.
     */
    :root {
      color-scheme: light;
      --ink: #181a17;
      --ink-soft: #62675f;
      --paper: #f1f1ec;
      --paper-deep: #e9e9e2;
      --panel: #fffef9;
      --panel-soft: #f7f7f1;
      --line: #20231f;
      --muted-line: #d9dbd4;
      --accent: #237657;
      --accent-strong: #15563e;
      --accent-soft: #e4f1ea;
      --checker: rgba(24, 26, 23, .055);
      --shadow: 0 24px 70px rgba(28, 31, 27, .08);
      --small-shadow: 0 10px 32px rgba(28, 31, 27, .07);
      --radius: 18px;
      --mono: "SFMono-Regular", "Cascadia Mono", "Liberation Mono", Menlo, monospace;
      --sans: "Avenir Next", Avenir, "Segoe UI", sans-serif;
    }

    body {
      background:
        radial-gradient(circle at 12% 0%, rgba(35, 118, 87, .08), transparent 29rem),
        linear-gradient(90deg, rgba(24, 26, 23, .027) 1px, transparent 1px),
        linear-gradient(rgba(24, 26, 23, .024) 1px, transparent 1px),
        var(--paper);
      background-size: auto, 48px 48px, 48px 48px, auto;
    }

    body::before {
      background: linear-gradient(135deg, transparent 0 48%, rgba(35, 118, 87, .045) 48% 49%, transparent 49% 100%);
    }

    .shell {
      max-width: 1480px;
      padding: 16px 22px 28px;
    }

    .topbar {
      min-height: 62px;
      margin-bottom: 18px;
      padding: 7px 2px;
      background: rgba(241, 241, 236, .86);
      border-color: rgba(24, 26, 23, .10);
    }

    .mark {
      width: 40px;
      height: 40px;
      padding: 3px;
      border-radius: 12px;
      background: var(--panel);
      box-shadow: 0 5px 18px rgba(28, 31, 27, .07);
    }

    .brand strong {
      font-size: 18px;
      letter-spacing: -.035em;
    }

    .brand span {
      margin-top: 3px;
      font-family: var(--mono);
      font-size: 10px;
      letter-spacing: .035em;
      text-transform: uppercase;
    }

    .toplinks {
      gap: 8px;
    }

    .toplinks a {
      padding: 8px 11px;
      border-radius: 999px;
      font-size: 13px;
    }

    .toplinks a:hover {
      background: var(--panel);
    }

    .language-switch {
      min-width: 42px;
      min-height: 42px;
      background: var(--ink);
      border-color: var(--ink);
      color: #fffef9;
    }

    .hero {
      grid-template-columns: minmax(340px, .66fr) minmax(690px, 1.34fr);
      gap: 18px;
      align-items: stretch;
    }

    .intro {
      min-height: 704px;
      padding: 30px;
      border-color: rgba(24, 26, 23, .14);
      background:
        linear-gradient(145deg, rgba(228, 241, 234, .82), transparent 42%),
        var(--panel);
      box-shadow: var(--shadow);
    }

    .intro::after {
      width: 210px;
      height: 210px;
      right: -82px;
      bottom: -82px;
      opacity: .09;
    }

    .kicker {
      padding: 6px 9px;
      border-color: rgba(35, 118, 87, .22);
      background: rgba(255, 254, 249, .74);
      font-size: 10px;
      font-weight: 800;
      letter-spacing: .075em;
      text-transform: uppercase;
    }

    h1 {
      max-width: 540px;
      margin: 22px 0 16px;
      font-size: clamp(43px, 4vw, 58px);
      line-height: .95;
      letter-spacing: -.055em;
    }

    .lede {
      max-width: 520px;
      font-size: 15px;
      line-height: 1.58;
    }

    .trust-strip {
      gap: 6px;
      margin-top: 20px;
    }

    .trust-chip {
      padding: 7px 9px;
      background: rgba(255, 254, 249, .72);
      font-family: var(--mono);
      font-size: 10px;
      text-transform: uppercase;
    }

    .intro-support {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }

    .support-title {
      grid-column: 1 / -1;
      margin-bottom: 2px;
      font-size: 10px;
      letter-spacing: .09em;
    }

    .task-link {
      grid-template-columns: 36px minmax(0, 1fr);
      gap: 9px;
      min-height: 78px;
      padding: 10px;
      border-radius: 13px;
      background: rgba(255, 254, 249, .76);
    }

    .task-link:hover {
      transform: translateY(-2px);
      border-color: rgba(35, 118, 87, .45);
      box-shadow: 0 10px 24px rgba(28, 31, 27, .07);
    }

    .task-icon {
      width: 36px;
      height: 36px;
      border-radius: 9px;
      background: var(--accent-soft);
      font-family: var(--mono);
      font-size: 10px;
    }

    .task-copy {
      font-size: 11px;
    }

    .task-copy strong {
      margin-bottom: 3px;
      font-size: 13px;
    }

    .task-arrow {
      display: none;
    }

    .workspace {
      grid-template-columns: minmax(278px, .36fr) minmax(0, .64fr);
      grid-template-rows: 62px 166px minmax(0, 1fr);
      grid-template-areas:
        "head head"
        "upload upload"
        "controls stage";
      gap: 0;
      height: 704px;
      min-height: 704px;
      padding: 0;
      overflow: hidden;
      border-color: rgba(24, 26, 23, .16);
      background: var(--panel);
      box-shadow: var(--shadow);
    }

    .workspace-head {
      grid-area: head;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 18px;
      min-width: 0;
      padding: 11px 16px;
      border-bottom: 1px solid var(--muted-line);
      background: rgba(255, 254, 249, .92);
    }

    .workspace-heading {
      min-width: 0;
    }

    .workspace-heading strong {
      display: block;
      overflow: hidden;
      margin-top: 2px;
      font-size: 14px;
      letter-spacing: -.02em;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .workspace-kicker {
      display: block;
      color: var(--accent-strong);
      font-family: var(--mono);
      font-size: 9px;
      font-weight: 800;
      letter-spacing: .11em;
      text-transform: uppercase;
    }

    .privacy-signal {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      flex: 0 0 auto;
      color: var(--ink-soft);
      font-family: var(--mono);
      font-size: 10px;
      text-transform: uppercase;
    }

    .privacy-signal span {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: #39a976;
      box-shadow: 0 0 0 4px rgba(57, 169, 118, .12);
    }

    .dropzone {
      min-height: 0;
      margin: 14px 16px;
      padding: 14px 20px;
      overflow: visible;
      border: 1px dashed rgba(24, 26, 23, .28);
      border-radius: 14px;
      background:
        radial-gradient(circle at 14% 20%, rgba(35, 118, 87, .08), transparent 14rem),
        var(--panel-soft);
      box-shadow: inset 0 0 0 4px rgba(255, 254, 249, .62);
    }

    .dropzone::before {
      content: "01";
      position: absolute;
      top: 10px;
      left: 12px;
      color: var(--accent-strong);
      font-family: var(--mono);
      font-size: 9px;
      font-weight: 800;
      letter-spacing: .08em;
    }

    .dropzone.is-dragging {
      transform: none;
      border-color: var(--accent);
      background: var(--accent-soft);
      box-shadow: inset 0 0 0 4px rgba(255, 254, 249, .74), 0 0 0 4px rgba(35, 118, 87, .10);
      animation: drop-pulse 1s ease-in-out infinite alternate;
    }

    @keyframes drop-pulse {
      from { box-shadow: inset 0 0 0 4px rgba(255, 254, 249, .74), 0 0 0 2px rgba(35, 118, 87, .08); }
      to { box-shadow: inset 0 0 0 4px rgba(255, 254, 249, .74), 0 0 0 7px rgba(35, 118, 87, .13); }
    }

    .drop-copy {
      grid-template-columns: auto minmax(0, 1fr) auto;
      grid-template-areas:
        "icon title button"
        "icon subtitle button"
        "icon accept button"
        "icon hint button";
      column-gap: 15px;
      row-gap: 3px;
      width: min(780px, 100%);
      justify-items: start;
      text-align: left;
    }

    .drop-icon {
      grid-area: icon;
      align-self: center;
      box-sizing: content-box;
      width: 34px;
      height: 30px;
      margin: 0;
      padding: 12px;
      border-radius: 14px;
      background: var(--ink);
      color: #fffef9;
    }

    .dropzone strong {
      grid-area: title;
      align-self: end;
      font-size: 20px;
    }

    .drop-copy > strong + span {
      grid-area: subtitle;
      font-size: 12px !important;
    }

    .choose-file {
      grid-area: button;
      align-self: center;
      min-width: 168px;
      min-height: 42px;
      margin: 0;
      border: 1px solid var(--ink);
      border-radius: 10px;
      background: var(--ink);
      box-shadow: none;
      color: #fffef9;
      font-size: 13px;
    }

    .choose-file:hover {
      background: var(--accent-strong);
      border-color: var(--accent-strong);
    }

    .accept-list {
      grid-area: accept;
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
      margin-top: 2px;
    }

    .dropzone .accept-list span {
      display: inline-flex;
      padding: 2px 5px;
      border: 1px solid var(--muted-line);
      border-radius: 5px;
      background: var(--panel);
      color: var(--ink-soft);
      font-family: var(--mono);
      font-size: 8px;
      font-weight: 800;
      letter-spacing: .05em;
    }

    .file-hint {
      grid-area: hint;
      font-size: 9px !important;
    }

    .controls {
      gap: 10px;
      padding: 14px;
      overflow: auto;
      border-right: 1px solid var(--muted-line);
      background: #f4f4ee;
    }

    .panel {
      padding: 11px;
      border-color: var(--muted-line);
      border-radius: 12px;
      background: var(--panel);
    }

    .panel-title {
      display: flex;
      align-items: center;
      gap: 7px;
      margin-bottom: 10px;
      color: var(--ink);
      font-size: 10px;
      font-weight: 800;
      letter-spacing: .055em;
    }

    .step-index {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 24px;
      height: 20px;
      padding: 0 5px;
      border-radius: 6px;
      background: var(--accent-soft);
      color: var(--accent-strong);
      font-size: 9px;
    }

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

    .preset,
    .format-btn {
      min-height: 38px;
      border-radius: 9px;
      background: var(--panel-soft);
    }

    .preset[data-custom] {
      font-size: 10px;
      line-height: 1.1;
    }

    .preset.is-active {
      border-color: var(--ink);
      background: var(--ink);
      box-shadow: none;
      color: #fffef9;
    }

    .format-btn.is-active {
      border-color: var(--accent);
      background: var(--accent);
      box-shadow: none;
    }

    .switch {
      padding: 8px;
      background: var(--panel-soft);
      font-size: 11px;
    }

    .actions {
      gap: 7px;
      margin-top: auto;
      padding-top: 6px;
      position: static;
      background: linear-gradient(to bottom, transparent, #f4f4ee 24%);
    }

    .primary,
    .secondary {
      min-height: 42px;
      border-radius: 10px;
      font-size: 13px;
    }

    .primary {
      border-color: var(--ink);
      background: var(--ink);
      box-shadow: none;
      color: #fffef9;
    }

    .primary:hover {
      border-color: var(--accent-strong);
      background: var(--accent-strong);
    }

    .status {
      min-height: 22px;
      font-size: 10px;
    }

    .stage {
      gap: 10px;
      padding: 14px;
      background:
        linear-gradient(90deg, rgba(24, 26, 23, .025) 1px, transparent 1px),
        linear-gradient(rgba(24, 26, 23, .022) 1px, transparent 1px),
        #eeeee8;
      background-size: 24px 24px;
    }

    .preview-card,
    .results-card {
      border-color: rgba(24, 26, 23, .16);
      border-radius: 13px;
      box-shadow: 0 8px 24px rgba(28, 31, 27, .05);
    }

    .card-head {
      min-height: 42px;
      padding: 9px 11px;
      background: rgba(255, 254, 249, .92);
    }

    .card-title,
    .meta {
      font-size: 10px;
    }

    .preview-wrap {
      padding: 12px;
      background: rgba(255, 254, 249, .72);
    }

    .sample-preview {
      max-width: 590px;
      margin-bottom: 9px;
      border-radius: 12px;
      box-shadow: 0 12px 28px rgba(28, 31, 27, .10);
    }

    .sample-btn {
      border-color: var(--ink);
      background: var(--panel);
      color: var(--ink);
    }

    .sample-btn:hover {
      background: var(--ink);
      color: #fffef9;
    }

    .content-block {
      border-color: rgba(24, 26, 23, .12);
      background: rgba(255, 254, 249, .82);
      box-shadow: none;
    }

    .content-block h2 {
      letter-spacing: -.045em;
    }

    .step-card {
      background: rgba(247, 247, 241, .86);
    }

    .step-card::before {
      background: var(--ink);
    }

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

      .intro {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(420px, .9fr);
        align-items: end;
        min-height: 0;
        gap: 28px;
      }

      .workspace {
        height: 704px;
      }
    }

    @media (max-width: 760px) {
      .shell {
        padding: 8px 10px 18px;
      }

      .topbar {
        min-height: 52px;
        margin-bottom: 9px;
        padding: 4px 2px;
      }

      .mark {
        width: 34px;
        height: 34px;
        border-radius: 10px;
      }

      .brand strong {
        font-size: 17px;
      }

      .language-switch {
        min-width: 38px;
        min-height: 38px;
      }

      .hero {
        display: flex;
        flex-direction: column;
        gap: 9px;
      }

      .intro {
        display: block;
        min-height: 0;
        padding: 18px;
        border-radius: 14px;
      }

      .intro-support {
        display: none;
      }

      .kicker {
        padding: 5px 7px;
        font-size: 9px;
      }

      h1 {
        margin: 13px 0 9px;
        font-size: clamp(32px, 10vw, 42px);
        line-height: .96;
      }

      .lede {
        display: -webkit-box;
        overflow: hidden;
        font-size: 13px;
        line-height: 1.48;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
      }

      .trust-strip {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px;
        margin-top: 13px;
      }

      .trust-chip {
        justify-content: center;
        text-align: center;
        padding: 6px 7px;
        font-size: 9px;
      }

      .workspace {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 0;
        border-radius: 14px;
        overflow: hidden;
      }

      .workspace-head {
        order: 0;
        padding: 10px 12px;
      }

      .workspace-heading strong {
        max-width: 250px;
        font-size: 12px;
      }

      .privacy-signal {
        font-size: 0;
      }

      .privacy-signal::after {
        content: "Private";
        font-size: 9px;
      }

      html[lang="es"] .privacy-signal::after {
        content: "Privado";
      }

      .dropzone {
        order: 1;
        min-height: 214px;
        margin: 9px;
        padding: 23px 14px 15px;
        overflow: hidden;
      }

      .dropzone::before {
        top: 8px;
        left: 10px;
      }

      .drop-copy {
        grid-template-columns: 1fr;
        grid-template-areas:
          "icon"
          "title"
          "subtitle"
          "button"
          "accept"
          "hint";
        gap: 7px;
        justify-items: center;
        text-align: center;
      }

      .drop-icon {
        width: 31px;
        height: 27px;
        padding: 10px;
        border-radius: 12px;
      }

      .dropzone strong {
        font-size: 20px;
      }

      .choose-file {
        width: min(240px, 100%);
        min-height: 44px;
        margin: 3px auto 0;
      }

      .accept-list {
        justify-content: center;
      }

      .controls {
        display: contents;
      }

      .workspace .panel {
        margin: 0 9px 9px;
      }

      .presets-panel {
        order: 2;
      }

      .custom-panel {
        order: 3;
      }

      .export-panel {
        order: 4;
      }

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

      .preset,
      .format-btn {
        min-height: 46px;
      }

      .preset[data-custom] {
        font-size: 13px;
      }

      .actions {
        order: 5;
        position: sticky;
        bottom: 8px;
        z-index: 12;
        grid-template-columns: 1fr;
        margin: 0 9px 9px;
        padding: 8px;
        border: 1px solid rgba(24, 26, 23, .16);
        border-radius: 12px;
        background: rgba(255, 254, 249, .94);
        box-shadow: 0 12px 28px rgba(28, 31, 27, .12);
        backdrop-filter: blur(14px);
      }

      .actions .status {
        min-height: 0;
        padding: 0 2px 4px;
        border: 0;
        background: transparent;
      }

      .primary,
      .secondary {
        min-height: 48px;
        font-size: 15px;
      }

      .stage {
        order: 6;
        gap: 9px;
        width: 100%;
        padding: 9px;
      }

      .stage,
      .stage.is-waiting {
        grid-template-rows: minmax(245px, auto) minmax(220px, auto);
      }

      .stage.is-waiting {
        grid-template-rows: minmax(245px, auto);
      }

      .preview-card {
        min-height: 280px;
      }

      .sample-preview {
        max-width: 100%;
      }

      .card-head {
        align-items: center;
        flex-direction: row;
      }

      .meta {
        max-width: 56%;
        overflow: hidden;
        text-align: right;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
    }

    @media (max-width: 460px) {
      .workspace-heading strong {
        max-width: 220px;
      }

      .file-hint {
        display: none;
      }

      .dropzone {
        min-height: 198px;
      }

      .content-block {
        padding: 19px;
      }

      .content-block h2 {
        font-size: 29px;
      }
    }

    /* Instagram Carousel — restrained controls within the precision studio. */
    .mode-switch,
    .option-grid {
      display: grid;
      gap: 6px;
    }

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

    .mode-btn,
    .ratio-btn,
    .fit-btn,
    .target-width-btn,
    .preview-tab {
      border: 1px solid var(--muted-line);
      background: var(--panel-soft);
      color: var(--ink);
      transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
    }

    .mode-btn,
    .ratio-btn,
    .fit-btn,
    .target-width-btn {
      min-width: 0;
      min-height: 44px;
      border-radius: 9px;
      padding: 8px 9px;
      text-align: left;
    }

    .mode-btn {
      display: grid;
      align-content: center;
      gap: 2px;
    }

    .mode-btn span,
    .fit-btn span {
      font-size: 11px;
      font-weight: 800;
      line-height: 1.2;
    }

    .mode-btn small,
    .ratio-btn small,
    .fit-btn small,
    .target-width-btn small {
      display: block;
      margin-top: 2px;
      color: var(--ink-soft);
      font-size: 9px;
      font-weight: 500;
      line-height: 1.2;
    }

    .mode-btn:hover,
    .ratio-btn:hover,
    .fit-btn:hover,
    .target-width-btn:hover,
    .preview-tab:hover {
      border-color: rgba(35, 118, 87, .48);
      background: var(--panel);
    }

    .mode-btn.is-active,
    .ratio-btn.is-active,
    .fit-btn.is-active,
    .target-width-btn.is-active,
    .preview-tab.is-active {
      border-color: var(--ink);
      background: var(--ink);
      color: #fffef9;
      box-shadow: none;
    }

    .mode-btn.is-active small,
    .ratio-btn.is-active small,
    .fit-btn.is-active small,
    .target-width-btn.is-active small {
      color: rgba(255, 254, 249, .68);
    }

    .carousel-panel {
      padding: 0;
      overflow: hidden;
    }

    .control-section {
      padding: 11px;
      border-top: 1px solid var(--muted-line);
    }

    .control-section:first-child {
      border-top: 0;
    }

    .control-section > .panel-title {
      margin-bottom: 9px;
    }

    .slides-row,
    .background-row,
    .range-row {
      border: 1px solid var(--muted-line);
      border-radius: 9px;
      background: var(--panel-soft);
      color: var(--ink);
    }

    .slides-row,
    .background-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      min-height: 44px;
      padding: 7px 9px;
    }

    .slides-row > span,
    .background-row > span:first-child,
    .range-row > span,
    .control-label {
      font-size: 11px;
      font-weight: 800;
      line-height: 1.3;
    }

    .slides-row small,
    .control-label small {
      color: var(--ink-soft);
      font-size: 9px;
      font-weight: 500;
    }

    .slides-row input[type="number"] {
      width: 66px;
      min-height: 34px;
      padding: 5px 7px;
      text-align: center;
      font-family: var(--mono);
      font-weight: 800;
    }

    .control-label {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 8px;
      margin: 10px 1px 6px;
      color: var(--ink);
    }

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

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

    .ratio-btn,
    .target-width-btn {
      text-align: center;
      font-family: var(--mono);
      font-size: 11px;
      font-weight: 800;
    }

    .fit-btn {
      display: grid;
      align-content: center;
    }

    .plan-summary,
    .adjust-hint {
      margin: 8px 1px 0;
      color: var(--ink-soft);
      font-size: 9px;
      line-height: 1.45;
    }

    .plan-summary {
      padding-left: 9px;
      border-left: 2px solid var(--accent);
      color: var(--accent-strong);
      font-family: var(--mono);
    }

    .range-row {
      display: grid;
      gap: 4px;
      margin-top: 8px;
      padding: 8px 9px 7px;
    }

    .range-row > span {
      display: flex;
      justify-content: space-between;
      gap: 10px;
    }

    .range-row output {
      color: var(--accent-strong);
      font-family: var(--mono);
      font-size: 10px;
    }

    .range-row input[type="range"] {
      min-height: 22px;
      margin: 0;
    }

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

    .position-grid .range-row {
      min-width: 0;
    }

    .color-control {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      color: var(--ink-soft);
      font-family: var(--mono);
      font-size: 9px;
    }

    .color-control input[type="color"] {
      width: 34px;
      height: 30px;
      padding: 2px;
      border: 1px solid var(--muted-line);
      border-radius: 7px;
      background: var(--panel);
    }

    .preview-tabs {
      display: flex;
      gap: 5px;
      padding: 7px 10px;
      border-bottom: 1px solid var(--muted-line);
      background: rgba(255, 254, 249, .92);
    }

    .preview-tab {
      min-height: 34px;
      padding: 6px 10px;
      border-radius: 8px;
      font-family: var(--mono);
      font-size: 9px;
      font-weight: 800;
      text-transform: uppercase;
    }

    .preview-panel {
      flex: 1;
      min-width: 0;
      min-height: 0;
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }

    .preview-panel .preview-wrap {
      min-height: 0;
    }

    .carousel-preview-panel {
      justify-content: center;
      gap: 12px;
      padding: 14px 12px 11px;
      background:
        linear-gradient(90deg, rgba(24, 26, 23, .025) 1px, transparent 1px),
        linear-gradient(rgba(24, 26, 23, .022) 1px, transparent 1px),
        rgba(255, 254, 249, .72);
      background-size: 20px 20px;
    }

    .carousel-preview-track {
      display: flex;
      align-items: center;
      gap: 10px;
      width: 100%;
      min-height: 0;
      padding: 10px max(10px, calc(50% - 112px));
      overflow-x: auto;
      overscroll-behavior-inline: contain;
      scroll-snap-type: x mandatory;
      scrollbar-width: thin;
    }

    .carousel-preview-track > * {
      flex: 0 0 min(224px, 68%);
      max-height: 100%;
      aspect-ratio: 4 / 5;
      scroll-snap-align: center;
    }

    .carousel-preview-slide {
      position: relative;
      padding: 0;
      border: 0;
      background: transparent;
      cursor: pointer;
    }

    .carousel-preview-slide span {
      position: absolute;
      right: 8px;
      bottom: 8px;
      min-width: 28px;
      padding: 4px 6px;
      border-radius: 999px;
      background: rgba(24, 26, 23, .84);
      color: #fff;
      font-family: var(--mono);
      font-size: 9px;
      font-weight: 800;
      text-align: center;
    }

    .carousel-preview-slide.is-active canvas {
      outline: 3px solid var(--accent);
      outline-offset: 3px;
    }

    #previewCanvas.is-adjustable {
      cursor: grab;
      touch-action: none;
    }

    #previewCanvas.is-adjustable.is-adjusting {
      cursor: grabbing;
    }

    .carousel-preview-track img,
    .carousel-preview-track canvas {
      width: 100%;
      height: 100%;
      display: block;
      object-fit: contain;
      border: 1px solid rgba(24, 26, 23, .14);
      border-radius: 10px;
      background: var(--panel);
      box-shadow: 0 12px 28px rgba(28, 31, 27, .12);
    }

    .carousel-placeholder {
      display: grid;
      place-items: center;
      border: 1px solid rgba(24, 26, 23, .16);
      border-radius: 10px;
      background:
        linear-gradient(135deg, transparent 49.6%, rgba(35, 118, 87, .13) 49.6% 50.4%, transparent 50.4%),
        var(--panel);
      box-shadow: 0 12px 28px rgba(28, 31, 27, .08);
      color: var(--accent-strong);
      font-family: var(--mono);
      font-size: 12px;
      font-weight: 800;
    }

    .carousel-preview-meta {
      align-self: center;
      padding: 6px 9px;
      border: 1px solid var(--muted-line);
      border-radius: 999px;
      background: var(--panel);
      color: var(--ink-soft);
      font-family: var(--mono);
      font-size: 9px;
      line-height: 1.2;
      text-align: center;
    }

    .resolution-warning {
      margin: 0 10px 10px;
      padding: 8px 10px 8px 28px;
      position: relative;
      border: 1px solid #d9a933;
      border-radius: 9px;
      background: #fff6da;
      color: #6b4e08;
      font-size: 10px;
      line-height: 1.4;
    }

    .resolution-warning::before {
      content: "!";
      position: absolute;
      top: 8px;
      left: 10px;
      font-family: var(--mono);
      font-weight: 900;
    }

    .resolution-warning.is-low,
    .resolution-warning[data-level="low"],
    .resolution-warning[data-severity="poor"] {
      border-color: #ca6c61;
      background: #fff0ed;
      color: #7d2920;
    }

    .resolution-warning.is-sharp,
    .resolution-warning[data-level="sharp"],
    .resolution-warning[data-severity="good"] {
      border-color: rgba(35, 118, 87, .30);
      background: var(--accent-soft);
      color: var(--accent-strong);
    }

    @media (max-width: 760px) {
      .mode-panel {
        order: 2;
      }

      .presets-panel,
      .carousel-panel,
      .custom-panel {
        order: 3;
      }

      .export-panel {
        order: 4;
      }

      .actions {
        order: 5;
      }

      .stage {
        order: 6;
      }

      .mode-btn,
      .ratio-btn,
      .fit-btn,
      .target-width-btn,
      .preview-tab,
      .slides-row,
      .background-row {
        min-height: 48px;
      }

      .mode-btn span,
      .fit-btn span {
        font-size: 12px;
      }

      .mode-btn small,
      .ratio-btn small,
      .fit-btn small,
      .target-width-btn small {
        font-size: 10px;
      }

      .carousel-panel {
        overflow: visible;
      }

      .control-section {
        padding: 12px;
      }

      .preview-tabs {
        padding: 8px;
      }

      .preview-tab {
        flex: 1;
        padding-inline: 7px;
      }

      .carousel-preview-panel {
        min-height: 300px;
      }

      .carousel-preview-track {
        padding-inline: max(14px, calc(50% - 104px));
      }

      .carousel-preview-track > * {
        flex-basis: min(208px, 76%);
      }
    }

    @media (max-width: 460px) {
      .mode-switch,
      .fit-grid,
      .target-width-grid,
      .position-grid {
        grid-template-columns: 1fr;
      }

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

      .control-label {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
      }

      .carousel-preview-track {
        padding-inline: max(10px, calc(50% - 92px));
      }

      .carousel-preview-track > * {
        flex-basis: min(184px, 80%);
      }
    }

    @media (max-width: 760px) {
      .preset,
      .format-btn,
      .sample-btn,
      .choose-file,
      .tile-foot a {
        min-height: 48px;
      }

      .tile-foot a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 8px 12px;
      }
    }
