/* Presets studio, the Models page (docs/studio/REMAKE.md sections 2, 5 and 6.5): what models.js and voice.js put inside
   the frame of studio.css (a day's tiles, the Add media window, the photo window, the voice list, the recorder), and the
   picker window and the media block of a line (picker.js) that the preset editor uses. Tokens only: the tints used here
   (--surface2, --accent-dim) carry their light-theme values, so no white-alpha needs a light twin. The one theme rule
   is the native players, which follow color-scheme. Sizes follow REMAKE 6.6. */

/* ── a day: its tiles, by type ── */
.st-md-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(148px,1fr));gap:16px 12px}
.st-md-tile{display:flex;flex-direction:column;min-width:0;padding:0;border:0;background:none;color:var(--text);
  font:inherit;text-align:left;cursor:pointer}
.st-md-thumb{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:1;overflow:hidden;
  border:1px solid var(--border);border-radius:8px;background:var(--bg);color:var(--muted2)}
.st-md-thumb img,.st-md-thumb video{display:block;width:100%;height:100%;object-fit:cover}
.st-md-thumb .st-ico{width:28px;height:28px}
.st-md-tile:hover .st-md-thumb{border-color:var(--border-hover)}
.st-md-tile:focus-visible{outline:none}
.st-md-tile:focus-visible .st-md-thumb{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}   /* a 2px ring */
.st-md-cap{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin-top:8px;
  font-size:12.5px;line-height:1.4;color:var(--text);overflow-wrap:anywhere}
.st-md-facts{margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:1.4;
  color:var(--muted2)}
/* nothing here yet, inside a part: the dashed box keeps the part's own inset */
.st-md-empty{padding:24px}
/* a sentence that holds her name: a name without a space breaks where the window ends instead of running out of it */
.st-md-wrap{overflow-wrap:anywhere}
.st-md-gap{margin-top:14px}
.st-md-gap[hidden]{display:none}

/* files dragged over the page: one dashed area over it that says what a drop does (it lets the drag through) */
.st-md-drop{position:fixed;z-index:90;display:flex;align-items:center;justify-content:center;padding:24px;
  border:2px dashed var(--accent);border-radius:14px;background:var(--accent-dim);pointer-events:none}
.st-md-drop span{max-width:460px;padding:12px 18px;border:1px solid var(--border);border-radius:10px;background:var(--surface);
  font-size:15px;font-weight:600;line-height:1.4;text-align:center;color:var(--text);overflow-wrap:anywhere}

/* ── the Add media window: column heads and "Set all" stay on top, then one row per file, in the same columns ──
   Every cell names its column (.st-up-type, .st-up-day…), so a row, the heads and "Set all" line up whatever a row
   holds; a voice note's player takes the three middle columns and its words the description's. */
.st-up{--st-up-cols:48px minmax(0,1.3fr) minmax(0,1fr) minmax(0,.85fr) minmax(0,.85fr) minmax(0,1.5fr) 28px;
  display:flex;flex-direction:column;min-width:0}
/* top:-3px covers the window body's 3px inset, so no row shows above the heads while the list scrolls */
.st-up-top{position:sticky;top:-3px;z-index:2;padding:3px 0 4px;background:var(--surface)}
.st-up-top[hidden]{display:none}
.st-up-head,.st-up-all,.st-up-row{display:grid;grid-template-columns:var(--st-up-cols);column-gap:12px;align-items:center}
.st-up-head{padding:0 13px 8px;font-size:12.5px;font-weight:600;color:var(--muted2)}
.st-up-head .st-up-c-file{grid-column:2}
.st-up-all{padding:9px 12px;border:1px solid var(--border);border-radius:10px;background:var(--surface2)}
.st-up-one .st-up-all{display:none}
.st-up-all-k{grid-column:1 / 3;font-size:13px;font-weight:600;color:var(--text)}
.st-up-type{grid-column:3}
.st-up-day{grid-column:4}
.st-up-light{grid-column:5}
.st-up-desc{grid-column:6}
.st-up-row{row-gap:6px;padding:10px 13px;border-bottom:1px solid var(--border)}
.st-up-row:last-child{border-bottom:0}
.st-up-row.busy{opacity:.6}
.st-up-prev{grid-column:1;grid-row:1;display:flex;align-items:center;justify-content:center;width:48px;height:48px;overflow:hidden;
  border:1px solid var(--border);border-radius:6px;background:var(--bg);color:var(--muted2)}
