:root {
  color-scheme: dark;
  --bg: #090a0c;
  --bg-soft: #0f1115;
  --panel: #12151a;
  --panel-2: #171b21;
  --border: #292e36;
  --border-soft: #20252c;
  --text: #f4f6f8;
  --muted: #8d96a3;
  --orange: #ff7a1a;
  --orange-2: #ff9b52;
  --orange-soft: rgba(255, 122, 26, 0.12);
  --green: #39d98a;
  --red: #ff5d67;
  --yellow: #ffca55;
  --blue: #62a8ff;
  --purple: #b88cff;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 78% -10%, rgba(255, 122, 26, 0.12), transparent 31rem),
    radial-gradient(circle at 0% 20%, rgba(255, 122, 26, 0.05), transparent 28rem),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.app-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 0 26px 50px;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 86px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  background: rgba(9, 10, 12, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 122, 26, 0.55);
  border-radius: 13px;
  color: #0b0b0c;
  background: linear-gradient(145deg, var(--orange-2), var(--orange));
  box-shadow: 0 10px 24px rgba(255, 122, 26, 0.2);
  font-weight: 900;
  letter-spacing: -0.06em;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.topbar-actions,
.hero-actions,
.console-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard {
  display: grid;
  gap: 18px;
  padding-top: 26px;
}

.panel {
  border: 1px solid var(--border-soft);
  border-radius: 19px;
  background: linear-gradient(150deg, rgba(23, 27, 33, 0.97), rgba(16, 19, 23, 0.98));
  box-shadow: var(--shadow);
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 28px;
}

.hero-card::after {
  position: absolute;
  top: -170px;
  right: -120px;
  width: 410px;
  height: 410px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 122, 26, 0.17), transparent 68%);
  content: "";
  pointer-events: none;
}

.hero-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--orange-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.hero-heading h2,
.panel-header h3,
.modal-card h2,
.login-copy h2 {
  margin: 0;
  letter-spacing: -0.035em;
}

.hero-heading h2 {
  font-size: clamp(25px, 4vw, 36px);
}

.hero-heading p {
  margin: 9px 0 0;
  color: var(--muted);
}

.stats-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 27px;
}

.stat {
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid var(--border-soft);
  border-radius: 13px;
  background: rgba(7, 8, 10, 0.34);
}

.stat span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
}

.stat strong {
  display: block;
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.content-grid > .panel,
.console-panel,
.history-panel {
  padding: 22px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.panel-header h3 {
  font-size: 19px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, opacity 140ms ease;
  font-weight: 750;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:disabled,
.disabled-link {
  cursor: not-allowed;
  opacity: 0.42;
  pointer-events: none;
}

.button.primary {
  color: #120b06;
  background: linear-gradient(135deg, var(--orange-2), var(--orange));
  box-shadow: 0 8px 22px rgba(255, 122, 26, 0.18);
}

.button.secondary {
  border-color: rgba(255, 122, 26, 0.32);
  color: var(--orange-2);
  background: var(--orange-soft);
}

.button.danger {
  border-color: rgba(255, 93, 103, 0.32);
  color: #ff858d;
  background: rgba(255, 93, 103, 0.09);
}

.button.ghost {
  border-color: var(--border);
  color: #c9ced5;
  background: rgba(255, 255, 255, 0.025);
}

.button.compact {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 12px;
}

.button.wide {
  width: 100%;
}

.status-pill,
.mini-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.045em;
  white-space: nowrap;
}

.status-pill {
  padding: 8px 12px;
  font-size: 11px;
}

.status-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

.status-pill.online,
.mini-badge.success {
  border-color: rgba(57, 217, 138, 0.28);
  color: var(--green);
  background: rgba(57, 217, 138, 0.07);
}

.status-pill.connecting,
.mini-badge.waiting {
  border-color: rgba(255, 202, 85, 0.28);
  color: var(--yellow);
  background: rgba(255, 202, 85, 0.07);
}

.status-pill.offline,
.mini-badge.neutral {
  color: #8e97a4;
  background: rgba(255, 255, 255, 0.025);
}

.status-pill.error,
.mini-badge.error {
  border-color: rgba(255, 93, 103, 0.28);
  color: var(--red);
  background: rgba(255, 93, 103, 0.07);
}

.mini-badge {
  padding: 6px 9px;
  font-size: 9px;
}

label > span,
.inline-setting > span {
  display: block;
  margin-bottom: 7px;
  color: #b9c0ca;
  font-size: 12px;
  font-weight: 650;
}

label small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

input,
select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: #0d0f12;
  transition: border-color 140ms ease, background 140ms ease;
}

input::placeholder {
  color: #555d68;
}

input:hover,
select:hover {
  border-color: #3a414c;
}

input:focus,
select:focus {
  border-color: rgba(255, 122, 26, 0.7);
  background: #101216;
  outline: none;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.span-two {
  grid-column: span 2;
}

.account-profile {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-radius: 13px;
  background: rgba(8, 9, 11, 0.28);
}

.avatar-placeholder {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  color: var(--orange-2);
  background: var(--orange-soft);
  font-weight: 900;
}

.account-profile strong,
.account-profile span {
  display: block;
}

.account-profile span {
  max-width: 330px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-panel .button {
  margin-top: 16px;
}

.switch-list {
  display: grid;
  gap: 15px;
}

.switch-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  cursor: pointer;
}

.switch-row div strong,
.switch-row div span {
  display: block;
}

.switch-row div strong {
  font-size: 13px;
}

.switch-row div span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.switch-row > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-row > i {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
  border: 1px solid #343b45;
  border-radius: 999px;
  background: #0d0f12;
  transition: 160ms ease;
}

.switch-row > i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #68717e;
  content: "";
  transition: 160ms ease;
}

.switch-row > input:checked + i {
  border-color: rgba(255, 122, 26, 0.55);
  background: var(--orange-soft);
}

.switch-row > input:checked + i::after {
  transform: translateX(18px);
  background: var(--orange);
  box-shadow: 0 0 11px rgba(255, 122, 26, 0.45);
}

.inline-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}

