/* ============================================================================
   DT²⁵⁶ DESIGN SYSTEM LAYER — v2.05 (2026-08-12)
   Purely additive stylesheet, loaded LAST so it can refine earlier sheets.
   It never changes behaviour: every selector targets presentation only, uses
   the existing theme variables (light + dark both keep working), and degrades
   gracefully in older browsers (color-mix guarded by @supports).
   ========================================================================== */

/* ---- 1. TYPOGRAPHY TOKENS — one unified sans-serif hierarchy ------------- */
:root{
  --dt-font:'Segoe UI',system-ui,-apple-system,'Helvetica Neue',Arial,sans-serif;
  --dt-h1-size:22px;   --dt-h1-weight:900; --dt-h1-lh:1.25;
  --dt-h2-size:16px;   --dt-h2-weight:800; --dt-h2-lh:1.3;
  --dt-h3-size:14px;   --dt-h3-weight:800; --dt-h3-lh:1.35;
  --dt-body-size:13.5px; --dt-body-weight:500; --dt-body-lh:1.55;
  --dt-meta-size:11.5px; --dt-meta-weight:600;
  --dt-caption-size:10.5px; --dt-caption-weight:600;
  --dt-btn-size:13px;  --dt-btn-weight:700;
  --dt-radius-sm:10px; --dt-radius:14px; --dt-radius-lg:18px;
  --dt-touch:44px;
}
@media(min-width:1024px){
  :root{ --dt-h1-size:26px; --dt-h2-size:18px; --dt-body-size:14px; }
}
body{ font-family:var(--dt-font); text-rendering:optimizeLegibility; -webkit-font-smoothing:antialiased; }
/* headings used across pages (.sh h3 = section heading pattern) */
.sh h3{ font-size:var(--dt-h2-size); font-weight:var(--dt-h2-weight); line-height:var(--dt-h2-lh); letter-spacing:-0.01em; }
button, input, select, textarea{ font-family:inherit; }

/* consistent focus visibility for every redesigned interactive control */
.dt-filter-btn:focus-visible, .dt-ip-cell:focus-visible, .dt-ip-close:focus-visible,
.cat:focus-visible, .snav-item:focus-visible{
  outline:2px solid var(--cyan); outline-offset:2px; border-radius:var(--dt-radius-sm);
}

/* ---- 2. CATEGORY ICON TILES — one source of truth ------------------------ */
/* renderCatIcon() is the single renderer used by the homepage tabs, the
   mobile category selector, the Admin category list, the edit preview and the
   Choose-Icon picker. Styling its .dt-fa-icon wrapper here upgrades ALL of
   those surfaces at once — no per-surface duplication, and old emoji-backed
   database rows keep working because the renderer itself is unchanged. */
.cat .dt-fa-icon,
.dt-mobile-cat-option .dt-fa-icon,
.dt-mobile-cat-current-icon .dt-fa-icon,
.dt-ip-cell .dt-fa-icon,
.dt-ip-cur .dt-fa-icon{
  border-radius:32%;
  background:rgba(var(--cyan-rgb),0.10);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.35), 0 1px 3px rgba(20,60,120,0.10);
  transition:transform .16s ease, box-shadow .16s ease;
}
@supports (background:color-mix(in srgb,red 10%,transparent)){
  .cat .dt-fa-icon,
  .dt-mobile-cat-option .dt-fa-icon,
  .dt-mobile-cat-current-icon .dt-fa-icon,
  .dt-ip-cell .dt-fa-icon,
  .dt-ip-cur .dt-fa-icon{
    background:color-mix(in srgb, var(--dt-icon-color, var(--cyan)) 14%, transparent);
  }
}
.cat:hover .dt-fa-icon{ transform:translateY(-1px) scale(1.04); }
.cat.active .dt-fa-icon{ box-shadow:inset 0 1px 0 rgba(255,255,255,0.4), 0 0 0 2px color-mix(in srgb, var(--dt-icon-color, var(--cyan)) 35%, transparent); }

/* ---- 3. HOMEPAGE CATEGORY TABS ------------------------------------------- */
.cats{ margin-bottom:20px; }
.cat{
  min-height:84px;
  gap:6px;
  padding:12px 6px 10px;
  border-radius:var(--dt-radius);
  -webkit-tap-highlight-color:transparent;
}
.cat:active{ transform:scale(.97); }
.cat .cl{ font-size:11.5px; font-weight:700; letter-spacing:.01em; }
.cat.active{ position:relative; }
.cat.active:after{
  content:''; position:absolute; left:50%; bottom:6px; transform:translateX(-50%);
  width:22px; height:3px; border-radius:3px; background:var(--cyan);
}
@media(prefers-reduced-motion:reduce){ .cat, .cat .dt-fa-icon{ transition:none; } .cat:active{ transform:none; } }

