:root {
  /* graphite neutrals: the lit model carries the colour, the chrome stays quiet */
  --bg: #0f0f10; --bg2: #161617; --bg3: #222224; --line: rgba(237,237,237,.08); --line2: rgba(237,237,237,.14);
  --text: #ededed; --text2: #a1a1a6; --mute: #8e8e94; --accent: #07b672;   /* AnyReference green, from the logo */ --accent-text: #2ccf8b;   /* the same green a touch lighter, for small text on raised surfaces (contrast) */ --err: #e5484d;
  --r: 12px; font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-size: 14px; }
button, input, select { font: inherit; color: inherit; }
h1, h2 { margin: 0; font-weight: 500; }

.topbar { height: calc(56px + env(safe-area-inset-top)); display: flex; align-items: center; gap: 16px; padding: env(safe-area-inset-top) max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left)); border-bottom: 1px solid var(--line); background: rgba(15,15,16,.85); backdrop-filter: blur(8px); position: relative; z-index: 5; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-size: 18px; font-weight: 600; }
.brand-mark { width: 28px; height: 28px; display: block; }
.brand b { color: var(--accent); }
.tag { color: var(--mute); font-size: 12px; }
.spacer { flex: 1; }
.pill { font-size: 12px; padding: 4px 12px; border-radius: 6px; background: var(--bg3); border: 1px solid var(--line); color: var(--mute); }
.pill.ok::before, .pill.warn::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.pill.ok::before { background: var(--accent); }
.pill.warn::before { background: #f5b942; }

.app { display: grid; grid-template-columns: 340px 1fr; height: calc(100% - 56px); }

/* panel */
.panel { padding: 24px 20px; border-right: 1px solid var(--line); overflow-y: auto; display: flex; flex-direction: column; gap: 16px; background: var(--bg2); }
.panel h1 { font-size: 20px; }
.sub { margin: -8px 0 0; color: var(--mute); line-height: 1.45; font-size: 13px; }
.dropzone { position: relative; display: grid; place-items: center; min-height: 220px; border: 1.5px dashed var(--line2); border-radius: var(--r); background: repeating-conic-gradient(#1a1a1c 0% 25%, #161617 0% 50%) 0 0 / 18px 18px; cursor: pointer; transition: border-color .15s, background-color .15s; overflow: hidden; }
.dropzone:hover, .dropzone.drag, .dropzone:focus-visible { border-color: var(--accent); outline: none; }
.dz-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 20px; color: var(--mute); }
.dz-empty svg { width: 36px; height: 36px; color: var(--accent); margin-bottom: 4px; }
.dz-empty strong { color: var(--text); font-weight: 500; }
.dz-empty span { font-size: 12px; }
.dropzone img { max-width: 100%; max-height: 300px; object-fit: contain; display: block; padding: 12px; }
.dropzone.has .dz-empty { display: none; }
.icon-btn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line2); background: var(--bg3); cursor: pointer; display: grid; place-items: center; font-size: 15px; transition: color .15s ease-out, background-color .15s ease-out, border-color .15s ease-out; }
.icon-btn:hover { border-color: var(--mute); }
.icon-btn.on { border-color: var(--accent); color: var(--accent); }
.clear { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; font-size: 12px; background: rgba(0,0,0,.6); }

.field { display: flex; flex-direction: column; gap: 8px; }
.field > label, .adv summary { font-size: 12px; color: var(--text2); font-weight: 500; }
select, input[type=number] { background: var(--bg3); border: 1px solid var(--line2); border-radius: 8px; padding: 8px 12px; width: 100%; }
select:focus, input:focus { outline: none; border-color: var(--accent); }
.hint { margin: 0; color: var(--mute); font-size: 12px; line-height: 1.4; }
.hint.center { text-align: center; padding: 32px 12px; }
.seg { display: flex; background: var(--bg3); border: 1px solid var(--line2); border-radius: 10px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 8px; border-radius: 6px; cursor: pointer; color: var(--mute); }
.seg button.on { background: var(--line2); color: var(--text); }
.seg button:disabled { opacity: .35; cursor: not-allowed; }
.seg.small button { padding: 8px 12px; font-size: 12px; }
.adv { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 12px; }
.adv summary { cursor: pointer; }
.adv[open] summary { margin-bottom: 12px; }
.adv .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.toggle { display: flex; gap: 8px; align-items: center; cursor: pointer; font-size: 13px; }
.toggle input { accent-color: var(--accent); width: 16px; height: 16px; }
.disabled { opacity: .4; pointer-events: none; }

