/* Wallflower — ember on near-black. Tokens mirror the Nocturne-derived
   design canvas; every colour in the UI comes from this block. */
:root {
  --color-bg: #0b0b0c;
  --color-surface: #141416;
  --color-text: #eceae6;
  --color-accent: #ff3d9a;
  --color-accent-soft: rgba(255, 61, 154, .12);
  --color-accent-hover: rgba(255, 61, 154, .14);
  --danger: #e0563a;
  --ok: #4fd1a5;
  --warn: #e0c341;
  --s2: #1a1a1d;
  --line: #26262a;
  --muted: #8b8a85;
  --dim: #5f5e5a;
  --ember-dim: #33091f;
  --void: #08080a;
  --glow: 0 0 0 4px rgba(255, 61, 154, .22), 0 0 26px rgba(255, 61, 154, .45);
  --glow-sm: 0 0 0 3px rgba(255, 61, 154, .25), 0 0 18px rgba(255, 61, 154, .4);
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --rail-w: 228px;
  --panel-w: 430px;
  color-scheme: dark;
}

[data-theme="light"] {
  --color-bg: #f2f1ed;
  --color-surface: #e6e4de;
  --color-text: #17171a;
  --color-accent: #c2186b;
  --color-accent-soft: rgba(194, 24, 107, .12);
  --color-accent-hover: rgba(194, 24, 107, .14);
  --danger: #b8351b;
  --ok: #1f8f6a;
  --warn: #9a7d10;
  --s2: #eae8e2;
  --line: #d8d5cd;
  --muted: #6d6b65;
  --dim: #8b8880;
  --ember-dim: #fbdcec;
  --void: #e9e7e1;
  --glow: 0 0 0 4px rgba(194, 24, 107, .2), 0 0 26px rgba(194, 24, 107, .35);
  --glow-sm: 0 0 0 3px rgba(194, 24, 107, .22), 0 0 18px rgba(194, 24, 107, .32);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--void);
  color: var(--color-text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(255, 61, 154, .32); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

.mono { font-family: var(--mono); }
.flower { flex: none; overflow: visible; }
.flower g { fill: var(--color-accent); }
.flower .eye { fill: var(--color-bg); }
.gate-mark { margin-bottom: 14px; }
button svg, .btn svg { flex: none; }
.with-icon { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.spacer { flex: 1; }
.vr { width: 1px; height: 18px; background: var(--line); flex: none; }
.kicker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
}

@keyframes wf-pulse { 0% { opacity: .25 } 50% { opacity: .7 } 100% { opacity: .25 } }
@keyframes wf-fade { from { opacity: 0 } to { opacity: 1 } }

/* — controls ————————————————————————————————————————————————— */
button, .btn {
  font-family: inherit;
  font-size: 12px;
  color: var(--color-text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
}
button:hover, .btn:hover { background: var(--s2); }
button:disabled { opacity: .4; cursor: not-allowed; }

.btn-accent {
  border-color: var(--color-accent);
  color: var(--color-accent);
  font-weight: 600;
  font-size: 14px;
  padding: 9px 18px;
  border-radius: 6px;
}
.btn-accent:hover { background: var(--color-accent-hover); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: rgba(224, 86, 58, .12); }
.btn-bare { border-color: transparent; color: var(--dim); }
.btn-bare:hover { background: transparent; color: var(--color-text); }

/* The copy affordance is the whole point of the app, so success is loud. */
.is-copied {
  background: var(--color-accent) !important;
  border-color: var(--color-accent) !important;
  color: #0b0b0c !important;
  box-shadow: var(--glow);
}

input, select {
  font-family: inherit;
  font-size: 13px;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 9px;
  min-width: 0;
}
input:hover, select:hover { border-color: var(--muted); }
input:focus-visible, select:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
input[type="range"] { padding: 0; border: 0; background: transparent; accent-color: var(--color-accent); }

.seg { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button {
  flex: 1;
  border: 0;
  border-radius: 0;
  padding: 6px 0;
  color: var(--muted);
  background: transparent;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--color-accent-hover); color: var(--color-accent); }

/* — password gate ————————————————————————————————————————————— */
.gate {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  background: var(--color-bg);
  overflow: hidden;
}
.gate::before {
  content: "";
  position: absolute;
  left: -160px;
  top: 50%;
  width: 760px;
  height: 760px;
  transform: translateY(-50%);
  background: radial-gradient(circle, rgba(255, 61, 154, .16), transparent 62%);
  pointer-events: none;
}
.gate::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: linear-gradient(180deg, transparent, var(--color-accent) 35%, var(--color-accent) 65%, transparent);
}
.gate-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 40px;
  width: min(760px, 100%);
  padding: 0 48px 0 clamp(48px, 12vw, 180px);
}
.wordmark { font-size: clamp(48px, 7vw, 76px); font-weight: 700; letter-spacing: -0.05em; line-height: 1; }
.gate-state { font-family: var(--mono); font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.gate-field {
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 2px solid var(--line);
  padding-bottom: 14px;
}
.gate-field:focus-within { border-bottom-color: var(--color-accent); }
.gate-field svg { flex: none; fill: var(--color-accent); }
.gate-field input {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 0;
  font-family: var(--mono);
  font-size: clamp(20px, 3vw, 30px);
  letter-spacing: .18em;
}
.gate-field input:hover { border-color: transparent; }
.gate-field .btn-accent { flex: none; display: inline-flex; align-items: center; gap: 10px; }
.gate-field .btn-accent span { font-family: var(--mono); font-size: 11px; opacity: .7; font-weight: 400; }

/* — shell ——————————————————————————————————————————————————— */
.shell { height: 100%; display: flex; background: var(--color-bg); }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.rail {
  width: var(--rail-w);
  flex: none;
  border-right: 1px solid var(--line);
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
}
.rail-head { padding: 16px 16px 14px; border-bottom: 1px solid var(--line); }
.rail-brand { display: flex; align-items: center; gap: 8px; }
.rail-brand i { width: 9px; height: 9px; background: var(--color-accent); border-radius: 2px; }
.rail-brand b { font-size: 19px; font-weight: 700; letter-spacing: -0.03em; }
.rail-stat { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.rail-body { flex: 1; overflow: auto; padding: 14px 10px; display: flex; flex-direction: column; gap: 18px; }
.rail-group { display: flex; flex-direction: column; gap: 2px; }
.rail-group > .kicker { padding: 0 6px 6px; }
.rail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
  width: 100%;
}
.rail-item:hover { background: var(--s2); }
.rail-item svg { flex: none; fill: var(--dim); }
.rail-item i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.rail-item span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-item b { font-family: var(--mono); font-size: 11px; font-weight: 400; color: var(--dim); }
.rail-item[aria-current="true"] { background: var(--s2); color: var(--color-text); }
.rail-item[aria-current="true"] svg { fill: var(--color-accent); }
.rail-add { color: var(--dim); }
.rail-add:hover { color: var(--color-accent); background: transparent; }
.rail-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 9px; }
.rail-foot .row { display: flex; align-items: baseline; justify-content: space-between; font-size: 12px; color: var(--muted); }
.rail-foot .row b { font-family: var(--mono); font-size: 11px; font-weight: 400; }
.rail-foot button { width: 100%; }
.rail-foot button svg { fill: currentColor; }
.rail-foot .btn-bare { justify-content: flex-start; }

