/* GFX Vote design tokens (decided 2026-11-04).
   Style direction taken from a reference poll site (strawpoll.com, analysed with REA):
   Tailwind's open-source gray + indigo palette, Inter-first font stack, white form
   card with a thin warm accent strip, centred page title, 6px radius, indigo focus ring.
   Only the visual language is reused: no logo, brand name, images or CSS from that site.
   Spacing scale: 4 / 8 / 16 / 24 (32 / 48 only for section padding).
   Radius: surface + control 6px, badge full. */
:root {
  --bg: #f9fafb;              /* gray-50 */
  --surface: #ffffff;
  --surface-sunken: #f3f4f6;  /* gray-100 */
  --border: #e5e7eb;          /* gray-200: cards, dividers, table rules */
  --border-strong: #9ca3af;   /* gray-400: input borders (one step darker than the reference, for contrast) */
  --text: #111827;            /* gray-900 */
  --label: #374151;           /* gray-700 */
  --text-muted: #6b7280;      /* gray-500 */
  --accent: #4f46e5;          /* indigo-600: buttons, active states, toggles */
  --accent-hover: #4338ca;    /* indigo-700 */
  --accent-fg: #ffffff;
  --accent-subtle: #eef2ff;   /* indigo-50 */
  --accent-subtle-text: #4338ca;
  --link: #4f46e5;
  --ring: #6366f1;            /* indigo-500 */
  --strip: #fbbf24;           /* amber-400: top strip of the main form card only */
  --control-border: #d1d5db;  /* gray-300: secondary buttons */
  --toggle-off: #d1d5db;
  --toggle-knob: #ffffff;
  --success-bg: #ecfdf5;
  --success-text: #047857;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-text: #b91c1c;
  --warn-bg: #fffbeb;
  --warn-text: #92400e;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 12px rgb(0 0 0 / 0.10);
  --r-surface: 6px;
  --r-control: 6px;
  /* Inter is used when installed; otherwise the platform UI font, which is close. */
  --font: "Inter", "Inter var", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111827;            /* gray-900 */
    --surface: #1f2937;       /* gray-800 */
    --surface-sunken: #273244;
    --border: #374151;        /* gray-700 */
    --border-strong: #6b7280; /* gray-500 */
    --text: #f3f4f6;          /* gray-100 */
    --label: #e5e7eb;         /* gray-200 */
    --text-muted: #9ca3af;    /* gray-400 */
    --accent: #4f46e5;        /* keep indigo-600 so white button text stays >= 4.5:1 */
    --accent-hover: #6366f1;
    --accent-fg: #ffffff;
    --accent-subtle: #312e81; /* indigo-900 */
    --accent-subtle-text: #e0e7ff;
    --link: #a5b4fc;          /* indigo-300 */
    --ring: #818cf8;          /* indigo-400 */
    --strip: #f59e0b;         /* amber-500 */
    --control-border: #6b7280;
    --toggle-off: #4b5563;
    --success-bg: #064e3b;
    --success-text: #a7f3d0;
    --danger: #ef4444;
    --danger-bg: #450a0a;
    --danger-text: #fecaca;
    --warn-bg: #422006;
    --warn-text: #fde68a;
    --shadow-sm: none;
    --shadow-md: 0 4px 16px rgb(0 0 0 / 0.5);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, p, ul, dl, dd, figure { margin: 0; }
h1 { font-size: 24px; line-height: 1.25; font-weight: 700; }
h2 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 12px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 8px 0; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: var(--r-control); }

.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.min-w-0 { min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 10; }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 0 24px; min-height: 64px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 18px; letter-spacing: -0.01em; color: var(--text); }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--label); padding: 8px 12px; border-radius: var(--r-control); font-weight: 500; min-height: 40px; display: inline-flex; align-items: center; }
.nav a:hover { color: var(--text); background: var(--surface-sunken); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent-subtle-text); background: var(--accent-subtle); }
.who { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* Page shell */
.page { max-width: 1280px; margin: 0 auto; padding: 24px 24px 48px; display: flex; flex-direction: column; gap: 24px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-header > div { display: flex; flex-direction: column; gap: 4px; }
.narrow { max-width: 680px; width: 100%; display: flex; flex-direction: column; gap: 24px; }
.back { font-weight: 500; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.section-head h2 { margin: 0; }

/* Surfaces */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-surface); box-shadow: var(--shadow-sm); }
/* Main form card: thin warm strip on top, as in the reference. Used once per page. */
.card-strip { border-top: 4px solid var(--strip); }
.divider { border: 0; border-top: 1px solid var(--border); margin: 0; }
.center { text-align: center; align-items: center; }
.lead { font-size: 16px; font-weight: 500; }
/* Form pages placed inside the signed-in shell stay centred. */
.page > .signup, .page > .auth-wrap { align-self: center; }
.section { padding: 24px; }
.narrow-card { max-width: 960px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: var(--r-control);
  border: 1px solid transparent; font: 500 14px/1 var(--font); cursor: pointer;
  white-space: nowrap; text-decoration: none; background: none; color: var(--text);
  transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-fg); box-shadow: var(--shadow-sm); }
