/* =============================================================================
   Antidote stylesheet
   -----------------------------------------------------------------------------
   Organised top-down, general to specific, so every rule has an obvious home:

     1. TOKENS      - CSS custom properties (colour, type) + the dark theme
     2. BASE        - reset, root elements (html/body), links, tiny helpers
     3. LAYOUT      - the page shell and the containers that centre content
     4. COMPONENTS  - self-contained UI blocks, each under its own heading,
                      ordered roughly by how early you meet them in the app
     5. MOTION      - the reduced-motion escape hatch

   Convention inside a component: rules run outer element first, then inward
   (block -> elements -> states), so a component reads like its markup.
   ========================================================================== */


/* 1. TOKENS ================================================================= */
:root {
  --wash:   #EDEFF2;
  --paper:  #FFFFFF;
  --ink:    #20232A;
  --muted:  #6A7180;
  --line:   #E4E7EC;
  --accent: #2E7D6B;
  --accent-ink: #1f5d4f;
  --on-accent: #FFFFFF;   /* text that sits on a filled accent button */
  --heart:  #E0554E;
  --ok:     #2E7D6B;
  --shadow: rgba(24,28,40,.10);
  --mono: ui-monospace, "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --wash:#15171C; --paper:#1E2128; --ink:#ECEEF2; --muted:#9AA1AE;
    --line:#2C3038; --accent:#5FBAA5; --accent-ink:#8fd3c3; --heart:#F06A62;
    --ok:#5FBAA5; --shadow:rgba(0,0,0,.45); --on-accent:#12211C;
  }
}


/* 2. BASE =================================================================== */
* { box-sizing: border-box; }
[x-cloak] { display: none !important; }   /* hide Alpine-controlled bits until init */

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;   /* so .page grows and the footer sits at the bottom on short pages */
  background: var(--wash);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

/* small generic helpers */
.muted  { color: var(--muted); }
.hint   { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); }
.inline { display: inline; margin: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }   /* honeypot: off-screen, not display:none (which bots skip) */


/* 3. LAYOUT ================================================================= */
.page { flex: 1 0 auto; padding: 22px 14px 64px; }   /* grow to push the footer down */

/* Centred column for text-ish pages (auth, people, profile, single post). */
.stack { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.stack--narrow { max-width: 480px; }
.stack--wide   { max-width: 1080px; }   /* data-dense pages (admin) - wide, not a phone-width strip */

.pagetitle { font-size: 22px; margin: 4px 2px 0; }
.backlink  { margin: 0 2px; font-size: 14px; }

/* The photo timeline: a wider centred column that scales up on desktop so the
   images aren't squeezed into a phone-width strip on a big screen. */
.feed { width: 100%; max-width: 620px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
@media (min-width: 1024px) { .feed, .flashes { max-width: 820px; } }
@media (min-width: 1440px) { .feed, .flashes { max-width: 920px; } }


/* 4. COMPONENTS ============================================================= */

/* --- Top bar & nav ----------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  height: 54px; padding: 0 16px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 660; font-size: 16px;
  letter-spacing: -.01em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .dot { width: 15px; height: 15px; border-radius: 50%;
  background: conic-gradient(from 210deg, var(--accent), #6FBFA9, var(--accent)); }
.nav { display: flex; align-items: center; gap: 16px; }
/* plain nav links only - NOT the New-post button (.btn), which keeps its own
   colours; without :not(.btn) this rule outweighs .btn and greys the label. */
.nav > a:not(.btn) { color: var(--muted); font-size: 14px; font-weight: 550; }
.nav > a:not(.btn):hover { color: var(--ink); text-decoration: none; }
.nav__me { display: inline-flex; }
.nav__me:hover { text-decoration: none; }
.linkbtn { border: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; padding: 0; }
.linkbtn:hover { color: var(--ink); }
/* hamburger (shown only on small screens; toggles .nav.is-open via app.js) */
.navtoggle { display: none; align-items: center; justify-content: center; width: 38px; height: 34px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--paper); cursor: pointer; }
.navtoggle__bars { position: relative; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; }
.navtoggle__bars::before, .navtoggle__bars::after { content: ''; position: absolute; left: 0; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; }
.navtoggle__bars::before { top: -6px; }
.navtoggle__bars::after { top: 6px; }
.nav__me-label { display: none; }   /* label shown only inside the mobile menu */
.topbar__right { display: flex; align-items: center; gap: 14px; }
.nav__sep { width: 1px; align-self: stretch; min-height: 20px; background: var(--line); }   /* vertical divider (desktop) */
.navico { display: none; }   /* leading icons appear only inside the mobile menu */

/* Topbar on small screens: keep it to one row - tighter gaps, smaller labels,
   and the New-post button collapses to just its icon. */
@media (max-width: 600px) {
  .topbar { padding: 0 12px; }
  .navtoggle { display: inline-flex; }
  /* nav becomes a dropdown panel under the topbar, toggled by the hamburger */
  .nav {
    position: absolute; top: calc(100% + 6px); right: 8px; left: 8px;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 12px 34px var(--shadow); padding: 8px; display: none;
  }
  .nav.is-open { display: flex; }
  .nav .inline { width: 100%; }
  .nav__new-label { display: none; }   /* New post is icon-only in the topbar on mobile */
  .navico { display: block; width: 20px; height: 20px; flex: none; }
  .nav > a, .nav .linkbtn { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font-size: 15px; padding: 11px 12px; border-radius: 8px; }
  .nav > a:not(.nav__me) { font-weight: 600; color: var(--ink); }   /* nav links pop */
  .nav > a .navico { color: var(--accent); }                        /* colourful leading icons */
  .nav > a:hover, .nav .linkbtn:hover { background: var(--wash); text-decoration: none; }
  .nav__me-label { display: inline; color: var(--ink); font-weight: 550; }
  .nav__sep { width: auto; min-height: 0; height: 1px; align-self: auto; margin: 6px 6px; }   /* horizontal divider */
}

/* --- Footer ------------------------------------------------------------ */
.sitefoot { flex-shrink: 0; width: 100%; max-width: 620px; margin: 40px auto 0; padding: 18px 16px 34px;
  display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; justify-content: space-between;
  font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); }

