/* OMGTOOLS 2.0 tool layout, shared by Convertible and Telecine (from Cover Kit, Figma 110:1221).
   Loaded after each tool's own styles. Preview pane on the left, settings panel on the right. */

/* One UI color: black with white text (white with black in dark mode) */
[data-accent="black"] { --bg-accent: #000000; --bg-accent-hover: #27272A; --bg-accent-subtle: #E4E4E7; --text-on-accent: #FFFFFF; --text-accent: #000000; --border-focus: #000000; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) [data-accent="black"] { --bg-accent: #FFFFFF; --bg-accent-hover: #E4E4E7; --bg-accent-subtle: #27272A; --text-on-accent: #000000; --text-accent: #FFFFFF; --border-focus: #FFFFFF; }
}
:root[data-theme="dark"] [data-accent="black"] { --bg-accent: #FFFFFF; --bg-accent-hover: #E4E4E7; --bg-accent-subtle: #27272A; --text-on-accent: #000000; --text-accent: #FFFFFF; --border-focus: #FFFFFF; }

.omg-tool.v2 { --v2-ease: cubic-bezier(.65, 0, .35, 1); display: grid; grid-template-columns: minmax(0, 1fr) clamp(380px, 34.25vw, 560px); gap: 0; max-width: none; margin: 0; padding: 0; height: calc(100vh - 54px); height: calc(100dvh - 54px); }

/* ---------- Left pane: drop zone, summary, file list ---------- */
.v2-pane { container-type: inline-size; min-width: 0; min-height: 0; overflow-y: auto; background: var(--bg-canvas); padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.omg-tool.v2 .omg-block { padding: 20px; }
.omg-tool.v2 .drop:not(.has-files) { flex: 1; min-height: 300px; }
.omg-tool.v2 .drop.has-files { flex: none; min-height: 0; flex-direction: row; justify-content: space-between; text-align: left; padding: 20px; }
.omg-tool.v2 .drop.has-files .drop-title { font: 16px/1.5 var(--font-body); }
.omg-tool.v2 .drop.has-files .drop-text > :not(.drop-title) { margin-top: 0 !important; }
/* Black marching ants: 1px, 6px dashes, 6px gaps */
.omg-tool.v2 .drop { background-size: 12px 1px, 12px 1px, 1px 12px, 1px 12px; animation: v2-march 1s linear infinite; transition: background-color .2s ease; }
@keyframes v2-march { to { background-position: 12px 0, -12px 100%, 0 -12px, 100% 12px; } }
.omg-tool.v2 .drop.over { background-color: var(--bg-canvas); animation-duration: .4s; }
.omg-tool.v2 .drop-title { font: 20px/1.2 var(--font-body); }
.omg-tool.v2 .drop .btn-secondary { background: var(--bg-canvas); border-color: transparent; }
/* Summary: 12px stats like the Cover Kit bar */
.omg-tool.v2 .summary { gap: 12px 40px; }
.omg-tool.v2 .stat { gap: 1px; }
.omg-tool.v2 .stat .k, .omg-tool.v2 .stat .v { font: 12px/1.5 var(--font-body); font-variant-numeric: tabular-nums; }
.omg-tool.v2 .stat .v { color: var(--text-primary); }
.omg-tool.v2 .summary .acts { margin-left: auto; }
/* Buttons in the pane: square, 37px, 12px text; row buttons 29px */
.omg-tool.v2 .btn { height: 37px; min-height: 37px; padding: 0 15px; font: 12px/1.5 var(--font-body); }
.omg-tool.v2 .rowacts .btn { height: 29px; min-height: 29px; padding: 0 10px; }
.omg-tool.v2 .btn { transition: background-color .15s ease, border-color .15s ease, opacity .2s ease; }
.omg-tool.v2 .progress i, .omg-tool.v2 .bar i { background: var(--text-primary); }

/* ---------- Right panel: description, accordions, notes; Download pinned at the foot ---------- */
.v2-panel { background: var(--bg-surface); display: flex; flex-direction: column; min-height: 0; }
.v2-settings { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 20px 40px; display: flex; flex-direction: column; gap: 40px; }
.v2-foot { display: flex; flex-direction: column; gap: 12px; padding: 20px; background: var(--bg-surface); }
.omg-tool.v2 .v2-foot .btn { width: 100%; }
.v2-intro { position: relative; }
.v2-intro img { position: absolute; left: 0; top: 2px; width: 20px; height: 20px; }
.v2-intro .omg-tool-desc { max-width: none; text-align: left; text-indent: 28px; }
.v2-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 20px; font: 16px/24px var(--font-body); color: var(--text-primary); }
.v2-row > span:first-child { flex: 1; }
.v2-val { font: 12px/1.5 var(--font-body); color: var(--text-secondary); font-variant-numeric: tabular-nums; }   /* current value, so a closed row still says what it's set to */
.v2-icon { flex: none; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 5px; background: var(--bg-canvas); }
.v2-chev img { width: 5.885px; height: 10px; transform: rotate(-90deg); transition: transform .3s var(--v2-ease); }
details[open]:not(.v2-closing) > summary .v2-chev img { transform: rotate(90deg); }
.v2-accs { border-bottom: 1px solid var(--border-default); }
.v2-acc { border-top: 1px solid var(--border-default); }
.v2-acc > summary { list-style: none; padding: 15px 0; cursor: pointer; }
.v2-acc > summary::-webkit-details-marker { display: none; }
.v2-acc > summary:focus-visible { outline: 1px solid var(--border-focus); outline-offset: -1px; }
.v2-body { display: flex; flex-direction: column; gap: 12px; padding: 5px 0 20px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .v2-panel img { filter: invert(1); } }
:root[data-theme="dark"] .v2-panel img { filter: invert(1); }
.omg-tool.v2 .v2-body.notes { border-top: 0; padding: 5px 0 20px; gap: 12px; font: 12px/1.5 var(--font-body); }   /* notes live in the last accordion row */

/* Pills: 29px, 12px text, sized to the label and wrapping. Selected is filled black. */
.omg-tool.v2 .seg, dialog .seg { display: flex; flex-wrap: wrap; gap: 8px; }
.omg-tool.v2 .seg button, dialog .seg button { height: 29px; min-height: 29px; padding: 0 10px; border-radius: 100px; font: 12px/1.5 var(--font-body); display: flex; align-items: center; justify-content: center; gap: 4px; color: var(--text-primary); background: var(--bg-surface); border: 1px solid var(--border-default); cursor: pointer; transition: border-color .15s ease, background-color .15s ease, color .15s ease; }
.omg-tool.v2 .seg button small, dialog .seg button small { font: 12px/1.5 var(--font-body); color: var(--text-secondary); transition: color .15s ease; }
.omg-tool.v2 .seg button[aria-pressed="true"], dialog .seg button[aria-pressed="true"] { background: var(--text-primary); border-color: var(--text-primary); color: var(--bg-surface); }
.omg-tool.v2 .seg button[aria-pressed="true"] small, dialog .seg button[aria-pressed="true"] small { color: inherit; opacity: .7; }
@media (hover: hover) {
  .omg-tool.v2 .seg button:not([aria-pressed="true"]):hover, dialog .seg button:not([aria-pressed="true"]):hover { border-color: var(--text-primary); }
}
.omg-tool.v2 .affix { transition: border-color .15s ease; }

/* Things that appear fade in */
@keyframes v2-fade-in { from { opacity: 0; } }
.omg-tool.v2 .row:not(.head), .omg-tool.v2 .banner:not([hidden]) { animation: v2-fade-in .2s ease; }
.v2-boot * { transition: none !important; }

/* ---------- Phones and small tablets: pane, then the panel, with Download pinned to the bottom ---------- */
@media (max-width: 800px) {
  .omg-tool.v2 { display: flex; flex-direction: column; height: auto; }
  .v2-pane { overflow: visible; padding: 16px; }
  .omg-tool.v2 .drop:not(.has-files) { min-height: 240px; }
  .v2-settings { overflow: visible; padding: 24px 16px 40px; }
  .v2-foot { position: sticky; bottom: 0; padding: 16px; }
  .omg-tool.v2 .drop.has-files { flex-direction: column; align-items: stretch; text-align: center; }
}

/* Stats bar: under the description, scrolling with the settings */
.omg-tool.v2 .v2-panel .summary { padding: 0; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; }
.omg-tool.v2 .v2-panel .summary .acts { margin-left: auto; flex-basis: auto; }
.omg-tool.v2 .v2-panel .summary .acts .btn-ghost { height: auto; min-height: 0; padding: 0; }   /* text button flush with the right edge, level with the stat values */

/* File list: content lines up with the drop strip, 20px in from every edge */
.omg-tool.v2 .list { padding: 8px 0; }
.omg-tool.v2 .list .row { padding-left: 20px; padding-right: 20px; }
.omg-tool.v2 .list .empty-row { padding: 12px 20px; }

/* File names stay on one line and end in … when they're too long; the full name shows on hover */
.omg-tool.v2 .list .meta { min-width: 0; }
.omg-tool.v2 .list .name { flex-wrap: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; }
.omg-tool.v2 .list .fname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Nav bar in the tool's icon color (the same color as its home card icon), black text */
.omg-nav[data-tool] { background: var(--nav-bg); }
.omg-nav[data-tool] a, .omg-nav[data-tool] .omg-nav-crumb { color: var(--nav-ink, #000000); }
.omg-nav[data-tool="convertible"] { --nav-bg: #1DCDAD; }
.omg-nav[data-tool="telecine"] { --nav-bg: #EF89F9; }
.omg-nav[data-tool="dingbats"] { --nav-bg: #8F77F7; }
.omg-nav[data-tool="teleprompter"] { --nav-bg: #FF6B00; }
.omg-nav[data-tool="shrink-ray"] { --nav-bg: #00B03D; }
.omg-nav[data-tool] :focus-visible { outline-color: #000000; }

/* Toggle beside Download (e.g. Convertible's JPG / PNG / WebP): same as Cover Kit's Cover/Story toggle.
   Rounded pill, the picked option filled black by one shape that slides across. */
.v2-foot-row { flex-direction: row; align-items: center; gap: 10px; }
.omg-tool.v2 .v2-foot-row .btn { flex: 1; width: auto; }
.v2-toggle { position: relative; flex: none; display: flex; padding: 3px; border: 1px solid var(--border-default); border-radius: 100px; }
.v2-toggle-fill { position: absolute; top: 3px; bottom: 3px; left: 3px; width: 0; border-radius: 100px; background: var(--text-primary); transition: left .3s var(--v2-ease), width .3s var(--v2-ease); }
.v2-toggle button { all: unset; box-sizing: border-box; position: relative; height: 29px; padding: 0 10px; display: flex; align-items: center; justify-content: center; border-radius: 100px; font: 12px/1.5 var(--font-body); color: var(--text-primary); cursor: pointer; transition: color .3s ease; }
.v2-toggle button[aria-pressed="true"] { color: var(--bg-surface); }
.v2-toggle button:disabled { opacity: .45; cursor: not-allowed; }
.v2-toggle button:focus-visible { outline: 1px solid var(--border-focus); outline-offset: 2px; }

/* Compact file list (narrow pane): no column headings, like on phones */
@container (max-width: 820px) {
  .omg-tool.v2 .row.head { display: none; }
  .omg-tool.v2 .row.head + .row { border-top: 0; }
}

/* Left pane: no white blocks. The drop zone and file list sit straight on the canvas gray (like Dingbats).
   Row lines move to the border gray so they still show, buttons in the pane go white, and the drop zone turns white while files are dragged over it. */
.v2-pane .omg-block { background-color: transparent; }   /* color only, so the drop zone keeps its marching-ants border */
.omg-tool.v2 .v2-pane .drop.over { background-color: transparent; }   /* no box while files are dragged over; the words change instead */
.omg-tool.v2 .v2-pane .drop .btn-secondary, .omg-tool.v2 .v2-pane .rowacts .btn-secondary { background: var(--bg-surface); }
.omg-tool.v2 .v2-pane .row { border-top-color: var(--border-default); }

/* Drop zone: no outline, just a centered + and “Drop media here”. The whole area is the button.
   The + does a quarter-turn on hover, keyboard focus and while files are dragged over. */
.omg-tool.v2 .v2-pane .drop { background-image: none; animation: none; padding: 0; gap: 0; }
.drop-pick { all: unset; box-sizing: border-box; flex: 1; align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 20px; color: var(--text-primary); cursor: pointer; }
.drop-plus { width: 28px; height: 28px; display: block; transition: transform .3s var(--v2-ease, cubic-bezier(.65, 0, .35, 1)); }
.drop-pick:focus-visible .drop-plus, .drop.over .drop-plus { transform: rotate(90deg); }
@media (hover: hover) { .drop-pick:hover .drop-plus { transform: rotate(90deg); } }
/* With files in: a small pill (like the settings pills: 29px, 12px text, no fill, 1px line that turns black on hover), 20px in so it lines up with the list */
.omg-tool.v2 .v2-pane .drop.has-files { padding: 20px; align-items: flex-start; }
.omg-tool.v2 .drop.has-files .drop-pick { flex: none; align-self: flex-start; flex-direction: row; justify-content: flex-start; gap: 6px; height: 29px; padding: 0 12px 0 10px; border: 1px solid var(--border-default); border-radius: 100px; background: transparent; transition: border-color .15s ease; }
.omg-tool.v2 .drop.has-files .drop-pick .drop-title { font: 12px/1.5 var(--font-body); }
.omg-tool.v2 .drop.has-files .drop-plus { flex: none; width: 10px; height: 10px; }
@media (hover: hover) { .omg-tool.v2 .drop.has-files .drop-pick:hover { border-color: var(--text-primary); } }
.omg-tool.v2 .drop.has-files .drop-pick:focus-visible { border-color: var(--border-focus); }
.drop.disabled .drop-pick { cursor: not-allowed; opacity: .45; }
@media (prefers-reduced-motion: reduce) { .drop-plus { transition: none; } }
/* “Drop media here” matches the 16px settings rows; the file list (and its “No images yet” line) stays hidden until files are in */
.omg-tool.v2 .drop-pick .drop-title { font: 16px/24px var(--font-body); }
.omg-tool.v2 .drop:not(.has-files) ~ .list { display: none; }
/* “Add media”, and while files are dragged over the page: “Drop it like it’s hot”. The two share one spot and crossfade. */
.drop-pick .drop-title { display: inline-grid; }
.drop-idle, .drop-hot { grid-area: 1 / 1; justify-self: center; transition: opacity .3s var(--v2-ease, cubic-bezier(.65, 0, .35, 1)); }
.drop.has-files .drop-idle, .drop.has-files .drop-hot { justify-self: start; }
.drop-hot, .drop.over .drop-idle { opacity: 0; }
.drop.over .drop-hot { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .drop-idle, .drop-hot { transition: none; } }
/* The pill fits whichever words are showing; its width slides as they crossfade (width set by omglord-tool.js) */
.omg-tool.v2 .drop.has-files .drop-pick { overflow: hidden; transition: border-color .15s ease, width .3s var(--v2-ease, cubic-bezier(.65, 0, .35, 1)); }
.omg-tool.v2 .drop.has-files .drop-title { flex: none; }
@media (prefers-reduced-motion: reduce) { .omg-tool.v2 .drop.has-files .drop-pick { transition: border-color .15s ease; } }
/* + line weight in real pixels, whatever the icon’s size: 1.5px on the big one, 1.1px in the pill */
.drop-plus path { vector-effect: non-scaling-stroke; stroke-width: 1.5px; }
.drop.has-files .drop-plus path { stroke-width: 1.1px; }
/* Everything in the pane starts at the same left margin as the nav text (the pane's own 20px, 16px on phones):
   the Add media pill and the file list rows have no extra inset, so their lines run from that margin too */
.omg-tool.v2 .v2-pane .drop.has-files { padding-left: 0; padding-right: 0; }
.omg-tool.v2 .v2-pane .list .row, .omg-tool.v2 .v2-pane .list .empty-row { padding-left: 0; padding-right: 0; }
/* File rows: a Download column. The heading sits over a ↓ icon button; ✕ stays at the far right. */
.omg-tool.v2 .v2-pane .rowacts { gap: 4px; align-items: center; }
.omg-tool.v2 .v2-pane .rowacts [data-a=rm] { width: 29px; min-width: 29px; padding: 0; }
.omg-tool.v2 .v2-pane .row.head > span:last-child { text-align: right; padding-right: 33px; }   /* ✕ width + gap, so the word sits over the arrow */
.row-dl { all: unset; box-sizing: border-box; flex: none; width: 56px; height: 29px; display: grid; place-items: center; color: var(--text-primary); cursor: pointer; transition: opacity .2s ease; }
.row-dl svg { width: 12px; height: 12px; display: block; }
.row-dl svg path { vector-effect: non-scaling-stroke; stroke-width: 1px; }   /* same weight as the ✕ */
.row-dl:disabled { opacity: .3; cursor: default; }
.row-dl:focus-visible { outline: 1px solid var(--border-focus); outline-offset: -1px; }
/* The Add media pill keeps its words while files are dragged over; only the big empty drop area says “Drop it like it’s hot” */
.drop.has-files.over .drop-idle { opacity: 1; }
.drop.has-files.over .drop-hot { opacity: 0; }
/* File list columns: one shared set of columns for the whole list (subgrid), each as wide as its widest content,
   with the spare space split evenly between them. Long names still end in “…”. Wide pane only; narrow keeps the stacked rows. */
@container (min-width: 821px) {
  /* content columns (odd) sized to their content; the even columns are the gaps, all equal and never under 24px */
  .omg-tool.v2 .v2-pane .list { display: grid; grid-template-columns: 56px minmax(24px, 1fr) minmax(0, max-content) minmax(24px, 1fr) max-content minmax(24px, 1fr) max-content minmax(24px, 1fr) max-content minmax(24px, 1fr) max-content; column-gap: 0; }
  .omg-tool.v2 .v2-pane .list > .row { grid-column: 1 / -1; grid-template-columns: subgrid; column-gap: 0; }
  .omg-tool.v2 .v2-pane .list > .row > :nth-child(1) { grid-column: 1; }
  .omg-tool.v2 .v2-pane .list > .row > :nth-child(2) { grid-column: 3; }
  .omg-tool.v2 .v2-pane .list > .row > :nth-child(3) { grid-column: 5; }
  .omg-tool.v2 .v2-pane .list > .row > :nth-child(4) { grid-column: 7; }
  .omg-tool.v2 .v2-pane .list > .row > :nth-child(5) { grid-column: 9; }
  .omg-tool.v2 .v2-pane .list > .row > :nth-child(6) { grid-column: 11; }
  .omg-tool.v2 .v2-pane .list > .row > .err { grid-column: 3 / -1; }
  .omg-tool.v2 .v2-pane .list > .empty-row { grid-column: 1 / -1; }
}
/* Download column: heading and ↓ share the column's left edge; ✕ sits flush with the list's right edge.
   (Telecine's Preview sits between them.) */
.omg-tool.v2 .v2-pane .row.head > span:last-child { text-align: left; padding-right: 0; }
.omg-tool.v2 .v2-pane .rowacts { justify-content: flex-start; }
.omg-tool.v2 .v2-pane .rowacts .row-dl { order: -1; width: auto; padding: 0 8px 0 0; justify-items: start; }
.omg-tool.v2 .v2-pane .rowacts [data-a=rm] { margin-left: auto; width: auto; min-width: 0; padding: 0 0 0 8px; justify-content: flex-end; }
/* With files in (desktop): the list starts at the top, level with the panel's intro, and the Add media pill is pinned
   to the pane's bottom-left corner, centred on the panel's Download button. The list scrolls under it. */
@media (min-width: 801px) {
  .omg-tool.v2 .v2-pane:has(.drop.has-files) { padding-bottom: 0; }
  .omg-tool.v2 .v2-pane .drop.has-files { order: 1; position: sticky; bottom: 0; z-index: 1; margin-top: auto; padding: 20px 0 24px; background-color: var(--bg-canvas); }
  .omg-tool.v2 .v2-pane .drop.has-files ~ .list { padding-top: 0; flex-shrink: 0; }   /* never squashed: a long list scrolls the pane, under the pill */
  .omg-tool.v2 .v2-pane .drop.has-files ~ .list > .row.head { padding-top: 0; }   /* headings level with the intro text */
}
/* Only the pill floats: no band behind it, the list scrolls behind and stays clickable around it.
   The pill itself is filled with the page gray so rows passing behind don't show through its words. */
@media (min-width: 801px) {
  .omg-tool.v2 .v2-pane .drop.has-files { background-color: transparent; pointer-events: none; }
  .omg-tool.v2 .v2-pane .drop.has-files .drop-pick { pointer-events: auto; background: var(--bg-canvas); }
}
/* The pinned pill matches the format toggle beside Download: 37px tall, bottoms level */
@media (min-width: 801px) {
  .omg-tool.v2 .v2-pane .drop.has-files { padding-bottom: 20px; }
  .omg-tool.v2 .v2-pane .drop.has-files .drop-pick { height: 37px; padding: 0 16px 0 14px; }
}
