:root {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  color: #dce5ed;
  background: #0b1018;
  font-synthesis: none;
  color-scheme: dark;
  --muted: #91a0b3;
  --line: #273243;
  --accent: #79ddca;
  --gold: #e5bf83;
  --panel: #121b27;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  outline-offset: 4px;
}
a {
  color: var(--accent);
}
button,
.button {
  border: 1px solid var(--line);
  background: #1c2a39;
  color: #eaf3f5;
  border-radius: 8px;
  padding: 10px 15px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover,
.button:hover {
  border-color: var(--accent);
}
button.primary,
.button.primary {
  background: var(--accent);
  color: #09271f;
  font-weight: 700;
  border-color: var(--accent);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
input,
select {
  background: #0d1520;
  border: 1px solid #344155;
  border-radius: 6px;
  color: #e5edf3;
  padding: 9px;
  max-width: 100%;
  min-width: 0;
}
input[type="checkbox"] {
  accent-color: var(--accent);
}
input[type="number"] {
  width: 130px;
}
input[type="search"] {
  width: 350px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 32px;
  letter-spacing: -1px;
  margin-bottom: 10px;
}
h2 {
  font-size: 20px;
  letter-spacing: -0.3px;
}
h3 {
  font-size: 16px;
}
p {
  line-height: 1.6;
}
.muted,
small {
  color: var(--muted);
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
}
.shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  border-right: 1px solid var(--line);
  background: #0e1520;
  padding: 30px 18px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.logo {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 12px;
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.5px;
}
.brandmark {
  font-size: 40px;
  color: var(--accent);
  line-height: 1;
}
.logo small {
  display: block;
  font-size: 10px;
  letter-spacing: 2px;
  margin-top: 4px;
}
nav {
  display: grid;
  gap: 7px;
}
nav button {
  text-align: left;
  background: transparent;
  border-color: transparent;
  color: #9baabd;
}
nav button.active {
  background: #19312f;
  color: var(--accent);
  border-color: #2d514b;
}
.sidefoot {
  margin-top: auto;
  font-size: 12px;
  line-height: 1.8;
  padding: 0 12px;
}
.workspace {
  padding: 35px 42px;
  min-width: 0;
  max-width: 1750px;
  width: 100%;
  margin: auto;
  align-self: start;
}
header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
  margin-bottom: 30px;
}
.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.pill {
  display: inline-block;
  background: #19312e;
  color: #9de2d1;
  padding: 5px 9px;
  border: 1px solid #31524b;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
}
.pill.warn {
  background: #302719;
  color: var(--gold);
  border-color: #5b482b;
}
.pill.danger {
  color: #ffb3b3;
  background: #3b2529;
  border-color: #60404a;
}
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 25px;
}
.card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
}
.card .stat {
  font-size: 30px;
  font-weight: 600;
  margin: 9px 0 5px;
  font-variant-numeric: tabular-nums;
}
.card small {
  font-size: 12px;
}
.panel {
  margin-bottom: 20px;
  overflow: hidden;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}
