:root {
  --ink: #111111;
  --paper: #fbf8ef;
  --sheet: #fffdf7;
  --line: #cfc7b8;
  --blue: #064b8f;
  --blue-dark: #003a73;
  --tan: #d6b98e;
  --kraft: #d8b985;
  --orange: #f58220;
  --muted: #5d5b55;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(0,0,0,.08) 1px, transparent 1px) 0 0/20px 20px,
    radial-gradient(circle at 0 0, rgba(6,75,143,.08), transparent 26rem),
    var(--paper);
  font-family: 'Trebuchet MS', Verdana, sans-serif;
}
a { color: inherit; }
.utility {
  height: 38px;
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 1.4rem;
  padding: 0 2rem;
  background: #0f0f0f;
  color: white;
  font-size: .9rem;
}
.utility strong { letter-spacing: .08em; }
.utility nav { display: flex; gap: 1.25rem; }
.utility a { color: white; text-decoration: none; }
.masthead {
  min-height: 92px;
  display: grid;
  grid-template-columns: 260px 1fr 240px;
  align-items: center;
  gap: 1.4rem;
  padding: 0 2rem;
  background: rgba(255,253,247,.92);
  border-bottom: 1px solid var(--line);
}
.brand {
  font: 700 clamp(2.4rem, 5vw, 4.2rem)/1 Georgia, 'Times New Roman', serif;
  text-decoration: none;
  letter-spacing: -.05em;
}
.tabs { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: .75rem; align-items: center; }
.tab {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  padding: .75rem 1rem;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 800;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.05rem;
}
.tab.active { background: var(--blue); color: white; box-shadow: 0 4px 0 rgba(0,0,0,.08); }
.tab:not(.active) { background: transparent; border-color: transparent; }
.kraft-note {
  padding: 1rem;
  background: linear-gradient(135deg, #d9bd91, #f1d6a7);
  border: 1px solid #c59b60;
  box-shadow: 0 8px 20px rgba(75,52,22,.18);
  font-family: Georgia, 'Times New Roman', serif;
}
.kraft-note b, .kraft-note span { display: block; }
.desk-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 360px;
  gap: 1.2rem;
  padding: 1.2rem 2rem;
}
.left-rail {
  border-right: 1px solid var(--line);
  padding-right: 1rem;
}
.left-rail h2 {
  margin: 1rem 0 .5rem;
  color: var(--blue-dark);
  font-size: .95rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.left-rail a {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: .65rem;
  align-items: center;
  padding: .58rem .5rem;
  border-bottom: 1px dotted var(--line);
  text-decoration: none;
  font-size: .94rem;
}
.rail-link.active {
  background: #eaf2fb;
  color: var(--blue-dark);
  font-weight: 700;
}
.left-rail a:hover { background: #eaf2fb; color: var(--blue-dark); }
.left-rail a span {
  width: 16px; height: 12px; border: 1px solid var(--blue-dark); background: #fff;
}
.rail-tip {
  margin-top: 2rem;
  padding: 1rem;
  border: 1px solid #cabda6;
  background: #f7ead4;
}
.rail-tip strong { color: var(--blue-dark); text-transform: uppercase; }
.workbench {
  min-width: 0;
}
.eyebrow {
  display: inline-block;
  margin: .2rem 0 .55rem;
  color: var(--blue-dark);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.crumbs { display: flex; gap: .45rem; color: var(--muted); font-size: .85rem; margin: .2rem 0 .8rem; }
.crumbs a { color: var(--blue-dark); text-decoration: none; }
h1 {
  margin: 0;
  font: 700 clamp(2rem, 4vw, 3.6rem)/1.02 Georgia, 'Times New Roman', serif;
  letter-spacing: -.04em;
}
.lead { max-width: 760px; color: var(--muted); font-size: 1.05rem; margin-bottom: 1rem; }
.finder, .chart, .template-panel, .visual-guide, .faq, .copy-block, .related-links {
  background: rgba(255,253,247,.94);
  border: 1px solid var(--line);
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
  margin-bottom: 1rem;
}
.summary-grid article {
  padding: 1rem;
  background: rgba(255,253,247,.94);
  border: 1px solid var(--line);
}
.summary-grid span {
  display: block;
  margin-bottom: .35rem;
  color: var(--blue-dark);
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.summary-grid strong {
  display: block;
  margin-bottom: .4rem;
  font: 700 1.3rem/1.1 Georgia, 'Times New Roman', serif;
}
.summary-grid p { margin: 0; color: var(--muted); font-size: .92rem; }
.finder { padding: 1rem; margin-bottom: 0; }
.finder h2, .chart h2, .template-panel h2, .visual-guide h2, .faq h2, .copy-block h2, .related-links h2 {
  margin: 0 0 .75rem;
  font: 700 1.45rem/1.1 Georgia, 'Times New Roman', serif;
}
.finder-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr)) 58px;
  gap: .8rem;
  align-items: end;
}
.finder label { display: grid; gap: .25rem; font-size: .82rem; }
select, input, button {
  min-height: 40px;
  border: 1px solid #bfb8ab;
  background: white;
  padding: .45rem .6rem;
  font: inherit;
}
button { background: var(--blue); color: white; font-weight: 900; cursor: pointer; }
.copy-block, .related-links { padding: 1rem; margin-top: 1rem; }
.note-list {
  margin: .85rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
}
.note-list li + li { margin-top: .55rem; }
.chart { border-top: 0; overflow-x: auto; margin-top: 1rem; }
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1rem 0;
}
.section-title span { font-size: 1rem; font-family: 'Trebuchet MS', Verdana, sans-serif; }
.unit-toggle { display: flex; border: 1px solid var(--line); }
.unit-toggle b, .unit-toggle span { padding: .5rem .9rem; }
.unit-toggle b { background: var(--blue); color: white; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .68rem .75rem; border: 1px solid var(--line); vertical-align: top; }
th { background: var(--blue); color: white; font-size: .82rem; }
td strong { color: var(--blue-dark); }
small { color: var(--muted); }
.table-note {
  margin: 0;
  padding: .85rem 1rem 1rem;
  color: var(--muted);
  font-size: .92rem;
}
.right-rail { display: grid; gap: 1rem; }
.template-panel, .visual-guide { position: relative; padding: 1rem; }
.cut-tag {
  position: absolute;
  right: 0;
  top: 0;
  padding: .65rem .9rem 1rem;
  background: var(--orange);
  color: #301400;
  font-size: .7rem;
  font-weight: 900;
  clip-path: polygon(0 0,100% 0,100% 78%,72% 68%,50% 100%,28% 68%,0 78%);
}
.template-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.template-grid a {
  min-height: 88px;
  padding: .75rem;
  border: 1px dashed #b7aa98;
  text-align: center;
  text-decoration: none;
  background: #fffdf7;
}
.template-grid strong { display: block; color: var(--blue-dark); font-size: .78rem; }
.template-grid em { display: block; color: var(--muted); font-style: normal; font-size: .75rem; }
.mini-shape { display: block; width: 54px; height: 28px; margin: .2rem auto .45rem; border: 1px solid #777; background: #f8f3e8; }
.blue-button { display: block; margin-top: .8rem; padding: .75rem; text-align: center; color: white; background: var(--blue); text-decoration: none; font-weight: 900; }
.guide-tabs { display: flex; margin-bottom: .9rem; }
.guide-tabs b, .guide-tabs span { padding: .45rem .65rem; border: 1px solid var(--line); font-size: .8rem; }
.guide-tabs b { background: var(--blue); color: white; }
.proportions { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; align-items: end; }
figure { margin: 0; text-align: center; font-size: .75rem; }
figure i { display: block; margin: 0 auto .4rem; border: 1px solid #b8824d; background: #fbf0dd; position: relative; }
figure i::before { content: ''; position: absolute; inset: 0; background: linear-gradient(150deg, transparent 48%, rgba(184,130,77,.45) 49%, transparent 51%); }
.side-note {
  margin: .9rem 0 0;
  color: var(--muted);
  font-size: .92rem;
}
.ruler { display: flex; justify-content: space-between; margin-top: 1rem; padding-top: .6rem; border-top: 1px solid var(--line); font-size: .75rem; }
.faq { padding: 1rem; margin-top: 1rem; }
details { border-top: 1px solid var(--line); padding: .7rem 0; }
summary { cursor: pointer; font-weight: 900; }
.related-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .7rem;
}
.related-grid a {
  display: block;
  padding: .85rem .9rem;
  border: 1px dashed #b7aa98;
  background: #fffdf7;
  text-decoration: none;
}
.related-grid strong {
  display: block;
  margin-bottom: .35rem;
  color: var(--blue-dark);
}
.related-grid span {
  display: block;
  color: var(--muted);
  font-size: .9rem;
}
.footer-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 0 2rem 1.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}
.footer-strip div { padding: .6rem 1rem; border-right: 1px solid var(--line); }
.footer-strip strong { display: block; color: var(--blue-dark); }
.footer-strip span { color: var(--muted); font-size: .9rem; }
footer { padding: 1rem 2rem 2rem; color: var(--muted); font-size: .9rem; }
@media (max-width: 1100px) {
  .masthead, .desk-layout { grid-template-columns: 1fr; }
  .tabs, .footer-strip, .summary-grid { grid-template-columns: 1fr 1fr; }
  .left-rail { border-right: 0; padding-right: 0; }
  .right-rail { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .utility { grid-template-columns: 1fr; height: auto; padding: .7rem 1rem; gap: .4rem; }
  .masthead { padding: 1rem; }
  .tabs, .finder-grid, .footer-strip, .summary-grid, .related-grid { grid-template-columns: 1fr; }
  .desk-layout { padding: 1rem; }
  .template-grid, .proportions { grid-template-columns: 1fr 1fr; }
}
