/* kzick v1.0.0 */
/* Admin page. K-Zick v2.2 tokens. */
:root {
  --bg: #000;
  --ink: #f4f1ea;
  --ink-2: rgba(244,241,234,.66);
  --ink-3: rgba(244,241,234,.42);
  --line: rgba(255,255,255,.08);
  --line-2: rgba(255,255,255,.14);
  --accent: #d4af37;
  --accent-hi: #f3d27a;
  --danger: #f87171;
  --tertiary: #22d3ee;
  --panel: rgba(14,14,16,.78);
  --edge: inset 1px 1px 0 rgba(255,255,255,.07), inset -1px -1px 0 rgba(0,0,0,.6);
  --seam: linear-gradient(90deg, transparent, var(--accent) 50%, transparent);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --display: "Anton", "Arial Black", Impact, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); }
body { color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; min-height: 100vh; overflow-x: hidden; }
body::before { content: ""; position: fixed; inset: -20% -10% auto auto; width: 900px; height: 900px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(212,175,55,.10), transparent 62%); filter: blur(30px); z-index: 0; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--ink); }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 40; background: rgba(0,0,0,.66); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--seam); opacity: .5; }
.top .in { max-width: 1440px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; gap: 16px; }
.mark { font-family: var(--display); font-size: 22px; letter-spacing: .04em; display: flex; align-items: baseline; gap: 8px; }
.mark b { font-weight: 400; background: linear-gradient(180deg, #fff4d6, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mark span { font: 700 10px var(--mono); letter-spacing: .2em; color: var(--ink-3); text-transform: uppercase; }
.spacer { flex: 1; }
.dirty { display: none; align-items: center; gap: 8px; font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-hi); }
.dirty i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
body.is-dirty .dirty { display: inline-flex; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px; font: 600 13px var(--sans);
  border: 1px solid var(--line-2); background: rgba(255,255,255,.03); transition: background .2s, border-color .2s, color .2s, opacity .2s; }
.btn:hover { border-color: rgba(255,255,255,.3); }
.btn.gold { background: var(--accent); border-color: var(--accent); color: #0b0b0b; }
.btn.gold:hover { background: var(--accent-hi); }
.btn.gold:disabled { opacity: .35; cursor: default; background: var(--accent); }
.btn.danger { background: rgba(248,113,113,.14); border-color: rgba(248,113,113,.5); color: #fecaca; }
.btn.danger:hover { background: rgba(248,113,113,.24); }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--ink-2); border: 1px solid transparent; transition: all .18s; }
.icon-btn:hover { color: var(--ink); background: rgba(255,255,255,.06); border-color: var(--line-2); }
.icon-btn.del:hover { color: var(--danger); border-color: rgba(248,113,113,.4); background: rgba(248,113,113,.08); }
.icon-btn:disabled { opacity: .25; pointer-events: none; }

/* ---------- layout ---------- */
.main { position: relative; z-index: 1; max-width: 1440px; margin: 0 auto; padding: 28px 24px 80px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 28px; align-items: start; }
.seg { display: none; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--edge), 0 20px 50px -24px rgba(0,0,0,.9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.ph { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.ph h2 { font-family: var(--display); font-weight: 400; font-size: 22px; letter-spacing: .03em; text-transform: uppercase; display: flex; align-items: baseline; gap: 10px; }
.ph h2 small { font: 500 11px var(--mono); color: var(--ink-3); letter-spacing: .1em; }

/* ---------- site text row ---------- */
.site { margin: 14px; padding: 14px 16px; border-radius: 12px; border: 1px dashed var(--line-2); display: grid; gap: 4px; position: relative; }
.site .k { font: 700 9.5px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.site .h { font-family: var(--display); font-size: 20px; letter-spacing: .02em; text-transform: uppercase; }
.site .l { color: var(--ink-2); font-size: 13px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding-right: 44px; }

/* ---------- project rows ---------- */
.list { list-style: none; padding: 0 14px 14px; display: grid; gap: 8px; }
.row { position: relative; display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 10px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(255,255,255,.02); transition: border-color .2s, background .2s; }
.row:hover, .row.open { border-color: rgba(212,175,55,.32); background: rgba(212,175,55,.04); }
.row.off { opacity: .5; }
.thumb { width: 74px; height: 48px; border-radius: 8px; overflow: hidden; position: relative; border: 1px solid var(--line-2);
  background: radial-gradient(120% 90% at 20% 0%, rgba(var(--tint),.55), transparent 65%), #0a0a0c; background-size: cover; background-position: center; }
.thumb.wide::after { content: ""; position: absolute; right: 5px; bottom: 5px; width: 14px; height: 6px; border-radius: 2px; border: 1px solid rgba(255,255,255,.7); }
.info { min-width: 0; display: grid; gap: 3px; }
.info .n { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 15px; }
.info .n .v { font: 500 10.5px var(--mono); color: var(--ink-3); font-weight: 500; }
.info .n .hid { font: 700 9px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 99px; padding: 2px 7px; }
.info .s { color: var(--ink-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info .m { font: 500 10.5px var(--mono); color: var(--ink-3); display: flex; gap: 10px; }
.info .m i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: rgb(var(--tint)); margin-right: 6px; vertical-align: 1px; }
.acts { display: flex; gap: 2px; opacity: 0; transform: translateX(6px); pointer-events: none; transition: opacity .2s, transform .2s; }
.row:hover .acts, .row.open .acts, .row:focus-within .acts { opacity: 1; transform: none; pointer-events: auto; }
.site .acts { position: absolute; right: 10px; top: 10px; }
.site:hover .acts, .site.open .acts { opacity: 1; transform: none; pointer-events: auto; }
.site:hover { border-color: rgba(212,175,55,.4); }

.add { margin: 0 14px 16px; width: calc(100% - 28px); height: 52px; border-radius: 12px; border: 1px dashed var(--line-2); color: var(--ink-2); display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 14px; transition: all .2s; }
.add:hover { border-color: var(--accent); color: var(--accent-hi); background: rgba(212,175,55,.05); }

/* ---------- preview ---------- */
.pv-wrap { position: sticky; top: 88px; }
.frame { margin: 14px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); background: #000; }
.chrome { height: 30px; display: flex; align-items: center; gap: 6px; padding: 0 12px; background: #0c0c0e; border-bottom: 1px solid var(--line); }
.chrome i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.14); }
.chrome span { margin-left: 10px; font: 500 10px var(--mono); color: var(--ink-3); }
.pv { padding: 22px 20px 24px; max-height: calc(100vh - 220px); overflow: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.pv .eb { font: 700 8px var(--mono); letter-spacing: .2em; color: var(--accent); text-transform: uppercase; }
.pv h1 { margin-top: 10px; font-family: var(--display); font-weight: 400; font-size: 34px; line-height: .95; text-transform: uppercase; max-width: 12ch; }
.pv h1 em { font-style: normal; background: linear-gradient(180deg, #fff4d6 10%, var(--accent) 70%, #8a6d1d); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pv .le { margin-top: 10px; font-size: 11px; line-height: 1.55; color: var(--ink-2); max-width: 380px; }
.pv h3 { margin: 22px 0 10px; font-family: var(--display); font-weight: 400; font-size: 16px; letter-spacing: .04em; text-transform: uppercase; }
.pg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; grid-auto-flow: dense; }
.pc { border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #0d0d0f; animation: pop .35s ease; }
.pc.wide { grid-column: span 2; }
.pc .sh { height: 58px; position: relative; background: radial-gradient(120% 90% at 20% 0%, rgba(var(--tint),.45), transparent 62%), #08080a; background-size: cover; background-position: center; }
.pc .sh::before { content: ""; position: absolute; inset: 0; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,.7)); }
.pc .lk { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.2); }
.pc .lk svg { width: 9px; height: 9px; }
.pc .tg { position: absolute; left: 5px; top: 5px; font: 700 5.5px var(--mono); letter-spacing: .14em; color: var(--accent-hi); border: 1px solid rgba(212,175,55,.4); background: rgba(0,0,0,.6); padding: 2px 4px; border-radius: 99px; text-transform: uppercase; }
.pc .bd { padding: 7px 8px 8px; }
.pc b { display: block; font-size: 10px; }
.pc p { font-size: 8px; color: var(--ink-2); line-height: 1.4; margin-top: 2px; }
.pc.flash { box-shadow: 0 0 0 1px var(--accent), 0 0 18px rgba(212,175,55,.35); }
@keyframes pop { from { opacity: 0; transform: scale(.97); } }

/* ---------- sheet (edit) ---------- */
.backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity .25s; }
.backdrop.on { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; z-index: 61; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: rgba(12,12,14,.96); border-left: 1px solid var(--line-2);
  box-shadow: -30px 0 80px rgba(0,0,0,.7); transform: translateX(102%); visibility: hidden; transition: transform .35s cubic-bezier(.2,.8,.2,1), visibility 0s .35s; display: flex; flex-direction: column; }
.sheet.on { transform: none; visibility: visible; transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.sheet .ph { padding: 16px 20px; }
.form { padding: 20px; overflow: auto; display: grid; gap: 16px; flex: 1; }
.f { display: grid; gap: 7px; }
.f > span { font: 700 9.5px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); display: flex; justify-content: space-between; }
.f input, .f textarea, .f select { width: 100%; background: rgba(255,255,255,.035); border: 1px solid var(--line-2); border-radius: 10px; padding: 11px 12px; font-size: 14px; outline: none; transition: border-color .2s, box-shadow .2s; }
.f textarea { resize: vertical; min-height: 64px; line-height: 1.5; }
.f input:focus, .f textarea:focus, .f select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(212,175,55,.15); }
.f select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.f select option { background: #111; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.drop { position: relative; height: 150px; border-radius: 12px; border: 1px dashed var(--line-2); display: grid; place-items: center; overflow: hidden; cursor: pointer;
  background: radial-gradient(120% 90% at 20% 0%, rgba(var(--tint),.35), transparent 65%), #0a0a0c; background-size: cover; background-position: center; transition: border-color .2s; }
.drop:hover { border-color: var(--accent); }
.drop .cta { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 99px; background: rgba(0,0,0,.6); border: 1px solid var(--line-2); font: 500 12px var(--mono); color: var(--ink-2); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop .rm { position: absolute; right: 8px; top: 8px; z-index: 2; background: rgba(0,0,0,.6); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); transition: transform .15s; }
.sw:hover { transform: scale(1.08); }
.sw[aria-pressed="true"] { border-color: #fff; }
.tg-row { display: flex; gap: 10px; flex-wrap: wrap; }
.tog { display: inline-flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-2); font-size: 13px; color: var(--ink-2); cursor: pointer; user-select: none; }
.tog .k { width: 30px; height: 18px; border-radius: 99px; background: rgba(255,255,255,.12); position: relative; transition: background .2s; }
.tog .k::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s; }
.tog input { display: none; }
.tog input:checked + .k { background: var(--accent); }
.tog input:checked + .k::after { transform: translateX(12px); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 7px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(255,255,255,.035); }
.chips .c { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 9px; border-radius: 7px; background: rgba(255,255,255,.06); border: 1px solid var(--line); font: 500 11.5px var(--mono); }
.chips .c button { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 4px; color: var(--ink-3); }
.chips .c button:hover { color: var(--danger); }
.chips .c svg { width: 11px; height: 11px; }
.chips input { flex: 1; min-width: 90px; background: none; border: 0; padding: 4px; font-size: 13px; outline: none; }
.sheet .foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- confirm modal ---------- */
.modal { position: fixed; z-index: 71; left: 50%; top: 50%; width: min(400px, calc(100% - 32px)); transform: translate(-50%, -46%) scale(.98); opacity: 0; pointer-events: none;
  padding: 24px; border-radius: 18px; background: rgba(16,16,18,.97); border: 1px solid var(--line-2); box-shadow: var(--edge), 0 40px 100px rgba(0,0,0,.8); transition: all .22s; }
.modal.on { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%); }
.modal .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(248,113,113,.12); color: var(--danger); margin-bottom: 16px; }
.modal .ic svg { width: 20px; height: 20px; }
.modal h3 { font-size: 18px; font-weight: 650; margin-bottom: 20px; overflow-wrap: anywhere; }
.modal .bt { display: flex; gap: 10px; justify-content: flex-end; }
#confirmBack { z-index: 70; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-radius: 12px; background: rgba(16,16,18,.94); border: 1px solid rgba(212,175,55,.4); font: 500 12px var(--mono); transition: all .3s; box-shadow: 0 20px 50px rgba(0,0,0,.7); }
.toast svg { color: var(--accent-hi); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (hover: none) {
  .row .acts, .site .acts { transition: opacity .15s; }
}
@media (max-width: 960px) {
  .top .in { padding: 0 16px; }
  .main { grid-template-columns: 1fr; padding: 16px 16px 80px; gap: 16px; }
  .seg { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255,255,255,.03); }
  .seg button { height: 38px; border-radius: 9px; font: 600 13px var(--sans); color: var(--ink-2); }
  .seg button[aria-pressed="true"] { background: rgba(255,255,255,.08); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
  body[data-tab="list"] #pvPanel, body[data-tab="pv"] #listPanel { display: none; }
  .pv-wrap { position: static; }
  .pv { max-height: none; }
}
@media (max-width: 560px) {
  .mark span, .dirty span { display: none; }
  .btn.save span { display: none; }
  .btn.save { width: 42px; padding: 0; }
  .row { grid-template-columns: 56px minmax(0, 1fr); gap: 12px; }
  .thumb { width: 56px; height: 42px; }
  .acts { grid-column: 1 / -1; justify-content: flex-end; display: none; border-top: 1px solid var(--line); padding-top: 8px; }
  .row.open .acts { display: flex; }
  .site .acts { display: flex; }
  .icon-btn { width: 40px; height: 40px; }
  .pg { grid-template-columns: repeat(2, 1fr); }
  .two { grid-template-columns: 1fr; }
  .sheet { top: auto; height: 92vh; width: 100%; border-left: 0; border-top: 1px solid var(--line-2); border-radius: 18px 18px 0 0; transform: translateY(102%); }
}

.drop.busy::after { content: ""; position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.drop.busy .cta { opacity: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast.err { border-color: rgba(248,113,113,.5); }
.toast.err svg { color: var(--danger); }
.import { margin: 0 14px 12px; width: calc(100% - 28px); }