.btn-wide { min-width: 240px; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); border-color: var(--control-border); color: var(--label); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--surface-sunken); }
.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-sunken); color: var(--text); }
.btn-voted { background: var(--accent-subtle); color: var(--accent-subtle-text); border-color: var(--accent-subtle); }
.btn-voted:hover { border-color: var(--accent); }
.btn-danger { background: var(--danger); color: var(--accent-fg); }
.btn-danger:hover { filter: brightness(0.95); }
.btn-danger-text { color: var(--danger-text); }
.btn-block { width: 100%; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; border: 0; padding: 0; margin: 0; }
label, legend { font-weight: 500; color: var(--label); padding: 0; }
input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]), textarea, select {
  width: 100%; min-height: 40px; padding: 8px 12px;
  font: 400 14px/1.4 var(--font); color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-control);
}
textarea { resize: vertical; }
select { appearance: none; cursor: pointer; padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.field-error { font-size: 12px; color: var(--danger-text); }
.file-preview { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.file-preview img { max-height: 240px; width: auto; align-self: flex-start; border: 1px solid var(--border); border-radius: var(--r-control); background: var(--surface-sunken); }
/* Busy submit button (JS sets aria-busy while the form is sending). */
.btn[aria-busy="true"] { cursor: progress; opacity: 0.85; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.check { display: inline-flex; gap: 8px; align-items: center; font-weight: 400; min-height: 40px; cursor: pointer; }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
/* On/off switch for single settings (e.g. "Offer at sign-up"). */
input[type="checkbox"].toggle {
  appearance: none; width: 44px; height: 24px; border-radius: 999px; cursor: pointer; flex: none;
  background: var(--toggle-off); position: relative; transition: background-color 150ms ease-out;
}
input[type="checkbox"].toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--toggle-knob); box-shadow: var(--shadow-sm); transition: transform 150ms ease-out;
}
input[type="checkbox"].toggle:checked { background: var(--accent); }
input[type="checkbox"].toggle:checked::after { transform: translateX(20px); }
.label-spacer { font-weight: 500; }
.choice-row { display: flex; gap: 16px; flex-wrap: wrap; }
input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.checks { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checks li { display: flex; flex-direction: column; gap: 4px; padding: 8px 16px; border-radius: var(--r-control); background: var(--warn-bg); color: var(--warn-text); }
.checks li .text-muted { color: inherit; opacity: 0.85; }
.checks a { color: inherit; text-decoration: underline; }
.checks li.hint { background: var(--surface-sunken); color: var(--text); }
.grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.signup { width: 100%; max-width: 736px; display: flex; flex-direction: column; gap: 32px; }
.page-title { text-align: center; display: flex; flex-direction: column; gap: 8px; }
.page-title h1 { font-size: 30px; line-height: 1.2; letter-spacing: -0.02em; }
.form-card { padding: 24px; display: flex; flex-direction: column; gap: 24px; }
.form-card h2 { font-size: 18px; font-weight: 600; margin: 0; }
input[type="file"] { padding: 6px 8px; color: var(--text-muted); cursor: pointer; }
input[type="file"]::file-selector-button {
  font: 500 14px/1 var(--font); color: var(--label); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--r-control);
  padding: 8px 12px; margin-right: 12px; cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: var(--surface-sunken); }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--ring); outline-offset: 0; border-color: var(--ring); }
/* Larger first field, like the reference's question input. */
input.input-lg { min-height: 48px; font-size: 16px; }
.help { font-size: 12px; color: var(--text-muted); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; align-items: flex-end; }
.form-actions.start { justify-content: flex-start; align-items: center; flex-wrap: wrap; gap: 16px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; align-items: end; }
.form-row .form-actions { grid-column: 1 / -1; }

