:root {
  --bg: #f4f1e8;
  --panel: #fffdf8;
  --panel-soft: #f8f4eb;
  --ink: #213124;
  --muted: #5d695d;
  --line: #ddd5c4;
  --line-strong: #cfc6b2;
  --accent: #4f6f4e;
  --accent-soft: #deead8;
  --warm: #8b673e;
  --shadow: 0 16px 36px rgba(24, 35, 28, 0.07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(143, 176, 124, 0.16), transparent 24%),
    linear-gradient(180deg, #eeece4 0, #eeece4 104px, var(--bg) 104px, var(--bg) 100%);
  font-family: "Segoe UI Variable", "Aptos", system-ui, sans-serif;
}

.page {
  width: min(1120px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.page-narrow {
  width: min(880px, calc(100vw - 48px));
}

a {
  color: inherit;
}

.portal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 4px 14px rgba(23, 34, 27, 0.04);
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-kicker {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-title {
  color: var(--accent);
  text-decoration: none;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-weight: 700;
  font-size: 1.2rem;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.94rem;
}

.portal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.portal-nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 8px 13px;
  border-radius: 999px;
  background: #fafbf9;
  border: 1px solid var(--line);
  font-size: 0.95rem;
}

.portal-nav a.active {
  color: #fffefb;
  background: var(--accent);
  border-color: transparent;
}

.hero,
.layout,
.panel,
.portal-footer {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 24px;
  margin-bottom: 22px;
  padding: 32px;
  overflow: hidden;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--accent), #35553a);
}

.hero-compact {
  grid-template-columns: 1fr;
}

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

h1,
h2 {
  margin: 0;
}

h1 {
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: clamp(30px, 4.2vw, 46px);
  line-height: 1.08;
  margin-bottom: 12px;
}

.lead {
  margin: 0;
  max-width: 64ch;
  color: var(--muted);
  line-height: 1.72;
}

.meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #d8e2da;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
}

.example-row,
.quick-links,
.cross-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.example-row {
  margin-top: 18px;
}

.hero-note {
  padding: 22px;
  border-radius: 18px;
  border: 1px solid #e5ebdf;
  background: #f8faf6;
}

.hero-note h2 {
  margin-bottom: 10px;
  font-size: 18px;
}

.hero-note ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.quick-links {
  margin-top: 18px;
}

.ghost-link {
  appearance: none;
  border: 1px solid #dbe5dd;
  border-radius: 999px;
  padding: 9px 12px;
  background: #ffffff;
  color: var(--accent);
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 22px;
  overflow: hidden;
}

.panel {
  padding: 24px;
}

.layout .panel {
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
}

.layout .panel + .panel {
  border-left: 1px solid var(--line);
}

.panel-head {
  margin-bottom: 18px;
}

.panel-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.input-note,
.validation-note,
.result-disclaimer {
  color: var(--muted);
}

.validation-note {
  margin: 0;
  font-size: 0.92rem;
}

.result-disclaimer {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.94rem;
}

.prose-panel {
  line-height: 1.82;
}

.prose-panel h2 {
  margin: 0 0 10px;
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: 1.22rem;
}

.prose-panel h2:not(:first-child) {
  margin-top: 24px;
}

.clean-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.clean-list.ordered {
  list-style: decimal;
}

.clean-list li + li {
  margin-top: 6px;
}

.field,
.file-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.field span,
.file-field span {
  font-size: 14px;
  color: var(--muted);
}

input[type="text"],
textarea,
input[type="file"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: #fbfcfa;
  color: var(--ink);
  font: inherit;
}

input[type="text"]:focus,
textarea:focus {
  outline: 0;
  border-color: #7f9b89;
  box-shadow: 0 0 0 3px rgba(35, 79, 59, 0.08);
}

textarea {
  resize: vertical;
  min-height: 160px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

button {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  transition: transform 120ms ease, opacity 120ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

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

.ghost {
  background: #f3f7f4;
  border: 1px solid #d9e4dc;
  color: var(--accent);
}

.single-result.empty {
  color: var(--muted);
}

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

.stat {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #dfe7e0;
  background: #f8fbf9;
}

.stat-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
}

.summary-card,
.advanced-details {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid #dfe6e0;
  border-radius: 18px;
  background: #fbfcfb;
}

.summary-title {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 700;
}

.summary-body {
  margin: 0;
  line-height: 1.75;
}

.summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.advanced-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--accent);
}

.advanced-body {
  margin-top: 12px;
  display: grid;
  gap: 10px;
  color: var(--muted);
}

.advanced-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.advanced-tile {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
}

.advanced-tile strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

.table-wrap {
  overflow: auto;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

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

th {
  position: sticky;
  top: 0;
  background: #f5f8f6;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.tag {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f4ede5;
  color: var(--warm);
  font-size: 12px;
  font-weight: 700;
}

.cross-links {
  margin-top: 16px;
}

.portal-footer {
  display: grid;
  gap: 12px;
  padding: 18px 22px;
  margin: 20px auto 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.footer-item {
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-item strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

.footer-disclaimer {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 980px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }

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

  .layout .panel + .panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

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

@media (max-width: 640px) {
  .page,
  .page-narrow {
    width: min(100vw - 24px, 100%);
    padding-top: 20px;
  }

  .hero,
  .panel {
    padding: 20px;
  }

  .single-card {
    grid-template-columns: 1fr;
  }
}
