:root {
  --navy:#0d1b2a; --navy2:#14283c; --blue:#2f80ed; --green:#21a179;
  --amber:#f59e0b; --orange:#ff8a00; --bg:#f5f7fa; --surface:#fff;
  --surface-soft:#f0f3f7; --text:#18212b; --muted:#66717e; --border:#dce3ea;
  --danger:#e5484d; --shadow:0 8px 26px rgba(13,27,42,.07);
  --sidebar:250px; --bottom-nav:72px;
}
*{box-sizing:border-box} html{background:var(--bg);color:var(--text);font-family:Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif}
body{margin:0;background:var(--bg);min-height:100vh} button,input{font:inherit} button{color:inherit}
.dev-ribbon{position:fixed;z-index:60;top:0;left:0;right:0;height:28px;background:var(--navy);color:#fff;display:flex;align-items:center;justify-content:center;font-size:11px;letter-spacing:.02em}
.app-shell{min-height:100vh;padding-top:28px}.desktop-sidebar{position:fixed;left:0;top:28px;bottom:0;width:var(--sidebar);background:var(--surface);border-right:1px solid var(--border);padding:22px 16px;display:flex;flex-direction:column;z-index:20}
.brand-block{display:flex;align-items:center;gap:10px;padding:0 8px 24px}.brand-cat{width:44px;height:44px;object-fit:contain;border-radius:13px;background:var(--surface-soft)}.brand-title{font-weight:800;font-size:19px}.brand-subtitle{font-size:12px;color:var(--muted)}
.side-nav{display:flex;flex-direction:column;gap:6px}.nav-item{border:0;background:transparent;border-radius:14px;padding:12px 13px;display:flex;align-items:center;gap:12px;text-align:left;cursor:pointer;color:var(--muted);font-weight:650}.nav-item:hover{background:var(--surface-soft)}.nav-item.active{background:rgba(255,138,0,.12);color:var(--orange)}.nav-icon{width:23px;text-align:center;font-size:19px}.sidebar-note{margin-top:auto;font-size:12px;color:var(--muted);padding:12px}.status-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--green);margin-right:6px}
.main-area{margin-left:var(--sidebar);min-height:calc(100vh - 28px);position:relative}.topbar{height:72px;background:rgba(255,255,255,.96);backdrop-filter:blur(12px);border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;padding:0 28px;position:sticky;top:28px;z-index:15}.topbar h1{margin:0;font-size:24px}.muted{color:var(--muted)}.topbar-actions{display:flex;gap:8px}.icon-btn,.avatar-btn{border:0;background:var(--surface-soft);width:42px;height:42px;border-radius:13px;cursor:pointer;font-size:22px}.avatar-btn{border-radius:50%;background:var(--blue);color:#fff;font-size:15px;font-weight:800}
.screen{display:none;max-width:980px;margin:0 auto;padding:18px 22px 42px}.screen.active{display:block}.surface{background:var(--surface);border:1px solid rgba(220,227,234,.8);box-shadow:0 2px 10px rgba(13,27,42,.025)}
.feed-controls{padding:12px;border-radius:18px 18px 0 0}.search-box{height:48px;border:1px solid var(--border);border-radius:16px;display:flex;align-items:center;gap:10px;padding:0 14px;background:var(--surface)}.search-box span{font-size:21px;color:var(--muted)}.search-box input{border:0;outline:0;width:100%;background:transparent;color:var(--text);font-size:15px}.toolbar-row{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:9px}.toolbar-btn{min-height:40px;border:0;border-radius:14px;background:var(--surface-soft);padding:8px 10px;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:650}.toolbar-btn:hover{filter:brightness(.98)}
.tabs{display:flex;gap:8px;padding:9px 12px;position:sticky;top:100px;z-index:8;border-top:0}.chip{border:1px solid var(--border);background:var(--surface);border-radius:999px;padding:7px 12px;cursor:pointer;font-size:13px}.chip.active{border-color:var(--blue);background:rgba(47,128,237,.09);color:var(--blue);font-weight:750}.chip.locked{opacity:.55}.card-list{padding-top:5px}.news-card{background:var(--surface);border:1px solid rgba(220,227,234,.82);border-radius:18px;margin:10px 0;padding:13px 14px;box-shadow:0 1px 4px rgba(13,27,42,.035);cursor:pointer;transition:.15s}.news-card:hover{box-shadow:var(--shadow);transform:translateY(-1px)}.news-card.compact{padding:10px 14px}.news-meta{display:flex;align-items:center;gap:8px}.source-marker{display:inline-flex;min-width:0;max-width:68%;padding:4px 8px;border-radius:8px;font-size:12px;font-weight:750;border:1px solid color-mix(in srgb,var(--source,#2f80ed),transparent 60%);background:color-mix(in srgb,var(--source,#2f80ed),white 78%);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.news-date{font-size:11px;color:var(--muted);margin-left:auto;white-space:nowrap}.news-title{font-size:16px;line-height:1.38;font-weight:700;margin:8px 0 0}.news-summary{font-size:13px;line-height:1.48;color:var(--muted);margin:7px 0 0}.news-card.compact .news-summary{display:none}.news-card.compact .news-title{font-size:14px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.empty-card{background:var(--surface);border-radius:20px;margin:20px 0;padding:0;overflow:hidden;border:1px solid var(--border)}.empty-card img{width:100%;display:block}.error-card,.notice-card{background:var(--surface);border:1px solid var(--border);border-radius:18px;padding:22px;margin-top:12px;color:var(--muted)}
.section-intro{border-radius:20px;padding:18px;margin-bottom:14px;display:flex;align-items:end;justify-content:space-between;gap:20px}.section-intro h2,.profile-card h2{margin:0 0 5px}.section-intro p,.profile-card p{margin:0;color:var(--muted);line-height:1.45}.compact-search{width:min(360px,100%)}
.publication-grid,.offer-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.publication-card,.offer-card{background:var(--surface);border:1px solid var(--border);border-radius:18px;overflow:hidden;display:flex;flex-direction:column;min-width:0}.publication-thumb,.offer-image{width:100%;aspect-ratio:16/8;object-fit:cover;background:var(--surface-soft)}.publication-body,.offer-body{padding:14px}.publication-type,.offer-type{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-weight:750}.publication-title,.offer-title{font-size:16px;font-weight:800;line-height:1.35;margin:7px 0}.publication-excerpt,.offer-desc{font-size:13px;line-height:1.48;color:var(--muted)}.card-link{margin-top:auto;padding:0 14px 14px;color:var(--green);font-weight:750;font-size:13px;text-decoration:none}
.profile-card{border-radius:20px;padding:20px;display:flex;align-items:center;gap:16px}.profile-avatar{width:62px;height:62px;border-radius:50%;background:var(--surface-soft);display:flex;align-items:center;justify-content:center;color:var(--muted);font-size:22px;font-weight:800}.settings-list{border-radius:20px;overflow:hidden;margin-top:14px}.settings-list button,.settings-list a{width:100%;border:0;border-bottom:1px solid var(--border);background:var(--surface);padding:16px 18px;display:flex;justify-content:space-between;text-align:left;text-decoration:none;color:var(--text)}.settings-list>*:last-child{border-bottom:0}.settings-list small{color:var(--muted)}.stage-card{margin-top:14px;padding:18px;border-radius:18px;background:rgba(47,128,237,.08);color:var(--text)}.stage-card p{margin:6px 0 0;color:var(--muted);line-height:1.45}
.mobile-bottom-nav{display:none}.loading-overlay{display:none;position:fixed;inset:28px 0 0 var(--sidebar);background:rgba(245,247,250,.5);backdrop-filter:blur(2px);z-index:40;align-items:center;justify-content:center}.loading-overlay.show{display:flex}.spinner{width:32px;height:32px;border:3px solid var(--border);border-top-color:var(--blue);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.toast{position:fixed;left:50%;bottom:26px;transform:translate(-50%,20px);background:var(--navy);color:#fff;padding:10px 14px;border-radius:12px;opacity:0;pointer-events:none;z-index:100;transition:.2s;font-size:13px}.toast.show{opacity:1;transform:translate(-50%,0)}
.modal{border:0;padding:0;background:transparent}.modal::backdrop{background:rgba(13,27,42,.42);backdrop-filter:blur(3px)}.modal-card{width:min(620px,calc(100vw - 28px));max-height:min(760px,86vh);overflow:auto;background:var(--surface);border-radius:22px;padding:18px;box-shadow:0 20px 60px rgba(13,27,42,.22)}.modal-head{display:flex;align-items:center;justify-content:space-between}.modal-head h3{margin:0}.modal-head button{border:0;background:var(--surface-soft);width:36px;height:36px;border-radius:12px;font-size:22px}.sources-list{margin-top:12px}.source-group{border-top:1px solid var(--border);padding:12px 0}.source-group-title{font-weight:800;margin-bottom:7px}.source-check{display:flex;align-items:flex-start;gap:9px;padding:6px 0;font-size:13px}.source-check input{margin-top:2px}.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:14px}.primary,.secondary{border:0;border-radius:13px;padding:10px 15px;font-weight:750}.primary{background:var(--blue);color:#fff}.secondary{background:var(--surface-soft)}
.desktop-only{display:block}
@media (max-width:800px){
  :root{--bottom-nav:70px}.desktop-sidebar{display:none}.main-area{margin-left:0;padding-bottom:calc(var(--bottom-nav) + env(safe-area-inset-bottom))}.topbar{height:60px;padding:0 14px;top:28px}.topbar h1{font-size:20px}.desktop-only{display:none}.screen{padding:10px 10px 24px;max-width:none}.feed-controls{margin:-10px -10px 0;border-radius:0;padding:9px 12px}.tabs{margin:0 -10px;top:88px;overflow-x:auto}.toolbar-row{gap:6px}.toolbar-btn{font-size:11px;padding:8px 6px}.news-card{margin:9px 2px;padding:12px}.source-marker{max-width:62%}.publication-grid,.offer-grid{grid-template-columns:1fr}.section-intro{display:block;padding:15px;margin:0 0 10px}.compact-search{margin-top:12px;width:100%}.mobile-bottom-nav{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:30;background:rgba(255,255,255,.97);backdrop-filter:blur(12px);border-top:1px solid var(--border);padding:5px 5px calc(5px + env(safe-area-inset-bottom));justify-content:space-around}.mobile-nav-item{border:0;background:transparent;min-width:68px;padding:3px 4px;display:flex;flex-direction:column;align-items:center;gap:1px;color:var(--muted);font-size:10px;cursor:pointer}.mobile-nav-item .mobile-icon{width:38px;height:28px;border-radius:14px;display:flex;align-items:center;justify-content:center;font-size:20px}.mobile-nav-item.active{color:var(--orange);font-weight:750}.mobile-nav-item.active .mobile-icon{background:rgba(255,138,0,.13)}.loading-overlay{left:0;bottom:var(--bottom-nav)}.toast{bottom:calc(var(--bottom-nav) + 18px)}
}
@media (prefers-color-scheme:dark){
  :root{--bg:#0c1218;--surface:#141d26;--surface-soft:#1c2732;--text:#f1f4f7;--muted:#9ca8b5;--border:#2a3846;--shadow:0 10px 28px rgba(0,0,0,.26)}
  .topbar,.mobile-bottom-nav{background:rgba(20,29,38,.96)}.source-marker{background:color-mix(in srgb,var(--source,#77b5ff),#141d26 65%)}.loading-overlay{background:rgba(12,18,24,.55)}
}


/* ===== Web Stage 1.1: Sources UX ===== */
.sources-modal{width:auto;max-width:none}.sources-modal-card{width:min(720px,calc(100vw - 32px));height:min(790px,88vh);background:var(--surface);border-radius:26px;box-shadow:0 24px 80px rgba(13,27,42,.25);overflow:hidden;display:grid;grid-template-rows:auto auto minmax(0,1fr) auto}.sources-modal-header{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:22px 22px 14px}.sources-modal-header h3{margin:0;font-size:21px}.sources-modal-header p{margin:6px 0 0;color:var(--muted);font-size:13px;line-height:1.45}.modal-close{flex:0 0 auto;border:0;background:var(--surface-soft);width:40px;height:40px;border-radius:14px;font-size:22px;cursor:pointer}.sources-toolbar{padding:0 22px 14px;border-bottom:1px solid var(--border)}.source-search-box{height:46px;border:1px solid var(--border);background:var(--surface-soft);border-radius:15px;padding:0 13px;display:flex;align-items:center;gap:9px}.source-search-box span{font-size:21px;color:var(--muted)}.source-search-box input{width:100%;border:0;outline:0;background:transparent;color:var(--text);font-size:14px}.source-filter-tabs{display:flex;gap:7px;margin-top:10px;overflow-x:auto;scrollbar-width:none}.source-filter-tabs::-webkit-scrollbar{display:none}.source-filter{white-space:nowrap;border:1px solid var(--border);background:var(--surface);border-radius:999px;padding:7px 11px;font-size:12px;cursor:pointer;color:var(--muted)}.source-filter span{display:inline-flex;min-width:20px;height:20px;padding:0 5px;align-items:center;justify-content:center;margin-left:4px;border-radius:999px;background:var(--surface-soft);font-size:10px}.source-filter.active{border-color:var(--blue);background:rgba(47,128,237,.09);color:var(--blue);font-weight:750}.sources-list.modern{overflow:auto;margin:0;padding:12px 14px 18px;background:var(--bg);overscroll-behavior:contain}.source-group-card{background:var(--surface);border:1px solid var(--border);border-radius:17px;margin:8px 0;overflow:hidden}.source-group-head{display:flex;align-items:center;gap:8px;padding:9px 10px 9px 8px}.source-group-toggle{min-width:0;flex:1;border:0;background:transparent;display:flex;align-items:center;gap:8px;text-align:left;padding:4px;cursor:pointer}.source-chevron{width:24px;height:24px;border-radius:8px;background:var(--surface-soft);display:flex;align-items:center;justify-content:center;transition:.18s}.source-group-card.collapsed .source-chevron{transform:rotate(-90deg)}.source-group-copy{min-width:0;display:flex;align-items:baseline;gap:8px}.source-group-copy strong{font-size:13px;overflow:hidden;text-overflow:ellipsis}.source-group-copy small{color:var(--muted);font-size:11px;white-space:nowrap}.source-group-all{flex:0 0 auto;border:0;background:rgba(47,128,237,.08);color:var(--blue);border-radius:10px;padding:7px 9px;font-size:11px;font-weight:700;cursor:pointer}.source-group-items{border-top:1px solid var(--border);padding:5px 9px 8px}.source-group-card.collapsed .source-group-items{display:none}.source-row{position:relative;display:grid;grid-template-columns:28px minmax(0,1fr);align-items:center;gap:8px;padding:8px 5px;border-radius:11px;cursor:pointer;font-size:13px}.source-row:hover{background:var(--surface-soft)}.source-row input{position:absolute;opacity:0;pointer-events:none}.pretty-check{width:22px;height:22px;border:1.5px solid var(--border);border-radius:7px;display:flex;align-items:center;justify-content:center;color:transparent;background:var(--surface);font-size:13px;font-weight:900;transition:.15s}.source-row input:checked + .pretty-check{background:var(--blue);border-color:var(--blue);color:#fff}.source-row-name{line-height:1.35}.source-empty{padding:38px 18px;text-align:center;color:var(--muted)}.sources-footer{border-top:1px solid var(--border);background:var(--surface);padding:12px 18px;display:flex;align-items:center;justify-content:space-between;gap:12px}.sources-counter{font-size:12px;color:var(--muted);white-space:nowrap}.sources-footer-actions{display:flex;gap:8px}.sources-footer .primary,.sources-footer .secondary{cursor:pointer}.sources-footer .primary{min-width:116px}

/* ===== Web Stage 1.1: Full-screen news reader ===== */
body.detail-open{overflow:hidden}.news-detail-dialog{border:0;padding:0;background:transparent;width:min(860px,calc(100vw - 32px));max-width:none;height:min(860px,calc(100vh - 48px));max-height:none}.news-detail-dialog::backdrop{background:rgba(13,27,42,.52);backdrop-filter:blur(5px)}.news-detail-shell{width:100%;height:100%;background:var(--surface);border-radius:26px;overflow:hidden;display:grid;grid-template-rows:auto minmax(0,1fr) auto;box-shadow:0 28px 90px rgba(13,27,42,.28)}.news-detail-header{height:60px;border-bottom:1px solid var(--border);display:grid;grid-template-columns:44px 1fr 44px;align-items:center;padding:0 14px;background:var(--surface);z-index:2}.news-detail-close{border:0;width:40px;height:40px;border-radius:13px;background:var(--surface-soft);cursor:pointer;font-size:21px}.news-detail-position{text-align:center;color:var(--muted);font-size:12px}.news-detail-header-actions{display:flex;justify-content:flex-end;color:var(--muted);font-size:13px}.news-detail-scroll{overflow-y:auto;overscroll-behavior:contain;background:var(--surface);touch-action:pan-y}.news-detail-content{max-width:720px;margin:0 auto;padding:34px 34px 60px;min-height:100%}.news-detail-meta{display:flex;align-items:center;gap:10px}.detail-source{max-width:74%}.news-detail-content h2{font-size:28px;line-height:1.28;margin:18px 0 0;letter-spacing:-.015em}.news-detail-summary{font-size:16px;line-height:1.72;color:var(--text);white-space:pre-wrap;margin-top:24px}.news-detail-source-link{display:inline-flex;margin-top:30px;color:var(--green);font-weight:750;text-decoration:none;border:1px solid color-mix(in srgb,var(--green),transparent 70%);background:color-mix(in srgb,var(--green),transparent 92%);padding:11px 14px;border-radius:13px}.swipe-hint{display:none;margin-top:28px;color:var(--muted);font-size:12px}.news-detail-footer{height:64px;border-top:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;padding:0 16px;background:var(--surface)}.detail-footer-btn{border:0;background:var(--surface-soft);border-radius:13px;padding:10px 14px;font-weight:700;cursor:pointer}.detail-footer-btn:disabled{opacity:.35;cursor:default}.news-detail-content.slide-next{animation:detailNext .18s ease-out}.news-detail-content.slide-prev{animation:detailPrev .18s ease-out}@keyframes detailNext{from{opacity:.35;transform:translateX(28px)}to{opacity:1;transform:none}}@keyframes detailPrev{from{opacity:.35;transform:translateX(-28px)}to{opacity:1;transform:none}}

@media (max-width:800px){
  .sources-modal{margin:0;width:100vw;max-width:none;height:100dvh;max-height:none}.sources-modal::backdrop{background:rgba(13,27,42,.45)}.sources-modal-card{width:100vw;height:calc(100dvh - 28px);margin-top:28px;border-radius:22px 22px 0 0}.sources-modal-header{padding:16px 14px 10px}.sources-modal-header h3{font-size:19px}.sources-modal-header p{font-size:12px}.sources-toolbar{padding:0 14px 11px}.sources-list.modern{padding:7px 8px 14px}.source-group-card{margin:7px 0}.source-group-copy{display:block}.source-group-copy strong{display:block}.source-group-copy small{display:block;margin-top:2px}.sources-footer{padding:10px 10px calc(10px + env(safe-area-inset-bottom));display:grid;grid-template-columns:1fr auto}.sources-footer-actions{gap:6px}.sources-footer .secondary{padding:9px 10px}.sources-footer .primary{min-width:104px;padding:9px 12px}
  .news-detail-dialog{margin:0;width:100vw;height:100dvh;max-width:none;max-height:none}.news-detail-dialog::backdrop{background:var(--surface)}.news-detail-shell{border-radius:0;height:100dvh}.news-detail-header{height:58px;padding:0 10px;padding-top:env(safe-area-inset-top)}.news-detail-content{padding:22px 17px 52px}.news-detail-content h2{font-size:22px;line-height:1.32;margin-top:15px}.news-detail-summary{font-size:15px;line-height:1.65;margin-top:19px}.news-detail-source-link{width:100%;justify-content:center;text-align:center}.swipe-hint{display:block}.news-detail-footer{display:none}.detail-source{max-width:68%}
}

/* ===== Web Stage 1.2: desktop polish, cache UX and infinite feed ===== */
.brand-cat{background:#0A2547;object-fit:cover;padding:0;box-shadow:0 0 0 1px rgba(10,37,71,.08),0 5px 16px rgba(10,37,71,.14)}
.sources-modal{position:fixed;inset:0;margin:auto;width:min(760px,calc(100vw - 48px));height:min(800px,calc(100vh - 64px));max-width:none;max-height:none}
.sources-modal-card{width:100%;height:100%;max-width:none;max-height:none}
.news-detail-dialog{position:fixed;inset:0;margin:auto}
.news-detail-close{display:grid;place-items:center;padding:0}.news-detail-close svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.news-detail-header-actions{font-size:11px;white-space:nowrap}
.news-detail-footer{height:72px;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:18px;padding:0 24px}
.detail-footer-btn{width:46px;height:46px;padding:0;border-radius:50%;display:grid;place-items:center;background:var(--surface-soft);border:1px solid transparent;transition:.15s;box-shadow:0 1px 4px rgba(13,27,42,.05)}
.detail-footer-btn:hover:not(:disabled){background:var(--surface);border-color:var(--border);box-shadow:0 6px 18px rgba(13,27,42,.09);transform:translateY(-1px)}
.detail-footer-btn svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:2.25;stroke-linecap:round;stroke-linejoin:round;display:block}
.detail-footer-btn.detail-prev{justify-self:end}.detail-footer-btn.detail-next{justify-self:start}
.detail-footer-center{min-width:112px;text-align:center;display:flex;flex-direction:column;gap:2px}.detail-footer-center strong{font-size:12px;font-weight:800}.detail-footer-center small{font-size:10px;color:var(--muted)}
.news-load-more-sentinel{height:64px;display:flex;align-items:center;justify-content:center;color:var(--muted);font-size:12px}.news-load-more-sentinel.loading span::before{content:"";display:inline-block;width:14px;height:14px;margin-right:8px;vertical-align:-2px;border:2px solid var(--border);border-top-color:var(--blue);border-radius:50%;animation:spin .8s linear infinite}
.empty-card img{background:var(--surface);content-visibility:auto}.publication-thumb,.offer-image{content-visibility:auto}

@media (max-width:800px){
  .sources-modal{position:fixed;inset:0;margin:0;width:100vw;height:100dvh;max-width:none;max-height:none}
  .sources-modal-card{width:100vw;height:calc(100dvh - 28px);margin-top:28px;border-radius:22px 22px 0 0}
  .news-detail-dialog{position:fixed;inset:0;margin:0;width:100vw;height:100dvh;max-width:none;max-height:none}
  .news-detail-footer{display:none}
  .news-detail-header-actions{font-size:0}.news-detail-header-actions::after{content:"свайп";font-size:10px;color:var(--muted)}
  .news-load-more-sentinel{height:54px}
}


/* ===== Web Stage 2A: Identity session + account UI ===== */
.profile-copy{min-width:0;flex:1}.profile-login-btn,.profile-logout-btn{flex:0 0 auto;cursor:pointer}
.profile-user-card{align-items:center}.profile-avatar.signed{background:#0A2547;color:#fff;box-shadow:0 5px 18px rgba(10,37,71,.18)}
.profile-badges{display:flex;flex-wrap:wrap;gap:7px;margin-top:9px}.profile-badge{display:inline-flex;align-items:center;min-height:24px;padding:4px 8px;border-radius:999px;background:var(--surface-soft);color:var(--muted);font-size:11px;font-weight:700}.profile-badge.ok{background:rgba(33,161,121,.10);color:var(--green)}
.settings-list button:not(:disabled){cursor:pointer}.settings-list button:not(:disabled):hover{background:var(--surface-soft)}
.auth-modal{position:fixed;inset:0;margin:auto;width:min(520px,calc(100vw - 40px));height:max-content;max-width:none;max-height:min(800px,calc(100vh - 56px))}
.auth-modal-card{width:100%;background:var(--surface);border:1px solid rgba(220,227,234,.9);border-radius:24px;box-shadow:0 28px 90px rgba(13,27,42,.28);overflow:hidden}
.auth-modal-header{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:22px 22px 14px}.auth-kicker{font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.055em;color:var(--blue)}.auth-modal-header h3{font-size:24px;line-height:1.2;margin:5px 0 4px}.auth-modal-header p{margin:0;color:var(--muted);font-size:13px;line-height:1.45}.modal-close{border:0;background:var(--surface-soft);width:38px;height:38px;border-radius:12px;display:grid;place-items:center;cursor:pointer;font-size:22px;flex:0 0 auto}
.auth-form{display:grid;gap:13px;padding:8px 22px 22px}.auth-form label{display:grid;gap:6px}.auth-form label>span{font-size:12px;font-weight:750;color:var(--muted)}.auth-form input{width:100%;height:46px;border:1px solid var(--border);background:var(--surface);border-radius:13px;padding:0 13px;outline:0;color:var(--text)}.auth-form input:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(47,128,237,.09)}.auth-submit{width:100%;min-height:46px;cursor:pointer;font-size:14px}.auth-submit:disabled{opacity:.55;cursor:wait}
.auth-links{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:28px}.text-btn{border:0;background:transparent;color:var(--blue);padding:4px 0;cursor:pointer;font-size:12px;font-weight:700;text-align:left}.auth-stage-note{color:var(--muted);font-size:11px;text-align:right}.auth-message{margin:2px 22px 8px;padding:11px 12px;border-radius:12px;background:rgba(47,128,237,.08);color:var(--text);font-size:12px;line-height:1.45}.auth-message.error{background:rgba(229,72,77,.09);color:#b4232a}.auth-message.success{background:rgba(33,161,121,.10);color:#187a5e}
.auth-security-note{border-top:1px solid var(--border);padding:13px 22px 16px;color:var(--muted);font-size:10.5px;line-height:1.45;background:var(--surface-soft)}
.desktop-swipe-copy{display:inline-flex;align-items:center;justify-content:flex-end}

@media (max-width:800px){
  .profile-card{align-items:flex-start;flex-wrap:wrap}.profile-login-btn,.profile-logout-btn{width:100%;margin-top:4px}
  .auth-modal{position:fixed;inset:auto 0 0 0;margin:0;width:100vw;max-width:none;height:auto;max-height:calc(100dvh - 28px)}
  .auth-modal-card{border-radius:24px 24px 0 0;max-height:calc(100dvh - 28px);overflow:auto;padding-bottom:env(safe-area-inset-bottom)}
  .auth-modal-header{padding:19px 17px 12px}.auth-form{padding:7px 17px 19px}.auth-message{margin-left:17px;margin-right:17px}.auth-security-note{padding-left:17px;padding-right:17px}
  .auth-links{align-items:flex-start;flex-direction:column}.auth-stage-note{text-align:left}
}


/* ===== Web Stage 2B: personalized state, compact auth, account settings ===== */

/* Author CSS must not override the semantic hidden attribute. */
[hidden]{display:none!important}
.auth-form[hidden]{display:none!important}
.auth-modal{width:min(480px,calc(100vw - 40px));height:auto;max-height:none}
.auth-modal-card{overflow:clip}
.auth-modal-header{padding-bottom:10px}
.auth-form{padding-top:5px}
.auth-security-note{font-size:10px}
.auth-modal::backdrop,.prefs-modal::backdrop{background:rgba(13,27,42,.45);backdrop-filter:blur(2px)}

.chip.locked{opacity:.52;cursor:pointer}
.news-card.read{opacity:.72}
.news-card.read .news-title{font-weight:620}
.news-card-actions{display:flex;align-items:center;justify-content:flex-end;gap:7px;margin-top:10px;opacity:0;transition:.15s}
.news-card:hover .news-card-actions,.news-card:focus-within .news-card-actions{opacity:1}
.news-state-btn{border:1px solid var(--border);background:var(--surface-soft);height:31px;padding:0 9px;border-radius:10px;display:inline-flex;align-items:center;gap:5px;cursor:pointer;color:var(--muted);font-size:11px;font-weight:700}
.news-state-btn:hover{background:var(--surface);color:var(--text)}
.news-state-btn.active{border-color:color-mix(in srgb,var(--blue),transparent 55%);background:rgba(47,128,237,.09);color:var(--blue)}
.news-state-btn.favorite.active{color:#d78a00;border-color:rgba(245,158,11,.35);background:rgba(245,158,11,.10)}
.news-state-btn .state-symbol{font-size:15px;line-height:1}

.news-detail-state-actions{display:flex;gap:9px;flex-wrap:wrap;margin-top:24px}
.state-action{border:1px solid var(--border);background:var(--surface-soft);border-radius:12px;padding:10px 12px;cursor:pointer;font-weight:720;font-size:12px;display:inline-flex;align-items:center;gap:6px}
.state-action.active{border-color:color-mix(in srgb,var(--blue),transparent 55%);background:rgba(47,128,237,.09);color:var(--blue)}
#detail-favorite-toggle.active{color:#d78a00;border-color:rgba(245,158,11,.35);background:rgba(245,158,11,.10)}

.empty-state-wrap{width:min(100%,460px);margin:22px auto;display:grid;gap:10px}
.offer-grid .empty-state-wrap{grid-column:1/-1;justify-self:center}
.empty-state-wrap .empty-card{width:100%;margin:0}
.empty-state-wrap .empty-card img{width:100%;height:auto;display:block}
.empty-state-wrap .notice-card{margin:0;text-align:center;padding:14px 18px;font-size:12px;line-height:1.5}
.offer-grid .empty-card,.card-list .empty-card{max-width:460px;margin-left:auto;margin-right:auto}

.prefs-modal{position:fixed;inset:0;margin:auto;width:min(600px,calc(100vw - 44px));height:auto;max-width:none;max-height:min(760px,calc(100vh - 60px))}
.prefs-modal-card{background:var(--surface);border:1px solid var(--border);border-radius:24px;box-shadow:0 28px 90px rgba(13,27,42,.28);overflow:hidden;display:grid;grid-template-rows:auto minmax(0,1fr) auto;max-height:min(760px,calc(100vh - 60px))}
.prefs-modal-header{padding:20px 20px 14px;display:flex;align-items:flex-start;justify-content:space-between;gap:14px;border-bottom:1px solid var(--border)}
.prefs-modal-header h3{margin:0;font-size:20px}.prefs-modal-header p{margin:5px 0 0;color:var(--muted);font-size:12px;line-height:1.45}
.prefs-list{padding:10px 12px;overflow:auto;background:var(--bg);scrollbar-width:thin}
.pref-row{background:var(--surface);border:1px solid var(--border);border-radius:14px;margin:7px 0;padding:11px 12px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center}
.pref-row strong{font-size:13px}.pref-row small{display:block;color:var(--muted);font-size:10px;margin-top:3px}
.switch{position:relative;width:42px;height:24px;display:inline-block}.switch input{position:absolute;opacity:0}.switch span{position:absolute;inset:0;background:#cfd6de;border-radius:999px;transition:.15s;cursor:pointer}.switch span::after{content:"";position:absolute;width:18px;height:18px;left:3px;top:3px;border-radius:50%;background:white;box-shadow:0 1px 4px rgba(0,0,0,.18);transition:.15s}.switch input:checked+span{background:var(--blue)}.switch input:checked+span::after{transform:translateX(18px)}
.prefs-footer{border-top:1px solid var(--border);padding:12px 16px;display:flex;align-items:center;justify-content:space-between;gap:12px;background:var(--surface)}.prefs-footer span{font-size:11px;color:var(--muted)}.prefs-footer .primary{cursor:pointer}

.source-saving{opacity:.68;pointer-events:none}
.sources-mode-auth{color:var(--green);font-weight:650}

@media (max-width:800px){
  .news-card-actions{opacity:1}
  .news-state-btn{height:32px}
  .auth-modal{position:fixed;inset:auto 0 0 0;margin:0;width:100vw;max-width:none;height:auto;max-height:none}
  .auth-modal-card{border-radius:24px 24px 0 0;max-height:none;overflow:hidden;padding-bottom:env(safe-area-inset-bottom)}
  .auth-modal-card::-webkit-scrollbar{display:none}
  .auth-modal-card{scrollbar-width:none}
  .auth-security-note{display:none}
  .prefs-modal{inset:auto 0 0 0;margin:0;width:100vw;max-width:none;height:auto;max-height:calc(100dvh - 28px)}
  .prefs-modal-card{border-radius:24px 24px 0 0;max-height:calc(100dvh - 28px);padding-bottom:env(safe-area-inset-bottom)}
  .prefs-list{scrollbar-width:none}.prefs-list::-webkit-scrollbar{display:none}
  .empty-state-wrap{width:min(100%,430px);margin:16px auto}
}


/* ===== Web Stage 2C: mobile parity + shared preferences ===== */
.news-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.news-summary{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:5;overflow:hidden}
.news-card.compact .news-summary{-webkit-line-clamp:2}
.news-card.compact .news-title{-webkit-line-clamp:2}

.profile-subpage{display:grid;gap:12px}.profile-subheader{display:flex;align-items:center;gap:12px;padding:14px 16px;border-radius:18px}.profile-subheader h2{margin:0;font-size:19px}.profile-subheader p{margin:3px 0 0;color:var(--muted);font-size:11px}.profile-back{width:40px;height:40px;border:0;border-radius:12px;background:var(--surface-soft);font-size:30px;line-height:1;cursor:pointer;color:var(--text)}
.profile-subcontent{display:grid;gap:12px}.profile-section-card{background:var(--surface);border:1px solid var(--border);border-radius:18px;overflow:hidden}.profile-section-title{padding:13px 15px 7px;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}
.setting-row{min-height:58px;padding:10px 14px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:14px;align-items:center;border-top:1px solid var(--border)}.setting-row:first-of-type{border-top:0}.setting-row strong{font-size:13px}.setting-row small{display:block;margin-top:3px;color:var(--muted);font-size:10.5px;line-height:1.35}.setting-row button.linkish{border:0;background:transparent;color:var(--blue);font-weight:750;cursor:pointer;padding:6px 0}.setting-row a{color:var(--blue);text-decoration:none;font-weight:700;font-size:12px}.setting-note{padding:12px 14px;color:var(--muted);font-size:11px;line-height:1.5}

.support-toolbar{display:flex;gap:9px;justify-content:space-between;align-items:center;padding:12px 14px}.support-toolbar p{margin:0;color:var(--muted);font-size:11px}.support-list{display:grid;gap:8px}.support-ticket{background:var(--surface);border:1px solid var(--border);border-radius:15px;padding:12px 13px;cursor:pointer}.support-ticket:hover{border-color:#b7c8db}.support-ticket-head{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}.support-ticket strong{font-size:13px}.support-ticket small{color:var(--muted);font-size:10px}.support-ticket p{margin:7px 0 0;color:var(--muted);font-size:11px;line-height:1.4;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.support-unread{min-width:22px;height:22px;border-radius:999px;background:var(--blue);color:white;display:grid;place-items:center;font-size:10px;font-weight:800}.support-status{display:inline-flex;padding:3px 7px;border-radius:999px;background:var(--surface-soft);font-size:9px;font-weight:750;color:var(--muted)}
.support-form{display:grid;gap:11px;padding:14px}.support-form label{display:grid;gap:5px}.support-form label span{font-size:11px;font-weight:750;color:var(--muted)}.support-form input,.support-form select,.support-form textarea,.support-reply textarea{width:100%;border:1px solid var(--border);background:var(--surface);border-radius:12px;padding:10px 11px;outline:0;color:var(--text);font:inherit}.support-form textarea{min-height:130px;resize:vertical}.support-thread{display:grid;gap:9px}.support-message{max-width:min(78%,650px);padding:10px 12px;border-radius:15px;background:var(--surface);border:1px solid var(--border)}.support-message.user{justify-self:end;background:rgba(47,128,237,.08);border-color:rgba(47,128,237,.20)}.support-message.admin{justify-self:start}.support-message small{display:block;color:var(--muted);font-size:9px;margin-top:5px}.support-reply{display:grid;gap:8px;padding:12px 0}.support-reply textarea{min-height:90px;resize:vertical}

.docs-list,.about-list{display:grid}.doc-row,.about-row{padding:12px 14px;border-top:1px solid var(--border);display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center}.doc-row:first-child,.about-row:first-child{border-top:0}.doc-row a{color:var(--text);text-decoration:none;font-weight:700;font-size:12px}.doc-row small,.about-row small{color:var(--muted);font-size:10px;line-height:1.4}.about-row strong{font-size:12px}.about-row .value{text-align:right;color:var(--muted);font-size:11px;max-width:420px}

.news-swipe-shell{position:relative;border-radius:16px;overflow:hidden}.news-swipe-underlay{position:absolute;inset:0;display:flex;align-items:center;padding:0 20px;background:rgba(33,161,121,.11);color:#187a5e;font-size:12px;font-weight:800}.news-swipe-underlay.right{justify-content:flex-start}.news-swipe-underlay.left{justify-content:flex-end}.news-swipe-underlay.unread{background:rgba(47,128,237,.10);color:var(--blue)}.news-swipe-shell>.news-card{position:relative;z-index:1;margin:0;will-change:transform;transition:transform .16s ease;background:var(--surface)}
.mobile-bottom-nav{transition:transform .2s ease}.mobile-bottom-nav.nav-hidden{transform:translateY(calc(100% + 18px))}

@media(max-width:800px){
  .news-title{line-height:1.34;min-height:2.68em;-webkit-line-clamp:2}
  .news-summary{line-height:1.42;min-height:4.26em;max-height:4.26em;-webkit-line-clamp:3}
  .news-card.compact .news-summary{min-height:2.84em;max-height:2.84em;-webkit-line-clamp:2}
  .news-card{touch-action:pan-y}
  .news-card-actions{display:none}
  .profile-subheader{border-radius:16px}
  .support-message{max-width:88%}
}


/* ===== Web Stage 2C.1: UX polish ===== */
.nav-icon,.mobile-icon{display:grid;place-items:center;flex:0 0 auto}
.nav-icon{width:24px;height:24px;font-size:0;text-align:initial}
.nav-icon svg,.mobile-icon svg{width:22px;height:22px;display:block;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.mobile-nav-item .mobile-icon{font-size:0}
.mobile-nav-item .mobile-icon svg{width:22px;height:22px}
.nav-item.active .nav-icon,.mobile-nav-item.active .mobile-icon{color:var(--orange)}
.mobile-nav-item.active .mobile-icon{background:rgba(255,138,0,.11)}
.nav-label{min-width:0}

.doc-copy{min-width:0;display:block}
.doc-row .doc-copy>a{display:block;line-height:1.35}
.doc-row .doc-meta{display:block;margin-top:4px;color:var(--muted);font-size:10px;line-height:1.35;font-weight:500}
.doc-chevron{align-self:center;color:var(--muted);font-size:18px}

.support-ticket-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:8px}
.support-ticket-meta small,.support-ticket-meta time{color:var(--muted);font-size:9.5px;line-height:1.3}
.support-ticket-meta time{white-space:nowrap;text-align:right}
.support-message small{display:flex;align-items:center;justify-content:space-between;gap:12px}
.support-message small time{white-space:nowrap}

.news-swipe-shell{transition:height .24s ease,opacity .18s ease,margin .24s ease}
.news-swipe-shell>.news-card{transform-origin:center}

@media(max-width:800px){
  .support-ticket-meta{align-items:flex-end}
  .support-message small{display:grid;grid-template-columns:1fr;gap:2px}
  .support-message small time{white-space:normal}
}


/* ===== Public RC1 origin ===== */
.dev-ribbon{display:none!important}
.app-shell{padding-top:0!important}
.desktop-sidebar{top:0!important}


/* ===== Public RC2: badges, publications, Web Push ===== */
.nav-item{position:relative}.nav-item .nav-label{min-width:0}
.nav-badge{margin-left:auto;min-width:20px;height:20px;padding:0 6px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;background:#ff7a00;color:#fff;font-size:11px;font-weight:800;line-height:1;font-variant-numeric:tabular-nums}
.mobile-nav-item{position:relative}
.mobile-nav-badge{position:absolute;top:0;left:50%;transform:translateX(7px);min-width:17px;height:17px;padding:0 4px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;background:#ff7a00;color:#fff;font-size:9px;font-weight:850;line-height:1;box-shadow:0 0 0 2px rgba(255,255,255,.97);font-variant-numeric:tabular-nums}
.publications-intro{display:flex;align-items:center;justify-content:space-between;gap:16px}.publications-intro>p{margin:0;color:var(--muted)}
.publication-list{display:flex;flex-direction:column;gap:10px}
.publication-list .publication-card{width:100%;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:14px;padding:15px 16px;border-radius:17px;overflow:hidden}
.publication-list .publication-body{padding:0;min-width:0}.publication-list .publication-title{margin:0 0 6px;font-size:16px;line-height:1.38}
.publication-list .publication-excerpt{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;font-size:13px;line-height:1.48}
.publication-list .publication-meta{margin-top:8px;color:var(--muted);font-size:11px}.publication-list .card-link{align-self:end;padding:0;white-space:nowrap}
.publication-list .publication-thumb{width:112px;height:74px;aspect-ratio:auto;border-radius:12px;object-fit:cover;grid-row:1 / span 2}
.push-status-card{display:flex;flex-direction:column;gap:13px}.push-state-line{display:flex;align-items:center;gap:9px;font-size:14px}
.push-state-dot{width:9px;height:9px;border-radius:50%;background:#aab3bf;flex:0 0 auto}.push-state-dot.on{background:var(--green)}.push-state-dot.off{background:#e15b64}
.push-actions{display:flex;flex-wrap:wrap;gap:8px}.push-help{font-size:12px;line-height:1.5;color:var(--muted)}.push-help strong{color:var(--text)}
@media(max-width:800px){
  .publications-intro{display:block}.publications-intro .compact-search{margin-top:10px}
  .publication-list .publication-card{grid-template-columns:minmax(0,1fr);padding:13px 14px}.publication-list .publication-thumb{display:none}
  .publication-list .publication-excerpt{-webkit-line-clamp:3}.publication-list .card-link{margin-top:2px}
}


/* ===== Public RC2.2 UI polish ===== */

/* Notifications */
.push-status-card{
  display:block;
  padding:18px 18px 16px;
  overflow:visible;
}
.push-status-head{
  display:grid;
  grid-template-columns:38px minmax(0,1fr);
  gap:12px;
  align-items:start;
}
.push-status-icon{
  width:38px;
  height:38px;
  border-radius:12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
  font-weight:850;
  background:var(--surface-soft);
  color:var(--muted);
  border:1px solid var(--border);
}
.push-status-icon.enabled{
  background:rgba(31,157,103,.10);
  color:var(--green);
  border-color:rgba(31,157,103,.18);
}
.push-status-icon.blocked{
  background:rgba(225,91,100,.09);
  color:#c94751;
  border-color:rgba(225,91,100,.18);
}
.push-status-icon.info{
  background:rgba(47,128,237,.09);
  color:var(--blue);
  border-color:rgba(47,128,237,.16);
}
.push-status-copy{
  min-width:0;
  padding-top:1px;
}
.push-status-copy>strong{
  display:block;
  font-size:14px;
  line-height:1.35;
}
.push-help{
  margin-top:5px;
  color:var(--muted);
  font-size:11.5px;
  line-height:1.55;
}
.push-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:15px;
  padding-left:50px;
}
.push-actions .primary,
.push-actions .secondary{
  min-height:38px;
  border-radius:12px;
  padding:9px 13px;
  cursor:pointer;
}
.push-action-danger{
  color:#a84950;
}
.push-info-card{
  padding:4px 18px;
}
.push-info-row{
  display:grid;
  grid-template-columns:30px minmax(0,1fr);
  gap:10px;
  align-items:start;
  padding:13px 0;
}
.push-info-row+.push-info-row{
  border-top:1px solid var(--border);
}
.push-info-icon{
  width:30px;
  height:30px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--surface-soft);
  color:var(--muted);
  font-size:12px;
  font-weight:850;
}
.push-info-row strong{
  display:block;
  font-size:12px;
  line-height:1.35;
}
.push-info-row p{
  margin:3px 0 0;
  color:var(--muted);
  font-size:10.8px;
  line-height:1.5;
}

/* Feed sort segmented control */
.setting-row-sort{
  align-items:center;
}
.sort-segment{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:3px;
  padding:3px;
  min-width:340px;
  border:1px solid var(--border);
  border-radius:13px;
  background:var(--surface-soft);
}
.sort-segment-btn{
  min-height:34px;
  border:0;
  border-radius:9px;
  padding:7px 11px;
  background:transparent;
  color:var(--muted);
  font:inherit;
  font-size:11.5px;
  font-weight:700;
  line-height:1.25;
  cursor:pointer;
  transition:background .15s ease,color .15s ease,box-shadow .15s ease,transform .15s ease;
}
.sort-segment-btn:hover:not(:disabled){
  color:var(--text);
  background:rgba(255,255,255,.65);
}
.sort-segment-btn.active{
  background:var(--surface);
  color:var(--text);
  box-shadow:0 1px 4px rgba(13,27,42,.10);
}
.sort-segment-btn:active:not(:disabled){
  transform:translateY(1px);
}
.sort-segment-btn:disabled{
  cursor:wait;
  opacity:.65;
}
.sort-segment-btn:focus-visible{
  outline:2px solid rgba(47,128,237,.32);
  outline-offset:1px;
}

@media(max-width:800px){
  .push-status-card{padding:15px 14px 14px}
  .push-status-head{grid-template-columns:34px minmax(0,1fr);gap:10px}
  .push-status-icon{width:34px;height:34px;border-radius:11px}
  .push-actions{padding-left:44px;margin-top:12px}
  .push-actions .primary,.push-actions .secondary{width:100%}
  .push-info-card{padding:3px 14px}
  .setting-row-sort{
    grid-template-columns:1fr;
    gap:9px;
  }
  .sort-segment{
    width:100%;
    min-width:0;
  }
  .sort-segment-btn{
    min-height:38px;
    padding:8px 8px;
    font-size:11px;
  }
}

@media(max-width:430px){
  .sort-segment{
    grid-template-columns:1fr;
  }
  .sort-segment-btn{
    text-align:center;
  }
}


/* ===== Public RC2.5: service switcher + iOS guide + small-phone hardening ===== */

/* Desktop: quiet cross-service navigation. */
.service-switcher{
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid var(--border);
}
.service-switcher-title{
  padding:0 12px 7px;
  color:var(--muted);
  font-size:9.5px;
  font-weight:800;
  letter-spacing:.065em;
  text-transform:uppercase;
}
.arp-service-link{
  min-height:52px;
  padding:8px 10px;
  border-radius:14px;
  display:grid;
  grid-template-columns:30px minmax(0,1fr) 16px;
  gap:10px;
  align-items:center;
  color:var(--muted);
  text-decoration:none;
  transition:background .15s ease,color .15s ease,transform .15s ease;
}
.arp-service-link:hover{
  background:var(--surface-soft);
  color:var(--text);
}
.arp-service-link:active{transform:translateY(1px)}
.arp-service-icon{
  width:30px;
  height:30px;
  display:block;
  object-fit:contain;
}
.arp-service-copy{min-width:0}
.arp-service-copy strong{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:12.5px;
  line-height:1.25;
}
.arp-service-copy small{
  display:block;
  margin-top:2px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--muted);
  font-size:9.5px;
  font-weight:500;
}
.arp-service-arrow{
  color:var(--muted);
  font-size:13px;
  text-align:center;
}

/* iPhone/iPad instructions are visible only when JS detects iOS outside standalone mode. */
.ios-push-guide{
  padding:17px 18px;
}
.ios-guide-title{
  display:flex;
  gap:11px;
  align-items:center;
  margin-bottom:13px;
}
.ios-guide-title>div{min-width:0}
.ios-guide-title strong{
  display:block;
  font-size:13px;
  line-height:1.35;
}
.ios-guide-title small{
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-size:10.5px;
}
.ios-guide-device{
  flex:0 0 auto;
  min-width:38px;
  height:30px;
  padding:0 7px;
  border-radius:10px;
  display:grid;
  place-items:center;
  background:var(--surface-soft);
  color:var(--text);
  font-size:10px;
  font-weight:850;
}
.ios-guide-steps{
  list-style:none;
  padding:0;
  margin:0;
  display:grid;
  gap:9px;
}
.ios-guide-steps li{
  display:grid;
  grid-template-columns:26px minmax(0,1fr);
  gap:9px;
  align-items:start;
  color:var(--muted);
  font-size:11px;
  line-height:1.5;
}
.ios-guide-steps li>span{
  width:26px;
  height:26px;
  border-radius:9px;
  display:grid;
  place-items:center;
  background:rgba(47,128,237,.09);
  color:var(--blue);
  font-size:10px;
  font-weight:850;
}
.ios-guide-steps strong{color:var(--text)}
.ios-guide-note{
  margin:12px 0 0;
  padding-top:11px;
  border-top:1px solid var(--border);
  color:var(--muted);
  font-size:10.5px;
  line-height:1.5;
}

/* Small phones: iPhone 8 / 375px class and narrower.
   Large phones and desktop keep the existing layout unchanged. */
@media(max-width:390px){
  :root{--bottom-nav:64px}

  .screen{
    padding:8px 7px 18px;
  }

  .topbar{
    height:54px;
    top:0;
    padding:0 9px 0 11px;
    gap:8px;
  }
  .topbar>div:first-child{
    min-width:0;
  }
  .topbar h1{
    max-width:210px;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
    font-size:18px;
    line-height:1.15;
  }
  .topbar-actions{
    flex:0 0 auto;
    gap:5px;
  }
  .icon-btn,.avatar-btn{
    width:36px;
    height:36px;
    min-width:36px;
    border-radius:11px;
    font-size:15px;
  }
  #refresh-btn{
    font-size:19px;
    line-height:1;
  }

  .profile-subpage{gap:9px}
  .profile-subheader{
    min-height:50px;
    gap:9px;
    padding:8px 9px;
    border-radius:14px;
  }
  .profile-back{
    flex:0 0 auto;
    width:34px;
    height:34px;
    border-radius:10px;
    font-size:24px;
    line-height:1;
    display:grid;
    place-items:center;
    padding:0 0 2px;
  }
  .profile-subheader>div{
    min-width:0;
  }
  .profile-subheader h2{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:16px;
  }
  .profile-subheader p{
    margin-top:2px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:9.5px;
  }

  .profile-section-card{
    border-radius:15px;
  }
  .setting-row{
    min-height:54px;
    padding:9px 11px;
    gap:9px;
  }
  .setting-row strong{font-size:12px}
  .setting-row small{font-size:9.5px}

  .push-status-card{
    padding:13px 11px 12px;
  }
  .push-status-head{
    grid-template-columns:32px minmax(0,1fr);
    gap:9px;
  }
  .push-status-icon{
    width:32px;
    height:32px;
    border-radius:10px;
  }
  .push-status-copy>strong{font-size:12.5px}
  .push-help{font-size:10px;line-height:1.48}
  .push-actions{
    padding-left:0;
    margin-top:11px;
    gap:6px;
  }
  .push-actions .primary,.push-actions .secondary{
    width:100%;
    min-height:38px;
    white-space:normal;
    line-height:1.25;
  }

  .ios-push-guide{
    padding:13px 11px;
  }
  .ios-guide-title{
    align-items:flex-start;
    gap:8px;
    margin-bottom:11px;
  }
  .ios-guide-title strong{font-size:12px}
  .ios-guide-title small{font-size:9.5px}
  .ios-guide-device{min-width:34px;height:28px}
  .ios-guide-steps{gap:8px}
  .ios-guide-steps li{
    grid-template-columns:24px minmax(0,1fr);
    gap:8px;
    font-size:10px;
  }
  .ios-guide-steps li>span{
    width:24px;
    height:24px;
    border-radius:8px;
  }
  .ios-guide-note{font-size:9.5px}

  .push-info-card{padding:2px 11px}
  .push-info-row{
    grid-template-columns:28px minmax(0,1fr);
    gap:8px;
    padding:11px 0;
  }
  .push-info-icon{width:28px;height:28px}
  .push-info-row strong{font-size:11px}
  .push-info-row p{font-size:9.5px}

  .sort-segment{
    gap:2px;
    padding:2px;
    border-radius:11px;
  }
  .sort-segment-btn{
    min-height:36px;
    border-radius:8px;
    padding:7px 6px;
    font-size:10px;
  }

  .mobile-bottom-nav{
    padding-left:2px;
    padding-right:2px;
  }
  .mobile-nav-item{
    min-width:0;
    flex:1 1 0;
    padding-left:1px;
    padding-right:1px;
    font-size:9px;
  }
  .mobile-nav-item .mobile-icon{
    width:34px;
    height:26px;
  }
  .mobile-nav-item .mobile-icon svg{
    width:20px;
    height:20px;
  }
  .mobile-nav-badge{
    transform:translateX(5px);
    min-width:16px;
    height:16px;
    padding:0 4px;
    font-size:8px;
  }

  .section-intro{
    padding:12px;
    border-radius:16px;
  }
  .section-intro h2{font-size:17px}
  .section-intro p{font-size:11px}

  .news-card{
    margin:7px 0;
    padding:11px;
    border-radius:15px;
  }
  .news-title{font-size:14px}
  .source-marker{max-width:70%}

  .sources-modal-header{
    gap:10px;
    padding:13px 11px 9px;
  }
  .sources-modal-header h3{font-size:17px}
  .modal-close{
    width:34px;
    height:34px;
    min-width:34px;
    border-radius:10px;
  }
  .sources-toolbar{padding-left:11px;padding-right:11px}
  .sources-footer{
    grid-template-columns:minmax(0,1fr);
    gap:7px;
  }
  .sources-footer-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    width:100%;
  }
  .sources-footer .primary,
  .sources-footer .secondary{
    width:100%;
    min-width:0;
  }

  .auth-modal-header{padding:15px 13px 9px}
  .auth-modal-header h3{font-size:20px}
  .auth-form{padding-left:13px;padding-right:13px}
  .auth-message{margin-left:13px;margin-right:13px}
}

/* 320–350 px: last-resort protection against clipped controls. */
@media(max-width:350px){
  .topbar h1{max-width:170px;font-size:17px}
  .screen{padding-left:6px;padding-right:6px}
  .profile-subheader{padding-left:7px;padding-right:7px}
  .sort-segment{grid-template-columns:1fr}
  .mobile-nav-item{font-size:8.5px}
}


/* ===== Public RC2.6: deterministic old/small iPhone layout =====
   JS adds .small-legacy-phone using the live CSS viewport (<=430 × <=820).
   This targets short/small phones such as iPhone 8/8 Plus without changing tall
   modern devices that already looked correct. */
.small-legacy-phone .screen{
  padding-left:7px!important;
  padding-right:7px!important;
}
.small-legacy-phone .topbar{
  height:54px!important;
  top:0!important;
  padding-left:10px!important;
  padding-right:9px!important;
  gap:7px!important;
}
.small-legacy-phone .topbar>div:first-child{
  min-width:0!important;
  flex:1 1 auto!important;
}
.small-legacy-phone .topbar h1{
  max-width:100%!important;
  font-size:18px!important;
  line-height:1.1!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.small-legacy-phone .topbar-actions{
  flex:0 0 auto!important;
  gap:5px!important;
}
.small-legacy-phone .icon-btn,
.small-legacy-phone .avatar-btn{
  flex:0 0 35px!important;
  width:35px!important;
  min-width:35px!important;
  height:35px!important;
  padding:0!important;
  border-radius:10px!important;
  display:grid!important;
  place-items:center!important;
}
.small-legacy-phone #refresh-btn{
  font-size:18px!important;
  line-height:1!important;
}
.small-legacy-phone .profile-subpage{gap:8px!important}
.small-legacy-phone .profile-subheader{
  min-height:48px!important;
  padding:7px 8px!important;
  gap:8px!important;
  border-radius:13px!important;
}
.small-legacy-phone .profile-back{
  flex:0 0 32px!important;
  width:32px!important;
  min-width:32px!important;
  height:32px!important;
  padding:0 0 2px!important;
  border-radius:9px!important;
  display:grid!important;
  place-items:center!important;
  font-size:23px!important;
  line-height:1!important;
}
.small-legacy-phone .profile-subheader>div{
  min-width:0!important;
  overflow:hidden!important;
}
.small-legacy-phone .profile-subheader h2{
  margin:0!important;
  font-size:15.5px!important;
  line-height:1.15!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.small-legacy-phone .profile-subheader p{
  margin:2px 0 0!important;
  max-width:100%!important;
  font-size:9px!important;
  line-height:1.2!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.small-legacy-phone .profile-section-card{border-radius:14px!important}
.small-legacy-phone .setting-row{
  min-height:52px!important;
  padding:8px 10px!important;
  gap:8px!important;
}
.small-legacy-phone .setting-row strong{font-size:11.5px!important}
.small-legacy-phone .setting-row small{font-size:9px!important}
.small-legacy-phone .push-status-card{padding:12px 10px!important}
.small-legacy-phone .push-status-head{
  grid-template-columns:30px minmax(0,1fr)!important;
  gap:8px!important;
}
.small-legacy-phone .push-status-icon{
  width:30px!important;height:30px!important;border-radius:9px!important;
}
.small-legacy-phone .push-status-copy>strong{font-size:12px!important}
.small-legacy-phone .push-help{font-size:9.5px!important;line-height:1.45!important}
.small-legacy-phone .push-actions{
  padding-left:0!important;
  margin-top:10px!important;
  gap:6px!important;
}
.small-legacy-phone .push-actions .primary,
.small-legacy-phone .push-actions .secondary{
  width:100%!important;
  min-height:37px!important;
  padding:8px 10px!important;
  white-space:normal!important;
  line-height:1.2!important;
}
.small-legacy-phone .sort-segment{
  width:100%!important;
  min-width:0!important;
  grid-template-columns:1fr!important;
  gap:2px!important;
  padding:2px!important;
}
.small-legacy-phone .sort-segment-btn{
  min-height:35px!important;
  padding:7px 6px!important;
  font-size:10px!important;
}
.small-legacy-phone .mobile-bottom-nav{
  padding-left:2px!important;
  padding-right:2px!important;
}
.small-legacy-phone .mobile-nav-item{
  min-width:0!important;
  flex:1 1 0!important;
  padding-left:1px!important;
  padding-right:1px!important;
  font-size:8.7px!important;
}
.small-legacy-phone .mobile-nav-item .mobile-icon{
  width:32px!important;height:25px!important;
}
.small-legacy-phone .mobile-nav-item .mobile-icon svg{
  width:19px!important;height:19px!important;
}
.small-legacy-phone .mobile-nav-badge{
  min-width:15px!important;height:15px!important;padding:0 3px!important;font-size:8px!important;
}
.small-legacy-phone .section-intro{
  padding:11px!important;
  border-radius:15px!important;
}
.small-legacy-phone .news-card{
  margin:7px 0!important;
  padding:10px!important;
  border-radius:14px!important;
}
.small-legacy-phone .sources-modal-header{
  padding:12px 10px 8px!important;
  gap:8px!important;
}
.small-legacy-phone .modal-close{
  flex:0 0 32px!important;
  width:32px!important;height:32px!important;
  min-width:32px!important;
  padding:0!important;
  border-radius:9px!important;
}
.small-legacy-phone .sources-footer{
  grid-template-columns:1fr!important;
  gap:7px!important;
}
.small-legacy-phone .sources-footer-actions{
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  width:100%!important;
}
.small-legacy-phone .sources-footer .primary,
.small-legacy-phone .sources-footer .secondary{
  width:100%!important;
  min-width:0!important;
}
.small-legacy-phone .auth-modal-header{
  padding:14px 12px 8px!important;
}
.small-legacy-phone .auth-modal-header h3{font-size:19px!important}
.small-legacy-phone .auth-form{
  padding-left:12px!important;
  padding-right:12px!important;
}


/* ===== Public RC2.7: Web registration ===== */
.profile-guest-actions{
  display:flex;
  flex:0 0 auto;
  gap:8px;
  align-items:center;
}
.profile-register-btn{cursor:pointer}

.auth-register-form{
  gap:11px;
}
.auth-register-form .field-hint{
  margin-top:-2px;
  color:var(--muted);
  font-size:9.5px;
}
.register-consents{
  display:grid;
  gap:5px;
  padding-top:2px;
}
.auth-form label.consent-row{
  display:grid;
  grid-template-columns:22px minmax(0,1fr);
  gap:9px;
  align-items:start;
  padding:7px 8px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--surface-soft);
}
.auth-form label.consent-row>input{
  width:18px;
  height:18px;
  margin:1px 0 0;
  padding:0;
  accent-color:var(--blue);
  box-shadow:none;
}
.auth-form label.consent-row>span{
  display:block;
  color:var(--text);
  font-size:10.5px;
  font-weight:550;
  line-height:1.45;
}
.consent-row a{
  color:var(--blue);
  text-decoration:none;
  font-weight:700;
}
.consent-row a:hover{text-decoration:underline}
.consent-row.optional{background:transparent}
.consent-row.optional small{
  display:block;
  margin-top:4px;
  color:var(--muted);
  font-size:9.5px;
  font-weight:500;
}
.registration-status-note{
  padding:9px 10px;
  border-radius:11px;
  font-size:10px;
  line-height:1.45;
  color:var(--muted);
  background:var(--surface-soft);
}
.registration-status-note.open{
  color:#187a5e;
  background:rgba(33,161,121,.09);
}
.registration-status-note.testing{
  color:#886110;
  background:rgba(245,158,11,.09);
}

@media(max-width:800px){
  .profile-guest-actions{
    width:100%;
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:7px;
    margin-top:4px;
  }
  .profile-guest-actions .profile-login-btn,
  .profile-guest-actions .profile-register-btn{
    width:100%;
    margin:0;
  }
  .auth-register-form{
    padding-bottom:14px;
  }
}

.small-legacy-phone .profile-guest-actions{
  grid-template-columns:1fr!important;
}
.small-legacy-phone .auth-register-form{
  gap:9px!important;
}
.small-legacy-phone .auth-form label.consent-row{
  grid-template-columns:20px minmax(0,1fr)!important;
  gap:7px!important;
  padding:6px 7px!important;
}
.small-legacy-phone .auth-form label.consent-row>input{
  width:17px!important;
  height:17px!important;
}
.small-legacy-phone .auth-form label.consent-row>span{
  font-size:9.5px!important;
  line-height:1.4!important;
}
.small-legacy-phone .consent-row.optional small{
  font-size:8.8px!important;
}


/* ===== Public RC2.8: remove obsolete 28px dev-ribbon offset ===== */
.topbar{top:0!important}
.tabs{top:72px!important}
@media(max-width:800px){
  .tabs{top:60px!important}
}
.small-legacy-phone .tabs{top:54px!important}
