/* ==========================================================================
   Local Image Studio — shared styles
   Pure static CSS. Light/dark themes, mobile first-ish, no external fonts.
   ========================================================================== */

:root {
  color-scheme: light;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
    "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --maxw: 1120px;
  --maxw-prose: 760px;

  --bg: #f4f6fb;
  --bg-glow-1: rgba(99, 102, 241, 0.18);
  --bg-glow-2: rgba(20, 184, 166, 0.14);
  --card: #ffffff;
  --card-2: #f7f9fc;
  --card-3: #eef2f9;

  --ink: #0d1526;
  --ink-2: #43506b;
  --ink-3: #6b7891;
  --line: #e3e8f1;
  --line-2: #cdd6e5;

  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-ink: #ffffff;
  --brand-soft: #eef0ff;
  --brand-soft-ink: #3730a3;

  --good: #047857;
  --good-soft: #e8f8f0;
  --warn: #a16207;
  --warn-soft: #fdf6e3;
  --bad: #b42318;
  --bad-soft: #fdeceb;

  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;

  --shadow-xs: 0 1px 2px rgba(13, 21, 38, 0.06);
  --shadow-sm: 0 1px 3px rgba(13, 21, 38, 0.07), 0 6px 16px -10px rgba(13, 21, 38, 0.2);
  --shadow: 0 2px 4px rgba(13, 21, 38, 0.05), 0 18px 40px -22px rgba(13, 21, 38, 0.35);
  --focus-ring: 0 0 0 3px rgba(79, 70, 229, 0.32);

  --step--1: 0.8125rem;
  --step-0: 0.9375rem;
  --step-1: 1.0625rem;
  --step-2: 1.25rem;
  --step-3: 1.5rem;
  --step-4: clamp(1.75rem, 1.2rem + 2.2vw, 2.5rem);
  --step-5: clamp(2.1rem, 1.3rem + 3.6vw, 3.4rem);
}

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

  --bg: #080d19;
  --bg-glow-1: rgba(99, 102, 241, 0.26);
  --bg-glow-2: rgba(20, 184, 166, 0.16);
  --card: #0f1729;
  --card-2: #0c1424;
  --card-3: #16223a;

  --ink: #e9eef9;
  --ink-2: #aebbd2;
  --ink-3: #8896af;
  --line: #1e2b43;
  --line-2: #2f405c;

  --brand: #8b8cf7;
  --brand-2: #b196fa;
  --brand-ink: #0b1020;
  --brand-soft: #1a2150;
  --brand-soft-ink: #c7c9ff;

  --good: #4ade80;
  --good-soft: #08281d;
  --warn: #fbbf24;
  --warn-soft: #2a2107;
  --bad: #fca5a5;
  --bad-soft: #2c1113;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45), 0 6px 18px -10px rgba(0, 0, 0, 0.7);
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.5), 0 24px 50px -26px rgba(0, 0, 0, 0.9);
  --focus-ring: 0 0 0 3px rgba(139, 140, 247, 0.45);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 15% -8%, var(--bg-glow-1), transparent 62%),
    radial-gradient(900px 480px at 92% 4%, var(--bg-glow-2), transparent 60%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  line-height: 1.18;
  letter-spacing: -0.018em;
  color: var(--ink);
  font-weight: 760;
  text-wrap: balance;
}

h1 { font-size: var(--step-5); letter-spacing: -0.03em; }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

img { max-width: 100%; height: auto; }

strong { font-weight: 660; color: var(--ink); }

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--card-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.1em 0.35em;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

::selection { background: var(--brand-soft); color: var(--brand-soft-ink); }

:focus-visible {
  outline: 2px solid transparent;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-xs);
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

[hidden] { display: none !important; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 740;
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand span small {
  display: block;
  font-size: 0.68rem;
  font-weight: 550;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  line-height: 1.2;
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  display: inline-block;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: var(--step--1);
  font-weight: 580;
  text-decoration: none;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--ink); background: var(--card-3); }
.site-nav a[aria-current="page"] { color: var(--brand-soft-ink); background: var(--brand-soft); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-left: 6px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--line-2); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  --btn-bg: var(--card);
  --btn-ink: var(--ink);
  --btn-line: var(--line-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid var(--btn-line);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font: inherit;
  font-size: var(--step--1);
  font-weight: 620;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--ink-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; flex: none; }

