/* DroneTrust 3D asset kit gallery: white, big, quiet. One type scale, one accent. */
:root {
  --bg: #f5f5f7; --card: #ffffff; --ink: #1d1d1f; --dim: #6e6e73; --faint: #a1a1a6; --line: #e8e8ed;
  --acc: #0a66ff; --acc-soft: #eaf2ff;
  --ok: #17794a; --ok-bg: #e7f6ee; --bad: #c5221f; --bad-bg: #fdeceb; --warn: #8a5a00; --warn-bg: #fff3d1;
  --r: 14px; --r-sm: 10px;
  --sh: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.06);
  --sh-lg: 0 2px 6px rgba(0,0,0,.06), 0 18px 48px rgba(0,0,0,.12);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --sheet-h: 0px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
a { color: var(--acc); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.dim { color: var(--dim); } .small { font-size: 12.5px; } .mono { font-family: var(--mono); font-size: 12px; }

#app { display: grid; grid-template-columns: 300px minmax(0, 1fr) 420px; height: 100dvh; }

/* ---------- rail: asset picker ---------- */
#rail { background: var(--card); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.brand { padding: 22px 20px 14px; }
.brand h1 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.brand p { color: var(--dim); font-size: 12.5px; margin-top: 2px; }
.rail-scroll { overflow: auto; flex: 1; padding: 0 12px 12px; overscroll-behavior: contain; }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 14px 8px 8px; display: flex; align-items: center; gap: 8px; }
.eyebrow .link { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 12.5px; color: var(--acc); background: none; border: 0; padding: 0; }
.asset { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; cursor: pointer; border: 0; background: none; width: 100%; text-align: left; }
.asset:hover { background: #f5f5f7; }
.asset.sel { background: var(--acc-soft); }
.asset .th { width: 52px; height: 52px; border-radius: 10px; background: #eee center/cover no-repeat; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.asset .nm { font-weight: 600; font-size: 14.5px; letter-spacing: -.01em; }
.asset .cl { color: var(--dim); font-size: 12px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.asset .add { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--acc); font-size: 19px; line-height: 1; display: grid; place-items: center; }
.asset .add:hover { background: var(--acc); color: #fff; border-color: var(--acc); }
.asset .add.in { color: var(--ok); border-color: transparent; background: var(--ok-bg); font-size: 14px; cursor: default; }
.asset .add[disabled] { color: var(--faint); cursor: default; background: none; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: #f0f0f3; color: var(--dim); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.bad { background: var(--bad-bg); color: var(--bad); } .chip.warn { background: var(--warn-bg); color: var(--warn); }
.scene-list { display: flex; flex-direction: column; gap: 6px; padding: 0 4px; }
.scene-item { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; text-align: left; width: 100%; }
.scene-item.focus { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
.scene-item b { font-weight: 600; font-size: 13.5px; display: block; }
.scene-item span { font-size: 11.5px; color: var(--dim); font-family: var(--mono); }
.x { width: 28px; height: 28px; border-radius: 50%; border: 0; background: #f0f0f3; color: var(--dim); font-size: 15px; line-height: 1; display: grid; place-items: center; }
.x:hover { background: var(--bad-bg); color: var(--bad); }
.scene-hint { font-size: 12px; color: var(--dim); padding: 6px 8px 0; }
.rail-foot { padding: 12px 20px calc(14px + var(--sab)); border-top: 1px solid var(--line); font-size: 11.5px; color: var(--dim); display: flex; flex-direction: column; gap: 6px; }

/* ---------- stage ---------- */
#stage { position: relative; min-width: 0; min-height: 0; background: #f4f5f7; overflow: hidden; }
#c { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
#progress { position: absolute; left: 0; top: 0; height: 3px; width: 0; background: var(--acc); transition: width .2s ease, opacity .4s ease .2s; opacity: 0; z-index: 4; }
#progress.on { opacity: 1; transition: width .2s ease; }
#loadnote { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--card); box-shadow: var(--sh-lg); border-radius: var(--r); padding: 16px 22px; font-weight: 600; display: none; min-width: 240px; text-align: center; z-index: 4; }
#loadnote.on { display: block; }
#loadnote .bar { height: 4px; background: #eee; border-radius: 4px; margin-top: 10px; overflow: hidden; }
#loadnote .bar i { display: block; height: 100%; width: 0; background: var(--acc); transition: width .2s; }
.title { position: absolute; left: calc(24px + var(--sal)); top: calc(20px + var(--sat)); pointer-events: none; max-width: 55%; }
.title h2 { font-size: 30px; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
.title p { color: var(--dim); font-size: 14px; margin-top: 4px; }
#chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; pointer-events: auto; }
#chips .sc { display: inline-flex; align-items: center; gap: 6px; background: var(--card); box-shadow: var(--sh); border-radius: 99px; padding: 4px 4px 4px 12px; font-size: 12.5px; font-weight: 600; border: 1px solid transparent; cursor: pointer; }
#chips .sc.focus { border-color: var(--acc); }
#chips .x { width: 22px; height: 22px; font-size: 13px; }
.seg { display: inline-flex; background: rgba(255,255,255,.85); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--sh); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 7px 13px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--dim); }
.seg button.on { background: var(--ink); color: #fff; }
#views { position: absolute; right: calc(20px + var(--sar)); top: calc(20px + var(--sat)); }
#toolbar { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; gap: 6px; align-items: center; background: rgba(255,255,255,.88); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--sh-lg); border-radius: 18px; padding: 6px; max-width: calc(100% - 24px); overflow-x: auto; scrollbar-width: none; }
#toolbar::-webkit-scrollbar { display: none; }
.tb { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; padding: 9px 13px; border-radius: 12px; font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.tb svg { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tb:hover { background: #f0f0f3; }
.tb.on { background: var(--acc); color: #fff; }
.tb.quiet.on { background: var(--acc-soft); color: var(--acc); }
.tb-sep { width: 1px; height: 22px; background: var(--line); flex: none; }
#followMode { display: none; } #followMode.on { display: inline-flex; box-shadow: none; background: #f0f0f3; }
#followMode button { padding: 6px 10px; font-size: 12.5px; }
#hud { position: absolute; left: calc(24px + var(--sal)); bottom: 84px; color: var(--dim); font-size: 12px; pointer-events: none; max-width: 60%; line-height: 1.4; }
#hud b { color: var(--ink); font-weight: 600; }
#wip { position: absolute; inset: 0; display: none; overflow: auto; background: var(--bg); padding: calc(96px + var(--sat)) 24px 110px; }
#wip.on { display: block; }
.wip-card { max-width: 980px; margin: 0 auto; background: var(--card); border-radius: 18px; box-shadow: var(--sh); padding: 28px; }
.wip-card h3 { font-size: 22px; letter-spacing: -.02em; margin: 12px 0 4px; }
.wip-card img { width: 100%; height: auto; border-radius: 12px; margin-top: 18px; display: block; background: #eee; }
.steps { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.steps span { font-size: 12.5px; font-weight: 600; padding: 5px 12px; border-radius: 99px; background: #f0f0f3; color: var(--faint); }
.steps span.done { background: var(--ok-bg); color: var(--ok); } .steps span.now { background: var(--warn-bg); color: var(--warn); }
body.wip #toolbar, body.wip #views, body.wip #hud { display: none; }

/* ---------- panel ---------- */
#panel { background: var(--bg); border-left: 1px solid var(--line); overflow: auto; min-height: 0; padding: 16px 16px calc(24px + var(--sab)); overscroll-behavior: contain; }
.head { padding: 8px 6px 14px; }
.head h2 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.head p { color: var(--dim); font-size: 13.5px; margin-top: 6px; }
.head .row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.btn { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 8px 14px; font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.btn:hover { border-color: #cfcfd6; }
.btn.primary { background: var(--acc); border-color: var(--acc); color: #fff; }
.btn.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn[disabled] { opacity: .5; cursor: default; }
details.sec { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); margin-bottom: 12px; overflow: hidden; }
details.sec > summary { list-style: none; padding: 15px 18px; font-size: 16px; font-weight: 650; letter-spacing: -.01em; cursor: pointer; display: flex; align-items: center; gap: 10px; user-select: none; }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint); transform: rotate(-45deg); transition: transform .15s; }
details.sec[open] > summary::after { transform: rotate(45deg); }
details.sec > summary .count { font-size: 12.5px; font-weight: 500; color: var(--dim); }
.sec .in { padding: 0 18px 18px; }
.sec h4 { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); margin: 18px 0 8px; }
.sec h4:first-child { margin-top: 2px; }
.empty { color: var(--dim); font-size: 13.5px; }

.slider { padding: 10px 0; border-top: 1px solid var(--line); } .slider:first-of-type { border-top: 0; padding-top: 2px; }
.slider .top { display: flex; align-items: baseline; gap: 8px; }
.slider label { font-weight: 600; font-size: 14px; }
.slider .val { margin-left: auto; font-family: var(--mono); font-size: 12.5px; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.slider .val i { color: var(--dim); font-style: normal; }
.slider .ctl { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.slider .desc { color: var(--dim); font-size: 12px; margin-top: 4px; line-height: 1.35; }
.slider.off label, .slider.off .val { color: var(--faint); }
input[type=range] { -webkit-appearance: none; appearance: none; flex: 1; height: 28px; background: none; margin: 0; min-width: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--acc) var(--p, 0%), #e3e3e8 var(--p, 0%)); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: #e3e3e8; }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--acc); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25), 0 0 0 .5px rgba(0,0,0,.08); margin-top: -9px; }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25), 0 0 0 .5px rgba(0,0,0,.08); }
input[type=range]:disabled { opacity: .45; }
.pill { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.pill.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pill .dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); }
.wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.act { position: relative; overflow: hidden; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 10px 12px; text-align: left; font-weight: 600; font-size: 13.5px; }
.act small { display: block; color: var(--dim); font-weight: 500; font-size: 11.5px; margin-top: 1px; }
.act.on { border-color: var(--acc); background: var(--acc-soft); color: var(--acc); }
.act .bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--acc); }
.act.travel small::after { content: " · moves through the scene"; }

/* verify */
.verdict { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; background: var(--ok-bg); color: var(--ok); }
.verdict.bad { background: var(--bad-bg); color: var(--bad); } .verdict.none { background: #f0f0f3; color: var(--dim); }
.verdict .big { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.verdict .txt { font-size: 13px; line-height: 1.35; } .verdict .txt b { display: block; font-size: 14.5px; }
.dimcard { border: 1px solid var(--line); border-radius: 12px; margin-top: 10px; overflow: hidden; }
.dimcard .dh { padding: 10px 14px; background: #fafafc; border-bottom: 1px solid var(--line); }
.dimcard .dh b { font-size: 14px; } .dimcard .dh div { font-size: 12px; color: var(--dim); margin-top: 2px; word-break: break-word; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 7px 14px; text-align: right; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
tr:first-child th, tr:first-child td { border-top: 0; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--faint); font-weight: 600; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; }
td.ok, td.bad { font-weight: 700; } td.ok { color: var(--ok); } td.bad { color: var(--bad); }
td.ok span, td.bad span { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--ok-bg); } td.bad span { background: var(--bad-bg); }
.note { font-size: 12px; color: var(--dim); margin-top: 10px; line-height: 1.4; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.tile.wide { grid-column: 1 / -1; }
.tile b { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
.tile span.v { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.tile .s { font-size: 12px; color: var(--dim); line-height: 1.35; margin-top: 2px; }
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photos figure { margin: 0; }
.photos img, .sheet img { width: 100%; display: block; border-radius: 10px; background: #eee; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.photos img { aspect-ratio: 4 / 3; object-fit: cover; }
figcaption { font-size: 11.5px; color: var(--dim); margin-top: 5px; line-height: 1.35; word-break: break-word; }
.sheet { margin-top: 4px; }
.kn td:first-child { color: var(--dim); width: 45%; } .kn td { text-align: left; padding-left: 0; } .kn td b { font-weight: 600; }
.kn td small { display: block; color: var(--faint); font-size: 11.5px; }
ul.src { padding-left: 18px; margin: 0; font-size: 12.5px; word-break: break-all; }
kbd { font: 11px var(--mono); background: #f0f0f3; border-radius: 5px; padding: 1px 6px; color: var(--dim); }

@media (max-width: 1700px) { .tb.ico span { display: none; } .tb.ico { padding: 9px 11px; } }

/* ---------- phone: stage on top, bottom sheet for picker / controls / verify ---------- */
#sheet { display: none; }
@media (max-width: 900px) {
  #app { display: block; height: 100dvh; }
  #stage { height: calc(100dvh - var(--sheet-h)); transition: height .25s ease; }
  #sheet { display: flex; flex-direction: column; position: fixed; left: 0; right: 0; bottom: 0; height: var(--sheet-full, 60dvh); max-height: calc(100dvh - var(--sat) - 12px); background: var(--bg); border-radius: 20px 20px 0 0; box-shadow: 0 -8px 40px rgba(0,0,0,.14); z-index: 10; transition: height .25s ease; }
  #sheet.drag, #sheet.drag ~ * { transition: none; }
  #grab { padding: 8px 0 4px; touch-action: none; cursor: grab; flex: none; }
  #grab i { display: block; width: 40px; height: 5px; border-radius: 5px; background: #c7c7cc; margin: 0 auto; }
  #tabs { display: flex; gap: 4px; padding: 4px 12px 10px; flex: none; }
  #tabs button { flex: 1; border: 0; background: none; padding: 9px 0; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--dim); }
  #tabs button.on { background: var(--card); color: var(--ink); box-shadow: var(--sh); }
  #sheetBody { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding-bottom: var(--sab); -webkit-overflow-scrolling: touch; }
  #rail, #panel { border: 0; background: none; display: none; overflow: visible; }
  #sheet[data-tab=assets] #rail { display: block; }
  #sheet[data-tab=controls] #panel, #sheet[data-tab=verify] #panel { display: block; padding-top: 4px; }
  #sheet[data-tab=controls] #panel [data-g=verify], #sheet[data-tab=verify] #panel [data-g=controls] { display: none; }
  .brand { padding: 4px 20px 6px; } .brand h1 { font-size: 17px; }
  .rail-scroll { overflow: visible; }
  .rail-foot { border: 0; padding-bottom: 20px; }
  .title { left: calc(16px + var(--sal)); top: calc(14px + var(--sat)); max-width: calc(100% - 32px); }
  .title h2 { font-size: 22px; } .title p { font-size: 12.5px; }
  #views { top: auto; right: auto; left: 50%; transform: translateX(-50%); bottom: 68px; }
  .seg button { padding: 6px 11px; font-size: 12.5px; }
  #toolbar { bottom: 10px; padding: 5px; border-radius: 16px; }
  #toolbar { gap: 2px; } .tb { padding: 9px 9px; font-size: 13px; gap: 6px; } .tb.ico span { display: none; } .tb-sep { margin: 0 1px; }
  #hud { display: none; }
  #wip { padding: calc(84px + var(--sat)) 12px 24px; } .wip-card { padding: 18px; }
  .acts { grid-template-columns: 1fr 1fr; }
}
body.print #panel { overflow: visible; height: auto; } body.print #app { height: auto; } body.print, html:has(body.print) { overflow: visible; height: auto; }
