/* VPNOIR Cloud — panel layout (loaded after app.css) */
:root { --side-w: 248px; --side-w-mini: 68px; --top-h: 60px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; transition: grid-template-columns .18s ease; }
.shell.mini { grid-template-columns: var(--side-w-mini) minmax(0, 1fr); }

.side-scrim { display: none; }

/* ---------- sidebar ---------- */
.side {
  position: sticky; top: 0; height: 100vh; height: 100dvh; z-index: 30;
  display: flex; flex-direction: column; border-right: 1px solid var(--line); background: rgba(6,6,6,.96);
  overflow: hidden;
}
.side-head { display: flex; align-items: center; gap: 8px; height: var(--top-h); padding: 0 12px 0 18px; border-bottom: 1px solid var(--line); flex: none; }
.side-head .wordmark { flex: 1; font-size: 13.5px; min-width: 0; overflow: hidden; }
.side-logo { display: none; width: 36px; height: 36px; border-radius: 10px; background: var(--fg); color: #000; place-items: center; flex: none; }
.side-logo svg { width: 20px; height: 20px; }
.side-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 10px 16px; scrollbar-width: thin; }
.side-group { margin-top: 14px; }
.side-group:first-child { margin-top: 2px; }
.side-group h4 { margin: 0 0 6px; padding: 0 10px; font: 700 10.5px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); white-space: nowrap; }
.side-link {
  position: relative; display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 10px; border-radius: 8px;
  color: var(--fg-2); font-weight: 600; font-size: 13.5px; white-space: nowrap;
}
.side-link:hover { background: var(--bg-2); color: var(--fg); }
.side-link.active { background: var(--fg); color: #000; }
.side-link .count { margin-left: auto; font: 11px var(--mono); color: var(--fg-3); }
.side-link.active .count { color: #555; }
.side-link .soon { margin-left: auto; font: 600 9.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-3); border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 4px; }
.side-storage { flex: none; padding: 14px 18px 16px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.ss-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ss-label { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-2); font-weight: 700; }
.ss-val { font-size: 11px; white-space: nowrap; }
.ss-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* collapsed (mini) sidebar */
.shell.mini .side-head { padding: 0; justify-content: center; flex-direction: column; height: auto; gap: 6px; padding: 12px 0 10px; }
.shell.mini .side-head .wordmark { display: none; }
.shell.mini .side-logo { display: grid; }
.shell.mini .side-group h4 { height: 1px; overflow: hidden; color: transparent; background: var(--line); margin: 8px 8px 10px; padding: 0; }
.shell.mini .side-link { justify-content: center; padding: 0; }
.shell.mini .side-link span, .shell.mini .side-link .count, .shell.mini .side-link .soon { display: none; }
.shell.mini .side-storage { padding: 12px 10px; }
.shell.mini .ss-row, .shell.mini .ss-sub { display: none; }
.shell.mini .side-toggle svg { transform: scaleX(-1); }

/* tooltips (collapsed sidebar + icon buttons) */
[data-tip] { position: relative; }
.shell.mini .side-link[data-tip]:hover::after, .top [data-tip]:hover::after {
  content: attr(data-tip); position: absolute; z-index: 100; white-space: nowrap; pointer-events: none;
  background: var(--fg); color: #000; font: 600 12px var(--sans); padding: 6px 9px; border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.shell.mini .side-link[data-tip]:hover::after { left: calc(100% + 12px); top: 50%; transform: translateY(-50%); }
.top [data-tip]:hover::after { top: calc(100% + 8px); left: 50%; transform: translateX(-50%); }
.shell.mini .side { overflow: visible; }
.shell.mini .side-nav { overflow: visible; }

/* ---------- top bar ---------- */
.main-area { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 25; height: var(--top-h);
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
  background: rgba(0,0,0,.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top-menu { display: none; }
.top-title { font-weight: 800; font-size: 15px; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.gsearch { position: relative; flex: 1; max-width: 560px; margin: 0 auto; }
.gsearch > svg { position: absolute; left: 12px; top: 10px; color: var(--fg-3); }
.gsearch input {
  width: 100%; height: 38px; padding: 0 56px 0 38px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--bg-1); outline: none;
}
.gsearch input:focus { border-color: var(--fg); background: #050505; }
.kbd { position: absolute; right: 7px; top: 7px; height: 24px; padding: 0 7px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--fg-2); font: 600 11px var(--mono); cursor: pointer; }
.kbd:hover { color: var(--fg); border-color: #555; }
.gs-drop {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60; max-height: 70vh; overflow: auto;
  background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,.75); padding: 6px;
}
.top-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.top-search-btn { display: none; }
.bell .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px #000; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--fg); color: #000;
  font: 800 13px var(--sans); cursor: pointer; display: grid; place-items: center; margin-left: 4px; flex: none;
}
.avatar:hover { box-shadow: 0 0 0 3px rgba(255,255,255,.15); }
.avatar.lg { width: 64px; height: 64px; font-size: 24px; cursor: default; }

/* ---------- result rows (search dropdown, command palette) ---------- */
.rrow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; min-width: 0; }
.rrow:hover, .rrow.sel { background: var(--bg-3); }
.rrow > svg { color: var(--fg-2); }
.rrow .rt { flex: 1; min-width: 0; }
.rrow .rt b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rrow .rt small { display: block; font: 11px var(--mono); color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rrow .hint { font: 11px var(--mono); color: var(--fg-3); }
.rhead { padding: 8px 10px 4px; font: 700 10.5px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); }
.rempty { padding: 14px 10px; color: var(--fg-3); font-size: 13px; }

/* command palette */
.palette { width: min(620px, 100%); padding: 0; gap: 0; align-self: start; margin-top: 10vh; }
.palette input { width: 100%; height: 54px; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 0 18px; font-size: 16px; outline: none; }
.palette .plist { max-height: 56vh; overflow: auto; padding: 6px; }
.palette .pfoot { display: flex; gap: 14px; padding: 9px 14px; border-top: 1px solid var(--line); font: 11px var(--mono); color: var(--fg-3); }

/* popovers (notifications, profile menu) */
.pop {
  position: fixed; z-index: 62; width: min(360px, calc(100vw - 16px)); max-height: 70vh; overflow: auto;
  background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,.75);
}
.pop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 700; position: sticky; top: 0; background: var(--bg-1); }
.notif { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.notif:last-child { border-bottom: 0; }
.notif:hover { background: var(--bg-2); }
.notif .nd { width: 8px; height: 8px; border-radius: 50%; background: transparent; margin-top: 6px; flex: none; }
.notif.unread .nd { background: var(--fg); }
.notif p { margin: 0; font-size: 13px; }
.notif small { font: 11px var(--mono); color: var(--fg-3); }
.pmenu-user { display: flex; gap: 12px; align-items: center; padding: 14px; border-bottom: 1px solid var(--line); }
.pmenu-user b { display: block; }
.pmenu-user small { color: var(--fg-3); font: 11px var(--mono); }

/* ---------- page ---------- */
.page { padding: 22px 24px 130px; flex: 1; min-width: 0; }
.ph { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.ph h1 { margin: 0; font-size: 22px; letter-spacing: -.01em; }
.ph .sub { color: var(--fg-3); font-size: 13px; }
.ph .tools { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumbs-row { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; margin: -6px 0 16px; min-width: 0; }
.crumbs-row a, .crumbs-row span { padding: 3px 7px; border-radius: 6px; font-weight: 600; font-size: 13px; color: var(--fg-2); white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.crumbs-row a:hover { background: var(--bg-2); color: var(--fg); }
.crumbs-row span.cur { color: var(--fg); }
.crumbs-row svg { width: 13px; height: 13px; color: var(--fg-3); }
.crumbs-row a.drop-target { background: var(--fg); color: #000; }

.selbar { position: sticky; top: calc(var(--top-h) + 8px); z-index: 20; margin: 10px 24px 0; }
.banner { margin: 14px 24px 0; }

/* ---------- cards & stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-1); padding: 14px 16px; display: grid; gap: 4px; }
.stat .k { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.stat .k svg { width: 14px; height: 14px; }
.stat .v { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.stat .s { font: 11px var(--mono); color: var(--fg-3); }
a.stat:hover { border-color: #444; background: var(--bg-2); }
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-1); padding: 16px; margin-bottom: 16px; min-width: 0; }
.box-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.box-h h2 { margin: 0; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.box-h a { margin-left: auto; font-size: 12px; color: var(--fg-2); }
.box-h a:hover { color: var(--fg); }
.hello { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.hello h1 { margin: 0; font-size: clamp(22px, 3vw, 30px); letter-spacing: -.02em; }
.hello p { margin: 4px 0 0; color: var(--fg-3); }
.quick { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* compact file strip (dashboard) */
.strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.mini-file { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg-2); cursor: pointer; min-width: 0; }
.mini-file:hover { border-color: #444; }
.mini-file .mt { aspect-ratio: 16/10; display: grid; place-items: center; background: var(--bg-3); color: var(--fg-2); overflow: hidden; }
.mini-file .mt img { width: 100%; height: 100%; object-fit: cover; }
.mini-file .mt svg { width: 30px; height: 30px; }
.mini-file .mn { padding: 8px 10px; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-file .ms { padding: 0 10px 8px; font: 10.5px var(--mono); color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* horizontal bars (storage by type) */
.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: 96px minmax(0, 1fr) 76px; gap: 10px; align-items: center; font-size: 13px; }
.hbar .lbl { display: flex; align-items: center; gap: 8px; color: var(--fg-2); text-transform: capitalize; }
.hbar .lbl svg { width: 15px; height: 15px; }
.hbar .trk { height: 8px; background: var(--bg-3); border-radius: 6px; overflow: hidden; }
.hbar .trk i { display: block; height: 100%; background: var(--fg); border-radius: 6px; min-width: 2px; }
.hbar .val { font: 11.5px var(--mono); text-align: right; color: var(--fg-2); white-space: nowrap; }
.stackbar { display: flex; height: 12px; border-radius: 8px; overflow: hidden; background: var(--bg-3); gap: 2px; }
.stackbar i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; font-size: 12px; color: var(--fg-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; text-transform: capitalize; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* column chart (uploads per month) */
.vbars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 8px; }
.vbar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.vbar i { width: 100%; max-width: 34px; background: var(--fg); border-radius: 4px 4px 0 0; min-height: 2px; }
.vbar small { font: 10px var(--mono); color: var(--fg-3); white-space: nowrap; }
.vbar:hover i { background: #fff; box-shadow: 0 0 12px rgba(255,255,255,.4); }

/* activity feed */
.feed { display: grid; }
.feed-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.feed-row:last-child { border-bottom: 0; }
.feed-ic { width: 30px; height: 30px; border-radius: 8px; background: var(--bg-3); display: grid; place-items: center; color: var(--fg-2); }
.feed-ic svg { width: 15px; height: 15px; }
.feed-ic.warn { color: var(--danger); }
.feed-row p { margin: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-row p b { font-weight: 600; }
.feed-row small { font: 11px var(--mono); color: var(--fg-3); white-space: nowrap; }
.feed-day { padding: 14px 2px 4px; font: 700 10.5px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); }

/* ---------- tags & favorites on items ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--fg); white-space: nowrap; cursor: pointer; }
.chip i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.chip.on { background: var(--fg); color: #000; border-color: var(--fg); }
.chip.big { height: 30px; padding: 0 12px; font-size: 12.5px; }
.chip .x { width: 14px; height: 14px; opacity: .6; }
.card .tagdots { display: flex; gap: 3px; margin-top: 4px; }
.card .tagdots i { width: 7px; height: 7px; border-radius: 50%; display: block; }
.favmark { color: var(--fg); }
.card .favmark { position: absolute; bottom: 8px; right: 8px; width: 15px; height: 15px; }
.card.folder .favmark { position: static; width: 14px; height: 14px; }
.row .name .favmark { width: 13px; height: 13px; vertical-align: -2px; margin-left: 6px; }
.row .name .chips { display: inline-flex; margin-left: 8px; vertical-align: 1px; }
.row .name .chip { height: 18px; font-size: 10.5px; padding: 0 6px; cursor: default; }

/* ---------- smart search page ---------- */
.search-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
.filters { position: sticky; top: calc(var(--top-h) + 16px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-1); padding: 14px; display: grid; gap: 16px; max-height: calc(100vh - var(--top-h) - 32px); overflow: auto; }
.filters h3 { margin: 0 0 8px; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); }
.filters .field input, .filters .field select { height: 34px; font-size: 13px; }
.filters .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.big-search { position: relative; margin-bottom: 14px; }
.big-search svg { position: absolute; left: 14px; top: 14px; color: var(--fg-3); }
.big-search input { width: 100%; height: 46px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-1); padding: 0 14px 0 42px; font-size: 15px; outline: none; }
.big-search input:focus { border-color: var(--fg); }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; align-items: center; }
.result-meta { color: var(--fg-3); font-size: 12.5px; margin: 0 0 12px; }
.hint-list { color: var(--fg-3); font-size: 12px; line-height: 1.8; }
.hint-list code { font-family: var(--mono); color: var(--fg-2); background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }

/* ---------- photos timeline ---------- */
.tl-group { margin-bottom: 22px; }
.tl-head { position: sticky; top: var(--top-h); z-index: 5; display: flex; align-items: baseline; gap: 10px; padding: 10px 0 8px; background: linear-gradient(#000 70%, transparent); }
.tl-head h2 { margin: 0; font-size: 15px; }
.tl-head small { color: var(--fg-3); font: 11px var(--mono); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; }
.ptile { position: relative; aspect-ratio: 1; background: var(--bg-2); overflow: hidden; cursor: pointer; border-radius: 4px; }
.ptile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.ptile:hover img { transform: scale(1.04); }
.ptile .pfav { position: absolute; top: 6px; right: 6px; width: 16px; height: 16px; color: #fff; filter: drop-shadow(0 1px 2px #000); }
.ptile .pcheck { position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.35); opacity: 0; display: grid; place-items: center; }
.ptile .pcheck svg { width: 13px; height: 13px; opacity: 0; }
.ptile:hover .pcheck, .has-selection .ptile .pcheck { opacity: 1; }
.ptile.selected { outline: 3px solid var(--fg); outline-offset: -3px; }
.ptile.selected .pcheck { background: #fff; color: #000; opacity: 1; }
.ptile.selected .pcheck svg { opacity: 1; }
.ptile .pdur { position: absolute; bottom: 6px; right: 6px; font: 600 11px var(--mono); background: rgba(0,0,0,.7); padding: 2px 6px; border-radius: 4px; }
.ptile .pplay { position: absolute; inset: 0; display: grid; place-items: center; }
.ptile .pplay svg { width: 34px; height: 34px; color: #fff; filter: drop-shadow(0 2px 6px #000); opacity: .9; }
.ptile .noth { width: 100%; height: 100%; display: grid; place-items: center; color: var(--fg-3); }
.ptile .noth svg { width: 32px; height: 32px; }
.phase-note { display: flex; gap: 10px; align-items: center; border: 1px dashed var(--line-2); border-radius: 10px; padding: 10px 12px; color: var(--fg-2); font-size: 12.5px; margin-bottom: 16px; }
.phase-note svg { flex: none; color: var(--fg-3); }

/* music list */
.tracks .row { grid-template-columns: 36px minmax(0, 1fr) 160px 70px 36px; }
.tracks .row .playbtn { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-3); }
.tracks .row .playbtn svg { width: 13px; height: 13px; }
.tracks .row.playing .playbtn { background: var(--fg); color: #000; }
.player {
  position: fixed; left: calc(var(--side-w) + 16px); right: 16px; bottom: 16px; z-index: 45;
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px;
  background: rgba(16,16,16,.96); border: 1px solid var(--line-2); box-shadow: 0 20px 60px rgba(0,0,0,.7);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.shell.mini .player { left: calc(var(--side-w-mini) + 16px); }
.player .pinfo { min-width: 0; flex: 0 1 260px; }
.player .pinfo b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.player .pinfo small { font: 11px var(--mono); color: var(--fg-3); }
.player audio { flex: 1; min-width: 0; height: 36px; }

/* ---------- placeholder ("coming soon") ---------- */
.soon-box { border: 1px dashed var(--line-2); border-radius: 16px; padding: 48px 24px; text-align: center; display: grid; justify-items: center; gap: 10px; color: var(--fg-2); max-width: 640px; margin: 20px auto; }
.soon-box svg { width: 44px; height: 44px; color: var(--fg-3); }
.soon-box h2 { margin: 0; color: var(--fg); }
.soon-box p { margin: 0; max-width: 460px; line-height: 1.6; }
.soon-box ul { text-align: left; color: var(--fg-2); font-size: 13px; line-height: 1.8; margin: 6px 0 0; }

/* ---------- details dialog ---------- */
.details-top { display: flex; gap: 14px; align-items: center; }
.details-top .dthumb { width: 72px; height: 72px; border-radius: 10px; background: var(--bg-3); display: grid; place-items: center; overflow: hidden; flex: none; color: var(--fg-2); }
.details-top .dthumb img { width: 100%; height: 100%; object-fit: cover; }
.details-top .dthumb svg { width: 32px; height: 32px; }
.details-top b { display: block; font-size: 15px; word-break: break-word; }
.tag-input { display: flex; gap: 8px; }
.tag-input input { flex: 1; height: 36px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg-1); padding: 0 10px; outline: none; }
.tag-input input:focus { border-color: var(--fg); }
.help-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13px; align-items: center; }
.help-grid kbd { font: 600 11px var(--mono); border: 1px solid var(--line-2); background: var(--bg-2); border-radius: 5px; padding: 2px 6px; white-space: nowrap; }
.tag-table .row { grid-template-columns: 26px minmax(0, 1fr) 80px 110px; }
.back-home { text-align: center; text-decoration: underline; text-underline-offset: 3px; }
.settings-grid { display: grid; gap: 0; max-width: 820px; }
.panel { max-width: 820px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .cols { grid-template-columns: 1fr; }
  .search-layout { grid-template-columns: 1fr; }
  .filters { position: static; max-height: none; }
  .filters.collapsed > :not(.filters-toggle) { display: none; }
}
@media (min-width: 1181px) { .filters-toggle { display: none !important; } }

@media (max-width: 900px) {
  .shell, .shell.mini { grid-template-columns: 1fr; }
  .side {
    position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); height: 100%;
    transform: translateX(-102%); transition: transform .2s ease; z-index: 70; box-shadow: 20px 0 60px rgba(0,0,0,.6);
  }
  .shell.drawer .side { transform: none; }
  .side-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 65; display: none; }
  .shell.drawer .side-scrim { display: block; }
  .side-toggle { display: none; }
  /* drawer always shows full labels */
  .shell.mini .side-head { flex-direction: row; padding: 0 12px 0 18px; height: var(--top-h); }
  .shell.mini .side-head .wordmark { display: inline-flex; }
  .shell.mini .side-logo { display: none; }
  .shell.mini .side-link { justify-content: flex-start; padding: 0 10px; }
  .shell.mini .side-link span, .shell.mini .side-link .count, .shell.mini .side-link .soon { display: inline; }
  .shell.mini .side-group h4 { height: auto; color: var(--fg-3); background: none; margin: 0 0 6px; padding: 0 10px; }
  .shell.mini .ss-row, .shell.mini .ss-sub { display: flex; }
  .shell.mini .side-link[data-tip]:hover::after { display: none; }
  .top { padding: 0 10px; gap: 6px; }
  .top-menu { display: inline-flex; }
  .gsearch { display: none; }
  .gsearch.open { display: block; position: fixed; left: 8px; right: 8px; top: 10px; max-width: none; z-index: 80; }
  .top-search-btn { display: inline-flex; }
  .top-title { flex: 1; }
  .hide-sm { display: none !important; }
  #uploadBtn span { display: none; }
  #uploadBtn { width: 36px; padding: 0; }
  .page { padding: 16px 14px calc(120px + var(--safe-b)); }
  .selbar { margin: 10px 14px 0; top: calc(var(--top-h) + 6px); }
  .selbar .btn span { display: none; }
  .banner { margin: 12px 14px 0; }
  .ph h1 { font-size: 19px; }
  .ph .tools .btn span { display: none; }
  .ph .tools .btn:not(.icon) { width: 36px; padding: 0; }
  .mnav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: rgba(0,0,0,.95); border-top: 1px solid var(--line); padding-bottom: var(--safe-b);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  }
  .mnav a, .mnav button { display: grid; justify-items: center; gap: 3px; padding: 9px 0 8px; color: var(--fg-3); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: none; border: 0; cursor: pointer; }
  .mnav a.active { color: var(--fg); }
  .mnav svg { width: 21px; height: 21px; }
  .uploads { bottom: calc(76px + var(--safe-b)); }
  .player { left: 8px; right: 8px; bottom: calc(70px + var(--safe-b)); flex-wrap: wrap; }
  .player .pinfo { flex: 1 1 100%; }
  .tracks .row { grid-template-columns: 36px minmax(0, 1fr) 36px; }
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 3px; }
  .hbar { grid-template-columns: 80px minmax(0, 1fr) 64px; }
  .tag-table .row { grid-template-columns: 26px minmax(0, 1fr) 80px; }
  .tag-table .row > :nth-child(3) { display: none; }
}
@media (min-width: 901px) { .mnav { display: none; } }

/* misc */
.pop .menu.inline { position: static; box-shadow: none; border: 0; background: transparent; min-width: 0; padding: 6px; display: block; }
.seg { display: inline-flex; gap: 4px; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg-2); cursor: pointer; }
.act-filters { margin-bottom: 14px; }
.center { display: flex; justify-content: center; padding-top: 12px; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.hbar:hover .lbl { color: var(--fg); }
.tag-table input[type=color] { width: 30px; height: 30px; padding: 0; border: 1px solid var(--line-2); border-radius: 6px; background: none; cursor: pointer; }
.quota-bar { height: 16px; }
.legend i { border: 1px solid var(--line-2); }
.share-row { grid-template-columns: 26px minmax(0, 1fr) 110px 110px 76px 76px; }
.hbar .lbl.mono { text-transform: none; }
@media (max-width: 900px) { .ph .tools .seg .btn { width: auto; padding: 0 10px; } }

/* accounts */
.accts { display: grid; gap: 10px; }
.acct { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 10px; background: var(--bg); }
.acct-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.acct-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--bg-3); display: grid; place-items: center; flex: none; }
.acct-t { flex: 1; min-width: 160px; }
.acct-t b { display: block; }
.acct-t small { color: var(--fg-3); font-size: 11.5px; }
.acct .row-actions { gap: 6px; }
.side-link.off { opacity: .55; }
.acct-bar .lbl { text-transform: none; }
.acct-bar .val { min-width: 0; }
@media (max-width: 900px) { .hbar.acct-bar { grid-template-columns: 90px minmax(0, 1fr) 110px; } }
.up-to { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--fg-3); font-weight: 600; white-space: nowrap; }
@media (max-width: 900px) { .up-to { font-size: 0; gap: 0; } .up-to .select { font-size: 13px; } }
.card .acct-line { display: flex; align-items: center; gap: 5px; color: var(--fg-2); }
.card .acct-line svg { width: 12px; height: 12px; flex: none; }

/* smart search filters: never wider than the panel */
.search-layout { grid-template-columns: 270px minmax(0, 1fr); }
.filters { overflow-x: hidden; }
.filters > * { min-width: 0; }
.filters .field { min-width: 0; }
.filters .field input, .filters .field select { width: 100%; min-width: 0; max-width: 100%; }
.filters .two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.filters input[type=date] { padding: 0 8px; font-size: 12.5px; }
.filters .presets .chip { max-width: 100%; }
.filters .chips { min-width: 0; }
@media (max-width: 1180px) { .search-layout { grid-template-columns: 1fr; } }
