:root {
    --bg: #070a12;
    --bg-soft: #0a0f1c;
    --panel: rgba(14, 20, 35, .88);
    --panel-solid: #0e1423;
    --panel-2: #121a2d;
    --line: rgba(255, 255, 255, .09);
    --line-strong: rgba(255, 255, 255, .15);
    --text: #f4f7ff;
    --muted: #8f9ab2;
    --primary: #9b87ff;
    --primary-2: #6d5dfc;
    --cyan: #58e6ff;
    --green: #48d6a8;
    --yellow: #f3c969;
    --red: #ff7187;
    --discord: #5865f2;
    --radius: 18px;
    --shadow: 0 24px 80px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(1200px 600px at 50% -10%, rgba(109, 93, 252, .14), transparent 62%),
        linear-gradient(180deg, #090d17 0%, var(--bg) 42%, #070912 100%);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.6;
}

button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }

.ambient { position: fixed; z-index: -1; border-radius: 50%; filter: blur(120px); opacity: .15; pointer-events: none; }
.ambient-one { width: 380px; height: 380px; background: #765cff; top: 18%; left: -180px; }
.ambient-two { width: 340px; height: 340px; background: #28c3e6; top: 58%; right: -190px; opacity: .08; }
.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.main-shell { min-height: calc(100vh - 180px); padding-top: 54px; padding-bottom: 70px; }

.topbar { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--line); background: rgba(7, 10, 18, .78); backdrop-filter: blur(18px); }
.topbar-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 11px; background: linear-gradient(135deg, #b49cff, #6c5dfd); box-shadow: 0 10px 30px rgba(109, 93, 252, .3); color: white; font-weight: 900; }
.brand > span:last-child { display: flex; align-items: baseline; gap: 6px; }
.brand strong { font-size: 16px; }
.brand small { color: var(--muted); font-weight: 600; }
.nav { display: flex; align-items: center; gap: 8px; }
.nav-link { color: var(--muted); padding: 9px 11px; border-radius: 10px; font-weight: 650; }
.nav-link:hover, .nav-link.active { color: var(--text); background: rgba(255,255,255,.05); }
.user-chip { display: flex; align-items: center; gap: 8px; color: #cbd3e6; margin-left: 4px; }
.user-chip img, .avatar-fallback { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--panel-2); font-weight: 800; font-size: 12px; }
.inline-form { display: inline-flex; margin: 0; }

.admin-tabs-wrap { border-bottom: 1px solid var(--line); background: rgba(9, 13, 23, .7); }
.admin-tabs { height: 48px; display: flex; align-items: end; gap: 24px; }
.admin-tabs a { height: 48px; display: flex; align-items: center; color: var(--muted); font-size: 13px; font-weight: 750; border-bottom: 2px solid transparent; }
.admin-tabs a:hover, .admin-tabs a.active { color: var(--text); border-color: var(--primary); }

.btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 42px; border: 1px solid transparent; border-radius: 11px; padding: 9px 15px; color: white; font-weight: 750; line-height: 1; transition: transform .14s ease, border-color .14s ease, background .14s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, #8a72ff, #6253ea); box-shadow: 0 12px 28px rgba(98, 83, 234, .2); }
.btn-secondary { background: rgba(255,255,255,.045); border-color: var(--line); color: #dbe1ef; }
.btn-secondary:hover, .btn-ghost:hover { border-color: var(--line-strong); background: rgba(255,255,255,.075); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-discord { background: #5865f2; box-shadow: 0 12px 28px rgba(88, 101, 242, .2); }
.btn-danger { background: rgba(255, 113, 135, .09); border-color: rgba(255, 113, 135, .28); color: #ff9cab; }
.btn-sm { min-height: 35px; padding: 7px 11px; border-radius: 9px; font-size: 13px; }
.btn-lg { min-height: 50px; padding: 13px 20px; }
.btn-wide { width: 100%; }

.card { background: linear-gradient(180deg, rgba(18, 25, 43, .9), rgba(11, 16, 29, .94)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.eyebrow { color: #9aa6c0; font-size: 11px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.muted { color: var(--muted); }
.text-link { color: #b7a8ff; font-weight: 700; }
.text-link:hover { color: #d3caff; }
.back-link { display: inline-block; margin-bottom: 18px; color: var(--muted); font-weight: 700; }
.back-link:hover { color: var(--text); }

.hero { max-width: 850px; padding: 70px 0 85px; }
.hero h1 { max-width: 760px; margin: 12px 0 20px; font-size: clamp(48px, 8vw, 86px); line-height: .98; letter-spacing: -.065em; }
.hero h1 span { background: linear-gradient(120deg, #cfc5ff 15%, #7de8ff 85%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { max-width: 670px; color: #9faac0; font-size: 18px; line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 32px; }
.status-pill { padding: 10px 14px; background: rgba(72,214,168,.08); border: 1px solid rgba(72,214,168,.18); color: #8ce5c8; border-radius: 999px; font-weight: 700; }

.section-head, .admin-heading, .panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; }
.section-head { margin: 0 0 22px; }
.section-head h2, .panel-head h2 { margin: 4px 0 0; font-size: 25px; letter-spacing: -.03em; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.form-card { min-height: 250px; display: flex; flex-direction: column; padding: 24px; background: linear-gradient(180deg, rgba(16, 23, 40, .82), rgba(10, 15, 27, .9)); border: 1px solid var(--line); border-radius: 16px; transition: border-color .18s ease, transform .18s ease, background .18s ease; }
.form-card:hover { transform: translateY(-3px); border-color: rgba(155,135,255,.35); background: linear-gradient(180deg, rgba(22, 30, 52, .92), rgba(11, 16, 29, .96)); }
.form-card-top { display: flex; align-items: center; gap: 7px; }
.form-card h3 { margin: 22px 0 9px; font-size: 21px; letter-spacing: -.025em; }
.form-card p { margin: 0; color: var(--muted); }
.form-card-footer { margin-top: auto; padding-top: 25px; display: flex; justify-content: space-between; gap: 15px; color: #758198; font-size: 12px; font-weight: 650; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 4px 8px; border-radius: 7px; font-size: 10px; font-weight: 850; letter-spacing: .08em; }
.badge-published { color: #7be0be; background: rgba(72,214,168,.1); border: 1px solid rgba(72,214,168,.18); }
.badge-draft { color: #b5a8f8; background: rgba(155,135,255,.09); border: 1px solid rgba(155,135,255,.18); }
.badge-closed { color: #efc978; background: rgba(243,201,105,.08); border: 1px solid rgba(243,201,105,.18); }
.badge-access, .badge-muted { color: #8f9ab1; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.badge-admin { color: #b8aaff; background: rgba(155,135,255,.1); border: 1px solid rgba(155,135,255,.2); }

.empty-state { padding: 60px 30px; text-align: center; }
.empty-state h3 { margin: 15px 0 6px; font-size: 22px; }
.empty-state p { max-width: 520px; margin: 0 auto 22px; color: var(--muted); }
.empty-icon { margin: 0 auto; width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; background: rgba(155,135,255,.1); color: #b9acff; border: 1px solid rgba(155,135,255,.18); font-size: 24px; }
.empty-compact { color: var(--muted); padding: 24px 0; }

.center-panel { min-height: 64vh; display: grid; place-items: center; }
.auth-card, .error-card, .success-card { width: min(560px, 100%); padding: 46px; text-align: center; }
.auth-card h1, .error-card h1, .success-card h1 { margin: 12px 0; font-size: 34px; letter-spacing: -.045em; }
.auth-card p, .error-card p, .success-card p { color: var(--muted); margin: 0 auto 26px; max-width: 450px; }
.auth-card .text-link { display: inline-block; margin-top: 20px; }
.lock-orb, .success-check { width: 62px; height: 62px; display: grid; place-items: center; margin: 0 auto 24px; border-radius: 18px; background: rgba(88,101,242,.12); border: 1px solid rgba(88,101,242,.24); color: #95a0ff; font-weight: 900; font-size: 22px; }
.success-check { background: rgba(72,214,168,.1); color: #73ddb9; border-color: rgba(72,214,168,.22); }
.error-code { font-size: 72px; font-weight: 900; line-height: 1; letter-spacing: -.06em; color: #8e7cf5; }
.center-actions { justify-content: center; }

.form-page-wrap { width: min(820px, 100%); margin: 20px auto 0; }
.form-sheet { overflow: hidden; position: relative; background: rgba(12, 17, 30, .91); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.form-accent { height: 5px; background: linear-gradient(90deg, #8f79ff, #55dcfa); }
.form-sheet-head { padding: 44px 48px 32px; border-bottom: 1px solid var(--line); }
.form-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.form-sheet-head h1 { margin: 14px 0 10px; font-size: clamp(32px, 6vw, 48px); letter-spacing: -.05em; line-height: 1.08; }
.form-sheet-head p { margin: 0; color: #a3aec3; font-size: 16px; }
.public-form { padding: 5px 48px 44px; }
.question { position: relative; display: grid; grid-template-columns: 44px 1fr; gap: 18px; padding: 34px 0; border-bottom: 1px solid var(--line); }
.question-number { color: #626f89; font-family: monospace; font-size: 12px; padding-top: 5px; }
.question-label { display: block; margin-bottom: 12px; font-weight: 780; font-size: 16px; color: #edf1fa; }
.required { color: #ff8194; margin-left: 4px; }
.field-help { margin: -7px 0 13px; color: var(--muted); font-size: 13px; }
.question input[type="text"], .question input[type="email"], .question input[type="url"], .question input[type="number"], .question input[type="date"], .question textarea, .question select,
.stack-form input[type="text"], .stack-form input[type="number"], .stack-form input[type="email"], .stack-form input[type="url"], .stack-form textarea, .stack-form select,
.create-form-inline input {
    width: 100%; min-height: 46px; color: var(--text); background: rgba(255,255,255,.035); border: 1px solid var(--line); border-radius: 11px; padding: 10px 13px; outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { resize: vertical; min-height: 110px; }
select { color-scheme: dark; }
input:focus, textarea:focus, select:focus { border-color: rgba(155,135,255,.58) !important; box-shadow: 0 0 0 3px rgba(155,135,255,.08); background: rgba(255,255,255,.05) !important; }
.choice-stack { display: grid; gap: 9px; }
.choice { display: flex; gap: 11px; align-items: center; padding: 11px 13px; border: 1px solid var(--line); background: rgba(255,255,255,.025); border-radius: 11px; cursor: pointer; }
.choice:hover { border-color: var(--line-strong); }
.choice input { accent-color: var(--primary-2); width: 17px; height: 17px; }
.question-error { background: linear-gradient(90deg, rgba(255,113,135,.035), transparent 65%); }
.field-error { margin-top: 9px; color: #ff95a5; font-size: 13px; font-weight: 650; }
.form-submit-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 32px; }
.form-alert { margin: 24px 48px 0; }
.empty-form-fields { padding: 42px 48px; color: var(--muted); }
.honeypot { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.alert { margin-bottom: 18px; padding: 12px 15px; border-radius: 11px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: #cbd3e4; }
.alert-success { background: rgba(72,214,168,.07); border-color: rgba(72,214,168,.18); color: #91e6ca; }
.alert-error { background: rgba(255,113,135,.07); border-color: rgba(255,113,135,.2); color: #ff9eac; }
.alert-info { background: rgba(88,101,242,.08); border-color: rgba(88,101,242,.2); color: #aeb5ff; }
.alert-warning { background: rgba(243,201,105,.07); border-color: rgba(243,201,105,.2); color: #f0d48e; }

.admin-heading { align-items: center; margin: 0 0 30px; }
.admin-heading h1 { margin: 5px 0 5px; font-size: 38px; letter-spacing: -.05em; }
.admin-heading p { margin: 0; color: var(--muted); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.stat-card { min-height: 155px; display: flex; flex-direction: column; justify-content: center; padding: 24px; background: linear-gradient(180deg, rgba(18,25,43,.84), rgba(11,16,29,.9)); border: 1px solid var(--line); border-radius: 16px; }
.stat-card span { color: var(--muted); font-weight: 700; font-size: 13px; }
.stat-card strong { margin: 4px 0; font-size: 38px; line-height: 1; letter-spacing: -.045em; }
.stat-card .stat-word { font-size: 27px; }
.stat-card small { color: #66728a; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; }
.admin-grid-gap { gap: 14px; }
.panel-card { padding: 24px; box-shadow: none; }
.activity-list { margin-top: 13px; }
.activity-item { display: grid; grid-template-columns: 12px 1fr 20px; gap: 11px; align-items: center; padding: 12px 4px; border-top: 1px solid var(--line); }
.activity-item:first-child { border-top: 0; }
.activity-item strong { display: block; font-size: 13px; }
.activity-item small { display: block; color: var(--muted); margin-top: 2px; }
.activity-arrow { color: #5f6c84; }
.activity-dot, .status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px rgba(155,135,255,.08); }
.status-published { background: var(--green); box-shadow: 0 0 0 4px rgba(72,214,168,.08); }
.status-closed { background: var(--yellow); box-shadow: 0 0 0 4px rgba(243,201,105,.08); }

.create-form-inline { display: flex; gap: 9px; width: min(430px, 100%); }
.admin-form-list { display: grid; gap: 10px; }
.admin-form-row { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 24px; box-shadow: none; }
.admin-form-main { min-width: 0; }
.admin-form-main h3 { margin: 10px 0 5px; font-size: 19px; }
.admin-form-main p { margin: 0 0 12px; color: var(--muted); }
.mini-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: #6f7c94; font-size: 12px; }
.row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

.builder-heading { align-items: flex-end; }
.url-line { display: flex; align-items: center; gap: 8px; margin-top: 10px !important; }
.url-line code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #8d99b0; }
.copy-button { border: 0; background: transparent; color: #b6a8ff; font-weight: 750; padding: 2px 4px; }
.builder-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.settings-card { padding: 26px; box-shadow: none; }
.stack-form { display: grid; gap: 16px; }
.stack-form label > span { display: block; margin-bottom: 6px; color: #aab4c8; font-weight: 700; font-size: 12px; }
.stack-form label > span small { color: #69758d; font-weight: 500; }
.field-grid { display: grid; gap: 12px; }
.field-grid.two { grid-template-columns: 1fr 1fr; }
.field-grid.three { grid-template-columns: repeat(3, 1fr); }
.toggle-row { display: flex !important; align-items: flex-start; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.02); }
.toggle-row input, .check-inline input { accent-color: var(--primary-2); margin-top: 3px; }
.toggle-row > span { margin: 0 !important; }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row small { color: var(--muted); margin-top: 2px; font-weight: 500; }
.builder-fields { margin-top: 28px; }
.compact-head { margin-bottom: 12px; }
.field-empty { padding: 20px 24px; }
.field-editor { position: relative; margin-bottom: 11px; padding: 23px; box-shadow: none; scroll-margin-top: 150px; }
.field-editor:target { border-color: rgba(155,135,255,.45); box-shadow: 0 0 0 3px rgba(155,135,255,.06); }
.field-editor-top { display: flex; justify-content: space-between; align-items: center; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.field-order { display: flex; align-items: center; gap: 10px; }
.field-order > span { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: #8995aa; font-family: monospace; font-size: 11px; }
.field-order code { color: #6f7a91; font-size: 11px; }
.icon-btn { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: rgba(255,255,255,.025); color: #aeb7ca; }
.icon-btn:hover { border-color: var(--line-strong); }
.editor-footer { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.check-inline { display: inline-flex !important; align-items: center; gap: 8px; color: #aeb7ca; font-weight: 700; font-size: 13px; }
.check-inline span { margin: 0 !important; }
.danger-corner { margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line); }
.danger-link { border: 0; background: transparent; padding: 0; color: #d67586; font-size: 12px; font-weight: 700; }
.danger-link:hover { color: #ff92a3; }
.toolbox { padding: 23px; box-shadow: none; }
.toolbox h3 { margin: 5px 0 17px; }
.toolbox hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.sticky-card { position: sticky; top: 142px; }
.stack-actions { display: grid; gap: 8px; margin-top: 12px; }

.response-stack { display: grid; gap: 12px; }
.response-card { padding: 26px; box-shadow: none; }
.response-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.response-head h3 { margin: 5px 0 2px; font-size: 19px; }
.response-head p { margin: 0; color: var(--muted); font-size: 12px; }
.response-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin-top: 8px; }
.response-value { padding: 16px 18px 16px 0; border-bottom: 1px solid var(--line); }
.response-value:nth-child(even) { padding-left: 18px; border-left: 1px solid var(--line); }
.response-value span { color: #7d899f; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.response-value p { margin: 5px 0 0; color: #dce2ef; word-break: break-word; }
.response-value em { color: #647087; }

.table-card { overflow: hidden; box-shadow: none; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 850px; }
th, td { padding: 14px 17px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: #758198; font-size: 10px; text-transform: uppercase; letter-spacing: .09em; background: rgba(255,255,255,.018); }
td { color: #b8c1d3; font-size: 13px; }
td strong { display: block; color: #e5e9f3; }
td small { display: block; color: #6d7990; }
td code { color: #929eb4; font-size: 11px; }
.metadata-code { white-space: normal; word-break: break-word; }

.footer { min-height: 72px; display: flex; align-items: center; gap: 8px; color: #4f5a6f; border-top: 1px solid rgba(255,255,255,.05); font-size: 12px; }
.dot { color: #343e50; }

@media (max-width: 980px) {
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .builder-layout { grid-template-columns: 1fr; }
    .sticky-card { position: static; }
    .builder-side { order: -1; }
    .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .shell { width: min(100% - 24px, 1180px); }
    .main-shell { padding-top: 34px; }
    .topbar-inner { min-height: 64px; }
    .nav-link { display: none; }
    .user-chip span { display: none; }
    .brand > span:last-child small { display: none; }
    .admin-tabs { gap: 17px; overflow-x: auto; }
    .hero { padding: 48px 0 58px; }
    .hero h1 { font-size: 50px; }
    .hero p { font-size: 16px; }
    .card-grid, .stat-grid, .field-grid.two, .field-grid.three, .response-grid { grid-template-columns: 1fr; }
    .admin-heading, .section-head { align-items: flex-start; flex-direction: column; }
    .create-form-inline { width: 100%; }
    .admin-form-row { align-items: flex-start; flex-direction: column; }
    .admin-form-row .row-actions { width: 100%; }
    .form-sheet-head { padding: 32px 24px 25px; }
    .public-form { padding: 0 24px 30px; }
    .question { grid-template-columns: 1fr; gap: 8px; padding: 27px 0; }
    .question-number { padding-top: 0; }
    .form-alert { margin: 20px 24px 0; }
    .form-submit-row { align-items: stretch; flex-direction: column; }
    .form-submit-row .btn { width: 100%; }
    .auth-card, .error-card, .success-card { padding: 34px 22px; }
    .builder-heading { align-items: flex-start; }
    .url-line { max-width: 100%; }
    .response-value:nth-child(even) { padding-left: 0; border-left: 0; }
    .response-head { flex-direction: column; }
    .footer { flex-wrap: wrap; }
}