/* --- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 10px;
  background: var(--accent-ink); color: var(--on-accent); font: inherit; font-weight: 600; font-size: 14px;
  padding: 9px 15px; cursor: pointer; line-height: 1;
}
.btn:hover { background: var(--accent); text-decoration: none; }
.btn--sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn--block { width: 100%; padding: 11px 15px; }
.btn--ghost { background: transparent; color: var(--accent); border-color: var(--line); }
.btn--ghost:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent-ink); }

/* --- Flashes & verify bar ---------------------------------------------- */
.flashes { max-width: 620px; margin: 14px auto 0; padding: 0 14px; display: flex; flex-direction: column; gap: 8px; }
/* A notice banner, not an input: tinted panel with a coloured left edge + lift. */
.flash { border-radius: 10px; padding: 11px 15px 11px 13px; font-size: 14px; font-weight: 500;
  background: var(--paper); border-left: 4px solid var(--line); box-shadow: 0 1px 2px var(--shadow); }
.flash--success { border-left-color: var(--ok); background: color-mix(in srgb, var(--ok) 7%, var(--paper)); color: var(--ok); }
.flash--error { border-left-color: var(--heart); background: color-mix(in srgb, var(--heart) 7%, var(--paper)); color: var(--heart); }
.flash--info { border-left-color: var(--accent); color: var(--muted); }
.verifybar { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  padding: 9px 16px; font-size: 13.5px; text-align: center;
  background: color-mix(in srgb, var(--accent) 12%, var(--paper)); border-bottom: 1px solid var(--line); }
.verifybar .linkbtn { color: var(--accent); font-weight: 600; }

/* --- Avatar ------------------------------------------------------------ */
.avatar { border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff;
  font-weight: 650; letter-spacing: .02em; object-fit: cover;
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--line); }