.inline-setting > span {
  margin: 0;
}

.inline-setting > div {
  display: flex;
  align-items: center;
  gap: 7px;
}

.inline-setting input {
  width: 68px;
  min-height: 36px;
}

.inline-setting b {
  color: var(--muted);
  font-size: 11px;
}

.compact-grid input {
  min-height: 38px;
}

.commands-list {
  display: grid;
  gap: 10px;
}

.command-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 112px 122px 34px;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: rgba(7, 8, 10, 0.27);
}

.command-row input {
  min-height: 36px;
}

.command-enable,
.command-secret,
.tiny-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
}

.command-enable input,
.command-secret input,
.tiny-check input {
  width: 15px;
  min-height: 15px;
  accent-color: var(--orange);
}

.command-enable span,
.command-secret span,
.tiny-check span {
  margin: 0;
}

.command-delete {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  color: #89919c;
  background: transparent;
}

.command-delete:hover {
  border-color: rgba(255, 93, 103, 0.4);
  color: var(--red);
}

.empty-state {
  margin: 0;
  padding: 22px 0 5px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

code {
  padding: 2px 5px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--orange-2);
  background: #0b0d10;
}


.security-note {
  margin: 16px 0 0;
  color: #6f7782;
  font-size: 10px;
  line-height: 1.5;
}

.console-heading {
  align-items: center;
}

.file-label {
  max-width: 320px;
  overflow: hidden;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.console-output {
  height: 360px;
  overflow: auto;
  padding: 13px;
  border: 1px solid #242931;
  border-radius: 13px;
  background: #08090b;
  scrollbar-color: #343b45 transparent;
}

.console-placeholder {
  display: grid;
  height: 100%;
  place-items: center;
  color: #545b65;
  font-size: 12px;
}

.log-line {
  display: grid;
  grid-template-columns: 72px 88px minmax(0, 1fr);
  gap: 10px;
  padding: 7px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.035);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
}

.log-line:last-child {
  border-bottom: 0;
}

.log-time {
  color: #626a75;
}

.log-level {
  font-weight: 800;
}

.log-message {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #c7ccd3;
}

