@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&family=Inter:wght@400;500;600;700&display=swap");

:root {
  color-scheme: dark;
  --void: #090b0c;
  --shell: #101315;
  --deck: #15191b;
  --deck-2: #1b2022;
  --raised: #22282a;
  --line: #343b3d;
  --line-hot: #66715d;
  --ink: #f2f0e9;
  --muted: #969c98;
  --dim: #656b68;
  --signal: #c8f35b;
  --signal-soft: rgba(200, 243, 91, 0.12);
  --amber: #f1b84a;
  --danger: #ff665f;
  --danger-soft: rgba(255, 102, 95, 0.12);
  --blue: #7eb9ff;
  --cut: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  --cut-small: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--body);
  font-size: 14px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    radial-gradient(circle at 18% -20%, rgba(200, 243, 91, 0.1), transparent 38%),
    var(--void);
  background-size: 38px 38px, 38px 38px, auto, auto;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

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

button,
.logout {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--raised);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  clip-path: var(--cut-small);
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease, transform 150ms ease;
}

button:hover,
.logout:hover {
  border-color: var(--line-hot);
  background: #29302c;
  color: var(--signal);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

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

.primary {
  border-color: var(--signal);
  background: var(--signal);
  color: #12150d;
}

.primary:hover {
  border-color: #dcff83;
  background: #dcff83;
  color: #0d1008;
}

.danger {
  border-color: rgba(255, 102, 95, 0.52) !important;
  color: #ffaaa6 !important;
}

.danger:hover {
  background: var(--danger-soft) !important;
  color: #ffd1cf !important;
}

input,
select,
textarea,
pre {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #0d1011;
  color: var(--ink);
}

input,
select,
textarea {
  min-height: 44px;
  padding: 11px 13px;
}

input::placeholder,
textarea::placeholder {
  color: #666d69;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--signal);
  background: #111513;
}

textarea,
pre {
  font-family: var(--mono);
  line-height: 1.55;
}

select {
  appearance: none;
  padding-right: 40px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2,
.server-state,
.brand strong {
  font-family: var(--display);
}

h1,
h2 {
  letter-spacing: 0.01em;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.muted,
.panel-subtitle,
.form-hint {
  color: var(--muted);
}

.eyebrow,
.modal-kicker,
.metric span,
.account-label {
  margin-bottom: 8px;
  color: var(--amber);
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* Launcher shell */
.app-shell {
  display: grid;
  grid-template-rows: 66px minmax(0, 1fr);
  width: calc(100vw - 24px);
  height: calc(100vh - 24px);
  margin: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--shell);
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.48);
  clip-path: var(--cut);
}

.app-chrome {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: stretch;
  min-width: 0;
  border-bottom: 1px solid var(--line);
  background: #121617;
}

.app-chrome::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, var(--signal), transparent 34%);
  opacity: 0.5;
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 224px;
  padding: 9px 18px;
  border-right: 1px solid var(--line);
  background: #181d1b;
}

.brand-mark {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 1px solid var(--signal);
  color: var(--signal);
  font: 800 16px/1 var(--display);
  clip-path: var(--cut-small);
}

.brand-mark i {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 6px;
  height: 6px;
  background: var(--signal);
}

.brand strong {
  display: block;
  font-size: 21px;
  font-style: italic;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.08em;
}

.brand strong span {
  color: var(--signal);
}

.brand small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font: 500 8px/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.app-chrome nav {
  display: flex;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.app-chrome nav::-webkit-scrollbar {
  display: none;
}

.nav-item {
  position: relative;
  flex: 0 0 auto;
  min-width: 110px;
  height: 65px;
  padding: 22px 17px 12px;
  border: 0;
  border-right: 1px solid #292f30;
  background: transparent;
  color: var(--muted);
  font: 600 12px/1 var(--mono);
  text-transform: uppercase;
  clip-path: none;
}

.nav-item::before {
  position: absolute;
  top: 9px;
  left: 17px;
  color: var(--dim);
  content: attr(data-code);
  font: 500 9px/1 var(--mono);
}

.nav-item::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  content: "";
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 150ms ease;
}

.nav-item:hover {
  background: #1a201e;
  color: var(--ink);
}

.nav-item.active {
  background: var(--signal-soft);
  color: var(--signal);
}

.nav-item.active::before {
  color: var(--signal);
}

.nav-item.active::after {
  transform: scaleX(1);
}

.operator-menu {
  display: flex;
  align-items: center;
  min-width: 188px;
  border-left: 1px solid var(--line);
}

.account-card {
  min-width: 0;
  padding: 9px 14px;
}

.account-card .account-label,
.account-card small {
  display: block;
}

.account-card .account-label {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 8px;
}