.panel-head h2 {
  margin-bottom: 5px;
}
.grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.grid2 .panel {
  margin-bottom: 0;
}
.stack {
  display: grid;
  gap: 18px;
}
.row {
  display: flex;
  gap: 15px;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.row:last-child {
  border-bottom: 0;
}
.rule {
  border-left: 2px solid #456458;
  padding-left: 17px;
  margin: 22px 0;
}
.rule p {
  font-size: 13px;
  margin-bottom: 7px;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}
th {
  font-weight: 600;
  color: #91a0b3;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 13px 12px;
  border-bottom: 1px solid #223040;
  vertical-align: top;
  line-height: 1.5;
}
td small {
  display: block;
}
tr:last-child td {
  border: 0;
}
code {
  font-family: ui-monospace, monospace;
  color: #b0cbc8;
  font-size: 0.9em;
  word-break: break-all;
}
details {
  margin: 12px 0;
}
summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 13px;
}
.signal {
  background: #182531;
  border-radius: 8px;
  padding: 14px;
  margin-top: 10px;
  border-left: 2px solid var(--gold);
}
.signal.context {
  border-color: #6c92b4;
}
.signal p {
  margin: 6px 0;
  font-size: 13px;
}
.empty {
  padding: 35px 15px;
  text-align: center;
  color: var(--muted);
}
.banner {
  background: #172a2c;
  border: 1px solid #31504f;
  padding: 16px 20px;
  border-radius: 9px;
  color: #b7d6d3;
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 22px;
}
.banner.warn {
  background: #292418;
  border-color: #53452c;
  color: #e8d4b1;
}
.config-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  align-items: start;
  margin: 8px 0 14px;
}
.field input:not([type="checkbox"]),
.field select {
  width: 100%;
}
.field small {
  line-height: 1.5;
}
.form-row {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}
.config-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
}
.savebar {
  position: sticky;
  bottom: 15px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  background: #1a2a38;
  border: 1px solid #425166;
  border-radius: 10px;
  padding: 15px 20px;
  margin-top: 20px;
  align-items: center;
}
.login {
  max-width: 480px;
  margin: 14vh auto;
  padding: 45px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  text-align: center;
}
.login .brandmark {
  margin-bottom: 30px;
  font-size: 64px;
}
.login h1 {
  font-size: 56px;
}
.login .button {
  margin: 15px 0;
}
.login small {
  display: block;
  margin-top: 25px;
}
.key {
  background: #09221e;
  border: 1px solid #446c61;
  padding: 15px;
  border-radius: 8px;
  overflow-wrap: anywhere;
  margin: 15px 0;
}
#notice {
  position: fixed;
  right: 25px;
  bottom: 25px;
  max-width: 440px;
  background: #223b38;
  border: 1px solid #537a71;
  color: #e7f8ef;
  border-radius: 9px;
  padding: 15px 20px;
  z-index: 20;
  display: none;
}
#notice.error {
  background: #422b31;
  border-color: #825660;
}
pre {
  overflow: auto;
  background: #0b141f;
  padding: 15px;
  border-radius: 7px;
  font-size: 11px;
  max-height: 350px;
}
footer {
  font-size: 11px;
  color: var(--muted);
  margin-top: 28px;
}
.mobile-brand {
  display: none;
}
@media (max-width: 1100px) {
  .workspace {
    padding: 28px;
  }
  .cards,
  .config-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid2 {
    grid-template-columns: 1fr;
  }
  .shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }
}
@media (max-width: 720px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    gap: 18px;
  }
  .sidebar .logo {
    font-size: 21px;
  }
  .sidebar nav {
    display: flex;
    overflow: auto;
    gap: 5px;
  }
  .sidebar nav button {
    white-space: nowrap;
    font-size: 12px;
    padding: 8px 10px;
  }
  .sidefoot {
    display: none;
  }
  .workspace {
    padding: 22px 16px;
  }
  header {
    display: block;
    margin-bottom: 22px;
  }
  .header-actions {
    margin-top: 18px;
  }
  h1 {
    font-size: 27px;
  }
  .cards {
    gap: 9px;
  }
  .card,
  .panel {
    padding: 17px;
  }
  .card .stat {
    font-size: 25px;
  }
  .config-grid {
    grid-template-columns: 1fr;
  }
  .savebar {
    align-items: start;
    flex-direction: column;
  }
  .login {
    margin: 10vh 16px;
    padding: 30px;
  }
  input[type="search"] {
    width: 100%;
  }
  .panel-head {
    flex-wrap: wrap;
  }
  th,
  td {
    padding: 10px 8px;
  }
}
.grid2 {
  margin-bottom: 20px;
}
.config-grid {
  align-items: start;
}
.weapon-floors {
  grid-column: 1/-1;
}
.weapon-floors .config-fields {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
input[readonly] {
  opacity: 0.6;
}
@media (max-width: 720px) {
  .weapon-floors .config-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
