/* BUILD: 2026-01-27T-specs */

:root {
  --max: 1100px;
  --pad: 16px;
  --bg: #0f1115;
  --card: #151a22;
  --text: #e8e8e8;
  --muted: #b7b7b7;
  --border: #2a3342;
  --accent: #9cc2ff;
  --accent2: #72ffb0;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}
header {
  border-bottom: 1px solid var(--border);
  padding: 14px var(--pad);
}
header .wrap,
main .wrap {
  max-width: var(--max);
  margin: 0 auto;
}
header h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.3px;
}
header nav {
  margin-top: 8px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
header a {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
}
header a:hover {
  text-decoration: underline;
}

main {
  padding: 18px var(--pad);
}

.card {
  max-width: var(--max);
  margin: 0 auto 16px auto;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.h2 {
  margin: 0 0 10px 0;
  font-size: 16px;
}
.small {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 0 0;
}

.stepbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.pill {
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
}
.pill strong {
  color: var(--text);
  font-weight: 600;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 1000px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 760px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.tile {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #0b0f16;
  cursor: pointer;
  transition:
    transform 0.06s ease,
    border-color 0.12s ease,
    box-shadow 0.12s ease;
  user-select: none;
  position: relative;
}
.tile:hover {
  transform: translateY(-1px);
  border-color: #3b4a63;
}
.tile.selected {
  border-color: var(--accent2);
  box-shadow: 0 0 0 2px rgba(114, 255, 176, 0.22);
}
.tile img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  background: #101623;
}
.tile .label {
  padding: 10px 10px 12px 10px;
  font-size: 13px;
  color: var(--text);
}
.tile .sub {
  padding: 0 10px 12px 10px;
  margin-top: -8px;
  font-size: 12px;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  background: #0b0f16;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
}

/* ===== Spec preview/export typography ===== */
.spec {
  font-family: "Courier New", Courier, monospace;
  font-size: 12px; /* Browser preview size */
  line-height: 1.35;
  color: #111; /* darker text */
  white-space: normal; /* IMPORTANT: let paragraphs wrap */
}

/* Paragraph blocks */
.spec .p {
  margin: 0;
}

/* Spacing like MasterSpec */
.spec .spacer {
  height: 12px;
}

/* Headings */
.spec .hdrline,
.spec .hdrtitle {
  font-weight: 700;
}

.spec .part {
  font-weight: 700;
}

.spec .subhead {
  font-weight: 700;
}

/* Header with right-justified project info */
.spec .hdr {
  display: table;
  width: 100%;
  table-layout: fixed;
}
.spec .hdr-left,
.spec .hdr-right {
  display: table-cell;
  vertical-align: top;
}
.spec .hdr-right {
  text-align: right;
}

/* Hanging indent layout (Word-safe) */
.spec .hang {
  display: table;
  width: 100%;
  table-layout: fixed;
}
.spec .hang .lead {
  display: table-cell;
  width: 44px; /* controls indent column */
  padding-right: 8px;
  vertical-align: top;
}
.spec .hang .body {
  display: table-cell;
  vertical-align: top;
}

/* OPTIONAL: Word export can be slightly smaller */
.spec.export {
  font-size: 11px;
  line-height: 1.3;
}

/* Step 2 layout */
.height-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}

@media (max-width: 900px) {
  .height-layout {
    grid-template-columns: 1fr;
  }
}

.height-card {
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.height-card-title {
  font-weight: 700;
  margin-bottom: 10px;
}

.height-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 900px) {
  .height-grid-2 {
    grid-template-columns: 1fr;
  }
}

.field {
  display: block;
}
.field-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}
.field-help {
  display: block;
  opacity: 0.8;
  margin-top: 6px;
  font-size: 12px;
}

.calc-box {
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px dashed rgba(0, 0, 0, 0.25);
  background: rgba(0, 0, 0, 0.03);
}

.calc-title {
  font-weight: 700;
  margin-bottom: 6px;
}
.calc-line {
  font-family: "Courier New", Courier, monospace;
}

/* Preset heights container */
.height-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 12px;
  border-radius: 8px;
}

/* Each preset option */
.height-preset-option {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start; /* KEY: aligns radios evenly */
  cursor: pointer;
}

/* Radio alignment */
.height-preset-option input[type="radio"] {
  margin-top: 2px; /* optical centering */
}

/* Text block */
.preset-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.preset-title {
  font-weight: 700;
  line-height: 1.2;
}

.preset-sub {
  font-size: 12px;
  opacity: 0.85;
  line-height: 1.3;
}

/* Mobile fallback */
@media (max-width: 900px) {
  .height-presets {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Choice Tiles (global)
   - Highlights selected tile
   - Dims non-selected tiles (within the same grid group)
   - Slightly enlarges images
   ============================================================ */

/* Grid container (you already have .grid; this is additive) */
.grid.choice-grid {
  gap: 14px; /* more breathing room */
}

/* Tile base */
.tile.choice label {
  display: block;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
  transition:
    transform 120ms ease,
    opacity 120ms ease,
    filter 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease;
  cursor: pointer;
  padding: 12px;
}

/* Bigger images */
.tile.choice label img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  /* Make images feel bigger by reducing extra UI chrome */
  margin-bottom: 10px;
  transform: scale(1.03);
  transition:
    transform 120ms ease,
    filter 120ms ease;
}

/* Title/label typography */
.tile.choice label .label {
  font-weight: 800;
  font-size: 15px;
  line-height: 1.2;
  margin-top: 4px;
}

.tile.choice label .sub {
  opacity: 0.85;
  font-size: 12px;
  margin-top: 2px;
}

/* Hover (only if not selected) */
.tile.choice:hover label {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.22);
}

