/* Social-feed look: light gray canvas, white cards, teal primary, orange sign-up.
   Logical properties (inline-start/end) everywhere so Arabic (RTL) mirrors correctly. */
:root {
  --bg: #f0f2f5;
  --card: #ffffff;
  --ink: #050505;
  --muted: #65676b;
  --line: #dadde1;
  --hover: #f2f2f2;
  --input: #f0f2f5;
  --primary: #0f766e;
  --primary-hover: #115e59;
  --primary-soft: #e3f4f1;
  --on-primary: #ffffff;
  --accent: #f76707;
  --accent-hover: #e8590c;
  --on-accent: #ffffff;
  --green: #2f9e44;
  --green-ink: #1b7a2b;
  --green-soft: #e6f4ea;
  --amber: #a15c00;
  --amber-soft: #fff4e0;
  --red: #e41e3f;
  --gray-soft: #e4e6eb;
  --shadow: 0 1px 2px rgb(0 0 0 / 20%);
  --shadow-lg: 0 2px 4px rgb(0 0 0 / 10%), 0 8px 16px rgb(0 0 0 / 10%);
  --radius: 8px;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #18191a;
  --card: #242526;
  --ink: #e4e6eb;
  --muted: #b0b3b8;
  --line: #3e4042;
  --hover: #3a3b3c;
  --input: #3a3b3c;
  --primary: #2dd4bf;
  --primary-hover: #5eead4;
  --primary-soft: #133a36;
  --on-primary: #042f2e;
  --accent: #ff8a3d;
  --accent-hover: #ffa25f;
  --on-accent: #2b1200;
  --green: #51cf66;
  --green-ink: #6fd17f;
  --green-soft: #1f3324;
  --amber: #f5b950;
  --amber-soft: #3a2f1a;
  --gray-soft: #3a3b3c;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%);
  --shadow-lg: 0 8px 24px rgb(0 0 0 / 50%);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 "Segoe UI", Helvetica, Arial, Tahoma, sans-serif;
}
:root[lang^='ar'] body { font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif; font-size: 16px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1.02rem; }
a { color: var(--primary); }
p { margin: 0 0 .6em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.ic { width: 20px; height: 20px; flex-shrink: 0; vertical-align: middle; }
[dir='rtl'] .ic.flip { transform: scaleX(-1); }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; min-height: 36px; border-radius: 6px; border: 0;
  background: var(--gray-soft); color: var(--ink); font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { filter: brightness(.95); }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hover); filter: none; }
.btn.success { background: var(--accent); color: var(--on-accent); }
.btn.success:hover { background: var(--accent-hover); filter: none; }
.btn.secondary { background: var(--primary-soft); color: var(--primary); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--hover); filter: none; }
.btn.danger { color: var(--red); }
.btn.big { padding: 12px 20px; font-size: 1.05rem; min-height: 48px; }
.btn.block { width: 100%; }
.small-btn { padding: 5px 12px; min-height: 30px; font-size: .85rem; }
.round-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--gray-soft); color: var(--ink);
  display: inline-grid; place-items: center; cursor: pointer; font: inherit; font-weight: 700; flex-shrink: 0;
}
.round-btn:hover { filter: brightness(.93); }
.lang-btn { font-size: .95rem; }
.link-btn { background: none; border: 0; color: var(--primary); cursor: pointer; font: inherit; padding: 4px; }
.link-btn:hover { text-decoration: underline; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 1rem; }
.icon-btn:hover { background: var(--hover); color: var(--red); }

input, select, textarea {
  font: inherit; color: var(--ink); background: var(--input);
  border: 1px solid transparent; border-radius: 6px; padding: 10px 12px; width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); background: var(--card); }
input:disabled { opacity: .5; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--primary); }
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 4px; font-weight: 600; font-size: .88rem; color: var(--muted); }
.stack { display: grid; gap: 12px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }

.segmented { display: flex; gap: 8px; flex-wrap: wrap; border: 0; padding: 0; margin: 0; }
.segmented legend { font-weight: 600; font-size: .88rem; color: var(--muted); margin-bottom: 4px; padding: 0; }
.segmented label {
  display: flex !important; align-items: center; gap: 8px; flex: 1; min-width: 150px;
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer;
  color: var(--ink); font-weight: 600; font-size: .92rem;
}
.segmented label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }

/* ---------- badges, callouts, cards ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.badge.blue { background: var(--primary-soft); color: var(--primary); }
.badge.green { background: var(--green-soft); color: var(--green-ink); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.gray { background: var(--gray-soft); color: var(--muted); }
.badge.red { background: #fde8e8; color: var(--red); }
:root[data-theme='dark'] .badge.red { background: #3b1d1d; }
.callout { display: flex; gap: 10px; align-items: flex-start; background: var(--primary-soft); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 16px; font-size: .92rem; }
.callout .ic { color: var(--primary); margin-top: 1px; }
.callout.gray { background: var(--gray-soft); display: block; }
.empty { text-align: center; padding: 40px 16px; }
.empty p { color: var(--muted); }
.loading { text-align: center; color: var(--muted); padding: 40px; }
.stars { color: #f7b928; letter-spacing: 1px; }
.notes { background: var(--input); padding: 10px 14px; border-radius: 8px; margin: 10px 0 0; }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center;
  color: #fff; font-weight: 700; font-size: .95rem; flex-shrink: 0; overflow: hidden;
}
.avatar.xs { width: 28px; height: 28px; font-size: .72rem; }
.avatar.sm { width: 32px; height: 32px; font-size: .8rem; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.4rem; }
.avatar.xl { width: 96px; height: 96px; font-size: 2rem; }
.logo-img { object-fit: contain; background: #fff; border: 1px solid var(--line); }
.avatar.anon { background: var(--gray-soft); color: var(--muted); }
.avatar.anon .ic { width: 55%; height: 55%; }
.logo { width: 35px; height: 38px; flex-shrink: 0; display: block; }
.logo .logo-sheet { fill: var(--primary); }
.logo .logo-gap { fill: var(--card); } /* the lines and the ring around the badge take the bar's colour */

/* ---------- top bar & layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; height: 56px; background: var(--card); box-shadow: var(--shadow);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 16px; gap: 8px;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--primary); }
.brand-name { font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; white-space: nowrap; }
.tabs { display: flex; height: 56px; }
.tab {
  width: 110px; display: grid; place-items: center; color: var(--muted); border-radius: 8px; margin: 4px 0;
  border-bottom: 3px solid transparent; position: relative;
}
.tab .ic { width: 26px; height: 26px; }
.tab:hover { background: var(--hover); }
.tab.active { color: var(--primary); border-radius: 0; margin: 0; }
.tab.active::after { content: ''; position: absolute; inset-inline: 0; bottom: 0; height: 3px; background: var(--primary); }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.me-chip { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; font-weight: 600; color: var(--ink); text-decoration: none; }
[dir='rtl'] .me-chip { padding: 4px 4px 4px 10px; }
.me-chip:hover { background: var(--hover); }

.layout { display: grid; grid-template-columns: 280px minmax(0, 680px) 300px; justify-content: space-between; gap: 24px; padding: 16px; max-width: 1400px; margin: 0 auto; }
.layout.wide { grid-template-columns: 280px minmax(0, 1000px); justify-content: start; }
.layout.wide .main { width: 100%; }
.side-left, .side-right { position: sticky; top: 72px; align-self: start; max-height: calc(100vh - 88px); overflow-y: auto; }
.side-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 600; }
.side-item:hover { background: var(--hover); }
.side-item.active { background: var(--primary-soft); color: var(--primary); }
.side-ic { width: 36px; height: 36px; border-radius: 50%; background: var(--gray-soft); display: grid; place-items: center; color: var(--primary); }
.side-left hr { margin: 8px; }
.side-foot { color: var(--muted); font-size: .78rem; padding: 0 8px; }
.side-card h3 { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .95rem; }
.side-card h3 .ic { color: var(--primary); }
.mini-steps { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; font-size: .92rem; }
.tips { margin: 0; padding-inline-start: 18px; display: grid; gap: 8px; font-size: .9rem; }
.stat-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.stat-row:last-child { border-bottom: 0; }

.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 10px; text-decoration: none; font-weight: 600; color: var(--muted); }
.back:hover { color: var(--primary); }
.section-title { margin: 8px 0 12px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.section-title .muted { font-weight: 400; font-size: .9rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 { margin-bottom: 16px; }
.grid-2 h2 { display: flex; gap: 8px; align-items: center; }
.danger-zone { margin-top: 8px; }

/* ---------- posts ---------- */
.composer { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--muted); }
.composer-input { flex: 1; background: var(--input); border-radius: 999px; padding: 10px 16px; font-size: 1.02rem; }
.composer:hover .composer-input { background: var(--hover); }
.post { padding: 0; overflow: hidden; }
.post-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px 0; }
.request-card .post-head { padding: 0 0 12px; }
.ph-meta { display: grid; flex: 1; min-width: 0; }
.ph-meta b { font-size: .95rem; }
.ph-meta small { color: var(--muted); font-size: .8rem; }
.post-body { display: block; padding: 10px 16px 12px; color: var(--ink); text-decoration: none; }
.post-body h3 { font-size: 1.1rem; margin-bottom: 4px; }
.post-body p { color: var(--ink); margin-bottom: 8px; }
.post-body:hover h3 { text-decoration: underline; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--input); border-radius: 999px; padding: 4px 12px; font-size: .85rem; }
.chip b { color: var(--primary); font-weight: 700; }
.chip.more { color: var(--muted); }
.post-stats { display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding: 8px 16px; color: var(--muted); font-size: .88rem; border-top: 1px solid var(--line); margin: 0 16px; padding-inline: 0; }
.post-stats span { display: inline-flex; gap: 6px; align-items: center; }
.post-stats b { color: var(--ink); }
.post-stats .ic { width: 16px; height: 16px; }
.post-actions { display: flex; border-top: 1px solid var(--line); margin: 0 16px; padding: 4px 0; }
.pa { flex: 1; display: flex; justify-content: center; align-items: center; gap: 8px; padding: 8px; border-radius: 6px; color: var(--muted); font-weight: 600; text-decoration: none; }
.pa:hover { background: var(--hover); }
.pa-primary { color: var(--primary); }

