:root {
  --bg: #eef3f9;
  --surface: #ffffff;
  --surface-alt: #f7f9fc;
  --line: #d7e0ea;
  --text: #162031;
  --muted: #627287;
  --accent: #1d4ed8;
  --accent-soft: #e8efff;
  --accent-strong: #163cae;
  --header-bg: #0f172a;
  --header-text: #f8fafc;
  --success: #15803d;
  --warning: #c47f00;
  --danger: #c12f45;
  --shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
  --radius: 18px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

body[data-site="autocode"] {
  --accent: #0f766e;
  --accent-soft: #def7f3;
  --accent-strong: #0b5f59;
}

body[data-site="audatex"] {
  --accent: #7c3aed;
  --accent-soft: #efe6ff;
  --accent-strong: #6128c7;
}

body[data-site="calculator"] {
  --accent: #c2410c;
  --accent-soft: #fff0e8;
  --accent-strong: #9a3404;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.9), transparent 30%),
    linear-gradient(180deg, #dde7f7 0%, var(--bg) 240px);
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page {
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 18px 24px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--header-bg), #172554);
  color: var(--header-text);
  border-color: rgba(255, 255, 255, 0.06);
}

.topbar-brand {
  display: flex;
  gap: 16px;
  align-items: center;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
}

.brand-subtitle {
  margin-top: 4px;
  color: rgba(248, 250, 252, 0.76);
  font-size: 14px;
}

.topbar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.system-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.system-pill.online::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: #4ade80;
}

.hero {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.85fr);
  align-items: stretch;
}

.hero-main {
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.96)),
    var(--surface);
}

.hero-side {
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 253, 1)),
    var(--surface);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

.hero-heading {
  display: grid;
  gap: 16px;
}

.hero h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1.12;
}

.hero p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
  max-width: 840px;
}

.hero-badges,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.tag.neutral {
  background: #eef2f7;
  color: #334155;
}

.tag.success {
  background: #e8f7ef;
  color: var(--success);
}

.tag.warning {
  background: #fff4db;
  color: var(--warning);
}

.tag.danger {
  background: #fdebed;
  color: var(--danger);
}

.system-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.system-tab {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
}

.summary-strip {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 22px;
}

.metric-card {
  display: grid;
  gap: 6px;
  padding: 18px;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--surface), var(--surface-alt));
  border: 1px solid var(--line);
}

.metric-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.metric-value {
  font-size: 24px;
  line-height: 1.2;
}

.metric-foot {
  color: var(--muted);
  font-size: 13px;
}

.portal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.portal-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 15px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 700;
  color: #334155;
}

.portal-link.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: rgba(29, 78, 216, 0.18);
}

.selector {
  display: grid;
  gap: 10px;
}

.selector label,
.section-title {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 16px;
  background: var(--surface);
  color: var(--text);
}

.side-note {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 16px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: #24344e;
}

.side-note strong {
  font-size: 14px;
}

.side-note span {
  font-size: 14px;
  line-height: 1.55;
  color: #3d4d66;
}

.case-meta {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.content-grid {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.content-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  padding: 22px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.card h2 {
  margin: 4px 0 0;
  font-size: 22px;
}

.section-kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.stats-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, var(--surface-alt));
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.stat-value {
  display: block;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.25;
}

.mono {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 16px;
}

.detail-grid {
  display: grid;
  gap: 14px;
}

.detail-row {
  display: grid;
  gap: 6px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.detail-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.detail-label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.detail-value {
  font-weight: 600;
  line-height: 1.55;
}

.list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.compact-list {
  margin-top: 16px;
}

.list-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, var(--surface-alt));
}

.item-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.item-title {
  margin: 0;
  font-size: 16px;
}

.item-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.item-meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.timeline-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.empty-state {
  padding: 18px;
  border-radius: 14px;
  background: #eef7f1;
  color: var(--success);
  border: 1px solid #d3eadb;
  line-height: 1.5;
}

table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

td {
  font-size: 15px;
}

.hint {
  margin-top: 14px;
  padding: 16px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: #1e3a8a;
  line-height: 1.6;
}

.hint.success {
  background: #e8f7ef;
  color: #166534;
}

.hint.warning {
  background: #fff4db;
  color: #9a6700;
}

.hint.danger {
  background: #fdebed;
  color: #9f1239;
}

.footer-note {
  margin-top: 20px;
  color: var(--muted);
  font-size: 14px;
}

code {
  font-family: "Consolas", "Courier New", monospace;
}

@media (max-width: 1100px) {
  .hero,
  .content-grid.two-col,
  .summary-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .page {
    padding: 16px;
  }

  .topbar,
  .card,
  .hero-main,
  .hero-side {
    padding: 18px;
  }

  .topbar,
  .card-head,
  .item-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero h1 {
    font-size: 30px;
  }
}