.account-card strong {
  display: block;
  max-width: 100px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-card small {
  margin-top: 2px;
  color: var(--signal);
  font: 500 8px/1 var(--mono);
  text-transform: uppercase;
}

.logout {
  display: grid;
  width: 52px;
  min-height: 65px;
  place-items: center;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: 600 10px/1 var(--mono);
  text-decoration: none;
  text-transform: uppercase;
  clip-path: none;
}

.workspace {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 0 26px 26px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.018), transparent 28%),
    var(--deck);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  height: 92px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(21, 25, 27, 0.94);
  backdrop-filter: blur(12px);
}

.title-lockup {
  display: flex;
  align-items: baseline;
  gap: 16px;
  min-width: 0;
}

.title-lockup .eyebrow {
  order: 2;
  margin: 0;
  color: var(--muted);
  white-space: nowrap;
}

.topbar h1 {
  margin: 0;
  overflow: hidden;
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 600;
  line-height: 0.88;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.topbar-status {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 18px;
  min-width: 130px;
  margin-left: 24px;
}

.topbar-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

.status-pill {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--line);
  color: var(--muted);
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-pill::before {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--danger);
  content: "";
  box-shadow: 0 0 12px currentColor;
}

.status-pill.online {
  color: var(--signal);
}

.status-pill.online::before {
  background: var(--signal);
}

.view {
  display: none;
  min-width: 0;
  animation: view-in 180ms ease both;
}

.view.active {
  display: block;
}

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

/* Dashboard */
.dashboard-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 252px;
  padding: 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(200, 243, 91, 0.08), transparent 42%),
    #111617;
  clip-path: var(--cut);
}

.dashboard-hero::before,
.dashboard-hero::after {
  position: absolute;
  right: 6%;
  border: 1px solid rgba(200, 243, 91, 0.22);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.dashboard-hero::before {
  top: 50%;
  width: 300px;
  height: 300px;
  transform: translateY(-50%);
  box-shadow: 0 0 0 38px rgba(200, 243, 91, 0.018), 0 0 0 76px rgba(200, 243, 91, 0.012);
}

.dashboard-hero::after {
  top: calc(50% - 1px);
  right: calc(6% + 110px);
  width: 80px;
  height: 1px;
  border: 0;
  border-top: 1px solid rgba(200, 243, 91, 0.55);
  border-radius: 0;
  transform: rotate(-34deg);
  transform-origin: right;
}

.dashboard-hero > div {
  position: relative;
  z-index: 2;
}

.server-state {
  margin: -4px 0 4px;
  font-size: clamp(70px, 10vw, 126px);
  font-weight: 700;
  line-height: 0.8;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.server-state.running {
  color: var(--signal);
}

.server-state.stopped {
  color: var(--danger);
}

.dashboard-hero .muted {
  margin: 20px 0 0;
}

.power-controls {
  display: flex;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  background: rgba(9, 11, 12, 0.76);
}

.icon-button {
  display: grid;
  width: 54px;
  height: 54px;
  min-height: 54px;
  place-items: center;
  padding: 0;
  font-size: 22px;
}

.power.start {
  border-color: rgba(200, 243, 91, 0.5);
  color: var(--signal);
}

.power.restart {
  border-color: rgba(241, 184, 74, 0.5);
  color: var(--amber);
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 10px;
  border: 1px solid var(--line);
  background: var(--deck-2);
}

.metric {
  min-width: 0;
  min-height: 92px;
  padding: 20px;
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: 0;
}

.metric span {
  display: block;
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 9px;
}

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

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(400px, 1.2fr);
  gap: 10px;
  margin-top: 10px;
}

/* Shared panels and lists */
.panel {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--deck-2);
  clip-path: var(--cut);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  margin-bottom: 20px;
}

.panel-head > div,
.editor-title {
  min-width: 0;
}

.panel-head button {
  flex: 0 0 auto;
  padding: 0 15px;
}

.panel-subtitle {
  margin: 7px 0 0;
  font-size: 12px;
}

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

.quick-actions button {
  min-width: 0;
}

dl {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 11px 18px;
  margin: 22px 0 0;
}

dt {
  color: var(--muted);
}

dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 12px;
}

.split {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(420px, 1.28fr);
  gap: 10px;
  min-width: 0;
}

.config-split,
.logs-layout {
  height: calc(100vh - 200px);
  min-height: 460px;
}

.config-split {
  grid-template-columns: minmax(260px, 0.56fr) minmax(520px, 1.44fr);
}

.list-panel,
.editor-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.list-search {
  flex: 0 0 auto;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 12px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  overflow: auto;
}

.config-list-panel .list,
.logs-layout .list {
  min-height: 0;
  padding-right: 4px;
  overscroll-behavior: contain;
}

.list-item,
.list-row {
  width: 100%;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  background: #111516;
}

.list-item {
  display: block;
  min-height: 0;
  text-align: left;
  clip-path: var(--cut-small);
}

