/* Samuraigen guest + customer layer: 18+ gate, sign-in popup, Subscription page, guest sidebar. */
html:not(.sg-admin) :is(#sProfileSettings,#sProfileProjects,#sProfileBatches,#sPause,#sWorker,#sWorkflowTabs){display:none!important}
:root{--sg-bg:#0e0f11;--sg-card:#16181b;--sg-line:#ffffff1c;--sg-dim:#8a9099;--sg-txt:#eceef2}
.sg-lock{overflow:hidden}

/* ---------- 18+ gate ---------- */
.sg-age,.sg-login{position:fixed;inset:0;z-index:200;display:flex;align-items:center;justify-content:center;padding:18px;
  background:#0709098f;-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px)}
.sg-age[hidden],.sg-login[hidden]{display:none}
.sg-age-card{width:min(430px,100%);background:#141618;border:1px solid var(--sg-line);border-radius:22px;padding:22px;box-shadow:0 30px 90px #000a}
.sg-age-head{display:flex;align-items:center;gap:14px;margin-bottom:18px}
.sg-age-badge{width:44px;height:44px;border-radius:13px;border:1px solid var(--sg-line);background:#1d2024;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:15px}
.sg-age-head img{height:15px}
.sg-age h2{margin:0 0 8px;font-size:22px;letter-spacing:-.01em}
.sg-age p{margin:0 0 16px;color:var(--sg-dim);font-size:14px;line-height:1.55}
.sg-age-warn{display:flex;gap:11px;padding:13px 14px;border-radius:13px;background:#2a1618;border:1px solid #5a2a2e;color:#f0b4b8;font-size:13px;line-height:1.5;margin-bottom:14px}
.sg-age-warn i{flex:0 0 7px;height:7px;border-radius:50%;background:#ef6b73;margin-top:6px}
.sg-age-check{display:flex;gap:12px;align-items:flex-start;padding:14px;border:1px solid var(--sg-line);border-radius:13px;background:#181a1d;cursor:pointer;font-size:13px;line-height:1.5;color:#c9ced6;margin-bottom:14px}
.sg-age-check input{position:absolute;opacity:0;pointer-events:none}
.sg-age-check b{flex:0 0 20px;height:20px;border:1.5px solid #ffffff44;border-radius:6px;margin-top:1px;display:flex;align-items:center;justify-content:center}
.sg-age-check input:checked+b{background:#fff;border-color:#fff}
.sg-age-check input:checked+b:after{content:'';width:5px;height:9px;border:solid #111;border-width:0 2px 2px 0;transform:rotate(45deg) translate(-1px,-1px)}
.sg-age-check a{color:#fff;text-decoration:underline;text-underline-offset:2px}
.sg-btn{display:flex;align-items:center;justify-content:center;gap:9px;width:100%;min-height:46px;border-radius:12px;font:700 14px/1 inherit;cursor:pointer;text-decoration:none;border:1px solid var(--sg-line);background:#181a1d;color:#d7dbe2;padding:12px 16px}
.sg-btn:hover{background:#202327}
.sg-btn.primary{background:#fff;color:#111;border-color:#fff}
.sg-btn.primary:hover{background:#eee}
.sg-btn:disabled,.sg-btn[disabled]{opacity:.45;cursor:not-allowed}
.sg-age .sg-btn+.sg-btn{margin-top:10px}

/* ---------- sign-in popup ---------- */
.sg-login-card{position:relative;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);width:min(1120px,100%);height:min(780px,calc(100vh - 36px));
  background:#0f1113;border:1px solid var(--sg-line);border-radius:26px;overflow:hidden;box-shadow:0 40px 120px #000b}
.sg-x{position:absolute;top:16px;right:16px;z-index:5;width:40px;height:40px;border-radius:50%;border:1px solid var(--sg-line);background:#1a1c20;color:#ddd;font-size:20px;cursor:pointer}
.sg-x:hover{background:#25282d}
.sg-left{position:relative;margin:12px;border-radius:18px;overflow:hidden;background:#000}
.sg-slide{position:absolute;inset:0;opacity:0;transition:opacity .7s;background-size:cover;background-position:center}
.sg-slide.on{opacity:1}
.sg-left:after{content:'';position:absolute;inset:0;background:linear-gradient(to top,#000d,#0004 55%,#0000);pointer-events:none}
.sg-info{position:absolute;left:24px;right:24px;bottom:24px;z-index:2}
.sg-chips{display:flex;gap:8px;margin-bottom:12px}.sg-chips span{padding:6px 12px;border-radius:99px;background:#ffffff1f;border:1px solid #ffffff26;font-size:12px;font-weight:600;backdrop-filter:blur(6px)}
.sg-info h3{margin:0 0 8px;font-size:clamp(28px,4.2vw,46px);letter-spacing:-.02em;line-height:1}
.sg-info p{margin:0 0 20px;color:#d6dae0;font-size:14px;line-height:1.5;max-width:380px}
.sg-bars{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.sg-bars button{background:none;border:0;color:#9ea4ad;font:600 12px inherit;text-align:left;padding:0;cursor:pointer}
.sg-bars button i{display:block;height:3px;border-radius:2px;background:#ffffff33;margin-bottom:9px;overflow:hidden}
.sg-bars button i:after{content:'';display:block;height:100%;width:0;background:#fff}
.sg-bars button.on{color:#fff}
.sg-bars button.on i:after{width:100%;transition:width 6s linear}
.sg-right{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:36px;
  background-image:radial-gradient(circle,#ffffff33 1.2px,transparent 1.7px);background-size:15px 15px}
.sg-right h2{margin:0 0 8px;display:flex;align-items:center;gap:12px;font-size:clamp(22px,3vw,32px);letter-spacing:.01em;text-shadow:0 0 30px #fff5;flex-wrap:wrap;justify-content:center}
.sg-right h2 img{height:.8em}
.sg-right p{margin:0 0 30px;color:var(--sg-dim);font-size:14px}
.sg-oauth{position:relative;display:flex;align-items:center;justify-content:center;gap:12px;width:min(400px,100%);min-height:56px;margin-bottom:12px;border-radius:14px;border:1px solid var(--sg-line);background:#14161aea;color:#eceef2;font:700 15px inherit;text-decoration:none;cursor:pointer}
.sg-oauth:hover:not([disabled]){background:#1d2024}
.sg-oauth[disabled]{opacity:.5;cursor:not-allowed}
.sg-oauth em{position:absolute;right:0;top:-12px;font-style:normal;font-size:10px;letter-spacing:.14em;font-weight:700;color:#aeb4bd;background:#1b1d21;border:1px solid var(--sg-line);border-radius:8px 8px 0 0;padding:5px 10px}
.sg-or{display:flex;align-items:center;gap:14px;width:min(400px,100%);margin:6px 0 18px;color:var(--sg-dim);font-size:12px;letter-spacing:.2em}
.sg-or:before,.sg-or:after{content:'';flex:1;height:1px;background:var(--sg-line)}
@media(max-width:860px){.sg-login-card{grid-template-columns:1fr}.sg-left{display:none}.sg-right{padding:60px 22px 30px}}

/* ---------- guest sidebar ---------- */
.sg-guest{display:flex;flex-direction:column;gap:10px;padding:14px 4px 0}
.sg-guest-label{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:800;letter-spacing:.04em;color:#c7ccd4}
.sg-guest-label img{height:11px}
.sg-user{display:flex;align-items:center;gap:11px;padding:10px 4px}
.sg-user i{width:36px;height:36px;border-radius:50%;background:#2b2f36;display:flex;align-items:center;justify-content:center;font-style:normal;font-weight:800}
.sg-user b{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:110px}
.sg-bal{display:flex;justify-content:space-between;align-items:center;gap:8px;width:100%;padding:9px 12px;border-radius:12px;border:1px solid var(--sg-line);background:#15171a;color:#cfd3da;font-size:12px;cursor:pointer}
.sg-bal span{color:#fff;font-weight:700}
.sg-fab{display:none;position:fixed;top:12px;right:12px;z-index:60;min-height:38px;padding:8px 16px;border-radius:11px;border:0;background:#fff;color:#111;font:800 13px inherit;cursor:pointer}
@media(max-width:1023px){.sg-fab.on{display:block}}

/* ---------- Subscription page ---------- */
.sg-sub{position:fixed;top:0;right:0;bottom:0;left:216px;z-index:15;overflow:auto;background:var(--sg-bg);color:var(--sg-txt)}
.sg-sub[hidden]{display:none}
@media(max-width:1023px){.sg-sub{left:0;bottom:70px}}

.sg-sub-in{position:relative;max-width:1240px;margin:0 auto;padding:clamp(22px,4vw,44px) clamp(16px,3vw,28px) 40px}
.sg-kicker{font-size:11px;letter-spacing:.24em;font-weight:700;color:#9aa0a9}
.sg-sub h1{margin:8px 0 6px;font-size:clamp(34px,5vw,52px);letter-spacing:-.02em}
.sg-sub .lead{color:#aab0b9;max-width:520px;font-size:14px;line-height:1.55;margin:0}
.sg-paid{margin:16px 0 0;padding:12px 14px;border-radius:12px;background:#10251c;border:1px solid #1f5a3f;color:#8be0b2;font-size:13px}
.sg-sec-title{text-align:center;font-size:clamp(22px,3vw,32px);letter-spacing:.2em;font-weight:800;margin:clamp(46px,8vw,86px) 0 6px}
.sg-sub-note{text-align:center;color:#8a9099;font-size:11px;margin:0 0 16px;min-height:14px}
.sg-toggle{display:flex;justify-content:center;gap:8px;margin-bottom:26px}
.sg-toggle button{padding:8px 16px;border-radius:99px;border:1px solid transparent;background:transparent;color:#aab0b9;font:600 12px inherit;cursor:pointer}
.sg-toggle button.on{background:#fff;color:#111}
.sg-plans{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;align-items:stretch}
@media(max-width:1100px){.sg-plans{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){.sg-plans{grid-template-columns:1fr}}
.sg-plan{position:relative;display:flex;flex-direction:column;padding:22px 20px 20px;border-radius:20px;border:1px solid var(--sg-line);background:#14161a;overflow:hidden}
.sg-plan.dark{background:#08090a}
.sg-plan .pop{position:absolute;top:-1px;left:50%;transform:translateX(-50%);background:#fff;color:#111;font:800 11px inherit;padding:5px 14px;border-radius:0 0 11px 11px}
.sg-plan h3{margin:6px 0 14px;text-align:center;font-size:26px;letter-spacing:.14em}
.sg-plan .num{position:absolute;right:12px;top:12px;font-size:56px;font-weight:900;color:#ffffff0f;line-height:1;pointer-events:none}
.sg-row2{display:flex;justify-content:space-between;align-items:flex-end;gap:10px;border-top:1px solid var(--sg-line);padding-top:14px}
.sg-row2 small{display:block;font-size:10px;letter-spacing:.12em;color:#7d838c;font-weight:700;margin-bottom:6px}
.sg-price{font-size:38px;font-weight:900;letter-spacing:-.02em;line-height:1}
.sg-price-sub{font-size:11px;color:#7d838c;margin-top:4px;min-height:14px}
.sg-recv{text-align:right;font-weight:800;font-size:15px}
.sg-badge{align-self:center;margin:16px 0;padding:7px 18px;border-radius:9px;background:#07080a;border:1px solid var(--sg-line);font-size:11px;font-weight:800;letter-spacing:.12em;transform:skewX(-10deg)}
.sg-acc{border:1px solid var(--sg-line);border-radius:13px;background:#101215;margin-bottom:8px;overflow:hidden}
.sg-acc>button{display:flex;align-items:center;gap:10px;width:100%;padding:13px 14px;background:none;border:0;color:#eceef2;font:800 13px inherit;letter-spacing:.06em;cursor:pointer;text-align:left}
.sg-acc>button span{margin-left:auto;padding:4px 10px;border-radius:99px;background:#202328;font-size:11px;color:#c9ced6}
.sg-acc>button:after{content:'⌄';color:#8a9099}
.sg-acc.open>button:after{transform:rotate(180deg)}
.sg-acc div{display:none;padding:0 14px 14px;color:#9ba1aa;font-size:12.5px;line-height:1.55}
.sg-acc.open div{display:block}
.sg-plan .sg-btn{margin-top:auto}
.sg-plan .sg-accs{margin-bottom:12px}
.sg-packs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}
@media(max-width:1000px){.sg-packs{grid-template-columns:repeat(2,minmax(0,1fr))}}
.sg-pack{padding:18px;border-radius:16px;border:1px solid var(--sg-line);background:#14161a;text-align:left;color:inherit;cursor:pointer;font:inherit}
.sg-pack:hover{background:#1b1e22}
.sg-pack h4{margin:0 0 10px;font-size:26px;letter-spacing:-.01em}
.sg-pack b{font-size:14px}.sg-pack b em{font-style:normal;color:#8a9099;margin:0 6px}
.sg-pack small{display:block;margin-top:10px;color:#7d838c;font-size:11px;line-height:1.4}
.sg-tokhead{display:flex;align-items:center;justify-content:center;position:relative}
.sg-tokhead .sg-planpill{position:absolute;right:0;padding:8px 14px;border-radius:99px;border:1px solid var(--sg-line);background:#14161a;font-size:11px;color:#aab0b9}
@media(max-width:700px){.sg-tokhead .sg-planpill{display:none}}
.sg-foot{display:flex;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-top:40px;color:#7d838c;font-size:12px}
.sg-foot a{color:inherit;text-decoration:none;margin-right:16px}.sg-foot a:hover{color:#fff}
.sg-toast{position:fixed;left:50%;bottom:92px;transform:translateX(-50%);z-index:300;background:#1c1f23;border:1px solid var(--sg-line);color:#fff;padding:11px 18px;border-radius:12px;font-size:13px;box-shadow:0 10px 40px #000a}

/* sidebar user */
.sg-user{display:flex;align-items:center;gap:12px;padding:12px 2px 10px}
.sg-av{width:40px;height:40px;border-radius:50%;object-fit:cover;flex:none;background:#2b2f36}
.sg-user b{font-size:13px;font-weight:700;color:#e8ebf0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:120px}
.sg-bal{justify-content:space-between}
.sg-bal span{font-weight:800}
/* storage popover */
.sg-pop{position:fixed;z-index:120;padding:16px;border-radius:18px;background:#15171a;border:1px solid var(--sg-line);box-shadow:0 18px 60px #000a;display:flex;flex-direction:column;align-items:center;gap:6px}
.sg-pop[hidden]{display:none}
.sg-pop-sub{font-size:12px;color:#8a9099;margin-top:-6px}
.sg-pop-free{display:flex;justify-content:space-between;align-items:flex-end;width:100%;border-top:1px solid var(--sg-line);margin-top:8px;padding-top:12px}
.sg-pop-free small{display:block;font-size:10px;letter-spacing:.16em;color:#8a9099;font-weight:700}
.sg-pop-free b{font-size:20px}
.sg-pop-free span{font-size:12px;color:#8a9099}
/* My videos: three steps */
.sg-steps{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px;margin:12px 0}
.sg-step{position:relative;padding:48px 20px 22px;border:1px solid var(--sg-line);border-radius:16px;background:#131518}
.sg-step span{position:absolute;left:0;top:0;padding:8px 16px 8px 14px;border:1px solid var(--sg-line);border-width:0 1px 1px 0;border-radius:15px 0 14px 0;background:#1b1e22;font-size:10px;letter-spacing:.2em;font-weight:700;color:#aeb4bd}
.sg-step h3{margin:0 0 6px;font-size:17px;color:#fff}
.sg-step p{margin:0;font-size:13px;line-height:1.5;color:#7f8690}

/* guest: no storage meter until sign-in */
html.sg-guest #railStorage .vs-meter{display:none}
.sg-guest{padding-top:6px}

/* Subscription page: animated dots, floating cards, shimmer, spinner */
.sg-dots{position:absolute;top:0;left:0;pointer-events:none;z-index:0}
.sg-sub-body{position:relative;z-index:1}
@keyframes sgFloat{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:none}}
@keyframes sgShimmer{from{background-position:200% 0}to{background-position:-100% 0}}
@keyframes sgSpin{to{transform:rotate(360deg)}}
.sg-plan{animation:sgFloat .45s cubic-bezier(.2,.7,.2,1) both;animation-delay:calc(var(--i,0)*70ms)}
.sg-pack{animation:sgFloat .45s cubic-bezier(.2,.7,.2,1) both}
.sg-pack:nth-child(2){animation-delay:60ms}.sg-pack:nth-child(3){animation-delay:120ms}.sg-pack:nth-child(4){animation-delay:180ms}.sg-pack:nth-child(5){animation-delay:240ms}
.sg-sec-title.shimmer{background:linear-gradient(100deg,#fff 0%,#fff 35%,#7e848d 50%,#fff 65%,#fff 100%);background-size:300% 100%;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent;animation:sgShimmer 3s linear infinite}
.sg-sec-title.shimmer .sg-dd{-webkit-text-fill-color:initial}
.sg-btn.shimmer span{background:linear-gradient(100deg,#d7dbe2 0%,#d7dbe2 35%,#fff 50%,#d7dbe2 65%,#d7dbe2 100%);background-size:300% 100%;-webkit-background-clip:text;background-clip:text;color:transparent;animation:sgShimmer 5.8s linear infinite}
.sg-ring{display:inline-block;width:18px;height:18px;border-radius:50%;border:2px solid #ffffff3a;border-top-color:#fff;animation:sgSpin .9s linear infinite}
@media(prefers-reduced-motion:reduce){.sg-plan,.sg-pack,.sg-sec-title.shimmer,.sg-btn.shimmer span{animation:none}}
/* plan dropdown on Add tokens */
.sg-dd{position:absolute;right:0;top:50%;transform:translateY(-50%);font-size:12px;letter-spacing:0;font-weight:600}
.sg-planpill{position:static!important;padding:9px 14px;border-radius:99px;border:1px solid var(--sg-line);background:#14161a;font:600 12px inherit;color:#aab0b9;cursor:pointer}
.sg-planpill b{color:#fff;font-weight:700}.sg-planpill i{font-style:normal;margin-left:6px}
.sg-menu{position:absolute;right:0;top:calc(100% + 8px);z-index:5;width:240px;padding:8px;border-radius:16px;background:#17191d;border:1px solid var(--sg-line);box-shadow:0 20px 60px #000b;display:flex;flex-direction:column;gap:4px}
.sg-menu[hidden]{display:none}
.sg-menu button{display:flex;justify-content:space-between;align-items:center;width:100%;padding:13px 14px;border-radius:11px;border:0;background:transparent;color:#d6dae0;font:600 14px inherit;text-align:left;cursor:pointer}
.sg-menu button:hover,.sg-menu button.on{background:#25282d;color:#fff}
.sg-menu em{font-style:normal;color:#9aa0a9;font-size:13px}
@media(max-width:700px){.sg-dd{position:static;transform:none;margin-top:10px;display:block}.sg-tokhead{flex-direction:column}}
