/* ==========================================================================
   QR Code Generator — style.css
   Vanilla CSS, no framework, no build step. Light/dark editor.
   ========================================================================== */

:root {
  /* Palette comes from the shared design system (/assets/site.css) so the tool
     UI and the site stay one theme. Light and dark are both defined there. */
  --bg:        var(--gk-bg);
  --surface:   var(--gk-surface);
  --surface-2: var(--gk-surface-2);
  --text:      var(--gk-text);
  --muted:     var(--gk-muted);
  --border:    var(--gk-border);
  --accent:    var(--gk-accent);
  --danger:    #dc2626;
  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    var(--gk-shadow-sm);
  --font:      var(--gk-font);
}

/* the one colour the shared tokens do not carry */
:root[data-theme="dark"] { --danger: #f87171; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --danger: #f87171; }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- App bar ---------- */
.app-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.app-bar__brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.app-bar__logo {
  display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--accent); color: #fff; font-size: 13px;
}
.app-bar__actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit; font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .12s, border-color .12s, transform .04s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { filter: brightness(1.06); background: var(--accent); }
.btn--sm { padding: 6px 10px; font-size: 13px; }
.btn--icon { padding: 8px 10px; line-height: 1; }
.btn--ghost-danger { border-color: transparent; color: var(--danger); background: transparent; }
.btn--ghost-danger:hover { background: rgba(220, 38, 38, .1); }

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(380px, 500px) 1fr;
  gap: 20px;
  padding: 20px;
  align-items: start;
  max-width: 1500px;
  margin: 0 auto;
}
.editor {
  display: flex; flex-direction: column; gap: 12px;
  position: sticky; top: 72px;
  max-height: calc(100vh - 92px);
  overflow-y: auto;
  padding-right: 4px;
}

/* ---------- Editor group heading ---------- */
.editor__group {
  flex: none;
  margin: 8px 0 -4px 2px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); opacity: .75;
}
.editor__group:first-child { margin-top: 0; }

/* ---------- Panels ---------- */
.panel {
  flex: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel > summary {
  list-style: none; cursor: pointer;
  padding: 12px 14px;
  font-weight: 700; font-size: 13px;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); user-select: none;
}
.panel > summary::-webkit-details-marker { display: none; }
.panel > summary::after { content: "+"; float: right; font-size: 15px; }
.panel[open] > summary::after { content: "\2212"; }
.panel__body { padding: 4px 14px 16px; }

/* ---------- Fields ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field--full { grid-column: 1 / -1; }
.field > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.field--check { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 8px; }
.field--check > span { color: var(--text); font-weight: 500; }

input, select, textarea {
  font: inherit; color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px; width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
  outline-offset: 1px; border-color: var(--accent);
}
input[type="color"] { padding: 4px; height: 38px; }
input[type="file"] { padding: 6px; background: transparent; border-style: dashed; }
input[type="checkbox"] { width: auto; }
textarea { resize: vertical; }

.hint { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
/* A hint that closes a field must not crowd the next one */
.field > .hint:last-child { margin-bottom: 16px; }
.hint--warn { color: var(--danger); font-weight: 600; }

