:root {
  --ink: #0f172a;
  --muted: #64748b;
  --paper: #f8fafc;
  --panel: #ffffff;
  --line: #e2e8f0;
  --accent: #0d9488;
  --accent-dark: #0f766e;
  --accent-light: #ccfbf1;
  --soft: #f0fdf9;
  --radius: 12px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.09), 0 1px 4px rgba(15, 23, 42, 0.05);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── Topbar ────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 252, 0.94);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  flex-shrink: 0;
}

.mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

nav {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.support-link {
  color: var(--accent);
  font-weight: 800;
}

.lang-toggle {
  padding: 6px 14px;
  border: 1.5px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.lang-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--soft);
}

/* ── Layout ────────────────────────────────────────── */
main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.tool-workspace {
  padding: 20px 0 48px;
}

/* ── Compact tool header (replaces hero block) ───────── */
.tool-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.tool-header h1 {
  font-size: clamp(17px, 2vw, 26px);
  line-height: 1.25;
  margin: 0 0 3px;
  font-weight: 900;
  max-width: none;
}

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

.tool-header .eyebrow {
  white-space: nowrap;
  padding-top: 4px;
  flex-shrink: 0;
}

.upload-area {
  margin-bottom: 16px;
}

.upload-area .dropzone {
  min-height: 200px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.40fr) minmax(280px, 0.60fr);
  gap: clamp(12px, 2vw, 24px);
  align-items: start;
  margin-top: 0;
}

.eyebrow {
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 12px;
}

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

h1 {
  max-width: 680px;
  font-size: clamp(28px, 3.6vw, 50px);
  line-height: 1.05;
  margin-bottom: 12px;
}

h2 {
  font-size: clamp(22px, 2.8vw, 38px);
  line-height: 1.08;
  margin-bottom: 12px;
}

h3 {
  font-size: 17px;
}

.lede {
  max-width: 680px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

/* ── Buttons ────────────────────────────────────────── */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  min-height: 46px;
  padding: 12px 20px;
  font: inherit;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s, border-color 0.15s, color 0.15s;
  text-align: center;
}

.button.primary {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}

.button.primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.38);
}

.button.primary:active {
  transform: translateY(0);
  box-shadow: none;
}

.button.secondary {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.button.secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.button.ghost {
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
}

.button.ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--soft);
}

.button.full {
  width: 100%;
}

/* ── Sections ────────────────────────────────────────── */
.tool-section,
.band,
.support {
  padding: 48px 0;
}

.section-heading {
  max-width: 740px;
  margin-bottom: 32px;
}

.section-heading p {
  color: var(--muted);
  line-height: 1.6;
}

/* ── Cards ────────────────────────────────────────── */
.customize-card,
.preview-card,
.cards article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.cards article {
  transition: box-shadow 0.18s, transform 0.18s;
}

.cards article:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.cards p {
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

/* ── Dropzone ────────────────────────────────────────── */
.dropzone {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 130px;
  padding: 24px 20px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.dropzone:hover {
  border-color: var(--accent);
  background: #e4f4f0;
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.08);
}

.dropzone.drag-over {
  border-color: var(--accent);
  background: #ceeee8;
  box-shadow: 0 0 0 5px rgba(13, 148, 136, 0.14);
}

.drop-icon {
  color: var(--accent);
  opacity: 0.75;
}

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

.drop-title {
  font-size: clamp(16px, 2vw, 21px);
  font-weight: 900;
}

.drop-help {
  color: var(--muted);
  font-size: 14px;
}

/* ── Quick presets ────────────────────────────────────────── */
.quick-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.quick-presets button {
  min-height: 34px;
  padding: 6px 14px;
  border: 1.5px solid var(--line);
  border-radius: 20px;
  color: var(--muted);
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.13s, border-color 0.13s, color 0.13s;
}

.quick-presets button.active,
.quick-presets button:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

/* ── Controls ────────────────────────────────────────── */
.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 12px;
}

/* Photo preset spans full width */
#labelPhotoPreset {
  grid-column: 1 / -1;
}

