/* A full-screen workshop with compact, touch-friendly floating controls. */
:root {
  --ui-ink: #f3f4ed;
  --ui-muted: #b5c8ce;
  --ui-glass: #102b39bd;
  --ui-line: #c1d8df26;
  --ui-gold: #ebc58d;
}
html, body {
  width: 100%; height: 100%; margin: 0; overflow: hidden;
  overscroll-behavior: none; background: #172a36;
}
#app, #app.with-guide {
  position: fixed; inset: 0; display: block;
  width: 100%; max-width: none; height: 100dvh; min-height: 0; max-height: none;
  margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none;
  overflow: hidden; color: var(--ui-ink); background: #233746;
}
#app > .board, #app.win > .board {
  position: absolute; inset: 0; display: block; padding: 0; border: 0;
  border-radius: 0; overflow: hidden; background: #233746; box-shadow: none;
}
.board::after {
  content: ''; display: block; position: absolute; inset: 0; z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, #081b29a6 0%, #081b2940 17%, transparent 35%, transparent 62%, #081b292b 75%, #081b29b0 100%);
}
.scene-host, .scene-surface { position: absolute; inset: 0; }
.scene-surface canvas {
  display: block; width: 100%; height: 100%; touch-action: none; outline-offset: -3px;
}
.scene-loading, .scene-error {
  position: absolute; inset: 42% 12% auto; margin: 0; padding: 12px;
  border-radius: 12px; background: #10232be8; color: white;
  font-size: 14px; line-height: 1.6; text-align: center; pointer-events: none;
}
.ui-icon {
  display: inline-block; width: 18px; height: 18px; flex: none;
  vertical-align: middle; overflow: visible; pointer-events: none;
}
button .ui-icon { filter: drop-shadow(0 1px 1px #0002); }
button:focus-visible { outline: 2px solid #f0d29e; outline-offset: 2px; }
.hud-top {
  position: absolute; z-index: 3;
  top: max(8px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  display: grid; gap: 0; pointer-events: none;
}
.hud-top .top, .hud-top .mission, .hud-top .metrics {
  background: none; border: 0; border-radius: 0; text-shadow: 0 1px 5px #07151c75;
}
.hud-top .top { height: 44px; padding: 0; gap: 6px; }
.hud-top .brand {
  flex: none; width: 24px; height: 28px; border-radius: 0;
  background: none; color: var(--ui-gold);
}
.hud-top .brand .ui-icon { width: 22px; height: 22px; }
.hud-top .title h1 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: .5px; }
.hud-top .title small:empty { display: none; }
.hud-top .title small {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 9px; letter-spacing: 0; color: #ffce96 !important;
}
.hud-top button, .scene-top button, .scene-camera button, .scene-bottom button {
  pointer-events: auto; color: var(--ui-ink);
}
.hud-top .top .small {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; width: 44px; height: 44px; min-height: 44px; padding: 0;
  border: 0; border-radius: 12px; background: transparent;
  font-size: 9px; line-height: 1; color: #d7e3e5;
}
.hud-top .top .small .ui-icon { width: 19px; height: 19px; color: #edf3f1; }
.hud-top .mission {
  width: fit-content; max-width: min(430px, 100%); min-height: 44px; gap: 8px; padding: 0;
}
.hud-top .number {
  width: auto; min-width: 31px; height: 24px; padding: 0 5px;
  border: 1px solid #ebc58d30; border-radius: 7px; background: #ebc58d0c;
  color: var(--ui-gold); font-size: 11px; font-weight: 650;
}
.hud-top .mission h2 { margin: 0; font-size: 12px; font-weight: 550; line-height: 1.3; }
.hud-top .mission p { display: none; }
.hud-top .detail-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  align-self: stretch; min-width: 44px; min-height: 44px; padding: 0 3px;
  border: 0; border-radius: 0; background: transparent;
  font-size: 10px; color: #b9cdd4;
}
.hud-top .detail-link .ui-icon { width: 14px; height: 14px; }
.hud-top .metrics {
  width: fit-content; max-width: 100%; min-height: 24px; padding: 0;
  justify-content: start; gap: 12px; font-size: 10px; color: #b7cbd3;
}
.hud-top .metric { display: inline-flex; align-items: center; gap: 4px; }
.hud-top .metric .ui-icon { width: 13px; height: 13px; color: #d9c198; }
.hud-top .metric:nth-child(2) .ui-icon { color: #9ccbd2; }
.hud-top .metric b { margin-left: 0; font-size: 12px; color: #eef5f2; font-weight: 650; }
.hud-top .metric.over, .hud-top .metric.over b { color: #ffba91; }
.hud-top .metrics .meta { color: #bbced4; font-size: 9px; }
.guide, .scene-badge { display: none; }
.scene-top {
  position: absolute; z-index: 3;
  top: calc(max(8px, env(safe-area-inset-top)) + 116px);
  right: max(12px, env(safe-area-inset-right));
  display: flex; align-items: center; gap: 4px; pointer-events: none;
}
.scene-top button {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 44px; padding: 0 8px; border: 0; border-radius: 12px;
  background: #102b398c; font-size: 10px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.scene-top button .ui-icon { width: 16px; height: 16px; color: #c7dadf; }
.scene-top button[aria-pressed="true"] { background: #6d543d9e; color: #f8d79f; }
.scene-top button[aria-pressed="true"] .ui-icon { color: #f8d79f; }
.scene-camera {
  position: absolute; z-index: 3;
  top: calc(max(8px, env(safe-area-inset-top)) + 166px);
  right: max(8px, env(safe-area-inset-right));
  display: grid; grid-template-columns: 44px; gap: 0;
}
.scene-camera button {
  position: relative; isolation: isolate; display: grid; place-items: center;
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: none; color: #d9e6e8;
}
.scene-camera button::before {
  content: ''; position: absolute; inset: 6px; z-index: -1;
  border: 1px solid #d3e4e526; border-radius: 50%; background: #102b3982;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.scene-camera .ui-icon { width: 16px; height: 16px; }
.game-dock {
  position: absolute; z-index: 4;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 50%; right: auto; width: min(380px, calc(100% - 24px)); transform: translateX(-50%);
  display: grid; gap: 7px; padding: 0; border: 0; border-radius: 0;
  background: none; box-shadow: none; pointer-events: none;
}
.scene-bottom { position: static; display: grid; gap: 2px; min-width: 0; pointer-events: none; }
.scene-selection { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; }
.scene-selection > button {
  flex: 0 1 auto; min-width: 44px; min-height: 44px; padding: 4px 12px;
  border: 1px solid #c9dce81c; border-radius: 22px; background: #102b3980;
  font-size: 11px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.scene-selection > button:first-child { width: 44px; padding: 0; flex: none; }
.scene-selection .layer {
  display: flex; flex-direction: row; flex-wrap: wrap;
  justify-content: center; align-items: center; align-content: center; gap: 3px 5px;
  min-height: 44px; text-align: center;
}
.scene-selection .layer.active {
  border-color: #e7c69550; background: #4f4335a6; color: #f8ddb1; box-shadow: none;
}
.scene-selection .layer small { color: #bed0d4; font-size: 10px; }
.scene-selection .ui-icon { width: 16px; height: 16px; }
.scene-regions {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(44px, 1fr); gap: 2px;
  min-width: 0; overflow-x: auto; scrollbar-width: none;
  pointer-events: auto; overscroll-behavior-x: contain;
}
.scene-regions::-webkit-scrollbar { display: none; }
.scene-regions button {
  min-height: 44px; padding: 0 5px; border: 1px solid #c9dce81c;
  border-radius: 22px; background: #102b398c; font-size: 11px;
}
.scene-tip {
  min-height: 12px; color: #d0dfe4; font-size: 10px; line-height: 1.2;
  text-align: center; text-shadow: 0 1px 4px #0008;
}
.game-dock .tray {
  height: 62px; grid-template-columns: minmax(0, 148px) minmax(0, 148px) 44px;
  justify-content: center; gap: 7px;
}
.game-dock .tray.compact { grid-template-columns: repeat(2, minmax(0, 148px)); }
.game-dock .tray .part-card {
  display: grid; grid-template-columns: 38px minmax(0, 1fr); grid-template-rows: 1fr 1fr;
  align-items: center; justify-items: start; column-gap: 4px; row-gap: 0;
  padding: 8px 7px; min-height: 44px; border: 1px solid #c4dce333;
  border-radius: 13px; background: linear-gradient(145deg, #244252d6, #102633d9);
  box-shadow: inset 0 1px 0 #ffffff0a, 0 4px 12px #03141c24; color: var(--ui-ink);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; cursor: grab; text-align: left;
}
.game-dock .tray .part-card.selected {
  padding: 8px 7px; border: 1px solid #edc58d;
  background: linear-gradient(145deg, #5a4b37df, #253238ec);
  box-shadow: inset 0 0 0 1px #edc58d22, 0 3px 12px #07161e20;
}
.game-dock .tray .piece {
  grid-column: 1; grid-row: 1 / 3; width: 38px; height: 36px; max-width: 38px;
  filter: drop-shadow(0 2px 2px #03151c38);
}
.game-dock .tray .part-card b, .game-dock .tray .part-name {
  grid-column: 2; align-self: end; display: block; margin: 0; min-width: 0;
  font-size: 11px; line-height: 1.25; font-weight: 600; white-space: normal;
}
.game-dock .tray .part-meta { grid-column: 2; grid-row: 1 / 3; align-self: center; min-width: 0; }
.game-dock .tray .part-card .specs {
  grid-column: 2; align-self: start; display: flex; align-items: center; gap: 3px;
  margin: 3px 0 0; font-size: 10px; line-height: 1.2; color: #bfd0d5; white-space: nowrap;
}
.slot-dot { width: 5px; height: 5px; flex: none; border-radius: 50%; background: #dfbf8a; }
.slot-dot.cool { background: #87cbd5; }
.slot-dot.warm { background: #e1ae80; }
.game-dock .tray .specs > span { display: inline-flex; align-items: center; gap: 2px; margin: 0; font-size: inherit; color: inherit; }
.game-dock .tray .specs .rating { margin-right: 2px; }
.game-dock .tray .specs .water { color: #9fd4dc; }
.game-dock .tray .specs .port { color: #e6c993; font-weight: 650; }
.game-dock .tray.compact > .part-card:only-child { grid-column: 1 / -1; width: 148px; max-width: 100%; justify-self: center; }
.game-dock .tray:has(.tray-placeholder) { height: 34px; }
.game-dock .tray .tray-placeholder { min-height: 34px; display: flex; align-items: center; justify-content: center; gap: 7px; }
.game-dock .tray .more { grid-column: 3; }
.spec-icon, .specs .ui-icon { display: inline-block; width: 11px; height: 11px; flex: none; }
.specs .rating { display: inline-flex; align-items: center; gap: 2px; margin: 0 2px 0 0; }
.rating i { display: block; width: 3px; height: 3px; border-radius: 50%; background: #ddbd88; }
.game-dock .tray .more {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 44px; border: 1px solid #c4dce31c; border-radius: 13px;
  background: #102b3973; color: #bfd0d5; font-size: 10px; pointer-events: auto;
}
.game-dock .tray-placeholder {
  min-height: 44px; padding: 5px; border: 0; border-radius: 0;
  color: #c1d3da; font-size: 11px; background: transparent;
}
.game-dock .controls {
  position: static; display: grid; grid-template-columns: 44px 44px minmax(120px, 148px);
  justify-content: center; gap: 8px; min-height: 44px; padding: 0; border-radius: 0; background: none;
}
.game-dock .controls button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 8px; border: 1px solid #c2d7df26; border-radius: 14px;
  background: #102b39a8; color: #dce8eb; font-size: 11px; pointer-events: auto;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.game-dock .controls .primary {
  border-color: #f1d5a970; background: linear-gradient(130deg, #e4c38e, #c5985e);
  color: #27333a; box-shadow: inset 0 1px 0 #ffedcc80, 0 3px 10px #06141f30;
  font-size: 13px; font-weight: 700;
}
.game-dock .controls .primary .ui-icon { width: 17px; height: 17px; }
.game-dock .controls .primary.green {
  border-color: #a2dec27a; background: linear-gradient(130deg, #a2d8bb, #6cab91);
  color: #173d32; box-shadow: inset 0 1px 0 #e3ffed60, 0 3px 10px #06141f30;
}
.game-dock .feedback {
  position: absolute; bottom: calc(100% + 8px); left: 0; right: 0;
  min-height: 44px; padding: 3px 5px 3px 10px; border: 1px solid #d3bd8f3b;
  border-radius: 14px; background: #163341ed; color: #f1f5ef;
  box-shadow: 0 4px 15px #07171d20; pointer-events: auto;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.game-dock .feedback:not(.error):not(.good):has(strong:empty) { display: none; }
.game-dock .feedback.good { border-color: #a2d8bb55; background: #163d35eb; }
.game-dock .feedback.error { border-color: #efb49366; background: #48342ced; }
.game-dock .feedback strong { font-size: 12px; font-weight: 600; }
.game-dock .feedback small { font-size: 10px; color: #c3d4d7; }
.game-dock .feedback button {
  min-height: 44px; background: transparent; color: #dfc595; font-size: 11px;
}
.drag-piece {
  position: fixed; z-index: 50; width: 72px; height: 68px; display: grid; place-items: center;
  padding: 4px; border: 1px solid #f0d29d; border-radius: 14px; background: #183443ed;
  box-shadow: 0 8px 28px #07182070, 0 0 18px #ffc96c30;
  transform: translate(-50%, -85%) rotate(-5deg); pointer-events: none;
  user-select: none; color: white; font-size: 10px;
}
.drag-piece:disabled { opacity: 1; }
.drag-piece svg { width: 100%; height: 46px; }
.drag-piece .part-meta { display: none; }
.drag-piece .specs { display: none; }
.drop-target {
  position: absolute; z-index: 2; display: grid; place-items: center;
  width: 72px; height: 72px; padding: 3px; border: 2px dashed #f0d29b;
  border-radius: 50%; background: #aa7a2829;
  box-shadow: 0 0 0 7px #ffd78615, 0 0 22px #ffcc6140; color: #fff1c5;
  text-shadow: 0 1px 3px #142833; font-size: 11px; font-weight: 650;
  text-align: center; transform: translate(-50%, -50%); pointer-events: none;
}
.drop-target.ready {
  border-style: solid; border-color: #b4edcc; background: #34925d7a;
  box-shadow: 0 0 0 9px #87f3ab30, 0 0 24px #a1ffc655; color: white;
}
.drop-burst {
  position: absolute; z-index: 2; width: 86px; height: 86px; display: grid; place-items: center;
  border: 3px solid #acffc7; border-radius: 50%; background: #3da36c40;
  color: #e3ffdc; font-size: 24px; font-weight: 800; pointer-events: none;
  animation: install-burst .65s ease-out forwards;
}
@keyframes install-burst {
  from { transform: translate(-50%, -50%) scale(.55); opacity: 1; }
  to { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
}
.qa { top: auto; bottom: 0; left: 0; padding: 1px 4px; opacity: .7; font-size: 8px; pointer-events: none; }

/* In-scene menus share the same restrained materials and accent colours. */
.modal-backdrop { background: #07151c80; backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); }
.sheet {
  color: #edf4f5; background: linear-gradient(150deg, #1e3b4bf5, #102633f5);
  border: 1px solid #b9d1da2b; border-radius: 22px; box-shadow: 0 18px 65px #0006;
}
.sheet-head { border-bottom-color: #c1d8df1c; }
.sheet-head h2 { font-size: 17px; font-weight: 650; }
.sheet-head button { display: grid; place-items: center; color: #c7d9df; background: transparent; }
.sheet .toolbar button { color: #d9e5e9; background: #c1d8df0b; border-color: #c1d8df26; }
.sheet .level-entry, .sheet .requirement, .sheet .help-hint, .sheet .issue {
  background: #c1d8df06; color: #edf4f5; border-color: #c1d8df1f;
}
.sheet .level-entry { border-radius: 12px; }
.sheet .level-entry:disabled { opacity: .42; }
.sheet .intro, .sheet .level-entry small, .sheet .issue span { color: #a9c0ca; }
.sheet .entry-id, .sheet .level-status { color: #e4c38e; }
.sheet button.action { background: #a8c9cd1c; color: #eef5f1; border: 1px solid #c1d8df26; }

@media (hover: hover) {
  .scene-top button:hover, .scene-selection button:hover, .scene-regions button:hover,
  .hud-top .small:hover, .game-dock .controls button:not(.primary):hover {
    background: #46606c80;
  }
  .game-dock .tray .part-card:hover { border-color: #d9c49f8c; }
  .scene-camera button:hover::before { background: #46606cb0; }
}
@media (max-width: 380px) {
  .scene-regions { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(44px, 1fr)); }
}
@media (max-width: 350px) {
  .hud-top { left: max(9px, env(safe-area-inset-left)); right: max(9px, env(safe-area-inset-right)); }
  .hud-top .title h1 { font-size: 14px; letter-spacing: 0; }
  .hud-top .mission { gap: 5px; }
  .hud-top .mission h2 { font-size: 11px; }
  .game-dock { width: calc(100% - 18px); }
  .game-dock .tray { gap: 5px; }
  .game-dock .tray .part-card { grid-template-columns: 31px minmax(0, 1fr); padding: 8px 5px; gap: 2px; }
  .game-dock .tray .part-card.selected { padding: 8px 5px; }
  .game-dock .tray .piece { width: 31px; height: 32px; }
  .game-dock .tray .part-card b, .game-dock .tray .part-name { font-size: 10px; }
  .game-dock .tray .part-card .specs { font-size: 9px; gap: 2px; }
}
@media (min-width: 700px) and (min-height: 501px) {
  .hud-top { top: max(16px, env(safe-area-inset-top)); left: max(20px, env(safe-area-inset-left)); right: max(20px, env(safe-area-inset-right)); }
  .hud-top .title h1 { font-size: 16px; }
  .scene-top { top: calc(max(16px, env(safe-area-inset-top)) + 52px); right: 20px; }
  .scene-camera { top: 122px; right: 20px; }
  .game-dock { bottom: max(20px, env(safe-area-inset-bottom)); }
}
@media (orientation: landscape) and (max-height: 500px) {
  .hud-top { right: auto; width: calc(100% - min(280px, 43vw) - 28px); }
  .hud-top .brand { display: none; }
  .hud-top .title h1 { font-size: 13px; letter-spacing: 0; }
  .hud-top .mission h2 { font-size: 11px; }
  .game-dock {
    left: auto; right: max(10px, env(safe-area-inset-right));
    width: min(280px, 43vw); transform: none; bottom: max(10px, env(safe-area-inset-bottom));
  }
  .scene-regions { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(44px, 1fr)); }
  .game-dock .tray { gap: 5px; }
  .game-dock .tray .part-card { grid-template-columns: 30px minmax(0, 1fr); padding: 8px 5px; gap: 2px; }
  .game-dock .tray .part-card.selected { padding: 8px 5px; }
  .game-dock .tray .piece { width: 30px; height: 32px; }
  .game-dock .tray .part-card b, .game-dock .tray .part-name { font-size: 10px; }
  .scene-top { left: max(10px, env(safe-area-inset-left)); right: auto; top: 124px; }
  .scene-camera { top: auto; bottom: max(8px, env(safe-area-inset-bottom)); left: max(8px, env(safe-area-inset-left)); right: auto; grid-template-columns: repeat(4, 44px); }
}
@media (prefers-reduced-motion: reduce) {
  .drop-burst { animation: none; transform: translate(-50%, -50%); }
}

/* The opening manual is a single illustrated sheet over the game. */
.manual-backdrop { align-items: center; padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)); }
.manual-backdrop .sheet { width: min(720px, 100%); max-height: 94dvh; }
.manual-backdrop .sheet-head { padding: 8px 18px; }
.manual-backdrop .sheet-body { padding: 14px 20px 22px; overscroll-behavior: contain; }
.manual-intro { margin-bottom: 17px; }
.manual-kicker { color: #e4c38e; font-size: 10px; letter-spacing: 2px; }
.manual-intro h3 { font-size: 23px; line-height: 1.4; margin: 7px 0 !important; color: #fff2d8; }
.manual-intro p, .manual-step p { color: #c5d7de; font-size: 12px; line-height: 1.65; margin: 0 !important; }
.manual-steps { display: grid; gap: 9px; }
.manual-step { display: grid; grid-template-columns: 102px minmax(0, 1fr); align-items: center; gap: 15px; padding: 12px; border: 1px solid #bdd5df20; border-radius: 16px; background: #c1d8df06; }
.manual-step-number { color: #e4c38e; font-size: 10px; font-weight: 700; letter-spacing: 1px; }
.manual-step h3 { font-size: 15px; margin: 1px 0 5px; color: #f3f4ed; }
.manual-art { position: relative; display: grid; place-items: center; height: 88px; border-radius: 12px; background: radial-gradient(ellipse, #4f6d793d, #0e26333b); overflow: hidden; }
.manual-furnace > .ui-icon { width: 66px; height: 66px; color: #b1c7cd; stroke-width: 1; }
.manual-focus { position: absolute; width: 22px; height: 22px; border: 2px dashed #e9c281; border-radius: 50%; left: 26px; top: 38px; box-shadow: 0 0 13px #e9c28140; }
.manual-drag-part { position: absolute; width: 62px; height: 48px; left: 0; bottom: 4px; }
.manual-drag-arrow { position: absolute; font-size: 27px; color: #ebc58d; left: 48px; top: 26px; }
.manual-drop-ring { position: absolute; top: 10px; right: 8px; display: grid; place-items: center; width: 32px; height: 32px; border: 1px dashed #edcf95; border-radius: 50%; color: #edcf95; font-size: 18px; }
.manual-pass { display: grid; justify-items: center; gap: 4px; color: #a9e0c1; font-size: 10px; }
.manual-pass .ui-icon { width: 37px; height: 37px; padding: 8px; border: 1px solid #a9e0c17a; border-radius: 50%; background: #7cb79516; }
.manual-example { margin-top: 16px; padding: 13px 15px; border: 1px solid #e4c38e36; border-radius: 15px; background: #e4c38e09; }
.manual-example h3 { display: flex; align-items: center; gap: 7px; font-size: 14px; margin: 0 0 6px; color: #f0d09e; }
.manual-example p { font-size: 12px; margin-bottom: 0; color: #c9dbe1; }
.manual-example-result { display: flex; align-items: center; gap: 15px; padding: 4px 0; }
.manual-example-result > .piece { width: 58px; height: 48px; flex: none; }
.manual-example-result b { display: block; font-size: 14px; color: #ace1c5; }
.manual-example-result small { display: block; font-size: 11px; color: #bdd1d9; }
.manual-section { margin-top: 22px; }
.manual-section h3 { font-size: 15px; color: #f3e4c9; margin: 0 0 12px; }
.manual-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.manual-tools > div { display: flex; gap: 9px; }
.manual-tools > div > .ui-icon { margin-top: 2px; color: #d8bc8c; }
.manual-tools b { display: block; font-size: 12px; font-weight: 600; }
.manual-tools small { display: block; color: #aec5cf; font-size: 11px; line-height: 1.7; margin-top: 3px; }
.manual-checks, .manual-accept ol { margin: 0; padding-left: 19px; font-size: 12px; line-height: 1.8; color: #c8d9df; }
.manual-checks li, .manual-accept li { padding-left: 3px; margin-bottom: 7px; }
.manual-checks .ui-icon { width: 12px; height: 12px; color: #e4c38e; }
.manual-note { color: #a7c0cc; font-size: 11px; line-height: 1.7; margin: 12px 0 0 !important; }
.manual-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; flex: none; border-top: 1px solid #bdd5df20; background: #112b38; border-radius: 0 0 22px 22px; }
.manual-footer > span { color: #b6ccd5; font-size: 11px; }
.manual-start { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; background: linear-gradient(130deg,#e4c38e,#c5985e); color: #26343d; font-size: 13px; font-weight: 700; }
@media (max-width: 430px) {
  .manual-backdrop .sheet-head { padding: 6px 13px; }
  .manual-backdrop .sheet-head h2 { font-size: 16px; }
  .manual-backdrop .sheet-body { padding: 12px 13px 20px; }
  .manual-intro h3 { font-size: 19px; }
  .manual-step { grid-template-columns: 78px minmax(0,1fr); padding: 10px; gap: 10px; }
  .manual-art { height: 86px; }
  .manual-step h3 { font-size: 14px; }
  .manual-step p { font-size: 11px; }
  .manual-furnace > .ui-icon { width: 56px; height: 56px; }
  .manual-focus { left: 18px; }
  .manual-drag-part { width: 53px; left: -4px; }
  .manual-drag-arrow { left: 34px; font-size: 24px; }
  .manual-drop-ring { right: 3px; width: 27px; height: 27px; }
  .manual-footer { padding: 10px 13px; gap: 8px; }
  .manual-start { padding: 0 14px; }
}
@media (max-width: 350px) {
  .manual-tools { grid-template-columns: 1fr; }
  .manual-footer > span { max-width: 100px; }
}
.manual-backdrop .sheet-body { scrollbar-width: thin; scrollbar-color: #76939f66 #102633; }
.manual-backdrop .sheet-body::-webkit-scrollbar { width: 5px; }
.manual-backdrop .sheet-body::-webkit-scrollbar-track { background: #102633; }
.manual-backdrop .sheet-body::-webkit-scrollbar-thumb { background: #76939f66; border-radius: 5px; }

.air-route {
  width: fit-content;
  margin-top: 4px;
  padding: 4px 7px;
  border: 1px solid #c9dce81c;
  border-radius: 8px;
  background: #102b39a6;
  color: #cadbe1;
  font-size: 11px;
  line-height: 1.25;
}
.air-route span:first-child { color: #a9d9f0; }
.air-route span:last-child { color: #f4cc95; }

/* Show the task, the selected part's standard, and replacement cost together. */
.hud-top .mission .mission-goal {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: #e1d5b9;
}
.hud-top .mission { min-height: 66px; }
.hud-top .metric small { color: #f1d49e; font-size: 10px; }
.scene-bottom { gap: 5px; }
.check-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 12px; height: 12px; margin-left: 3px; font-size: 10px; font-weight: 750; }
.check-badge.needs { color: #ffb89a; }
.check-badge.good { color: #a2dcba; }
.scene-regions button { position: relative; line-height: 1.2; }
.scene-regions .check-badge { display: flex; margin: 2px auto 0; }
.inspection-panel {
  padding: 8px 10px;
  border: 1px solid #9cb9c13d;
  border-radius: 12px;
  background: #102c3ae8;
  color: #dce9e9;
  font-size: 11px;
}
.inspection-panel.needs { border-color: #e9a58066; }
.inspection-title, .inspection-values { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.inspection-title b { color: #f6e9d1; font-size: 11px; }
.inspection-title > span { color: #a5d6b7; font-size: 10px; }
.inspection-panel.needs .inspection-title > span { color: #ffbb98; }
.inspection-values { margin-top: 4px; justify-content: start; gap: 15px; font-size: 11px; }
.inspection-values b { color: #f3e0b9; font-weight: 650; }
.inspection-panel p { margin: 4px 0 0; font-size: 10px; line-height: 1.4; color: #c8d7dd; }
.game-dock .tray { height: 76px; }
.game-dock .tray .part-card .cost-label { display: block; margin-top: 3px; color: #efcf91; font-size: 12px; font-weight: 700; }
.game-dock .tray .part-card.unaffordable { border-style: dashed; }
.game-dock .tray .part-card.unaffordable .cost-label { color: #ffc3a5; }
.replacement-summary { display: grid; justify-items: center; gap: 2px; padding: 6px 8px; border-radius: 9px; background: #102c3ae8; font-size: 11px; color: #cfdee2; }
.replacement-summary b { color: #f2d095; }
.replacement-summary small { font-size: 10px; color: #b6dfc7; }
.replacement-summary.needs small { color: #ffbf9a; }
.installing .game-dock { pointer-events: none; }
.installing .game-dock button { pointer-events: none; }
.installing .scene-tip { color: #f4d598; }
@media (max-width: 699px) and (orientation: portrait) {
  .scene-top { top: calc(max(8px, env(safe-area-inset-top)) + 172px); }
  .scene-camera { top: calc(max(8px, env(safe-area-inset-top)) + 222px); }
}
@media (max-height: 640px) {
  .inspection-panel { padding: 5px 8px; }
  .inspection-panel.good p { display: none; }
  .game-dock { gap: 4px; }
  .inspection-values { font-size: 10px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .hud-top { width: calc(100% - min(300px, 45vw) - 28px); }
  .hud-top .mission { min-height: 62px; }
  .scene-top { top: 145px; }
  .game-dock { width: min(300px, 45vw); }
  .inspection-panel { padding: 6px 8px; }
}

/* Clickable part labels live in the projected 3D scene. */
.model-hotspots {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  visibility: hidden;
}
.model-hotspots[data-ready="true"] { visibility: visible; }
.hotspot-leaders { position: absolute; inset: 0; width: 100%; height: 100%; overflow: hidden; pointer-events: none; }
.hotspot-leaders path { fill: none; stroke-width: 1; opacity: .7; }
.hotspot-leaders circle { stroke: #142c39; stroke-width: 1.5; }
.model-tag {
  position: absolute;
  top: 0; left: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 58px;
  height: 44px;
  min-height: 44px;
  padding: 0 9px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #ebf4f4;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: auto;
  touch-action: manipulation;
  isolation: isolate;
}
.model-tag::before {
  content: '';
  position: absolute;
  inset: 4px 0;
  z-index: -1;
  border: 1px solid #9bbfc766;
  border-radius: 12px;
  background: #16323ee8;
  box-shadow: 0 2px 8px #07182140;
}
.model-tag.needs::before { border-color: #e5bc8380; }
.model-tag.active::before { border-color: #f3ce8d; background: #5d4936ed; box-shadow: 0 0 0 2px #f3ce8d20; }
.model-tag[hidden] { display: none; }
.model-hotspots.placing { visibility: hidden; }
.model-hotspots.placing .model-tag, .installing .model-tag { pointer-events: none; }
.installing .model-hotspots { visibility: hidden; }
@media (max-width: 350px) {
  .model-tag { font-size: 10px; padding-inline: 7px; min-width: 54px; }
}

/* First job: a single mounting point on the stove-to-furnace connection. */
.pipe-lesson {
  --socket-gold: #ffda86;
  --socket-ink: #352a1b;
}
.pipe-socket {
  position: absolute; top: 0; left: 0;
  width: 48px; height: 48px; padding: 0; min-width: 0;
  display: grid; place-items: center; border: 0; border-radius: 50%;
  background: transparent; color: var(--socket-gold); pointer-events: auto;
  touch-action: manipulation;
}
.pipe-socket[hidden] { display: none; }
.socket-rim {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 3px dashed currentColor; border-radius: 50%;
  background: #31291c68;
  box-shadow: 0 0 0 2px #302d23d9, 0 0 0 6px #ffd27f3d;
}
.socket-rim .ui-icon { width: 18px; height: 18px; filter: drop-shadow(0 1px 2px #24190e); }
.socket-caption {
  position: absolute; top: calc(100% + 2px); left: 50%; transform: translateX(-50%);
  padding: 3px 9px; min-width: max-content; border-radius: 12px;
  background: var(--socket-gold); color: var(--socket-ink);
  font-size: 12px; font-weight: 750; line-height: 1.4; box-shadow: 0 2px 6px #12202b61;
}
.pipe-socket.connected { color: #a5ecc1; }
.pipe-socket.connected .socket-rim { border-style: solid; background: #173e32b8; box-shadow: 0 0 0 2px #183b31; }
.pipe-socket.connected .socket-caption { background: #b1e8c8; color: #163d32; }
.model-hotspots.placing .pipe-socket, .installing .pipe-socket { pointer-events: none; }
.pipe-lesson .scene-tip {
  justify-self: center; padding: 6px 14px; margin-bottom: 3px; border-radius: 18px;
  color: #fff3d6; background: #142c37eb; font-size: 14px; line-height: 1.4; font-weight: 650;
}
.pipe-lesson .game-dock .tray.compact { grid-template-columns: repeat(2,minmax(0,174px)); }
.pipe-lesson .game-dock .pipe-card {
  grid-template: 1fr / minmax(38px, 36%) minmax(0, 1fr);
  column-gap: 6px; height: 76px; padding: 6px 9px;
  background: linear-gradient(150deg,#344f59,#172f3b 72%); border: 1px solid #a2bbc45c;
}
.pipe-lesson .game-dock .pipe-card.selected {
  border-color: var(--socket-gold); background: linear-gradient(135deg,#594b37,#25323a);
}
.pipe-lesson .game-dock .pipe-card.unaffordable { border-style: dashed; }
.pipe-lesson .game-dock .pipe-card .piece { grid-area: 1 / 1; width: 100%; max-width: 60px; height: auto; }
.pipe-lesson .pipe-card .pipe-card-info { display: grid; gap: 4px; }
.pipe-lesson .game-dock .pipe-card-info b { grid-area: auto; font-size: clamp(12px,3.25vw,15px); color: #f4f4e9; }
.pipe-lesson .pipe-card .pipe-price, .pipe-lesson .point-chips { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.pipe-lesson .pipe-card .pipe-price { margin: 0; gap: 5px; font-size: 12px; color: #ffdb91; font-weight: 700; }
.pipe-lesson .point-chips i { display: block; width: 6px; height: 9px; border-radius: 2px; border: 1px solid #f6d498; background: #d2a359; }
.pipe-lesson .game-dock .controls .primary[data-action="test"] { background: #203643e8; color: #dde9e8; }
.pipe-lesson .drop-target {
  width: 66px; height: 66px; border-color: var(--socket-gold);
  background: #493a25ab; color: #fff6d9; font-size: 13px;
}
.pipe-lesson .drop-target.ready { background: #17593ed9; border-color: #b3f3c6; }
.drag-piece .pipe-card-info { display: none; }
@media (max-width: 350px) {
  .pipe-lesson .game-dock .pipe-card { grid-template-columns: 37px 1fr; padding: 6px; gap: 4px; }
}

.pipe-lesson .pipe-card .point-chips, .pipe-lesson .pipe-wallet .point-chips { display:inline-flex; flex-wrap:nowrap; gap:2px; margin:0; }
.pipe-lesson .pipe-wallet { display:inline-flex; align-items:center; gap:4px; margin-right:9px; padding-right:9px; border-right:1px solid #abc1c44d; color:#f5d79f; font-size:12px; }

.pipe-lesson .drop-target.shortfall { background: #693525e8; border-color: #ffc29a; color: #fff0de; }
