:root {
  color-scheme: light;
  --navy: #102433;
  --deep: #0b1b28;
  --ink: #132a3a;
  --muted: #526777;
  --blue: #12536f;
  --blue-bg: #e5f1f7;
  --paper: #fff;
  --background: #edf3f6;
  --line: #d3dfe6;
  --orange: #b74c29;
  --orange-light: #ffb191;
  --green: #185b4a;
  --green-bg: #e6f5ec;
  --warn: #834512;
  --warn-bg: #fdf1dd;
  --fail: #a33934;
  --fail-bg: #fbeae8;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--background);
  font: 15px/1.52 "Inter", "Segoe UI", system-ui, sans-serif;
}
body:has(#home:not([hidden])) { background: #f5f8fa; }
[hidden] { display: none !important; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { line-height: 1.13; letter-spacing: -.025em; overflow-wrap: anywhere; }
h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
h2 { font-size: 1.33rem; }
h3 { font-size: 1.04rem; }
a { color: var(--blue); }
button, select, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
:focus-visible { outline: 3px solid #4095b4; outline-offset: 3px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 10px; top: 10px; z-index: 5; color: white; background: var(--navy); padding: .5rem; }
.eyebrow {
  color: var(--blue);
  margin-bottom: .42rem;
  font: 650 .73rem/1.45 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.subdued { color: var(--muted); font-size: .89rem; }
.lead { color: var(--muted); font-size: 1.1rem; max-width: 65ch; margin: .55rem 0 1.4rem; }
.button-row { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.top {
  color: white;
  background: var(--navy);
  border-bottom: 1px solid #2e485a;
}
.top-inner {
  max-width: 1470px;
  min-height: 67px;
  padding: .5rem max(1rem, 2.2vw);
  margin: 0 auto;
  display: flex;
  gap: clamp(.8rem, 3vw, 3.5rem);
  align-items: center;
}
.top a { color: #d8e5ed; text-decoration: none; }
.top .brand { display: inline-flex; flex-shrink: 0; align-items: center; gap: .47rem; font-weight: 750; color: white; font-size: 1.13rem; letter-spacing: -.035em; }
.brand img { border: 1px solid #3a586a; border-radius: 9px; }
.brand-quiet { color: #a8c2d4; font-weight: 500; }
.top-nav { display: flex; gap: clamp(.7rem, 2vw, 1.7rem); align-items: center; }
.top-nav a { padding: .5rem 0; font-size: .87rem; }
.top-nav a[aria-current="page"] { color: #ffb293; }
.access-link { margin-left: auto; text-align: center; border: 1px solid #527084; border-radius: 7px; padding: .37rem .78rem; white-space: nowrap; font-size: .85rem; }
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .55rem;
  border: 1px solid transparent;
  padding: .56rem .85rem;
  min-height: 42px;
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 650;
  line-height: 1.24;
}
.btn:hover { filter: brightness(.95); }
.primary { background: var(--navy); color: white; }
.quiet { border-color: #c7d7df; }
.tonal { color: #13415b; background: #e4f0f7; border-color: #c3dce8; }
.on-dark { color: #dce9ef; background: #183141; border-color: #4c6a7b; }
.danger { color: #922e29; background: #fff5f3; border-color: #ecc8c3; }

.hero {
  color: white;
  background: radial-gradient(ellipse at 78% 34%, #203e50 0, var(--navy) 50%, var(--deep) 100%);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.04fr .96fr;
  gap: clamp(1rem, 4vw, 4.5rem);
  align-items: center;
  max-width: 1300px;
  margin: 0 auto;
  padding: clamp(2rem, 7vw, 7.3rem) max(1.15rem, 4vw);
}
.hero h1 { font-size: clamp(2.65rem, 5.6vw, 5rem); letter-spacing: -.065em; line-height: 1.01; }
.hero .eyebrow { color: #a4c9d7; font-size: .75rem; margin-bottom: 1.05rem; }
.hero-copy > p:not(.eyebrow) { margin: 1.25rem 0 1.55rem; color: #c1d5e1; font-size: clamp(1rem, 1.65vw, 1.18rem); max-width: 42ch; }
.hero .primary { background: var(--orange-light); color: #231e1c; border-color: var(--orange-light); }
.hero-figure {
  background: #0d2534;
  border: 1px solid #3d5d70;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 25px 90px #08182390;
}
.hero-figure figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .3rem .65rem;
  color: #c4d8e5;
  padding: .75rem .9rem;
  background: #162f40;
  border-top: 1px solid #3d5d70;
  font-size: .8rem;
}
.hero-drawing { color: #d5e9f2; }
.drawing svg, .hero-drawing svg { width: 100%; height: auto; display: block; }
.home-more {
  max-width: 1260px;
  margin: 0 auto;
  padding: 2.1rem max(1.15rem, 4vw) 2.7rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(.8rem, 4vw, 3rem);
}
.home-more p { color: var(--muted); margin-top: .5rem; max-width: 37ch; }

#studio { max-width: 1510px; margin: 0 auto; padding: clamp(1rem, 2.2vw, 2rem); }
.workspace-top {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .6rem;
  margin-bottom: 1rem;
}
.workspace-top h1 { font-size: clamp(1.95rem, 3.3vw, 2.8rem); }
.workspace-top .subdued { margin-top: .35rem; }
.system-bar {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  align-items: center;
  margin: .3rem 0 1rem;
}
.segmented { display: inline-flex; align-items: stretch; gap: .2rem; background: #e0ebf1; border: 1px solid #d2e0e8; padding: .22rem; border-radius: 8px; }
.segmented button { border: 1px solid transparent; background: transparent; color: #435e6e; border-radius: 6px; padding: .4rem .62rem; font-size: .86rem; font-weight: 650; }
.segmented button[aria-pressed="true"] { background: white; color: var(--ink); border-color: #d4e3eb; box-shadow: 0 1px 3px #1b3a4e18; }
.designer {
  display: grid;
  grid-template-columns: 174px minmax(310px, 1.02fr) minmax(330px, 1fr);
  gap: clamp(.75rem, 1.3vw, 1.1rem);
  align-items: start;
}
.card, .gate {
  min-width: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(.95rem, 2.1vw, 1.5rem);
  box-shadow: 0 4px 11px #24425609;
}
.card + .card { margin-top: .85rem; }
.designer > .card { margin: 0; }
.design-nav { padding: .47rem; position: sticky; top: .6rem; }
.design-nav button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: .55rem;
  padding: .57rem .42rem;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-size: .84rem;
  font-weight: 580;
  min-height: 38px;
}
.design-nav button[aria-current="step"] { color: var(--blue); background: #e8f3f8; border-color: #d0e4ef; }
.design-nav button:hover { color: var(--ink); background: #edf4f8; }
.step-number { color: var(--blue); font: 600 .72rem ui-monospace, monospace; }
.step-header { margin-bottom: 1rem; }
.step-header h2 { font-size: 1.6rem; }
.step-header p:last-child { margin-top: .38rem; }
.field-group + .field-group { margin-top: 1.2rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.field-group h3 { margin-bottom: .55rem; }
.field-group > p { margin-bottom: .6rem; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .72rem; }
.field-grid .wide { grid-column: 1 / -1; }
label.field { display: flex; flex-direction: column; gap: .25rem; min-width: 0; font-size: .84rem; font-weight: 650; }
label.field em { font-style: normal; font-weight: 450; color: var(--muted); }
label.check {
  display: flex;
  align-items: flex-start;
  gap: .46rem;
  min-height: 36px;
  padding: .35rem 0;
  font-size: .85rem;
  font-weight: 580;
}
input[type="checkbox"] { width: 17px; height: 17px; margin: .13rem 0; accent-color: var(--blue); flex-shrink: 0; }
input[type="number"], input[type="text"], input[type="email"], select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 39px;
  background: #fbfdfe;
  border: 1px solid #afc6d1;
  border-radius: 6px;
  padding: .43rem .51rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 450;
}
textarea { resize: vertical; }
input::placeholder { color: #637d8c; }
.step-actions {
  display: flex;
  justify-content: space-between;
  gap: .6rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  margin-top: 1rem;
}
.layertable input { min-width: 48px; min-height: 37px; }
.layertable .unit { font-size: .73rem; color: var(--muted); }
.layer-remove {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: white;
  min-width: 33px;
  min-height: 34px;
}
.inspector {
  position: sticky;
  top: .65rem;
  padding: .95rem;
}
.inspector-head { display: flex; align-items: flex-end; justify-content: space-between; gap: .45rem; margin-bottom: .72rem; }
.scale-note { border: 1px solid var(--line); border-radius: 4px; padding: .12rem .3rem; font: .75rem ui-monospace, monospace; color: var(--muted); white-space: nowrap; }
.drawing-tabs { display: flex; flex-wrap: wrap; width: fit-content; max-width: 100%; margin-bottom: .65rem; }
.drawing {
  color: #d5e9f2;
  border-radius: 8px;
  overflow: hidden;
  background: #102a3c;
}
.drawing-foot { display: flex; flex-wrap: wrap; gap: .35rem .7rem; margin: .68rem 0 .45rem; color: var(--muted); font-size: .74rem; }
.swatch { display: inline-flex; align-items: center; gap: .28rem; }
.swatch::before { content: ""; width: .63rem; height: .63rem; border-radius: 50%; background: #95b2c3; border: 1px solid #63889f; }
.swatch.steel::before { background: #314b5d; }
.swatch.sma::before { background: #ea8465; border-color: #a54d34; }
.swatch.mortar::before { background: #a6d8e6; }
.swatch.cfrp::before { background: #e0de8b; border-color: #827e38; }
.material-tabs { margin-top: .6rem; }
.basis-panel { margin: .8rem 0; padding: .8rem; background: #eef6fa; border: 1px solid #cedfe8; border-radius: 8px; }
.basis-panel p { margin: .22rem 0 .5rem; font-size: .85rem; color: #38556a; }
.basis-panel a { display: inline-block; margin-right: .75rem; font-size: .82rem; font-weight: 650; }
#drawing-note { font-size: .82rem; }
#drawing-controls:not(:empty) { margin: .55rem 0; }
#future-system { margin-bottom: .75rem; }
#future-system p { margin-top: .55rem; max-width: 65ch; }

.contained { max-width: 1110px; min-height: 64vh; margin: 0 auto; padding: clamp(1rem, 4vw, 2.8rem); }
.gate { margin: .6rem 0 2rem; max-width: 700px; }
.gate p { margin: .45rem 0 .8rem; }
.gate .btn + .btn { margin-left: .25rem; }
.site-footer {
  max-width: 1470px;
  margin: 0 auto;
  padding: 1.15rem max(1.1rem, 3vw);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .81rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .4rem;
}
.sep { margin: 0 .3rem; opacity: .67; }

.note, .notice { padding: .59rem .68rem; border-radius: 6px; margin: .66rem 0; font-size: .83rem; }
.note { color: #23495e; background: #e8f3f8; }
.notice { color: var(--warn); background: var(--warn-bg); }
.error { color: var(--fail); background: var(--fail-bg); }
.ok { color: var(--green); background: var(--green-bg); }
table { width: 100%; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums; }
th, td { border-bottom: 1px solid var(--line); padding: .46rem .4rem; vertical-align: top; }
th { font-size: .75rem; color: var(--muted); }
td { font-size: .85rem; }
.table-wrap { overflow-x: auto; }
.pill { font-size: .74rem; line-height: 1.2; font-weight: 690; background: #edf2f6; padding: .2rem .4rem; border-radius: 5px; display: inline-block; white-space: nowrap; }
.pill.pass, .pill.confirmed, .pill.active { color: var(--green); background: var(--green-bg); }
.pill.fail, .pill.revoked { color: var(--fail); background: var(--fail-bg); }
.pill.review, .pill.expired { color: var(--warn); background: var(--warn-bg); }
#print-report { display: none; }
details { margin-top: .65rem; }
summary { cursor: pointer; font-weight: 650; }
.mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .65rem; }
.metric, .product-info { border: 1px solid var(--line); border-radius: 7px; background: #f6fafc; padding: .67rem; }
.metric span, .product-info small { display: block; color: var(--muted); font-size: .78rem; }
.metric strong { display: block; overflow-wrap: anywhere; margin-top: .2rem; font-size: 1.06rem; }
.product-info strong { color: var(--orange); }
.case-result + .case-result { border-top: 1px solid var(--line); padding-top: .75rem; margin-top: .9rem; }
.case-result .mini-grid { margin: .5rem 0; }
.result-method { margin-top: 1rem; margin-bottom: .8rem; padding-bottom: .4rem; border-bottom: 1px solid var(--line); color: var(--blue); }
.compare-result { margin: .8rem 0; border: 1px solid var(--line); border-radius: 8px; padding: .8rem; background: #f6fafc; }
.compare-result .table-wrap { margin-top: .5rem; }
.compare-result table { min-width: 420px; }
.input-issues { margin: .5rem 0 .8rem; padding-inline-start: 1.4rem; }
.example-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; margin-bottom: 1rem; }
.example-grid .example-card { display: flex; flex-direction: column; margin: 0; align-items: flex-start; gap: .55rem; }
.example-card .eyebrow { margin: 0; }
.example-ref { color: var(--blue); font-size: .82rem; font-weight: 650; }
.example-summary { font-size: .88rem; font-weight: 675; }
.example-card .btn { margin-top: auto; }
.example-history details { border-top: 1px solid var(--line); margin-top: .9rem; padding-top: .7rem; }
.example-history details p { margin: .55rem 0; }
.example-history > p { margin-top: .5rem; }
.example-notes dt { font-weight: 650; }
.example-notes dd { margin: .2rem 0 .75rem; color: var(--muted); }
.site-footer a { color: inherit; }
.result-tab { margin: .6rem 0; }
.checklist { padding: 0; list-style: none; }
.checklist li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.checklist li p { margin: .18rem 0; font-size: .83rem; }
.checklist li small { color: var(--muted); }
.checklist .pill { margin-right: .4rem; }
.access-grid { display: grid; grid-template-columns: .72fr 1.28fr; gap: .85rem; margin-top: .8rem; }
.access-grid .card { margin: 0; }
.access-grid .field { margin: .65rem 0; }
.access-grid td:first-child { word-break: break-word; }
.operator-notice { margin-top: .8rem; }

@media (max-width: 1120px) {
  .designer { grid-template-columns: 142px minmax(280px, 1fr) minmax(270px, .88fr); }
  .design-nav button { gap: .33rem; font-size: .79rem; }
}
@media (max-width: 900px) {
  .designer { grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); }
  .design-nav { grid-column: 1 / -1; position: static; display: flex; gap: .25rem; flex-wrap: wrap; }
  .design-nav button { width: auto; min-height: 36px; }
}
@media (max-width: 690px) {
  .top-inner { gap: .5rem .8rem; flex-wrap: wrap; }
  .top-nav { order: 3; width: 100%; gap: .4rem 1rem; flex-wrap: wrap; }
  .top-nav a { padding: .25rem 0; }
  .hero-inner, .designer, .access-grid, .example-grid { grid-template-columns: 1fr; }
  .hero-inner { padding: 2.1rem 1rem; }
  .home-more { grid-template-columns: 1fr; gap: 1.1rem; }
  .inspector { position: static; }
  .designer .inspector { grid-row: 2; }
  .designer .editor { grid-row: 3; }
  .drawing { max-width: 100%; }
  .inspector .drawing svg { max-height: 305px; margin: auto; }
}
@media (max-width: 370px) {
  .field-grid, .mini-grid { grid-template-columns: 1fr; }
  .segmented button { padding-inline: .45rem; }
}
@media print {
  body { background: #fff; color: #111; font-size: 10pt; }
  body > :not(#print-report) { display: none !important; }
  #print-report { display: block !important; }
  #print-report h1 { font-size: 19pt; }
  #print-report h2 { font-size: 13pt; margin-top: 12pt; }
  #print-report .checklist li, #print-report tr, #print-report figure { break-inside: avoid; }
  #print-report .drawing { max-width: 117mm; print-color-adjust: exact; }
}
/* Account and developer controls */
.brand-domain { font-size: .56em; font-weight: 500; color: #486779; margin-left: 2px; }
.auth-card { max-width: 560px; margin: 32px auto; }
.auth-card form { margin-top: 24px; }
#key-value { font-family: ui-monospace, Consolas, monospace; }
