/* ============================================================
   Srcset Studio — pure-black modern UI
   Type: Readex Pro · Code: Geist Mono
   Palette: black, white, neutral-900, white/opacity. No hues.
   ============================================================ */

:root {
  --bg: #000000;
  --bg-elev: #0a0a0a;
  --surface: #121212;      /* neutral-900-ish card */
  --surface-2: #1a1a1a;
  --surface-3: #242424;

  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);

  --text: #ffffff;
  --text-2: rgba(255, 255, 255, 0.72);
  --text-3: rgba(255, 255, 255, 0.45);
  --text-4: rgba(255, 255, 255, 0.30);

  --neutral-glass: rgba(23, 23, 23, 0.72);
  --white-soft: rgba(255, 255, 255, 0.06);
  --white-hover: rgba(255, 255, 255, 0.10);

  --danger: #ff6a5f;

  --radius: 26px;
  --radius-sm: 16px;
  --radius-xs: 12px;
  --pill: 999px;

  --shadow-md: 0 10px 34px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.6);
  --glow-white: 0 8px 30px rgba(255, 255, 255, 0.14);

  --spring: cubic-bezier(0.34, 1.4, 0.5, 1);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --font-ui: "Readex Pro", system-ui, -apple-system, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-ui);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(64% 46% at 50% -8%, rgba(255, 255, 255, 0.07), transparent 70%),
    radial-gradient(40% 40% at 100% 0%, rgba(255, 255, 255, 0.045), transparent 62%),
    radial-gradient(46% 44% at 0% 12%, rgba(255, 255, 255, 0.03), transparent 60%);
  background-attachment: fixed;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

code { font-family: var(--font-mono); font-size: 0.9em; }
a { color: inherit; }

/* the `hidden` attribute must win over any component `display` (e.g. the
   lightbox's display:flex) — otherwise "hidden" overlays still capture clicks */
[hidden] { display: none !important; }

.grain {
  position: fixed; inset: 0; z-index: 999; pointer-events: none;
  opacity: 0.4; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- floating top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 22px clamp(18px, 4vw, 44px);
  max-width: 1300px; margin: 0 auto;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 11px; text-decoration: none;
}
.wordmark__mark {
  display: grid; grid-template-columns: repeat(3, 4px); gap: 2.5px; width: 14px;
}
.wordmark__mark span { width: 4px; height: 14px; border-radius: 1px; display: block; background: #fff; }
.wordmark__mark span:nth-child(2) { background: rgba(255, 255, 255, 0.35); }
.wordmark__mark span:nth-child(3) { background: rgba(255, 255, 255, 0.16); }
.wordmark__text {
  font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; color: #fff;
}
.wordmark__dot { color: var(--text-3); }

.topbar__badge {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 0.78rem; font-weight: 400; color: var(--text-2);
  padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--pill);
  background: var(--neutral-glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.topbar__badge .dot {
  width: 7px; height: 7px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.10);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- layout ---------- */
.wrap { max-width: 1300px; margin: 0 auto; padding: 6px clamp(18px, 4vw, 44px) 44px; }

.intro { max-width: 760px; margin: 26px 0 40px; }
.intro__title {
  font-weight: 500; font-size: clamp(2.3rem, 6.4vw, 4.6rem);
  line-height: 0.95; letter-spacing: -0.04em; text-transform: lowercase;
  margin: 0 0 20px; color: #fff;
  animation: rise 0.8s var(--ease) both;
}
.intro__sub {
  font-size: 1.02rem; font-weight: 300; color: var(--text-2); margin: 0; max-width: 620px;
  animation: rise 0.8s var(--ease) 0.08s both;
}
.intro__sub code {
  background: var(--white-soft); padding: 1px 7px; border-radius: 7px;
  border: 1px solid var(--line); color: #fff; font-weight: 400;
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.workspace {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 20px; align-items: start;
}
.col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.col--right { position: sticky; top: 96px; }

/* ---------- panels ---------- */
.panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)) ,
    var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-md);
  animation: rise 0.7s var(--ease) 0.12s both;
}
.panel--output { min-height: 440px; display: flex; flex-direction: column; }
.panel__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 20px;
}
.panel__title {
  font-weight: 500; font-size: 1.15rem; letter-spacing: -0.03em;
  text-transform: lowercase; margin: 0; color: #fff;
}

