:root {
  color-scheme: light;
  --bg: #eef1f5;
  --panel: rgba(255, 255, 255, 0.76);
  --panel-2: rgba(248, 249, 251, 0.82);
  --line: rgba(42, 52, 66, 0.14);
  --text: #1d1d1f;
  --muted: #667085;
  --good: #128a45;
  --warn: #a76b00;
  --bad: #b42318;
  --focus: #007aff;
  --shadow: 0 18px 45px rgba(20, 28, 38, 0.12), 0 2px 8px rgba(20, 28, 38, 0.06);
}

* { box-sizing: border-box; }
html { min-width: 0; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 8%, rgba(76, 132, 229, 0.12), transparent 32%),
    radial-gradient(circle at 88% 18%, rgba(18, 138, 69, 0.08), transparent 30%),
    linear-gradient(145deg, #f8fafc 0%, #eef2f7 48%, #e6ebf2 100%);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

header {
  width: min(1388px, calc(100% - 32px));
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px auto;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  border-radius: 14px;
  position: sticky;
  top: 10px;
  z-index: 2;
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand img { width: 40px; height: 40px; border-radius: 10px; display: block; box-shadow: 0 5px 14px rgba(0,0,0,0.16); }
h1 { margin: 0; font-size: 20px; font-weight: 720; letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 4px;
  border: 1px solid rgba(42, 52, 66, 0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.38);
}
.top-nav a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 9px;
  color: var(--muted);
  font-weight: 650;
  font-size: 13px;
  text-decoration: none;
}
.top-nav a:hover { color: var(--focus); text-decoration: none; }
.top-nav a.active {
  color: var(--focus);
  background: rgba(255,255,255,0.84);
  box-shadow: 0 4px 12px rgba(20, 28, 38, 0.08);
}
.nav-ico {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: currentColor;
  font-size: 15px;
  line-height: 1;
}
.top-actions { display: flex; align-items: center; gap: 12px; min-width: 0; }
.header-ico {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255,255,255,0.52);
  border: 1px solid rgba(42, 52, 66, 0.08);
}
.logout { color: var(--muted); text-decoration: none; font-size: 13px; }
.logout:hover { color: var(--focus); }