.list-item > span,
.list-item > small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-item > span {
  font-weight: 700;
}

.list-item > small,
.setting-label small,
.log-copy small {
  margin-top: 5px;
  color: var(--muted);
  font: 400 11px/1.35 var(--mono);
}

.list-item.active {
  border-color: var(--signal);
  background: var(--signal-soft);
  color: var(--signal);
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.list-row > span:first-child,
.list-row > div:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.row-actions,
.user-controls,
.button-row {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.row-actions button,
.user-controls button {
  padding: 0 12px;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(390px, auto);
}

.user-controls select {
  width: 165px;
  min-height: 40px;
}

.credential-button {
  color: var(--signal);
}

.empty-state {
  display: grid;
  min-height: 180px;
  padding: 30px;
  place-content: center;
  text-align: center;
  border: 1px dashed var(--line);
  color: var(--muted);
}

.empty-state strong {
  margin-bottom: 8px;
  color: var(--ink);
}

/* Editors */
.editor-head {
  align-items: flex-start;
}

.editor-title h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.segmented {
  display: flex;
  border: 1px solid var(--line);
}

.segmented button {
  min-height: 38px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  clip-path: none;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button.active {
  background: var(--signal);
  color: #11140d;
}

.settings-editor,
#fileEditor,
#bansEditor,
#logViewer {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.settings-editor {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-right: 4px;
}

.setting-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.72fr) minmax(220px, 1.28fr);
  align-items: center;
  gap: 20px;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  background: #111516;
}

.setting-label,
.setting-label strong,
.setting-label small {
  display: block;
  min-width: 0;
}

.setting-label strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setting-label small {
  overflow-wrap: anywhere;
}

.setting-row input,
.setting-row select {
  min-height: 40px;
}

.setting-row .toggle-input {
  width: 22px;
  height: 22px;
  min-height: 22px;
  margin: 0;
  accent-color: var(--signal);
}

#fileEditor,
#bansEditor {
  resize: none;
  padding: 18px;
  font-size: 12px;
}

#logViewer {
  margin: 0;
  padding: 18px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.log-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.log-copy {
  min-width: 0;
}

.log-copy strong,
.log-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.size-badge {
  flex: 0 0 auto;
  padding: 5px 7px;
  border: 1px solid var(--line);
  color: var(--muted);
  font: 500 9px/1 var(--mono);
}

/* Forms and workshop */
.inline-form,
.stack-form {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.inline-form input {
  flex: 1 1 180px;
}

.inline-form button {
  flex: 0 0 auto;
  padding: 0 18px;
}

.stack-form {
  flex-direction: column;
}

.stack-form button {
  padding: 0 18px;
}

.workshop-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1.35fr) minmax(300px, 0.65fr);
  gap: 10px;
}

.upload-panel {
  align-self: start;
  background:
    linear-gradient(145deg, rgba(200, 243, 91, 0.07), transparent 45%),
    var(--deck-2);
}

.file-drop {
  display: grid;
  min-height: 132px;
  padding: 22px;
  place-content: center;
  border: 1px dashed var(--line-hot);
  background: #111516;
  text-align: center;
  cursor: pointer;
}

.file-drop:hover {
  border-color: var(--signal);
  background: var(--signal-soft);
}

.file-drop span {
  color: var(--signal);
  font-weight: 700;
}

.file-drop small {
  margin-top: 7px;
  color: var(--muted);
}

.file-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-progress {
  padding: 12px;
  border: 1px solid var(--line);
  background: #111516;
}

.upload-progress > div {
  display: flex;
  justify-content: space-between;
  margin-bottom: 9px;
  font: 500 10px/1 var(--mono);
}

progress {
  width: 100%;
  height: 6px;
  border: 0;
  background: #2b3030;
  accent-color: var(--signal);
}

progress::-webkit-progress-bar { background: #2b3030; }
progress::-webkit-progress-value { background: var(--signal); }

/* Dialogs and messages */
.modal-card {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line-hot);
  background: var(--deck-2);
  color: var(--ink);
  clip-path: var(--cut);
}

.modal-card::backdrop {
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(4px);
}

.modal-card form {
  padding: 26px;
}

.modal-card label,
.login-panel label {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  color: var(--muted);
  font: 500 11px/1 var(--mono);
  text-transform: uppercase;
}

.modal-close {
  width: 40px;
  padding: 0 !important;
  font-size: 23px;
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 20px;
}

.modal-actions button {
  padding: 0 18px;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 14px 18px;
  border: 1px solid var(--signal);
  background: #171c15;
  color: var(--signal);
  font-weight: 700;
  clip-path: var(--cut-small);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.48);
}

.toast.error,
.notice.error {
  border-color: var(--danger);
  background: #211414;
  color: #ffaaa6;
}

.notice {
  padding: 12px 14px;
  border: 1px solid var(--line);
}