/* — filter bar ————————————————————————————————————————————————— */
.filters {
  height: 52px;
  flex: none;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 18px;
}
.search {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 230px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--color-surface);
}
.search svg { flex: none; fill: var(--dim); }
.search input { flex: 1; background: transparent; border: 0; padding: 0; font-size: 13px; }
.search input:hover { border-color: transparent; }
.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 12px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
}
.chip:hover { border-color: var(--color-accent); background: transparent; }
.chip[aria-pressed="true"] { border-color: var(--color-accent); color: var(--color-accent); background: var(--color-accent-soft); }
.chip svg { fill: currentColor; flex: none; }
.filters .count { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.filters select { height: 30px; font-size: 12px; color: var(--muted); }
.sort-wrap { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.sort-wrap svg { flex: none; fill: currentColor; }
#select-mode { height: 30px; }
#select-mode svg { fill: currentColor; }

/* — content ————————————————————————————————————————————————— */
.content { flex: 1; overflow: auto; padding: 14px 18px 24px; display: flex; flex-direction: column; gap: 14px; }

.dropstrip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--dim);
  font-size: 13px;
  flex: none;
}
.dropstrip svg { flex: none; fill: var(--color-accent); }
.dropstrip u { color: var(--color-accent); text-underline-offset: 3px; cursor: pointer; }
body.dragging .dropstrip, body.dragging .empty-drop { border-color: var(--color-accent); background: var(--color-accent-soft); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; align-content: start; }
.grid.is-narrow { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }

