:root {
  --page:      #e8e4f6;   
  --bg:        #ffffff;   
  --bg-soft:   #f7f6fb;
  --text:      #14151a;
  --text-mute: #6a6f7d;
  --line:      #e5e3ee;
  --line-soft: #f0eef7;
  --accent:    #5b3fd6;   
  --accent-bg: #f1eefc;
  --radius:    2px;       
  --wrap:      1120px;
  --wrap-narrow: 700px;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; background: var(--page); }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

.site-header, main, .site-footer {
  max-width: var(--wrap);
  margin-left: auto;
  margin-right: auto;
  background: var(--bg);
}
.site-header { margin-top: 28px; }
.site-footer { margin-bottom: 28px; }

img, video { max-width: 100%; height: auto; }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: #4028ab; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 28px; }
.wrap-narrow { max-width: var(--wrap-narrow); }

.skip {
  position: absolute; left: -9999px;
  background: var(--accent); color: #fff;
  padding: 10px 16px; z-index: 100;
}
.skip:focus { left: 12px; top: 12px; }

.kicker, .section-head, .card-cat, .ad-label, .side-head, .crumbs, .toc-head {
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-mute);
}

.site-header { padding: 34px 0 0; }
.header-inner { text-align: center; padding-bottom: 22px; }

.kicker { display: block; margin-bottom: 16px; }

.brand {
  display: inline-block;
  font-family: var(--serif);
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  line-height: 1.15;
}
.brand:hover { color: var(--text); }

.nav {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
}
.nav a {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  padding: 13px 16px;
  border-right: 1px solid var(--line-soft);
  white-space: nowrap;
}
.nav a:first-child { border-left: 1px solid var(--line-soft); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent); }

.hero { padding: 46px 0 8px; text-align: center; }
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
  margin: 0 0 10px;
}
.lede { color: var(--text-mute); margin: 0 auto; max-width: 620px; }

.page-head { padding: 44px 0 20px; border-bottom: 1px solid var(--line); margin-bottom: 30px; }
.page-head h1 {
  font-family: var(--serif);
  font-size: clamp(26px, 4vw, 34px);
  margin: 0 0 8px;
  font-weight: 700;
}

.section-head {
  display: block;
  text-align: center;
  margin: 44px 0 20px;
  position: relative;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 40px;
  align-items: start;
  padding-bottom: 50px;
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 28px; }
}

.sidebar { border-left: 1px solid var(--line); padding-left: 32px; }
@media (max-width: 860px) {
  .sidebar { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 24px; }
}
.side-head { display: block; text-align: center; margin: 0 0 14px; }
.side-block { margin-bottom: 34px; font-size: 14.5px; color: var(--text-mute); }
.side-block p { margin: 0 0 10px; }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { border-bottom: 1px solid var(--line-soft); }
.side-list a {
  display: block; padding: 9px 0; font-size: 14px;
  color: var(--text); text-decoration: none;
}
.side-list a:hover { color: var(--accent); }
.side-note { font-size: 13px; line-height: 1.6; }

