/* BYEOLI Film Emulate — darkroom theme */
:root {
  --bg: #050505;
  --bg-2: #0d0d0d;
  --bg-3: #161616;
  --line: #262626;
  --ink: #ece7df;
  --ink-2: #b9b3aa;
  --muted: #8a847c;
  --red: #ec4a3c;
  --red-ink: #ff6a5c;
  --red-deep: #6e1d17;
  --focus: #ffb3aa;
  --radius: 10px;
  --serif: "Noto Serif Thai", "Times New Roman", serif;
  --sans: "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 3vw, 28px);
  color-scheme: dark;
  /* subtle film grain for page surfaces (never placed over the photo preview) */
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background-color: var(--bg);
  background-image: var(--grain);
  background-size: 180px 180px;
  background-blend-mode: soft-light;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.serif { font-family: var(--serif); font-stretch: 75%; }
.noscript { padding: 24px; text-align: center; }

/* ---------- small UI parts ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-3); color: var(--red-ink);
  border: 1px solid transparent; border-radius: 6px;
  padding: 6px 10px; min-height: 32px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.pill:hover { border-color: #3a2a28; }
.pill[aria-pressed="true"] { background: var(--red); color: #140504; }
.pill.brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px var(--red); }
.reg { font-weight: 400; }
.label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--red-ink); margin: 0; }
.label.muted { color: var(--muted); font-weight: 500; }
.note { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.note.warn { color: #ffb08a; }
.fine { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: 8px;
  font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none;
  border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--red); color: #160504; }
.btn-primary:hover { background: var(--red-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: #3b3b3b; }
.btn-ghost:hover { border-color: var(--red); color: var(--red-ink); }
.btn-small { min-height: 38px; padding: 7px 14px; font-size: 14px; }
.btn.block { display: flex; width: 100%; margin-top: 10px; }
.btn:disabled, .icon-btn:disabled { opacity: .4; cursor: default; }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center;
  background: var(--bg-3); border: 1px solid transparent; border-radius: 8px; color: var(--ink); cursor: pointer;
}
.icon-btn:not(:disabled):hover { border-color: var(--red); color: var(--red-ink); }

/* grain texture inside headline letters */
.grain-text {
  color: var(--red);
  background-color: var(--red);
  background-image: var(--grain);
  background-size: 140px 140px;
  background-blend-mode: multiply;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .grain-text { -webkit-text-fill-color: var(--red); background: none; }
}

/* ---------- home ---------- */
.topnav {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 14px var(--gutter); position: sticky; top: 0; z-index: 5;
  background: linear-gradient(var(--bg) 60%, transparent);
}
.navlinks { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.home { max-width: 1120px; margin: 0 auto; padding: 8px var(--gutter) 40px; }
.headline {
  font-family: var(--serif); font-stretch: 70%; font-weight: 500;
  font-size: clamp(40px, 7.4vw, 86px); line-height: 1.02; letter-spacing: -0.01em;
  margin: 18px 0 26px; max-width: 14ch;
}
html[lang="en"] .headline { font-stretch: 75%; }

.dropzone {
  display: block; position: relative; cursor: pointer;
  border: 1.5px dashed #4a3532; border-radius: 16px;
  background: rgba(14, 10, 10, .78);
  min-height: clamp(260px, 42vh, 420px);
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--red); background: rgba(40, 12, 10, .55); }
.dz-inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 20px; text-align: center; }
.dz-icon { color: var(--red-ink); margin-bottom: 4px; }
.dz-btn { min-width: 200px; min-height: 52px; font-size: 17px; }
.dz-hint { color: var(--ink-2); font-size: 15px; }
.dz-formats { color: var(--muted); font-size: 12px; letter-spacing: .08em; margin-top: 6px; }
.home-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 16px 0 0; }
.privacy { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; margin: 0; }
.privacy svg { color: var(--red-ink); flex: none; }