/* --- Post card --------------------------------------------------------- */
.post { background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 1px 2px var(--shadow), 0 12px 28px -20px var(--shadow); overflow: hidden;
  animation: rise .45s cubic-bezier(.2,.7,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* head: avatar + who */
.post__head { display: flex; align-items: center; gap: 11px; padding: 12px 15px; }
.post__avatar { display: inline-flex; }
.post__avatar:hover { text-decoration: none; }
.who { min-width: 0; line-height: 1.25; }
.who__name { font-size: 15px; font-weight: 620; color: var(--ink); }
.who__name:hover { text-decoration: none; color: var(--accent); }
.who__meta { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who__meta .loc { color: var(--accent); }
.who__time { color: var(--muted); }
.who__time:hover { color: var(--ink); text-decoration: none; }

/* image spread - layout varies by count (template picks the modifier) */
.spread { display: grid; gap: 3px; background: var(--line); }
.spread--1 { grid-template-columns: 1fr; aspect-ratio: 3/2; }
.spread--2 { grid-template-columns: 1.45fr 1fr; aspect-ratio: 3/2; }
.spread--3 { grid-template-columns: 1.55fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 3/2; }
.spread--3 .frame:first-child { grid-row: 1 / span 2; }
.frame { position: relative; margin: 0; padding: 0; border: 0; overflow: hidden; cursor: zoom-in; background: var(--wash); }
.frame img { display: block; width: 100%; height: 100%; object-fit: cover;
  transition: transform .45s cubic-bezier(.2,.7,.2,1); }
.frame:hover img, .frame:focus-visible img { transform: scale(1.04); }
.frame:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.frame .more-count { position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(16,18,24,.5); color: #fff; font-family: var(--mono); font-size: 22px; }

/* caption */
.body { padding: 12px 15px 2px; }
.caption { font-size: 15px; line-height: 1.55; margin: 0; color: var(--ink); }
.more { border: 0; background: none; padding: 0 0 0 4px; color: var(--muted); font: inherit; cursor: pointer; }
.more:hover { color: var(--accent); }

/* actions (like / view / owner edit+delete) */
.actions { display: flex; align-items: center; gap: 18px; padding: 10px 15px 13px; }
.act { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; cursor: pointer;
  color: var(--muted); font-family: var(--mono); font-size: 12.5px; padding: 4px 2px; border-radius: 8px; }
.act:hover { color: var(--ink); text-decoration: none; }
.act:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.act svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.act--owner { color: var(--muted); }
.act--owner.push-right { margin-left: auto; }
.act--danger:hover { color: var(--heart); }
.act.is-liked { color: var(--heart); }
.act.is-liked svg { fill: var(--heart); stroke: var(--heart); }
.act.pop svg { animation: pop .32s ease; }
@keyframes pop { 40% { transform: scale(1.35); } }

/* --- Feed states (loader / end / empty) -------------------------------- */
.sentinel { height: 1px; }
.end { text-align: center; font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); padding: 10px 0; }
.empty { text-align: center; background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
  padding: 34px 22px; }
.empty h2 { margin: 0 0 6px; font-size: 18px; }
.empty p { margin: 6px 0; }
.empty .btn { margin-top: 8px; }

/* --- Panels, people & profile ------------------------------------------ */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 16px 16px; }
.panel__title { margin: 0 0 12px; font-size: 14px; font-family: var(--mono); letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); }
.peoplelist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.person { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0;
  border-top: 1px solid var(--line); }
.person:first-child { border-top: 0; }
.person__id { display: flex; align-items: center; gap: 11px; min-width: 0; color: var(--ink); }
.person__id:hover { text-decoration: none; }
.person__name { display: block; font-weight: 600; font-size: 15px; }
.person__handle { display: block; font-size: 12.5px; color: var(--muted); }
.tag { font-family: var(--mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; white-space: nowrap; }
.tag--ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.profilehead { display: flex; align-items: flex-start; gap: 16px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 16px; padding: 18px 18px; }
.profilehead__meta { flex: 1; min-width: 0; }
.profilehead__name { margin: 0; font-size: 20px; }
.profilehead__handle { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.profilehead__bio { margin: 8px 0 0; font-size: 14px; line-height: 1.5; white-space: pre-line; }
.profstats { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 10px 0 0; padding: 0;
  font-size: 13px; color: var(--muted); }
.profstats strong { color: var(--ink); font-weight: 600; }

/* grid <-> feed view toggle */
.viewtoggle { align-self: center; display: inline-flex; gap: 2px; padding: 3px;
  background: var(--wash); border: 1px solid var(--line); border-radius: 10px; }
.viewtoggle__btn { padding: 6px 16px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--muted); }
.viewtoggle__btn:hover { color: var(--ink); text-decoration: none; }
.viewtoggle__btn.is-active { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px var(--shadow); }

/* profile photo grid */
.postgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.postgrid__cell { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 8px; background: var(--wash); }
.postgrid__cell img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .15s; }
.postgrid__cell:hover img { opacity: .88; }
.postgrid__multi { position: absolute; top: 5px; right: 5px; width: 18px; height: 18px; color: #fff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .55)); }

/* read-only field value (e.g. the fixed @username on the edit page) */
.readonlyfield { margin: 0; padding: 10px 12px; background: var(--wash); border: 1px solid var(--line);
  border-radius: 10px; color: var(--muted); font-size: 15px; }

/* --- Forms & inputs ---------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: 15px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink); }
input[type=text], input[type=email], input[type=password], input[type=search],
input[type=url], input[type=tel], input[type=number], input[type=datetime-local],
textarea, input[type=file] {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink);
  background: var(--wash); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
textarea { resize: vertical; }
/* file inputs: subtle field + a button that matches the design */
input[type=file] { padding: 8px 10px; font-size: 14px; color: var(--muted); cursor: pointer; }
input[type=file]::file-selector-button {
  font: inherit; font-weight: 600; font-size: 13px; cursor: pointer;
  color: var(--accent); background: transparent;
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 13px; margin-right: 12px;
  transition: background .15s, color .15s; }
input[type=file]::file-selector-button:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-ink); }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
select {
  font: inherit; font-size: 14px; color: var(--ink); cursor: pointer;
  background: var(--wash); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

/* --- Staged photo uploader (New Post) ---------------------------------- */
.uploader { display: flex; flex-direction: column; gap: 10px; }
.up-pick { display: grid; place-items: center; gap: 4px; padding: 22px; text-align: center;
  border: 1.5px dashed var(--line); border-radius: 12px; color: var(--muted); cursor: pointer; }
.up-pick input { position: absolute; width: 1px; height: 1px; opacity: 0; }
/* compact "Change picture" button + preview, used in the Edit-profile form */
.up-pick--inline { display: inline-flex; align-items: center; padding: 9px 14px; border-style: solid;
  border-radius: 9px; color: var(--accent); font-weight: 600; font-size: 14px; }
.pfield-pic { display: flex; align-items: center; gap: 14px; }
.pfield-pic__preview { flex: none; }
.uploader.is-drag .up-pick { border-color: var(--accent); color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, transparent); }
.up-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.up-thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--wash); }
.up-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: .55; transition: opacity .2s; }
.up-thumb.is-done img { opacity: 1; }
.up-thumb.is-error { outline: 2px solid var(--heart); outline-offset: -2px; }
.up-thumb.is-error img { opacity: .22; }
.up-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--accent); transition: width .15s; }
.up-thumb.is-done .up-bar { width: 100%; background: var(--ok); }
/* error reason shown on the tile itself, not just a tooltip */
.up-msg { display: none; }
.up-thumb.is-error .up-msg { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; text-align: center; padding: 6px; font-size: 10.5px; line-height: 1.25;
  color: #fff; background: color-mix(in srgb, var(--heart) 72%, rgba(0,0,0,.45)); }
/* remove (x) button on every tile: on hover, and always when errored */
.up-remove { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: 0;
  border-radius: 50%; background: rgba(16,18,24,.62); color: #fff; font-size: 16px; line-height: 1;
  cursor: pointer; display: grid; place-items: center; padding: 0; opacity: 0; transition: opacity .15s; }
.up-thumb:hover .up-remove, .up-thumb.is-error .up-remove { opacity: 1; }
.up-remove:hover { background: var(--heart); }
/* after the bytes are sent, the server re-encodes (thumb/feed/full) - show a spinner
   so the gap before "done" reads as working, not stalled. */
.up-thumb.is-processing::after { content: ''; position: absolute; top: 6px; left: 6px; width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%;
  animation: up-spin .7s linear infinite; }
@keyframes up-spin { to { transform: rotate(360deg); } }

/* ---- avatar cropper (profile) ---- */
.cropper { display: grid; gap: 12px; justify-items: center; margin-top: 12px; }
.cropper[hidden] { display: none; }   /* the class' display:grid would otherwise override [hidden] */
.cropper__stage { position: relative; width: 280px; height: 280px;
  border-radius: 14px; overflow: hidden; background: #0b0b0b; }
.cropper__canvas { display: block; width: 280px; height: 280px; cursor: grab; touch-action: none; }
.cropper__canvas:active { cursor: grabbing; }
.cropper__ring { position: absolute; inset: 0; border-radius: 50%;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .48); pointer-events: none; }   /* circular preview mask */
.cropper__zoom { display: flex; align-items: center; gap: 10px; width: 280px; }
.cropper__zoom-input { flex: 1; }
.cropper__actions { display: flex; gap: 8px; }

/* ---- edit-post photo grid ---- */
.editgrid { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 10px; }
.editgrid__item { position: relative; width: 110px; height: 110px; border-radius: 10px; overflow: hidden; background: var(--wash); }
.editgrid__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.editgrid__del { position: absolute; top: 4px; right: 4px; margin: 0; }
/* always visible (touch has no hover), unlike the uploader's .up-remove */
.editgrid__x { width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(16, 18, 24, .62);
  color: #fff; font-size: 16px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0; }
.editgrid__x:hover { background: var(--heart); }

/* ---- admin panel ---- */
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stat__n { display: block; font-size: 22px; font-weight: 700; line-height: 1.15; }
.stat__l { color: var(--muted); font-size: 13px; }
.tablewrap { overflow-x: auto; }
.admintable { width: 100%; border-collapse: collapse; font-size: 14px; }
.admintable th, .admintable td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admintable th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.admintable .num { text-align: right; white-space: nowrap; }
.admituser { display: inline-flex; align-items: center; gap: 8px; }
.admituser span { display: flex; flex-direction: column; line-height: 1.2; }
.admituser small { font-size: 12px; }
.rolebar { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.tag--warn { background: #8a5a00; color: #fff; }
.linkbtn--danger { color: var(--heart); }

/* moderation queue */
.reportsbar { display: block; padding: 12px 16px; border-radius: 12px; font-weight: 600; color: var(--ink);
  background: color-mix(in srgb, var(--heart) 12%, var(--paper));
  border: 1px solid color-mix(in srgb, var(--heart) 40%, var(--line)); }
.reportsbar:hover { text-decoration: none; background: color-mix(in srgb, var(--heart) 18%, var(--paper)); }
.reportcard { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.reportcard__main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.reportcard__thumb { flex: none; width: 72px; height: 72px; border-radius: 8px; overflow: hidden; background: var(--wash); }
.reportcard__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reportcard__meta { min-width: 0; }
.reportcard__meta p { margin: 0 0 3px; }
.reportcard__caption { font-size: 13px; }
.reportcard__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.act--muted { color: var(--muted); cursor: default; }

/* --- Auth pages -------------------------------------------------------- */
.authcard { max-width: 380px; margin: 6vh auto 0; background: var(--paper); border: 1px solid var(--line);
  border-radius: 18px; padding: 28px 26px; box-shadow: 0 20px 50px -30px var(--shadow); }
.authcard__title { margin: 0 0 4px; font-size: 22px; }
.authcard__sub { margin: 0 0 20px; font-size: 14px; }
.authcard__alt { margin: 18px 0 0; font-size: 14px; text-align: center; }

/* --- Error page -------------------------------------------------------- */
.errorpage { max-width: 440px; margin: 12vh auto; text-align: center; padding: 0 20px; }
.errorpage h1 { font-size: 64px; margin: 0; color: var(--accent); }
.errorpage .lead { font-size: 20px; margin: 4px 0 10px; }
.trace { text-align: left; overflow: auto; background: var(--paper); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px; font-size: 12px; font-family: var(--mono); line-height: 1.5; }

/* --- Lightbox (Alpine: visibility via x-show) -------------------------- */
.lightbox { position: fixed; inset: 0; background: rgba(12,14,18,.86); backdrop-filter: blur(2px);
  display: grid; place-items: center; padding: 16px; z-index: 60; }
/* Show the full 2048px variant as large as the viewport allows (never upscaled
   past its native width). Previously capped at 1100px, which wasted the detail. */
.lightbox img { max-width: min(96vw, 2048px); max-height: 94vh; border-radius: 12px; display: block;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.7); }
.lb-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px;
  border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: #20232A;
  display: grid; place-items: center; cursor: pointer; font-size: 24px; line-height: 1;
  box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.lb-btn.prev { left: 14px; } .lb-btn.next { right: 14px; }
.lb-count { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 12px; letter-spacing: .1em; color: #fff;
  background: rgba(0,0,0,.45); padding: 4px 10px; border-radius: 999px; }
.lb-close { position: absolute; top: 14px; right: 20px; border: 0; background: none; color: #fff;
  font-size: 34px; line-height: 1; cursor: pointer; opacity: .85; }
.lb-close:hover { opacity: 1; }


/* 5. MOTION ================================================================= */
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
