/* Shipyard extends the shared paper window; its scene/art camera stays fixed. */
.shipyard-v7-screen { min-height:0; gap:6px; }
.shipyard-v7-screen .meta-heading { min-height:36px; grid-template-columns:minmax(0,1fr) 36px; }
.shipyard-v7-screen .meta-heading h1 { font-size:24px; text-align:center; }
.shipyard-v7-screen .meta-heading .icon-button { width:36px; height:36px; }
.shipyard-v7-screen .wallet-strip { gap:6px; }
.shipyard-v7-screen .wallet-chip { min-height:28px; min-width:76px; padding:2px 7px; font-size:14px; }
.shipyard-v7-screen .wallet-chip .icon { width:16px; height:16px; }
.shipyard-v7-screen .vessel-preview.workshop-scene {
  flex:1 1 auto;
  height:auto;
  min-height:180px;
  max-height:none;
  width:100%;
  border:1px solid #c5b284;
  border-image:none;
  border-radius:14px;
  background:#b7e1df url('assets/shipyard-v7/workshop.png') center/cover no-repeat;
  box-shadow:inset 0 1px 0 #ffffffb3;
  overflow:hidden;
  isolation:isolate;
}
.workshop-scene .workshop-vessel-canvas {
  inset:0;
  left:3%;
  top:1%;
  width:94%;
  height:88%;
  aspect-ratio:auto;
  transform:none;
  object-fit:contain;
  filter:none;
  z-index:1;
}
/* The keel is bottom-aligned at scene Y89%; static shadows stay on the floor. */
.workshop-scene::before,.workshop-scene::after {
  content:"";
  position:absolute;
  display:block;
  pointer-events:none;
  z-index:0;
}
.workshop-scene::before {
  left:16%;
  top:84.5%;
  width:77%;
  height:11%;
  border-radius:50%;
  background:radial-gradient(ellipse at 50% 43%,#4d382947 0%,#62452d32 32%,#75513118 59%,#78573408 72%,transparent 82%);
  transform:rotate(-2deg);
}
.workshop-scene::after {
  left:24%;
  top:87.6%;
  width:55%;
  height:3.6%;
  border-radius:50%;
  background:radial-gradient(ellipse at center,#3c2e2b66 0%,#4a352b48 31%,#58402c24 58%,transparent 79%);
}
.workshop-scene .preview-caption {
  left:8px;
  top:8px;
  transform:none;
  max-width:calc(100% - 58px);
  padding:3px 8px;
  border:1px solid #dfd3af;
  border-radius:7px;
  background:#fff8e9e8;
  color:#285763;
  font-size:9px;
  line-height:13px;
  letter-spacing:.6px;
  z-index:4;
}
.workshop-scene .ship-art-status {
  inset:39% 17%;
  z-index:5;
  background:#fff8e9f2;
  border:1px solid #b9d3ca;
  border-radius:9px;
  font-size:13px;
  padding:8px;
}
.workshop-preview-reset {
  position:absolute;
  right:8px;
  top:8px;
  z-index:4;
  width:30px;
  min-height:30px;
  display:grid;
  place-items:center;
  padding:5px;
  appearance:none;
  border:1px solid #c4cdb8;
  border-radius:7px;
  background:#fff8e9f2;
  color:#285763;
}
.workshop-preview-reset .icon { width:16px; height:16px; }
.workshop-scene .ship-art-status[hidden],.workshop-preview-reset[hidden] { display:none; }

/* One bounded drawer replaces the stacked family/slot/theme/catalog strips. */
.workshop-drawer {
  width:100%;
  flex:0 0 236px;
  height:236px;
  min-height:0;
  display:flex;
  flex-direction:column;
  gap:4px;
}
.workshop-view-tabs {
  flex:0 0 30px;
  height:30px;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:5px;
}
.workshop-view-tab {
  min-width:0;
  padding:4px;
  appearance:none;
  border:1px solid #c6c7b3;
  border-radius:7px;
  background:#f4eddb;
  color:#315d67;
  font:inherit;
  font-size:12px;
  line-height:1.1;
}
.workshop-view-tab.selected { background:#177d8c; border-color:#177d8c; color:#fff5dc; }
.workshop-slot-strip.workshop-slot-grid {
  flex:0 0 88px;
  height:88px;
  min-height:0;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  grid-template-rows:repeat(2,minmax(0,1fr));
  gap:4px;
  padding:0;
  overflow:hidden;
}
.workshop-view-classic .workshop-slot-grid { flex-basis:76px; height:76px; }
.shipyard-v7-screen .vessel-slot.workshop-slot {
  position:static;
  min-width:0;
  width:auto;
  min-height:0;
  padding:3px 1px;
  display:flex;
  flex-direction:row;
  align-items:center;
  justify-content:center;
  gap:4px;
  border:1px solid #c0cbbd;
  border-radius:7px;
  background:#fff8e8;
  color:#315d67;
  font-size:10px;
  line-height:12px;
  box-shadow:none;
}
.shipyard-v7-screen .workshop-slot .icon { width:17px; height:17px; }
.shipyard-v7-screen .workshop-slot.selected { background:#177d8c; color:#fff6df; border-color:#177d8c; box-shadow:none; }
.shipyard-v7-screen .theme-selector.workshop-classic-themes {
  flex:0 0 28px;
  min-height:28px;
  height:28px;
  gap:4px;
}
.shipyard-v7-screen .workshop-classic-themes .theme-chip { min-height:0; padding:3px 2px; font-size:10px; border-radius:6px; }
.workshop-catalog-label { flex:0 0 12px; height:12px; display:flex; align-items:center; justify-content:space-between; gap:6px; padding:0 2px; color:#507271; }
.workshop-catalog-label>span { font-size:9px; letter-spacing:.5px; }
.workshop-catalog-label>small { font-size:9px; }
.shipyard-v7-screen .part-grid.workshop-parts {
  flex:1 1 auto;
  min-height:72px;
  width:100%;
  display:flex;
  gap:7px;
  padding:2px 2px 4px;
  overflow-x:auto;
  overflow-y:hidden;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  scrollbar-color:#9bbeb6 transparent;
}
.shipyard-v7-screen .workshop-part-card,.shipyard-v7-screen .workshop-set-card {
  position:relative;
  flex:0 0 78px;
  min-width:0;
  min-height:0;
  height:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  padding:5px 4px;
  appearance:none;
  border:1px solid #c4cebd;
  border-radius:9px;
  background:#fff9ec;
  color:#2b5664;
  text-align:center;
  box-shadow:none;
}
.shipyard-v7-screen .workshop-part-card.selected,.shipyard-v7-screen .workshop-set-card.selected { border-color:#198797; outline:none; box-shadow:inset 0 0 0 1px #198797; background:#edf7ef; }
.shipyard-v7-screen .workshop-part-card .part-thumbnail { width:52px; height:calc(100% - 22px); min-height:42px; max-height:70px; }
.shipyard-v7-screen .workshop-part-card strong,.shipyard-v7-screen .workshop-set-card strong { padding:0; font-size:11px; line-height:1.1; font-weight:400; }
.shipyard-v7-screen .workshop-part-card .part-status,.shipyard-v7-screen .workshop-set-card .part-status {
  position:absolute;
  top:4px;
  right:4px;
  width:14px;
  height:14px;
  display:grid;
  place-items:center;
  border:0;
  padding:0;
  color:#628078;
  font-size:9px;
}
.shipyard-v7-screen .workshop-part-card .part-status .icon,.shipyard-v7-screen .workshop-set-card .part-status .icon { width:12px; height:12px; }
.shipyard-v7-screen .workshop-part-card.owned .part-status,.shipyard-v7-screen .workshop-set-card.owned .part-status { color:#208177; }
.shipyard-v7-screen .workshop-set-card { flex-basis:116px; padding:7px; }
.shipyard-v7-screen .workshop-set-card .workshop-set-thumbnail { width:100%; height:calc(100% - 28px); min-height:90px; max-height:170px; }
.shipyard-v7-screen .part-selection {
  flex:0 0 58px;
  min-height:58px;
  height:58px;
  display:grid;
  grid-template-columns:minmax(0,1fr) 144px;
  align-items:center;
  gap:8px;
  padding:5px 0 0;
  border-top:1px solid #d1c7a7;
}
.shipyard-v7-screen .part-selection>div { gap:2px; min-width:0; }
.shipyard-v7-screen .part-selection strong { font-size:13px; line-height:1.12; font-weight:400; }
.shipyard-v7-screen .part-selection>div>span { font-size:10px; line-height:1.15; }
.shipyard-v7-screen .part-selection .selected-only-note { color:#607772; font-size:9px; }
.shipyard-v7-screen .part-selection .tool { min-height:48px; font-size:12px; padding:2px; }
.shipyard-v7-screen .part-selection .tool.long-label { font-size:11px; }
.shipyard-v7-screen .part-cost { font-size:12px!important; gap:4px; }
.shipyard-v7-screen .part-cost .icon { width:14px; height:14px; }
@media(max-height:760px) {
  .shipyard-v7-screen { gap:4px; }
  .shipyard-v7-screen .vessel-preview.workshop-scene { min-height:120px; }
  .workshop-drawer { flex-basis:220px; height:220px; gap:3px; }
  .workshop-slot-strip.workshop-slot-grid { flex-basis:82px; height:82px; }
  .workshop-view-classic .workshop-slot-grid { flex-basis:64px; height:64px; }
  .shipyard-v7-screen .theme-selector.workshop-classic-themes { flex-basis:25px; min-height:25px; height:25px; }
  .shipyard-v7-screen .part-grid.workshop-parts { min-height:65px; }
  .shipyard-v7-screen .part-selection { flex-basis:58px; min-height:58px; height:58px; }
}
@media(max-height:660px) {
  .shipyard-v7-screen .vessel-preview.workshop-scene { min-height:100px; }
  .workshop-drawer { flex-basis:204px; height:204px; }
  .workshop-slot-strip.workshop-slot-grid { flex-basis:70px; height:70px; }
  .workshop-view-classic .workshop-slot-grid { flex-basis:56px; height:56px; }
  .shipyard-v7-screen .part-grid.workshop-parts { min-height:59px; }
  .shipyard-v7-screen .workshop-part-card .part-thumbnail { min-height:32px; }
}
@media(max-width:350px) {
  .shipyard-v7-screen .vessel-slot.workshop-slot { flex-direction:column; gap:1px; font-size:8px; }
  .shipyard-v7-screen .workshop-slot .icon { width:15px; height:15px; }
  .shipyard-v7-screen .workshop-part-card { flex-basis:70px; }
  .shipyard-v7-screen .part-selection { grid-template-columns:minmax(0,1fr) 128px; }
}

/* Four crew sources share the registered rest-row foot pivot (160,304).
   Continuous motion is provided by the mesh layer or the gentle CSS fallback. */
.workshop-crew { position:absolute; inset:0; z-index:3; pointer-events:none; }
.workshop-worker {
  position:absolute;
  height:16.4%;
  width:auto;
  aspect-ratio:1;
  transform:translate(-50%,-95%);
  pointer-events:none;
}
.worker-carpenter { left:16%; top:94%; }
.worker-painter { left:43%; top:97%; }
.worker-foreman { left:78%; top:95.5%; height:15.6%; }
/* The rigger stands on the common deck. The scene projects these three pixel
   values from the same canvas fit used by the ship; zero size hides it while
   the composite is loading instead of guessing a percentage over the sea. */
.worker-rigger {
  left:var(--crew-deck-x,50%);
  top:var(--crew-deck-y,60%);
  width:var(--crew-deck-size,0px);
  height:var(--crew-deck-size,0px);
}
.worker-sprite {
  position:absolute;
  inset:0;
  display:block;
  background-image:url('assets/shipyard-v10/crew.png');
  background-repeat:no-repeat;
  background-size:400% 300%;
  background-position-x:calc(var(--crew-col) * 100% / 3);
  background-position-y:0%;
  pointer-events:none;
}
/* Contact at the fixed foot pivot; the cast lobe falls toward lower-right.
   It stays fixed on the floor/deck while the character above it moves. */
.worker-shadow {
  position:absolute;
  left:22%;
  top:88%;
  width:82%;
  height:15%;
  border-radius:50%;
  background:radial-gradient(ellipse 30% 24% at 35% 46%,#49321f70 0%,#5840263d 52%,transparent 100%),radial-gradient(ellipse 48% 40% at 60% 60%,#69472935 0%,#7050301e 52%,transparent 100%);
  transform:rotate(-5deg);
  pointer-events:none;
}
.worker-rigger .worker-shadow { opacity:.72; }
