/* Yarrow Studio - the BTS page. Colours, corners and type all come from the
   variables and classes in studio.html; this file only adds what BTS needs. */

#pageBts[hidden], #app[hidden] { display: none; }

/* ---- the page head: title, By image / Library, Upload ---- */
.bts-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.bts-head-left { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.bts-head h2 { font-size: 22px; font-weight: 700; line-height: 1.2; letter-spacing: -.03em; }
.bts-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px; padding: 4px 0; border: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 550; }
.bts-back:hover { color: var(--text); }
.bts-back svg, .bts-ic { width: 14px; height: 14px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bts-toolbar { display: flex; align-items: stretch; flex-wrap: wrap; gap: 10px; padding: 20px 24px 16px; }
.bts-toolbar .search-box { max-width: none; }
.bts-collection { min-height: 38px; padding: 0 34px 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); font-size: 12.5px; }
.bts-toolbar .search-box input { flex: 1; min-width: 0; min-height: 38px; border: 0; outline: 0; background: none; color: var(--text); font-size: 12.5px; }

/* ---- thumbnails; a B&W + Colour pair is one picture split on the diagonal ---- */
.bts-thumb { position: relative; display: block; flex: 0 0 auto; width: 78px; height: 50px; border-radius: 9px; overflow: hidden; background: var(--panel-2); color: var(--faint); }
.bts-thumb.lg { width: 136px; height: 86px; border-radius: 14px; }
.bts-thumb.sm { width: 60px; height: 38px; border-radius: 8px; }
.bts-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.bts-thumb img.alt { clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.bts-thumb.pair::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom right, transparent calc(50% - .8px), #fff calc(50% - .8px), #fff calc(50% + .8px), transparent calc(50% + .8px)); }
.bts-thumb > svg { position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; stroke: currentColor; fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---- the list, by image ---- */
table.bts-list { width: 100%; border-collapse: collapse; font-size: 12.5px; text-align: left; }
table.bts-list th { padding: 12px; background: var(--tint); color: var(--ink); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); font-size: 11px; font-weight: 600; white-space: nowrap; }
table.bts-list td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.bts-list th:first-child, table.bts-list td:first-child { padding-left: 24px; }
table.bts-list th:last-child, table.bts-list td:last-child { padding-right: 24px; width: 28px; color: var(--faint); }
table.bts-list tbody tr { cursor: pointer; }
table.bts-list tbody tr:hover td { background: var(--tint); }
table.bts-list tbody tr:last-child td { border-bottom: 0; }
.bts-cell { display: flex; align-items: center; gap: 14px; min-width: 0; }
.bts-cell b { display: block; font-size: 13px; font-weight: 600; letter-spacing: -.01em; color: var(--text); }
.bts-cell small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.bts-kinds { display: flex; flex-wrap: wrap; gap: 7px; }
.bts-kind { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 8px; border-radius: 10px; background: var(--panel-2); color: var(--ink); font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.bts-none { display: inline-flex; padding: 4px 10px; border: 1.5px dashed var(--bad); border-radius: 10px; background: var(--bad-bg); color: var(--bad); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.bts-sugg { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.bts-empty { padding: 44px 24px 52px; text-align: center; color: var(--muted); font-size: 12.5px; }

/* ---- tags ---- */
.bts-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink); font-size: 11px; white-space: nowrap; }
.bts-tag.dark { border-color: var(--accent); background: var(--accent); color: var(--on-accent); font-weight: 600; }
.bts-tag .bts-ic { width: 12px; height: 12px; }

/* ---- one image ---- */
.bts-work { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.bts-work-left { display: flex; align-items: center; gap: 18px; min-width: 0; }
.bts-work h2 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.bts-work .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.bts-work-note { color: var(--muted); font-size: 12px; }
.bts-card { margin-bottom: 20px; padding: 22px 24px 20px; border: 1px solid var(--line); border-radius: 22px; background: var(--panel); }
.bts-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.bts-card-head h3, .bts-sub { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.bts-card-head h3 small { margin-left: 10px; color: var(--muted); font-size: 12px; font-weight: 400; letter-spacing: 0; }
.bts-cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; margin-bottom: 24px; }
.bts-label { color: var(--text); font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }

/* upload tiles: every tile is the same height, as wide as its picture */
.bts-tiles { display: flex; flex-wrap: wrap; gap: 16px 14px; }
.bts-tile { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 0; border: 0; background: none; color: var(--text); text-align: left; }
.bts-tile-pic { position: relative; display: block; height: 150px; border-radius: 14px; overflow: hidden; background: var(--panel-2); }
.bts-tile-pic img { display: block; height: 100%; width: 100%; object-fit: cover; }
.bts-tile b { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bts-tile small { color: var(--muted); font-size: 11px; }
.bts-tile small.unused { color: var(--bad); }
.bts-tile.on .bts-tile-pic { outline: 3px solid var(--accent); outline-offset: -3px; }
.bts-tile.off { opacity: .4; cursor: default; }
.bts-tick { position: absolute; left: 9px; top: 9px; width: 22px; height: 22px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; border-radius: 50%; background: rgba(0,0,0,.35); color: #fff; font-size: 11px; font-weight: 700; }
.bts-tile.on .bts-tick { border-color: #161614; background: #161614; }
.bts-clipmark { position: absolute; left: 9px; bottom: 9px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; background: rgba(0,0,0,.72); color: #fff; font-size: 10.5px; font-weight: 600; }
.bts-clipmark svg { width: 10px; height: 10px; fill: currentColor; stroke: none; }
.bts-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 16px; padding: 11px 12px 11px 18px; border-radius: 16px; background: var(--panel-2); font-size: 12.5px; font-weight: 600; }
.bts-actions > div { display: flex; flex-wrap: wrap; gap: 8px; }
.bts-actions .hint { color: var(--muted); font-weight: 400; }

/* the displays on an image, in page order */
.bts-display { display: flex; gap: 12px; margin-bottom: 14px; padding: 18px 20px 18px 10px; border: 1px solid var(--line); border-radius: 22px; background: var(--panel); }
.bts-display.dragging { opacity: .45; }
.bts-display.over { border-color: var(--accent); }
.bts-grip { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 2px; color: var(--faint); }
.bts-grip .handle { display: flex; padding: 4px; cursor: grab; }
.bts-grip .handle svg { width: 16px; height: 16px; fill: currentColor; }
.bts-grip b { color: var(--muted); font-size: 11px; font-weight: 700; }
.bts-grip button { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: none; color: var(--muted); }
.bts-grip button:hover:not(:disabled) { background: var(--panel-2); color: var(--text); }
.bts-grip button:disabled { opacity: .3; }
.bts-display-body { flex: 1; min-width: 0; }
.bts-display-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.bts-display-name { display: flex; align-items: center; gap: 12px; }
.bts-display-name .ico { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 11px; background: var(--panel-2); }
.bts-display-name .ico svg { width: 17px; height: 17px; }
.bts-display-name b { display: block; font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.bts-display-name small { display: block; margin-top: 3px; color: var(--muted); font-size: 11.5px; }
.bts-display-btns { display: flex; gap: 8px; }
.bts-pill-btn { padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink); font-size: 12px; font-weight: 500; }
.bts-pill-btn:hover { border-color: var(--faint); background: var(--panel-2); }
.bts-pill-btn.danger { color: var(--bad); }
.bts-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.bts-strip img { display: block; height: 118px; width: auto; max-width: 100%; border-radius: 9px; background: var(--panel-2); }
.bts-strip.frames img { height: 84px; }
.bts-add { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; border: 1.5px dashed var(--faint); border-radius: 22px; background: none; color: var(--text); font-size: 13px; font-weight: 600; }
.bts-add:hover { background: var(--tint); }
.bts-blank { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 30px 24px; border: 1.5px dashed var(--faint); border-radius: 22px; color: var(--muted); font-size: 13px; text-align: center; }
.bts-blank > div { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.bts-kind-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text); font-size: 12.5px; font-weight: 500; }
.bts-kind-btn:hover { border-color: var(--faint); background: var(--panel-2); }
.bts-kind-btn svg { width: 15px; height: 15px; }
.bts-side { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; font-size: 12.5px; }
.bts-side div { padding: 9px 12px; border-radius: 11px; background: var(--bg); color: var(--muted); }
.bts-side div.on { display: flex; gap: 8px; background: var(--accent); color: var(--on-accent); font-weight: 600; }

/* ---- the library ---- */
.bts-lib { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 26px; align-items: start; }
.bts-filter { display: flex; flex-direction: column; gap: 22px; padding: 20px 12px; border: 1px solid var(--line); border-radius: 22px; background: var(--panel); }
.bts-filter .bts-label { padding: 0 10px 8px; }
.bts-filter button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border: 0; border-radius: 11px; background: none; color: var(--text); font-size: 12.5px; text-align: left; }
.bts-filter button:hover { background: var(--panel-2); }
.bts-filter button.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.bts-filter button i { font-style: normal; color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.bts-filter button.on i { color: inherit; opacity: .8; }
.bts-filter button.year { font-weight: 600; }
.bts-filter button.year span { display: inline-flex; align-items: center; gap: 7px; }
.bts-filter button.year svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.bts-filter button.year.shut svg { transform: rotate(-90deg); }
.bts-filter .shoots { margin: 0 0 4px 15px; padding-left: 6px; border-left: 1px solid var(--line); }
.bts-filter .shoots button { padding: 8px 10px; }
.bts-group { padding-bottom: 26px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.bts-group:last-child { border-bottom: 0; margin-bottom: 0; }
.bts-group-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.bts-group-head > div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bts-group-head span.n { color: var(--muted); font-size: 12px; }

/* ---- pop-ups ---- */
#btsOverlay .modal { width: min(940px, 100%); }
.bts-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 28px 0; }
.bts-modal-head > div { display: flex; align-items: center; gap: 14px; min-width: 0; }
.bts-modal-head h2 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.bts-modal-head p { margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.bts-modal-body { display: flex; flex-direction: column; gap: 26px; padding: 24px 28px; }
.bts-modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 20px 28px 24px; border-top: 1px solid var(--line-2); color: var(--ink); font-size: 12.5px; line-height: 1.5; }
.bts-modal-foot > div { display: flex; gap: 10px; }
.bts-modal-foot .err { color: var(--bad); }
.bts-step-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.bts-step-head span { color: var(--muted); font-size: 12px; }
.bts-kindgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.bts-kindcard { display: flex; flex-direction: column; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); color: var(--text); text-align: left; }
.bts-kindcard:hover { border-color: var(--faint); }
.bts-kindcard.on { padding: 15px; border: 2px solid var(--accent); }
.bts-kindcard .art { height: 86px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 11px; background: var(--panel-2); overflow: hidden; color: var(--muted); }
.bts-kindcard .art i { display: block; background: var(--text); border-radius: 5px; }
.bts-kindcard .art svg { width: 18px; height: 18px; }
.bts-kindcard b { display: block; font-size: 14px; font-weight: 700; }
.bts-kindcard small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.bts-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.bts-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.bts-field input, .bts-field select, .bts-field textarea { width: 100%; min-height: 44px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); color: var(--text); font-size: 13px; }
.bts-field textarea { resize: vertical; line-height: 1.5; font-family: inherit; }
.bts-field input:focus, .bts-field select:focus, .bts-field textarea:focus { outline: 0; border-color: var(--muted); }
/* a Quote display on the image's list: the words where the stills would be */
.bts-quote { margin-top: 12px; padding: 14px 16px; border-radius: 11px; background: var(--panel-2); font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 14px; line-height: 1.55; color: var(--text); }
/* find the shoot by an image: a search under the Shoot field, hits with the picture and its shoot */
.bts-findshoot { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 8px; }
.bts-findshoot .search-box { max-width: none; }
.bts-findshoot .search-box input { flex: 1; min-width: 0; min-height: 38px; border: 0; outline: 0; background: none; color: var(--text); font-size: 12.5px; }
.bts-findshoot-hit { display: flex; align-items: center; gap: 12px; width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); text-align: left; cursor: pointer; }
.bts-findshoot-hit + .bts-findshoot-hit { margin-top: 6px; }
.bts-findshoot-hit:hover { border-color: var(--faint); background: var(--panel-2); }
.bts-findshoot-hit span { display: flex; flex-direction: column; min-width: 0; }
.bts-findshoot-hit b { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bts-findshoot-hit small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bts-findshoot-none { padding: 4px 2px; color: var(--muted); font-size: 12px; }
.bts-newshoot { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 110px; gap: 12px; }
.bts-hint { grid-column: 1 / -1; padding: 11px 14px; border-radius: 14px; background: var(--panel-2); color: var(--ink); font-size: 12.5px; line-height: 1.5; }
.bts-files { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); overflow: hidden; }
.bts-file { display: grid; grid-template-columns: 60px minmax(0, 1.2fr) minmax(0, 1fr) auto 28px; gap: 14px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line-2); font-size: 12.5px; }
.bts-file:first-child { border-top: 0; }
.bts-file input { width: 100%; min-height: 36px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); font-size: 12.5px; font-weight: 600; }
.bts-file .src { display: block; margin-top: 4px; color: var(--muted); font-family: var(--mono); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bts-file .what { color: var(--ink); }
.bts-file .what.bad { color: var(--bad); }
.bts-state { padding: 4px 10px; border-radius: 999px; background: var(--panel-2); color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
.bts-state.ready, .bts-state.done { background: var(--good-bg); color: var(--good); }
.bts-state.error { background: var(--bad-bg); color: var(--bad); }
.bts-x { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: none; color: var(--muted); }
.bts-x:hover { background: var(--panel-2); color: var(--text); }
.bts-drop { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 20px 24px; border: 1.5px dashed var(--faint); border-radius: 20px; background: var(--tint); }
.bts-drop.over { border-color: var(--accent); background: var(--panel-2); }
.bts-drop b { display: block; font-size: 14px; font-weight: 600; }
.bts-drop small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }

@media (max-width: 1100px) {
  .bts-cols, .bts-lib { grid-template-columns: minmax(0, 1fr); }
  .bts-kindgrid, .bts-fields { grid-template-columns: minmax(0, 1fr); }
  .bts-newshoot { grid-template-columns: minmax(0, 1fr); }
  .bts-file { grid-template-columns: 60px minmax(0, 1fr) 28px; }
  .bts-file .what, .bts-file .bts-state { grid-column: 2; }
}
