/* Al Massah Mall — affiliate area (dashboard + join form). Green / cyan "tech" theme.
   Light is the default; html[data-theme="dark"] switches to the dark look (toggle in the top bar). */
:root {
  --bg: #eefcf9; --panel: rgba(255, 255, 255, .86); --panel2: #f6fffd; --side: rgba(255, 255, 255, .92); --input: #ffffff;
  --line: rgba(13, 148, 136, .18); --ink: #0f2e2c; --ink2: #24423f; --muted: #5b7c79; --g: #0d9488; --c: #0891b2; --lime: #65a30d;
  --warn: #d97706; --bad: #e11d48; --ok: #059669; --grad: linear-gradient(135deg, #10b981, #06b6d4);
  --num1: #0d9488; --num2: #0891b2; --code: #0e7490; --lime-ink: #4d7c0f; --warn-ink: #92400e; --tip-bg: #ffffff;
  --bad-ink: #be123c; --ok-ink: #047857; --c-pend: #b45309; --c-conf: #047857; --c-paid: #0e7490; --c-void: #be123c;
  --shadow: 0 14px 40px rgba(13, 148, 136, .12); --grid-op: .55;
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #031417; --panel: rgba(9, 38, 46, .72); --panel2: rgba(12, 52, 62, .6); --side: rgba(2, 16, 20, .82); --input: rgba(2, 20, 24, .7);
  --line: rgba(45, 212, 191, .16); --ink: #e6fffb; --ink2: #cdeeea; --muted: #8fb8b5; --g: #2dd4bf; --c: #22d3ee; --lime: #a3e635;
  --warn: #fbbf24; --bad: #fb7185; --ok: #34d399;
  --num1: #5eead4; --num2: #67e8f9; --code: #a5f3fc; --lime-ink: #d9f99d; --warn-ink: #fde68a; --tip-bg: #053b3f;
  --bad-ink: #fecdd3; --ok-ink: #bbf7d0; --c-pend: #fde68a; --c-conf: #a7f3d0; --c-paid: #a5f3fc; --c-void: #fecdd3;
  --shadow: 0 30px 80px rgba(0, 0, 0, .45); --grid-op: .35;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Tajawal, system-ui, sans-serif; color: var(--ink); min-height: 100vh;
  background: radial-gradient(1200px 600px at 85% -10%, rgba(6,182,212,.18), transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(16,185,129,.16), transparent 60%), var(--bg); }
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; opacity: var(--grid-op);
  background-image: linear-gradient(rgba(45,212,191,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(45,212,191,.06) 1px, transparent 1px); background-size: 34px 34px; }
