:root {
  /* "Calm Harbour" palette — chosen with colour psychology in mind: teal-blue carries
     the dominant weight because blue reads as trust and lowers anxiety more consistently
     than any other hue, which is why banks/insurers/healthcare apps default to it. Sage
     backs it up for "safe/confirmed" states (green shares that reassurance association,
     and doubles as a "money, growth" cue for the savings message). Cream stays warm
     rather than stark white so it reads human, not clinical. Coral is rationed to
     buttons/CTAs and small highlight moments only — enough warmth to feel inviting
     without it competing with the calm base. Navy replaces near-black as the outline
     colour for the same reason: structure without harshness.
     Variable NAMES are kept as -terracotta/-mustard/etc so nothing downstream has to
     change — only the hex values and a handful of "which var for which role" swaps. */
  --cream: #F6F1E7;
  --cream-2: #EDE4D2;
  --card: #FBF7EE;
  --line: #E1D6BE;
  --ink: #1F2A3D;
  --ink-soft: #52607A;
  --teal: #3E8FA8;
  --teal-dark: #2C6E82;
  --terracotta: #E8734A;
  --terracotta-dark: #C25A2C;
  --sage: #4F9B7D;
  --sage-dark: #35735A;
  --mustard: #D9A44A;
  --pink: #E7A99A;
  --radius: 14px;
  --shadow: 4px 4px 0 var(--ink);

  /* legacy aliases so nothing else has to change */
  --navy: var(--ink);
  --navy-light: var(--terracotta-dark);
  --green: var(--sage-dark);
  --amber: #8A5A12;
  --red: var(--terracotta-dark);
  --bg: var(--cream);
  --border: var(--line);
  --text: var(--ink);
  --muted: var(--ink-soft);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Nunito', -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Baloo 2', Georgia, serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

header {
  background: rgba(246, 241, 231, .95);
  backdrop-filter: blur(6px);
  color: var(--ink);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1.5px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  font-family: 'Baloo 2', serif;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: .2px;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand::before {
  content: "FS";
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--teal);
  border: 2px solid var(--ink);
  color: #FFF6EA;
  font-family: 'Baloo 2', serif;
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-4deg);
  flex: none;
}

.brand span { color: var(--teal-dark); }

nav { display: flex; gap: 4px; align-items: center; }

.navlink {
  background: transparent;
  border: none;
  color: var(--ink-soft);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
}
.navlink:hover { background: var(--cream-2); color: var(--ink); }

main { max-width: 1000px; margin: 28px auto; padding: 0 20px 60px; }

.card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: 3px 3px 0 rgba(42, 36, 32, 0.08);
}
.card h2 {
  margin-top: 0;
  font-size: 13px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-soft);
}

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.stat { border: 1.5px solid var(--line); border-radius: 10px; padding: 16px; background: var(--card); }
.stat .label { font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; }
.stat .value { font-family: 'Baloo 2', serif; font-size: 27px; font-weight: 700; margin-top: 4px; color: var(--teal-dark); }

.pill {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1.5px solid var(--line);
  background: var(--cream-2);
  color: var(--ink-soft);
}
.pill.green { background: #DCEEE3; color: var(--sage-dark); border-color: #B9DBC9; }
.pill.amber { background: #FBEDD2; color: #7A5410; border-color: #F0D89B; }
.pill.red { background: #FBE2D6; color: var(--terracotta-dark); border-color: #F0BFA0; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--ink-soft); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; font-family: 'Nunito', sans-serif; }
/* Tables don't reflow like flex/grid — on a narrow viewport, let the table itself
   scroll horizontally rather than squishing cells or forcing the whole page wider. */
table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
thead, tbody, tr { display: table; width: 100%; table-layout: fixed; }
@media (min-width: 640px) {
  table { display: table; overflow-x: visible; }
  thead, tbody, tr { display: table-row-group; width: auto; table-layout: auto; }
  thead { display: table-header-group; }
  tr { display: table-row; }
}

.btn {
  background: var(--terracotta);
  color: #FFF6EA;
  border: 2px solid var(--ink);
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { background: var(--terracotta); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
.btn.secondary { background: var(--card); color: var(--ink); border: 2px solid var(--ink); }
.btn.small { padding: 6px 13px; font-size: 12.5px; box-shadow: 2px 2px 0 var(--ink); }
.btn.small:hover { box-shadow: 3px 3px 0 var(--ink); }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1.5px solid var(--line); flex-wrap: wrap; }
.tabs a, .tabs button {
  background: none; border: none; padding: 10px 14px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--ink-soft);
  border-bottom: 2px solid transparent; text-decoration: none; font-family: inherit;
}
.tabs a.active { color: var(--teal-dark); border-bottom-color: var(--teal); font-weight: 700; }

input, select {
  padding: 9px 11px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Nunito', sans-serif;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus { outline: 2px solid var(--teal); outline-offset: 1px; }

label { font-size: 12px; color: var(--ink-soft); display: block; margin-bottom: 4px; font-weight: 600; }
.field { margin-bottom: 12px; }

.banner {
  background: #FBEDD2;
  border: 1.5px solid #F0D89B;
  color: #8A5A12;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 14px;
}
.banner.error { background: #FBE2D6; border-color: #F0BFA0; color: var(--terracotta-dark); }
.banner.success { background: #DCEEE3; border-color: #B9DBC9; color: var(--sage-dark); }

.muted { color: var(--ink-soft); font-size: 13px; }

.log-entry { font-size: 13px; padding: 8px 0; border-bottom: 1px dashed var(--line); }

.mock-tag {
  font-size: 10.5px;
  background: var(--cream-2);
  color: var(--ink-soft);
  padding: 3px 8px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: middle;
  font-weight: 600;
  border: 1px solid var(--line);
}
.mock-tag.live { background: #DCEEE3; color: var(--sage-dark); border-color: #B9DBC9; }

.checklist {
  background: var(--cream-2);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
  white-space: pre-wrap;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

.hero { max-width: 640px; margin: 60px auto; text-align: left; }
.hero h1 { font-size: 34px; margin-bottom: 12px; }

footer.note {
  max-width: 1000px;
  margin: 0 auto 40px;
  padding: 0 20px;
  font-size: 12px;
  color: var(--ink-soft);
}

a { color: var(--terracotta-dark); }

@media (max-width: 640px) {
  header { padding: 12px 16px; }
  .brand { font-size: 17px; }
  nav .muted { display: none; }
  main { margin: 18px auto; padding: 0 14px 40px; }
  .card { padding: 16px 16px; }
  .btn { padding: 9px 16px; font-size: 13.5px; }
}
