:root {
  color-scheme: dark;
  --bg: #090b10;
  --panel: #11141c;
  --panel-2: #171a24;
  --line: #272b38;
  --text: #f7f8fc;
  --muted: #939bad;
  --green: #50e3a4;
  --orange: #ff7548;
  --purple: #a783ff;
  --danger: #ff6474;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); overflow-x: hidden; }
[hidden] { display: none !important; }
button, input { font: inherit; }
button { color: inherit; }
.ambient { position: fixed; z-index: -1; filter: blur(120px); opacity: .12; border-radius: 50%; pointer-events: none; }
.ambient-one { width: 520px; height: 520px; background: var(--purple); top: -260px; right: 8%; }
.ambient-two { width: 480px; height: 480px; background: var(--orange); left: -320px; top: 45%; }

.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(22px, 5vw, 72px); border-bottom: 1px solid #20232d; background: #090b10dd; backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1rem; letter-spacing: -.01em; }
.brand small { color: var(--muted); font-size: .78rem; margin-top: 2px; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(145deg, #ff8a55, #ff4e73); display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding: 10px; box-shadow: 0 8px 28px #ff645733; }
.brand-mark span { width: 4px; border-radius: 4px; background: white; }
.brand-mark span:nth-child(1) { height: 8px; }.brand-mark span:nth-child(2) { height: 16px; }.brand-mark span:nth-child(3) { height: 12px; }
.top-actions, .hero-actions { display: flex; align-items: center; gap: 10px; }
.user-menu { display: flex; align-items: center; gap: 9px; border: 0; background: transparent; cursor: pointer; color: var(--text); padding: 4px; text-align: left; }
.user-menu > span:first-child { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; background: #292e3b; color: var(--green); font-size: .75rem; font-weight: 850; }
.user-menu strong, .user-menu small { display: block; max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.user-menu strong { font-size: .75rem; }.user-menu small { color: var(--muted); font-size: .66rem; margin-top: 2px; }
.system-pill { display: flex; align-items: center; gap: 9px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; color: #c9cfda; font-size: .82rem; background: #141720; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px #50e3a417; }

main { width: min(1460px, calc(100% - 44px)); margin: 0 auto; padding: 58px 0 64px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 36px; }
.eyebrow { margin: 0 0 12px; color: var(--orange); font-size: .75rem; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 0; max-width: 760px; font-size: clamp(2.5rem, 5vw, 5rem); line-height: .98; letter-spacing: -.055em; }
h1 em { color: var(--green); font-style: normal; }
.hero-copy { color: var(--muted); max-width: 640px; line-height: 1.65; font-size: 1.04rem; margin: 22px 0 0; }

.button { min-height: 44px; border: 0; border-radius: 12px; padding: 0 17px; font-weight: 750; font-size: .88rem; cursor: pointer; transition: transform .16s ease, border-color .16s ease, background .16s ease, opacity .16s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button.primary { background: linear-gradient(135deg, #ff8155, #ff5f69); box-shadow: 0 12px 30px #ff645729; }
.button.secondary { background: #20242f; border: 1px solid #333847; }
.button.ghost { background: transparent; border: 1px solid var(--line); color: #c7cdda; }
.button.danger { color: #ffb2ba; border: 1px solid #5a3039; background: #28171c; }
.button-icon { margin-right: 7px; font-size: .78rem; }

.overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 48px 0 62px; }
.metric-card { position: relative; overflow: hidden; background: linear-gradient(145deg, #151822, #10131a); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.metric-card::after { content: ""; width: 100px; height: 100px; border-radius: 50%; position: absolute; right: -42px; top: -48px; filter: blur(32px); opacity: .3; }
.accent-green::after { background: var(--green); }.accent-purple::after { background: var(--purple); }.accent-orange::after { background: var(--orange); }
.metric-label { display: block; color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .12em; }
.metric-card strong { display: block; font-size: 2rem; margin: 9px 0 3px; letter-spacing: -.04em; }
.metric-card small { color: var(--muted); font-size: .8rem; }

.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-size: 1.7rem; letter-spacing: -.025em; }
.section-heading .eyebrow { margin-bottom: 6px; }
.section-heading > p { margin: 0; color: var(--muted); font-size: .88rem; }
.channel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.channel-card { min-width: 0; background: linear-gradient(150deg, #161923, #101219); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: 0 22px 70px #0000002e; transition: border-color .2s, transform .2s; }
.channel-card.dragging { border-color: var(--orange); transform: translateY(-3px); }
.channel-header { padding: 17px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.channel-title { display: flex; align-items: center; gap: 11px; min-width: 0; }
.channel-avatar { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; background: #242936; font-weight: 850; color: #e8ebf2; }
.channel-title h3 { margin: 0; font-size: .96rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-title small { display: block; color: var(--muted); font-size: .73rem; margin-top: 3px; }
.status-badge { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 7px 10px; font-size: .73rem; font-weight: 750; background: #262a36; color: #bdc4d1; }
.status-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #7d8595; }
.status-badge.running { background: #123629; color: #79e8b5; }.status-badge.running::before { background: var(--green); box-shadow: 0 0 0 4px #50e3a415; }
.status-badge.failed { background: #3d1b23; color: #ff9fab; }.status-badge.failed::before { background: var(--danger); }
.status-badge.restarting, .status-badge.starting { background: #3c3218; color: #ffd67b; }.status-badge.restarting::before, .status-badge.starting::before { background: #ffc857; }
.preview-wrap { position: relative; background: #050609; height: 440px; overflow: hidden; }
.preview-frame { width: 100%; height: 100%; border: 0; display: block; }
.preview-offline { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; background: radial-gradient(circle at 50% 35%, #252a37, #08090d 70%); color: var(--muted); padding: 30px; }
.preview-offline[hidden] { display: none; }
.preview-offline strong { color: #dfe3eb; margin-bottom: 6px; }
.drop-overlay { position: absolute; inset: 12px; display: none; place-content: center; text-align: center; border: 2px dashed var(--orange); background: #140e0ddd; border-radius: 14px; color: white; z-index: 4; }
.channel-card.dragging .drop-overlay { display: grid; }
.channel-body { padding: 17px 18px 19px; }
.health-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.health-item { background: #0c0f15; border: 1px solid #222632; border-radius: 11px; padding: 9px 10px; }
.health-item span { display: block; color: #747d8f; font-size: .64rem; font-weight: 800; letter-spacing: .08em; }
.health-item strong { display: block; font: 700 .82rem ui-monospace, monospace; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #252936; padding-top: 15px; }
.file-info { min-width: 0; }
.file-info strong, .file-info small { display: block; }
.file-info strong { font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-info small { color: var(--muted); margin-top: 4px; font-size: .7rem; }
.card-actions { display: flex; gap: 8px; margin-top: 14px; }
.card-actions .button { flex: 1; min-width: 0; padding-inline: 10px; }
.update-banner { display: none; margin: 0 18px 17px; border: 1px solid #4b3a24; background: #241c11; color: #ffd991; border-radius: 11px; padding: 10px 12px; font-size: .75rem; }
.update-banner.visible { display: block; }
.update-banner.failed { border-color: #58303a; background: #28171c; color: #ffadb7; }

.help-card { display: flex; align-items: center; gap: 15px; margin-top: 22px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: #11141bc7; }
.help-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #262b38; font-weight: 900; color: var(--purple); }
.help-card strong { font-size: .9rem; }.help-card p { margin: 3px 0 0; color: var(--muted); font-size: .8rem; }
.help-note { margin-left: auto; color: #b4bbca; font-size: .75rem; }

dialog { width: min(520px, calc(100% - 28px)); color: var(--text); border: 1px solid #343948; border-radius: 22px; padding: 0; background: #12151d; box-shadow: 0 28px 100px #000c; }
dialog::backdrop { background: #05060ad6; backdrop-filter: blur(8px); }
.dialog-card { padding: 30px; position: relative; }
.dialog-close { position: absolute; right: 18px; top: 16px; border: 0; background: transparent; color: var(--muted); font-size: 1.8rem; cursor: pointer; }
.dialog-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: linear-gradient(145deg, #ff8754, #ff5b70); font-size: 1.5rem; margin-bottom: 20px; }
.dialog-card h2 { margin: 0; font-size: 1.65rem; letter-spacing: -.03em; }.dialog-card h2 span { color: var(--green); }
.dialog-copy { color: var(--muted); line-height: 1.55; font-size: .88rem; }
.file-drop { display: grid; place-items: center; min-height: 145px; text-align: center; border: 1.5px dashed #4a5060; border-radius: 15px; background: #0b0e14; cursor: pointer; margin-top: 22px; padding: 20px; transition: border .2s, background .2s; }
.file-drop:hover { border-color: var(--orange); background: #15100f; }.file-drop input { display: none; }.file-drop strong { font-size: .95rem; }.file-drop span { color: var(--muted); font-size: .77rem; margin-top: 6px; }
.upload-progress { height: 6px; overflow: hidden; border-radius: 999px; background: #282d39; margin-top: 18px; }.upload-progress div { width: 0; height: 100%; background: linear-gradient(90deg, var(--orange), var(--green)); transition: width .2s; }
.upload-message { min-height: 20px; color: var(--muted); font-size: .78rem; text-align: center; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.toast { position: fixed; z-index: 50; right: 24px; bottom: 24px; max-width: 380px; padding: 13px 17px; border-radius: 12px; background: #1b202b; border: 1px solid #383e4d; color: #e7eaf0; font-size: .84rem; box-shadow: 0 18px 50px #0008; transform: translateY(30px); opacity: 0; pointer-events: none; transition: .22s ease; }.toast.visible { transform: none; opacity: 1; }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(440px, 100%); padding: 36px; border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(145deg, #171a24f2, #0f1118f2); box-shadow: 0 30px 100px #0009; }
.login-mark { margin-bottom: 26px; }.login-card h1 { font-size: 2rem; letter-spacing: -.04em; }.login-card > p:not(.eyebrow):not(.login-error) { color: var(--muted); line-height: 1.55; margin-bottom: 25px; }
.login-card label, .user-form label { display: grid; gap: 7px; color: #cdd2dc; font-size: .8rem; font-weight: 700; margin-top: 14px; }
.login-card input, .user-form input, .user-form select { width: 100%; border: 1px solid #353a48; background: #0a0d13; color: var(--text); border-radius: 11px; padding: 12px 13px; outline: none; }
.login-card input:focus, .user-form input:focus, .user-form select:focus { border-color: var(--orange); box-shadow: 0 0 0 3px #ff754817; }
.login-card .button { width: 100%; margin-top: 8px; }.login-card > small { display: block; text-align: center; color: #697284; margin-top: 18px; }
.login-error { min-height: 20px; color: #ff9ca7; font-size: .78rem; }
.users-dialog-card { width: min(760px, 100%); max-height: 85vh; overflow: auto; }.users-dialog-card h2 { margin-bottom: 18px; }
.user-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 12px; padding: 18px; background: #0b0e14; border: 1px solid var(--line); border-radius: 15px; }.user-form .button { align-self: end; margin-top: 14px; }
.users-list { display: grid; gap: 8px; margin-top: 20px; }.user-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }.user-row strong, .user-row small { display: block; }.user-row small { color: var(--muted); margin-top: 3px; }.user-row.inactive { opacity: .55; }

@media (max-width: 1050px) { .channel-grid { grid-template-columns: repeat(2, 1fr); }.hero { align-items: flex-start; flex-direction: column; }.preview-wrap { height: 500px; } }
@media (max-width: 720px) { main { width: min(100% - 24px, 520px); padding-top: 34px; }.topbar { padding-inline: 14px; }.top-actions > .ghost, .system-pill { display: none; }.hero-actions { width: 100%; }.hero-actions .button { flex: 1; }.overview, .channel-grid { grid-template-columns: 1fr; }.overview { margin-block: 32px 44px; }.section-heading { align-items: flex-start; flex-direction: column; }.section-heading > p { display: none; }.preview-wrap { height: 560px; }.help-note { display: none; }.dialog-card { padding: 24px 19px; }.user-form { grid-template-columns: 1fr; }.login-card { padding: 27px 21px; } }