.btn-primary {
  --btn-bg: linear-gradient(135deg, var(--brand), var(--brand-2));
  --btn-ink: var(--brand-ink);
  --btn-line: transparent;
  box-shadow: 0 10px 22px -12px rgba(79, 70, 229, 0.85);
}
[data-theme="dark"] .btn-primary {
  --btn-bg: linear-gradient(135deg, #7d7ef7, #a78bfa);
  --btn-ink: #0b1020;
  box-shadow: 0 12px 26px -14px rgba(139, 140, 247, 0.9);
}
.btn-primary:hover { --btn-line: transparent; filter: brightness(1.04); }

.btn-ghost {
  --btn-bg: transparent;
  --btn-line: transparent;
  color: var(--ink-2);
}
.btn-ghost:hover { --btn-bg: var(--card-3); border-color: transparent; }

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 0.78rem; }
.btn-icon {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 999px;
  color: var(--ink-3);
  background: transparent;
  border-color: transparent;
}
.btn-icon:hover { background: var(--bad-soft); color: var(--bad); border-color: transparent; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  padding: clamp(40px, 7vw, 76px) 0 26px;
  text-align: center;
}

.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 7px 14px 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow-xs);
  font-size: 0.78rem;
  font-weight: 620;
  letter-spacing: 0.01em;
  color: var(--ink-2);
}
.hero .eyebrow .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.16);
}
.hero .eyebrow .sep { color: var(--line-2); }

.hero h1 {
  margin: 0 auto 18px;
  max-width: 25ch;
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--brand), var(--brand-2) 55%, #0ea5e9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .lede {
  margin: 0 auto;
  max-width: 62ch;
  font-size: var(--step-1);
  color: var(--ink-2);
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 10px;
  margin: 26px auto 0;
  padding: 0;
  list-style: none;
  max-width: 760px;
}
.trust-row li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 0.8rem;
  font-weight: 570;
  color: var(--ink-2);
  box-shadow: var(--shadow-xs);
}
.trust-row svg { width: 15px; height: 15px; color: var(--good); flex: none; }

/* --------------------------------------------------------------------------
   Tool card
   -------------------------------------------------------------------------- */

.tool-section { padding: 26px 0 10px; }

.tool-card {
  position: relative;
  padding: clamp(16px, 2.4vw, 26px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow);
}

/* Dropzone ---------------------------------------------------------------- */

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: clamp(26px, 4.5vw, 46px) 20px;
  border: 2px dashed var(--line-2);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(600px 180px at 50% 0%, var(--brand-soft), transparent 70%),
    var(--card-2);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.2s ease, transform 0.15s ease;
}
.dropzone:hover { border-color: var(--brand); }
.dropzone:focus-visible { outline: none; box-shadow: var(--focus-ring); border-color: var(--brand); }
.dropzone.is-dragover {
  border-color: var(--brand);
  background: var(--brand-soft);
  transform: scale(1.005);
}

.dropzone .dz-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  margin-bottom: 6px;
  border-radius: 16px;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 12px 24px -14px rgba(79, 70, 229, 0.9);
}
[data-theme="dark"] .dropzone .dz-icon { color: #0b1020; }
.dropzone .dz-icon svg { width: 26px; height: 26px; }

.dropzone .dz-title {
  font-size: var(--step-1);
  font-weight: 700;
  color: var(--ink);
}
.dropzone .dz-sub {
  font-size: var(--step--1);
  color: var(--ink-3);
  max-width: 46ch;
}
.dropzone .dz-cta {
  margin-top: 10px;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.8rem;
  font-weight: 640;
}

.drag-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--brand-soft) 72%, transparent);
  backdrop-filter: blur(3px);
  pointer-events: none;
}
.drag-overlay.is-visible { display: flex; }
.drag-overlay span {
  padding: 18px 26px;
  border: 2px dashed var(--brand);
  border-radius: var(--radius-lg);
  background: var(--card);
  color: var(--ink);
  font-weight: 660;
  box-shadow: var(--shadow);
}

/* Settings ---------------------------------------------------------------- */

.settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card-2);
}

.field { min-width: 0; }
.field-wide { grid-column: 1 / -1; }

.field > .label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.field > .label .hint {
  font-size: 0.72rem;
  font-weight: 560;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-3);
}