/* ---------- dropzone ---------- */
.dropzone {
  display: block; cursor: pointer; border-radius: var(--radius-sm);
  border: 1.5px dashed var(--line-strong); background: rgba(255, 255, 255, 0.015);
  padding: 36px 20px; text-align: center;
  transition: border-color 0.25s, background 0.25s, transform 0.35s var(--spring);
}
.dropzone:hover, .dropzone:focus-visible {
  border-color: rgba(255, 255, 255, 0.5); background: var(--white-soft); outline: none;
}
.dropzone.is-drag {
  border-color: #fff; background: var(--white-hover);
  transform: scale(1.012); box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.06);
}
.dropzone__icon {
  width: 56px; height: 56px; margin: 0 auto 15px; border-radius: 16px;
  display: grid; place-items: center; color: #fff;
  background: var(--white-soft); border: 1px solid var(--line);
}
.dropzone__title { font-weight: 500; margin: 0 0 4px; font-size: 1rem; letter-spacing: -0.02em; }
.dropzone__hint { margin: 0; color: var(--text-3); font-size: 0.85rem; font-weight: 300; }

/* ---------- source card ---------- */
.source { margin: 0; display: flex; gap: 15px; align-items: center; }
.source__thumb {
  width: 92px; height: 92px; flex: none; border-radius: var(--radius-sm);
  overflow: hidden; background: var(--surface-2); border: 1px solid var(--line);
  background-image:
    linear-gradient(45deg, rgba(255,255,255,0.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.06) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.06) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.06) 75%);
  background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.source__thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.source__meta { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.source__name { font-weight: 500; font-size: 0.96rem; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source__stats { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-3); }
.source__stats .sep { margin: 0 6px; color: var(--text-4); }

/* ---------- queue (batch source list) ---------- */
.dropzone.is-compact { padding: 20px; }
.dropzone.is-compact .dropzone__icon { width: 42px; height: 42px; margin-bottom: 10px; }
.dropzone.is-compact .dropzone__hint { display: none; }

.queue { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.qitem {
  display: flex; align-items: center; gap: 12px; padding: 9px;
  border-radius: var(--radius-xs); background: var(--surface-2);
  border: 1px solid var(--line); animation: pop 0.3s var(--spring) both;
}
.qitem__thumb {
  width: 42px; height: 42px; flex: none; border-radius: 9px; overflow: hidden;
  background: var(--bg-elev); border: 1px solid var(--line);
}
.qitem__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.qitem__meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.qitem__name {
  font-weight: 500; font-size: 0.86rem; letter-spacing: -0.02em; color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.qitem__stats { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-3); }
.qitem__x {
  flex: none; display: grid; place-items: center; width: 22px; height: 22px;
  border: none; border-radius: 50%; cursor: pointer; color: var(--text-3);
  background: rgba(255, 255, 255, 0.08); font-size: 15px; line-height: 1; transition: all 0.15s;
}
.qitem__x:hover { background: #fff; color: #000; }

/* ---------- per-image result groups ---------- */
.results { display: flex; flex-direction: column; gap: 26px; }
.rgroup { animation: rise 0.5s var(--ease) both; }
.rgroup + .rgroup { border-top: 1px solid var(--line); padding-top: 24px; }
.rgroup__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.rgroup__title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rgroup__name {
  font-family: var(--font-mono); font-size: 0.9rem; font-weight: 500; color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rgroup__meta { font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-3); }
.rgroup__dl { flex: none; }
.rgroup .variants { margin-bottom: 16px; }
.rgroup .code { margin-bottom: 0; }

/* ---------- fields ---------- */
.field { margin-bottom: 24px; }
.field:last-of-type { margin-bottom: 0; }
.field--split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.field__label {
  display: block; font-size: 0.72rem; font-weight: 500; letter-spacing: 0.04em;
  color: var(--text-3); margin-bottom: 12px; text-transform: uppercase;
}
.field__row .field__label { margin-bottom: 0; }
.field__label code { text-transform: none; color: var(--text-2); letter-spacing: 0; }
.field__value {
  font-family: var(--font-mono); font-weight: 500; font-size: 0.9rem; color: #000;
  background: #fff; padding: 3px 12px; border-radius: var(--pill);
  min-width: 46px; text-align: center;
}
.field__note { margin: 10px 0 0; font-size: 0.78rem; color: var(--text-4); font-weight: 300; line-height: 1.5; }
.field__note code { color: var(--text-3); }

/* ---------- inputs ---------- */
.input {
  width: 100%; font-family: var(--font-ui); font-size: 0.92rem; color: #fff;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-xs); padding: 11px 13px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.input:focus {
  outline: none; border-color: rgba(255, 255, 255, 0.55);
  background: var(--surface-3); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.07);
}
.input--sm { padding: 9px 12px; }
.input::placeholder { color: var(--text-4); }

/* ---------- format toggles ---------- */
.formats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.chip-toggle {
  position: relative; display: flex; flex-direction: column; gap: 2px;
  padding: 13px 13px; cursor: pointer; text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius-xs);
  background: var(--surface-2); transition: all 0.2s var(--ease);
}
.chip-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.chip-toggle span { font-weight: 500; font-size: 0.9rem; letter-spacing: -0.02em; }
.chip-toggle small { font-size: 0.66rem; color: var(--text-4); font-weight: 300; line-height: 1.3; }
.chip-toggle:hover { border-color: var(--line-strong); background: var(--surface-3); }
.chip-toggle:has(input:checked) {
  border-color: rgba(255, 255, 255, 0.7); background: var(--white-hover);
}
.chip-toggle:has(input:checked) span { color: #fff; }
.chip-toggle:has(input:checked) small { color: var(--text-2); }
.chip-toggle:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08); }
.chip-toggle::after {
  content: ""; position: absolute; top: 11px; right: 11px;
  width: 15px; height: 15px; border-radius: 50%;
  border: 1.5px solid var(--line-strong); transition: all 0.2s var(--spring);
}
.chip-toggle:has(input:checked)::after {
  background: #fff; border-color: #fff; box-shadow: inset 0 0 0 3px #121212;
}