.feed-head h1 { margin-bottom: 2px; }
.city-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.city-chip { border: 0; background: var(--gray-soft); color: var(--ink); font: inherit; font-weight: 600; font-size: .85rem; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.city-chip:hover { filter: brightness(.95); }
.city-chip.active { background: var(--primary-soft); color: var(--primary); }

.list { padding: 8px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.list-row:hover { background: var(--hover); }
.list-ic { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.list-main { display: grid; flex: 1; min-width: 0; }
.list-side { display: grid; justify-items: end; gap: 4px; text-align: end; }

/* ---------- request detail ---------- */
.request-card h1 { margin-top: 2px; }
.meta-line { display: flex; gap: 6px 16px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: .88rem; }
.meta-line span { display: inline-flex; gap: 4px; align-items: center; }
.meta-line .ic { width: 16px; height: 16px; }

.offer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.offer-card { display: grid; gap: 8px; align-content: start; margin: 0; }
.offer-card.best { box-shadow: 0 0 0 2px var(--primary), var(--shadow); }
.offer-card.expired { opacity: .6; }
.oc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.oc-head h3 { margin: 0; margin-inline-end: auto; }
.oc-total { font-size: 1.55rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.oc-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .86rem; color: var(--muted); }
.oc-facts li { display: flex; gap: 6px; align-items: center; }
.oc-facts .ic { width: 16px; height: 16px; }
.oc-note { font-style: italic; font-size: .9rem; margin: 0; }

.table-wrap { overflow-x: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
.card .table-wrap, details .table-wrap { box-shadow: none; border: 1px solid var(--line); margin: 8px 0 0; }
table.compare { width: 100%; border-collapse: collapse; font-size: .9rem; }
.compare th, .compare td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.compare th { background: var(--input); font-weight: 700; white-space: nowrap; }
.compare .num { text-align: end; font-variant-numeric: tabular-nums; }
.compare td small { display: block; color: var(--muted); font-size: .78rem; }
.compare td small.alt { color: var(--amber); }
.compare td.best { background: var(--green-soft); color: var(--green-ink); font-weight: 700; }
.compare td.na { color: var(--muted); font-style: italic; }
.compare tr.total td { font-weight: 800; font-size: 1rem; }
.compare tr.sub td { color: var(--muted); }
.compare tr:last-child td { border-bottom: 0; }
details summary { cursor: pointer; font-weight: 700; color: var(--primary); }
.others summary { margin-bottom: 4px; }

.selected-card { box-shadow: 0 0 0 2px var(--green), var(--shadow); display: grid; gap: 12px; }
.selected-card h2 { font-size: 1.35rem; margin: 6px 0 2px; }
.selected-card p { margin: 0; }
.sel-top { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.sel-info { flex: 1; min-width: 200px; }
.sel-info .ic { width: 16px; height: 16px; }
.sel-total { display: grid; text-align: end; }
.sel-total b { font-size: 1.6rem; }
.sel-total small { color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- chat (messenger style) ---------- */
.chat-log { height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 8px 2px; margin-bottom: 10px; }
.msg-row { display: flex; align-items: flex-end; gap: 6px; max-width: 85%; }
.msg-row.mine { align-self: flex-end; }
.msg { background: var(--gray-soft); padding: 8px 12px; border-radius: 18px; overflow-wrap: anywhere; }
.msg-row.mine .msg { background: var(--primary); color: var(--on-primary); }
.msg small { display: block; opacity: .7; font-size: .7rem; margin-top: 2px; }
.msg.system { align-self: center; background: none; color: var(--muted); font-size: .8rem; text-align: center; padding: 4px 12px; margin: 0; }
.chat-form { display: flex; gap: 8px; }
.chat-form input { border-radius: 999px; }

/* ---------- rating ---------- */
.star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
/* row-reverse also mirrors correctly in RTL: star 1 sits at the inline start in both directions. */
.star-input input { position: absolute; opacity: 0; pointer-events: none; }
.star-input label { font-size: 2rem; color: var(--line); cursor: pointer; line-height: 1; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: #f7b928; }
.star-input input:focus-visible + label { outline: 2px solid var(--primary); border-radius: 4px; }

/* ---------- new request ---------- */
.big-form h1 { margin: 8px 0 0; }
.big-form .post-head { padding: 0; }
.item-head, .item-row { display: grid; grid-template-columns: 76px minmax(0, 2.6fr) 64px 96px minmax(0, 1fr) 32px; gap: 8px; align-items: center; }
.item-head { font-size: .78rem; color: var(--muted); font-weight: 700; }
#items { display: grid; gap: 8px; }
.paste { background: var(--input); border-radius: 8px; padding: 10px 12px; }
.paste textarea { margin: 10px 0; background: var(--card); }

/* ---------- quote form ---------- */
.qlines { display: grid; border: 1px solid var(--line); border-radius: 8px; }
.qline:first-child { border-radius: 8px 8px 0 0; }
.qline:last-child { border-radius: 0 0 8px 8px; }
.qline { display: grid; grid-template-columns: minmax(0, 2fr) auto 150px 120px; gap: 8px 12px; align-items: end; padding: 12px; border-bottom: 1px solid var(--line); }
.qline.subbed { background: var(--amber-soft); box-shadow: inset 4px 0 0 var(--amber); }
[dir='rtl'] .qline.subbed { box-shadow: inset -4px 0 0 var(--amber); }
.ql-extra { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ql-extra .ql-alt { flex: 1 1 200px; padding: 7px 10px; font-size: .88rem; }
.ql-subtoggle { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: .88rem; }
.ql-subtoggle .ic { width: 16px; height: 16px; }
.ql-sub { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1 1 100%; }
.ql-sub select { width: auto; padding: 7px 10px; font-size: .88rem; }
.ql-subname { flex: 1 1 220px; }
.ql-subname input { padding: 7px 10px; font-size: .88rem; background: var(--card); }
.qline:last-child { border-bottom: 0; }
.qline.off { background: var(--input); }
.qline label span { font-size: .75rem; }
.ql-name { display: flex; gap: 10px; align-items: center; align-self: center; }
.ql-name > div { display: grid; min-width: 0; }
.ql-name small { color: var(--muted); }
.ql-avail { display: flex !important; align-items: center; gap: 6px; white-space: nowrap; padding-bottom: 10px; color: var(--ink) !important; }
.ql-total { text-align: end; font-weight: 700; font-variant-numeric: tabular-nums; padding-bottom: 10px; }
.qline.off .ql-total { color: var(--muted); font-weight: 400; font-style: italic; }
.quote-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 14px; }
.quote-total { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- landing ---------- */
.landing-bar { display: flex; justify-content: flex-end; align-items: center; gap: 8px; max-width: 1000px; margin: 0 auto; padding: 12px 16px 0; }
.hero { display: grid; grid-template-columns: 1fr 396px; gap: 32px 64px; align-items: center; max-width: 1000px; margin: 0 auto; padding: 56px 16px 80px; }
.hero-brand { color: var(--primary); font-weight: 800; font-size: clamp(2.6rem, 7vw, 3.8rem); letter-spacing: -.03em; line-height: 1; margin-bottom: 16px; }
.hero h1 { font-size: clamp(1.4rem, 3vw, 1.75rem); font-weight: 600; line-height: 1.3; margin-bottom: 10px; }
.hero p { font-size: 1.05rem; color: var(--muted); }
.auth-card { background: var(--card); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 16px; display: grid; text-align: center; }
.auth-card input { font-size: 1.05rem; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); }
.auth-card hr { margin: 20px 0; }
.auth-card .btn.success { justify-self: center; }
.auth-under { text-align: center; margin-top: 24px; font-size: .92rem; }
.auth-under a { color: var(--ink); text-decoration: none; }
.auth-under a:hover { text-decoration: underline; }

.land-section { background: var(--card); padding: 48px 16px; }
.land-section:nth-of-type(even) { background: var(--bg); }
.land-section > * { max-width: 1000px; margin-inline: auto; }
.land-section > h2 { text-align: center; font-size: 1.6rem; margin-bottom: 28px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature { text-align: center; padding: 8px; }
.feature p { color: var(--muted); }
.feature-ic { width: 56px; height: 56px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: inline-grid; place-items: center; margin-bottom: 12px; }
.feature-ic .ic { width: 28px; height: 28px; }
.feature-ic.green { background: var(--green-soft); color: var(--green-ink); }
.audiences { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.audience { background: var(--card); border-radius: 12px; box-shadow: var(--shadow); padding: 24px; display: grid; gap: 12px; align-content: start; justify-items: start; }
.audience ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.audience li { display: flex; gap: 10px; align-items: flex-start; }
.audience li .ic { color: var(--green); margin-top: 1px; }
.land-foot { text-align: center; padding: 24px 16px 40px; color: var(--muted); font-size: .85rem; }
.land-foot p { margin-top: 8px; }

/* ---------- sign-up modal ---------- */
.modal { border: 0; border-radius: 8px; padding: 0; width: min(432px, calc(100% - 32px)); background: var(--card); color: var(--ink); box-shadow: var(--shadow-lg); }
.modal::backdrop { background: rgb(255 255 255 / 80%); }
:root[data-theme='dark'] .modal::backdrop { background: rgb(0 0 0 / 70%); }
.modal form { padding: 16px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 4px; }
.modal-head h2 { font-size: 1.8rem; margin: 0; }
.modal-head p { margin: 0; }
.modal input, .modal select { background: var(--input); border-color: var(--line); }
.fine { font-size: .78rem; color: var(--muted); margin: 0; }
.signup-btn { justify-self: center; min-width: 194px; }

/* ---------- toast ---------- */
.toast { position: fixed; inset-inline-start: 16px; bottom: 16px; background: var(--card); color: var(--ink); padding: 12px 16px; border-radius: 8px; box-shadow: var(--shadow-lg); z-index: 60; max-width: min(420px, calc(100% - 32px)); font-weight: 600; border-inline-start: 4px solid var(--green); }
.toast.error { border-inline-start-color: var(--red); }
.boot-error { max-width: 480px; margin: 80px auto; }

/* ---------- autocomplete ---------- */
.ac-wrap, .ac-host { position: relative; min-width: 0; }
.ac-list {
  position: absolute; inset-inline: 0; top: calc(100% + 4px); z-index: 30; margin: 0; padding: 4px; list-style: none;
  background: var(--card); border-radius: 8px; box-shadow: var(--shadow-lg); max-height: 320px; overflow-y: auto; min-width: min(420px, 90vw);
}
.ac-list li { display: flex; gap: 10px; align-items: center; padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: .92rem; }
.ac-list li img, .ac-noimg { width: 40px; height: 40px; border-radius: 6px; object-fit: contain; background: #fff; border: 1px solid var(--line); flex-shrink: 0; }
.ac-noimg { display: grid; place-items: center; color: var(--muted); background: var(--input); }
.ac-noimg .ic { width: 16px; height: 16px; }
.ac-text { display: grid; gap: 1px; min-width: 0; }
.ac-list li small { color: var(--muted); font-size: .75rem; }
.ac-list li:hover, .ac-list li.active { background: var(--primary-soft); }

/* ---------- categories, location ---------- */
.plain-fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.plain-fieldset legend { font-weight: 600; font-size: .88rem; color: var(--muted); margin-bottom: 6px; padding: 0; }
.cat-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-option { display: inline-flex !important; cursor: pointer; }
.cat-option input { position: absolute; opacity: 0; pointer-events: none; }
.cat-option span { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: .88rem; font-weight: 600; color: var(--ink); }
.cat-option input:checked + span { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.cat-option input:checked + span::before { content: '✓ '; }
.cat-option input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 8px; }
.cat-chip { font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); }
.loc-box { display: grid; gap: 8px; }
.loc-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.loc-actions .ic { width: 16px; height: 16px; }
.filter-label { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: .82rem; font-weight: 700; color: var(--muted); }
.filter-label .ic { width: 16px; height: 16px; }
.filter-label + .city-chips { margin-top: 6px; }

/* ---------- feed items ---------- */
.item-list { list-style: none; margin: 4px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.item-list li { display: flex; align-items: center; gap: 10px; padding: 6px 12px; font-size: .9rem; border-bottom: 1px solid var(--line); }
.item-list .il-name { flex: 1; }
.item-list li:nth-child(even) { background: var(--input); }
.item-list li:last-child { border-bottom: 0; }
.il-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.il-qty { font-weight: 700; color: var(--primary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.il-more { color: var(--muted); justify-content: center !important; }
.post-notes { color: var(--muted) !important; font-size: .9rem; }
.ph-meta small { display: flex; align-items: center; gap: 4px; }
.ph-meta small .ic { width: 13px; height: 13px; }
.replies { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--gray-soft); color: var(--muted); white-space: nowrap; }
.replies .ic { width: 14px; height: 14px; }
.replies.some { background: var(--primary-soft); color: var(--primary); }
.replies.full { background: var(--amber-soft); color: var(--amber); }

/* ---------- verification, replacements ---------- */
.verified { display: inline-flex; align-items: center; gap: 3px; color: var(--primary); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.verified .ic { width: 16px; height: 16px; fill: var(--primary-soft); }
.sub-tag { display: inline-flex; align-items: center; gap: 3px; font-size: .72rem; font-weight: 800; color: var(--amber); background: var(--amber-soft); border-radius: 999px; padding: 1px 8px; margin-top: 3px; }
.sub-tag .ic { width: 12px; height: 12px; }
.sub-name { color: var(--ink) !important; font-weight: 600; }
.compare td.subbed { background: var(--amber-soft); }
.compare tr.subbed-row td { background: var(--amber-soft); }
.oc-facts li.warn { color: var(--amber); font-weight: 700; }

/* ---------- profile, admin ---------- */
.logo-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.file-btn { cursor: pointer; }
.verif-cta { box-shadow: 0 0 0 2px var(--primary-soft), var(--shadow); }
.admin-body { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; margin: 12px 0 4px; }
.admin-shop .actions { margin-top: 8px; }
.admin-shop .post-head { padding: 0; }

/* ---------- drop-down multi-select ---------- */
.field { display: grid; gap: 4px; min-width: 0; }
.field-label { font-weight: 600; font-size: .88rem; color: var(--muted); }
.dropdown { position: relative; }
.dropdown summary {
  list-style: none; cursor: pointer; background: var(--input); border: 1px solid transparent; border-radius: 6px;
  padding: 10px 36px 10px 12px; min-height: 42px; position: relative; font-weight: 500;
}
[dir='rtl'] .dropdown summary { padding: 10px 12px 10px 36px; }
.dropdown summary::-webkit-details-marker { display: none; }
.dropdown summary::after { content: '▾'; position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.dropdown[open] summary { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.dd-value { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-value.placeholder { color: var(--muted); font-weight: 400; }
.dd-panel {
  position: absolute; z-index: 25; inset-inline: 0; top: calc(100% + 4px); background: var(--card); border-radius: 8px;
  box-shadow: var(--shadow-lg); padding: 6px; display: grid; max-height: 300px; overflow-y: auto; min-width: 240px;
}
.dd-option { display: flex !important; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; cursor: pointer; color: var(--ink) !important; font-weight: 500 !important; font-size: .92rem !important; }
.dd-option:hover { background: var(--hover); }

/* ---------- photos ---------- */
.thumb { width: 32px; height: 32px; border-radius: 6px; overflow: hidden; flex-shrink: 0; display: inline-grid; place-items: center; background: #fff; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb.md { width: 48px; height: 48px; }
.thumb.no-photo { background: var(--input); color: var(--muted); border-style: dashed; }
.thumb.no-photo .ic { width: 14px; height: 14px; }
.thumb.md.no-photo .ic { width: 18px; height: 18px; }
.ir-photo { display: flex; align-items: center; gap: 4px; }
.photo-btn { width: 24px; height: 24px; border-radius: 50%; display: grid !important; place-items: center; cursor: pointer; background: var(--primary-soft); color: var(--primary) !important; }
.photo-btn .ic { width: 14px; height: 14px; }
.photo-btn:focus-within { outline: 2px solid var(--primary); }
.cell-item { display: flex; gap: 8px; align-items: center; }
.cell-item > div { display: grid; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- feed controls ---------- */
.feed-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.feed-controls .filter-label { margin-top: 0; }
.toggle { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-weight: 600; cursor: pointer; }
.match-tag { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 700; color: var(--green-ink); background: var(--green-soft); border-radius: 999px; padding: 2px 9px; margin-bottom: 6px; }
.match-tag .ic { width: 12px; height: 12px; }
.own-post { box-shadow: 0 0 0 2px var(--primary-soft), var(--shadow); }
.list-card { padding: 8px; }
.list-card .item-list { margin: 0; border: 0; }

/* ---------- offers ---------- */
.offer-card.clickable { cursor: pointer; transition: transform .1s; }
.offer-card.clickable:hover { transform: translateY(-2px); }
.oc-more { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 700; font-size: .88rem; }
.oc-more .ic { width: 16px; height: 16px; }
.wide-modal { width: min(760px, calc(100% - 24px)); }
.modal-body { padding: 16px; display: grid; gap: 12px; }
.warn-callout { background: var(--amber-soft); color: var(--amber); font-weight: 600; margin: 0; }
.warn-callout .ic { color: var(--amber); }
.inline-facts { display: flex; flex-wrap: wrap; gap: 8px 16px; }

/* ---------- responsive ---------- */
@media (max-width: 1260px) {
  .layout { grid-template-columns: 240px minmax(0, 1fr) 280px; }
  .layout.wide { grid-template-columns: 240px minmax(0, 1fr); }
}
@media (max-width: 1060px) {
  .layout { grid-template-columns: minmax(0, 680px) 280px; justify-content: center; }
  .layout.wide { grid-template-columns: minmax(0, 1000px); justify-content: center; }
  .side-left { display: none; }
}
@media (max-width: 860px) {
  .layout, .layout.wide { grid-template-columns: minmax(0, 1fr); padding: 12px 0; gap: 0; }
  .side-right { display: none; }
  .main > .card, .main > .back, .main > .callout, .main > .section-title, .main > .offer-grid, .main > .table-wrap, .main > .grid-2, .main > .danger-zone, .main > details { margin-inline: 8px; }
  .hero { grid-template-columns: 1fr; padding: 24px 16px 48px; text-align: center; gap: 24px; }
  .auth-wrap { max-width: 396px; width: 100%; margin: 0 auto; }
  .features, .audiences, .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar { grid-template-columns: auto 1fr auto; padding: 0 8px; }
  .brand-name, .me-name { display: none; }
  .tabs { justify-content: center; }
  .tab { width: 64px; }
  .top-actions { gap: 4px; }
  .round-btn { width: 36px; height: 36px; }
  .me-chip { display: none; }
  .item-head { display: none; }
  .item-row { grid-template-columns: 60px 1fr 1fr 36px; padding: 10px; background: var(--input); border-radius: 8px; }
  .item-row .ir-photo { grid-row: 1 / span 2; }
  .item-row input, .item-row select { background: var(--card); }
  .item-row .ac-host { grid-column: 2 / -1; }
  .item-row [name=note] { grid-column: 1 / -1; }
  .item-row [data-remove] { grid-column: 4; grid-row: 2; }
  .feed-controls { grid-template-columns: 1fr; }
  .qline { grid-template-columns: 1fr 1fr; }
  .ql-name { grid-column: 1 / -1; }
  .ql-avail { order: 3; }
  .ql-total { order: 4; }
  .sel-total { text-align: start; }
  .compare th, .compare td { padding: 8px; }
  .pa { font-size: .9rem; }
}
/* ---------- header menus (account, messages) ---------- */
.menu-wrap { position: relative; }
.avatar-btn { border: 0; padding: 0; background: none; border-radius: 50%; cursor: pointer; display: grid; }
.avatar-btn .avatar { width: 40px; height: 40px; }
.avatar-btn:hover .avatar { filter: brightness(.93); }
.badge-host { position: relative; }
.count-badge {
  position: absolute; top: -4px; inset-inline-end: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: .72rem; font-weight: 800; display: grid; place-items: center; line-height: 1;
  border: 2px solid var(--card);
}
.count-badge.static { position: static; border: 0; }
.menu-panel {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 40; width: 340px; max-width: calc(100vw - 16px);
  background: var(--card); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 8px; max-height: 70vh; overflow-y: auto;
}
.menu-panel hr { margin: 6px 4px; }
.menu-title { font-weight: 800; font-size: 1.25rem; padding: 4px 8px 8px; }
.menu-empty { padding: 8px; }
.menu-head { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.menu-head span { display: grid; }
.menu-head small { color: var(--muted); }
.menu-head:hover, .menu-item:hover { background: var(--hover); }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border-radius: 8px; border: 0; background: none; font: inherit; font-weight: 600; color: var(--ink); text-decoration: none; cursor: pointer; text-align: start; }
.conv-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 8px; border: 0; background: none; font: inherit; color: var(--ink); cursor: pointer; text-align: start; }
.conv-item:hover { background: var(--hover); }
.conv-text { display: grid; min-width: 0; flex: 1; }
.conv-text small, .conv-last { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-item.unread .conv-last { color: var(--ink); font-weight: 700; }
.conv-meta { display: grid; justify-items: end; gap: 4px; flex-shrink: 0; }
.conv-meta small { color: var(--muted); font-size: .72rem; }

/* ---------- pop-out chat windows ---------- */
.chat-dock { position: fixed; bottom: 0; inset-inline-end: 16px; z-index: 50; display: flex; flex-direction: row-reverse; align-items: flex-end; gap: 10px; pointer-events: none; }
.chat-win {
  pointer-events: auto; width: 330px; background: var(--card); border-radius: 10px 10px 0 0; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line);
}
.chat-win.floating { position: fixed; z-index: 55; border-radius: 10px; }
.cw-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 10px; background: var(--primary); color: #fff; cursor: grab; user-select: none; touch-action: none; }
.cw-head:active { cursor: grabbing; }
.cw-head .avatar { border: 2px solid rgb(255 255 255 / 60%); }
.cw-who { display: grid; min-width: 0; flex: 1; }
.cw-who b { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-who small { font-size: .72rem; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-who .verified { color: #fff; }
.cw-btn { width: 28px; height: 28px; border-radius: 50%; border: 0; background: transparent; color: #fff; display: grid; place-items: center; cursor: pointer; font: inherit; }
.cw-btn:hover { background: rgb(255 255 255 / 18%); }
.cw-btn .ic { width: 16px; height: 16px; }
.cw-rate { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 10px; background: var(--amber-soft); border-bottom: 1px solid var(--line); font-size: .85rem; }
.cw-rate-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-rate-form { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; width: 100%; }
.cw-rate-form input { flex: 1 1 120px; padding: 5px 8px; font-size: .82rem; background: var(--card); }
.star-pick { display: inline-flex; }
.star-pick button { border: 0; background: none; font-size: 1.3rem; line-height: 1; color: var(--line); cursor: pointer; padding: 0 1px; }
.star-pick button.on { color: #f7b928; }
.star-pick button:focus-visible { outline: 2px solid var(--primary); border-radius: 4px; }
.cw-body { display: flex; flex-direction: column; }
.cw-body .chat-log { height: 300px; padding: 8px; margin: 0; }
.cw-body .chat-form { padding: 8px; border-top: 1px solid var(--line); }
.chat-win.min .cw-rate, .chat-win.min .cw-body { display: none; }
.chat-win.min { width: 240px; }
.chat-cta p { margin-bottom: 12px; }

/* ---------- feed: composer, view switch, compact filters ---------- */
.composer { display: flex; align-items: center; gap: 10px; }
button.composer-input { border: 0; text-align: start; font: inherit; color: var(--muted); cursor: pointer; }
button.composer-input:hover { background: var(--hover); }
.composer-photo { width: 42px; height: 42px; padding: 0; border-radius: 50%; }
.composer-modal { width: min(820px, calc(100% - 24px)); max-height: calc(100vh - 32px); overflow-y: auto; }
.composer-modal .big-form { padding: 16px; }
.composer-head { position: sticky; top: -16px; background: var(--card); z-index: 2; padding-top: 4px; }
.view-switch { display: flex; background: var(--input); border-radius: 8px; padding: 4px; gap: 4px; }
.view-switch button { flex: 1; border: 0; background: none; padding: 8px; border-radius: 6px; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; }
.view-switch button.active { background: var(--card); color: var(--primary); box-shadow: var(--shadow); }
.view-switch + .filter-bar { margin-top: 10px; }
.filter-bar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1.2fr); gap: 8px; margin-top: 8px; align-items: end; }
.fb-field { display: grid; gap: 3px; min-width: 0; }
.fb-label { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 700; color: var(--muted); }
.fb-label .ic { width: 13px; height: 13px; }
.filter-bar select, .filter-bar .dropdown summary { padding: 7px 10px; min-height: 36px; font-size: .9rem; }
.status-chips { margin: 0 0 12px; }

/* ---------- quote form: one aligned row per article ---------- */
.qline { grid-template-columns: minmax(0, 1fr) 170px 110px auto 96px; align-items: center; gap: 8px 12px; }
.qline.qhead { padding: 8px 12px; background: var(--input); font-size: .75rem; font-weight: 700; color: var(--muted); }
.qline.qhead .num { text-align: end; }
.ql-price { display: flex; align-items: center; gap: 4px; }
.ql-price input { padding: 8px 10px; text-align: end; font-variant-numeric: tabular-nums; }
.ql-unit { font-size: .72rem; color: var(--muted); white-space: nowrap; max-width: 66px; overflow: hidden; text-overflow: ellipsis; }
.ql-total { padding-bottom: 0; }
.ql-avail { padding-bottom: 0; font-size: .88rem; }
.ql-subtoggle.active { color: var(--amber); background: var(--amber-soft); }
.ql-sub { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 4px; }
.ql-sub .ql-alt { flex: 1 1 160px; padding: 7px 10px; font-size: .88rem; background: var(--card); }

/* ---------- admin dashboard ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-tile { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; display: grid; gap: 2px; }
.st-label { font-size: .78rem; font-weight: 700; color: var(--muted); }
.st-value { font-size: 1.45rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }
.st-sub { font-size: .78rem; color: var(--muted); }
.dash-charts { margin-bottom: 16px; }
.viz { --s-acc: #0d9488; --s-not: #eb6834; }
.viz-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin-bottom: 10px; }
.viz-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw.s-acc, .hb-seg.s-acc { background: var(--s-acc); }
.sw.s-not, .hb-seg.s-not { background: var(--s-not); }
.hbars { display: grid; gap: 8px; }
.hb-row { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: .85rem; }
.hb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.hb-track { display: flex; gap: 2px; height: 14px; }
.hb-seg { height: 100%; min-width: 3px; }
.hb-seg:first-child { border-radius: 0; }
.hb-seg:last-child { border-start-end-radius: 4px; border-end-end-radius: 4px; }
.hb-value { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .8rem; white-space: nowrap; }
.viz-tip { position: fixed; z-index: 70; background: var(--ink); color: #fff; font-size: .8rem; padding: 6px 10px; border-radius: 6px; pointer-events: none; max-width: 280px; }
.data-table td small { display: block; color: var(--muted); font-size: .75rem; }
.data-table td { vertical-align: middle; }
.mini-bar { display: inline-block; width: 40px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--primary) var(--v), var(--gray-soft) var(--v)); vertical-align: middle; margin-inline-end: 4px; }
[dir='rtl'] .mini-bar { background: linear-gradient(270deg, var(--primary) var(--v), var(--gray-soft) var(--v)); }
.danger-btn:hover { color: var(--red); }

@media (max-width: 860px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .filter-bar .fb-field:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .qline { grid-template-columns: minmax(0, 1fr) auto auto; }
  .qline.qhead { display: none; }
  .ql-name { grid-column: 1 / -1; }
  .ql-price { grid-column: 1; }
  .ql-total { grid-column: 2 / -1; }
  .ql-btn-label { font-size: .82rem; }
  .ql-avail, .ql-total { order: 0; }
  .chat-dock { inset-inline: 0; }
  .chat-win, .chat-win.min { width: 100%; }
  .chat-win.floating { width: calc(100% - 16px); }
  .hb-row { grid-template-columns: minmax(0, 90px) minmax(0, 1fr) auto; }
  .menu-panel { position: fixed; top: 60px; inset-inline: 8px; width: auto; }
}


.data-table td:first-child { min-width: 210px; }
.data-table th { white-space: nowrap; }

/* ---------- spreadsheet-style tables (quotes for shops and clients, article list) ---------- */
.xls-wrap { overflow-x: auto; border: 1px solid #c8ccd0; border-radius: 6px; background: var(--card); margin: 8px 0 4px; }
table.xls { width: 100%; border-collapse: collapse; font-size: .9rem; }
.xls th, .xls td { border: 1px solid #d6dade; padding: 6px 8px; text-align: start; vertical-align: middle; }
.xls tr > :first-child { border-inline-start: 0; }
.xls tr > :last-child { border-inline-end: 0; }
.xls thead th { border-top: 0; background: #eef1f3; font-size: .78rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.xls .num { text-align: end; font-variant-numeric: tabular-nums; }
.xls .center { text-align: center; }
.xls .rownum { width: 32px; text-align: center; background: #eef1f3; color: var(--muted); font-size: .75rem; }
.xls td small { display: block; color: var(--muted); font-size: .75rem; }
.xls .x-item { min-width: 200px; }
/* A cell to fill: the input takes the whole cell, like a spreadsheet. */
.xls td.x-cell { padding: 0; background: #fffef5; min-width: 120px; }
.xls td.x-cell input { width: 100%; height: 100%; min-height: 40px; border: 0; border-radius: 0; background: transparent; padding: 8px 10px; }
.xls td.x-cell input[name=price] { text-align: end; font-variant-numeric: tabular-nums; }
.xls td.x-cell input:focus { box-shadow: inset 0 0 0 2px var(--primary); outline: none; background: #fff; }
.xls td.x-cell input:disabled { background: repeating-linear-gradient(135deg, #f3f4f5 0 6px, #eceef0 6px 12px); cursor: not-allowed; }
.xls td.x-sub { min-width: 220px; }
.xls td.x-sub .ac-host { height: 100%; }
.xls input[type=checkbox] { width: 18px; height: 18px; }
.xls tr.off td:not(.rownum) { color: var(--muted); }
.xls tr.subbed td { background: var(--amber-soft); }
.xls tr.subbed td.x-sub { background: #fff; box-shadow: inset 0 0 0 2px var(--amber); }
.xls tfoot td, .xls tr.sub td, .xls tr.total td { background: #f7f8f9; }
.xls .x-total td, .xls tr.total td { font-weight: 800; font-size: .98rem; }
.xls tr.subbed-row td { background: var(--amber-soft); }
.xls .cell-item small.alt { color: var(--amber); }

/* The client's article list in the request form, as a grid of cells. */
#new-request .item-head, #new-request .item-row { gap: 0; }
#new-request .item-head { background: #eef1f3; border: 1px solid #c8ccd0; border-bottom: 0; border-radius: 6px 6px 0 0; }
#new-request .item-head > span { padding: 6px 8px; border-inline-end: 1px solid #d6dade; }
#new-request #items { gap: 0; border: 1px solid #c8ccd0; border-radius: 0 0 6px 6px; overflow: visible; }
#new-request .item-row { border-bottom: 1px solid #d6dade; background: #fffef5; }
#new-request .item-row:last-child { border-bottom: 0; }
#new-request .item-row > * { border-inline-end: 1px solid #d6dade; align-self: stretch; }
#new-request .item-row > :last-child { border-inline-end: 0; }
#new-request .item-row input, #new-request .item-row select { border: 0; border-radius: 0; background: transparent; height: 100%; min-height: 44px; }
#new-request .item-row input:focus, #new-request .item-row select:focus { box-shadow: inset 0 0 0 2px var(--primary); background: #fff; }
#new-request .item-row .ir-photo { padding: 4px; background: #fff; }
#new-request .item-row .icon-btn { border-radius: 0; height: 100%; width: 100%; }
@media (max-width: 640px) {
  #new-request .item-head { display: none; }
  #new-request .item-row { padding: 0; border-radius: 0; }
  #new-request #items { border-radius: 6px; }
}

/* ---------- the client's request form as a spreadsheet ---------- */
.req-xls tbody { counter-reset: row; }
.req-xls .req-row { counter-increment: row; }
.req-xls .req-row .rownum::before { content: counter(row); }
.xls td.x-photo { width: 64px; padding: 4px 6px; background: #fff; }
.xls td.x-photo .ir-photo { gap: 4px; }
.xls td.x-item-cell { min-width: 220px; }
.xls td.x-qty { width: 72px; min-width: 72px; }
.xls td.x-qty input { text-align: end; }
.xls td.x-unit { width: 100px; min-width: 100px; }
.xls td.x-cell select { width: 100%; min-height: 40px; border: 0; border-radius: 0; background: transparent; padding: 8px; }
.xls td.x-cell select:focus { box-shadow: inset 0 0 0 2px var(--primary); outline: none; background: #fff; }
.req-xls td.x-cell { min-width: 110px; }
.req-xls td.x-cell.x-qty { min-width: 72px; }
.req-xls .icon-btn { width: 32px; height: 32px; }
.xls td .muted { color: #b0b4b8; }
.il-name { display: grid; min-width: 0; flex: 1; }
.il-spec { color: var(--muted); font-size: .76rem; }
.ac-list { z-index: 80; }

/* The old card list used #items as a grid; inside the table it must stay a table body. */
#new-request .req-xls #items { display: table-row-group; border: 0; border-radius: 0; }
.req-xls td.x-cell.x-item-cell { min-width: 240px; }
.xls td.x-item { min-width: 190px; }
.xls td.ql-total, .xls #qfee, .xls #qtotal { white-space: nowrap; min-width: 110px; }
.xls #qcount { white-space: nowrap; }

/* ---------- "Remplacer l'article": the alternative is written in a box under the article ---------- */
.xls .sub-box { margin-top: 6px; display: grid; gap: 3px; }
.xls .sub-box[hidden] { display: none; }
.xls .sub-label { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 800; color: var(--amber); }
.xls .sub-label .ic { width: 12px; height: 12px; }
.xls .sub-box input { width: 100%; padding: 7px 9px; border: 2px solid var(--amber); border-radius: 4px; background: #fff; font-size: .88rem; }
.xls .sub-box input:focus { outline: none; box-shadow: 0 0 0 3px var(--amber-soft); }
.xls tr.subbed td.x-item { background: var(--amber-soft); }
.xls #qcount { display: block; font-weight: 400; }

/* ---------- phones: smaller tables, no brand / size / row number ---------- */
@media (max-width: 640px) {
  .xls .col-brand, .xls .col-size, .xls .rownum { display: none; }
  table.xls { font-size: .8rem; }
  .xls th, .xls td { padding: 4px 5px; }
  .xls thead th { font-size: .68rem; white-space: normal; }
  .xls td.x-photo { width: 34px; padding: 3px; }
  .xls td.x-photo .photo-btn { width: 20px; height: 20px; }
  .xls .thumb.sm { width: 26px; height: 26px; }
  .xls td.x-item { min-width: 110px; }
  .xls td.x-cell { min-width: 64px; }
  .xls td.x-cell input, .xls td.x-cell select { min-height: 34px; padding: 5px 6px; font-size: .82rem; }
  .req-xls td.x-cell.x-item-cell { min-width: 130px; }
  .req-xls td.x-qty { width: 52px; min-width: 52px; }
  .req-xls td.x-unit { width: 72px; min-width: 72px; }
  .xls td.ql-total, .xls #qfee, .xls #qtotal { min-width: 76px; }
  .xls input[type=checkbox] { width: 16px; height: 16px; }
  .card .xls-wrap, .modal .xls-wrap { margin-inline: -8px; border-radius: 0; border-inline: 0; }
}
.xls .qty-inline { display: none; }
@media (max-width: 640px) {
  /* Phone: quantity goes under the article name; quotes and offers drop the photo column. */
  .xls .col-qty { display: none; }
  .xls .qty-inline { display: block; color: var(--primary); font-weight: 700; }
  .xls:not(.req-xls) .x-photo { display: none; }
  .xls td.x-item { min-width: 0; max-width: 140px; overflow-wrap: anywhere; }
  .xls td.x-cell { min-width: 70px; }
  .xls td.ql-total, .xls #qfee, .xls #qtotal { min-width: 0; white-space: normal; }
  .xls th.center, .xls td.center { padding-inline: 2px; }
}
@media (max-width: 640px) {
  .xls td.x-item { max-width: 118px; }
  .xls td.x-cell { min-width: 56px; }
  .xls th, .xls td { padding: 4px 4px; }
  .xls td.ql-total { font-size: .74rem; }
}
@media (max-width: 640px) {
  .req-xls .col-note { display: none; }
  .composer-modal .big-form { padding: 12px; }
  .composer-modal .xls-wrap { margin-inline: -12px; }
}
@media (max-width: 640px) {
  .req-xls td.x-cell.x-item-cell { min-width: 112px; }
  .req-xls td.x-unit { width: 66px; min-width: 66px; }
}
@media (max-width: 640px) {
  .req-xls td.x-qty { width: 46px; min-width: 46px; }
}

/* ---------- attachments: photo / file of the list, devis file ---------- */
.att-box { border: 1px dashed var(--line); border-radius: var(--radius); padding: 12px; margin: 8px 0 12px; background: var(--bg); display: grid; gap: 8px; }
.att-lead { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: .9rem; }
.att-lead .ic { color: var(--primary); flex: none; margin-top: 2px; }
.att-title { display: flex; align-items: center; gap: 6px; font-size: .95rem; margin: 0; }
.att-picker { display: grid; gap: 8px; }
.att-picker .fine { margin: 0; }
.att-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.att-btn { cursor: pointer; }
.att-grid { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.att-grid:empty { display: none; }
.att-tile { position: relative; width: 132px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.att-tile > a { display: grid; color: inherit; text-decoration: none; }
.att-tile img, .att-tile .att-ic { width: 100%; height: 92px; object-fit: cover; object-position: top; display: grid; place-items: center; background: var(--gray-soft); }
.att-ic { color: var(--muted); align-content: center; gap: 2px; }
.att-ic .ic { width: 28px; height: 28px; }
.att-ic b { font-size: .72rem; letter-spacing: .04em; }
.att-pdf { color: #c92a2a; }
.att-sheet { color: #2b8a3e; }
.att-doc { color: #1864ab; }
.att-name { display: grid; padding: 6px 8px; font-size: .78rem; line-height: 1.25; min-width: 0; }
.att-name bdi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.att-name small { color: var(--muted); }
.att-remove { position: absolute; inset-block-start: 4px; inset-inline-end: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0;
  background: rgb(0 0 0 / 60%); color: #fff; cursor: pointer; font-size: .8rem; line-height: 1; }
.att-remove:hover { background: var(--red); }
.att-loading { opacity: .65; }
.att-loading .att-ic .ic { animation: att-pulse 1s ease-in-out infinite alternate; }
@keyframes att-pulse { from { transform: translateY(2px); } to { transform: translateY(-2px); } }
.att-view { display: grid; gap: 8px; margin-top: 12px; }
.att-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.att-strip img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.att-chip { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border-radius: 14px; background: var(--gray-soft); color: var(--muted); font-size: .78rem; font-weight: 700; align-self: center; }
.amount-field { max-width: 280px; }
.amount-field input { font-size: 1.1rem; font-weight: 700; background: var(--card); border: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) { .att-loading .att-ic .ic { animation: none; } }
@media (max-width: 640px) {
  .att-tile { width: calc(50% - 4px); }
  .att-btns .att-btn { flex: 1 1 140px; justify-content: center; }
  .amount-field { max-width: none; }
}

/* ---------- landing v2: list first, sample comparison; auth pages ---------- */
.landing-bar { max-width: 1100px; padding: 12px 16px; justify-content: flex-start; }
.landing-bar .grow { flex: 1; }
.hero.hero-list { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); max-width: 1100px; gap: 32px 48px; padding: 40px 16px 64px; text-align: start; }
.hero-list h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin-bottom: 14px; color: var(--ink); }
.hero-list p { font-size: 1.08rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 12px; }
.hero-ctas .btn.success { font-size: 1.15rem; padding-inline: 26px; }
.hero-note { display: flex; gap: 6px; align-items: center; font-size: .92rem !important; }
.hero-note .ic { color: var(--green); flex: none; }
.hero-list .callout { margin-top: 16px; text-align: start; }

.demo-card { margin: 0; background: var(--card); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 16px; min-width: 0; }
.demo-card figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-bottom: 10px; font-size: .95rem; }
.demo-card figcaption .muted { font-size: .85rem; }
.demo-scroll { overflow-x: auto; }
.demo-table { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
.demo-table th, .demo-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.demo-table thead th { font-size: .82rem; color: var(--muted); font-weight: 700; white-space: nowrap; }
.demo-table th[scope=row] { font-weight: 600; }
.demo-table small { display: block; color: var(--muted); font-weight: 400; font-size: .76rem; }
.demo-table .num { text-align: end; white-space: nowrap; }
.demo-table td.na { color: var(--muted); font-style: italic; }
.demo-table .best { background: var(--green-soft); }
.demo-table thead .best { color: var(--green-ink); }
.demo-table thead .best small { color: var(--green-ink); font-weight: 700; }
.demo-sub th, .demo-sub td { color: var(--muted); }
.demo-total th, .demo-total td { font-weight: 800; font-size: .95rem; border-bottom: 0; }
.demo-total small.warn { color: var(--amber); font-weight: 600; }
.demo-note { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; font-size: .85rem !important; color: var(--muted); }
.demo-note .ic { color: var(--primary); flex: none; margin-top: 2px; }

.auth-page { display: grid; grid-template-columns: minmax(0, 480px); justify-content: center; padding: 24px 16px 48px; }
.auth-panel { width: 100%; min-width: 0; padding: 24px; }
.auth-panel h1 { font-size: 1.5rem; margin-bottom: 16px; }
.auth-panel .form label { color: var(--ink); }
.auth-panel input, .auth-panel select { font-size: 1rem; }
.field-hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
.forgot { justify-self: end; font-size: .9rem; color: var(--primary); }
.auth-switch { text-align: center; margin: 18px 0 0; font-size: .95rem; }
.auth-switch a { color: var(--primary); font-weight: 700; }
.segmented.two label { flex: 1 1 160px; justify-content: center; }
[data-for][hidden], [data-kind][hidden] { display: none !important; }

@media (max-width: 860px) {
  .hero.hero-list { grid-template-columns: minmax(0, 1fr); padding: 16px 16px 40px; text-align: start; }
  .hero-list > * { min-width: 0; }
  .hero-ctas .btn { flex: 1 1 220px; justify-content: center; }
}
@media (max-width: 480px) {
  .landing-bar .brand-name { font-size: 1.1rem; }
  .demo-card { padding: 12px; }
  .demo-table th, .demo-table td { padding: 6px 4px; }
  .demo-table { font-size: .8rem; }
}

/* ---------- seller profile, what "Choisir" means, order tracking ---------- */
.oc-links { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; }
.oc-links .link-btn, .modal-head .link-btn { display: inline-flex; align-items: center; gap: 4px; padding-inline: 0; }
.choose-hint { display: flex; gap: 6px; align-items: flex-start; margin: 8px 0 0; font-size: .8rem; color: var(--muted); }
.choose-hint .ic { flex: none; color: var(--primary); margin-top: 1px; }
.seller-table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; font-size: .92rem; }
.seller-table th, .seller-table td { text-align: start; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.seller-table th { width: 38%; color: var(--muted); font-weight: 600; }
.review-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.review-list li { background: var(--bg); border-radius: var(--radius); padding: 10px 12px; }
.review-list p { margin: 4px 0 0; }
.rv-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.rate-h { display: flex; align-items: center; gap: 6px; font-size: 1rem; margin: 12px 0 8px; }
.outcome-line { display: flex; gap: 6px; align-items: center; margin: 6px 0 0; font-weight: 600; font-size: .92rem; }
.outcome-line.received { color: var(--green-ink); }
.outcome-line.failed { color: var(--red); }
.outcome-line.waiting { color: var(--amber); }
@media (max-width: 480px) { .seller-table th { width: 42%; } }

/* brand name: "Devis" teal + "Prix" orange */
.brand-accent { color: var(--accent); }

/* ---------- installable app + help page ---------- */
.install-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.help-wrap { max-width: 760px; margin: 0 auto; padding: 16px; }
.help-page h1 { display: flex; align-items: center; gap: 8px; font-size: 1.5rem; }
.help-section { margin-top: 20px; display: grid; gap: 10px; }
.help-section h2 { display: flex; align-items: center; gap: 8px; font-size: 1.15rem; margin: 0; }
.help-section > .btn { justify-self: start; }
.help-item { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.help-item > summary { cursor: pointer; padding: 12px 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; list-style: none; }
.help-item > summary::-webkit-details-marker { display: none; }
.help-item > summary::before { content: '▸'; color: var(--primary); transition: transform .15s; }
.help-item[open] > summary::before { transform: rotate(90deg); }
[dir=rtl] .help-item > summary::before { content: '◂'; }
[dir=rtl] .help-item[open] > summary::before { transform: rotate(-90deg); }
.help-item > p, .help-item > .help-steps { margin: 0 14px 14px; color: var(--ink); line-height: 1.5; }
.help-item > .fine { margin: -6px 14px 14px; }
.help-steps { padding-inline-start: 22px; display: grid; gap: 6px; }
.side-foot a { color: inherit; }
.install-link .narrow-only { display: none; }
@media (max-width: 480px) {
  .install-link .wide-only { display: none; }
  .install-link .narrow-only { display: inline; }
  .landing-bar { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) { .help-item > summary::before { transition: none; } }

/* ---------- phones: no zoom, fields that fit, address field ---------- */
/* iPhone zooms into any field whose text is under 16 px: touch screens get 16 px fields. */
html { touch-action: manipulation; } /* no double-tap zoom */
body { overflow-x: hidden; }
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px; }
}
/* iPhone date fields keep their own width unless reset. */
input[type=date] { -webkit-appearance: none; appearance: none; display: block; min-height: 42px; text-align: start; max-width: 100%; }
input[type=date]::-webkit-date-and-time-value { text-align: start; }
@media (max-width: 640px) {
  .row.row-stack-phone { grid-template-columns: 1fr; }
}
.loc-box { display: grid; gap: 8px; }
.loc-box > label { display: grid; gap: 4px; }
.loc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.loc-missing input[dir=auto] { border-color: var(--red); box-shadow: 0 0 0 2px rgb(228 30 63 / 15%); }
.loc-missing .loc-status { color: var(--red); }

/* ---------- new-request form: a fixed frame, only the middle scrolls ---------- */
/* Header (title, step) and footer (buttons) never move or cover a field; one scroll area in between.
   Sized on the visible screen (dvh): iPhone's toolbar can't hide the buttons. */
.composer-modal { padding: 0; overflow: hidden; max-height: none; }
.composer-form { display: flex; flex-direction: column; gap: 0; padding: 0 !important; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); }
.composer-head { position: static; top: auto; display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 4px 12px;
  padding: 14px 16px 10px; border-bottom: 1px solid var(--line); background: var(--card); margin: 0; }
.composer-head h2 { font-size: 1.35rem; margin: 0; }
.step-label { margin: 2px 0 0; color: var(--muted); font-size: .88rem; font-weight: 600; }
.step-bar { grid-column: 1 / -1; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; margin-top: 6px; }
.step-bar span { height: 4px; border-radius: 2px; background: var(--gray-soft); }
.step-bar span.on { background: var(--primary); }
.composer-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 20px; }
.composer-body > section { gap: 14px; }
.composer-body .section-title { margin: 6px 0 0; font-size: 1.05rem; }
.composer-foot { display: flex; gap: 10px; padding: 10px 16px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--card); }
.composer-foot #publish { flex: 1; }
.composer-foot #step-back { flex: 0 0 auto; }
/* The categories list opens in the page (no little scrolling box over other fields). */
.composer-form .dd-panel { position: static; max-height: none; overflow: visible; box-shadow: none; border: 1px solid var(--line); margin-top: 6px; min-width: 0; }
@media (max-width: 640px) {
  .composer-modal { inset: 0; margin: 0; width: 100%; max-width: 100%; height: 100vh; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .composer-form { height: 100vh; height: 100dvh; max-height: 100dvh; }
  .composer-body { padding: 12px 12px 20px; }
  .composer-modal .composer-body .xls-wrap { margin-inline: -12px; }
}

/* ---------- errors under the field concerned ---------- */
.field-error { display: flex; align-items: flex-start; gap: 6px; margin-top: 4px; color: var(--red); font-size: .85rem; font-weight: 600; line-height: 1.35; }
.field-error::before { content: '⚠'; flex: none; }
input.is-invalid, select.is-invalid, textarea.is-invalid { border-color: var(--red) !important; box-shadow: 0 0 0 2px rgb(228 30 63 / 15%) !important; background: var(--card); }
.dropdown.is-invalid summary, .att-btns.is-invalid .btn { border-color: var(--red); box-shadow: 0 0 0 2px rgb(228 30 63 / 15%); }
.att-btns.is-invalid .btn { border: 1px solid var(--red); }
/* In the item table the message sits under the cell's input without widening the column. */
.xls td .field-error { font-size: .78rem; white-space: normal; max-width: 220px; }

/* Legal pages: readable long text */
.legal-page p { line-height: 1.6; margin: 0; }
.legal-page .help-section { gap: 8px; }
.legal-page .help-section h2 { font-size: 1.05rem; }
.legal-other { margin-top: 24px !important; padding-top: 12px; border-top: 1px solid var(--line); }

/* Admin: visitor statistics */
.visits { display: grid; gap: 12px; }
.visits h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.vchart { display: flex; align-items: flex-end; gap: 2px; height: 140px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.vcol { flex: 1; height: 100%; display: flex; align-items: flex-end; position: relative; outline: none; }
.vcol i { display: block; width: 100%; min-height: 2px; background: var(--primary); border-radius: 4px 4px 0 0; opacity: .85; }
.vcol:hover i, .vcol:focus i { opacity: 1; box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--primary); }
.vcol span { position: absolute; top: 100%; inset-inline-start: 0; margin-top: 4px; font-size: .72rem; color: var(--muted); white-space: nowrap; }
.vcol span.end { inset-inline-start: auto; inset-inline-end: 0; }
.vlists { gap: 12px; }
.vlists h3 { font-size: .95rem; margin: 0 0 6px; }
.vlist td { padding: 6px 8px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .grid-3 { grid-template-columns: 1fr; } }

/* ---------- phones: each article of a new list is a small card, brand / size / details included ---------- */
@media (max-width: 640px) {
  .req-xls thead { display: none; }
  .req-xls, .req-xls tbody { display: block; }
  .req-xls tr.req-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 32px;
    grid-template-areas: "photo item item item rm" "photo qty size note rm";
    gap: 6px 6px;
    padding: 10px 8px;
    border-bottom: 1px solid var(--line);
  }
  .req-xls tr.req-row > td { display: block; border: 0; padding: 0; min-width: 0 !important; width: auto !important; max-width: none; }
  .req-xls td.rownum { display: none !important; }
  .req-xls td.x-photo { grid-area: photo; align-self: start; }
  .req-xls td.x-photo .ir-photo { display: flex; flex-direction: column; align-items: center; gap: 6px; }
  .req-xls td.x-photo .photo-btn { width: 32px; height: 32px; }
  .req-xls td.x-item-cell { grid-area: item; }
  .req-xls td.x-qty { grid-area: qty; }
  .req-xls td.x-unit { grid-area: unit; }
  .req-xls td.col-brand { grid-area: brand; display: block !important; }
  .req-xls td.col-size { grid-area: size; display: block !important; }
  .req-xls td.col-note { grid-area: note; display: block !important; }
  .req-xls td.center { grid-area: rm; align-self: start; }
  .req-xls td.x-cell input, .req-xls td.x-cell select { width: 100%; min-height: 40px; font-size: 16px; }
  .req-xls td.col-brand input, .req-xls td.col-size input, .req-xls td.col-note input { min-height: 36px; font-size: 16px; background: var(--bg, #f8fafc); }
  .req-xls td.center .icon-btn { width: 32px; height: 40px; }
}

/* ---------- touch targets: header and language buttons at least 44px ---------- */
.landing-bar .link-btn, .landing-bar .btn, .land-foot .link-btn { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; padding-inline: 10px; }
.landing-bar .install-link { gap: 4px; }

/* ---------- Arabic: phone numbers, emails, quantities stay left-to-right ("22 123 456", not "456 123 22") ---------- */
html[dir=rtl] input[type=tel], html[dir=rtl] input[type=email], html[dir=rtl] input[type=url], html[dir=rtl] input[type=number],
html[dir=rtl] input[inputmode=tel], html[dir=rtl] input[inputmode=decimal], html[dir=rtl] input[inputmode=numeric] {
  direction: ltr;
  text-align: right;
}

/* ---------- shops near you (home page and step 2 of a list) ---------- */
.near-title { margin: 0; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.near-row { display: flex; gap: 8px; flex-wrap: wrap; }
.near-row select { flex: 1 1 160px; min-height: 44px; min-width: 0; }
.near-row .btn { min-height: 44px; }
.near-out, .near-line { margin: 0; font-weight: 600; }
.near-out.ok, .near-line.ok { color: var(--green-ink); }
.near-out.warn, .near-line.warn { color: var(--amber, #b45309); }
.near-line { padding: 8px 10px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); font-size: .92rem; }

/* ---------- page not found ---------- */
.not-found { text-align: center; padding: 32px 16px; }
.not-found .nf-code { font-size: 3rem; font-weight: 800; color: var(--primary); margin: 0; }
.not-found .row-gap { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

/* ---------- our own confirm / question dialogs ---------- */
.ask-modal { width: min(440px, calc(100vw - 32px)); border: 0; border-radius: 14px; padding: 0; box-shadow: var(--shadow-lg); background: var(--card); color: var(--ink); }
.ask-modal::backdrop { background: rgb(0 0 0 / 45%); }
.ask-body { padding: 20px; display: grid; gap: 12px; }
.ask-body h2 { margin: 0; font-size: 1.15rem; line-height: 1.35; }
.ask-text { margin: 0; color: var(--muted); }
.ask-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: .92rem; }
.ask-list li { display: flex; gap: 8px; align-items: flex-start; }
.ask-list li .ic { flex: none; color: var(--primary); margin-top: 2px; }
.ask-list li.warn { color: var(--amber); font-weight: 600; }
.ask-list li.warn .ic { color: var(--amber); }
.ask-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.ask-actions .btn { min-height: 44px; }
.btn.danger-solid { background: var(--red); color: #fff; border-color: var(--red); }
.btn.danger-solid:hover { filter: brightness(.92); }

/* ---------- side-by-side comparison of offers ---------- */
.cmp-card { display: grid; gap: 8px; }
.cmp-card h3 { margin: 0; display: flex; align-items: center; gap: 6px; }
.cmp-scroll { overflow-x: auto; margin-inline: -4px; -webkit-overflow-scrolling: touch; }
.cmp-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .88rem; font-variant-numeric: tabular-nums; }
.cmp-table th, .cmp-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; background: var(--card); }
.cmp-table thead th { vertical-align: bottom; white-space: nowrap; }
.cmp-table th[scope=row] { font-weight: 600; min-width: 128px; max-width: 200px; }
/* The article column stays put while scrolling through offers on a phone. */
.cmp-table th:first-child { position: sticky; inset-inline-start: 0; z-index: 1; box-shadow: 1px 0 0 var(--line); }
.cmp-table small { display: block; color: var(--muted); font-weight: 400; font-size: .76rem; }
.cmp-table .num { text-align: end; white-space: nowrap; }
.cmp-table td.na { color: var(--muted); font-style: italic; }
.cmp-table .best { background: var(--green-soft); }
.cmp-table thead .best .cmp-head { color: var(--green-ink); }
.cmp-table .off { opacity: .55; }
.cmp-table td.cheap { color: var(--green-ink); font-weight: 800; }
.cmp-table td.cheap::before { content: '▼ '; font-size: .7em; }
.cmp-table .cmp-sub { color: var(--amber); white-space: normal; max-width: 160px; margin-inline-start: auto; }
.cmp-table td.file-cell { vertical-align: middle; text-align: center; white-space: normal; color: var(--muted); }
.cmp-head { background: none; border: 0; padding: 4px 0; font: inherit; font-weight: 800; color: var(--primary); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; min-height: 32px; }
.cmp-head .ic { width: 15px; height: 15px; }
.cmp-table thead .badge { margin-top: 4px; }
.cmp-table tr.cmp-sub-row th, .cmp-table tr.cmp-sub-row td { font-size: .84rem; }
.cmp-table tr.cmp-total th, .cmp-table tr.cmp-total td { font-size: 1rem; border-top: 2px solid var(--ink); }
.cmp-table tr.cmp-same th, .cmp-table tr.cmp-same td { background: var(--primary-soft); }
.cmp-table tr.cmp-actions td, .cmp-table tr.cmp-actions th { border-bottom: 0; }
.cmp-table .cmp-pickup { font-weight: 600; }
@media (max-width: 640px) {
  .cmp-table { font-size: .82rem; }
  .cmp-table th, .cmp-table td { padding: 7px 7px; }
  .cmp-table th[scope=row] { min-width: 108px; max-width: 132px; white-space: normal; }
  .cmp-card { padding-inline: 12px; }
}

/* ---------- going back on a choice ---------- */
.change-card h2 { display: flex; align-items: center; gap: 6px; font-size: 1.05rem; }
.change-card.urgent { border: 2px solid var(--amber); }

/* ---------- reviews and wins on the shop side ---------- */
.review-box { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius); background: var(--amber-soft); display: grid; gap: 4px; }
.review-box p { margin: 0; }
.review-box .stars { color: #f59f00; letter-spacing: 1px; }
.win-card { border: 2px solid var(--green); background: linear-gradient(180deg, var(--green-soft), var(--card) 70%); display: grid; gap: 8px; }
.win-top { display: flex; align-items: center; gap: 10px; }
.win-ic { font-size: 1.8rem; line-height: 1; }
.win-text { flex: 1; min-width: 0; display: grid; }
.win-text small { color: var(--muted); overflow-wrap: anywhere; }
.win-total { font-size: 1.1rem; color: var(--green-ink); white-space: nowrap; }
.win-card .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.win-card p { margin: 0; }
.explore-hint { display: flex; gap: 6px; align-items: flex-start; margin: 4px 4px 10px; }

/* ---------- photos and files in the chat ---------- */
.chat-form { align-items: center; }
.cw-attach { flex: none; width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--primary); cursor: pointer; }
.cw-attach:hover { background: var(--hover); }
.chat-pending { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 8px 0; }
.cp-file { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 4px 8px; border-radius: 999px; background: var(--primary-soft); font-size: .8rem; }
.cp-file bdi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.cp-file button { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 0 2px; min-width: 24px; min-height: 24px; }
.msg-files { display: grid; gap: 6px; margin-bottom: 4px; }
.msg-files img { display: block; max-width: 220px; max-height: 220px; border-radius: 10px; object-fit: cover; }
.msg-file { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: inherit; text-decoration: underline; overflow-wrap: anywhere; }

/* ---------- profile: delete the account ---------- */
.danger-zone-card { border: 1px solid #f5c2c7; }
.danger-zone-card h2 { color: var(--red); font-size: 1.05rem; }

/* ---------- directories: Sana3ty and Quincailleries ---------- */
.public-nav { display: flex; gap: 6px; max-width: 1100px; margin: 0 auto; padding: 0 16px 8px; overflow-x: auto; }
.public-nav a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); color: var(--ink); font-weight: 700; text-decoration: none; white-space: nowrap; }
.public-nav a .ic { width: 18px; height: 18px; color: var(--primary); }
.public-nav a.active { background: var(--primary-soft); color: var(--primary); box-shadow: none; }
.dir-wrap { max-width: 860px; }
.dir-filters h1 { display: flex; align-items: center; gap: 8px; font-size: 1.35rem; margin: 0; }
.dir-filters h1 .ic { color: var(--primary); }
.dir-filters > p { margin: 4px 0 10px; }
.dir-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.dir-grid label { display: grid; gap: 4px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.dir-grid select { min-height: 44px; }
.dir-only { margin-top: 10px; }
.dir-count { margin: 8px 12px; font-size: .88rem; }
.dir-list { display: grid; gap: 8px; }
.dir-card { display: flex; gap: 12px; align-items: flex-start; color: var(--ink); text-decoration: none; }
.dir-card:hover { background: var(--hover); }
.dc-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.dc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.dc-top b { font-size: 1.02rem; overflow-wrap: anywhere; }
.dc-main .cat-chips { margin: 0; }
.dc-meta { margin: 2px 0 0; font-size: .85rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; }
.dc-meta .ic { width: 14px; height: 14px; }
.dc-meta b { color: var(--ink); }
.dc-reco { margin: 0; font-size: .82rem; font-weight: 700; color: var(--green-ink); }
.official-badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 9px; border-radius: 999px; background: var(--green-soft); color: var(--green-ink); font-size: .75rem; font-weight: 800; white-space: nowrap; }
.official-badge .ic { width: 14px; height: 14px; }
.prof-head { display: grid; justify-items: center; text-align: center; gap: 6px; }
.prof-head h1 { margin: 4px 0 0; font-size: 1.35rem; overflow-wrap: anywhere; }
.prof-head p { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 6px; }
.prof-head .cat-chips { justify-content: center; margin: 0; }
.prof-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; width: 100%; }
.prof-actions .btn { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.prof-bio { white-space: pre-line; margin: 0 0 10px; }
.reco-mine { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; font-size: .9rem; }
.link-btn.danger { color: var(--red); }
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.gallery a, .gallery .g-item, .gallery .g-add { aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--input); position: relative; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery .g-item .round-btn { position: absolute; top: 4px; inset-inline-end: 4px; background: rgb(0 0 0 / 55%); color: #fff; width: 36px; height: 36px; }
.gallery .g-add { display: grid; place-content: center; justify-items: center; gap: 4px; border: 2px dashed var(--line); color: var(--primary); font-weight: 700; cursor: pointer; }
.reco-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.reco-list li { display: flex; gap: 10px; align-items: center; }
.reco-list li > span { display: grid; min-width: 0; }
.reco-list a { color: var(--ink); }
.dir-reviews li.by-shop { background: var(--green-soft); }
.rv-shop { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: var(--green-ink); }
.rv-shop .ic { width: 15px; height: 15px; }
.rv-report { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); padding-inline: 0; min-height: 32px; }
.rv-report .ic { width: 14px; height: 14px; }
.review-form { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.review-form .field-label { margin: 0; font-weight: 700; }
/* 5 stars, right to left in the markup so "this and the ones before" light up with :hover / :checked ~ */
.star-pick { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
[dir='rtl'] .star-pick { flex-direction: row-reverse; }
.star-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-pick label { font-size: 2rem; line-height: 1; color: var(--line); cursor: pointer; min-width: 44px; min-height: 44px; display: grid; place-items: center; }
.star-pick input:checked ~ label, .star-pick label:hover, .star-pick label:hover ~ label { color: #f7b928; }
.star-pick input:focus-visible + label { outline: 2px solid var(--primary); border-radius: 6px; }
.prof-info { display: grid; gap: 8px; }
.prof-info .cat-chips { margin: 0; }
.info-line { display: flex; gap: 8px; align-items: flex-start; margin: 0; }
.info-line > .ic { flex: none; color: var(--primary); margin-top: 2px; }
.links-line { flex-wrap: wrap; gap: 6px 16px; }
.links-line a { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; }
.links-line .ic { width: 16px; height: 16px; }
.dir-fields { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 0; display: grid; gap: 10px; min-width: 0; }
.dir-fields legend { display: flex; align-items: center; gap: 6px; font-weight: 800; padding: 0 6px; }
.dir-fields legend .ic { color: var(--primary); }
.dir-fields .toggle { margin-top: 0; }
.dir-fields .fine { margin-top: -6px; }
.chip-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-checks label { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; font-weight: 600; font-size: .88rem; cursor: pointer; }
.chip-checks label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.chip-checks input { accent-color: var(--primary); }
.grid-2.tight { gap: 8px; margin: 0; grid-template-columns: 1fr 1fr; }
.artisan-signup .callout { margin: 0; }
.admin-report p { margin: 6px 0; }
.rep-list { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 4px; }
.rep-list .ic { width: 13px; height: 13px; color: var(--red); }
@media (max-width: 760px) {
  .dir-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .tabs.n4 .tab, .tabs.n5 .tab { width: 56px; }
  .tabs.n4 .tab .ic, .tabs.n5 .tab .ic { width: 24px; height: 24px; }
  .public-nav { padding: 0 8px 8px; }
  .dir-wrap { padding: 8px 0; }
  .dir-wrap > .card, .dir-wrap > .back, .dir-wrap > .dir-list, .dir-wrap > .dir-count { margin-inline: 8px; }
}
@media (max-width: 400px) {
  .tabs.n4 .tab { width: 50px; }
  .tabs.n5 .tab { width: 44px; }
  .dir-card .avatar.lg { width: 52px; height: 52px; font-size: 1.15rem; }
}
/* A long choice ("Plomberie, Électricité, Carrelage…") is cut with "…" instead of widening the page. */
.form, .field { grid-template-columns: minmax(0, 1fr); }
/* Checkbox and its text on one line inside forms. */
.form label.toggle { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: .92rem; min-height: 44px; }
.form label.toggle input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--primary); }
.prof-head .prof-where { display: block; }
.prof-where .ic { width: 15px; height: 15px; vertical-align: -2px; }
.reco-mine .link-btn { min-height: 44px; }
.dir-grid select { font-size: .92rem; padding-inline: 10px; }
#annuaire, #photos, #verif, #avis { scroll-margin-top: 72px; }
.chip-checks input { margin: 0; }

/* ---------- visitors: same header as the app ---------- */
.visitor-bar .login-top { min-height: 40px; display: inline-flex; align-items: center; }
@media (max-width: 760px) { .visitor-bar .wide-login { display: none; } }
/* Handyman picture (artisans without a photo, Sana3ty title) */
.avatar.handyman { background: none; padding: 0; overflow: hidden; }
.avatar.handyman svg { width: 100%; height: 100%; display: block; }
.avatar.md { width: 44px; height: 44px; }
.dir-filters h1 .avatar.handyman { flex: none; }
.avatar.handyman.tab-hm { width: 28px; height: 28px; }
.tab:not(.active) .avatar.handyman.tab-hm { filter: saturate(.75); }
.side-ic .avatar.handyman.tab-hm { width: 36px; height: 36px; }

/* ---------- language switch in the header ---------- */
.lang-btn { min-width: 40px; height: 36px; padding: 0 8px; border: 0; border-radius: 999px; background: var(--gray-soft); color: var(--ink); font: inherit; font-weight: 800; font-size: .82rem; cursor: pointer; flex: none; }
.lang-btn:hover { background: var(--hover); }
.lang-btn[lang='ar'] { font-size: .9rem; }
/* ---------- feed: "Mes demandes | Fil d'actualité" on top ---------- */
.feed-switch { margin-bottom: 12px; background: var(--card); box-shadow: var(--shadow); }
.feed-switch button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.feed-switch button.active { background: var(--primary-soft); box-shadow: none; }
.feed-wrap .composer { margin-bottom: 8px; }
@media (max-width: 860px) { .main > .feed-switch { margin-inline: 8px; } }
@media (max-width: 640px) {
  .feed-wrap > .feed-switch, .feed-wrap > .post, .feed-wrap > .explore-hint { margin-inline: 8px; }
}
@media (max-width: 400px) {
  .tabs.n4 .tab { width: 46px; }
  .top-actions { gap: 3px; }
  .lang-btn { min-width: 36px; padding: 0 6px; }
}
/* ---------- home on a phone: the example of quotes right under the title, before any scrolling ---------- */
@media (max-width: 860px) {
  .hero.hero-list { gap: 12px; padding-top: 12px; }
  .hero-list .hero-text { display: contents; }
  .hero-list h1 { order: 1; font-size: 1.45rem; margin: 0; }
  .hero-list .hero-demo { order: 2; }
  .hero-list .hero-text > p:not(.hero-note) { order: 3; margin: 0; }
  .hero-list .hero-ctas { order: 4; }
  .hero-list .hero-note { order: 5; }
  .hero-list .signup-box { order: 6; }
  .hero-list .hero-text > .callout { order: 7; }
}
@media (max-width: 400px) {
  .lang-btn { padding: 0 5px; font-size: .74rem; height: 34px; }
  .lang-btn[lang='ar'] { font-size: .8rem; }
  .top-actions .round-btn { width: 34px; height: 34px; }
  .top-actions .avatar-btn .avatar { width: 36px; height: 36px; }
  .topbar { gap: 4px; }
}
/* The example fits a phone without sideways scrolling (Arabic labels are wider). */
@media (max-width: 420px) {
  .hero-list .demo-card { padding: 12px 10px; }
  .demo-table { font-size: .8rem; }
  .demo-table th, .demo-table td { padding: 6px 4px; }
  .demo-table small { font-size: .7rem; }
  .demo-table thead th { white-space: normal; }
}
@media (max-width: 420px) {
  .demo-table small { white-space: normal; }
  [dir='rtl'] .demo-table { font-size: .76rem; }
  [dir='rtl'] .demo-table th[scope=row] { max-width: 76px; }
}
@media (max-width: 420px) {
  /* "Retrait" / "تهزّ السلعة من الحانوت" may wrap instead of widening its column */
  .demo-table td.num:not(:has(b)) { white-space: normal; }
  .demo-table td.num i, .demo-table td.na { white-space: normal; }
}

/* ---------- the header keeps the same order in French and Arabic (only the words change) ---------- */
.topbar { direction: ltr; }
[dir='rtl'] .topbar .menu-panel { direction: rtl; }
/* ---------- visitors: invitation on top of Sana3ty / Quincailleries ---------- */
.dir-invite { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; border: 2px solid var(--primary-soft); }
.dir-invite:hover { background: var(--hover); }
.dir-invite > span:not(.avatar) { flex: 1; min-width: 0; display: grid; gap: 2px; }
.dir-invite b { color: var(--primary); font-size: 1.02rem; }
.dir-invite small { color: var(--muted); font-size: .85rem; }
.dir-invite > .ic { flex: none; color: var(--primary); }
.dir-invite-ic { background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.dir-invite-ic .ic { width: 30px; height: 30px; }
.ic.flip-x { transform: scaleX(-1); }
[dir='rtl'] .ic.flip-x { transform: none; }
@media (max-width: 640px) { .dir-wrap > .dir-invite { margin-inline: 8px; } }

/* ---------- imported shop pages: finding one's shop, claiming, admin ---------- */
.finder h1 { margin-top: 0; }
.finder-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.finder-row label { flex: 1 1 180px; }
.finder-row .btn { min-height: 44px; }
.finder-results { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.finder-results li { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.finder-results li > span { flex: 1; min-width: 0; display: grid; }
.finder-results small { overflow-wrap: anywhere; }
.finder-results .btn { min-height: 40px; flex: none; }
.finder-none { margin: 12px 0; }
.finder-new { margin-top: 8px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.rne-box { display: grid; gap: 8px; padding: 12px; border: 1px dashed var(--line); border-radius: var(--radius); }
.rne-box .field-label { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 800; color: var(--ink); }
.rne-box .fine { margin: 0; }
.unclaimed-box { display: grid; gap: 8px; border: 1px dashed var(--line); }
.unclaimed-box p { margin: 0; }
.unclaimed-box .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.unclaimed-box .btn { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.listing-card { display: grid; gap: 8px; }
.listing-card .callout { margin: 0; }
.listing-card .callout .btn { margin: 4px 4px 0 0; }
.listing-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.listing-actions .btn { min-height: 40px; display: inline-flex; align-items: center; gap: 4px; }
#import-form textarea { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
.change-list { list-style: none; margin: 0; padding: 0; display: grid; }
.change-list li { padding: 10px 4px; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.change-list li.unseen { background: var(--amber-soft); border-radius: 6px; padding-inline: 8px; }
.change-list small { display: block; }
.change-val { overflow-wrap: anywhere; }
.claim-compare { line-height: 1.6; }
.finder-results .avatar, .listing-card .avatar { flex: none; }

/* ---------- directories: search, cards with presentation and photos ---------- */
.dir-search { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; padding: 0 12px; border-radius: 999px; background: var(--input); min-height: 46px; }
.dir-search .ic { color: var(--muted); flex: none; }
.dir-search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 1rem; padding: 10px 0; outline: none; color: var(--ink); }
.dir-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dir-card { display: grid; gap: 8px; }
.dc-head { display: flex; gap: 12px; align-items: flex-start; }
.dc-bio { margin: 0; color: var(--ink); font-size: .92rem; line-height: 1.45; }
.dc-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.dc-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; display: block; }

/* ---------- jobs for artisans ---------- */
.composer { flex-wrap: wrap; }
.post-kinds { flex-basis: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.post-kinds .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: .88rem; padding-inline: 8px; }
.avatar.handyman.chip-hm { width: 22px; height: 22px; display: inline-block; vertical-align: middle; }
.svc-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; }
.feed-switch:has(button:nth-child(3)) button { font-size: .85rem; padding-inline: 4px; }
.svc-answer { display: grid; gap: 8px; }
.svc-answer .oc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.svc-price { font-size: 1.4rem; font-weight: 800; color: var(--ink); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.svc-price small { font-size: .85rem; font-weight: 600; color: var(--muted); }
.svc-answer .svc-price:has(.ic) { font-size: 1rem; color: var(--primary); }
.svc-job { display: grid; gap: 8px; color: var(--ink); text-decoration: none; }
.svc-form h1 { display: flex; align-items: center; gap: 8px; }
.svc-form .gallery .g-add { min-height: 90px; }
.post-kinds .btn { white-space: normal; line-height: 1.2; text-align: center; min-width: 0; }
/* Home on a phone: tighter example rows, so the "Publier ma liste" button shows without scrolling. */
@media (max-width: 860px) {
  .hero-list .demo-card { padding: 10px; }
  .hero-list .demo-card figcaption { margin-bottom: 4px; font-size: .88rem; }
  .hero-list .demo-card figcaption .muted { font-size: .76rem; }
  .hero-list .demo-table th, .hero-list .demo-table td { padding-top: 3px; padding-bottom: 3px; line-height: 1.25; }
  .hero-list .demo-table small { line-height: 1.15; }
  .hero-list .demo-note { margin: 6px 0 0; font-size: .78rem; }
  .hero-list .hero-text > p:not(.hero-note) { font-size: .95rem; line-height: 1.4; }
  .hero-list .hero-ctas { margin: 0; }
}

/* ---------- placing an address on a map ---------- */
.loc-actions { flex-wrap: wrap; }
.map-modal { width: min(640px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); padding: 0; border: 0; border-radius: 14px; }
.map-modal::backdrop { background: rgb(0 0 0 / 45%); }
.map-body { display: grid; gap: 10px; padding: 14px; }
.map-body h2 { margin: 0; font-size: 1.1rem; }
.pick-map { height: min(60dvh, 460px); border-radius: 10px; overflow: hidden; background: var(--input); }
.map-pin span { display: block; width: 30px; height: 30px; border-radius: 50% 50% 50% 0; background: var(--accent); border: 3px solid #fff; transform: rotate(-45deg); box-shadow: 0 2px 6px rgb(0 0 0 / 35%); }
.pick-map .leaflet-container, .pick-map { font: inherit; }
[dir='rtl'] .pick-map { direction: ltr; }

/* ----- directory maps (Leaflet + OpenStreetMap) ----- */
.dir-views { margin: 10px 0 0; }
.dir-map { height: min(68dvh, 560px); border-radius: 12px; overflow: hidden; background: var(--input); box-shadow: var(--shadow); font: inherit; }
.dir-map-note { margin: 8px 12px; }
.mini-map { height: 200px; border-radius: 10px; overflow: hidden; background: var(--input); margin-bottom: 10px; font: inherit; }
[dir='rtl'] .dir-map, [dir='rtl'] .mini-map { direction: ltr; }
.dir-pin span { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--primary); color: #fff; border: 3px solid #fff; box-shadow: 0 2px 8px rgb(0 0 0 / 35%); }
.dir-pin.is-artisan span { border-color: #e4572e; }
.dir-pin span::after { content: ''; position: absolute; left: 50%; top: 100%; border: 7px solid transparent; border-top-color: #fff; transform: translateX(-50%); }
.dir-pin.is-artisan span::after { border-top-color: #e4572e; }
.dir-pin img, .dir-pin .avatar { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.dir-pin b { font-size: 1.1rem; }
.dir-pop { display: flex; gap: 10px; align-items: flex-start; color: inherit; text-decoration: none; }
.dir-pop-main { display: grid; gap: 2px; min-width: 0; }
.dir-pop-main small { color: var(--muted); }
.dir-pop-go { color: var(--primary); font-weight: 700; margin-top: 2px; }
[dir='rtl'] .dir-pop { direction: rtl; text-align: right; }
.leaflet-popup-content { margin: 12px; font: inherit; }
.map-locate { width: 34px; height: 34px; display: grid; place-items: center; background: #fff; border: 2px solid rgb(0 0 0 / 20%); border-radius: 6px; cursor: pointer; color: #333; background-clip: padding-box; }
.map-locate svg { width: 18px; height: 18px; }
.map-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
@media (max-width: 860px) { .dir-wrap > .dir-views { margin-inline: 8px; } }

/* ----- open requests on a map ----- */
.req-views { margin-top: 10px; }
.jobs-head .filter-bar { grid-template-columns: minmax(0, 1fr); }
.rq-pin-wrap { background: none; border: 0; }
.rq-pin { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 3px; min-width: 50px; height: 28px; padding: 0 8px; border-radius: 14px; font-weight: 800; font-size: .9rem; color: #fff; background: #1f8a4c; border: 2px solid #fff; box-shadow: 0 2px 6px rgb(0 0 0 / 35%); white-space: nowrap; }
.rq-pin::after { content: ''; position: absolute; left: 50%; top: 100%; border: 6px solid transparent; border-top-color: #fff; transform: translateX(-50%); }
.rq-pin.some { background: #d9822b; }
.rq-pin.mine { background: #5b6472; }
.rq-pin svg { width: 14px; height: 14px; }
.rq-pop { display: grid; gap: 4px; color: inherit; text-decoration: none; }
.rq-pop small { color: var(--muted); }
.rq-pop .cat-chips { margin: 0; }
[dir='rtl'] .rq-pop { direction: rtl; text-align: right; }
.dir-more { justify-self: center; margin: 6px 0 12px; }
/* groups of pins on the directory map ("42": tap to zoom in) */
.map-cluster { background: none; border: 0; }
.map-cluster span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; font-size: .95rem; border: 3px solid #fff; box-shadow: 0 0 0 4px rgb(15 118 110 / 30%), 0 2px 8px rgb(0 0 0 / 30%); cursor: pointer; }

/* ----- phone check by WhatsApp, shop documents ----- */
.wa-box { display: grid; gap: 8px; padding: 14px; border-radius: 12px; background: var(--input); }
.wa-box.done { background: var(--green-soft); }
.wa-btn { background: var(--green); color: #fff; border-color: var(--green); }
.wa-btn:hover:not(:disabled) { background: var(--green-ink); }
.wa-btn:disabled { opacity: .6; }
.wa-status { margin: 0; font-size: .9rem; font-weight: 600; }
.wa-status.wait { color: var(--muted); font-weight: 500; }
.wa-status.ok { color: var(--green-ink); }
.wa-status.warn { color: var(--red); }
.wa-test { display: grid; gap: 6px; border-top: 1px dashed var(--line); padding-top: 8px; }
.wa-test-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.wa-alt .link-btn, .wa-box .link-btn { justify-self: start; }
.wa-optin span { font-size: .92rem; }
.doc-read { margin: 0; font-size: .88rem; padding: 8px 10px; border-radius: 8px; }
.doc-read.reading { background: var(--input); color: var(--muted); }
.doc-read.reading::before { content: ''; display: inline-block; width: 12px; height: 12px; margin-inline-end: 8px; vertical-align: -2px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.doc-read.failed { background: var(--amber-soft); color: var(--amber); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .doc-read.reading::before { animation: none; } }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.plain-list > li.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.plain-list > li.between:last-child { border-bottom: 0; padding-bottom: 0; }
/* home: one button per kind of account */
.signup-box { display: grid; gap: 8px; margin-top: 14px; }
.signup-types { display: grid; gap: 8px; }
.signup-type { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; color: inherit; text-decoration: none; }
.signup-type:hover { border-color: var(--primary); }
.signup-type > svg { width: 26px; height: 26px; flex: none; color: var(--primary); }
.signup-type > .avatar { width: 30px; height: 30px; flex: none; }
.signup-type span { display: grid; min-width: 0; }
.signup-type small { color: var(--muted); font-size: .82rem; }

/* editing an open list */
.edit-list-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 0 12px; }
.modal.list-editor { width: min(560px, calc(100% - 12px)); }
.list-editor .le-head, .list-editor .le-row { display: grid; grid-template-columns: minmax(0, 1fr) 52px 86px 32px; gap: 6px; align-items: center; }
.list-editor .le-row input, .list-editor .le-row select { padding-inline: 8px; }
.list-editor .le-head { font-size: .78rem; color: var(--muted); font-weight: 600; }
.list-editor .le-rows { display: grid; gap: 6px; max-height: 50dvh; overflow-y: auto; }
.list-editor .le-row input, .list-editor .le-row select { min-width: 0; }
.near-line.closed-city { display: grid; gap: 8px; justify-items: start; }
.dir-soon { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 28px 18px; }
.dir-soon p { max-width: 46ch; margin: 0; }

/* "⋯" menu: report, hide, block */
.mod-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; margin-inline-start: auto;
  border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer;
}
.mod-btn:hover, .mod-btn:focus-visible { background: var(--hover); color: var(--ink); }
.mod-btn .ic { width: 20px; height: 20px; stroke-width: 3; }
.post-head .mod-btn { margin-inline-start: 0; }
.prof-head { position: relative; }
.mod-btn.corner { position: absolute; top: 8px; inset-inline-end: 8px; }
.mod-modal .modal-body { width: min(460px, calc(100vw - 24px)); }
.mod-actions { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.form label.mod-choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; color: var(--ink); font-weight: 400; }
.mod-choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.form label.mod-choice input { width: 20px; height: 20px; flex: none; margin: 2px 0 0; accent-color: var(--primary); }
.mod-choice span { display: grid; gap: 2px; }
.mod-choice b { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.mod-choice small { color: var(--muted); font-size: .82rem; }

/* browser notifications: the invitation on the lists, the profile card */
.push-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; border-inline-start: 4px solid var(--primary); }
.push-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); flex-shrink: 0; }
.push-text { flex: 1 1 220px; min-width: 0; }
.push-text p { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.push-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.push-state { display: grid; gap: 8px; justify-items: start; }
.ok-text { color: var(--green-ink); display: flex; align-items: center; gap: 6px; margin: 0; }

/* shops without their RNE extract */
.rne-banner { display: flex; gap: 12px; align-items: flex-start; }
.rne-banner > .ic { width: 28px; height: 28px; flex-shrink: 0; }
.rne-banner p { margin: 4px 0 10px; }
.rne-modal .modal-body { width: min(480px, calc(100vw - 24px)); }

/* admin: invitations, people reported */
.filters-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.filters-row input[type=search] { flex: 1 1 220px; min-width: 0; }
.invite-list, #pp-list { display: grid; gap: 8px; }
.invite-row { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 12px 16px; margin: 0; }
.inv-main { display: grid; gap: 3px; min-width: 0; flex: 1 1 260px; }
.inv-main small { overflow-wrap: anywhere; }
.inv-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.num-mobile { font-weight: 600; }
.people-event { padding: 12px 16px; margin: 0; }
.people-event p { margin: 6px 0 0; overflow-wrap: anywhere; }

/* The admin has 7 tabs: on a phone they scroll sideways inside the bar instead of widening the page. */
@media (max-width: 760px) {
  .topbar:has(.tabs.n7) { grid-template-columns: auto minmax(0, 1fr) auto; }
  .tabs.n7 { justify-content: flex-start; overflow-x: auto; min-width: 0; scrollbar-width: none; }
  .tabs.n7::-webkit-scrollbar { display: none; }
  .tabs.n7 .tab { width: 48px; flex: none; }
  .tabs.n7 .tab .ic { width: 22px; height: 22px; }
}

/* =====================================================================================================
   Design 2026 (the user's mockups): deep green #0F6B5D, orange #E76F28 for the action that commits
   (publish, send a quote, choose an offer), mint #E5F3F0 surfaces, light #F4F6F7 page, white cards with a
   hairline border, 12px corners, 44-48px controls, a tab bar at the bottom of the screen on phones.
   Added last so it wins over the older rules above without touching how anything works.
   ===================================================================================================== */
:root {
  --bg: #f4f6f7;
  --card: #ffffff;
  --ink: #17262b;
  --muted: #647488;
  --line: #e2e8ec;
  --hover: #f1f5f6;
  --input: #ffffff;
  --primary: #0f6b5d;
  --primary-hover: #0b5a4e;
  --primary-soft: #e5f3f0;
  --accent: #e76f28;
  --accent-hover: #d2601d;
  --green: #1f9d55;
  --green-ink: #137a40;
  --green-soft: #e3f5ea;
  --gray-soft: #eef2f4;
  --shadow: 0 1px 2px rgb(16 40 48 / 6%);
  --shadow-lg: 0 4px 12px rgb(16 40 48 / 8%), 0 12px 32px rgb(16 40 48 / 10%);
  --radius: 12px;
  --field: #d9e1e6;
}
:root[data-theme='dark'] {
  --bg: #111718;
  --card: #1a2224;
  --ink: #e6eef0;
  --muted: #9aaab3;
  --line: #2c383b;
  --hover: #233033;
  --input: #1f292b;
  --primary: #3fb8a3;
  --primary-hover: #63c9b7;
  --primary-soft: #16332e;
  --on-primary: #04211c;
  --accent: #f08a4b;
  --accent-hover: #f6a370;
  --gray-soft: #263235;
  --field: #34434a;
}
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); }
:root[lang^='ar'] body { font-family: system-ui, -apple-system, "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif; }
h1 { letter-spacing: -.01em; }
h1, h2, h3 { font-weight: 700; }

/* buttons: green = go on, orange (.success) = the committing action, mint = secondary, white = neutral */
.btn { border-radius: 10px; min-height: 44px; padding: 10px 18px; font-weight: 600; background: var(--card); box-shadow: inset 0 0 0 1px var(--field); }
.btn:hover { filter: none; background: var(--hover); }
.btn.primary, .btn.success, .btn.ghost { box-shadow: none; }
.btn.secondary { box-shadow: none; background: var(--primary-soft); color: var(--primary); }
.btn.secondary:hover { background: #d5ece7; }
:root[data-theme='dark'] .btn.secondary:hover { background: #1d413a; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.success:hover { background: var(--accent-hover); }
.btn.ghost:hover { background: var(--hover); }
.btn.big { min-height: 52px; border-radius: 12px; font-size: 1.05rem; }
.small-btn { min-height: 34px; padding: 6px 12px; border-radius: 8px; }
.round-btn { background: var(--gray-soft); }

/* fields: white with a visible border, green ring on focus */
input, select, textarea { background: var(--input); border: 1px solid var(--field); border-radius: 10px; }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), select { min-height: 44px; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); background: var(--input); }
.form label { color: var(--ink); font-size: .9rem; }

/* cards and badges */
.card { border-radius: 14px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.badge { border-radius: 999px; padding: 3px 10px; font-weight: 600; }
.callout { border-radius: 12px; }

/* top bar: white, a hairline under it, the name next to the logo; tabs show their word under the icon */
.topbar { box-shadow: none; border-bottom: 1px solid var(--line); height: 60px; }
.brand-name { color: var(--primary); font-weight: 800; }
.tabs { height: 60px; }
.tab { gap: 2px; align-content: center; text-decoration: none; }
.tab .ic { width: 22px; height: 22px; }
.tab-lbl { font-size: .72rem; font-weight: 600; line-height: 1.1; white-space: nowrap; }
.tabs.n7 .tab-lbl { display: none; }

/* phones: the main tabs move to a bar at the bottom of the screen (thumb reach), the top keeps logo and name */
@media (max-width: 760px) {
  .topbar:has(.tabs:not(.n7)) { grid-template-columns: auto 1fr; }
  .topbar .brand-name { display: inline; font-size: 1.15rem; }
  .tabs:not(.n7) {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 30; height: auto; justify-content: space-around;
    background: var(--card); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .tabs:not(.n7) .tab { flex: 1 1 0; width: auto !important; min-width: 0; height: 54px; margin: 0; border-radius: 10px; }
  .tabs:not(.n7) .tab:hover { background: transparent; }
  .tabs:not(.n7) .tab.active::after { display: none; }
  .tabs:not(.n7) .tab-lbl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: .7rem; }
  .topbar:has(.tabs:not(.n7)) ~ .layout { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .landing:has(.topbar .tabs:not(.n7)) { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) {
  .topbar .brand-name { display: none; }
}

/* client home: greeting and two big choices */
.hello { margin: 0 0 16px; }
.hello h1 { margin: 4px 0 2px; font-size: 1.55rem; }
.hello-sub { color: var(--muted); font-weight: 600; margin: 0 0 14px; }
.hello-actions { display: grid; gap: 10px; }
.action-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: start; font: inherit; color: var(--ink); cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: var(--shadow);
}
.action-card:hover { border-color: var(--primary); }
.action-card .ac-ic { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.action-card .ac-ic .ic { width: 26px; height: 26px; }
.action-card .ac-ic .avatar { width: 40px; height: 40px; }
.action-card .ac-txt { display: grid; gap: 2px; flex: 1; min-width: 0; }
.action-card b { font-size: 1.08rem; }
.action-card small { color: var(--muted); font-size: .86rem; line-height: 1.35; }
.action-card .ac-go { color: var(--muted); }
.action-card.main { background: var(--accent); border-color: var(--accent); color: #fff; }
.action-card.main:hover { background: var(--accent-hover); }
.action-card.main .ac-ic { background: rgb(255 255 255 / 20%); color: #fff; }
.action-card.main small, .action-card.main .ac-go { color: rgb(255 255 255 / 90%); }
.hello-photo {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 10px; min-height: 44px;
  background: transparent; border: 1.5px dashed var(--field); border-radius: 12px; color: var(--primary); font: inherit; font-weight: 600; cursor: pointer;
}
.hello-photo:hover { background: var(--primary-soft); }
@media (min-width: 761px) { .hello-actions { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) { .main > .hello { margin-inline: 12px; } }

/* new request: three ways in (tabs), then the list as a table with a green title row */
.list-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.list-modes button {
  display: grid; justify-items: center; gap: 4px; padding: 10px 4px; min-height: 64px; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink); font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; text-align: center; line-height: 1.2;
}
.list-modes button .ic { width: 22px; height: 22px; color: var(--primary); }
.list-modes button.active { background: var(--primary-soft); color: var(--primary); }
.list-modes button:not(.active):hover { background: var(--hover); }

#new-request .xls-wrap { border: 1px solid var(--line); background: var(--card); overflow: visible; margin-inline: 0 !important; border-radius: 14px; box-shadow: var(--shadow); }
#new-request .req-xls { display: block; border: 0; background: transparent; font-size: .95rem; width: 100%; }
#new-request .req-xls thead, #new-request .req-xls tbody#items { display: block !important; border: 0; }
#new-request .req-xls tr {
  display: grid; align-items: center; gap: 5px; padding: 6px 8px;
  grid-template-columns: 18px minmax(0, 1.75fr) minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) 26px;
}
#new-request .req-xls thead tr { background: var(--primary); color: #fff; border-radius: 13px 13px 0 0; min-height: 48px; }
#new-request .req-xls thead th { background: none; color: #fff; border: 0; padding: 0; font-size: .78rem; font-weight: 700; line-height: 1.15; text-align: start; position: static; }
#new-request .req-xls tr.req-row { border-bottom: 1px solid var(--line); background: none; box-shadow: none; border-radius: 0; }
#new-request .req-xls tr.req-row:last-child { border-bottom: 0; }
#new-request .req-xls tr > * { display: block !important; border: 0; padding: 0; min-width: 0 !important; width: auto !important; max-width: none; background: none; grid-row: 1; }
#new-request .req-xls .rownum { grid-column: 1; text-align: center; font-size: .85rem; color: var(--muted); }
#new-request .req-xls thead .rownum { color: #fff; }
#new-request .req-xls .x-item-cell { grid-column: 2; }
#new-request .req-xls .x-qty { grid-column: 3; }
#new-request .req-xls .col-size { grid-column: 4; }
#new-request .req-xls .col-note { grid-column: 5; }
#new-request .req-xls .center { grid-column: 6; }
#new-request .req-xls thead .x-photo { display: none !important; }
/* the photo button sits inside the end of the article box; once there is a photo, its thumbnail takes the spot */
#new-request .req-xls td.x-photo { grid-column: 2; justify-self: end; z-index: 2; margin-inline-end: 5px; }
#new-request .req-xls td.x-photo .ir-photo { display: block; position: relative; width: 28px; height: 28px; }
#new-request .req-xls td.x-photo .ir-thumb { display: none; }
#new-request .req-xls tr.has-photo td.x-photo .ir-thumb { display: block; position: absolute; inset: 0; }
#new-request .req-xls tr.has-photo td.x-photo .ir-thumb .thumb { width: 28px; height: 28px; border-radius: 6px; }
#new-request .req-xls td.x-photo .photo-btn { position: relative; width: 28px; height: 28px; border-radius: 8px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
#new-request .req-xls td.x-photo .photo-btn .ic { width: 17px; height: 17px; }
#new-request .req-xls tr.has-photo td.x-photo .photo-btn { opacity: 0; }
#new-request .req-xls td.x-item-cell input { padding-inline-end: 34px !important; }
#new-request .req-xls td.x-cell input, #new-request .req-xls td.x-cell select {
  width: 100%; min-height: 42px; font-size: 15px; background: var(--input); border: 1px solid var(--field); border-radius: 10px; padding: 7px 8px;
}
#new-request .req-xls td.x-cell input:focus, #new-request .req-xls td.x-cell select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); outline: none; }
/* quantity and unit in one box, a thin line between them */
.qty-box { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); border: 1px solid var(--field); border-radius: 10px; background: var(--input); }
.qty-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
#new-request .req-xls .qty-box input, #new-request .req-xls .qty-box select { border: 0 !important; box-shadow: none !important; background: transparent; border-radius: 0; min-height: 40px; }
#new-request .req-xls .qty-box input { text-align: center; padding-inline: 2px; }
#new-request .req-xls .qty-box select { border-inline-start: 1px solid var(--field) !important; padding: 6px 2px 6px 6px; font-size: 14px; }
#new-request .req-xls td.center .icon-btn { width: 26px; height: 42px; border-radius: 8px; color: var(--muted); padding: 0; display: grid; place-items: center; }
#new-request .req-xls td.center .icon-btn .ic { width: 19px; height: 19px; }
#new-request .req-xls td.center .icon-btn:hover { color: var(--red); background: transparent; }
#new-request #add-row { width: 100%; min-height: 48px; }
.list-total { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .95rem; }
.list-total .link-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.list-total .link-btn .ic { width: 18px; height: 18px; }
.gen-notes { display: grid; gap: 8px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.gen-notes > span { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); }
.gen-notes .ic { width: 18px; height: 18px; color: var(--muted); }
.tip-box { display: grid; gap: 10px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.tip-box p { display: flex; align-items: center; gap: 8px; margin: 0; }
.tip-box p .ic { color: var(--primary); }
.tip-box b { color: var(--primary); }
.tip-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tip-btns .btn { white-space: normal; font-size: .84rem; text-align: start; justify-content: flex-start; padding: 8px 10px; line-height: 1.25; }
.tip-btns .btn .ic { color: var(--primary); }
@media (min-width: 641px) {
  #new-request .req-xls tr { grid-template-columns: 24px minmax(0, 2.2fr) minmax(150px, 1.4fr) minmax(0, 1.1fr) minmax(0, 1.4fr) 32px; gap: 8px; padding: 8px 12px; }
  #new-request .req-xls thead th { font-size: .85rem; }
}
.composer-head { border-bottom: 0; }
.step-bar span { height: 5px; border-radius: 3px; }
.composer-body { background: var(--bg); }
.composer-foot #publish { border-radius: 12px; }
/* phones: every pixel counts in the five columns */
@media (max-width: 640px) {
  .composer-modal .composer-body { padding-inline: 8px; }
  #new-request .req-xls tr { grid-template-columns: 14px minmax(0, 1.55fr) minmax(0, 1.6fr) minmax(0, .9fr) minmax(0, .8fr) 22px; gap: 4px; padding: 6px; }
  #new-request .req-xls thead th { font-size: .72rem; }
  #new-request .req-xls td.x-cell input, #new-request .req-xls td.x-cell select { padding: 6px 5px; font-size: 14px; }
  #new-request .req-xls td.x-item-cell input { padding-inline-end: 24px !important; }
  #new-request .req-xls td.x-photo { margin-inline-end: 2px; }
  #new-request .req-xls td.x-photo .ir-photo, #new-request .req-xls td.x-photo .photo-btn,
  #new-request .req-xls tr.has-photo td.x-photo .ir-thumb .thumb { width: 22px; height: 22px; }
  #new-request .req-xls td.x-photo .photo-btn .ic { width: 15px; height: 15px; }
  #new-request .req-xls td.center .icon-btn { width: 22px; }
  #new-request .req-xls td.center .icon-btn .ic { width: 17px; height: 17px; }
}
/* the unit: no wide native arrow, a small one drawn instead */
#new-request .req-xls .qty-box select {
  appearance: none; -webkit-appearance: none; text-overflow: ellipsis;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0h10L5 6z' fill='%230f6b5d'/%3E%3C/svg%3E") no-repeat right 5px center;
  padding-inline: 5px 16px !important;
}
[dir='rtl'] #new-request .req-xls .qty-box select { background-position: left 5px center; padding-inline: 5px 16px !important; }
#new-request .req-xls .qty-box { grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); }
#new-request .req-xls td.x-cell .qty-box select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0h10L5 6z' fill='%230f6b5d'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 5px center;
}
[dir='rtl'] #new-request .req-xls td.x-cell .qty-box select { background-position: left 5px center; }
#new-request .req-xls td.x-photo { align-self: center; }
/* offers: the best one stands out (green frame, filled badge); totals large */
.offer-card { border-radius: 16px; }
.offer-card.best { border: 2px solid var(--primary); background: linear-gradient(var(--primary-soft), var(--card) 120px); }
.offer-card.best .badge.green { background: var(--primary); color: #fff; }
.oc-total { font-size: 1.5rem; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
/* the article box keeps room for the photo button on the side where it sits, whatever the language typed in it */
#new-request .req-xls td.x-item-cell input { padding-inline-end: 8px !important; padding-right: 30px !important; }
[dir='rtl'] #new-request .req-xls td.x-item-cell input { padding-right: 8px !important; padding-left: 30px !important; }
@media (max-width: 640px) {
  #new-request .req-xls td.x-item-cell input { padding-left: 5px !important; padding-right: 25px !important; }
  [dir='rtl'] #new-request .req-xls td.x-item-cell input { padding-right: 5px !important; padding-left: 25px !important; }
}
/* quantity and unit read as one box: no inner frame around the unit */
#new-request .req-xls td.x-cell .qty-box select { border-radius: 0 !important; border-top: 0 !important; border-bottom: 0 !important; border-inline-end: 0 !important; }
#new-request .req-xls td.x-cell .qty-box input { border-radius: 10px 0 0 10px !important; }
@media (max-width: 640px) {
  #new-request .req-xls tr.req-row { padding-block: 5px; }
  #new-request .req-xls td.x-cell input, #new-request .req-xls td.x-cell select { min-height: 40px; }
  #new-request .req-xls .qty-box input, #new-request .req-xls .qty-box select { min-height: 38px; }
}
#new-request .req-xls .qty-box { overflow: hidden; }

/* sign-up in three steps (all accounts), "Continuer" at the bottom */
.signup-steps .signup-progress { display: grid; gap: 8px; margin-bottom: 4px; }
.signup-steps .step-label { margin: 0; font-size: .92rem; color: var(--muted); font-weight: 600; }
.signup-steps .step-bar { margin-top: 0; }
.signup-steps .step-bar span { height: 6px; border-radius: 3px; }
.step-actions { display: flex; gap: 10px; margin-top: 6px; }
.step-actions [data-next] { flex: 1; justify-content: center; }
.step-actions [data-next] .ic { width: 20px; height: 20px; }
.claim-card { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border: 1.5px solid var(--primary); border-radius: 14px; background: var(--card); }
.claim-card img, .claim-card .claim-ph { width: 76px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--primary-soft); display: grid; place-items: center; color: var(--primary); }
.claim-card > div { display: grid; gap: 4px; min-width: 0; }
.claim-card b { font-size: 1.02rem; overflow-wrap: anywhere; }
.claim-card span { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: .9rem; }
.claim-card .ic { width: 16px; height: 16px; }
.claim-card .claim-ph .ic { width: 30px; height: 30px; }
.claim-card .claim-ok { width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; align-self: start; }
.claim-card .claim-ok .ic { width: 16px; height: 16px; stroke-width: 3; }

/* "check your email" and "email confirmed" */
.check-email { display: grid; gap: 14px; justify-items: center; text-align: center; max-width: 520px; margin-inline: auto; padding: 28px 20px; }
.check-email h1 { margin: 0; font-size: 1.6rem; }
.check-email p { margin: 0; }
.check-email b[dir=ltr] { overflow-wrap: anywhere; }
.check-email .btn.block, .check-email form, .check-email .callout { width: 100%; }
.check-email .callout { text-align: start; }
.check-art { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.check-art .ic { width: 44px; height: 44px; }
.check-art.ok { background: var(--primary); color: #fff; }
.check-art.ok .ic { stroke-width: 3; }
.check-art.warn { background: #fdecdf; color: var(--accent); }
.check-steps { list-style: none; counter-reset: s; margin: 0; padding: 14px; width: 100%; display: grid; gap: 12px; background: var(--primary-soft); border-radius: 14px; text-align: start; }
.check-steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: center; }
.check-steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.email-banner { display: flex; gap: 12px; align-items: flex-start; }
.email-banner > .ic { color: var(--primary); width: 24px; height: 24px; flex: none; }
.email-banner p { margin: 4px 0 8px; }
.rne-banner:not(.warn-callout) { display: flex; gap: 12px; align-items: flex-start; }
.rne-banner:not(.warn-callout) > .ic { color: var(--primary); width: 24px; height: 24px; flex: none; }
.rne-banner:not(.warn-callout) p { margin: 4px 0 0; }

/* New request: a missing quantity is outlined in red; its message is a toast (the cell is too narrow). */
.req-xls .x-qty .field-error { display: none; }
.req-xls .qty-box:has(.is-invalid) { border-color: var(--red); box-shadow: 0 0 0 2px color-mix(in srgb, var(--red) 25%, transparent); }
.req-xls .qty-msg td { padding: 0 8px 6px; border: 0; }
.req-xls .qty-msg .field-error { display: block; margin: 0; }
#new-request .req-xls tr.qty-msg { padding: 0 8px 8px; border-bottom: 1px solid var(--line); }
#new-request .req-xls tr.qty-msg > td { grid-column: 2 / -1; }
#new-request .req-xls tr.req-row:has(+ .qty-msg) { border-bottom: 0; padding-bottom: 2px; }

/* ---------- installing the app: header button, tip, sign-up hint, step-by-step guide ---------- */
.install-wrap { position: relative; }
.install-top { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 999px; background: var(--accent); color: var(--on-accent); border: 0; font-weight: 700; font-size: .88rem; }
.install-top:hover { background: var(--accent-hover); }
.install-top .ic { width: 18px; height: 18px; }
.install-arrow { display: inline-flex; animation: install-bob 1.6s ease-in-out infinite; }
@keyframes install-bob { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(3px); } }
.install-tip { position: absolute; top: calc(100% + 10px); inset-inline-end: 0; width: 210px; z-index: 30; display: flex; gap: 6px; align-items: flex-start;
  background: var(--ink); color: #fff; padding: 10px 12px; border-radius: 10px; font-size: .84rem; line-height: 1.35; box-shadow: var(--shadow-lg); }
.install-tip::before { content: ''; position: absolute; top: -6px; inset-inline-end: 22px; width: 12px; height: 12px; background: var(--ink); transform: rotate(45deg); }
.install-tip .link-btn { color: #fff; padding: 0 2px; }
@media (max-width: 560px) { .install-top-label { display: none; } .install-top { width: 38px; padding: 0; justify-content: center; } }
@media (prefers-reduced-motion: reduce) { .install-arrow, .ig-pulse { animation: none !important; } }

.install-hint { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 10px; background: var(--primary-soft); }
.install-hint > .ic { width: 22px; height: 22px; flex: none; color: var(--primary); margin-top: 2px; }
.install-hint p { margin: 2px 0 8px; font-size: .88rem; color: var(--muted); }

.install-guide { width: min(460px, calc(100% - 24px)); max-height: calc(100dvh - 24px); }
.install-guide .ig-body { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); padding: 0; gap: 0; }
.install-guide .modal-head { padding: 16px; border-bottom: 1px solid var(--line); }
.install-guide .ig-scroll { overflow-y: auto; padding: 16px; display: grid; gap: 12px; overscroll-behavior: contain; }
.ig-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.ig-steps li { display: grid; grid-template-columns: 30px 1fr; gap: 6px 10px; align-items: start; }
.ig-steps li p { margin: 4px 0 0; font-weight: 600; }
.ig-num { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 800; }
.ig-steps svg { grid-column: 2; width: min(200px, 100%); height: auto; justify-self: center; }
.ig-steps .ig-desk { width: min(320px, 100%); }
.ig-pulse { transform-box: fill-box; transform-origin: center; animation: ig-pulse 1.4s ease-out infinite; }
@keyframes ig-pulse { 0% { opacity: 1; transform: scale(.85); } 100% { opacity: 0; transform: scale(1.5); } }
.ig-other summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.ig-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.center { text-align: center; }

/* shops' RNE */
.doc-or { margin: -4px 0; text-align: center; font-size: .82rem; color: var(--muted); }
.doc-read.ok { background: var(--green-soft); color: var(--green-ink); }

/* one governorate open */
.launch-pill { width: fit-content; justify-self: start; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin: 0 0 10px; padding: 5px 12px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: .88rem; }
.launch-pill .ic { width: 16px; height: 16px; }
.install-guide .modal-head h2 { font-size: 1.15rem; margin: 0; }
.check-email .install-hint { text-align: start; }