/* ---- 4. FILTERS BUTTON ---------------------------------------------------- */
.dt-filter-btn{
  display:inline-flex; align-items:center; gap:6px;
  background:var(--card); border:1px solid var(--cardb);
  border-radius:20px; color:var(--cyan); cursor:pointer;
  padding:7px 14px; min-height:32px;
  font-weight:var(--dt-btn-weight); font-size:12px; font-family:inherit;
  box-shadow:0 1px 4px rgba(20,60,120,0.06);
  transition:box-shadow .15s ease, transform .12s ease, background .15s ease;
  -webkit-tap-highlight-color:transparent;
}
.dt-filter-btn svg{ display:block; }
.dt-filter-btn:hover{ box-shadow:0 3px 10px rgba(20,60,120,0.12); }
.dt-filter-btn:active{ transform:scale(.96); }
.dt-filter-btn.on{ background:var(--cyan); border-color:var(--cyan); color:#fff; }
.dt-filter-count{
  background:rgba(255,255,255,0.9); color:var(--cyan);
  font-size:10.5px; font-weight:900; border-radius:9px; padding:1px 6px; font-style:normal;
}
.dt-filter-btn:not(.on) .dt-filter-count{ background:var(--cbg); color:var(--cyan); }

/* ---- 5. HOMEPAGE BENEFIT CARDS ------------------------------------------- */
.dt-fcard svg{ flex-shrink:0; filter:drop-shadow(0 2px 4px rgba(20,60,120,0.18)); }

/* ---- 6. PROFILE MENU ROWS ------------------------------------------------- */
/* the 38px pastel tile stays (it comes from the menu data); the 3D icon sits
   inside it, so light and dark themes both read correctly */
.card > div[onclick] > div:first-child svg{ filter:drop-shadow(0 2px 4px rgba(20,60,120,0.20)); }

/* ---- 7. SIDE DRAWER ICON TILES ------------------------------------------- */
.snav-ico.dt-snav-3d{ background:transparent !important; box-shadow:none; }
.snav-ico.dt-snav-3d svg{ filter:drop-shadow(0 2px 4px rgba(20,60,120,0.22)); }
.snav-item:hover .snav-ico.dt-snav-3d{ box-shadow:none; transform:translateY(-1px); }

/* ---- 8. ADMIN "CHOOSE CATEGORY ICON" PICKER ------------------------------- */
.dt-ip-scrim{ position:fixed; inset:0; background:rgba(3,10,22,.55); z-index:99990; backdrop-filter:blur(2px); }
.dt-ip-panel{
  position:fixed; left:50%; top:50%; transform:translate(-50%,-50%); z-index:99991;
  width:460px; max-width:calc(100vw - 20px); max-height:82vh;
  display:flex; flex-direction:column;
  background:var(--card); border:1px solid var(--border);
  border-radius:20px; padding:16px; box-shadow:var(--shadow-lg);
}
.dt-ip-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:11px; }
.dt-ip-titlewrap{ display:flex; align-items:center; gap:10px; min-width:0; }
.dt-ip-cur{ flex-shrink:0; display:inline-flex; align-items:center; justify-content:center; width:40px; height:40px; border-radius:12px; background:var(--bg3); border:1px solid var(--cardb); }
.dt-ip-titles{ display:flex; flex-direction:column; min-width:0; }
.dt-ip-h1{ font-size:15px; font-weight:900; line-height:1.25; }
.dt-ip-sub{ font-size:10.5px; color:var(--muted); line-height:1.4; margin-top:2px; }
.dt-ip-close{
  flex-shrink:0; width:32px; height:32px; border-radius:10px;
  background:var(--bg3); border:1px solid var(--cardb); color:var(--muted);
  font-size:15px; cursor:pointer; display:flex; align-items:center; justify-content:center;
}
.dt-ip-close:hover{ color:var(--text); }
.dt-ip-search{
  display:flex; align-items:center; gap:8px;
  background:var(--bg3); border:1px solid var(--cardb); border-radius:11px;
  padding:0 12px; margin-bottom:8px; color:var(--muted);
}
.dt-ip-search svg{ flex-shrink:0; }
.dt-ip-search input{
  flex:1; background:none; border:none; outline:none; color:var(--text);
  font-size:13px; font-family:inherit; padding:11px 0; min-width:0;
}
.dt-ip-body{ overflow-y:auto; -webkit-overflow-scrolling:touch; flex:1; padding-right:2px; }
.dt-ip-group{ font-size:10px; font-weight:800; color:var(--muted); letter-spacing:1px; text-transform:uppercase; margin:11px 0 7px; }
.dt-ip-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(52px,1fr)); gap:7px; }
.dt-ip-cell{
  display:flex; align-items:center; justify-content:center;
  min-height:50px; padding:6px 0; border-radius:13px; cursor:pointer; font-family:inherit;
  border:1.5px solid var(--cardb); background:var(--bg3);
  transition:transform .12s ease, border-color .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color:transparent;
}
.dt-ip-cell:hover{ border-color:var(--cyan); transform:translateY(-1px); }
.dt-ip-cell:active{ transform:scale(.94); }
.dt-ip-cell.on{
  border-color:var(--cyan);
  box-shadow:0 0 0 2px rgba(var(--cyan-rgb),0.25);
  background:rgba(var(--cyan-rgb),0.08);
}
.dt-ip-empty{ font-size:12px; color:var(--muted); padding:18px; text-align:center; line-height:1.6; }
@media(max-width:520px){
  .dt-ip-panel{ left:10px; right:10px; top:auto; bottom:10px; transform:none; width:auto; max-height:78vh; border-radius:18px; }
  .dt-ip-grid{ grid-template-columns:repeat(auto-fill,minmax(48px,1fr)); }
  .dt-ip-cell{ min-height:46px; }
}
@media(prefers-reduced-motion:reduce){
  .dt-ip-cell, .dt-filter-btn{ transition:none; }
  .dt-ip-cell:active, .dt-filter-btn:active{ transform:none; }
}

