:root {
  --bg: #09090c;
  --fg: #ecebf2;
  --lime: oklch(0.88 0.19 128);
  --violet: oklch(0.65 0.2 290);
  --t1: #cfcdda;
  --t2: #a9a7b8;
  --t3: #8e8c9e;
  --t4: #6f6d7e;
  --t5: #5d5b6b;
  --line: rgba(255,255,255,0.08);
  --line2: rgba(255,255,255,0.12);
  --card: rgba(255,255,255,0.035);
  --danger: oklch(0.72 0.17 25);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font-family: Manrope, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--lime); text-decoration: none; }
a:hover { color: #fff; }
input, button { font-family: inherit; }
input::placeholder { color: var(--t5); }
::selection { background: var(--lime); color: var(--bg); }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
@keyframes spin { to { transform: rotate(360deg) } }

.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.display { font-family: Unbounded, Manrope, sans-serif; }
.hidden { display: none !important; }

/* фон */
.stage { position: relative; min-height: 100vh; overflow: hidden; background: var(--bg); }
.grid-bg { position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,0.035) 1px,transparent 1px), linear-gradient(90deg,rgba(255,255,255,0.035) 1px,transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%,#000 30%,transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%,#000 30%,transparent 80%); }
.glow-a { position: absolute; top: -280px; left: -160px; width: 720px; height: 720px; border-radius: 50%; background: radial-gradient(circle, oklch(0.6 0.2 290 / 0.32), transparent 65%); pointer-events: none; }
.glow-b { position: absolute; top: 120px; right: -240px; width: 640px; height: 640px; border-radius: 50%; background: radial-gradient(circle, oklch(0.88 0.19 128 / 0.13), transparent 65%); pointer-events: none; }
.shell { position: relative; min-height: 100vh; display: flex; flex-direction: column; }

/* общие элементы */
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--lime); box-shadow: 0 0 24px oklch(0.88 0.19 128 / 0.6); }
.logo-mark.sm { width: 22px; height: 22px; border-radius: 7px; box-shadow: 0 0 16px oklch(0.88 0.19 128 / 0.6); }
.h1 { font-family: Unbounded, sans-serif; font-weight: 800; font-size: clamp(30px,4vw,46px); letter-spacing: -0.035em; line-height: 1.05; margin: 0; }
.kicker { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--lime); margin-bottom: 10px; }
.label { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--t2); }
.input { height: 48px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(0,0,0,0.35); color: #fff; font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--lime); box-shadow: 0 0 0 4px oklch(0.88 0.19 128 / 0.15); }
.btn-primary { height: 52px; border: 0; border-radius: 14px; background: var(--lime); color: var(--bg); font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 0 20px; box-shadow: 0 10px 40px oklch(0.88 0.19 128 / 0.3); transition: transform .15s, box-shadow .15s, opacity .15s; }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 14px 50px oklch(0.88 0.19 128 / 0.5); }
.btn-primary:disabled { opacity: .4; box-shadow: none; }
.btn-ghost { height: 48px; padding: 0 20px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.14); background: transparent; color: #fff; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
.btn-ghost:hover { border-color: #fff; color: #fff; }
.btn-ghost.danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-text { border: 0; background: transparent; color: var(--t3); font-size: 14px; padding: 0; }
.btn-text:hover { color: #fff; }
.back { margin-bottom: 16px; }
.card { padding: 20px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.card .k { font-size: 13px; color: var(--t3); }
.card .v { font-family: Unbounded, sans-serif; font-weight: 600; font-size: 32px; letter-spacing: -0.03em; line-height: 1; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 28px; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); }
.seg button { height: 36px; padding: 0 14px; border: 0; border-radius: 10px; font-size: 13px; font-weight: 600; background: transparent; color: var(--t2); }
.seg button[aria-pressed="true"] { background: var(--lime); color: var(--bg); }
.seg button:not([aria-pressed="true"]):hover { color: #fff; }
.seg.sm { gap: 2px; padding: 3px; border-radius: 10px; background: rgba(0,0,0,0.35); }
.seg.sm button { height: 28px; padding: 0 10px; border-radius: 7px; font-size: 12px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.1); background: transparent; color: var(--t1); display: grid; place-items: center; }
.icon-btn:hover { border-color: var(--lime); color: var(--lime); }
.form-error { font-size: 13px; color: var(--danger); min-height: 18px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(9,9,12,0.3); border-top-color: var(--bg); animation: spin .7s linear infinite; }

/* вход */
.login { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 48px; align-items: center; max-width: 1240px; width: 100%; margin: 0 auto; padding: 48px 32px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-name { font-family: Unbounded, sans-serif; font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.pill { display: inline-flex; align-self: flex-start; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line2); border-radius: 999px; font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--t2); background: rgba(255,255,255,0.03); }
.pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); animation: pulse 1.8s infinite; }
.pill.off i { background: var(--danger); animation: none; }
.hero { font-family: Unbounded, sans-serif; font-weight: 800; font-size: clamp(38px, 5vw, 68px); line-height: 1.02; letter-spacing: -0.035em; text-wrap: balance; margin: 0; }
.hero em { font-style: normal; color: var(--lime); }
.lead { font-size: 18px; line-height: 1.55; color: var(--t2); max-width: 480px; text-wrap: pretty; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chips span { padding: 8px 14px; border-radius: 10px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--t1); }
.login-card { justify-self: center; width: 100%; max-width: 420px; padding: 36px; border-radius: 24px; background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02)); border: 1px solid rgba(255,255,255,0.1); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 30px 80px rgba(0,0,0,0.5); display: flex; flex-direction: column; gap: 18px; }
.login-card h2 { font-family: Unbounded, sans-serif; font-weight: 600; font-size: 22px; letter-spacing: -0.02em; margin: 0; }
.login-card .note { font-size: 12px; color: var(--t4); }

