*{box-sizing:border-box;margin:0;padding:0}

:root{
--bg:#020202;
--panel:#090a0d;
--panel-soft:#0e1015;
--line:rgba(255,255,255,.08);
--line-strong:rgba(255,255,255,.14);
--text:#f5f1e8;
--muted:#a59f95;
--brand:#d4a85a;
--brand-strong:#f1cc8c;
--brand-soft:rgba(212,168,90,.16);
--nav-h:60px;
--panel-w:100vw;
}

html,body{
height:100%;
background:#000;
}

html{
scroll-behavior:smooth;
}

body{
background:radial-gradient(circle at top,#15110a 0%,#050505 32%,#000 100%);
color:var(--text);
font-family:'Inter',sans-serif;
overflow:hidden;
display:flex;
justify-content:center;
color-scheme:dark;
}

button,input,select,textarea{
font:inherit;
}

button{
appearance:none;
}

a{
color:inherit;
text-decoration:none;
}

.hidden{
display:none!important;
}

.app{
max-width:420px;
width:100%;
height:100dvh;
min-height:100dvh;
background:linear-gradient(180deg,rgba(14,12,9,.75) 0%,rgba(3,3,3,.96) 18%,#000 100%);
display:flex;
flex-direction:column;
position:relative;
overflow:hidden;
isolation:isolate;
}

.topbar{
height:calc(44px + env(safe-area-inset-top));
padding:env(safe-area-inset-top) 20px 0;
background:linear-gradient(180deg,rgba(20,18,15,.98) 0%,rgba(10,10,9,.95) 64%,rgba(0,0,0,.92) 100%);
border-bottom:1px solid rgba(255,255,255,.04);
display:flex;
align-items:center;
justify-content:flex-start;
position:relative;
z-index:12;
backdrop-filter:blur(14px);
box-shadow:0 12px 24px rgba(0,0,0,.18);
}

.logo{
font-weight:800;
font-size:11px;
letter-spacing:.26em;
color:#f8f1e6;
}

.toast{
position:fixed;
top:calc(env(safe-area-inset-top) + 10px);
left:50%;
transform:translateX(-50%);
width:min(360px,calc(100vw - 28px));
padding:14px 16px;
border-radius:18px;
background:rgba(18,18,18,.92);
border:1px solid rgba(255,255,255,.08);
color:#f6ecdc;
font-size:13px;
line-height:1.5;
box-shadow:0 18px 40px rgba(0,0,0,.32);
backdrop-filter:blur(18px);
z-index:70;
}

.feed{
flex:1;
height:calc(100dvh - 44px - env(safe-area-inset-top));
overflow-y:auto;
overflow-x:hidden;
scroll-snap-type:y mandatory;
scroll-behavior:smooth;
-webkit-overflow-scrolling:touch;
overscroll-behavior-y:contain;
padding-top:0;
}

.card{
height:calc(100dvh - 44px - env(safe-area-inset-top));
min-height:calc(100dvh - 44px - env(safe-area-inset-top));
scroll-snap-align:start;
scroll-snap-stop:always;
display:flex;
flex-direction:column;
position:relative;
overflow:hidden;
}

.heroWrap{
position:relative;
height:min(36dvh,300px);
flex-shrink:0;
}

.hero{
width:100%;
height:100%;
object-fit:cover;
background:#080808;
display:block;
}

.heroFade{
position:absolute;
inset:auto 0 0 0;
height:42%;
background:linear-gradient(to top,rgba(0,0,0,.64),transparent);
pointer-events:none;
}

.heartBtn{
position:absolute;
top:16px;
right:18px;
width:42px;
height:42px;
border-radius:999px;
border:1px solid rgba(255,255,255,.16);
background:rgba(38,34,28,.34);
backdrop-filter:blur(14px);
color:#fff4e4;
display:flex;
align-items:center;
justify-content:center;
font-size:18px;
cursor:pointer;
transition:transform .22s ease,background .22s ease,border-color .22s ease,color .22s ease;
}

.heartBtn.saved{
background:rgba(212,168,90,.18);
border-color:rgba(241,204,140,.6);
color:var(--brand-strong);
}

.heartBtn:active{
transform:scale(.92);
}

.content{
min-height:0;
padding:16px 22px calc(120px + env(safe-area-inset-bottom));
flex:1;
display:flex;
flex-direction:column;
justify-content:flex-start;
}

.tag{
color:var(--brand-strong);
font-size:11px;
font-weight:600;
margin-bottom:12px;
letter-spacing:.16em;
text-transform:uppercase;
}

.title{
font-size:25px;
font-weight:800;
line-height:1.14;
letter-spacing:-.03em;
margin-bottom:12px;
}

.desc{
color:var(--muted);
font-size:14px;
line-height:1.6;
letter-spacing:.01em;
}

.publisherRow{
margin-top:auto;
display:flex;
align-items:center;
justify-content:space-between;
gap:14px;
padding-bottom:2px;
}

.publisherMeta{
display:flex;
align-items:center;
gap:12px;
min-width:0;
}

.badge{
width:42px;
height:42px;
border-radius:14px;
background:linear-gradient(145deg,#6b4f23,#d4a85a);
box-shadow:0 10px 30px rgba(212,168,90,.18);
display:flex;
align-items:center;
justify-content:center;
font-size:16px;
color:#120f09;
}

.metaText{
display:flex;
flex-direction:column;
gap:2px;
}

.metaLabel{
font-size:11px;
letter-spacing:.14em;
color:#837d72;
text-transform:uppercase;
}

.metaValue{
font-size:14px;
color:#eee5d6;
font-weight:600;
}

.readBtn{
background:linear-gradient(135deg,#c19045,#f1cc8c);
color:#120f09;
border:none;
padding:13px 20px;
border-radius:16px;
font-weight:800;
font-size:13px;
letter-spacing:.08em;
cursor:pointer;
box-shadow:0 12px 34px rgba(212,168,90,.18);
transition:transform .24s ease,box-shadow .24s ease;
}

.readBtn:active{
transform:translateY(1px) scale(.98);
}

.bottomNav{
position:fixed;
left:50%;
transform:translateX(-50%);
bottom:0;
width:min(420px,100vw);
height:calc(var(--nav-h) + env(safe-area-inset-bottom));
padding:6px 10px calc(7px + env(safe-area-inset-bottom));
background:linear-gradient(180deg,rgba(24,22,18,.95) 0%,rgba(10,10,10,.97) 48%,rgba(0,0,0,.99) 100%);
backdrop-filter:blur(22px);
border-top:1px solid rgba(255,255,255,.08);
display:grid;
grid-template-columns:repeat(5,1fr);
gap:4px;
z-index:20;
box-shadow:0 -18px 42px rgba(0,0,0,.34);
}

.navItem{
background:transparent;
color:#a7a194;
border:1px solid transparent;
border-radius:12px;
font-size:10px;
font-weight:700;
letter-spacing:.03em;
cursor:pointer;
transition:background .28s ease,color .28s ease,border-color .28s ease,transform .22s ease;
display:flex;
flex-direction:column;
align-items:center;
justify-content:center;
gap:3px;
padding:5px 2px;
}

.navItem.active{
color:#fff4e4;
background:rgba(212,168,90,.13);
border-color:rgba(212,168,90,.24);
box-shadow:inset 0 0 0 1px rgba(255,255,255,.02);
}

.navItem:active{
transform:scale(.98);
}

.navIcon{
width:20px;
height:20px;
display:flex;
align-items:center;
justify-content:center;
font-size:17px;
line-height:1;
flex-shrink:0;
}

.navIcon svg{
width:20px;
height:20px;
display:block;
stroke:currentColor;
stroke-linecap:round;
stroke-linejoin:round;
overflow:visible;
}

.navLabel{
font-size:10px;
line-height:1;
}

.screenPanel{
position:fixed;
top:calc(44px + env(safe-area-inset-top));
bottom:0;
left:50%;
width:min(420px,100vw);
transform:translateX(-50%);
display:flex;
justify-content:flex-end;
background:rgba(0,0,0,.42);
backdrop-filter:blur(10px);
opacity:0;
pointer-events:none;
transition:opacity .24s ease;
z-index:40;
overflow:hidden;
}

.screenPanel.active{
opacity:1;
pointer-events:auto;
}

.screenCard{
width:100%;
height:100%;
background:
radial-gradient(circle at top,rgba(212,168,90,.10),transparent 32%),
linear-gradient(180deg,#0f0d09 0%,#050505 22%,#020202 100%);
transform:translateY(102%);
transition:transform .26s cubic-bezier(.22,1,.36,1);
padding:14px 18px calc(72px + env(safe-area-inset-bottom));
overflow-y:auto;
-webkit-overflow-scrolling:touch;
border-top-left-radius:0;
border-top-right-radius:0;
border-top:1px solid rgba(255,255,255,.08);
box-shadow:0 -20px 50px rgba(0,0,0,.44);
}

.screenPanel.active .screenCard{
transform:translateY(0);
}

.screenHeader{
display:flex;
align-items:center;
justify-content:space-between;
gap:14px;
margin-bottom:20px;
padding-top:max(8px,env(safe-area-inset-top));
}

.screenHeader h2{
font-size:28px;
font-weight:800;
letter-spacing:-.03em;
}

.headerActions{
display:flex;
align-items:center;
gap:10px;
}

.sheetClose,
.primaryAction,
.ghostAction{
border-radius:14px;
padding:12px 15px;
cursor:pointer;
font-size:13px;
font-weight:700;
letter-spacing:.04em;
transition:transform .22s ease,background .22s ease,border-color .22s ease;
}

.sheetClose,
.ghostAction{
background:rgba(255,255,255,.04);
border:1px solid rgba(255,255,255,.10);
color:#f7f0e6;
}

.primaryAction{
background:linear-gradient(135deg,#c19045,#f1cc8c);
border:none;
color:#140f08;
}

.sheetClose:active,
.primaryAction:active,
.ghostAction:active{
transform:scale(.98);
}

.stackForm{
display:flex;
flex-direction:column;
gap:14px;
}

.fieldLabel{
display:block;
margin-bottom:12px;
font-size:12px;
font-weight:700;
letter-spacing:.14em;
color:#d1c7b7;
text-transform:uppercase;
}

.textInput{
width:100%;
background:rgba(255,255,255,.04);
border:1px solid rgba(255,255,255,.10);
color:var(--text);
border-radius:18px;
padding:16px 18px;
outline:none;
font-size:15px;
transition:border-color .22s ease,background .22s ease,box-shadow .22s ease;
}

.textInput:focus{
border-color:rgba(212,168,90,.44);
box-shadow:0 0 0 4px rgba(212,168,90,.10);
}

.actionRow{
display:flex;
gap:12px;
}

.listView{
display:flex;
flex-direction:column;
gap:14px;
margin-top:18px;
}

.listCard{
background:linear-gradient(180deg,rgba(255,255,255,.04),rgba(255,255,255,.02));
border:1px solid rgba(255,255,255,.08);
border-radius:22px;
padding:16px;
display:flex;
flex-direction:column;
gap:10px;
}

.listCard h3{
font-size:18px;
line-height:1.42;
letter-spacing:-.02em;
}

.listMeta{
font-size:13px;
color:var(--muted);
line-height:1.6;
}

.listActions{
display:flex;
align-items:center;
justify-content:space-between;
gap:12px;
margin-top:4px;
}

.inlineAction{
display:flex;
align-items:center;
gap:12px;
}

.miniHeart{
width:36px;
height:36px;
border-radius:999px;
border:1px solid rgba(255,255,255,.12);
background:rgba(255,255,255,.03);
color:#f6eee2;
display:flex;
align-items:center;
justify-content:center;
cursor:pointer;
font-size:16px;
}

.miniHeart.saved{
color:var(--brand-strong);
border-color:rgba(241,204,140,.44);
background:rgba(212,168,90,.12);
}

.accountCard{
background:linear-gradient(180deg,rgba(255,255,255,.04),rgba(255,255,255,.02));
border:1px solid rgba(255,255,255,.08);
border-radius:24px;
padding:20px;
display:flex;
flex-direction:column;
gap:14px;
}

.accountCard h3{
font-size:24px;
font-weight:800;
letter-spacing:-.03em;
}

.mutedText{
color:var(--muted);
font-size:14px;
line-height:1.7;
}

.emptyState{
padding:24px 0;
color:var(--muted);
font-size:14px;
line-height:1.7;
}

.authSwitch{
font-size:13px;
color:#ddd3c5;
}

.linkBtn{
background:none;
border:none;
padding:0;
color:#f1cc8c;
cursor:pointer;
font-weight:700;
}

.inlineError{
font-size:13px;
line-height:1.5;
color:#ffb3b3;
background:rgba(121,25,25,.18);
border:1px solid rgba(255,112,112,.20);
padding:12px 14px;
border-radius:14px;
}

.chipGrid{
display:flex;
flex-wrap:wrap;
gap:10px;
}

.filterChip{
border:1px solid rgba(255,255,255,.10);
background:rgba(255,255,255,.03);
color:#e7ddcf;
padding:12px 14px;
border-radius:999px;
font-size:13px;
font-weight:600;
cursor:pointer;
transition:background .22s ease,border-color .22s ease,color .22s ease,transform .22s ease;
}

.filterChip.selected{
background:rgba(212,168,90,.14);
border-color:rgba(241,204,140,.42);
color:var(--brand-strong);
}

.filterChip:active{
transform:scale(.98);
}

.endCard{
min-height:calc(100dvh - 44px - env(safe-area-inset-top));
padding:40px 24px calc(126px + env(safe-area-inset-bottom));
display:flex;
align-items:center;
justify-content:center;
scroll-snap-align:start;
}

@media (max-height:780px){
.heroWrap{
height:min(32dvh,260px);
}

.title{
font-size:23px;
}
}

.endCardInner{
width:100%;
display:flex;
flex-direction:column;
align-items:center;
text-align:center;
gap:18px;
}

.endBadge{
width:84px;
height:84px;
border-radius:999px;
display:flex;
align-items:center;
justify-content:center;
background:linear-gradient(180deg,rgba(255,255,255,.05),rgba(255,255,255,.02));
border:1px solid rgba(255,255,255,.08);
font-size:34px;
color:#2ec27e;
}

.endTitle{
font-size:34px;
font-weight:800;
letter-spacing:-.04em;
}

.endText{
max-width:280px;
font-size:16px;
line-height:1.7;
color:var(--muted);
}

.endAction{
min-width:210px;
}

@media (max-width:420px){
.title{
font-size:28px;
}

.screenHeader h2{
font-size:26px;
}

.endTitle{
font-size:30px;
}
}
