:root {
  --page: #f4f5f6;
  --surface: #ffffff;
  --surface-strong: #172128;
  --surface-soft: #f9fafb;
  --text: #172128;
  --muted: #66727b;
  --line: #dfe3e6;
  --line-strong: #cbd1d5;
  --orange: #f04b18;
  --orange-soft: #fff0ea;
  --green: #16734a;
  --green-soft: #e9f5ef;
  --blue-gray: #526b7a;
  --blue-gray-soft: #edf2f5;
  --red: #a83a3a;
  --red-soft: #faeded;
  --shadow: 0 8px 24px rgba(23, 33, 40, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  scroll-padding-top: 132px;
  color: var(--text);
  background: var(--page);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

body {
  margin: 0;
  overflow-x: hidden;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 9px 12px;
  color: #fff;
  background: var(--surface-strong);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px max(24px, calc((100vw - 1320px) / 2));
  color: var(--text);
  background: #fff;
  border-bottom: 3px solid var(--orange);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  text-decoration: none;
}

.brand img { display: block; width: clamp(230px, 25vw, 350px); height: 58px; object-fit: contain; object-position: left center; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.admin-entry { min-height: 40px; display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 4px; padding: 8px 12px; color: var(--text); background: #fff; font-size: .86rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.admin-entry:hover { border-color: var(--orange); color: #b9320b; }
.admin-entry:focus-visible, .brand:focus-visible { outline: 3px solid rgba(240, 75, 24, .28); outline-offset: 3px; }

.header-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.header-meta {
  max-width: 240px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.refresh-button {
  min-height: 38px;
  padding: 7px 12px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  cursor: pointer;
}

.refresh-button:hover,
.refresh-button:focus-visible {
  border-color: var(--orange);
  outline: none;
}

.refresh-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.section-nav {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px max(24px, calc((100vw - 1320px) / 2));
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
}

.section-nav a {
  padding: 8px 12px;
  color: #45515a;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.section-nav a:hover,
.section-nav a:focus-visible {
  color: var(--text);
  border-bottom-color: var(--orange);
  outline: none;
}

main {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
}

.overview-section,
.content-section {
  padding: 42px 0;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.overview-heading {
  align-items: flex-start;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--orange);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 7px;
  font-size: 2rem;
  line-height: 1.18;
}

h2 {
  margin-bottom: 0;
  font-size: 1.45rem;
  line-height: 1.25;
}

h3 {
  margin: 0;
  font-size: 1rem;
}

.lead,
.section-note {
  margin-bottom: 0;
  color: var(--muted);
}

.section-note {
  text-align: right;
}

.checked-at {
  min-width: 190px;
  display: grid;
  gap: 3px;
  text-align: right;
}

.checked-at span {
  color: var(--muted);
  font-size: 0.8rem;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
}

.server-overview,
.platform-statement,
.module-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.server-overview {
  display: grid;
  grid-template-columns: minmax(210px, 0.7fr) minmax(0, 1.3fr);
  align-items: stretch;
  min-height: 210px;
}

.server-state {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 28px;
  color: #fff;
  background: var(--surface-strong);
  border-radius: 5px 0 0 5px;
}

.server-state p {
  margin-bottom: 4px;
  color: #aeb8be;
}

.server-state strong {
  font-size: 1.45rem;
}

.state-indicator {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border: 4px solid #7d8990;
  border-radius: 50%;
}

.state-indicator.ready {
  border-color: #54c28a;
  background: var(--green);
}

.state-indicator.error {
  border-color: #dd8b8b;
  background: var(--red);
}

.server-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 18px 22px;
}

.server-facts div {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.server-facts div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.server-facts dt {
  color: var(--muted);
  font-size: 0.8rem;
}

.server-facts dd {
  min-width: 0;
  margin: 0;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.platform-statement {
  padding: 28px;
  border-top: 4px solid var(--orange);
}

.platform-statement h2 {
  max-width: 440px;
  margin-bottom: 12px;
}

.platform-statement > p:not(.eyebrow) {
  color: var(--muted);
}

.statement-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 20px;
}

.statement-tags span {
  padding: 5px 8px;
  color: var(--blue-gray);
  background: var(--blue-gray-soft);
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
}

.status-badge {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  padding: 4px 9px;
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-ready {
  color: var(--green);
  background: var(--green-soft);
}

.status-prepared,
.status-protected,
.status-loading {
  color: var(--blue-gray);
  background: var(--blue-gray-soft);
}

.status-inactive {
  color: #60686d;
  background: #eceeef;
}

.status-error {
  color: var(--red);
  background: var(--red-soft);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.module-card {
  min-height: 242px;
  display: flex;
  flex-direction: column;
  padding: 19px;
}

.module-card-accent {
  border-top: 3px solid var(--orange);
}

.module-card-head {
  min-height: 32px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 15px;
}

.module-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #354149;
}

.module-card li {
  position: relative;
  padding-left: 15px;
}

.module-card li::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: 0;
  width: 5px;
  height: 5px;
  background: var(--orange);
  border-radius: 50%;
}

.module-foot {
  margin: auto 0 0;
  padding-top: 16px;
  color: var(--muted);
  font-size: 0.82rem;
}

.operations-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.operation-item {
  min-height: 102px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 18px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.operation-item p {
  margin: 3px 0 0;
  color: var(--muted);
}

.operation-marker {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  background: #9ba5ab;
  border-radius: 50%;
}

.operation-marker.ready {
  background: var(--green);
}

.operation-marker.protected {
  background: var(--blue-gray);
}

.operation-marker.error {
  background: var(--red);
}

.protected-notice {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 16px;
  padding: 16px 18px;
  background: var(--blue-gray-soft);
  border-left: 3px solid var(--blue-gray);
}

.protected-notice strong {
  flex: 0 0 auto;
}

.protected-notice p {
  margin: 0;
  color: #4e616d;
}

.roadmap-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line-strong);
}

.roadmap-list li {
  min-height: 92px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 17px 8px;
  border-bottom: 1px solid var(--line);
}

.roadmap-list > li > span {
  color: var(--orange);
  font-weight: 800;
}

.roadmap-list p {
  margin: 3px 0 0;
  color: var(--muted);
}

.roadmap-list em {
  color: var(--blue-gray);
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 800;
}

.api-contracts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.api-contracts div {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 16px;
  background: var(--surface);
}

.api-contracts code {
  min-width: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.api-contracts span {
  color: var(--muted);
  text-align: right;
}

.api-note {
  margin: 14px 0 0;
  color: var(--muted);
}

footer {
  width: min(1320px, calc(100% - 48px));
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto;
  padding: 24px 0 34px;
  color: var(--muted);
  font-size: 0.82rem;
}

@media (max-width: 1080px) {
  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 820px) {
  html {
    scroll-padding-top: 172px;
  }

  .site-header {
    align-items: flex-start;
    padding: 14px 20px;
  }

  .header-actions { align-items: flex-end; flex-direction: column; }

  .header-status {
    flex-wrap: wrap;
  }

  .header-meta {
    display: none;
  }

  .section-nav {
    flex-wrap: wrap;
    padding: 6px 14px;
  }

  main,
  footer {
    width: min(100% - 32px, 1320px);
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .server-overview {
    grid-template-columns: 1fr;
  }

  .server-state {
    min-height: 118px;
    border-radius: 5px 5px 0 0;
  }

  .protected-notice {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}

@media (max-width: 600px) {
  .site-header {
    min-height: auto;
    flex-direction: column;
    gap: 12px;
  }

  .brand { width: 100%; }
  .brand img { width: min(100%, 300px); height: 64px; }

  .header-actions { width: 100%; align-items: stretch; gap: 8px; }

  .header-status {
    width: 100%;
    justify-content: space-between;
  }

  .admin-entry { justify-content: center; }

  .section-nav {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-nav a {
    padding: 7px 8px;
  }

  .overview-section,
  .content-section {
    padding: 30px 0;
  }

  .section-heading,
  .overview-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .checked-at {
    min-width: 0;
    text-align: left;
  }

  h1 {
    font-size: 1.65rem;
  }

  .module-grid,
  .operations-grid,
  .api-contracts {
    grid-template-columns: 1fr;
  }

  .module-card {
    min-height: 225px;
  }

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

  .server-facts div,
  .server-facts div:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .server-facts div:last-child {
    border-bottom: 0;
  }

  .roadmap-list li {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .roadmap-list em {
    grid-column: 2;
  }

  .api-contracts div {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .api-contracts span {
    text-align: left;
  }

  footer {
    flex-direction: column;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
