/* NegaFlip: dark UI so the photo reads true. Accent amber #ffb020 with dark text (contrast 10:1). */
:root {
  --bg: #111214; --surface: #1b1d21; --surface2: #24272c; --line: #3a3e46; --text: #f2f2f2; --muted: #b8bcc4;
  --accent: #ffb020; --accent-text: #111214; --link: #ffc65a; --radius: 12px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
body.lb-on { overflow: hidden; }
img, svg, video, canvas { max-width: 100%; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
main:focus { outline: none; }
h1, h2, h3 { line-height: 1.2; margin: 1.6em 0 .5em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.6rem); margin-top: .6em; letter-spacing: -.01em; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p, ul, ol { margin: 0 0 1em; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.small { font-size: .92rem; color: var(--muted); }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lede { font-size: 1.15rem; color: var(--muted); }

.skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--accent); color: var(--accent-text); padding: 10px 14px; border-radius: 8px; font-weight: 700; }
.skip:focus { top: 8px; }

/* header and footer */
.top { border-bottom: 1px solid #26292f; background: var(--bg); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.2rem; }
.nav { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav a { display: inline-block; padding: 10px 10px; color: var(--text); text-decoration: none; border-radius: 8px; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--surface2); }
.nav a.pro { border: 1px solid var(--accent); color: var(--accent); padding: 8px 14px; margin-left: 4px; }
@media (max-width: 520px) { .nav .sec { display: none; } }

.foot { margin-top: 64px; border-top: 1px solid #26292f; padding: 32px 0 40px; background: #0d0e10; }
.foot .cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.foot h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 .6em; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin: 0 0 .25em; }
.foot li a { display: inline-block; padding: 6px 0; color: var(--text); overflow-wrap: anywhere; }
.foot .fine { margin-top: 28px; font-size: .85rem; color: var(--muted); }
@media (max-width: 720px) { .foot .cols { grid-template-columns: 1fr; gap: 16px; } }
.crumbs { margin-top: 20px; }
.crumbs a { color: var(--muted); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  border: 1px solid var(--accent); border-radius: 10px; background: var(--accent); color: var(--accent-text);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; text-align: center; line-height: 1.2;
}
.btn:hover { filter: brightness(1.08); }
.btn.big { min-height: 52px; padding: 14px 22px; font-size: 1.08rem; }
.btn.sm { min-height: 40px; padding: 8px 12px; font-size: .95rem; font-weight: 600; }
.btn.alt { background: var(--surface2); border-color: var(--line); color: var(--text); }
.btn.ghost { background: transparent; border-color: #5a606b; color: var(--text); }
.btn.ghost[aria-pressed="true"] { border-color: var(--accent); background: rgba(255, 176, 32, .16); }
.btn:disabled { cursor: not-allowed; filter: none; background: var(--surface2); border-color: var(--line); color: var(--muted); }
.btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* home hero */
.hero { padding: 12px 0 8px; max-width: 820px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 20px; }
.badges li { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: .9rem; color: var(--muted); }

/* converter */
.nf { margin: 8px 0 32px; }
.nf-start {
  border: 2px dashed #4a4f58; border-radius: var(--radius); background: var(--surface); padding: 28px 18px; text-align: center;
}
.nf.drop .nf-start { border-color: var(--accent); background: #22201a; }
.nf-start h2 { margin: 0 0 18px; font-size: 1.3rem; }
.nf-start h2:focus { outline: none; }
.nf-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.filebtn { position: relative; display: inline-flex; }
.filebtn input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.filebtn input:focus-visible + label { outline: 3px solid #fff; outline-offset: 2px; }
.nf-drop { margin: 14px 0 0; }
.tips { max-width: 600px; margin: 20px auto 0; text-align: left; }
.tips summary { cursor: pointer; font-weight: 600; padding: 8px 0; text-align: center; }
.tips ul { margin: 8px 0 0; padding-left: 1.2em; color: var(--muted); }
.tips li { margin-bottom: .4em; }
@media (hover: hover) and (pointer: fine) { .coarse-only { display: none !important; } }
@media (hover: none) and (pointer: coarse) { .fine-only { display: none !important; } }
@media (max-width: 520px) {
  .nf-actions { flex-direction: column; align-items: stretch; }
  .nf-actions .filebtn, .nf-actions .btn { width: 100%; }
}

.nf-editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .nf-editor { grid-template-columns: minmax(0, 1fr); } }
.nf-stage {
  display: flex; align-items: center; justify-content: center; padding: 20px; min-height: 260px;
  background: #08090a; border-radius: var(--radius); overflow: hidden;
}
@media (max-width: 520px) { .nf-stage { padding: 16px; min-height: 0; } .nf-panel { padding: 14px 12px; } }
.nf-frame { position: relative; line-height: 0; }
#nf-canvas { display: block; background: #222; touch-action: pan-y; }
#nf-canvas:focus { outline: none; }
#nf-canvas.picking { cursor: crosshair; touch-action: none; }
.nf-crop { position: absolute; inset: 0; }
.nf-box {
  position: absolute; outline: 2px solid #fff; box-shadow: 0 0 0 200vmax rgba(0, 0, 0, .6);
  cursor: move; touch-action: none;
}
.nf-box::before, .nf-box::after { content: ""; position: absolute; pointer-events: none; border: 0 solid rgba(255, 255, 255, .35); }
.nf-box::before { left: 33.33%; right: 33.33%; top: 0; bottom: 0; border-left-width: 1px; border-right-width: 1px; }
.nf-box::after { top: 33.33%; bottom: 33.33%; left: 0; right: 0; border-top-width: 1px; border-bottom-width: 1px; }
.hd {
  position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; padding: 0; border: 0; background: transparent;
  touch-action: none; z-index: 2;
}
.hd::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  background: #fff; border: 2px solid #111; border-radius: 3px;
}
.hd:focus-visible { outline: none; }
.hd:focus-visible::before { background: var(--accent); box-shadow: 0 0 0 3px #fff; }
.hd-nw { left: 0; top: 0; cursor: nwse-resize; } .hd-se { left: 100%; top: 100%; cursor: nwse-resize; }
.hd-ne { left: 100%; top: 0; cursor: nesw-resize; } .hd-sw { left: 0; top: 100%; cursor: nesw-resize; }
.hd-n { left: 50%; top: 0; cursor: ns-resize; } .hd-s { left: 50%; top: 100%; cursor: ns-resize; }
.hd-e { left: 100%; top: 50%; cursor: ew-resize; } .hd-w { left: 0; top: 50%; cursor: ew-resize; }
.hd-n::before, .hd-s::before { width: 26px; height: 10px; margin: -5px 0 0 -13px; }
.hd-e::before, .hd-w::before { width: 10px; height: 26px; margin: -13px 0 0 -5px; }
.hd-move {
  position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; padding: 0;
  display: flex; align-items: center; justify-content: center; border: 2px solid #fff; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff; cursor: move; touch-action: none; z-index: 1;
}
.hd-move .ic { pointer-events: none; }
.hd-move:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }

.nf-tools { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; max-width: 520px; margin: 12px auto 0; }
.tool {
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; min-height: 56px; padding: 8px 2px;
  border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--text); font: inherit; font-size: .82rem; cursor: pointer;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.tool:hover { background: var(--surface2); }
.tool[aria-pressed="true"] { border-color: var(--accent); background: rgba(255, 176, 32, .16); }
.tool .ic { width: 22px; height: 22px; }
.nf-cropbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; padding: 12px; background: var(--surface); border-radius: var(--radius); }
.field.inline { display: inline-flex; align-items: center; gap: 8px; }
select {
  min-height: 44px; padding: 8px 10px; border-radius: 8px; border: 1px solid #5a606b; background: var(--surface2); color: var(--text); font: inherit;
}

.nf-panel { background: var(--surface); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.nf-save { display: flex; flex-direction: column; gap: 10px; }
.nf-save .btn { width: 100%; }
.nf-save p { margin: 0; }
.seg { border: 0; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.seg legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.seg label { flex: 1 1 120px; position: relative; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span {
  display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 10px; border: 1px solid #5a606b; border-radius: 10px;
  cursor: pointer; text-align: center; font-size: .95rem; white-space: nowrap; padding: 8px 6px;
}
.seg input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 700; }
.seg input:focus-visible + span { outline: 3px solid #fff; outline-offset: 2px; }
.nf-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.nf-picks .btn { flex: 1 1 auto; }
.sl { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 8px; }
.sl label { font-weight: 600; font-size: .95rem; }
.sl output { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .92rem; }
.sl input { grid-column: 1 / -1; width: 100%; height: 32px; margin: 2px 0 0; accent-color: var(--accent); }
.pro-card { border: 1px dashed #5a606b; border-radius: 10px; padding: 12px 14px; }
.pro-card h2 { margin: 0 0 6px; font-size: 1rem; }
.pro-card ul { margin: 0 0 8px; padding-left: 1.1em; color: var(--muted); font-size: .92rem; }
.pro-card .soon { margin: 0; font-size: .92rem; }
.price { color: var(--accent); font-weight: 700; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--surface2); border: 1px solid var(--line); font-size: .82rem; color: var(--text); }
.status { min-height: 1.6em; margin: 12px 0 0; text-align: center; color: var(--muted); }
.noscript { padding: 12px; border: 1px solid var(--accent); border-radius: 10px; }

dialog.live {
  width: min(760px, 96vw); max-height: 94vh; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
}
dialog.live::backdrop { background: rgba(0, 0, 0, .8); }
dialog.live h2 { margin: 0 0 10px; font-size: 1.2rem; }
dialog.live video { display: block; width: 100%; max-height: 60vh; background: #000; border-radius: 8px; object-fit: contain; }
dialog.live video.inv { filter: invert(1); }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

/* articles */
.content { padding-bottom: 8px; }
.content li { margin-bottom: .45em; }
.steps { padding-left: 1.4em; }
.steps li { padding-left: .2em; margin-bottom: .7em; }
.checks { list-style: none; padding: 0; }
.checks li { position: relative; padding-left: 1.7em; }
.checks li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--accent); font-weight: 800; }
.demo { margin: 24px 0; }
.demo img { display: block; width: 100%; height: auto; border-radius: 10px; }
.demo figcaption { margin-top: 8px; font-size: .9rem; color: var(--muted); }
.table-wrap { overflow-x: auto; margin: 0 0 1.2em; border: 1px solid #2c3036; border-radius: 10px; }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: .95rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #2c3036; vertical-align: top; }
thead th { background: var(--surface); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
.faq { margin-top: 32px; }
.faq details { border-bottom: 1px solid #2c3036; }
.faq summary { cursor: pointer; font-weight: 600; padding: 14px 0; }
.faq details p { color: var(--muted); }
.pro-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 0 0 1.2em; }
.lightbox-start { margin: 20px 0; }
.lb { position: fixed; inset: 0; z-index: 1000; background: #fff; cursor: pointer; }
.lb:focus { outline: none; }

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media print { .top, .foot, .nf { display: none; } }
/* with a mouse there is no "Take a photo" button: opening a file is the main action */
@media (hover: hover) and (pointer: fine) {
  .nf-actions .filebtn label.alt { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
}
.tool span { text-align: center; line-height: 1.15; }