.st-up-prev.bad{color:var(--red)}
.st-up-prev img,.st-up-prev video{display:block;width:100%;height:100%;object-fit:cover}
/* a photo or video of a row opens large on a click (button reset; the frame's hover and focus ring) */
.st-up-zoom{padding:0;font:inherit;cursor:zoom-in}
.st-up-zoom:hover{border-color:var(--border-hover)}
.st-up-zoom:focus-visible{outline:none;border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}
.st-up-big img,.st-up-big video{max-height:70vh}
.st-up-prev .st-ico{width:20px;height:20px}
.st-up-c-file{grid-column:2;display:flex;flex-direction:column;min-width:0;font-size:13px;line-height:1.35}
.st-up-file{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600;color:var(--text)}
.st-up-size{font-size:12px;color:var(--muted2)}
.st-up-x{grid-column:7;grid-row:1}
.st-up-player{grid-column:3 / 6;display:block;width:100%;height:36px}
.st-up-why{grid-column:3 / 7;min-width:0}
.st-up-why .st-err{margin-top:0}
.st-up-msg{grid-column:2 / 7;display:flex;flex-direction:column;gap:4px;min-width:0}
.st-up-msg .st-err{margin-top:0}
.st-up-msg:not(:has(> :not([hidden]):not(:empty))){display:none}
.st-up-keep[hidden],.st-up-msg .st-err[hidden]{display:none}
.st-up-msg .chat-toggle{margin:0;font-size:13px}
.st-up-status{font-size:12.5px;color:var(--muted)}
.st-up-status:empty{display:none}
/* the footer's reason: plain words, a click goes to the row it means */
.st-up-say{min-width:0;margin-right:4px;padding:0;border:0;background:none;color:var(--muted);font:400 13px/1.4 var(--font-ui);
  text-align:right;cursor:pointer}
.st-up-say:hover:not(:disabled){color:var(--text);text-decoration:underline}
.st-up-say:disabled{opacity:1;cursor:default}
.st-up-say:empty{display:none}

/* ── the photo window ── */
.st-photo{display:grid;grid-template-columns:minmax(0,240px) minmax(0,1fr);gap:20px;align-items:start}
.st-photo-prev{display:flex;align-items:center;justify-content:center;min-height:160px;overflow:hidden;border:1px solid var(--border);
  border-radius:10px;background:var(--bg)}
.st-photo-prev img,.st-photo-prev video{display:block;width:100%;max-height:420px;object-fit:contain}
.st-photo-prev audio{width:100%;margin:0 12px}
.st-photo-fields{min-width:0}
.st-photo-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:14px}
.st-photo-grid label{margin-top:0}
.st-photo-grid + .st-help{margin-top:6px}
.st-photo-name{margin-top:14px;font-family:var(--font-mono);font-size:12px;color:var(--muted2);overflow-wrap:anywhere}

/* native players follow the theme */
.st-vn-player,.st-rec audio,.st-photo-prev video,.st-up-player,.st-up-prev video{color-scheme:dark}
html[data-theme="light"] .st-vn-player,html[data-theme="light"] .st-rec audio,html[data-theme="light"] .st-photo-prev video,
html[data-theme="light"] .st-up-player,html[data-theme="light"] .st-up-prev video{color-scheme:light}
.st-vn-player{display:block;width:100%}

/* ── voice notes: one row per note (play, words, tag, length, ✕; "Used in" on its own line under the words) ── */
.st-vn-list{display:flex;flex-direction:column;min-width:0}
.st-vn{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;min-width:0;padding:11px 0;border-bottom:1px solid var(--border)}
.st-vn:first-child{padding-top:0}
.st-vn:last-child{padding-bottom:0;border-bottom:0}
.st-vn-words{flex:1 1 0;min-width:80px;font-size:14px;line-height:1.45;color:var(--text);overflow-wrap:anywhere}
.st-vn-words i{color:var(--muted2)}
.st-vn-edit{margin:-2px -6px;padding:2px 6px;border-radius:6px;cursor:text}
.st-vn-edit:hover{background:var(--surface2)}
.st-vn-edit:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
.st-vn-edit.st-vn-editing,.st-vn-edit.st-vn-editing:hover{margin:0;padding:0;background:none;cursor:auto}
.st-vn-input{padding:6px 10px}
.st-vn-dur{flex-shrink:0;min-width:34px;text-align:right;font-size:12.5px;color:var(--muted2);font-variant-numeric:tabular-nums}
.st-vn-used{display:flex;flex-wrap:wrap;align-items:center;gap:6px;min-width:0;order:10;flex-basis:100%;padding-left:40px}
.st-vn-used:empty{display:none}
.st-vn-used-lbl{font-size:12.5px;color:var(--muted2)}
.st-vn-used .chip-link{max-width:100%;font-family:var(--font-ui);line-height:inherit;text-align:left;overflow-wrap:anywhere}
.st-vn-play{border-radius:50%;font-size:11px}
.st-vn-play.st-vn-playing{color:var(--accent);border-color:var(--accent)}
.st-vn .st-icon-btn .st-ico{width:14px;height:14px}

