:root {
  --bg: #f5f7f4;
  --panel: #ffffff;
  --panel-soft: #eef3ec;
  --ink: #17201b;
  --muted: #647067;
  --line: #dce3d7;
  --accent: #1f7a4d;
  --accent-dark: #145a38;
  --accent-soft: #d9eee2;
  --danger: #a53b2b;
  --shadow: 0 16px 48px rgba(31, 67, 43, 0.10);
  --radius: 14px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body[data-theme="night"] {
  --bg: #101612;
  --panel: #17201b;
  --panel-soft: #1d2b22;
  --ink: #eef6ef;
  --muted: #a8b8ac;
  --line: #2c3c31;
  --accent: #42b777;
  --accent-dark: #91e1b3;
  --accent-soft: #193624;
  --danger: #e27664;
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  background: var(--bg);
}

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 54px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  backdrop-filter: blur(14px);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
}

.main-nav a,
.nav-menu-button {
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: transparent;
  font-size: 0.88rem;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
}

.main-nav a:hover,
.nav-menu-button:hover,
.nav-menu-button[aria-expanded="true"] {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.nav-menu-button::after {
  content: "▾";
  margin-left: 6px;
  font-size: 0.7rem;
}

.nav-menu-button[aria-expanded="true"]::after {
  content: "▴";
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent-dark);
  font-size: 0.84rem;
  font-weight: 900;
  white-space: nowrap;
}

.theme-toggle,
.language-select,
.language-link {
  padding: 6px 9px;
  border: 1px solid rgba(31, 122, 77, 0.18);
  border-radius: 999px;
  color: var(--accent-dark);
  background: transparent;
  text-decoration: none;
}

.theme-toggle {
  display: inline-grid;
  width: 36px;
  min-height: 34px;
  place-items: center;
  padding: 0;
  font-size: 1.05rem;
  font-weight: 900;
}

.language-select {
  min-height: 34px;
  max-width: 142px;
  background: var(--panel);
  font-size: 0.82rem;
  font-weight: 900;
}

.language-switcher {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.language-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  padding: 4px 8px 4px 5px;
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.88rem;
  line-height: 1;
  color: var(--accent-dark);
  font-weight: 950;
  background: var(--panel);
  text-shadow: none;
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.08);
}

.language-link.is-active {
  border-color: var(--accent-dark);
  color: #0f3f28;
  background: #dff5e9;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.78),
    0 0 0 2px rgba(31, 122, 77, 0.34),
    0 6px 14px rgba(31, 122, 77, 0.18);
}

.language-link.is-preview {
  color: rgba(15, 63, 40, 0.72);
  cursor: default;
  opacity: 0.88;
}

.flag-icon {
  display: inline-block;
  width: 25px;
  height: 17px;
  flex: 0 0 auto;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.18);
}