/* навигация */
.topbar { position: sticky; top: 0; z-index: 5; padding: 16px 24px; }
.nav { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 18px; border-radius: 18px; background: rgba(18,18,24,0.7); border: 1px solid var(--line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.nav .brand { margin-right: auto; }
.nav .brand-name { font-size: 14px; }
.nav-link { height: 40px; padding: 0 16px; border-radius: 12px; border: 0; font-size: 14px; font-weight: 600; background: transparent; color: var(--t3); }
.nav-link:hover { color: #fff; }
.nav-link[aria-current="page"] { background: rgba(255,255,255,0.08); color: #fff; }
.nav-sep { width: 1px; height: 24px; background: rgba(255,255,255,0.1); margin: 0 6px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--violet), var(--lime)); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--bg); flex: none; }
.logout { height: 40px; padding: 0 12px; border: 0; background: transparent; color: var(--t4); font-size: 13px; }
.logout:hover { color: #fff; }
.main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 24px 24px 80px; }

/* список */
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.search { flex: 1; min-width: 240px; max-width: 400px; height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.03); color: #fff; font-size: 14px; outline: none; }
.search:focus { border-color: var(--lime); }
.rows { display: flex; flex-direction: column; gap: 8px; }
.row { display: grid; grid-template-columns: minmax(220px, 2.2fr) minmax(180px, 1.6fr) 90px 120px 130px 44px; gap: 16px; align-items: center; padding: 16px 16px 16px 20px; border-radius: 16px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); cursor: pointer; transition: background .15s, border-color .15s; }
.row:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.16); }
.row-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.type-badge { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 500; background: rgba(255,255,255,0.06); border: 1px solid var(--line); color: var(--t1); text-transform: uppercase; }
.row-title { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-client { font-size: 13px; color: var(--t3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-url { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-opens b { display: block; font-family: Unbounded, sans-serif; font-weight: 600; font-size: 18px; }
.row-opens span { font-size: 11px; color: var(--t4); }
.row-exp { font-size: 13px; color: var(--t2); }
.status { display: inline-flex; align-items: center; gap: 7px; justify-self: start; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-active { background: oklch(0.88 0.19 128 / 0.12); color: var(--lime); }
.st-new { background: oklch(0.65 0.2 290 / 0.18); color: oklch(0.78 0.14 290); }
.st-expired, .st-disabled { background: rgba(255,255,255,0.06); color: var(--t3); }
.empty { padding: 40px 0; color: var(--t4); }
.more { margin-top: 16px; }
@media (max-width: 820px) {
  .row { grid-template-columns: 1fr auto; gap: 10px 12px; }
  .row-main { grid-column: 1 / -1; }
  .row-url { grid-column: 1 / -1; }
  .row-opens { display: flex; align-items: baseline; gap: 6px; }
  .row-opens b { display: inline; }
  .row-exp { justify-self: end; }
  .row .icon-btn { justify-self: end; }
}

/* загрузка */
.upload-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 20px; align-items: start; }
.drop { position: relative; min-height: 440px; border-radius: 24px; border: 1.5px dashed rgba(255,255,255,0.18); background: rgba(255,255,255,0.025); display: flex; flex-direction: column; justify-content: space-between; gap: 24px; padding: 28px; cursor: pointer; transition: all .2s; overflow: hidden; }
.drop.has-file { border-color: var(--lime); }
.drop.drag { border-color: var(--lime); background: oklch(0.88 0.19 128 / 0.08); }
.step { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--t3); }
.drop-empty { display: flex; flex-direction: column; gap: 18px; }
.drop-icon { width: 72px; height: 72px; border-radius: 20px; display: grid; place-items: center; background: oklch(0.88 0.19 128 / 0.12); border: 1px solid oklch(0.88 0.19 128 / 0.4); color: var(--lime); }
.drop-title { font-family: Unbounded, sans-serif; font-weight: 600; font-size: 26px; letter-spacing: -0.02em; line-height: 1.15; }
.drop-text { font-size: 14px; color: var(--t3); line-height: 1.6; max-width: 360px; }
.file-box { display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: 16px; background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.1); }
.file-ext { flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-family: 'JetBrains Mono', monospace; font-size: 11px; background: var(--lime); color: var(--bg); font-weight: 500; text-transform: uppercase; }
.file-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--t3); }
.file-clear { border: 0; background: transparent; color: var(--t3); font-size: 20px; }
.file-clear:hover { color: #fff; }
.file-hint { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--lime); margin-top: 16px; }
.drop-foot { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--t5); }
.panel { border-radius: 24px; padding: 28px; background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)); border: 1px solid rgba(255,255,255,0.1); display: flex; flex-direction: column; gap: 20px; }
.slug-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; color: var(--t2); }
.slug-box { display: flex; align-items: center; height: 48px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(0,0,0,0.35); overflow: hidden; font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.slug-box:focus-within { border-color: var(--lime); }
.slug-box span { padding: 0 0 0 16px; color: var(--t4); white-space: nowrap; }
.slug-box input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--lime); font-family: 'JetBrains Mono', monospace; font-size: 13px; outline: none; padding-right: 16px; }
.slug-box input[readonly] { cursor: default; }
.slug-note { font-size: 12px; min-height: 16px; color: var(--t3); }
.slug-note.ok { color: var(--lime); }
.slug-note.bad { color: var(--danger); }
.slug-note button { border: 0; background: none; padding: 0; color: var(--lime); font: inherit; text-decoration: underline; }
.expiry { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.expiry button { height: 44px; border-radius: 12px; font-size: 13px; font-weight: 600; border: 1px solid var(--line2); background: rgba(0,0,0,0.35); color: var(--t1); }
.expiry button[aria-pressed="true"] { border-color: var(--lime); background: oklch(0.88 0.19 128 / 0.1); color: var(--lime); }
.progress-head { display: flex; justify-content: space-between; font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--t2); margin-bottom: 8px; }
.progress { height: 6px; border-radius: 99px; background: rgba(255,255,255,0.08); overflow: hidden; }
.progress div { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--violet), var(--lime)); box-shadow: 0 0 16px oklch(0.88 0.19 128 / 0.6); transition: width .2s; }
.btn-publish { height: 56px; font-size: 16px; padding: 0 22px; }