main {
  width: min(1420px, 100%);
  margin: 0 auto;
  padding: 0 16px 16px;
  display: block;
}
main, .dashboard, .primary-column, .side-column, section { min-width: 0; }
.overview {
  display: grid;
  grid-template-columns: minmax(230px, 1.15fr) repeat(3, minmax(128px, 0.7fr)) minmax(220px, 1.2fr) repeat(2, minmax(120px, 0.65fr));
  gap: 0;
  align-items: stretch;
  margin-bottom: 16px;
  min-height: 112px;
}
.overview > * {
  border-right: 1px solid var(--line);
}
.overview > *:last-child { border-right: 0; }
.server-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 18px;
}
.server-card img {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  box-shadow: 0 8px 18px rgba(20, 28, 38, 0.14);
}
.server-card strong,
.status-tile strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
}
.server-card span,
.status-tile span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.status-tile {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 15px 16px;
}
.copy-host {
  position: absolute;
  right: 12px;
  bottom: 18px;
  width: 28px;
  min-height: 28px;
  padding: 0;
  color: var(--muted);
}
.tile-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 800;
}
.tile-icon.good {
  color: white;
  background: linear-gradient(180deg, #20b35d, #128a45);
  box-shadow: 0 6px 14px rgba(18, 138, 69, 0.24);
}
.tile-icon.warn {
  color: white;
  background: linear-gradient(180deg, #f2a93b, #c06d00);
  box-shadow: 0 6px 14px rgba(192, 109, 0, 0.20);
}
.tile-icon.bad {
  color: white;
  background: linear-gradient(180deg, #ef5348, #b42318);
  box-shadow: 0 6px 14px rgba(180, 35, 24, 0.20);
}
.tile-icon.neutral {
  color: #5f6b7a;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(42, 52, 66, 0.10);
}
.status-tile .value {
  max-width: 100%;
  text-align: left;
  font-size: 13px;
}
.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 500px);
  gap: 16px;
  align-items: start;
}
.primary-column,
.side-column {
  display: grid;
  gap: 16px;
}
section {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 13px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(32, 41, 55, 0.08);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
}
section h2 {
  margin: 0;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 650;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.section-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: #5f6b7a;
  font-weight: 800;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.section-head h2 {
  border-bottom: 0;
  background: transparent;
}
.head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 12px;
}
.head-actions button,
.head-actions select {
  min-height: 32px;
  font-size: 13px;
}
.content { padding: 14px; }
.row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 8px 0; min-width: 0; }
.label { color: var(--muted); }
.value {
  max-width: min(100%, 260px);
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: right;
}
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 9px;
  border-radius: 999px;
  font-weight: 650;
  border: 1px solid rgba(255,255,255,0.72);
  background: rgba(255,255,255,0.7);
}
.ok { color: var(--good); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
button, input, select {
  max-width: 100%;
  min-height: 36px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font: inherit;
  box-shadow: 0 1px 2px rgba(20, 28, 38, 0.05);
}
button {
  padding: 0 12px;
  cursor: pointer;
  font-weight: 600;
}
button:hover { border-color: rgba(0, 122, 255, 0.45); background: rgba(255,255,255,0.92); }
button.danger { background: #fff2f1; border-color: rgba(180, 35, 24, 0.22); color: var(--bad); }
button.success { background: #effaf3; border-color: rgba(18, 138, 69, 0.22); color: var(--good); }
button.warn-btn { background: #fff8ed; border-color: rgba(167, 107, 0, 0.22); color: #c06d00; }
button.primary { background: linear-gradient(#1687ff, #0071e3); border-color: #006edb; color: #fff; }
input, select { padding: 0 10px; }
input { min-width: 0; }
input:focus, select:focus, button:focus-visible {
  outline: 3px solid rgba(0, 122, 255, 0.18);
  border-color: var(--focus);
}
.command {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.console-panel .command {
  padding-bottom: 12px;
}
pre {
  margin: 0;
  padding: 12px;
  min-height: 280px;
  max-height: 62vh;
  overflow: auto;
  background: rgba(250, 251, 252, 0.86);
  border-top: 1px solid var(--line);
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
.console-panel .output {
  min-height: 438px;
  max-height: 58vh;
  margin: 0 14px 0;
  border: 1px solid rgba(42, 52, 66, 0.12);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(7, 13, 22, 0.98));
  color: #e5edf7;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.output { min-height: 130px; max-height: 240px; }
.audit { min-height: 130px; max-height: 220px; }
.quick-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 0;
  margin-top: 14px;
}
.quick-strip button {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.metric-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(42, 52, 66, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.84), 0 6px 18px rgba(32, 41, 55, 0.05);
}
.metric-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  margin-bottom: 8px;
}
.metric-head strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
}
.metric-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.metric-value {
  flex: 0 1 auto;
  max-width: 48%;
  color: var(--text);
  font: 650 12px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: right;
  overflow-wrap: anywhere;
}
.metric-chart {
  width: 100%;
  height: 132px;
  display: block;
  border: 1px solid rgba(42, 52, 66, 0.10);
  border-radius: 10px;
  background: rgba(248, 249, 251, 0.66);
}
.metric-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
}
.metric-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.metric-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.metric-legend .system { background: #007aff; }
.metric-legend .java { background: #30b46c; }
.muted { color: var(--muted); }
#stamp { white-space: nowrap; }
a { color: var(--focus); text-decoration: none; font-weight: 650; }
a:hover { text-decoration: underline; }
.table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 650; background: rgba(248, 249, 251, 0.62); }
.file-cell { max-width: 280px; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.public-page header { position: static; }
.public-main {
  display: grid;
  gap: 16px;
}
.public-hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
}
.public-hero h2 {
  margin: 4px 0 8px;
  font-size: 34px;
  line-height: 1.08;
  border: 0;
  background: transparent;
  padding: 0;
}
.public-hero p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}
.eyebrow {
  color: var(--focus);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}
.public-connect {
  min-width: min(100%, 280px);
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.66);
}
.public-connect span,
.public-card span {
  color: var(--muted);
  font-size: 12px;
}
.public-connect strong {
  font: 750 18px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.copy-public {
  width: max-content;
  min-height: 32px;
  padding: 0 12px;
  border-color: rgba(0, 122, 255, 0.32);
  color: var(--focus);
  background: rgba(255,255,255,0.74);
  font-size: 13px;
}
.public-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.public-card {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(32, 41, 55, 0.08);
}
.public-card strong {
  font-size: 16px;
  overflow-wrap: anywhere;
}
.public-section {
  padding-bottom: 14px;
}
.public-list,
.public-links {
  display: grid;
  gap: 10px;
  padding: 14px;
}
.join-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}
.join-grid > div {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,0.58);
}
.join-grid span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-bottom: 10px;
  border-radius: 50%;
  color: #fff;
  background: var(--focus);
  font-weight: 800;
}
.join-grid strong {
  display: block;
  margin-bottom: 5px;
}
.join-grid p {
  margin: 0;
  color: var(--muted);
}
.join-grid code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text);
  overflow-wrap: anywhere;
}
.public-list p {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,0.55);
}
.public-links {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.public-links a {
  display: grid;
  place-items: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,0.68);
}
.button-link {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid #006edb;
  border-radius: 7px;
  color: #fff;
  background: linear-gradient(#1687ff, #0071e3);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}
.button-link:hover { text-decoration: none; }
.map-widget { padding-bottom: 0; }
.map-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}
.map-progress > div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,0.58);
}
.map-progress span,
.map-note {
  color: var(--muted);
  font-size: 12px;
}
.map-progress strong {
  overflow-wrap: anywhere;
  font-size: 15px;
}
.map-note {
  padding: 0 14px 14px;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 18px;
  background: linear-gradient(145deg, #f7f8fb 0%, #e4e9f1 100%);
}
.login-card {
  width: min(380px, 100%);
  display: grid;
  gap: 12px;
  padding: 22px;
  border: 1px solid rgba(42, 52, 66, 0.14);
  border-radius: 16px;
  background: rgba(255,255,255,0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.25);
}
.login-brand { margin-bottom: 4px; }
.login-brand img { width: 40px; height: 40px; border-radius: 10px; }
.login-brand h1 { font-size: 19px; }
.login-card input, .login-card button { min-height: 42px; width: 100%; }
.login-card button { border-color: #006edb; background: linear-gradient(#1687ff, #0071e3); color: white; font-weight: 700; }
.error { padding: 10px 12px; border-radius: 9px; background: #fff2f1; color: var(--bad); }

@media (max-width: 900px) {
  main { padding: 10px; }
  header { width: calc(100% - 20px); padding: 0 12px; margin-top: 10px; }
  .top-nav { display: none; }
  .overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
  }
  .overview > * {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .overview > *:nth-last-child(-n+2) { border-bottom: 0; }
  .server-card { grid-column: 1 / -1; }
  .dashboard { grid-template-columns: 1fr; }
  .public-hero { flex-direction: column; }
  .public-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .join-grid { grid-template-columns: 1fr; }
  .map-progress { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .command { grid-template-columns: 1fr; }
  button { width: 100%; }
  .toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  body {
    font-size: 13px;
    background: linear-gradient(145deg, #f7f8fb 0%, #e4e9f1 100%);
  }
  header {
    height: auto;
    min-height: 58px;
    top: 0;
    border-radius: 0 0 14px 14px;
    margin-top: 0;
    width: 100%;
    padding: 10px 12px;
    gap: 8px;
  }
  .brand { gap: 9px; }
  .brand img { width: 32px; height: 32px; border-radius: 8px; }
  h1 { font-size: 16px; }
  #stamp { font-size: 12px; }
  .top-actions { gap: 8px; }
  .logout { display: none; }
  main { padding: 10px; }
  .overview,
  .dashboard,
  .primary-column,
  .side-column { gap: 10px; }
  .overview { margin-bottom: 10px; }
  section { border-radius: 12px; }
  section h2 { padding: 10px 12px; }
  .section-head { align-items: stretch; flex-direction: column; gap: 0; }
  .head-actions { padding: 0 12px 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content { padding: 12px; }
  .row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
  }
  .value {
    max-width: none;
    text-align: right;
    font-size: 12px;
    line-height: 1.35;
  }
  .pill {
    justify-self: end;
    max-width: 100%;
    overflow-wrap: anywhere;
    text-align: right;
  }
  .toolbar { gap: 7px; }
  button, input, select { min-height: 40px; font-size: 13px; }
  pre {
    min-height: 180px;
    max-height: 46vh;
    padding: 10px;
    font-size: 11px;
    line-height: 1.45;
  }
  .console-panel .output {
    min-height: 320px;
    margin: 0 12px;
  }
  .output { min-height: 104px; max-height: 190px; }
  .console-panel .output { max-height: 52vh; }
  .audit { min-height: 104px; max-height: 180px; }
  .metrics-grid { grid-template-columns: 1fr; }
  .metric-chart { height: 132px; }
  .metric-value { max-width: 54%; }
  th, td { padding: 8px; }
  .file-cell { max-width: 150px; }
  .public-status-grid,
  .public-links,
  .join-grid,
  .map-progress { grid-template-columns: 1fr; }
  .public-hero h2 { font-size: 27px; }
}

@media (max-width: 380px) {
  .toolbar { grid-template-columns: 1fr; }
  header { align-items: flex-start; flex-direction: column; }
  #stamp { align-self: flex-end; margin-top: -22px; }
  .overview { grid-template-columns: 1fr; }
  .overview > * { border-bottom: 1px solid var(--line); }
  .overview > *:last-child { border-bottom: 0; }
  .row { grid-template-columns: 1fr; }
  .label, .value, .pill { text-align: left; justify-self: stretch; }
  .quick-strip,
  .action-grid,
  .head-actions { grid-template-columns: 1fr; }
}
