/* Tool layout only: sizes and spacing for the parts no kit piece covers. Colors come from --ff- variables. */
.tl-main { padding: 16px 0 40px; }
/* full width: the kit container stops at 1100 px, which left big empty sides */
.tl-main.ff-container { width: calc(100% - 32px); max-width: 2400px; }
/* Preview tab: the 16:9 screen plus its bar and footer fit inside the window, centered with room on the sides.
   --tl-chrome = the height of everything on the page that isn't the screen (app.js measures it). */
#v-discover { width: min(100%, calc((100vh - var(--tl-chrome, 220px)) * 16 / 9)); min-width: min(100%, 320px); margin-inline: auto; }
.tl-bar { flex-wrap: wrap; gap: .5rem 1.25rem; }
.tl-wrap { flex-wrap: wrap; }
.tl-count { margin-left: .4rem; }
.tl-two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); align-items: start; }
.tl-mini { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .75rem; }

/* Media: drop fields in the files' real shapes */
.tl-media { display: flex; flex-direction: column; gap: 1rem; }
.tl-media-row { display: grid; gap: .75rem; align-items: start; }
.tl-slot { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.tl-slot-head { display: flex; align-items: center; gap: .4rem; min-height: 1.9rem; }
.tl-slot-head b { font-size: .875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-slot-head .ff-badge { font-size: .65rem; }
.tl-drop { aspect-ratio: var(--ar); min-height: 0; padding: 0; gap: 0; position: relative; overflow: hidden; cursor: pointer; }
.tl-drop.has-file { border-style: solid; }
.tl-drop-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; text-align: center; padding: .4rem; }
.tl-drop-empty[hidden] { display: none; }
.tl-drop-empty .ff-icon { font-size: 1.1rem; opacity: .8; }
.tl-slot-pic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.tl-drop.is-alpha .tl-slot-pic, .tl-drop.is-alpha.has-file { object-fit: contain;
  background-color: var(--ff-field);
  background-image: linear-gradient(45deg, var(--ff-raised) 25%, transparent 25%, transparent 75%, var(--ff-raised) 75%),
                    linear-gradient(45deg, var(--ff-raised) 25%, transparent 25%, transparent 75%, var(--ff-raised) 75%);
  background-size: 14px 14px; background-position: 0 0, 7px 7px; }
.tl-shots { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 2px; }
.tl-shots[hidden] { display: none; }
.tl-shots[data-n="1"] { grid-template-columns: 1fr; }
.tl-shots span { position: relative; overflow: hidden; }
.tl-shots img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tl-shots b { position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--ff-panel) 60%, transparent); font-size: 1.1rem; }
.tl-checks { display: flex; flex-wrap: wrap; gap: .15rem .7rem; font-size: .75rem; min-height: 1rem; color: var(--ff-text-3); }
.tl-checks span { display: inline-flex; gap: .25rem; align-items: center; color: var(--ff-text-2); }
.tl-checks .ok { color: var(--ff-success); }
.tl-checks .warn { color: var(--ff-warning); }
.tl-checks .bad { color: var(--ff-danger); }
.tl-artonly { color: var(--ff-text-2); }
.tl-spec-size { font-family: var(--ff-mono); font-size: .8rem; color: var(--ff-text-2); }
/* one long strip: all six at the same height. Narrow screens: it scrolls sideways at a fixed height instead */
.tl-media-card { padding: 1rem; }
@media (max-width: 1000px) {
  .tl-media-card { overflow-x: auto; }
  .tl-media-row { width: calc(var(--sum) * 150px + 5 * .75rem); }
}
.tl-details { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); align-items: start; }
.tl-pair { grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: .75rem; align-items: end; }
.tl-toggle-cell { min-height: var(--ff-input-height, 2.5rem); }
.tl-chips { gap: .6rem 1.25rem; }
.tl-foot { gap: .5rem 1rem; margin-top: -.25rem; }
.tl-two > .ff-card { align-self: start; }
.tl-quad { grid-template-columns: minmax(9.5rem, 1.5fr) repeat(3, minmax(5.5rem, 1fr)); gap: .75rem; }
@media (max-width: 640px) { .tl-quad { grid-template-columns: 1fr 1fr; } }
.tl-req { color: var(--ff-warning); font-weight: 700; }
.tl-media .tl-checks span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tl-media .tl-drop-empty .ff-small { display: none; }
.tl-slot { position: relative; }
.tl-remove { position: absolute; right: .3rem; top: calc(1.9rem + .4rem + .3rem); --ff-btn-height: 1.75rem; z-index: 1; opacity: 0; transition: opacity .15s; }
.tl-slot:hover .tl-remove, .tl-remove:focus-visible { opacity: 1; }
@media (hover: none) { .tl-remove { opacity: 1; } }
.tl-details .tl-quad { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.tl-preview-only { gap: .9rem; }
.tl-preview-only[hidden] { display: none; }
@media (max-width: 900px) { .tl-preview-only .tl-lbl, .tl-mock { display: none; } .tl-preview-only { gap: .5rem; } }
