:root {
  --ink: #17201c;
  --muted: #607067;
  --paper: #f5f2ea;
  --panel: #fffdf8;
  --line: rgba(23, 32, 28, 0.14);
  --green: #23624f;
  --teal: #4c8373;
  --gold: #bf8a2d;
  --red: #ba5245;
  --blue: #3f647f;
  --shadow: 0 20px 64px rgba(23, 32, 28, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

a {
  color: inherit;
}

button {
  font: inherit;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid var(--line);
  background: rgba(245, 242, 234, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  font-size: 12px;
  font-weight: 950;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

nav {
  display: flex;
  gap: 28px;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

nav a {
  text-decoration: none;
}

.header-action,
.chip,
.primary-action {
  min-height: 42px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 9px 15px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-weight: 900;
}

.hero {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(280px, 420px);
  gap: clamp(30px, 6vw, 90px);
  align-items: end;
  padding: clamp(56px, 8vw, 96px) clamp(18px, 5vw, 72px);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--red);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 1000px;
  margin-bottom: 22px;
  font-size: clamp(48px, 7vw, 92px);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1;
  letter-spacing: 0;
}

.hero p,
.report-section p,
.detail-panel p,
.grant-card p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.health-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.health-card span,
.metric-grid span,
.grant-meta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.health-card strong {
  display: block;
  margin: 20px 0 8px;
  color: var(--green);
  font-size: 76px;
  line-height: 1;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.metric-grid article {
  min-height: 126px;
  padding: 28px clamp(18px, 3vw, 42px);
  border-right: 1px solid var(--line);
}

.metric-grid article:last-child {
  border-right: 0;
}

.metric-grid strong {
  display: block;
  margin-top: 9px;
  font-size: clamp(30px, 4vw, 46px);
}

.section {
  padding: clamp(68px, 9vw, 118px) clamp(18px, 5vw, 72px);
}

.workspace {
  background: #e8eee8;
}

.data-stream-section {
  background: #eef2ee;
  border-bottom: 1px solid var(--line);
}

.section-heading p,
.strategy-section p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.stream-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.stream-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.stream-card strong {
  display: block;
  margin: 14px 0 8px;
  color: var(--green);
  font-size: 54px;
  line-height: 1;
}

.stream-card p,
.stream-item p,
.milestone-item p,
.imperative-card p {
  color: var(--muted);
  line-height: 1.58;
}

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

.sync-console {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 0.85fr);
  gap: 14px;
  margin-top: 28px;
}

.sync-console > div,
.mapping-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: var(--panel);
}

.sync-steps {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.sync-steps li {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  background: #fbfaf5;
}

.sync-steps li span {
  border-radius: 999px;
  padding: 5px 7px;
  text-align: center;
  color: #fff;
  background: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.sync-steps li.active {
  border-color: var(--blue);
  color: var(--ink);
}

.sync-steps li.active span {
  background: var(--blue);
}

.sync-steps li.complete span {
  background: var(--green);
}

.empty-state {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

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

.exception-item + .exception-item {
  margin-top: 8px;
}

.exception-item h3 {
  margin: 10px 0 6px;
  font-size: 18px;
}

.exception-item p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.48;
}

.mapping-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.45fr) minmax(320px, 1fr);
  gap: 20px;
  margin-top: 14px;
}

.mapping-panel h3 {
  margin-bottom: 0;
  font-size: 24px;
}

.mapping-table {
  display: grid;
  gap: 8px;
}

.mapping-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.7fr) minmax(180px, 1fr) minmax(120px, 0.7fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfaf5;
}

.mapping-row span,
.mapping-row em,
.confidence span,
.board-packet span {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.confidence {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.confidence strong {
  color: var(--green);
  font-size: 26px;
}

.stream-item,
.milestone-item,
.imperative-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.stream-item {
  min-height: 250px;
  padding: 20px;
}

.stream-item h3 {
  margin-bottom: 10px;
  font-size: 22px;
}

.milestone-section {
  display: grid;
  grid-template-columns: minmax(260px, 0.65fr) minmax(320px, 1.35fr);
  gap: clamp(28px, 6vw, 80px);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.milestone-list {
  display: grid;
  gap: 12px;
}

.milestone-item {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 0.42fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
}

.milestone-item h3 {
  margin-bottom: 6px;
  font-size: 22px;
}

.milestone-progress {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.strategy-section {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(320px, 1.25fr);
  gap: clamp(28px, 6vw, 80px);
  background: #e8eee8;
}

.imperative-grid {
  display: grid;
  gap: 12px;
}

.imperative-card {
  padding: 22px;
}

.imperative-card h3 {
  margin-bottom: 16px;
  font-size: 24px;
}

.section-heading,
.report-section {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(320px, 1.15fr);
  gap: clamp(28px, 6vw, 80px);
  align-items: start;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.chip.active {
  color: #fff;
  background: var(--ink);
}

.grant-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 0.8fr);
  gap: 18px;
  margin-top: 34px;
}

.grant-list {
  display: grid;
  gap: 12px;
}

.grant-card,
.detail-panel,
.deadline-item,
.report-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.grant-card {
  padding: 20px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.grant-card:hover,
.grant-card.active {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(23, 32, 28, 0.11);
}

.grant-card.active {
  outline: 2px solid var(--green);
}

.grant-card h3,
.detail-panel h3 {
  margin-bottom: 8px;
  font-size: 24px;
}

.grant-meta,
.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
}

.pill {
  border-radius: 999px;
  padding: 6px 9px;
  color: #fff;
  background: var(--green);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.pill.warning {
  background: var(--gold);
}

.pill.risk {
  background: var(--red);
}

.pill.info {
  background: var(--blue);
}

.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5dfd2;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--green));
}

.detail-panel {
  position: sticky;
  top: 88px;
  padding: 24px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.detail-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfaf5;
}

.detail-grid span,
.deadline-date {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.detail-grid strong {
  display: block;
  margin-top: 6px;
}

.task-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 16px 0 0;
  list-style: none;
}

.task-list li {
  color: var(--muted);
}

.doc-task {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
  color: var(--ink);
  background: #fbfaf5;
  cursor: pointer;
  font: inherit;
}

.doc-task.active {
  border-color: var(--green);
  outline: 2px solid rgba(35, 98, 79, 0.16);
}

.doc-task strong {
  border-radius: 999px;
  padding: 5px 7px;
  color: #fff;
  background: var(--blue);
  font-size: 10px;
  text-transform: uppercase;
}

.doc-task.active strong {
  background: var(--green);
}

.document-panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fbfaf5;
}

.document-panel h4 {
  margin: 10px 0 8px;
  font-size: 22px;
}

.document-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.document-preview div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.document-preview span,
.approval-record span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.document-preview strong {
  display: block;
  margin-top: 5px;
}

.approval-walkthrough {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.5;
}

.signature-label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.signature-label input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  text-transform: none;
}

.approve-document {
  width: 100%;
}

.deadline-section {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(320px, 1.3fr);
  gap: clamp(28px, 6vw, 80px);
}

.deadline-list {
  display: grid;
  gap: 12px;
}

.deadline-item {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
}

.deadline-item h3 {
  margin-bottom: 4px;
  font-size: 20px;
}

.deadline-item p {
  margin: 0;
  color: var(--muted);
}

.report-section {
  background: var(--green);
  color: #fff;
}

.report-section .eyebrow {
  color: #f5c68e;
}

.report-section p {
  color: rgba(255, 255, 255, 0.76);
}

.report-card {
  padding: 28px;
  color: var(--ink);
}

.report-card ul {
  display: grid;
  gap: 12px;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.55;
}

.primary-action {
  margin-top: 18px;
  color: #fff;
  background: var(--green);
}

.primary-action:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.board-packet {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfaf5;
}

.board-packet p {
  margin-bottom: 0;
}

.approval-section {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(320px, 1.28fr);
  gap: clamp(28px, 6vw, 80px);
  background: var(--panel);
}

.approval-section p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.approval-ledger {
  display: grid;
  gap: 12px;
}

.approval-record {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 0.5fr);
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fbfaf5;
}

