/* design3d: direction B, "Print bed" (Avi, 2026-10-28). The dark textured
   bed of a 3D printer, warm cream text, filament orange for what matters,
   and faint layer lines behind the part. One look, dark only: every colour
   below is set explicitly. Phone first (REQ-D3.40). */

:root {
  --bg: #17140f;
  --bed: #2a2418;
  --panel: #221d14;
  --panel-2: #2f281c;
  --line: #3d3424;
  --ink: #f3ead8;
  --soft: #a89878;
  --hi: #ff7a1a;
  --hi-ink: #1a1006;
  --good: #7fcf8e;
  --bad: #ff8f7a;
  --f-body: "Space Grotesk", "Segoe UI", Arial, sans-serif;
  --f-mono: "IBM Plex Mono", Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body.d3 { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.5; overflow-x: clip; }
a { color: var(--hi); }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 2px solid var(--hi); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---- the frame ---- */
.d3-bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 8px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.d3-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1.1rem; letter-spacing: -.01em; }
.d3-brand i { width: 16px; height: 16px; background: var(--hi); border-radius: 3px; box-shadow: 3px 3px 0 #7a3a0a; display: block; }
.d3-nav { display: flex; gap: 2px 14px; flex-wrap: wrap; }
.d3-nav a { color: var(--soft); text-decoration: none; font-weight: 600; min-height: 40px; display: inline-flex; align-items: center; font-size: .95rem; }
.d3-nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--hi); }
.d3-account { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--soft); }
.d3-link { background: none; border: 0; padding: 0; font: inherit; color: var(--soft); text-decoration: underline; cursor: pointer; min-height: 40px; }
@media (max-width: 520px) { .d3-who { display: none; } .d3-nav { order: 3; width: 100%; } }

.d3-main { width: 100%; max-width: 1280px; margin: 0 auto; padding-inline: 16px; padding-block: 20px 48px; }
.d3-flash { display: grid; gap: 8px; margin-bottom: 14px; }
.d3-flash p { margin: 0; padding: 10px 12px; background: var(--panel-2); border-left: 3px solid var(--hi); }
.d3-flash p.error { border-left-color: var(--bad); }

.d3-h1 { font-size: clamp(1.7rem, 6vw, 2.4rem); line-height: 1.05; margin: 0; letter-spacing: -.02em; text-wrap: balance; }
.d3-muted { color: var(--soft); }
.d3-small { font-size: .88rem; }
.d3-mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.d3-error { color: var(--bad); display: block; }

.d3-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border: 0; border-radius: 10px; background: var(--hi); color: var(--hi-ink); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.d3-btn:hover { filter: brightness(1.06); }
.d3-btn:disabled { opacity: .5; cursor: default; }
.d3-btn-quiet { background: var(--panel-2); color: var(--ink); }
.d3-btn-small { min-height: 38px; padding: 0 12px; font-size: .9rem; }
.d3-btn-danger { background: transparent; color: var(--bad); border: 1px solid var(--bad); }
.d3-google { background: #fff; color: #222; width: 100%; min-height: 50px; }
.d3-google svg { width: 20px; height: 20px; }

.d3-bedbg { background-color: var(--bed); background-image: radial-gradient(rgba(255, 214, 150, .07) 1px, transparent 1.4px); background-size: 5px 5px; }

/* ---- the door and forms ---- */
.d3-door { display: grid; place-items: start center; padding-top: 6vh; }
.d3-card { width: 100%; max-width: 460px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 26px 22px; display: grid; gap: 14px; }
.d3-card p { margin: 0; }
.d3-form { display: grid; gap: 12px; }
.d3-field { display: grid; gap: 5px; font-weight: 600; font-size: .95rem; }
.d3-field input, .d3-field textarea, .d3-field select {
  font: inherit; font-size: 16px; font-weight: 400; width: 100%; min-height: 44px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink);
}
.d3-more summary { cursor: pointer; color: var(--soft); text-decoration: underline; min-height: 36px; display: inline-flex; align-items: center; font-size: .92rem; }
.d3-more[open] summary { margin-bottom: 10px; }
.d3-state { padding: 10px 12px; border-radius: 10px; background: var(--panel-2); }

