/* Caption editing (captions-ui.mjs), on both pages that mount it: the style pane, the lines pane and the text box
   on the picture. Everything here carries a cu- class; a page styles only its own shell. */
.cu-group { display: grid; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.cu-group:last-child { padding-bottom: 0; border-bottom: 0; }
.cu-h { margin: 0; font: 600 12px/1.2 var(--sans); color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.cu-hint { margin: 0; font: 400 12.5px/1.45 var(--sans); color: var(--muted); }

/* the looks */
.cu-seg { display: flex; }
.cu-seg button { flex: 1; padding: 8px 10px; font-size: 13px; white-space: nowrap; }
.cu-presets { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.cu-presets button { padding: 0; border: 2px solid transparent; border-radius: 12px; background: var(--ink); cursor: pointer; height: 60px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.cu-presets canvas { display: block; width: 100%; height: 100%; }
.cu-presets button.is-on { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; }

/* the switches, in one card */
.cu-switches { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.cu-switch { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; cursor: pointer; }
.cu-switch span { display: grid; gap: 3px; }
.cu-switch b { font: 500 13.5px/1.3 var(--sans); color: var(--ink); }
.cu-switch small { font: 400 12px/1.35 var(--sans); color: var(--muted); }
.cu-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.cu-switch i { position: relative; width: 38px; height: 22px; border-radius: 999px; background: rgba(14, 8, 7, 0.16); transition: background var(--t) var(--ease); }
.cu-switch i::after { content: ''; position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform var(--t) var(--ease); }
.cu-switch input:checked + i { background: var(--ink); }
.cu-switch input:checked + i::after { transform: translateX(16px); }
.cu-switch input:focus-visible + i { outline: var(--ring); }

/* fields */
.cu-field { display: grid; gap: 8px; min-width: 0; font: 500 13px/1 var(--sans); color: var(--ink); }
.cu-field > span { display: flex; justify-content: space-between; }
.cu-field > span b { color: var(--muted); font-weight: 500; }
.cu-field select { width: 100%; padding: 11px 38px 11px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230e0807' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center; color: var(--ink); font: 500 14px/1.2 var(--sans); appearance: none; -webkit-appearance: none; cursor: pointer; }
.cu-field select:focus-visible { border-color: var(--ink); }
.cu-field input[type="range"] { width: 100%; accent-color: var(--ink); }
.cu-field input[type="color"] { width: 100%; height: 42px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.cu-field input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.cu-field input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 8px; }
.cu-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cu-two > * { min-width: 0; }

/* the lines */
.cu-lines { display: grid; gap: 10px; }
.cu-line { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; border: 1px solid transparent; background: var(--paper-2); transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease); }
.cu-line.is-now { border-color: var(--yellow); }
.cu-line:focus-within { background: #fff; border-color: rgba(14, 8, 7, 0.28); }
.cu-line-times { display: flex; align-items: center; gap: 4px; font: 500 11.5px/1 var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; }
.cu-time { width: 58px; padding: 3px 5px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); font: 500 11.5px/1.2 var(--sans); font-variant-numeric: tabular-nums; text-align: center; }
.cu-time:hover { border-color: rgba(14, 8, 7, 0.18); }
.cu-time:focus { outline: none; border-color: var(--ink); color: var(--ink); background: #fff; }
.cu-line-tools { margin-left: auto; display: flex; gap: 2px; opacity: 0; transition: opacity var(--t-fast) var(--ease); }
.cu-line:hover .cu-line-tools, .cu-line:focus-within .cu-line-tools { opacity: 1; }
.cu-line-tools button { width: 26px; height: 22px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font: 500 12px/1 var(--sans); }
.cu-line-tools button:hover { background: rgba(14, 8, 7, 0.08); color: var(--ink); }
.cu-line-text { font: 500 15px/1.5 var(--sans); color: var(--ink); outline: none; white-space: pre-wrap; word-break: break-word; min-height: 22px; }
.cu-line-text:empty::before { content: 'Type the caption…'; color: var(--muted-2); }
.cu-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 4px; }
.cu-btn { display: inline-flex; align-items: center; padding: 8px 12px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--muted); font: 600 13px/1 var(--sans); cursor: pointer; }
.cu-btn:hover { color: var(--ink); background: var(--paper-2); }
.cu-shift { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; font: 500 12.5px/1 var(--sans); color: var(--muted); }

/* the text box on the picture */
.cu-inline { position: absolute; z-index: 3; display: grid; gap: 4px; min-width: 240px; max-width: 80%; padding: 10px 12px 8px; background: #fff; border: 1.5px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-float); }
.cu-inline-text { font: 600 16px/1.4 var(--sans); color: var(--ink); outline: none; white-space: pre-wrap; word-break: break-word; min-height: 24px; }
.cu-inline small { font: 400 11.5px/1.2 var(--sans); color: var(--muted); }
