:root {
  color-scheme: dark;
  --bg: #080d12;
  --surface: #0b1118;
  --surface-raised: #0f1720;
  --line: #283541;
  --line-soft: #1b2731;
  --text: #e7edf3;
  --muted: #94a2b1;
  --blue: #a7b5c7;
  --green: #4ddd9b;
  --amber: #e8b75f;
  --red: #ff8188;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 72% 12%, #18212c 0%, transparent 38%), var(--bg); color: var(--text); font: 14px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
.hidden { display: none !important; }
.muted { margin: 4px 0 0; color: var(--muted); }
.eyebrow { margin: 0 0 9px; color: var(--blue); font-size: 10px; font-weight: 700; letter-spacing: 1.8px; }

.topbar { min-height: 68px; border-bottom: 1px solid var(--line); background: #090e13; }
.topbar-inner { width: min(1120px, calc(100% - 48px)); min-height: 68px; margin: 0 auto; display: flex; align-items: center; gap: 30px; }
.wordmark { display: inline-flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; font-size: 16px; font-weight: 850; letter-spacing: 1.8px; white-space: nowrap; }
.wordmark-light { margin-left: 4px; color: #a9b5c0; }
.logo-mark { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid #7c9c70; background: #18231b; color: #c4d2a4; font-size: 15px; font-weight: 800; letter-spacing: 0; }
.top-nav { display: flex; align-items: stretch; gap: 3px; height: 68px; margin-left: auto; }
.top-nav a { display: flex; align-items: center; padding: 0 13px; border-bottom: 2px solid transparent; color: #c0cad3; font-size: 12px; text-decoration: none; transition: color .15s, border-color .15s; }
.top-nav a:hover, .top-nav a.active { color: #fff; }
.top-nav a.active { border-bottom-color: #aac77f; }
.topbar-user { display: flex; align-items: center; gap: 13px; padding-left: 16px; border-left: 1px solid var(--line); }
.user-badge { max-width: 130px; overflow: hidden; color: #d5dde4; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.text-button { padding: 5px 0; border: 0; background: transparent; color: var(--muted); font-size: 12px; text-decoration: none; }
.text-button:hover { color: #fff; }

.content-shell { width: min(1120px, calc(100% - 48px)); min-height: calc(100vh - 68px); margin: 0 auto; padding: 45px 0 0; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 31px; }
h1, h2, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(25px, 4vw, 32px); line-height: 1.2; letter-spacing: -.55px; }
h2 { margin: 0; font-size: 19px; line-height: 1.3; letter-spacing: -.2px; }
.page-heading .muted { font-size: 13px; }
.button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface-raised); color: var(--text); font-size: 12px; font-weight: 650; text-decoration: none; transition: background .15s, border-color .15s, color .15s; }
.button:hover { border-color: #587087; background: #15212c; }
.button.primary { border-color: #dce4ec; background: #dce4ec; color: #101820; }
.button.primary:hover { background: #fff; }
.button.secondary { background: transparent; }
.button.success { border-color: #225b43; background: #10261d; color: var(--green); }
.button.danger { border-color: #57323a; background: #28191d; color: var(--red); }
.button.quiet { border-color: transparent; background: transparent; color: var(--muted); }
.button.full { width: 100%; margin-top: 9px; }

.page-view { padding-bottom: 24px; }
.welcome-panel { min-height: 144px; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 17px; padding: 25px 27px; border: 1px solid var(--line); background: linear-gradient(105deg, #101821, #0b1117 74%); }
.welcome-panel h2 { font-size: 23px; }
.welcome-panel .muted { font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.stat { min-height: 86px; display: flex; align-items: center; gap: 13px; padding: 15px 16px; border: 1px solid var(--line); background: var(--surface); }
.stat-icon { width: 32px; height: 32px; display: grid; flex: 0 0 auto; place-items: center; border: 1px solid #314353; color: var(--blue); }
.stat-icon.green { border-color: #24533f; color: var(--green); }
.stat-icon.amber { border-color: #594a2e; color: var(--amber); }
.stat-icon.red { border-color: #5a3439; color: var(--red); }
.stat small, .stat strong { display: block; }
.stat small { color: var(--muted); font-size: 11px; }
.stat strong { margin-top: 2px; font-size: 21px; font-weight: 700; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 35px 0 15px; }
.section-head .eyebrow { margin-bottom: 5px; }
.section-head .muted { font-size: 12px; }
.text-link { color: var(--blue); font-size: 12px; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.support-strip { display: flex; align-items: center; gap: 17px; margin-top: 30px; padding: 17px 18px; border: 1px solid var(--line); background: #0b1117; color: var(--muted); font-size: 11px; }
.support-strip div { display: grid; gap: 2px; margin-right: auto; }
.support-strip b { color: var(--text); font-size: 12px; }
.support-strip a { color: var(--blue); text-decoration: none; }
.support-strip a:hover { text-decoration: underline; }

.bot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bot-grid.compact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bot-card { min-width: 0; padding: 16px; border: 1px solid var(--line); background: var(--surface); }
.bot-top { display: flex; align-items: center; gap: 11px; }
.bot-avatar { width: 36px; height: 36px; display: grid; flex: 0 0 auto; place-items: center; border: 1px solid #34424e; background: #101923; color: #b9ca9d; font-size: 17px; }
.bot-title { min-width: 0; display: grid; gap: 2px; }
.bot-title b { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.bot-title small, .bot-identity { color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.status { flex: 0 0 auto; margin-left: auto; padding: 3px 7px; border: 1px solid var(--line); color: var(--muted); font-size: 9px; letter-spacing: .3px; text-transform: uppercase; }
.status.online { border-color: #225b43; color: var(--green); }
.status.error, .status.kicked { border-color: #63383d; color: var(--red); }
.status.connecting { border-color: #594a2e; color: var(--amber); }
.bot-identity { margin: 13px 0 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft); }
.bot-identity b { color: #dbe3e9; font-weight: 600; }
.bot-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 10px 0 13px; }
.bot-metrics > div { min-width: 0; padding: 7px 8px; border: 1px solid var(--line-soft); background: #0a1016; }
.bot-metrics small, .bot-metrics b { display: block; overflow-wrap: anywhere; }
.bot-metrics small { color: var(--muted); font-size: 9px; }
.bot-metrics b { margin-top: 2px; font-size: 11px; font-weight: 600; }
.bot-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.bot-actions .button { min-height: 31px; padding: 6px 9px; font-size: 10px; }
.bot-actions .quiet { margin-left: auto; }
.inline-chat, .inline-command { display: flex; gap: 7px; margin-top: 8px; }
.inline-chat input, .inline-command input { min-width: 0; flex: 1; }
.empty { min-height: 140px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; padding: 22px; border: 1px dashed #3b4c59; color: var(--muted); }
.empty b { color: var(--text); font-size: 13px; }
.empty .button { margin-top: 8px; }
.compact-grid .empty { grid-column: 1 / -1; }

.notice { margin: 14px 0; padding: 12px 14px; border: 1px solid #394653; background: #0d151d; color: #bac7d1; font-size: 12px; }
.notice a { color: var(--blue); }
.logs-card { overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.logs-top { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 14px; border-bottom: 1px solid var(--line); color: #c2cbd3; font-size: 10px; font-weight: 700; letter-spacing: 1px; }
.logs-top .muted { margin-left: auto; font-size: 10px; font-weight: 400; letter-spacing: 0; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px #4ddd9b66; }
.logs { max-height: 490px; overflow: auto; padding: 8px 14px; font: 11px/1.8 ui-monospace, SFMono-Regular, Consolas, monospace; }
.log-line { display: grid; grid-template-columns: 70px 70px minmax(0, 1fr); gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line-soft); }
.log-time { color: #758493; }
.log-type { color: var(--blue); font-size: 9px; text-transform: uppercase; }
.log-type.error, .log-type.warn { color: var(--red); }
.log-msg { overflow-wrap: anywhere; color: #c1ccd5; white-space: pre-wrap; }
.logs-empty { min-height: 170px; border: 0; }
select, input { width: 100%; padding: 10px 11px; border: 1px solid #35434f; border-radius: 2px; outline: 0; background: #090f15; color: var(--text); }
input:focus, select:focus { border-color: #93b9d9; box-shadow: 0 0 0 2px #82b8ed1c; }
label { display: block; margin-top: 14px; color: #d1dae2; font-size: 11px; font-weight: 650; }
label input, label select { display: block; margin-top: 6px; }
.label-note { color: var(--muted); font-size: 10px; font-weight: 400; }
.check-label { display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); }
.check-label input { width: 15px; height: 15px; margin: 0; accent-color: #a9c780; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.settings-card { padding: 20px; border: 1px solid var(--line); background: var(--surface); }
.settings-form { max-width: 720px; }
.form-footer { display: flex; align-items: center; gap: 13px; margin-top: 18px; }
.form-footer .muted { font-size: 11px; }
.share-login { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; padding: 14px 16px; border: 1px solid var(--line); background: var(--surface); }
.share-login small { display: block; margin-top: 3px; color: var(--blue); overflow-wrap: anywhere; }
.user-list { border: 1px solid var(--line); background: var(--surface); }
.user-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 16px; border-bottom: 1px solid var(--line-soft); }
.user-row:last-child { border-bottom: 0; }
.user-summary { min-width: 160px; }
.user-summary b { font-size: 13px; }
.user-summary small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.user-actions { display: flex; align-items: end; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.user-actions .button { min-height: 31px; padding: 6px 9px; font-size: 10px; }
.quota-input { width: 100px; margin: 0; font-size: 10px; }
.quota-input input { padding: 6px 8px; }
.quota-input small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.admin-tag { padding: 4px 8px; border: 1px solid #546340; color: #c6d6a5; font-size: 10px; }
.success-message { min-height: 20px; color: var(--green); font-size: 11px; }
.error { min-height: 18px; color: var(--red); font-size: 11px; }
.site-footer { display: flex; justify-content: space-between; gap: 15px; margin-top: 30px; padding: 17px 0 20px; border-top: 1px solid var(--line); color: #74818c; font-size: 10px; }
.site-footer span:first-child { color: #c5ced5; font-weight: 800; letter-spacing: 1.2px; }

.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at 72% 12%, #18212c 0%, transparent 38%), var(--bg); }
.auth-card { width: min(440px, 100%); padding: 32px; border: 1px solid var(--line); background: rgba(11, 17, 24, .97); box-shadow: 0 22px 70px rgba(0,0,0,.34); }
.auth-card .wordmark { margin-bottom: 28px; }
.auth-card h1 { font-size: 26px; }
.auth-card > .muted { margin: 7px 0 18px; font-size: 12px; }
.auth-card label { display: grid; gap: 6px; margin-top: 14px; color: #d5dde5; font-size: 11px; font-weight: 650; }
.auth-card input { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid #354252; border-radius: 3px; outline: none; background: #080d13; color: var(--text); font-size: 13px; }
.auth-card input:focus { border-color: #8194a8; box-shadow: 0 0 0 2px rgba(167,181,199,.12); }
.auth-card .button { min-height: 42px; }
.auth-card .error { min-height: 18px; margin: 7px 0; font-size: 11px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 14px 0 3px; color: var(--muted); font-size: 10px; }
.auth-divider::before, .auth-divider::after { height: 1px; flex: 1; background: var(--line-soft); content: ""; }
.optional-contact { margin-top: 16px; border: 1px solid var(--line-soft); padding: 9px 11px; color: #c5cfd7; font-size: 11px; }
.optional-contact summary { cursor: pointer; }
.optional-contact summary span { margin-left: 5px; color: var(--muted); }
.optional-contact label:first-of-type { margin-top: 12px; }
.support-contact { margin: 18px 0 0; color: var(--muted); font-size: 10px; text-align: center; }
.support-contact a { color: var(--blue); text-decoration: none; }

.modal { position: fixed; inset: 0; z-index: 5; display: grid; place-items: center; overflow: auto; padding: 18px; background: #05090dcf; }
.modal-card { position: relative; width: min(570px, 100%); margin: auto; padding: 23px; border: 1px solid #3b4a56; background: #0a1016; }
.modal-card h2 { font-size: 21px; }
.modal-card .muted { font-size: 11px; }
.close { position: absolute; top: 12px; right: 13px; width: 32px; height: 32px; border: 1px solid var(--line); background: transparent; color: var(--text); font-size: 20px; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 10; max-width: 360px; padding: 12px 15px; border: 1px solid #53687a; background: #101a23; color: var(--text); font-size: 12px; }
.toast.bad { border-color: #79454a; color: #ffb2b6; }

@media (max-width: 900px) {
  .topbar-inner, .content-shell { width: min(100% - 32px, 760px); }
  .topbar-inner { flex-wrap: wrap; gap: 0 17px; padding-top: 10px; }
  .top-nav { order: 3; width: 100%; height: 45px; margin: 0; overflow-x: auto; }
  .top-nav a { padding: 0 10px; white-space: nowrap; }
  .topbar-user { margin-left: auto; border: 0; }
  .bot-grid.compact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-row { align-items: flex-start; flex-direction: column; }
  .user-actions { justify-content: flex-start; }
}
@media (max-width: 600px) {
  .topbar-inner, .content-shell { width: calc(100% - 28px); }
  .content-shell { padding-top: 28px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 14px; margin-bottom: 22px; }
  .page-heading .button { align-self: stretch; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { min-height: 72px; padding: 10px; gap: 9px; }
  .stat-icon { width: 27px; height: 27px; }
  .stat strong { font-size: 18px; }
  .welcome-panel { align-items: flex-start; flex-direction: column; padding: 19px; }
  .bot-grid, .bot-grid.compact-grid { grid-template-columns: 1fr; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .support-strip { align-items: flex-start; flex-direction: column; gap: 7px; }
  .support-strip div { margin: 0 0 4px; }
  .two { grid-template-columns: 1fr; gap: 0; }
  .share-login { align-items: flex-start; flex-direction: column; }
  .share-login .button { width: 100%; }
  .log-line { grid-template-columns: 52px 47px minmax(0, 1fr); gap: 5px; }
  .logs { padding: 7px 9px; }
  .form-footer { align-items: flex-start; flex-direction: column; }
  .site-footer { flex-direction: column; }
  .auth-card { padding: 22px; }
}

/* Admin, tickets and backup controls */
.ticket-actions,.backup-actions { display:flex; flex-wrap:wrap; align-items:center; gap:9px; margin-top:12px; }
.ticket-actions input { min-width:220px; flex:1; }
.ticket-actions select,.ticket-actions input,.settings-form textarea { border:1px solid var(--line); background:#080d12; color:var(--text); padding:10px 12px; font:inherit; }
.settings-form textarea { resize:vertical; }
.status.reconnecting { color:#f2c66d; border-color:#715b31; }
.backup-actions label { cursor:pointer; }
.auth-challenge { margin:16px 0; padding:16px; border:1px solid #486d5e; background:linear-gradient(135deg,#11231f,#101a20); }
.auth-challenge-heading { display:flex; align-items:center; gap:9px; color:#d7ffe9; font-size:13px; }
.auth-pulse { width:8px; height:8px; border-radius:50%; background:#56d693; box-shadow:0 0 12px #56d693a6; }
.auth-challenge p { margin:10px 0 7px; color:var(--muted); font-size:12px; }
.auth-code { display:block; width:fit-content; margin:8px 0 12px; padding:8px 12px; border:1px solid #526a61; background:#08120f; color:#f4fff8; font-size:23px; font-weight:800; letter-spacing:.12em; }
.auth-challenge-actions { display:flex; flex-wrap:wrap; gap:8px; }
.auth-challenge small { display:block; margin-top:10px; color:var(--muted); font-size:10px; }

/* Minecraft-inspired polish: block colors, crisp icons and clearer account identity. */
:root { --grass: #79b64b; --grass-bright: #a5d66e; --dirt: #8b6748; --stone: #202a31; }
body { background: radial-gradient(ellipse at 78% 0%, #243725 0%, transparent 35%), linear-gradient(180deg, #0b1115, var(--bg) 42%); }
.topbar { background: rgba(8, 13, 17, .94); backdrop-filter: blur(12px); }
.wordmark { letter-spacing: 1.5px; }
.logo-mark { position: relative; border-color: #5c8441; background: linear-gradient(180deg, #41652d 0 28%, #202b22 28% 100%); box-shadow: inset 0 -4px #141c17, 2px 2px 0 #080d12; }
.logo-mark::after { position: absolute; right: 3px; bottom: 3px; width: 5px; height: 5px; background: var(--grass-bright); content: ""; }
.top-nav a { gap: 7px; }
.nav-glyph { display: inline-grid; width: 19px; height: 19px; place-items: center; border: 1px solid #34433a; background: #111b16; color: #a8ce80; font-size: 12px; line-height: 1; }
.top-nav a.active .nav-glyph { border-color: #608b43; background: #1c2c1b; color: #c4e59b; }
.button { border-radius: 5px; }
.button.primary { border-color: #8dc65a; background: linear-gradient(180deg, #8ac456, #659a3c); color: #10170d; box-shadow: inset 0 1px #c3e49a; }
.button.primary:hover { border-color: #b7e783; background: #9bd36a; }
.welcome-panel { position: relative; overflow: hidden; border-color: #354a37; border-top: 2px solid #6da849; border-radius: 7px; background: linear-gradient(110deg, #17251b, #0c1315 75%); }
.welcome-panel::after { position: absolute; top: 0; right: 0; width: 150px; height: 100%; background: linear-gradient(135deg, transparent 40%, #79b64b0b 40% 60%, transparent 60%); content: ""; pointer-events: none; }
.stat, .bot-card, .settings-card, .logs-card, .user-list { border-radius: 6px; }
.stat-icon { border-radius: 3px; image-rendering: pixelated; }
.bot-card { transition: border-color .18s, transform .18s, background .18s; }
.bot-card:hover { transform: translateY(-2px); border-color: #526b4b; background: #0e1714; }
.bot-avatar { width: 42px; height: 42px; overflow: hidden; border-color: #587343; border-radius: 4px; background: #17251a; box-shadow: 2px 2px 0 #080d12; }
.bot-avatar svg { display: block; width: 34px; height: 34px; image-rendering: pixelated; }
.bot-avatar.bedrock { border-color: #397b7a; background: #10201f; }
.bot-identity { display: grid; gap: 2px; padding: 11px 12px; border: 1px solid var(--line-soft); border-radius: 4px; background: #0a1110; }
.bot-identity > span { color: #88ad68; font-size: 9px; font-weight: 750; letter-spacing: 1px; text-transform: uppercase; }
.bot-identity b { color: #edf4e7; font-size: 13px; }
.bot-identity .identity-login { overflow-wrap: anywhere; color: var(--muted); font-size: 10px; }
.status { border-radius: 3px; }
.auth-card { border-top: 2px solid #6da849; border-radius: 7px; background: rgba(11, 17, 18, .97); }
.remember-label { display: flex !important; grid-template-columns: none !important; align-items: center; gap: 10px !important; margin: 12px 0 3px !important; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; background: #0b1210; cursor: pointer; }
.remember-label input { width: 16px !important; min-height: 16px !important; height: 16px; margin: 0; accent-color: var(--grass); }
.remember-label span { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 12px; }
.remember-label small { color: var(--muted); font-size: 10px; font-weight: 450; }
.auth-card input:not([type="checkbox"]) { border-radius: 4px; }
.empty { border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }

/* Keep controls readable and aligned at compact widths. */
select, input { border-radius: 4px; }
.top-nav a { min-width: max-content; }
.nav-glyph { flex: 0 0 19px; font-family: "Courier New", monospace; font-variant-emoji: text; font-weight: 700; }
.bot-title b { font-size: 14px; }
.bot-title small { font-size: 11px; }
.status { padding: 4px 8px; font-size: 10px; }
.bot-metrics small { font-size: 10px; }
.bot-metrics b { font-size: 12px; }
.bot-actions .button { min-height: 35px; font-size: 11px; }
.button:focus-visible, .top-nav a:focus-visible, .text-button:focus-visible { outline: 2px solid var(--grass-bright); outline-offset: 3px; }
input, select, textarea { min-width: 0; }
.inline-chat .button, .inline-command .button { flex: 0 0 auto; }
.ticket-actions select { min-width: 150px; }
@media (max-width: 600px) {
  .topbar-inner { gap: 0 12px; }
  .topbar-user { gap: 9px; padding-left: 10px; }
  .user-badge { max-width: min(38vw, 130px); }
  .top-nav { scrollbar-width: thin; }
  .bot-top { flex-wrap: wrap; }
  .bot-top .status { margin-left: auto; }
  .bot-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bot-actions .quiet { margin-left: 0; }
  .inline-chat, .inline-command { align-items: stretch; }
  .inline-chat .button, .inline-command .button { padding-inline: 9px; }
  .ticket-actions select, .ticket-actions input { min-width: 100%; }
}