.primary { border: 0; border-radius: 12px; padding: 12px 16px; background: var(--accent); color: #0f0f10; font-weight: 600; cursor: pointer; transition: transform .1s ease-out, filter .15s ease-out, opacity .15s ease-out; text-decoration: none; text-align: center; display: inline-block; }
.primary:hover { filter: brightness(1.08); }
.primary:active { transform: scale(.98); }
.primary:disabled { opacity: .35; cursor: not-allowed; filter: none; }
.primary.small { padding: 8px 16px; font-size: 13px; border-radius: 8px; }

.jobcard { border: 1px solid var(--line); border-radius: var(--r); padding: 12px; background: var(--bg3); }
.jobhead { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
#jobPct { color: var(--accent); font-variant-numeric: tabular-nums; }
.bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; }
.err { color: var(--err); margin: 12px 0 0; font-size: 13px; line-height: 1.4; word-break: break-word; }

/* stage */
.stage { position: relative; overflow: hidden; background: radial-gradient(ellipse at 50% 40%, #1c1c1e 0%, #0f0f10 70%); }
.stage.light .empty p { color: #171717; }
.stage.light .empty span { color: #525252; }
.popover { position: absolute; top: 70px; right: 14px; width: 260px; padding: 16px; border-radius: 12px; background: rgba(22,22,23,.95); border: 1px solid var(--line2); backdrop-filter: blur(8px); display: flex; flex-direction: column; gap: 8px; z-index: 4; box-shadow: 0 12px 30px rgba(0,0,0,.35); max-height: calc(100% - 84px - var(--meta-h, 0px)); overflow: hidden auto; }
.popover h4 { margin: 4px 0 2px; font-size: 11px; color: var(--mute); }
.popover h4 + .swatches { margin-top: 2px; }
.swatches { display: grid; grid-template-columns: repeat(9, 1fr); gap: 8px; }
.swatches button { aspect-ratio: 1; border-radius: 6px; border: 1px solid rgba(255,255,255,.18); cursor: pointer; padding: 0; }
.swatches button.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.prow { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.prow span { color: var(--mute); font-variant-numeric: tabular-nums; }
.popover input[type=color] { width: 40px; height: 26px; border: 1px solid var(--line2); border-radius: 6px; background: none; padding: 1px; cursor: pointer; }
.popover input[type=range] { width: 100%; accent-color: var(--accent); }
.popover .hint { margin-top: -2px; }
.linkbtn { background: none; border: 0; color: var(--mute); font-size: 12px; text-align: left; padding: 0; cursor: pointer; text-decoration: underline; }
.linkbtn:hover { color: var(--text); }
.viewer, .viewer canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage.dragging::after { content: "Drop a photo or 3D model"; position: absolute; inset: 14px; border: 2px dashed var(--accent); border-radius: 16px; display: grid; place-items: center; font-size: 18px; background: rgba(15,15,16,.6); }
.empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--mute); pointer-events: none; }
.empty p { color: var(--text); font-size: 16px; margin: 24px 0 0; }
.empty span { font-size: 12px; }
.cube { width: 70px; height: 70px; border: 2px solid var(--line2); border-radius: 10px; transform: rotateX(55deg) rotateZ(45deg);  }
.loading { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(15,15,16,.86); color: var(--text2); font-size: 13px; font-variant-numeric: tabular-nums; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--line2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; will-change: transform; }   /* runs on the GPU, keeps turning even while the page is busy */
@keyframes spin { to { transform: rotate(360deg); } }
.toolbar { position: absolute; top: 14px; right: 14px; display: flex; gap: 8px; align-items: center; padding: 8px; border-radius: 12px; background: rgba(22,22,23,.8); border: 1px solid var(--line); backdrop-filter: blur(8px); }
.toolbar .seg { border: 0; }
.chip { height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line2); background: var(--bg3); cursor: pointer; font-size: 12px; color: var(--mute); transition: color .15s ease-out, background-color .15s ease-out, border-color .15s ease-out; white-space: nowrap; }
.chip:hover { border-color: var(--mute); color: var(--text); }
.chip.on, .chip.set { border-color: var(--accent); color: var(--accent); }
.meta { position: absolute; right: 14px; bottom: 14px; display: flex; gap: 24px; align-items: center; padding: 12px 16px; border-radius: 12px; background: rgba(22,22,23,.8); border: 1px solid var(--line); backdrop-filter: blur(8px); }
.ghost { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line2); background: var(--bg3); border-radius: 8px; padding: 8px 12px; font-size: 13px; cursor: pointer; transition: border-color .15s; }
.ghost:hover { border-color: var(--accent); }
.ghost svg { width: 16px; height: 16px; }
.savegroup { position: relative; display: flex; }
.primary.save { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; font-size: 14px; border-radius: 10px 0 0 10px; }
.primary.save svg { width: 18px; height: 18px; }
.primary.caret { padding: 12px 12px; border-radius: 0 10px 10px 0; border-left: 1px solid rgba(0,0,0,.25); font-size: 12px; }
.shotmenu { position: absolute; right: 0; bottom: calc(100% + 10px); width: 270px; padding: 16px; border-radius: 12px; background: rgba(22,22,23,.97); border: 1px solid var(--line2); display: flex; flex-direction: column; gap: 8px; box-shadow: 0 12px 30px rgba(0,0,0,.4); z-index: 5; }
.shotmenu h4 { margin: 2px 0 0; font-size: 11px; color: var(--mute); }
.shotmenu .toggle { margin-top: 4px; }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; animation: flash .35s ease-out; }
@keyframes flash { from { opacity: .45; } to { opacity: 0; } }

.hhead { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.hhead h2 { font-size: 15px; }
#histCount { color: var(--mute); font-size: 12px; }
.hlist { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg3); cursor: pointer; transition: border-color .15s; }
.card:hover { border-color: var(--line2); }
.card.active { border-color: var(--accent); }
.card img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; background: #121213; }
.card .cinfo { padding: 8px 8px; font-size: 11px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .badge { position: absolute; top: 6px; left: 6px; font-size: 10px; padding: 2px 8px; border-radius: 6px; background: rgba(0,0,0,.7); }
.badge.running { color: var(--accent); }
.badge.failed { color: var(--err); }
.card .del { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; font-size: 10px; border-radius: 6px; opacity: 0; background: rgba(0,0,0,.7); }
.card:hover .del { opacity: 1; }
.card .cbar { position: absolute; left: 0; bottom: 27px; height: 3px; background: var(--accent); }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--bg3); border: 1px solid var(--line2); padding: 12px 16px; border-radius: 10px; z-index: 50; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.invite-row { display: flex; gap: 8px; margin: 14px 0 8px; }
.invite-row input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line2); background: var(--bg); color: var(--text); font: inherit; font-size: 13px; }
.toast.err { border-color: var(--err); border-left: 4px solid var(--err); color: var(--text); }   /* red text on dark failed contrast */

