/* Design-notes pages. Reuses tokens from styles.css. */
.n-top { background: var(--surface); border-bottom: 1px solid var(--line); }
.n-top-in { max-width: 1160px; margin: 0 auto; padding: 12px 20px; display: flex; gap: 10px 22px; align-items: center; flex-wrap: wrap; }
.n-top nav { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.n-top nav a { text-decoration: none; color: var(--ink); padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: .9375rem; min-height: 40px; display: inline-flex; align-items: center; }
.n-top nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }
.n-top nav a:hover { background: #efece4; }
.n-top nav a.go { background: var(--brand); color: #fff; }
.n-top nav a.go:hover { background: var(--brand-hover); }

.note { max-width: 1160px; margin: 0 auto; padding: 36px 20px 20px; }
.note h1 { max-width: 22ch; }
.note .lede { max-width: 70ch; }
.note section { margin-top: 44px; }
.note h2 { font-size: 1.3125rem; margin-bottom: 4px; }
.note .sub { color: var(--muted); max-width: 70ch; }
.note .kicker { font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); margin-bottom: 4px; }

.hmw { margin-top: 24px; background: var(--ink); color: #fff; border-radius: var(--radius); padding: 22px 26px; font-family: var(--display); font-size: clamp(1.2rem, 2.2vw, 1.5rem); line-height: 1.35; }
.hmw small { display: block; font-family: var(--font); font-size: .8125rem; letter-spacing: .06em; text-transform: uppercase; opacity: .75; margin-bottom: 6px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 16px; }
.note .card { margin: 0; }
.note .card h3 { margin-bottom: 4px; }
.note .card p, .note .card li { font-size: .9375rem; color: #343e4c; }
.note .card ul { list-style: disc; padding-left: 18px; margin-top: 6px; }

.tbl { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); font-size: .9375rem; }
.tbl th { text-align: left; background: #faf9f6; font-size: .8125rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px 14px; vertical-align: top; border-top: 1px solid #eee9de; }
.tbl tr:first-child td { border-top: 0; }
.tbl td:first-child { font-weight: 700; width: 20%; }
.tbl .tag { display: inline-block; font-size: .8125rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); white-space: nowrap; }
.tbl .tag.hi { background: var(--bad-bg); color: var(--bad); }
.tbl .tag.md { background: var(--warn-bg); color: var(--warn); }
.tbl .tag.lo { background: var(--ok-bg); color: var(--ok); }

/* journey strip */
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 18px; }
.flow > div { position: relative; background: #fff; border: 1px solid var(--line); padding: 16px; }
.flow > div:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.flow > div:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.flow > div + div { border-left: 0; }
.flow .n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: .875rem; margin-bottom: 6px; }
.flow h3 { font-size: 1.0625rem; }
.flow dl { margin-top: 8px; font-size: .875rem; }
.flow dt { font-weight: 700; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; margin-top: 8px; }
.flow dd { margin: 0; color: #343e4c; }

/* fact anatomy */
.fact-diagram { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; margin-top: 16px; align-items: start; }
.anat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.anat .f { display: grid; grid-template-columns: 110px 1fr; gap: 6px 14px; font-size: .9375rem; }
.anat .f dt { font-weight: 700; color: var(--muted); font-size: .8125rem; text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
.anat .f dd { margin: 0; }
.rule { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--brand-soft); color: #08423d; font-weight: 600; font-size: .9375rem; }
.states { display: grid; gap: 8px; }
.states > div { display: flex; gap: 10px; align-items: flex-start; font-size: .9375rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.states .chip { flex: none; margin-top: 1px; min-width: 128px; justify-content: center; }

.cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-top: 16px; }
.col h3 { display: flex; gap: 8px; align-items: center; }
.col ul { list-style: none; padding: 0; margin-top: 8px; }
.col li { padding: 8px 0; border-top: 1px solid #eee9de; }
.col li:first-child { border-top: 0; }
.col li b { display: block; }
.col li span { color: var(--muted); font-size: .875rem; }

.tradeoff { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.tradeoff .card.pick { border: 2px solid var(--brand); }
.tradeoff .card.pick h3::after { content: "Chosen"; margin-left: 8px; font-size: .75rem; background: var(--brand); color: #fff; padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.metric { display: grid; grid-template-columns: 1.3fr .8fr 1.4fr; gap: 12px; padding: 10px 0; border-top: 1px solid #eee9de; font-size: .9375rem; }
.metric:first-child { border-top: 0; }
.metric b { font-size: 1rem; }
.metric .tgt { font-weight: 700; color: var(--brand); }
.n-foot { max-width: 1160px; margin: 0 auto; padding: 36px 20px 60px; display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; }

@media (max-width: 900px) {
  .grid2, .grid3, .grid4, .cols, .tradeoff, .fact-diagram { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  .flow > div, .flow > div:first-child, .flow > div:last-child { border-radius: 0; border-left: 1px solid var(--line); }
  .flow > div + div { border-top: 0; }
  .flow > div:first-child { border-radius: var(--radius) var(--radius) 0 0; }
  .flow > div:last-child { border-radius: 0 0 var(--radius) var(--radius); }
  .metric { grid-template-columns: 1fr; gap: 2px; }
  .tbl, .tbl tbody, .tbl tr, .tbl td, .tbl th { display: block; }
  .tbl thead { display: none; }
  .tbl td:first-child { width: auto; padding-bottom: 0; }
  .tbl td { border-top: 0; padding: 4px 14px; }
  .tbl tr { border-top: 1px solid #eee9de; padding: 8px 0; }
  .tbl tr:first-child { border-top: 0; }
  .anat .f { grid-template-columns: 1fr; gap: 0; }
  .anat .f dd { margin-bottom: 8px; }
}
