/* Type, after the Collective deck: DM Mono Light capitals for titles and labels, Bahnschrift for
   figures, interface and (condensed) reading text, Swiss 721 Bold Outline for the few display words.
   The files sit in fonts/ (kept out of git, see fonts/README.md). */
@font-face {
  font-family: 'Bahnschrift';
  src:
    local('Bahnschrift');
  font-weight: 300 700;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: 'Myriad Pro';
  src:
    local('Myriad Pro'),
    local('MyriadPro-Regular');
  font-display: swap;
}
@font-face {
  font-family: 'DM Mono';
  src:
    local('DM Mono Light'),
    url('./fonts/DMMono-Light.ttf') format('truetype');
  font-weight: 300 400;
  font-display: swap;
}
@font-face {
  font-family: 'DM Mono';
  src:
    local('DM Mono Medium'),
    url('./fonts/DMMono-Medium.ttf') format('truetype');
  font-weight: 500 700;
  font-display: swap;
}
@font-face {
  font-family: 'Swiss Outline';
  src:
    local('Swis721 BdOul BT');
  font-display: swap;
}
* {
  box-sizing: border-box;
}
:root {
  --sans: Bahnschrift, 'DIN Alternate', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --text: 'Myriad Pro', Myriad, 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --mono: 'DM Mono', 'SF Mono', ui-monospace, 'PingFang SC', 'Microsoft YaHei', monospace;
  --display: 'Swiss Outline', var(--sans);
  --paper: #eeeee9;
  --ink: #242829;
  --muted: #6d7474;
  --line: #c6c9c5;
  --accent: #b8754c;
  --dark: #252b2e;
}
html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
  background: var(--paper);
  color: var(--ink);
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  color: inherit;
  border: 1px solid var(--line);
  background: transparent;
  padding: 10px 14px;
  transition:
    background 0.2s,
    color 0.2s;
}
button:hover {
  background: #dadcd8;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #6c8d9b;
  outline-offset: 4px;
}
button:disabled {
  opacity: 0.4;
  cursor: wait;
}
a {
  color: inherit;
}
h1,
h2,
h3,
p {
  margin: 0;
}
p {
  font-stretch: 80%;
}
h1,
h2,
h3 {
  font-weight: 400;
}
small,
.micro {
  font-size: 10px;
  line-height: 1.55;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.muted {
  color: var(--muted);
}
.mono {
  font-family: var(--mono);
  font-size: 11px;
}
.dark {
  background: var(--dark);
  color: #fff;
  border-color: var(--dark);
}
.dark:hover {
  background: #485153;
}
.pill {
  border-radius: 30px;
}
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 21px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: 24px;
  letter-spacing: -1.2px;
}
.brand svg {
  width: 25px;
  height: 30px;
}
.brand small {
  display: block;
  font-size: 8px;
  letter-spacing: 0.11em;
  margin-top: 3px;
}
.topbar {
  height: 79px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  gap: 24px;
}
.topbar nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar nav button {
  border: 0;
  font-size: 11px;
  padding: 12px;
}
.topbar nav button.active {
  border-bottom: 1px solid var(--ink);
}
.topbar .language {
  border: 1px solid var(--line);
  padding: 7px 12px;
  font-size: 11px;
}
.topbar .right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.studio-credit {
  font-size: 10px;
  line-height: 1.6;
}
.page-footer {
  padding: 16px 34px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 10px;
  color: var(--muted);
}
.home {
  padding: 30px 3.4vw 0;
  min-height: 100svh;
  background: #dedfdd;
}
.home .topbar {
  background: #e8e9e5;
  border: 1px solid #bec3c0;
  border-bottom: 0;
  padding: 0 24px;
  height: 72px;
}
.home-shell {
  height: min(690px, calc(100svh - 150px));
  min-height: 510px;
  display: grid;
  grid-template-columns: minmax(0, 71fr) minmax(0, 29fr);
  border: 1px solid #bac0be;
}
.hero-left {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: #8d9292;
}
.viewport {
  width: 100%;
  height: 100%;
  min-height: 340px;
  position: relative;
  overflow: hidden;
}
.viewport canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
}
.viewport[data-loading='true']:after {
  content: 'BUILDING SURFACE ···';
  position: absolute;
  top: 18px;
  right: 20px;
  font: 10px var(--mono);
  letter-spacing: 0.12em;
  color: #454e51;
  background: #eeeee9dd;
  padding: 9px 13px;
  pointer-events: none;
}
.hero-left .viewport {
  position: absolute;
  inset: 0;
  min-height: 0;
}
.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #1e242549, transparent 65%);
  pointer-events: none;
}
.hero-vertical {
  position: absolute;
  top: 34px;
  left: 20px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--display);
  font-size: clamp(32px, 4.3vw, 66px);
  font-weight: 400;
  letter-spacing: 0;
  color: #f7f7f3;
  pointer-events: none;
}
.hero-vertical b {
  font-weight: 400;
}
.glass-orb {
  position: absolute;
  width: min(43%, 390px);
  aspect-ratio: 1;
  container-type: inline-size;
  left: 12%;
  top: 20%;
  border-radius: 50%;
  border: 1px solid #ffffff69;
  background: linear-gradient(135deg, #f2f5f128, #c4cbcb18 55%, #161d211c);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 7%;
  color: white;
  pointer-events: none;
}
.glass-orb h1 {
  font-size: clamp(20px, 16cqi, 57px);
  line-height: 1.02;
  letter-spacing: -0.06em;
  margin: 0.3em 0;
}
.glass-orb p {
  font-size: 11px;
  line-height: 1.65;
  max-width: 170px;
}
.hero-index {
  position: absolute;
  right: 27px;
  top: 26px;
  color: white;
  display: flex;
  gap: 25px;
}
.hero-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  border-top: 1px solid #ffffff63;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 17px 24px;
  background: #333c3d20;
  font-size: 10px;
}
.hero-bottom button {
  color: white;
  border-color: #ffffff70;
  border-radius: 30px;
  font-size: 10px;
}
.hero-cross {
  position: absolute;
  right: 12%;
  top: 41%;
  color: #f8f8f5;
  font: 28px monospace;
  pointer-events: none;
}
.hero-caption {
  position: absolute;
  right: 25px;
  bottom: 92px;
  text-align: right;
  color: white;
  font-size: 10px;
  line-height: 1.8;
  letter-spacing: 0.08em;
  pointer-events: none;
}
.wheel-panel {
  position: relative;
  overflow: hidden;
  background: #f5f5f0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 24px;
}
.wheel-ring {
  position: absolute;
  width: 580px;
  height: 580px;
  border: 1px solid #b8bcb9;
  border-radius: 50%;
  top: 50%;
  left: 20px;
  transform: translateY(-50%);
  pointer-events: none;
}
.wheel-ring:after {
  content: '';
  position: absolute;
  inset: 35px;
  border: 1px dashed #c5cac5;
  border-radius: 50%;
}
.wheel-panel > small {
  position: relative;
  z-index: 1;
}
.wheel-options {
  display: flex;
  flex-direction: column;
  position: relative;
  gap: 25px;
  margin: 22px 0;
  padding-left: 14px;
}
.wheel-item {
  border: 0;
  text-align: left;
  padding: 15px 12px 15px 26px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: clamp(16px, 1.8vw, 26px);
  color: #969b99;
  background: none;
  position: relative;
  letter-spacing: -0.04em;
}
.wheel-item:hover {
  background: none;
  color: #333;
}
.wheel-item small {
  font-size: 9px;
  letter-spacing: 0.08em;
}
.wheel-item.selected {
  color: #1e2527;
  font-weight: 600;
}
.wheel-item.selected:before {
  content: '↗';
  position: absolute;
  left: -13px;
  top: 18px;
  background: #272e30;
  color: #fff;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  text-align: center;
  line-height: 29px;
  font-weight: 400;
}
.wheel-item:nth-child(2) {
  margin-left: 22px;
}
.wheel-enter {
  position: relative;
  z-index: 1;
}
.wheel-enter p {
  font-size: 12px;
  line-height: 1.65;
  color: #747c7a;
  min-height: 58px;
  margin-bottom: 20px;
}
.wheel-enter button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.home-footer {
  display: flex;
  justify-content: space-between;
  padding: 18px 0;
  color: #616968;
  font-size: 10px;
}
.home-footer a {
  text-decoration: none;
}
.home-footer span {
  max-width: 60%;
}
.page-head {
  padding: 30px 34px 25px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.page-head h1 {
  font: 300 clamp(28px, 2.9vw, 40px) / 1.12 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin: 9px 0;
}
/* The deck's chapter number: bold, raised and to the left of the title. */
.head-title {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.head-no {
  font: 700 34px / 1 var(--sans);
  margin-top: -6px;
}
.page-head p {
  font-size: 14px;
  color: var(--muted);
  max-width: 620px;
  line-height: 1.7;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.page-head .actions {
  justify-content: flex-end;
  align-items: center;
}
.actions button,
.actions select {
  font-size: 11px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 0 34px;
}
.stat {
  padding: 20px 22px;
  border-right: 1px solid var(--line);
}
.stat:first-child {
  padding-left: 0;
}
.stat:last-child {
  border: 0;
}
.stat strong {
  display: block;
  font-weight: 400;
  font-size: 32px;
  letter-spacing: -1.4px;
  margin: 7px 0;
}
.stat strong small {
  font-size: 12px;
  letter-spacing: 0;
}
.stat > small {
  color: var(--muted);
}
.bank-layout {
  display: grid;
  grid-template-columns: minmax(0, 37fr) minmax(0, 63fr);
  margin: 24px 34px 36px;
  border: 1px solid var(--line);
}
.inventory {
  border-right: 1px solid var(--line);
  min-width: 0;
}
.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}
.filters input {
  grid-column: span 2;
}
.filters input,
.filters select {
  min-width: 0;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 11px;
}
.material-list {
  max-height: 630px;
  overflow: auto;
}
@media (min-width: 901px) {
  .bank-layout > .inventory {
    display: flex;
    flex-direction: column;
  }
  .bank-layout .material-list {
    flex: 1 1 0;
    min-height: 420px;
    max-height: none;
  }
}
.material-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #d8dad5;
  text-align: left;
  display: grid;
  grid-template-columns: 55px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 18px;
  background: transparent;
}
.material-row.active {
  background: #dfe3df;
}
.material-row h3 {
  font-size: 13px;
  margin-bottom: 6px;
}
.material-row .id {
  font: 10px var(--mono);
  color: var(--muted);
}
.material-row .size {
  font: 11px var(--sans);
  text-align: right;
}
.material-row svg {
  width: 50px;
  height: 40px;
}
.material-detail {
  min-width: 0;
}
.detail-heading {
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.detail-heading h2 {
  font-size: 25px;
  letter-spacing: -0.8px;
}
.tag {
  font: 9px var(--mono);
  padding: 5px 7px;
  border: 1px solid var(--line);
  display: inline-block;
}
.model-wrap {
  height: 360px;
  position: relative;
  background: #e9e9e5;
}
.model-tools {
  position: absolute;
  top: 14px;
  left: 17px;
  display: flex;
  gap: 5px;
  z-index: 1;
}
.model-tools button {
  background: #eeeeeadb;
  font-size: 10px;
  padding: 7px 10px;
}
.model-meta {
  position: absolute;
  bottom: 15px;
  right: 20px;
  font: 10px var(--mono);
  color: #626b6c;
}
.detail-body {
  padding: 22px 24px;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-bottom: 22px;
}
.detail-grid label {
  display: block;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 7px;
}
.detail-grid span {
  font-size: 12px;
}
.note {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
  margin: 12px 0;
}
.tabs {
  display: flex;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 0 34px;
  overflow: auto;
}
.tabs button {
  flex: 1;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 17px 20px;
  display: flex;
  gap: 18px;
  align-items: center;
  white-space: nowrap;
  font-size: 12px;
}
.tabs button.active {
  background: var(--dark);
  color: white;
}
.tabs button small {
  opacity: 0.55;
}
.studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  margin: 0 34px 25px;
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.studio-canvas {
  min-height: 580px;
  position: relative;
  min-width: 0;
}
.studio-canvas .viewport {
  min-height: 100%;
}
.canvas-title {
  position: absolute;
  bottom: 22px;
  left: 23px;
  pointer-events: none;
}
.canvas-title h2 {
  margin-bottom: 8px;
}
.canvas-title p {
  font-size: 11px;
  max-width: 450px;
  color: #6b7473;
  line-height: 1.6;
}
.side-panel {
  border-left: 1px solid var(--line);
  padding: 22px;
}
.side-panel h2 {
  font-size: 21px;
  letter-spacing: -0.5px;
  margin: 9px 0 20px;
}
.side-panel label {
  display: block;
  font-size: 11px;
  margin: 17px 0 8px;
}
.side-panel input[type='range'] {
  width: 100%;
  accent-color: #384347;
}
.side-panel input[type='checkbox'] {
  accent-color: #384347;
}
.side-panel select,
.side-panel input[type='number'] {
  width: 100%;
  border: 1px solid var(--line);
  background: transparent;
  padding: 9px;
  font-size: 11px;
}
.side-panel .actions {
  margin-top: 12px;
}
.side-panel .actions button {
  flex: 1;
}
/* Two equal columns when a panel ends with several actions. */
.grid-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-actions button {
  white-space: normal;
  line-height: 1.25;
}
/* Saw kerf: a labelled number field under the processing figures. */
.kerf {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  font-size: 12px;
}
.kerf input {
  width: 76px;
  border: 1px solid var(--line);
  background: #fff;
  color: inherit;
  padding: 8px 10px;
  font-size: 12px;
}
.range-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-top: 16px;
}
.side-panel select + .data-pair {
  margin-top: 6px;
}
.side-panel hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 22px 0;
}
.data-pair {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  padding: 9px 0;
  border-bottom: 1px solid #d4d7d1;
  gap: 10px;
}
.data-pair span:last-child {
  font-family: var(--sans);
  text-align: right;
}
.warning {
  border-left: 2px solid var(--accent);
  padding: 10px 12px;
  background: #b8754c0d;
  font-size: 11px;
  line-height: 1.6;
  margin: 13px 0;
}
.success {
  font-size: 11px;
  color: #4f665d;
  padding: 10px 0;
}
.report {
  margin: 26px 34px 45px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
}
.section-head h2,
.canvas-title h2 {
  font: 300 22px / 1.2 var(--mono);
  text-transform: uppercase;
}
.table-scroll {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
th {
  text-align: left;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 400;
  padding: 13px 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 13px 12px;
  border-bottom: 1px solid #d5d8d2;
  font-family: var(--sans);
  white-space: nowrap;
}
tr[data-edge] {
  cursor: pointer;
}
tr[data-edge]:hover {
  background: #e0e4dd;
}
tr.selected {
  background: #e1e5df;
}
.trim-text {
  color: #99613d;
}
.legend {
  display: flex;
  gap: 18px;
  align-items: center;
  font-size: 10px;
}
.legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #666;
  display: inline-block;
  margin-right: 5px;
}
.legend i.cut {
  background: var(--accent);
}
.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin: 24px 34px;
}
.overview-card {
  background: var(--paper);
  padding: 20px;
}
.overview-card img {
  width: 100%;
  aspect-ratio: 1.5;
  object-fit: cover;
  display: block;
}
.overview-card h2 {
  font-size: 20px;
  margin: 15px 0 8px;
}
.overview-card p {
  font-size: 11px;
  color: var(--muted);
}
.overview-card:last-child {
  grid-column: span 2;
}
.overview-card:last-child img {
  aspect-ratio: 2.4;
}
.project-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  border: 1px solid var(--line);
  margin: 0 34px 35px;
}
.project-visual {
  min-height: 450px;
  display: flex;
  flex-direction: column;
}
.project-visual > .viewport {
  flex: 1;
}
.project-info {
  padding: 35px;
  border-left: 1px solid var(--line);
}
.project-info h2 {
  font-size: 30px;
  margin: 20px 0;
  letter-spacing: -1px;
}
.project-info p {
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
}
.project-info .actions {
  margin-top: 25px;
}
/* Pavilion: the model on a dark stage (black for Points and Wire, as in the film), labels over it in
   mono capitals, and a slim panel of controls underneath. */
