/* base reset (the prototype got these from its host page) */
html, body { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }

/* Layout: app shell — sticky header, filter strip, responsive card grid; bottom tab bar on phones; listing details in a sheet. */
:root {
  /* palette taken from the logo: bag green, price-tag terracotta, warm cream */
  --bg: #f8f2e8;
  --surface: #ffffff;
  --sunk: #f0e7da;
  --fg: #22201a;
  --muted: #6b6255;
  --line: #e4d9c9;
  --palm: #3f7b3a;
  --palm-ink: #ffffff;
  --palm-soft: #e4efdc;
  --ochre: #b85a32;
  --wa: #178a4a;
  --ok: #2f7a36; --ok-soft: #e0f0dc;
  --warn: #8f5a00; --warn-soft: #fbedd0;
  --bad: #ad3524; --bad-soft: #f8e0da;
  --idle: #6b6255; --idle-soft: #f0e7da;
  --scrim: rgba(25, 20, 12, .52);
  /* illustration colours */
  --clay: #d36f45; --sky: #4a7fb5; --ink2: #3a3128; --pale: #ffffff;
  /* placeholder "rug" tiles */
  --ph-a: #f3e3cb; --ph-a-ln: #dfc49b;
  --ph-b: #e2eed9; --ph-b-ln: #b4d0a5;
  --ph-c: #f6dccf; --ph-c-ln: #e2ae96;
  --ph-d: #dde6ef; --ph-d-ln: #afc2d6;
  --f-display: 'IBM Plex Sans Arabic', Tahoma, sans-serif;
  --f-body: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, Arial, sans-serif;
  --r: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15130f; --surface: #1e1b15; --sunk: #29251d; --fg: #efe9df; --muted: #ab9f8e; --line: #3a342a;
    --palm: #7cbf6f; --palm-ink: #10200e; --palm-soft: #243a20; --ochre: #ec8f63; --wa: #3cc47a;
    --ok: #7fcf86; --ok-soft: #1c3320; --warn: #f0b955; --warn-soft: #3a2c10; --bad: #f08470; --bad-soft: #3e1d17;
    --idle: #ab9f8e; --idle-soft: #2c271f; --scrim: rgba(0, 0, 0, .62);
    --clay: #ec8f63; --sky: #7fb0e0; --ink2: #c9bfb0; --pale: #f6f1e8;
    --ph-a: #3a3122; --ph-a-ln: #5a4a30; --ph-b: #23331f; --ph-b-ln: #36502f;
    --ph-c: #3b2621; --ph-c-ln: #5b3a31; --ph-d: #212b38; --ph-d-ln: #33445a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15130f; --surface: #1e1b15; --sunk: #29251d; --fg: #efe9df; --muted: #ab9f8e; --line: #3a342a;
    --palm: #7cbf6f; --palm-ink: #10200e; --palm-soft: #243a20; --ochre: #ec8f63; --wa: #3cc47a;
    --ok: #7fcf86; --ok-soft: #1c3320; --warn: #f0b955; --warn-soft: #3a2c10; --bad: #f08470; --bad-soft: #3e1d17;
    --idle: #ab9f8e; --idle-soft: #2c271f; --scrim: rgba(0, 0, 0, .62);
    --clay: #ec8f63; --sky: #7fb0e0; --ink2: #c9bfb0; --pale: #f6f1e8;
    --ph-a: #3a3122; --ph-a-ln: #5a4a30; --ph-b: #23331f; --ph-b-ln: #36502f;
    --ph-c: #3b2621; --ph-c-ln: #5b3a31; --ph-d: #212b38; --ph-d-ln: #33445a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--fg); font-family: var(--f-body); font-size: 15px; line-height: 1.65; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--surface); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1, h2 { font-family: var(--f-display); font-weight: 700; line-height: 1.25; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
p { margin: 0; }
a { color: var(--palm); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--palm); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

.wrap { max-width: 1180px; margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* demo strip + header */
.demo-bar { background: var(--sunk); color: var(--muted); font-size: 13px; }
.demo-bar .wrap { padding-block: 6px; }
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 14px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand b { font-family: var(--f-display); font-size: 25px; line-height: 1; display: block; }
.brand small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.mark { width: 48px; height: 48px; flex: none; border-radius: 12px; display: block; }
.topnav { display: flex; gap: 4px; margin-inline-start: auto; }
.topnav a { padding: 7px 14px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 600; }
.topnav a:hover { color: var(--fg); }
.topnav a[aria-current="page"] { background: var(--palm-soft); color: var(--palm); }
.acct { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--fg); font-weight: 600; padding: 4px 4px 4px 12px; border: 1px solid var(--line); border-radius: 999px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--palm); color: var(--palm-ink); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.avatar.lg { width: 44px; height: 44px; font-size: 18px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 9px 16px; font-weight: 600; text-decoration: none; line-height: 1.3; white-space: nowrap; }
.btn-primary { background: var(--palm); color: var(--palm-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--fg); }
.btn-ghost:hover { border-color: var(--palm); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-danger { background: var(--bad-soft); color: var(--bad); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 12px 22px; font-size: 16px; }
.btn-block { width: 100%; }
.linkish { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; font-size: 13px; }

main { padding-block: 22px 48px; min-height: 60vh; }
.intro { display: grid; gap: 4px; margin-bottom: 14px; }
.intro p { color: var(--muted); }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.filters .grow { flex: 1 1 260px; }
.filters > * { flex: 0 1 auto; }
input, select, textarea { font: inherit; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; min-width: 0; max-width: 100%; }
textarea { resize: vertical; min-height: 110px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--palm); outline-offset: 0; border-color: transparent; }
.check { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.check input { width: 18px; height: 18px; accent-color: var(--palm); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-size: 14px; font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.count { color: var(--muted); font-size: 14px; margin-bottom: 10px; }

/* listing cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
@media (min-width: 761px) { .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; min-width: 0; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--palm); transform: translateY(-2px); }
.card-media { aspect-ratio: 4 / 3; width: 100%; max-width: 100%; display: block; object-fit: cover; }
.card-body { padding: 10px 12px 12px; display: grid; gap: 2px; min-width: 0; }
.price { font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.price small { font-weight: 500; font-size: 13px; color: var(--muted); }
.card h3 { font-size: 15px; font-weight: 600; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { color: var(--muted); font-size: 13px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag { font-size: 12px; background: var(--sunk); color: var(--muted); border-radius: 6px; padding: 1px 8px; }
.tag.season { background: var(--warn-soft); color: var(--warn); }

/* placeholder photo: woven lozenge pattern, like a local rug */
.ph { position: relative; display: grid; place-items: center; background-color: var(--ph-a);
  background-image: repeating-linear-gradient(45deg, var(--ph-a-ln) 0 2px, transparent 2px 20px), repeating-linear-gradient(-45deg, var(--ph-a-ln) 0 2px, transparent 2px 20px); }
.ph-b { background-color: var(--ph-b); background-image: repeating-linear-gradient(45deg, var(--ph-b-ln) 0 2px, transparent 2px 20px), repeating-linear-gradient(-45deg, var(--ph-b-ln) 0 2px, transparent 2px 20px); }
.ph-c { background-color: var(--ph-c); background-image: repeating-linear-gradient(45deg, var(--ph-c-ln) 0 2px, transparent 2px 20px), repeating-linear-gradient(-45deg, var(--ph-c-ln) 0 2px, transparent 2px 20px); }
.ph-d { background-color: var(--ph-d); background-image: repeating-linear-gradient(45deg, var(--ph-d-ln) 0 2px, transparent 2px 20px), repeating-linear-gradient(-45deg, var(--ph-d-ln) 0 2px, transparent 2px 20px); }
.ph-ic { width: 46%; max-width: 150px; aspect-ratio: 1; background: var(--surface); border-radius: 50%; display: grid; place-items: center; }
.ph-ic svg, .ph-ic img { width: 66%; height: 66%; }
.up-ic { object-fit: contain; display: block; }

/* section switcher + illustrated category tiles */
.sections { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-bottom: 20px; }
@media (max-width: 1100px) { .sections b { font-size: 14px; } .sections a { padding: 10px 6px; } }
/* lost & found */
.lt { font-weight: 700; padding: 1px 10px; border-radius: 999px; font-size: 14px; }
.lt-lost { background: var(--bad-soft); color: var(--bad); }
.lt-found { background: var(--ok-soft); color: var(--ok); }
.lost-cta { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 16px; }
.lost-cta .btn { justify-content: flex-start; gap: 12px; text-align: start; white-space: normal; border: 1.5px solid; }
.lost-cta span { display: grid; }
.lost-cta small { font-weight: 400; font-size: 13px; opacity: .85; }
.lost-btn { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.found-btn { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.sections a { flex-direction: column; text-align: center; gap: 6px; }
/* "I'm looking for…" + notifications */
.card.wcard { cursor: default; }
.card.wcard:hover { transform: none; border-color: var(--line); }
.wcard > .btn, .wcard > .pill { align-self: flex-start; }
.bell { position: relative; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--fg); display: grid; place-items: center; flex: none; padding: 0; }
.bell .dot { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
.notif-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.notif-list button { width: 100%; text-align: start; display: grid; gap: 2px; background: var(--sunk); border: 1px solid transparent; border-radius: 10px; padding: 10px 12px; }
.notif-list .unread button { border-color: var(--palm); background: var(--palm-soft); }
.notif-list small { font-size: 12px; }
@media (max-width: 1000px) { .sections .sec-ic { width: 40px; height: 40px; } .sections b { font-size: 16px; } }
/* free items */
.free { color: var(--ok); font-weight: 700; }
.st-reserved { background: var(--warn-soft); color: var(--warn); }
.ok-note { background: var(--ok-soft); color: var(--ok); }
.howto { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 16px; }
.howto div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; display: grid; gap: 2px; }
.howto span { color: var(--muted); font-size: 13px; }
.reqs { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 6px; }
.reqs li { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--sunk); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.reqs li > div { min-width: 0; flex: 1; }/* professionals */
.card.pro { padding: 14px; gap: 8px; }
.pro-top { display: flex; align-items: center; gap: 12px; }
.pro-top .who { min-width: 0; display: grid; gap: 4px; }
.card.pro h3 { -webkit-line-clamp: 1; }
.pro-ic { width: 54px; height: 54px; flex: none; background: var(--sunk); border-radius: 12px; padding: 7px; }
.pro-ic.lg { width: 72px; height: 72px; padding: 10px; }
.grid.pros { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.badge-v { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); vertical-align: middle; font-family: var(--f-body); }
.checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.opt { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--surface); cursor: pointer; font-size: 14px; font-weight: 500; line-height: 1.3; }
.opt:has(input:checked) { border-color: var(--palm); background: var(--palm-soft); }
.opt input { accent-color: var(--palm); flex: none; }
.opt-ic { width: 28px; height: 28px; flex: none; }
.cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border: 1.5px dashed var(--palm); background: var(--palm-soft); border-radius: var(--r); padding: 16px; margin-bottom: 8px; }
.cta .who { flex: 1 1 220px; min-width: 0; }
.cta-ic { width: 54px; height: 54px; flex: none; }
.works { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.works img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.tax-ic.big { width: 44px; height: 44px; }
.vcode { font-size: 30px; font-weight: 700; letter-spacing: .08em; text-align: center; background: var(--sunk); border: 1.5px dashed var(--palm); border-radius: var(--r); padding: 12px; user-select: all; }
.alert { background: var(--warn-soft); border: 1px solid var(--warn); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 6px; }
.alert p, .alert ul { font-size: 13px; margin: 0; }
.alert ul { padding-inline-start: 18px; }
.sections a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--fg); text-decoration: none; min-width: 0; }
.sections a:hover { border-color: var(--palm); }
.sections a[aria-current="page"] { border-color: var(--palm); background: var(--palm-soft); }
.sections b { display: block; font-family: var(--f-display); font-size: 18px; line-height: 1.3; }
.sections small { color: var(--muted); font-size: 13px; }
.sec-ic { width: 52px; height: 52px; flex: none; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tile { position: relative; height: 92px; padding: 10px 12px; border: 1.5px solid transparent; border-radius: var(--r); background: var(--sunk); overflow: hidden; text-align: start; font-weight: 600; font-size: 14px; line-height: 1.35; display: block; }
.tile span { position: relative; z-index: 1; display: block; max-width: 62%; }
.tile:hover { border-color: var(--line); }
.tile[aria-pressed="true"] { border-color: var(--palm); background: var(--palm-soft); color: var(--palm); }
.tile-ic { position: absolute; width: 60px; height: 60px; bottom: 4px; inset-inline-end: 6px; }
.tax-ic { width: 32px; height: 32px; flex: none; }
.icon-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; }
.icon-pick label { border: 1.5px solid var(--line); border-radius: 10px; padding: 6px; cursor: pointer; display: grid; place-items: center; }
.icon-pick label:has(input:checked) { border-color: var(--palm); background: var(--palm-soft); }
.icon-pick input { position: absolute; opacity: 0; pointer-events: none; }
.icon-pick svg, .icon-pick img { width: 40px; height: 40px; }
.icon-pick .up-tile { border-style: dashed; color: var(--palm); font-size: 12px; font-weight: 600; text-align: center; line-height: 1.2; }
.icon-pick .up-tile b { display: block; font-size: 22px; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
@media (max-width: 760px) {
  .sections { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
  .sections::-webkit-scrollbar { display: none; }
  .sections a { flex: 0 0 96px; flex-direction: column; text-align: center; gap: 4px; padding: 10px 6px; }
  .sections b { font-size: 14px; }
  .sections small { font-size: 12px; }
  .sec-ic { width: 40px; height: 40px; }
  .tiles { display: flex; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
  .tiles::-webkit-scrollbar { display: none; }
  .tile { flex: 0 0 122px; height: 86px; font-size: 13px; }
  .tile-ic { width: 52px; height: 52px; }
}

/* status pills */
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.st-published { background: var(--ok-soft); color: var(--ok); }
.st-pending { background: var(--warn-soft); color: var(--warn); }
.st-sold, .st-expired, .st-hidden { background: var(--idle-soft); color: var(--idle); }
.st-refused { background: var(--bad-soft); color: var(--bad); }
.pill.cat { background: var(--palm-soft); color: var(--palm); }

/* empty / gate */
.empty { text-align: center; padding: 48px 16px; display: grid; gap: 12px; justify-items: center; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r); }
.empty p { color: var(--muted); max-width: 46ch; }

/* sheet */
.overlay { position: fixed; inset: 0; z-index: 50; background: var(--scrim); display: flex; align-items: center; justify-content: center; padding: 16px; }
.panel { background: var(--surface); border-radius: 16px; width: min(620px, 100%); max-height: calc(100% - 32px); overflow: auto; position: relative; }
.panel-pad { padding: 22px; display: grid; gap: 14px; }
.close { position: absolute; top: 10px; inset-inline-end: 10px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--surface); color: var(--fg); font-size: 22px; line-height: 1; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
@media (max-width: 760px) {
  .overlay { align-items: flex-end; padding: 0; }
  .panel { border-radius: 18px 18px 0 0; max-height: 92%; padding-bottom: env(safe-area-inset-bottom, 0px); }
}

/* detail */
.d-main { aspect-ratio: 4 / 3; width: 100%; max-width: 100%; display: block; object-fit: cover; }
.thumbs { display: flex; gap: 8px; padding: 10px 22px 0; overflow-x: auto; }
.thumbs button { border: 2px solid transparent; padding: 0; border-radius: 8px; overflow: hidden; flex: none; background: none; }
.thumbs button[aria-pressed="true"] { border-color: var(--palm); }
.thumbs img { width: 64px; height: 48px; object-fit: cover; display: block; }
.d-head { display: flex; gap: 8px; flex-wrap: wrap; }
.d-price { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ochre); }
.d-price small { font-size: 15px; font-weight: 500; color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 0; }
.facts div { background: var(--sunk); border-radius: 10px; padding: 8px 12px; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.seller { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: var(--r); padding: 12px; flex-wrap: wrap; }
.seller .who { flex: 1 1 140px; min-width: 0; }
.seller .who b { display: block; }
.phone { font-variant-numeric: tabular-nums; user-select: all; font-weight: 600; letter-spacing: .02em; }
.d-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.d-actions.one { grid-template-columns: 1fr; }
.pref { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.note.late { background: var(--warn-soft); color: var(--warn); }
.seg3 { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.flabel { font-weight: 600; }
.note { font-size: 13px; color: var(--muted); background: var(--sunk); border-radius: 10px; padding: 10px 12px; }
.note b { color: var(--fg); }

/* forms */
.form { display: grid; gap: 18px; max-width: 680px; }
.field { display: grid; gap: 6px; }
.field > label, legend { font-weight: 600; }
.hint { font-weight: 400; color: var(--muted); font-size: 13px; }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg legend { grid-column: 1 / -1; margin-bottom: 6px; }
.seg label { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 12px; font-weight: 600; cursor: pointer; }
.seg label:has(input:checked) { border-color: var(--palm); background: var(--palm-soft); color: var(--palm); }
.seg input { accent-color: var(--palm); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.pthumb { position: relative; margin: 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.pthumb img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.pthumb figcaption { font-size: 11px; color: var(--muted); padding: 4px 6px; font-variant-numeric: tabular-nums; }
.pthumb button { position: absolute; top: 4px; inset-inline-start: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--surface); color: var(--bad); font-size: 16px; line-height: 1; }
.addph { aspect-ratio: 1; border: 2px dashed var(--line); border-radius: 10px; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer; padding: 8px; }
.addph:hover { border-color: var(--palm); color: var(--palm); }
.addph svg { width: 30px; height: 30px; display: block; margin: 0 auto 4px; }
.addph.cam { border-color: var(--palm); color: var(--palm); background: var(--palm-soft); }
/* the camera shortcut only makes sense on phones and tablets */
@media (hover: hover) and (pointer: fine) { .addph.cam { display: none; } }
.file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.form-err { color: var(--bad); background: var(--bad-soft); border-radius: 10px; padding: 10px 12px; font-weight: 600; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.g { width: 22px; height: 22px; border-radius: 50%; background: var(--surface); color: #4a73d6; display: grid; place-items: center; font-weight: 700; font-family: Arial, sans-serif; border: 1px solid var(--line); }
.fine { font-size: 12px; color: var(--muted); }

/* account + admin */
.profile { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 22px; }
.profile .who { flex: 1 1 200px; min-width: 0; }
.profile .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 26px 0 12px; flex-wrap: wrap; }
.sec-h h2 { font-size: 20px; }
.list { display: grid; gap: 10px; }
.lrow { display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; }
.lrow .thumb { width: 84px; aspect-ratio: 4 / 3; border-radius: 8px; object-fit: cover; display: block; max-width: 100%; }
.lrow .info { min-width: 0; display: grid; gap: 4px; }
.lrow .info h3 { font-size: 15px; font-weight: 600; }
.lrow .line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.lrow .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.stat b { display: block; font-size: 28px; font-family: var(--f-display); font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat span { color: var(--muted); font-size: 13px; }
.stat.attn { border-color: var(--warn); }
.stat.attn b { color: var(--warn); }
.admin-tabs { margin-top: 22px; }
.urow { grid-template-columns: 44px 1fr; }
.tax { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 16px 16px; margin-bottom: 18px; }
.tax .sec-h { margin-top: 14px; }
.tax-add { display: flex; gap: 8px; margin-bottom: 12px; }
.tax-add input { flex: 1 1 auto; }
.tax-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; }
.tax-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.tax-list .tname { font-weight: 600; flex: 1 1 120px; min-width: 0; }
.tax-list .tcount { color: var(--muted); font-size: 13px; }
.tacts { display: flex; gap: 6px; flex-wrap: wrap; }
.ibtn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); line-height: 1; }
.ibtn:disabled { opacity: .35; cursor: default; }
.rules { white-space: pre-line; max-width: 680px; margin-bottom: 18px; }

/* footer + bottom nav + toast */
footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
footer .wrap { padding-block: 18px; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
footer .sp { flex: 1; }
.bottom { display: none; position: fixed; inset: auto 0 0 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: max(8px, env(safe-area-inset-left, 0px)); padding-right: max(8px, env(safe-area-inset-right, 0px)); }
.bottom a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; }
.bottom a[aria-current="page"] { color: var(--palm); }
.bottom svg { width: 24px; height: 24px; }
.bottom .add svg { background: var(--palm); color: var(--palm-ink); border-radius: 50%; padding: 3px; width: 28px; height: 28px; }
.toast { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); background: var(--fg); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-weight: 600; max-width: calc(100% - 32px); text-align: center; }
@media (max-width: 760px) {
  .topnav, .top .btn-add, .acct .lbl { display: none; }
  .acct { margin-inline-start: auto; padding: 3px; }
  .bottom { display: grid; }
  main { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  footer { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  h1 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { .card { transition: none; } .card:hover { transform: none; } }
