:root {
  --bg: #0b0b0d; --panel: #141417; --panel2: #1c1c21; --line: #26262c; --line2: #33333b;
  --text: #f4f4f5; --mut: #8f8f99; --dim: #5d5d66;
  --acc: #ff5b2e; --acc-soft: rgba(255, 91, 46, .14); --ok: #36d399; --bad: #ff5d6c;
  --r: 14px; --r-sm: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--text); font: 500 14px/1.45 Manrope, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; }
svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.num { font-variant-numeric: tabular-nums; }
.mut { color: var(--mut); } .dim { color: var(--dim); }
.hide { display: none !important; }

/* ── boot / logo ── */
.boot { height: 100vh; display: grid; place-items: center; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--acc); position: relative; flex: none; }
.logo-mark::after { content: ''; position: absolute; left: 11px; top: 8px; border-left: 11px solid #fff; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.logo-mark.big { width: 48px; height: 48px; border-radius: 14px; animation: pulse 1.2s ease-in-out infinite; }
.logo-mark.big::after { left: 18px; top: 13px; border-left-width: 17px; border-top-width: 11px; border-bottom-width: 11px; }
@keyframes pulse { 50% { transform: scale(.92); opacity: .7; } }

/* ── shell ── */
.app { display: grid; grid-template-columns: 84px 1fr; min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding: 18px 0; gap: 6px; background: var(--bg); z-index: 20; }
.rail .logo-mark { margin-bottom: 18px; }
.nav { width: 64px; padding: 10px 0 8px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; gap: 5px; color: var(--mut); font-size: 11px; font-weight: 600; text-decoration: none; transition: .15s; }
.nav svg { width: 20px; height: 20px; }
.nav:hover { color: var(--text); background: var(--panel); }
.nav.on { color: var(--text); background: var(--panel2); }
.nav.on svg { color: var(--acc); }
.rail .grow { flex: 1; }
main { min-width: 0; padding: 26px 34px 60px; max-width: 1380px; width: 100%; }
.head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; min-height: 40px; flex-wrap: wrap; }
.head h1 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-right: auto; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { font-size: 12px; color: var(--mut); background: var(--panel); border: 1px solid var(--line); padding: 5px 10px; border-radius: 99px; white-space: nowrap; }
.pill b { color: var(--text); font-weight: 700; }

/* ── controls ── */
.btn { text-decoration: none; height: 40px; padding: 0 16px; border-radius: var(--r-sm); background: var(--panel2); border: 1px solid var(--line2); display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; white-space: nowrap; transition: .15s; }
.btn:hover { border-color: #4a4a54; }
.btn.pri { background: var(--acc); border-color: var(--acc); color: #fff; }
.btn.pri:hover { filter: brightness(1.08); }
.btn.ghost { background: none; border-color: transparent; color: var(--mut); }
.btn.ghost:hover { color: var(--text); background: var(--panel2); }
.btn.danger { color: var(--bad); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn.icon { width: 40px; padding: 0; }
.btn.sm.icon { width: 32px; }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.big { height: 54px; font-size: 16px; border-radius: 13px; }

.input, select.input, textarea.input { width: 100%; height: 40px; padding: 0 12px; background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--r-sm); outline: none; transition: border .15s; }
textarea.input { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--acc); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238f8f99' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 32px; }

.seg { display: flex; background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.seg button { flex: 1; height: 32px; border-radius: 7px; color: var(--mut); font-weight: 700; font-size: 13px; padding: 0 8px; white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: 6px; }
.seg button.on { background: var(--line2); color: var(--text); }
.seg button:hover:not(.on) { color: var(--text); }

.field { display: grid; gap: 8px; }
.field > label, .lbl { font-size: 12px; font-weight: 700; color: var(--mut); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.field > label output { color: var(--text); font-variant-numeric: tabular-nums; }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: none; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--acc) var(--p, 50%), var(--line2) var(--p, 50%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; margin-top: -7px; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--line2); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--acc); }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: #fff; }

.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; font-weight: 600; }
.toggle input { display: none; }
.toggle i { width: 38px; height: 22px; border-radius: 22px; background: var(--line2); position: relative; transition: .2s; flex: none; }
.toggle i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; }
.toggle input:checked + i { background: var(--acc); }
.toggle input:checked + i::after { transform: translateX(16px); }