/* успех */
.success { max-width: 820px; margin: 24px auto 0; display: flex; flex-direction: column; gap: 20px; }
.ok-line { display: flex; align-items: center; gap: 12px; }
.ok-dot { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--lime); color: var(--bg); font-size: 20px; font-weight: 700; box-shadow: 0 0 40px oklch(0.88 0.19 128 / 0.6); }
.ok-text { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--lime); }
.success .h1 { font-size: clamp(30px, 4.5vw, 52px); text-wrap: balance; }
.sub { font-size: 16px; color: var(--t2); }
.link-box { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 10px 10px 22px; border-radius: 20px; background: rgba(0,0,0,0.4); border: 1px solid oklch(0.88 0.19 128 / 0.45); box-shadow: 0 0 0 6px oklch(0.88 0.19 128 / 0.06), 0 20px 60px rgba(0,0,0,0.4); }
.link-box .url { flex: 1; min-width: 220px; font-family: 'JetBrains Mono', monospace; font-size: clamp(14px, 1.8vw, 18px); color: #fff; word-break: break-all; }
.btn-copy { height: 48px; padding: 0 20px; border: 0; border-radius: 14px; background: var(--lime); color: var(--bg); font-weight: 700; font-size: 14px; }
.conf { border-radius: 20px; background: rgba(255,255,255,0.03); border: 1px solid var(--line); overflow: hidden; }
.conf-head { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--t3); }
.conf-head b { font-weight: 400; color: var(--lime); }
.conf pre { margin: 0; padding: 20px; font-family: 'JetBrains Mono', monospace; font-size: 13px; line-height: 1.7; color: var(--t1); overflow-x: auto; }
.fine { font-size: 13px; color: var(--t4); line-height: 1.6; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* статистика */
.stats-url { display: flex; gap: 8px; align-items: center; padding: 8px 8px 8px 16px; border-radius: 14px; background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.1); max-width: 100%; }
.stats-url span { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--t1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-url button { flex: none; height: 36px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--lime); color: var(--bg); font-weight: 700; font-size: 13px; }
.stats-title { font-family: Unbounded, sans-serif; font-weight: 800; font-size: clamp(26px, 3.6vw, 42px); letter-spacing: -0.035em; line-height: 1.08; text-wrap: balance; margin: 0; overflow-wrap: anywhere; }
.stats-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 12px; }
.stats-cards .v { font-size: 30px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 12px; }
.box { padding: 24px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; }
.box-head { display: flex; justify-content: space-between; font-size: 14px; font-weight: 700; margin-bottom: 20px; }
.box-head span { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--t3); font-weight: 400; }
.bars { height: 200px; display: flex; align-items: flex-end; gap: 6px; }
.bars div { flex: 1; min-height: 4px; border-radius: 6px 6px 2px 2px; background: rgba(255,255,255,0.14); }
.bars div.today { background: var(--lime); box-shadow: 0 0 20px oklch(0.88 0.19 128 / 0.6); }
.bars-foot { display: flex; justify-content: space-between; font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--t4); margin-top: 20px; }
.log-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid rgba(255,255,255,0.06); font-size: 13px; }
.log-row .t { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--t3); }
.log-row .p { color: var(--t1); }
.log-row .d { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--lime); }
.manage { margin-top: 20px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 20; padding: 12px 18px; border-radius: 14px; background: var(--fg); color: var(--bg); font-weight: 600; font-size: 14px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); max-width: calc(100vw - 32px); }
.loading { padding: 60px 0; color: var(--t4); }

@media (max-width: 600px) {
  .login { padding: 32px 16px; gap: 32px; }
  .login-card { padding: 24px; }
  .topbar { padding: 12px 16px; }
  .nav { padding-left: 12px; gap: 4px; }
  .nav .brand-name, .nav-sep { display: none; }
  .nav-link { padding: 0 10px; }
  .main { padding: 16px 16px 64px; }
  .drop { min-height: 300px; padding: 20px; }
  .panel { padding: 20px; }
  .log-row { grid-template-columns: 1fr auto; }
  .log-row .p { grid-column: 1 / -1; grid-row: 2; }
}