.pavilion-layout {
  display: grid;
  margin: 0 34px 35px;
  border: 1px solid var(--line);
}
.pav-stage {
  position: relative;
  /* Stage and panel fit the first screen of the section (heading included), so the controls are in
     view whenever the model is. */
  height: clamp(380px, calc(100svh - 372px), 760px);
  overflow: hidden;
  background: #000 var(--pav-ground, none) center / 104px 60px;
  color: #fff;
}
/* Grid: the site's dashed diamond ground, in white on the black stage. */
.pav-stage[data-ground='grid'] {
  --pav-ground: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='104' height='60'%3E%3Cpath d='M0 0L104 60M0 60L104 0' stroke='%23fff' stroke-opacity='.16' stroke-dasharray='5 6' fill='none'/%3E%3C/svg%3E");
}
.pav-stage .viewport {
  position: absolute;
  inset: 0;
  min-height: 0;
  cursor: grab;
}
.pav-stage .viewport:active {
  cursor: grabbing;
}
/* Turn: a switch over the stage's corner; the dot spins while the model does. */
.pav-turn {
  position: absolute;
  right: 16px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font: 300 11px / 1.4 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.pav-turn i {
  width: 11px;
  height: 11px;
  border: 1px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
}
.pav-turn[aria-pressed='true'] i {
  animation: pav-spin 2.4s linear infinite;
}
@keyframes pav-spin {
  to {
    transform: rotate(1turn);
  }
}
.pav-turn[aria-pressed='false'] {
  color: rgba(255, 255, 255, 0.6);
}
.pav-stage :is(.pav-meta, .pav-detail, .pav-status, .pav-callout) {
  position: absolute;
  font: 300 11px / 1.5 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  pointer-events: none;
}
.pav-meta {
  top: 18px;
  left: 20px;
  right: 20px;
  color: rgba(255, 255, 255, 0.55);
}
.pav-detail {
  left: 20px;
  right: 130px;
  bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  color: rgba(255, 255, 255, 0.62);
}
.pav-detail b {
  font-weight: 400;
  color: #fff;
}
.pav-callout {
  top: 0;
  left: 0;
  padding: 6px 9px 5px;
  background: #fff;
  color: #0c0d0e;
  font-weight: 400;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.12s;
}
.pav-callout.on {
  opacity: 1;
}
/* Loading: one quiet line and a hairline of progress in the middle of the stage. */
.pav-status {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, 0.78);
  text-align: center;
}
.pav-status[hidden] {
  display: none;
}
.pav-status small {
  font: inherit;
}
.pav-status b {
  font: 400 26px / 1 var(--sans);
  letter-spacing: 0;
}
.pav-status i {
  position: relative;
  width: 168px;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
}
.pav-status i::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--p, 0) * 100%);
  background: #fff;
}
.pav-status em {
  max-width: 320px;
  font-style: normal;
  text-transform: none;
  color: rgba(255, 255, 255, 0.5);
}
/* One row when it fits, spread across the panel; what wraps starts again at the left edge. */
.pav-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 22px;
  padding: 12px 16px;
}
.pav-group,
.pav-parts [data-pav-parts],
.pav-explode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.pav-panel small {
  margin-right: 10px;
  font-family: var(--mono);
  color: var(--muted);
}
.pav-panel button {
  padding: 7px 11px;
  font-size: 11px;
}
.pav-panel button[aria-pressed='true'] {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}
/* Part filters read as switches: a square filled while the part shows; the count in mono. */
.pav-parts button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.pav-parts button[aria-pressed] {
  background: transparent;
  border-color: var(--line);
  color: inherit;
}
.pav-parts button[aria-pressed='false'] {
  color: var(--muted);
}
.pav-parts button i {
  width: 7px;
  height: 7px;
  border: 1px solid currentColor;
}
.pav-parts button[aria-pressed='true'] i {
  background: currentColor;
}
.pav-parts button small {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0;
}
.pav-explode {
  gap: 0;
}
.pav-explode input {
  width: 112px;
  accent-color: #384347;
}
.pav-explode output {
  width: 5ch;
  font: 11px var(--mono);
  text-align: right;
}
@media (max-width: 700px) {
  .pav-stage {
    height: clamp(340px, 58svh, 520px);
  }
  /* On a phone each group stacks: its label above, its buttons on an even grid. */
  .pav-panel {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 14px;
  }
  .pav-group,
  .pav-explode {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }
  .pav-panel :is(.pav-group, .pav-explode) > small {
    grid-column: 1 / -1;
    margin: 0 0 4px;
  }
  .pav-parts {
    display: block;
  }
  .pav-parts [data-pav-parts] {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }
  .pav-parts button small {
    margin-left: auto;
  }
  .pav-explode {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .pav-explode input {
    width: auto;
    margin: 0;
  }
}
dialog {
  width: min(640px, 94vw);
  border: 1px solid #a7b0ac;
  background: var(--paper);
  padding: 30px;
  color: var(--ink);
  max-height: 90svh;
  overflow: auto;
  overscroll-behavior: contain;
}
/* The page behind an open dialog stays where it was. */
html:has(dialog[open]) {
  overflow: hidden;
}
dialog::backdrop {
  background: #17202380;
  backdrop-filter: blur(4px);
}
.modal-head {
  position: sticky;
  top: -30px;
  z-index: 1;
  margin-top: -30px;
  padding-top: 30px;
  background: var(--paper);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.modal-head h2 {
  font-size: 25px;
}
.modal-head button {
  border: 0;
  font-size: 25px;
  padding: 0 7px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
}
.form-grid label {
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.form-grid input,
.form-grid select,
.form-grid textarea {
  padding: 10px;
  border: 1px solid var(--line);
  background: transparent;
  width: 100%;
  min-width: 0;
}
.form-grid .wide {
  grid-column: span 2;
}
.modal-body p {
  font-size: 12px;
  line-height: 1.8;
  margin: 13px 0;
}
.modal-body .actions {
  margin-top: 24px;
}
#toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #263034;
  color: white;
  padding: 14px 22px;
  font-size: 12px;
  z-index: 30;
  max-width: 90vw;
  transition: transform 0.3s;
}
.hidden {
  display: none !important;
}
#toast.visible {
  transform: translateX(-50%) translateY(0);
}
.empty {
  padding: 30px;
  color: var(--muted);
  font-size: 12px;
}
.error-screen {
  padding: 50px;
}
@media (min-width: 1600px) {
  .home {
    padding-top: 50px;
  }
  .home-shell {
    height: 760px;
  }
  .studio-canvas {
    min-height: 680px;
  }
}
@media (max-width: 1050px) {
  .topbar {
    padding: 0 20px;
    gap: 12px;
  }
  .topbar nav {
    gap: 0;
  }
  .topbar nav button {
    font-size: 10px;
    padding: 9px;
  }
  .studio-credit {
    display: none;
  }
  .home-shell {
    grid-template-columns: minmax(0, 66fr) minmax(0, 34fr);
  }
  .glass-orb {
    width: 64%;
    left: 14%;
    top: 22%;
    padding: 0 10%;
  }
  .hero-caption {
    display: none;
  }
  .wheel-panel {
    padding: 23px 17px;
  }
  .wheel-options {
    padding-left: 5px;
  }
  .wheel-item {
    padding-left: 16px;
  }
  .page-head,
  .report {
    margin-left: 0;
    margin-right: 0;
    padding-left: 20px;
    padding-right: 20px;
  }
  .stats,
  .tabs,
  .studio-layout,
  .bank-layout,
  .project-grid,
  .overview-grid {
    margin-left: 20px;
    margin-right: 20px;
  }
  .bank-layout {
    grid-template-columns: minmax(0, 40fr) minmax(0, 60fr);
  }
  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
  .studio-layout {
    grid-template-columns: minmax(0, 1fr) 270px;
  }
  .side-panel {
    padding: 17px;
  }
  .material-row {
    grid-template-columns: 35px 1fr;
    padding: 13px;
  }
  .material-row svg {
    width: 32px;
  }
  .material-row .size {
    grid-column: 2;
    text-align: left;
  }
  .wheel-item {
    font-size: 20px;
  }
  .hero-vertical {
    font-size: 52px;
    left: 12px;
  }
}
@media (max-width: 700px) {
  .topbar {
    height: auto;
    min-height: 74px;
    padding: 15px 16px;
    flex-wrap: wrap;
  }
  .brand {
    font-size: 22px;
  }
  .topbar nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
    border-top: 1px solid var(--line);
    padding-top: 9px;
  }
  .topbar nav button {
    font-size: 10px;
  }
  .topbar .right {
    margin-left: auto;
  }
  .topbar .save-button {
    display: none;
  }
  .home {
    padding: 12px 12px 0;
  }
  .home .topbar {
    padding: 0 15px;
    height: 65px;
  }
  .home .topbar .right {
    gap: 5px;
  }
  .home .topbar .right button {
    font-size: 10px;
  }
  .home-shell {
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
  }
  .hero-left {
    height: 440px;
  }
  .hero-vertical {
    font-size: 46px;
    top: 25px;
    left: 9px;
  }
  .glass-orb {
    left: 18%;
    top: 24%;
    width: 61%;
    padding: 0 11%;
    max-width: 310px;
  }
  .glass-orb h1 {
    font-size: 37px;
  }
  .glass-orb p {
    font-size: 10px;
  }
  .hero-index {
    font-size: 9px;
    gap: 10px;
    right: 16px;
  }
  .hero-bottom {
    padding: 12px;
    font-size: 9px;
  }
  .hero-bottom small {
    font-size: 8px;
  }
  .wheel-panel {
    min-height: 340px;
    padding: 24px;
  }
  .wheel-ring {
    width: 560px;
    height: 560px;
    left: 80px;
    top: 40%;
  }
  .wheel-options {
    gap: 5px;
    margin: 12px 0 22px;
  }
  .wheel-item {
    font-size: 22px;
    padding: 9px 15px 9px 27px;
  }
  .wheel-item.selected:before {
    left: -9px;
    top: 8px;
  }
  .wheel-item small {
    display: none;
  }
  .wheel-item:nth-child(2) {
    margin-left: 18px;
  }
  .wheel-enter p {
    min-height: 0;
    margin-bottom: 13px;
    max-width: 270px;
  }
  .wheel-enter button {
    max-width: 310px;
  }
  .home-footer {
    font-size: 8px;
    gap: 15px;
  }
  .home-footer span {
    max-width: 65%;
  }
  .page-head {
    padding: 24px 16px 20px;
    align-items: flex-start;
    flex-direction: column;
    gap: 17px;
  }
  .page-head h1 {
    font-size: 36px;
  }
  .page-head p {
    font-size: 11px;
  }
  .stats,
  .tabs,
  .studio-layout,
  .bank-layout,
  .project-grid,
  .overview-grid {
    margin-left: 12px;
    margin-right: 12px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .stat {
    padding: 15px !important;
    border-bottom: 1px solid var(--line);
  }
  .stat:nth-child(2) {
    border-right: 0;
  }
  .stat:nth-child(3),
  .stat:nth-child(4) {
    border-bottom: 0;
  }
  .stat strong {
    font-size: 28px;
  }
  .stat small {
    font-size: 9px;
  }
  .bank-layout {
    display: flex;
    flex-direction: column;
  }
  .inventory {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .material-list {
    max-height: 230px;
  }
  .material-row {
    grid-template-columns: 45px 1fr auto;
  }
  .material-row .size {
    grid-column: auto;
  }
  .filters {
    padding: 13px;
  }
  .model-wrap {
    height: 330px;
  }
  .detail-heading,
  .detail-body {
    padding: 18px;
  }
  .detail-grid {
    gap: 18px;
  }
  .studio-layout {
    grid-template-columns: 1fr;
  }
  .studio-canvas {
    height: 420px;
  }
  .side-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
    max-height: none;
    padding: 20px;
  }
  .side-panel h2 {
    margin: 8px 0 14px;
  }
  .tabs button {
    padding: 14px 12px;
    gap: 8px;
    font-size: 11px;
    flex: 0 0 auto;
  }
  .tabs button small {
    font-size: 9px;
  }
  .canvas-title {
    left: 16px;
    bottom: 18px;
  }
  .canvas-title h2 {
    font-size: 20px;
  }
  .canvas-title p {
    max-width: 260px;
    font-size: 9px;
  }
  .report {
    padding: 0 13px;
    margin-top: 22px;
  }
  .section-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .section-head h2 {
    font-size: 22px;
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
  .project-visual {
    height: 350px;
  }
  .project-info {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 22px;
  }
  .overview-grid {
    grid-template-columns: 1fr;
  }
  .overview-card:last-child {
    grid-column: auto;
  }
  .overview-card:last-child img {
    aspect-ratio: 1.5;
  }
  .page-footer {
    padding: 18px 15px;
    font-size: 9px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .wide {
    grid-column: auto;
  }
  dialog {
    padding: 22px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
@media print {
  .topbar,
  .page-head .actions,
  .model-tools,
  .page-footer,
  .tabs,
  .side-panel,
  #toast {
    display: none !important;
  }
  .overview-grid {
    display: block;
    margin: 0;
  }
  .overview-card {
    break-inside: avoid;
    border-bottom: 1px solid #ccc;
  }
  .overview-card img {
    max-height: 300px;
    object-fit: contain;
  }
  .report {
    margin: 15px 0;
  }
  .stats {
    margin: 0;
  }
  .table-scroll {
    overflow: visible;
  }
  dialog[open] {
    position: static;
    max-height: none;
    width: 100%;
    border: 0;
  }
  body:has(dialog[open]) #app {
    display: none;
  }
}
.side-panel label.range-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.side-panel .range-label output {
  font-family: var(--sans);
  white-space: nowrap;
}
@media (max-width: 700px) {
  .home .topbar {
    flex-wrap: nowrap;
  }
  .home .topbar .right button[data-page='projects'] {
    display: none;
  }
  .home .glass-orb {
    width: 64%;
    left: 19%;
    top: 24%;
    padding: 0 7%;
    height: auto;
    aspect-ratio: 1;
  }
  .home .glass-orb h1 {
    font-size: 30px;
    margin: 12px 0;
  }
  .home .glass-orb small {
    font-size: 8px;
  }
  .home .glass-orb p {
    font-size: 9px;
  }
}

.geometry-message {
  position: absolute;
  bottom: 100px;
  left: 20px;
  right: 20px;
  background: #fff3e7;
  padding: 14px;
  font-size: 13px;
  z-index: 5;
  border: 1px solid #b68660;
  pointer-events: none;
}
