:root {
  /* No web fonts (CSP): Inter when installed, then system faces that carry Arabic glyphs. */
  font-family:
    Inter,
    "Segoe UI",
    Tahoma,
    "Noto Sans Arabic",
    "Noto Naskh Arabic",
    system-ui,
    Arial,
    sans-serif;
  color: #e7e9ec;
  background: #111315;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
a {
  color: #b4c7dc;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
[hidden] {
  display: none !important;
}
.muted {
  color: #9b9fa6;
  line-height: 1.55;
}
.tiny {
  font-size: 12px;
}
.error {
  color: #ff8585;
}
.eyebrow,
.nav-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  font-weight: 750;
  color: #9299a4;
}
.eyebrow {
  margin: 0 0 9px;
}
.panel {
  background: #1c1f22;
  border: 1px solid #34383d;
  border-radius: 10px;
  padding: 22px;
}
.identity {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 19px 16px;
  border-bottom: 1px solid #2a2e32;
}
.identity strong {
  font-size: 14px;
}
.identity small {
  display: block;
  font-size: 10px;
  color: #8f969e;
  letter-spacing: 0.12em;
  margin-top: 3px;
}
.logo {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #bbed68;
  color: #152208;
}
.login {
  max-width: 420px;
  margin: 12vh auto;
  padding: 0 25px 25px;
}
.login .identity {
  margin: 0 -25px 25px;
}
.login h1 {
  font-size: 25px;
  margin: 0;
}
.login form {
  margin-top: 24px;
}
.shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: #17191b;
  border-inline-end: 1px solid #303338;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.sidebar .nav-label {
  margin: 28px 16px 10px;
}
.side-nav {
  display: grid;
  gap: 3px;
  padding: 0 10px;
}
.side-nav button,
.side-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: none;
  color: #a8adb5;
  border: 0;
  text-align: start;
  padding: 10px 12px;
  border-radius: 7px;
  font-size: 13px;
}
.side-nav span {
  width: 18px;
  color: #8a949c;
  font-size: 17px;
}
.side-nav .active,
.side-nav button:hover,
.side-nav a:hover {
  background: #292d31;
  color: #f3f4f5;
  text-decoration: none;
}
.side-nav .active span {
  color: #bbed68;
}
.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid #303338;
  padding: 17px 14px;
  display: flex;
  gap: 8px;
  align-items: center;
  color: #a7abb1;
  font-size: 12px;
}
.sidebar-foot button {
  margin-inline-start: auto;
  padding: 5px 8px;
  background: none;
  color: #cbd0d6;
  border: 1px solid #444b50;
  border-radius: 5px;
}
.status-dot {
  height: 7px;
  width: 7px;
  border-radius: 50%;
  background: #bbed68;
}
.work-area {
  min-width: 0;
}
.topbar {
  height: 61px;
  border-bottom: 1px solid #303338;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 25px;
}
.crumb {
  color: #9299a2;
  font-size: 13px;
}
.crumb span {
  padding: 0 10px;
}
.crumb strong {
  color: #eef0f2;
}
.top-actions {
  display: flex;
  gap: 14px;
  align-items: center;
}
.account {
  border-radius: 50%;
  background: #353c37;
  color: #c8e8a6;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-size: 0;
}
.account:after {
  content: "O";
  font-size: 13px;
}
.badge {
  border: 1px solid #4b5642;
  border-radius: 20px;
  color: #bedcaa;
  padding: 5px 9px;
  font-size: 11px;
}
.work-area main {
  padding: 25px;
  max-width: 1800px;
  margin: auto;
}
.page-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin: 1px 0 22px;
}
.page-head h1 {
  font-size: 25px;
  letter-spacing: -0.03em;
  margin: 0 0 5px;
}
.page-head p:last-child {
  margin: 0;
}
.quiet-link,
.secondary {
  background: #262a2e;
  border: 1px solid #41474c;
  border-radius: 7px;
  color: #e1e4e7;
  padding: 9px 12px;
  white-space: nowrap;
  font-size: 12px;
}
.secondary:hover,
.quiet-link:hover {
  background: #353a3f;
  text-decoration: none;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.stat {
  border: 1px solid #34383d;
  border-radius: 10px;
  background: #1b1e21;
  padding: 19px;
}
.stat small {
  display: block;
  color: #9199a2;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.stat strong {
  display: block;
  color: #bbed68;
  font-size: 30px;
  margin-top: 8px;
}
.overview-grid,
.access-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
  margin-top: 15px;
}
.overview-grid {
  grid-template-columns: 1fr 1fr;
}
.panel h2 {
  font-size: 16px;
  margin: 0 0 12px;
}
.overview-grid .secondary {
  margin-top: 16px;
}
.assistant-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 242px;
  margin: -25px;
  min-height: calc(100vh - 61px);
}
.assistant-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 24px max(22px, calc((100% - 980px) / 2)) 18px;
}
.assistant-main .page-head {
  padding: 0 4px;
}
.messages {
  flex: 1;
  min-height: 250px;
  overflow: auto;
  max-height: calc(100vh - 310px);
  padding: 0 4px 18px;
}
.empty-chat {
  text-align: center;
  color: #989fa7;
  margin: 10vh auto;
}
.empty-chat span {
  font-size: 32px;
  color: #bbed68;
}
.empty-chat h2 {
  color: #e5e7e9;
  margin: 8px;
}
.message {
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.message.user {
  background: #2a2d30;
  border-radius: 15px;
  padding: 11px 16px;
  max-width: 75%;
  width: max-content;
  margin-block: 12px 18px;
  margin-inline: auto 0;
  font-size: 13px;
}
.message.assistant {
  padding: 4px 0 20px;
  font-size: 13px;
  max-width: 960px;
}
.message.assistant p {
  margin: 8px 0;
}
.message.assistant ul {
  margin: 6px 0 12px;
  padding-inline-start: 23px;
}
.message.assistant li {
  margin: 4px 0;
}
.message.error {
  color: #ff9393;
}
.evidence {
  display: grid;
  gap: 7px;
  margin: 4px 0 16px;
}
.evidence details {
  border: 1px solid #3b3e42;
  border-radius: 5px;
  background: #232527;
}
.evidence summary {
  cursor: pointer;
  padding: 8px 11px;
  font-weight: 600;
  list-style-position: inside;
}
.evidence summary span {
  font-weight: 400;
  color: #aab0b7;
  margin-inline-start: 7px;
}
.evidence-detail {
  padding: 0 13px 10px;
  color: #aab0b7;
  font-size: 12px;
}
.evidence-detail a {
  float: inline-end;
}
.source-line {
  color: #9da8b2;
  font-size: 11px;
  border-top: 1px solid #31363a;
  margin-top: 14px;
  padding-top: 9px;
}
.composer {
  border: 1px solid #42464a;
  border-radius: 8px;
  background: #242628;
  padding: 9px;
  margin: 0 4px;
}
.composer textarea {
  min-height: 45px;
  resize: vertical;
  background: none;
  border: 0;
  width: 100%;
  padding: 5px;
  color: #f0f1f2;
  outline: none;
}
.composer-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: #8f969e;
  font-size: 11px;
}
.composer button,
form > button,
.proposal button {
  background: #a9d970;
  color: #18210f;
  border: 0;
  border-radius: 6px;
  padding: 9px 15px;
  font-weight: 700;
}
.chat-sidebar {
  border-inline-start: 1px solid #34383d;
  background: #1a1c1e;
  padding: 22px 12px;
  min-width: 0;
}
.chat-sidebar h2 {
  font-size: 13px;
  margin: 1px 7px 13px;
}
.chat-list {
  display: grid;
  gap: 5px;
}
.chat-list button {
  border: 0;
  text-align: start;
  border-radius: 5px;
  background: none;
  color: #b9bec5;
  padding: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-list button.active,
.chat-list button:hover {
  background: #313539;
  color: #fff;
}
.chat-sidebar .tiny {
  margin: 18px 8px;
}
form:not(.composer):not(.toolbar):not(.search-row) {
  display: grid;
  gap: 14px;
}
label {
  display: grid;
  gap: 7px;
  color: #c2c8ce;
  font-size: 12px;
}
input,
select {
  width: 100%;
  background: #131619;
  border: 1px solid #44494d;
  border-radius: 6px;
  color: #edf0f3;
  padding: 10px;
}
.action-panel {
  max-width: 700px;
}
.proposal {
  border: 1px solid #79643c;
  background: #30291d;
  padding: 15px;
  border-radius: 7px;
  margin-top: 18px;
}
.proposal p {
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.warning-badge {
  display: inline-block;
  color: #f2bf78;
  background: #3a2c19;
  border-radius: 14px;
  padding: 5px 9px;
  font-size: 11px;
  margin-bottom: 14px;
}
.discord-ready-badge {
  color: #c7ed67;
  background: #25331f;
}
.access-steps {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}
.access-steps > div {
  display: flex;
  gap: 12px;
  align-items: center;
  color: #d8dcdf;
  font-size: 13px;
}
.access-steps strong {
  background: #333a29;
  color: #c6e59c;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 1050px) {
  .assistant-view {
    grid-template-columns: minmax(0, 1fr) 190px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 750px) {
  .work-area main {
    padding: 17px;
  }
  .assistant-view {
    margin: -17px;
    display: block;
  }
  .assistant-main {
    padding: 20px 16px;
  }
  .chat-sidebar {
    border-inline-start: 0;
    border-top: 1px solid #34383d;
  }
  .chat-list {
    display: flex;
    overflow: auto;
  }
  .chat-list button {
    min-width: 120px;
  }
  .stats,
  .overview-grid,
  .access-grid {
    grid-template-columns: 1fr;
  }
  .topbar {
    padding: 0 16px;
  }
  .messages {
    max-height: none;
    min-height: 350px;
  }
}
/* Staff workspace: simple solid surfaces, bounded tables and canvas charts. */
body {
  background: #0b0e11;
  color: #dfe7ed;
}
.sidebar {
  background: #0e1216;
  border-color: #20272e;
}
.topbar {
  background: #0d1115;
  border-color: #20272e;
}
.panel,
.stat {
  background: #10151a;
  border: 1px solid #242c33;
  box-shadow: none;
}
.side-nav button.active {
  background: #1c242b;
  color: #c6f26a;
}
.logo {
  background: #c4f04b;
  color: #102014;
  border-radius: 50%;
}
.work-area main {
  max-width: 1900px;
  margin: auto;
}
.stats {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.stat {
  padding: 17px;
}
.stat strong {
  font-size: 26px;
  color: #bcec52;
}
.stat small {
  font-size: 10px;
}
.page-head h1 {
  font-size: 25px;
}
.page-head h1 .warning-badge {
  vertical-align: middle;
  margin: 0;
  margin-inline-start: 8px;
  font-size: 11px;
}
.top-actions select {
  width: 180px;
  padding: 6px 10px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.6fr) minmax(250px, 1fr);
  gap: 16px;
  margin-top: 18px;
}
.panel-head,
.toolbar,
.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-head {
  margin-bottom: 16px;
}
.panel-head h2 {
  margin: 0;
}
.panel-head select,
.toolbar select,
.page-head > select {
  width: auto;
  padding: 7px 10px;
  font-size: 12px;
}
.panel-head button {
  font-size: 11px;
  padding: 6px 9px;
}
.chart-panel canvas {
  display: block;
  width: 100%;
  height: 265px;
}
.server-card {
  padding: 14px 0;
  border-bottom: 1px solid #20272e;
}
.server-card:last-child {
  border: 0;
}
.server-card .panel-head {
  margin: 0;
}
.online {
  color: #bcec52;
}
.offline,
.log-error {
  color: #f47a79;
}
.log-warning {
  color: #edb052;
}
.incident-summary {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.incident-summary strong {
  font-size: 18px;
  color: #bcec52;
}
.log-lines {
  font:
    11px/1.65 Consolas,
    monospace;
  overflow: auto;
  max-height: 250px;
}
.log-row {
  display: grid;
  grid-template-columns: 145px 110px minmax(350px, 1fr);
  gap: 10px;
  border-bottom: 1px solid #182027;
  padding: 3px 0;
}
.log-row time {
  color: #788794;
}
.log-source {
  color: #81abc9;
  overflow: hidden;
  text-overflow: ellipsis;
}
.full-log {
  max-height: 65vh;
  min-height: 300px;
}
.map-toolbar {
  margin-bottom: 13px;
  justify-content: flex-start;
}
.segmented {
  display: flex;
  background: #10151a;
  border: 1px solid #29323b;
  border-radius: 7px;
  padding: 3px;
  flex-shrink: 0;
}
.segmented button {
  background: none;
  border: 0;
  color: #8192a0;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 4px;
}
.segmented button.active {
  background: #26313a;
  color: #fff;
}
.map-frame {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #273643;
  height: calc(100vh - 260px);
  min-height: 420px;
  max-height: 850px;
  background: #0c2b4a;
}
.map-frame canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}
.map-frame canvas:active {
  cursor: grabbing;
}
.map-notice {
  position: absolute;
  top: 14px;
  left: 14px;
  pointer-events: none;
  padding: 9px 12px;
  background: #101820e8;
  color: #c1d2df;
  border-radius: 6px;
  font-size: 12px;
}
.map-legend {
  position: absolute;
  bottom: 14px;
  left: 14px;
  pointer-events: none;
  padding: 13px;
  background: #0c141ce8;
  border: 1px solid #29343d;
  border-radius: 9px;
  width: 225px;
  font-size: 11px;
}
.map-legend > div:not(.gradient) {
  display: flex;
  justify-content: space-between;
  color: #a4b2be;
  font-size: 10px;
}
.map-legend p {
  color: #8d9ba7;
  font-size: 10px;
  margin-bottom: 0;
  line-height: 1.6;
}
.gradient {
  height: 7px;
  border-radius: 5px;
  margin: 9px 0 4px;
  background: linear-gradient(90deg, #2256d8, #30bbb2, #edf15c);
}
.map-controls {
  position: absolute;
  right: 15px;
  bottom: 15px;
  display: grid;
  gap: 3px;
}
.map-controls button {
  background: #101820;
  color: #d8e6ed;
  border: 1px solid #32424f;
  border-radius: 4px;
  padding: 7px 10px;
}
.map-controls button:nth-child(-n + 2) {
  font-size: 20px;
  font-weight: 700;
}
.map-detail {
  margin-top: 15px;
}
.search-row {
  display: flex !important;
  gap: 10px !important;
  align-items: center;
  margin-bottom: 18px;
}
.search-row input {
  max-width: 500px;
}
.search-row select {
  width: auto;
}
.search-row button {
  padding: 10px 16px;
}
.table-scroll {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
th {
  text-align: start;
  color: #7c8c99;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.05em;
  padding: 12px 10px;
  border-bottom: 1px solid #283139;
  white-space: nowrap;
}
td {
  padding: 13px 10px;
  border-bottom: 1px solid #20272e;
  vertical-align: top;
}
td:first-child {
  min-width: 220px;
}
td small {
  display: block;
  margin-top: 5px;
  font-size: 11px;
}
td strong {
  display: block;
  max-width: 850px;
  overflow-wrap: anywhere;
  font-weight: 500;
}
td button {
  white-space: nowrap;
}
.resource-panel {
  margin-top: 18px;
}
#resources-term {
  max-width: 400px;
}
.tiny {
  font-size: 11px;
}
.secondary {
  background: #161d23;
  border-color: #313c45;
}
button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 2px solid #bcec52;
  outline-offset: 3px;
}
@media (max-width: 1200px) {
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .dashboard-grid {
    grid-template-columns: minmax(0, 1.8fr) minmax(230px, 1fr);
  }
}
@media (max-width: 850px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .map-toolbar {
    flex-wrap: wrap;
  }
  .map-frame {
    height: 65vh;
    min-height: 380px;
  }
  .top-actions select {
    width: 140px;
  }
  .map-notice {
    max-width: 80%;
  }
  .map-legend {
    width: 190px;
    padding: 10px;
  }
  .search-row {
    flex-wrap: wrap;
  }
  .log-row {
    grid-template-columns: 140px 90px minmax(300px, 1fr);
  }
}
#performance-chart { display:block;width:100%;height:280px;margin-bottom:12px;cursor:crosshair; }
#errors-chart {
  display: block;
  width: 100%;
  height: 110px;
  margin-bottom: 16px;
}
.map-notice {
  border: 1px solid #cf9d4a;
  color: #f4ce8d;
  font-weight: 600;
}
@media (max-width: 600px) {
  .page-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .topbar {
    height: auto;
    min-height: 61px;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .top-actions {
    margin-inline-start: auto;
  }
  .map-frame {
    min-height: 380px;
  }
  .map-notice {
    right: 14px;
    max-width: none;
    font-size: 11px;
  }
  .stats .stat {
    padding: 13px;
  }
  .stat strong {
    font-size: 23px;
  }
  .segmented button {
    padding: 8px;
    font-size: 11px;
  }
}
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}
#server-registration {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}
#server-registration label {
  display: grid;
  gap: 7px;
}
#registration-details {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 9px;
}
#registration-details dt {
  color: #83909c;
}
#registration-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.server-path {
  overflow-wrap: anywhere;
}
.issue-spark {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  width: 72px;
  height: 28px;
}
.issue-spark span {
  flex: 1;
  background: #dd716e;
  min-width: 2px;
}
.issue-spark .level-0 {
  height: 2px;
  opacity: 0.2;
}
.issue-spark .level-1 {
  height: 10%;
}
.issue-spark .level-2 {
  height: 20%;
}
.issue-spark .level-3 {
  height: 30%;
}
.issue-spark .level-4 {
  height: 40%;
}
.issue-spark .level-5 {
  height: 50%;
}
.issue-spark .level-6 {
  height: 60%;
}
.issue-spark .level-7 {
  height: 70%;
}
.issue-spark .level-8 {
  height: 80%;
}
.issue-spark .level-9 {
  height: 90%;
}
.issue-spark .level-10 {
  height: 100%;
}
.issue-samples {
  max-height: 140px;
  overflow: auto;
}
.calibration-landmarks {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}
.calibration-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid #283039;
  border-radius: 8px;
  padding: 8px;
}
.calibration-row legend {
  color: #c7d1d8;
}
.calibration-row input[type="number"] {
  width: 125px;
}
.server-policy {
  display: grid;
  gap: 7px;
  border-top: 1px solid #26313a;
  padding-top: 12px;
  margin-top: 12px;
}
.server-policy label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.server-policy input[type="number"],
.server-policy input[type="time"],
.server-policy select {
  width: 160px;
}