/* ---- my designs and the gallery ---- */
.d3-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.d3-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 16px; }
.d3-dcard { display: grid; grid-template-rows: auto 1fr; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; color: var(--ink); text-decoration: none; min-width: 0; }
.d3-dcard:hover { border-color: var(--hi); }
.d3-dcard-pic { aspect-ratio: 4 / 3; max-width: 100%; overflow: hidden; display: grid; place-items: center; }
.d3-dcard-pic img { width: 100%; height: 100%; object-fit: cover; }
.d3-dcard-pic span { color: var(--soft); font-size: .9rem; }
.d3-dcard-text { padding: 10px 12px 12px; display: grid; gap: 2px; min-width: 0; }
.d3-dcard-text b { overflow-wrap: anywhere; }
.d3-chip { display: inline-block; font-family: var(--f-mono); font-size: .72rem; padding: 1px 8px; border-radius: 10px; background: var(--panel-2); color: var(--soft); }
.d3-chip.on { background: var(--hi); color: var(--hi-ink); }
.d3-empty { background: var(--panel); border: 1px dashed var(--line); border-radius: 12px; padding: 22px; display: grid; gap: 10px; justify-items: start; }
.d3-empty p { margin: 0; }

/* ---- a design: phone first ---- */
.d3-work { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.d3-work > * { min-width: 0; }
.d3-view { position: relative; height: 46vh; min-height: 260px; border-radius: 14px; overflow: hidden; }
.d3-view canvas { display: block; width: 100% !important; height: 100% !important; touch-action: none; }
.d3-layers { position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255,122,26,.05) 0 2px, transparent 2px 6px); pointer-events: none; }
.d3-view-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; color: var(--soft); }
.d3-size { position: absolute; left: 10px; bottom: 8px; font-family: var(--f-mono); font-size: .78rem; color: var(--soft); background: rgba(23,20,15,.7); padding: 2px 8px; border-radius: 6px; }
.d3-busy { position: absolute; right: 10px; top: 10px; font-family: var(--f-mono); font-size: .78rem; color: var(--hi-ink); background: var(--hi); padding: 3px 10px; border-radius: 10px; }
.d3-view-acts { position: absolute; right: 10px; bottom: 8px; display: flex; gap: 6px; }

