* { box-sizing: border-box; }
:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f8fafc;
  background: #0b1020;
}
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top, #1f2937 0, #0b1020 52%, #060914 100%); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
.page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.admin-page { max-width: 1100px; margin: 0 auto; padding: 30px 18px 60px; }
.card { background: rgba(17,24,39,.92); border: 1px solid rgba(255,255,255,.1); border-radius: 24px; box-shadow: 0 28px 80px rgba(0,0,0,.38); }
.viewer-card { width: min(100%, 560px); text-align: center; padding: 34px 24px; }
.admin-card { padding: 30px; }
.eyebrow { font-size: 13px; font-weight: 800; letter-spacing: .14em; opacity: .7; }
h1 { margin: 10px 0 8px; font-size: clamp(28px, 6vw, 42px); line-height: 1.05; }
h2 { margin: 0 0 6px; font-size: 22px; }
.subtitle, .hint { color: #aeb8c8; line-height: 1.55; }
.pill { display: inline-block; margin: 18px 0; padding: 9px 14px; border-radius: 999px; font-size: 14px; font-weight: 800; }
.pill-open { background: rgba(16,185,129,.16); color: #6ee7b7; border: 1px solid rgba(16,185,129,.38); }
.pill-closed { background: rgba(248,113,113,.13); color: #fca5a5; border: 1px solid rgba(248,113,113,.28); }
.counter { display: flex; align-items: baseline; justify-content: space-between; margin: 10px 0 18px; padding: 18px; background: rgba(255,255,255,.05); border-radius: 16px; }
.counter span { color: #cbd5e1; }
.counter strong { font-size: 30px; }
.primary, .secondary, .danger, .button-link { border: 0; border-radius: 14px; padding: 14px 18px; font-weight: 900; }
.primary { width: 100%; color: white; background: linear-gradient(135deg, #7c3aed, #2563eb); box-shadow: 0 12px 32px rgba(37,99,235,.28); }
.secondary { color: #e5e7eb; background: #283244; }
.danger { color: white; background: #b91c1c; }
.button-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.result { margin-top: 18px; padding: 20px; border: 1px solid rgba(52,211,153,.35); background: rgba(16,185,129,.1); border-radius: 18px; }
.result-title { color: #a7f3d0; font-weight: 800; }
.result code { display: block; margin: 12px auto; padding: 13px; font-size: 24px; font-weight: 900; color: white; background: #050914; border-radius: 10px; word-break: break-all; }
.hidden { display: none !important; }
.message { min-height: 24px; color: #bac4d3; line-height: 1.5; }
.message.error { color: #fca5a5; }
.field { display: grid; gap: 8px; margin: 20px 0 12px; }
.field span { font-weight: 800; }
input, textarea { width: 100%; color: #f8fafc; background: #0b1220; border: 1px solid #334155; border-radius: 12px; padding: 13px 14px; outline: none; }
input:focus, textarea:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgba(129,140,248,.12); }
textarea { resize: vertical; }
#codes { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row .primary { width: auto; }
.controls { margin: 20px 0; }
.admin-status-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 24px 0; }
.admin-status-grid div { padding: 16px; background: rgba(255,255,255,.045); border-radius: 14px; }
.admin-status-grid span { display: block; color: #94a3b8; font-size: 13px; }
.admin-status-grid strong { display: block; margin-top: 5px; font-size: 20px; }
.admin-section { margin-top: 28px; padding-top: 26px; border-top: 1px solid #293548; }
.section-heading { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; }
.links-admin-head { display: flex; gap: 16px; justify-content: space-between; align-items: center; margin: 22px 0 12px; }
.link-editor { display: grid; gap: 10px; margin-bottom: 16px; }
.link-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 10px; align-items: center; padding: 12px; border: 1px solid #293548; border-radius: 14px; background: rgba(255,255,255,.025); }
.link-row-main { display: grid; grid-template-columns: minmax(130px,.7fr) minmax(220px,1.3fr); gap: 8px; }
.link-visible { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-weight: 700; }
.link-visible input { width: auto; }
.link-row-actions { display: flex; gap: 6px; }
.mini { padding: 10px 12px; border-radius: 10px; }
.table-wrap { margin-top: 24px; overflow: auto; border: 1px solid #293548; border-radius: 14px; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #293548; }
th { color: #94a3b8; font-size: 13px; }
td code { color: #e2e8f0; }
.viewer-extra { margin-top: 18px; text-align: left; padding: 18px; border: 1px solid #293548; border-radius: 16px; background: rgba(255,255,255,.035); }
.viewer-extra-title { font-weight: 900; margin-bottom: 10px; }
.viewer-note { color: #d6deea; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.viewer-links { display: grid; gap: 9px; }
.viewer-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 13px 14px; border-radius: 12px; color: #f8fafc; text-decoration: none; font-weight: 850; background: #202a3c; border: 1px solid #334155; }
.viewer-link::after { content: "↗"; opacity: .7; }
.viewer-link:hover { background: #2a3750; border-color: #4f6280; }
@media (max-width: 720px) {
  .admin-card { padding: 20px 16px; }
  .admin-status-grid { grid-template-columns: repeat(2, 1fr); }
  .controls button { flex: 1 1 100%; }
  .link-row { grid-template-columns: 1fr; }
  .link-row-main { grid-template-columns: 1fr; }
  .link-row-actions { justify-content: flex-end; }
  .links-admin-head { align-items: flex-start; }
}