/* Dim label row: label text + px/cm toggle side by side */
.dim-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.unit-btns {
  display: flex;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.unit-btn {
  padding: 1px 8px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  line-height: 1.6;
}

.unit-btn + .unit-btn {
  border-left: 1.5px solid var(--line);
}

.unit-btn.active {
  background: var(--accent);
  color: #fff;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  height: 38px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

.quality-control {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.quality-control label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

input[type="range"] {
  padding: 0;
  accent-color: var(--accent);
  height: auto;
}

/* ── Progress bar ────────────────────────────────────────── */
.progress-wrap {
  margin: 10px 0 6px;
}

.progress-track {
  height: 6px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  width: 0%;
  transition: width 0.35s ease;
}

.progress-label {
  font-size: 12px;
  color: var(--muted);
}

/* ── Status ────────────────────────────────────────── */
.status {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

/* ── Trust row ────────────────────────────────────────── */
.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.trust-row span {
  padding: 7px 14px;
  border: 1.5px solid #b2dfd6;
  border-radius: 20px;
  color: var(--accent-dark);
  background: #eaf8f4;
  font-size: 13px;
  font-weight: 700;
}

/* ── Preview panel ────────────────────────────────────────── */
.preview-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.preview-tab {
  flex: 1;
  padding: 8px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.13s, border-color 0.13s, color 0.13s;
}

.preview-tab.active {
  background: var(--soft);
  border-color: var(--accent);
  color: var(--accent-dark);
  font-weight: 800;
}

.preview-box {
  display: grid;
  place-items: center;
  min-height: 280px;
  background:
    linear-gradient(45deg, #eef0ed 25%, transparent 25%),
    linear-gradient(-45deg, #eef0ed 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef0ed 75%),
    linear-gradient(-45deg, transparent 75%, #eef0ed 75%);
  background-color: #fff;
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  border-radius: var(--radius);
  overflow: hidden;
}

canvas,
.original-preview {
  max-width: 100%;
  max-height: 280px;
  object-fit: contain;
  display: block;
}

/* ── File stats ────────────────────────────────────────── */
.file-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0 0;
}

.file-stats div {
  padding: 12px;
  background: var(--soft);
  border-radius: 8px;
}

dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

dd {
  margin: 4px 0 0;
  font-weight: 900;
  font-size: 15px;
}

/* ── After upload info ────────────────────────────────────────── */
.after-upload-info {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1.5px solid #b2dfd6;
  border-radius: var(--radius);
  background: #eaf8f4;
}

.after-upload-info h2 {
  margin-bottom: 6px;
  font-size: 17px;
  color: var(--accent-dark);
}

.after-upload-info p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

/* ── Results ────────────────────────────────────────── */
.results {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.results-header h2 {
  margin: 0;
  font-size: 17px;
}

.btn-download-all {
  padding: 7px 14px;
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  background: var(--soft);
  color: var(--accent-dark);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.13s, box-shadow 0.13s;
}

.btn-download-all:hover {
  background: var(--accent-light);
  box-shadow: var(--shadow-sm);
}

.result-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.result-item:first-child {
  border-top: 0;
}

.result-item strong {
  display: block;
  margin-bottom: 3px;
  font-size: 14px;
}

.result-item span {
  color: var(--muted);
  font-size: 13px;
}

.result-item a {
  padding: 8px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-size: 13px;
  font-weight: 900;
  transition: background 0.13s;
  white-space: nowrap;
}

.result-item a:hover {
  background: var(--accent-dark);
}

/* ── Band ────────────────────────────────────────── */
.band {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

/* ── Service grid ────────────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.service-grid article {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s, transform 0.18s;
}

.service-grid article:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.service-grid p {
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.service-status {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 900;
}

.service-status.live {
  color: var(--accent-dark);
  background: var(--accent-light);
}

.service-status.next {
  color: var(--muted);
  background: #f1f5f9;
  border: 1px solid var(--line);
}

.tools-category-label {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 2.25rem 0 .75rem;
}

/* ── Problem shortcuts (hero quick-jump pills) ───── */
.problem-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 1.5rem;
  align-items: center;
}
.problem-shortcuts-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.problem-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border: 1.5px solid var(--line);
  border-radius: 20px;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  background: #fff;
  transition: border-color .12s, background .12s, color .12s;
}
.problem-pill:hover {
  border-color: var(--accent);
  background: var(--soft);
  color: var(--accent);
}

/* ── Fix-picker cards ────────────────────────────── */
.fix-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 2rem;
}
.fix-card {
  padding: 24px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fix-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--accent);
}
.fix-card-icon {
  font-size: 1.75rem;
  line-height: 1;
}
.fix-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}
.fix-card p {
  font-size: .875rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
  flex: 1;
}
.fix-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 9px 18px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 700;
  text-decoration: none;
  align-self: flex-start;
  border: none;
  cursor: pointer;
  transition: opacity .12s;
}
.fix-card-cta:hover { opacity: .85; }

/* Batch callout strip */
.batch-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 18px 24px;
  background: var(--soft);
  border: 1.5px solid var(--accent-light);
  border-radius: var(--radius);
}
.batch-callout-text strong {
  display: block;
  font-size: .9375rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 3px;
}
.batch-callout-text span {
  font-size: .8125rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  .fix-grid { grid-template-columns: 1fr; }
  .batch-callout { flex-direction: column; align-items: flex-start; }
}

/* ── FAQ ────────────────────────────────────────── */
.faq-list {
  max-width: 740px;
}

details {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

details:first-child {
  border-top: 1px solid var(--line);
}

summary {
  font-weight: 800;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 15px;
}

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

summary::after {
  content: "+";
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

details[open] summary::after {
  content: "–";
}

details p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

/* ── Support ────────────────────────────────────────── */
.support {
  background: linear-gradient(160deg, var(--soft) 0%, #fff 60%);
}

/* ── Footer ────────────────────────────────────────── */
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 24px clamp(18px, 4vw, 56px);
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 14px;
}

footer nav {
  display: flex;
  gap: 18px;
  font-size: 14px;
}

/* ── Hero grid ────────────────────────────────────────── */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(16px, 3vw, 40px);
  align-items: start;
  margin-bottom: 24px;
}

/* ── Privacy proof aside ────────────────────────────────── */
.privacy-proof {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  min-width: 220px;
  max-width: 300px;
}

.proof-kicker {
  display: block;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
  margin-bottom: 8px;
}

.privacy-proof h2 {
  font-size: 17px;
  margin-bottom: 6px;
}

.privacy-proof p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 10px;
}

.privacy-proof ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.privacy-proof ul li {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-dark);
  padding: 3px 0;
}