.d3-tools { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.d3-tools > summary { list-style: none; cursor: pointer; padding: 12px 14px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
.d3-tools > summary::-webkit-details-marker { display: none; }
.d3-tools-body { padding: 0 14px 14px; display: grid; gap: 16px; }
.d3-tools h3 { margin: 0 0 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--soft); font-weight: 600; }
.d3-slider { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; font-size: .9rem; }
.d3-slider output { font-family: var(--f-mono); font-variant-numeric: tabular-nums; color: var(--hi); }
.d3-slider input { grid-column: 1 / -1; width: 100%; accent-color: var(--hi); min-height: 32px; }
.d3-versions { display: flex; flex-wrap: wrap; gap: 6px; }
.d3-versions a, .d3-versions span { font-family: var(--f-mono); font-size: .8rem; padding: 4px 10px; border-radius: 10px; background: var(--panel-2); color: var(--ink); text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.d3-versions .on { background: var(--hi); color: var(--hi-ink); }
.d3-versions .failed { color: var(--bad); }
.d3-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.d3-row form { margin: 0; }

.d3-chat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; min-height: 320px; }
.d3-msgs { padding: 14px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; max-height: 60vh; }
.d3-msg { max-width: 88%; padding: 9px 12px; border-radius: 14px 14px 14px 4px; background: var(--panel-2); overflow-wrap: anywhere; }
.d3-msg-text { white-space: pre-wrap; }
.d3-msg.person { align-self: flex-end; background: var(--hi); color: var(--hi-ink); border-radius: 14px 14px 4px 14px; }
.d3-msg.failed { border: 1px solid var(--bad); }
.d3-msg .d3-assume { margin: 8px 0 0; padding-left: 18px; font-size: .88rem; color: var(--soft); white-space: normal; }
.d3-msg .d3-built { margin-top: 6px; font-family: var(--f-mono); font-size: .76rem; color: var(--soft); }
.d3-msg .d3-trail { margin-top: 8px; font-size: .8rem; color: var(--soft); white-space: normal; }
.d3-msg .d3-trail summary { cursor: pointer; }
.d3-msg .d3-trail ol { margin: 4px 0 0; padding-left: 0; list-style: none; display: grid; gap: 2px; }
.d3-msg .d3-trail li { overflow-wrap: anywhere; }
.d3-msg .d3-trail .d3-mono { display: inline-block; min-width: 3.4em; }
.d3-msg .d3-pics { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.d3-msg .d3-pics img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; }
.d3-thinking { color: var(--soft); font-style: italic; }
.d3-thinking::after { content: "…"; }
.d3-elapsed { font-size: .78rem; color: var(--soft); }
.d3-slow { display: block; margin-top: 4px; font-size: .82rem; color: var(--soft); }
@media (prefers-reduced-motion: no-preference) {
  .d3-msg.thinking .d3-thinking, .d3-msg.building .d3-thinking { animation: d3-breathe 1.6s ease-in-out infinite; }
  @keyframes d3-breathe { 50% { opacity: .45; } }
}
.d3-hello { color: var(--soft); font-size: .95rem; display: grid; gap: 6px; }
.d3-hello p { margin: 0; }

.d3-composer { border-top: 1px solid var(--line); padding: 10px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
.d3-compose-row { display: flex; gap: 8px; align-items: flex-end; }
.d3-compose-row textarea { flex: 1 1 0; width: 0; min-width: 0; font: inherit; font-size: 16px; min-height: 44px; max-height: 160px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 22px; background: var(--bg); color: var(--ink); resize: none; }
.d3-iconbtn { position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); color: var(--ink); border: 0; cursor: pointer; overflow: hidden; }
.d3-iconbtn.cam { background: var(--hi); color: var(--hi-ink); }
.d3-iconbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.d3-iconbtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
/* Say it (Avi, 2026-10-31): the mic turns red while it listens. */
.d3-iconbtn.d3-mic[aria-pressed="true"] { background: var(--bad); color: var(--hi-ink); }
.d3-iconbtn.d3-mic.d3-busy { opacity: .6; cursor: progress; }
.d3-recording { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 13px; color: var(--soft); }
.d3-rec-heard { color: var(--ink); }
.d3-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); animation: d3-rec 1s ease-in-out infinite; }
@keyframes d3-rec { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .d3-rec-dot { animation: none; } }
@media (max-width: 420px) {
  .d3-compose-row { gap: 6px; }
  .d3-compose-row .d3-iconbtn { width: 40px; height: 40px; }
}
.d3-chosen { display: flex; gap: 6px; flex-wrap: wrap; }
.d3-chosen img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.d3-limit { font-size: .86rem; color: var(--bad); }

/* a computer: the chat left, the part in the middle, sizes and versions right */
@media (min-width: 980px) {
  .d3-work { grid-template-columns: 340px minmax(0, 1fr) 260px; grid-template-areas: "chat view tools"; align-items: start; }
  .d3-chat { grid-area: chat; height: calc(100vh - 120px); position: sticky; top: 72px; }
  .d3-msgs { max-height: none; }
  .d3-viewcol { grid-area: view; }
  .d3-view { height: calc(100vh - 170px); }
  .d3-tools { grid-area: tools; }
  .d3-tools > summary { pointer-events: none; }
}
@media (max-width: 979px) {
  .d3-viewcol { order: 1; }
  .d3-tools { order: 2; }
  .d3-chat { order: 3; }
}

/* ---- Avi's people screen ---- */
.d3-people { display: grid; gap: 22px; max-width: 900px; }
.d3-people h2 { margin: 0 0 8px; font-size: 1.1rem; }
.d3-person { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); }
.d3-person-who { display: grid; min-width: 0; }
.d3-person-who span { overflow-wrap: anywhere; }
.d3-limit-form { display: flex; gap: 6px; align-items: center; }
.d3-limit-form input { width: 80px; font: inherit; font-size: 16px; min-height: 38px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }

