/* agent-pick v1 — one look for every choice on the site.
   Lists (<select>) use the same picker as the map's category list and the
   «نزدیک من» area picker. Filter chips, checkboxes, radios and switches share
   one colour and one shape. Panels keep their own workspace accent. */
:root{--ag-acc:#123528;--ag-acc-hover:#1b4636;--ag-ink:#fff;--ag-soft:color-mix(in oklab,#123528 9%,transparent)}
:root[data-theme=dark],:root[data-theme=night],:root[data-theme=luxury]{--ag-acc:#d6b46a;--ag-acc-hover:#e2c58a;--ag-ink:#1d2a1f;--ag-soft:color-mix(in oklab,#d6b46a 14%,transparent)}
body.page-panel.page-admin{--ag-acc:var(--pw-accent,#126b64);--ag-acc-hover:var(--pw-accent,#126b64);--ag-ink:var(--pw-accent-ink,#fff);--ag-soft:color-mix(in oklab,var(--pw-accent,#126b64) 10%,transparent)}

/* ---- the list field (closed state) ---- */
.ag-pick{position:relative;z-index:auto;min-width:0;max-width:100%;box-sizing:border-box}
.ag-pick[hidden]{display:none!important}
:root:not(#_) .catpick:not(.n2-area *) .catpick-btn{width:100%;min-height:48px;padding:10px 14px;gap:10px;border-radius:12px;
  border:1px solid color-mix(in oklab,var(--color-border) 70%,var(--color-border-strong,var(--color-border)));background:var(--color-card,var(--color-surface,#fff));
  color:var(--color-muted-foreground);font:inherit;font-size:.95rem;font-weight:500;line-height:1.5;box-shadow:none;
  text-align:start;cursor:pointer;transition:border-color .15s ease,box-shadow .15s ease}
:root:not(#_) .catpick:not(.n2-area *).has-value .catpick-btn{color:var(--color-foreground);font-weight:600}
:root:not(#_) .catpick:not(.n2-area *) .catpick-btn:hover{border-color:var(--ag-acc)}
:root:not(#_) .catpick:not(.n2-area *) .catpick-btn[aria-expanded=true],
:root:not(#_) .catpick:not(.n2-area *) .catpick-btn:focus-visible{outline:none;border-color:var(--ag-acc);box-shadow:0 0 0 3px var(--ag-soft)}
:root:not(#_) .catpick:not(.n2-area *) .catpick-btn:disabled{opacity:.55;cursor:not-allowed}
:root:not(#_) .catpick:not(.n2-area *) .catpick-btn .catpick-caret{width:18px;height:18px;flex:none;color:var(--color-muted-foreground);margin-inline-start:auto}
:root:not(#_) .catpick:not(.n2-area *) .catpick-btn[aria-expanded=true] .catpick-caret{color:var(--ag-acc)}
.catpick:not(.n2-area *) .catpick-val{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
:root:not(#_) .catpick.is-invalid .catpick-btn{border-color:var(--color-danger,#b42318);box-shadow:0 0 0 3px color-mix(in oklab,var(--color-danger,#b42318) 15%,transparent)}
:root:not(#_) .page-panel .panel-main-content .ag-pick .catpick-btn{min-height:44px;border-radius:10px!important;border:1px solid #9bafb9!important;background:var(--pw-surface,#fff)!important;color:var(--pw-text)!important;box-shadow:none!important;font-weight:500}
:root:not(#_) .page-panel .panel-main-content .ag-pick:not(.has-value) .catpick-btn{color:var(--pw-muted)!important}
:root:not(#_) .page-panel .panel-main-content .ag-pick .catpick-btn[aria-expanded=true]{border-color:var(--pw-accent)!important;box-shadow:0 0 0 3px var(--ag-soft)!important}
.page-panel .ag-pick-pop{background:var(--pw-surface,#fff)}
/* compact rows (map chips, sort bars) */
:root:not(#_) :is(.map-chips,.select-chip) .catpick .catpick-btn{min-height:40px;border-radius:999px;padding:6px 14px}

/* ---- the open list ---- */
.ag-pick-pop{color:var(--color-foreground);font-size:.95rem}
.ag-pick-pop .catpick-list{overscroll-behavior:contain}
.ag-pick-pop .catpick-item{align-items:center;font-weight:500}
.ag-pick-pop .catpick-item .ci-name{flex:1 1 auto;min-width:0}
.ag-pick-pop .ci-grp{margin-inline-start:auto;font-size:.8rem;color:var(--color-muted-foreground)}
.ag-pick-pop .catpick-item:hover,.ag-pick-pop .catpick-item.is-cursor,.ag-pick-pop .catpick-item:focus-visible{background:var(--ag-soft);outline:none}
.ag-pick-pop .catpick-item.is-on{background:color-mix(in oklab,var(--ag-acc) 13%,transparent);font-weight:700;color:var(--color-foreground)}
.ag-pick-pop .catpick-item.is-on:not(:has(.ag-pick-box))::after{content:"";flex:none;width:8px;height:8px;border-radius:50%;background:var(--ag-acc);margin-inline-start:auto}
.ag-pick-pop .catpick-item.is-none .ci-name{color:var(--color-muted-foreground)}
.ag-pick-pop .catpick-item:disabled{opacity:.45;cursor:not-allowed}
.ag-pick-box{flex:none;width:22px;height:22px;border-radius:6px;border:1.5px solid var(--color-border-strong,var(--color-border));display:grid;place-items:center;background:var(--color-card,#fff);color:transparent}
.ag-pick-box svg{width:15px;height:15px}
.catpick-item.is-on .ag-pick-box{background:var(--ag-acc);border-color:var(--ag-acc);color:var(--ag-ink)}
.ag-pick-foot{padding:10px 14px calc(10px + env(safe-area-inset-bottom));border-top:1px solid var(--glass-hairline,var(--color-border));background:var(--color-background)}
.ag-pick-done{width:100%;min-height:46px;border:0;border-radius:12px;background:var(--ag-acc);color:var(--ag-ink);font:inherit;font-weight:700;cursor:pointer}
.ag-pick-done:hover{background:var(--ag-acc-hover)}
@media (max-width:860px){
  .ag-pick-pop .catpick-list{padding-bottom:16px}
  .ag-pick-pop.catpick-pop{z-index:1200}
}
@media (min-width:861px){
  :root:not(#_) .ag-pick-pop.catpick-pop{border-radius:14px;border:1px solid var(--color-border);background:var(--color-card,var(--color-background));
    box-shadow:0 16px 40px -18px rgba(10,28,20,.32);overflow:hidden;animation:none}
  .ag-pick-pop .catpick-sheet-head{display:none}
  .ag-pick-pop .catpick-search{padding:8px 12px}
  .ag-pick-pop .catpick-search input{min-height:40px}
  .ag-pick-pop .catpick-item{min-height:42px;padding:9px 14px}
  .ag-pick-foot{padding:8px 12px}
  .ag-pick-done{min-height:40px}
}

/* ---- older list widget, if any page still builds one ---- */
:root:not(#_) .dg-select-trigger{min-height:48px;border-radius:12px;border-color:var(--color-border-strong,var(--color-border));background:var(--color-card);box-shadow:none}
:root:not(#_) .dg-select.is-open .dg-select-trigger,:root:not(#_) .dg-select-trigger:focus-visible{border-color:var(--ag-acc);box-shadow:0 0 0 3px var(--ag-soft)}
:root:not(#_) .dg-select-opt.is-selected{background:color-mix(in oklab,var(--ag-acc) 13%,transparent);color:var(--color-foreground)}

/* ---- filter chips: one plain pill everywhere on the public site ---- */
:root:not(#_) body:not(.page-admin) .chip{border-radius:999px!important;border:1px solid var(--color-border)!important;
  background:var(--color-card)!important;color:var(--color-foreground)!important;box-shadow:none!important;
  -webkit-backdrop-filter:none!important;backdrop-filter:none!important;transform:none!important;font-weight:600}
:root:not(#_) body:not(.page-admin) .chip:hover{border-color:var(--ag-acc)!important}
:root:not(#_) body:not(.page-admin) :is(.chip.is-active,.chip[aria-pressed=true],.chip[aria-current=page],.chip[aria-selected=true],.chip:has(input:checked)){
  background:var(--ag-acc)!important;border-color:var(--ag-acc)!important;color:var(--ag-ink)!important}
:root:not(#_) body:not(.page-admin) :is(.chip.is-active,.chip[aria-pressed=true],.chip[aria-current=page]) :is(svg,.ic){color:inherit}
:root:not(#_) body:not(.page-admin) .chip.is-active .chip-n{background:color-mix(in oklab,var(--ag-ink) 22%,transparent);color:var(--ag-ink)}
:root:not(#_) body:not(.page-admin) .chip:focus-visible{outline:2px solid var(--ag-acc)!important;outline-offset:2px}
/* a checkbox turned into a filter chip */
.ag-chipcheck{cursor:pointer;user-select:none;gap:8px}
.ag-chipcheck input[type=checkbox]{position:absolute;opacity:0;width:1px;height:1px;pointer-events:none}
.ag-chipcheck::before{content:"";width:8px;height:8px;border-radius:50%;border:1.5px solid currentColor;flex:none;opacity:.7}
.ag-chipcheck.is-active::before{background:currentColor;opacity:1}
.ag-chipcheck:has(input:focus-visible){outline:2px solid var(--ag-acc);outline-offset:2px}

/* radio cards that already look like chips (presets, stock, topics) */
:root:not(#_) body:not(.page-admin) :is(label.stock-chip):has(input:checked){border-color:var(--ag-acc)!important;
  background:color-mix(in oklab,var(--ag-acc) 10%,var(--color-card))!important;box-shadow:inset 0 0 0 1px var(--ag-acc)!important}

/* ---- checkboxes, radios, switches ---- */
:root:not(#_) input:is([type=checkbox],[type=radio]){accent-color:var(--ag-acc)}
:root:not(#_) body:not(.page-admin) input:is([type=checkbox],[type=radio]):not(.switch *):not(.switch-row *):not(.ag-chipcheck *){width:20px;height:20px;flex:none;cursor:pointer;vertical-align:middle}
:root:not(#_) body:not(.page-admin) .check{gap:10px;align-items:center;cursor:pointer}
:root:not(#_) .switch input:checked + .track,:root:not(#_) .switch-row input:checked ~ .track{background:var(--ag-acc)}
:root[data-theme=dark] .switch input:checked + .track::after,:root[data-theme=night] .switch input:checked + .track::after,:root[data-theme=luxury] .switch input:checked + .track::after{background:#1d2a1f}
/* the sort list on /businesses stays a compact field beside «اکنون باز است» */
@media (min-width:861px){:root:not(#_) .dir-filters .dir-row>.ag-pick{flex:0 1 300px!important;width:300px!important;max-width:300px!important;min-width:220px!important;justify-self:start}}
/* short lists on phones: a bottom sheet instead of a full screen */
@media (max-width:860px){
  .ag-pick-scrim{position:fixed;inset:0;z-index:1199;background:rgba(12,20,16,.42)}
  :root:not(#_) .ag-pick-pop.ag-pick-short{top:auto;bottom:0;left:0;right:0;max-height:82vh;max-height:82dvh;border-radius:18px 18px 0 0;
    padding-bottom:env(safe-area-inset-bottom);box-shadow:0 -10px 30px -12px rgba(0,0,0,.3);animation:agPickUp .18s ease-out}
  .ag-pick-pop.ag-pick-short .catpick-list{flex:0 1 auto;padding-bottom:8px;max-height:60vh;overflow-y:auto}
  .ag-pick-pop.ag-pick-short .catpick-sheet-head{padding-top:12px}
}
@keyframes agPickUp{from{transform:translateY(24px);opacity:.6}to{transform:none;opacity:1}}
@media (prefers-reduced-motion:reduce){.ag-pick-pop.ag-pick-short{animation:none!important}}
/* the search field inside the list never takes the page's input frame */
:root:not(#_) .ag-pick-pop .catpick-search input{border:0!important;box-shadow:none!important;background:none!important;outline:none!important;min-height:40px;padding:0!important;border-radius:0!important}
:root:not(#_) .ag-pick-pop .catpick-search:focus-within{background:var(--ag-soft)}
/* the leading icon of the older category picker takes the accent colour */
:root:not(#_) .catpick:not(.n2-area *) .catpick-btn>svg:not(.catpick-caret){color:var(--ag-acc);width:18px;height:18px}
/* a switch is the small track only — the whole row is not painted */
:root:not(#_) :is(.switch,.switch:has(input:checked)){background:none!important;border-radius:0}
:root:not(#_) .switch .track{background:var(--color-border-strong,#c9c3b3)}
:root:not(#_) .switch input:checked + .track{background:var(--ag-acc)}

/* ---- v2: the open list is a real dropdown card (mission 13 review) ---- */
@media (min-width:861px){
  html:not(#_) body .ag-pick-pop.catpick-pop{background:#fff;border:1px solid rgba(18,53,40,.16);border-radius:12px;
    box-shadow:0 2px 6px rgba(16,32,24,.06),0 14px 34px -10px rgba(16,32,24,.24);padding:6px;gap:4px;overflow:hidden}
}
:root[data-theme=dark] body .ag-pick-pop.catpick-pop,:root[data-theme=night] body .ag-pick-pop.catpick-pop,:root[data-theme=luxury] body .ag-pick-pop.catpick-pop{background:var(--color-card,#1c2621)!important;border-color:rgba(255,255,255,.14)!important}
/* the search sits in its own small field, not a coloured band */
html:not(#_) body .ag-pick-pop .catpick-search{margin:2px 2px 4px;padding:0 10px!important;min-height:40px;border:1px solid rgba(18,53,40,.18)!important;border-radius:9px;
  background:var(--color-background,#f7f6f2)!important;box-shadow:none!important;gap:8px}
html:not(#_) body .ag-pick-pop .catpick-search:focus-within{border-color:var(--ag-acc)!important;background:#fff!important;box-shadow:0 0 0 3px var(--ag-soft)!important}
:root[data-theme=dark] body .ag-pick-pop .catpick-search:focus-within,:root[data-theme=night] body .ag-pick-pop .catpick-search:focus-within,:root[data-theme=luxury] body .ag-pick-pop .catpick-search:focus-within{background:transparent!important}
html:not(#_) body .ag-pick-pop .catpick-search[hidden]{display:none!important}
html:not(#_) body .ag-pick-pop .catpick-search input{font-size:.92rem!important;min-height:38px!important;color:var(--color-foreground)}
html:not(#_) body .ag-pick-pop .catpick-search input::placeholder{color:var(--color-muted-foreground);opacity:.85}
html:not(#_) body .ag-pick-pop .catpick-search input::-webkit-search-cancel-button{-webkit-appearance:none;appearance:none}
html:not(#_) body .ag-pick-pop .catpick-search svg{width:16px;height:16px}
/* rows: same height, rounded hover, no rules between them */
html:not(#_) body .ag-pick-pop .catpick-item{min-height:40px;padding:8px 12px;border:0!important;border-radius:8px;font-size:.93rem;font-weight:500;width:100%;background:none;color:var(--color-foreground);text-align:start}
html:not(#_) body .ag-pick-pop .catpick-item + .catpick-item{margin-top:1px}
html:not(#_) body .ag-pick-pop .catpick-item:is(:hover,.is-cursor,:focus-visible){background:var(--ag-soft)}
html:not(#_) body .ag-pick-pop .catpick-item.is-on{background:color-mix(in oklab,var(--ag-acc) 12%,transparent);font-weight:700}
html:not(#_) body .ag-pick-pop .catpick-item.is-none .ci-name{color:var(--color-muted-foreground);font-weight:500}
html:not(#_) body .ag-pick-pop .catpick-list{padding:0 2px;scrollbar-width:thin;scrollbar-color:rgba(18,53,40,.25) transparent}
html:not(#_) body .ag-pick-pop .catpick-list::-webkit-scrollbar{width:6px}
html:not(#_) body .ag-pick-pop .catpick-list::-webkit-scrollbar-thumb{background:rgba(18,53,40,.25);border-radius:6px}
html:not(#_) body .ag-pick-pop .catpick-empty{padding:14px;margin:0;color:var(--color-muted-foreground);font-size:.9rem;text-align:center}
html:not(#_) body .ag-pick-pop .ag-pick-foot{margin:4px -6px -6px;background:transparent}
/* phones: the sheet keeps the same inner look */
@media (max-width:860px){
  html:not(#_) body .ag-pick-pop .catpick-search{margin:4px 12px 8px}
  html:not(#_) body .ag-pick-pop .catpick-list{padding:0 8px 16px}
  html:not(#_) body .ag-pick-pop .catpick-item{min-height:46px}
  html:not(#_) body .ag-pick-pop .catpick-sheet-head{font-weight:700}
}

/* ---- v2: hours rows (wizard + owner panel) ---- */
.hours-row .ag-pick{min-width:0!important}
.hours-row .ag-pick .catpick-btn{min-height:44px!important;font-variant-numeric:tabular-nums}
.hours-row.ag-day-off .ag-pick{opacity:.4;pointer-events:none}
.hours-row.ag-day-off .ag-pick .catpick-val{text-decoration:line-through}
/* ---- v2: preset choices are equal tiles ---- */
html:not(#_) body .rw-presets{display:grid!important;grid-auto-rows:1fr;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px;align-items:stretch}
html:not(#_) body .rw-presets>.rw-preset{display:flex!important;width:100%;margin:0;min-height:56px;border:0!important;background:none!important;box-shadow:none!important}
html:not(#_) body .rw-presets>.rw-preset>span{flex:1 1 auto;display:flex;align-items:center;justify-content:center;text-align:center;line-height:1.6;box-sizing:border-box;
  border:1px solid rgba(18,53,40,.18);border-radius:12px;background:var(--color-card,#fff);font-weight:600;transition:border-color .12s ease,background-color .12s ease}
html:not(#_) body .rw-presets>.rw-preset:hover>span{border-color:var(--ag-acc)}
html:not(#_) body .rw-presets>.rw-preset>input:checked+span{border-color:var(--ag-acc);background:color-mix(in oklab,var(--ag-acc) 10%,var(--color-card,#fff));color:var(--color-foreground);box-shadow:inset 0 0 0 1px var(--ag-acc)}
@media (max-width:520px){html:not(#_) body .rw-presets{grid-template-columns:1fr 1fr}}
/* ---- v2: one checkbox / radio look on the public site and owner pages ---- */
:root:not(#_) body:not(.page-admin) input:is([type=checkbox],[type=radio]):not(.switch *):not(.switch-row *):not(.ag-chipcheck *):not(.sr-only):not(.rw-preset *):not(.stock-chip *):not([hidden]){
  -webkit-appearance:none;appearance:none;margin:0;width:20px;height:20px;flex:none;display:inline-grid;place-content:center;
  border:1.5px solid color-mix(in oklab,var(--color-foreground,#1d2a1f) 32%,transparent);border-radius:6px;background:var(--color-card,#fff);
  cursor:pointer;vertical-align:middle;transition:background-color .12s ease,border-color .12s ease}
:root:not(#_) body:not(.page-admin) input[type=radio]:not(.switch *):not(.switch-row *):not(.ag-chipcheck *):not(.sr-only):not(.rw-preset *):not(.stock-chip *){border-radius:50%}
:root:not(#_) body:not(.page-admin) input:is([type=checkbox],[type=radio]):not(.switch *):not(.switch-row *):not(.ag-chipcheck *):not(.sr-only):not(.rw-preset *):not(.stock-chip *):hover{border-color:var(--ag-acc)}
:root:not(#_) body:not(.page-admin) input:is([type=checkbox],[type=radio]):not(.switch *):not(.switch-row *):not(.ag-chipcheck *):not(.sr-only):not(.rw-preset *):not(.stock-chip *):checked{background:var(--ag-acc);border-color:var(--ag-acc)}
:root:not(#_) body:not(.page-admin) input[type=checkbox]:not(.switch *):not(.switch-row *):not(.ag-chipcheck *):not(.sr-only):not(.rw-preset *):not(.stock-chip *):checked::before{content:"";width:11px;height:6px;border:solid var(--ag-ink);border-width:0 0 2.2px 2.2px;transform:translateY(-1px) rotate(-45deg)}
:root:not(#_) body:not(.page-admin) input[type=radio]:not(.switch *):not(.switch-row *):not(.ag-chipcheck *):not(.sr-only):not(.rw-preset *):not(.stock-chip *):checked::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--ag-ink)}
:root:not(#_) body:not(.page-admin) input:is([type=checkbox],[type=radio]):not(.switch *):not(.switch-row *):not(.ag-chipcheck *):focus-visible{outline:2px solid var(--ag-acc);outline-offset:2px}
:root:not(#_) body:not(.page-admin) input:is([type=checkbox],[type=radio]):disabled{opacity:.5;cursor:not-allowed}
/* ---- v2: small icon inside a field hint stays on the text line ---- */
:root:not(#_) .field-hint>svg.dgi{display:inline-block!important;width:14px;height:14px;vertical-align:-2px;margin-inline-end:4px;flex:none}
@media (max-width:860px){
  html:not(#_) body .hours-row{display:grid!important;grid-template-columns:1fr 1fr;gap:8px 10px;align-items:center;padding:10px 0;border-bottom:1px solid rgba(18,53,40,.08)}
  html:not(#_) body .hours-row:last-child{border-bottom:0}
  html:not(#_) body .hours-row>span:first-child{grid-column:1;grid-row:1;margin:0}
  html:not(#_) body .hours-row>label.check{grid-column:2;grid-row:1;justify-self:end;margin:0}
  html:not(#_) body .hours-row>.ag-pick{grid-row:2;width:100%!important;margin:0!important}
}

/* ===================== v3 (registration review, round 2) ===================== */
/* «دسته»: error replaces the green «انتخاب شما» bar until a job is picked */
html:not(#_) .rw-picked.ag-err-hide{display:none!important}
html:not(#_) .ag-cat-err{display:flex;align-items:flex-start;gap:8px;margin:0 0 12px;padding:10px 12px;border-radius:var(--radius-md);border:1px solid color-mix(in oklab,var(--color-destructive) 30%,transparent);background:color-mix(in oklab,var(--color-destructive) 9%,transparent);color:var(--color-danger-text);font-size:var(--text-sm);font-weight:600;line-height:1.7}
html:not(#_) .ag-cat-err svg{flex:none;margin-top:3px}
/* «تصاویر»: hints as a short list, saved count, cover shown as it will appear (16:9) */
html:not(#_) .rw-img-hints{margin:0 0 12px;padding:0;list-style:none;display:grid;gap:4px;font-size:var(--text-sm);color:var(--color-text-muted);line-height:1.8}
html:not(#_) .rw-img-hints li{display:block;position:relative;padding-inline-start:13px}
html:not(#_) .rw-img-hints li::before{content:"";position:absolute;inset-inline-start:0;top:.75em;width:5px;height:5px;border-radius:50%;background:currentColor;opacity:.55}
html:not(#_) .rw-img-count{display:flex;align-items:center;gap:6px;margin:4px 0 10px;font-size:var(--text-sm);font-weight:700;color:var(--rw-accent,#123528)}
html:not(#_) .rw-img-count svg{width:16px;height:16px}
html:not(#_) .rw-thumbs .rw-thumb.is-cover{grid-column:span 2;aspect-ratio:16/9;outline:2px solid var(--color-primary);outline-offset:-2px}
html:not(#_) .rw-thumb .rw-cover-tag,html:not(#_) .imgf-cover-tag{position:absolute;top:6px;bottom:auto;inset-inline-end:6px;inset-inline-start:auto;padding:2px 8px;border-radius:999px;background:var(--color-primary);color:var(--color-on-primary,#fff);font-size:11px;font-weight:700;line-height:1.7;box-shadow:0 1px 2px rgba(0,0,0,.18)}
html:not(#_) .imgf-item.is-cover .imgf-tools{inset-inline-end:auto;inset-inline-start:6px}
html:not(#_) .imgf-grid .imgf-item.is-cover{grid-column:span 2}
html:not(#_) .imgf-grid .imgf-item.is-cover img{aspect-ratio:16/9}
html:not(#_) .imgf-item figcaption{font-size:11.5px;line-height:1.6;padding:3px 6px}
/* side «خلاصهٔ ثبت»: long values wrap (max 2 lines) instead of a broken «(۹–۳-…» */
html:not(#_) .rw-summary li b{white-space:normal;max-width:20ch;text-align:end;unicode-bidi:plaintext;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;line-height:1.6}

/* ===================== v4 (catalogue cards + item page, m19) ===================== */
/* the site-wide tap-size rule «.card a{padding-block:11px;display:inline-block}» also hit the
   photo link of every catalogue card: the photo shrank and left bands above and below it */
html:not(#_) .item-card .item-media-link{padding:0!important;min-height:0!important;display:block!important}
html:not(#_) .item-card .item-media-link>img{display:block;width:100%;height:100%;object-fit:cover}
html:not(#_) .item-card .item-media-link>.item-ph{display:grid;place-items:center;width:100%;height:100%}
html:not(#_) .item-card .item-ph svg{width:38px;height:38px}
/* badges sit small in the top corner instead of floating in the middle of the photo */
html:not(#_) .item-card .media-badges{position:absolute!important;top:8px!important;bottom:auto!important;inset-inline-start:8px!important;inset-inline-end:auto!important;transform:none!important;margin:0!important;display:flex!important;flex-wrap:wrap;gap:4px;justify-content:flex-start!important;align-items:flex-start!important;max-width:calc(100% - 16px);pointer-events:none;z-index:2}
html:not(#_) .item-card .media-badges .badge{min-height:0!important;padding:2px 8px!important;font-size:11.5px!important;line-height:1.7!important;gap:4px;box-shadow:0 1px 3px rgba(0,0,0,.18)}
html:not(#_) .item-card .media-badges .badge svg{width:12px!important;height:12px!important}
html:not(#_) .item-card .item-foot .btn{white-space:nowrap}
html:not(#_) .item-card .item-price s{margin-inline:6px;font-weight:500;font-size:12px!important;opacity:.85}

/* phones: one item per row, photo beside the text, price + action across the bottom
   (the list layout Digikala / Snappfood use for info-rich items) */
@media (max-width:600px){
  html:not(#_) body .item-grid,html:not(#_) body .item-grid.lg{grid-template-columns:minmax(0,1fr)!important;gap:10px!important}
  html:not(#_) body .item-grid>.item-card{display:grid!important;grid-template-columns:96px minmax(0,1fr);column-gap:12px;row-gap:0;align-items:start;padding:10px!important;border-radius:14px!important;transform:none!important;min-height:0}
  html:not(#_) body .item-grid>.item-card>.sheen{display:none!important}
  html:not(#_) body .item-grid>.item-card>.item-media{grid-column:1;grid-row:1/span 4;width:96px;height:96px;aspect-ratio:1/1!important;border-radius:10px;min-height:0!important}
  html:not(#_) body .item-grid>.item-card .media-badges{top:5px!important;inset-inline-start:5px!important;max-width:calc(100% - 10px)}
  html:not(#_) body .item-grid>.item-card .media-badges .badge{padding:1px 6px!important;font-size:10.5px!important}
  html:not(#_) body .item-grid>.item-card .media-badges .badge:nth-child(n+2){display:none!important}
  html:not(#_) body .item-grid>.item-card .item-more{bottom:5px;inset-inline-end:5px;padding:2px 6px}
  html:not(#_) body .item-grid>.item-card>.card-body{display:contents!important}
  html:not(#_) body .item-grid>.item-card>.card-body>*{grid-column:2;margin:0;min-width:0}
  html:not(#_) body .item-grid>.item-card .card-title a{display:inline!important;min-height:0!important;padding:0!important}
  html:not(#_) body .item-grid>.item-card .card-title{min-height:0!important;padding:0!important;font-size:14px!important;line-height:1.6;margin:0 0 2px!important;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  html:not(#_) body .item-grid>.item-card .card-desc{font-size:12.5px!important;line-height:1.7;margin:0!important;-webkit-line-clamp:2;color:var(--color-muted-foreground)}
  html:not(#_) body .item-grid>.item-card .item-opts{display:block;margin-top:4px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px;color:var(--color-muted-foreground)}
  html:not(#_) body .item-grid>.item-card .item-opt{display:inline;border:0;padding:0;border-radius:0;font-size:12px;font-weight:600}
  html:not(#_) body .item-grid>.item-card .item-opt+.item-opt::before{content:" · ";font-weight:400}
  html:not(#_) body .item-grid>.item-card .item-flags{display:flex;flex-wrap:wrap;gap:2px 10px;margin-top:5px!important}
  html:not(#_) body .item-grid>.item-card .item-flag{background:none!important;padding:0!important;border-radius:0;font-size:12px!important;font-weight:600;line-height:1.6;align-items:flex-start}
  html:not(#_) body .item-grid>.item-card .item-flag svg{margin-top:3px;flex:none}
  html:not(#_) body .item-grid>.item-card .item-flag:nth-child(n+3){display:none}
  html:not(#_) body .item-grid>.item-card .item-tags{display:none!important}
  html:not(#_) body .item-grid>.item-card .item-note{grid-column:1/-1;margin-top:8px!important;font-size:12px;line-height:1.7}
  html:not(#_) body .item-grid>.item-card .item-foot{grid-column:1/-1;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;margin-top:10px!important;padding-top:10px!important}
  html:not(#_) body .item-grid>.item-card .item-price{font-size:14px!important;flex:1 1 auto;min-width:0}
  html:not(#_) body .item-grid>.item-card .item-price{flex-basis:100%!important}
  html:not(#_) body .item-grid>.item-card .item-foot .btn{flex:1 1 100%;justify-content:center;min-height:42px;padding-inline:14px;font-size:13.5px}
  html:not(#_) body .item-grid>.item-card .item-foot.prices-hidden .btn,html:not(#_) body .item-grid>.item-card .item-foot>.btn:only-child{flex:1 1 100%}
  html:not(#_) body .item-grid>.item-card .stock-card-form{flex:1 1 100%;display:flex;gap:6px}
  html:not(#_) body .item-grid>.item-card .stock-card-form .input{flex:1;min-width:0}
  html:not(#_) body .item-grid>.item-card .item-meta{grid-column:1/-1;margin-top:8px!important}
}

/* item page */
html:not(#_) .item-detail-copy .item-store-link{display:flex!important;padding-block:10px!important}
html:not(#_) .item-detail-copy .ag-it-desc{white-space:pre-line}
/* one steady 4:3 photo frame (like Digikala/Divar): the photo fills it, no empty bands,
   and swiping between photos never makes the page jump */
html:not(#_) .item-detail-media{aspect-ratio:4/3!important;min-height:0!important;height:auto!important;padding:0!important;display:block!important;overflow:hidden;border-radius:16px}
html:not(#_) .item-detail-media>img{display:block;width:100%!important;height:100%!important;max-height:none!important;object-fit:cover}
html:not(#_) .item-detail-media.item-ph{display:grid!important;place-items:center}
html:not(#_) .ag-gal-track{align-items:stretch}
html:not(#_) .item-detail-price{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px}
html:not(#_) .item-detail-price s{font-size:13px;font-weight:500;color:var(--color-muted-foreground)}
html:not(#_) .badge-off{background:color-mix(in oklab,#c0392b 12%,transparent)!important;color:#b42318!important;border:0!important;font-size:12px!important;font-weight:700;padding:2px 8px!important;min-height:0!important}
html[data-theme=dark]:not(#_) .badge-off{color:#ff8a80!important}
html:not(#_) .ag-it-block{margin:14px 0}
html:not(#_) .ag-it-label{display:block;margin-bottom:6px;font-size:12.5px;font-weight:700;color:var(--color-muted-foreground)}
html:not(#_) .ag-it-flags{list-style:none;margin:14px 0;padding:0;display:grid;gap:8px}
html:not(#_) .ag-it-flags li{display:flex;gap:8px;align-items:flex-start;font-size:var(--text-sm);font-weight:600;line-height:1.7}
html:not(#_) .ag-it-flags svg{width:18px;height:18px;flex:none;margin-top:2px;color:var(--color-primary)}
html:not(#_) .ag-it-note{margin:14px 0;padding:10px 12px;border-radius:12px;background:color-mix(in oklab,var(--color-warning,#b7791f) 10%,transparent);font-size:13px;line-height:1.8;color:var(--color-text,inherit)}
html:not(#_) .ag-it-secs{display:grid;gap:var(--space-md);grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr));margin-top:var(--space-md);margin-bottom:var(--space-lg)}
html:not(#_) .ag-it-secs:empty{display:none}
html:not(#_) .ag-it-h{display:flex;align-items:center;gap:8px;margin:0 0 8px;font-size:var(--fs-lg)}
html:not(#_) .ag-it-h svg{width:20px;height:20px;color:var(--color-primary)}
html:not(#_) .ag-it-sec .item-specs{margin:0}
html:not(#_) .ag-it-sec .info-row .k{min-width:110px}
html:not(#_) .ag-it-sec .info-row .v{unicode-bidi:plaintext}
html:not(#_) .ag-it-tags{gap:6px;margin-bottom:12px}
html:not(#_) .ag-gal-track{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;border-radius:16px;scrollbar-width:none;overscroll-behavior-x:contain}
html:not(#_) .ag-gal-track::-webkit-scrollbar{display:none}
html:not(#_) .ag-gal-track:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}
html:not(#_) .ag-gal-slide{flex:0 0 100%;margin:0;scroll-snap-align:start}
html:not(#_) .ag-gal-thumbs{display:flex;gap:8px;margin-top:10px;overflow-x:auto;scrollbar-width:none}
html:not(#_) .ag-gal-thumb{flex:none;width:60px;height:60px;padding:0;border-radius:10px;overflow:hidden;border:2px solid transparent;background:var(--color-muted);cursor:pointer;opacity:.72}
html:not(#_) .ag-gal-thumb.is-on{border-color:var(--color-primary);opacity:1}
html:not(#_) .ag-gal-thumb img{display:block;width:100%;height:100%;object-fit:cover}
html:not(#_) .item-detail-price{font-size:20px!important;font-weight:800;color:var(--color-primary)}
html:not(#_) .item-detail-price s{font-weight:500}
html:not(#_) .ag-it-offer{width:100%;margin-top:10px}
html:not(#_) .catalog-haggle-card[hidden]{display:none!important}
html:not(#_) .ag-feat-lock{margin:-6px 0 12px!important;display:flex;gap:6px;align-items:center;flex-wrap:wrap}
html:not(#_) .ag-feat-lock svg{width:15px;height:15px}
html:not(#_) .switch:has(input:disabled){opacity:.55;cursor:not-allowed}
html:not(#_) .media-badges .badge-off{background:#b42318!important;color:#fff!important}

/* ===================== v5 (admin panel, m20) ===================== */
/* off switches were gold (the border colour) and read as «on»; off is now plain grey, on stays green */
html:not(#_) .switch input:not(:checked)+.track{background:#c5c9ce!important}
html[data-theme=dark]:not(#_) .switch input:not(:checked)+.track,html[data-theme=night]:not(#_) .switch input:not(:checked)+.track,html[data-theme=luxury]:not(#_) .switch input:not(:checked)+.track{background:#4b4f55!important}
html:not(#_) .switch input:disabled+.track{opacity:.55}
/* one switch per row in the business editor (two shared a row, so a label sat next to the wrong switch) */
html:not(#_) .business-editor-section .switch{display:flex!important;width:100%;align-items:center;gap:10px}

/* ===================== v6 (admin panel, m21) ===================== */
/* sidebar: v608 painted the menu box light (--dg-wash) under light (#f0eee5) labels -> labels invisible */
html body.page-panel .panel-side .panel-nav{background:transparent!important;border-color:transparent!important}
/* confirm / alert box: its styles lived only in perf-bundle (not loaded on panel pages) -> bare browser dialog */
dialog.dg-modal-dialog{padding:0;border:0;background:transparent;max-width:min(440px,calc(100vw - 32px));width:100%;margin:auto;overflow:visible;color:inherit}
dialog.dg-modal-dialog::backdrop{background:rgba(10,24,18,.56);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}
.dg-modal-card{background:var(--color-card,#fdfbf6);color:var(--color-foreground,#14221c);border:1px solid rgba(216,181,102,.42);border-radius:20px;padding:20px 22px;box-shadow:0 24px 60px -20px rgba(8,22,16,.45);animation:agModalIn .18s ease-out;text-align:start}
html[data-theme="dark"] .dg-modal-card{background:#12211b;color:#f4efe3;border-color:rgba(216,181,102,.34)}
.dg-modal-head{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.dg-modal-mark{width:30px;height:30px;border-radius:10px;display:grid;place-items:center;background:color-mix(in oklab,var(--color-primary,#0f4c3a) 14%,transparent);color:var(--color-primary,#0f4c3a);font-size:.95rem;flex-shrink:0}
html[data-theme="dark"] .dg-modal-mark{color:#e3be6f;background:rgba(216,181,102,.16)}
.dg-modal-title{margin:0;font-size:1.02rem;font-weight:800;flex:1 1 auto}
.dg-modal-x{width:30px;height:30px;border-radius:9px;border:0;background:transparent;color:var(--color-muted-foreground);font-size:.95rem;cursor:pointer;flex-shrink:0}
.dg-modal-x:hover{background:color-mix(in oklab,var(--color-foreground) 8%,transparent);color:var(--color-foreground)}
.dg-modal-msg{margin:0 0 18px;font-size:.91rem;line-height:1.75;color:var(--color-muted-foreground)}
.dg-modal-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.dg-modal-btn{min-height:38px;padding-inline:16px!important;border-radius:11px!important}
@keyframes agModalIn{from{opacity:0;transform:translateY(8px) scale(.97)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.dg-modal-card{animation:none}}
/* phone business cards: status buttons get a visible word (desktop table stays icon-only) */
.ag-act-txt{display:none}
html body .panel-biz-actions .ag-act-txt{display:inline;font-size:13px;font-weight:700}
html body .panel-biz-actions .btn-icon:has(.ag-act-txt){display:inline-flex!important;flex-direction:row!important;align-items:center!important;justify-content:center!important;width:auto!important;min-width:44px;height:40px!important;padding-inline:12px!important;gap:6px!important;white-space:nowrap}