/* the recorder */
.st-rec{display:flex;flex-direction:column;gap:12px}
.st-rec audio{width:100%;max-width:420px}
.st-rec label{margin-top:0}
.st-rec-row{display:flex;align-items:center;flex-wrap:wrap;gap:10px}
.st-rec-row .st-help{margin-top:0}
.st-rec-dot{width:9px;height:9px;border-radius:50%;background:var(--red);animation:st-rec-blink 1.2s ease-in-out infinite}
@keyframes st-rec-blink{50%{opacity:.35}}
@media (prefers-reduced-motion:reduce){.st-rec-dot{animation:none}}
.st-rec-time{font-size:20px;font-weight:600;font-variant-numeric:tabular-nums}
.st-rec-btns{display:flex;flex-wrap:wrap;gap:8px}

/* ── the picker window (Studio.picker.open) ── */
.st-pick-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px}
.st-pick-model{display:inline-flex;align-items:center;gap:8px;font:500 13px var(--font-ui);letter-spacing:0;color:var(--muted)}
.st-pick-model select{width:auto;min-width:160px;max-width:240px;padding:7px 10px;font-size:13.5px}
.st-pick{min-height:200px}
.st-pick-tabs{margin-bottom:16px}
.st-pick-tabs .pool-tab{padding:8px 10px}                       /* seven tabs fit one row of the window */
.st-pick-empty,.st-pick-none{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-height:200px;
  text-align:center;font-size:13.5px;color:var(--muted)}
.st-pick-empty-title{font-size:15px;font-weight:600;color:var(--text)}
.st-pick-none{min-height:120px;font-size:13px}
.st-pick-count{font-size:13px;color:var(--muted);white-space:nowrap}
.st-pick-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:8px}
.st-pick-tile{position:relative;display:block;width:100%;padding:0;aspect-ratio:1;overflow:hidden;border:1px solid var(--border);
  border-radius:8px;background:var(--bg);color:var(--text);font:inherit;cursor:pointer}
.st-pick-tile img,.st-pick-tile video{display:block;width:100%;height:100%;object-fit:cover;pointer-events:none}
.st-pick-tile:hover{border-color:var(--border-hover)}
.st-pick-tile.st-pick-on{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}
.st-pick-tile:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.st-pick-check{position:absolute;top:6px;right:6px;display:flex;align-items:center;justify-content:center;width:22px;height:22px;
  border:1px solid var(--border-hover);border-radius:50%;background:var(--surface);color:transparent;font-size:12px;font-weight:700;
  line-height:1}
/* the tick: the line of the frame's small marks (studio.css), 1.75 on the 24 grid at 18px, whatever its own size */
.st-pick-check .st-ico,.st-pick-box .st-ico{width:13px;height:13px;vector-effect:non-scaling-stroke;stroke-width:calc(1.75px * 18 / 24)}
.st-pick-on .st-pick-check{background:var(--accent);border-color:var(--accent);color:var(--bg)}
.st-pick-day{position:absolute;left:6px;bottom:6px;padding:1px 6px;border-radius:5px;background:var(--surface);color:var(--muted);
  font-size:11px}
.st-pick-aud{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:10px;overflow:hidden;
  text-align:center;font-size:12px;color:var(--muted)}
.st-pick-list{display:flex;flex-direction:column;gap:2px}
.st-pick-vn{padding:9px 10px;border:1px solid transparent;border-radius:8px;cursor:pointer}
.st-pick-vn:hover{background:var(--surface2)}
.st-pick-vn.st-pick-on{background:var(--accent-dim);border-color:var(--accent-dim)}
.st-pick-vn:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
.st-pick-box{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:20px;height:20px;border:1.5px solid var(--border-hover);
  border-radius:5px;color:transparent;font-size:12px;font-weight:700;line-height:1}
