:root{
  --bg:#16130f; --surface:#241e18; --surface2:#2f271f; --wall:#0e0b08; --text:#ede4d8; --muted:#b0a494;
  --accent:#34d399; --ink:#0e1116; --ok:#34d399; --warn:#fbbf24; --danger:#f87171; --info:#60a5fa;
  --r:12px; --rb:10px; --rim:rgba(255,240,220,.18);
  font-family:"Hanken Grotesk",system-ui,sans-serif; font-size:15px; line-height:1.55; color:var(--text);
}
:root[data-look=minimal]{ --bg:#111319; --surface:#1a1f27; --surface2:#272a30; --wall:transparent; --rim:transparent; --muted:#94a3b8; --text:#e1e2e9 }
*{box-sizing:border-box}
body{margin:0;background:var(--bg);min-height:100vh}
h1{font-size:1.5rem;margin:.2rem 0;font-weight:700}
h2{font-size:1.05rem;margin:0 0 .6rem;font-weight:700}
.muted{color:var(--muted)} .small{font-size:.85rem}
a{color:inherit}
[hidden]{display:none!important}

/* header */
.top{position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:1.1rem;padding:.6rem 10%;background:var(--bg);border-bottom:1px solid var(--surface2)}
.brand{font-weight:700;font-size:1.3rem;text-decoration:none;display:flex;align-items:center;gap:.15rem}
.logo{display:inline-grid;place-items:center;width:34px;height:34px;border-radius:10px;background:var(--accent);color:var(--ink);font-weight:700;box-shadow:0 4px 0 #1d8a63}
.logo.big{width:48px;height:48px;font-size:1.6rem}
.tabs{display:flex;gap:.35rem;flex:1}
.tab{padding:.5rem .9rem;border-radius:999px;text-decoration:none;font-weight:600;color:var(--muted);font-size:1.05rem}
.tab.on{color:var(--text);background:var(--surface)}
.more{position:relative}
.menu{position:absolute;right:0;top:110%;background:var(--surface);border-radius:var(--r);padding:.35rem;min-width:220px;box-shadow:0 10px 30px #000a;display:flex;flex-direction:column}
.menu button{background:none;color:inherit;border:0;text-align:left;padding:.6rem .8rem;border-radius:8px;font:inherit;cursor:pointer}
.menu button:hover{background:var(--surface2)}
.menu-who{padding:.5rem .8rem;color:var(--muted);font-size:.85rem;border-bottom:1px solid var(--surface2)}

/* clay controls */
button,.btn{font:inherit;font-weight:600;cursor:pointer;border:0;border-radius:var(--rb);padding:.6rem 1rem;min-height:40px;
  background:var(--surface2);color:var(--text);box-shadow:0 5px 0 var(--wall),inset 0 2px 0 var(--rim);transition:none;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:.35rem}
button:active,.btn:active{transform:translateY(4px) scale(1.03,.96);box-shadow:0 1px 0 var(--wall)}
.primary{background:var(--accent);color:var(--ink);box-shadow:0 5px 0 #1d8a63,inset 0 2px 0 rgba(255,255,255,.35)}
.ghost{background:transparent;box-shadow:none;color:inherit}
.ghost:hover{background:var(--surface2)}
.icon{padding:.4rem .7rem;font-size:1.3rem}
.icon.big{font-size:1.5rem;min-width:48px;min-height:48px}
.danger{color:var(--danger)}
button:disabled{opacity:.55;cursor:wait}
:focus-visible{outline:3px solid var(--info);outline-offset:2px}

/* layout */
main{width:80%;margin:0 auto;padding:1.1rem 0 3rem}
.card{background:var(--surface);border-radius:var(--r);padding:1.1rem;margin-bottom:1.1rem}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:.6rem;margin:.4rem 0 .6rem}
.card-head h2{margin:0}
.grid2{display:grid;grid-template-columns:1.1fr 1fr;gap:1.1rem}
.grid2>.card{margin:0;min-width:0}
.grid2{grid-template-columns:minmax(0,1.1fr) minmax(0,1fr)}
.grid2{margin-bottom:1.1rem}
.row{display:flex;gap:.8rem;flex-wrap:wrap}.row>div{flex:1;min-width:150px}
label{display:block;font-weight:500;margin:.8rem 0 .35rem;font-size:.9rem}
input,select,textarea{width:100%;font:inherit;color:var(--text);background:var(--bg);border:1px solid var(--surface2);border-radius:var(--rb);padding:.6rem .7rem;min-height:40px}
textarea{resize:vertical}
details summary{cursor:pointer;color:var(--muted);margin:.6rem 0}
#makeBtn{margin-top:1.1rem;width:100%;font-size:1.05rem;min-height:48px}
.hint{color:var(--danger);min-height:1em;margin:.5rem 0 0}
.drop{display:flex;gap:1rem;align-items:center;border:2px dashed var(--surface2);border-radius:var(--r);padding:1.1rem;cursor:pointer;margin:0}
.drop.over{border-color:var(--accent)}
.drop-big{display:grid;place-items:center;width:56px;height:56px;border-radius:14px;background:var(--accent);color:var(--ink);font-size:1.8rem;font-weight:700;box-shadow:0 5px 0 #1d8a63}
.picked{margin-top:.5rem;font-family:"JetBrains Mono",monospace;font-size:.85rem;display:flex;justify-content:space-between;align-items:center;background:var(--bg);border-radius:var(--rb);padding:.35rem .35rem .35rem .8rem}
.chips{display:flex;gap:.5rem;flex-wrap:wrap;margin:.5rem 0}
.chip{border-radius:999px;padding:.4rem .9rem;min-height:36px;font-weight:500}
.chip.on{background:var(--accent);color:var(--ink);box-shadow:0 4px 0 #1d8a63}
.list{display:flex;flex-direction:column;gap:.5rem;margin-bottom:.8rem}
.item{background:var(--bg);border-radius:var(--rb);padding:.7rem .8rem}
.item-row{display:flex;align-items:center;gap:.6rem;justify-content:space-between;flex-wrap:wrap}
.bar{height:6px;background:var(--surface2);border-radius:3px;margin-top:.45rem;overflow:hidden}
.bar>i{display:block;height:100%;background:var(--accent);border-radius:3px}
.badge{font-size:.72rem;font-weight:600;padding:.15rem .55rem;border-radius:999px;background:var(--surface2);color:var(--muted);white-space:nowrap}
.badge.published{background:rgba(52,211,153,.18);color:var(--ok)}
.badge.building,.badge.working{background:rgba(96,165,250,.18);color:var(--info)}
.badge.failed{background:rgba(248,113,113,.18);color:var(--danger)}
.seg{display:flex;background:var(--bg);border-radius:var(--rb);padding:3px}
.seg button{background:none;box-shadow:none;min-height:34px;padding:.3rem .8rem;color:var(--muted)}
.seg button.on{background:var(--surface2);color:var(--text)}
.bulk{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap;background:var(--bg);border-radius:var(--rb);padding:.4rem .6rem;margin-bottom:.8rem}
.bulk select{width:auto;min-height:36px}
.empty{text-align:center;padding:3rem 1rem;color:var(--muted)}

/* my shorts */
.shorts.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:.8rem}
.shorts.list{display:flex;flex-direction:column;gap:.4rem}
.sh{position:relative;background:var(--bg);border-radius:var(--r);overflow:hidden;cursor:pointer}
.sh img{display:block;width:100%;aspect-ratio:9/16;object-fit:cover;background:var(--surface2)}
.sh .meta{padding:.5rem .6rem}
.sh .t{font-weight:600;font-size:.9rem;line-height:1.3}
.sh .sel{position:absolute;top:.5rem;left:.5rem;width:24px;height:24px;min-height:0;accent-color:var(--accent)}
.shorts.list .sh{display:flex;align-items:center;gap:.8rem;padding-left:2.4rem}
.shorts.list .sh img{width:48px;aspect-ratio:9/16;border-radius:6px}
.shorts.list .sh .sel{top:50%;transform:translateY(-50%)}
.shorts.list .sh .meta{flex:1;display:flex;justify-content:space-between;align-items:center;gap:.6rem}

/* watch feed */
#watch{margin:-1.1rem 0 -3rem}
.feed{height:calc(100vh - 62px);overflow-y:scroll;scroll-snap-type:y mandatory;scrollbar-width:none}
.feed::-webkit-scrollbar{display:none}
.slide{height:calc(100vh - 62px);scroll-snap-align:start;display:flex;justify-content:center;align-items:center;gap:1rem;padding:.8rem 0}
.player{position:relative;height:100%;aspect-ratio:9/16;max-width:100%;border-radius:16px;overflow:hidden;background:#000}
.player video{width:100%;height:100%;object-fit:cover;display:block}
.overlay{position:absolute;left:0;right:0;bottom:0;padding:.5rem 1rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.9rem;background:linear-gradient(transparent,rgba(0,0,0,.75));pointer-events:none}
.overlay .who{font-weight:600}
.overlay .t{font-size:.9rem;opacity:.9}
.side{display:flex;flex-direction:column;gap:.8rem}
.side button{width:56px;height:56px;border-radius:50%;font-size:1.3rem;padding:0;flex-direction:column}
.side small{font-size:.72rem;color:var(--muted);text-align:center;display:block;margin-top:.2rem}
.tapnote{position:absolute;top:1rem;right:1rem;background:rgba(0,0,0,.6);border-radius:999px;padding:.3rem .8rem;font-size:.8rem;pointer-events:none}
.draftflag{position:absolute;top:1rem;left:1rem;background:var(--warn);color:var(--ink);border-radius:999px;padding:.2rem .7rem;font-size:.75rem;font-weight:700}

/* drawer */
.drawer{position:fixed;top:0;right:0;bottom:0;width:min(560px,100%);background:var(--surface);z-index:50;box-shadow:-10px 0 40px #000a;display:flex;flex-direction:column}
.drawer-head{display:flex;align-items:center;gap:.5rem;padding:.6rem;border-bottom:1px solid var(--surface2)}
.drawer-head h2{margin:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.drawer-body{overflow-y:auto;padding:1.1rem}
.drawer video{width:min(260px,70%);aspect-ratio:9/16;display:block;margin:0 auto 1rem;border-radius:12px;background:#000}
.scene{background:var(--bg);border-radius:var(--rb);padding:.6rem .8rem;margin:.5rem 0}
.scene .k{font-size:.72rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}
.actions{display:flex;gap:.5rem;flex-wrap:wrap;margin:.8rem 0}

.login{display:grid;place-items:center;min-height:80vh}
.login-card{max-width:420px;width:100%;text-align:center}
.login-card form{text-align:left}
.login-card .primary{width:100%;margin-top:.8rem}
#gbtn{display:flex;justify-content:center;margin:1rem 0}

.toast{position:fixed;left:50%;bottom:1.6rem;transform:translateX(-50%);background:var(--text);color:var(--bg);padding:.6rem 1.1rem;border-radius:999px;font-weight:600;opacity:0;pointer-events:none;z-index:60}
.toast.show{opacity:1}

@media (max-width:760px){
  main{width:92%}
  .top{padding:.5rem 4%;gap:.5rem}
  .brand{font-size:0}.brand .logo{font-size:1.1rem}
  .tab{padding:.45rem .7rem;font-size:1rem}
  .grid2{grid-template-columns:minmax(0,1fr)}
  #watch{margin:-1.1rem -4% -3rem}
  .slide{padding:0;position:relative}
  .player{border-radius:0;height:100%;width:100%;aspect-ratio:auto}
  .side{position:absolute;right:.5rem;top:15%}
  .side button{background:rgba(0,0,0,.45);color:#fff}
  .side small{color:#fff}
  .shorts.cards{grid-template-columns:repeat(2,1fr)}
}
@media (prefers-reduced-motion:reduce){button:active,.btn:active{transform:none}}

.src-link{display:block;color:var(--accent,#34d399);text-decoration:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#links{width:100%;resize:vertical}
.item,.item-row{min-width:0}.item-row b{overflow-wrap:anywhere}

.inline{display:flex;gap:.5rem;align-items:stretch}.inline input{flex:1;min-width:0;margin:0}
.h3{font-size:1rem}
.invited{background:rgba(52,211,153,.14);color:var(--ok);padding:.6rem .8rem;border-radius:var(--rb)}
.sheet{border:0;border-radius:var(--r);background:var(--surface);color:inherit;padding:1.2rem;width:min(460px,calc(100vw - 32px))}
.sheet::backdrop{background:#000a}
.sheet-actions{margin-top:1rem;justify-content:flex-end}
.pl-card{max-width:520px;margin:2rem auto;text-align:center}
.pl-card .big-n{font-size:2.4rem;font-weight:700;color:var(--accent)}
.pl-card .primary{margin-top:1rem;min-width:220px}
#reqBadge{margin-left:.3rem;background:var(--accent);color:var(--ink)}
.person{display:flex;align-items:center;justify-content:space-between;gap:.6rem;flex-wrap:wrap}
.person .who{min-width:0;overflow-wrap:anywhere}
