/* Admin studio: reuses tokens from style.css */
.admin { min-height: 100vh; }
.admin label { display: grid; gap: 7px; font-size: 13.5px; font-weight: 600; color: #cfc6bf; margin-bottom: 16px; }
.admin label small { color: var(--dim); font-weight: 500; }
.admin input[type=text], .admin input[type=email], .admin input[type=password], .admin input[type=url], .admin input[type=search], .admin textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2);
  background: rgba(0,0,0,.35); color: var(--text); font: inherit; font-size: 15px; font-weight: 500; outline: none; transition: border-color .2s, box-shadow .2s;
}
.admin textarea { resize: vertical; min-height: 80px; }
.admin input:focus, .admin textarea:focus { border-color: rgba(255,120,60,.65); box-shadow: 0 0 0 3px rgba(255,91,31,.15); }
.admin input::placeholder, .admin textarea::placeholder { color: var(--dim); }
.form-error { color: #ff8a65; font-size: 14px; min-height: 0; margin: 0 0 12px; }
.form-error:empty { display: none; }
.hint { color: var(--muted); font-size: 13.5px; margin: -8px 0 16px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; position: relative; overflow: hidden; }
.login[hidden] { display: none; }
.login__glow { position: absolute; left: 50%; bottom: -70vh; width: 140vh; height: 100vh; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(closest-side, #0b0807 92%, transparent 93%), radial-gradient(closest-side, rgba(255,140,80,.9), rgba(255,91,31,.5) 60%, transparent 100%);
  box-shadow: 0 0 120px 30px rgba(255,91,31,.35); }
.login__glow::before { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 3px 0 rgba(255,220,190,.8), inset 0 10px 30px rgba(255,120,60,.6); }
.login__card { position: relative; width: min(420px, 100%); padding: 36px 32px; border-radius: 24px; background: linear-gradient(180deg, rgba(22,19,18,.92), rgba(10,9,8,.96)); border: 1px solid var(--line-2); backdrop-filter: blur(14px); box-shadow: 0 40px 100px -30px rgba(0,0,0,.9), 0 -20px 80px -40px rgba(255,91,31,.5); }
.login__card h1 { font-size: 30px; margin: 26px 0 6px; }
.login__card > p { color: var(--muted); margin-bottom: 26px; }
.login__back { display: block; text-align: center; margin-top: 18px; color: var(--muted); font-size: 14px; }
.login__back:hover { color: var(--text); }

/* ---------- dashboard ---------- */
.dash[hidden] { display: none; }
.dash__bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 14px 26px; background: rgba(10,8,7,.8); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.dash__crumb { color: var(--muted); font-size: 14px; padding-left: 14px; border-left: 1px solid var(--line-2); }
.dash__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.dash__user { color: var(--muted); font-size: 13.5px; }
.dash__main { max-width: 1280px; margin: 0 auto; padding: 28px 26px 60px; display: grid; grid-template-columns: minmax(340px, 440px) 1fr; gap: 22px; align-items: start; }
.panel { padding: 24px; border-radius: 22px; background: linear-gradient(180deg, #151211, #0c0a09); border: 1px solid var(--line); }
.panel > h2, .panel__head h2 { font-size: 21px; margin-bottom: 18px; }
.panel:first-child { position: sticky; top: 90px; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel__head input { max-width: 240px; padding: 9px 14px !important; }
.count { display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 7px; border-radius: 999px; background: rgba(255,91,31,.18); color: #ffc7a8; font-size: 13px; vertical-align: 3px; margin-left: 6px; }

.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 12px; background: rgba(0,0,0,.35); border: 1px solid var(--line); margin-bottom: 18px; }
.seg__btn { height: 38px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.seg__btn.is-on { background: #221d1b; color: var(--text); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }

.drop { position: relative; display: grid !important; place-items: center; min-height: 200px; border-radius: 16px; border: 1.5px dashed rgba(255,255,255,.16); background: rgba(255,255,255,.02); cursor: pointer; text-align: center; overflow: hidden; transition: border-color .2s, background .2s; margin-bottom: 8px !important; }
.drop:hover, .drop.is-over { border-color: var(--orange); background: rgba(255,91,31,.06); }
.drop__empty { display: grid; gap: 6px; justify-items: center; padding: 20px; }
.drop__empty b { font-size: 16px; color: var(--text); }
.drop__empty small { color: var(--muted); font-weight: 500; }
.drop__icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(180deg, var(--orange-2), var(--orange)); box-shadow: var(--glow); color: #fff; margin-bottom: 6px; }
.drop__icon svg { width: 22px; height: 22px; }
.drop.has-file .drop__empty { display: none; }
.drop__preview { max-height: 340px; width: 100%; object-fit: contain; background: #000; }
.file-name { font-size: 13px; color: var(--muted); margin: 0 0 16px; word-break: break-all; }
.file-name:empty { display: none; }

.link-preview { display: flex; gap: 14px; align-items: center; padding: 10px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(255,255,255,.03); margin-bottom: 16px; }
.link-preview img, .link-preview .ig { width: 64px; height: 84px; border-radius: 10px; object-fit: cover; flex: none; }
.link-preview .ig { display: grid; place-items: center; background: radial-gradient(120% 90% at 20% 110%, #ffb347 0%, #ff5b1f 30%, #c1258a 60%, #5b2bd1 100%); font-weight: 800; }
.link-preview b { display: block; font-size: 14.5px; }
.link-preview small { color: var(--muted); font-size: 13px; }

.row { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: start; }
.shape { border: 0; padding: 0; margin: 0 0 16px; display: grid; gap: 7px; }
.shape legend { font-size: 13.5px; font-weight: 600; color: #cfc6bf; padding: 0; margin-bottom: 7px; }
.shape label, .check { display: flex !important; align-items: center; gap: 8px; margin: 0 !important; font-weight: 500 !important; font-size: 14px !important; cursor: pointer; white-space: nowrap; }
.check { margin-bottom: 20px !important; }
.admin input[type=radio], .admin input[type=checkbox] { accent-color: var(--orange); width: 16px; height: 16px; }

.progress { position: relative; height: 34px; border-radius: 10px; background: rgba(0,0,0,.4); border: 1px solid var(--line-2); overflow: hidden; margin-bottom: 14px; }
.progress__bar { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--orange-deep), var(--orange-2)); box-shadow: 0 0 20px rgba(255,91,31,.6); transition: width .2s; }
.progress span { position: relative; display: grid; place-items: center; height: 100%; font-size: 13px; font-weight: 700; }

/* video list */
.vlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.vrow { display: grid; grid-template-columns: 18px 56px 1fr auto; gap: 14px; align-items: center; padding: 10px; border-radius: 14px; background: rgba(255,255,255,.025); border: 1px solid var(--line); transition: border-color .2s; }
.vrow:hover { border-color: var(--line-2); }
.vrow__thumb { width: 56px; height: 76px; border-radius: 9px; overflow: hidden; background: #000; position: relative; }
.vrow__thumb img, .vrow__thumb video { width: 100%; height: 100%; object-fit: cover; }
.vrow__thumb .ig { width: 100%; height: 100%; display: grid; place-items: center; font-weight: 800; font-size: 12px; background: radial-gradient(120% 90% at 20% 110%, #ffb347 0%, #ff5b1f 30%, #c1258a 60%, #5b2bd1 100%); }
.vrow__body { min-width: 0; }
.vrow__body b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vrow__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.06); color: #cfc6bf; }
.chip--hot { background: rgba(255,91,31,.18); color: #ffc7a8; }
.vrow__actions { display: flex; gap: 4px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.03); cursor: pointer; display: grid; place-items: center; color: var(--muted); transition: all .2s; }
.icon-btn:hover { color: var(--text); border-color: var(--line-2); background: rgba(255,255,255,.07); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.is-on { color: #ffb37a; border-color: rgba(255,91,31,.45); background: rgba(255,91,31,.12); }
.icon-btn.is-on svg { fill: currentColor; }
.icon-btn--danger:hover { color: #fff; background: #c2341a; border-color: #c2341a; }

/* dialog */
.edit { width: min(460px, 92vw); padding: 0; border-radius: 22px; border: 1px solid var(--line-2); background: linear-gradient(180deg, #171413, #0d0b0a); color: var(--text); }
.edit::backdrop { background: rgba(4,3,2,.75); backdrop-filter: blur(6px); }
.edit form { padding: 26px; }
.edit h3 { font-size: 21px; margin-bottom: 18px; }
.edit__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); padding: 12px 18px; border-radius: 12px; background: #1d1816; border: 1px solid var(--line-2); box-shadow: 0 20px 40px rgba(0,0,0,.6); font-size: 14.5px; font-weight: 600; opacity: 0; pointer-events: none; transition: all .3s; z-index: 200; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-err { border-color: rgba(255,91,31,.6); color: #ffb39a; }

@media (max-width: 900px) {
  .dash__main { grid-template-columns: 1fr; padding: 18px 14px 50px; }
  .panel:first-child { position: static; }
  .dash__bar { padding: 12px 14px; }
  .dash__user, .dash__crumb { display: none; }
}
@media (max-width: 520px) {
  .row { grid-template-columns: 1fr; }
  .vrow { grid-template-columns: 48px 1fr; }
  .vrow__thumb { width: 48px; height: 64px; }
  .vrow__actions { grid-column: 1 / -1; justify-content: flex-end; }
  .panel__head { flex-wrap: wrap; }
  .panel__head input { max-width: none; }
}

/* ---------- v2: Studio ---------- */
.login__card { text-align: center; }
.login__card label { text-align: left; }
.login__top { display: flex; align-items: center; justify-content: center; gap: 10px; }
.login__tag { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #ffc7a8; padding: 4px 10px; border-radius: 999px; background: rgba(255,91,31,.15); border: 1px solid rgba(255,91,31,.35); }
.login__avatar { width: 96px; height: 96px; margin: 22px auto 0; border-radius: 50%; object-fit: cover; object-position: 50% 20%; background: radial-gradient(circle, rgba(255,91,31,.35), transparent 70%); animation: hop 3.2s var(--spring) infinite; }
@keyframes hop { 0%, 70%, 100% { transform: translateY(0) scale(1); } 78% { transform: translateY(2px) scale(1.06, .94); } 86% { transform: translateY(-12px) scale(.97, 1.04); } 93% { transform: translateY(0) scale(1.03, .97); } }
.login__card h1 { margin-top: 14px; }
.shake { animation: shake .5s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

.or { display: flex; align-items: center; gap: 12px; margin: 16px 0 12px; color: var(--dim); font-size: 13px; font-weight: 600; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }
.title-field { margin-top: 16px; }
#linkInput, #rLink { margin-bottom: 4px; }
.link-preview { margin-top: 10px; }
.drop { transition: border-color .3s, background .3s, transform .6s var(--spring); }
.drop.is-over { transform: scale(1.02); }
.drop--sm { min-height: 110px; margin: 14px 0 0 !important; }
.edit__sub { color: var(--muted); font-size: 14px; margin: -8px 0 6px; }
.hint-inline { color: var(--muted); font-size: 13px; }
.hint-inline b { color: var(--text); letter-spacing: -2px; }
.empty { color: var(--muted); text-align: center; padding: 30px 0; }

.vrow { transition: transform .5s var(--spring), opacity .3s, border-color .2s, background .2s; animation: rowIn .6s var(--spring) both; }
.vrow:nth-child(2) { animation-delay: 30ms; } .vrow:nth-child(3) { animation-delay: 60ms; } .vrow:nth-child(4) { animation-delay: 90ms; }
@keyframes rowIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.vrow.is-drag { opacity: .4; transform: scale(.98); }
.vrow.is-over { border-color: var(--orange); background: rgba(255,91,31,.08); transform: translateY(4px); }
.vrow.is-leaving { opacity: 0; transform: translateX(30px) scale(.95); }
.grip { cursor: grab; color: #5b524c; font-weight: 900; letter-spacing: -3px; user-select: none; text-align: center; }
.vrow:hover .grip { color: var(--orange-2); }
.vrow__title { color: var(--text); font-family: inherit; outline: none; width: 100%; padding: 4px 8px !important; margin-left: -8px; border: 1px solid transparent !important; background: transparent !important; font-weight: 700 !important; font-size: 15px !important; border-radius: 8px !important; text-overflow: ellipsis; }
.vrow__title:hover { border-color: var(--line-2) !important; }
.vrow__title:focus { background: rgba(0,0,0,.35) !important; }
.vrow__actions { display: flex; align-items: center; gap: 6px; }
.move { display: inline-flex; gap: 2px; }
.move .icon-btn { width: 30px; height: 30px; }
.btn--danger { background: rgba(194,52,26,.18); border-color: rgba(194,52,26,.6); color: #ffb39a; }
.btn--danger:hover { background: #c2341a; color: #fff; }
@media (max-width: 520px) {
  .vrow { grid-template-columns: 14px 48px 1fr; }
  .vrow__actions { grid-column: 1 / -1; justify-content: flex-end; }
  .hint-inline { display: none; }
}
