:root {
  color-scheme: light;
  --ink: #1c1915;
  --muted: #5e564c;
  --paper: #f3ecdf;
  --panel: #fffaf3;
  --line: #d9cbb8;
  --green: #1f4d3a;
  --copper: #8c4a32;
  --focus: #1f4d3a;
  --display: "Iowan Old Style", Palatino, "Palatino Linotype", "Noto Naskh Arabic", serif;
  --text: "Avenir Next", "Segoe UI", "Noto Naskh Arabic", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 0 0, rgba(140, 74, 50, 0.08), transparent 28rem),
    var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.05rem;
  line-height: 1.55;
}

body { padding: 1.25rem; }

.skip {
  position: absolute;
  inset-inline-start: 1rem;
  top: -4rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 0.8rem;
}

.skip:focus { top: 1rem; }

.mast {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
}

.wordmark {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1.1;
  max-width: 16ch;
}

.mast-tools { display: flex; gap: 0.75rem; align-items: center; }

.product {
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--muted);
}

button, a {
  font: inherit;
}

button {
  background: transparent;
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
}

button[aria-pressed="true"] {
  background: var(--green);
  color: #f6f1e7;
}

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }

.frame {
  display: grid;
  grid-template-columns: minmax(12rem, 16rem) 1fr;
  gap: 1.5rem;
  align-items: start;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: sticky;
  top: 1rem;
}

nav a {
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 1px solid transparent;
}

nav a[aria-current="page"] {
  color: var(--copper);
  border-bottom-color: var(--copper);
}

main {
  background: var(--panel);
  border: 1px solid var(--line);
  min-height: 70vh;
  padding: clamp(1.2rem, 3vw, 2.5rem);
}

.kicker {
  margin: 0;
  color: var(--copper);
  font-size: 0.85rem;
}

h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1.05;
  margin: 0.2rem 0 1rem;
}

.state-switch { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }

.panel {
  margin: 0;
  max-width: 42rem;
  font-size: 1.15rem;
}

textarea, #support-diagnostic, #audit-export, #usage-view, #usage-cancellation, #usage-refund, #usage-plan-quote, #usage-promotion, #usage-downgrade, #usage-yearly, #usage-yearly-promo, #usage-yearly-upgrade, #usage-yearly-upgrade-promo, #usage-yearly-refund, #usage-yearly-promo-refund, #usage-license, #usage-diagnostics, #usage-rollback, #usage-first-run, #usage-recovery, #data-request, #trust-record, #approval-queue, #graph-fact, #outcome-ledger, #simulation-run, #outcome-contract, #worker-passport, #workforce-roster, #skill-record, #integration-slot, #cost-ledger, #routine-schedule, #workspace-overview, #analytics-measurement, #connected-identities, #team-membership, #workspace-settings, #portal-entitlements, #portal-presentment, #portal-overage, #portal-cancellation, #portal-refund, #portal-plan-quote, #portal-promotion, #portal-downgrade, #portal-yearly, #portal-yearly-promo, #portal-yearly-upgrade, #portal-yearly-upgrade-promo, #portal-yearly-refund, #portal-yearly-promo-refund, #portal-license, #portal-diagnostics, #portal-rollback, #portal-first-run, #portal-recovery, #portal-reconciliation, #portal-support {
  display: block;
  width: min(100%, 42rem);
  margin-top: 0.8rem;
}

textarea {
  min-height: 8rem;
  font: inherit;
  color: inherit;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 0.7rem;
}

#support-diagnostic dl, #audit-export dl, #usage-view dl, #data-request dl, #trust-record dl, #approval-queue dl, #graph-fact dl, #outcome-ledger dl, #simulation-run dl, #outcome-contract dl, #worker-passport dl, #workforce-roster dl, #skill-record dl, #integration-slot dl, #cost-ledger dl, #routine-schedule dl, #workspace-overview dl, #analytics-measurement dl, #connected-identities dl, #team-membership dl, #workspace-settings dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1rem;
  margin: 0.8rem 0;
}

main[data-state="loading"] .panel { color: var(--muted); }
main[data-state="error"] .panel { color: var(--copper); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

@media (max-width: 800px) {
  .frame { grid-template-columns: 1fr; }
  nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    gap: 0.8rem;
  }
  nav a { white-space: nowrap; }
}