.tile {
  display: flex;
  flex-direction: column;
  gap: 7px;
  cursor: pointer;
  border-radius: 8px;
  padding: 5px;
  margin: -5px;
  border: 0;
  background: transparent;
  text-align: left;
  animation: wf-fade .18s ease;
}
.tile:hover { background: var(--color-surface); }
.tile[aria-selected="true"] { box-shadow: 0 0 0 2px var(--color-accent); background: var(--color-surface); }
.tile-shot { position: relative; aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: #000; }
.tile-shot img { width: 100%; height: 100%; object-fit: cover; opacity: .94; display: block; }
.tile-badges { position: absolute; top: 6px; left: 6px; display: flex; gap: 4px; }
.badge {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .06em;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(8, 8, 10, .72);
  color: #cfcdc8;
  backdrop-filter: blur(6px);
}
.badge.is-8k { color: #ff7fbc; }
.tile-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(236, 234, 230, .5);
  background: rgba(8, 8, 10, .5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.tile-check svg { fill: #0b0b0c; display: none; }
body.selecting .tile-check { display: flex; }
.tile[aria-selected="true"] .tile-check { border-color: var(--color-accent); background: var(--color-accent); }
.tile[aria-selected="true"] .tile-check svg { display: block; }
.tile-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 7px;
  display: flex;
  gap: 5px;
  background: linear-gradient(transparent, rgba(8, 8, 10, .85));
}
body.selecting .tile-bar { opacity: 0; pointer-events: none; }
.tile-bar button {
  font-family: var(--mono);
  font-size: 11px;
  padding: 5px;
  border-radius: 5px;
  background: rgba(8, 8, 10, .6);
  transition: box-shadow .18s, background .18s;
}
.tile-copy {
  flex: 1;
  border-color: var(--color-accent);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.tile-copy svg { fill: currentColor; }
.tile-open { width: 28px; color: #e9e7e2; }
.tile-meta { display: flex; flex-direction: column; gap: 2px; padding: 0 1px; min-width: 0; }
.tile-name { display: flex; align-items: center; gap: 6px; }
.tile-name i { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.tile-name span { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.tile-facts { display: flex; gap: 6px; font-family: var(--mono); font-size: 11px; color: var(--dim); }
.tile-file { font-family: var(--mono); font-size: 10px; color: var(--dim); opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.no-hits {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
  padding: 60px 0;
  color: var(--muted);
  font-size: 13px;
}

/* — upload queue ————————————————————————————————————————————— */
.queue { border: 1px solid var(--line); border-radius: 8px; background: var(--color-surface); flex: none; }
.queue-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.queue-head .live { width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent); animation: wf-pulse 1.2s infinite; }
.queue-head .title { font-size: 13px; font-weight: 600; }
.queue-head .rate { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.queue-head .failed { font-family: var(--mono); font-size: 12px; color: var(--danger); }
.queue-row {
  display: grid;
  grid-template-columns: 1fr 130px 96px 84px;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
}
.queue-row:last-child { border-bottom: 0; }
.queue-row .file { display: flex; align-items: center; gap: 10px; min-width: 0; }
.queue-row .file i { width: 5px; height: 5px; border-radius: 50%; flex: none; }
.queue-row .file span { font-family: var(--mono); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-row .track { height: 4px; border-radius: 2px; background: var(--s2); overflow: hidden; }
.queue-row .track div { height: 100%; transition: width .2s ease; }
.queue-row .size { font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: right; }
.queue-row .status { font-family: var(--mono); font-size: 11px; text-align: right; }

/* — empty state ————————————————————————————————————————————— */
.empty { flex: 1; padding: 26px; display: flex; }
.empty-drop {
  flex: 1;
  border: 1px dashed var(--line);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 42%, rgba(255, 61, 154, .07), transparent 60%);
}
.empty-drop svg { fill: var(--color-accent); }
.empty-drop h2 { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 8px; }
.empty-drop p { color: var(--muted); max-width: 420px; margin: 0; text-wrap: pretty; }
.empty-hint { font-family: var(--mono); font-size: 11px; color: var(--dim); letter-spacing: .06em; }

/* — selection bar ————————————————————————————————————————————— */
.bulkbar {
  height: 52px;
  flex: none;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: var(--ember-dim);
}
.bulkbar .n { font-size: 13px; font-weight: 600; color: var(--color-accent); }
.bulkbar .btn-bare { color: var(--color-text); }

.workspace { flex: 1; display: flex; min-height: 0; }
.workspace > .content { flex: 1; }

.recipe-panel {
  width: 400px;
  flex: none;
  border-left: 1px solid var(--line);
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.recipe-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.recipe-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.recipe-chips span {
  font-family: var(--mono);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 5px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.recipe-chips span.is-key { border-color: var(--color-accent); color: var(--color-accent); }
.recipe-list { flex: 1; overflow: auto; }
.recipe-row { display: flex; flex-direction: column; gap: 5px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.recipe-row .top { display: flex; align-items: baseline; gap: 8px; }
.recipe-row .top b { font-size: 12px; font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recipe-row .top span { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.recipe-row .bottom { display: flex; align-items: center; gap: 8px; }
.recipe-row .bottom code { flex: 1; font-family: var(--mono); font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recipe-row .bottom button { font-family: var(--mono); font-size: 11px; padding: 4px 9px; border-radius: 5px; }
.recipe-foot { padding: 14px 16px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.recipe-foot .btn-accent { flex: 1; transition: box-shadow .18s, background .18s; }
.recipe-foot .total { font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: right; line-height: 1.35; }

/* — detail view ————————————————————————————————————————————— */
.detail { position: fixed; inset: 0; background: var(--color-bg); display: flex; flex-direction: column; z-index: 20; }
.detail-head { height: 52px; flex: none; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 16px; }
.detail-head .back { display: flex; align-items: center; gap: 7px; border-color: transparent; color: var(--muted); font-size: 13px; }
.detail-head .back:hover { color: var(--color-text); background: transparent; }
.detail-head .back svg { fill: currentColor; }
.detail-title { display: flex; align-items: center; gap: 7px; min-width: 0; }
.detail-title i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.detail-title input {
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  width: 250px;
  padding: 2px 0;
}
.detail-title input:hover { border-bottom-color: var(--line); }
.detail-title input:focus-visible { border-bottom-color: var(--color-accent); outline: none; }
.detail-tags { display: flex; align-items: center; gap: 5px; }
.detail-tags .tag { font-size: 11px; padding: 3px 8px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); }
.detail-tags .tag.is-add { border-style: dashed; color: var(--dim); }
.detail-head .file { font-family: var(--mono); font-size: 11px; color: var(--dim); }

.detail-body { flex: 1; display: flex; min-height: 0; }
.stage-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--void); }
.stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; min-height: 0; }
.stage-note { flex: none; padding: 0 24px 18px; display: flex; align-items: center; gap: 14px; }
.stage-note .lead { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--color-accent); }
.stage-note .rule { flex: 1; height: 1px; background: linear-gradient(to right, var(--line), transparent); }
.stage-note .facts { font-family: var(--mono); font-size: 11px; color: var(--dim); }

/* Cover: the full frame sits dimmed behind, the kept rectangle punches through. */
.ghost { position: relative; }
.ghost > img { width: 100%; height: 100%; object-fit: fill; opacity: .16; display: block; }
.ghost .hatch {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(45deg, rgba(255, 61, 154, .05) 0 6px, transparent 6px 12px);
}
.ghost .keep {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
  box-shadow: 0 0 0 2px var(--color-accent), 0 0 40px rgba(0, 0, 0, .7);
}
.ghost .keep img { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); object-fit: fill; display: block; }
.framed { position: relative; box-shadow: 0 0 0 1px var(--line), 0 0 40px rgba(0, 0, 0, .7); }
.framed.is-bars { background: #000; }
.framed img { width: 100%; height: 100%; display: block; }
.framed.is-bars img { object-fit: contain; }
.framed.is-fit img { object-fit: fill; }

.panel { width: var(--panel-w); flex: none; border-left: 1px solid var(--line); background: var(--color-surface); display: flex; flex-direction: column; min-height: 0; }
.panel-scroll { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 18px; }
.panel-section { display: flex; flex-direction: column; gap: 9px; }
.panel-section > header { display: flex; align-items: center; gap: 8px; }
.panel-section > header > svg { flex: none; fill: var(--color-accent); }
.panel-section > header .rule { flex: 1; height: 1px; background: var(--line); }
.panel-section .legend { display: flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 10px; color: var(--dim); }
.panel-section .legend i { width: 5px; height: 5px; border-radius: 50%; background: var(--ok); }
.panel-section.is-off { opacity: .4; }

.size-row { display: grid; grid-template-columns: 78px 1fr; align-items: center; gap: 10px; }
.size-row > .k { font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: right; }
.size-opts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.preset {
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 9px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
}
.preset i { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.preset.is-cached i { background: var(--ok); }
.preset[aria-pressed="true"] { border-color: var(--color-accent); color: var(--color-accent); background: var(--color-accent-soft); }
.preset[aria-pressed="true"].is-cached i { background: var(--color-accent); }
.size-opts input { width: 74px; font-family: var(--mono); font-size: 12px; }
.size-opts .x { color: var(--dim); font-family: var(--mono); font-size: 12px; }
.size-opts.is-off input { opacity: .4; }
.quality { display: flex; align-items: center; gap: 11px; }
.quality label { font-size: 12px; color: var(--muted); width: 52px; }
.quality input { flex: 1; }
.quality output { font-family: var(--mono); font-size: 12px; width: 26px; text-align: right; }
.note { font-size: 12px; color: var(--muted); }

.panel-foot { flex: none; border-top: 1px solid var(--line); background: var(--color-bg); padding: 14px 16px; display: flex; flex-direction: column; gap: 11px; }
.panel-foot .recipe { display: flex; align-items: baseline; gap: 10px; }
.panel-foot .recipe .spec { font-family: var(--mono); font-size: 12px; color: var(--color-accent); }
.panel-foot .recipe .cached { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.panel-foot .recipe .cached.is-hot { color: var(--ok); }
.panel-foot .out { display: flex; align-items: baseline; gap: 10px; }
.panel-foot .out b { font-size: 23px; font-weight: 700; letter-spacing: -0.02em; }
.panel-foot .out span { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.url-row { display: flex; align-items: stretch; gap: 9px; }
.url-row .url {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--color-surface);
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.url-row .btn-accent {
  min-width: 150px;
  font-size: 15px;
  padding: 11px 20px;
  transition: box-shadow .18s, background .18s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.url-row .btn-accent svg { fill: currentColor; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 40;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--color-accent);
  background: var(--color-bg);
  color: var(--color-accent);
  font-family: var(--mono);
  font-size: 12px;
  box-shadow: var(--glow-sm);
  animation: wf-fade .14s ease;
}

@media (max-width: 1180px) {
  .panel { width: 360px; }
  .recipe-panel { width: 330px; }
}
@media (max-width: 900px) {
  .rail { display: none; }
  .detail-body { flex-direction: column; }
  .panel { width: 100%; border-left: 0; border-top: 1px solid var(--line); max-height: 55%; }
  .search { width: 150px; }
}