/* Segmented control */
.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
.segmented label {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 8px 6px;
  border-radius: 9px;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.segmented input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.segmented .seg-name {
  font-size: 0.86rem;
  font-weight: 680;
  color: var(--ink);
  line-height: 1.3;
}
.segmented .seg-note {
  font-size: 0.68rem;
  color: var(--ink-3);
  line-height: 1.25;
}
.segmented label:hover { background: var(--card-3); }
.segmented input:checked ~ .seg-name { color: var(--brand-soft-ink); }
.segmented label:has(input:checked) {
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 45%, transparent);
}
.segmented label:has(input:checked) .seg-note { color: var(--brand-soft-ink); opacity: 0.8; }
.segmented label:has(input:focus-visible) { box-shadow: var(--focus-ring); }
.segmented label:has(input:disabled) { opacity: 0.45; cursor: not-allowed; }

.seg-badge {
  position: absolute;
  top: -7px;
  right: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--good);
  color: var(--card);
  font-size: 0.58rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
[data-theme="dark"] .seg-badge { color: #06231a; }

/* Range slider */
.range-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
input[type="range"] {
  --fill: 50%;
  flex: 1 1 auto;
  width: 100%;
  height: 26px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--brand) var(--fill), var(--line-2) var(--fill));
}
input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: var(--line-2);
}
input[type="range"]::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--brand);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border: 3px solid var(--card);
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 1px 4px rgba(13, 21, 38, 0.35);
}
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 3px solid var(--card);
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 1px 4px rgba(13, 21, 38, 0.35);
}
input[type="range"]:focus-visible { outline: none; box-shadow: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: var(--focus-ring); }
input[type="range"]:disabled { opacity: 0.5; cursor: not-allowed; }

.range-value {
  flex: none;
  min-width: 58px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
}

.range-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
  padding: 0 2px;
  font-size: 0.68rem;
  color: var(--ink-3);
}

/* Selects and inputs */
.select-wrap { position: relative; }
.select-wrap::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

select,
input[type="text"],
input[type="number"] {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
}
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  cursor: pointer;
}
select:focus, input[type="text"]:focus, input[type="number"]:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}
input::placeholder { color: var(--ink-3); }

.inline-inputs {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.inline-inputs.is-hidden { display: none; }

.field-note {
  margin-top: 7px;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--ink-3);
}
.field-note code { font-size: 0.95em; background: transparent; border: 0; padding: 0; color: var(--ink-2); }
.field-note.is-warn { color: var(--warn); }

/* --------------------------------------------------------------------------
   Results
   -------------------------------------------------------------------------- */

.results {
  margin-top: 18px;
}

.results-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.results-head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}
.results-head .count {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--card-3);
  color: var(--ink-2);
  font-size: 0.74rem;
  font-weight: 650;
}
.results-head .spacer { margin-left: auto; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 30px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card-2);
  text-align: center;
  color: var(--ink-3);
  font-size: 0.85rem;
}
.empty-state strong { color: var(--ink-2); font-weight: 620; }
.empty-state.is-hidden { display: none; }

.notice {
  margin: 0 0 10px;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line));
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand-soft-ink);
  font-size: 0.8rem;
  line-height: 1.5;
}
.notice.is-warn {
  border-color: color-mix(in srgb, var(--warn) 35%, var(--line));
  background: var(--warn-soft);
  color: var(--warn);
}

.filelist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.filelist:empty { display: none; }