.stepper { display: flex; align-items: center; background: var(--panel2); border: 1px solid var(--line2); border-radius: 13px; height: 54px; }
.stepper button { width: 54px; height: 100%; display: grid; place-items: center; color: var(--mut); }
.stepper button:hover { color: var(--text); }
.stepper input { flex: 1; min-width: 0; text-align: center; background: none; border: 0; outline: none; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper.sm { height: 40px; border-radius: var(--r-sm); width: 112px; }
.stepper.sm button { width: 34px; }
.stepper.sm input { font-size: 15px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }

/* ── create ── */
.create { display: grid; grid-template-columns: minmax(330px, 410px) 1fr; gap: 28px; align-items: start; }
.controls { display: grid; gap: 18px; position: sticky; top: 24px; }
.controls .card { padding: 18px; display: grid; gap: 18px; }
.hint { font-size: 12px; color: var(--mut); text-align: center; }
.chooser { display: flex; gap: 6px; }
.chooser .seg { flex: 1; }
.chosen { display: flex; align-items: center; gap: 10px; background: var(--acc-soft); border: 1px solid rgba(255,91,46,.35); border-radius: var(--r-sm); padding: 0 6px 0 12px; height: 40px; font-weight: 700; }
.chosen span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.go-row { display: flex; gap: 10px; align-items: stretch; }
.go-row .btn.pri { flex: 1; }
.batch { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.batch .lbl { font-size: 10px; }

.tune-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; font-weight: 700; color: var(--mut); padding: 2px 0; }
.tune-toggle:hover { color: var(--text); }
.tune-toggle svg { transition: .2s; }
.tune-open .tune-toggle svg { transform: rotate(180deg); }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 0 4px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { height: 30px; padding: 0 11px; border-radius: 99px; font-size: 12px; font-weight: 700; color: var(--mut); white-space: nowrap; border: 1px solid transparent; }
.tabs button.on { color: var(--text); border-color: var(--line2); background: var(--panel2); }
.tune-body { display: grid; gap: 16px; }
.tune-foot { display: flex; gap: 6px; border-top: 1px solid var(--line); padding-top: 14px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line2); color: var(--mut); font-size: 12px; font-weight: 700; }
.chips button.on { border-color: var(--acc); color: var(--text); background: var(--acc-soft); }
.logo-pick { display: flex; align-items: center; gap: 10px; }
.logo-pick img { height: 40px; max-width: 90px; object-fit: contain; background: var(--panel2); border-radius: 8px; padding: 4px; }