/* ---- 9. WALLET & PROFILE POLISH ------------------------------------------ */
/* light consistency touches only — layout and logic untouched */
.wal-top > div, .wal-split > div{ border-radius:var(--dt-radius-lg); }
.card{ border-radius:var(--dt-radius); }
.card.card-p{ padding:15px; }

/* ---- 10. SHARED BUTTON HEIGHT / TOUCH TARGETS ---------------------------- */
.fbtn{ min-height:var(--dt-touch); }
.fbtn-ghost{ min-height:40px; }

/* ═══ v2.06c (2026-08-13) POPULAR CATEGORIES — refined mini category cards ═══════════════
   Card chrome for the upgraded homepage strip (markup in chunk-03). Theme-variable surfaces
   so light AND dark mode adapt; the styles-05 dark-contrast overrides for
   .dt-popular-name/.dt-popular-count continue to apply unchanged. Uniform card geometry at
   every width (§11); horizontal swipe behaviour itself is untouched (.dt-hscroll). */
.dt-popular-card{
  flex:0 0 auto;width:96px;background:var(--card);border:1px solid var(--cardb);
  border-radius:16px;padding:12px 8px 11px;text-align:center;cursor:pointer;
  box-shadow:0 2px 8px rgba(20,80,140,0.06);
  transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease;
}
@media (hover:hover){
  .dt-popular-card:hover{transform:translateY(-2px);box-shadow:0 8px 20px rgba(20,80,140,0.12);border-color:var(--cb)}
  .dt-popular-card:hover .dt-popular-tile{transform:translateY(-1px)}
}
.dt-popular-card:active{transform:scale(.97)}
.dt-popular-card:focus-visible{outline:2px solid var(--cyan);outline-offset:2px}
.dt-popular-tile{
  width:54px;height:54px;border-radius:15px;margin:0 auto;
  display:flex;align-items:center;justify-content:center;transition:transform .16s ease;
}
.dt-popular-tile svg{display:block}
.dt-popular-name{font-size:12px;font-weight:800;color:var(--text);margin-top:7px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dt-popular-count{font-size:10px;color:var(--muted);margin-top:1px}
@media (max-width:430px){
  .dt-popular-card{width:88px;padding:10px 6px 10px}
  .dt-popular-tile{width:50px;height:50px;border-radius:14px}
}
@media (min-width:768px){ .dt-popular-card{width:104px} }
@media (min-width:1024px){ .dt-popular-card{width:110px;padding:14px 10px 12px} .dt-popular-tile{width:58px;height:58px} }
@media (prefers-reduced-motion:reduce){
  .dt-popular-card,.dt-popular-card:hover,.dt-popular-card:active,.dt-popular-tile{transform:none;transition:none}
}