.level-INFO .log-level { color: var(--blue); }
.level-SUCCESS .log-level { color: var(--green); }
.level-WARNING .log-level,
.level-RECONNECT .log-level { color: var(--yellow); }
.level-ERROR .log-level,
.level-KICK .log-level,
.level-DEATH .log-level { color: var(--red); }
.level-COMMAND .log-level { color: var(--orange-2); }
.level-CHAT .log-level { color: var(--purple); }
.level-FOOD .log-level { color: #80e29c; }
.level-AUTH .log-level { color: #65c4ff; }

.command-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.command-bar input {
  min-width: 0;
}

.session-list {
  display: grid;
  gap: 8px;
}

.session-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  background: rgba(7, 8, 10, 0.22);
}

.session-name {
  min-width: 0;
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-meta {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(10px);
}

.modal-card {
  position: relative;
  width: min(460px, 100%);
  padding: 28px;
  border: 1px solid #323841;
  border-radius: 20px;
  background: #12151a;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.6);
}

.modal-card p {
  color: var(--muted);
  line-height: 1.55;
}

.modal-card > small {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  text-align: center;
  font-size: 10px;
}

.modal-close {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  font-size: 21px;
}

.device-code {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  padding: 14px;
  border: 1px solid rgba(255, 122, 26, 0.35);
  border-radius: 13px;
  background: var(--orange-soft);
}

.device-code span {
  color: var(--muted);
  font-size: 10px;
}

.device-code strong {
  color: var(--orange-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 22px;
  letter-spacing: 0.1em;
}

.toast-container {
  position: fixed;
  z-index: 200;
  right: 18px;
  bottom: 18px;
  display: grid;
  width: min(380px, calc(100vw - 36px));
  gap: 10px;
}

.toast {
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: #dce0e6;
  background: #161a20;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.45);
  font-size: 12px;
  animation: toast-in 180ms ease;
}

.toast.error {
  border-color: rgba(255, 93, 103, 0.34);
}

.toast.success {
  border-color: rgba(57, 217, 138, 0.34);
}

@keyframes toast-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-shell {
  width: min(430px, 100%);
}

.login-card {
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(155deg, rgba(24, 28, 34, 0.98), rgba(13, 15, 18, 0.98));
  box-shadow: var(--shadow);
}

.brand-login {
  margin-bottom: 32px;
}

.login-copy p {
  margin: 9px 0 23px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.stack-form {
  display: grid;
  gap: 14px;
}

.notice,
.form-error {
  padding: 12px 13px;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.5;
}

.notice.warning {
  margin-bottom: 15px;
  border: 1px solid rgba(255, 202, 85, 0.26);
  color: #f6d98e;
  background: rgba(255, 202, 85, 0.07);
}

.form-error {
  margin: 14px 0 0;
  border: 1px solid rgba(255, 93, 103, 0.28);
  color: #ff9ca2;
  background: rgba(255, 93, 103, 0.08);
}

@media (max-width: 1080px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .command-row {
    grid-template-columns: 30px minmax(0, 1fr) 100px 34px;
  }

  .command-secret {
    grid-column: 2 / 4;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 0 14px 35px;
  }

  .topbar {
    min-height: 72px;
  }

  .brand p,
  .topbar .button {
    display: none;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .hero-card,
  .content-grid > .panel,
  .console-panel,
  .history-panel {
    padding: 17px;
  }

  .hero-heading {
    display: grid;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .button {
    flex: 1;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid.two {
    grid-template-columns: 1fr;
  }

  .span-two {
    grid-column: span 1;
  }

  .command-row {
    grid-template-columns: 28px minmax(0, 1fr) 34px;
  }

  .command-delay,
  .command-secret {
    grid-column: 2 / 4;
  }

  .console-heading,
  .console-actions {
    align-items: flex-start;
  }

  
.security-note {
  margin: 16px 0 0;
  color: #6f7782;
  font-size: 10px;
  line-height: 1.5;
}

.console-heading {
    display: grid;
  }

  .file-label {
    max-width: 190px;
  }

  .log-line {
    grid-template-columns: 58px 72px minmax(0, 1fr);
    gap: 6px;
    padding-inline: 3px;
    font-size: 9px;
  }

  .command-bar {
    grid-template-columns: 1fr auto;
  }

  .command-bar .tiny-check {
    grid-column: 1 / 2;
  }

  .session-item {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .session-meta {
    grid-column: 1 / 2;
  }
}
