/* LocalJXL — light-table palette: neutral glass white, film-box green. */
:root {
  --bg: #eef1ef;
  --surface: #ffffff;
  --ink: #1a2321;
  --muted: #55625f;
  --line: #cbd3d0;
  --accent: #0b6b4f;
  --accent-ink: #ffffff;
  --accent-soft: #dceee6;
  --error: #a1361b;
  --mark: #1a2321;
  --radius-s: 6px;
  --radius-m: 10px;
  --font: "Avenir Next", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1513;
    --surface: #161e1b;
    --ink: #e4ebe8;
    --muted: #96a39f;
    --line: #2a3532;
    --accent: #5cc79f;
    --accent-ink: #06231a;
    --accent-soft: #17332a;
    --error: #f08c6e;
    --mark: #e4ebe8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1513;
  --surface: #161e1b;
  --ink: #e4ebe8;
  --muted: #96a39f;
  --line: #2a3532;
  --accent: #5cc79f;
  --accent-ink: #06231a;
  --accent-soft: #17332a;
  --error: #f08c6e;
  --mark: #e4ebe8;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
img { max-width: 100%; }

.wrap { width: 100%; max-width: 64rem; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* Header */
.site-head { padding: 18px 0; }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.125rem; letter-spacing: -0.01em; }
.brand svg { width: 26px; height: 26px; flex: none; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; padding: 0; list-style: none; font-size: 0.95rem; }
.nav a { color: var(--muted); text-decoration: none; padding: 4px 0; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }

/* Hero + tool */
main { padding-bottom: 64px; }
.intro { padding: 28px 0 22px; max-width: 44rem; }
h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 1.2rem + 3.2vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 700;
}
.lead { margin: 0; color: var(--muted); font-size: 1.125rem; max-width: 38rem; }

.tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px; }
@media (min-width: 720px) { .tool { padding: 24px; } }

/* The light-table drop zone, framed by crop marks. */
.drop {
  --c: 22px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 220px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  border-radius: var(--radius-s);
  background:
    linear-gradient(var(--mark), var(--mark)) top left / var(--c) 2px,
    linear-gradient(var(--mark), var(--mark)) top left / 2px var(--c),
    linear-gradient(var(--mark), var(--mark)) top right / var(--c) 2px,
    linear-gradient(var(--mark), var(--mark)) top right / 2px var(--c),
    linear-gradient(var(--mark), var(--mark)) bottom left / var(--c) 2px,
    linear-gradient(var(--mark), var(--mark)) bottom left / 2px var(--c),
    linear-gradient(var(--mark), var(--mark)) bottom right / var(--c) 2px,
    linear-gradient(var(--mark), var(--mark)) bottom right / 2px var(--c),
    var(--bg);
  background-repeat: no-repeat;
  transition: background-color 120ms ease;
}
.drop:hover, .drop.is-over { background-color: var(--accent-soft); }
.drop.is-over { --mark: var(--accent); }
.drop:focus-within { outline: 3px solid var(--accent); outline-offset: 3px; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drop-title { font-size: clamp(1.35rem, 1rem + 1.6vw, 1.9rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.drop-sub { color: var(--muted); }
.drop-link { color: var(--accent); text-decoration: underline; text-underline-offset: 0.18em; }
.touch-only { display: none; }
/* Phones and tablets cannot drag files, so the drop zone becomes a tap target. */
@media (hover: none) and (pointer: coarse) {
  .touch-only { display: inline; }
  .pointer-only { display: none; }
}
@media (max-width: 520px) {
  .intro { padding: 16px 0 18px; }
  .drop { min-height: 150px; padding: 24px 16px; }
}

.options { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; margin: 18px 0 4px; font-size: 0.97rem; }
.options label { display: inline-flex; align-items: center; gap: 10px; }
.options select {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-s); padding: 6px 10px;
}
.options input[type="range"] { width: 140px; accent-color: var(--accent); }
.options input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
.options output { min-width: 2.2em; font-weight: 600; }
.options .is-disabled { opacity: 0.45; }

.status { margin: 14px 0 0; color: var(--muted); font-size: 0.95rem; display: flex; align-items: flex-start; gap: 8px; }
.status::before { content: ""; width: 8px; height: 8px; margin-top: 0.55em; border-radius: 50%; background: var(--accent); flex: none; }
.status[data-tone="busy"]::before { animation: pulse 1s ease-in-out infinite; }
.status[data-tone="error"] { color: var(--error); }
.status[data-tone="error"]::before { background: var(--error); }
@keyframes pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .status[data-tone="busy"]::before { animation: none; } .drop { transition: none; } }

/* Results: rows on hairlines, not cards. */
.results { list-style: none; margin: 16px 0 0; padding: 0; }
.results:empty { display: none; }
.row { display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 4px; background: var(--bg); display: block; }
.meta { min-width: 0; display: flex; flex-direction: column; }
.name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail { color: var(--muted); font-size: 0.9rem; }
.row[data-state="error"] .detail { color: var(--error); }
.row[data-state="working"] .detail::after { content: "…"; }
.saving { color: var(--accent); font-weight: 600; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.actions[hidden] { display: none; }
.btn {
  font: inherit; font-size: 0.95rem; font-weight: 600; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 16px; border-radius: var(--radius-s);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { padding: 8px 12px; font-size: 0.9rem; }
.btn[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }

/* Article content below the tool */
.content { max-width: 42rem; padding-top: 48px; }
.content h2 { font-size: 1.45rem; line-height: 1.25; letter-spacing: -0.015em; margin: 40px 0 10px; }
.content h2:first-child { margin-top: 0; }
.content p, .content li { color: var(--ink); }
.content ul { padding-left: 1.2em; }
.content li + li { margin-top: 6px; }
.faq details { border-top: 1px solid var(--line); padding: 12px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; list-style-position: outside; }
.faq details p { margin: 8px 0 0; color: var(--muted); }

.support-result {
  display: flex; align-items: center; gap: 16px; padding: 20px; border-radius: var(--radius-m);
  background: var(--surface); border: 1px solid var(--line); margin-top: 8px;
}
.support-result strong { font-size: clamp(1.4rem, 1rem + 1.8vw, 2rem); letter-spacing: -0.02em; line-height: 1.15; }
.support-result .badge { width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 1.4rem; font-weight: 700; background: var(--accent-soft); color: var(--accent); }
.support-result[data-result="no"] .badge { color: var(--error); background: transparent; border: 2px solid var(--error); }
.support-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 0.97rem; }
.support-table th, .support-table td { text-align: left; padding: 10px 8px 10px 0; border-top: 1px solid var(--line); vertical-align: top; }
.support-table th { font-weight: 600; white-space: nowrap; }

.prose { max-width: 42rem; padding-top: 12px; }
.prose h2 { font-size: 1.3rem; margin: 32px 0 8px; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 0.92rem; }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; }
.site-foot ul { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 0; padding: 0; }
.site-foot a { color: var(--muted); }
.site-foot p { margin: 0; }

@media (max-width: 520px) {
  .row { grid-template-columns: 44px 1fr; }
  .thumb { width: 44px; height: 44px; }
  .row .btn { grid-column: 2; justify-self: start; }
  .options input[type="range"] { width: 120px; }
}
