*{box-sizing:border-box}
html,body{height:100%}
body{font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;background:#f1f5f9;color:#0f172a;margin:0;display:flex;flex-direction:column;overflow:hidden}

.sticky-top{flex-shrink:0;background:#fff;border-bottom:1px solid #e2e8f0;z-index:40}

header{background:#fff;border-bottom:1px solid #e2e8f0;padding:12px 16px}
.hi{max-width:1400px;margin:0 auto;display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:nowrap}
h1{font-size:18px;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:0 1 auto}

.brand { margin: 0; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
.brand a { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; overflow: hidden; }
.brand a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.brand-logo { height: 28px; width: auto; max-width: 100px; object-fit: contain; display: block; flex-shrink: 0; }

.search-wrapper { flex: 1; max-width: 600px; position: relative; }
#search{width:100%;padding:11px 14px;font-size:15px;border:1px solid #cbd5e1;border-radius:10px;outline:none}
#search:focus{border-color:#2563eb}
#search:disabled{background:#f8fafc;color:#94a3b8}
.search-history { display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid #cbd5e1; border-radius: 10px; box-shadow: 0 6px 20px rgba(15,23,42,0.12); z-index: 60; padding: 6px; max-height: 320px; overflow-y: auto; }
.search-history.show { display: block; }
.sh-header { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px 8px; font-size: 10px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid #f1f5f9; margin-bottom: 4px; }
.sh-clear-all { background: transparent; border: none; color: #dc2626; font-size: 11px; font-weight: 600; cursor: pointer; padding: 2px 8px; border-radius: 4px; text-transform: none; letter-spacing: 0; }
.sh-clear-all:hover { background: #fef2f2; }
.sh-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; color: #334155; }
.sh-item:hover { background: #f1f5f9; }
.sh-term { flex: 1; word-break: break-word; min-width: 0; }
.sh-del { flex-shrink: 0; background: transparent; border: none; color: #94a3b8; font-size: 18px; cursor: pointer; padding: 0 6px; line-height: 1; border-radius: 4px; font-family: inherit; }
.sh-del:hover { background: #fee2e2; color: #dc2626; }

.header-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.search-toggle-btn, .info-toggle-btn, .menu-toggle-btn { background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 8px; padding: 8px 12px; font-size: 16px; cursor: pointer; color: #2563eb; transition: all 0.15s; }
.search-toggle-btn:hover, .info-toggle-btn:hover, .menu-toggle-btn:hover { background: #e2e8f0; }
.search-toggle-btn, .menu-toggle-btn { display: none; }
.info-toggle-btn { display: block; }

.typetabs{background:#fff;padding:10px 16px;border-bottom:1px solid #e2e8f0}
.ti{max-width:1400px;margin:0 auto;display:flex;gap:12px;padding:4px 0;flex-wrap:wrap;justify-content:center}
.ti .tab{padding:9px 16px;background:transparent;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;color:#475569;white-space:nowrap;text-decoration:none;display:inline-block;border:none;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.ti .tab:hover{background:#f1f5f9;color:#0f172a}
.ti .tab.active{background:#2563eb !important;color:#fff}
.ti .tab .c{opacity:.7;font-size:11px;margin-left:6px}

.layout{max-width:1400px;margin:0 auto;display:grid;grid-template-columns:260px 1fr;grid-template-rows:1fr;gap:0;align-items:stretch;flex:1;min-height:0;overflow:hidden;width:100%;}

.sb{background:#fff;border-right:1px solid #e2e8f0;padding:0;height:100%;overflow-y:auto;min-width:0;position:relative;}
.sb-mobile-header{display:none;}
.sb-mobile-types{display:none;}

.main{padding:0;min-width:0;height:100%;overflow-y:auto;position:relative;display:flex;flex-direction:column;}

.list-header{font-size:22px;font-weight:700;color:#0f172a;padding:16px;margin:0;border-bottom:2px solid #e2e8f0;display:flex;align-items:center;gap:10px;flex-wrap:wrap;position:sticky;top:0;background:#f1f5f9;z-index:10;}
.list-header .lh-count{font-size:13px;font-weight:500;color:#64748b;background:#f1f5f9;padding:3px 10px;border-radius:999px;border:1px solid #e2e8f0}
.list-header-buttons { display: flex; gap: 8px; margin-left: auto; align-items: center; }

.bouquet-search-btn{background:#f1f5f9;border:1px solid #cbd5e1;color:#334155;font-size:14px;padding:6px 10px;border-radius:6px;cursor:pointer;flex-shrink:0;line-height:1}
.bouquet-search-btn:hover{background:#e2e8f0}
.bouquet-search-btn.active{background:#2563eb;color:#fff;border-color:#2563eb}
.bouquet-search-input{flex:1;min-width:150px;max-width:300px;padding:7px 12px;font-size:13px;border:1px solid #cbd5e1;border-radius:8px;outline:none}
.bouquet-search-input:focus{border-color:#2563eb}

.catchup-filter-btn{background:#f1f5f9;border:1px solid #cbd5e1;color:#16a34a;font-size:11px;font-weight:700;padding:6px 12px;border-radius:6px;cursor:pointer;flex-shrink:0;text-transform:uppercase;letter-spacing:.4px;display:inline-flex;align-items:center;justify-content:center;gap:6px;font-family:inherit;touch-action:manipulation;}
.catchup-filter-btn:hover{background:#f0fdf4;border-color:#bbf7d0}
.catchup-filter-btn .cu-x{display:none;font-weight:700;font-size:12px;line-height:1}
.catchup-filter-btn.active{background:#16a34a;color:#fff;border-color:#16a34a}
.catchup-filter-btn.active .cu-x{display:inline}

.sb-catchup-row { padding: 6px 16px 6px 16px; }
.sb-catchup-btn { width: 100%; padding: 8px 12px; font-size: 12px; }

#chView, #updView { padding: 0 16px 16px 16px; flex: 1; }

.sb-sticky-head { position: sticky; top: 0; z-index: 6; background: #fff; border-bottom: 1px solid #f1f5f9; }
.sb-sortrow{display:flex;justify-content:space-between;align-items:center;padding:8px 16px 6px;gap:12px;}
.sb-title-row{display:flex;justify-content:space-between;align-items:center;padding:12px 16px 6px;}
.sb-title{font-size:11px;text-transform:uppercase;letter-spacing:.8px;color:#94a3b8;font-weight:700}
.sb-count{color:#cbd5e1;font-weight:500;margin-left:2px}
.bouquet-filter-btn{background:transparent;border:none;color:#94a3b8;font-size:14px;cursor:pointer;padding:2px 6px;border-radius:4px;line-height:1;transition:all .15s;touch-action:manipulation}
.bouquet-filter-btn:hover{background:#f1f5f9;color:#2563eb}
.bouquet-filter-btn.active{background:#2563eb;color:#fff}
.bouquet-filter-input{width:calc(100% - 32px);margin:0 16px 8px;padding:7px 10px;font-size:12px;border:1px solid #cbd5e1;border-radius:8px;outline:none;background:#f8fafc}
.bouquet-filter-input:focus{border-color:#2563eb;background:#fff}
.sb-g{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;padding:10px 16px;font-size:14px;color:#334155;cursor:pointer;border-left:3px solid transparent;touch-action:manipulation}
.sb-g:hover{background:#f8fafc}
.sb-g.active{background:#eff6ff;border-left-color:#2563eb;color:#1d4ed8;font-weight:600}
.sb-g .nm{flex:1;white-space:normal;word-break:break-word;line-height:1.3;font-weight:600;}
.sb-g .ct{font-size:11px;color:#94a3b8;background:#f1f5f9;padding:2px 8px;border-radius:999px;font-weight:600;flex-shrink:0;margin-top:2px}
.sb-u{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:10px 16px;cursor:pointer;border-left:3px solid transparent;touch-action:manipulation}
.sb-u:hover{background:#f8fafc}
.sb-u.active{background:#eff6ff;border-left-color:#2563eb}
.sb-u .dt{font-size:13px;font-weight:600;color:#0f172a}
.sb-u .sub{font-size:11px;color:#94a3b8;display:flex;gap:8px;flex-wrap:wrap}
.sb-u .g{color:#16a34a}
.sb-u .r{color:#dc2626}
.sb-u.active .dt{color:#1d4ed8}
.sb-total{font-size:11px;font-weight:600;color:#64748b;text-transform:uppercase;letter-spacing:.5px;white-space:nowrap}
.sortbtn{background:#f1f5f9;border:1px solid #cbd5e1;color:#334155;font-size:11px;font-weight:700;padding:3px 8px;border-radius:6px;cursor:pointer;text-align:center;white-space:nowrap;flex-shrink:0;touch-action:manipulation;min-width:64px;display:inline-flex;justify-content:center;align-items:center;}
.sortbtn:hover{background:#e2e8f0}

.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px}
.ch{background:#fff;border:1px solid #e2e8f0;border-radius:12px;padding:10px 8px 8px;text-align:center;display:flex;flex-direction:column;align-items:center;gap:6px;min-height:130px;position:relative;transition:all .15s}
.ch:hover{transform:translateY(-2px);border-color:#2563eb;box-shadow:0 4px 14px rgba(0,0,0,.06)}
.ch .logo{width:56px;height:56px;background:#f8fafc;border-radius:8px;display:flex;align-items:center;justify-content:center;overflow:hidden;flex-shrink:0;font-size:22px;color:#94a3b8}
.ch .logo img{width:100%;height:100%;object-fit:contain}
.ch .name{font-size:12px;line-height:1.3;word-break:break-word;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-weight: 600;margin-top:auto;}
.ch .cu{background:#16a34a;color:#fff;font-size:9px;font-weight:700;padding:2px 8px;border-radius:4px;white-space:nowrap;display:flex;align-items:center;gap:4px;margin:2px 0 0}
.ch .info-i{display:inline-flex;align-items:center;justify-content:center;width:12px;height:12px;background:rgba(255,255,255,.3);border-radius:50%;font-size:9px;font-style:italic;font-weight:700;cursor:pointer;font-family:Georgia,serif}
.ch .info-i:hover{background:rgba(255,255,255,.5)}
.ch .bouquet{font-size:10px;font-weight:600;padding:2px 6px;border-radius:4px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ch .bouquet.live, .ch .bouquet.vod, .ch .bouquet.series { background: #dbeafe; color: #1e40af; }

.no-logos .grid:not(.list-view) .ch { padding: 8px; min-height: 80px; gap: 4px; }
.no-logos .grid:not(.list-view) .ch .logo { display: none; }
.no-logos .grid:not(.list-view) .ch .bouquet { margin-top: auto; font-size: 10px; margin-bottom: 2px; }
.no-logos .grid:not(.list-view) .ch .name { font-size: 13px; -webkit-line-clamp: 3; margin-bottom: 2px; margin-top: 0; }
.no-logos .grid:not(.list-view) .ch .cu { margin: 0 0 2px 0; }

.hl { background: #fef08a; color: #0f172a; font-weight: 700; padding: 0 1px; border-radius: 2px; }

.back-to-top { display: none; position: fixed; bottom: 24px; right: 24px; width: 44px; height: 44px; border-radius: 50%; background: #2563eb; color: #fff; border: none; font-size: 20px; font-weight: 700; cursor: pointer; z-index: 90; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4); transition: all 0.2s; align-items: center; justify-content: center; line-height: 1; padding: 0; }
.back-to-top:hover { background: #1d4ed8; transform: translateY(-2px); }
.back-to-top.show { display: flex; }

.load-more-wrap { text-align: center; margin-top: 20px; }
.load-more-hint { font-size: 12px; color: #64748b; margin-top: 10px; text-align: center; line-height: 1.5; }
.load-more-hint a { color: #2563eb; text-decoration: underline; cursor: pointer; font-weight: 600; }
.load-more-hint a:hover { color: #1d4ed8; }

.search-result { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; margin-bottom: 4px; font-size: 13px; background: #f8fafc; border-left: 3px solid transparent; }
.search-result.add { background: #f0fdf4; border-left-color: #16a34a; }
.search-result.rem { background: #fef2f2; border-left-color: #dc2626; }
.search-result .sr-date { font-size: 11px; color: #64748b; font-weight: 600; white-space: nowrap; }
.search-result .sr-name { font-weight: 700; flex: 1; word-break: break-word; }
.search-result .sr-group { font-size: 11px; color: #64748b; }
.search-result .sr-type { font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; }
.search-result.add .sr-type { background: #16a34a; color: #fff; }
.search-result.rem .sr-type { background: #dc2626; color: #fff; }

/* ===== Latest Updates ===== */
.upd { max-width: 1400px; padding-bottom: 20px; }
#updContent .acc-controls { position: sticky; top: 0; z-index: 10; background: #f1f5f9; padding: 0 0 10px 0; margin: 0 0 12px 0; display: flex; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid #e2e8f0; }
.acc-ctrl-btn{background:#f1f5f9;border:1px solid #cbd5e1;color:#334155;font-size:12px;font-weight:600;padding:5px 12px;border-radius:6px;cursor:pointer;touch-action:manipulation}
.acc-ctrl-btn:hover{background:#e2e8f0}

.sec-title{font-size:12px;text-transform:uppercase;letter-spacing:.6px;color:#64748b;font-weight:700;margin:16px 0 8px}
.ulist{padding:10px;background:#f8fafc;border-radius:8px;font-size:13px;border:1px solid #e2e8f0;margin-bottom:12px}
.ulist .li{padding:5px 8px;border-radius:5px;margin-bottom:2px}
.ulist .li.add{background:#f0fdf4;color:#166534;border-left:3px solid #16a34a;font-weight:500}
.ulist .li.rem{background:#fef2f2;color:#991b1b;border-left:3px solid #dc2626;font-weight:500;font-style:italic}
.ulist .li.add::before, .ulist .li.rem::before, details.acc .acc-body .li.add::before, details.acc .acc-body .li.rem::before { content: "" !important; margin-right: 0 !important; padding-left: 0 !important; }
.empty{padding:60px 20px;text-align:center;color:#64748b;font-size:15px}
@keyframes spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}
.hidden{display:none!important}

.catchup-info-box { max-width: 480px; margin: 0 auto; text-align: left; background: #f8fafc; padding: 20px; border-radius: 12px; border: 1px solid #e2e8f0; font-size: 14px; color: #334155; line-height: 1.6; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
.catchup-info-box strong { color: #0f172a; font-size: 16px; }

.waiting { padding: 40px 20px; display: flex; justify-content: center; align-items: flex-start; }
.waiting.loading { padding: 60px 20px; }
.waiting .waiting-content { display: flex; align-items: center; justify-content: center; gap: 10px; }
.waiting .big { font-size: 24px; opacity: .6; color: #0f172a; }
.waiting.loading .big { animation: spin 1.5s linear infinite; }
.waiting-text { color: #0f172a; font-weight: 600; }

.loading-spinner { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 60px 20px; color: #0f172a; font-weight: 600; font-size: 15px; }
.loading-spinner .big { font-size: 24px; opacity: .6; animation: spin 1.5s linear infinite; }

.welcome-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 20px; padding: 32px 28px; max-width: 520px; width: 100%; text-align: center; box-shadow: 0 4px 20px rgba(15,23,42,0.06); }
.welcome-icon { font-size: 56px; line-height: 1; margin-bottom: 18px; }
.welcome-title { font-size: 22px; font-weight: 700; color: #0f172a; margin-bottom: 10px; line-height: 1.3; }
.welcome-total { display: inline-block; font-size: 13px; font-weight: 700; color: #2563eb; background: #eff6ff; padding: 4px 14px; border-radius: 999px; border: 1px solid #bfdbfe; margin-bottom: 14px; letter-spacing: .3px; }
.welcome-sub { font-size: 16px; color: #0f172a; font-weight: 700; line-height: 1.5; margin-bottom: 24px; max-width: 400px; margin-left: auto; margin-right: auto; }
.welcome-features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 22px; }
.welcome-feature { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; transition: all .15s; cursor: pointer; font-family: inherit; color: #334155; text-align: center; touch-action:manipulation; -webkit-tap-highlight-color:transparent; }
.welcome-feature:hover { background: #eff6ff; border-color: #bfdbfe; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(37, 99, 235, 0.1); }
.welcome-feature:active { transform: translateY(0); }
.welcome-feature-wide { grid-column: 1 / -1; flex-direction: row; justify-content: center; gap: 10px; padding: 14px 16px; }
.wf-icon { font-size: 22px; line-height: 1; }
.wf-label { font-size: 12px; font-weight: 700; color: #334155; text-transform: uppercase; letter-spacing: .4px; }
.wf-count { font-size: 11px; font-weight: 700; color: #64748b; background: #f1f5f9; padding: 2px 8px; border-radius: 999px; border: 1px solid #e2e8f0; line-height: 1.2; margin-top: 2px; }
.welcome-feature:hover .wf-count { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.welcome-feature-wide .wf-count { margin-top: 0; }
.welcome-disclaimer { background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 12px; padding: 14px 16px; font-size: 11px; color: #075985; line-height: 1.5; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; cursor: pointer; transition: all .15s; font-family: inherit; touch-action:manipulation; }
.welcome-disclaimer:hover { background: #e0f2fe; border-color: #7dd3fc; transform: translateY(-1px); }
.welcome-disclaimer .wd-icon { font-size: 16px; line-height: 1; flex-shrink: 0; }
.welcome-disclaimer .wd-text { max-width: 380px; margin: 0 auto; }
.welcome-disclaimer strong { color: #0284c7; font-weight: 700; text-decoration: underline; }

/* Landing Page specific */
.landing-wrap { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 60px); padding: 20px; }
.landing-info { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 12px; padding: 16px; margin-bottom: 20px; text-align: left; font-size: 14px; color: #1e40af; line-height: 1.6; }
.landing-info code { background: #dbeafe; padding: 2px 6px; border-radius: 4px; font-family: monospace; font-size: 13px; color: #1e3a8a; }

/* Preparing State specific */
.prep-wrap { display: flex; align-items: flex-start; justify-content: center; min-height: calc(100vh - 60px); padding: 60px 20px; }
.prep-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 20px; padding: 40px 32px; max-width: 440px; width: 100%; text-align: center; box-shadow: 0 4px 20px rgba(15,23,42,0.06); }
.prep-icon { font-size: 48px; line-height: 1; margin-bottom: 20px; animation: spin 2s linear infinite; display: inline-block; }
.prep-title { font-size: 20px; font-weight: 700; color: #0f172a; margin-bottom: 10px; }
.prep-sub { font-size: 14px; color: #64748b; line-height: 1.5; margin-bottom: 24px; }
.prep-bar-bg { background: #e2e8f0; height: 12px; border-radius: 6px; overflow: hidden; margin-bottom: 12px; }
.prep-bar-fill { background: linear-gradient(90deg, #2563eb, #1d4ed8); height: 100%; width: 0; transition: width .3s ease; }
.prep-pct { font-size: 14px; font-weight: 700; color: #2563eb; }

details.acc{background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;margin-bottom:6px;overflow:hidden}
details.acc[open]{background:#fff}
details.acc summary{cursor:pointer;padding:10px 14px;font-size:13px;font-weight:600;color:#0f172a;list-style:none;display:flex;justify-content:space-between;align-items:center;user-select:none;transition:background .1s;touch-action:manipulation}
details.acc summary:hover{background:#f1f5f9}
details.acc summary::-webkit-details-marker{display:none}
details.acc summary::before{content:"\25B6";display:inline-block;font-size:10px;color:#64748b;margin-right:8px;transition:transform .15s}
details.acc[open] summary::before{transform:rotate(90deg)}
details.acc summary .acc-count{font-size:11px;color:#94a3b8;font-weight:500;margin-left:auto}
details.acc .acc-body{padding:6px 10px 10px 10px}
details.acc .acc-body .li{padding:5px 8px;border-radius:5px;margin-bottom:2px;font-size:13px;display:flex;align-items:center;gap:8px}
details.acc .acc-body .li.add{background:#f0fdf4;color:#166534;border-left:3px solid #16a34a;font-weight:500}
details.acc .acc-body .li.rem{background:#fef2f2;color:#991b1b;border-left:3px solid #dc2626;font-weight:500;font-style:italic}
details.acc .acc-body .li .ch-logo{width:24px;height:24px;background:#fff;border-radius:4px;display:flex;align-items:center;justify-content:center;overflow:hidden;flex-shrink:0;font-size:14px}
details.acc .acc-body .li .ch-logo img{width:100%;height:100%;object-fit:contain}
details.acc .acc-body .li .ch-name{flex:1;word-break:break-word}

.sec-acc { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.sec-acc > summary { cursor: pointer; padding: 14px 18px; font-size: 14px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; text-transform: uppercase; letter-spacing: .6px; transition: background .15s; touch-action:manipulation; }
.sec-acc > summary::-webkit-details-marker { display: none; }
.sec-acc > summary::before { content: "\25B6"; display: inline-block; font-size: 10px; margin-right: 10px; transition: transform .15s; }
.sec-acc[open] > summary::before { transform: rotate(90deg); }
.sec-acc.added > summary { color: #16a34a; background: #f0fdf4; }
.sec-acc.added > summary:hover { background: #dcfce7; }
.sec-acc.removed > summary { color: #dc2626; background: #fef2f2; }
.sec-acc.removed > summary:hover { background: #fee2e2; }
.sec-body { padding: 14px 18px; background: #fff; border-top: 1px solid #e2e8f0; }

.modal-bg{position:fixed;inset:0;background:rgba(15,23,42,.6);display:none;align-items:center;justify-content:center;z-index:100;padding:16px}
.modal-bg.show{display:flex}
.modal{background:#fff;border-radius:14px;max-width:600px;width:100%;max-height:90vh;overflow:auto;box-shadow:0 20px 60px rgba(0,0,0,.3)}
.modal-head{padding:16px 20px;border-bottom:1px solid #e2e8f0;display:flex;justify-content:space-between;align-items:center}
.modal-head h3{margin:0;font-size:17px}
.modal-body{padding:20px;font-size:14px;color:#334155;line-height:1.6}
.modal-body p{margin:0 0 12px 0}
.modal-body ul{margin:8px 0 12px 20px;padding:0}
.modal-body li{margin-bottom:4px}
.modal-close{background:transparent;border:none;font-size:22px;color:#94a3b8;cursor:pointer;padding:4px 10px;border-radius:6px}
.modal-close:hover{background:#f1f5f9;color:#0f172a}

.grid.list-view { grid-template-columns: 1fr; gap: 8px; }
.grid.list-view .ch { display: grid; grid-template-columns: 48px 1fr auto; grid-template-rows: auto auto; gap: 4px 12px; text-align: left; padding: 12px 16px; align-items: center; border-radius: 8px; min-height: auto; }
.grid.list-view .ch:hover { transform: none; border-color: #2563eb; box-shadow: 0 2px 10px rgba(37,99,235,.15); }
.grid.list-view .ch .logo { grid-row: 1 / 3; grid-column: 1; width: 48px; height: 48px; margin: 0; }
.grid.list-view .ch .bouquet { grid-row: 1; grid-column: 2; margin: 0; justify-self: start; font-size: 11px; padding: 2px 8px; }
.grid.list-view .ch .cu { grid-row: 1; grid-column: 3; position: static; transform: none; margin: 0; justify-self: end; font-size: 11px; padding: 2px 8px; }
.grid.list-view .ch .name { grid-row: 2; grid-column: 2 / 4; margin: 0; font-size: 15px; font-weight: 700; text-align: left; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 0; }

.no-logos .grid.list-view .ch { grid-template-columns: 1fr auto; }
.no-logos .grid.list-view .ch .bouquet { grid-row: 1; grid-column: 1; margin: 0; }
.no-logos .grid.list-view .ch .cu { grid-row: 1; grid-column: 2; margin: 0; }
.no-logos .grid.list-view .ch .name { grid-row: 2; grid-column: 1 / 3; padding-left: 0; margin-top: 0; }

.mobile-menu-overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,0.5); z-index: 99; }
.mobile-menu-overlay.show { display: block; }

/* Mobile Back Button (Hidden on Desktop) */
.mobile-back-btn { display: none; background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 6px; padding: 4px 10px; font-size: 16px; font-weight: 700; color: #334155; cursor: pointer; margin-right: 6px; align-items: center; justify-content: center; }

/* ===== MODERN MODAL (for Update Text) ===== */
.modal.modern-modal {
    max-width: 700px;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal.modern-modal .modal-head {
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
    border-radius: 16px 16px 0 0;
}

.modal.modern-modal .modal-head h3 {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.3px;
}

.modal.modern-modal .modal-body {
    padding: 24px;
    background: #fff;
    border-radius: 0 0 16px 16px;
}

.modal.modern-modal .modal-close {
    font-size: 24px;
    padding: 4px 12px;
    color: #94a3b8;
    transition: all 0.15s;
}
.modal.modern-modal .modal-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.modal-bg.show {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ===== TEXT FILTER BUTTONS (Modern) ===== */
.text-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn.filter-btn {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
}

/* Inactive State (Blue Outline) */
.b-outline-blue {
    background: transparent;
    color: #2563eb;
    border: 1.5px solid #2563eb;
}
.b-outline-blue:hover {
    background: #eff6ff;
    transform: translateY(-1px);
}

/* Active State (Solid Blue) */
.b-blue.filter-btn {
    background: #2563eb;
    color: #fff;
    border: 1.5px solid #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

@media(max-width:900px){
    .layout{grid-template-columns:200px 1fr}
    .sb-sortrow{padding:6px 10px 4px;gap:8px}
    .sb-title-row{padding:8px 10px 4px}
    .sb-title{font-size:10px}
    .bouquet-filter-btn{font-size:12px;padding:1px 4px}
    .bouquet-filter-input{width:calc(100% - 20px);margin:0 10px 6px;font-size:11px;padding:6px 8px}
    .sb-catchup-row { padding: 6px 10px 6px 10px; }
    .sb-catchup-btn { font-size: 11px; padding: 7px 10px; }
    .sb-g,.sb-u{padding:8px 10px;font-size:12px;gap:6px}
    .sb-g .ct{font-size:10px;padding:1px 5px}
    .sb-u{padding:8px 10px}
    .sb-u .dt{font-size:12px}
    .sb-u .sub{font-size:10px;gap:6px}
    .sb-total{font-size:10px}
    .sortbtn{font-size:10px;padding:2px 6px;}
    #chView, #updView { padding: 0 12px 12px 12px; }
    .list-header{font-size:18px;padding:12px;}
    .grid{grid-template-columns:repeat(auto-fill,minmax(105px,1fr));gap:8px}
    .ch{padding:8px 6px;min-height:120px;gap:5px}
    .ch .logo{width:48px;height:48px}
    .ch .name{font-size:11px}
    .ch .cu{font-size:8px;padding:1px 6px;}
    .ch .bouquet{font-size:9px;padding:1px 4px}
    details.acc summary{padding:9px 12px;font-size:12px}
    details.acc .acc-body .li{font-size:12px}
    details.acc .acc-body .li .ch-logo{width:22px;height:22px;font-size:12px}
    .no-logos .grid:not(.list-view) .ch { min-height: 75px; padding: 6px; }
    .no-logos .grid:not(.list-view) .ch .name { font-size: 12px; }
}

@media(max-width:600px){
    /* Compact Header */
    header { padding: 8px 12px; }
    .hi { gap: 6px; }
    
    h1.brand { font-size: 16px; flex: 1 1 0%; min-width: 0; }
    .header-actions { display: flex; gap: 4px; flex-shrink: 0; margin-left: auto; }
    
    .search-toggle-btn, .info-toggle-btn, .menu-toggle-btn { padding: 6px 8px; font-size: 15px; }
    
    /* Compact Search Wrapper when active */
    .search-wrapper {
        display: none;
        width: 100%;
        max-width: 100%;
        order: 10;
        margin-top: 6px;
    }
    .hi.search-active .search-wrapper { display: block; }
    
    .hi.search-active .search-toggle-btn { 
        display: block; 
        background: #fee2e2; 
        color: #dc2626; 
        border-color: #fecaca;
    }
    
    .search-toggle-btn { display: block; }
    .menu-toggle-btn { display: block; }
    .info-toggle-btn { display: block; }
    
    .typetabs { display: none; }
    
    .layout { display: block; }
    
    .sb { 
        position: fixed; 
        top: 0; 
        left: 0; 
        bottom: 0; 
        width: 280px; 
        z-index: 100; 
        transform: translateX(-100%); 
        transition: transform 0.3s ease; 
        border-right: 1px solid #e2e8f0;
        box-shadow: 4px 0 15px rgba(0,0,0,0.1);
        display: flex;
        flex-direction: column;
    }
    .sb.open { transform: translateX(0); }
    
    .sb-mobile-header { 
        display: flex; 
        justify-content: space-between; 
        align-items: center; 
        padding: 12px 16px; 
        background: #fff; 
        border-bottom: 1px solid #e2e8f0; 
        position: sticky; 
        top: 0; 
        z-index: 10; 
    }
    
    .sb-mobile-home {
        display: flex;
        align-items: center;
        gap: 8px;
        text-decoration: none;
        color: inherit;
        min-width: 0;
        overflow: hidden;
    }
    .sb-mobile-home img {
        height: 24px;
        width: auto;
        max-width: 80px;
        object-fit: contain;
        flex-shrink: 0;
        display: block;
    }
    .sb-mobile-home span {
        font-size: 16px;
        font-weight: 700;
        color: #0f172a;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sb-close-btn { background: transparent; border: none; font-size: 22px; cursor: pointer; color: #64748b; padding: 4px; flex-shrink: 0; }
    .sb-close-btn:hover { color: #0f172a; }
    
    /* 2-Column Grid for Mobile Type Tabs */
    .sb-mobile-types { 
        display: grid; 
        grid-template-columns: 1fr 1fr; 
        gap: 8px; 
        padding: 12px 16px; 
        background: #f8fafc; 
        border-bottom: 1px solid #e2e8f0; 
    }
    .sb-mobile-types .tab { 
        display: flex; 
        flex-direction: column; 
        align-items: center; 
        justify-content: center;
        text-align: center; 
        padding: 8px 4px; 
        font-size: 12px; 
        font-weight: 600; 
        border-radius: 8px; 
        background: #fff; 
        border: 1px solid #cbd5e1; 
        color: #475569; 
        text-decoration: none; 
        line-height: 1.2;
    }
    .sb-mobile-types .tab .c { font-size: 11px; color: #94a3b8; font-weight: normal; margin-top: 2px; }
    .sb-mobile-types .tab.active { background: #2563eb; color: #fff; border-color: #2563eb; }
    .sb-mobile-types .tab.active .c { color: #bfdbfe; }

    #sbBouquets { flex: 1; overflow-y: auto; }
    #sbUpdates { flex: 1; overflow-y: auto; }
    
    .sb-sortrow { flex-direction: column; align-items: stretch; gap: 6px; padding: 8px 16px 6px; }
    .sortbtn { width: 100%; padding: 6px 0; }
    .sb-catchup-row { padding: 4px 16px 6px 16px; }
    .sb-title-row { padding: 8px 16px 4px; }
    .bouquet-filter-input { width: calc(100% - 32px); margin: 0 16px 6px; font-size: 12px; }
    .sb-g { flex-direction: row; align-items: center; padding: 12px 16px; font-size: 14px; }
    .sb-g .nm { font-size: 14px; }
    .sb-g .ct { font-size: 11px; margin-top: 0; }
    
    #chView, #updView { padding: 0 12px 12px 12px; }
    
    /* ===== COMPACT LIST HEADER ===== */
    .list-header { 
        display: flex; 
        flex-wrap: wrap; 
        align-items: center; 
        padding: 8px 12px; 
        gap: 6px; 
    }
    
    #listTitle { 
        flex: 1 1 auto; 
        font-size: 16px; 
        margin-bottom: 0; 
        white-space: nowrap; 
        overflow: hidden; 
        text-overflow: ellipsis; 
    }
    
    .lh-count { 
        font-size: 11px; 
        padding: 2px 8px; 
    }
    
    .list-header-buttons { 
        flex: 0 0 auto; 
        margin-left: auto; 
        gap: 4px; 
        margin-top: 0; 
    }
    
    .list-header-buttons .sortbtn { 
        flex: 0 0 auto; 
        padding: 6px 10px; 
        font-size: 12px; 
        width: auto; 
        min-width: 0; 
    }
    
    .mobile-back-btn { 
        display: inline-flex; 
        padding: 4px 8px; 
        font-size: 14px; 
        margin-right: 0; 
    }
    
    .bouquet-search-input { 
        flex: 1 1 100%; 
        max-width: 100%; 
        font-size: 12px; 
        padding: 6px 10px; 
        margin-top: 4px; 
    }
    /* ===== END COMPACT LIST HEADER ===== */
    
    .grid { grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 8px; }
    .ch { padding: 10px 6px 8px; min-height: 120px; gap: 6px; }
    .ch .logo { width: 48px; height: 48px; font-size: 20px; }
    .ch .name { font-size: 12px; }
    .ch .cu { font-size: 9px; padding: 2px 6px; }
    .ch .bouquet { font-size: 9px; padding: 2px 6px; }
    
    .grid.list-view .ch { grid-template-columns: 42px 1fr auto; gap: 4px 10px; padding: 10px 12px; }
    .grid.list-view .ch .logo { width: 42px; height: 42px; }
    .grid.list-view .ch .bouquet, .grid.list-view .ch .cu { font-size: 10px; padding: 2px 6px; }
    .grid.list-view .ch .name { font-size: 14px; -webkit-line-clamp: 2; }
    .no-logos .grid.list-view .ch { grid-template-columns: 1fr auto; }
    
    .waiting { padding: 20px 12px; }
    .welcome-card { padding: 24px 18px; border-radius: 16px; }
    .welcome-icon { font-size: 44px; margin-bottom: 14px; }
    .welcome-title { font-size: 18px; }
    .welcome-total { font-size: 12px; padding: 3px 12px; margin-bottom: 12px; }
    .welcome-sub { font-size: 14px; margin-bottom: 18px; }
    .welcome-features { gap: 8px; margin-bottom: 18px; }
    .welcome-feature { padding: 12px 6px; border-radius: 10px; }
    .wf-icon { font-size: 22px; }
    .wf-label { font-size: 11px; }
    .wf-count { font-size: 10px; padding: 2px 8px; }
    .welcome-feature-wide { padding: 12px 14px; gap: 8px; }
    .welcome-disclaimer { font-size: 11px; padding: 14px 12px; }
}

@media(max-width:420px){
    .sb-mobile-types .tab { font-size: 11px; padding: 6px 2px; }
    .sb-g, .sb-u { padding: 10px 12px; font-size: 13px; }
    .sb-g .nm { font-size: 13px; }
    .list-header{font-size:15px}
    .grid{grid-template-columns:repeat(auto-fill,minmax(95px,1fr));gap:6px}
    .ch{padding:8px 4px;min-height:105px;gap:4px}
    .ch .logo{width:42px;height:42px;font-size:18px}
    .ch .name{font-size:11px}
    .ch .bouquet{font-size:8px}
    .ch .cu{font-size:8px;padding:1px 4px}
    .no-logos .grid:not(.list-view) .ch { min-height: 70px; padding: 6px; }
    .no-logos .grid:not(.list-view) .ch .name { font-size: 11px; }

    .welcome-card { padding: 20px 14px; }
    .welcome-icon { font-size: 38px; }
    .welcome-title { font-size: 16px; }
    .welcome-total { font-size: 11px; padding: 3px 10px; }
    .welcome-sub { font-size: 13px; }
    .welcome-feature { padding: 10px 4px; }
    .wf-icon { font-size: 20px; }
    .wf-label { font-size: 10px; }
    .wf-count { font-size: 9px; padding: 1px 5px; }
}