:root {
  --sidebar: #15171c;
  --sidebar-soft: #1d2027;
  --canvas: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f3f4f7;
  --text: #171923;
  --muted: #6f7481;
  --border: #e2e4e9;
  --violet: #6d4aff;
  --violet-dark: #5635e8;
  --green: #159556;
  --amber: #d67a00;
  --red: #d64444;
  --radius: 10px;
  --sidebar-width: 232px;
  --topbar-height: 64px;
  --content-width: 1500px;
  color-scheme: light;
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

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

body {
  color: var(--text);
  background: var(--canvas);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  color: inherit;
  font: 500 14px/1.4 Inter, "Segoe UI", sans-serif;
}

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

a {
  color: var(--violet-dark);
  text-decoration: none;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

h1 {
  font-size: clamp(27px, 2.2vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -0.018em;
}

h3 {
  font-size: 14px;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.icon {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, transform 150ms ease;
}

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

.button:focus-visible,
.icon-button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgb(109 74 255 / 22%);
  outline-offset: 2px;
}

.button.primary {
  color: #fff;
  border-color: var(--violet);
  background: var(--violet);
}

.button.primary:hover {
  background: var(--violet-dark);
}

.button.secondary {
  border-color: #cfd2da;
  background: var(--surface);
}

.button.danger-outline {
  border-color: #f05b5b;
  color: #cf2929;
  background: var(--surface);
}

.button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  display: inline-grid;
  place-items: center;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.icon-button:hover {
  background: var(--surface-2);
  border-color: var(--border);
}

.icon-button.danger {
  color: var(--red);
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  color: #e8e9ed;
  background:
    radial-gradient(circle at 20% 14%, rgb(109 74 255 / 8%), transparent 34%),
    linear-gradient(150deg, #15171c, #11151b 68%, #181c23);
  border-right: 1px solid #272b34;
}

.sidebar > header {
  height: 122px;
  padding: 28px 28px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.sidebar-logo {
  color: #fff;
  display: inline-flex;
  flex-direction: column;
  line-height: 1;
  letter-spacing: 0.18em;
}

.sidebar-logo strong {
  font-size: 29px;
  font-weight: 720;
}

.sidebar-logo small {
  margin-top: 7px;
  color: #8c6dff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4em;
}

.sidebar nav {
  padding: 0 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar nav a {
  min-height: 50px;
  padding: 0 18px;
  border-left: 3px solid transparent;
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 15px;
  color: #d7d9df;
  font-size: 14px;
  font-weight: 550;
  transition: background 150ms ease, color 150ms ease;
}

.sidebar nav a:hover {
  color: #fff;
  background: #1f222a;
}

.sidebar nav a.active {
  color: #fff;
  border-left-color: #8a68ff;
  background: linear-gradient(90deg, #5638ea, #704aff);
}

.sidebar nav a .icon {
  width: 22px;
  height: 22px;
}

.sidebar > footer {
  min-height: 84px;
  margin-top: auto;
  padding: 17px 18px;
  border-top: 1px solid #2c3038;
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
  gap: 10px;
}

.sidebar > footer .avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #8b6aff, #5b36ec);
  color: #fff;
  font-weight: 700;
}

.sidebar > footer > div:nth-child(2) {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sidebar > footer strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar > footer small {
  color: #9ca1ad;
  font-size: 10px;
  letter-spacing: 0.05em;
}

.sidebar > footer .icon-button {
  color: #b9bec8;
}

.sidebar-close,
.sidebar-backdrop {
  display: none;
}

.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-height);
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgb(255 255 255 / 95%);
  backdrop-filter: blur(12px);
}

.topbar > strong {
  font-size: 15px;
}

.menu-button {
  margin-left: -10px;
}

.connection-state {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #515762;
  font-size: 13px;
}

.connection-state > span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #b3b7c0;
}

.connection-state > span.online {
  background: #2ab35c;
  box-shadow: 0 0 0 4px rgb(42 179 92 / 9%);
}

.connection-state > span.offline {
  background: var(--red);
}

.content {
  min-height: calc(100vh - var(--topbar-height));
  padding: 36px 30px 72px;
}

.content-inner {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
}

.page-heading {
  margin-bottom: 28px;
}

.page-heading.inline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.page-heading p,
.realm-heading p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
}

.realm-heading {
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.realm-heading > div:first-child > div:last-child {
  margin-top: 12px;
}

.realm-heading p span {
  margin: 0 9px;
  color: #a0a4ad;
}

.realm-heading-controls {
  padding-top: 6px;
}

.realm-hero,
.realm-factbar,
.section-block,
.summary-strip,
.file-panel,
.directory-rail,
.console-panel,
.session-panel,
.form-panel,
.info-panel,
.admin-detail section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.realm-hero {
  display: grid;
  grid-template-columns: minmax(260px, 1.25fr) minmax(500px, 3fr) auto;
  align-items: center;
  overflow: hidden;
}

.realm-identity {
  min-height: 150px;
  padding: 27px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.realm-identity h2 {
  margin-bottom: 8px;
  font-size: 27px;
}

.realm-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 18%), transparent 50%),
    linear-gradient(145deg, #302165, #7357dc);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 12%);
  font-size: 18px;
  font-weight: 750;
}

.realm-mark.large {
  width: 92px;
  height: 92px;
  border-radius: 9px;
  font-size: 35px;
}

.hero-facts {
  min-height: 70px;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1.25fr 0.8fr;
}

.hero-facts > div {
  min-width: 0;
  padding: 5px 22px;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-facts dt,
.metric-strip small,
.realm-factbar small,
.summary-strip small,
.info-panel dt,
.session-panel dt,
.admin-detail dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.hero-facts dd {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 650;
}

.hero-controls {
  padding: 0 26px;
}

.control-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.control-buttons form {
  margin: 0;
}

.metric-strip {
  grid-column: 1 / -1;
  min-height: 95px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.metric-strip > div {
  padding: 20px 30px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.metric-strip > div + div {
  border-left: 1px solid var(--border);
}

.metric-strip .icon {
  width: 32px;
  height: 32px;
}

.metric-strip span {
  display: flex;
  flex-direction: column;
}

.metric-strip strong {
  font-size: 17px;
  font-weight: 650;
}

.section-block {
  margin-top: 30px;
}

.section-block > h2,
.section-block > header {
  padding: 0 0 11px;
  border: 0;
  background: transparent;
}

.section-block:not(.table-card) {
  border: 0;
  background: transparent;
}

.section-block.table-card {
  overflow: hidden;
}

.section-block.table-card > header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.table-shell {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.table-shell.borderless {
  border: 0;
  border-radius: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  height: 58px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

th {
  height: 48px;
  color: #414651;
  background: #fbfbfc;
  font-size: 12px;
  font-weight: 650;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  transition: background 130ms ease;
}

tbody tr:hover,
tbody tr.is-selected {
  background: #faf9ff;
}

tbody tr.is-selected td:first-child {
  box-shadow: inset 3px 0 0 var(--violet);
}

tbody tr.needs-attention {
  background: #fff9f0;
}

.realm-link,
.file-name {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}

.realm-link strong {
  font-size: 14px;
}

.row-arrow {
  color: #1b1e25;
  font-size: 28px;
  font-weight: 300;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.status i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}

.status-green,
.text-green {
  color: var(--green);
}

.status-red,
.text-red {
  color: var(--red);
}

.status-amber {
  color: var(--amber);
}

.text-muted {
  color: var(--muted);
}

.copy-value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.copy-value .icon-button {
  width: 29px;
  height: 29px;
}

.copy-value .icon {
  width: 17px;
  height: 17px;
}

.realm-factbar {
  min-height: 80px;
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.realm-factbar > div {
  padding: 16px 23px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.realm-factbar > div + div {
  border-left: 1px solid var(--border);
}

.realm-factbar span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  font-weight: 600;
}

.realm-tabs {
  height: 54px;
  margin-bottom: 25px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.realm-tabs a {
  height: 54px;
  padding: 0 17px;
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  color: #555a65;
  font-size: 14px;
}

.realm-tabs a.active {
  color: var(--violet-dark);
  border-bottom-color: var(--violet);
}

.file-layout {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  gap: 18px;
}

.directory-rail {
  min-height: 540px;
  padding: 18px 10px;
}

.directory-rail h2 {
  padding: 0 10px 14px;
  font-size: 15px;
}

.directory-rail > a {
  min-height: 43px;
  padding: 0 12px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #3f4450;
}

.directory-rail > a.active {
  color: var(--violet-dark);
  background: #f0edff;
  box-shadow: inset 0 0 0 1px #ddd5ff;
}

.directory-rail > p {
  margin: 24px 10px 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.directory-rail > p .icon {
  width: 16px;
  height: 16px;
}

.file-panel {
  min-width: 0;
  overflow: hidden;
}

.file-toolbar {
  min-height: 70px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.breadcrumbs {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  overflow: hidden;
  white-space: nowrap;
}

.breadcrumbs a {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breadcrumbs span {
  color: #a2a6ae;
}

.toolbar-actions {
  display: flex;
  gap: 10px;
}

.file-name .icon {
  color: #343943;
}

.file-name .protected-lock {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.row-actions .icon-button {
  width: 36px;
  height: 36px;
  border-color: var(--border);
}

.row-actions .icon {
  width: 18px;
  height: 18px;
}

.table-empty {
  height: 110px;
  color: var(--muted);
  text-align: center;
}

.console-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  align-items: start;
}

.console-panel {
  padding: 6px;
  overflow: hidden;
}

.console-panel > header {
  min-height: 54px;
  padding: 7px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.console-panel > header h2 {
  font-size: 15px;
}

.console-panel > header > div {
  color: var(--muted);
  font-size: 12px;
}

.console-panel pre {
  height: min(58vh, 610px);
  min-height: 360px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  color: #e9ecf1;
  background:
    radial-gradient(circle at 100% 0, rgb(109 74 255 / 7%), transparent 42%),
    #10141a;
  border: 1px solid #252b34;
  border-radius: 6px 6px 0 0;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.console-command {
  min-height: 52px;
  padding: 6px 8px 6px 15px;
  border: 1px solid #303744;
  border-top: 0;
  border-radius: 0 0 6px 6px;
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 8px;
  color: #d9dde4;
  background: #12171e;
}

.console-command input {
  width: 100%;
  border: 0;
  outline: 0;
  color: #eff1f5;
  background: transparent;
}

.console-command input::placeholder {
  color: #878d98;
}

.console-panel > footer {
  padding: 13px 10px 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.console-panel > footer .icon {
  width: 17px;
  height: 17px;
}

.session-panel {
  overflow: hidden;
}

.session-panel h2 {
  padding: 18px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}

.session-panel dl {
  padding: 0 16px 14px;
}

.session-panel dl > div,
.info-panel dl > div,
.admin-detail dl > div {
  min-height: 56px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.session-panel dl > div:last-child,
.info-panel dl > div:last-child,
.admin-detail dl > div:last-child {
  border-bottom: 0;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 20px;
  align-items: start;
}

.form-panel,
.info-panel {
  padding: 24px;
}

.form-panel > header {
  margin-bottom: 24px;
}

.form-panel > header p,
.info-panel > p {
  margin-top: 8px;
  color: var(--muted);
}

.stack-form {
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

label {
  color: #2f333c;
  font-size: 13px;
  font-weight: 650;
}

label > input,
label > select,
.dialog-form > label input,
.stack-form input,
.stack-form select {
  width: 100%;
  min-height: 45px;
  margin-top: 7px;
  padding: 0 13px;
  border: 1px solid #cfd2d9;
  border-radius: 7px;
  background: #fff;
  font-weight: 500;
}

.policy-note {
  margin-top: 18px !important;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12px;
}

.policy-note .icon {
  width: 17px;
  height: 17px;
  color: var(--violet);
}

.summary-strip {
  min-height: 82px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

.summary-strip > div {
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  column-gap: 10px;
}

.summary-strip > div + div {
  border-left: 1px solid var(--border);
}

.summary-icon {
  grid-row: 1 / -1;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: #f1f2f5;
}

.summary-icon .icon {
  width: 18px;
  height: 18px;
}

.summary-icon.violet {
  color: var(--violet);
  background: #f1edff;
}

.summary-icon.green {
  color: var(--green);
  background: #edf9f1;
}

.summary-icon.amber {
  color: var(--amber);
  background: #fff6e8;
}

.summary-icon.red {
  color: var(--red);
  background: #fff0f0;
}

.summary-strip strong {
  align-self: end;
  font-size: 19px;
}

.summary-strip small {
  align-self: start;
}

.admin-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
}

.admin-split.has-detail {
  grid-template-columns: minmax(680px, 1fr) 430px;
}

.admin-split > main {
  min-width: 0;
}

.admin-detail {
  position: sticky;
  top: calc(var(--topbar-height) + 18px);
  max-height: calc(100vh - var(--topbar-height) - 36px);
  padding: 0 0 22px;
  overflow-y: auto;
  border-left: 1px solid var(--border);
  background: #fbfcfd;
}

.admin-detail > header {
  padding: 0 14px 14px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.admin-detail > header > div {
  display: flex;
  gap: 12px;
}

.admin-detail > header h2 {
  margin-top: 2px;
  font-size: 17px;
}

.admin-detail > header p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.admin-detail section {
  margin: 0 14px 12px;
  padding: 14px;
}

.admin-detail h3 {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-detail h3 .icon {
  width: 17px;
  height: 17px;
}

.admin-detail dd {
  max-width: 250px;
  text-align: right;
  overflow-wrap: anywhere;
}

.reauth-inline {
  margin-top: 13px;
}

.reauth-inline label {
  display: block;
}

.reauth-inline input {
  width: 100%;
  height: 40px;
  margin: 6px 0 9px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.reauth-inline .button {
  width: 100%;
}

details {
  border-bottom: 1px solid var(--border);
}

details:last-child {
  border-bottom: 0;
}

details summary {
  padding: 12px 2px;
  cursor: pointer;
  font-weight: 600;
}

.json-view {
  max-height: 300px;
  margin: 0 0 12px;
  padding: 12px;
  overflow: auto;
  border-radius: 5px;
  color: #e9ecf1;
  background: #14181f;
  font-size: 10px;
  white-space: pre-wrap;
}

.admin-actions {
  border-color: #cfc4ff !important;
}

.admin-actions > a,
.admin-actions > form > button {
  width: 100%;
  min-height: 55px;
  padding: 9px;
  border: 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 26px 1fr 14px;
  align-items: center;
  gap: 8px;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.admin-actions > a:last-child,
.admin-actions > form:last-child > button {
  border-bottom: 0;
}

.admin-actions span {
  display: flex;
  flex-direction: column;
  font-weight: 600;
}

.admin-actions small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.notice,
.flash {
  min-height: 48px;
  margin-bottom: 18px;
  padding: 12px 15px;
  border: 1px solid #d5d8df;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 11px;
  background: #fff;
}

.notice p,
.flash span {
  flex: 1;
}

.notice.info,
.flash.info {
  color: #4d3bb7;
  border-color: #d8d1ff;
  background: #f7f5ff;
}

.notice.warning,
.flash.warning {
  color: #805000;
  border-color: #f2d5a5;
  background: #fff9ee;
}

.notice.error,
.flash.error {
  color: #9d2929;
  border-color: #f0c5c5;
  background: #fff6f6;
}

.flash.success {
  color: #116d3d;
  border-color: #bde3cc;
  background: #f2fbf5;
}

.flash .icon,
.notice .icon {
  width: 19px;
  height: 19px;
}

.flash .icon-button {
  margin-left: auto;
}

.empty-state {
  min-height: 430px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
}

.empty-state > .icon {
  width: 55px;
  height: 55px;
  margin-bottom: 20px;
  color: #aaa4c8;
}

.empty-state h1 {
  color: var(--text);
  font-size: 26px;
}

.empty-state p {
  margin-top: 8px;
}

.health-list {
  margin-top: 12px;
}

.health-list > div {
  min-height: 62px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 12px 1fr;
  column-gap: 10px;
  align-items: center;
}

.health-list > div:last-child {
  border-bottom: 0;
}

.health-list p {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
}

.health-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
}

.health-dot.ok {
  background: var(--green);
}

dialog {
  width: min(500px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 25px 70px rgb(21 23 28 / 22%);
}

dialog::backdrop {
  background: rgb(20 23 29 / 55%);
  backdrop-filter: blur(2px);
}

.dialog-form > header,
.editor-form > header {
  min-height: 64px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.dialog-form > label {
  margin: 20px;
  display: block;
}

.dialog-form > footer,
.editor-form > footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dropzone {
  min-height: 180px;
  border: 1px dashed #b8bdc7;
  border-radius: 8px;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
  cursor: pointer;
}

.dropzone .icon {
  width: 32px;
  height: 32px;
  color: var(--violet);
}

.dropzone strong {
  color: var(--text);
}

.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.editor-dialog {
  width: min(1100px, calc(100vw - 36px));
  max-width: none;
}

.editor-form > header > div {
  min-width: 0;
}

.editor-form > header h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-form > header p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.editor-form textarea {
  width: 100%;
  height: min(65vh, 700px);
  padding: 18px;
  resize: vertical;
  border: 0;
  outline: 0;
  color: #e9ecf1;
  background: #10141a;
  font: 12px/1.55 "SFMono-Regular", Consolas, monospace;
  tab-size: 2;
}

/* Login */
.login-body {
  background: #fff;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(460px, 42.2%) minmax(0, 1fr);
}

.login-brand {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: #fff;
  background:
    radial-gradient(circle at 50% 38%, rgb(85 92 106 / 22%), transparent 32%),
    linear-gradient(145deg, #11151b, #181c23 48%, #0f1319);
}

.brand-blueprint {
  position: absolute;
  inset: 6% 7% 17%;
  opacity: 0.75;
  background:
    linear-gradient(90deg, transparent 49.8%, #525965 50%, transparent 50.2%),
    linear-gradient(transparent 79.8%, #454c57 80%, transparent 80.2%),
    repeating-linear-gradient(90deg, transparent 0 70px, rgb(102 110 124 / 32%) 71px, transparent 72px),
    repeating-linear-gradient(0deg, transparent 0 79px, rgb(102 110 124 / 20%) 80px, transparent 81px);
  mask-image: linear-gradient(to bottom, transparent, #000 9%, #000 88%, transparent);
}

.arch {
  position: absolute;
  left: 50%;
  bottom: 16%;
  border: 1px solid #69717f;
  border-bottom: 0;
  border-radius: 220px 220px 0 0;
  transform: translateX(-50%);
}

.arch-one {
  width: 64%;
  height: 78%;
}

.arch-two {
  width: 40%;
  height: 59%;
}

.axis {
  position: absolute;
  top: 0;
  bottom: 3%;
  left: 50%;
  border-left: 1px dashed #565e6b;
}

.diamond {
  position: absolute;
  top: 11%;
  left: calc(50% - 6px);
  width: 12px;
  height: 12px;
  border: 2px solid #7b59ff;
  transform: rotate(45deg);
}

.login-logo {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-logo strong {
  font-size: clamp(56px, 6vw, 88px);
  line-height: 1;
  letter-spacing: 0.08em;
  text-shadow: 0 10px 35px rgb(0 0 0 / 36%);
}

.login-logo strong span {
  color: #7857ff;
}

.login-logo small {
  margin-top: 14px;
  color: #8b6aff;
  font-size: clamp(18px, 2vw, 28px);
  font-weight: 700;
  letter-spacing: 0.54em;
}

.mobile-note {
  position: absolute;
  left: 15%;
  bottom: 8%;
  display: flex;
  align-items: center;
  gap: 20px;
}

.mobile-note > .icon {
  width: 52px;
  height: 82px;
  color: #7d59ff;
}

.mobile-note strong {
  display: block;
  font-size: 17px;
}

.mobile-note p {
  margin: 4px 0 1px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.mobile-note p span {
  color: #8d6cff;
}

.mobile-note small {
  color: #d6d8de;
}

.login-form-wrap {
  min-height: 100vh;
  padding: 60px 9vw;
  display: flex;
  align-items: center;
  background: #fff;
}

.login-form {
  width: 100%;
  max-width: 610px;
}

.login-form > h1 {
  font-size: clamp(40px, 4vw, 56px);
}

.login-form > p {
  margin: 13px 0 37px;
  color: #515560;
  font-size: 20px;
}

.login-form form {
  display: flex;
  flex-direction: column;
  gap: 23px;
}

.input-icon {
  position: relative;
  margin-top: 8px;
}

.input-icon > .icon {
  position: absolute;
  top: 50%;
  left: 19px;
  width: 25px;
  height: 25px;
  color: #717683;
  transform: translateY(-50%);
}

.input-icon input {
  width: 100%;
  height: 69px;
  padding: 0 58px 0 60px;
  border: 1px solid #aeb3be;
  border-radius: 7px;
  font-size: 17px;
}

.reveal-button {
  position: absolute;
  top: 50%;
  right: 15px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  display: grid;
  place-items: center;
  color: #707582;
  background: transparent;
  transform: translateY(-50%);
  cursor: pointer;
}

.login-submit {
  height: 70px;
  margin-top: 2px;
  color: #fff;
  background: linear-gradient(90deg, #623cff, #744dfd);
  border: 0;
  font-size: 20px;
}

.login-player-note {
  min-height: 108px;
  margin-top: 35px;
  padding: 24px 17px;
  border-top: 1px solid #ccd0d7;
  border-bottom: 1px solid #ccd0d7;
  display: flex;
  align-items: center;
  gap: 24px;
}

.login-player-note .icon {
  width: 48px;
  height: 48px;
  color: var(--violet);
}

.login-player-note p {
  color: #555a66;
  font-size: 16px;
}

.login-help {
  margin: 31px 0 0 !important;
  color: #666b75 !important;
  font-size: 15px !important;
}

.error-body {
  display: grid;
  place-items: center;
  background: var(--canvas);
}

.error-page {
  width: min(520px, calc(100vw - 36px));
  padding: 50px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  text-align: center;
}

.error-mark {
  width: 60px;
  height: 60px;
  margin: 0 auto 18px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--red);
  background: #fff0f0;
}

.error-mark .icon {
  width: 30px;
  height: 30px;
}

.error-page > p {
  color: var(--muted);
}

.error-page h1 {
  margin: 8px 0 28px;
  font-size: 28px;
}

@media (max-width: 1260px) {
  .realm-hero {
    grid-template-columns: minmax(250px, 1fr) minmax(460px, 2.2fr);
  }

  .hero-controls {
    grid-column: 1 / -1;
    padding: 18px 26px;
    border-top: 1px solid var(--border);
  }

  .admin-split.has-detail {
    grid-template-columns: minmax(600px, 1fr) 390px;
  }

  .login-form-wrap {
    padding-inline: 7vw;
  }
}

@media (max-width: 1040px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-close {
    display: inline-grid;
    color: #fff;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgb(15 18 24 / 58%);
  }

  .sidebar-open .sidebar-backdrop {
    display: block;
  }

  .workspace {
    margin-left: 0;
  }

  .admin-split.has-detail {
    grid-template-columns: 1fr;
  }

  .admin-detail {
    position: static;
    max-height: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }

  .login-shell {
    grid-template-columns: 37% 1fr;
  }

  .mobile-note {
    display: none;
  }
}

@media (max-width: 820px) {
  .content {
    padding: 25px 18px 60px;
  }

  .realm-hero {
    grid-template-columns: 1fr;
  }

  .hero-facts {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 20px 20px;
  }

  .hero-facts > div {
    border-top: 1px solid var(--border);
  }

  .hero-facts > div:nth-child(odd) {
    border-left: 0;
  }

  .metric-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric-strip > div:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .metric-strip > div:nth-child(4) {
    border-top: 1px solid var(--border);
  }

  .realm-heading,
  .page-heading.inline {
    flex-direction: column;
  }

  .realm-heading-controls {
    width: 100%;
  }

  .control-buttons {
    justify-content: stretch;
  }

  .control-buttons form,
  .control-buttons .button {
    flex: 1;
    width: 100%;
  }

  .realm-factbar {
    grid-template-columns: repeat(2, 1fr);
  }

  .realm-factbar > div:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .realm-factbar > div:nth-child(4) {
    border-top: 1px solid var(--border);
  }

  .file-layout,
  .console-layout,
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .directory-rail {
    min-height: 0;
  }

  .directory-rail > a:not(.active),
  .directory-rail > p {
    display: none;
  }

  .file-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .summary-strip > div {
    border-bottom: 1px solid var(--border);
  }

  .summary-strip > div:nth-child(odd) {
    border-left: 0;
  }

  .summary-strip > div:last-child {
    grid-column: 1 / -1;
    border-bottom: 0;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: 210px;
  }

  .brand-blueprint {
    inset: 0 10%;
  }

  .login-logo strong {
    font-size: 46px;
  }

  .login-logo small {
    font-size: 14px;
  }

  .login-form-wrap {
    min-height: calc(100vh - 210px);
    padding: 42px 24px 60px;
    align-items: flex-start;
  }

  .login-form > h1 {
    font-size: 38px;
  }

  .login-form > p {
    margin-bottom: 28px;
    font-size: 17px;
  }
}

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

  .connection-state {
    font-size: 0;
  }

  .connection-state > span {
    margin-right: 0;
  }

  h1 {
    font-size: 28px;
  }

  .realm-identity {
    min-height: 125px;
    padding: 20px;
  }

  .realm-mark.large {
    width: 70px;
    height: 70px;
  }

  .realm-identity h2 {
    font-size: 22px;
  }

  .hero-facts {
    grid-template-columns: 1fr;
  }

  .hero-facts > div {
    border-left: 0;
  }

  .control-buttons {
    flex-direction: column;
  }

  .metric-strip {
    grid-template-columns: 1fr;
  }

  .metric-strip > div + div {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .realm-factbar {
    grid-template-columns: 1fr;
  }

  .realm-factbar > div + div {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .realm-tabs {
    overflow-x: auto;
  }

  .realm-tabs a {
    padding-inline: 13px;
    white-space: nowrap;
  }

  .toolbar-actions {
    width: 100%;
    flex-direction: column;
  }

  .toolbar-actions .button {
    width: 100%;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }

  .summary-strip > div,
  .summary-strip > div:last-child {
    grid-column: auto;
    border-left: 0;
    border-bottom: 1px solid var(--border);
  }

  .summary-strip > div:last-child {
    border-bottom: 0;
  }

  .page-heading.inline .button {
    width: 100%;
  }

  .input-icon input {
    height: 59px;
  }

  .login-submit {
    height: 60px;
  }

  .login-player-note {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
