@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600&family=Inter:wght@400;500&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #FBF8F3;
  --white:    #FFFFFF;
  --border:   #EDE9E2;
  --blue:     #2B5C8A;
  --blue-lt:  #EAF1F8;
  --text:     #1A2B3C;
  --muted:    #6B6860;
  --hint:     #77736C;
  --radius:   12px;
  --tabbar-h: 62px;
}

/* ── BASE (mobile first) ── */
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  font-size: 15px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  /* clear the fixed bottom tab bar on mobile */
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
}

main { flex: 1; }

/* accessible focus for keyboard and switch users */
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ── TOP HEADER ── */
/* Mobile: brand only. Desktop: brand + horizontal links. */
.site-head {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-height: 44px;
}

.nav-logo {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }

.nav-name { line-height: 1.2; }
.nav-name p { margin: 0; }
.nav-name .top { font-size: 13px; font-weight: 500; color: var(--text); }
.nav-name .sub { font-size: 10px; color: var(--hint); }

/* desktop-only link row */
.nav-links {
  display: none;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
  padding: 10px 2px;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--blue);
  font-weight: 500;
}

/* ── BOTTOM TAB BAR (mobile only) ── */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: var(--tabbar-h);
  padding: 6px 2px;
  font-size: 10px;
  font-weight: 500;
  color: var(--hint);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.tabbar a i { font-size: 21px; line-height: 1; }

.tabbar a.active { color: var(--blue); }

/* ── PAGE WRAPPER ── */
.page { max-width: 900px; margin: 0 auto; padding: 26px 16px 48px; width: 100%; }

/* ── EYEBROW ── */
.eyebrow {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 10px;
}

/* ── HEADINGS ── */
h1 {
  font-family: 'Playfair Display', serif;
  font-size: 27px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 12px;
}

h2 {
  font-family: 'Playfair Display', serif;
  font-size: 21px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}

.lead {
  font-size: 14px;
  color: var(--muted);
  max-width: 480px;
  line-height: 1.7;
  margin-bottom: 28px;
}

/* ── CARDS ── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.card-icon {
  width: 40px;
  height: 40px;
  background: var(--blue-lt);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  color: var(--blue);
  font-size: 18px;
}

.card a {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 0.15s;
}

.card:hover { border-color: var(--blue); }

.card p.label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 5px;
}

.card p.desc {
  font-size: 12.5px;
  color: var(--hint);
  line-height: 1.55;
}

/* ── SCROLLABLE TABLES ── */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── SECTION DIVIDER ── */
.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

/* ── BADGE ── */
.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.badge-p16  { background: #EEEDFE; color: #3C3489; }
.badge-xvive { background: #E1F5EE; color: #085041; }
.badge-md   { background: #FAEEDA; color: #633806; }

/* ── MIX BARS ── */
.mix-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.mix-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.mix-card h3 { font-size: 13px; margin-bottom: 2px; }
.mix-card .sub { font-size: 11px; color: var(--hint); margin-bottom: 10px; }

.bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.bar-label {
  font-size: 11.5px;
  color: var(--muted);
  width: 96px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  flex: 1;
  height: 7px;
  background: #F0EDE8;
  border-radius: 3px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 3px;
}

.bar-pct {
  font-size: 10.5px;
  color: var(--hint);
  width: 30px;
  text-align: right;
  flex-shrink: 0;
}

/* ── CHECKLIST ── */
.checklist { list-style: none; }

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14.5px;
}

.checklist li:last-child { border-bottom: none; }

.checklist input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin-top: 1px;
  flex-shrink: 0;
  accent-color: var(--blue);
  cursor: pointer;
}

.checklist .step-text { line-height: 1.5; }
.checklist .step-note { font-size: 12.5px; color: var(--hint); margin-top: 3px; }

/* ── FOOTER ── */
footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  font-size: 11px;
  color: var(--hint);
  margin-top: auto;
}

/* ── SECTION LABEL ── */
.section-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hint);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin: 32px 0 14px;
}

/* ── DESKTOP (768px and up) ── */
@media (min-width: 768px) {
  body { padding-bottom: 0; }

  .site-head { padding: 0 32px; height: 60px; }
  .nav-links { display: flex; }
  .tabbar { display: none; }

  .page { padding: 52px 32px 80px; }

  h1 { font-size: 36px; margin-bottom: 14px; }
  h2 { font-size: 22px; }
  .lead { margin-bottom: 40px; }

  .card { padding: 24px; }
  .card-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
  .card-icon { width: 38px; height: 38px; margin-bottom: 14px; }
  .card p.label { font-size: 13px; }
  .card p.desc { font-size: 12px; }

  .mix-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
  .bar-label { font-size: 11px; width: 90px; }
  .bar-track { height: 6px; }
  .bar-pct { font-size: 10px; width: 28px; }

  .checklist li { padding: 14px 0; font-size: 14px; gap: 12px; }
  .checklist input[type="checkbox"] { width: 18px; height: 18px; }
  .checklist .step-note { font-size: 12px; margin-top: 2px; }

  .section-label { margin: 36px 0 14px; }
  .section-divider { margin: 48px 0; }

  footer {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 18px 32px;
    gap: 0;
  }
}
