/* ===================================================================================================
   REDESIGN: header, menu, Home cards, weather, bottom tab bar. Loads after theme.css.
   Artwork is inline SVG (no extra downloads). Colours come from the theme tokens.
   =================================================================================================== */
:root{
  --art-leaf-w:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 300'%3E%3Cg fill='white' fill-opacity='.07'%3E%3Cpath d='M150 20C230 40 270 110 255 200C170 190 120 120 150 20Z'/%3E%3Cpath d='M60 90C120 80 190 130 200 215C130 225 70 180 60 90Z' transform='rotate(-18 130 150)'/%3E%3Cpath d='M210 120C262 135 290 190 275 255C225 250 195 205 210 120Z'/%3E%3C/g%3E%3Cpath d='M150 22C175 80 205 130 250 198' stroke='white' stroke-opacity='.06' stroke-width='3' fill='none'/%3E%3C/svg%3E"); --art-leaf-g:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 300'%3E%3Cg fill='%232E7D32' fill-opacity='.10'%3E%3Cpath d='M150 20C230 40 270 110 255 200C170 190 120 120 150 20Z'/%3E%3Cpath d='M60 90C120 80 190 130 200 215C130 225 70 180 60 90Z' transform='rotate(-18 130 150)'/%3E%3Cpath d='M210 120C262 135 290 190 275 255C225 250 195 205 210 120Z'/%3E%3C/g%3E%3Cpath d='M150 22C175 80 205 130 250 198' stroke='%232E7D32' stroke-opacity='.08' stroke-width='3' fill='none'/%3E%3C/svg%3E"); --art-wave:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 120' preserveAspectRatio='none'%3E%3Cpath d='M0 70C80 30 150 90 230 60S340 30 400 55V120H0Z' fill='%2326A241' fill-opacity='.30'/%3E%3Cpath d='M0 92C90 62 170 112 250 86S350 72 400 92V120H0Z' fill='%231F8A38' fill-opacity='.42'/%3E%3C/svg%3E"); --art-maize:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 300'%3E%3Cdefs%3E%3ClinearGradient id='c' x1='0' x2='1'%3E%3Cstop offset='0' stop-color='%23FFD83A'/%3E%3Cstop offset='1' stop-color='%23F2A81A'/%3E%3C/linearGradient%3E%3Cpattern id='k' width='14' height='14' patternUnits='userSpaceOnUse'%3E%3Cellipse cx='7' cy='7' rx='5.2' ry='5.6' fill='%23FFE36B' stroke='%23D99A12' stroke-width='1'/%3E%3C/pattern%3E%3C/defs%3E%3Cg transform='rotate(24 110 150)'%3E%3Crect x='62' y='30' width='96' height='210' rx='46' fill='url(%23c)'/%3E%3Crect x='62' y='30' width='96' height='210' rx='46' fill='url(%23k)'/%3E%3Cpath d='M110 250C40 210 20 120 70 60C60 140 85 200 110 250Z' fill='%234F9A2E'/%3E%3Cpath d='M110 250C180 215 205 130 150 68C165 140 140 205 110 250Z' fill='%236DB83A'/%3E%3C/g%3E%3Cpath d='M0 300C70 232 160 218 220 242V300Z' fill='%233E8E2B'/%3E%3C/svg%3E"); --art-scene:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 420' preserveAspectRatio='xMidYMid slice'%3E%3Cdefs%3E%3ClinearGradient id='s' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%231747B8'/%3E%3Cstop offset='.6' stop-color='%232F7BE2'/%3E%3Cstop offset='1' stop-color='%2378B6F2'/%3E%3C/linearGradient%3E%3ClinearGradient id='f' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%236DB33F'/%3E%3Cstop offset='1' stop-color='%232B6A1D'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='800' height='420' fill='url(%23s)'/%3E%3Cg fill='white'%3E%3Cg fill-opacity='.9'%3E%3Cellipse cx='560' cy='250' rx='120' ry='34'/%3E%3Cellipse cx='620' cy='225' rx='80' ry='36'/%3E%3Cellipse cx='500' cy='235' rx='70' ry='28'/%3E%3C/g%3E%3Cg fill-opacity='.55'%3E%3Cellipse cx='300' cy='290' rx='140' ry='26'/%3E%3Cellipse cx='700' cy='140' rx='90' ry='22'/%3E%3Cellipse cx='120' cy='200' rx='80' ry='18'/%3E%3C/g%3E%3C/g%3E%3Cpath d='M0 300C120 288 220 296 330 290S560 282 800 296V420H0Z' fill='url(%23f)'/%3E%3Cg fill='%232D5E24'%3E%3Cellipse cx='690' cy='292' rx='34' ry='22'/%3E%3Cellipse cx='735' cy='296' rx='30' ry='20'/%3E%3Cellipse cx='655' cy='297' rx='24' ry='16'/%3E%3C/g%3E%3Cpath d='M0 312C200 300 420 318 800 306V420H0Z' fill='%234E9A2E' fill-opacity='.8'/%3E%3C/svg%3E");
  --hdr-grad:linear-gradient(135deg,#0F4B25 0%,#0A361A 58%,#072A14 100%);
  --drawer-grad:linear-gradient(180deg,#0C4522 0%,#08301A 58%,#052212 100%);
  --brand-light:#7FE06D;
  --hdr-glass:rgba(255,255,255,.10); --hdr-glass-line:rgba(255,255,255,.18);
}
:root[data-theme="dark"]{
  --hdr-grad:linear-gradient(135deg,#0B2E19 0%,#08210F 58%,#06180C 100%);
  --drawer-grad:linear-gradient(180deg,#0A2916 0%,#07190E 58%,#050F09 100%);
}

/* ---------- header ---------- */
#header{background:var(--art-leaf-w) right -26px center/auto 150% no-repeat,var(--hdr-grad);border-bottom:0;box-shadow:0 8px 22px rgba(0,0,0,.22);z-index:20}
#header .hdr-left{gap:10px;min-width:0}
#header .logo-wrap{position:static;transform:none;display:flex!important;align-items:center;gap:10px;min-width:0;max-width:none;padding:0;border:0;pointer-events:auto}
#header .logo-wrap>div:not(.logo-mark){display:block;min-width:0}
.logo-mark{width:46px;height:46px;flex:none}
.logo-text{font-size:26px;font-weight:800;color:#fff;line-height:1;letter-spacing:-.01em;white-space:nowrap}
.logo-text b,.drawer-brand b{color:var(--brand-light);font-weight:800}
#header .logo-sub{font-size:11.5px;color:rgba(255,255,255,.9);letter-spacing:.02em;margin-top:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:62vw}
#header .hdr-icon-btn{width:44px;height:44px;border-radius:14px;background:var(--hdr-glass);border:1px solid var(--hdr-glass-line);color:#fff;position:relative}
#header .hdr-badge{position:absolute;top:-5px;right:-5px;min-width:20px;height:20px;border-radius:10px;background:#E53935;color:#fff;font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:center;padding:0 5px;border:2px solid #0A361A}
#header .header-right{display:flex;align-items:center;gap:10px}
.hdr-profile-btn{display:none!important}
#back-btn{width:40px;height:40px;border-radius:12px;margin-right:0}
@media (max-width:768px){
  :root{--hdr-base:76px}
  #header{padding-left:14px;padding-right:14px}
  #header .hdr-msg-btn,#header .hdr-profile-btn{display:none!important}
  #header .hdr-menu-btn{display:flex!important}
}
@media (max-width:360px){#header .logo-sub{font-size:10.5px}.logo-text{font-size:22px}.logo-mark{width:40px;height:40px}#header .hdr-icon-btn{width:40px;height:40px}}

/* ---------- menu (drawer) ---------- */
#mobile-drawer{background:var(--art-leaf-w) right -60px top 10px/260px no-repeat,var(--drawer-grad)}
.drawer-hdr{padding:calc(env(safe-area-inset-top,0px) + 18px) 18px 16px;gap:12px;border-bottom:1px solid var(--chrome-line)}
.drawer-logo{width:56px;height:56px}
.drawer-brand{font-size:28px;font-weight:800;color:#fff;line-height:1;letter-spacing:-.01em}
.drawer-sub{font-size:12px;letter-spacing:.2em;text-transform:uppercase;color:rgba(255,255,255,.88);margin-top:6px}
.drawer-close{width:44px;height:44px;border-radius:50%;background:transparent;border:1px solid rgba(255,255,255,.4);color:#fff}
.drawer-profile{border-radius:18px;padding:14px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.16);backdrop-filter:blur(6px)}
.drawer-ava{width:56px;height:56px;border-radius:16px;background:linear-gradient(135deg,#3FA84A,#2A7E36);color:#fff}
.drawer-name{font-size:18px;font-weight:700;color:#fff}.drawer-meta{font-size:14px;color:rgba(255,255,255,.88)}
.drawer-section-label{display:flex;align-items:center;gap:12px;font-size:13px;font-weight:800;letter-spacing:.16em;text-transform:uppercase;color:#7FE06D}
.drawer-section-label::after{content:"";flex:1;height:1px;background:rgba(127,224,109,.45)}
.drawer-tiles{gap:10px}
.drawer-tile{position:relative;min-height:92px;border-radius:16px;padding:12px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.16);display:flex;flex-direction:column;align-items:flex-start;justify-content:space-between;text-align:left}
.drawer-tile::after{content:"";position:absolute;right:10px;top:26px;width:16px;height:16px;background:rgba(255,255,255,.85);-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat}
.drawer-tile-ico{width:40px;height:40px;border-radius:50%;background:rgba(76,175,80,.32);display:flex;align-items:center;justify-content:center;color:#CFF5C9}
.drawer-tile-lbl{font-size:15px;font-weight:700;color:#fff}
.drawer-nav-item{position:relative;display:flex;align-items:center;gap:14px;padding:14px 12px;margin:0 0 2px;border-radius:14px;color:#fff;font-size:16px;font-weight:600;border-bottom:1px solid rgba(255,255,255,.1)}
.drawer-nav-item::after{content:"";margin-left:auto;width:16px;height:16px;background:rgba(255,255,255,.85);-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat}
.drawer-nav-item:first-of-type,.drawer-nav-item.active{background:rgba(255,255,255,.09);border-color:transparent}
.drawer-foot{position:relative;margin-top:auto;padding:20px 18px calc(30px + env(safe-area-inset-bottom,0px));text-align:center;font-size:14px;color:rgba(255,255,255,.9);background:var(--art-wave) bottom/100% 90px no-repeat;border-top:1px solid var(--chrome-line)}
.df-leaf{display:flex;align-items:center;justify-content:center;gap:12px;margin-bottom:10px;color:#7FE06D}.df-leaf i{flex:0 1 70px;height:1px;background:rgba(127,224,109,.6)}.df-leaf svg{width:20px;height:20px}
/* Dark mode switch in the menu */
.drawer-theme{padding:6px 16px 4px;gap:6px}
.dt-row{display:flex;align-items:center;gap:12px;color:#fff;font-size:16px;font-weight:600}.dt-ico{display:flex;color:#fff}.dt-ico svg{width:24px;height:24px}.dt-lbl{flex:1}
.dt-switch{position:relative;width:54px;height:32px;border-radius:16px;border:0;background:rgba(255,255,255,.28);cursor:pointer;transition:background .2s;flex:none}
.dt-switch i{position:absolute;top:3px;left:3px;width:26px;height:26px;border-radius:50%;background:#fff;box-shadow:0 2px 6px rgba(0,0,0,.35);transition:transform .2s}
.dt-switch[aria-checked="true"]{background:#4CAF50}.dt-switch[aria-checked="true"] i{transform:translateX(22px)}
.dt-switch:focus-visible{outline:2px solid #7FE06D;outline-offset:3px}
.dt-auto{display:flex;align-items:center;gap:8px;margin-left:36px;font-size:13px;color:rgba(255,255,255,.85)}.dt-auto input{width:18px;height:18px;accent-color:#4CAF50}

/* ---------- page header (Know and the other pages) ---------- */
.page-hdr-icon{border-radius:14px;width:48px;height:48px}
.page-hdr-h2{font-size:28px;font-weight:800;color:var(--text-primary)}
@media (max-width:768px){
  .page-hdr{flex-wrap:wrap;gap:12px}
  .page-hdr-body p{display:none}
  .page-hdr-actions{width:100%;display:grid;grid-template-columns:1fr 1.05fr;gap:10px}
  .page-hdr-actions .btn{min-height:48px;border-radius:12px;font-size:15px;font-weight:700;justify-content:center}
}
.btn-sync{justify-content:space-between!important;background:var(--surface);color:var(--text-primary);border:1.5px solid var(--border)}
.btn-sync svg:last-child{opacity:.8}
.btn-library{background:linear-gradient(180deg,#2E9A3A,#1F7A2B);color:#fff;border:0;box-shadow:0 4px 12px rgba(31,122,43,.35)}

/* ---------- Daily Farm Brief card ---------- */
.fb-teaser{position:relative;overflow:hidden;background:var(--art-leaf-g) right -30px bottom -40px/180px no-repeat,linear-gradient(135deg,#EEF9EE,#DDF1DD);border:1px solid #BFE3BF;border-radius:20px}
.fb-teaser-ico{background:#fff;border-radius:16px;color:#2E7D32}
.fb-teaser-txt strong{color:#14532D;font-size:19px}
:root[data-theme="dark"] .fb-teaser{background:var(--art-leaf-w) right -30px bottom -40px/180px no-repeat,linear-gradient(135deg,#12261A,#0E1D14);border-color:#2A4A33}
:root[data-theme="dark"] .fb-teaser-ico{background:#1B3324;color:#86EFAC}
:root[data-theme="dark"] .fb-teaser-txt strong{color:#E7F5EA}

/* ---------- sponsored card ---------- */
.mn-sponsor{position:relative;overflow:hidden;align-items:flex-start;border-radius:20px;padding:18px 150px 18px 16px;background:var(--art-maize) right bottom/150px auto no-repeat,linear-gradient(135deg,#FFF7DB,#FDEFC2);border:1px solid #EED9A0;color:#3A2A07;display:block}
.mn-sponsor-tag{position:absolute;top:0;left:14px;display:flex;align-items:center;gap:6px;background:#B8741A;color:#fff;border-radius:0 0 12px 12px;padding:6px 12px;font-size:12px;font-weight:800;letter-spacing:.1em;text-transform:uppercase}
.mn-sponsor-tag svg{width:12px;height:12px}
.mn-sp-head{display:flex;align-items:center;gap:10px;margin:18px 0 8px;color:#14532D}.mn-sp-head b{font-size:19px}
.mn-sp-ico{width:42px;height:42px;border-radius:12px;background:rgba(255,255,255,.7);display:flex;align-items:center;justify-content:center;color:#2E7D32}
.mn-sponsor-h{font-size:18px;font-weight:800;color:#14532D;margin-bottom:6px}
.mn-sponsor p{font-size:14px;color:#4A3A12;margin-bottom:12px}
.mn-sponsor .btn{background:#fff;border:1.5px solid #2E7D32;color:#14532D;border-radius:12px;font-weight:700}
:root[data-theme="dark"] .mn-sponsor{background:var(--art-maize) right bottom/150px auto no-repeat,linear-gradient(135deg,#2E2812,#241F0E);border-color:#5A4A1C;color:#F3E7C4}
:root[data-theme="dark"] .mn-sp-head,:root[data-theme="dark"] .mn-sponsor-h{color:#E9F7E4}:root[data-theme="dark"] .mn-sponsor p{color:#E8DDBA}
:root[data-theme="dark"] .mn-sponsor .btn{background:rgba(255,255,255,.08);color:#F1F6F2;border-color:#86EFAC}
@media (max-width:420px){.mn-sponsor{padding-right:118px;background-size:120px auto}}

/* ---------- weather ---------- */
.wx-card{position:relative;overflow:hidden;border-radius:22px;color:#fff;background:var(--art-scene) center/cover no-repeat;box-shadow:0 10px 26px rgba(23,71,184,.28)}
.wx-top{display:flex;justify-content:space-between;align-items:flex-start;padding:20px 20px 74px}
.wx-temp{font-size:58px;font-weight:800;line-height:1;letter-spacing:-.02em;text-shadow:0 2px 12px rgba(0,0,0,.25)}
.wx-line{display:flex;align-items:center;gap:8px;margin-top:10px;font-size:17px;font-weight:600;text-shadow:0 1px 8px rgba(0,0,0,.25)}.wx-line svg{width:18px;height:18px;flex:none}.wx-date{font-size:15px;font-weight:500;opacity:.92;margin-top:8px}
.wx-ico{width:84px;height:84px;color:#fff;filter:drop-shadow(0 4px 12px rgba(0,0,0,.25))}.wx-ico svg{width:100%;height:100%}
.wx-stats{display:grid;grid-template-columns:repeat(4,1fr);background:rgba(8,32,20,.62);backdrop-filter:blur(8px);margin:0 8px 8px;border-radius:16px;padding:12px 4px}
.wx-stats>div{display:flex;flex-direction:column;align-items:center;gap:2px;border-left:1px solid rgba(255,255,255,.18);padding:0 4px}.wx-stats>div:first-child{border-left:0}
.wx-v{display:flex;align-items:center;gap:6px;font-size:20px;font-weight:700}.wx-v small{font-size:13px;font-weight:500;opacity:.9}.wx-v svg{width:20px;height:20px;opacity:.95}
.wx-l{font-size:12px;opacity:.9}
.wx-off{padding:22px;text-align:center;font-size:15px}.wx-off button{margin-top:10px}
@media (max-width:380px){.wx-temp{font-size:48px}.wx-v{font-size:17px}.wx-v svg{display:none}.wx-ico{width:68px;height:68px}}

/* ---------- bottom tab bar (phones) ---------- */
#bottom-nav{display:none}
@media (max-width:768px){
  #bottom-nav{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:150;background:var(--surface);border-top:1px solid var(--border);box-shadow:0 -8px 24px rgba(0,0,0,.08);padding:8px 10px calc(8px + env(safe-area-inset-bottom,0px))}
  #main{padding-bottom:calc(92px + env(safe-area-inset-bottom,0px))!important}
}
.bn-tab{flex:1;display:flex;flex-direction:column;align-items:center;gap:4px;background:none;border:0;color:var(--text-secondary);font-size:14px;font-weight:600;cursor:pointer;padding:0;position:relative;font-family:inherit}
.bn-pill{position:relative;width:68px;height:36px;border-radius:18px;display:flex;align-items:center;justify-content:center;transition:background .2s}.bn-pill svg{width:26px;height:26px}
.bn-tab.active{color:#1F6B2A;font-weight:700}.bn-tab.active .bn-pill{background:#DDF3DC}
:root[data-theme="dark"] .bn-tab.active{color:#86EFAC}:root[data-theme="dark"] .bn-tab.active .bn-pill{background:rgba(134,239,172,.16)}
.bn-tab [data-chat-badge]{position:absolute;top:-6px;right:2px;min-width:20px;height:20px;border-radius:10px;background:#E53935;color:#fff;font-size:12px;font-weight:700;align-items:center;justify-content:center;padding:0 5px;display:none}
.bn-tab [data-chat-badge].show,.bn-tab [data-chat-badge][style*="inline"],.bn-tab [data-chat-badge][style*="flex"]{display:flex!important}
.bn-tab:focus-visible{outline:2px solid #2E7D32;outline-offset:2px;border-radius:12px}
/* language sheet */

/* ---------- fixes found in review on a 390px phone ---------- */
#header .logo-text,#header .logo-sub{display:block!important}
#header .logo-wrap{width:auto;min-width:0!important;max-width:none!important;flex:1 1 auto}
#header .hdr-left{flex:1 1 auto;min-width:0}
#header .logo-wrap>div:not(.logo-mark){flex:1 1 auto;min-width:0;overflow:hidden}
/* weather stats: icon above value so four columns always fit */
.wx-stats{grid-template-columns:repeat(4,minmax(0,1fr))}
.wx-v{flex-direction:column;gap:3px;font-size:18px;white-space:nowrap}.wx-v small{font-size:12px;margin-left:2px}.wx-v svg{width:20px;height:20px;display:block!important}
.wx-l{white-space:nowrap}
/* menu tiles: three equal columns that never overflow the panel */
.drawer-tiles{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.drawer-tile{min-width:0;padding:10px 10px 12px}
.drawer-tile-lbl{font-size:14px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.drawer-tile::after{right:8px;top:22px;width:14px;height:14px}
.drawer-tile-ico{width:38px;height:38px}
/* Dark mode row: label left, switch right, like the mockup */
.drawer-theme{flex-direction:column;align-items:stretch;justify-content:flex-start;padding:10px 16px 6px}
.dt-row{width:100%}.dt-lbl{text-align:left}
#header .logo-sub{text-transform:none;font-weight:500}
#header .logo-text{text-transform:none}

.wx-n{display:inline-flex;align-items:baseline;gap:2px}
#header .logo-sub{font-size:10.5px;letter-spacing:0;max-width:none}
.drawer-tile{padding:10px 8px 12px}
.drawer-tile-lbl{font-size:13px;letter-spacing:-.01em;overflow:visible;text-overflow:clip}
.drawer-tile::after{right:7px;top:20px;width:13px;height:13px}
@media (max-width:768px){.page-hdr-actions{grid-template-columns:repeat(auto-fit,minmax(130px,1fr))}}
:root[data-theme="dark"] .page-hdr-icon{background:#1B3324!important;color:#86EFAC!important}
:root[data-theme="dark"] .btn-sync{background:rgba(255,255,255,.06);border-color:rgba(255,255,255,.22);color:#F1F6F2}

/* More sheet: hosts the footer (language, App/USSD, Help, Contact, Terms, Privacy) on phones */
#more-sheet{position:fixed;inset:0;z-index:100003;display:none;align-items:flex-end;background:rgba(0,0,0,.5)}#more-sheet.open{display:flex}
#more-sheet .ms-box{width:100%;max-height:85vh;overflow:auto;background:var(--bg-card);color:var(--text-primary);border-radius:22px 22px 0 0;padding:10px 16px calc(14px + env(safe-area-inset-bottom,0px));box-shadow:0 -10px 30px rgba(0,0,0,.35)}
#more-sheet .ms-grab{width:40px;height:4px;border-radius:2px;background:var(--border);margin:0 auto 14px}
#more-sheet #app-footer{margin:0;padding:0;border:0;background:transparent}
#more-sheet .af-settings{margin-bottom:10px}
@media (min-width:769px){#more-sheet{display:none!important}}

/* Phones: bell + profile on the left, logo centred */
@media (max-width:768px){
  #header{position:relative;justify-content:flex-start}
  #header .header-right{order:-1;gap:8px;position:relative;z-index:2}
  #header .hdr-icon-btn{width:40px;height:40px}
  #header .hdr-left{position:absolute;left:50%;top:var(--safe-top);height:var(--hdr-base);transform:translateX(calc(-50% + 14px));flex:0 0 auto!important;display:flex;align-items:center;justify-content:center;pointer-events:none}
  #header .logo-wrap{pointer-events:auto;flex:0 0 auto!important;display:grid!important;grid-template-columns:auto auto;justify-content:center;justify-items:center;align-items:center;column-gap:8px;row-gap:2px}
  #header .logo-wrap>div:not(.logo-mark){display:contents!important}
  #header .logo-mark{width:40px;height:40px;justify-self:end}
  #header .logo-text{justify-self:start;line-height:1;margin:0}
  #header .logo-sub{grid-column:1 / -1;margin:0;text-align:center;font-size:10px;max-width:none}
}
@media (max-width:400px){
  #header{padding-left:12px}
  #header .header-right{gap:6px}
  #header .hdr-icon-btn{width:36px;height:36px}
  #header .logo-wrap{column-gap:6px}
  #header .logo-mark{width:34px;height:34px}
  #header .logo-text{font-size:22px}
  #header .logo-sub{font-size:9.5px}
}

/* Menu button first, then the bell. With the back arrow showing, the logo shrinks to its icon so nothing collides. */
@media (max-width:480px){html:not(.uli-lite) #header:has(#back-btn:not([hidden])) .logo-text,html:not(.uli-lite) #header:has(#back-btn:not([hidden])) .logo-sub{display:none!important}}

/* ===== Compact phone sizing: smaller header, cards and tab bar ===== */
@media (max-width:768px){
  :root{--hdr-base:60px}
  #header{padding-left:12px;padding-right:12px}
  #header .hdr-icon-btn{width:34px;height:34px;border-radius:11px;font-size:16px}
  #header .logo-mark{width:30px;height:30px}
  #header .logo-text{font-size:20px}
  #header .logo-sub{font-size:9px}
  #header .logo-wrap{row-gap:1px}

  .page-hdr{gap:8px}
  .page-hdr-icon{width:38px;height:38px;border-radius:12px;font-size:18px}
  .page-hdr-h2{font-size:22px}
  .page-hdr-actions{gap:8px}
  .page-hdr-actions .btn{min-height:40px;border-radius:10px;font-size:14px;padding-top:0;padding-bottom:0}

  .fb-teaser{border-radius:16px}
  .fb-teaser .card-body{padding:11px 12px;gap:10px}
  .fb-teaser-ico{width:40px;height:40px;border-radius:12px}
  .fb-teaser-ico svg{width:22px;height:22px}
  .fb-teaser-txt{font-size:12.5px;line-height:1.35}
  .fb-teaser-txt strong{font-size:15.5px}

  .mn-sponsor{border-radius:16px;padding:16px 104px 12px 12px;background-size:92px auto}
  .mn-sponsor-tag{font-size:10px;padding:4px 9px;left:12px;gap:4px}
  .mn-sponsor-tag svg{width:10px;height:10px}
  .mn-sp-head{gap:8px}
  .mn-sp-head b{font-size:15px}
  .mn-sp-ico{width:30px;height:30px;border-radius:10px}
  .mn-sp-ico svg{width:16px;height:16px}
  .mn-sponsor-h{font-size:15px;margin-bottom:3px;line-height:1.3}
  .mn-sponsor p{font-size:12.5px;line-height:1.4;margin-bottom:8px}
  .mn-sponsor .btn{min-height:0;padding:6px 12px;font-size:13px;border-radius:10px}

  .wx-card{border-radius:18px;box-shadow:0 6px 18px rgba(23,71,184,.22)}
  .wx-top{padding:14px 16px 40px}
  .wx-temp{font-size:40px}
  .wx-line{font-size:14px;margin-top:6px;gap:6px}
  .wx-line svg{width:15px;height:15px}
  .wx-date{font-size:12.5px}
  .wx-ico{width:56px;height:56px}
  .wx-stats{margin:0 8px 8px;padding:8px 2px;border-radius:14px}
  .wx-v{font-size:15px;gap:2px}
  .wx-v small{font-size:11px}
  .wx-v svg{width:16px;height:16px}
  .wx-l{font-size:11px}

  #bottom-nav{padding:5px 10px calc(5px + env(safe-area-inset-bottom,0px))}
  .bn-tab{font-size:12px;gap:2px}
  .bn-pill{width:56px;height:30px;border-radius:15px}
  .bn-pill svg{width:22px;height:22px}
  #main{padding-bottom:calc(68px + env(safe-area-inset-bottom,0px))!important}
}

/* ===== Glass header: round translucent buttons, count badge, rounded content sheet rising into the header ===== */
@media (max-width:768px){
  :root{--hdr-base:74px;--hdr-tuck:16px}
  #header{padding-bottom:var(--hdr-tuck);box-shadow:none;background:var(--art-leaf-w) right -26px center/auto 150% no-repeat,radial-gradient(120% 140% at 8% 0%,rgba(255,255,255,.10) 0%,rgba(255,255,255,0) 55%),var(--hdr-grad)}
  #header::before{content:'';position:absolute;left:0;right:0;bottom:-1px;height:calc(var(--hdr-tuck) + 2px);background:var(--surface);border-radius:20px 20px 0 0;z-index:3;pointer-events:none}
  #header::after{display:none}
  #header .hdr-left{height:calc(var(--hdr-base) - var(--hdr-tuck))}
  #header .header-right{align-self:center}
  #header .logo-wrap{height:100%!important}
  #header .hdr-icon-btn{width:38px;height:38px;border-radius:50%;background:linear-gradient(145deg,rgba(255,255,255,.20),rgba(255,255,255,.06));border:1px solid rgba(255,255,255,.22);box-shadow:inset 0 1px 0 rgba(255,255,255,.28),0 4px 12px rgba(0,0,0,.22);-webkit-backdrop-filter:blur(10px) saturate(150%);backdrop-filter:blur(10px) saturate(150%)}
  #header .hdr-icon-btn:active{background:rgba(255,255,255,.26)}
  #header .hdr-badge{top:-4px;right:-4px;min-width:18px;height:18px;padding:0 5px;font-size:11px;line-height:1;box-shadow:0 0 0 2px rgba(10,54,26,.9)}
}
@media (max-width:400px){#header .hdr-icon-btn{width:36px;height:36px}}
