/* ═══════════════════════════════════════════════════════════════
   Gallery by Vayunex Labs
   Same plum-and-violet system as the Utility suite, with one twist:
   the gallery floor and the lightbox go dark, so pictures carry
   themselves instead of fighting a bright page.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --ink: #241238;
  --ink-soft: #3A2555;
  --plum-950: #170B28;
  --plum-900: #1E1030;
  --violet: #7C3AED;
  --violet-deep: #5B21B6;
  --orchid: #A855F7;
  --wing: #CBB7EF;
  --line: #E6DDF5;
  --mist: #F7F4FC;
  --card: #FFFFFF;
  --muted: #6E5C8A;

  --ok: #147D5B;   --ok-bg: #E7F6EF;   --ok-line: #B5E2CE;
  --warn: #9A5B07; --warn-bg: #FBF1DC; --warn-line: #EBD5A8;
  --bad: #B42318;  --bad-bg: #FCECEA;  --bad-line: #F2C3BE;

  --grad: linear-gradient(90deg, var(--violet-deep), var(--violet) 45%, var(--orchid));
  --shadow-1: 0 1px 2px rgba(36,18,56,.06), 0 8px 24px -12px rgba(91,33,182,.18);
  --shadow-2: 0 2px 6px rgba(36,18,56,.08), 0 24px 48px -20px rgba(91,33,182,.3);

  --font-display: "Bricolage Grotesque", "Segoe UI", sans-serif;
  --font-ui: "Instrument Sans", "Segoe UI", sans-serif;
  --font-mono: "Spline Sans Mono", Consolas, monospace;

  --r-lg: 22px; --r-md: 14px; --r-sm: 9px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 15px; line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 85% -160px, rgba(168,85,247,.10), transparent 60%),
    var(--mist);
  min-height: 100vh;
  display: flex; flex-direction: column;
}
main { flex: 1; padding-bottom: 90px; }

a { color: var(--violet-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 2.5px solid var(--violet); outline-offset: 2px; border-radius: 5px; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 22px; }
.wrap-wide { max-width: 1560px; }
.wrap-narrow { max-width: 760px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

svg.i { width: 17px; height: 17px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ═══════════════ nav ═══════════════ */

