:root {
  --bg: #0a0e17;
  --surface: #131a26;
  --fg: #f4f6fa;
  --muted: #97a2b8;
  --border: #262f42;
  /* Blue → cyan — same gradient as the MD Unlocker family's default mark
     (md-storeos's fallback logo), so beta reads as the same brand. */
  --accent: #2563eb;
  --accent-2: #06b6d4;
  --accent-fg: #ffffff;
  --max-width: 1200px;

  /* Header keeps a fixed dark identity regardless of page theme, like a
     storefront's brand navbar — only the page body follows the toggle.
     Tinted indigo (not flat gray) so it reads as part of the same
     blue/cyan brand rather than a generic dark bar. */
  --header-bg: #0b1120;
  --header-bg-alt: #070b15;
  --header-fg: #f4f6fa;
  --header-muted: #97a2b8;
  --header-border: #1c2438;
}

:root[data-theme="light"] {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --fg: #101828;
  --muted: #5a647a;
  --border: #e2e6ef;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f8fb;
    --surface: #ffffff;
    --fg: #101828;
    --muted: #5a647a;
    --border: #e2e6ef;
  }
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* Sticky footer: on short pages (little content) the footer used to sit
   right under the content instead of pinned to the bottom of the
   viewport. body's direct children are header/main/footer in document
   order, so a flex column + margin-top:auto on .site-footer (see below)
   pushes it down without needing an extra wrapper element. */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
}

/* Present in the DOM (real text for search engines/screen readers) but
   not shown visually — for headings like the homepage's <h1> that exist
   for SEO/accessibility structure but would be redundant next to the
   header's own brand mark and search bar. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- header ---- */

.site-header {
  background: var(--header-bg);
  color: var(--header-fg);
}

.header-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  white-space: nowrap;
  color: var(--header-fg);
  flex-shrink: 0;
}

.brand img {
  height: 2rem;
  max-width: 10rem;
  object-fit: contain;
}

/* -- search -- */

.header-search {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  height: 2.5rem;
}

.search-form {
  display: flex;
  flex: 1;
  min-width: 0;
  /* No overflow:hidden here — rounded corners come from the input/button
     themselves instead, so the suggestions dropdown (absolutely positioned
     inside .search-input-wrap) isn't clipped by this element's box. */
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.search-input-wrap input {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 6px 0 0 6px;
  padding: 0 0.75rem;
  font-size: 0.9rem;
  color: #14181c;
  background: #ffffff;
}

.search-input-wrap input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 20;
}

.search-suggestions li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
}

.search-suggestions li:hover {
  background: var(--surface);
}

.search-suggestions__thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
}

.search-suggestions__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.search-suggestions__thumb--fallback {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--bg)), color-mix(in srgb, var(--accent-2) 16%, var(--bg)));
  color: var(--accent);
}

.search-suggestions__thumb--fallback svg {
  width: 1.1rem;
  height: 1.1rem;
}

.search-form button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  flex-shrink: 0;
  background: var(--accent);
  color: var(--accent-fg);
  border: none;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
}

.search-form button svg {
  width: 1.15rem;
  height: 1.15rem;
}

/* -- "All filters" (tags) dropdown -- */

.filters-dropdown {
  position: relative;
  flex-shrink: 0;
}

.filters-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  height: 100%;
  padding: 0 0.9rem;
  background: #ffffff;
  color: #14181c;
  border: none;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.filters-btn svg {
  width: 1rem;
  height: 1rem;
}

.filters-btn.active {
  background: var(--accent);
  color: var(--accent-fg);
}

.filters-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 12rem;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 20;
}

.filters-panel li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.6rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
}

.filters-panel li:hover {
  background: var(--surface);
}

.filters-panel li.active {
  color: var(--accent);
  font-weight: 600;
}

/* -- currency selector -- */

.currency-dropdown {
  position: relative;
  flex-shrink: 0;
}

.currency-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  height: 2.25rem;
  padding: 0 0.7rem;
  background: none;
  color: var(--header-fg);
  border: 1px solid var(--header-border);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.currency-btn svg {
  width: 0.9rem;
  height: 0.9rem;
  color: var(--header-muted);
}

.currency-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 11rem;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 20;
}

.currency-panel li {
  padding: 0;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}

.currency-panel li a {
  display: block;
  padding: 0.5rem 0.6rem;
  color: var(--fg);
  text-decoration: none;
}

.currency-panel li:hover {
  background: var(--bg);
}

.filter-dropdown {
  position: relative;
  flex-shrink: 0;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  height: 2.5rem;
  padding: 0 1rem;
  background: #ffffff;
  color: #0f172a;
  border: none;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.filter-btn svg {
  width: 1rem;
  height: 1rem;
}

.filter-panel {
  top: calc(100% + 6px);
  left: 0;
  min-width: 13rem;
  max-height: 22rem;
  overflow-y: auto;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.filter-panel li {
  padding: 0;
  border-radius: 6px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.filter-panel li a {
  display: block;
  padding: 0.5rem 0.6rem;
  color: var(--fg);
  text-decoration: none;
}

.filter-panel li:hover {
  background: var(--bg);
}

.filter-panel li.active a {
  color: var(--accent);
  font-weight: 700;
}

.currency-panel li.active a {
  color: var(--accent);
  font-weight: 600;
}

/* -- account menu (logged in) -- */

#auth-links {
  display: contents;
}

#auth-links[hidden] {
  display: none;
}

.account-menu {
  position: relative;
  flex-shrink: 0;
}

.account-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.25rem;
  padding: 0 0.8rem 0 0.4rem;
  background: none;
  color: var(--header-fg);
  border: 1px solid var(--header-border);
  border-radius: 999px;
  cursor: pointer;
}

.account-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
}

.account-avatar svg {
  width: 0.9rem;
  height: 0.9rem;
}

.account-name {
  font-size: 0.82rem;
  font-weight: 600;
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 11rem;
  max-height: 70vh;
  overflow-y: auto;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 20;
}

.account-panel li button,
.account-panel li a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  text-decoration: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg);
  background: none;
  border: none;
  padding: 0.55rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
}

.account-panel li button:hover,
.account-panel li a:hover {
  background: var(--bg);
}

.account-panel li a svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: var(--muted);
}

.account-panel li.account-balance {
  padding: 0.5rem 0.6rem 0.7rem;
  font-size: 0.85rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
}

.account-panel li.account-balance strong {
  color: var(--fg);
}

.dashboard-balance {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.dashboard-balance__label {
  color: var(--muted);
  font-size: 0.9rem;
}

.dashboard-balance__value {
  font-size: 1.5rem;
  font-weight: 700;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  font-size: 0.85rem;
}

/* Orders/statement/invoice/login-history tables all have 5-6 columns —
   on a narrow phone that overflows the card and bleeds off-screen
   instead of wrapping. Scroll the table itself horizontally instead;
   `thead`/`tbody`/`tr` keep their default table-part display, so column
   alignment between header and body is unaffected. */
@media (max-width: 700px) {
  .history-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
}

.history-table th,
.history-table td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* Whole-row click target: the order-id link's ::after is stretched over
   the entire row (position:relative on the row, position:absolute inset:0
   on the pseudo-element), so clicking anywhere in the row opens the popup
   — not just the id text itself. Still zero JS, just CSS. */
.history-table tbody tr {
  position: relative;
}

.history-table tbody tr:hover {
  background: var(--bg);
  cursor: pointer;
}

.order-row-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.order-row-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.history-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.statement-credit {
  color: #34d399;
  font-weight: 600;
}

.statement-debit {
  color: #ef4444;
  font-weight: 600;
}

.statement-id {
  font-weight: 600;
  color: var(--muted);
}

.statement-type-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.statement-type-pill--credit {
  background: color-mix(in srgb, #34d399 18%, transparent);
  color: #34d399;
}

.statement-type-pill--debit {
  background: color-mix(in srgb, #ef4444 18%, transparent);
  color: #ef4444;
}

.invoice-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.invoice-status-pill--paid {
  background: color-mix(in srgb, #34d399 18%, transparent);
  color: #34d399;
}

.invoice-status-pill--pending {
  background: color-mix(in srgb, #f59e0b 18%, transparent);
  color: #f59e0b;
}

.invoice-status-pill--failed,
.invoice-status-pill--unpaid {
  background: color-mix(in srgb, #ef4444 18%, transparent);
  color: #ef4444;
}

/* -- actions -- */

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Mobile only — desktop is untouched (still the original single flex row
   in plain DOM order: brand, filter, search, currency, theme, account).
   `.header-top`'s children are brand/filter/currency/theme never shrink
   (flex-shrink:0), so on a narrow phone the only flexible item — search
   (flex:1; min-width:0) — got crushed to a sliver, and everything else
   overflowed. CSS Grid areas regroup the SAME elements into 3 rows
   without reordering/duplicating any markup (no `order` + `display:
   contents` combo — that interaction is unreliable across browsers and
   is what broke desktop earlier). */
@media (max-width: 700px) {
  .header-top {
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    row-gap: 0.6rem;
    column-gap: 0.5rem;
  }

  /* Row 1: logo, then account pushed to the far right (column 2 is
     empty on this row — the 1fr track absorbs the gap between them). */
  .header-top > .brand {
    grid-row: 1;
    grid-column: 1;
    justify-self: start;
  }

  .header-top > .account-menu,
  .header-top > #auth-links {
    grid-row: 1;
    grid-column: 3;
    justify-self: end;
  }

  /* `#auth-links` is `display: contents` by default (desktop: its two
     buttons dissolve into `.header-actions`'s flex row directly) — that
     also erases IT as a grid item here, leaving its Login/Register
     buttons with no placement at all. Give it a real box back so the
     grid-column/row above actually applies, and lay its two buttons out
     in a small flex row inside that box. */
  .header-top > #auth-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  /* Base rule is `.auth-text { display: none; }`, only shown again above
     640px (`.auth-icon` was meant to take over below that — but these
     Login/Register links have no `.auth-icon` counterpart, so under
     700px they were rendering nothing at all). Show the text version
     here too instead of introducing icon-only buttons this site's
     markup was never given. */
  .header-top > #auth-links .auth-text {
    display: inline-block;
  }

  /* Logo (10rem max-width) + two full-size buttons don't fit a phone's
     ~375px width on one line — shrink both a bit and let the pair wrap
     to a second line as a last resort rather than overflow the viewport. */
  .header-top > .brand img {
    max-width: 7rem;
  }

  .header-top > #auth-links {
    flex-wrap: wrap;
    justify-content: flex-end;
    row-gap: 0.4rem;
  }

  .header-top > #auth-links .btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
  }

  /* Row 2: filter, currency, theme side by side. */
  .header-top > .filter-dropdown {
    grid-row: 2;
    grid-column: 1;
    justify-self: start;
  }

  .header-top > .currency-dropdown {
    grid-row: 2;
    grid-column: 2;
    justify-self: start;
  }

  .header-top > .theme-toggle {
    grid-row: 2;
    grid-column: 3;
    justify-self: end;
  }

  /* Row 3: search bar, full width. */
  .header-top > .header-search {
    grid-row: 3;
    grid-column: 1 / span 3;
    width: 100%;
  }
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background: none;
  border: 1px solid var(--header-border);
  border-radius: 999px;
  color: var(--header-fg);
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}

.icon-btn svg {
  width: 1.1rem;
  height: 1.1rem;
}

/* Floating WhatsApp support button — same admin-configured number the
   main site's chat launcher links out to, shown site-wide via shell()
   (pages.rs) so it doesn't need adding to every page individually. */
.whatsapp-float-btn {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  text-decoration: none;
  transition: transform 0.15s ease;
}

.whatsapp-float-btn:hover {
  transform: scale(1.06);
}

.whatsapp-float-btn svg {
  width: 1.9rem;
  height: 1.9rem;
}

@media (max-width: 700px) {
  .whatsapp-float-btn {
    right: 1rem;
    bottom: 1rem;
    width: 3rem;
    height: 3rem;
  }
  .whatsapp-float-btn svg {
    width: 1.6rem;
    height: 1.6rem;
  }
}

.theme-toggle .icon-moon {
  display: none;
}
:root[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}
:root[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

.auth-text {
  display: none;
}

.btn {
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--header-border);
  white-space: nowrap;
}

.btn-ghost {
  color: var(--header-fg);
  background: none;
}

/* .btn-ghost is header-only (fixed dark identity via --header-fg/
   --header-border regardless of page theme) — anywhere else on the page
   (light-themed card bodies included) needs the page's own tokens instead,
   or the text is invisible in light mode. */
.btn-ghost--body {
  color: var(--fg);
  background: none;
  border-color: var(--border);
}

.btn-primary {
  color: var(--accent-fg);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  background-size: 160% 160%;
  border-color: transparent;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-position 0.3s ease;
}

.btn-primary:hover {
  background-position: 100% 0;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 45%, transparent);
  transform: translateY(-1px);
}

/* -- tag strip -- */

.tag-strip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.7rem 1rem;
  overflow-x: auto;
  white-space: nowrap;
  /* Same background as header-top, not header-bg-alt — the category strip
     reads as part of the header, not a separate block underneath it. */
  background: var(--header-bg);
  scrollbar-width: none;
}