.card-grid { list-style: none; margin: 0; padding: 0; }
.card { border: 1px solid var(--line); margin-bottom: 16px; background: var(--bg); }
.card:hover { border-color: #cdc6e8; }

.card-link {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  text-decoration: none;
  color: inherit;
}
@media (max-width: 620px) {
  .card-link { grid-template-columns: 1fr; }
}
.card-rail {
  background: var(--bg-soft);
  border-right: 1px solid var(--line-soft);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
@media (max-width: 620px) {
  .card-rail { border-right: 0; border-bottom: 1px solid var(--line-soft); flex-direction: row; gap: 12px; }
}
.card-body { padding: 18px 20px; }

.card-cat { display: block; color: var(--accent); margin-bottom: 4px; }
.card-title {
  display: block;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.3;
  margin: 0 0 7px;
  font-weight: 700;
}
.card-desc { display: block; margin: 0 0 10px; font-size: 14.5px; color: var(--text-mute); }
.card-meta { display: block; font-size: 12px; color: var(--text-mute); }

.featured { margin-top: 30px; }
.featured .card-title { font-size: 22px; }

.empty { color: var(--text-mute); padding: 30px 0; }

.crumbs { display: block; padding: 30px 0 0; }
.crumbs a { color: var(--text-mute); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }

.post-head { padding: 14px 0 22px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.post-head h1 {
  font-family: var(--serif);
  font-size: clamp(27px, 4.2vw, 38px);
  line-height: 1.22;
  margin: 0 0 12px;
  font-weight: 700;
}
.post-meta { font-size: 13px; color: var(--text-mute); margin: 0; }

.toc {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 18px 20px;
  margin-bottom: 30px;
}
.toc-head { display: block; margin: 0 0 8px; }
.toc ul { margin: 0; padding-left: 18px; }
.toc li { margin: 4px 0; font-size: 14.5px; }

.prose { font-size: 17px; }
.prose h2 {
  font-family: var(--serif);
  font-size: 25px;
  margin: 42px 0 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  font-weight: 700;
}
.prose h3 { font-size: 19px; margin: 30px 0 8px; font-weight: 700; }
.prose p { margin: 0 0 18px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose blockquote {
  margin: 24px 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--accent);
  color: var(--text-mute);
  font-style: italic;
}
.prose code {
  background: var(--bg-soft);
  padding: 2px 5px;
  font-size: .92em;
  border: 1px solid var(--line);
}
.prose img { border: 1px solid var(--line); }

.table-scroll { overflow-x: auto; margin: 0 0 22px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.prose th, .prose td {
  border: 1px solid var(--line);
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
}
.prose th { background: var(--bg-soft); font-weight: 600; }

.faq { margin: 46px 0 0; }
.faq h2 {
  font-family: var(--serif); font-size: 23px;
  padding-top: 16px; border-top: 1px solid var(--line); font-weight: 700;
}
.faq-item { border-bottom: 1px solid var(--line-soft); padding: 12px 0; }
.faq-item summary { cursor: pointer; font-weight: 600; }
.faq-item p { margin: 10px 0 0; color: var(--text-mute); }

.related { margin: 46px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.related h2 { font-family: var(--serif); font-size: 21px; margin: 0 0 10px; font-weight: 700; }
.related ul { margin: 0; padding-left: 20px; }
.related li { margin: 6px 0; }

.ad { margin: 34px 0; text-align: center; }
.ad-label { display: block; margin-bottom: 6px; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 30px 0 34px;
  font-size: 13.5px;
  color: var(--text-mute);
  text-align: center;
}
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; margin-bottom: 12px; }
.footer-nav a { color: var(--text-mute); text-decoration: none; }
.footer-nav a:hover { color: var(--accent); }
.copy { margin: 0; }
.views { margin: 8px 0 0; font-size: 12px; }

.section-grid { list-style: none; margin: 0; padding: 0; display: grid;
                grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.section-grid .card { margin: 0; }
.section-grid .card-link { grid-template-columns: 1fr; }
.section-grid .card-body { padding: 20px; }
.group-head { display: block; text-align: left; margin: 38px 0 14px;
              padding-bottom: 8px; border-bottom: 1px solid var(--line); }

.calc { margin: 26px 0 30px; border: 1px solid var(--line); background: var(--bg-soft);
        padding: 20px 20px 16px; }
.calc-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 18px; }
.calc-field { display: flex; flex-direction: column; gap: 5px; }
.calc-field label { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.35; }
.calc-field input, .calc-field select {
  font: inherit; font-size: 15px; padding: 8px 10px; width: 100%;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--text);
}
.calc-field input:focus, .calc-field select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.calc-unit { display: flex; align-items: stretch; }
.calc-unit input { border-right: 0; }
.calc-unit-label { display: flex; align-items: center; padding: 0 10px; font-size: 13px;
                   color: var(--text-mute); background: var(--accent-bg); border: 1px solid var(--line); }
.calc-help { margin: 0; font-size: 12.5px; color: var(--text-mute); line-height: 1.4; }
.calc-out { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.calc-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
            padding: 7px 0; font-size: 15px; }
.calc-label { color: var(--text-mute); }
.calc-value { font-weight: 700; text-align: right; }
.calc-row-big { border-top: 1px solid var(--line-soft); margin-top: 6px; padding-top: 12px; }
.calc-row-big .calc-label { color: var(--text); font-weight: 600; }
.calc-row-big .calc-value { font-family: var(--serif); font-size: 24px; color: var(--accent); }
.calc-note { margin: 2px 0 8px; font-size: 13px; color: var(--text-mute); line-height: 1.5; }
.calc-assume { margin: 14px 0 0; font-size: 12.5px; color: var(--text-mute); line-height: 1.5; }
.calc-error { margin: 0; font-size: 14px; color: var(--text-mute); }
.tool-list { list-style: none; margin: 0; padding: 0; }
.tool-list li { border-bottom: 1px solid var(--line-soft); padding: 14px 0; }
.tool-list a { font-weight: 600; }
.tool-list p { margin: 4px 0 0; font-size: 14.5px; color: var(--text-mute); }