.file-row {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  animation: row-in 0.22s ease both;
}
@keyframes row-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.file-row .thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #e6eaf2 25%, transparent 25%, transparent 75%, #e6eaf2 75%),
    linear-gradient(45deg, #e6eaf2 25%, transparent 25%, transparent 75%, #e6eaf2 75%);
  background-size: 12px 12px;
  background-position: 0 0, 6px 6px;
  flex: none;
}
[data-theme="dark"] .file-row .thumb {
  background-color: #0b1020;
  background-image:
    linear-gradient(45deg, #1d2942 25%, transparent 25%, transparent 75%, #1d2942 75%),
    linear-gradient(45deg, #1d2942 25%, transparent 25%, transparent 75%, #1d2942 75%);
}
.file-row .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.file-row .info { min-width: 0; }

.file-row .fname {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 620;
  color: var(--ink);
  line-height: 1.35;
}
.file-row .fname .name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-row .fmeta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-top: 3px;
  font-size: 0.76rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.file-row .fmeta .from { color: var(--ink-3); }
.file-row .fmeta .arrow { color: var(--line-2); }
.file-row .fmeta .to { color: var(--ink-2); font-weight: 620; }
.file-row .fmeta .dims { color: var(--ink-3); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.badge-good { background: var(--good-soft); color: var(--good); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-muted { background: var(--card-3); color: var(--ink-2); }

.file-row .fsave { display: inline-flex; align-items: center; gap: 6px; }

.file-row .actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

.file-row.is-error { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.file-row.is-error .fmeta { color: var(--bad); }

.file-row .row-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: transparent;
  overflow: hidden;
}
.file-row .row-progress span {
  display: block;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  transform: translateX(-100%);
  animation: row-slide 1s linear infinite;
}
.file-row:not(.is-busy) .row-progress { display: none; }
@keyframes row-slide {
  to { transform: translateX(320%); }
}

/* Summary bar ------------------------------------------------------------- */

.summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card-2);
  box-shadow: var(--shadow-xs);
  transition: opacity 0.2s ease;
}
.summary.is-idle { opacity: 0.65; }

.summary .stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  font-size: 0.8rem;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.summary .stats .big {
  font-size: 1rem;
  font-weight: 720;
  color: var(--ink);
}
.summary .stats .arrow { color: var(--line-2); }
.summary .actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.summary .busy-note {
  display: none;
  font-size: 0.75rem;
  color: var(--ink-3);
}
.summary.is-busy .busy-note { display: inline; }

/* Scrollbar-ish nicety for the list on mobile is unnecessary; rows wrap below. */

/* --------------------------------------------------------------------------
   Content sections
   -------------------------------------------------------------------------- */

.section { padding: clamp(44px, 6vw, 76px) 0; }
.section-tight { padding: clamp(30px, 4vw, 46px) 0; }

.section-head {
  max-width: 62ch;
  margin: 0 auto clamp(22px, 3vw, 34px);
  text-align: center;
}
.section-head .kicker {
  display: block;
  margin-bottom: 10px;
  font-size: 0.74rem;
  font-weight: 720;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
}
.section-head p { color: var(--ink-2); font-size: var(--step-1); }

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.step {
  position: relative;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-xs);
}
.step::before {
  counter-increment: step;
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-bottom: 12px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-soft-ink);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
}
.step h3 { font-size: 1.02rem; margin-bottom: 6px; }
.step p { font-size: 0.88rem; color: var(--ink-2); margin: 0; }

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(20px, 4vw, 44px);
  align-items: start;
}

.prose {
  max-width: var(--maxw-prose);
}
.prose h2 { font-size: var(--step-3); }
.prose h3 { font-size: 1.05rem; margin-top: 1.6em; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul, .prose ol { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.4em; }
.prose li::marker { color: var(--brand); }

.feature-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.feature-list li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.feature-list .tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-top: 2px;
  border-radius: 999px;
  background: var(--good-soft);
  color: var(--good);
}
.feature-list .tick svg { width: 15px; height: 15px; }
.feature-list strong { display: block; font-size: 0.94rem; }
.feature-list span.desc { font-size: 0.86rem; color: var(--ink-2); }