.privacy-proof ul li::before {
  content: "✓ ";
}

/* ── Task strip ────────────────────────────────────────── */

/* ── Panel / upload headings ───────────────────────────── */
.upload-step-heading,
.panel-heading {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

/* ── Step label (legacy — kept for backwards compat) ───── */
.step-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.step-label > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.step-label strong {
  display: block;
  font-size: 15px;
  margin-bottom: 2px;
}

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

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 820px) {
  .topbar,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    gap: 12px;
    padding: 14px 16px;
    position: static;
  }

  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }

  main {
    width: min(560px, calc(100% - 20px));
  }

  .cards,
  .service-grid,
  .workspace-grid,
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .privacy-proof {
    max-width: 100%;
  }

  .task-strip {
    gap: 8px;
  }

  .task-card {
    flex: 1 1 calc(50% - 8px);
  }

  .tool-workspace {
    padding: 20px 0 36px;
  }

  .tool-intro h1 {
    font-size: 28px;
    line-height: 1.1;
  }

  .lede {
    font-size: 15px;
  }

  .customize-card,
  .preview-card,
  .cards article,
  .service-grid article {
    padding: 16px;
  }

  .upload-area .dropzone {
    min-height: 160px;
    padding: 20px 14px;
  }

  .controls,
  .file-stats {
    grid-template-columns: 1fr;
  }

  .quick-presets button {
    flex: 1 1 calc(33.333% - 8px);
  }

  .button.full {
    min-height: 52px;
  }

  .preview-box {
    min-height: 240px;
  }

  canvas,
  .original-preview {
    max-height: 240px;
  }

  .result-item {
    grid-template-columns: 1fr;
  }

  nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    white-space: nowrap;
  }

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