.approval-record h3 {
  margin: 6px 0 4px;
  font-size: 20px;
}

.approval-record p {
  margin: 4px 0 0;
  font-size: 14px;
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  padding: 24px clamp(18px, 5vw, 72px);
  color: var(--muted);
  background: var(--panel);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 36px));
  padding: 14px 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  nav {
    display: none;
  }

  .hero,
  .section-heading,
  .sync-console,
  .mapping-panel,
  .milestone-section,
  .strategy-section,
  .grant-layout,
  .deadline-section,
  .approval-section,
  .report-section {
    grid-template-columns: 1fr;
  }

  .controls {
    justify-content: flex-start;
  }

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

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

  .mapping-row {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .app-header {
    padding: 12px 14px;
  }

  .brand small {
    display: none;
  }

  .header-action {
    display: none;
  }

  .hero,
  .section {
    padding: 52px 18px;
  }

  h1 {
    font-size: 44px;
  }

  h2 {
    font-size: 36px;
  }

  .metric-grid,
  .stream-grid,
  .detail-grid,
  .document-preview,
  .approval-record,
  .sync-steps li,
  .milestone-item,
  .deadline-item {
    grid-template-columns: 1fr;
  }
}

/* Distinct GrantGuard presentation layer: board packet, audit ledger, and controlled evidence tone. */
.grantguard-app {
  --ink: #20201b;
  --muted: #666457;
  --paper: #f3efe4;
  --panel: #fffdf6;
  --line: rgba(32, 32, 27, 0.18);
  --green: #315f4b;
  --teal: #466f67;
  --gold: #a97926;
  --red: #a94b3f;
  --blue: #334f70;
  --shadow: 0 18px 44px rgba(32, 32, 27, 0.12);
  background:
    linear-gradient(90deg, rgba(32, 32, 27, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(32, 32, 27, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 36px 36px;
}

.grantguard-app .app-header {
  border-bottom: 1px solid rgba(32, 32, 27, 0.24);
  background: rgba(255, 253, 246, 0.96);
}

.grantguard-app .brand > span {
  border-radius: 3px;
  background: var(--ink);
  box-shadow: inset 0 -5px 0 var(--gold);
}

.grantguard-app .header-action,
.grantguard-app .primary-action {
  border-radius: 3px;
  background: var(--ink);
  color: #fff;
}

.grantguard-app .chip {
  border-radius: 3px;
}

.grantguard-app .hero {
  align-items: stretch;
  background:
    linear-gradient(120deg, rgba(169, 121, 38, 0.18), transparent 38%),
    linear-gradient(0deg, rgba(255, 253, 246, 0.72), rgba(255, 253, 246, 0.72));
}

.grantguard-app h1 {
  max-width: 900px;
  font-size: clamp(42px, 5.8vw, 80px);
  line-height: 1;
}

.grantguard-app h2 {
  font-size: clamp(30px, 4.2vw, 54px);
}

.grantguard-app .health-card,
.grantguard-app .stream-card,
.grantguard-app .report-card,
.grantguard-app .detail-panel {
  border-radius: 3px;
  border-color: rgba(32, 32, 27, 0.24);
  background: #fffdf6;
  box-shadow: 10px 10px 0 rgba(169, 121, 38, 0.16);
}

.grantguard-app .health-card strong,
.grantguard-app .stream-card strong {
  color: var(--gold);
}

.grantguard-app .metric-grid {
  margin: 0 clamp(18px, 5vw, 72px);
  border: 1px solid var(--line);
  background: var(--ink);
  color: #fff;
}

.grantguard-app .metric-grid span {
  color: rgba(255, 255, 255, 0.68);
}

.grantguard-app .metric-grid article {
  border-right-color: rgba(255, 255, 255, 0.14);
}

.grantguard-app .data-stream-section,
.grantguard-app .workspace {
  background: #eee8da;
}

.grantguard-app .sync-console,
.grantguard-app .mapping-panel,
.grantguard-app .grant-layout {
  border: 1px solid var(--line);
  background: #fffdf6;
}

.grantguard-app .grant-card,
.grantguard-app .stream-item,
.grantguard-app .milestone-item,
.grantguard-app .imperative-card,
.grantguard-app .deadline-item,
.grantguard-app .approval-record {
  border-radius: 3px;
  background: #fffdf6;
  box-shadow: none;
}

.grantguard-app .grant-card.active {
  outline: 3px solid rgba(169, 121, 38, 0.34);
}

.grantguard-app .tag,
.grantguard-app .status-pill,
.grantguard-app .document-pill {
  border-radius: 3px;
}

.grantguard-app .approval-section {
  background:
    linear-gradient(90deg, rgba(169, 121, 38, 0.10), transparent 28%),
    #fffdf6;
}

@media (max-width: 640px) {
  .grantguard-app .metric-grid {
    margin-left: 18px;
    margin-right: 18px;
  }
}