/* Print-ready checks (D3.7) */
.d3-checks { margin-bottom: 10px; }
.d3-check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.d3-check { margin: 0; font-size: .86rem; line-height: 1.4; overflow-wrap: anywhere; }
.d3-check-list .d3-check { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; padding-left: 10px; border-left: 3px solid var(--line); }
.d3-check-list .d3-check > span { flex: 1 1 14em; min-width: 0; }
.d3-check-list .d3-warn { border-left-color: var(--bad); }
.d3-check-list .d3-note { border-left-color: var(--soft); color: var(--soft); }
.d3-ok { color: var(--good); }
.d3-warn { color: var(--bad); }
.d3-built .d3-warn { cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.d3-check-list .d3-warn > span { color: var(--ink); }
.d3-check-list .d3-fix { flex: none; }

/* The 3D view's tools: Point, Measure, Pinned (D3.9, Avi 2026-10-29) */
.d3-view-tools { position: absolute; left: 10px; top: 10px; display: flex; flex-wrap: wrap; gap: 6px; max-width: calc(100% - 120px); }
.d3-view-tools .d3-chip { border: 1px solid var(--line); background: rgba(23,20,15,.78); color: var(--ink); font-size: .78rem; padding: 6px 12px; min-height: 36px; cursor: pointer; }
.d3-view-tools .d3-chip[aria-pressed="true"] { background: var(--hi); color: var(--hi-ink); border-color: var(--hi); }
.d3-view-tools .d3-stick[aria-pressed="false"] { color: var(--soft); }
.d3-measure-label { position: absolute; left: 50%; bottom: 56px; transform: translateX(-50%); max-width: calc(100% - 20px); overflow-wrap: anywhere; text-align: center;
  background: #0f2a33; color: #bfefff; border: 1px solid #35d0ff; padding: 4px 10px; border-radius: 8px; font-size: .8rem; }
.d3-view[data-mode="pin"] canvas, .d3-view[data-mode="measure"] canvas { cursor: crosshair; }
.d3-pinned { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .86rem; color: #bfefff;
  border-left: 3px solid #35d0ff; padding-left: 10px; }
.d3-pinned > span { flex: 1 1 12em; min-width: 0; }
.d3-compose-foot { display: flex; justify-content: flex-end; }
.d3-done { text-decoration: none; }
.d3-msg .d3-pin-tag { display: inline-block; margin-top: 6px; font-family: var(--f-mono); font-size: .74rem; color: #bfefff; border: 1px solid #35d0ff; border-radius: 8px; padding: 1px 8px; }

/* On a phone the part stays at the top while the chat scrolls, unless the
   person unpins it. --d3-bar-h is the header's height, set by design.js. */
@media (max-width: 979px) {
  .d3-work:not(.d3-unstuck) .d3-viewcol { position: sticky; top: var(--d3-bar-h, 104px); z-index: 5; background: var(--bg); padding-bottom: 6px; }
  .d3-work:not(.d3-unstuck) .d3-view { height: 36vh; min-height: 220px; }
}
@media (min-width: 980px) { .d3-stick { display: none; } }

/* The Done page (D3.9) */
.d3-done-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.d3-done-grid > * { min-width: 0; }
.d3-done-acts { display: grid; gap: 18px; }
.d3-done-acts section { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.d3-done-acts form { margin: 0; }
.d3-h2 { margin: 0 0 10px; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--soft); font-weight: 600; }
@media (min-width: 980px) {
  .d3-done-grid { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  .d3-done-page .d3-view { height: calc(100vh - 220px); }
}

/* Invitations on the People screen (Avi, 2026-10-29) */
.d3-invite-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; max-width: 520px; }
.d3-invite-form input { width: 100%; min-width: 0; box-sizing: border-box; }
.d3-invite-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }

/* Several parts (Chapter 7) */
.d3-parts-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; }
.d3-parts-bar .d3-chip { border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); font-size: .78rem; padding: 6px 10px; min-height: 34px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.d3-parts-bar .d3-chip[aria-pressed="true"] { border-color: var(--hi); }
.d3-parts-bar .d3-part-chip[aria-pressed="false"] { opacity: .45; }
.d3-seg, .d3-part-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.d3-seg .d3-chip[aria-pressed="true"] { background: var(--hi); color: var(--hi-ink); }
.d3-explode { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--soft); flex: 1 1 160px; min-width: 0; }
.d3-explode input { flex: 1 1 0; width: 0; min-width: 0; accent-color: var(--hi); }
.d3-part-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.d3-partlist { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; }
.d3-partlist li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .88rem; }
.d3-partlist .d3-part-name { flex: 1 1 8em; min-width: 0; overflow-wrap: anywhere; }