/* ------------------------------------------------------------
   Selected vs non-selected behavior:
   We dim *other tiles* only after a selection exists in that grid.
   We do this by toggling `.has-selection` on the grid element in JS.
------------------------------------------------------------ */

/* default: no dim until user selects something */
.grid.choice-grid.has-selection .tile.choice {
  opacity: 0.42;
  filter: grayscale(0.15);
}

/* selected tile becomes bright */
.grid.choice-grid.has-selection
  .tile.choice
  input[type="radio"]:checked
  + label {
  opacity: 1;
  filter: none;
  border-color: rgba(255, 255, 255, 0.38);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.55);
  transform: translateY(-1px);
}

/* selected tile image pops slightly */
.grid.choice-grid.has-selection
  .tile.choice
  input[type="radio"]:checked
  + label
  img {
  transform: scale(1.06);
  filter: none;
}

/* Accessibility: focus ring */
.tile.choice input[type="radio"]:focus + label {
  outline: 2px solid rgba(255, 255, 255, 0.45);
  outline-offset: 3px;
}

/* Optional: if you want tiles bigger overall */
.tile.choice {
  /* if your grid is tight, you can enforce minimum size */
  min-width: 220px;
}

/* =========================================================
   Keystone — Toolbar + Button System (PASTE AT BOTTOM)
   ========================================================= */

/* Toolbar (layout only) */
.spec-toolbar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0 0 16px 0;
  padding: 0;
  border: 0;
  background: transparent;
}

/* Base button (global) */
button {
  appearance: none;
  -webkit-appearance: none;

  padding: 10px 14px;
  border-radius: 10px;

  border: 1px solid var(--border);
  background: #0f141c;
  color: var(--text);

  cursor: pointer;
  font-weight: 600;
  line-height: 1;
}

button:hover {
  filter: brightness(1.05);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* Primary button */
button.primary {
  background: #111a28;
  border-color: #3b4a63;
  color: var(--text);
}

button.secondary {
  background: #05ad37;
  border-color: #056d17;
  color: #0b0f16;
}

button.secondary:hover {
  background: #06c341;
}

button.secondary:active {
  transform: translateY(1px);
}

/* Danger button (wins globally) */
button.danger {
  font-weight: 700;
  letter-spacing: 0.2px;

  background: rgba(176, 0, 32, 0.25);
  color: #ffb3bd;
  border-color: rgba(176, 0, 32, 0.6);
}

button.danger:hover {
  background: rgba(176, 0, 32, 0.35);
}

button.danger:active {
  transform: translateY(1px);
}

.cover {
  --ink: #111;
  --muted: rgba(0, 0, 0, 0.65);
  --accent: #0b5; /* default fallback */
  --tint: rgba(0, 0, 0, 0.02); /* subtle paper tint */
}

.cover.theme-solid_plastic {
  --accent: #2b6cb0;
  --tint: rgba(43, 108, 176, 0.05);
}
.cover.theme-solid_phenolic {
  --accent: #111827;
  --tint: rgba(17, 24, 39, 0.04);
}
.cover.theme-plam {
  --accent: #8a5a2b;
  --tint: rgba(138, 90, 43, 0.05);
}

.cover-logo img {
  height: 42px; /* adjust to taste */
  width: auto;
  display: block;
  filter: brightness(1); /* safety for white logos */
}

.materials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.material-card img {
  width: 100%;
  height: auto;
  display: block;
}

.landing-description {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.45;
  font-size: 0.95rem;
}

#euro-ultimate-mounts,
#euro-ultimate-heights {
  margin-bottom: 10px;
}

/* Hide build/continue buttons until the card is selected */
.landing-choice-card .landing-build-button {
  display: none;
}

.landing-choice-card:has(input[type="radio"]:checked) .landing-build-button {
  display: inline-flex;
}

.keystone-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.keystone-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.keystone-modal-panel {
  position: relative;
  z-index: 2;
  width: min(980px, calc(100vw - 32px));
  margin: 40px auto;
  background: #1b1f26;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.keystone-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.keystone-modal-head h2 {
  margin: 0;
}

.keystone-modal-close {
  background: transparent;
  color: white;
  border: 0;
  font-size: 1.5rem;
  cursor: pointer;
}

.keystone-modal-body {
  padding: 20px;
}

.keystone-modal-intro {
  margin-top: 0;
  margin-bottom: 18px;
  color: rgba(255, 255, 255, 0.82);
}

.keystone-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 20px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.engraving-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 900px) {
  .engraving-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .engraving-grid {
    grid-template-columns: 1fr;
  }
}

.engraving-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: white;
}

.engraving-card img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.engraving-card span {
  font-weight: 600;
}

.engraving-card.is-active {
  border-color: rgba(90, 160, 255, 0.85);
  box-shadow: 0 0 0 2px rgba(90, 160, 255, 0.18);
}