.tag-strip::-webkit-scrollbar {
  display: none;
}

#tag-list {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.tag-strip a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--header-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  flex-shrink: 0;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--header-fg) 6%, transparent);
  border: 1px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tag-strip a svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.tag-strip a:hover, .tag-strip a:focus-visible {
  color: var(--header-fg);
  background: color-mix(in srgb, var(--header-fg) 12%, transparent);
}

.tag-strip a.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
}

.tag-sep {
  width: 1px;
  height: 1rem;
  background: var(--header-border);
  flex-shrink: 0;
}

/* ---- hero ---- */

.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 1.25rem 3rem;
  text-align: center;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent);
}

.hero-badge {
  display: inline-block;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(2rem, 6vw, 3.25rem);
  line-height: 1.1;
  margin: 0 0 0.9rem;
}

.hero h1 .accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  color: var(--muted);
  font-size: 1.1rem;
  margin: 0 auto 2rem;
  max-width: 46ch;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-bottom: 2.75rem;
}

.cta {
  display: inline-block;
  font-weight: 600;
  text-decoration: none;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.cta-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 35%, transparent);
}

.cta-secondary {
  background: none;
  color: var(--fg);
  border-color: var(--border);
}

.trust-strip {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.75rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.trust-item svg {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--accent);
}

/* ---- services grid ---- */

.services {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}

.section-head {
  text-align: center;
  margin-bottom: 2rem;
}

.section-head h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin: 0 0 0.5rem;
}

.section-head p {
  color: var(--muted);
  margin: 0;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1.25rem;
}

.product-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.1rem;
  text-decoration: none;
  color: var(--fg);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.product-card:hover, .product-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.product-card__image {
  aspect-ratio: 16 / 9;
  border-radius: 0.6rem;
  overflow: hidden;
  background: var(--bg);
}

.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-card__image--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--bg)), color-mix(in srgb, var(--accent-2) 16%, var(--bg)));
  color: var(--accent);
}

.product-card__image--fallback svg {
  width: 2.25rem;
  height: 2.25rem;
}

.product-card__badge {
  align-self: flex-start;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, transparent), color-mix(in srgb, var(--accent-2) 16%, transparent));
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  text-decoration: none;
  transition: transform 0.15s ease;
}

.product-card__badge:hover {
  transform: translateY(-1px);
}

.group-detail {
  display: grid;
  grid-template-columns: minmax(0, 42rem) minmax(0, 1fr);
  align-items: start;
  gap: 1.25rem;
  max-width: 1440px;
  margin: 2.5rem auto;
  padding: 0 1.25rem 0 0.25rem;
}

.group-detail__media {
  min-width: 0;
}

.group-detail__image {
  margin-top: 7rem;
  border-radius: 1rem;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 860px) {
  .group-detail {
    grid-template-columns: minmax(0, 1fr);
  }

  .group-detail__image {
    position: static;
    max-width: 100%;
    margin-top: 0;
  }

  .order-price,
  .processing-box,
  .plan-selector,
  .requirements-box {
    margin: 0.75rem 0;
    padding: 0.85rem 1rem;
  }
}

.group-detail__image-link {
  display: block;
  width: 100%;
  cursor: zoom-in;
}

.group-detail__image img {
  width: 100%;
  height: auto;
  max-height: 42rem;
  object-fit: contain;
  display: block;
}

.group-detail__image svg {
  width: 3rem;
  height: 3rem;
  color: var(--muted);
}

/* Click-to-zoom lightbox — pure CSS, no JS. The thumbnail links to
   `#img-N`; the browser's own anchor navigation makes that element
   `:target`, which is the only thing that shows it. Closing just
   navigates back to the plain page URL (no fragment). */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox:target {
  display: flex;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 14, 0.85);
}

.lightbox__inner {
  position: relative;
  z-index: 1;
  max-width: min(90vw, 40rem);
  max-height: 85vh;
  display: flex;
}

.lightbox__inner img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 0.75rem;
  background: var(--surface);
}

.lightbox__close {
  position: absolute;
  top: -1rem;
  right: -1rem;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border);
  text-decoration: none;
  font-size: 1rem;
  z-index: 2;
}

.group-detail__body {
  min-width: 0;
}

.group-detail__body h1 {
  margin: 0.75rem 0 0.5rem;
  font-size: 1.85rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-weight: 800;
}

.group-detail__meta {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.group-detail__meta strong {
  color: var(--fg);
}

/* ---- order/product-detail page ---- */

.order-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0;
}

.order-badge {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, transparent), color-mix(in srgb, var(--accent-2) 16%, transparent));
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}

.order-quick-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 1rem;
  margin: 1.25rem 0;
}

.order-quick-row > * {
  margin: 0 !important;
}

.order-price {
  flex: 1 1 14rem;
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  flex-wrap: wrap;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 6%, var(--bg)), var(--bg));
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.order-price__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  flex-basis: 100%;
}

.order-price__value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.order-price__value--free {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: #34d399;
}

.order-price__value--contact {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
}

.order-availability {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 700;
  color: #059669;
  background: color-mix(in srgb, #34d399 14%, transparent);
  border: 1px solid color-mix(in srgb, #34d399 30%, transparent);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  box-shadow: 0 0 0 3px color-mix(in srgb, #34d399 8%, transparent);
}

.processing-box {
  flex: 1.4 1 16rem;
  margin: 1.25rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.processing-box__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.processing-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.processing-row__icon {
  font-size: 1rem;
}

.processing-row__label {
  color: var(--muted);
  font-size: 0.88rem;
}

.processing-row__value {
  margin-left: auto;
  font-weight: 700;
  font-size: 0.9rem;
}

.plan-selector {
  flex: 1 1 12rem;
  margin: 1.25rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.plan-selector__label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.plan-selector__options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.plan-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.plan-chip:hover {
  transform: translateY(-1px);
}

.plan-chip input {
  accent-color: var(--accent);
}

.plan-chip:has(input:checked) {
  border-color: var(--accent);
  color: var(--accent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), color-mix(in srgb, var(--accent-2) 12%, transparent));
  box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 25%, transparent);
}

.requirements-box {
  position: relative;
  margin: 1.25rem 0;
  padding: 1.25rem 1.25rem 1.25rem 1.4rem;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-radius: 1rem;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 6%, var(--surface)), var(--surface));
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.requirements-box::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

.requirements-box__label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.requirements-box__hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.3rem 0 0.9rem;
}

.requirements-box .auth-field {
  margin-bottom: 0.9rem;
}

.required-mark {
  color: #ef4444;
  margin-left: 0.15rem;
}

.order-form__note {
  color: var(--muted);
  margin: 0.75rem 0;
}

.auth-field__hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.order-total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.2));
  border-radius: 12px;
  font-size: 0.95rem;
}

.order-total__value {
  font-size: 1.25rem;
  color: var(--accent, #3b82f6);
}

.order-total__calc {
  color: var(--muted);
}

.order-total--invalid .order-total__value {
  color: #ef4444;
}

.service-details {
  max-width: 1440px;
  margin: 0 auto 2.5rem;
  padding: 1.5rem 1.25rem;
  border-top: 1px solid var(--border);
}

.service-details__label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.service-details__text {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--fg);
  white-space: pre-line;
}

/* ---- image carousel (no JS — radio-driven, see pages.rs::product_detail) ---- */

.carousel {
  position: relative;
  width: 100%;
}

.carousel-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.carousel-viewport {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
}

.carousel-slide {
  display: none;
}

