/* sweet-gallery: layout on top of rcm-themes (tokens only, no raw colours except shadows). Grid and viewer styles
   come from pkg/galleryui (gallery.css, player.css). */
body.apage { background: var(--bg); background-attachment: scroll; } /* plain background: fixed theme gradients stall long grids */
main { padding: 16px 16px 8px; }
main a:not(.btn) { color: var(--info); }
.wrap { max-width: 1100px; margin: 0 auto; }
.skip { position: absolute; left: 8px; top: -200px; z-index: 50; }
.skip:focus { top: 8px; }
.clip-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.narrow { max-width: 440px; width: 100%; margin: 24px auto 0; }
.grow { flex: 1; min-width: 0; }
.foot { padding: 16px; font-size: 12px; }

/* top bar */
.atop { position: sticky; top: 0; z-index: 10; padding: 0 12px; background: var(--bg); border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.atop .bar { display: flex; align-items: center; gap: 10px; min-height: 52px; flex-wrap: wrap; }
.atop .mark { width: 22px; height: 22px; color: var(--accent); flex: none; }
.atop .tname { text-decoration: none; color: var(--title, var(--fg)); font-weight: 700; }
.atop .sp { flex: 1; }
.atop form.inline { margin: 0; }
.atop select { max-width: 10em; min-height: 36px; }
.anav { display: inline-flex; gap: 2px; padding: 2px; border-radius: 9px; background: color-mix(in srgb, var(--fg) 8%, transparent); }
.anav a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 10px; border-radius: 7px; color: var(--muted); text-decoration: none; font-size: 14px; }
.anav a[aria-current] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 3px rgb(0 0 0 / .2); }
.pill.who { max-width: 10em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shn { color: var(--muted); font-size: 14px; }

/* buttons, forms */
a.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border-radius: var(--radius); border: 1px solid var(--btn-border); background: var(--btn-bg); color: var(--fg); text-decoration: none; font-size: 14px; }
a.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.btn svg, .ib svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ib { display: inline-grid; place-items: center; min-width: 40px; min-height: 40px; padding: 0; text-decoration: none; color: var(--fg); }
.ib.done { color: var(--ok, var(--accent)); }
.form { display: grid; gap: 8px; }
.form > label { color: var(--muted); font-size: 13px; }
.form input, .form select, .form textarea { width: 100%; min-height: 40px; font-size: 16px; box-sizing: border-box; }
.form textarea { min-height: 80px; resize: vertical; font: inherit; }
.form .row { margin-top: 8px; }
.box { margin-bottom: 16px; }
.box > * + * { margin-top: 12px; }
.head { align-items: center; margin-bottom: 12px; flex-wrap: nowrap; }
.head h1 { margin: 0; font-size: 22px; overflow-wrap: anywhere; }
.flash { margin-bottom: 12px; }
.danger-zone form { align-items: center; }

/* link rows */
.lrow { display: flex; align-items: center; gap: 4px; min-width: 0; }
.lrow .lv { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 6px 8px;
  border-radius: 6px; background: color-mix(in srgb, var(--fg) 6%, transparent); font-size: 13px; }

/* My shares */
.slist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.scard { display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; align-items: center; padding: 10px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.scard.off { opacity: .75; }
.scov { width: 96px; height: 72px; border-radius: 6px; overflow: hidden; display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted); font-size: 12px; text-decoration: none; }
.scov img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sbody { display: grid; gap: 4px; min-width: 0; }
.stitle { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main a.stitle { color: var(--fg); text-decoration: none; }
.smeta { font-size: 13px; }

/* share items */
.ilist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; counter-reset: it; }
.ilist li { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; padding: 4px; border-radius: 8px; }
.ilist li:hover { background: color-mix(in srgb, var(--fg) 5%, transparent); }
.ith { width: 56px; height: 42px; border-radius: 5px; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-size: 12px; }
.ith img { width: 100%; height: 100%; object-fit: cover; }
.itx { display: grid; min-width: 0; font-size: 14px; }
.itx .muted { font-size: 12px; }
.iact { display: flex; gap: 2px; margin: 0; }
.iact .ib { min-width: 36px; min-height: 36px; font-size: 16px; }
.iact .ib.danger { color: var(--err); }

/* grid pages */
body.gpage .gmain { padding: 8px 4px; }
.gsub { padding: 0 8px; }
.gfilt { align-items: center; gap: 8px; margin: 4px 0 8px; flex-wrap: wrap; }
.gfilt .sp { flex: 1; }
.addm { margin: 4px 0; }
.gmeta { margin: 0 0 8px; }
.gmeta > summary { cursor: pointer; color: var(--muted); padding: 4px 0; }
.gmeta-f { display: grid; gap: 6px; max-width: 640px; padding: 4px 0; }
.gmeta-r { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 2fr); gap: 6px; align-items: center; }
.gmeta-r input { min-height: 36px; font-size: 16px; min-width: 0; box-sizing: border-box; }
.gmeta-f .row { align-items: center; gap: 8px; flex-wrap: wrap; }
.gmatch { align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; }
.gmatch .sp { flex: 1; }
.gmatch form { margin: 0; }
body.gpage .gg.js .t { border-radius: 6px; }
.pager { justify-content: center; padding: 8px; }
.gg.js ~ .pager { display: none; }
.shead { padding: 8px 8px 12px; }
.shead h1 { margin: 0 0 4px; font-size: 24px; overflow-wrap: anywhere; }
.sdesc { margin: 0 0 4px; white-space: pre-line; overflow-wrap: anywhere; }
.shead p { margin: 0; }
.empty.gone { margin: 15vh auto; }
dialog.sheet { max-width: min(520px, calc(100vw - 32px)); }

@media (max-width: 640px) {
  main { padding: 12px 10px 8px; }
  .atop { padding: 0 8px; }
  .atop .bar { gap: 6px; padding-block: 6px; }
  .atop .gtheme, .pill.who { display: none; }
  .scard { grid-template-columns: 64px 1fr; }
  .scard > a.btn { grid-column: 1 / -1; }
  .scov { width: 64px; height: 56px; }
  .ilist li { grid-template-columns: 44px 1fr; }
  .iact { grid-column: 1 / -1; justify-content: flex-end; }
  .ith { width: 44px; height: 36px; }
  .head h1 { font-size: 18px; }
  body.gpage .gg.js .t { border-radius: 4px; }
}
.sname { margin-top: 24px; }
.sname .row { margin-top: 0; gap: 8px; }
.sname .row input { flex: 1; }
.sname .row .btn { flex: none; }