/* A picture from the chat, full size (Avi, 2026-10-29) */
.d3-pic { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 8px; overflow: hidden; line-height: 0; }
.d3-lightbox { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--ink); padding: 12px;
  max-width: min(96vw, 900px); max-height: 92vh; }
.d3-lightbox::backdrop { background: rgba(10, 8, 5, .82); }
.d3-lightbox img { display: block; max-width: 100%; max-height: 74vh; margin: 0 auto 10px; border-radius: 8px; }

/* Home: back to the first view (Avi, 2026-10-29) */
.d3-home { position: absolute; right: 10px; bottom: 8px; width: 40px; height: 40px; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--line); border-radius: 10px; background: rgba(23,20,15,.78); color: var(--ink); cursor: pointer; }
.d3-home svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.d3-home:hover { border-color: var(--hi); }

/* The invitation link, ready to share (Avi, 2026-10-30) */
.d3-share { margin-top: 12px; padding: 12px; border: 1px solid var(--hi); border-radius: 12px; display: grid; gap: 10px; max-width: 560px; }
.d3-share p { margin: 0; overflow-wrap: anywhere; }
.d3-share-link { width: 100%; min-width: 0; box-sizing: border-box; font-size: .8rem; }
.d3-invite-ideas { margin: 0 0 12px; padding-left: 18px; color: var(--soft); display: grid; gap: 4px; }

/* Friends: a link of your own (Avi, 2026-10-30) */
.d3-friends { margin-top: 28px; max-width: 560px; }
.d3-friends h2 { margin: 0 0 6px; font-size: 1.1rem; }
.d3-friend { border-left: 3px solid var(--hi); padding-left: 10px; }

/* Chapter 8: turns, seats */
.d3-compose-foot { align-items: center; gap: 10px; flex-wrap: wrap; }
.d3-turns { margin-right: auto; font-size: .8rem; color: var(--soft); }
.d3-turns.low { color: var(--bad); }
.d3-seat-form input { width: 6em; }

/* The tour (Chapter 8, REQ-D3.74): phone one column; tablet wider with
   pictures side by side; from 980 px words and pictures side by side. */