.stat-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(320px 160px at 100% 0%, var(--brand-soft), transparent 70%),
    var(--card);
  box-shadow: var(--shadow-xs);
}
.stat-card dl { margin: 0; display: grid; gap: 14px; }
.stat-card--row dl { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 28px; }
.stat-card--row dd { font-size: 1.3rem; }
.stat-card dt { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.stat-card dd { margin: 2px 0 0; font-size: 1.15rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-card dd small { display: block; font-size: 0.76rem; font-weight: 500; color: var(--ink-3); }

.compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 22px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.86rem;
}
.compare-table caption {
  caption-side: bottom;
  padding-top: 8px;
  font-size: 0.72rem;
  color: var(--ink-3);
  text-align: left;
}
.compare-table th,
.compare-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.compare-table thead th {
  background: var(--card-2);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.compare-table tbody tr:last-child th,
.compare-table tbody tr:last-child td { border-bottom: 0; }
.compare-table tbody th { font-weight: 620; color: var(--ink); }
.compare-table td { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.compare-table tr.is-best td { background: var(--good-soft); color: var(--good); font-weight: 650; }

/* FAQ --------------------------------------------------------------------- */

.faq {
  max-width: 820px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
}
.faq details {
  border-bottom: 1px solid var(--line);
}
.faq summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 4px;
  cursor: pointer;
  font-weight: 640;
  font-size: 0.98rem;
  color: var(--ink);
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin-left: auto;
  border-right: 2px solid var(--ink-3);
  border-bottom: 2px solid var(--ink-3);
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq summary:hover { color: var(--brand); }
.faq .answer {
  padding: 0 4px 20px;
  font-size: 0.9rem;
  color: var(--ink-2);
  max-width: 72ch;
}
.faq .answer p { margin-bottom: 0.7em; }
.faq .answer p:last-child { margin-bottom: 0; }

/* Ad slots ---------------------------------------------------------------- */

.ad-slot {
  display: none; /* stays out of the layout until AdSense code is uncommented */
  margin: 28px auto;
  max-width: 970px;
  min-height: 90px;
  text-align: center;
}

/* Note box */
.note-box {
  display: flex;
  gap: 12px;
  margin: 24px 0 0;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--brand) 26%, var(--line));
  border-radius: var(--radius);
  background: var(--brand-soft);
  color: var(--brand-soft-ink);
  font-size: 0.85rem;
}
.note-box svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.note-box p { margin: 0; }
.note-box strong { color: inherit; }

/* CTA band ---------------------------------------------------------------- */

.cta-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  padding: clamp(22px, 3.5vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(520px 220px at 8% 0%, var(--brand-soft), transparent 72%),
    var(--card);
  box-shadow: var(--shadow-xs);
}
.cta-band h2 { font-size: var(--step-3); margin-bottom: 4px; }
.cta-band p { margin: 0; color: var(--ink-2); font-size: 0.92rem; }
.cta-band .btn { margin-left: auto; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  margin-top: 20px;
  padding: 40px 0 34px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--card-2) 70%, transparent);
  font-size: 0.84rem;
  color: var(--ink-3);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: 28px;
}
.footer-brand p { max-width: 40ch; margin-top: 10px; color: var(--ink-3); }
.footer-col h4 {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.footer-col ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.footer-col a { color: var(--ink-2); text-decoration: none; }
.footer-col a:hover { color: var(--brand); text-decoration: underline; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
}
.footer-bottom .sep { margin-left: auto; }

/* --------------------------------------------------------------------------
   Pages (about / privacy / terms / contact / 404)
   -------------------------------------------------------------------------- */

.page-hero {
  padding: clamp(34px, 5vw, 58px) 0 6px;
}
.page-hero > .wrap,
.page-body > .wrap { max-width: 840px; }
.page-hero .kicker {
  display: block;
  margin-bottom: 8px;
  font-size: 0.72rem;
  font-weight: 720;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
}
.page-hero h1 { font-size: var(--step-4); max-width: 24ch; }
.page-hero .lede { color: var(--ink-2); max-width: 62ch; }
.page-hero .updated { margin-top: 10px; font-size: 0.78rem; color: var(--ink-3); }

.page-body { padding: 26px 0 clamp(48px, 6vw, 76px); }
.prose-page {
  max-width: 800px;
  margin: 0 auto;
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-xs);
}
.prose-page h2 {
  margin-top: 1.8em;
  font-size: 1.2rem;
  scroll-margin-top: 90px;
}
.prose-page h2:first-child { margin-top: 0; }
.prose-page h3 { margin-top: 1.5em; font-size: 1rem; }
.prose-page p, .prose-page li { color: var(--ink-2); font-size: 0.92rem; }
.prose-page ul, .prose-page ol { padding-left: 1.25em; }
.prose-page li { margin-bottom: 0.45em; }
.prose-page .callout {
  padding: 14px 16px;
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--brand-soft);
  color: var(--brand-soft-ink);
  font-size: 0.9rem;
}
.prose-page .callout p { color: inherit; }
.toc {
  margin: 0 0 26px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-2);
  font-size: 0.85rem;
}
.toc strong { display: block; margin-bottom: 6px; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.toc ol { margin: 0; padding-left: 1.1em; columns: 2; column-gap: 24px; }
.toc li { margin-bottom: 4px; }

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 22px;
}
.contact-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-xs);
}
.contact-card h2 { margin-top: 0; font-size: 1.05rem; }
.contact-card p { font-size: 0.9rem; color: var(--ink-2); }
.contact-card .mail {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-weight: 640;
  font-size: 0.95rem;
  word-break: break-all;
}

.form-row { margin-bottom: 14px; }
.form-row label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.form-row textarea {
  width: 100%;
  min-height: 130px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  resize: vertical;
}
.form-row textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus-ring); }
.form-note { font-size: 0.75rem; color: var(--ink-3); }