.flag-icon.flag-uk {
  background:
    linear-gradient(33deg, transparent 42%, #fff 42% 48%, #c8102e 48% 53%, #fff 53% 59%, transparent 59%),
    linear-gradient(147deg, transparent 42%, #fff 42% 48%, #c8102e 48% 53%, #fff 53% 59%, transparent 59%),
    linear-gradient(90deg, transparent 40%, #fff 40% 46%, #c8102e 46% 54%, #fff 54% 60%, transparent 60%),
    linear-gradient(0deg, transparent 36%, #fff 36% 44%, #c8102e 44% 56%, #fff 56% 64%, transparent 64%),
    #012169;
}

.flag-icon.flag-cn {
  background:
    radial-gradient(circle at 24% 28%, #ffde00 0 7%, transparent 8%),
    radial-gradient(circle at 39% 20%, #ffde00 0 2.5%, transparent 3%),
    radial-gradient(circle at 45% 31%, #ffde00 0 2.5%, transparent 3%),
    #de2910;
}

.flag-icon.flag-jp {
  background:
    radial-gradient(circle at 50% 50%, #bc002d 0 28%, transparent 29%),
    #fff;
}

.flag-icon.flag-de {
  background: linear-gradient(#000 0 33.33%, #dd0000 33.33% 66.66%, #ffce00 66.66%);
}

.flag-icon.flag-es {
  background:
    radial-gradient(circle at 35% 50%, #f1bf00 0 8%, transparent 9%),
    linear-gradient(#aa151b 0 25%, #f1bf00 25% 75%, #aa151b 75%);
}

.flag-icon.flag-fr {
  background: linear-gradient(90deg, #0055a4 0 33.33%, #fff 33.33% 66.66%, #ef4135 66.66%);
}

.flag-icon.flag-it {
  background: linear-gradient(90deg, #009246 0 33.33%, #fff 33.33% 66.66%, #ce2b37 66.66%);
}

.flag-icon.flag-kr {
  background:
    radial-gradient(circle at 48% 42%, #cd2e3a 0 15%, transparent 16%),
    radial-gradient(circle at 55% 58%, #0047a0 0 15%, transparent 16%),
    linear-gradient(35deg, transparent 8%, #111 8% 12%, transparent 12% 18%, #111 18% 22%, transparent 22%),
    linear-gradient(-35deg, transparent 78%, #111 78% 82%, transparent 82% 88%, #111 88% 92%, transparent 92%),
    #fff;
}

.flag-icon.flag-ru {
  background: linear-gradient(#fff 0 33.33%, #0039a6 33.33% 66.66%, #d52b1e 66.66%);
}

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

.mega-menu {
  position: sticky;
  top: 54px;
  z-index: 19;
  padding: 14px 16px 0;
}

.mega-menu-inner {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 22px 70px rgba(31, 67, 43, 0.16);
}

.tool-column {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.tool-column h2 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tool-column a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.disabled-tool {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.tool-column a:hover {
  color: var(--accent-dark);
}

.disabled-tool {
  color: var(--muted);
}

.disabled-tool em {
  color: var(--muted);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.tool-icon {
  display: inline-grid;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 6px;
  color: #ffffff;
  background: var(--accent);
  font-size: 0.7rem;
  font-weight: 900;
}

.tool-icon.organize {
  background: #d7674b;
}

.tool-icon.convert {
  background: #3d7bba;
}

.tool-icon.design {
  background: #a2782a;
}

.tool-icon.muted {
  background: #9aa59d;
}

.shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0 40px;
}

.hero {
  min-height: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(238, 245, 234, 0.96)),
    radial-gradient(circle at 92% 0%, rgba(31, 122, 77, 0.10), transparent 28%);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: #ffffff;
  background: var(--accent);
  letter-spacing: 0;
}

.trust-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  color: var(--accent-dark);
  font-size: 0.86rem;
  font-weight: 700;
}

.trust-line span {
  padding: 6px 9px;
  border: 1px solid rgba(31, 122, 77, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.7fr);
  gap: 18px;
  align-items: stretch;
  padding: 20px 2px 0;
}

.eyebrow,
.tool-kicker {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 10px;
  font-size: clamp(1.9rem, 3.4vw, 3rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-text {
  max-width: 620px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.hero-proof span {
  padding: 7px 10px;
  border: 1px solid rgba(31, 122, 77, 0.18);
  border-radius: 999px;
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
  font-weight: 900;
}

.privacy-card {
  padding: 16px;
  border: 1px solid rgba(31, 122, 77, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
}

.privacy-card h2 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.privacy-card p,
.privacy-card li {
  color: var(--muted);
  line-height: 1.55;
}

.privacy-card ul {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0 0;
  padding-left: 0;
  list-style: none;
}

.privacy-card li {
  padding: 5px 8px;
  border: 1px solid rgba(31, 122, 77, 0.16);
  border-radius: 999px;
  background: #f7faf5;
  font-size: 0.86rem;
}

.usage-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.72fr);
  gap: 18px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(31, 122, 77, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.usage-panel h2 {
  margin: 0 0 6px;
  font-size: clamp(1.35rem, 2.5vw, 2rem);
}

.usage-panel p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.usage-stats {
  display: grid;
  gap: 8px;
}

.usage-stats span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(31, 122, 77, 0.14);
  border-radius: 12px;
  background: #f8fbf6;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.usage-stats strong {
  color: var(--accent-dark);
  font-size: 1.35rem;
}

.frame-teaser {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(320px, 1fr);
  align-items: center;
  gap: 18px;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(31, 122, 77, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
  overflow: hidden;
}

.frame-teaser-copy h2 {
  margin-bottom: 6px;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
}

.frame-teaser-copy p {
  max-width: 40ch;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.frame-teaser-art {
  position: relative;
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(96px, 0.42fr) minmax(190px, 0.95fr);
  min-height: 190px;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.teaser-pair {
  position: relative;
  display: flex;
  min-height: 210px;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.frame-demo {
  position: relative;
  width: clamp(108px, 11vw, 158px);
  aspect-ratio: 0.72;
  border: 0;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 16px 42px rgba(31, 67, 43, 0.16);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.frame-demo:hover {
  box-shadow: 0 20px 50px rgba(31, 67, 43, 0.2);
  transform: translateY(-2px) rotate(var(--tilt));
}

.frame-demo-gold {
  --tilt: -7deg;
  transform: translateY(10px) rotate(var(--tilt));
}

.frame-demo-silver {
  --tilt: 7deg;
  transform: translateY(-10px) rotate(var(--tilt));
}

.frame-demo-image {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    url("./assets/frame-gilded-floral-transparent.png") center / 100% 100% no-repeat,
    linear-gradient(#ffffff, #ffffff);
}

.frame-demo-gold .frame-demo-image::before,
.frame-demo-silver .frame-demo-image::before {
  content: "";
  position: absolute;
  inset: 24%;
  background-position: center;
  background-size: cover;
}

.frame-demo-gold .frame-demo-image::before {
  background-image: url("./assets/art-mona-lisa.jpg");
}

.frame-demo-silver .frame-demo-image {
  background:
    url("./assets/frame-straight-silver-floral-tight.png") center / 100% 100% no-repeat,
    linear-gradient(#ffffff, #ffffff);
}

.frame-demo-silver .frame-demo-image::before {
  inset: 22%;
  background-image: url("./assets/art-starry-night.jpg");
}

.scan-demo {
  position: relative;
  width: clamp(116px, 12vw, 170px);
  aspect-ratio: 0.72;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 16px 42px rgba(31, 67, 43, 0.14);
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.scan-demo:hover {
  box-shadow: 0 20px 50px rgba(31, 67, 43, 0.2);
  transform: translateY(-2px) rotate(var(--tilt));
}

.scan-demo-left {
  --tilt: 7deg;
  transform: translateY(-8px) rotate(var(--tilt));
}

.scan-demo-right {
  --tilt: -7deg;
  transform: translateY(12px) rotate(var(--tilt));
}

.scan-demo-image {
  position: absolute;
  inset: 0;
  background-color: #ffffff;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.scan-demo-cn {
  background-image: url("./assets/demo-id-scan-a.jpg");
}

.scan-demo-qld {
  background-image: url("./assets/demo-id-scan-b.jpg");
}

.receipt-demo {
  position: relative;
  justify-self: center;
  width: clamp(88px, 8.4vw, 126px);
  aspect-ratio: 0.72;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 16px 42px rgba(31, 67, 43, 0.14);
  overflow: hidden;
  transform: translateY(2px) rotate(2deg);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.receipt-demo:hover {
  box-shadow: 0 20px 50px rgba(31, 67, 43, 0.2);
  transform: translateY(-2px) rotate(2deg);
}

.receipt-demo-image {
  position: absolute;
  inset: 0;
  background: #ffffff url("./assets/demo-receipt-sheet.jpg") center / cover no-repeat;
}

.workspace {
  margin-top: 16px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  overflow-x: auto;
}

.tab {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.tab.active {
  color: #ffffff;
  background: var(--accent);
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

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

.tool-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(31, 67, 43, 0.06);
}

.tool-card.wide {
  grid-column: 1 / -1;
}

.tool-card.featured {
  grid-column: 1 / -1;
}

.tool-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.tool-head h2 {
  margin-bottom: 0;
  font-size: 1.2rem;
  letter-spacing: 0;
}

.status-pill {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 0.78rem;
  font-weight: 800;
}

.tool-desc {
  min-height: 36px;
  color: var(--muted);
  line-height: 1.45;
}

.drop-zone {
  display: grid;
  gap: 5px;
  min-height: 96px;
  margin: 12px 0;
  padding: 14px;
  place-items: center;
  border: 1px dashed rgba(31, 122, 77, 0.46);
  border-radius: var(--radius);
  color: var(--accent-dark);
  background: #f8fbf6;
  text-align: center;
}

.drop-zone.compact {
  min-height: 86px;
}

.drop-zone input {
  width: min(100%, 280px);
}

.drop-zone span {
  font-weight: 900;
}

.drop-zone small {
  color: var(--muted);
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.file-chooser {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  color: #ffffff;
  background: var(--accent);
  font-size: 0.88rem;
  font-weight: 900;
}

.drop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.capture-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(31, 122, 77, 0.25);
  border-radius: 12px;
  color: var(--accent-dark);
  background: #ffffff;
  font-size: 0.88rem;
  font-weight: 900;
}

.capture-button:hover {
  border-color: rgba(31, 122, 77, 0.45);
  background: #eef9f1;
}

.icon-capture {
  width: 42px;
  min-width: 42px;
  padding: 0;
  font-size: 1.08rem;
  line-height: 1;
}

.drop-zone:hover .file-chooser {
  background: var(--accent-dark);
}

.drop-zone.drag-over {
  border-color: var(--accent);
  background: #eef9f1;
  box-shadow: inset 0 0 0 2px rgba(31, 122, 77, 0.14);
}

.drop-zone.drag-over .file-chooser {
  background: var(--accent-dark);
}

.file-status {
  color: var(--accent-dark);
  font-size: 0.88rem;
  font-weight: 800;
}

.inline-form,
.settings-grid {
  display: grid;
  gap: 8px;
}

.inline-form {
  margin: 14px 0;
}

.inline-form.two {
  grid-template-columns: 0.7fr 1fr;
  align-items: center;
}

label {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  min-height: 38px;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #ffffff;
}

input[type="color"] {
  width: 100%;
  min-height: 38px;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

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

.range-label {
  display: block;
}

.range-ruler {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 4px;
  padding-top: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.range-ruler::before {
  content: "";
  position: absolute;
  top: 0;
  left: 7px;
  right: 7px;
  height: 1px;
  background:
    radial-gradient(circle, rgba(31, 122, 77, 0.72) 0 2px, transparent 2.5px) left center / 8px 8px no-repeat,
    radial-gradient(circle, rgba(31, 122, 77, 0.72) 0 2px, transparent 2.5px) center center / 8px 8px no-repeat,
    radial-gradient(circle, rgba(31, 122, 77, 0.72) 0 2px, transparent 2.5px) right center / 8px 8px no-repeat,
    linear-gradient(90deg, rgba(31, 122, 77, 0.24), rgba(31, 122, 77, 0.34), rgba(31, 122, 77, 0.24));
}

.range-ruler span:nth-child(1) {
  text-align: left;
}

.range-ruler span:nth-child(2) {
  text-align: center;
}

.range-ruler span:nth-child(3) {
  text-align: right;
}

.settings-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 12px 0 16px;
}

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

.pdf-layout-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 9px;
  margin: 12px 0 14px;
}

.frame-showcase {
  display: grid;
  grid-column: span 4;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 9px;
  align-self: end;
}

.frame-thumb {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 70px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfa;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
  text-align: left;
}

.frame-thumb:hover,
.frame-thumb.is-active {
  border-color: rgba(31, 122, 77, 0.65);
  background: #f4faf3;
  box-shadow: 0 8px 18px rgba(31, 67, 43, 0.09);
}

.frame-thumb-art {
  position: relative;
  display: block;
  width: 54px;
  height: 54px;
  border-radius: 7px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(25, 45, 34, 0.14);
}

.frame-thumb-art::before {
  content: "";
  position: absolute;
  inset: 12px;
  z-index: 1;
  background-image: var(--art-url);
  background-position: center;
  background-size: cover;
}

.frame-thumb-art.page-frame-ornate-gold::after,
.frame-thumb-art.page-frame-straight-gold::after,
.frame-thumb-art.page-frame-straight-silver::after {
  content: "";
  position: absolute;
  z-index: 2;
  pointer-events: none;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.frame-thumb-art.page-frame-ornate-gold::after {
  inset: 0;
  background-image: url("./assets/frame-gilded-floral-transparent.png");
}

.frame-thumb-art.page-frame-straight-gold::after {
  inset: 0;
  background-image: url("./assets/frame-straight-gold-floral-tight.png");
}

.frame-thumb-art.page-frame-straight-silver::after {
  inset: 0;
  background-image: url("./assets/frame-straight-silver-floral-tight.png");
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfa;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.primary {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  color: #ffffff;
  background: var(--accent);
  font-weight: 900;
  transition: transform 0.16s ease, background 0.16s ease;
}

.primary:hover {
  background: var(--accent-dark);
}

.primary:active {
  transform: translateY(1px);
}

.file-list,
.page-editor,
.preview-grid {
  display: grid;
  gap: 7px;
  margin: 10px 0;
}

.page-editor {
  grid-template-columns: repeat(auto-fill, minmax(154px, 1fr));
  gap: 12px;
}

.page-editor-hint {
  margin: 8px 0 4px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.merge-editor-hint {
  margin: 8px 0 4px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

#mergeList {
  grid-template-columns: repeat(auto-fill, minmax(154px, 1fr));
  gap: 12px;
}

.merge-card {
  align-items: stretch;
  flex-direction: column;
  min-height: 242px;
  cursor: grab;
}

.merge-card:active {
  cursor: grabbing;
}

.merge-card.dragging {
  opacity: 0.42;
}

.merge-card.drag-over {
  border-color: rgba(31, 122, 77, 0.7);
  box-shadow: 0 0 0 3px rgba(31, 122, 77, 0.12);
}

.merge-thumb {
  display: grid;
  min-height: 150px;
  place-items: center;
  border: 1px solid rgba(31, 122, 77, 0.16);
  border-radius: 8px;
  background: #eef4ee;
  overflow: hidden;
}

.merge-thumb img {
  display: block;
  max-width: 100%;
  max-height: 178px;
  object-fit: contain;
}

.merge-thumb-placeholder {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.merge-card .file-name {
  flex: 0 0 auto;
  white-space: normal;
}

.merge-card .row-actions {
  justify-content: flex-start;
}

.file-row,
.page-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfa;
}

.file-name {
  flex: 1 1 180px;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.row-actions button,
.page-row button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
}

.page-row.excluded {
  opacity: 0.55;
}

.page-row {
  align-items: stretch;
  flex-direction: column;
  min-height: 242px;
  cursor: grab;
}

.page-row:active {
  cursor: grabbing;
}

.page-row.dragging {
  opacity: 0.42;
}

.page-row.drag-over {
  border-color: rgba(31, 122, 77, 0.7);
  box-shadow: 0 0 0 3px rgba(31, 122, 77, 0.12);
}

.page-thumb {
  display: grid;
  min-height: 150px;
  place-items: center;
  border: 1px solid rgba(31, 122, 77, 0.16);
  border-radius: 8px;
  background: #eef4ee;
  overflow: hidden;
}

.page-thumb img,
.page-thumb canvas {
  display: block;
  max-width: 100%;
  max-height: 178px;
  object-fit: contain;
}

.page-thumb-placeholder {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.page-row .file-name {
  flex: 0 0 auto;
  white-space: normal;
}

.page-row .row-actions {
  justify-content: flex-start;
}

.result {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.result strong {
  color: var(--accent-dark);
}

.tool-feedback {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.tool-feedback details {
  border: 1px solid rgba(31, 122, 77, 0.14);
  border-radius: 12px;
  background: #f8fbf6;
}

.tool-feedback summary {
  cursor: pointer;
  padding: 11px 12px;
  color: var(--accent-dark);
  font-weight: 900;
}

.feedback-body {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.feedback-list {
  display: grid;
  gap: 8px;
}

.feedback-empty,
.feedback-small {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.feedback-note {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.feedback-note p {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
}

.feedback-note span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.feedback-form {
  display: grid;
  gap: 8px;
}

.feedback-form label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-weight: 900;
}

.feedback-form textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #ffffff;
  font: inherit;
  line-height: 1.45;
}

.feedback-form button {
  justify-self: start;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(31, 122, 77, 0.24);
  border-radius: 10px;
  color: #ffffff;
  background: var(--accent);
  font-weight: 900;
}

.result.error {
  color: var(--danger);
}

.seo-page {
  max-width: 1120px;
}

.seo-hero {
  margin-top: 18px;
  padding: clamp(20px, 4vw, 38px);
  border: 1px solid rgba(31, 122, 77, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(246, 251, 247, 0.88)),
    radial-gradient(circle at 100% 0%, rgba(31, 122, 77, 0.1), transparent 34%);
}

.seo-hero h1 {
  max-width: 820px;
  margin-bottom: 12px;
  font-size: clamp(2rem, 4.3vw, 4rem);
}

.seo-hero p {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.seo-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.seo-primary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  color: #ffffff;
  background: var(--accent);
  font-weight: 900;
  text-decoration: none;
}

.seo-primary-link:hover {
  background: var(--accent-dark);
}

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

.seo-content-card,
.seo-keywords,
.seo-related {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.seo-content-card h2,
.seo-keywords h2,
.seo-related h2 {
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.seo-content-card ul,
.seo-content-card ol {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.75;
}

.seo-keywords {
  margin-top: 16px;
}

.seo-keywords div,
.seo-related nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.seo-keywords span,
.seo-related a {
  padding: 7px 10px;
  border: 1px solid rgba(31, 122, 77, 0.16);
  border-radius: 999px;
  color: var(--accent-dark);
  background: #f8fbf6;
  font-size: 0.86rem;
  font-weight: 900;
  text-decoration: none;
}

.seo-related {
  margin-top: 16px;
}

.seo-faq {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(320px, 0.58fr);
  gap: 18px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.seo-faq h2 {
  margin-bottom: 8px;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.seo-faq p {
  color: var(--muted);
  line-height: 1.55;
}

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

.faq-list details {
  border: 1px solid rgba(31, 122, 77, 0.14);
  border-radius: 12px;
  background: #f8fbf6;
}

.faq-list summary {
  cursor: pointer;
  padding: 12px;
  color: var(--ink);
  font-weight: 900;
}

.faq-list p {
  margin: 0;
  padding: 0 12px 12px;
}

.preview-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.image-pdf-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.workflow-panel {
  display: grid;
  grid-template-columns: minmax(190px, 0.38fr) minmax(280px, 0.62fr);
  gap: 10px 12px;
  align-items: end;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfa;
}

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

.compact-check {
  min-height: 42px;
  padding: 9px 10px;
}

.workflow-note {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.brightness-control {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
}

.brightness-control > span:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 800;
}

.brightness-control output {
  color: var(--accent-dark);
}

.brightness-control input[type="range"] {
  width: 100%;
}

.range-ticks {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.image-pdf-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fbfcfa;
}

.image-pdf-thumb {
  display: grid;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  place-items: center;
  background: var(--panel-soft);
}

.image-pdf-rotor {
  display: grid;
  width: 92%;
  height: 92%;
  place-items: center;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.image-pdf-rotor.turn {
  width: 70%;
  height: 96%;
}

.image-pdf-meta {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.image-pdf-meta strong {
  overflow: hidden;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-pdf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.image-pdf-actions button {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #ffffff;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 800;
}

.image-pdf-actions button.scan-active {
  border-color: rgba(31, 122, 77, 0.45);
  background: #e7f6ee;
  color: var(--accent-dark);
}

.scan-editor {
  margin: 12px 0;
  padding: 14px;
  border: 1px solid rgba(31, 122, 77, 0.28);
  border-radius: 16px;
  background: #fbfcfa;
}

.scan-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.scan-editor h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.scan-editor p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.secondary-button,
.scan-actions button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.scan-stage-wrap {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 10px;
  border: 1px dashed rgba(31, 122, 77, 0.28);
  border-radius: 14px;
  background:
    linear-gradient(45deg, rgba(31, 122, 77, 0.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(31, 122, 77, 0.06) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(31, 122, 77, 0.06) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(31, 122, 77, 0.06) 75%);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.scan-canvas {
  display: block;
  width: min(100%, 720px);
  height: auto;
  border-radius: 10px;
  background: #111111;
  cursor: crosshair;
  touch-action: none;
}

.scan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.page-preview-wrap {
  margin: 12px 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfa;
  overflow: hidden;
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.preview-head h3 {
  margin: 0;
  font-size: 1rem;
}

.preview-head span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.page-preview {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.preview-page {
  position: relative;
  display: grid;
  flex: 0 1 auto;
  width: 360px;
  max-width: 100%;
  aspect-ratio: 0.707;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(31, 67, 43, 0.12);
  pointer-events: none;
  overflow: hidden;
}

.preview-page.landscape-page,
.preview-page.fit-page {
  aspect-ratio: 1.414;
  width: 560px;
  max-width: 100%;
}

.preview-cell {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  border: 1px dashed rgba(31, 122, 77, 0.26);
  border-radius: 8px;
  background: #f8fbf6;
  overflow: hidden;
}

.preview-page.page-frame-thin-black {
  box-shadow:
    inset 0 0 0 4px #111111,
    0 10px 30px rgba(31, 67, 43, 0.12);
}

.preview-page.page-frame-white-mat {
  box-shadow:
    inset 0 0 0 26px #ffffff,
    inset 0 0 0 28px #d8d8d0,
    0 10px 30px rgba(31, 67, 43, 0.12);
}

.preview-page.page-frame-deep-red {
  box-shadow:
    inset 0 0 0 34px #4b0000,
    0 10px 30px rgba(31, 67, 43, 0.12);
}

.preview-page.page-frame-photo-print {
  box-shadow:
    inset 0 0 0 30px #ffffff,
    inset 0 0 0 32px #eeeeee,
    0 10px 30px rgba(31, 67, 43, 0.12);
}

.preview-page.page-frame-film-strip {
  box-shadow:
    inset 0 0 0 36px #111111,
    0 10px 30px rgba(31, 67, 43, 0.12);
}

.preview-page.page-frame-film-strip::before {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 13px, rgba(255,255,255,.9) 13px 19px, transparent 19px 32px) left top / 10px 100% no-repeat,
    repeating-linear-gradient(0deg, transparent 0 13px, rgba(255,255,255,.9) 13px 19px, transparent 19px 32px) right top / 10px 100% no-repeat;
}

.preview-page.page-frame-ornate-gold::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: url("./assets/frame-gilded-floral-transparent.png") center / 100% 100% no-repeat;
}

.preview-page.page-frame-straight-gold::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: url("./assets/frame-straight-gold-floral-tight.png") center / 100% 100% no-repeat;
}

.preview-page.page-frame-straight-silver::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: url("./assets/frame-straight-silver-floral-tight.png") center / 100% 100% no-repeat;
}

.preview-page.full-page-cover .preview-cell {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.preview-page.full-page-cover .preview-image {
  width: 100%;
  height: 100%;
  background-size: cover;
}

.preview-cell.empty {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.preview-image {
  width: 92%;
  height: 92%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
}

.preview-label {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 5px;
  z-index: 3;
  overflow: hidden;
  padding: 3px 5px;
  border-radius: 6px;
  color: #17311f;
  background: rgba(255, 255, 255, 0.82);
  font-size: 0.68rem;
  font-weight: 850;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-cell.cover .preview-image {
  width: 100%;
  height: 100%;
  background-size: cover;
}

.preview-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fbfcfa;
}

.preview-item img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.preview-item a {
  display: block;
  padding: 10px;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.crop-preview-wrap {
  margin-top: 12px;
}

.crop-preview {
  display: grid;
  min-height: 392px;
  height: 392px;
  place-items: center;
  padding: 12px;
  border: 1px dashed rgba(31, 122, 77, 0.35);
  border-radius: 14px;
  background: #fbfdf9;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
  overflow: hidden;
}

.crop-preview canvas {
  display: block;
  max-width: 100%;
  width: min(100%, 520px);
  height: auto;
  max-height: 360px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(24, 52, 36, 0.12);
}

.source-preview {
  margin-top: 12px;
}

.preview-section-head {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.preview-item.source-item span {
  display: block;
  overflow: hidden;
  padding: 9px 10px;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.download-link {
  color: var(--accent-dark);
  font-weight: 900;
}

.download-button {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin: 0 8px 0 2px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  color: #ffffff;
  background: var(--accent);
  font-size: 0.86rem;
  font-weight: 900;
}

.download-button:hover {
  background: var(--accent-dark);
}

.site-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

.site-footer p {
  max-width: 520px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.visit-counter {
  font-weight: 800;
}

.analytics-note {
  font-size: 0.82rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.site-footer a,
.text-link {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

.site-footer a:hover,
.text-link:hover {
  text-decoration: underline;
}

.simple-page {
  max-width: 920px;
}

.simple-topbar {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

.legal-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(31, 67, 43, 0.06);
}

.legal-card h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 5vw, 3.2rem);
}

.legal-card h2 {
  margin: 24px 0 8px;
  font-size: 1.1rem;
}

.legal-card p {
  color: var(--muted);
  line-height: 1.65;
}

.updated {
  font-size: 0.9rem;
}

.contact-panel {
  display: grid;
  gap: 4px;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid rgba(31, 122, 77, 0.18);
  border-radius: 12px;
  background: #f8fbf6;
}

.contact-panel span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.site-feedback-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid rgba(31, 122, 77, 0.16);
  border-radius: 14px;
  background: #f8fbf6;
}

.site-feedback-form label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-weight: 900;
}

.site-feedback-form select,
.site-feedback-form input,
.site-feedback-form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #ffffff;
  font: inherit;
}

.feedback-comment-field,
.site-feedback-form .feedback-small {
  grid-column: 1 / -1;
}

.feedback-submit {
  width: auto;
  min-width: 180px;
}

.contact-feedback-wall {
  margin: 18px 0;
}

.contact-feedback-note span {
  margin: 0 0 6px;
}

body[data-theme="night"] .mega-menu-inner,
body[data-theme="night"] .privacy-card,
body[data-theme="night"] .frame-teaser,
body[data-theme="night"] .usage-panel,
body[data-theme="night"] .tabs,
body[data-theme="night"] .tool-card,
body[data-theme="night"] .seo-faq,
body[data-theme="night"] .seo-hero,
body[data-theme="night"] .seo-content-card,
body[data-theme="night"] .seo-keywords,
body[data-theme="night"] .seo-related,
body[data-theme="night"] .drop-zone,
body[data-theme="night"] .image-pdf-item,
body[data-theme="night"] .workflow-panel,
body[data-theme="night"] .scan-editor,
body[data-theme="night"] .file-row,
body[data-theme="night"] .page-row,
body[data-theme="night"] .page-preview-wrap,
body[data-theme="night"] .preview-item,
body[data-theme="night"] .crop-preview,
body[data-theme="night"] .site-footer,
body[data-theme="night"] .simple-topbar,
body[data-theme="night"] .legal-card,
body[data-theme="night"] .contact-panel {
  background: var(--panel);
}

body[data-theme="night"] .hero {
  background:
    linear-gradient(135deg, rgba(23, 32, 27, 0.95), rgba(25, 45, 34, 0.96)),
    radial-gradient(circle at 92% 0%, rgba(66, 183, 119, 0.13), transparent 30%);
}

body[data-theme="night"] .privacy-card li,
body[data-theme="night"] .hero-proof span,
body[data-theme="night"] .usage-stats span,
body[data-theme="night"] .frame-thumb,
body[data-theme="night"] .preview-cell,
body[data-theme="night"] .image-pdf-thumb,
body[data-theme="night"] .scan-stage-wrap,
body[data-theme="night"] .check-row,
body[data-theme="night"] .crop-preview,
body[data-theme="night"] .tool-feedback details,
body[data-theme="night"] .faq-list details,
body[data-theme="night"] .site-feedback-form,
body[data-theme="night"] .seo-keywords span,
body[data-theme="night"] .seo-related a {
  background: var(--panel-soft);
}

body[data-theme="night"] .feedback-note,
body[data-theme="night"] .feedback-form textarea,
body[data-theme="night"] .site-feedback-form select,
body[data-theme="night"] .site-feedback-form input,
body[data-theme="night"] .site-feedback-form textarea {
  background: var(--panel);
}

body[data-theme="night"] .secondary-button,
body[data-theme="night"] .scan-actions button,
body[data-theme="night"] .image-pdf-actions button {
  background: var(--panel);
  color: var(--ink);
}

body[data-theme="night"] .check-row {
  border-color: #49604f;
  color: var(--ink);
}

body[data-theme="night"] .check-row input {
  accent-color: var(--accent);
}

body[data-theme="night"] .image-pdf-meta strong,
body[data-theme="night"] .file-name,
body[data-theme="night"] .preview-item.source-item span {
  color: var(--ink);
}

body[data-theme="night"] .row-actions button,
body[data-theme="night"] .page-row button,
body[data-theme="night"] .image-pdf-actions button {
  border-color: #49604f;
  color: var(--ink);
  background: #132019;
}

body[data-theme="night"] .row-actions button:hover,
body[data-theme="night"] .page-row button:hover,
body[data-theme="night"] .image-pdf-actions button:hover {
  border-color: var(--accent);
  background: #183021;
}

body[data-theme="night"] input,
body[data-theme="night"] select {
  color: var(--ink);
  background: #0f1712;
}

body[data-theme="night"] .frame-demo {
  background: #ffffff;
}

@media (max-width: 980px) {
  .app-header {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    grid-column: 1 / -1;
    order: 3;
  }

  .header-actions {
    justify-content: flex-end;
  }

  .mega-menu {
    top: 94px;
  }

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

  .hero-grid,
  .usage-panel,
  .frame-teaser,
  .seo-faq,
  .seo-content-grid,
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .site-feedback-form {
    grid-template-columns: 1fr;
  }

  .frame-teaser-art {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 160px;
  }

  .teaser-pair {
    min-height: 180px;
  }

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

  .frame-showcase {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .app-header {
    gap: 8px;
    padding: 8px 10px;
  }

  .main-nav a,
  .nav-menu-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.82rem;
  }

  .language-select {
    max-width: 118px;
  }

  .language-switcher {
    gap: 4px;
  }

  .language-link {
    padding-inline: 4px 6px;
  }

  .mega-menu {
    top: 92px;
    padding: 8px 10px 0;
  }

  .mega-menu-inner {
    grid-template-columns: 1fr;
    gap: 14px;
    max-height: calc(100dvh - 112px);
    overflow: auto;
    padding: 16px;
  }

  .shell {
    width: min(100% - 20px, 1220px);
    padding-top: 10px;
  }

  .hero {
    padding: 12px;
    border-radius: 16px;
  }

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

  .trust-line {
    justify-content: flex-start;
  }

  .hero-grid {
    gap: 12px;
    padding-top: 18px;
  }

  .frame-teaser {
    gap: 12px;
    padding: 14px;
  }

  .frame-teaser-art {
    min-height: 130px;
    gap: 10px;
  }

  .frame-demo {
    width: min(42vw, 140px);
  }

  h1 {
    font-size: clamp(2rem, 10vw, 2.55rem);
    line-height: 1.04;
  }

  .hero-text {
    font-size: 0.94rem;
  }

  .privacy-card {
    padding: 12px;
  }

  .tabs {
    gap: 4px;
  }

  .tab {
    flex: 1 0 auto;
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.9rem;
  }

  .tool-card {
    padding: 14px;
  }

  .settings-grid,
  .pdf-layout-grid,
  .workflow-panel,
  .inline-form.two {
    grid-template-columns: 1fr;
  }

  .workflow-options {
    grid-template-columns: 1fr;
  }

  .scan-editor-head {
    flex-direction: column;
  }

  .scan-editor-head .secondary-button {
    width: 100%;
  }

  .frame-showcase {
    grid-template-columns: 1fr;
  }

  .file-row,
  .page-row {
    align-items: stretch;
    flex-direction: column;
  }

  .row-actions {
    flex-wrap: wrap;
  }

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

  .site-footer {
    flex-direction: column;
  }

  .site-footer nav {
    justify-content: flex-start;
  }
}