/* ---------- range ---------- */
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px;
  border-radius: var(--pill); background: rgba(255, 255, 255, 0.14); outline: none; }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: none; box-shadow: var(--glow-white), 0 0 0 1px rgba(0,0,0,0.2);
  cursor: pointer; transition: transform 0.2s var(--spring);
}
.range::-webkit-slider-thumb:hover { transform: scale(1.18); }
.range::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  border: none; box-shadow: var(--glow-white); cursor: pointer;
}

/* ---------- widths ---------- */
.presets { display: flex; gap: 14px; }
.linkbtn {
  border: none; background: none; cursor: pointer; padding: 0;
  font-family: var(--font-ui); font-size: 0.74rem; font-weight: 500;
  color: var(--text-3); text-transform: uppercase; letter-spacing: 0.03em;
  transition: color 0.15s;
}
.linkbtn:hover { color: #fff; }

.widths { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; min-height: 34px; }
.wtag {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 400;
  padding: 6px 8px 6px 12px; border-radius: var(--pill);
  background: var(--white-soft); border: 1px solid var(--line); color: #fff;
  animation: pop 0.32s var(--spring) both;
}
.wtag.is-skipped { opacity: 0.35; text-decoration: line-through; }
.wtag__x {
  display: grid; place-items: center; width: 17px; height: 17px;
  border: none; border-radius: 50%; cursor: pointer; color: var(--text-3);
  background: rgba(255, 255, 255, 0.12); font-size: 13px; line-height: 1; transition: all 0.15s;
}
.wtag__x:hover { background: #fff; color: #000; }
@keyframes pop { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: none; } }

.width-add { display: flex; gap: 8px; }
.width-add .input { flex: 1; }
.addbtn {
  flex: none; padding: 0 17px; font-family: var(--font-ui); font-weight: 500;
  font-size: 0.86rem; color: #fff; background: var(--surface-3);
  border: 1px solid var(--line-strong); border-radius: var(--radius-xs);
  cursor: pointer; transition: all 0.2s;
}
.addbtn:hover { border-color: #fff; background: rgba(255, 255, 255, 0.14); }

/* ---------- primary button (white pill) ---------- */
.primary {
  width: 100%; margin-top: 28px; display: flex; flex-direction: column;
  align-items: center; gap: 2px; padding: 16px; cursor: pointer;
  border: none; border-radius: var(--pill); background: #fff; color: #000;
  box-shadow: var(--glow-white);
  transition: transform 0.3s var(--spring), box-shadow 0.3s, background 0.2s, opacity 0.2s;
}
.primary:hover:not(:disabled) { transform: translateY(-2px); background: #e6e6e6; box-shadow: 0 14px 40px rgba(255, 255, 255, 0.2); }
.primary:active:not(:disabled) { transform: translateY(0) scale(0.99); }
.primary:disabled { opacity: 0.28; cursor: not-allowed; box-shadow: none; }
.primary__label { font-weight: 500; font-size: 1.02rem; letter-spacing: -0.03em; text-transform: lowercase; }
.primary__meta { font-size: 0.75rem; opacity: 0.62; font-weight: 400; }

/* ---------- ghost / output actions ---------- */
.ghostbtn {
  padding: 9px 15px; font-family: var(--font-ui); font-weight: 500; font-size: 0.8rem;
  color: var(--text-2); background: var(--white-soft); cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--pill); transition: all 0.2s;
}
.ghostbtn:hover { border-color: var(--line-strong); color: #fff; background: var(--white-hover); }
.ghostbtn--accent { color: #000; background: #fff; border-color: #fff; }
.ghostbtn--accent:hover { background: #e6e6e6; border-color: #e6e6e6; color: #000; box-shadow: var(--glow-white); }

/* ---------- empty state ---------- */
.empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px 20px; color: var(--text-4);
}
.empty__art { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 22px; height: 60px; }
.empty__art span { width: 22px; border-radius: 6px 6px 3px 3px; animation: bob 2.6s var(--ease) infinite; }
.empty__art span:nth-child(1) { height: 60px; animation-delay: 0s; background: rgba(255,255,255,0.22); }
.empty__art span:nth-child(2) { height: 40px; animation-delay: 0.2s; background: rgba(255,255,255,0.10); }
.empty__art span:nth-child(3) { height: 50px; animation-delay: 0.4s; background: rgba(255,255,255,0.22); }
.empty__art span:nth-child(4) { height: 30px; animation-delay: 0.6s; background: rgba(255,255,255,0.10); }
@keyframes bob { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(0.62); } }
.empty__title { font-weight: 500; color: var(--text-2); margin: 0 0 4px; letter-spacing: -0.02em; }
.empty__hint { font-size: 0.85rem; margin: 0; font-weight: 300; }

/* ---------- progress ---------- */
.progress { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 40px; }
.progress__track { width: 100%; max-width: 300px; height: 8px; border-radius: var(--pill); background: var(--surface-3); overflow: hidden; border: 1px solid var(--line); }
.progress__bar { height: 100%; width: 0; border-radius: var(--pill); background: linear-gradient(90deg, rgba(255,255,255,0.6), #fff); transition: width 0.35s var(--ease); }
.progress__text { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-3); margin: 0; }

/* ---------- summary ---------- */
.summary {
  display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: baseline;
  padding: 15px 18px; margin-bottom: 16px; border-radius: var(--radius-sm);
  background: var(--white-soft); border: 1px solid var(--line);
  animation: rise 0.5s var(--ease) both;
}
.summary__stat { display: flex; flex-direction: column; gap: 2px; }
.summary__k { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-4); font-weight: 500; }
.summary__v { font-family: var(--font-mono); font-size: 0.98rem; font-weight: 500; color: #fff; }
.summary__v.good { color: #fff; }
.summary__v.good::before { content: "↓ "; color: var(--text-3); }

/* ---------- variant grid ---------- */
.variants { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 24px; }
.variant {
  border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden;
  background: var(--surface-2); animation: rise 0.5s var(--ease) both;
  transition: transform 0.3s var(--spring), box-shadow 0.3s, border-color 0.2s;
}
.variant:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.variant__media {
  display: block; position: relative; width: 100%; margin: 0; padding: 0;
  border: none; background: var(--bg-elev); color: inherit; font: inherit;
  cursor: zoom-in; overflow: hidden;
}
.variant__media:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.variant__preview {
  aspect-ratio: 16 / 10; background: var(--bg-elev); display: block; width: 100%;
  object-fit: cover; border-bottom: 1px solid var(--line);
  transition: transform 0.4s var(--spring);
}
.variant__media:hover .variant__preview { transform: scale(1.04); }
.variant__zoom {
  position: absolute; top: 8px; right: 8px; width: 28px; height: 28px;
  display: grid; place-items: center; border-radius: 8px; color: #fff;
  background: rgba(0, 0, 0, 0.55); border: 1px solid var(--line-strong);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transform: scale(0.9);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--spring);
}
.variant__media:hover .variant__zoom,
.variant__media:focus-visible .variant__zoom { opacity: 1; transform: none; }
.variant__body { padding: 11px 13px; }
.variant__top { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 5px; }
.badge {
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.06em; padding: 3px 8px;
  border-radius: var(--pill); color: #fff;
  background: var(--white-hover); border: 1px solid var(--line-strong);
}
.badge--avif, .badge--webp, .badge--jpeg { /* monochrome — differentiated by label text */ }
.variant__dl { border: none; background: none; cursor: pointer; color: var(--text-4); padding: 2px; border-radius: 5px; transition: color 0.15s; }
.variant__dl:hover { color: #fff; }
.variant__dims { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-3); }
.variant__size { font-family: var(--font-mono); font-size: 0.92rem; font-weight: 500; margin-top: 2px; color: #fff; }
.variant__save { font-size: 0.66rem; font-weight: 500; color: var(--text-2); margin-top: 3px; }

/* ---------- code block ---------- */
.code { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-elev); }
.code__head { display: flex; align-items: center; justify-content: space-between; padding: 9px 11px; border-bottom: 1px solid var(--line); background: var(--surface); }
.tabs { display: flex; gap: 4px; }
.tab {
  font-family: var(--font-mono); font-size: 0.76rem; padding: 7px 12px; cursor: pointer;
  border: 1px solid transparent; border-radius: var(--pill); background: none; color: var(--text-3);
  transition: all 0.18s;
}
.tab:hover { color: var(--text-2); }
.tab.is-active { background: #fff; color: #000; border-color: #fff; font-weight: 500; }
.copybtn {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-ui);
  font-size: 0.79rem; font-weight: 500; padding: 7px 15px; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: var(--pill); background: var(--white-soft); color: #fff;
  transition: all 0.2s;
}
.copybtn:hover { border-color: #fff; background: var(--white-hover); }
.copybtn.is-done { background: #fff; border-color: #fff; color: #000; }
.code__block { margin: 0; padding: 18px; overflow-x: auto; }
.code__block code {
  font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.75;
  color: var(--text-2); white-space: pre; display: block;
}

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 1200;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(16px, 4vw, 52px);
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  opacity: 0; transition: opacity 0.28s var(--ease);
}
.lightbox.is-open { opacity: 1; }
.lightbox__figure {
  margin: 0; display: flex; flex-direction: column; gap: 14px;
  max-width: min(960px, 100%); max-height: 100%;
  transform: scale(0.96) translateY(10px); transition: transform 0.4s var(--spring);
}
.lightbox.is-open .lightbox__figure { transform: none; }
.lightbox__img {
  display: block; margin: 0 auto; max-width: 100%; max-height: calc(100vh - 190px);
  object-fit: contain; border-radius: var(--radius-sm);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  background-color: var(--bg-elev);
  background-image:
    linear-gradient(45deg, rgba(255,255,255,0.05) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.05) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.05) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.05) 75%);
  background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}
.lightbox__cap {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--neutral-glass); border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.lightbox__meta { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lightbox__name {
  font-family: var(--font-mono); font-size: 0.85rem; color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lightbox__stats { display: flex; align-items: center; gap: 9px; font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-3); }
.lightbox__stats .sep { color: var(--text-4); }
.lightbox__close {
  position: absolute; top: clamp(14px, 3vw, 28px); right: clamp(14px, 3vw, 28px);
  width: 44px; height: 44px; border-radius: 50%; padding: 0;
  display: grid; place-items: center; cursor: pointer; color: #fff; font-size: 22px; line-height: 1;
  background: var(--neutral-glass); border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: all 0.2s;
}
.lightbox__close:hover { background: #fff; color: #000; border-color: #fff; }

/* ---------- error toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px);
  z-index: 1000; max-width: 90vw; padding: 13px 22px; border-radius: var(--pill);
  background: #fff; color: #000; font-size: 0.88rem; font-weight: 500;
  box-shadow: var(--shadow-lg); opacity: 0; transition: all 0.4s var(--spring); pointer-events: none;
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.is-error { background: #1a0f0e; color: var(--danger); border: 1px solid rgba(255, 106, 95, 0.4); }

/* ---------- footer ---------- */
.footer { max-width: 1300px; margin: 0 auto; padding: 30px clamp(18px, 4vw, 44px) 48px; }
.footer p { font-size: 0.82rem; color: var(--text-4); margin: 0; max-width: 640px; font-weight: 300; }
.footer p.footer__by { margin-top: 10px; }
.footer a { color: var(--text-2); text-decoration: none; font-weight: 400; }
.footer a:hover { color: #fff; text-decoration: underline; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; }
  .col--right { position: static; }
}
@media (max-width: 520px) {
  .field--split { grid-template-columns: 1fr; }
  .formats { grid-template-columns: 1fr; }
  .topbar__badge { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