.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 62vh;
  padding: 40px 0;
  text-align: center;
}
.error-page .code {
  font-family: var(--font-mono);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.error-page p { max-width: 48ch; color: var(--ink-2); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .grid-2 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .cta-band .btn { margin-left: 0; }
}

@media (max-width: 760px) {
  :root { --step-5: clamp(1.9rem, 1.2rem + 6vw, 2.6rem); }

  .header-inner { min-height: 58px; gap: 10px; }
  .brand span small { display: none; }
  .brand span { font-size: 0.92rem; }
  .site-nav { gap: 0; }
  .site-nav a { padding: 7px 8px; font-size: 0.78rem; }
  .site-nav .nav-secondary { display: none; }

  .hero { padding-top: 34px; }
  .hero .lede { font-size: 1rem; }
  .trust-row { gap: 6px; }
  .trust-row li { font-size: 0.74rem; padding: 6px 10px; }

  .tool-card { border-radius: var(--radius-lg); }
  .settings { grid-template-columns: 1fr; padding: 13px; }
  .dropzone { padding: 24px 14px; }
  .dropzone .dz-icon { width: 46px; height: 46px; border-radius: 13px; }
  .dropzone .dz-icon svg { width: 22px; height: 22px; }
  .dropzone .dz-title { font-size: 1rem; }

  .file-row {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 10px 12px;
    padding: 10px;
  }
  .file-row .thumb { width: 46px; height: 46px; }
  .file-row .actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
  .file-row .actions .btn { flex: 1 1 auto; }

  .summary { gap: 10px; }
  .summary .actions { width: 100%; margin-left: 0; }
  .summary .actions .btn-primary { flex: 1 1 auto; }

  .stat-card--row dl { grid-template-columns: 1fr; gap: 14px; }

  .inline-inputs { grid-template-columns: 1fr; }
  .compare-table { font-size: 0.78rem; }
  .compare-table th, .compare-table td { padding: 8px 10px; }
  .toc ol { columns: 1; }
  .contact-grid { grid-template-columns: 1fr; }
  .prose-page { padding: 18px; }
}

@media (max-width: 560px) {
  .header-inner { gap: 6px; padding: 0 14px; }
  .brand svg { width: 26px; height: 26px; }
  .brand span { max-width: 132px; overflow: hidden; text-overflow: ellipsis; }
  .site-nav a[aria-current="page"] { display: none; }
  .site-nav a { padding: 7px 7px; }
}

@media (max-width: 420px) {
  .site-nav a[href*="about"] { display: none; }
  .segmented .seg-note { display: none; }
}

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

@media print {
  .site-header, .site-footer, .summary, .dropzone, .settings, .ad-slot, .theme-toggle { display: none !important; }
  body { background: #fff; color: #000; }
  .tool-card { box-shadow: none; border-color: #ccc; }
}

/* ==========================================================================
   Plans, licensing and watermark controls (added with the Pro release)
   ========================================================================== */

/* Pills and plan badge ----------------------------------------------------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--card-3);
  color: var(--ink-2);
  font-size: 0.64rem;
  font-weight: 760;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  vertical-align: middle;
}
.pill-pro {
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 4px 10px -6px rgba(79, 70, 229, 0.9);
}
[data-theme="dark"] .pill-pro { color: #0b1020; }

.plan-badge {
  flex: none;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-3);
  font-size: 0.64rem;
  font-weight: 760;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.plan-badge.is-pro {
  border-color: transparent;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  color: #fff;
}
[data-theme="dark"] .plan-badge.is-pro { color: #0b1020; }

.nav-pro { margin-left: 4px; }
.nav-pro.is-pro {
  --btn-bg: var(--good-soft);
  --btn-ink: var(--good);
  --btn-line: transparent;
  box-shadow: none;
}

/* Presets ----------------------------------------------------------------- */

.preset-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.preset {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}
.preset span { font-size: 0.84rem; font-weight: 660; line-height: 1.25; }
.preset em { font-style: normal; font-size: 0.68rem; color: var(--ink-3); }
.preset:hover { border-color: var(--brand); }
.preset:active { transform: translateY(1px); }
.preset.is-active {
  border-color: color-mix(in srgb, var(--brand) 55%, transparent);
  background: var(--brand-soft);
}
.preset.is-active span, .preset.is-active em { color: var(--brand-soft-ink); }

[data-pro-only].is-locked .preset,
[data-pro-only].is-locked .preset span,
[data-pro-only].is-locked .preset em { opacity: 0.62; }
[data-pro-only].is-locked .preset::after {
  content: "PRO";
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}
[data-pro-only].is-locked .preset { position: relative; opacity: 1; }

/* Batch progress ---------------------------------------------------------- */

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.progress-track {
  flex: 1 1 auto;
  height: 7px;
  border-radius: 999px;
  background: var(--card-3);
  overflow: hidden;
}
.progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width 0.25s ease;
}
body.is-pro .progress-bar { background: linear-gradient(90deg, var(--good), #22c55e); }
.progress-text {
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.limit-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--brand) 32%, var(--line));
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand-soft-ink);
  font-size: 0.8rem;
  line-height: 1.5;
}
.limit-banner .btn { margin-left: auto; }
.limit-banner[hidden] { display: none; }

/* Watermark panel --------------------------------------------------------- */

.wm-panel {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card-2);
}
.wm-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}
.wm-head h3 {
  margin: 0 0 2px;
  font-size: 0.98rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wm-head p {
  margin: 0;
  max-width: 56ch;
  font-size: 0.78rem;
  color: var(--ink-3);
}

.wm-body {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  gap: 16px;
  margin-top: 14px;
  align-items: start;
}
.wm-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.wm-group { display: contents; }
.wm-group[hidden] { display: none !important; }
.wm-controls .field > .label label {
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  cursor: pointer;
}
.wm-controls .field > .label .range-value {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 0.74rem;
  color: var(--ink-2);
}

input[type="color"] {
  width: 100%;
  min-height: 40px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  cursor: pointer;
}

.logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.logo-name {
  font-size: 0.72rem;
  color: var(--ink-3);
  word-break: break-all;
}

.wm-preview-wrap {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}
#wmPreview {
  display: block;
  width: 100%;
  height: auto;
}
.wm-preview-tag {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(8, 13, 25, 0.62);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
body.is-pro .wm-preview-tag { display: none; }

/* Switch ------------------------------------------------------------------ */

.switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  cursor: pointer;
  user-select: none;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--line-2);
  transition: background 0.15s ease;
}
.switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(13, 21, 38, 0.4);
  transition: transform 0.15s ease;
}
.switch input:checked + .switch-track { background: linear-gradient(120deg, var(--brand), var(--brand-2)); }
.switch input:checked + .switch-track .switch-knob { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { box-shadow: var(--focus-ring); }
.switch-label { font-size: 0.76rem; font-weight: 640; color: var(--ink-2); white-space: nowrap; }

/* Pricing ----------------------------------------------------------------- */

.pricing {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 18px;
  max-width: 900px;
  margin: 0 auto;
}
.price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow-xs);
}
.price-card--pro {
  border-color: color-mix(in srgb, var(--brand) 42%, var(--line));
  background:
    radial-gradient(420px 220px at 100% 0%, var(--brand-soft), transparent 72%),
    var(--card);
  box-shadow: var(--shadow);
}
.price-flag {
  position: absolute;
  top: 14px;
  right: 16px;
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 0.64rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
[data-theme="dark"] .price-flag { color: #0b1020; }
.price-head h3 { margin: 0; font-size: 1.1rem; }
.price { display: flex; align-items: baseline; gap: 4px; margin: 4px 0 2px; }
.price span { font-size: 2.2rem; font-weight: 800; letter-spacing: -0.03em; }
.price small { font-size: 0.82rem; font-weight: 600; color: var(--ink-3); }
.price-alt { margin: 0; font-size: 0.8rem; color: var(--ink-2); }

.price-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
  color: var(--ink-2);
}
.price-list li { display: flex; gap: 8px; align-items: flex-start; }
.price-list li > .tick-y,
.price-list li > .tick-n { flex: none; width: 1em; text-align: center; }
.price-list code { font-size: 0.78rem; }
.tick-y { color: var(--good); font-weight: 800; }
.tick-n { color: var(--ink-3); font-weight: 700; }
.price-card .btn { width: 100%; }
.price-foot { margin: 0; font-size: 0.76rem; color: var(--ink-3); }
.pro-active-note { color: var(--good); }
.pro-active-note strong { color: inherit; }

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.compare-table--plans { max-width: 900px; margin: 26px auto 0; }
.compare-table--plans td, .compare-table--plans th { text-align: center; }
.compare-table--plans th[scope="row"] { text-align: left; }
.compare-table--plans .col-pro { background: color-mix(in srgb, var(--brand-soft) 55%, transparent); color: var(--ink); font-weight: 600; }
.compare-table--plans thead .col-pro { color: var(--brand-soft-ink); }

/* Ad slot (house placeholder) --------------------------------------------- */

.ad-slot--house {
  display: block;
  margin: 18px auto 0;
  max-width: 100%;
  min-height: 0;
  padding: 14px 16px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  background: var(--card-2);
  text-align: center;
}
.ad-slot-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.ad-slot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 12px;
  color: var(--ink-2);
  font-size: 0.82rem;
}
.ad-slot-inner strong { font-size: 0.86rem; }
.ad-slot-inner span { color: var(--ink-3); font-size: 0.74rem; }