a { color: var(--c); }
button, input, select, textarea { font: inherit; }
.hidden { display: none !important; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- buttons / inputs ---------- */
.btn { border: 0; border-radius: 12px; padding: 10px 16px; font-weight: 800; cursor: pointer; color: #022; background: var(--grad); display: inline-flex; align-items: center; gap: 8px; justify-content: center; text-decoration: none; transition: filter .15s, transform .1s; }
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: wait; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.sm { padding: 6px 11px; font-size: .82rem; border-radius: 10px; }
.btn.danger { background: linear-gradient(135deg, #f43f5e, #fb7185); color: #fff; }
.fld { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.fld label { font-size: .82rem; font-weight: 700; color: var(--muted); }
.inp { width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--input); color: var(--ink); outline: 0; }
.inp:focus { border-color: var(--c); box-shadow: 0 0 0 3px rgba(34,211,238,.15); }
textarea.inp { min-height: 90px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.msg { padding: 10px 12px; border-radius: 12px; font-size: .88rem; margin: 8px 0; }
.msg.bad { background: rgba(251,113,133,.12); color: var(--bad-ink); border: 1px solid rgba(251,113,133,.3); }
.msg.ok { background: rgba(52,211,153,.12); color: var(--ok-ink); border: 1px solid rgba(52,211,153,.3); }

/* ---------- login ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; position: relative; }
.auth-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 26px; backdrop-filter: blur(14px); box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; }
.brand .logo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--grad); color: #022; font-size: 1.1rem; box-shadow: 0 0 24px rgba(45,212,191,.45); }
.brand small { display: block; font-size: .72rem; color: var(--muted); font-weight: 700; }
.auth-card h1 { font-size: 1.3rem; margin: 18px 0 4px; }
.auth-card p.sub { color: var(--muted); margin: 0 0 18px; font-size: .9rem; }
.auth-foot { margin-top: 14px; text-align: center; font-size: .85rem; color: var(--muted); }
.lang-btn { position: absolute; top: 16px; inset-inline-end: 16px; }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; position: relative; }
.side { position: sticky; top: 0; height: 100vh; padding: 18px 14px; border-inline-end: 1px solid var(--line); background: var(--side); backdrop-filter: blur(10px); display: flex; flex-direction: column; gap: 6px; }
.side .brand { margin-bottom: 14px; padding: 0 6px; }
.nav-btn { display: flex; align-items: center; gap: 10px; width: 100%; text-align: start; border: 0; background: transparent; color: var(--muted); padding: 10px 12px; border-radius: 12px; cursor: pointer; font-weight: 700; }
.nav-btn i { width: 18px; text-align: center; }
.nav-btn:hover { color: var(--ink); background: rgba(45,212,191,.08); }
.nav-btn.on { color: #022; background: var(--grad); box-shadow: 0 6px 20px rgba(16,185,129,.3); }
.side .spacer { flex: 1; }
.main { padding: 22px 26px 90px; min-width: 0; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.top h2 { margin: 0; font-size: 1.35rem; }
.top .hello { color: var(--muted); font-size: .9rem; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .76rem; font-weight: 800; border: 1px solid var(--line); color: var(--ink); background: rgba(45,212,191,.08); }
.chip.pending { color: var(--c-pend); border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.1); }
.chip.confirmed { color: var(--c-conf); border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.1); }
.chip.paid { color: var(--c-paid); border-color: rgba(34,211,238,.35); background: rgba(34,211,238,.1); }
.chip.void, .chip.reversed { color: var(--c-void); border-color: rgba(251,113,133,.35); background: rgba(251,113,133,.08); }
.bottom-nav { display: none; }

/* ---------- cards ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; backdrop-filter: blur(10px); margin-bottom: 16px; position: relative; overflow: hidden; }
.card h3 { margin: 0 0 12px; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.card h3 i { color: var(--g); }
.card .hint { color: var(--muted); font-size: .84rem; margin: -6px 0 12px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; position: relative; overflow: hidden; }
.kpi::after { content: ''; position: absolute; inset-inline-end: -30px; top: -30px; width: 100px; height: 100px; border-radius: 50%; background: radial-gradient(circle, rgba(34,211,238,.25), transparent 70%); }
.kpi > span { display: block; font-size: .74rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kpi b { display: block; font-size: 1.5rem; margin: 4px 0 2px; background: linear-gradient(90deg, var(--num1), var(--num2)); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi b small { font-size: .75rem; -webkit-text-fill-color: var(--muted); }
.kpi em { font-style: normal; font-size: .78rem; color: var(--muted); }
.kpi .trend { font-weight: 800; }
.kpi .trend.up { color: var(--ok); } .kpi .trend.down { color: var(--bad); }
.row2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

/* ---------- charts / meters ---------- */
.chart-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.chart-tabs button { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px; padding: 4px 11px; font-size: .78rem; font-weight: 800; cursor: pointer; }
.chart-tabs button.on { background: rgba(45,212,191,.15); color: var(--ink); border-color: rgba(45,212,191,.5); }
.chart { width: 100%; height: 230px; display: block; }
.chart .grid line { stroke: rgba(143,184,181,.14); }
.chart text { fill: var(--muted); font-size: 10px; font-family: Tajawal, sans-serif; }
.chart .tip { pointer-events: none; }
.gauge-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.gauge { width: 190px; height: 120px; }
.gauge text.v { fill: var(--ink); font-size: 22px; font-weight: 800; }
.gauge text.l { fill: var(--muted); font-size: 10px; }
.meter { margin: 10px 0; }
.meter-head { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); margin-bottom: 6px; }
.meter-head b { color: var(--ink); }
.meter-bar { height: 10px; border-radius: 999px; background: rgba(143,184,181,.14); overflow: hidden; }
.meter-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #10b981, #22d3ee, #a3e635); box-shadow: 0 0 14px rgba(34,211,238,.6); transition: width .8s; }

/* ---------- tables / lists ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .86rem; }
.tbl th { text-align: start; font-size: .72rem; color: var(--muted); font-weight: 800; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 8px; border-bottom: 1px solid rgba(45,212,191,.08); vertical-align: middle; }
.tbl tr:hover td { background: rgba(45,212,191,.04); }
.tbl .nw { white-space: nowrap; }
.tbl .r { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters .inp { width: auto; padding: 7px 10px; }

/* ---------- link box ---------- */
.linkbox { display: flex; gap: 8px; align-items: center; background: var(--input); border: 1px dashed rgba(45,212,191,.45); border-radius: 14px; padding: 8px 8px 8px 12px; }
.linkbox code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--code); font-family: Consolas, monospace; font-size: .86rem; direction: ltr; }
.coupon-big { font-size: 1.8rem; font-weight: 800; letter-spacing: .08em; text-align: center; padding: 14px; border-radius: 16px; border: 2px dashed rgba(101,163,13,.45); color: var(--lime-ink); background: rgba(163,230,53,.06); direction: ltr; }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.qr { background: #fff; border-radius: 12px; padding: 8px; width: 156px; height: 156px; }

/* ---------- products ---------- */
.p-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.p-card { background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.p-card .im { aspect-ratio: 1; background: #fff; display: grid; place-items: center; }
.p-card .im img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.p-card .bd { padding: 9px 10px 10px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.p-card .nm { font-size: .84rem; font-weight: 700; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.p-card .pr { font-weight: 800; color: var(--num1); }
.p-card .pr s { color: var(--muted); font-weight: 600; font-size: .78rem; margin-inline-start: 6px; }
.p-card .earn { font-size: .74rem; color: var(--lime-ink); }
.p-card .acts { display: flex; gap: 6px; margin-top: auto; }
.p-card .acts .btn { flex: 1; padding: 6px 4px; font-size: .76rem; }
.p-card.in { outline: 2px solid var(--lime); }
.p-card .note { font-size: .76rem; color: var(--warn-ink); background: rgba(251,191,36,.1); border-radius: 8px; padding: 5px 7px; }
.store-list { display: flex; flex-direction: column; gap: 6px; }
.store-item { display: flex; align-items: center; gap: 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 6px 8px; }
.store-item img { width: 44px; height: 44px; object-fit: contain; background: #fff; border-radius: 8px; }
.store-item .t { flex: 1; font-size: .84rem; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { border: 1px solid var(--line); background: transparent; color: var(--ink); width: 32px; height: 32px; border-radius: 9px; cursor: pointer; }
.icon-btn:hover { border-color: var(--c); color: var(--c); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 700; }
.switch input { width: 42px; height: 24px; appearance: none; background: rgba(143,184,181,.25); border-radius: 999px; position: relative; cursor: pointer; transition: background .2s; }
.switch input::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: inset-inline-start .2s; }
.switch input:checked { background: var(--grad); }
.switch input:checked::after { inset-inline-start: 21px; }

/* ---------- learn ---------- */
.post { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; margin-bottom: 14px; }
.post img.cover { width: 100%; max-height: 260px; object-fit: cover; display: block; }
.post .pb { padding: 14px 18px; }
.post h4 { margin: 0 0 6px; font-size: 1.05rem; }
.post .body { color: var(--ink2); line-height: 1.8; white-space: pre-wrap; font-size: .92rem; }
.post .date { color: var(--muted); font-size: .76rem; }
.post iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 12px; margin-top: 10px; }

/* ---------- toast ---------- */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 100; background: var(--tip-bg); border: 1px solid rgba(45,212,191,.5); color: var(--ink); padding: 10px 16px; border-radius: 12px; font-weight: 700; box-shadow: 0 14px 40px rgba(0,0,0,.4); }

/* ---------- join page ---------- */
.join { max-width: 860px; margin: 0 auto; padding: 24px 18px 60px; position: relative; }
.join-hero { text-align: center; padding: 26px 10px 10px; }
.join-hero h1 { font-size: 1.9rem; margin: 14px 0 8px; background: linear-gradient(90deg, var(--num1), var(--num2), var(--lime)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.join-hero p { color: var(--muted); margin: 0 auto; max-width: 620px; line-height: 1.7; }
.perks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 22px 0; }
.perk { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; text-align: center; }
.perk i { font-size: 1.4rem; color: var(--g); }
.perk b { display: block; margin: 8px 0 4px; }
.perk span { color: var(--muted); font-size: .84rem; }
.checks { list-style: none; padding: 0; margin: 8px 0 14px; display: grid; gap: 6px; }
.checks li { display: flex; gap: 8px; align-items: center; font-size: .88rem; color: var(--muted); }
.checks li.ok { color: var(--ok-ink); } .checks li.ok i { color: var(--ok); }
.checks li.no i { color: var(--bad); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

@media (max-width: 1000px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row2, .row3 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding: 16px 14px 96px; }
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: var(--side); border-top: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); gap: 2px; }
  .bottom-nav::-webkit-scrollbar { display: none; }
  .bottom-nav .nav-btn { flex: 0 0 auto; flex-direction: column; gap: 3px; font-size: .68rem; padding: 6px 10px; width: auto; }
  .bottom-nav .nav-btn i { font-size: 1rem; }
  .kpi b { font-size: 1.2rem; }
  .grid2, .perks { grid-template-columns: 1fr; }
  .join-hero h1 { font-size: 1.5rem; }
}

/* chart tooltip + theme-aware bits */
#tipR { fill: var(--tip-bg); stroke: var(--g); }
#tipT1 { fill: var(--ink); }
#tipT2 { fill: var(--muted); }
#tipC { fill: var(--input); stroke: var(--c); }
.kpi, .card, .post, .perk, .auth-card { box-shadow: var(--shadow); }
.aff-num { color: var(--num1); }
.aff-lime { color: var(--lime-ink); }
.nav-btn.on, .btn { color: #022; }
.btn.ghost { color: var(--ink); }
.btn.danger { color: #fff; }

/* ---------- store builder ---------- */
.bld-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.bld-url { font-size: .74rem; color: var(--muted); font-weight: 600; margin-inline-start: 6px; direction: ltr; unicode-bidi: isolate; }
.bld-page.on { outline: 2px solid var(--g); }
.bld-page .t { white-space: normal; }
.bld-secs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.bld-sec { border: 1px solid var(--line); border-radius: 14px; background: var(--panel2); }
.bld-sec.open { border-color: var(--g); }
.bld-sec-head { display: flex; align-items: center; gap: 6px; padding: 6px 8px; }
.bld-sec-t { flex: 1; min-width: 0; text-align: start; background: none; border: 0; color: var(--ink); font-weight: 800; cursor: pointer; padding: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bld-sec-t i:first-child { color: var(--g); width: 18px; }
.bld-sec-body { padding: 4px 14px 14px; border-top: 1px dashed var(--line); }
.bld-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 12px; border: 1px dashed var(--line); border-radius: 14px; }
.bld-add b { font-size: .84rem; margin-inline-end: 4px; }
.bld-img { display: flex; gap: 10px; align-items: flex-start; }
.bld-img img, .bld-noimg { width: 86px; height: 86px; border-radius: 12px; object-fit: cover; background: #fff; border: 1px solid var(--line); flex: 0 0 auto; }
.bld-noimg { display: grid; place-items: center; color: var(--muted); font-size: 1.6rem; }
.bld-items { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.bld-item { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--panel); }
.bld-slug { display: flex; align-items: center; gap: 4px; }
.bld-slug span { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.bld-color { width: 46px; height: 36px; border: 1px solid var(--line); border-radius: 10px; padding: 2px; background: var(--input); cursor: pointer; }
.bld-css { min-height: 260px; font-family: Consolas, monospace; font-size: .84rem; direction: ltr; text-align: left; white-space: pre; tab-size: 2; }
.bld-modal { position: fixed; inset: 0; z-index: 90; background: rgba(2, 16, 20, .55); display: flex; align-items: flex-start; justify-content: center; padding: 30px 12px; overflow-y: auto; }
.bld-box { width: min(720px, 100%); margin: 0; }
.bld-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.bld-m { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.bld-m img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.bld-m .btn { border-radius: 0; }
.bld-m .icon-btn { position: absolute; top: 6px; inset-inline-end: 6px; background: rgba(255,255,255,.92); color: #e11d48; }
@media (max-width: 760px) { .bld-img { flex-direction: column; } .bld-sec-head .icon-btn { width: 28px; height: 28px; } }
/* ---------- catalog choice, templates, product editor ---------- */
.bld-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bld-mode, .bld-tpl { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: start; border: 1px solid var(--line); background: var(--panel2); color: var(--ink); border-radius: 14px; padding: 12px 14px; cursor: pointer; font: inherit; }
.bld-mode i, .bld-tpl i { color: var(--g); font-size: 1.2rem; }
.bld-mode span, .bld-tpl span { font-size: .78rem; color: var(--muted); }
.bld-mode.on { border-color: var(--g); box-shadow: 0 0 0 2px rgba(13,148,136,.25); background: rgba(13,148,136,.08); }
.bld-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; max-height: 320px; overflow: auto; padding: 4px; border: 1px solid var(--line); border-radius: 12px; }
.bld-cat { display: flex; align-items: center; gap: 8px; font-size: .84rem; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.bld-cat:hover { background: rgba(13,148,136,.06); }
.bld-cat span { margin-inline-start: auto; color: var(--muted); font-size: .74rem; }
.bld-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.p-card .im { position: relative; }
.p-edit { position: absolute; top: 6px; inset-inline-start: 6px; width: 32px; height: 32px; border-radius: 10px; border: 0; background: rgba(255,255,255,.95); color: #0f766e; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.p-flag { position: absolute; bottom: 6px; inset-inline-end: 6px; font-size: .7rem; font-weight: 800; background: #e11d48; color: #fff; padding: 2px 8px; border-radius: 99px; }
.p-card.p-hidden { opacity: .6; }
@media (max-width: 760px) { .bld-modes { grid-template-columns: 1fr; } }