@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --accent: #ff5a36;
  --bg: #0b0b0d;
  --panel: #131317;
  --panel-2: #1a1a20;
  --line: #26262e;
  --text: #f2f2f4;
  --muted: #8b8b96;
  --ok: #3ddc97;
  --warn: #ffb547;
  --err: #ff5470;
  --radius: 14px;
  --sans: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  background-image: radial-gradient(1200px 600px at 80% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.5 var(--sans);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.mono { font-family: var(--mono); font-feature-settings: 'tnum'; }
.muted { color: var(--muted); }

.shell { max-width: 880px; margin: 0 auto; padding: 28px 16px 64px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 40px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { height: 34px; width: auto; display: block; }
.brand .name { font-weight: 700; letter-spacing: -0.01em; font-size: 17px; line-height: 1.1; }
.brand .product { color: var(--accent); font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; }
.pill { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); padding: 5px 10px; border-radius: 99px; white-space: nowrap; }
.pill .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 8px var(--ok); }

h1 { font-size: clamp(28px, 5vw, 42px); line-height: 1.05; letter-spacing: -0.03em; margin: 0 0 10px; font-weight: 700; }
h2 { font-size: 18px; margin: 0 0 14px; letter-spacing: -0.01em; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.lede { color: var(--muted); max-width: 60ch; margin: 0 0 28px; white-space: pre-line; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.stack > * + * { margin-top: 16px; }

/* drop zone */
.drop {
  position: relative; border: 1.5px dashed #34343e; border-radius: var(--radius);
  padding: 44px 20px; text-align: center; background: var(--panel);
  transition: border-color .15s, background .15s;
}
.drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--panel)); }
.drop .icon { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.drop .big { font-size: 19px; font-weight: 600; margin-bottom: 4px; }
.drop .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* controls */
button, .btn {
  appearance: none; border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  font: 500 14px var(--sans); padding: 10px 16px; border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; transition: border-color .15s, background .15s, opacity .15s;
}
button:hover:not(:disabled) { border-color: #3a3a46; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover:not(:disabled) { filter: brightness(1.08); }
button.ghost { background: transparent; }
button.small { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
button.danger:hover:not(:disabled) { border-color: var(--err); color: var(--err); }

label.field { display: block; }
label.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; }
input[type=text], input[type=password], input[type=number], textarea, select {
  width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--text);
  font: 15px var(--sans); padding: 11px 12px; border-radius: 10px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 70px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

/* file list */
.files { list-style: none; margin: 0; padding: 0; }
.file { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.file:first-child { border-top: 0; }
.file .fname { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.file .meta { font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; }
.file .sub { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.file .sub.err { color: var(--err); }
.file .sub.ok { color: var(--ok); }
.bar { grid-column: 1 / -1; height: 4px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s linear; }
.file.done .bar > i { background: var(--ok); }
.file.error .bar > i { background: var(--err); }
.file .x { background: none; border: 0; padding: 0 0 0 8px; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; }

/* totals */
.totals { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.stat { font-family: var(--mono); }
.stat b { display: block; font-size: 22px; font-weight: 500; letter-spacing: -0.02em; }
.stat small { color: var(--muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.stats { display: flex; gap: 28px; flex-wrap: wrap; }
.bigbar { height: 6px; margin-top: 16px; }

.notice { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--panel); padding: 12px 14px; border-radius: 10px; font-size: 14px; color: var(--muted); }
.notice.err { border-left-color: var(--err); color: var(--text); }
.notice.ok { border-left-color: var(--ok); color: var(--text); }

.center-state { text-align: center; padding: 70px 20px; }
.center-state .ring { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 22px;
  background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }

footer.foot { margin-top: 56px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
footer.foot a { color: var(--muted); }

.hidden { display: none !important; }

/* admin */
.link-row { padding: 18px 0; border-top: 1px solid var(--line); }
.link-row:first-child { border-top: 0; padding-top: 0; }
.link-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.link-title { font-weight: 600; font-size: 16px; }
.tag { font-family: var(--mono); font-size: 11px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); margin-left: 6px; vertical-align: 2px; }
.tag.live { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.tag.off { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, transparent); }
.urlbox { display: flex; gap: 8px; margin-top: 10px; }
.urlbox input { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.link-actions { display: flex; gap: 6px; flex-wrap: wrap; }
details.received { margin-top: 10px; }
details.received summary { cursor: pointer; color: var(--muted); font-size: 13px; font-family: var(--mono); }
details.received ul { list-style: none; padding: 0; margin: 8px 0 0; font-size: 13px; }
details.received li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px dashed var(--line); }
details.received li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 500; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
