:root {
  color-scheme: light;
  font: 16px/1.53 system-ui, sans-serif;
  --bg: #f3efe6;
  --page: #fffdf7;
  --ink: #1c2f3c;
  --muted: #435761;
  --rule: #d7d1c5;
  --blue: #204d61;
  --dark: #173a4b;
  --pale: #dceaf0;
  --gold: #f0d7a4;
  --warn: #775019;
  --bad: #913633;
  color: var(--ink);
  background: var(--bg);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
.masthead { color: #fff; background: #193744; }
.top, .shell { max-width: 85rem; padding-inline: clamp(1rem, 3vw, 2.6rem); margin-inline: auto; }
.top { min-height: 3.75rem; display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1rem; padding-block: .55rem; }
.top a { color: #fff; text-decoration: none; font-weight: 650; }
.top a:hover { text-decoration: underline; }
.save-status { font-size: .85rem; margin-left: auto; color: #dbe8ed; }
.save-status.exception { color: #ffd1a3; }
.actions { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
button { border: 1px solid var(--blue); background: var(--blue); color: #fff; border-radius: .5rem; min-height: 2.5rem; padding: .5rem .85rem; font: inherit; font-size: .91rem; font-weight: 650; cursor: pointer; }
button:hover { background: var(--dark); border-color: var(--dark); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.quiet { color: var(--dark); border-color: var(--rule); background: var(--page); }
button.quiet:hover { background: #e7ecec; }
button.light { background: transparent; border-color: #70909d; }
button.light:hover { background: #2e505e; }
button.remove { background: white; border-color: #dcc3bd; color: var(--bad); min-height: 2.15rem; }
button.remove:hover { background: #fae9e5; }
:focus-visible { outline: 3px solid #337487; outline-offset: 3px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) clamp(10rem, 23vw, 16rem); align-items: center; gap: clamp(.85rem, 3vw, 2.3rem); padding: clamp(1.3rem, 4vw, 2.75rem) 0 clamp(1.3rem, 4vw, 2.2rem); }
.hero-copy { min-width: 0; }
h1, h2, h3 { margin: 0; line-height: 1.14; }
h1 { font-family: Georgia, serif; font-size: clamp(2.35rem, 6vw, 4.6rem); letter-spacing: -.05em; }
h2 { font-size: clamp(1.55rem, 2.6vw, 2rem); letter-spacing: -.028em; }
h3 { font-size: 1.12rem; margin-top: 1.15rem; }
p { margin: .55rem 0 .85rem; }
.hero p { max-width: 50ch; font-size: clamp(.99rem, 1.8vw, 1.12rem); color: var(--muted); }
.hero-actions { margin-top: 1.05rem; }
.pyramid-net { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3,1fr); gap: 2px; aspect-ratio: 1; }
.pyramid-net button { border: none; border-radius: 0; min-height: 0; min-width: 0; padding: 0; justify-content: center; color: #172f3d; font-size: clamp(.76rem, 1.6vw, 1.38rem); }
.pyramid-net button:hover { filter: brightness(.91); }
.pyramid-net button:focus-visible { outline: none; color: #fff; background: #214e64; }
.triangle.north { grid-area: 1/2; clip-path: polygon(50% 0,100% 100%,0 100%); background: #afcbd9; padding-top: 29%; }
.triangle.east { grid-area: 2/3; clip-path: polygon(0 0,100% 50%,0 100%); background: #edcc8f; padding-right: 28%; }
.triangle.south { grid-area: 3/2; clip-path: polygon(0 0,100% 0,50% 100%); background: #b7d4c8; padding-bottom: 29%; }
.triangle.west { grid-area: 2/1; clip-path: polygon(100% 0,100% 100%,0 50%); background: #c1ccdf; padding-left: 28%; }
.pyramid-net .base-square { grid-area: 2/2; border: 1px solid #aeb9b6; background: var(--page); font-size: clamp(.62rem, 1vw, .89rem); }
.workspace { display: grid; grid-template-columns: minmax(13rem, 15rem) minmax(0, 1fr); gap: 1rem; align-items: start; }
.navbox, .panel, .report { background: var(--page); border: 1px solid var(--rule); border-radius: .82rem; }
.navbox { padding: .6rem; position: sticky; top: .7rem; }
#nav { display: grid; gap: .25rem; }
#nav button { width: 100%; text-align: left; background: transparent; color: var(--ink); border-color: transparent; }
#nav button:hover, #nav button[aria-current="page"] { background: var(--pale); color: var(--dark); }
.panel { padding: clamp(1rem, 2vw, 1.6rem); min-height: 19rem; }
.section-note { max-width: 74ch; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: .7rem; }
.field { display: grid; gap: .25rem; font-size: .91rem; font-weight: 630; align-content: start; min-width: 0; }
.field.wide { grid-column: 1/-1; }
input:not([type=checkbox]), select, textarea { width: 100%; min-width: 0; font: inherit; font-weight: 400; color: var(--ink); background: white; border: 1px solid #b8c2c2; border-radius: .42rem; padding: .53rem .6rem; }
textarea { min-height: 5rem; resize: vertical; }
.check { display: flex; gap: .5rem; align-items: start; font-size: .92rem; color: var(--ink); }
input[type=checkbox] { inline-size: 1rem; block-size: 1rem; accent-color: var(--dark); }
.card { border: 1px solid var(--rule); background: white; border-radius: .67rem; padding: .8rem; margin-block: .7rem; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .6rem; }
.card-head strong, dd, td, .section-note { overflow-wrap: anywhere; }
small, .muted { color: var(--muted); }
.status-line, .notice { margin-block: .7rem; padding: .65rem .82rem; background: #e7f0f3; border-left: .25rem solid var(--blue); overflow-wrap: anywhere; }
.status-line.warn, .notice.error { background: #f8eddb; color: var(--warn); border-left-color: #946635; }
.facet-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .65rem; margin-block: .9rem; }
.facet-button { display: grid; text-align: left; color: var(--dark); background: white; border-color: var(--rule); min-height: 6rem; align-content: center; gap: .35rem; padding: .78rem; }
.facet-button:hover { background: #eaf2f4; color: var(--dark); }
.facet-button small { font-size: .8rem; font-weight: 540; }
.facet-button strong { font-size: 1.02rem; }
.facet-buttons { margin-block: .9rem; }
.facet-buttons button[aria-pressed=true] { color: var(--dark); background: var(--pale); border-color: #9ab8c5; }
details summary { cursor: pointer; font-weight: 650; color: var(--blue); }
details .grid { margin-top: .75rem; }
.report { padding: .85rem; margin-top: .95rem; }
.report dl { display: grid; grid-template-columns: minmax(8rem, 1fr) minmax(0,3fr); gap: .22rem .7rem; margin-block: .65rem; }
.report dt { font-weight: 650; }
.report dd { margin: 0; white-space: pre-wrap; }
.table-wrap { overflow: auto; margin-block: .7rem; }
table { width: 100%; border-collapse: collapse; font-size: .89rem; }
th, td { padding: .43rem .47rem; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { background: #eaf1f3; }
footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; padding-block: 1.3rem 2rem; color: var(--muted); font-size: .88rem; }
footer p { margin: 0; }
.print-only { display: none; }
@media (max-width: 820px) {
  .workspace { grid-template-columns: minmax(0,1fr); gap: .7rem; }
  .navbox { position: static; }
  #nav { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); }
  #nav button { background: #f4f4ef; }
}
@media (max-width: 520px) {
  .hero { grid-template-columns: minmax(0,1fr) 8.6rem; gap: .55rem; }
  .hero h1 { font-size: clamp(1.86rem,8vw,2.55rem); }
  .hero p { font-size: .89rem; }
  .pyramid-net .base-square { font-size: .49rem; }
  .hero .actions button { font-size: .8rem; }
  .save-status { margin-left: 0; }
  .top { justify-content: space-between; }
  .facet-button { min-height: 5.3rem; padding: .55rem; }
  .report dl { grid-template-columns: minmax(0,1fr); }
  .report dt { margin-top: .3rem; }
  .report table, .report tbody, .report tr { display: block; }
  .report thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .report tr { padding: .5rem 0; border-top: 1px solid var(--rule); }
  .report td { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: .45rem; border: 0; padding: .2rem .15rem; }
  .report td::before { content: attr(data-label); font-weight: 650; color: var(--muted); }
  .report td:first-child { display: block; font-weight: 700; }
  .report td:first-child::before { content: none; }
}
@media print {
  .masthead, .shell { display: none; }
  .print-only { display: block; }
  .report { padding: 0; border: 0; background: white; }
  body { color: #000; background: #fff; font-size: 11pt; }
  h2, h3 { break-after: avoid; }
  .report td:first-child { min-width: 9.5em; overflow-wrap: normal; }
  tr { break-inside: avoid; }
}
