/*
 * Listaro — the public marketplace website (P4).
 *
 * Hand-written and served as a static file, like the admin panel's stylesheet:
 * the buyer is on shared hosting with no Node and no build step. Mobile first;
 * wider layouts are added with min-width queries. Directions are logical
 * (margin-inline-start, inset-inline-end, text-align: start), so Arabic lays
 * out right to left from the same rules. Brand tokens come from the app
 * (source/lib/theme/tokens.dart); the panel can override --accent.
 */

@font-face {
  font-family: "Inter";
  src: url("fonts/inter.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sora";
  src: url("fonts/sora.woff2") format("woff2");
  font-weight: 500 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --page: #f5f6f8;
  --surface: #ffffff;
  --ink: #0e1420;
  --ink-2: #5d6879;   /* 5.2:1 on --page, AA for body text */
  --ink-3: #6b7688;
  --line: #e4e7ec;
  --line-soft: #edeff3;
  --accent: #2f5bea;
  --accent-dark: #2445bc;
  --accent-tint: #eaeffe;
  --on-accent: #ffffff;
  --price: #e8533f;   /* brand red, used at 18.7px bold and up (large text, 3.7:1) */
  --price-ink: #c43d2a; /* the same red, darkened for small text (5.2:1) */
  --ok: #17a66b;
  --ok-tint: #e8f7f0;
  --ok-ink: #05603a;
  --warn: #f79009;
  --warn-tint: #fef4e6;
  --warn-ink: #8a4b00;
  --danger: #d92d20;
  --danger-tint: #fdecea;
  --danger-ink: #b42318;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(14, 20, 32, .06), 0 8px 24px rgba(14, 20, 32, .04);
  --shadow-lg: 0 12px 32px rgba(14, 20, 32, .12);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", Tahoma, sans-serif;
  --font-head: "Sora", var(--font);
  --header-h: 64px;
  color-scheme: light;
}

/* Arabic: Inter and Sora have no Arabic glyphs; the system's Arabic face reads better
   than a Latin-first stack falling back letter by letter. */
:root:lang(ar) {
  --font: "Noto Sans Arabic", "Segoe UI", Tahoma, "Geeza Pro", system-ui, sans-serif;
  --font-head: var(--font);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { padding: 0; margin: 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }
s { text-decoration-thickness: 1px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.sr-only, .visually-hidden-input {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; }
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: 16px; }
.container.narrow { max-width: 760px; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.accent { color: var(--accent); }

.icon { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: -4px; }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }
.rot180 { transform: rotate(180deg); }
[dir="rtl"] .flip-rtl.rot180 { transform: rotate(180deg) scaleX(-1); }

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: .95rem; line-height: 1.2; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { text-decoration: none; border-color: #cfd4dc; background: #fafbfc; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 55%, transparent); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink); }
.btn-ghost:hover { background: rgba(14, 20, 32, .05); border-color: transparent; }
.btn-light { background: #fff; color: var(--accent-dark); border-color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-ink); border-color: var(--danger-ink); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .875rem; border-radius: 10px; }
.btn-lg { min-height: 52px; padding: 12px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn .icon { width: 18px; height: 18px; }
.btn.danger, .icon-btn.danger { color: var(--danger-ink); }
.btn[disabled], .btn.disabled { opacity: .55; cursor: not-allowed; }
.link-btn { background: none; border: 0; color: var(--accent); font-weight: 600; cursor: pointer; padding: 6px 0; display: inline-flex; align-items: center; gap: 6px; }

.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px;
  border-radius: 12px; border: 0; background: transparent; color: var(--ink); cursor: pointer;
}
.icon-btn:hover { background: rgba(14, 20, 32, .06); text-decoration: none; }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 9px; background: rgba(255, 255, 255, .92); box-shadow: 0 1px 3px rgba(14, 20, 32, .2); }
.icon-btn.sm .icon { width: 17px; height: 17px; }

.dot-badge {
  position: absolute; top: 4px; inset-inline-end: 2px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; line-height: 1; border: 2px solid var(--surface);
}
.dot-badge.static { position: static; border: 0; }
.pill { display: inline-block; min-width: 22px; padding: 1px 8px; border-radius: 999px; background: var(--line-soft); color: var(--ink-2); font-size: .78rem; font-weight: 600; text-align: center; }
.pill-accent { background: var(--accent-tint); color: var(--accent-dark); }

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

.site-header { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .96); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-block: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
/* The default mark (two tags on blue) until the operator uploads their own logo. */
.brand-mark { width: 36px; height: 36px; border-radius: 9px; flex: none; }
.brand-logo { height: 36px; width: auto; max-width: 180px; object-fit: contain; }
.header-search {
  order: 3; flex: 1 0 100%; display: flex; align-items: center; gap: 6px;
  background: var(--page); border: 1px solid var(--line); border-radius: 12px; padding: 4px; padding-inline-start: 12px;
}
.header-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.header-search .icon { color: var(--ink-2); }
.header-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; padding: 6px 4px; }
.header-search input:focus-visible { outline: none; }
.header-search .btn { display: none; }
.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 4px; }
.post-btn span { display: none; }
.post-btn { padding-inline: 12px; }
.sign-in { padding-inline: 12px; }

.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; position: relative; border-radius: 12px; padding: 4px; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 50; min-width: 240px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px;
}
.menu-panel a, .menu-panel button {
  display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 10px 12px; border-radius: 9px;
  color: var(--ink); background: none; border: 0; text-align: start; cursor: pointer; font-size: .95rem;
}
.menu-panel a:hover, .menu-panel button:hover { background: var(--page); text-decoration: none; }
.menu-who { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.form-panel { padding: 14px; min-width: 280px; }

.avatar { border-radius: 50%; object-fit: cover; background: var(--line-soft); flex: 0 0 auto; }
.avatar-initial { display: inline-grid; place-items: center; background: var(--accent-tint); color: var(--accent-dark); font-weight: 700; font-family: var(--font-head); }

/* -------------------------------------------------------------------- notices */

.notice { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; border: 1px solid transparent; font-size: .95rem; }
.notice ul { margin: 6px 0 0; padding-inline-start: 18px; }
.notice-ok { background: var(--ok-tint); color: var(--ok-ink); border-color: #b7e6cf; }
.notice-info { background: var(--accent-tint); color: #1d3a9c; border-color: #c9d5fb; }
.notice-err { background: var(--danger-tint); color: var(--danger-ink); border-color: #f6c9c4; }
.demo-code { font-weight: 600; }

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

.hero {
  background:
    radial-gradient(1200px 400px at 90% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    linear-gradient(180deg, var(--accent-tint), var(--page));
  border-bottom: 1px solid var(--line-soft);
}
.hero-inner { padding-block: 36px 32px; }
.hero-title { font-size: clamp(1.75rem, 5vw, 2.9rem); font-weight: 750; letter-spacing: -.03em; max-width: 16ch; margin-bottom: 10px; }
.hero-lead { color: var(--ink-2); font-size: 1.06rem; max-width: 52ch; margin-bottom: 22px; }
.hero-search {
  display: grid; gap: 8px; background: var(--surface); padding: 8px; border-radius: 18px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line); max-width: 860px;
}
.hero-search.compact { box-shadow: var(--shadow); margin: 20px auto; max-width: 560px; grid-template-columns: 1fr auto; }
.hero-field { display: flex; align-items: center; gap: 8px; padding-inline: 12px; border-radius: 12px; background: var(--page); min-height: 52px; }
.hero-field:focus-within { box-shadow: 0 0 0 3px var(--accent-tint); outline: 1px solid var(--accent); }
.hero-field .icon { color: var(--ink-2); }
.hero-field input, .hero-field select { flex: 1; min-width: 0; border: 0; background: transparent; padding: 12px 0; outline: none; font-size: 1rem; }
.hero-field select { cursor: pointer; }

/* ------------------------------------------------------------------ sections */

.section { padding-block: 28px 8px; }
.section-sm { margin-top: 22px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { margin: 0; display: inline-flex; align-items: center; gap: 8px; }
.link-more { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; white-space: nowrap; }

.cat-grid { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cat-tile {
  display: flex; align-items: center; gap: 12px; padding: 14px; height: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.cat-tile:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: var(--shadow); transform: translateY(-1px); }
.cat-icon { width: 44px; height: 44px; border-radius: 12px; display: inline-grid; place-items: center; background: var(--accent-tint); color: var(--accent); flex: 0 0 auto; }
.cat-icon .icon { width: 24px; height: 24px; }
.cat-icon.sm { width: 36px; height: 36px; border-radius: 10px; vertical-align: middle; margin-inline-end: 8px; }
.cat-icon.sm .icon { width: 20px; height: 20px; vertical-align: 0; }
.cat-name { font-weight: 600; line-height: 1.25; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cat-count { display: none; color: var(--ink-2); font-size: .82rem; }

.cta-band {
  display: flex; flex-direction: column; gap: 16px; align-items: flex-start;
  padding: 28px 24px; border-radius: 22px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}
.cta-band h2 { color: #fff; margin-bottom: 6px; }
.cta-band p { margin: 0; opacity: .92; max-width: 50ch; }

/* --------------------------------------------------------------------- cards */

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: box-shadow .18s, transform .18s, border-color .18s; min-width: 0;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: transparent; }
.card-link { display: block; color: inherit; height: 100%; }
.card-link:hover { text-decoration: none; }
.card-link:focus-visible { outline-offset: -3px; border-radius: var(--radius); }
.card-media { position: relative; aspect-ratio: 4 / 3; background: var(--line-soft); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); }
.card-placeholder .icon { width: 32px; height: 32px; }
.badges { position: absolute; top: 8px; inset-inline-start: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 7px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; line-height: 1.3; }
.badge-featured { background: #fff4d6; color: #7a4a00; }
.badge-urgent { background: var(--danger); color: #fff; }
.badge-cover { position: absolute; top: 6px; inset-inline-start: 6px; background: var(--accent); color: #fff; }
.card-body { padding: 10px 12px 12px; }
.card-price { margin: 0 0 2px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.price { color: var(--price); font-weight: 750; font-size: 1.17rem; font-family: var(--font-head); letter-spacing: -.01em; }
.small-price { font-size: .95rem; color: var(--price-ink); }
.was { color: var(--ink-2); font-size: .85rem; }
.card-title { font-family: var(--font); font-size: .95rem; font-weight: 500; line-height: 1.35; margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; overflow-wrap: anywhere; }
.card-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; margin: 0; color: var(--ink-2); font-size: .8rem; }
.card-meta span { display: inline-flex; align-items: center; gap: 3px; min-width: 0; }
.card-meta .icon { width: 14px; height: 14px; vertical-align: -2px; }
.card-save { position: absolute; top: 6px; inset-inline-end: 6px; margin: 0; }
.save-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: rgba(255, 255, 255, .94); color: var(--ink); box-shadow: 0 2px 8px rgba(14, 20, 32, .18);
}
.save-btn:hover { color: var(--price-ink); }
.save-btn.is-saved, .btn.is-saved { color: var(--price-ink); }

/* -------------------------------------------------------------- breadcrumbs */

/* One line that never scrolls or clips mid-letter: every crumb may shrink to an
   ellipsis, the earlier ones first, so the page's own name keeps the most room. */
.breadcrumbs { margin: 16px 0 6px; font-size: .875rem; min-width: 0; }
.breadcrumbs ol { list-style: none; display: flex; align-items: center; gap: 4px; white-space: nowrap; min-width: 0; overflow: hidden; }
.breadcrumbs li { display: flex; align-items: center; gap: 4px; color: var(--ink-2); min-width: 0; flex: 0 3 auto; }
.breadcrumbs li:last-child { flex: 0 1 auto; }
.breadcrumbs li:first-child { flex-shrink: 0; }
.breadcrumbs a, .breadcrumbs [aria-current] { display: block; min-width: 1.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumbs a { color: var(--ink-2); }
.breadcrumbs .icon { width: 14px; height: 14px; flex: none; }
.breadcrumbs [aria-current] { color: var(--ink); font-weight: 500; max-width: 40ch; }

/* -------------------------------------------------------------- browse page */

.browse-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin: 14px 0 10px; }
.browse-head h1 { margin: 0; display: flex; align-items: center; overflow-wrap: anywhere; }
.browse-head p { margin: 0; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll-x { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; scrollbar-width: thin; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-size: .9rem; font-weight: 500;
}
.chip:hover { text-decoration: none; border-color: var(--accent); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-remove { background: var(--accent-tint); border-color: transparent; color: var(--accent-dark); }
.chip-remove .icon { width: 14px; height: 14px; }

.browse { display: grid; gap: 16px; align-items: start; }
.filters > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 600;
}
.filters > summary::-webkit-details-marker { display: none; }
.filters-form { margin-top: 14px; }
.filters-actions { display: grid; gap: 8px; position: sticky; bottom: 0; background: var(--surface); padding-top: 8px; }
.results-bar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.results-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.sort-form { display: flex; align-items: center; gap: 8px; }
.sort-form select { width: auto; min-height: 40px; padding-block: 6px; }

/* ----------------------------------------------------------------- panels */

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.panel-title { font-size: 1.05rem; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.sub-title { font-size: .95rem; margin: 18px 0 10px; }

/* ------------------------------------------------------------------- forms */

.field { margin-bottom: 14px; }
.field > label, .field > legend { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.sub-label { display: block; font-size: .8rem; color: var(--ink-2); margin-bottom: 4px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="search"],
input[type="number"], input[type="url"], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #cfd4dc; border-radius: 12px; background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); outline: none; }
[aria-invalid="true"] { border-color: var(--danger) !important; }
input[type="file"] { max-width: 100%; }
.hint { color: var(--ink-2); font-size: .85rem; margin: 6px 0 0; }
.error { color: var(--danger-ink); font-size: .87rem; margin: 6px 0 0; font-weight: 500; }
.req { color: var(--danger-ink); }
.check { display: flex; align-items: center; gap: 10px; margin: 8px 0; cursor: pointer; font-weight: 400; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: 0 0 auto; margin: 0; }
.check.choice { padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.check.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); }
.check.disabled { opacity: .6; cursor: not-allowed; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; background: linear-gradient(transparent, var(--page) 30%); padding: 18px 0 14px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.inline-form select { width: auto; min-height: 36px; padding-block: 4px; }
.seg-radio { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-radio label { position: relative; cursor: pointer; }
.seg-radio input { position: absolute; opacity: 0; inset: 0; }
.seg-radio span { display: inline-block; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 500; }
.seg-radio input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg-radio input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.code-input { font-size: 1.6rem; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; }
.code-input.sm { font-size: 1.15rem; letter-spacing: .3em; width: 11ch; }

.dropzone {
  display: grid; justify-items: center; gap: 4px; padding: 22px; border: 2px dashed #c7cdd6; border-radius: 14px;
  background: var(--page); cursor: pointer; text-align: center; font-weight: 600;
}
.dropzone:hover { border-color: var(--accent); background: var(--accent-tint); }
.dropzone .icon { width: 28px; height: 28px; color: var(--accent); }
.file-input { margin-top: 10px; }
.photo-preview { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.photo-preview:empty { display: none; }
.photo-preview li, .photo-tile { position: relative; border-radius: 12px; overflow: hidden; background: var(--line-soft); aspect-ratio: 4 / 3; }
.photo-preview img, .photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview .photo-actions, .photo-tile .photo-actions { position: absolute; bottom: 6px; inset-inline: 6px; display: flex; gap: 4px; justify-content: flex-end; }
.photo-actions form { margin: 0; }
.photo-manager { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.photo-tile.is-cover { outline: 3px solid var(--accent); outline-offset: -3px; }
.upload-form { display: grid; gap: 8px; }

.steps { list-style: none; display: flex; gap: 8px; margin: 0 0 18px; counter-reset: step; }
.steps li { counter-increment: step; display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--ink-2); }
.steps li::before { content: counter(step); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--line-soft); font-weight: 700; font-size: .8rem; }
.steps li.current { color: var(--ink); font-weight: 600; }
.steps li.current::before { background: var(--accent); color: #fff; }
.steps li + li { padding-inline-start: 8px; border-inline-start: 1px solid var(--line); }

.pick-grid { display: grid; gap: 12px; }
.pick-group { margin: 0; }
.pick-head { display: flex; align-items: center; font-size: 1.02rem; }
.pick-group ul { list-style: none; }
.pick-group a { display: flex; justify-content: space-between; align-items: center; padding: 10px 4px; border-top: 1px solid var(--line-soft); color: var(--ink); }
.pick-group a:hover { color: var(--accent); text-decoration: none; }

/* ------------------------------------------------------------ listing page */

.detail { display: grid; gap: 16px; margin-top: 8px; }
.detail-main, .detail-side { min-width: 0; }
/* Single column (phones, small tablets): what the buyer came for — title, price,
   message / offer / call — sits right under the photos, not after the whole
   description and attribute list. The main column's boxes join the grid so the
   price box can be placed between them; from 960px the two columns return. */
@media (max-width: 959px) {
  .detail-main { display: contents; }
  .detail-main > * { order: 3; min-width: 0; }
  .detail-main > .gallery { order: 1; margin-bottom: 0; }
  .detail-side { order: 2; }
}
.gallery { margin-bottom: 14px; }
.gallery-stage { position: relative; background: #0e1420; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; }
.gallery-main { width: 100%; height: 100%; object-fit: contain; }
.gallery-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; color: #c6ccd6; background: var(--line-soft); }
.gallery-empty { color: var(--ink-2); }
.gallery-empty .icon { width: 40px; height: 40px; }
.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .92); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-lg);
}
.gallery-nav.prev { inset-inline-start: 10px; }
.gallery-nav.next { inset-inline-end: 10px; }
.gallery-count { position: absolute; bottom: 10px; inset-inline-end: 10px; background: rgba(14, 20, 32, .72); color: #fff; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-variant-numeric: tabular-nums; }
.gallery-thumbs { list-style: none; display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; padding-bottom: 4px; }
.thumb { padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: none; width: 84px; flex: 0 0 auto; }
.thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.thumb.active { border-color: var(--accent); }
.listing-title { font-size: 1.35rem; margin-bottom: 8px; overflow-wrap: anywhere; }
.detail-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 8px; }
.detail-price .price { font-size: 1.85rem; }
.detail-price .was { font-size: 1rem; }
.tag-line, .place { display: flex; align-items: center; gap: 6px; color: var(--ink-2); margin-bottom: 6px; }
.stack-actions { display: grid; gap: 10px; margin-top: 14px; }
.stack-actions form { margin: 0; }
.offer-box > summary, .phone-box > summary { list-style: none; cursor: pointer; }
.offer-box > summary::-webkit-details-marker, .phone-box > summary::-webkit-details-marker { display: none; }
.offer-form, .offer-inline { margin-top: 10px; padding: 14px; border-radius: 12px; background: var(--page); }
.phone-number { display: block; text-align: center; font-size: 1.3rem; font-weight: 700; padding: 12px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.row-actions form { margin: 0; }
.attr-list { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0; }
.attr-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.attr-list dt { color: var(--ink-2); }
.attr-list dd { margin: 0; font-weight: 600; text-align: end; overflow-wrap: anywhere; }
.prose { overflow-wrap: anywhere; }
.prose h1, .prose h2, .prose h3 { margin-top: 1.2em; }
.prose ul, .prose ol { padding-inline-start: 1.4em; margin-bottom: 1em; }
.description { white-space: normal; }
.listing-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.listing-facts span { display: inline-flex; align-items: center; gap: 4px; }
.listing-facts .icon { width: 16px; height: 16px; }
.seller-head { display: flex; align-items: center; gap: 12px; color: var(--ink); margin-bottom: 10px; }
.seller-head:hover { text-decoration: none; }
.seller-head > span { display: grid; }
.seller-name { display: inline-flex; align-items: center; gap: 4px; }
.verified { color: var(--ok); width: 18px; height: 18px; }
.seller-stats { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; text-align: center; }
.seller-stats li { background: var(--page); border-radius: 12px; padding: 10px 6px; display: grid; }
.seller-stats strong { font-family: var(--font-head); font-size: 1.15rem; }
.seller-stats span { font-size: .78rem; color: var(--ink-2); }
.safety ul { padding-inline-start: 18px; color: var(--ink-2); font-size: .9rem; }
.safety li { margin-bottom: 6px; }
.safety .icon { color: var(--ok); }
.report > summary { cursor: pointer; color: var(--ink-2); font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; padding: 8px 0; }
.report .panel { margin-top: 8px; }

.stars { display: inline-flex; align-items: center; gap: 6px; }
.stars-track { position: relative; display: inline-flex; color: #d6dae1; }
.stars-track .icon { width: 17px; height: 17px; }
.stars-fill { position: absolute; inset-block: 0; inset-inline-start: 0; overflow: hidden; display: inline-flex; color: #f5a524; white-space: nowrap; }
.stars-num { font-weight: 600; font-size: .9rem; }

/* ------------------------------------------------------------ seller page */

.profile-head { display: grid; justify-items: center; text-align: center; gap: 12px; margin-top: 18px; padding: 22px; }
.profile-info h1 { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.profile-info p { margin-bottom: 6px; }
.bio { max-width: 60ch; }
.profile-head .seller-stats { width: 100%; max-width: 420px; margin: 0; }
.profile-follow { margin: 0; }
.review-list { list-style: none; display: grid; gap: 10px; }
.review { margin: 0; }
.review-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.review-head > div { display: grid; flex: 1; min-width: 140px; }

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

.auth-wrap { display: grid; place-items: center; padding-block: 28px 48px; }
.auth-card { width: 100%; max-width: 440px; padding: 24px; }
.auth-card h1 { margin-bottom: 4px; }
.auth-switch { text-align: center; margin: 18px 0 0; color: var(--ink-2); }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--page); border-radius: 12px; padding: 4px; margin: 16px 0; }
.seg-item { text-align: center; padding: 9px 8px; border-radius: 9px; color: var(--ink-2); font-weight: 600; font-size: .92rem; }
.seg-item.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg-item:hover { text-decoration: none; }

/* ---------------------------------------------------------------- account */

.account { display: grid; gap: 14px; padding-top: 14px; padding-bottom: 32px; }
.account-main { min-width: 0; }
.account-nav ul { list-style: none; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.account-nav a { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; color: var(--ink); white-space: nowrap; font-weight: 500; background: var(--surface); border: 1px solid var(--line); }
.account-nav a:hover { text-decoration: none; border-color: var(--accent); }
.account-nav a.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.page-head h1 { margin: 0; font-size: 1.45rem; }
.page-head form { margin: 0; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs a { padding: 10px 12px; color: var(--ink-2); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.active { color: var(--ink); border-bottom-color: var(--accent); }

.row-list { list-style: none; display: grid; gap: 10px; }
.row-item { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; margin: 0; align-items: start; }
.row-thumb { border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--line-soft); position: relative; display: block; }
.row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-body { min-width: 0; }
.row-title { font-weight: 600; margin: 0 0 4px; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row-title a { color: var(--ink); }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0 0 4px; }
.row-meta span { display: inline-flex; align-items: center; gap: 4px; }
.row-meta .icon { width: 15px; height: 15px; }
.row-item > .row-actions { grid-column: 1 / -1; justify-content: flex-start; }
.row-item:not(:has(.row-thumb)) { grid-template-columns: minmax(0, 1fr); }

.status { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--line-soft); color: var(--ink-2); }
.status-active, .status-pay-paid { background: var(--ok-tint); color: var(--ok-ink); }
.status-pending, .status-draft, .status-pay-pending, .status-pay-review { background: var(--warn-tint); color: var(--warn-ink); }
.status-rejected, .status-pay-failed { background: var(--danger-tint); color: var(--danger-ink); }
.status-sold { background: var(--accent-tint); color: var(--accent-dark); }

.package-grid { display: grid; gap: 10px; margin-bottom: 14px; }
.package { position: relative; cursor: pointer; display: block; }
.package input { position: absolute; opacity: 0; }
.package-body { display: grid; gap: 4px; padding: 16px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); height: 100%; }
.package input:checked + .package-body { border-color: var(--accent); background: var(--accent-tint); }
.package input:focus-visible + .package-body { outline: 3px solid var(--accent); outline-offset: 2px; }
.package .badge { justify-self: start; }
.package-name { font-family: var(--font-head); font-size: 1.05rem; }
.package-price { font-family: var(--font-head); font-size: 1.4rem; font-weight: 700; }
.benefits { list-style: none; margin-top: 6px; font-size: .88rem; color: var(--ink-2); display: grid; gap: 4px; }
.benefits li { display: flex; gap: 6px; }
.benefits .icon { width: 16px; height: 16px; color: var(--ok); }
.pay-with { display: grid; gap: 8px; }

.inbox { list-style: none; padding: 0; overflow: hidden; }
.inbox li + li { border-top: 1px solid var(--line-soft); }
.inbox-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--ink); }
.inbox-row:hover { background: var(--page); text-decoration: none; }
.inbox-row.unread { background: color-mix(in srgb, var(--accent-tint) 60%, transparent); }
.inbox-row.unread strong { font-weight: 700; }
.inbox-thumb img, .inbox-thumb .avatar { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
.inbox-body { display: grid; min-width: 0; flex: 1; gap: 2px; }
.inbox-top { display: flex; justify-content: space-between; gap: 8px; }
.inbox-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-top .muted { white-space: nowrap; }
.inbox-listing, .inbox-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent); flex: 0 0 auto; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }

.thread { padding: 0; overflow: hidden; display: flex; flex-direction: column; min-height: 70vh; }
.thread-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.thread-who { display: grid; min-width: 0; flex: 1; }
.thread-who h1 { font-size: 1.05rem; margin: 0; }
.thread-who a, .thread-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-thumb { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; }
.back-link { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--ink); }
.messages { list-style: none; flex: 1; padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; background: var(--page); overflow-y: auto; max-height: 62vh; }
.msg { display: grid; max-width: 82%; gap: 3px; }
.msg.mine { align-self: flex-end; justify-items: end; }
.msg.theirs { align-self: flex-start; justify-items: start; }
.bubble { padding: 10px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); overflow-wrap: anywhere; }
.msg.mine .bubble { background: var(--accent); border-color: var(--accent); color: #fff; border-end-end-radius: 6px; }
.msg.theirs .bubble { border-end-start-radius: 6px; }
.bubble img { border-radius: 12px; max-width: 240px; height: auto; }
.msg-time { font-size: .74rem; color: var(--ink-2); }
.msg-system { align-self: center; text-align: center; font-size: .82rem; color: var(--ink-2); }
.msg-system span { background: var(--surface); border: 1px solid var(--line); padding: 4px 12px; border-radius: 999px; display: inline-block; }
.offer-card { padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 2px solid var(--accent); display: grid; gap: 4px; min-width: 220px; }
.offer-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); font-weight: 700; }
.offer-amount { font-family: var(--font-head); font-size: 1.5rem; }
.offer-note { margin: 0; font-size: .9rem; }
.offer-state { font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.offer-accepted { border-color: var(--ok); }
.offer-accepted .offer-state { color: var(--ok-ink); }
.offer-declined, .offer-expired { border-color: var(--line); }
.offer-actions { display: flex; gap: 8px; margin-top: 6px; }
.offer-actions form { margin: 0; }
.composer { padding: 12px 14px; border-top: 1px solid var(--line); background: var(--surface); }
.composer-form { display: flex; align-items: flex-end; gap: 8px; }
.composer-form textarea { min-height: 46px; max-height: 160px; flex: 1; border-radius: 14px; }
.attach { cursor: pointer; }
.hide-sm { display: none; }

.wallet-top { display: grid; gap: 14px; }
.balance-card { color: #fff; padding: 22px; border-radius: 20px; background: linear-gradient(135deg, var(--accent), var(--accent-dark)); box-shadow: var(--shadow-lg); }
.balance-card h2 { color: rgba(255, 255, 255, .85); font-size: .9rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin: 0; }
.balance-amount { font-family: var(--font-head); font-size: 2.3rem; font-weight: 700; margin: 6px 0; letter-spacing: -.02em; }
.balance-card .small { opacity: .9; margin: 0; }
.topup { margin: 0; }
.ledger { list-style: none; padding: 0; }
.ledger li { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 12px 16px; }
.ledger li + li { border-top: 1px solid var(--line-soft); }
.ledger li > span:first-child { display: grid; min-width: 0; }
.ledger strong { font-weight: 600; overflow-wrap: anywhere; }
.amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount.pos { color: var(--ok-ink); }

.photo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.verify-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.verify-row form { margin: 0; }
.danger-zone { border-color: #f6c9c4; }
.plain-list { padding-inline-start: 20px; margin-bottom: 14px; color: var(--ink-2); }
.publish-panel { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.publish-panel p { margin: 0; }

.empty { text-align: center; padding: 40px 20px; background: var(--surface); border: 1px dashed #cfd4dc; border-radius: var(--radius); }
.empty .icon { width: 40px; height: 40px; color: var(--ink-3); margin-bottom: 10px; }
.empty h2 { font-size: 1.15rem; }
.empty.small { padding: 22px; }
.empty.small p { margin: 0; }

.pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 22px 0 8px; }
.pager-btn { min-width: 44px; height: 44px; display: grid; place-items: center; padding: 0 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.pager-btn:hover { text-decoration: none; border-color: var(--accent); }
.pager-btn.current { background: var(--ink); color: #fff; border-color: var(--ink); }
.pager-btn.disabled { opacity: .4; }

/* -------------------------------------------------------------------- pages */

.page-article { margin-block: 22px 40px; padding: 24px; }
.error-page { text-align: center; padding-block: 56px 72px; }
.error-code { font-family: var(--font-head); font-size: 4.5rem; font-weight: 800; color: var(--accent); line-height: 1; margin-bottom: 12px; letter-spacing: -.04em; }

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

.site-footer { margin-top: 40px; background: var(--surface); border-top: 1px solid var(--line); padding-top: 32px; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.footer-brand { grid-column: 1 / -1; }
.footer-brand p { margin: 10px 0 0; max-width: 36ch; }
.footer-title { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin-bottom: 10px; font-family: var(--font); font-weight: 700; }
.footer-links { list-style: none; display: grid; gap: 4px; }
.footer-links a { color: var(--ink); padding: 4px 0; display: inline-block; }
.footer-links a.current { font-weight: 700; }
.footer-bottom { border-top: 1px solid var(--line-soft); margin-top: 24px; padding-block: 16px 24px; color: var(--ink-2); font-size: .875rem; }

/* -------------------------------------------------------------- breakpoints */

@media (min-width: 560px) {
  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cat-count { display: block; }
  .cat-tile { flex-direction: column; align-items: flex-start; }
  .post-btn span { display: inline; }
  .photo-preview { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .photo-manager { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-search { grid-template-columns: 1fr auto; }
  .hero-search:has(.hero-select) { grid-template-columns: 1fr 220px auto; }
  .row-item { grid-template-columns: 120px minmax(0, 1fr); }
  .package-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hide-sm { display: inline; }
  .pick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 760px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .header-search { order: 0; flex: 1 1 360px; max-width: 560px; }
  .header-search .btn { display: inline-flex; }
  .cta-band { flex-direction: row; align-items: center; justify-content: space-between; padding: 36px 40px; }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
  .footer-brand { grid-column: auto; }
  .wallet-top { grid-template-columns: 1fr 1fr; align-items: stretch; }
  .profile-head { grid-template-columns: auto 1fr auto; justify-items: start; text-align: start; }
  .profile-head .seller-stats { grid-column: 1 / -1; max-width: none; grid-template-columns: repeat(3, 1fr); }
  .profile-follow { grid-row: 1; grid-column: 3; }
  .hero-inner { padding-block: 56px 48px; }
  .row-item { grid-template-columns: 120px minmax(0, 1fr) auto; }
  .row-item > .row-actions { grid-column: auto; justify-content: flex-end; max-width: 300px; }
  .attr-list { grid-template-columns: 1fr 1fr; column-gap: 28px; }
}

@media (min-width: 960px) {
  h1 { font-size: 1.9rem; }
  .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .browse { grid-template-columns: 280px minmax(0, 1fr); gap: 24px; }
  .filters { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto; }
  .detail { grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
  .detail-side { position: sticky; top: calc(var(--header-h) + 16px); }
  .account { grid-template-columns: 230px minmax(0, 1fr); gap: 24px; align-items: start; padding-top: 24px; }
  .account-nav { position: sticky; top: calc(var(--header-h) + 16px); }
  .account-nav ul { flex-direction: column; overflow: visible; }
  .account-nav a { border-color: transparent; background: transparent; }
  .account-nav a:hover { background: var(--surface); border-color: var(--line); }
  .results-bar { flex-direction: row; align-items: flex-start; justify-content: space-between; }
  .results-tools { flex-wrap: nowrap; margin-inline-start: auto; }
  .package-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1200px) {
  .cat-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .cat-tile { align-items: center; text-align: center; padding: 16px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
  .site-header, .site-footer, .card-save, .stack-actions, .report { display: none !important; }
}

/* Inputs inside the combined search bars take the bar's frame, not their own. */
.header-search input[type="search"], .hero-field input, .hero-field select {
  border: 0; box-shadow: none; background: transparent; min-height: 0; border-radius: 0; padding-inline: 0;
}

/* The dropzone label is the visible control; the file input stays focusable but hidden. */
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
[data-photo-picker]:has(.file-input:focus-visible) .dropzone { outline: 3px solid var(--accent); outline-offset: 2px; }
[data-photo-picker] { position: relative; }
.upload-form > .btn { justify-self: start; }
.account-nav { min-width: 0; }
.field > .check { display: flex; font-weight: 400; font-size: 1rem; margin: 8px 0; }