/* Alerts and states */
.alert { padding: 8px 16px; border-radius: var(--r-control); border: 1px solid transparent; }
.alert-success { background: var(--success-bg); color: var(--success-text); }
.alert-danger { background: var(--danger-bg); color: var(--danger-text); }
.alert-warn { background: var(--warn-bg); color: var(--warn-text); }
.alert a { color: inherit; text-decoration: underline; }
.empty { padding: 48px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; border: 1px dashed var(--border); border-radius: var(--r-surface); }
.badge.badge-warn { background: var(--warn-bg); color: var(--warn-text); border-color: transparent; }
.badge.badge-ok { background: var(--success-bg); color: var(--success-text); border-color: transparent; }
.text-warn { color: var(--warn-text); }
.gallery-meta .badge { align-self: flex-start; margin-top: 4px; }
.badge { display: inline-block; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--surface-sunken); color: var(--text-muted); border: 1px solid var(--border); }

/* Toolbar */
.toolbar { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.search { display: flex; gap: 8px; flex: 1 1 320px; max-width: 480px; }

/* Product filter chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips a { display: inline-flex; gap: 8px; align-items: center; min-height: 40px; padding: 0 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-muted); font-weight: 500; }
.chips a:hover { color: var(--text); text-decoration: none; }
.chips a[aria-current="true"] { background: var(--accent-subtle); color: var(--accent-subtle-text); border-color: var(--accent-subtle); }
.proof { display: flex; justify-content: center; background: var(--surface-sunken); border-radius: var(--r-control); padding: 16px; }
.proof img { max-height: 60vh; width: auto; object-fit: contain; }

/* Filter panel: one field per column, wraps to one column on phones. */
.filters { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.filters-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); align-items: end; }
.filters-actions { display: flex; gap: 8px; align-items: center; }
.filters-more > summary { cursor: pointer; color: var(--link); font-weight: 500; min-height: 40px; display: flex; align-items: center; }
.filters-more[open] > summary { margin-bottom: 8px; }
/* Desktop: all column filters are always visible (app.js opens the panel). */
@media (min-width: 768px) { .filters-more > summary { display: none; } }

/* Sortable headers: aria-sort drives the arrow. */
th a.sort { color: inherit; display: inline-flex; align-items: center; gap: 4px; min-height: 24px; }
th a.sort:hover { color: var(--text); text-decoration: none; }
th a.sort::after { content: "\2195"; opacity: 0.35; font-size: 11px; }
th[aria-sort="ascending"] a.sort::after { content: "\2191"; opacity: 1; }
th[aria-sort="descending"] a.sort::after { content: "\2193"; opacity: 1; }
th[aria-sort="ascending"], th[aria-sort="descending"] { color: var(--text); }

/* Small proof thumbnail in tables. */
.thumb-sm { display: block; width: 56px; height: 56px; border-radius: var(--r-control); overflow: hidden; border: 1px solid var(--border); background: var(--surface-sunken); }
.thumb-sm img { width: 100%; height: 100%; object-fit: cover; color: transparent; font-size: 0; }