@media (max-width: 900px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

.console-command-form { margin-top: 16px; padding: 16px; }
.console-command-row { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.console-command-row input { flex: 1; min-width: 0; font-family: ui-monospace, monospace; }
#console-command-exact { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 650px) { .console-command-row { flex-wrap: wrap; } .console-command-row input { width: 80%; } }

#console-lines { max-height: calc(100vh - 410px); min-height: 200px; }

#map-live-canvas { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; z-index:2; }
.map-notice, .map-controls, .map-legend { z-index:3; }

.map-legend { top: 14px; bottom: auto; }

#server-lifecycle-review { width: min(420px, calc(100vw - 32px)); margin: auto; padding: 24px; color: var(--text, #e5edf2); background: #10171c; max-height: 85vh; }
#server-lifecycle-review:not([open]) { display: none; }
#server-lifecycle-review .toolbar { justify-content: flex-end; gap: 10px; }
#server-lifecycle-expiry, #server-lifecycle-status:empty { display: none; }
#server-lifecycle-review::backdrop { background: rgba(0, 0, 0, .65); }

.server-controls { justify-content: flex-start; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.server-controls > button, .server-controls > a,
#server-lifecycle-review button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid #34414b;
  border-radius: 8px;
  background: #182128;
  color: #e4ebef;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 120ms, border-color 120ms;
}
.server-controls .lifecycle-button { min-width: 88px; }
.server-controls > :hover:not(:disabled), #server-lifecycle-review button:hover:not(:disabled) { background: #24313a; border-color: #52616b; }
.server-controls .lifecycle-start { background: #b8eb48; border-color: #b8eb48; color: #172007; }
.server-controls .lifecycle-start:hover:not(:disabled) { background: #caf477; border-color: #caf477; }
.server-controls .lifecycle-stop, #server-lifecycle-review .lifecycle-stop { background: #352126; border-color: #70414a; color: #ffb8be; }
.server-controls .lifecycle-stop:hover:not(:disabled), #server-lifecycle-review .lifecycle-stop:hover:not(:disabled) { background: #482a30; border-color: #a75b68; }
.server-controls .lifecycle-restart, #server-lifecycle-review .lifecycle-restart { background: #303522; border-color: #58633b; color: #d6ec9b; }
.server-controls button:disabled { background: #131a1f; border-color: #263039; color: #6e7b83; opacity: .65; }
#server-lifecycle-review { padding: 26px; border-radius: 14px; box-shadow: 0 20px 65px #0007; }
#server-lifecycle-review h2 { margin: 0 0 12px; font-size: 18px; }
#server-lifecycle-effect { margin: 0; color: #aebbc4; font-size: 14px; line-height: 1.6; }
#server-lifecycle-review .toolbar { margin-top: 24px; gap: 10px; }
#server-lifecycle-review button { min-width: 104px; min-height: 40px; }
#server-lifecycle-status { margin: 16px 0 0; font-size: 13px; }

button:where(:not(.side-nav button):not(.chat-list button):not(.segmented button):not(.map-controls button)) {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 38px; padding: 0 16px; border: 1px solid #34414b;
  border-radius: 8px; background: #182128; color: #e4ebef;
  font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1.2; gap: 8px;
}
button:not(.side-nav button):focus-visible { outline: 2px solid #b8eb48; outline-offset: 3px; }
button:not(.side-nav button):not(:disabled):hover { border-color: #63727b; }
form > button:not(.secondary), #console-command-run { background: #b8eb48; border-color: #b8eb48; color: #172007; }
button:disabled { opacity: .5; }
.console-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.console-tools > input { flex: 1; min-width: 180px; }
.console-tools label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
#console-lines { overflow-anchor: none; }

#player-live-list { display:grid; gap:8px; margin-top:16px; max-height:65vh; overflow:auto; }
.player-list-item { justify-content:flex-start !important; }
.player-record { padding:12px 0; border-bottom:1px solid #2b353d; }
.player-details { white-space:pre-wrap; overflow-wrap:anywhere; }

#player-known-list { display:grid; gap:8px; margin:12px 0; max-height:40vh; overflow:auto; }
dialog.panel { width:min(480px,calc(100vw - 32px)); margin:auto; padding:24px; color:#e4ebef; border-radius:14px; max-height:85vh; overflow:auto; }
dialog.panel:not([open]) { display:none; }
dialog.panel::backdrop { background:#0009; }
dialog.panel .toolbar { justify-content:flex-end; margin-top:24px; gap:10px; }
#moderation-effect { overflow-wrap:anywhere; line-height:1.6; }
#moderation-ban-form { display:grid; gap:12px; margin:16px 0; }
#moderation-ban-form[hidden] { display:none; }
#cfg-fields { display:grid; gap:12px; margin:16px 0; }
#cfg-backups { display:flex; gap:8px; flex-wrap:wrap; margin-top:16px; }
#staff-capabilities { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:16px 0; }
#staff-capabilities label { display:flex; align-items:center; gap:8px; }
#staff-policy-panel { margin-top:20px; }

/* Keep the console and its command bar within the available viewport. */
#view-console:not([hidden]) { display: flex; flex-direction: column; height: calc(100dvh - 112px); min-height: 420px; gap: 8px; }
#view-console > .page-head { margin-bottom: 4px; flex-shrink: 0; }
#view-console > .console-tools { margin-bottom: 0; flex-shrink: 0; }
#view-console #console-lines { flex: 1 1 0; min-height: 100px; max-height: none; margin: 0; }
#view-console #console-status { margin: 0; }
#view-console .console-command-form { margin: 0; padding: 10px 14px; flex-shrink: 0; }
#view-console .console-command-row { margin-top: 4px; }
#view-console .console-command-form p { margin: 5px 0 0; }
#view-console .console-command-form p:empty { display: none; }
#view-console > details { flex-shrink: 0; padding: 10px 14px; margin: 0; }
#view-console > details[open] { max-height: 25vh; overflow: auto; }
@media (max-width: 650px) { #view-console:not([hidden]) { height: calc(100dvh - 100px); } }
.resource-folder{font:11px/1.5 Consolas,monospace;color:#9aabba;max-width:430px;overflow-wrap:anywhere}.resource-actions{white-space:nowrap}.resource-actions button+button{margin-inline-start:6px}.resource-control-note{display:block;margin-top:8px;color:#94a3ad;font-size:11px}.resource-action-panel{width:min(560px,calc(100vw - 32px));margin:auto;max-width:560px}.resource-action-panel .panel-head{gap:18px}.resource-action-panel #resource-action-target{overflow-wrap:anywhere}.resource-action-panel form{display:flex;align-items:end;gap:10px;flex-wrap:wrap}.resource-action-panel form label{flex:1 1 300px}.resource-action-panel form button{white-space:nowrap}.resource-action-panel .proposal{margin-top:15px}
@media(max-width:750px){.resource-actions{white-space:normal}.resource-actions button{margin:3px!important}.resource-folder{max-width:220px}}

#registration-review { width: min(600px, calc(100vw - 32px)); max-height: 85dvh; overflow: auto; margin: auto; padding: 24px; border-radius: 14px; color: #e5edf2; background: #10171c; box-shadow: 0 20px 65px #0007; }
#registration-review:not([open]) { display: none; }
#registration-review::backdrop { background: #000a; }
#registration-review h2 { margin: 0 0 12px; }
#registration-review dl { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px 16px; }
#registration-review dt { color: #91a3b2; }
#registration-review dd { margin: 0; overflow-wrap: anywhere; }
#registration-review .toolbar { justify-content: flex-end; gap: 10px; margin-top: 24px; }
#registration-review button { min-height: 40px; min-width: 104px; }
#registration-review #registration-save { background: #b8eb48; border-color: #b8eb48; color: #172007; }

/* Registered server cards keep fleet controls compact and settings optional. */
#view-servers > .settings-grid { grid-template-columns: minmax(280px, .75fr) minmax(0, 1.5fr); align-items: start; }
#registered-servers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 14px; margin-top: 20px; align-items: start; }
#registered-servers .registered-server-card { margin: 0; padding: 18px; border: 1px solid #2a363e; border-radius: 12px; background: #0c1217; min-width: 0; }
.registered-server-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.registered-server-header strong { font-size: 16px; }
.server-state { font-size: 11px; padding: 5px 9px; border-radius: 20px; background: #26313a; color: #b1bfca; text-transform: capitalize; }
.server-state.state-running { background: #20311e; color: #b8eb48; }
.server-state.state-failed { background: #392126; color: #ffb8be; }
#registered-servers .server-path { overflow-wrap: anywhere; margin: 10px 0; line-height: 1.5; }
#registered-servers .server-controls { justify-content: flex-start; gap: 8px; margin: 10px 0; }
#registered-servers .server-controls button, #registered-servers .server-controls a { min-width: 0; padding: 9px 12px; }
#registered-servers .server-policy { margin-top: 16px; padding-top: 14px; border-top: 1px solid #26323a; }
#registered-servers .server-policy summary { cursor: pointer; font-weight: 600; font-size: 13px; padding: 2px 0; }
#registered-servers .policy-field { display: grid; grid-template-columns: minmax(0, 1fr) minmax(110px, .8fr); align-items: center; gap: 12px; margin: 12px 0; font-size: 12px; }
#registered-servers .policy-field input:not([type=checkbox]), #registered-servers .policy-field select { width: 100%; min-width: 0; margin: 0; }
#registered-servers .policy-switch { grid-template-columns: minmax(0, 1fr) 40px; }
#registered-servers input[type=checkbox] { appearance: none; width: 38px; height: 22px; border-radius: 20px; border: 1px solid #46535d; background: #26313a; cursor: pointer; margin: 0; padding: 0; position: relative; }
#registered-servers input[type=checkbox]::after { content: ''; position: absolute; width: 14px; height: 14px; top: 3px; left: 3px; background: #c1cbd2; border-radius: 50%; transition: transform 120ms ease; }
#registered-servers input[type=checkbox]:checked { background: #a9db3e; border-color: #a9db3e; }
#registered-servers input[type=checkbox]:checked::after { transform: translateX(16px); background: #152008; }
#registered-servers input[type=checkbox]:focus-visible { outline: 2px solid #b8eb48; outline-offset: 3px; }
#registered-servers input[type=checkbox]:disabled { opacity: .4; cursor: not-allowed; }
@media (max-width: 1000px) { #view-servers > .settings-grid { grid-template-columns: 1fr; } }
#registered-servers .server-policy { display: block; }

#cfg-panel { margin-top: 24px; padding: 20px; border: 1px solid #29363e; border-radius: 12px; background: #0c1217; }
#cfg-panel h2 { margin: 0 0 12px; font-size: 15px; }
#cfg-panel > p { margin: 0 0 18px; line-height: 1.6; max-width: 70ch; }
#cfg-panel #cfg-status:empty { display: none; }
#cfg-panel #cfg-status:not(:empty) { margin-top: 14px; }
#cfg-panel #cfg-form { margin-top: 18px; }
#cfg-panel #cfg-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 16px; margin-bottom: 18px; }
#cfg-panel #cfg-fields label { display: grid; gap: 8px; }
#cfg-panel #cfg-backups:not(:empty) { margin-top: 20px; padding-top: 16px; border-top: 1px solid #29363e; }

#registration-issues { display: grid; gap: 8px; list-style: none; padding: 0; margin: 20px 0 0; }
#registration-issues:empty { display: none; }
#registration-issues .registration-notice { position: relative; padding-block: 12px; padding-inline: 40px 14px; border: 1px solid #544629; border-radius: 9px; background: #292318; color: #ead9ae; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
#registration-issues .registration-notice::before { content: '⚠'; position: absolute; top: 12px; inset-inline-start: 14px; color: #efc46a; font-size: 15px; line-height: 1.3; }
#registration-issues .registration-setup { background: #15242d; border-color: #2d485a; color: #b8d4e4; }
#registration-issues .registration-setup::before { content: 'ⓘ'; color: #80badc; }

.server-picker { position: relative; min-width: 180px; }
.topbar .server-picker-trigger { position: relative; display: flex; justify-content: flex-start; align-items: center; width: 100%; height: 38px; padding-block: 0; padding-inline: 13px 36px; background: #10151a; border: 1px solid #303a43; border-radius: 7px; color: #e5edf2; font-size: 13px; font-weight: 500; text-align: start; }
.topbar .server-picker-trigger:hover, .topbar .server-picker-trigger[aria-expanded=true] { border-color: #657348; background: #161d22; }
.server-picker-trigger::after { content: ''; position: absolute; inset-inline-end: 14px; top: 14px; width: 6px; height: 6px; border-right: 1.5px solid #96a3ad; border-bottom: 1.5px solid #96a3ad; transform: rotate(45deg); pointer-events: none; }
.server-picker-menu { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; width: 240px; max-width: 85vw; max-height: 320px; overflow: auto; padding: 5px; background: #11171c; border: 1px solid #303a43; border-radius: 8px; box-shadow: 0 8px 24px #0005; z-index: 60; }
.server-picker-menu[hidden] { display: none; }
.topbar .server-picker-menu button { position: relative; display: flex; justify-content: flex-start; align-items: center; width: 100%; min-height: 38px; border: 0; border-radius: 5px; background: transparent; color: #b9c4cc; text-align: start; margin: 0; padding-block: 9px; padding-inline: 12px 32px; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.topbar .server-picker-menu button:hover, .topbar .server-picker-menu button:focus-visible { background: #202930; color: #edf2f5; }
.topbar .server-picker-menu button[aria-selected=true] { color: #d0ee9b; background: #1d2822; }
.server-picker-menu button[aria-selected=true]::after { content: ''; position: absolute; inset-inline-end: 14px; width: 5px; height: 9px; border-right: 1.5px solid #bcec52; border-bottom: 1.5px solid #bcec52; transform: rotate(45deg); }
.selected-server-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 110px), 1fr)); gap: 10px; margin: 18px 0; }
.selected-server-metrics > div { border: 1px solid #29373f; border-radius: 9px; padding: 12px; background: #0c1419; }
.selected-server-metrics small { display: block; color: #92a4b1; font-size: 11px; margin-bottom: 8px; }
.selected-server-metrics strong { display: block; font-size: 18px; overflow-wrap: normal; }
@media (max-width: 600px) { .server-picker { min-width: 130px; } .selected-server-metrics { grid-template-columns: 1fr; } }

/* Readable terminal surface, with a command bar attached below the scroll area. */
#view-console > .page-head { order: 0; }
#view-console > .console-tools { order: 1; gap: 8px; }
#view-console #console-lines { order: 2; background: #090f14; padding: 12px 14px; border-color: #2b3943; border-radius: 12px 12px 0 0; font: 12px/1.75 Consolas, 'Cascadia Code', monospace; }
#view-console #console-lines .log-row { grid-template-columns: 155px 112px minmax(0, 1fr); padding: 5px 8px; gap: 14px; border-bottom: 1px solid #17212a; color: #cbd6df; border-left: 2px solid transparent; }
#view-console #console-lines .log-row > span:last-child { white-space: pre-wrap; overflow-wrap: anywhere; font-weight: 400; }
#view-console #console-lines .log-row:hover { background: #131d25; }
#view-console #console-lines .log-row time { font-size: 10px; color: #748894; font-style: normal; }
#view-console #console-lines .log-source { font-size: 11px; color: #91a8b8; }
#view-console #console-lines .log-error { color: #f2a2a8; background: #2b171c; border-left-color: #e2737f; }
#view-console #console-lines .log-warning { color: #e8ce8d; background: #252116; border-left-color: #d4aa55; }
#view-console #console-lines .log-success { color: #b4d7b1; border-left-color: #6d9b6a; }
#view-console .console-command-form { order: 3; margin-top: -8px; border-color: #2b3943; border-top: 1px solid #34464f; border-radius: 0 0 12px 12px; padding: 9px 12px; background: #111b22; }
#view-console .console-command-form:focus-within { border-color: #8aae45; }
#view-console .console-command-row { margin: 0; gap: 10px; }
#view-console .console-command-row > span { color: #b8eb48; font: 18px Consolas, monospace; padding-left: 4px; }
#view-console #console-command-input { margin: 0; background: transparent; border: 0; box-shadow: none; outline: none; min-height: 40px; font-size: 13px; padding: 8px 4px; }
#view-console #console-command-run { min-height: 36px; padding: 8px 14px; font-size: 12px; border-radius: 7px; background: #243322; color: #d3eda6; border-color: #405334; }
#view-console #console-command-run:hover:not(:disabled) { background: #34492b; }
#view-console .console-command-form p { font-size: 11px; line-height: 1.5; color: #92a5b2; margin: 6px 4px 0; }
#view-console #console-status { order: 4; padding: 2px 4px; color: #8296a5; }
#view-console > details { order: 6; }
#view-console .console-tools input[type=search] { min-height: 38px; border-radius: 8px; font-size: 12px; }
#view-console .console-tools button { min-height: 36px; padding: 8px 12px; font-size: 11px; }
#view-console .console-tools input[type=checkbox] { accent-color: #b8eb48; width: 14px; height: 14px; }
@media (max-width: 800px) { #view-console #console-lines .log-row { grid-template-columns: 112px minmax(0, 1fr); gap: 8px; } #view-console #console-lines .log-source { display: none; } }

/* Shared form rhythm across staff pages. */
.work-area main form > button { justify-self: start; width: auto; min-width: 112px; }
.work-area main form.toolbar { display: flex; flex-wrap: wrap; align-items: end; justify-content: flex-start; gap: 12px; }
.work-area main form.toolbar > label { flex: 0 1 220px; min-width: 170px; margin: 0; gap: 7px; }
.work-area main form.toolbar > button { flex: 0 0 auto; min-height: 40px; margin: 0; }
.work-area main label { line-height: 1.5; }
.work-area main input:not([type=checkbox]):not([type=radio]), .work-area main select, .work-area main textarea { min-height: 40px; border-color: #34444f; border-radius: 8px; font: inherit; font-size: 12px; }
.work-area main textarea { padding: 10px 12px; resize: vertical; background: #111a20; color: #dfe8ee; }
.work-area main input[type=checkbox], .work-area main input[type=radio] { width: 16px; height: 16px; margin: 0; accent-color: #b8eb48; flex-shrink: 0; }
.work-area main .toolbar { flex-wrap: wrap; justify-content: flex-start; gap: 10px; }
.work-area main details.panel > summary { font-size: 13px; font-weight: 600; line-height: 1.5; cursor: pointer; color: #c8d5de; padding: 2px 0; }
.work-area main details.panel[open] > summary { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid #28363f; }
.work-area main .panel > h2:first-child { margin-top: 0; }
.work-area main [role=status]:empty { display: none; }
#view-console > details { padding: 12px 16px; }
#view-console > details[open] { max-height: none; overflow: visible; }
#console-archive-filter { margin: 0; padding: 0; }
#console-archive-filter > label { flex-basis: 210px; }
#console-archive-filter > button { background: #253322; color: #d1eba9; border: 1px solid #405334; padding: 0 16px; min-width: 120px; }
#console-archive-status { margin: 12px 0 0; font-size: 12px; }
#console-archive-lines:empty { display: none; }
#console-archive-lines:not(:empty) { max-height: 160px; overflow: auto; margin-top: 14px; padding: 10px; border: 1px solid #27343c; border-radius: 8px; background: #090f14; }
#console-archive-next:not([hidden]) { margin-top: 10px; }
#view-console .console-command-row input { min-height: 40px; }
#view-servers #registration-preview { justify-self: stretch; width: 100%; }
@media (max-width: 600px) { .work-area main form.toolbar > label { flex: 1 1 100%; } .work-area main form.toolbar > button { width: 100%; } }
/* Keep navigation overflow separate from the workspace. */
@media (min-width: 761px) {
  .sidebar { position: sticky; top: 0; height: 100dvh; min-height: 0; overflow-y: auto; }
  .sidebar > * { flex-shrink: 0; }
}


#console-preview { overflow-anchor: none; }
.console-preview-foot { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:28px; margin-top:8px; }
.console-preview-foot button { min-height:28px; padding:4px 9px; font-size:11px; }
#console-preview:focus-visible, #console-lines:focus-visible { outline:1px solid #8aae45; outline-offset:2px; }


/* Player directory and profile workspace */
#view-players .players-page-head { align-items: center; margin-bottom: 8px; }
.players-page-status { min-height: 18px; margin: 0 0 18px; }
.players-layout { display: grid; grid-template-columns: 310px minmax(0,1fr); gap: 20px; align-items: start; }
.players-directory { padding: 20px 14px; position: sticky; top: 20px; }
.player-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#view-players .player-section-heading h2 { font-size: 14px; margin: 0; }
.player-section-heading h3 { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 12px; font-weight: 650; color: #c4cfd5; }
.player-directory-label { font-size: 9px; font-weight: 650; color: #687d89; letter-spacing: .1em; white-space: nowrap; }
.player-search-field { position: relative; margin: 18px 0 22px; }
.player-search-field svg { position: absolute; inset-inline-start: 12px; top: 14px; color: #79909d; pointer-events: none; }
#view-players #player-search { width: 100%; min-height: 44px; padding-inline-start: 36px; background: #0b1217; border-color: #2c3b45; font-size: 12px; }
.player-online-dot { width: 6px; height: 6px; border-radius: 50%; background: #b8eb48; }
.player-count { min-width: 24px; padding: 3px 7px; border: 1px solid #2a3941; border-radius: 6px; background: #182229; color: #a6bac6; font: 11px/1.3 Consolas, monospace; text-align: center; }
#view-players #player-live-list, #view-players #player-known-list { gap: 5px; margin: 10px 0 0; max-height: 38vh; overflow: auto; }
.player-known-group { border-top: 1px solid #24323b; margin-top: 22px; padding-top: 20px; }
.player-directory-hint { margin: 5px 0 10px; font-size: 11px; color: #788a97; }
#view-players .player-list-item { width: 100%; min-height: 64px; padding: 10px; gap: 10px; border: 1px solid transparent; background: transparent; text-align: start; border-radius: 9px; }
#view-players .player-list-item:hover { background: #17232b; border-color: #2c414e; }
#view-players .player-list-item[aria-pressed="true"] { background: #1d2a20; border-color: #526936; }
.player-avatar { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: #22323c; border: 1px solid #344954; color: #c1d6e1; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.player-avatar.large { width: 58px; height: 58px; border-radius: 16px; background: #253520; border-color: #4b6332; color: #c7ef88; font-size: 21px; }
.player-list-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 5px; }
.player-list-name { color: #e3eaee; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-list-meta { color: #899ba7; font-size: 10px; font-weight: 400; line-height: 1.4; }
.player-state { display: inline-flex; flex-shrink: 0; align-items: center; gap: 5px; padding: 5px 8px; border: 1px solid #30424d; border-radius: 7px; color: #8fa6b5; background: #142028; font-size: 10px; font-weight: 600; white-space: nowrap; }
.player-state.is-online { color: #c3e99b; border-color: #3b512d; background: #1d2a1c; }
.player-state.is-online::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #b8eb48; }
.player-state.is-observed { color: #9aadba; }
.player-list-item .player-state { padding: 3px 6px; font-size: 9px; }
.player-empty { border: 1px dashed #2a3a44; border-radius: 9px; padding: 18px 14px; color: #869ca9; font-size: 12px; line-height: 1.6; margin: 8px 0; }
#player-known-more { width: 100%; margin-top: 10px; }
.players-detail { min-width: 0; }
.player-selection-empty { display: flex; min-height: 460px; align-items: center; justify-content: center; flex-direction: column; text-align: center; padding: 40px; }
#view-players .player-selection-empty h2 { margin: 22px 0 8px; font-size: 20px; }
.player-selection-empty p { max-width: 330px; margin: 0; font-size: 13px; }
.player-detail-card { padding: 0; overflow: hidden; }
#player-profile { padding: 26px; background: #10191f; }
.player-profile-head { display: flex; align-items: center; gap: 16px; }
.player-profile-copy { flex: 1; min-width: 0; }
#view-players .player-profile-copy h2 { font-size: 22px; margin: 0 0 7px; line-height: 1.2; overflow-wrap: anywhere; }
.player-profile-copy p { margin: 0; font-size: 12px; color: #8b9faa; }
.player-profile-facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 24px; }
.player-fact { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; background: #0c1318; border: 1px solid #26363f; border-radius: 9px; min-width: 0; }
.player-fact small { color: #8298a5; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.player-fact strong { color: #dbe5ea; font-size: 14px; font-weight: 550; overflow-wrap: anywhere; }
.player-tabs { display: flex; gap: 22px; padding: 0 26px; border-top: 1px solid #24333c; border-bottom: 1px solid #24333c; overflow-x: auto; }
#view-players .player-tabs button { background: transparent; border: none; border-bottom: 2px solid transparent; border-radius: 0; min-height: 48px; padding: 0 1px; flex-shrink: 0; color: #8fa4b1; font-size: 12px; }
#view-players .player-tabs button[aria-selected="true"] { border-bottom-color: #b8eb48; color: #d5edb6; }
#view-players .player-tabs button:hover { color: #e2ecf1; }
.player-tab-panel { padding: 24px 26px; min-height: 250px; }
#view-players .player-section-intro h2 { font-size: 15px; margin: 0 0 6px; }
.player-section-intro p { margin: 0 0 22px; color: #8296a4; }
.player-timeline { margin-top: 16px; }
#view-players .player-disclosure {
  margin: 12px 0 0;
  border: 1px solid #2a3b46;
  border-radius: 10px;
  background: #0c151b;
  overflow: hidden;
}
#view-players .player-timeline + .player-disclosure { margin-top: 24px; }
#view-players .player-disclosure > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #111c23;
  color: #cfdee7;
  cursor: pointer;
  list-style: none;
}
#view-players .player-disclosure > summary::-webkit-details-marker { display: none; }
#view-players .player-disclosure > summary::marker { content: ''; }
#view-players .player-disclosure > summary:hover { background: #18262f; }
#view-players .player-disclosure > summary:focus-visible { outline: 2px solid #b8eb48; outline-offset: -3px; }
.player-disclosure-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; line-height: 1.5; }
.player-disclosure-icon { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex-shrink: 0; border: 1px solid #30444e; border-radius: 8px; background: #182930; color: #9db9ba; }
.player-disclosure-chevron { flex-shrink: 0; color: #8fa6b4; transition: transform 150ms ease; }
#view-players .player-disclosure[open] { border-color: #46604c; }
#view-players .player-disclosure[open] > summary { color: #e0edda; border-bottom: 1px solid #2a3b46; }
.player-disclosure[open] .player-disclosure-icon { color: #b8eb48; border-color: #465c32; background: #24331f; }
.player-disclosure[open] .player-disclosure-chevron { transform: rotate(90deg); color: #b8eb48; }
.player-disclosure-content { padding: 16px; max-height: 380px; overflow: auto; overflow-wrap: anywhere; scrollbar-width: thin; }
.player-disclosure-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.player-disclosure-tools button { max-width: 100%; white-space: normal; }
.player-disclosure-content .muted { font-size: 12px; }
#view-players #management-status { margin: 14px 2px 0; color: #8299a7; font-size: 11px; line-height: 1.6; }
#view-players #management-status:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .player-disclosure-chevron { transition: none; } }

.player-timeline-item { position: relative; padding: 0 0 24px; padding-inline-start: 23px; margin-inline-start: 5px; border-inline-start: 1px solid #30424d; }
.player-timeline-item:last-child { padding-bottom: 4px; border-inline-start-color: transparent; }
.player-timeline-item::before { content: ''; position: absolute; top: 4px; inset-inline-start: -4px; width: 7px; height: 7px; border-radius: 50%; background: #86a668; border: 2px solid #111a20; }
.player-timeline-item time { display: block; color: #718996; font-size: 10px; margin-bottom: 6px; }
.player-timeline-item strong { color: #d4dfe5; font-size: 13px; font-weight: 550; }
.player-timeline-item p { color: #8fa4b0; font-size: 12px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; margin: 7px 0 0; }
#view-players .player-record { background: #101a21; border: 1px solid #283944; border-radius: 9px; padding: 16px; margin: 10px 0; }
#view-players .player-record p { font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.player-record-title, .player-session-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }
.player-record-meta, .player-session-meta { color: #8098a6; font-size: 11px; line-height: 1.6; }
.player-coverage { padding: 12px 14px; border: 1px solid #2b3e49; border-radius: 8px; background: #14212a; }
.player-coverage:empty { display: none; }
.player-record-editor { display: grid; gap: 16px; background: #0c151b; border: 1px solid #2a3c47; border-radius: 10px; padding: 18px; margin: 20px 0 24px; }
#view-players h3 { font-size: 13px; }
#view-players .player-record-editor h3 { margin: 0; color: #dce6ed; }
.player-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
#view-players label { display: flex; flex-direction: column; gap: 7px; font-size: 12px; color: #a9becb; }
#view-players input:not([type="checkbox"]), #view-players select, #view-players textarea { width: 100%; min-height: 40px; background: #101a20; border: 1px solid #344751; border-radius: 8px; padding: 10px 12px; font-size: 12px; color: #e1e9ee; }
#view-players textarea { resize: vertical; min-height: 88px; }
#view-players input:focus, #view-players select:focus, #view-players textarea:focus { outline: 1px solid #82a64d; border-color: #82a64d; }
.player-form-actions { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.player-form-actions > span { max-width: 300px; font-size: 10px; }
#view-players #appeals-panel > h2, #view-players #moderation-panel > h2 { margin: 0 0 8px; font-size: 15px; }
#appeal-form, #appeal-decision-form, #moderation-config-form { display: grid; gap: 14px; margin: 22px 0; padding: 18px; background: #0d161c; border: 1px solid #2a3a45; border-radius: 10px; }
#appeal-form > button, #appeal-decision-form > button, #moderation-ban-form > button, #moderation-config-form > button { justify-self: start; }
#view-players .player-tab-panel > button { margin-top: 14px; }
@media (max-width: 1000px) { .players-layout { grid-template-columns: 270px minmax(0,1fr); gap: 14px; } .player-tabs { gap: 16px; padding: 0 20px; } #player-profile, .player-tab-panel { padding: 20px; } .player-profile-head { gap: 12px; flex-wrap: wrap; } }
@media (max-width: 740px) { .players-layout { grid-template-columns: minmax(0,1fr); } .players-directory { position: static; } #view-players #player-live-list, #view-players #player-known-list { max-height: 190px; } .player-selection-empty { min-height: 260px; } .player-form-grid { grid-template-columns: minmax(0,1fr); } .player-form-actions { align-items: flex-start; flex-direction: column; gap: 12px; } .player-tabs { gap: 20px; } }

.players-head-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
#view-players > #management-import-panel,
#view-players > #management-cleanup-panel { margin-top: 16px; }
#management-import-file { max-width: 100%; min-width: 0; }
#management-import-file::file-selector-button { border: 1px solid #405334; border-radius: 7px; background: #253322; color: #d1eba9; padding: 7px 11px; margin-inline-end: 10px; cursor: pointer; }
#view-players .player-tabs button:disabled { cursor: not-allowed; color: #59707e; opacity: .6; }
@media (max-width: 740px) {
  .work-area, .work-area main, #view-players, .players-layout, .players-directory, .players-detail,
  #management-import-panel, #management-cleanup-panel { min-width: 0; max-width: 100%; }
  #view-players .players-page-head { flex-wrap: wrap; }
  #view-players .players-head-actions { min-width: 0; width: 100%; }
  #management-import-panel form, #management-cleanup-panel form { min-width: 0; max-width: 100%; }
  #management-import-panel input, #management-cleanup-panel input { min-width: 0; max-width: 100%; }
}

#view-players #player-record-save { background: #b8eb48; border-color: #b8eb48; color: #172007; }
#view-players #player-record-save:not(:disabled):hover { background: #caf477; border-color: #caf477; }
.player-form-grid > label { align-self: end; }

.log-message { white-space: pre-wrap; overflow-wrap: anywhere; font-weight: 400; }
.log-row.log-error { color: #ff6b72; background: #28161b; border-left: 2px solid #e8626c; }
.log-row.log-warning { color: #e8ce8d; background: #252116; border-left: 2px solid #d4aa55; }
.log-row.log-success { color: #b4d7b1; }
#view-console #console-lines .log-error { color: #ff6b72; }
.log-row.log-error time, .log-row.log-error .log-source,
#view-console #console-lines .log-error time, #view-console #console-lines .log-error .log-source { color: inherit; }
.log-row.log-error .log-message span { color: inherit; }
.log-color-black { color: #6a737d; }
.log-color-red { color: #c6535e; }
.log-color-green { color: #8bbb71; }
.log-color-yellow { color: #d2b263; }
.log-color-blue { color: #699bd2; }
.log-color-magenta { color: #c486c0; }
.log-color-cyan { color: #62afb5; }
.log-color-white { color: #d6dce3; }
.log-color-bright-black { color: #939ba5; }
.log-color-bright-red { color: #ff6b72; }
.log-color-bright-green { color: #b0dc8c; }
.log-color-bright-yellow { color: #f2d479; }
.log-color-bright-blue { color: #88b6ee; }
.log-color-bright-magenta { color: #e2a5db; }
.log-color-bright-cyan { color: #8dd6dc; }
.log-color-bright-white { color: #f1f5f7; }
.log-bold { font-weight: 700; }
.log-dim { opacity: .72; }

.full-cfg-panel {margin-top:24px;padding:24px;border:1px solid #293740;border-radius:12px;background:#0b1318;}
.cfg-code-editor {width:100%;min-height:340px;margin:12px 0;padding:16px;resize:vertical;tab-size:4;line-height:1.65;font:13px/1.65 Consolas,monospace;white-space:pre;color:#cfdae2;background:#080f14;}
.cfg-code-editor[readonly] {color:#8ca2af;}
.full-cfg-panel .toolbar {justify-content:flex-start;gap:10px;flex-wrap:wrap;}
#staff-capabilities {grid-template-columns:repeat(auto-fit,minmax(210px,1fr));}
html[dir="rtl"] .side-nav button > span { margin-inline-end: .5rem; }
/* Keep the overview's charts and server health cards inside narrow viewports. */
#view-overview,
#view-overview .dashboard-grid,
#view-overview .dashboard-grid > .panel,
#view-overview #server-cards,
#view-overview .server-card,
#view-overview .selected-server-metrics,
#view-overview .stat {
  min-width: 0;
  max-width: 100%;
}
#view-overview .chart-panel canvas,
#view-overview #performance-chart {
  display: block;
  min-width: 0;
  max-width: 100%;
}
#view-overview .panel-head { min-width: 0; flex-wrap: wrap; }
#view-overview .panel-head > * { min-width: 0; }
#view-overview .server-card,
#view-overview .selected-server-metrics > div { overflow-wrap: anywhere; }
#view-overview #console-preview { min-width: 0; max-width: 100%; overflow-x: auto; }
@media (max-width: 850px) {
  #view-overview .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  #view-overview .selected-server-metrics { grid-template-columns: minmax(0, 1fr); }
  #view-overview .server-controls { min-width: 0; flex-wrap: wrap; }
}

.connector-effect { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.65; }
#view-account .panel + .panel { margin-top: 20px; }


/* Keep log messages readable while compact summaries share the chart row. */
@media (min-width: 851px) {
  #view-overview #performance-panel { grid-column: 1; grid-row: 2; }
  #view-overview #overview-incidents-panel { grid-column: 2; grid-row: 2; }
  #view-overview #console-preview-panel { grid-column: 1 / -1; grid-row: 3; }
}


/* Staff access workspace. */
#view-access { min-width: 0; }
#view-access .access-grid { display: block; margin: 0 0 20px; }
#view-access .access-connection { min-height: 0; padding: 20px 24px; }
#view-access .access-connection h2 { display: inline-block; margin: 0 0 0 12px; font-size: 14px; }
#view-access .access-connection .warning-badge { margin: 0; vertical-align: middle; }
#view-access .access-connection > p { margin: 12px 0 0; font-size: 13px; }
#view-access .staff-access-panel { min-height: 0; padding: 24px; }
.staff-access-heading, .staff-members-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
#view-access .staff-access-heading h2 { margin-bottom: 5px; }
.staff-access-heading p { margin: 0; font-size: 12px; }
.staff-status { padding: 12px 14px; margin: 16px 0 0; border: 1px solid #51432c; border-radius: 8px; background: #231f16; color: #e5c68b; font-size: 12px; line-height: 1.6; }
.staff-status:empty { display: none; }
.staff-workspace { display: grid; grid-template-columns: 265px minmax(0,1fr); align-items: start; gap: 24px; margin-top: 24px; }
.staff-members { min-width: 0; padding: 16px; border: 1px solid #283a45; background: #0c151b; border-radius: 10px; }
.staff-members-heading h3 { margin: 0; font-size: 13px; color: #c9d9e4; }
.staff-count { font-size: 11px; padding: 3px 7px; border-radius: 6px; background: #1e2d37; color: #b4c9d6; }
#view-access .staff-add-member { width: 100%; margin: 15px 0; }
#staff-accounts { display: grid; gap: 10px; }
.staff-account-card { display: grid; gap: 10px; min-width: 0; padding: 14px; border: 1px solid #2a3c47; border-radius: 9px; background: #111d24; }
.staff-account-card > strong { font: 600 12px/1.6 Consolas, monospace; color: #d6e3eb; overflow-wrap: anywhere; }
.staff-account-level { margin: 0; font-size: 11px; color: #a1b6c5; }
.staff-account-full { color: #c4e797; }
.staff-account-card.is-editing { border-color: #6b8c3f; background: #1a281e; }
.staff-account-card button { justify-self: start; }
.staff-empty { margin: 5px 0; color: #7f98a9; font-size: 12px; line-height: 1.7; }
#staff-more { margin-top: 14px; width: 100%; }
.staff-editor { min-width: 0; }
.staff-editor-heading { margin-bottom: 20px; }
.staff-editor-heading h3 { font-size: 15px; margin: 0 0 7px; color: #dce7ed; }
.staff-editor-heading p { margin: 0; font-size: 12px; }
#view-access .staff-id-field { display: grid; gap: 8px; margin: 0; font-size: 12px; color: #b3c7d4; }
#view-access #staff-discord-id { width: 100%; margin: 0; padding: 12px 14px; font-family: Consolas, monospace; background: #0a1319; }
#view-access #staff-capabilities { display: grid; grid-template-columns: minmax(0,1fr); gap: 10px; margin: 22px 0 0; padding: 0; border: 0; min-width: 0; }
#staff-capabilities legend { padding: 0; margin-bottom: 12px; font-size: 12px; color: #8ba4b4; }
#view-access #staff-capabilities .staff-capability { display: flex; align-items: center; gap: 10px; min-width: 0; margin: 0; padding: 12px; border: 1px solid #2d404d; border-radius: 8px; background: #111e26; cursor: pointer; }
#view-access #staff-capabilities .staff-capability:hover { border-color: #59733e; background: #18262b; }
#view-access #staff-capabilities .staff-capability:has(input:checked) { border-color: #658942; background: #1c2b20; }
#view-access #staff-capabilities input { appearance: none; flex-shrink: 0; width: 18px; height: 18px; margin: 0; padding: 0; border: 1px solid #506675; border-radius: 5px; background: #0a141a; cursor: pointer; }
#view-access #staff-capabilities input:checked { background: #b8eb48; border-color: #b8eb48; }
#view-access #staff-capabilities input:checked::after { content: '✓'; display: block; color: #172007; font-size: 13px; font-weight: 800; line-height: 16px; text-align: center; }
#view-access #staff-capabilities input:focus-visible { outline: 2px solid #d3f195; outline-offset: 3px; }
.staff-capability-name { display: block; color: #cedde7; font-size: 12px; line-height: 1.5; }
.staff-capability-copy small { display: block; margin-top: 4px; color: #8ba3b2; font-size: 11px; line-height: 1.5; }
#view-access #staff-capabilities .staff-full-capability { padding: 16px; margin-bottom: 8px; }
.staff-caps-group { overflow: hidden; border: 1px solid #2c3e49; border-radius: 9px; background: #0e181f; }
.staff-caps-group > summary { display: flex; align-items: center; gap: 10px; padding: 14px 16px; list-style: none; cursor: pointer; color: #cbdbe5; }
.staff-caps-group > summary::-webkit-details-marker { display: none; }
.staff-caps-group > summary::marker { content: ''; }
.staff-caps-group > summary::after { content: '›'; color: #8aa1b0; font-size: 20px; line-height: 16px; }
.staff-caps-group > summary:hover { background: #15242d; }
.staff-caps-group > summary:focus-visible { outline: 2px solid #b8eb48; outline-offset: -3px; }
.staff-group-title { flex: 1; font-size: 12px; font-weight: 600; }
.staff-group-count { color: #849eaf; font-size: 10px; }
.staff-caps-group[open] > summary { border-bottom: 1px solid #2c3e49; }
.staff-caps-group[open] > summary::after { transform: rotate(90deg); }
.staff-capability-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; padding: 12px; }
.staff-full-selected .staff-group-title { color: #bddc98; }
.staff-editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 22px; padding-top: 18px; border-top: 1px solid #293b46; }
#staff-selection-hint { font-size: 11px; line-height: 1.6; }
html[dir="rtl"] .staff-caps-group:not([open]) > summary::after { transform: rotate(180deg); }
@media (max-width: 1050px) { .staff-workspace { grid-template-columns: 220px minmax(0,1fr); gap: 18px; } .staff-capability-grid { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 760px) { .staff-workspace { grid-template-columns: minmax(0,1fr); } #view-access .staff-access-panel, #view-access .access-connection { padding: 18px; } .staff-access-heading { flex-wrap: wrap; } #view-access .access-connection h2 { display: block; margin: 12px 0 0; } .staff-editor-footer { flex-wrap: wrap; } }

/* Server actions workspace. */
#view-actions .actions-workspace { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(340px,1fr); gap: 20px; align-items: start; }
#view-actions .panel { margin: 0; padding: 22px; min-width: 0; }
#view-actions .action-panel { max-width: none; }
#view-actions .actions-integrations { display: grid; gap: 20px; min-width: 0; }
#view-actions .actions-integrations:has(> [hidden]):not(:has(> :not([hidden]))) { display: none; }
#view-actions .actions-workspace:not(:has(.actions-integrations > :not([hidden]))) { grid-template-columns: minmax(0,1fr); }
#view-actions .actions-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
#view-actions .actions-section-head h2 { font-size: 15px; margin: 0 0 6px; line-height: 1.4; }
#view-actions .actions-section-head p { font-size: 12px; line-height: 1.6; margin: 0; }
#view-actions .actions-section-head > button { flex-shrink: 0; font-size: 11px; padding: 9px 11px; }
#view-actions .action-picker { border: 0; padding: 0; margin: 0; min-width: 0; }
#view-actions .action-picker legend { font-size: 11px; color: #91a5b0; margin-bottom: 10px; padding: 0; }
#view-actions .action-choices { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
#view-actions .action-choice { display: flex; align-items: center; gap: 12px; text-align: start; padding: 14px; border: 1px solid #2c3a43; border-radius: 9px; background: #0d171d; color: #bdcbd4; min-width: 0; }
#view-actions .action-choice:last-child { grid-column: 1 / -1; }
#view-actions .action-choice:hover:not(:disabled) { background: #152229; border-color: #506474; }
#view-actions .action-choice[aria-pressed=true] { background: #1d2b20; border-color: #718e46; color: #d3edb0; }
#view-actions .action-choice:focus-visible { outline: 2px solid #b8eb48; outline-offset: 3px; }
#view-actions .action-choice-icon { width: 34px; height: 34px; background: #16232b; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }
#view-actions .action-choice[aria-pressed=true] .action-choice-icon { background: #2a3a23; }
#view-actions .action-choice-icon svg { width: 19px; height: 19px; }
#view-actions .action-choice-copy { display: grid; gap: 5px; }
#view-actions .action-choice-copy strong { font-size: 12px; font-weight: 600; }
#view-actions .action-choice-copy small { font-size: 10px; color: #91a4ae; font-weight: 400; line-height: 1.5; }
#view-actions .action-details-heading { margin-top: 7px; padding-top: 20px; border-top: 1px solid #28363f; }
#view-actions .action-details-heading h3 { margin: 0 0 5px; font-size: 14px; }
#view-actions .action-details-heading p { margin: 0; font-size: 11px; line-height: 1.6; }
#view-actions .action-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
#view-actions .action-fields:not(:has(#duration-row:not([hidden]))) { grid-template-columns: minmax(0,1fr); }
#view-actions .action-reason-field { grid-column: 1 / -1; }
#view-actions label > small { font-size: 10px; line-height: 1.5; }
#view-actions input, #view-actions select, #view-actions textarea { background: #0d161c; width: 100%; min-width: 0; }
#view-actions input:focus, #view-actions select:focus, #view-actions textarea:focus { outline: 1px solid #82a64d; border-color: #82a64d; }
#view-actions #reason { min-height: 88px; }
#view-actions .action-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 17px; margin-top: 4px; border-top: 1px solid #28363f; }
#view-actions .action-form-footer > span { font-size: 10px; line-height: 1.6; max-width: 280px; }
#view-actions .action-form-footer button { flex-shrink: 0; }
#view-actions .actions-integration-status { font-size: 11px; line-height: 1.7; color: #b5c8d3; background: #0c171d; border: 1px solid #283c46; border-radius: 8px; padding: 11px 12px; margin: 0 0 18px; overflow-wrap: anywhere; }
#view-actions .actions-disclosure { border: 1px solid #2a3942; border-radius: 8px; margin-top: 20px; background: #0d171d; }
#view-actions .actions-disclosure > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; cursor: pointer; font-size: 11px; color: #afc4cf; }
#view-actions .actions-disclosure > summary::-webkit-details-marker { display: none; }
#view-actions .actions-disclosure > summary::after { content: '›'; font-size: 17px; color: #a6c76f; transform: rotate(0deg); transition: transform .15s ease; }
#view-actions .actions-disclosure[open] > summary::after { transform: rotate(90deg); }
#view-actions .actions-disclosure > summary:focus-visible { outline: 2px solid #b8eb48; outline-offset: 2px; border-radius: 8px; }
#view-actions .actions-disclosure > div { border-top: 1px solid #28363f; padding: 12px 16px; font-size: 11px; line-height: 1.8; }
#view-actions .actions-disclosure ol { margin: 0; padding-inline-start: 18px; }
#view-actions .actions-disclosure li + li { margin-top: 8px; }
#view-actions #discord-review { margin-top: 18px; padding: 14px; border: 1px solid #48533b; border-radius: 8px; background: #142018; }
#view-actions #discord-review h3 { margin: 0 0 12px; font-size: 12px; }
#view-actions #discord-result:not(:empty) { font-size: 11px; line-height: 1.6; margin: 16px 0 0; }
#view-actions .proposal { background: #172119; border-color: #48573b; color: #d6e4ce; margin-top: 18px; }
#view-actions .proposal button { margin-inline-end: 8px; }
@media (max-width: 1100px) { #view-actions .actions-workspace { grid-template-columns: minmax(0,1fr); } #view-actions .actions-integrations { grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; } }
@media (max-width: 760px) { #view-actions .panel { padding: 18px; } #view-actions .actions-integrations, #view-actions .action-fields { grid-template-columns: minmax(0,1fr); } #view-actions .actions-section-head { flex-wrap: wrap; } #view-actions .action-form-footer { align-items: flex-start; flex-direction: column; } }
@media (max-width: 460px) { #view-actions .action-choices { grid-template-columns: minmax(0,1fr); } }
[dir=rtl] #view-actions .actions-disclosure:not([open]) > summary::after { transform: rotate(180deg); }
#view-actions .action-form-footer > button { background: #b8eb48; color: #17200c; border: 0; padding: 10px 16px; font-weight: 700; min-height: 38px; }

/* Resolved Discord staff names. */
.staff-account-card > strong { font-size: 14px; font-weight: 600; line-height: 1.5; font-family: inherit; }
.staff-account-id { display: block; font: 10px/1.6 Consolas, monospace; color: #849da9; margin-top: 4px; overflow-wrap: anywhere; }
#view-access .staff-profile-preview { display: flex; align-items: center; gap: 12px; margin-top: -4px; padding: 12px 14px; border: 1px solid #354737; border-radius: 8px; background: #14201a; color: #b5c8be; font-size: 11px; line-height: 1.6; }
.staff-profile-copy { display: grid; gap: 3px; min-width: 0; }
.staff-profile-copy strong { font-size: 14px; color: #d5eac8; overflow-wrap: anywhere; }
.staff-profile-copy small { font-size: 11px; color: #95afa4; overflow-wrap: anywhere; }

/* Top-center transient notifications and offline live pages. */
#notifications { position: fixed; inset: 22px auto auto 50%; transform: translateX(-50%); width: min(520px,calc(100vw - 32px)); margin: 0; padding: 0; border: 0; background: transparent; overflow: visible; z-index: 10000; pointer-events: none; }
#notifications:popover-open { display: grid; gap: 10px; }
.notification { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #152129; color: #dce9ef; border: 1px solid #425966; border-radius: 11px; box-shadow: 0 8px 30px #0006; pointer-events: auto; animation: notification-slide .2s ease-out; }
.notification-copy { flex: 1; min-width: 0; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.notification-icon { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: #2c404c; color: #c9e7f5; font-weight: 700; flex-shrink: 0; }
.notification-error { background: #2a191c; border-color: #794349; } .notification-error .notification-icon { background: #572d33; color: #ffc1c7; }
.notification-success { background: #19281c; border-color: #597440; } .notification-success .notification-icon { background: #32472a; color: #cceb9b; }
#notifications .notification-close { border: 0; padding: 0; width: 28px; height: 28px; min-width: 28px; background: transparent; color: #a7b8c3; font-size: 20px; border-radius: 6px; }
#notifications .notification-close:hover { background: #ffffff0d; color: #fff; }
#notifications .notification-close:focus-visible { outline: 2px solid #b8eb48; }
@keyframes notification-slide { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: translateY(0); } }
.view[data-server-gate=blocked] > :not(.page-head):not(#server-state-panel) { display: none !important; }
.view[data-server-gate=blocked] > .page-head > :not(:first-child) { display: none !important; }
#server-state-panel { margin: 0; padding: 36px; min-height: 260px; display: flex; flex-direction: column; align-items: center; text-align: center; justify-content: center; gap: 18px; flex-shrink: 0; }
.server-state-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: #1d2a31; color: #a7bac7; border: 1px solid #35444e; }
.server-state-icon svg { width: 28px; height: 28px; }
#server-state-panel .eyebrow { margin: 0 0 9px; }
#server-state-panel h2 { font-size: 21px; margin: 0 0 9px; }
#server-state-panel .server-state-copy > .muted { font-size: 13px; line-height: 1.7; margin: 0; }
#server-state-controls:empty { display: none; }
#server-state-controls .server-controls { display: flex; justify-content: center; gap: 8px; margin: 0; }
#server-state-controls .server-controls button { min-width: 82px; }
#server-state-controls > p { font-size: 11px; max-width: 520px; margin: 12px 0 0; }
.server-state-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
@media (max-width: 700px) { #server-state-panel { padding: 25px 18px; } #notifications { top: 12px; } }
@media (prefers-reduced-motion: reduce) { .notification { animation: none; } }

/* Automation view: status header, two-column settings, toggle rows. */
#automation-content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
#automation-content > .automation-status-card { grid-column: 1 / -1; }
@media (max-width: 1100px) { #automation-content { grid-template-columns: minmax(0, 1fr); } }
.automation-status-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; }
.automation-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.automation-title h2 { margin: 0; font-size: 20px; }
.automation-facts { margin: 6px 0 0; font-size: 13px; }
.automation-actions { margin-top: 0; }
.automation-state { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; text-transform: capitalize; border: 1px solid #3a4046; color: #c2c8ce; background: #15181b; }
.automation-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.automation-state-running { color: #b8eb48; border-color: #4b5a2a; background: #1a2111; }
.automation-state-starting, .automation-state-stopping { color: #f2c46d; border-color: #5e4c27; background: #211b10; }
.automation-state-failed { color: #ff8f99; border-color: #70414a; background: #2a1619; }
.automation-state-stopped { color: #9b9fa6; }
.automation-card { display: grid; gap: 18px; }
.automation-card > header h2 { margin: 0 0 4px; }
.automation-card > header p { margin: 0; font-size: 13px; }
.automation-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 16px; }
.automation-toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border: 1px solid #2c3136; border-radius: 8px; background: #16191c; cursor: pointer; }
.automation-toggle span { display: grid; gap: 3px; }
.automation-toggle-title { color: #e7e9ec; font-size: 13px; font-weight: 600; }
.automation-toggle-help { color: #9b9fa6; font-size: 12px; line-height: 1.4; }
.automation-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid #2c3136; }
.automation-footer > span { font-size: 12px; }
.automation-card input:disabled, .automation-card select:disabled { opacity: .5; }
.automation-toggle { position: relative; }
.automation-switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.automation-switch { flex: none; position: relative; width: 40px; height: 22px; border-radius: 999px; background: #2a2f34; border: 1px solid #3d444a; transition: background .15s, border-color .15s; }
.automation-switch::after { content: ""; position: absolute; top: 50%; left: 3px; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: #9ba3aa; transition: transform .15s, background .15s; }
.automation-switch-input:checked + .automation-switch { background: #3f5418; border-color: #b8eb48; }
.automation-switch-input:checked + .automation-switch::after { transform: translateX(16px); background: #b8eb48; }
.automation-switch-input:focus-visible + .automation-switch { outline: 2px solid #b8eb48; outline-offset: 2px; }
.automation-notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border-radius: 8px; font-size: 13px; line-height: 1.45; }
.automation-notice-ok { background: #18210f; border: 1px solid #4b5a2a; color: #d6ec9b; }
.automation-notice-restart { background: #241d0f; border: 1px solid #6b5326; color: #f2d08a; }
.automation-notice button { flex: none; }
/* Server thread performance: legend chips with current and peak values. */
.perf-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 8px; }
.perf-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 9px; border: 1px solid #2c3136; border-radius: 999px; background: #15181b; font-size: 12px; color: #c2c8ce; white-space: nowrap; }
.perf-chip i { width: 8px; height: 8px; border-radius: 50%; align-self: center; }
.perf-chip b { font-weight: 600; color: #e7e9ec; }
.perf-chip small { color: #80909c; font-size: 11px; }
/* ===== RTL, bidirectional text and phone/tablet layout ===================== */
/* Arabic is the default language (index.html ships lang="ar" dir="rtl").      */
/* Prefer logical properties (margin-inline-*, inset-inline-*, text-align:     */
/* start) for anything that should follow the reading direction.               */

/* Arabic letters join: tracking and forced capitals break the joins. */
html[lang="ar"] :is(.eyebrow, .nav-label, .stat small, th, .identity small) {
  letter-spacing: 0;
  text-transform: none;
}
/* Glyphs like › are mirrored by the bidi algorithm; SVG chevrons are not. */
html[dir="rtl"] .player-disclosure:not([open]) .player-disclosure-chevron { transform: scaleX(-1); }
/* Switches read "off" at the start edge and slide towards the end edge. */
html[dir="rtl"] #registered-servers input[type=checkbox]::after,
html[dir="rtl"] .automation-switch::after { left: auto; right: 3px; }
html[dir="rtl"] #registered-servers input[type=checkbox]:checked::after,
html[dir="rtl"] .automation-switch-input:checked + .automation-switch::after { transform: translateX(-16px); }

/* Code, console and log areas stay left-to-right in both languages. */
.log-lines,
#console-lines,
#console-preview,
.cfg-code-editor,
code,
kbd,
samp,
.console-command-row,
#console-command-exact,
.resource-folder,
#staff-discord-id {
  direction: ltr;
  text-align: left;
}
/* ...while each log message picks its own direction (Arabic chat lines, names). */
.log-message { unicode-bidi: plaintext; }
/* User-supplied text: player names, identifiers, staff names, free-text fields. */
.player-list-name,
.player-list-meta,
.player-profile-copy h2,
.staff-account-card > strong,
.staff-account-id,
.server-card h2,
td strong,
.message.user,
.chat-list button,
pre.player-details,
pre.connector-effect {
  unicode-bidi: plaintext;
  text-align: match-parent;
}
input:not([type="checkbox"]):not([type="radio"]),
textarea {
  unicode-bidi: plaintext;
}
/* Keep values such as "12 ms" or "1,234 / 2,048" in one piece inside RTL text. */
.stat strong,
.perf-chip,
.badge,
time {
  unicode-bidi: isolate;
}

/* ---- Navigation drawer (closed and invisible on wide screens) ---- */
.nav-toggle { display: none; }
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: #dfe7ed;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
}
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.shell.nav-open .nav-toggle-bars { background: transparent; }
.shell.nav-open .nav-toggle-bars::before { top: 0; transform: rotate(45deg); }
.shell.nav-open .nav-toggle-bars::after { top: 0; transform: rotate(-45deg); }

/* Phones and tablets. Keep in sync with matchMedia("(max-width: 900px)") in ui-feedback.js. */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    z-index: 80;
    width: min(288px, 86vw);
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.22s ease, visibility 0s linear 0.22s;
  }
  html[dir="rtl"] .sidebar { transform: translateX(100%); }
  .shell.nav-open .sidebar {
    transform: none;
    visibility: visible;
    transition: transform 0.22s ease, visibility 0s;
    box-shadow: 0 0 40px #000b;
  }
  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: #000000a8;
  }
  body.nav-locked { overflow: hidden; }
  .sidebar .nav-label { margin: 22px 16px 8px; }
  .side-nav button,
  .side-nav a { min-height: 44px; }
  .sidebar-foot { flex-wrap: wrap; padding: 14px; }
  .sidebar-foot button { min-height: 40px; padding: 0 12px; }

  .nav-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    background: #161d23;
    border: 1px solid #313c45;
    border-radius: 8px;
  }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: auto;
    min-height: 58px;
    flex-wrap: nowrap;
    gap: 10px;
    padding: 8px 12px;
  }
  /* "Workspace ›" is dropped; only the page name stays. */
  .crumb {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .crumb span { display: none; }
  .crumb strong { font-size: 15px; }
  .top-actions { gap: 8px; min-width: 0; margin-inline-start: 0; }
  .top-actions .server-picker { min-width: 0; width: clamp(120px, 42vw, 220px); }
  .top-actions select { width: clamp(120px, 42vw, 220px); }
  .topbar .server-picker-trigger { height: 42px; }
  #ai-state { max-width: 28vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .work-area main { padding: 16px; }
  .page-head { flex-wrap: wrap; gap: 12px; }
  .page-head > div:first-child { flex: 1 1 240px; min-width: 0; }
  .page-head h1 { font-size: 22px; overflow-wrap: anywhere; }
  .panel { padding: 16px; min-width: 0; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dashboard-grid,
  .overview-grid,
  .access-grid,
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .chart-panel canvas { height: 220px; }
  #performance-chart { height: 240px; }
  #errors-chart { height: 100px; }
  .map-frame { height: 60vh; min-height: 320px; }
  .table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
  td:first-child { min-width: 180px; }
  .log-lines { overflow-x: auto; }
  .segmented { max-width: 100%; overflow-x: auto; }
  .search-row { flex-wrap: wrap; }
  .search-row input,
  #resources-term { max-width: none; flex: 1 1 100%; }
  dialog {
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    overflow: auto;
  }
  dialog.panel,
  #server-lifecycle-review,
  .resource-action-panel { width: calc(100vw - 24px); padding: 20px; }
}

/* Touch targets of at least 40px on small or touch screens. */
@media (max-width: 900px), (pointer: coarse) {
  button:where(:not(.side-nav button):not(.chat-list button):not(.segmented button):not(.map-controls button)),
  .secondary,
  .quiet-link,
  select,
  input:not([type="checkbox"]):not([type="radio"]) { min-height: 40px; }
  .panel-head button { min-height: 40px; padding: 0 12px; }
  .segmented button,
  .map-controls button,
  .chat-list button { min-height: 40px; min-width: 40px; }
}

/* Phones. */
@media (max-width: 600px) {
  .work-area main { padding: 12px; }
  .login { width: calc(100% - 24px); margin: 6vh auto; }
  .stats .stat { padding: 12px; min-width: 0; }
  .stat strong { font-size: 21px; overflow-wrap: anywhere; }
  .work-area main form:not(.composer):not(.search-row) input:not([type="checkbox"]):not([type="radio"]),
  .work-area main form select,
  .work-area main form textarea { width: 100%; max-width: none; }
  .search-row > button,
  .search-row > select { flex: 1 1 auto; }
  .dialog-actions,
  dialog .toolbar { flex-wrap: wrap; }
  .dialog-actions > button,
  dialog .toolbar > button { flex: 1 1 auto; }
  /* Log lines stack: time, then the message (source hidden as on the console). */
  .log-row,
  #view-console #console-lines .log-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .log-row .log-source,
  #view-console #console-lines .log-source { display: none; }
  .log-row time { font-size: 10px; }
  .map-legend { width: min(190px, calc(100% - 28px)); }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .shell.nav-open .sidebar { transition: none; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
.chat-examples {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 760px;
  margin: 18px auto 0;
}
.chat-examples .chat-example {
  background: #1c1f22;
  border: 1px solid #34383d;
  color: #d9dde1;
  border-radius: 14px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}
.chat-examples .chat-example:hover,
.chat-examples .chat-example:focus-visible {
  border-color: #b8eb48;
  color: #b8eb48;
}
.ai-status-line {
  margin: 6px 2px 0;
  color: #8f969e;
}
[dir="rtl"] .message.assistant ul {
  padding-left: 0;
  padding-right: 23px;
}
.message.assistant:dir(rtl) ul {
  padding-left: 0;
  padding-right: 23px;
}
/* AI Ops */
#view-aiops .panel { margin-bottom: 16px; }
#view-aiops .panel h2 { font-size: 15px; margin: 0 0 10px; }
.aiops-notice { display: flex; flex-direction: column; gap: 4px; border: 1px solid #70414a; background: #352126; color: #ffb8be; border-radius: 8px; padding: 10px 12px; font-size: 12px; }
#aiops-status[data-tone="error"] { color: #ffb8be; }
#aiops-status[data-tone="ok"] { color: #b8eb48; }
.aiops-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 18px; margin: 0 0 10px; }
.aiops-facts dt { color: #7c8c99; font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
.aiops-facts dd { margin: 2px 0 0; font-size: 13px; color: #e1e4e7; overflow-wrap: anywhere; }
.aiops-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.aiops-action, #aiops-confirm-submit { border-radius: 7px; padding: 7px 10px; font-size: 12px; border: 1px solid #41474c; background: #262a2e; color: #e1e4e7; white-space: nowrap; }
.aiops-action:hover:not(:disabled) { background: #353a3f; }
.aiops-propose, .aiops-test { background: #303522; border-color: #58633b; color: #d6ec9b; }
.aiops-deploy, #aiops-confirm-submit { background: #b8eb48; border-color: #b8eb48; color: #172007; }
.aiops-deploy:hover:not(:disabled), #aiops-confirm-submit:hover:not(:disabled) { background: #caf477; border-color: #caf477; }
.aiops-rollback { background: #352126; border-color: #70414a; color: #ffb8be; }
.aiops-severity-critical, .aiops-status-rolled_back, .aiops-status-rollback_failed, .aiops-status-failed { border-color: #70414a; color: #ffb8be; }
.aiops-severity-high, .aiops-class-needs-review, .aiops-status-interrupted { border-color: #6e5a2c; color: #f1d08a; }
.aiops-class-simple, .aiops-status-verified, .aiops-status-deployed, .aiops-status-merged { border-color: #58633b; color: #b8eb48; }
#view-aiops code { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; }
.aiops-files { font-family: ui-monospace, monospace; font-size: 12px; }
/* Insights page */
.insights-grid { display: grid; gap: 16px; }
.insights-card { display: grid; gap: 10px; min-width: 0; }
.insights-card > .panel-head h2 { margin: 0; }
.insights-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.insights-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border: 1px solid #2c3136; border-radius: 999px; background: #15181b; color: #c2c8ce; font-size: 11px; white-space: nowrap; margin: 1px 3px 1px 0; }
.insights-tone-ok, .insights-tone-info { border-color: #4b5642; color: #b8eb48; }
.insights-tone-warning { border-color: #5a4a22; color: #f2c94c; }
.insights-tone-critical { border-color: #5a2a2a; color: #eb5757; }
.insights-tone-muted { color: #8a96a0; }
.insights-subhead { margin: 8px 0 0; color: #dfe5e9; font-weight: 600; font-size: 13px; }
.insights-empty { margin: 4px 0; font-size: 12px; }
.insights-incident { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid #263038; border-left: 3px solid #4b5642; border-radius: 8px; background: #121619; }
.insights-incident p, .insights-incident ul { margin: 0; font-size: 12px; line-height: 1.5; }
.insights-incident ul { padding-inline-start: 18px; }
.insights-incident-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.insights-border-warning { border-left-color: #f2c94c; }
.insights-border-critical { border-left-color: #eb5757; }
.insights-border-info { border-left-color: #b8eb48; }
[dir=rtl] .insights-incident { border-left-width: 1px; border-right: 3px solid #4b5642; }
[dir=rtl] .insights-border-warning { border-right-color: #f2c94c; }
[dir=rtl] .insights-border-critical { border-right-color: #eb5757; }
[dir=rtl] .insights-border-info { border-right-color: #b8eb48; }
.insights-incident-list { display: grid; gap: 8px; margin-top: 10px; }
.insights-ai { padding: 10px 12px; border: 1px dashed #3a4a2a; border-radius: 8px; background: #141a12; font-size: 12px; }
.insights-ai ul { margin: 6px 0 0; padding-inline-start: 18px; }
.insights-advisor { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid #2a3a24; border-radius: 8px; background: #141a12; }
.insights-advisor p { margin: 0; }

/* ===== Analytics map: layer tabs, summary chips, legend card, zoom group ===== */
.map-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.map-layers button { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: 13px; }
.layer-dot { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 50%; }
.layer-dot.live { background: #ff4566; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25); }
.layer-dot.heat { background: linear-gradient(135deg, #2256d8, #30bbb2, #edf15c); }
.layer-dot.incident { background: #f0a040; }
.map-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.map-chip { padding: 4px 10px; border: 1px solid #2c3640; border-radius: 999px; background: #11171c; color: #c2ccd4; font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.map-legend { top: 14px; bottom: auto; inset-inline-start: 14px; inset-inline-end: auto; width: 260px; padding: 12px 14px; border-radius: 10px; }
.map-legend strong { display: flex; align-items: center; gap: 8px; color: #eef3f6; font-size: 13px; margin-bottom: 6px; }
.map-legend.incidents strong::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #f0a040; flex: none; }
.map-legend > div.map-legend-live { justify-content: flex-start; align-items: center; gap: 8px; color: #d8e2e9; font-size: 12px; font-variant-numeric: tabular-nums; }
.map-legend > div.map-legend-scale { margin-bottom: 2px; }
.map-legend p { margin: 8px 0 0; }
.map-notice { top: 14px; inset-inline-end: 14px; inset-inline-start: auto; max-width: min(420px, 45%); }
.map-controls { inset-inline-end: 14px; inset-inline-start: auto; bottom: 14px; gap: 0; border: 1px solid #32424f; border-radius: 8px; overflow: hidden; background: #101820; }
.map-controls button { width: 38px; height: 38px; padding: 0; border: 0; border-radius: 0; background: transparent; font-size: 18px; line-height: 1; }
.map-controls button + button { border-top: 1px solid #26333d; }
.map-controls button:hover { background: #1b2630; }
.map-controls button:nth-child(-n + 2) { font-size: 20px; }
.map-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.map-footer #map-status { margin: 0; }
.map-warning { padding: 3px 10px; border: 1px solid #6b5326; border-radius: 999px; background: #1d1810; color: #f0c77a; font-size: 11px; }
#map-range:disabled { opacity: 0.5; cursor: not-allowed; }
@media (max-width: 600px) {
  .map-layers button { padding: 8px 10px; font-size: 12px; }
  .map-legend { width: min(230px, calc(100% - 28px)); padding: 10px 12px; }
  .map-notice { top: auto; bottom: 14px; inset-inline-start: 14px; inset-inline-end: 66px; max-width: none; }
}
html[dir="rtl"] .map-legend .gradient { background: linear-gradient(270deg, #2256d8, #30bbb2, #edf15c); }