@media (max-width: 1150px) {
  .app { grid-template-columns: 320px 1fr; }
}
@media (max-width: 760px) {
  .app { display: flex; flex-direction: column; height: auto; }
  .panel { border-right: 0; }
  .stage { height: 70vh; }
  .tag { display: none; }
  .meta { flex-wrap: wrap; gap: 16px; }
}


.ghost.wide { width: 100%; justify-content: center; padding: 12px 16px; font-size: 14px; }
.ghost.wide svg { width: 18px; height: 18px; color: var(--accent); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--mute); font-size: 12px; margin: -4px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.badge.uploaded { color: #9fb4ff; }
.badge.lock { color: #ffd479; }
.card.locked img { opacity: .45; }
.lock-tile { aspect-ratio: 1; display: grid; place-items: center; background: #1b1b1d; color: var(--mute); }
.lock-tile .ic { width: 22px; height: 22px; }
#libNote { margin-bottom: 12px; }
.meta .savegroup { flex-direction: row; }

.presets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.presets button { border: 1px solid var(--line2); background: var(--bg3); border-radius: 6px; padding: 8px 0; font-size: 12px; cursor: pointer; }
.presets button:hover { border-color: var(--accent); }
.lightcols { display: flex; gap: 8px; align-items: center; }
.lightcols button { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); cursor: pointer; padding: 0; }
.lightcols button.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.lightcols input[type=color] { width: 30px; height: 24px; border: 1px solid var(--line2); border-radius: 6px; background: none; padding: 1px; cursor: pointer; }
#lightPop .hint { margin: -2px 0 2px; }

.axes { display: flex; flex-direction: column; gap: 8px; margin: 2px 0 4px; }
.axes label { display: grid; grid-template-columns: 18px 1fr 64px; align-items: center; gap: 8px; }
.axes input[type=range] { width: 100%; }
.axes input[type=number] { width: 64px; padding: 4px 8px; font-size: 12px; border-radius: 6px; background: var(--bg3); border: 1px solid var(--line2); font-variant-numeric: tabular-nums; }
.ax { font-size: 12px; text-align: center; }
.ax.x { color: #ff5a5a; } .ax.y { color: #5ad86a; } .ax.z { color: #5a8dff; }
#lx { accent-color: #ff5a5a; } #ly { accent-color: #5ad86a; } #lz { accent-color: #5a8dff; }
.lightcols { flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.lightcols button { width: 20px; height: 20px; }

/* ---------- panel headers with close button ---------- */
.pophead { display: flex; align-items: center; justify-content: space-between; }
.pophead h4 { margin: 0; }
.pop-close { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line2); background: var(--bg3); cursor: pointer; font-size: 11px; color: var(--mute); display: grid; place-items: center; }
.pop-close:hover { color: var(--text); border-color: var(--mute); }

/* touch vs mouse wording */
.touch-only { display: none; }
@media (pointer: coarse) {
  .touch-only { display: inline; }
  .desk-only { display: none !important; }
  .card .del { opacity: 1; }              /* no hover on touch screens */
}

/* ---------- phone layout ---------- */
@media (max-width: 760px) {
  html, body { font-size: 15px; }
  body { padding-bottom: env(safe-area-inset-bottom); }
  .topbar { height: 52px; padding: 0 16px; padding-top: env(safe-area-inset-top); height: calc(52px + env(safe-area-inset-top)); position: sticky; top: 0;
    /* no blur here: a blurred bar traps the account menu (a sheet fixed to the bottom of the screen) inside itself,
       which pushed the menu off the top of the screen. The bar also sits above the page so the sheet does too. */
    backdrop-filter: none; background: var(--bg); z-index: 45; }
  .pill { font-size: 11px; max-width: 52vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .app { display: flex; flex-direction: column; height: auto; }

  /* create panel */
  .panel { padding: 16px 16px 20px; gap: 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .panel h1 { font-size: 19px; }
  .dropzone { min-height: 170px; }
  .dropzone img { max-height: 240px; }
  select, input[type=number] { font-size: 16px; padding: 12px 12px; }   /* 16px stops iOS zooming on focus */
  .seg button { padding: 12px 8px; }
  .primary { padding: 16px 16px; font-size: 16px; }
  .ghost.wide { padding: 12px 16px; }

  /* viewer */
  .stage { height: 68vh; height: 68svh; min-height: 380px; scroll-margin-top: 60px; }
  .toolbar { left: 8px; right: 8px; top: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; justify-content: flex-start; flex-wrap: nowrap; }
  .toolbar::-webkit-scrollbar { display: none; }
  .toolbar > * { flex: 0 0 auto; }
  .toolbar .icon-btn, .toolbar .chip { height: 40px; min-width: 40px; }
  .toolbar .seg.small button { padding: 8px 12px; }
  .empty p { font-size: 15px; text-align: center; padding: 0 20px; }

  /* bottom bar: big Save, small Download, stats hidden */
  .meta { left: 8px; right: 8px; bottom: 8px; padding: 8px; gap: 8px; flex-wrap: nowrap; }
  .savegroup { flex: 1; }
  .primary.save { flex: 1; justify-content: center; padding: 12px 16px; font-size: 16px; }
  .primary.caret { padding: 12px 16px; }

  /* every settings panel becomes a bottom sheet that leaves the model visible above it */
  .popover, .shotmenu {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto;
    max-height: 48vh; max-height: 48svh; overflow-y: auto;
    border-radius: 16px 18px 0 0; padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
    z-index: 30; box-shadow: 0 -12px 40px rgba(0,0,0,.5);
  }
  .popover::before, .shotmenu::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line2); margin: 0 auto 8px; }
  .pop-close { width: 36px; height: 36px; font-size: 13px; }
  .popover input[type=range], .shotmenu input[type=range] { height: 28px; }
  .presets button { padding: 12px 0; font-size: 13px; }
  .axes label { grid-template-columns: 20px 1fr 64px; }
  .axes input[type=number] { width: 64px; font-size: 16px; padding: 8px; }
  .swatches button, .lightcols button { min-width: 28px; min-height: 28px; }
  .toggle { padding: 4px 0; }
  .toggle input { width: 20px; height: 20px; }

  .card .del { width: 28px; height: 28px; font-size: 12px; }

  .toast { bottom: calc(20px + env(safe-area-inset-bottom)); max-width: 90vw; text-align: center; }
}
@media (max-width: 760px) {
  .meta, .toolbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(22,22,23,.92); }
}
@media (max-width: 760px) { .popover, .shotmenu { background: var(--bg2); backdrop-filter: none; -webkit-backdrop-filter: none; } }

.setup { border: 1px solid #5a4a1c; background: #221d10; color: #f5d98b; border-radius: var(--r); padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; line-height: 1.45; }
.setup strong { color: #ffe7a3; }
.setup code { background: rgba(255,255,255,.08); padding: 1px 4px; border-radius: 4px; }

/* ---------- account area ---------- */
.account { position: relative; display: flex; align-items: center; gap: 8px; }
.credits-chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line2); background: var(--bg3); cursor: pointer; font-weight: 600; font-variant-numeric: tabular-nums; }
.credits-chip svg { width: 14px; height: 14px; color: var(--accent); }
.credits-chip .cl { color: var(--mute); font-weight: 400; font-size: 12px; }
.credits-chip:hover { border-color: var(--accent); }
.credits-chip.low { border-color: #8a6a1c; }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line2); background: var(--bg3) center/cover no-repeat; color: var(--text); font-weight: 600; cursor: pointer; padding: 0; }
.menu { position: absolute; top: calc(100% + 8px); right: 0; width: 250px; background: var(--bg2); border: 1px solid var(--line2); border-radius: 12px; padding: 8px; z-index: 40; box-shadow: 0 14px 34px rgba(0,0,0,.45); display: flex; flex-direction: column; }
.menu-head { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-head span { color: var(--mute); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.menu-plan { color: var(--accent) !important; }
.menu button { text-align: left; background: none; border: 0; padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.menu button:hover { background: var(--bg3); }

/* ---------- modals ---------- */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(5,6,9,.72); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; overflow-y: auto; }
.modal-card { position: relative; background: var(--bg2); border: 1px solid var(--line2); border-radius: 16px; padding: 24px; width: 100%; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.modal-card.narrow { max-width: 400px; text-align: center; }
.modal-card.wide { max-width: 860px; }
.modal-card h2 { font-size: 22px; margin-bottom: 8px; }
.modal-card h3 { font-size: 15px; margin: 20px 0 12px; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.modal-card h3 .hint { font-weight: 400; }
.modal-x { position: absolute; top: 14px; right: 14px; }
.fine { color: var(--mute); font-size: 11px; margin: 16px 0 0; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pcard { position: relative; border: 1px solid var(--line2); border-radius: 14px; padding: 16px; background: var(--bg3); display: flex; flex-direction: column; gap: 8px; }
.pcard.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.pcard .pbadge { position: absolute; top: -10px; right: 12px; background: var(--accent); color: #0f0f10; font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 99px; }
.pcard .pname { font-weight: 600; }
.pcard .pprice { font-size: 26px; font-weight: 600;  }
.pcard .pprice small { font-size: 13px; font-weight: 400; color: var(--mute); }
.pcard .pmeta { color: var(--mute); font-size: 12.5px; flex: 1; }
.pcard .primary, .pcard .ghost { margin-top: 8px; justify-content: center; }
.pcard.current { border-color: var(--accent); }
.cost { font-style: normal; font-size: 10.5px; color: var(--mute); margin-left: 4px; }
.seg button.on .cost { color: var(--accent-text); }
.signed-out-note { text-align: center; padding: 24px 12px; color: var(--mute); font-size: 13px; }
.signed-out-note button { margin-top: 12px; }

@media (max-width: 760px) {
  .credits-chip .cl { display: none; }
  .modal { padding: 0; place-items: end stretch; }
  .modal-card { border-radius: 16px 18px 0 0; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); max-height: 92svh; overflow-y: auto; }
  .plans, .packs { grid-template-columns: 1fr; }
  .menu { position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: auto; border-radius: 16px 18px 0 0; padding: 12px 12px calc(16px + env(safe-area-inset-bottom)); }
  .menu button { padding: 16px 12px; font-size: 16px; }
}

.menu .menu-link { display: block; padding: 8px 12px; border-radius: 8px; color: inherit; text-decoration: none; }
.menu .menu-link:hover { background: var(--bg3); }
.menu .danger { color: var(--err); font-size: 13px; }
.menu-foot { padding: 8px 12px 4px; font-size: 11px; color: var(--mute); border-top: 1px solid var(--line); margin-top: 4px; }
.menu-foot a, .legal-foot a, .fine a { color: var(--mute); }
.legal-foot { font-size: 11px; color: var(--mute); text-align: center; margin: 20px 0 0; }

#viewer.bw canvas { filter: grayscale(1); }
.sheet-btn { margin-top: 8px; width: 100%; justify-content: center; }

@media (min-width: 761px) { .toolbar { flex-wrap: wrap; justify-content: flex-end; max-width: calc(100% - 28px); } }

/* Lens (perspective) slider in the viewer toolbar */
.chip.lens { display: inline-flex; align-items: center; gap: 8px; cursor: default; }
.chip.lens input[type=range] { width: 96px; accent-color: var(--accent); cursor: pointer; }
.chip.lens output { min-width: 52px; font-variant-numeric: tabular-nums; text-align: right; }
@media (max-width: 760px) { .chip.lens input[type=range] { width: 80px; } }

/* "View" dropdown menu */
.tools-pop { width: 290px; }
.tools-pop .seg { display: flex; width: 100%; }
.tools-pop .seg button { flex: 1; }
.mi-group { display: flex; flex-direction: column; gap: 2px; }
.mi { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font-size: 13px; text-align: left; cursor: pointer; }
.mi:hover { background: var(--bg3); }
.mi .mi-ic { width: 18px; text-align: center; color: var(--mute); }
.mi.on { color: var(--accent); }
.mi.on .mi-ic { color: var(--accent); }
.mi:not(.sub).on::after { content: ''; margin-left: auto; width: 16px; height: 16px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 16px no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 16px no-repeat; }
.mi.sub::after { content: ''; margin-left: auto; width: 16px; height: 16px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / 16px no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / 16px no-repeat; color: var(--mute); }
@media (max-width: 760px) {
  .toolbar { justify-content: space-between; }
  .mi { padding: 12px 12px; font-size: 14px; }
  .tools-pop { width: auto; }
}
.mi .mi-ic { pointer-events: none; }

/* ---- collapsible upload panel ---- */
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-min-btn { width: 32px; height: 32px; font-size: 18px; line-height: 1; }
.app.upload-min { grid-template-columns: 0 1fr; }
.app.upload-min .panel { padding: 0; border: 0; overflow: hidden; visibility: hidden; }
.upload-tab { position: fixed; left: 0; top: 50%; transform: translateY(-50%); z-index: 15; padding: 16px 8px; border: 1px solid var(--line2); border-left: 0; border-radius: 0 12px 12px 0; background: var(--bg3); color: var(--text); cursor: pointer; font-size: 12px; box-shadow: 6px 0 20px rgba(0,0,0,.3); }
.upload-tab span { writing-mode: vertical-rl; transform: rotate(180deg); display: block; white-space: nowrap; }
.upload-tab:hover { color: var(--accent); border-color: var(--accent); }

/* ---- "My references" drawer ---- */
.refs { position: fixed; top: 56px; right: 0; bottom: 0; width: 340px; max-width: 88vw; z-index: 25; background: var(--bg2); border-left: 1px solid var(--line); transform: translateX(100%); transition: transform .2s ease-out; box-shadow: -12px 0 40px rgba(0,0,0,0); }
.refs.open { transform: none; box-shadow: -12px 0 40px rgba(0,0,0,.45); }
.refs-inner { height: 100%; overflow-y: auto; padding: 20px 16px; display: flex; flex-direction: column; gap: 12px; }
.refs-inner .hhead { margin-bottom: 0; align-items: center; }
.refs-tab { position: absolute; right: 100%; top: 50%; transform: translateY(-50%); padding: 16px 8px; border: 1px solid var(--line2); border-right: 0; border-radius: 12px 0 0 12px; background: var(--bg3); color: var(--text); cursor: pointer; font-size: 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; box-shadow: -6px 0 20px rgba(0,0,0,.3); }
.refs-tab-label { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.refs-tab b { font-size: 11px; color: var(--bg); background: var(--accent); border-radius: 8px; padding: 1px 8px; min-width: 18px; text-align: center; }
.refs-tab b:empty { display: none; }
.refs-tab:hover, .refs.open .refs-tab { color: var(--accent); border-color: var(--accent); }
.refs-seg { display: flex; }
.refs-seg button { flex: 1; padding-inline: 4px; white-space: nowrap; }
.refs-seg span { opacity: .7; font-size: 11px; }
.snaps .card img { object-fit: cover; }
.snaps .card .kind { position: absolute; top: 6px; left: 6px; font-size: 10px; padding: 2px 8px; border-radius: 6px; background: rgba(0,0,0,.65); color: #fff; }

/* ---- saved-reference viewer ---- */
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(5,6,10,.86); display: grid; place-items: center; padding: 24px; }
.lb-inner { max-width: min(1200px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 12px; }
.lb-inner img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; border-radius: 10px; background: repeating-conic-gradient(#1c1c1e 0% 25%, #161617 0% 50%) 0 0 / 18px 18px; }
.lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--mute); font-size: 13px; }
.lb-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lb-actions a { text-decoration: none; display: inline-flex; align-items: center; }
.ghost.danger { color: var(--err); }

@media (max-width: 760px) {
  .app.upload-min .panel { display: none; }
  .upload-tab { position: static; transform: none; width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 12px; box-shadow: none; }
  .upload-tab span { writing-mode: horizontal-tb; transform: none; }
  .refs { top: 0; z-index: 50; }   /* above the top bar (45): the panel covers the whole screen, title and close button included */
  .refs-tab { top: auto; bottom: 120px; }
  .refs-inner { padding-top: calc(20px + env(safe-area-inset-top)); padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}
@keyframes refsPulse { 0%, 100% { transform: translateY(-50%) scale(1); } 40% { transform: translateY(-50%) scale(1.12); background: var(--accent); color: var(--bg); } }
.refs-tab.pulse { animation: refsPulse .7s ease-out; }
@media (max-width: 760px) { @keyframes refsPulseM { 40% { background: var(--accent); color: var(--bg); } } .refs-tab.pulse { animation: refsPulseM .7s ease-out; } .refs-tab { transform: none; } }

.theme-btn { font-size: 15px; }

/* View menu: collapsible "More options" and tone-band row */
.mi-more summary { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--text); list-style: none; }
.mi-more summary::-webkit-details-marker { display: none; }
.mi-more summary::after { content: ''; margin-left: auto; width: 16px; height: 16px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / 16px no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / 16px no-repeat; color: var(--mute); transition: transform .15s ease-out; }
.mi-more[open] summary::after { transform: rotate(90deg); }
.mi-more summary:hover { background: var(--bg3); }
.mi-more summary .mi-ic { width: 18px; text-align: center; color: var(--mute); }
.mi-more .mi-group { padding-left: 12px; border-left: 1px solid var(--line); margin: 2px 0 0 20px; }
.tone-row { white-space: nowrap; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--mute); }

/* fullscreen: bottom-right corner of the model view */
.fs-btn { flex: 0 0 auto; width: 40px; height: 40px; font-size: 17px; }

/* bigger "My references" tab */
.refs-tab { padding: 20px 12px; font-size: 14px; font-weight: 600; gap: 12px; border-radius: 14px 0 0 14px; }
.refs-tab b { font-size: 12px; padding: 2px 8px; }

/* keyboard focus */
button:focus-visible, a:focus-visible, summary:focus-visible, input[type=range]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* one line-icon set (lucide), 16px, 1.5 stroke, coloured by its text role */
.ic { width: 16px; height: 16px; flex: 0 0 auto; display: block; }
.chip .ic { display: inline-block; vertical-align: -3px; margin-left: 4px; color: var(--mute); }
.mi .mi-ic, .mi-more summary .mi-ic { display: grid; place-items: center; width: 16px; color: var(--mute); }
.pop-close .ic { width: 14px; height: 14px; }
.card .del .ic { width: 12px; height: 12px; }
.fs-btn .ic, .theme-btn .ic { width: 16px; height: 16px; }

@media (max-width: 760px) {
  /* everything in the model view stays on screen: toolbar wraps, the save row fits one line */
  .toolbar { flex-wrap: wrap; overflow: visible; }
  .meta { gap: 8px; }
  .primary.save { white-space: nowrap; }
  .savegroup { flex: 1; min-width: 0; }
  .savegroup .primary.save { flex: 1; }
}

/* install button and instructions */
.install-btn { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.install-btn .ic { margin: 0; color: var(--accent); }
.install-card { max-width: 400px; }
.invite-card { max-width: 460px; }
.install-card h2 { font-size: 18px; margin-bottom: 8px; }
.install-steps { margin: 16px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 12px; font-size: 14px; line-height: 1.45; }
@media (max-width: 760px) { .install-btn span { display: none; } .install-btn { width: 36px; padding: 0; justify-content: center; } }
/* installed app: no browser chrome, so respect the notch and home bar */
@media (display-mode: standalone) { body { padding-bottom: env(safe-area-inset-bottom); } }

/* ---- fit any window height (installed app windows, laptops, split screen) ---- */
/* the page is a column: header strips take what they need, the work area gets exactly the rest */
html, body { height: 100%; }
body { display: flex; flex-direction: column; min-height: 0; }
body > .topbar { flex: 0 0 auto; }
body > .app { flex: 1 1 auto; min-height: 0; height: auto; }
/* panels stop above the bottom bar (Save reference etc.) instead of covering it */
.stage:has(#meta:not([hidden])) { --meta-h: 80px; }
/* while a panel is open the My references tab steps aside so it never covers panel controls */
body.panel-open .refs:not(.open) .refs-tab { opacity: 0; pointer-events: none; }
.refs-tab { transition: opacity .15s ease-out; }
/* short windows: tighter upload panel */
@media (max-height: 820px) and (min-width: 761px) {
  .panel { gap: 12px; padding-top: 16px; padding-bottom: 16px; }
  .dropzone { min-height: 150px; }
  .panel .sub { display: none; }   /* only the intro line under the heading (menu rows use the word "sub" too) */
}
@media (max-width: 760px) {
  body { display: block; }
}

/* demo model button on the empty home screen */
.empty .demo-btn { margin-top: 20px; pointer-events: auto; }
.lb-inner img { -webkit-touch-callout: default; -webkit-user-select: auto; user-select: auto; }   /* long-press "Save to Photos" on iPhone/iPad */

/* Lighting is the main tool in the toolbar: lamp-green, with its icon */
.chip.light-chip { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); border-color: rgba(7,182,114,.5); background: rgba(7,182,114,.1); font-weight: 500; }
.chip.light-chip:hover { border-color: var(--accent); color: var(--accent); background: rgba(7,182,114,.18); }
.chip.light-chip.on { background: var(--accent); color: #141415; border-color: var(--accent); }
.chip.light-chip .ic { margin: 0; color: currentColor; }

/* generation progress over the photo in the upload box */
.dz-progress { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 2; display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 10px; background: rgba(15,15,16,.86); border: 1px solid var(--line2); backdrop-filter: blur(6px); pointer-events: none; }
.dz-progress-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text); }
.dz-progress-row #dzPct { color: var(--accent); font-variant-numeric: tabular-nums; }
.dz-progress.failed { border-color: var(--err); }
.dz-progress.failed .bar i { background: var(--err); }

/* ---- upload rules popup (before the first model) ---- */
.terms-card { max-width: 520px; }
.terms-list { margin: 4px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.5; color: var(--text2); }
.terms-list b { color: var(--text); }
.terms-agree { margin-top: 14px; }
.terms-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.terms-card a { color: var(--accent-text); }

/* ---- perspective menu (1, 2, 3-point) ---- */
.persp-txt { display: flex; flex-direction: column; gap: 2px; }
.persp-txt b { font-weight: 500; }
.persp-txt small { font-size: 11.5px; color: var(--mute); }

/* ---- More menu: the download link looks like the other rows ---- */
a.mi { text-decoration: none; box-sizing: border-box; }

/* ---- lighting: computers get X / Y / Z, phones get two plain sliders and a short list ---- */
.light-simple { display: none; }
.light-more > summary { display: none; }
.light-more > * + * { margin-top: 8px; }
.light-more > .prow, .light-more > .toggle { display: flex; }
.tools-fold { display: none; }
@media (max-width: 760px) {
  .light-simple { display: flex; flex-direction: column; gap: 4px; }
  #lightPop .axes, #lightPop .desk-light { display: none; }
  .light-more > summary { display: block; padding: 8px 0; font-size: 13px; color: var(--mute); cursor: pointer; }
  #lightPop { max-height: 42svh; }
  #lightPop input[type=range] { height: 36px; }
  /* the toolbar folds away behind "Tools" */
  .tools-fold { display: inline-flex; align-items: center; gap: 4px; }
  .tools-fold .ic { transition: transform .15s ease-out; transform: rotate(180deg); }
  .toolbar.folded { left: auto; }
  .toolbar.folded > :not(.tools-fold) { display: none !important; }
  .toolbar.folded .tools-fold .ic { transform: none; }
}

/* ---- press and hold on the model view (iPad, iPhone) never selects or highlights it ---- */
.stage, .stage * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.stage input, .stage textarea { -webkit-user-select: text; user-select: text; }   /* number boxes can still be typed in */

/* ---- Choose your plan: centred heading, Yearly / Monthly tabs, two plan cards ---- */
#pricingModal .modal-card.wide { max-width: 720px; padding: 32px; }
.pr-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 24px; }
.pr-head h2 { font-size: 28px; margin: 0; }
.pr-bill { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.pr-toggle { display: inline-flex; padding: 4px; border: 1px solid var(--line2); border-radius: 12px; background: var(--bg3); }
.pr-toggle button { border: 0; background: transparent; color: var(--mute); font-size: 14px; font-weight: 500; padding: 8px 20px; border-radius: 8px; cursor: pointer; transition: background-color .15s ease-out, color .15s ease-out; }
.pr-toggle button.on { background: var(--accent); color: #0f0f10; font-weight: 600; }
.pr-toggle button { display: inline-flex; align-items: center; gap: 8px; }
.pr-save { color: var(--accent); font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: rgba(7,182,114,.14); white-space: nowrap; }
.pr-toggle button.on .pr-save { color: #0f0f10; background: rgba(0,0,0,.16); }
.pr-note { color: var(--mute); font-size: 12px; margin: 4px 0 0; min-height: 1em; }
#pricingModal .plans { gap: 16px; }
#pricingModal .pcard { padding: 24px; gap: 4px; border-radius: 16px; }
#pricingModal .pcard .pname { font-size: 20px; }
.pcard .pblurb { color: var(--mute); font-size: 13px; }
#pricingModal .pcard .pprice { font-size: 36px; margin-top: 12px; line-height: 1.1; }
.pcard .pbilled { color: var(--mute); font-size: 12px; }
.pcard .pallow { display: flex; flex-direction: column; gap: 2px; color: var(--mute); font-size: 13px; margin-top: 16px; padding: 16px 0; border-top: 1px solid var(--line2); border-bottom: 1px solid var(--line2); }
.pcard .pallow b { color: var(--text); font-size: 15px; }
.pcard .pticks { list-style: none; margin: 16px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--mute); flex: 1; }
.pcard .pticks li { display: flex; align-items: center; gap: 8px; }
.pcard .pticks .ic { width: 16px; height: 16px; color: var(--accent); flex: 0 0 auto; }
#pricingModal .pcard > button { margin-top: 8px; justify-content: center; border-radius: 99px; padding: 12px 16px; font-size: 14px; font-weight: 600; }
#pricingModal .pcard.pack { padding: 16px; gap: 4px; }
#pricingModal .pcard.pack .pname { font-size: 14px; }
#pricingModal .pcard.pack .pprice { font-size: 20px; margin-top: 0; }
#pricingModal .pcard.pack > button { padding: 8px 12px; }
@media (max-width: 760px) {
  #pricingModal .modal-card.wide { padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); }
  .pr-head h2 { font-size: 22px; }
  .pr-bill { gap: 12px; }
}
#pricingModal .modal-card.wide { max-height: calc(100svh - 32px); overflow-y: auto; }   /* with top-up packs showing it can be taller than a laptop screen */

/* ---- model view toolbar: More, reset, Lens, Lighting, light/dark. Everything else lives in the More menu ---- */
.mi.set { color: var(--accent); }
.mi.set .mi-ic { color: var(--accent); }
.mi[hidden] { display: none; }
@media (max-width: 760px) {
  /* phone: one row of buttons (Tools, More, reset, lighting, light/dark), the Lens slider on its own full row under it */
  .toolbar .light-chip .lbl { display: none; }
  .toolbar .chip.lens { order: 9; flex: 1 1 100%; }
  .toolbar .chip.lens input[type=range] { flex: 1; width: auto; }
}

/* ---- My reference book: upload and folder buttons, folders, the move button on each image ---- */
.book-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.book-bar .ghost { flex: 1; justify-content: center; }
.book-crumb { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.book-crumb b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hlist.folders { margin-bottom: 12px; }
.card.folder { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; color: var(--text); font: inherit; text-align: left; }
.card.folder:hover { border-color: var(--accent); }
.card.folder .ic { width: 20px; height: 20px; color: var(--accent); }
.card.folder .fname { font-size: 13px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.folder .fcount { font-size: 11px; color: var(--mute); }
.snaps .card .move { position: absolute; top: 5px; right: 34px; width: 24px; height: 24px; border-radius: 6px; background: rgba(0,0,0,.7); opacity: 0; }
.snaps .card .move .ic { width: 12px; height: 12px; }
@media (max-width: 760px) { .snaps .card .move { width: 28px; height: 28px; right: 38px; } }
.snaps .card:hover .move, .snaps .card .move:focus-visible { opacity: 1; }
@media (hover: none) { .snaps .card .move { opacity: 1; } }
.book-usage { margin-top: 16px; }
#moveList .mi { justify-content: flex-start; }
.refs-seg button { padding-left: 6px; padding-right: 6px; font-size: 12px; }   /* three tabs fit: 3D models, My reference book, Library */

/* ---- picture viewer: zoom, brightness and contrast (for looking only; the saved image is not changed) ---- */
.lb-stage { display: grid; place-items: center; max-width: 100%; border-radius: 10px; }
.lb-stage.zoomed { display: block; place-items: start; overflow: auto; cursor: grab; max-width: 100%; max-height: calc(100svh - 190px); touch-action: pan-x pan-y; }
.lb-stage.zoomed img { display: block; border-radius: 0; }
.lb-inner img { max-height: calc(100svh - 190px); }
.lb-tools { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--mute); font-size: 12px; }
.lb-tools label { display: inline-flex; align-items: center; gap: 8px; }
.lb-tools input[type=range] { width: 120px; accent-color: var(--accent); }
.lb-tools output { min-width: 40px; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .lb-tools { gap: 8px 12px; }
  .lb-tools label { flex: 1 1 100%; }
  .lb-tools input[type=range] { flex: 1; width: auto; height: 28px; }
  .lb-inner img, .lb-stage.zoomed { max-height: calc(100svh - 300px); }
}
.lb-stage { align-self: center; }
