:root {
  --bg: #f4efe7;
  --panel: rgba(255, 252, 246, 0.94);
  --line: #e0d3bf;
  --text: #1f2430;
  --muted: #69717f;
  --accent: #1f6d42;
  --accent-soft: #d8f0e2;
  --secondary: #b8862b;
  --danger: #9b1c1c;
  --danger-soft: #fde8e8;
  --shadow: 0 20px 50px rgba(30, 36, 48, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(212, 166, 47, 0.18), transparent 22%),
    radial-gradient(circle at bottom right, rgba(31, 109, 66, 0.12), transparent 24%),
    var(--bg);
}

.portal-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 20px 56px;
}

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

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

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1f6d42, #d4a62f);
  box-shadow: var(--shadow);
}

.masthead-link {
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
  margin-bottom: 18px;
}

.hero-copy,
.panel,
.status-banner {
  border: 1px solid rgba(224, 211, 191, 0.8);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-copy,
.panel {
  padding: 24px;
}

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

h1,
h2,
h3,
h4 {
  margin: 0;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.04;
  max-width: 12ch;
}

.hero-text {
  color: var(--muted);
  margin-top: 14px;
  max-width: 48ch;
  line-height: 1.6;
}

.status-banner {
  padding: 22px;
  display: flex;
  align-items: center;
  color: #14532d;
  background: var(--accent-soft);
}

.portal-grid,
.content-grid,
.detail-grid,
.insight-strip {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.insight-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.portal-grid {
  grid-template-columns: repeat(2, minmax(280px, 1fr));
}

.content-grid {
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
}

.detail-grid {
  grid-template-columns: repeat(2, minmax(280px, 1fr));
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.form-block,
.actions,
.list {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

input,
textarea,
button {
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 12px 14px;
  font: inherit;
}

input,
textarea {
  background: #fff;
  color: var(--text);
}

button {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  cursor: pointer;
}

button.ghost {
  background: transparent;
  color: var(--text);
}

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

.token-box {
  margin-top: 18px;
}

.token-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.code-block {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  background: #18202d;
  color: #d8f0e2;
  border-radius: 18px;
  padding: 16px;
  min-height: 110px;
}

.insight-card,
.list-item,
.client-card,
.detail-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: #fff;
}

.insight-card {
  display: grid;
  gap: 8px;
  box-shadow: var(--shadow);
}

.insight-label {
  color: var(--muted);
  font-size: 0.86rem;
}

.insight-card strong {
  font-size: 1.25rem;
}

.list-item.clickable {
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease;
}

.list-item.clickable:hover {
  transform: translateY(-1px);
  border-color: #ccb793;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f2eadc;
  color: var(--text);
  font-size: 0.82rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

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

.summary-item span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  margin-bottom: 6px;
}

.summary-text {
  line-height: 1.7;
  color: #394150;
}

.doc-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.section-stack {
  display: grid;
  gap: 18px;
}

.section-block h3 {
  margin-bottom: 10px;
}

.empty-state {
  color: var(--muted);
  padding: 24px 0;
}

@media (max-width: 960px) {
  .hero,
  .portal-grid,
  .content-grid,
  .detail-grid,
  .insight-strip {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    max-width: none;
  }

  .masthead {
    flex-direction: column;
    align-items: flex-start;
  }

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

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