.form-block { margin-top: 12px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: #14181f; color: #fff;
  padding: 10px 18px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 50;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Range inputs ---------- */
.field input[type="range"] { width: 100%; accent-color: var(--accent); margin: 6px 0 0; }
.field input[type="color"] { width: 100%; height: 38px; padding: 2px; cursor: pointer; }

.preset-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* Segmented control — one row, one active choice */
.seg-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.seg-row button {
  appearance: none;
  flex: 1 1 auto;
  min-width: 54px;
  padding: 7px 8px;
  font-size: 13px;
  border: 0;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.seg-row button:hover { color: var(--text); }
.seg-row button.is-active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(17, 24, 39, .12);
}
[data-theme="dark"] .seg-row button.is-active { background: #2a2f3a; }

.linklike {
  appearance: none; background: none; border: 0; padding: 0;
  font: inherit; font-weight: 600; color: var(--accent);
  cursor: pointer; text-decoration: underline;
}

/* ---------- Results column ---------- */
.results { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* ---------- Dropzone ---------- */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 44px 24px;
  text-align: center;
  transition: border-color .15s, background .15s;
}
.dropzone.is-over { border-color: var(--accent); background: var(--surface-2); }
.dropzone--slim { padding: 12px 16px; }
.dropzone--slim .dropzone__icon { display: inline-block; margin: 0 6px 0 0; font-size: 15px; vertical-align: -2px; }
.dropzone--slim .dropzone__sub { display: inline; }
.dropzone__icon { display: block; font-size: 26px; color: var(--muted); margin-bottom: 8px; }
.dropzone__title { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.dropzone__sub { margin: 0; color: var(--muted); font-size: 13px; }
.dropzone__privacy {
  margin: 14px 0 0; font-size: 12px; color: var(--muted);
  padding-top: 12px; border-top: 1px solid var(--border);
}

/* ---------- Summary bar ---------- */
.summary {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.summary__main { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.summary__main b { font-size: 15px; }
.summary__main span { color: var(--muted); font-variant-numeric: tabular-nums; }
.summary__saved { font-weight: 700; color: #16a34a; font-variant-numeric: tabular-nums; }
[data-theme="dark"] .summary__saved { color: #4ade80; }

/* ---------- File list ---------- */
.file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.file-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.file-thumb {
  width: 64px; height: 64px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  object-fit: cover;
  background:
    linear-gradient(45deg, #e8eaee 25%, transparent 25%, transparent 75%, #e8eaee 75%),
    linear-gradient(45deg, #e8eaee 25%, transparent 25%, transparent 75%, #e8eaee 75%) 6px 6px,
    #fff;
  background-size: 12px 12px;
}

.file-info { min-width: 0; }
.file-name {
  font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-meta {
  margin-top: 3px;
  font-size: 12.5px; color: var(--muted);
  font-variant-numeric: tabular-nums;
  display: flex; flex-wrap: wrap; gap: 4px 8px;
}
.file-meta .arrow { opacity: .55; }
.file-meta .new-size { color: var(--text); font-weight: 600; }

.file-actions { display: flex; align-items: center; gap: 6px; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.badge--good { background: rgba(22, 163, 74, .12); color: #15803d; }
.badge--flat { background: rgba(107, 114, 128, .14); color: var(--muted); }
.badge--worse { background: rgba(234, 88, 12, .13); color: #c2410c; }
.badge--busy { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.badge--error { background: rgba(220, 38, 38, .12); color: var(--danger); }
[data-theme="dark"] .badge--good { background: rgba(34, 197, 94, .16); color: #4ade80; }
[data-theme="dark"] .badge--worse { background: rgba(251, 146, 60, .16); color: #fdba74; }
[data-theme="dark"] .badge--error { background: rgba(248, 113, 113, .16); color: #fca5a5; }

.file-row--error { border-color: rgba(220, 38, 38, .4); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; }
  .editor { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 560px) {
  .file-row { grid-template-columns: 48px minmax(0, 1fr); }
  .file-thumb { width: 48px; height: 48px; }
  .file-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .app-bar { flex-wrap: wrap; }
}

.btn.is-active { border-color: var(--accent); color: var(--accent); background: var(--surface-2); }

.fmt-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--muted);
  margin-right: 2px;
}

.row-explain { color: var(--muted); font-style: italic; }

/* ---------- Help modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px;
  background: rgba(15, 18, 22, .55);
  overflow-y: auto;
}
.modal__card {
  width: 100%; max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.modal__head h2 { margin: 0; font-size: 16px; }
.modal__body { padding: 4px 20px 22px; }
.modal__lead { color: var(--muted); }
.modal__body h3 {
  margin: 18px 0 6px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.modal__body p { margin: 6px 0; }
.modal__body ul { margin: 6px 0; padding-left: 18px; }
.modal__body li { margin: 4px 0; }
.modal__body b { color: var(--text); }

/* ---------- Armed (two-click) button ---------- */
.btn--armed { border-color: var(--danger); color: var(--danger); }

/* ---------- Before/after compare ---------- */
.modal__card--wide { max-width: 900px; }
.compare {
  position: relative;
  width: 100%;
  max-height: 62vh;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background:
    linear-gradient(45deg, #e8eaee 25%, transparent 25%, transparent 75%, #e8eaee 75%),
    linear-gradient(45deg, #e8eaee 25%, transparent 25%, transparent 75%, #e8eaee 75%) 8px 8px,
    #fff;
  background-size: 16px 16px;
}
.compare__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  user-select: none; -webkit-user-drag: none;
}
.compare__img--before { clip-path: inset(0 50% 0 0); }
.compare__divider {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px; background: var(--accent);
  transform: translateX(-1px);
  pointer-events: none;
}
.compare__divider span {
  position: absolute; top: 50%; left: 50%;
  width: 26px; height: 26px; margin: -13px 0 0 -13px;
  border-radius: 50%; background: var(--accent);
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.compare__tag {
  position: absolute; bottom: 10px;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(20, 24, 31, .82); color: #fff;
  font-size: 12px; font-weight: 600;
}
.compare__tag--l { left: 10px; }
.compare__tag--r { right: 10px; }
.compare__tag b { font-weight: 700; margin-left: 4px; }
#cmpRange { width: 100%; margin: 12px 0 0; accent-color: var(--accent); }
.file-thumb { cursor: zoom-in; }

/* iOS-style on/off switch — restyles the native checkbox, no markup change */
.field--check input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  flex: none; width: 40px; height: 24px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  position: relative; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.field--check input[type="checkbox"]::before {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform .15s;
}
.field--check input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.field--check input[type="checkbox"]:checked::before { transform: translateX(16px); }
.field--check input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[data-theme="dark"] .field--check input[type="checkbox"]::before { background: #e8eaed; }


.app-bar__logo svg { width: 15px; height: 15px; display: block; }

/* ==========================================================================
   REDESIGN — empty-state first, tooltips instead of paragraphs, button states
   ========================================================================== */

/* ---------- ? tooltip next to a label ---------- */
.lbl-tip { display: inline-flex; align-items: center; gap: 6px; }
.tip {
  display: inline-grid; place-items: center;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--muted); font-size: 10px; font-weight: 700; cursor: help;
}
.tip:hover, .tip:focus-visible { color: var(--accent); border-color: var(--accent); outline: none; }

/* ---------- Empty state: no settings panel, one big drop target ---------- */
body:not(.has-files) .editor { display: none; }
body:not(.has-files) .layout { display: block; max-width: 760px; }
body:not(.has-files) .dropzone {
  min-height: min(58vh, 440px);
  display: grid; place-items: center;
  border-width: 2px; padding: 44px 24px;
}
body:not(.has-files) .dropzone__icon { font-size: 42px; margin-bottom: 14px; }
body:not(.has-files) .dropzone__title { font-size: 22px; }
body:not(.has-files) .dropzone__sub { font-size: 14px; }
body:not(.has-files) .dropzone__privacy { margin-top: 10px; }

/* ---------- App bar: disabled actions, dominant download ---------- */
.btn:disabled, .btn[disabled] { opacity: .4; pointer-events: none; }
.app-bar__sep {
  width: 1px; height: 22px; flex: none;
  background: var(--border); margin: 0 3px;
}
.btn--dl {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; font-size: 14px;
}
.btn--dl svg { width: 16px; height: 16px; }
@media (max-width: 560px) { .app-bar__sep { display: none; } }

/* ==========================================================================
   MODE TABS — Compress / Convert / Resize
   ========================================================================== */
.editor { gap: 16px; }

.tabs {
  display: flex; gap: 4px; padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.tab {
  appearance: none; flex: 1 1 0; min-width: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 8px; border: 0; border-radius: 9px;
  background: transparent; color: var(--muted);
  font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer;
  transition: background .14s, color .14s, box-shadow .14s;
}
.tab:hover { color: var(--text); }
.tab.is-active {
  background: var(--surface); color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,.10);
}
.tab__n {
  display: grid; place-items: center;
  width: 18px; height: 18px; border-radius: 6px;
  font-size: 11px; font-weight: 700;
  background: var(--surface-2); color: var(--muted);
}
.tab.is-active .tab__n { background: var(--accent); color: #fff; }
@media (max-width: 460px) { .tab { font-size: 12.5px; } .tab__n { display: none; } }

.tab-lead { margin: 2px 0 -2px; font-size: 13px; line-height: 1.55; color: var(--muted); display: none; }
body[data-imgmode="compress"] .lead-compress,
body[data-imgmode="convert"] .lead-convert,
body[data-imgmode="resize"]  .lead-resize { display: block; }

.fieldset {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.fieldset__title {
  display: block; margin-bottom: 12px;
  font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted);
}
.fieldset .seg-row + .seg-row,
.fieldset .field + .field,
.fieldset .preset-row { margin-top: 12px; }

/* each mode shows only its own controls */
.grp-format, .grp-quality, .grp-resize, .grp-exif { display: none; }
body[data-imgmode="compress"] .grp-quality,
body[data-imgmode="compress"] .grp-exif,
body[data-imgmode="convert"]  .grp-format,
body[data-imgmode="resize"]   .grp-resize { display: block; }
/* Convert changes the format, so "Keep original" makes no sense there */
body[data-imgmode="convert"] [data-convert="auto"] { display: none; }
/* a group hidden by JS (e.g. #qualityField for PNG) still wins via [hidden] */

.preset-label {
  display: block; margin: 14px 0 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
}

/* keep the empty-state hiding the whole editor, tabs included */
body:not(.has-files) .tabs,
body:not(.has-files) .tab-lead { display: none; }

/* ==========================================================================
   Favicon Generator — additions
   ========================================================================== */

.fieldset__title { display: flex; align-items: center; justify-content: space-between; }
.fieldset__title .val {
  text-transform: none; letter-spacing: 0; font-weight: 600;
  color: var(--text); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 1px 9px; font-size: 11px;
}
.fieldset input[type="range"] { width: 100%; margin-top: 4px; accent-color: var(--gk-ink); }
.fieldset input[type="color"] { width: 46px; height: 30px; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: none; cursor: pointer; }
.editor .fieldset + .fieldset { margin-top: 12px; }

/* -------- right panel -------- */
.stage { display: flex; flex-direction: column; gap: 16px; }
.stage__note { margin: 0; font-size: 12px; color: var(--muted); }
.stage__note code { font-size: 11.5px; }

/* browser-tab mock */
.tabmock {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); padding: 8px 8px 0; overflow: hidden;
}
.tabmock__row { display: flex; gap: 4px; align-items: flex-end; }
.tabmock__tab {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-bottom: none;
  border-radius: 9px 9px 0 0; padding: 8px 10px; max-width: 230px; min-width: 0;
}
.tabmock__tab--dim { background: transparent; border-color: transparent; color: var(--muted); }
.tabmock__fav { width: 16px; height: 16px; flex: none; display: block; border-radius: 3px; overflow: hidden; }
.tabmock__fav canvas, .tabmock__fav img { width: 16px; height: 16px; display: block; }
.tabmock__t { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabmock__x { color: var(--muted); font-size: 13px; flex: none; }
.tabmock__omni {
  background: var(--surface); border-top: 1px solid var(--border);
  margin: 0 -8px; padding: 7px 14px; font-size: 11.5px; color: var(--muted);
}

/* mobile icon mocks */
.mockrow { display: flex; gap: 14px; }
.mock { margin: 0; flex: 1; text-align: center; }
.mock figcaption { margin-top: 8px; font-size: 11px; color: var(--muted); }
.mock__ios, .mock__android {
  display: inline-grid; place-items: center; width: 76px; height: 76px;
  background:
    linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
  box-shadow: 0 4px 14px -4px rgba(9,9,11,.28);
}
[data-theme="dark"] .mock__ios, [data-theme="dark"] .mock__android {
  background: linear-gradient(135deg, #1e293b, #0f172a);
}
.mock__ios { border-radius: 22%; }
.mock__android { border-radius: 50%; }
.mock__ios canvas, .mock__ios img { width: 76px; height: 76px; border-radius: 22%; display: block; }
.mock__android canvas, .mock__android img { width: 76px; height: 76px; border-radius: 50%; display: block; }

/* compact size cards */
.previews { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.preview {
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  padding: 10px 8px; text-align: center;
}
.preview__frame {
  display: flex; align-items: center; justify-content: center;
  height: 66px; margin-bottom: 7px; border-radius: 7px;
  background-color: var(--surface-2);
  background-image:
    linear-gradient(45deg, var(--border) 25%, transparent 25%),
    linear-gradient(-45deg, var(--border) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--border) 75%),
    linear-gradient(-45deg, transparent 75%, var(--border) 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
}
.preview__frame canvas, .preview__frame img { display: block; }
.preview__label { font-size: 10.5px; font-weight: 700; color: var(--text); }
.preview__label small { display: block; font-weight: 500; color: var(--muted); font-size: 9.5px; }

/* collapsed snippet */
.snip {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); font-size: 12.5px;
}
.snip summary {
  cursor: pointer; padding: 10px 12px; color: var(--muted); list-style: none;
  display: flex; align-items: center; gap: 6px;
}
.snip summary::-webkit-details-marker { display: none; }
.snip summary::before { content: "▸"; font-size: 10px; }
.snip[open] summary::before { content: "▾"; }
.snip summary code { color: var(--text); font-size: 11.5px; }
.snip pre {
  margin: 0; padding: 0 14px 14px; overflow-x: auto; font-size: 11.5px; line-height: 1.6;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text);
}

body.has-files #dropzone { display: none; }

@media (max-width: 720px) {
  .previews { grid-template-columns: repeat(2, 1fr); }
}