/* Upload gallery (affiliate history, affiliate detail). */
.gallery { list-style: none; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.gallery li { overflow: hidden; display: flex; flex-direction: column; }
.gallery-img { display: block; aspect-ratio: 3 / 4; background: var(--surface-sunken); border-bottom: 1px solid var(--border); }
.gallery-img img { width: 100%; height: 100%; object-fit: cover; color: transparent; font-size: 0; }
.gallery-meta { padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.today-upload { display: flex; flex-direction: column; gap: 8px; }
.today-upload .proof img { max-height: 360px; }

/* Collapsible card section. */
.disclosure summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 40px; }
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::after { content: "Show"; color: var(--link); font-size: 14px; font-weight: 500; }
.disclosure[open] summary::after { content: "Hide"; }

/* Image dialog (lightbox). */
.lightbox { padding: 0; border: 1px solid var(--border); border-radius: var(--r-surface); background: var(--surface); color: var(--text);
  width: min(960px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: var(--shadow-md); }
.lightbox[open] { display: flex; flex-direction: column; }
.lightbox::backdrop { background: rgb(17 24 39 / 0.75); }
.lightbox-bar { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--border); }
.lightbox-caption { font-weight: 600; margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox-body { display: flex; align-items: center; gap: 8px; padding: 16px; min-height: 0; background: var(--surface-sunken); }
.lightbox-img { flex: 1; min-width: 0; max-height: calc(100vh - 200px); object-fit: contain; margin: 0 auto; }
.lightbox-file { padding: 8px 16px; }
@media (max-width: 767px) {
  .lightbox { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
  .lightbox-body { flex: 1; flex-wrap: wrap; justify-content: center; }
  .lightbox-img { order: -1; flex-basis: 100%; max-height: calc(100dvh - 200px); }
  .lightbox-open { display: none; }
}

/* Detail pages */
.detail { display: grid; gap: 24px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1024px) { .detail { grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr); } }
.detail-single { max-width: 736px; }
@media (min-width: 1024px) { .detail-single { grid-template-columns: 1fr; } }
.preview { padding: 16px; display: flex; justify-content: center; background: var(--surface-sunken); }
.preview img { max-height: 70vh; width: auto; object-fit: contain; }
.preview-none { padding: 48px 16px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.kv { display: grid; grid-template-columns: minmax(96px, max-content) 1fr; border-top: 1px solid var(--border); }
.kv dt, .kv dd { padding: 8px 0; border-bottom: 1px solid var(--border); }
.kv dt { color: var(--text-muted); padding-right: 16px; }
.list { list-style: none; padding: 0; border-top: 1px solid var(--border); }
.list li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--border); }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-surface); }
table { width: 100%; border-collapse: collapse; }
th { font-size: 12px; font-weight: 500; color: var(--text-muted); text-align: left; background: var(--surface-sunken); position: sticky; top: 0; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.r { text-align: right; }
.cell-clip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Numbered pagination (template "pager"). */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pagination-links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pagination-numbers { display: inline-flex; align-items: center; gap: 4px; }
.page-num { min-width: 40px; padding: 0 8px; color: var(--label); border-color: var(--border); background: var(--surface); }
.page-num:hover { background: var(--surface-sunken); }
.page-num[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.pagination-gap { min-width: 24px; text-align: center; color: var(--text-muted); }
.btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
@media (max-width: 767px) {
  .pagination { flex-direction: column; align-items: stretch; }
  .pagination-links { justify-content: space-between; flex-wrap: nowrap; }
  /* Phones: Previous · current page · Next. */
  .pagination-numbers .page-num:not([aria-current]), .pagination-gap { display: none; }
}

/* Row action menu (details/summary, no JS needed) */
.menu { position: relative; display: inline-block; text-align: left; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
/* Panel opens in-flow so the scrolling table wrapper never clips it. */
.menu-panel { margin-top: 8px; width: 240px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-surface); box-shadow: var(--shadow-md); }
.menu-panel .btn { width: 100%; }

/* Auth */
.auth { display: flex; align-items: center; padding: 48px 16px; flex-direction: column; }
.auth-wrap { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 24px; }
.auth-card { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-surface); box-shadow: var(--shadow-sm); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.auth-card.card-strip { border-top: 4px solid var(--strip); }

@media (max-width: 900px) {
  .who .text-muted { display: none; }
}
/* Phones: brand + sign out on the first row, navigation scrolls on its own row. */
@media (max-width: 767px) {
  .topbar-inner { flex-wrap: wrap; row-gap: 0; }
  .who { order: 2; }
  .nav { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; margin: 0 -8px; padding-bottom: 4px; scrollbar-width: none; }
  .nav a { white-space: nowrap; }
}
/* Responsive tables: below 768px each row becomes a card with labelled fields. */
@media (max-width: 767px) {
  .table-wrap:has(.rtable) { border: 0; background: none; overflow: visible; }
  .rtable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable tr { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-surface); box-shadow: var(--shadow-sm); padding: 8px 16px; margin-bottom: 8px; }
  .rtable td { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--border); text-align: right; max-width: none; white-space: normal; }
  .rtable td.cell-clip { overflow: visible; text-overflow: clip; }
  .rtable tr td:last-child { border-bottom: 0; }
  .rtable td::before { content: attr(data-label); font-family: var(--font); color: var(--text-muted); font-size: 12px; font-weight: 500; text-align: left; flex: none; }
  .rtable td.r { text-align: right; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}

@media (max-width: 767px) {
  .topbar-inner { padding: 8px 16px; gap: 8px; }
  .page { padding: 16px 16px 48px; }
  input:not([type="radio"]):not([type="checkbox"]), textarea, select { font-size: 16px; min-height: 44px; }
  .auth { padding: 24px 16px; }
  .signup { gap: 24px; }
  .page-title h1 { font-size: 24px; }
  .form-card { padding: 16px; }
  .btn-wide { width: 100%; }
  .btn { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .spinner { animation-duration: 2s; }
}