.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(247,244,252,.86);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); flex: none; }
.brand:hover { text-decoration: none; }
.brand svg { width: 30px; height: 30px; }
.brand-word { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.brand-word small {
  display: block; font-family: var(--font-ui); font-weight: 600; font-size: 10px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--violet); margin-top: -2px;
}
.nav-search { position: relative; flex: 1; max-width: 420px; margin-left: 12px; }
.nav-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.nav-search input {
  width: 100%; height: 38px; padding: 0 14px 0 34px;
  border: 1px solid var(--line); border-radius: 99px; background: #fff;
  font: inherit; font-size: 13.5px; color: var(--ink);
}
.nav-search input::placeholder { color: #9B8AB5; }
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav-links a { padding: 7px 14px; border-radius: 99px; font-weight: 600; font-size: 13.5px; color: var(--ink-soft); }
.nav-links a:hover { background: #EEE7FA; text-decoration: none; }
.nav-links a.active { background: var(--ink); color: #fff; }
.signout { margin: 0; }
.signout button {
  background: none; border: 0; padding: 7px 14px; border-radius: 99px;
  font: inherit; font-size: 13.5px; font-weight: 500; color: var(--muted); cursor: pointer;
}
.signout button:hover { background: #EEE7FA; color: var(--ink-soft); }

.strip {
  background: var(--warn-bg); border-bottom: 1px solid var(--warn-line);
  color: #6B3F05; font-size: 13px; padding: 9px 0;
}
.strip code { font-family: var(--font-mono); font-size: 12px; background: rgba(0,0,0,.05);
  padding: 1px 5px; border-radius: 4px; }
.strip a { color: #6B3F05; text-decoration: underline; }

/* ═══════════════ headings, buttons, fields ═══════════════ */

.page-head {
  display: flex; align-items: flex-end; gap: 26px; flex-wrap: wrap;
  padding: 30px 0 20px;
}
.page-head h1 {
  font-family: var(--font-display); font-size: clamp(28px, 3.4vw, 38px);
  line-height: 1.1; letter-spacing: -.025em; margin: 0 0 6px; font-weight: 700;
}
.lede { margin: 0; color: var(--muted); max-width: 62ch; font-size: 14.5px; }
.page-head-side { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; }

.tally {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 4px 14px 4px 0; border-right: 1px solid var(--line); margin-right: 4px;
}
.tally b { font-family: var(--font-display); font-size: 22px; line-height: 1; }
.tally span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }

.section-title {
  font-family: var(--font-display); font-size: 13px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 14px;
}

.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13px;
  color: var(--muted); padding-top: 22px; }
.crumbs a { color: var(--muted); }
.crumbs b { color: var(--ink); font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 99px;
  border: 1px solid transparent; background: none;
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink);
  cursor: pointer; white-space: nowrap; transition: .14s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--ink); color: #fff; box-shadow: var(--shadow-1); }
.btn-primary:hover { background: var(--violet-deep); transform: translateY(-1px); }
.btn-quiet { background: #fff; border-color: var(--line); color: var(--ink-soft); }
.btn-quiet:hover { border-color: var(--wing); background: #FBF9FE; }
.btn-quiet[disabled] { opacity: .45; cursor: not-allowed; }
.btn-sheet { background: #F1E9FE; color: var(--violet-deep); border-color: #E0CFFA; }
.btn-sheet:hover { background: #E9DCFD; }
.btn-icon { width: 38px; padding: 0; }
.btn-wide { width: 100%; height: 44px; margin-top: 8px; }
.linky { background: none; border: 0; padding: 0; font: inherit; font-weight: 600;
  color: var(--violet-deep); cursor: pointer; text-decoration: underline; }

.field { display: block; margin-bottom: 18px; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.field input, .field select {
  width: 100%; height: 42px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: #fff; font: inherit; font-size: 14.5px; color: var(--ink);
}
.field input:focus { border-color: var(--violet); outline: none; box-shadow: 0 0 0 3px rgba(124,58,237,.14); }
.field small { display: block; margin-top: 7px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.withunit { display: flex; align-items: center; gap: 10px; }
.withunit input { max-width: 120px; }
.withunit i { font-style: normal; color: var(--muted); font-size: 13px; }

.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 26px; box-shadow: var(--shadow-1);
  margin-bottom: 22px;
}
.panel-quiet { box-shadow: none; background: #FCFAFE; }
.panel-foot { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 4px; }

.note { border-radius: var(--r-md); padding: 13px 16px; font-size: 13.5px;
  line-height: 1.55; margin-bottom: 18px; }
.note code { font-family: var(--font-mono); font-size: 12.5px; }
.note.ok { background: var(--ok-bg); border: 1px solid var(--ok-line); color: #0C5C42; }
.note.warn { background: var(--warn-bg); border: 1px solid var(--warn-line); color: #6B3F05; }
.note.bad { background: var(--bad-bg); border: 1px solid var(--bad-line); color: var(--bad); }

.deflist { margin: 0; }
.deflist dt { font-weight: 600; margin-top: 12px; }
.deflist dt code { font-family: var(--font-mono); font-size: 12.5px; background: #F1E9FE;
  padding: 2px 7px; border-radius: 5px; color: var(--violet-deep); }
.deflist dd { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.fineprint { color: var(--muted); font-size: 12.5px; }
.cmd { font-family: var(--font-mono); font-size: 13px; background: var(--plum-950);
  color: #E9DEFB; padding: 12px 15px; border-radius: var(--r-sm); overflow-x: auto; }

/* ═══════════════ login ═══════════════ */

body.gate { justify-content: center; }
body.gate main { display: grid; place-items: center; padding: 40px 20px 90px; }
.gate-panel { width: 100%; max-width: 380px; }
.gate-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 34px 30px 30px; box-shadow: var(--shadow-2); text-align: center;
}
.gate-mark svg { width: 46px; height: 46px; }
.gate-card h1 { font-family: var(--font-display); font-size: 26px; margin: 12px 0 4px; letter-spacing: -.02em; }
.gate-sub { color: var(--muted); font-size: 13px; margin: 0 0 24px; }
.gate-card .field { text-align: left; }
.gate-error { background: var(--bad-bg); border: 1px solid var(--bad-line); color: var(--bad);
  border-radius: var(--r-sm); padding: 10px 13px; font-size: 13px; margin-bottom: 18px; }
.gate-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }

/* ═══════════════ folder shelf ═══════════════ */

.newfolder {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px; margin-bottom: 22px; box-shadow: var(--shadow-1);
}
.newfolder input {
  height: 40px; padding: 0 13px; border: 1px solid var(--line);
  border-radius: var(--r-sm); font: inherit; font-size: 14px; color: var(--ink);
}
.newfolder input[name="name"] { flex: 1 1 240px; }
.newfolder input[name="note"] { flex: 1 1 200px; }

.shelf { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); }
.fcard {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; color: var(--ink);
  box-shadow: var(--shadow-1); transition: .16s ease;
}
.fcard:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--wing); }
.fcard-art {
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px;
  height: 150px; background: var(--plum-900); position: relative;
}
.fcard-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fcard-art img:only-child { grid-column: span 2; grid-row: span 2; }
.fcard-art img:first-child:nth-last-child(2),
.fcard-art img:first-child:nth-last-child(2) ~ img { grid-row: span 2; }
.fcard-art img:first-child:nth-last-child(3) { grid-row: span 2; }
.fcard-art::after {
  content: attr(data-count); position: absolute; right: 9px; bottom: 9px;
  background: rgba(23,11,40,.78); color: #EFE6FD; font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 99px; backdrop-filter: blur(6px);
}
.fcard-empty { grid-column: span 2; display: grid; place-items: center; }
.fcard-empty svg { width: 40px; height: 40px; fill: none; stroke: #4B2E73; stroke-width: 1.4; }
.fcard-body { padding: 14px 16px 16px; }
.fcard-body h2 { font-family: var(--font-display); font-size: 17px; margin: 0; letter-spacing: -.01em; }
.fcard-note { margin: 4px 0 0; font-size: 12.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcard-meta { margin: 8px 0 0; font-size: 11.5px; color: var(--violet); font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; }

.recent { margin-top: 46px; }
.recent-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.recent-tile { flex: none; width: 118px; }
.recent-tile img { width: 118px; height: 88px; object-fit: cover; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--plum-900); display: block; }
.recent-tile span { display: block; font-size: 11px; color: var(--muted); margin-top: 5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-tile:hover { text-decoration: none; }

.blank {
  text-align: center; padding: 64px 20px; border: 1.5px dashed var(--wing);
  border-radius: var(--r-lg); background: rgba(255,255,255,.5);
}
.blank svg { width: 44px; height: 44px; fill: none; stroke: var(--orchid); stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round; }
.blank h2 { font-family: var(--font-display); font-size: 21px; margin: 14px 0 6px; }
.blank p { color: var(--muted); margin: 0 0 18px; }

/* ═══════════════ toolbar ═══════════════ */

.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filter { position: relative; }
.filter svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.filter input {
  height: 36px; width: 210px; padding: 0 13px 0 32px;
  border: 1px solid var(--line); border-radius: 99px; background: #fff;
  font: inherit; font-size: 13px; color: var(--ink);
}
.sorts { display: flex; gap: 2px; background: #fff; border: 1px solid var(--line);
  border-radius: 99px; padding: 3px; }
.sorts a { padding: 5px 13px; border-radius: 99px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.sorts a:hover { background: #F4EFFC; text-decoration: none; }
.sorts a.on { background: var(--ink); color: #fff; }
.toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.zoomer input[type=range] { width: 110px; accent-color: var(--violet); }

.menu { position: relative; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-2); padding: 6px; min-width: 210px;
}
.menu-pop button, .menu-pop a {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  padding: 9px 12px; border-radius: var(--r-sm); font: inherit; font-size: 13.5px;
  color: var(--ink-soft); cursor: pointer;
}
.menu-pop button:hover, .menu-pop a:hover { background: #F4EFFC; text-decoration: none; }
.menu-pop .danger { color: var(--bad); }
.menu-pop .danger:hover { background: var(--bad-bg); }

/* ═══════════════ the floor — dark, so pictures pop ═══════════════ */

.floor {
  position: relative; border-radius: var(--r-lg); padding: 18px;
  background:
    radial-gradient(700px 300px at 20% -60px, rgba(124,58,237,.22), transparent 65%),
    var(--plum-950);
  border: 1px solid #2E1A4A; min-height: 240px;
}
.floor.dragging .dropveil { opacity: 1; pointer-events: auto; }
.dropveil {
  position: absolute; inset: 6px; border-radius: var(--r-lg);
  border: 2px dashed var(--orchid); background: rgba(23,11,40,.86);
  display: grid; place-items: center; opacity: 0; pointer-events: none;
  transition: opacity .12s ease; z-index: 20;
}
.dropveil span { font-family: var(--font-display); font-size: 20px; color: #F1E7FF; }

.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(var(--tile), 1fr)); }

.tile {
  position: relative; margin: 0; border-radius: var(--r-md); overflow: hidden;
  background: #241238; border: 1px solid #352054; transition: .14s ease;
}
.tile:hover { border-color: var(--orchid); transform: translateY(-2px); }
.tile.on { border-color: var(--orchid); box-shadow: 0 0 0 2px rgba(168,85,247,.55); }
.tile.flash { animation: flash .5s ease; }
@keyframes flash { 0%,100% { box-shadow: none; } 30% { box-shadow: 0 0 0 3px rgba(168,85,247,.85); } }
.tile.fresh { animation: pop .35s ease; }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }

.tile-shot {
  display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; cursor: zoom-in;
  background:
    conic-gradient(from 90deg at 1px 1px, #00000000 25%, #ffffff08 0) 0 0/14px 14px,
    #1B0E2E;
}
.tile-shot img { width: 100%; height: 100%; object-fit: contain; display: block; }

.tile-foot {
  display: flex; align-items: center; gap: 6px; padding: 7px 8px 8px;
  background: #241238; border-top: 1px solid #352054;
}
.tile-name {
  flex: 1; min-width: 0; font-size: 11.5px; color: #CDBBE8;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--font-mono);
}
.tile-copy {
  flex: none; width: 27px; height: 27px; display: grid; place-items: center;
  border-radius: 7px; border: 1px solid #462C6E; background: #311C50;
  color: #D9C8F2; cursor: pointer; transition: .12s ease;
}
.tile-copy:hover { background: var(--violet); border-color: var(--orchid); color: #fff; }
.tile-copy.done { background: var(--ok); border-color: var(--ok); color: #fff; }

.tile-dims {
  position: absolute; left: 8px; bottom: 42px;
  background: rgba(23,11,40,.8); color: #D7C7EF; font-family: var(--font-mono);
  font-size: 10px; padding: 2px 7px; border-radius: 99px;
  opacity: 0; transition: opacity .12s ease; pointer-events: none;
}
.tile:hover .tile-dims { opacity: 1; }

.tile-where {
  position: absolute; left: 8px; top: 8px; background: rgba(23,11,40,.82);
  color: #D7C7EF; font-size: 10.5px; font-weight: 600; padding: 3px 9px;
  border-radius: 99px; backdrop-filter: blur(6px);
}
.tile-where:hover { background: var(--violet); color: #fff; text-decoration: none; }

.tile-pick { position: absolute; right: 8px; top: 8px; z-index: 5; cursor: pointer; }
.tile-pick input { position: absolute; opacity: 0; width: 0; height: 0; }
.tile-pick span {
  display: block; width: 21px; height: 21px; border-radius: 6px;
  border: 1.5px solid rgba(233,222,251,.6); background: rgba(23,11,40,.62);
  backdrop-filter: blur(4px); transition: .12s ease;
}
.tile-pick span::after {
  content: ""; position: absolute; left: 6.5px; top: 4px; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(42deg) scale(0);
  transition: transform .12s ease;
}
.tile:hover .tile-pick span { border-color: #fff; }
.tile-pick input:checked + span { background: var(--violet); border-color: var(--orchid); }
.tile-pick input:checked + span::after { transform: rotate(42deg) scale(1); }
.tile-pick input:focus-visible + span { outline: 2.5px solid var(--orchid); outline-offset: 2px; }

.dropnote { text-align: center; padding: 40px 20px 26px; color: #A38FC4; }
.dropnote[data-quiet] { padding: 22px 20px 8px; opacity: .55; }
.dropnote[data-quiet] svg, .dropnote[data-quiet] small { display: none; }
.dropnote svg { width: 34px; height: 34px; fill: none; stroke: var(--orchid);
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.dropnote p { margin: 10px 0 4px; font-size: 14px; color: #D3C3ED; }
.dropnote small { font-size: 11.5px; color: #8C77AE; font-family: var(--font-mono); }
.dropnote .linky { color: var(--orchid); }

/* ═══════════════ upload tray ═══════════════ */

.tray {
  position: fixed; right: 20px; bottom: 20px; z-index: 60; width: 330px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-2); overflow: hidden;
}
.tray-head { display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; font-size: 13.5px; }
.tray-bar { height: 3px; background: #EFE7FB; }
.tray-bar i { display: block; height: 100%; width: 0; background: var(--grad); transition: width .2s ease; }
.tray-list { list-style: none; margin: 0; padding: 6px 0; max-height: 190px; overflow-y: auto; }
.tray-list li { display: flex; gap: 8px; align-items: center; padding: 5px 14px;
  font-size: 12px; color: var(--muted); }
.tray-list li span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--font-mono); }
.tray-list li.bad { color: var(--bad); }
.tray-list li.good b { color: var(--ok); }

/* ═══════════════ selection bar ═══════════════ */

.selbar { position: fixed; left: 0; right: 0; bottom: 18px; z-index: 55; display: grid; place-items: center;
  pointer-events: none; }
.selbar-inner {
  pointer-events: auto; display: flex; gap: 6px; align-items: center;
  background: var(--ink); color: #fff; border-radius: 99px;
  padding: 7px 8px 7px 20px; box-shadow: 0 18px 40px -14px rgba(36,18,56,.7);
  animation: rise .18s ease;
}
@keyframes rise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.selbar-inner > b { font-size: 13px; margin-right: 8px; white-space: nowrap; }
.sb {
  background: rgba(255,255,255,.11); border: 0; color: #fff; border-radius: 99px;
  padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.sb:hover { background: rgba(255,255,255,.22); }
.sb.danger:hover { background: #C1362B; }
.sb.quiet { background: none; color: #BCA7DC; }
.sb-move { position: relative; }
.sb-pop {
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow-2);
  padding: 6px; min-width: 190px; max-height: 260px; overflow-y: auto;
}
.sb-pop button { display: block; width: 100%; text-align: left; background: none; border: 0;
  padding: 8px 12px; border-radius: var(--r-sm); font: inherit; font-size: 13.5px;
  color: var(--ink); cursor: pointer; }
.sb-pop button:hover { background: #F4EFFC; }
.sb-none { display: block; padding: 10px 12px; color: var(--muted); font-size: 12.5px; }

/* ═══════════════ the URL sheet ═══════════════ */

.sheet-bar {
  position: sticky; top: 64px; z-index: 30;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: rgba(247,244,252,.94); backdrop-filter: blur(10px);
  padding: 12px 0 14px; margin-bottom: 2px;
}
.fmt { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.fmt select {
  height: 36px; padding: 0 30px 0 12px; border: 1px solid var(--line);
  border-radius: 99px; background: #fff; font: inherit; font-size: 13px; color: var(--ink);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%236E5C8A' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 12px;
}
.sheet-filter { margin-left: auto; }

.sheet-scroll {
  border: 1px solid var(--line); border-radius: var(--r-md); overflow: auto;
  background: #fff; box-shadow: var(--shadow-1); max-height: calc(100vh - 220px);
}
.sheet { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.sheet thead th {
  position: sticky; top: 0; z-index: 5;
  background: #F3EEFC; border-bottom: 1px solid var(--line);
  text-align: left; padding: 10px 12px; font-weight: 700; font-size: 11px;
  letter-spacing: .09em; text-transform: uppercase; color: var(--ink-soft);
  white-space: nowrap;
}
.sheet tbody td { border-bottom: 1px solid #F0EAF9; padding: 7px 12px; vertical-align: middle; }
.sheet tbody tr:hover td { background: #FBF8FE; }
.sheet tbody tr.on td { background: #F4ECFE; }
.sheet tbody tr:last-child td { border-bottom: 0; }

.c-gut { width: 40px; padding-left: 14px !important; }
.c-num { width: 46px; color: var(--muted); font-family: var(--font-mono); font-size: 11.5px; text-align: right; }
.c-thumb { width: 56px; }
.c-thumb img { width: 42px; height: 32px; object-fit: cover; border-radius: 5px;
  border: 1px solid var(--line); background: var(--plum-900); display: block; }
.c-file { max-width: 230px; }
.c-file span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--font-mono); font-size: 12px; }
.c-url { min-width: 340px; }
.c-url code {
  display: block; font-family: var(--font-mono); font-size: 12px; color: var(--violet-deep);
  cursor: copy; padding: 4px 8px; border-radius: 5px; border: 1px solid transparent;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: .12s ease;
}
.c-url code:hover { background: #F3ECFE; border-color: #E2D3FA; }
.c-url code.copied { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.c-dim, .c-size { width: 72px; color: var(--muted); font-family: var(--font-mono); font-size: 11.5px; }
.c-type { width: 62px; }
.c-type { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; color: var(--violet); }
.c-alt { min-width: 180px; }
.altcell {
  width: 100%; border: 1px solid transparent; background: none; border-radius: 5px;
  padding: 5px 8px; font: inherit; font-size: 12.5px; color: var(--ink);
}
.altcell:hover { border-color: var(--line); }
.altcell:focus { border-color: var(--violet); outline: none; background: #fff;
  box-shadow: 0 0 0 3px rgba(124,58,237,.12); }
.altcell.saved { border-color: var(--ok-line); background: var(--ok-bg); }

.colcopy {
  border: 0; background: #E7DBFB; color: var(--violet-deep); border-radius: 99px;
  padding: 2px 9px; margin-left: 8px; font: inherit; font-size: 9.5px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; cursor: pointer;
}
.colcopy:hover { background: var(--violet); color: #fff; }

.pick-all, .pick-row { display: inline-flex; cursor: pointer; position: relative; }
.pick-all input, .pick-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.pick-all span, .pick-row span {
  display: block; width: 17px; height: 17px; border-radius: 5px;
  border: 1.5px solid var(--wing); background: #fff; transition: .12s ease;
}
.pick-all span::after, .pick-row span::after {
  content: ""; position: absolute; left: 5.5px; top: 2px; width: 4px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(42deg) scale(0);
  transition: transform .12s ease;
}
.pick-all input:checked + span, .pick-row input:checked + span { background: var(--violet); border-color: var(--violet); }
.pick-all input:checked + span::after, .pick-row input:checked + span::after { transform: rotate(42deg) scale(1); }
.pick-all input:focus-visible + span, .pick-row input:focus-visible + span { outline: 2.5px solid var(--violet); outline-offset: 2px; }

.sheet-tip { color: var(--muted); font-size: 12.5px; margin-top: 12px; }
.sheet-tip .sep { margin: 0 8px; color: var(--wing); }

/* ═══════════════ lightbox ═══════════════ */

.lb {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(14,7,24,.96);
  display: grid; grid-template-rows: auto 1fr auto;
  backdrop-filter: blur(8px); animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.lb[hidden] { display: none; }

.lb-bar { display: flex; align-items: center; gap: 16px; padding: 14px 18px; }
.lb-id { min-width: 0; }
.lb-id b { display: block; font-family: var(--font-mono); font-size: 13.5px; color: #F0E7FC;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-id span { font-size: 11.5px; color: #9C87BE; }
.lb-tools { margin-left: auto; display: flex; gap: 8px; }
.lb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; min-width: 36px; padding: 0 13px; border-radius: 99px;
  background: rgba(255,255,255,.09); border: 0; color: #EDE3FA;
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: .12s ease;
}
.lb-btn:hover { background: rgba(255,255,255,.19); text-decoration: none; color: #fff; }
.lb-copy { background: var(--violet); }
.lb-copy:hover { background: var(--orchid); }
.lb-copy.done { background: var(--ok); }

.lb-stage { display: grid; place-items: center; overflow: auto; padding: 0 18px; }
.lb-stage img { max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain;
  border-radius: 8px; box-shadow: 0 30px 80px -30px #000; }
.lb-stage.zoom { place-items: start center; cursor: zoom-out; }
.lb-stage.zoom img { max-width: none; max-height: none; }

.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 46px; height: 76px; border: 0; border-radius: 12px;
  background: rgba(255,255,255,.07); color: #E6D8FA; cursor: pointer; transition: .12s ease;
}
.lb-nav:hover { background: rgba(255,255,255,.18); }
.lb-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lb-prev { left: 14px; } .lb-next { right: 14px; }

.lb-foot { display: flex; align-items: center; gap: 16px; padding: 12px 18px 18px; }
.lb-foot code {
  flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 12px; color: #B49BD9;
  background: rgba(255,255,255,.06); padding: 7px 12px; border-radius: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: copy;
}
.lb-foot code:hover { background: rgba(255,255,255,.12); color: #E0D0F7; }
.lb-count { font-family: var(--font-mono); font-size: 12px; color: #7E6A9C; }

body.lb-open { overflow: hidden; }

/* ═══════════════ toast ═══════════════ */

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 99px;
  font-size: 13.5px; font-weight: 600; box-shadow: 0 16px 36px -12px rgba(36,18,56,.65);
  opacity: 0; pointer-events: none; transition: .18s ease; z-index: 120; max-width: 88vw;
  text-align: center;
}
.toast.up { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); }

/* ═══════════════ small screens ═══════════════ */

@media (max-width: 760px) {
  .nav-search { display: none; }
  .nav-inner { gap: 10px; }
  .page-head { padding: 22px 0 16px; }
  .page-head-side { width: 100%; margin-left: 0; }
  .toolbar-right { width: 100%; margin-left: 0; }
  .zoomer { display: none; }
  .sheet-bar { position: static; }
  .sheet-filter { margin-left: 0; width: 100%; }
  .sheet-filter input { width: 100%; }
  .lb-nav { width: 38px; height: 60px; }
  .selbar-inner { padding-left: 14px; flex-wrap: wrap; justify-content: center; border-radius: 20px; }
}

@media print { .nav, .strip, .selbar, .toast, .sheet-bar { display: none; } }