.carousel-slide img {
  width: 100%;
  height: auto;
  max-height: 34rem;
  object-fit: contain;
  display: block;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg);
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  user-select: none;
}

.carousel-arrow--prev {
  left: 0.6rem;
}

.carousel-arrow--next {
  right: 0.6rem;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.carousel-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--border);
  cursor: pointer;
}

/* Generic index-based show/highlight rules — structural only, works for
   any product's images (up to MAX_CAROUSEL_SLIDES in pages.rs). */
.carousel-radio:nth-of-type(1):checked ~ .carousel-viewport .carousel-slide:nth-child(1),
.carousel-radio:nth-of-type(2):checked ~ .carousel-viewport .carousel-slide:nth-child(2),
.carousel-radio:nth-of-type(3):checked ~ .carousel-viewport .carousel-slide:nth-child(3),
.carousel-radio:nth-of-type(4):checked ~ .carousel-viewport .carousel-slide:nth-child(4),
.carousel-radio:nth-of-type(5):checked ~ .carousel-viewport .carousel-slide:nth-child(5),
.carousel-radio:nth-of-type(6):checked ~ .carousel-viewport .carousel-slide:nth-child(6),
.carousel-radio:nth-of-type(7):checked ~ .carousel-viewport .carousel-slide:nth-child(7),
.carousel-radio:nth-of-type(8):checked ~ .carousel-viewport .carousel-slide:nth-child(8) {
  display: block;
}

.carousel-radio:nth-of-type(1):checked ~ .carousel-dots .carousel-dot:nth-child(1),
.carousel-radio:nth-of-type(2):checked ~ .carousel-dots .carousel-dot:nth-child(2),
.carousel-radio:nth-of-type(3):checked ~ .carousel-dots .carousel-dot:nth-child(3),
.carousel-radio:nth-of-type(4):checked ~ .carousel-dots .carousel-dot:nth-child(4),
.carousel-radio:nth-of-type(5):checked ~ .carousel-dots .carousel-dot:nth-child(5),
.carousel-radio:nth-of-type(6):checked ~ .carousel-dots .carousel-dot:nth-child(6),
.carousel-radio:nth-of-type(7):checked ~ .carousel-dots .carousel-dot:nth-child(7),
.carousel-radio:nth-of-type(8):checked ~ .carousel-dots .carousel-dot:nth-child(8) {
  background: var(--accent);
}

/* ---- resources (admin-added links) ---- */

.resources-box {
  margin-top: 1rem;
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.resources-box__label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.65rem;
}

.resources-box__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.resource-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  background: var(--bg);
  color: var(--fg);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.resource-pill:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  color: var(--accent);
}

/* ---- related services ---- */

.related-services {
  max-width: 1440px;
  margin: 0 auto 3rem;
  padding: 0 1.25rem;
}

.related-services__label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.group-products {
  max-width: var(--max-width);
  margin: 0 auto 2.5rem;
  padding: 0 1.25rem;
}

.group-products__count {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 1rem;
}

.product-card--static:hover {
  transform: none;
  border-color: var(--border);
  cursor: default;
}

.product-card__price {
  font-weight: 700;
  color: var(--fg);
  margin: 0;
}

.product-card__price--free {
  color: #34d399;
}

/* Original price (M.R.P.) + % off — set per product in the admin app */
.price-off {
  color: #f43f5e;
  font-weight: 600;
}

.price-mrp {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.78rem;
}

.price-mrp s {
  text-decoration-thickness: 1px;
}

.product-card__price--deal {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.45rem;
  row-gap: 0.1rem;
}

.product-card__price--deal .price-off {
  font-size: 0.95rem;
}

.product-card__price--deal .price-mrp {
  flex-basis: 100%;
}

.order-price__deal {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
}

.order-price__deal .price-off {
  font-size: 1.5rem;
  font-weight: 500;
}

.order-price .price-mrp {
  flex-basis: 100%;
  order: 10;
  font-size: 0.85rem;
  margin-top: -0.4rem;
}

.product-card__price--contact {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--muted);
}

.product-card__title {
  margin: 0;
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.3;
}

.product-card__desc {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.service-card--skeleton {
  min-height: 9.5rem;
  background: linear-gradient(90deg, var(--surface) 25%, var(--border) 37%, var(--surface) 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-color: transparent;
}

@keyframes skeleton-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

.product-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.product-pagination[hidden] {
  display: none;
}

.pagination-btn {
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.55rem 1.25rem;
  cursor: pointer;
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-label {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

/* ---- why us ---- */

.why-us {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.why-us-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3.5rem 1.25rem;
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 1.25rem;
}

.why-card {
  padding: 1.5rem;
  border-radius: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.why-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
}

.why-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
  margin-bottom: 0.9rem;
}

.why-card__icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.why-card h3 {
  font-size: 1.02rem;
  margin: 0 0 0.4rem;
}

.why-card p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.5;
}

/* ---- auth pages (login / register) ---- */

.auth-page {
  display: flex;
  justify-content: center;
  padding: 3.5rem 1.25rem;
  min-height: 60vh;
}

.auth-card {
  width: 100%;
  max-width: 26rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 2.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

.auth-card--wide {
  max-width: 38rem;
}

.auth-greeting {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.5rem;
}

.auth-card h1 {
  font-size: 1.6rem;
  margin: 0 0 0.5rem;
}

.auth-subtext {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 1.75rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}

.auth-field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1rem 1.25rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.auth-field__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.auth-generate-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  background-size: 200% 200%;
  border: none;
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  animation: auth-generate-glow 2.4s ease-in-out infinite;
}

.auth-generate-btn svg {
  width: 0.85rem;
  height: 0.85rem;
}

.auth-generate-btn:hover {
  animation-play-state: paused;
  filter: brightness(1.1);
}

@keyframes auth-generate-glow {
  0%, 100% {
    background-position: 0% 50%;
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent);
  }
  50% {
    background-position: 100% 50%;
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 0%, transparent);
  }
}

