﻿:root {
  font-family: system-ui, -apple-system, "Yu Gothic", sans-serif;
  color: #222925;
  background: #fff;
  font-size: 14px;
  line-height: 1.75;
  --border: #ddd;
}

* { box-sizing: border-box; }
body { margin: 0; background: #fff; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, label.button { cursor: pointer; }
button:disabled { color: #888; border-color: #ccc; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid #555;
  outline-offset: 3px;
}
h1, h2, p { margin-top: 0; }

.header {
  height: 64px;
  padding-inline: max(20px, calc((100vw - 1080px) / 2));
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.brand { font-size: 19px; font-weight: 700; }
main { max-width: 1120px; margin: auto; padding: 42px 20px 24px; }
.intro { margin-bottom: 28px; }
h1 { font-size: 30px; line-height: 1.4; margin-bottom: 12px; }
.intro p { color: #59625d; margin-bottom: 0; }
h2 { font-size: 16px; line-height: 1.5; margin: 0; }

.drop-zone {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.drop-zone.drag { background: #f5f5f5; border-color: #777; }
.drop-zone p { color: #626a65; font-size: 12px; margin: 5px 0 0; }
.drop-zone .button { margin-left: auto; white-space: nowrap; }
#zip-files { position: absolute; width: 1px; height: 1px; opacity: 0; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid #999;
  border-radius: 4px;
  background: #fff;
  color: #222;
  font-size: 13px;
  font-weight: 600;
}
.button:hover:not(:disabled), .view-controls button:hover { border-color: #444; }
.load-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 12px 0 28px; }
.load-bar p { margin: 0; font-size: 12px; color: #626a65; overflow-wrap: anywhere; }
.text-button { border: 0; background: none; color: #555; padding: 4px 0; font-size: 12px; white-space: nowrap; }
.text-button:hover:not(:disabled) { text-decoration: underline; }

.workspace { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 26px; align-items: start; }
.vehicles, .projection { min-width: 0; border-top: 1px solid #aaa; }
.panel-title { padding: 16px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.count { font-size: 11px; color: #626a65; }
.vehicles > input { width: 100%; margin: 0 0 14px; }
.vehicle-list { max-height: 650px; overflow: auto; border-top: 1px solid var(--border); }
.vehicle {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 10px;
  background: #fff;
  color: #222925;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-left: 2px solid transparent;
}
.vehicle.active { border-left-color: #555; background: #f5f5f5; }
.vehicle:hover { background: #f8f8f8; }
.vehicle strong, .vehicle small { display: block; overflow-wrap: anywhere; }
.vehicle strong { font-size: 12px; }
.vehicle small { color: #777; font-size: 10px; margin-top: 3px; }
.empty-list { padding: 35px 8px; text-align: center; color: #777; font-size: 12px; }
.projection .panel-title p { font-size: 11px; margin: 4px 0 0; color: #777; overflow-wrap: anywhere; }
.view-label { font-size: 11px; color: #666; white-space: nowrap; }
.view-controls { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 0 16px; }
.view-controls button { padding: 5px 9px; border: 1px solid #bbb; border-radius: 4px; background: #fff; color: #555; font-size: 12px; }
.view-controls button.active { border-color: #555; color: #222; font-weight: 700; }

/* The checkerboard indicates transparency and is not part of the saved PNG. */
.preview {
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  background-color: #fff;
  background-image: linear-gradient(45deg, #f0f0f0 25%, transparent 25%), linear-gradient(-45deg, #f0f0f0 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #f0f0f0 75%), linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
}
.preview canvas { display: block; max-width: 100%; max-height: 540px; width: auto; height: auto; }
.preview canvas[hidden] { display: none; }
#empty-preview { text-align: center; color: #777; font-size: 12px; }
#empty-preview p { margin: 0; }
.render-status { padding: 10px 0; font-size: 11px; color: #666; }
.render-status.error { color: #a33; }
.export-controls { display: flex; align-items: end; gap: 18px; flex-wrap: wrap; padding: 16px 0; border-top: 1px solid var(--border); }
.export-controls > label { font-size: 11px; color: #626a65; }
.export-controls select { display: block; margin-top: 4px; }
.export-controls .button { margin-left: auto; }
input[type=checkbox] { accent-color: #555; }
input[type=search], select { padding: 7px 9px; border: 1px solid #bbb; border-radius: 4px; background: #fff; color: #333; min-width: 0; }
.note { margin: 0 0 20px; color: #777; font-size: 11px; line-height: 1.8; }

/* Optional part controls and file diagnostics. */
details { padding: 14px 0; border-top: 1px solid var(--border); }
summary { font-size: 12px; font-weight: 600; cursor: pointer; }
summary span { margin-left: 6px; color: #777; }
.part-tools { display: flex; gap: 12px; flex-wrap: wrap; margin: 14px 0; }
.part-tools input { flex: 1; }
.parts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; max-height: 240px; overflow: auto; }
.part { display: flex; align-items: center; gap: 6px; font-size: 11px; overflow-wrap: anywhere; }
fieldset { min-width: 0; border: 0; margin: 0; padding: 0; }
fieldset:disabled { opacity: .55; }
.editor-help { font-size: 11px; color: #777; margin: 12px 0 0; }
.material-scroll { max-height: 320px; overflow: auto; }
.materials-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.materials-table th { position: sticky; top: 0; z-index: 1; background: #fff; font-weight: 600; white-space: nowrap; }
.materials-table th, .materials-table td { padding: 8px 6px; border-bottom: 1px solid var(--border); text-align: center; }
.materials-table th:nth-child(2), .materials-table td:nth-child(2) { text-align: left; }
.material-name { display: block; min-width: 105px; font-weight: 600; overflow-wrap: anywhere; }
.material-texture, .material-flags { display: block; max-width: 230px; color: #777; font-size: 10px; overflow-wrap: anywhere; }
.material-opacity { display: flex; align-items: center; gap: 5px; }
.material-opacity input { width: 68px; accent-color: #555; }
.material-opacity output { width: 32px; text-align: right; white-space: nowrap; }
#messages { padding-left: 18px; color: #666; font-size: 11px; overflow-wrap: anywhere; }
footer { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border); color: #777; font-size: 11px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }

@media (max-width: 850px) {
  .workspace { grid-template-columns: 200px minmax(0, 1fr); gap: 20px; }
  .drop-zone { flex-wrap: wrap; gap: 14px; }
  .drop-zone .button, .export-controls .button { margin-left: 0; }
  .parts { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  main { padding: 28px 15px 20px; }
  .header { padding-inline: 15px; }
  h1 { font-size: 25px; }
  .workspace { grid-template-columns: 1fr; gap: 26px; }
  .vehicle-list { max-height: 220px; }
  .drop-zone { padding: 15px; }
  .preview { min-height: 230px; padding: 14px; }
  .export-controls { gap: 12px; }
  .view-controls { gap: 4px; }
  .view-controls button { padding: 5px 8px; }
  .parts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