.d3-tour { max-width: 1180px; margin: 0 auto; display: grid; gap: 22px; min-height: calc(100vh - 140px); grid-template-rows: auto 1fr auto; }
.d3-tour-top { display: flex; align-items: center; gap: 14px; }
.d3-tour-bar { display: flex; gap: 6px; flex: 1 1 0; min-width: 0; max-width: 420px; }
.d3-tour-bar span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.d3-tour-bar span.on { background: var(--hi); }
.d3-tour-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start; }
.d3-tour-body > * { min-width: 0; }
.d3-tour-text { display: grid; gap: 14px; align-content: start; }
.d3-tour-h1 { margin: 0; font-size: clamp(2.4rem, 9vw, 3.6rem); line-height: 1.02; letter-spacing: -.02em; }
.d3-tour-h2 { margin: 0; font-size: clamp(1.7rem, 6vw, 2.6rem); line-height: 1.08; letter-spacing: -.015em; text-wrap: balance; }
.d3-tour-lead { margin: 0; font-size: 1.05rem; line-height: 1.5; color: #e2d6bd; }
.d3-tour-you { justify-self: end; max-width: 30em; margin: 0; background: var(--hi); color: var(--hi-ink); border-radius: 16px 16px 4px 16px; padding: 10px 14px; font-weight: 500; line-height: 1.4; }
.d3-tour-tag { display: block; margin-top: 4px; font-size: .72rem; color: #3a1d06; }
.d3-tour-reply { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; line-height: 1.45; color: #e2d6bd; display: grid; gap: 6px; }
.d3-tour-pics { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.d3-tour-pics figure { margin: 0; position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--bed); }
.d3-tour-pics img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.d3-tour-pics .paper, .d3-tour-pics .photo { background: #f4f4f2; }
.d3-tour-pics .paper img { object-fit: contain; }
.d3-tour-pics figcaption { position: absolute; left: 10px; bottom: 10px; font-size: .75rem; color: #e2d6bd; background: rgba(23,20,15,.8); padding: 3px 8px; border-radius: 6px; }
.d3-tour-ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.d3-tour-ways div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 6px; }
.d3-tour-ways b { font-size: .7rem; letter-spacing: .06em; color: #ff9a4d; font-weight: 500; }
.d3-tour-ways span { font-size: .85rem; line-height: 1.3; color: #e2d6bd; overflow-wrap: anywhere; }
.d3-tour-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 12px; align-content: start; }
.d3-tour-card p { margin: 0; line-height: 1.45; }
.d3-tour-done { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.d3-tour-done .d3-btn { justify-content: center; text-align: center; }
.d3-tour-meter { display: flex; justify-content: space-between; align-items: baseline; }
.d3-tour-meter b { font-size: 1.8rem; color: var(--hi); font-weight: 500; }
.d3-hi { color: var(--hi); }
.d3-tour-nav { display: flex; gap: 10px; justify-content: flex-end; padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
.d3-tour-nav .d3-btn { min-height: 52px; min-width: 110px; justify-content: center; }
.d3-tour-nav form { margin: 0; flex: 1 1 auto; display: flex; justify-content: flex-end; }
#d3-tour-next, #d3-tour-start { flex: 0 1 260px; }
@media (max-width: 699px) {
  .d3-tour-nav #d3-tour-next, .d3-tour-nav form, .d3-tour-nav #d3-tour-start { flex: 1 1 auto; }
}
@media (min-width: 700px) {
  .d3-tour-pics { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
  .d3-tour-pics.one { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 980px) {
  .d3-tour-body { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.4fr); gap: 48px; align-items: center; align-self: center; }
  .d3-tour-pics.one img { max-height: 62vh; }
}
.d3-tour-hero { align-items: center; }

/* An attached STL; taking something out before sending (Avi, 2026-10-30) */
.d3-ref-tag { display: inline-block; margin-top: 6px; font-size: .74rem; padding: 2px 8px; border-radius: 8px; border: 1px solid var(--soft); color: var(--ink); overflow-wrap: anywhere; }
.d3-chosen-item { position: relative; display: inline-flex; align-items: center; }
.d3-chosen-x { position: absolute; top: -6px; right: -6px; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--ink); font-size: 16px; line-height: 1; padding: 0; cursor: pointer; display: grid; place-items: center; }
.d3-said { margin: 6px 0 0; }

/* Sizes on the part (Avi, 2026-10-30) */
.d3-dims { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.d3-dim { position: absolute; left: 0; top: 0; pointer-events: auto; font-family: var(--f-mono); font-size: .74rem; line-height: 1;
  padding: 5px 7px; min-height: 26px; border-radius: 7px; border: 1px solid #e2d6bd; background: rgba(23,20,15,.86); color: #f3ead8; cursor: pointer; white-space: nowrap; }
.d3-dim.unknown { border-color: #f7d046; color: #f7d046; }
.d3-to-measure { margin-top: 8px; padding: 10px 12px; border: 1px solid #f7d046; border-radius: 12px; display: grid; gap: 8px; }
.d3-to-measure p { margin: 0; }
.d3-measure-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 6.5em auto; align-items: center; gap: 8px; font-size: .9rem; }
.d3-measure-row b { color: #f7d046; font-weight: 500; }
.d3-measure-row span { min-width: 0; overflow-wrap: anywhere; }
.d3-measure-row input { width: 100%; min-width: 0; box-sizing: border-box; }
.d3-dim-edit { width: min(92vw, 360px); }
.d3-dim-edit form { margin: 0; }
.d3-tour-side { display: grid; gap: 12px; min-width: 0; align-content: start; }
.d3-tour-side .d3-tour-pics img { max-height: 34vh; }
