:root {
  --bg: #f6f6f6;
  --surface: #ffffff;
  --surface-subtle: #fafafa;
  --border: #d8dada;
  --text: #1b1d1f;
  --muted: #6f7171;
  --brand: #ee0000;
  --brand-hover: #cc0000;
  --success-bg: #dcfce7;
  --success-text: #166534;
  --success-border: #86efac;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.portal-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 2px solid var(--brand);
}

.portal-header-inner {
  width: min(1180px, calc(100vw - 40px));
  margin: 0 auto;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
}

.portal-logo {
  width: 22px;
  height: 22px;
  display: block;
}

.portal-nav {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.portal-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.portal-nav a:hover {
  color: var(--text);
}

.shell {
  width: min(1180px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 40px 0 80px;
}

.hero {
  padding: 36px 40px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1, h2, h3 {
  letter-spacing: -0.015em;
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  max-width: 36ch;
  font-size: clamp(1.8rem, 3.2vw, 2.7rem);
  line-height: 1.15;
}

.hero p {
  max-width: 65ch;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 28px 0 42px;
}

.status-strip > div,
.service-card,
.modal-panel {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.status-strip > div {
  border-radius: 8px;
  padding: 18px;
}

.status-strip > div:hover {
  transform: translateY(-1px);
  border-color: #a7a7a7;
}

.metric-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.status-strip strong {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  color: var(--text);
}

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

.service-card {
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.service-card:hover {
  transform: translateY(-2px);
  border-color: #a7a7a7;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.runtime-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.runtime-pill {
  background: #f3f4f6;
  color: #333333;
  border: 1px solid var(--border);
}

.status-pill {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}

.service-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.service-card h3 {
  margin: 16px 0 10px;
  font-size: 1.35rem;
  line-height: 1.2;
  color: var(--text);
}

.service-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.94rem;
  flex-grow: 1;
}

.highlights {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.highlights li {
  padding: 10px 0;
  border-top: 1px solid #ebedef;
  font-size: 0.9rem;
  color: #4a4c4d;
}

.actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.primary-action,
.secondary-action,
.ghost-action,
.modal-close {
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.primary-action,
.secondary-action,
.ghost-action {
  padding: 11px 14px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  text-align: center;
}

.primary-action {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #ffffff;
}

.primary-action:hover {
  border-color: var(--brand-hover);
  background: var(--brand-hover);
}

.secondary-action {
  background: var(--surface);
  color: var(--brand);
  border: 1px solid var(--brand);
}

.secondary-action:hover {
  color: var(--brand-hover);
  border-color: var(--brand-hover);
  background: #fff5f5;
}

.ghost-action {
  background: var(--surface-subtle);
  color: var(--text);
  border: 1px solid var(--border);
}

.ghost-action:hover {
  background: #f0f2f4;
}

.modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8vh;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
}

.modal-panel {
  position: relative;
  width: min(760px, calc(100vw - 32px));
  border-radius: 10px;
  padding: 28px;
  border: 1px solid var(--border);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--muted);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.modal-close:hover {
  color: var(--text);
  background: #eff1f2;
}

.modal-copy {
  margin-top: 4px;
  color: var(--muted);
}

.prompt-box {
  width: 100%;
  min-height: 220px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--text);
  font-family: inherit;
  font-size: 0.94rem;
  line-height: 1.55;
  resize: vertical;
  outline: none;
}

.prompt-box:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(238, 0, 0, 0.15);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

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

@media (max-width: 860px) {
  .portal-header-inner,
  .shell {
    width: calc(100vw - 24px);
  }

  .portal-nav {
    display: none;
  }

  .hero {
    padding: 28px 22px;
  }

  .status-strip,
  .service-grid {
    grid-template-columns: 1fr;
  }
}
