:root {
  color-scheme: light;
  --ink: #142033;
  --muted: #647184;
  --line: #d9e1ea;
  --panel: #ffffff;
  --soft: #f2f6f9;
  --field: #fbfcfe;
  --accent: #1167b1;
  --accent-strong: #0b4c86;
  --green: #18885a;
  --gold: #b27311;
  --danger: #b42318;
  --navy: #13253d;
  --shadow: 0 24px 70px rgba(20, 32, 51, .16);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(17, 103, 177, .14), rgba(24, 136, 90, .08) 48%, rgba(178, 115, 17, .1)),
    #f6f8fb;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(20, 32, 51, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 32, 51, .04) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, #000, transparent 75%);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border-radius: 6px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 800;
}

button:disabled {
  cursor: not-allowed;
  opacity: .65;
}

.topbar,
.footer {
  position: relative;
  z-index: 1;
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

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

.clock,
.language-control {
  min-height: 46px;
  border: 1px solid rgba(217, 225, 234, .9);
  border-radius: 8px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 10px 28px rgba(20, 32, 51, .08);
}

.clock {
  min-width: 158px;
  padding: 7px 12px;
}

.clock span,
.clock small,
.language-control span {
  display: block;
}

.clock span {
  font-weight: 900;
  font-size: 17px;
}

.clock small,
.language-control span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.language-control {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 12px;
}

.language-control select {
  border: 0;
  color: var(--ink);
  background: transparent;
  font-weight: 900;
  outline: none;
}

.portal-shell {
  position: relative;
  z-index: 1;
  width: min(1220px, calc(100% - 32px));
  min-height: calc(100vh - 136px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(420px, 1.05fr);
  gap: 24px;
  align-items: stretch;
  padding-bottom: 24px;
}

.hero-panel,
.access-panel {
  border: 1px solid rgba(217, 225, 234, .95);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-panel {
  position: relative;
  min-height: 650px;
  display: flex;
  align-items: flex-end;
  background:
    linear-gradient(160deg, rgba(19, 37, 61, .92), rgba(17, 103, 177, .78)),
    var(--navy);
  color: #fff;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 25% 18%, rgba(255, 255, 255, .16), transparent 18%),
    linear-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .09) 1px, transparent 1px);
  background-size: auto, 58px 58px, 58px 58px;
}

.hero-grid::after {
  content: "";
  position: absolute;
  inset: 18% 10% auto auto;
  width: 58%;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
  box-shadow: inset 0 0 0 32px rgba(255, 255, 255, .035);
}

.hero-content {
  position: relative;
  padding: 42px;
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 18px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  color: rgba(255, 255, 255, .86);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

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

h1 {
  max-width: 11ch;
  margin-bottom: 18px;
  font-size: 56px;
  line-height: 1;
  letter-spacing: 0;
}

.hero-content > p:not(.eyebrow) {
  max-width: 42rem;
  margin-bottom: 28px;
  color: rgba(255, 255, 255, .78);
  line-height: 1.65;
}

.status-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.status-cards article {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  background: rgba(255, 255, 255, .1);
  backdrop-filter: blur(10px);
}

.status-cards strong,
.status-cards span {
  display: block;
  overflow-wrap: anywhere;
}

.status-cards strong {
  margin-bottom: 6px;
  font-size: 17px;
}

.status-cards span {
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
  font-weight: 800;
}

.access-panel {
  min-height: 650px;
  background: rgba(255, 255, 255, .94);
}

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: #f9fbfd;
}

.tab {
  appearance: none;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  min-height: 56px;
  padding: 0 20px;
  color: var(--muted);
}

.tab.is-active {
  background: #fff;
  color: var(--accent);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.view {
  display: none;
  padding: 32px;
}

.view.is-active {
  display: block;
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading.compact {
  margin-bottom: 0;
}

.section-heading h2 {
  margin-bottom: 8px;
  font-size: 28px;
  letter-spacing: 0;
}

.section-heading p {
  max-width: 46rem;
  color: var(--muted);
  line-height: 1.55;
}

.form {
  display: grid;
  gap: 16px;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 13px 14px;
  color: var(--ink);
  background: var(--field);
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(17, 103, 177, .14);
}

.primary {
  color: #fff;
  background: var(--accent);
}

.primary:hover {
  background: var(--accent-strong);
}

.secondary {
  color: var(--accent);
  background: #e9f3ff;
  border-color: #bad7f3;
}

.ghost {
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
}

.message {
  min-height: 24px;
  margin: 0 32px 26px;
  color: var(--muted);
  font-weight: 800;
}

.message.is-error {
  color: var(--danger);
}

.message.is-ok {
  color: var(--green);
}

.session-box {
  margin-top: 26px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.session-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.session-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(24, 136, 90, .13);
}

.session-head h2 {
  margin-bottom: 5px;
}

.session-head p {
  color: var(--muted);
}

.session-meta,
.metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 18px 0;
}

.session-meta div,
.metrics div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.session-meta span,
.metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.session-meta strong,
.metrics strong {
  display: block;
  margin-top: 5px;
}

.metrics {
  grid-template-columns: repeat(3, 1fr);
  margin: 18px 0 24px;
}

.metrics strong {
  font-size: 28px;
}

.check-row {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  margin: 18px 0;
  color: var(--ink);
}

.check-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.actions,
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.toolbar {
  justify-content: space-between;
}

.notice {
  margin: 16px 0 0;
  color: var(--gold);
  font-weight: 800;
}

.list {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.item,
.empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.item header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.item header span {
  align-self: flex-start;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--accent);
  background: #e9f3ff;
  font-size: 12px;
  font-weight: 900;
}

.item p {
  margin-bottom: 10px;
  color: var(--muted);
}

.item small {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
}

.logs {
  min-height: 180px;
  max-height: 300px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #111827;
  color: #d1fae5;
  font-size: 12px;
  white-space: pre-wrap;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 22px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 980px) {
  .portal-shell {
    grid-template-columns: 1fr;
  }

  .hero-panel,
  .access-panel {
    min-height: auto;
  }

  h1 {
    max-width: 16ch;
    font-size: 44px;
  }
}

@media (max-width: 640px) {
  .topbar,
  .portal-shell,
  .footer {
    width: min(100% - 18px, 1220px);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 0;
  }

  .topbar-tools {
    width: 100%;
    justify-content: stretch;
  }

  .clock,
  .language-control {
    flex: 1;
  }

  .portal-shell {
    gap: 12px;
    min-height: auto;
    padding-bottom: 12px;
  }

  .hero-content,
  .view {
    padding: 22px;
  }

  h1 {
    font-size: 36px;
  }

  .status-cards,
  .metrics,
  .session-meta {
    grid-template-columns: 1fr;
  }

  .tabs {
    overflow-x: auto;
  }

  .tab {
    flex: 1 0 auto;
    min-width: 110px;
  }

  .message {
    margin: 0 22px 22px;
  }

  .footer {
    flex-direction: column;
  }
}