.auth-password-popup {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: #34d399;
  background: color-mix(in srgb, #34d399 12%, transparent);
  border: 1px solid color-mix(in srgb, #34d399 30%, var(--border));
  border-radius: 0.5rem;
  padding: 0.5rem 0.7rem;
  animation: auth-popup-in 0.2s ease;
}

.auth-password-popup[hidden] {
  display: none;
}

.auth-password-popup svg {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
}

@keyframes auth-popup-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-field--full {
  grid-column: 1 / -1;
}

.auth-field input,
.auth-field select {
  width: 100%;
  min-width: 0;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 400;
  padding: 0.7rem 0.9rem;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
}

.auth-field,
.auth-grid > * {
  min-width: 0;
}

.auth-field input:focus,
.auth-field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.auth-password-wrap {
  position: relative;
  display: flex;
}

.auth-password-wrap input {
  flex: 1;
  padding-right: 2.5rem;
}

.auth-password-toggle {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0.2rem;
  display: flex;
}

.auth-password-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.auth-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
}

.auth-checkbox input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.auth-checkbox a {
  color: var(--accent);
  text-decoration: none;
}

.auth-checkbox a:hover {
  text-decoration: underline;
}

.auth-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-notice {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  color: var(--fg);
  border-radius: 0.6rem;
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  line-height: 1.5;
}

.auth-notice--error {
  background: color-mix(in srgb, #ef4444 10%, transparent);
  border-color: color-mix(in srgb, #ef4444 30%, var(--border));
  color: #ef4444;
}

.auth-notice a {
  color: var(--accent);
  font-weight: 600;
}

.auth-submit {
  width: 100%;
  text-align: center;
  border: none;
  font-size: 0.98rem;
  font-weight: 700;
  padding: 0.9rem 1.5rem;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.auth-switch {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  margin: 1.5rem 0 0;
}

.auth-switch a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

@media (min-width: 640px) {
  .auth-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---- auth modal ---- */

.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 3rem 1.25rem;
  background: rgba(5, 8, 14, 0.6);
  backdrop-filter: blur(2px);
  animation: auth-modal-fade-in 0.15s ease;
}

.auth-modal-backdrop[hidden] {
  display: none;
}

body.auth-modal-open {
  overflow: hidden;
}

@keyframes auth-modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.auth-modal-card {
  position: relative;
  width: 100%;
  max-width: 26rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 2.25rem;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
  animation: auth-modal-pop-in 0.18s ease;
}

.auth-modal-card:has(#auth-modal-view-register:not([hidden])) {
  max-width: 38rem;
}

@keyframes auth-modal-pop-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-modal-close {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.auth-modal-close:hover {
  color: var(--fg);
  background: var(--bg);
}

.auth-modal-close svg {
  width: 1rem;
  height: 1rem;
}

.auth-modal-view h2 {
  font-size: 1.6rem;
  margin: 0 0 0.5rem;
}

/* ---- footer ---- */

.site-footer {
  background: var(--header-bg);
  color: var(--header-muted);
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 1rem 1rem;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .footer-inner {
    gap: 2.5rem;
    align-items: start;
  }
}

.footer-brand .brand {
  color: var(--header-fg);
  font-size: 1.25rem;
  font-weight: 700;
}

.footer-brand p {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  max-width: 40ch;
}

.footer-legal-notice {
  font-size: 0.6875rem !important;
  color: color-mix(in srgb, var(--header-muted) 85%, transparent) !important;
}

.footer-legal-notice strong {
  color: var(--header-muted);
}

.footer-col h3 {
  color: var(--header-muted);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin: 0;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-col nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 1rem;
  row-gap: 0.35rem;
}

.footer-col a {
  color: var(--header-muted);
  text-decoration: none;
  font-size: 0.88rem;
  white-space: nowrap;
}

.footer-col a:hover {
  color: var(--header-fg);
  text-decoration: underline;
}

.footer-trust {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-top: 1px solid var(--header-border);
  padding-top: 0.75rem;
}

.footer-pay-row, .footer-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.footer-pay {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(226, 232, 240, 0.85);
  white-space: nowrap;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.footer-pay:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.1);
  color: #6ee7b7;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.footer-pay svg, .footer-badge svg {
  width: 0.85rem;
  height: 0.85rem;
  flex-shrink: 0;
}

.footer-pay--upi svg { color: #fb923c; }
.footer-pay--crypto svg { color: #fbbf24; }
.footer-pay--cards svg { color: #a78bfa; }
.footer-pay--bank svg { color: #60a5fa; }

@media (min-width: 900px) {
  .footer-trust {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .footer-badge-row {
    justify-content: flex-end;
  }
}

.footer-social {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.footer-social-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--header-muted);
}

.footer-social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.85rem 0.42rem 0.5rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(226, 232, 240, 0.9);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.footer-social-link svg {
  width: 1.55rem;
  height: 1.55rem;
  padding: 0.3rem;
  border-radius: 9999px;
  color: #ffffff;
  flex-shrink: 0;
}

.footer-social--instagram svg {
  background: linear-gradient(45deg, #f9ce34, #ee2a7b 55%, #6228d7);
}

.footer-social--facebook svg {
  background: #1877f2;
}

.footer-social-link:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.24);
  color: #ffffff;
  transform: translateY(-1px);
}

.footer-social-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.footer-bottom {
  border-top: 1px solid var(--header-border);
  padding: 0.625rem 1rem;
  text-align: center;
  font-size: 0.75rem;
}

@media (max-width: 640px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 640px) {
  .auth-icon {
    display: none;
  }
  .auth-text {
    display: inline-block;
  }
}

@media (min-width: 900px) {
  .header-top {
    padding: 1rem 3rem;
  }
  .tag-strip {
    padding: 0.55rem 3rem;
  }
  .hero {
    padding: 5rem 2rem 3rem;
  }
}

/* ---- server-rendered pages (no JS): <details>-based dropdowns and the
   plain-page variant of the auth card, replacing the old JS-toggled
   button+hidden-panel pattern and the modal popup. ---- */

/* Checkbox-hack dropdown (currency picker, account menu): no JS, but
   still closes on an outside click — a hidden checkbox toggled by the
   visible button-label, plus a full-page transparent overlay-label (same
   checkbox) that sits under the panel/button but over everything else, so
   clicking anywhere outside re-toggles (closes) it. Native <details> can't
   do the outside-click-closes part without JS, which is why this isn't
   just <details>/<summary>. */

.dropdown-check {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.currency-btn,
.account-btn,
.filter-btn {
  cursor: pointer;
  position: relative;
  z-index: 16;
}

.currency-panel,
.account-panel,
.filter-panel {
  display: none;
  position: absolute;
  z-index: 20;
}

.dropdown-check:checked ~ .currency-panel,
.dropdown-check:checked ~ .account-panel,
.dropdown-check:checked ~ .filter-panel {
  display: block;
}

.dropdown-overlay {
  display: none;
}

.dropdown-check:checked ~ .dropdown-overlay {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 15;
  cursor: default;
  background: transparent;
}

.auth-page {
  display: flex;
  justify-content: center;
  padding: 3rem 1.25rem 4rem;
}

.auth-modal-card--page {
  position: static;
  animation: none;
  max-width: 30rem;
}

.auth-modal-card--register {
  max-width: 38rem;
}

.auth-modal-card--orders {
  max-width: 96rem;
  width: 100%;
}

.auth-modal-card--security {
  max-width: 72rem;
  width: 100%;
}

.auth-modal-card--api {
  max-width: 96rem;
  width: 100%;
}

/* ---- API keys page: mirrors the main site's API control page layout ---- */

.api-mt {
  margin-top: 0.9rem;
}

.api-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

.api-surface--accent {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.api-surface--warn {
  border-color: color-mix(in srgb, #f59e0b 35%, var(--border));
  background: color-mix(in srgb, #f59e0b 6%, var(--surface));
}

.api-fix-box {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid color-mix(in srgb, #f59e0b 45%, var(--border));
  background: color-mix(in srgb, #f59e0b 10%, var(--surface));
  font-size: 0.88rem;
  line-height: 1.5;
}

.api-fix-box code {
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
}

.api-list {
  list-style: disc;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.api-inline-code {
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  margin: 0 0.35rem;
}

.api-code {
  display: block;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
  padding: 0.7rem 0.9rem;
  overflow-wrap: anywhere;
}

.api-identity-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1rem;
  margin-top: 1.25rem;
}

@media (max-width: 900px) {
  .api-identity-grid {
    grid-template-columns: 1fr;
  }
}

.api-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.api-mini-stat {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--bg);
  padding: 0.6rem 0.7rem;
}

.api-mini-stat span {
  display: block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.api-mini-stat strong {
  display: block;
  margin-top: 0.3rem;
  font-size: 1.3rem;
  font-weight: 900;
}

.api-mini-stat--success { border-color: color-mix(in srgb, #10b981 35%, var(--border)); }
.api-mini-stat--success strong { color: #10b981; }
.api-mini-stat--idle strong { color: var(--muted); }
.api-mini-stat--info { border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.api-mini-stat--info strong { color: var(--accent); }
.api-mini-stat--warn { border-color: color-mix(in srgb, #f59e0b 40%, var(--border)); }
.api-mini-stat--warn strong { color: #f59e0b; }

.api-secret-reveal {
  border: 1px solid var(--border);
  border-left: 4px solid #10b981;
  border-radius: 0.75rem;
  background: var(--surface);
  padding: 0.85rem 1rem;
}

.api-secret-reveal__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.api-secret-reveal__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 999px;
  background: #10b981;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 900;
  flex-shrink: 0;
}

.api-secret-reveal__row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}

.api-secret-reveal__row code {
  flex: 1;
  min-width: 16rem;
  font-family: ui-monospace, monospace;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.55rem 0.75rem;
  overflow-wrap: anywhere;
}

.api-add-details summary {
  cursor: pointer;
  list-style: none;
  width: fit-content;
}

.api-add-details summary::-webkit-details-marker {
  display: none;
}

.api-table-shell {
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
}

.api-table-scroll {
  overflow-x: auto;
}

.api-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 60rem;
}

.api-table thead {
  background: color-mix(in srgb, var(--accent) 12%, var(--bg));
}

.api-table th {
  text-align: left;
  padding: 0.75rem 0.9rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

.api-td {
  padding: 0.75rem 0.9rem;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}

.api-td--actions {
  text-align: right;
}

.api-table-cell-strong {
  font-weight: 700;
}

.api-table-cell-muted {
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

.api-input {
  width: 100%;
  min-width: 6rem;
  padding: 0.4rem 0.55rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  font-size: 0.85rem;
}

.api-input:disabled {
  opacity: 0.5;
}

.api-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent-2) 40%, var(--border));
  background: color-mix(in srgb, var(--accent-2) 12%, var(--surface));
  padding: 0.2rem 0.55rem;
  font-size: 0.7rem;
  font-family: ui-monospace, monospace;
  color: color-mix(in srgb, var(--accent-2) 70%, var(--fg));
  margin: 0.1rem;
}

.api-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: flex-end;
}

.api-row-form {
  display: contents;
}

.api-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 0.65rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.api-action-btn svg {
  width: 1.05rem;
  height: 1.05rem;
}

.api-action-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.api-action-btn--key {
  color: #b45309;
  background: color-mix(in srgb, #f59e0b 20%, var(--surface));
  border-color: color-mix(in srgb, #f59e0b 45%, var(--border));
}

.api-action-btn--save {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.api-action-btn--pause {
  color: #b91c1c;
  background: color-mix(in srgb, #ef4444 18%, var(--surface));
  border-color: color-mix(in srgb, #ef4444 40%, var(--border));
}

.api-action-btn--enable {
  color: #ffffff;
  background: #10b981;
  border-color: #10b981;
}

.api-action-btn--delete {
  color: #ffffff;
  background: #ef4444;
  border-color: #ef4444;
}

/* Auto-off toggle — pure CSS switch, no JS: a visually-hidden checkbox
   plus a sibling-selector-styled track/thumb. */
.api-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.api-switch--disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.api-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.api-switch__track {
  position: relative;
  display: block;
  width: 2.6rem;
  height: 1.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.api-switch__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  background: var(--muted);
  transition: transform 0.15s ease, background 0.15s ease;
}

.api-switch input:checked + .api-switch__track {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 35%, var(--bg));
}

.api-switch input:checked + .api-switch__track .api-switch__thumb {
  transform: translateX(1.15rem);
  background: var(--accent);
}

.orders-filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  align-items: end;
  gap: 1rem 1.25rem;
  margin: 1.25rem 0 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.orders-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 0;
}

.orders-filter-field input,
.orders-filter-field select {
  width: 100%;
  min-width: 0;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 400;
  padding: 0.55rem 0.7rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
}

.orders-filter-bar .btn {
  flex-shrink: 0;
}

.order-fields-json {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 1rem;
  font-size: 0.8rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.order-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  /* Clears the modal's absolutely-positioned close button (top:1.1rem
     right:1.1rem, ~2rem wide) so the status pill never sits under it. */
  padding-right: 2.75rem;
}

.order-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.order-status-pill--success {
  background: color-mix(in srgb, #34d399 18%, transparent);
  color: #34d399;
}

.order-status-pill--failed {
  background: color-mix(in srgb, #ef4444 18%, transparent);
  color: #ef4444;
}

.order-status-pill--processing {
  background: color-mix(in srgb, #f59e0b 18%, transparent);
  color: #f59e0b;
}

.order-status-pill--neutral {
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
}

.order-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.order-stat {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.9rem 1rem;
}

.order-stat span {
  color: var(--muted);
  font-size: 0.8rem;
}

.order-stat strong {
  font-size: 1.15rem;
}

.order-fields-list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.totp-secret {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.7rem 0.9rem;
  word-break: break-all;
  margin: 0.75rem 0;
}

.totp-key-reveal {
  margin: 0.75rem 0;
}

.totp-key-reveal summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
}

.totp-qr {
  display: flex;
  justify-content: center;
  background: #fff;
  border-radius: 0.6rem;
  padding: 1rem;
  margin: 1rem 0;
  max-width: 240px;
}

.totp-qr svg {
  width: 100%;
  height: auto;
}

.security-card.order-section {
  border-top: none;
  margin-top: 1.25rem;
  padding: 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 1rem;
}

.security-card__head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

/* .security-card__head doubles as a <summary> for the 3 collapsible
   sections (Password / Master password / 2FA) — no JS, native <details>
   open/close. Login activity stays a plain (always-open) card below, so
   the chevron/collapse styling below is scoped to `summary` only. */
summary.security-card__head {
  list-style: none;
  cursor: pointer;
  margin-bottom: 0;
}

summary.security-card__head::-webkit-details-marker {
  display: none;
}

summary.security-card__head::after {
  content: "▾";
  flex-shrink: 0;
  margin-left: auto;
  color: var(--muted);
  transition: transform 0.15s ease;
}

details[open] > summary.security-card__head::after {
  transform: rotate(180deg);
}

summary.security-card__head .security-badge {
  margin-left: 0.5rem;
}

details.security-card[open] > summary.security-card__head {
  margin-bottom: 1rem;
}

.security-card__head h3 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
}

.security-card__head .auth-subtext {
  margin: 0;
}

.security-card__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  font-size: 1.2rem;
}

.security-badge {
  flex-shrink: 0;
  margin-left: auto;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.security-badge--off {
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
}

.security-badge--pending {
  background: color-mix(in srgb, #f59e0b 18%, transparent);
  color: #f59e0b;
}

.security-badge--on {
  background: color-mix(in srgb, #34d399 18%, transparent);
  color: #34d399;
}

.security-card__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.security-card__actions .auth-subtext {
  margin: 0;
  flex: 1 1 14rem;
}

/* CSS-only tabs (Password / Master password / 2FA in a row, one shared
   content area below) — three hidden radios + sibling selectors decide
   which label looks active and which panel shows, same no-JS technique
   as the currency/account dropdowns elsewhere on this site. */
.security-tab-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.security-tab-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.security-tab-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 12rem;
  padding: 0.9rem 1.1rem;
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.92rem;
}

.security-tab-label__icon {
  font-size: 1.1rem;
}

.security-tab-label__badge {
  margin-left: auto;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
}

#security-tab-password:checked ~ .security-tab-labels label[for="security-tab-password"],
#security-tab-pin:checked ~ .security-tab-labels label[for="security-tab-pin"],
#security-tab-2fa:checked ~ .security-tab-labels label[for="security-tab-2fa"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--bg));
  color: var(--accent);
}

.security-tab-panel {
  display: none;
  padding: 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 1rem;
}

#security-tab-password:checked ~ .security-tab-panel--password,
#security-tab-pin:checked ~ .security-tab-panel--pin,
#security-tab-2fa:checked ~ .security-tab-panel--2fa {
  display: block;
}

.password-strength-meter {
  margin: -0.6rem 0 0;
  font-size: 0.8rem;
  font-weight: 600;
}

.password-strength-meter[hidden] {
  display: none;
}

.password-strength-meter--weak {
  color: #ef4444;
}

.password-strength-meter--medium {
  color: #f59e0b;
}

.password-strength-meter--strong {
  color: #34d399;
}

.order-fields-list li {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.88rem;
}

.order-reply-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.order-reply-text {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
}

.order-detail-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.order-section {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.order-section-label {
  margin: 0 0 0.75rem;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.order-section .history-table {
  margin-top: 0;
}

.order-reply-block {
  margin-top: 1.75rem;
  padding: 1rem;
  border-top: none;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: var(--bg);
}

.order-reply-block .order-section-label {
  color: var(--muted);
}

/* Pure-CSS popup: the row link jumps to this element's #id, :target
   reveals it as an overlay — no JS, no page reload. */
.order-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 3rem 1.25rem;
  background: rgba(5, 8, 14, 0.6);
  backdrop-filter: blur(2px);
}

.order-modal-backdrop:target,
.order-modal-backdrop--open {
  display: flex;
}

/* The row link's #hash wins over a stale server-side `?focus=` popup, so
   two different orders can never be open (and stacked) at once. */
body:has(.order-modal-backdrop:target) .order-modal-backdrop--open:not(:target) {
  display: none;
}

.order-modal-card {
  position: relative;
  width: 100%;
  max-width: 42rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 2.25rem;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
}

.order-modal-close {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: none;
  color: var(--muted);
  text-decoration: none;
  font-size: 1.1rem;
  line-height: 1;
}

.order-modal-close:hover {
  color: var(--fg);
  background: var(--bg);
}

.pagination-btn {
  display: inline-block;
  text-decoration: none;
}

.auth-phone-wrap {
  display: flex;
  gap: 0.5rem;
}

.auth-phone-code {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 3.2rem;
  padding: 0 0.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  flex-shrink: 0;
}

.auth-phone-wrap input {
  flex: 1;
}

/* -- API keys page -- */

.api-key-card {
  margin-top: 1.25rem;
}

.api-key-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.api-key-sub {
  margin-top: 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.api-key-sub summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--accent);
}

.api-ip-list {
  list-style: none;
  margin: 0.75rem 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.api-ip-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.5rem 0.7rem;
  font-size: 0.85rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.api-ip-delete {
  margin: 0;
}

/* ---- top up: radio-button CSS tabs, zero JS ---- */

.topup-methods {
  margin-top: 1.25rem;
}

.topup-method-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.topup-method-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1.4rem;
  margin: 0 0.6rem 0.85rem 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
}

.topup-method-btn svg {
  width: 1.35rem;
  height: 1.35rem;
  flex-shrink: 0;
}

.topup-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  flex-shrink: 0;
  border-radius: 999px;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  color: #ffffff;
}

.topup-icon-badge svg {
  width: 1.3rem;
  height: 1.3rem;
}

.topup-icon-badge--upi {
  background: #097939;
}

.topup-icon-badge--bank {
  background: #475569;
}

.topup-icon-badge--usdt {
  background: #26a17b;
}

.topup-icon-badge--eth {
  background: #627eea;
}

.topup-icon-badge--upi-instant {
  background: #16a34a;
}

.topup-icon-badge--card {
  background: #4f46e5;
}

.topup-instant-pill {
  margin-left: 0.1rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.14);
  color: #15803d;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.topup-fee-note {
  margin: 0.2rem 0 0.9rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.topup-fee-summary {
  margin: 0.8rem 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
}

.topup-fee-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.2rem 0;
}

.topup-fee-summary dt,
.topup-fee-summary dd {
  margin: 0;
}

.topup-fee-summary__total {
  margin-top: 0.35rem;
  padding-top: 0.5rem !important;
  border-top: 1px solid var(--border);
  font-weight: 700;
}

.topup-method-radio:checked + .topup-method-btn .topup-instant-pill {
  background: rgba(255, 255, 255, 0.22);
  color: inherit;
}

.topup-icon-badge--generic {
  background: var(--muted);
}

.topup-method-radio:checked + .topup-method-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}

.topup-panel {
  display: none;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* Radios and panels are siblings, both direct children of .topup-methods
   — the fixed, known set of method ids each get their own visibility
   rule (the set of possible payment methods is a small closed list, not
   arbitrary user data, so static rules per id are safe here). */
#method-upi:checked ~ #panel-upi,
#method-bank:checked ~ #panel-bank,
#method-bep20:checked ~ #panel-bep20,
#method-trc20:checked ~ #panel-trc20,
#method-eth:checked ~ #panel-eth,
#method-razorpay:checked ~ #panel-razorpay,
#method-razorpay_intl:checked ~ #panel-razorpay_intl {
  display: block;
}

.topup-submit-form {
  margin-top: 0;
}

.topup-step {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.topup-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 700;
  font-size: 0.85rem;
}

.topup-step-body {
  flex: 1;
  min-width: 0;
}

.topup-step-title {
  margin: 0.2rem 0 0.85rem;
  font-weight: 700;
  font-size: 1rem;
}

.topup-pay-card {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.topup-qr {
  flex-shrink: 0;
  width: 160px;
  background: #ffffff;
  border-radius: 0.6rem;
  padding: 0.6rem;
}

.topup-qr svg {
  width: 100%;
  height: auto;
}

.topup-qr-caption {
  margin: 0.5rem 0 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  width: 160px;
}

.topup-pay-details {
  flex: 1;
  min-width: 14rem;
}

.topup-detail-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin: 0 0 1rem;
}

.topup-detail-list dt {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.topup-detail-list dd {
  margin: 0.15rem 0 0;
  font-weight: 600;
  font-size: 0.95rem;
}

.topup-address {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  word-break: break-all;
}

.topup-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* ---- Android app: header "App" button + /app download page ---- */
.app-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 2.25rem;
  padding: 0 0.85rem 0 0.7rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--header-border));
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--header-fg);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.app-btn:hover { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.app-btn svg { width: 1.05rem; height: 1.05rem; }

@media (max-width: 700px) {
  /* Row 2, right side, just left of the theme toggle. */
  .header-top > .app-btn {
    grid-row: 2;
    grid-column: 3;
    justify-self: end;
    margin-right: 2.75rem;
    height: 2.25rem;
  }
}

.app-dl {
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.app-dl h1 { margin: 0.75rem 0 0.5rem; font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.15; }
.app-dl h2 { margin: 0 0 0.75rem; font-size: 1.1rem; }
.app-dl-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  padding: 2rem;
  border-radius: 1.25rem;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 85% 15%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 55%),
    var(--surface);
}
.app-dl-icon { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); }
.app-dl-lead { margin: 0 0 1.25rem; color: var(--muted); line-height: 1.6; max-width: 34rem; }
.app-dl-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-bottom: 1rem; }
.app-dl-chip {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
}
.app-dl-muted { color: var(--muted); font-size: 0.9rem; line-height: 1.6; }
.app-dl-btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.8rem 1.4rem; font-size: 1rem; }
.app-dl-btn svg { width: 1.2rem; height: 1.2rem; }
.app-dl-qr { text-align: center; }
.app-dl-qr-box { background: #fff; padding: 10px; border-radius: 14px; display: inline-block; line-height: 0; }
.app-dl-qr-box svg { width: 180px; height: 180px; }
.app-dl-qr p { margin: 0.6rem 0 0; font-size: 0.8rem; color: var(--muted); }
.app-dl-shots {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 0.25rem 0.25rem 0.75rem;
  scroll-snap-type: x mandatory;
}
.app-dl-shots img {
  flex: 0 0 auto;
  width: 220px;
  height: auto;
  border-radius: 1.25rem;
  border: 1px solid var(--border);
  scroll-snap-align: start;
}
.app-dl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.app-dl-card { padding: 1.5rem; border-radius: 1rem; border: 1px solid var(--border); background: var(--surface); }
.app-dl-card p { margin: 0; }
.app-dl-steps { margin: 0 0 1rem; padding-left: 1.25rem; line-height: 1.7; }
.app-dl-steps li { margin-bottom: 0.4rem; }
.app-dl-notes { white-space: pre-line; color: var(--muted); line-height: 1.6; }
.app-dl-old-title { margin: 1.5rem 0 0.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); font-size: 1rem; }
.app-dl-old { border: 1px solid var(--border); border-radius: 0.75rem; padding: 0.6rem 0.9rem; margin-top: 0.5rem; }
.app-dl-old summary { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; list-style: none; }
.app-dl-old summary::-webkit-details-marker { display: none; }
.app-dl-old summary::after { content: "+"; margin-left: auto; color: var(--muted); font-weight: 700; }
.app-dl-old[open] summary::after { content: "−"; }
.app-dl-old .app-dl-notes { margin-top: 0.6rem; }
.app-dl-safe { border-color: color-mix(in srgb, #f59e0b 45%, var(--border)); }
.app-dl-safe p { color: var(--muted); line-height: 1.6; }

.app-dl-trust {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}
.app-dl-trust li {
  padding: 0.9rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.app-dl-trust strong { font-size: 1rem; }
.app-dl-trust span { color: var(--muted); font-size: 0.8rem; }
.app-dl-section__title { margin: 0.5rem 0 0.9rem; font-size: 1.35rem !important; }
.app-dl-benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.app-dl-benefit {
  padding: 1.25rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
}
.app-dl-benefit h3 { margin: 0.8rem 0 0.35rem; font-size: 1rem; }
.app-dl-benefit p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.6; }
.app-dl-benefit__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
}
.app-dl-benefit__icon svg { width: 1.3rem; height: 1.3rem; }
.app-dl-faq { border-top: 1px solid var(--border); padding: 0.7rem 0; }
.app-dl-faq:first-of-type { border-top: 0; padding-top: 0; }
.app-dl-faq summary { cursor: pointer; font-weight: 600; line-height: 1.5; }
.app-dl-faq p { margin: 0.5rem 0 0 !important; color: var(--muted); line-height: 1.6; font-size: 0.92rem; }

@media (max-width: 900px) {
  .app-dl-benefits { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .app-dl-hero { grid-template-columns: 1fr; padding: 1.5rem; }
  .app-dl-trust { grid-template-columns: repeat(2, 1fr); }
  .app-dl-benefits { grid-template-columns: 1fr; }
  .app-dl-qr { display: none; }
  .app-dl-grid { grid-template-columns: 1fr; }
  .app-dl-btn { width: 100%; justify-content: center; }
  .app-dl-shots img { width: 180px; }
}

/* Cloudflare Turnstile on login/register (only rendered when admin turns it on). */
.auth-captcha { display: flex; justify-content: center; margin: 0.25rem 0 0.75rem; min-height: 65px; }
.auth-captcha .cf-turnstile { width: 100%; }

.rental-info {
  margin: 1rem 0 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  font-size: 0.9rem;
}

.rental-info p {
  margin: 0.35rem 0 0;
}

.rental-info__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.rental-info__ok {
  color: #22c55e;
  font-weight: 600;
}

.rental-info__busy {
  color: #f59e0b;
  font-weight: 600;
}

.rental-box__text {
  margin: 0.4rem 0 0.75rem;
}

.rental-box__copy {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.rental-box__warning {
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.08);
  font-size: 0.85rem;
  line-height: 1.5;
}

.auth-forgot {
  margin: -0.35rem 0 0.75rem;
  text-align: right;
  font-size: 0.85rem;
}

/* ---- /renewals ---- */
.renewals-page { max-width: 820px; width: 100%; margin: 0 auto; padding: 2rem 1rem 3rem; }
.renewals-page h1 { margin: 0 0 0.4rem; }
.renewals { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.25rem; }
.renewal {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.1rem; border-radius: 0.9rem; border: 1px solid var(--border); background: var(--surface);
  border-left-width: 4px;
}
.renewal__main { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.renewal__name { font-size: 1rem; }
.renewal__meta, .renewal__expiry { color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }
.renewal__side { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }
.renewal__left { font-weight: 700; font-size: 0.9rem; white-space: nowrap; }
.renewal--ok { border-left-color: #16a34a; } .renewal--ok .renewal__left { color: #16a34a; }
.renewal--soon { border-left-color: #f59e0b; } .renewal--soon .renewal__left { color: #d97706; }
.renewal--urgent { border-left-color: #dc2626; } .renewal--urgent .renewal__left { color: #dc2626; }
.renewal--expired { border-left-color: var(--muted); opacity: 0.85; } .renewal--expired .renewal__left { color: var(--muted); }
@media (max-width: 600px) {
  .renewal { flex-direction: column; align-items: flex-start; }
  .renewal__side { width: 100%; justify-content: space-between; }
}

/* ---------------------------------------------------------------- live chat widget */
.mdu-chat-launcher {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 95;
  width: 3.5rem;
  height: 3.5rem;
  border: 0;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-fg);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.mdu-chat-launcher:hover { transform: scale(1.06); }
.mdu-chat-launcher svg { width: 1.6rem; height: 1.6rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.mdu-chat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25rem;
  text-align: center;
}
.mdu-chat-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 5.5rem;
  z-index: 96;
  width: min(380px, calc(100vw - 2rem));
  height: min(600px, calc(100vh - 7rem));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg);
  color: var(--fg);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.mdu-chat-panel[hidden] { display: none; }
.mdu-chat-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 0.9rem;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.mdu-chat-head-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.mdu-chat-head-text strong { font-size: 1rem; }
.mdu-chat-sub { font-size: 0.78rem; opacity: 0.85; }
.mdu-chat-head button {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 0.35rem 0.6rem;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}
.mdu-chat-head button:hover { background: rgba(255, 255, 255, 0.28); }
.mdu-chat-head button[hidden] { display: none; }
.mdu-chat-head svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.mdu-chat-close { padding: 0.35rem !important; }
.mdu-chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.9rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: var(--bg);
}
.mdu-msg { display: flex; flex-direction: column; max-width: 85%; }
.mdu-msg-in { align-self: flex-start; }
.mdu-msg-out { align-self: flex-end; align-items: flex-end; }
.mdu-bubble {
  padding: 0.55rem 0.75rem;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.mdu-msg-in .mdu-bubble { background: var(--surface); border: 1px solid var(--border); border-top-left-radius: 4px; }
.mdu-msg-out .mdu-bubble { background: var(--accent); color: var(--accent-fg); border-top-right-radius: 4px; }
.mdu-meta { margin-top: 0.2rem; font-size: 0.7rem; color: var(--muted); }
.mdu-msg-system { align-self: center; font-size: 0.78rem; color: var(--muted); text-align: center; padding: 0.2rem 0.6rem; }
.mdu-buttons { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.55rem; }
.mdu-choice {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  text-align: center;
  cursor: pointer;
}
.mdu-choice:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 20%, var(--surface)); }
.mdu-choice:disabled { cursor: default; opacity: 0.55; }
.mdu-media { display: block; max-width: 100%; border-radius: 10px; margin-bottom: 0.35rem; }
.mdu-media img { display: block; max-width: 100%; border-radius: 10px; }
.mdu-file { display: inline-block; margin-bottom: 0.35rem; color: inherit; text-decoration: underline; }
.mdu-chat-typing { padding: 0 0.9rem 0.3rem; font-size: 0.75rem; color: var(--muted); }
.mdu-chat-typing[hidden] { display: none; }
.mdu-chat-form { border-top: 1px solid var(--border); padding: 0.6rem; background: var(--surface); display: flex; flex-direction: column; gap: 0.45rem; }
.mdu-chat-guest { display: grid; grid-template-columns: 1fr 1.4fr; gap: 0.4rem; }
.mdu-chat-guest[hidden] { display: none; }
.mdu-chat-guest input, .mdu-chat-row textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-size: 0.9rem;
  padding: 0.5rem 0.65rem;
}
.mdu-chat-guest input:focus, .mdu-chat-row textarea:focus { outline: none; border-color: var(--accent); }
.mdu-chat-row { display: flex; align-items: flex-end; gap: 0.4rem; }
.mdu-chat-row textarea { resize: none; max-height: 8rem; }
.mdu-chat-send {
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-fg);
  background: var(--accent);
  cursor: pointer;
}
.mdu-chat-send svg { width: 1.15rem; height: 1.15rem; fill: currentColor; }
.mdu-chat-note { font-size: 0.78rem; color: #ef4444; }
.mdu-chat-note[hidden] { display: none; }

/* WhatsApp button shown (Admin toggle): chat button and window sit above it. */
.whatsapp-float-btn ~ .mdu-chat-launcher { bottom: 5.5rem; }
.whatsapp-float-btn ~ .mdu-chat-panel { bottom: 9.75rem; height: min(600px, calc(100vh - 11rem)); }

@media (max-width: 700px) {
  .mdu-chat-launcher { right: 1rem; bottom: 1rem; width: 3rem; height: 3rem; }
  .whatsapp-float-btn ~ .mdu-chat-launcher { bottom: 4.75rem; }
  .whatsapp-float-btn ~ .mdu-chat-panel { bottom: 0.5rem; height: calc(100dvh - 1rem); }
  .mdu-chat-panel { right: 0.5rem; left: 0.5rem; bottom: 0.5rem; width: auto; height: calc(100dvh - 1rem); }
}
.mdu-chat-send[hidden], .mdu-chat-tool[hidden], .mdu-chat-row[hidden] { display: none; }
.mdu-chat-tool {
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}
.mdu-chat-tool:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.mdu-chat-tool svg, .mdu-chat-mic svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mdu-chat-rec { display: flex; align-items: center; gap: 0.5rem; }
.mdu-chat-rec[hidden] { display: none; }
.mdu-rec-dot { width: 0.65rem; height: 0.65rem; border-radius: 999px; background: #ef4444; animation: mdu-rec-blink 1s ease-in-out infinite; }
.mdu-rec-time { font-variant-numeric: tabular-nums; font-weight: 600; }
.mdu-rec-label { flex: 1; color: var(--muted); font-size: 0.85rem; }
@keyframes mdu-rec-blink { 50% { opacity: 0.25; } }
.mdu-audio { display: block; width: 240px; max-width: 100%; height: 40px; margin-bottom: 0.35rem; }

/* Live chat: new message slide-in, "typing…" dots, "Seen". */
.mdu-anim { animation: mdu-in 0.28s ease-out both; }
.mdu-msg-out.mdu-anim { animation-name: mdu-in-right; }
@keyframes mdu-in { from { opacity: 0; transform: translate(-8px, 6px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes mdu-in-right { from { opacity: 0; transform: translate(8px, 6px) scale(0.98); } to { opacity: 1; transform: none; } }
.mdu-typing { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.75rem 0.9rem; }
.mdu-dot { width: 0.45rem; height: 0.45rem; border-radius: 999px; background: var(--muted); animation: mdu-bounce 1.2s ease-in-out infinite; }
.mdu-dot:nth-child(2) { animation-delay: 0.15s; }
.mdu-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes mdu-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.45; } 30% { transform: translateY(-0.35rem); opacity: 1; } }
.mdu-meta.is-seen { color: var(--accent); }
@media (prefers-reduced-motion: reduce) {
  .mdu-anim, .mdu-dot { animation: none; }
}

/* ---- /app trust section ---- */
.app-secure {
  display: flex; align-items: center; gap: 1.5rem; margin: 1.25rem 0;
  padding: 1.5rem; border-radius: 1rem; border: 1px solid color-mix(in srgb, #22c55e 40%, var(--border));
  background: linear-gradient(135deg, color-mix(in srgb, #22c55e 10%, var(--surface)), var(--surface));
}
.app-secure__shield { position: relative; flex: 0 0 96px; width: 96px; height: 96px; display: grid; place-items: center; }
.app-secure__shield svg { position: relative; width: 72px; height: 72px; z-index: 1; }
.app-secure__body { fill: color-mix(in srgb, #22c55e 18%, transparent); stroke: #22c55e; stroke-width: 3; stroke-linejoin: round; }
.app-secure__tick {
  fill: none; stroke: #22c55e; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 40; stroke-dashoffset: 40; animation: app-tick 0.9s 0.4s ease-out forwards;
}
.app-secure__ring {
  position: absolute; inset: 8px; border-radius: 50%; border: 2px solid #22c55e; opacity: 0;
  animation: app-ring 2.6s ease-out infinite;
}
.app-secure__ring--2 { animation-delay: 1.3s; }
.app-secure__text h2 { margin: 0 0 0.6rem !important; font-size: 1.25rem !important; }
.app-secure__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.app-secure__list li { position: relative; padding-left: 1.6rem; color: var(--muted); line-height: 1.5; font-size: 0.93rem; }
.app-secure__list li::before {
  content: ""; position: absolute; left: 0; top: 0.2rem; width: 1rem; height: 1rem; border-radius: 50%;
  background: #22c55e url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 70% no-repeat;
}
@keyframes app-tick { to { stroke-dashoffset: 0; } }
@keyframes app-ring { 0% { transform: scale(0.7); opacity: 0.7; } 100% { transform: scale(1.35); opacity: 0; } }

.app-stats { list-style: none; margin: 0 0 0.75rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.app-stats li { padding: 1.1rem 1.25rem; border-radius: 1rem; border: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; gap: 0.2rem; }
.app-stats strong { font-size: 1.9rem; line-height: 1.1; color: var(--accent); font-variant-numeric: tabular-nums; }
.app-stats span { color: var(--muted); font-size: 0.88rem; }
/* In the hero, under Download APK: one compact line. */
.app-stats--hero { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.1rem 0 0; }
.app-stats--hero li { flex-direction: row; align-items: baseline; gap: 0.45rem; padding: 0.55rem 0.95rem; border-radius: 999px; }
.app-stats--hero strong { font-size: 1.15rem; }
.app-stats--hero span { font-size: 0.86rem; }
.app-live { display: flex; align-items: center; gap: 0.55rem; margin: 0 0 1.25rem; color: var(--muted); font-size: 0.92rem; }
.app-live strong { color: var(--fg); font-variant-numeric: tabular-nums; }
.app-live__dot { width: 10px; height: 10px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); animation: app-live 1.8s infinite; }
@keyframes app-live { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); } 70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

@media (max-width: 640px) {
  .app-secure { flex-direction: column; text-align: left; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .app-secure__tick { animation: none; stroke-dashoffset: 0; }
  .app-secure__ring, .app-live__dot { animation: none; }
}

/* Invoices: wallet credit next to the rupees paid (no inline styles under the CSP). */
.invoice-credit { opacity: 0.65; font-size: 0.85em; }

/* ---------------------------------------------------------------- file library (/library) */
.lib-page { max-width: var(--max-width); width: 100%; margin: 0 auto; padding: 1.75rem 1rem 3rem; box-sizing: border-box; }
.lib-page--narrow { max-width: 720px; }
.lib-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.lib-head h1 { margin: 0 0 0.35rem; font-size: 1.75rem; }
.lib-eyebrow { color: var(--accent); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 0.4rem; }
.lib-sub { color: var(--muted); margin: 0; max-width: 60ch; font-size: 0.92rem; }
.lib-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.lib-side { display: flex; flex-direction: column; gap: 0.75rem; position: sticky; top: 1rem; }
.lib-side__title { margin: 0.4rem 0 0; color: var(--muted); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.lib-side__group { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 0.9rem; padding: 0.35rem; }
.lib-side__link { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.5rem 0.65rem; border-radius: 0.6rem; color: var(--fg); text-decoration: none; font-size: 0.88rem; min-width: 0; }
.lib-side__link > span:first-child { display: flex; align-items: center; gap: 0.5rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-side__link:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.lib-side__link.active { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-weight: 600; }
.lib-side__folder svg { width: 16px; height: 16px; flex-shrink: 0; color: #f59e0b; }
.lib-count { color: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.lib-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: #64748b; }
.lib-storage { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.75rem 0.9rem; border: 1px solid var(--border); border-radius: 0.9rem; background: var(--surface); font-size: 0.8rem; }
.lib-storage span { color: var(--muted); }

.lib-plan { display: flex; flex-direction: column; gap: 0.75rem; padding: 1rem; border-radius: 0.9rem; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), color-mix(in srgb, var(--accent-2) 8%, var(--surface))); }
.lib-plan--wide { margin-bottom: 1.25rem; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.lib-plan__head { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.lib-plan__label { color: var(--muted); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.lib-plan__head strong { font-size: 1.05rem; overflow-wrap: anywhere; }
.lib-plan__days { color: var(--muted); font-size: 0.8rem; }
.lib-plan__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 0.5rem; }
.lib-plan__stats > div { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.5rem 0.6rem; border-radius: 0.6rem; background: var(--surface); border: 1px solid var(--border); }
.lib-plan__stats span { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; }
.lib-plan__stats strong { font-size: 0.95rem; }
.lib-plan--wide .lib-plan__stats { flex: 1 1 320px; }
.lib-plan__btn { display: block; }

.lib-main { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.lib-toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.6rem; border: 1px solid var(--border); border-radius: 0.9rem; background: var(--surface); }
.lib-toolbar input, .lib-toolbar select { font: inherit; font-size: 0.88rem; color: var(--fg); background: var(--bg); border: 1px solid var(--border); border-radius: 0.6rem; padding: 0.5rem 0.65rem; min-width: 0; }
.lib-search { flex: 1 1 220px; }
.lib-toolbar button, .lib-confirm button, .lib-plan-card button { font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; }

.lib-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem; font-size: 0.9rem; min-width: 0; }
.lib-crumb { color: var(--muted); text-decoration: none; padding: 0.25rem 0.5rem; border-radius: 0.5rem; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.lib-crumb:hover { color: var(--fg); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.lib-crumb--current { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); font-weight: 600; }
.lib-sep { color: var(--muted); }
.lib-up { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 0.5rem; border: 1px solid var(--border); background: var(--surface); color: var(--fg); }
.lib-up svg { width: 16px; height: 16px; }
.lib-up.is-disabled { opacity: 0.4; }
.lib-clear { font-size: 0.85rem; color: var(--accent); }

.lib-folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.65rem; }
.lib-folder { display: flex; align-items: center; gap: 0.75rem; padding: 0.8rem; border-radius: 0.9rem; border: 1px solid var(--border); background: var(--surface); color: var(--fg); text-decoration: none; min-width: 0; transition: border-color 0.15s, transform 0.15s; }
.lib-folder:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); transform: translateY(-1px); }
.lib-folder__icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 0.7rem; flex-shrink: 0; color: #fff; background: linear-gradient(135deg, #fbbf24, #f97316); }
.lib-folder__icon svg { width: 20px; height: 20px; }
.lib-folder--c1 .lib-folder__icon { background: linear-gradient(135deg, #38bdf8, #2563eb); }
.lib-folder--c2 .lib-folder__icon { background: linear-gradient(135deg, #34d399, #0d9488); }
.lib-folder--c3 .lib-folder__icon { background: linear-gradient(135deg, #fb7185, #dc2626); }
.lib-folder--c4 .lib-folder__icon { background: linear-gradient(135deg, #a78bfa, #4f46e5); }
.lib-folder--c5 .lib-folder__icon { background: linear-gradient(135deg, #22d3ee, #0891b2); }
.lib-folder--c6 .lib-folder__icon { background: linear-gradient(135deg, #e879f9, #db2777); }
.lib-folder--c7 .lib-folder__icon { background: linear-gradient(135deg, #a3e635, #16a34a); }
.lib-folder__text { display: flex; flex-direction: column; min-width: 0; }
.lib-folder__text strong { font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-folder__text span { color: var(--muted); font-size: 0.75rem; }

.lib-files { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 0.9rem; background: var(--surface); overflow: hidden; }
.lib-file { display: flex; align-items: center; gap: 0.85rem; padding: 0.75rem 0.9rem; border-top: 1px solid var(--border); min-width: 0; }
.lib-file:first-child { border-top: 0; }
.lib-file__main { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; flex: 1; }
.lib-file__name { color: var(--fg); font-weight: 600; font-size: 0.92rem; text-decoration: none; overflow-wrap: anywhere; }
a.lib-file__name:hover { color: var(--accent); }
.lib-file__side { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }
.lib-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; color: var(--muted); font-size: 0.78rem; }
.lib-meta__path { color: var(--muted); font-size: 0.75rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; margin: 0; }
.lib-tile { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 0.7rem; flex-shrink: 0; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.04em; color: #64748b; background: color-mix(in srgb, currentColor 15%, transparent); }
.lib-tile--documents { color: #e11d48; } .lib-dot--documents { background: #e11d48; }
.lib-tile--images { color: #db2777; } .lib-dot--images { background: #db2777; }
.lib-tile--audio { color: #7c3aed; } .lib-dot--audio { background: #7c3aed; }
.lib-tile--video { color: #ea580c; } .lib-dot--video { background: #ea580c; }
.lib-tile--archives { color: #d97706; } .lib-dot--archives { background: #d97706; }
.lib-tile--apps { color: #0891b2; } .lib-dot--apps { background: #0891b2; }
.lib-tile--code { color: #059669; } .lib-dot--code { background: #059669; }
.lib-chip { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.1rem 0.5rem; border-radius: 999px; border: 1px solid var(--border); font-size: 0.72rem; }
.lib-chip svg { width: 12px; height: 12px; }
.lib-chip--pass { color: #16a34a; border-color: color-mix(in srgb, #16a34a 40%, var(--border)); }
.lib-chip--pass code { font-size: 0.75rem; user-select: all; }
.lib-badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.lib-badge svg { width: 12px; height: 12px; }
.lib-badge--free { color: #16a34a; background: color-mix(in srgb, #16a34a 12%, transparent); }
.lib-badge--plan { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.lib-badge--price { color: #d97706; background: color-mix(in srgb, #f59e0b 14%, transparent); }
.lib-dl, .lib-confirm__actions .btn { display: inline-flex; align-items: center; gap: 0.4rem; }
.lib-dl svg, .lib-confirm__actions svg { width: 15px; height: 15px; }
.lib-empty { padding: 2.5rem 1rem; text-align: center; border: 1px dashed var(--border); border-radius: 0.9rem; color: var(--muted); }
.lib-empty strong { color: var(--fg); font-size: 1rem; }
.lib-empty p { margin: 0.35rem 0 0; font-size: 0.88rem; }
.lib-pager { display: flex; align-items: center; justify-content: center; gap: 0.75rem; flex-wrap: wrap; }
.lib-pager a.pagination-btn { text-decoration: none; }
.lib-pager .pagination-btn.is-disabled { opacity: 0.45; pointer-events: none; }

.lib-confirm { display: flex; flex-direction: column; gap: 1rem; padding: 1.5rem; border: 1px solid var(--border); border-radius: 1.1rem; background: var(--surface); box-shadow: 0 20px 50px -30px rgba(15, 23, 42, 0.45); }
.lib-confirm__file { display: flex; gap: 1rem; align-items: flex-start; }
.lib-confirm__file .lib-tile { width: 56px; height: 56px; font-size: 0.75rem; }
.lib-confirm__name { margin: 0; font-size: 1.2rem; overflow-wrap: anywhere; }
.lib-confirm__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.lib-confirm__actions form { margin: 0; }
.lib-confirm .auth-switch { margin: 0; }
.lib-access { margin: 0; padding: 0.7rem 0.85rem; border-radius: 0.7rem; font-size: 0.88rem; border: 1px solid var(--border); }
.lib-access--free { color: #16a34a; background: color-mix(in srgb, #16a34a 8%, transparent); }
.lib-access--plan { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.lib-access--price { background: color-mix(in srgb, #f59e0b 8%, transparent); }
.lib-access--warn { color: #dc2626; background: color-mix(in srgb, #dc2626 8%, transparent); }
.lib-notice { margin: 0 0 1rem; padding: 0.7rem 0.85rem; border-radius: 0.7rem; font-size: 0.88rem; border: 1px solid var(--border); }
.lib-confirm .lib-notice { margin: 0; }
.lib-notice--error { color: #dc2626; background: color-mix(in srgb, #dc2626 8%, transparent); border-color: color-mix(in srgb, #dc2626 35%, var(--border)); }
.lib-notice--ok { color: #16a34a; background: color-mix(in srgb, #16a34a 8%, transparent); border-color: color-mix(in srgb, #16a34a 35%, var(--border)); }

.lib-plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.9rem; }
.lib-plan-card { display: flex; flex-direction: column; gap: 0.75rem; padding: 1.1rem; border: 1px solid var(--border); border-radius: 1rem; background: var(--surface); }
.lib-plan-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.lib-plan-card__head strong { font-size: 1.05rem; overflow-wrap: anywhere; }
.lib-plan-card__head span { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.lib-plan-card__desc { margin: 0; color: var(--muted); font-size: 0.85rem; }
.lib-plan-card__price { font-size: 1.6rem; font-weight: 800; }
.lib-plan-card form, .lib-plan-card form .btn, .lib-plan-card > .btn { width: 100%; margin: 0; box-sizing: border-box; }
.lib-plan-card form .btn, .lib-plan-card > .btn { display: block; }

@media (max-width: 900px) {
  .lib-layout { grid-template-columns: 1fr; }
  .lib-side { position: static; }
}
@media (max-width: 600px) {
  .lib-file { flex-wrap: wrap; }
  .lib-file__side { width: 100%; justify-content: space-between; padding-left: calc(44px + 0.85rem); box-sizing: border-box; }
  .lib-toolbar select { flex: 1 1 30%; }
  .lib-head h1 { font-size: 1.4rem; }
}

/* -- file library: roomier sizing (overrides the base block above) -- */
.lib-page { max-width: 1480px; padding: 2rem 1.5rem 3.5rem; }
.lib-page--narrow { max-width: 820px; }
.lib-head { margin-bottom: 1.75rem; }
.lib-head h1 { font-size: 2.2rem; }
.lib-eyebrow { font-size: 0.85rem; }
.lib-sub { font-size: 1.02rem; max-width: 70ch; line-height: 1.5; }
.lib-layout { grid-template-columns: 310px minmax(0, 1fr); gap: 1.75rem; }
.lib-side { gap: 1rem; }
.lib-side__title { font-size: 0.8rem; }
.lib-side__group { padding: 0.45rem; border-radius: 1rem; }
.lib-side__link { padding: 0.7rem 0.85rem; font-size: 1rem; border-radius: 0.7rem; }
.lib-side__folder svg { width: 19px; height: 19px; }
.lib-count { font-size: 0.85rem; }
.lib-dot { width: 10px; height: 10px; }
.lib-storage { padding: 0.9rem 1rem; font-size: 0.92rem; }
.lib-plan { padding: 1.2rem; gap: 0.9rem; border-radius: 1rem; }
.lib-plan__label { font-size: 0.78rem; }
.lib-plan__head strong { font-size: 1.3rem; }
.lib-plan__days { font-size: 0.9rem; }
.lib-plan__stats > div { padding: 0.65rem 0.75rem; }
.lib-plan__stats span { font-size: 0.75rem; }
.lib-plan__stats strong { font-size: 1.1rem; }
.lib-plan__btn, .lib-plan-card .btn { font-size: 0.98rem; padding: 0.7rem 1rem; }

.lib-main { gap: 1.25rem; }
.lib-toolbar { padding: 0.75rem; gap: 0.65rem; border-radius: 1rem; }
.lib-toolbar input, .lib-toolbar select { font-size: 1rem; padding: 0.7rem 0.85rem; border-radius: 0.7rem; }
.lib-toolbar button { font-size: 1rem; padding: 0.7rem 1.4rem; }
.lib-crumbs { font-size: 1.02rem; }
.lib-up { width: 38px; height: 38px; }
.lib-up svg { width: 18px; height: 18px; }
.lib-section { display: flex; align-items: center; gap: 0.5rem; margin: 0.4rem 0 -0.4rem; font-size: 1.1rem; font-weight: 700; }
.lib-section span { color: var(--muted); font-size: 0.85rem; font-weight: 600; padding: 0.1rem 0.55rem; border-radius: 999px; border: 1px solid var(--border); }

.lib-folders { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0.9rem; }
.lib-folder { padding: 1.05rem 1.1rem; gap: 0.95rem; border-radius: 1rem; }
.lib-folder__icon { width: 52px; height: 52px; border-radius: 0.85rem; }
.lib-folder__icon svg { width: 26px; height: 26px; }
.lib-folder__text strong { font-size: 1.08rem; }
.lib-folder__text span { font-size: 0.88rem; margin-top: 0.15rem; }

.lib-files { border-radius: 1rem; }
.lib-file { padding: 1.05rem 1.25rem; gap: 1.1rem; }
.lib-file:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.lib-file__main { gap: 0.4rem; }
.lib-file__name { font-size: 1.08rem; }
.lib-meta { font-size: 0.9rem; gap: 0.3rem 1rem; }
.lib-meta__path { font-size: 0.85rem; }
.lib-tile { width: 54px; height: 54px; font-size: 0.78rem; border-radius: 0.85rem; }
.lib-tile--link { color: var(--accent); }
.lib-tile svg { width: 24px; height: 24px; }
.lib-chip { font-size: 0.82rem; padding: 0.15rem 0.6rem; }
.lib-chip--pass code { font-size: 0.85rem; }
.lib-badge { font-size: 0.85rem; padding: 0.3rem 0.75rem; }
.lib-file__side { gap: 0.85rem; }
.lib-dl, .lib-confirm__actions .btn { font-size: 0.98rem; padding: 0.65rem 1.2rem; }
.lib-dl svg, .lib-confirm__actions svg { width: 18px; height: 18px; }
.lib-empty { padding: 3rem 1rem; }
.lib-empty strong { font-size: 1.15rem; }
.lib-empty p { font-size: 0.98rem; }
.lib-pager .pagination-btn, .lib-pager .pagination-label { font-size: 0.95rem; }

.lib-confirm { padding: 2rem; gap: 1.2rem; }
.lib-confirm__file .lib-tile { width: 68px; height: 68px; font-size: 0.9rem; }
.lib-confirm__name { font-size: 1.5rem; }
.lib-access, .lib-notice { font-size: 0.98rem; padding: 0.85rem 1rem; }
.lib-plan-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.1rem; }
.lib-plan-card { padding: 1.4rem; }
.lib-plan-card__head strong { font-size: 1.25rem; }
.lib-plan-card__price { font-size: 2rem; }

@media (max-width: 1100px) {
  .lib-layout { grid-template-columns: 270px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .lib-layout { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .lib-page { padding: 1.25rem 1rem 2.5rem; }
  .lib-head h1 { font-size: 1.6rem; }
  .lib-file { padding: 0.9rem 1rem; }
  .lib-file__side { padding-left: calc(54px + 1.1rem); }
  .lib-folders { grid-template-columns: 1fr; }
}