.example { margin-top: 64px; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.example-note { color: var(--muted); font-size: 13px; margin: 8px 0 0; }

/* before/after compare (used on home) */
.compare { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 4 / 3; user-select: none; }
.compare canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.compare-before { position: absolute; inset: 0; overflow: hidden; clip-path: inset(0 50% 0 0); }
.compare-range { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.compare::after { content: ""; position: absolute; top: 0; bottom: 0; left: var(--split, 50%); width: 2px; background: var(--ink); transform: translateX(-1px); pointer-events: none; box-shadow: 0 0 6px rgba(0,0,0,.6); }
.compare-tag { position: absolute; top: 10px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: rgba(0,0,0,.6); color: var(--ink); padding: 3px 8px; border-radius: 4px; pointer-events: none; }
.compare-tag.left { left: 10px; } .compare-tag.right { right: 10px; }

.brand-teaser { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 56px; }
.teaser-card { display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: var(--radius); background: var(--bg-2); border: 1px solid var(--line); text-decoration: none; }
.teaser-card:hover { border-color: var(--red-deep); }
.teaser-title { font-size: clamp(22px, 3vw, 32px); color: var(--red); line-height: 1.1; }

.site-footer { padding: 40px var(--gutter) 0; overflow: hidden; }
.wordmark {
  font-family: var(--sans); font-weight: 700; color: var(--red-deep);
  font-size: clamp(56px, 15vw, 210px); line-height: .8; letter-spacing: -0.03em; white-space: nowrap;
  margin-top: 12px; transform: translateY(8%);
}

/* ---------- editor ---------- */
.editor {
  height: 100vh; height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-rows: auto minmax(0, 1fr) 104px;
  grid-template-areas: "top top" "stage panel" "strip panel";
}
.ed-top { grid-area: top; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px var(--gutter); border-bottom: 1px solid var(--line); }
.ed-tools-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: center; }
.btn-save { min-height: 40px; padding: 8px 22px; }

.stage { grid-area: stage; position: relative; background: #0a0a0a; display: grid; place-items: center; padding: 16px; min-height: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#preview { max-width: 100%; max-height: 100%; display: block; box-shadow: 0 10px 40px rgba(0,0,0,.6); cursor: pointer; }
.stage-badge { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.72); color: var(--ink); padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.stage-hint { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--muted); pointer-events: none; white-space: nowrap; }
.stage-busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(5,5,5,.35); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid #3a3a3a; border-top-color: var(--red); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.filmstrip { grid-area: strip; display: flex; align-items: center; gap: 8px; padding: 10px var(--gutter); border-top: 1px solid var(--line); min-width: 0; }
.thumbs { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: thin; }
.thumb { position: relative; flex: none; }
.thumb-btn { display: block; padding: 0; border: 2px solid transparent; border-radius: 8px; background: var(--bg-3); cursor: pointer; overflow: hidden; width: 96px; height: 72px; }
.thumb-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-btn[aria-current="true"] { border-color: var(--red); }
.thumb-btn.loading { display: grid; place-items: center; }
.thumb-remove { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.75); color: var(--ink); cursor: pointer; font-size: 14px; line-height: 1; display: grid; place-items: center; }
.thumb-remove:hover { background: var(--red); color: #000; }
.thumb-edited { position: absolute; left: 6px; bottom: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px rgba(0,0,0,.6); }
.thumb-add { flex: none; width: 56px; height: 72px; display: grid; place-items: center; border: 1.5px dashed #444; border-radius: 8px; font-size: 26px; color: var(--ink-2); cursor: pointer; }
.thumb-add:hover { border-color: var(--red); color: var(--red-ink); }

.panel { grid-area: panel; border-left: 1px solid var(--line); background: rgba(10,10,10,.92); display: flex; flex-direction: column; min-height: 0; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 14px 6px 12px; cursor: pointer; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.tab[aria-selected="true"] { color: var(--red-ink); border-bottom-color: var(--red); }
.panes { flex: 1; overflow-y: auto; padding: 16px 18px; min-height: 0; }

.tone-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.tone { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; color: var(--ink-2); }
.tone canvas, .tone .tone-swatch { width: 100%; aspect-ratio: 1; border-radius: 6px; display: block; background: var(--bg-3); border: 2px solid transparent; object-fit: cover; }
.tone[aria-pressed="true"] canvas, .tone[aria-pressed="true"] .tone-swatch { border-color: var(--red); }
.tone[aria-pressed="true"] { color: var(--ink); }
.tone-name { display: block; font-size: 12px; font-weight: 600; margin-top: 5px; line-height: 1.25; }
.tone-tag { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.import-lut { margin-top: 18px; width: 100%; }

.slider-block + .slider-block { margin-top: 2px; }
.slider { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; padding: 8px 0; }
.slider label { font-size: 14px; color: var(--ink); }
.slider output { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--ink-2); min-width: 3.5ch; text-align: right; cursor: pointer; border-radius: 4px; padding: 0 4px; }
.slider output:hover { color: var(--red-ink); }
.slider input[type="range"] { grid-column: 1 / -1; width: 100%; margin: 6px 0 0; accent-color: var(--red); height: 28px; background: transparent; }
.group-label { margin: 14px 0 2px; }
.group-label:first-child { margin-top: 0; }

.batch { border-top: 1px solid var(--line); padding: 12px 18px 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.batch .label { width: 100%; }
.batch .btn { flex: 1 1 auto; }
.batch .note { width: 100%; margin-top: 0; }

/* ---------- dialog, toast ---------- */
.dialog { background: var(--bg-2); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; padding: 0; width: min(440px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(0,0,0,.7); }
.dialog-body { padding: 24px; position: relative; }
.dialog-title { color: var(--red); font-size: 30px; font-weight: 500; margin: 0 0 12px; }
.dialog-close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border: 0; border-radius: 8px; background: var(--bg-3); font-size: 20px; cursor: pointer; }
.ex-status { margin: 4px 0 10px; }
.progress { height: 8px; background: var(--bg-3); border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--red); transition: width .15s; }
.ex-errors { margin: 10px 0 0; padding-left: 18px; color: #ffb08a; font-size: 13px; }

.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50;
  display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px);
  background: #1c1c1c; border: 1px solid #333; border-radius: 10px; padding: 10px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.6); font-size: 14px; }
.toast-action { background: none; border: 0; color: var(--red-ink); font-weight: 700; cursor: pointer; padding: 6px; }
.drop-overlay { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(30,6,4,.82); border: 3px dashed var(--red); font-family: var(--serif); font-stretch: 75%; font-size: 40px; color: var(--red-ink); pointer-events: none; }

/* ---------- content pages ---------- */
.page { max-width: 880px; margin: 0 auto; padding: 8px var(--gutter) 60px; }
.page h1 { margin-bottom: 18px; }
.placeholder { border: 1.5px dashed #444; border-radius: var(--radius); padding: 22px; color: var(--ink-2); background: rgba(14,14,14,.8); }
.placeholder strong { color: var(--red-ink); }
.camera-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 22px; }
.camera-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); padding: 14px; }
.camera-card .ph { aspect-ratio: 4/3; border-radius: 6px; background: var(--bg-3); display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.camera-card h2 { font-family: var(--serif); font-stretch: 75%; color: var(--red); font-weight: 500; font-size: 24px; margin: 12px 0 4px; }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }

/* ---------- responsive ---------- */
.desktop-only { display: inline; }
@media (hover: none), (max-width: 820px) { .desktop-only { display: none; } }

@media (max-width: 820px) {
  .editor {
    grid-template-columns: 100%;
    grid-template-rows: auto minmax(0, 40dvh) 76px minmax(0, 1fr);
    grid-template-areas: "top" "stage" "strip" "panel";
  }
  .ed-top { padding: 8px 12px; flex-wrap: nowrap; }
  .ed-top #btn-home { padding: 6px 8px; }
  .ed-tools-top { gap: 4px; flex-wrap: nowrap; }
  .ed-tools-top .lang { display: none; }
  .btn-save { padding: 8px 14px; }
  .stage { padding: 8px; }
  .stage-hint { display: none; }
  .filmstrip { padding: 6px 12px; }
  .thumb-btn { width: 72px; height: 56px; }
  .thumb-add { width: 46px; height: 56px; }
  .panel { border-left: 0; border-top: 1px solid var(--line); }
  .panes { padding: 12px 16px; }
  .tone-list { grid-template-columns: repeat(4, 1fr); }
  .batch { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); gap: 6px; flex-wrap: nowrap; }
  .batch .note, .batch .label { display: none; }
  .batch .btn { min-height: 36px; padding: 6px 8px; font-size: 13px; }
  .tab { padding: 10px 4px 9px; }
  .slider { padding: 4px 0; }
  .brand-teaser { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .pill { font-size: 11px; padding: 6px 8px; }
  .topnav .brand { font-size: 11px; }
  .tone-list { grid-template-columns: repeat(3, 1fr); }
  .ed-top #btn-home { font-size: 0; gap: 0; }
  .ed-top #btn-home span { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- v2: logo, chips, products ---------- */
.brand-logo { display: inline-flex; align-items: center; }
.brand-logo img { height: 34px; width: auto; display: block; }
.headline { font-stretch: normal; }
.font-condensed .headline { font-stretch: 70%; }
.font-condensed .serif, .font-condensed .dialog-title { font-stretch: 75%; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 0;
  background: var(--bg-3); color: var(--ink-2); border: 1px solid #2c2c2c; border-radius: 999px;
  padding: 6px 14px; min-height: 36px; justify-content: center; cursor: pointer; font-size: 13px; font-weight: 600; line-height: 1.2;
}
.chip small { font-size: 10px; font-weight: 500; color: var(--muted); }
.chip:hover { border-color: var(--red-deep); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #160504; }
.chip[aria-pressed="true"] small { color: #3a0c08; }
#grain-types { margin-bottom: 6px; }
#grain-types .chip { border-radius: 8px; padding: 6px 10px; }

.example-controls { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }

.products { margin-top: 64px; }
.product-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.product { margin: 0; background: #000; border-radius: var(--radius); overflow: hidden; border: 1px solid #1d1d1d; }
.product img { width: 100%; height: auto; display: block; }
.product figcaption { padding: 10px 14px; font-size: 13px; color: var(--ink-2); border-top: 1px solid #1d1d1d; }
.ad { position: relative; display: block; margin-top: 14px; border-radius: var(--radius); overflow: hidden; background: #000; text-decoration: none; isolation: isolate; }
.ad img { width: 100%; height: auto; display: block; }
.ad-copy { position: absolute; display: flex; flex-direction: column; gap: 10px; color: var(--red); width: 40%; }
.ad-copy small { font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.ad-copy strong { font-family: var(--serif); font-weight: 500; font-size: clamp(22px, 4.4vw, 56px); line-height: 1.04; }
.ad-copy em { font-style: normal; font-size: 13px; border-bottom: 1px solid var(--red); padding-bottom: 6px; align-self: flex-start; color: var(--red-ink); }
.ad-copy.left { top: 24%; left: 5%; }
.ad-copy.right { top: 20%; right: 4%; }
.ad-copy.top { top: 5%; left: 0; right: 0; width: 100%; align-items: center; text-align: center; }
.ad-copy.top em { align-self: center; }
.ad:hover em { color: var(--ink); border-color: var(--ink); }
.products .fine { margin-top: 12px; }

@media (max-width: 820px) {
  .product-pair { grid-template-columns: 1fr; }
  .brand-logo img { height: 28px; }
  .ad-copy { gap: 4px; }
  .ad-copy small, .ad-copy em { font-size: 9px; }
  .ad-copy em { padding-bottom: 3px; }
}

/* ---------- v3: blend product art into the page (no hard black boxes) ---------- */
.product { background: none; border: 0; border-radius: 0; overflow: visible; }
/* camera images are transparent PNGs, so they sit directly on the page */
.product { display: flex; flex-direction: column; justify-content: flex-end; }
.product figcaption { border-top: 0; text-align: center; padding-top: 0; }
.ad { background: none; border-radius: 0; overflow: visible; }
.ad img {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent),
                      linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-composite: source-in;
          mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent),
                      linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
          mask-composite: intersect;
}

/* ---------- v4: buy buttons ---------- */
.product figcaption { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 4px 14px 0; }
.product-name { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.btn-buy { min-width: 168px; min-height: 46px; border-radius: 999px; letter-spacing: .02em; box-shadow: 0 0 0 1px rgba(236,74,60,.35), 0 8px 28px rgba(236,74,60,.18); }
.btn-buy::after { content: "↗"; font-size: 13px; opacity: .8; }
.buy-row { display: flex; align-items: center; justify-content: center; gap: 12px 18px; flex-wrap: wrap; margin: 22px auto 6px; max-width: 640px; text-align: center; }
.buy-note { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.buy-row .btn { border-radius: 999px; }

/* ---------- v5: complementary teal for commerce buttons ---------- */
:root { --teal: #3fd0c4; --teal-ink: #6fe3d9; --teal-dark: #04211f; }
.btn-buy { background: var(--teal); color: var(--teal-dark); box-shadow: 0 0 0 1px rgba(63,208,196,.35), 0 8px 28px rgba(63,208,196,.18); }
.btn-buy:hover { background: var(--teal-ink); }
.buy-row .btn { border-color: var(--teal); color: var(--teal-ink); }
.buy-row .btn:hover { background: rgba(63,208,196,.12); color: var(--teal-ink); border-color: var(--teal-ink); }

/* export options */
.ex-scope { margin: 2px 0 12px; }
.ex-option {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; margin-top: 10px;
  padding: 12px 16px; border-radius: 10px; border: 1px solid #3b3b3b; background: transparent; cursor: pointer; text-align: left;
}
.ex-option strong { font-size: 16px; }
.ex-option span { font-size: 13px; color: var(--muted); }
.ex-option:hover { border-color: var(--red); }
.ex-option.is-main { background: var(--red); border-color: var(--red); color: #160504; }
.ex-option.is-main span { color: #4a120c; }
.ex-option.is-main:hover { background: var(--red-ink); }

/* small Instagram follow card shown while saving at full resolution */
.ig-card { position: relative; margin: 14px 0 4px; padding: 12px; border-radius: 12px; background: #0f0f0f; border: 1px solid #262626; }
.ig-close { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: #1f1f1f; color: var(--ink); font-size: 16px; cursor: pointer; }
.ig-close:hover { background: #333; }
.ig-head { display: flex; align-items: center; gap: 10px; padding-right: 34px; }
.ig-avatar { width: 44px; height: 44px; border-radius: 50%; background: #050505; padding: 2px; box-shadow: 0 0 0 2px var(--teal); flex: none; }
.ig-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.ig-who strong { font-size: 14px; }
.ig-who span { font-size: 12px; color: var(--muted); }
.btn-follow { margin-left: auto; min-height: 34px; padding: 6px 16px; border-radius: 8px; font-size: 13px; background: var(--teal); color: var(--teal-dark); }
.btn-follow:hover { background: var(--teal-ink); }
.ig-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin-top: 10px; border-radius: 6px; overflow: hidden; }
.ig-grid img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; display: block; }
.ig-note { margin: 8px 0 0; font-size: 12px; color: var(--ink-2); text-align: center; }

/* ---------- v6: product promo shown while saving at full resolution ---------- */
.promo-card { margin: 14px 0 4px; padding: 14px; border-radius: 12px; background: #0b0b0b; border: 1px solid #262626; display: flex; flex-direction: column; gap: 10px; }
.promo-kicker { margin: 0; text-align: center; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--red-ink); }
.promo-cams { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.promo-cam { display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; }
.promo-cam img { width: 100%; height: auto; display: block; }
.btn-promo { width: 100%; min-height: 40px; padding: 8px 10px; font-size: 14px; background: var(--red); color: #160504; border-radius: 8px; }
.promo-cam:hover .btn-promo { background: var(--red-ink); }
.btn-promo-ghost { min-height: 40px; font-size: 14px; border: 1px solid var(--red); color: var(--red-ink); background: transparent; border-radius: 8px; }
.btn-promo-ghost:hover { background: rgba(236,74,60,.12); }
.btn-close-ad { width: 100%; min-height: 52px; font-size: 17px; font-weight: 700; background: var(--teal); color: var(--teal-dark); border-radius: 10px; margin-top: 2px; }
.btn-close-ad:hover { background: var(--teal-ink); }

/* ---------- v7: story page ---------- */
.story-title { max-width: 18ch; font-size: clamp(34px, 6vw, 68px); margin-top: 8px; }
.story-hero { margin: 8px 0 28px; }
.story-hero img, .story-gallery img { width: 100%; height: auto; display: block; border-radius: 6px; }
.story-text { max-width: 62ch; font-size: 17px; line-height: 1.85; color: var(--ink); }
.story-text p { margin: 0 0 1.1em; }
.story-sign { font-size: clamp(28px, 4vw, 44px); margin-top: 26px !important; }
.story-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 40px 0 10px; }
.story-share { color: var(--ink-2); margin: 18px 0 0; }
.story-share a { color: var(--red-ink); }
@media (max-width: 820px) { .story-gallery { grid-template-columns: 1fr 1fr; } .story-text { font-size: 16px; } }

/* ---------- v8: cameras specs/price, shop page, footer links ---------- */
.lead { font-size: 17px; color: var(--ink-2); margin: -10px 0 22px; max-width: 52ch; }
.center { text-align: center; }
.price-box { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0 10px; }
.price-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(13,13,13,.85); text-align: center; }
.price { font-family: var(--sans); font-size: 30px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.price-sub { font-size: 13px; color: var(--muted); }
.btn-ig { margin-top: 4px; border-radius: 999px; border-color: var(--teal); color: var(--teal-ink); }
.btn-ig:hover { background: rgba(63,208,196,.12); color: var(--teal-ink); border-color: var(--teal-ink); }
.fine a { color: var(--ink-2); }
.specs { margin: 40px 0; }
.spec-list { margin: 12px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.spec-list div { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.spec-list dt { color: var(--muted); }
.spec-list dd { margin: 0; color: var(--ink); }
.shop .toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 28px; }
.shop .toc a { font-size: 13px; padding: 6px 12px; border-radius: 999px; background: var(--bg-3); color: var(--ink-2); text-decoration: none; }
.shop .toc a:hover { color: var(--red-ink); }
.policy { padding: 22px 0; border-top: 1px solid var(--line); scroll-margin-top: 70px; }
.policy h2 { color: var(--red); font-weight: 500; font-size: 30px; margin: 0 0 10px; }
.policy h3 { margin: 16px 0 4px; }
.policy ul { margin: 0; padding-left: 20px; line-height: 1.8; }
.policy a { color: var(--red-ink); }
.policy .pending { color: #ffb08a; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 10px; }
.foot-links a { font-size: 13px; color: var(--ink-2); text-decoration: none; }
.foot-links a:hover { color: var(--red-ink); }
@media (max-width: 820px) {
  .price-box, .spec-list { grid-template-columns: 1fr; }
  .spec-list div { grid-template-columns: 110px 1fr; }
}

/* ---------- v9: bilingual blocks (toggled by <html lang>) ---------- */
html[lang="th"] [lang="en"]:not(html), html[lang="en"] [lang="th"]:not(html) { display: none !important; }
.price-links { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

/* ---------- v10: white-balance slider tracks ---------- */
.slider[data-key="temperature"] input[type="range"],
.slider[data-key="tint"] input[type="range"] { -webkit-appearance: none; appearance: none; height: 8px; border-radius: 999px; margin: 14px 0 10px; accent-color: #fff; }
.slider[data-key="temperature"] input[type="range"] { background: linear-gradient(90deg, #3d7bd9, #d9d4cc 50%, #e8952f); }
.slider[data-key="tint"] input[type="range"] { background: linear-gradient(90deg, #3fae55, #d9d4cc 50%, #d14fb6); }
.slider[data-key="temperature"] input[type="range"]::-webkit-slider-thumb,
.slider[data-key="tint"] input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #f4f1ec; border: 2px solid #111; box-shadow: 0 1px 4px rgba(0,0,0,.6); cursor: pointer; }
.slider[data-key="temperature"] input[type="range"]::-moz-range-thumb,
.slider[data-key="tint"] input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #f4f1ec; border: 2px solid #111; cursor: pointer; }