body.is-pro .ad-slot,
body.is-pro .ad-slot--house { display: none !important; }

/* Modals ------------------------------------------------------------------ */

body.has-modal { overflow: hidden; }

.modal {
  width: min(560px, calc(100vw - 28px));
  max-height: min(88vh, 760px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 40px 90px -30px rgba(13, 21, 38, 0.55);
  overflow: auto;
}
.modal::backdrop { background: rgba(8, 13, 25, 0.58); backdrop-filter: blur(2px); }
.modal.is-open {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: block;
}
.modal-card { position: relative; padding: clamp(20px, 3.4vw, 28px); }
.modal-card--sm { max-width: 520px; }
.modal-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--card-3);
  color: var(--ink-2);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.modal-x:hover { background: var(--line); color: var(--ink); }
.modal-head h2 { margin: 10px 0 6px; font-size: 1.3rem; }
.modal-head p { margin: 0; font-size: 0.86rem; color: var(--ink-2); }
.modal-body { margin-top: 18px; }

.modal-list {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  font-size: 0.87rem;
  color: var(--ink-2);
}
.modal-list li { position: relative; padding-left: 20px; }
.modal-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.5em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
}
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.modal-actions .btn { flex: 1 1 160px; }
.modal-foot { margin: 14px 0 0; font-size: 0.76rem; color: var(--ink-3); }

