:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #637083;
  --line: #d9e0ea;
  --brand: #425a1f;
  --brand-strong: #263613;
  --lime: #c8ff00;
  --blue: #2357a4;
  --teal: #127c71;
  --red: #a63d40;
  --amber: #9a6a11;
  --shadow: 0 18px 50px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(200, 255, 0, 0.12), transparent 34%),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--brand-strong);
  color: var(--lime);
  font-weight: 800;
}

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

.brand span {
  color: var(--muted);
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 0 12px;
}

.nav-item.active,
.nav-item:hover {
  border-color: var(--line);
  background: #f2f5f8;
  color: var(--ink);
}

.guide-panel {
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.guide-panel h2 {
  margin: 8px 0 0;
  font-size: 18px;
  letter-spacing: 0;
}

.guide-panel p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.main-panel {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.topbar h1 {
  margin: 4px 0 0;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: 0;
}

.eyebrow {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-pill,
.state-badge,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--teal);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero-panel,
.panel-card,
.result-card,
.support-box,
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 26px;
  padding: 28px;
  overflow: hidden;
}

.hero-panel h2 {
  margin: 8px 0 12px;
  max-width: 660px;
  font-size: 34px;
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-panel p,
.panel-card p,
.helper-text,
.result-card p,
.support-box p {
  color: var(--muted);
  line-height: 1.6;
}

.hero-flow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-content: center;
}

.hero-flow span {
  min-height: 70px;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  background: #f8fafc;
  font-weight: 800;
}

.metric-grid,
.content-grid,
.recon-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

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

.metric-card,
.panel-card {
  padding: 18px;
}

.metric-card {
  border-radius: 8px;
  background: var(--brand-strong);
  color: #fff;
}

.metric-card:nth-child(2) {
  background: var(--blue);
}

.metric-card:nth-child(3) {
  background: var(--teal);
}

.metric-value,
.metric-label {
  display: block;
}

.metric-value {
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

.metric-label {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.82);
}

.panel-card h3,
.flow-card h3,
.support-box h3 {
  margin: 0 0 10px;
  font-size: 17px;
}

.flow-section {
  margin-top: 16px;
}

.section-heading.compact {
  margin-bottom: 12px;
}

.section-heading.compact h2 {
  font-size: 22px;
}

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

.flow-card {
  min-height: 160px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 18px;
}

.flow-card span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: rgba(200, 255, 0, 0.45);
  color: var(--brand-strong);
  font-weight: 900;
  margin-bottom: 14px;
}

.flow-card p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.check-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.section-heading h2 {
  margin: 4px 0 0;
  font-size: 26px;
  letter-spacing: 0;
}

.primary-button {
  min-height: 40px;
  border: 1px solid var(--brand-strong);
  border-radius: 8px;
  background: var(--brand-strong);
  color: #fff;
  padding: 0 16px;
  font-weight: 800;
}

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

.secondary-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  font-weight: 800;
}

.secondary-button:hover {
  background: #f2f5f8;
}

.action-row {
  display: flex;
  justify-content: flex-end;
  margin: 12px 0;
}

.status-output {
  display: block;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--brand-strong);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.helper-text {
  max-width: 760px;
  margin: 0 0 16px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 14px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f1f4f7;
  color: var(--ink);
  font-size: 13px;
}

td {
  color: var(--muted);
  line-height: 1.45;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

.result-card {
  min-height: 190px;
  padding: 18px;
}

.compact-result {
  min-height: 118px;
  margin-bottom: 16px;
}

.empty-state {
  display: grid;
  min-height: 150px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

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

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

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

.result-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.result-item strong {
  overflow-wrap: anywhere;
}

.event-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.event-item {
  display: grid;
  grid-template-columns: minmax(190px, 0.9fr) minmax(260px, 1.4fr) auto;
  align-items: start;
  gap: 16px;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}

.event-item strong {
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.event-item code,
.support-box code {
  display: block;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: var(--brand-strong);
}

.api-response code {
  display: block;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #23324d;
  white-space: pre-wrap;
  overflow-x: auto;
}

.support-box {
  margin-top: 16px;
  padding: 18px;
}

.state-badge {
  color: var(--ink);
}

.state-badge.good {
  border-color: rgba(18, 124, 113, 0.35);
  background: rgba(18, 124, 113, 0.08);
  color: var(--teal);
}

.state-badge.warn {
  border-color: rgba(154, 106, 17, 0.35);
  background: rgba(154, 106, 17, 0.1);
  color: var(--amber);
}

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

  .sidebar {
    position: static;
  }

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

  .hero-panel,
  .metric-grid,
  .content-grid,
  .recon-grid,
  .form-grid,
  .result-grid,
  .event-item,
  .flow-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}