.st-pick-on .st-pick-box{background:var(--accent);border-color:var(--accent);color:var(--bg)}

/* ── the media block of a line (Studio.mediaBlock) ── */
.st-media{display:flex;flex-direction:column;align-items:flex-start;gap:8px;min-width:0;max-width:100%}
.st-media .seg-group{flex-wrap:wrap;max-width:100%}
.st-media .st-help{margin-top:0}
.st-media-notes{display:flex;flex-direction:column;gap:2px;max-width:100%;overflow-wrap:anywhere}   /* "… belong to <her name>" */
.st-media-files{display:flex;flex-wrap:wrap;align-items:center;gap:6px;max-width:100%}
.st-file-chip{display:inline-flex;align-items:center;gap:6px;min-width:0;max-width:100%;height:28px;padding:0 4px 0 3px;
  border:1px solid var(--border);border-radius:999px;background:var(--surface2);font-size:12.5px;color:var(--text)}
.st-file-chip img{flex-shrink:0;width:22px;height:22px;border-radius:50%;object-fit:cover;background:var(--bg)}
.st-file-chip .st-vn-play{width:22px;height:22px;font-size:9px}
.st-file-txt{min-width:0;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.st-file-chip > .st-file-txt:first-child{padding-left:6px}
.st-file-x{flex-shrink:0;width:20px;height:20px;padding:0;border:0;border-radius:50%;background:none;color:var(--muted2);
  font:inherit;font-size:11px;line-height:1;cursor:pointer}
.st-file-x:hover{color:var(--red)}
.st-file-x:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
.st-file-chip.st-file-missing{border-style:dashed;background:transparent;color:var(--muted2)}

/* ── a phone: tiles a little smaller, a file's row stacks its fields, the windows take one column ── */
@media(max-width:768px){
  .st-md-grid{grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:14px 10px}
  .st-md-empty{padding:16px}
  /* a file's row: preview, name and ✕ on top, then type, day and lighting, then the description */
  .st-up{--st-up-cols:44px minmax(0,1fr) minmax(0,1fr) 28px}
  .st-up-top{position:static}                                    /* a phone has no height to spare for a pinned head */
  .st-up-head{display:none}
  .st-up-all{grid-template-columns:minmax(0,1fr) minmax(0,1fr);row-gap:8px}
  .st-up-all-k{grid-column:1 / -1}
  .st-up-all .st-up-type{grid-column:1 / -1}
  .st-up-all .st-up-day{grid-column:1}
  .st-up-all .st-up-light{grid-column:2}
  .st-up-row{row-gap:8px;padding:12px 2px;column-gap:10px}
  .st-up-prev{width:44px;height:44px}
  .st-up-c-file{grid-column:2 / 4}
  .st-up-x{grid-column:4}
  .st-up-row .st-up-type,.st-up-row .st-up-desc,.st-up-player,.st-up-why,.st-up-msg{grid-column:1 / -1}
  .st-up-row .st-up-day{grid-column:1 / 3}
  .st-up-row .st-up-light{grid-column:3 / -1}
  .st-modal-foot .st-up-say{flex-basis:100%;order:-1;text-align:left}   /* what is still missing gets its own line */
  .st-up-modal .st-modal-foot .btn{padding-left:12px;padding-right:12px}  /* the three buttons share one row */
  .st-photo{grid-template-columns:1fr}
  .st-photo-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .st-photo-grid > :first-child{grid-column:1 / -1}
  .st-photo-prev{min-height:120px}
  .st-photo-prev img,.st-photo-prev video{max-height:180px}
  .st-pick-grid{grid-template-columns:repeat(auto-fill,minmax(96px,1fr))}
  .st-modal-foot .st-pick-count{flex-basis:100%}                 /* its own line above the three buttons */
  .st-file-txt{max-width:160px}
}

/* a phone: the picker's seven tabs stay one row that scrolls sideways (as the tabs of the preset editor, editor.css),
   not three rows with the open tab's line in the middle; the inset line keeps that line on the hairline (picker.js
   brings the open tab into view, the row is drawn again on every click) */
@media(max-width:520px){
  .pool-tabs.st-pick-tabs{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;border-bottom:0;
    box-shadow:inset 0 -1px 0 var(--border)}
  .pool-tabs.st-pick-tabs::-webkit-scrollbar{display:none}
  .st-pick-tabs .pool-tab{flex:none;margin-bottom:0;white-space:nowrap}
}