.license-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.license-form input {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  letter-spacing: 0.02em;
}
.license-form .btn { width: 100%; margin-top: 12px; }

.license-status {
  margin: 10px 0 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card-2);
  font-size: 0.79rem;
  line-height: 1.5;
  color: var(--ink-2);
}
.license-status.is-error {
  border-color: color-mix(in srgb, var(--bad) 40%, var(--line));
  background: var(--bad-soft);
  color: var(--bad);
}
.license-status.is-ok {
  border-color: color-mix(in srgb, var(--good) 40%, var(--line));
  background: var(--good-soft);
  color: var(--good);
}
.license-status[hidden] { display: none; }

.license-box {
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--good) 32%, var(--line));
  border-radius: var(--radius);
  background: var(--good-soft);
}
.license-box dl { display: grid; gap: 8px; margin: 10px 0 0; }
.license-box dt { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.license-box dd { margin: 1px 0 0; font-size: 0.88rem; font-weight: 620; color: var(--ink); word-break: break-all; }
.license-active .btn { margin-top: 12px; }

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

/* Responsive -------------------------------------------------------------- */

@media (max-width: 900px) {
  .site-nav .nav-secondary { display: none; }
  .pricing { grid-template-columns: 1fr; max-width: 560px; }
  .wm-body { grid-template-columns: 1fr; }
  .wm-preview-wrap { order: -1; }
  .preset-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compare-table--plans { font-size: 0.76rem; }
}

@media (max-width: 760px) {
  .wm-head { align-items: flex-start; }
  .wm-controls { grid-template-columns: 1fr; }
  .wm-panel { padding: 13px; }
  .compare-table--plans th[scope="row"] { min-width: 8.5em; }
}

@media (max-width: 560px) {
  .site-nav .nav-optional { display: none; }
  .site-nav a { padding: 7px 6px; font-size: 0.76rem; }
  .site-nav a[href="index.html"] { display: none; }
  .site-nav .nav-pro { padding: 6px 9px; }
  .header-inner { gap: 4px; }
  .plan-badge { display: none; }
  .modal { width: calc(100vw - 16px); border-radius: var(--radius-lg); }
  .modal-card { padding: 20px 16px; }
  .modal-actions .btn { flex: 1 1 100%; }
  .price span { font-size: 1.9rem; }
}

@media (max-width: 380px) {
  .site-nav a { padding: 6px 5px; font-size: 0.72rem; }
  .brand span { max-width: 108px; }
}

@media print {
  .wm-panel, .pricing, .modal, .limit-banner, .preset-row { display: none !important; }
}