.stage { display: grid; gap: 16px; justify-items: center; }
.frame { position: relative; background: #000; border-radius: 22px; overflow: hidden; width: 100%; max-width: min(100%, calc(72vh * var(--ar))); aspect-ratio: var(--ar); box-shadow: 0 0 0 1px var(--line), 0 30px 80px -30px rgba(0,0,0,.8); }
.frame > canvas, .frame > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--dim); padding: 24px; background: radial-gradient(ellipse at 50% 30%, #1a1a1f, #0b0b0d 70%); }
.empty svg { width: 34px; height: 34px; margin-bottom: 10px; stroke-width: 1.5; }
.empty b { display: block; color: var(--mut); font-size: 15px; margin-bottom: 4px; }
.progress { position: absolute; left: 14px; right: 14px; bottom: 14px; background: rgba(11,11,13,.82); backdrop-filter: blur(10px); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; }
.progress .row { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; }
.bar { height: 4px; background: var(--line2); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--acc); width: 0; transition: width .2s; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.caption { width: 100%; max-width: 520px; display: grid; gap: 8px; }
.caption .lbl button { color: var(--mut); font-size: 12px; font-weight: 700; display: flex; gap: 5px; align-items: center; }
.caption .lbl button:hover { color: var(--text); }
.batchlist { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.batchlist button { height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line2); font-size: 12px; font-weight: 700; color: var(--mut); display: flex; gap: 6px; align-items: center; }
.batchlist button.on { color: var(--text); border-color: var(--acc); }

.picks { width: 100%; display: grid; gap: 10px; }
.picks .lbl { justify-content: flex-start; gap: 12px; }
.strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.tile { position: relative; flex: none; width: 66px; height: 88px; border-radius: 10px; overflow: hidden; background: var(--panel2); border: 1px solid var(--line); }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile.wide { width: 124px; }
.tile .tag { position: absolute; left: 5px; top: 5px; font-size: 9px; font-weight: 800; letter-spacing: .04em; background: rgba(0,0,0,.65); padding: 2px 5px; border-radius: 4px; text-transform: uppercase; }
.tile.song { display: flex; flex-direction: column; justify-content: flex-end; padding: 8px; font-size: 11px; font-weight: 700; background: linear-gradient(160deg, #2a1a14, var(--panel2)); }
.tile.song span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tile .ops { position: absolute; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; gap: 4px; opacity: 0; transition: .15s; }
.tile:hover .ops { opacity: 1; }
.tile .ops button { width: 26px; height: 26px; border-radius: 7px; background: rgba(255,255,255,.14); display: grid; place-items: center; }
.tile .ops button:hover { background: var(--acc); }
.tile .ops svg { width: 14px; height: 14px; }
.tile.manual { border-color: var(--acc); }
.tile.add { display: grid; place-items: center; color: var(--mut); border-style: dashed; border-color: var(--line2); }
.tile.add:hover { color: var(--text); border-color: var(--mut); }

/* ── library ── */
.ltabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.ltabs button { padding: 0 0 12px; color: var(--mut); font-weight: 700; font-size: 15px; border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; gap: 7px; align-items: baseline; }
.ltabs button small { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.ltabs button.on { color: var(--text); border-color: var(--acc); }
.pool { display: flex; align-items: center; gap: 16px; padding: 14px 16px; margin-bottom: 16px; flex-wrap: wrap; }
.pool .bar { flex: 1; min-width: 120px; height: 6px; }
.pool .txt { font-weight: 700; }
.toolbar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.toolbar .seg { flex: none; }
.toolbar .input { width: auto; min-width: 140px; }
.toolbar .sp { flex: 1; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
.grid.songs { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.item { position: relative; aspect-ratio: 3/4; border-radius: 10px; overflow: hidden; background: var(--panel); cursor: pointer; border: 2px solid transparent; }
.item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.item:hover img { transform: scale(1.04); }
.item.clip { aspect-ratio: 16/10; }
.item .badge { position: absolute; right: 6px; bottom: 6px; font-size: 11px; font-weight: 800; background: rgba(0,0,0,.7); padding: 2px 6px; border-radius: 5px; }
.item .used { position: absolute; left: 6px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--dim); box-shadow: 0 0 0 2px rgba(0,0,0,.5); }
.item .used.fresh { background: var(--ok); }
.item .check { position: absolute; right: 6px; top: 6px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.3); display: none; }
.selecting .item .check { display: block; }
.item.sel { border-color: var(--acc); }
.item.sel .check { background: var(--acc); border-color: var(--acc); }
.item.sel .check::after { content: ''; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.item.song { aspect-ratio: auto; display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--panel); border: 1px solid var(--line); }
.item.song .ic { width: 42px; height: 42px; border-radius: 10px; background: var(--acc-soft); color: var(--acc); display: grid; place-items: center; flex: none; }
.item.song .nm { flex: 1; min-width: 0; }
.item.song .nm b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item.song .nm small { color: var(--mut); }
.item.song .used, .item.song .check { top: 50%; transform: translateY(-50%); }
.item.song .used { position: static; transform: none; flex: none; }
.item.song.sel { border-color: var(--acc); }
.item.song.sel .check::after { transform: rotate(45deg); }
.blank { text-align: center; padding: 70px 20px; color: var(--mut); border: 1px dashed var(--line2); border-radius: var(--r); }
.blank svg { width: 32px; height: 32px; stroke-width: 1.5; margin-bottom: 10px; color: var(--dim); }
.blank b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.blank .btn { margin-top: 16px; }
.sentinel { height: 40px; }
.selbar { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 18px; border-radius: 14px; background: var(--panel2); border: 1px solid var(--line2); box-shadow: 0 20px 50px rgba(0,0,0,.6); z-index: 30; }
.selbar b { margin-right: 8px; white-space: nowrap; }
.drop { position: fixed; inset: 0; background: rgba(11,11,13,.85); border: 2px dashed var(--acc); z-index: 60; display: grid; place-items: center; font-size: 20px; font-weight: 800; pointer-events: none; }

/* ── uploads widget ── */
.upw { position: fixed; right: 20px; bottom: 20px; width: 300px; padding: 14px 16px; display: grid; gap: 8px; z-index: 40; box-shadow: 0 20px 50px rgba(0,0,0,.6); }
.upw .row { display: flex; justify-content: space-between; align-items: center; font-weight: 700; gap: 8px; }
.upw small { color: var(--mut); }

/* ── history ── */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.vcard { cursor: pointer; display: grid; gap: 8px; }
.vcard .th { position: relative; aspect-ratio: 9/16; border-radius: 12px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); }
.vcard .th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vcard .th .badge { position: absolute; right: 7px; bottom: 7px; font-size: 11px; font-weight: 800; background: rgba(0,0,0,.7); padding: 2px 6px; border-radius: 5px; }
.vcard .th .fb { position: absolute; left: 7px; top: 7px; font-size: 10px; font-weight: 800; background: #1877f2; padding: 2px 6px; border-radius: 5px; }
.vcard .th .nofile { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); font-size: 12px; text-align: center; padding: 10px; }
.vcard .meta { font-size: 12px; color: var(--mut); display: flex; justify-content: space-between; }
.vcard:hover .th { border-color: var(--line2); }

/* ── settings ── */
.sgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.sgrid .card { padding: 20px; display: grid; gap: 16px; }
.sgrid h3 { font-size: 15px; font-weight: 800; }
.plist { display: grid; gap: 6px; }
.prow { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 12px; background: var(--panel2); border-radius: var(--r-sm); }
.prow span { flex: 1; font-weight: 700; }
.status { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.status.on i { background: var(--ok); box-shadow: 0 0 0 4px rgba(54,211,153,.15); }
.note { font-size: 12px; color: var(--mut); line-height: 1.55; }
.note code { background: var(--panel2); padding: 1px 5px; border-radius: 4px; font-size: 11px; }

/* ── modal ── */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(4px); z-index: 50; display: grid; place-items: center; padding: 20px; animation: fade .15s; }
.modal { background: var(--panel); border: 1px solid var(--line2); border-radius: 18px; width: 100%; max-width: 440px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; overflow: hidden; animation: up .2s; }
.modal.wide { max-width: 880px; }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 16px 20px; border-bottom: 1px solid var(--line); gap: 10px; }
.modal-h h3 { font-size: 16px; font-weight: 800; }
.modal-b { padding: 20px; overflow: auto; display: grid; gap: 16px; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.viewer { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start; }
.viewer video, .viewer img.big { max-height: 62vh; max-width: 100%; border-radius: 12px; background: #000; display: block; }
.kv { display: grid; gap: 10px; font-size: 13px; }
.kv div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.kv span { color: var(--mut); }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(12px); opacity: 0; } }

/* ── toasts ── */
#toasts { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: var(--panel2); border: 1px solid var(--line2); padding: 10px 16px; border-radius: 12px; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: up .2s; display: flex; gap: 8px; align-items: center; max-width: 90vw; }
.toast.bad { border-color: var(--bad); }
.toast.good svg { color: var(--ok); }

/* ── auth ── */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(ellipse at 50% 0%, #22140f, var(--bg) 60%); }
.auth .card { width: 100%; max-width: 380px; padding: 30px; display: grid; gap: 16px; }
.auth h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; display: flex; gap: 12px; align-items: center; margin-bottom: 6px; }
.auth .err { color: var(--bad); font-size: 13px; min-height: 18px; }
.auth ol { padding-left: 18px; display: grid; gap: 8px; color: var(--mut); font-size: 13px; }

.spin { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ── responsive ── */
@media (max-width: 1020px) {
  .create { grid-template-columns: 1fr; }
  .create.has-out .stage { order: -1; }
  .controls { position: static; }
  .viewer { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; justify-content: space-around; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); }
  .rail .logo-mark, .rail .grow { display: none; }
  .nav { flex: 1; }
  main { padding: 18px 16px 100px; }
  .frame { max-width: min(100%, calc(62vh * var(--ar))); }
  .upw { left: 16px; right: 16px; width: auto; bottom: 84px; }
  .selbar { bottom: 84px; }
  .toolbar .input { flex: 1; }
  .hide-m { display: none; }
  .head h1 { font-size: 20px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .vgrid { grid-template-columns: repeat(2, 1fr); }
  .sgrid { grid-template-columns: 1fr; }
}