[hidden] {
  display: none !important;
}

/* Login */
.login-shell {
  display: grid;
  min-height: 100vh;
  padding: 22px;
  place-items: center;
}

.login-panel {
  position: relative;
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(200, 243, 91, 0.08), transparent 40%),
    var(--deck-2);
  clip-path: var(--cut);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.login-panel::after {
  position: absolute;
  top: 0;
  left: 0;
  width: 90px;
  height: 3px;
  background: var(--signal);
  content: "";
}

.login-panel h1 {
  margin-bottom: 26px;
  font-size: 54px;
  font-weight: 600;
  line-height: 0.9;
  text-transform: uppercase;
}

.login-panel button {
  width: 100%;
  margin-top: 20px;
}

.ok-text { color: var(--signal); }
.bad-text { color: var(--danger); }

/* Scrollbars */
* {
  scrollbar-color: #515953 #171b1c;
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: #171b1c;
}

::-webkit-scrollbar-thumb {
  border: 2px solid #171b1c;
  background: #515953;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--signal);
}

/* Compact launcher mode */
@media (max-width: 1180px) {
  .app-shell {
    grid-template-rows: auto minmax(0, 1fr);
  }

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

  .app-chrome nav {
    order: 3;
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
  }

  .nav-item {
    flex: 1 0 104px;
    height: 52px;
    min-height: 52px;
    padding: 21px 12px 9px;
    text-align: left;
  }

  .nav-item::before {
    top: 7px;
    left: 12px;
  }

  .operator-menu {
    justify-self: end;
  }

  .config-split,
  .logs-layout {
    height: calc(100vh - 252px);
  }

  .user-row {
    grid-template-columns: 1fr;
  }

  .user-controls {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

@media (max-width: 860px) {
  body {
    overflow: auto;
  }

  .app-shell {
    width: 100%;
    height: 100vh;
    margin: 0;
    border: 0;
    clip-path: none;
  }

  .brand {
    width: auto;
    border-right: 0;
  }

  .account-card {
    display: none;
  }

  .operator-menu {
    min-width: 52px;
  }

  .workspace {
    padding: 0 14px 18px;
  }

  .topbar {
    height: 78px;
    margin-bottom: 14px;
  }

  .title-lockup {
    display: block;
  }

  .title-lockup .eyebrow {
    margin-top: 6px;
  }

  .topbar h1 {
    font-size: 36px;
  }

  .topbar-rule {
    display: none;
  }

  .topbar-status {
    flex: 0 0 auto;
    min-width: 0;
  }

  .status-pill {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .dashboard-hero {
    min-height: 218px;
    padding: 24px;
  }

  .dashboard-hero::before,
  .dashboard-hero::after {
    opacity: 0.45;
  }

  .server-state {
    font-size: clamp(56px, 14vw, 86px);
  }

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

  .metric:nth-child(2) {
    border-right: 0;
  }

  .metric:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .dashboard-grid,
  .split,
  .config-split,
  .workshop-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .config-split,
  .logs-layout {
    height: auto;
    min-height: 0;
  }

  .config-list-panel,
  .logs-layout .list-panel {
    height: 340px;
  }

  .editor-panel {
    min-height: 500px;
  }

  .users-list-panel,
  .user-create-panel {
    min-height: auto;
  }

  .workshop-layout .panel {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .brand {
    padding-inline: 12px;
  }

  .brand small,
  .brand-mark {
    display: none;
  }

  .brand strong {
    font-size: 18px;
  }

  .topbar-status {
    margin-left: 10px;
  }

  .status-pill {
    width: 16px;
    padding: 0;
    border: 0;
    color: transparent !important;
  }

  .status-pill::before {
    margin: 0;
  }

  .dashboard-hero {
    display: block;
    min-height: 264px;
  }

  .power-controls {
    position: absolute !important;
    right: 18px;
    bottom: 18px;
  }

  .icon-button {
    width: 46px;
    height: 46px;
    min-height: 46px;
  }

  .panel {
    padding: 17px;
  }

  .panel-head,
  .editor-head {
    align-items: flex-start;
  }

  .editor-head {
    flex-direction: column;
  }

  .editor-actions {
    width: 100%;
  }

  .editor-actions .segmented {
    flex: 1;
  }

  .editor-actions .segmented button {
    flex: 1;
  }

  .setting-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .inline-form {
    flex-direction: column;
  }

  .inline-form input {
    flex: 0 0 auto;
  }

  .inline-form button {
    min-height: 44px;
  }

  .list-row,
  .log-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .user-controls,
  .row-actions {
    width: 100%;
  }

  .user-controls select {
    width: 100%;
  }

  .user-controls button,
  .row-actions button {
    flex: 1;
  }

  dl {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  dd {
    margin-bottom: 10px;
  }
}
