/* Shared style of the STL Generator, based on renswijnmalen.nl (colours, fonts, rounded buttons) */
:root {
  --bg: #ffffff; --ink: #1f1a2e; --ink-rgb: 31,26,46; --muted: #4a4358; --faint: #706580;
  --red: #d0391f; --red-dark: #a82a13; --yellow: #ffd23f; --pink: #f7b7cc;
  --card: #f1e4cf; --green: #bfe6d0; --purple: #cdbaf5;
  --heading-font: 'Fredoka', system-ui, sans-serif;
  --header-height: 66px;
  --subbar-height: 72px;
  /* Colours for the 3D preview (read by the script) */
  --model: #d0391f; --model-edge: #7e1f0e; --grid: #d9c8aa; --grid-strong: #b49d78;
  --panel-2d: #fff6e4;
}
/* Dark: automatic via the system unless light is chosen, or forced with the theme switch */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #15111d; --ink: #f2ecf8; --ink-rgb: 242,236,248; --muted: #c3b9d1; --faint: #9c91ad;
    --red: #ef5536; --red-dark: #c93d22; --card: #2a2337; --green: #1d3329;
    --yellow-panel: #3a3016; --purple: #2b2445;
    --model: #ef5536; --model-edge: #8f2410; --grid: #3d3450; --grid-strong: #5c5174;
    --panel-2d: #3b3326;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #15111d; --ink: #f2ecf8; --ink-rgb: 242,236,248; --muted: #c3b9d1; --faint: #9c91ad;
  --red: #ef5536; --red-dark: #c93d22; --card: #2a2337; --green: #1d3329;
  --yellow-panel: #3a3016; --purple: #2b2445;
  --model: #ef5536; --model-edge: #8f2410; --grid: #3d3450; --grid-strong: #5c5174;
  --panel-2d: #3b3326;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body {
  color: var(--ink);
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-size: 16px; line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--red); text-decoration: none; }
h1, h2 { font-family: var(--heading-font); font-weight: 600; letter-spacing: -0.01em; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  height: var(--header-height);
  border-bottom: 1px solid rgba(var(--ink-rgb), 0.12);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(8px);
}
.header-inner {
  height: 100%; max-width: 1500px; margin: 0 auto; padding: 0 28px;
  display: flex; align-items: center; gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 12px; margin-right: auto;
  font-family: var(--heading-font); font-weight: 600; font-size: 24px; line-height: 1; color: var(--ink);
}
.brand-accent { color: var(--red); }
.brand-dot {
  width: 15px; height: 15px; border-radius: 50%; background: var(--yellow); flex: 0 0 auto;
  box-shadow: 0 0 0 5px rgba(255,210,63,0.35), 0 0 18px 6px rgba(255,210,63,0.45);
}
.nav-link {
  color: var(--ink); font-size: 15px; font-weight: 500;
  padding: 7px 14px; border-radius: 999px; transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--yellow); color: #1f1a2e; }
.theme-switch { display: flex; gap: 2px; padding: 2px; border: 2px solid var(--ink); border-radius: 999px; }
.theme-switch button {
  font: inherit; font-size: 14px; font-weight: 500; color: var(--ink);
  background: none; border: 0; border-radius: 999px; padding: 3px 12px; cursor: pointer;
  transition: background .15s, color .15s;
}
.theme-switch button:hover { background: var(--yellow); color: #1f1a2e; }
.theme-switch button.is-active { background: var(--ink); color: var(--bg); }
/* While a Dutch page is still being translated (assets/theme-init.js, js/core/i18n.js) */
html[data-translating] body { visibility: hidden; }

.pill {
  align-self: flex-start; margin: 0;
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600;
  padding: 6px 13px; border-radius: 999px; background: var(--yellow); color: #1f1a2e;
}
h1 { font-size: 34px; line-height: 1.08; margin: 0; }
h2 { font-size: 24px; line-height: 1.15; margin: 0; }
h3 { font-family: var(--heading-font); font-weight: 600; font-size: 19px; line-height: 1.2; margin: 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.fields { display: flex; flex-direction: column; gap: 14px; }
.unused { opacity: .4; }
.unused label::after { content: ' · not used by this part'; font-weight: 500; color: var(--muted); }
input.invalid { border-color: var(--red); background: color-mix(in srgb, var(--red) 8%, var(--bg)); }
.text-button {
  align-self: flex-start; padding: 0 0 2px; background: none; border: 0; border-bottom: 2px solid var(--ink);
  font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer;
  transition: color .18s, border-color .18s;
}
.text-button:hover { color: var(--red); border-bottom-color: var(--red); }
.small-screen { display: none; }
.lead { margin: -6px 0 0; color: var(--muted); font-size: 15px; }

/* Forms */
label { display: block; font-size: 14px; font-weight: 600; margin: 0 0 6px 4px; }
input, select {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  padding: 10px 18px; border: 2px solid var(--ink); border-radius: 999px; background: var(--bg);
}
input:focus, select:focus { outline: 3px solid var(--yellow); outline-offset: 2px; }
.select { position: relative; }
.select select { -webkit-appearance: none; appearance: none; padding-right: 46px; cursor: pointer; font-weight: 500; }
.select::after {
  content: ""; position: absolute; right: 22px; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.field { position: relative; }
.field .unit {
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  color: var(--faint); font-size: 14px; pointer-events: none;
}
.field input { padding-right: 48px; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.4; margin: 5px 0 0 4px; }
#part-fields { display: flex; flex-direction: column; gap: 14px; }
#part-form { margin: 0; }

/* Buttons */
.buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  flex: 1 1 auto;
  font: inherit; font-size: 15px; font-weight: 600;
  padding: 13px 24px; border-radius: 999px; cursor: pointer;
  transition: background-color .18s, color .18s, border-color .18s;
}
.btn-red { background: var(--red); color: #ffffff; border: 2px solid var(--red); }
.btn-red:hover:not(:disabled) { background: var(--red-dark); border-color: var(--red-dark); }
.btn-outline { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.btn-outline:hover:not(:disabled) { background: var(--ink); color: var(--bg); }
.btn-dark { background: var(--ink); color: var(--bg); border: 2px solid var(--ink); }
.btn-dark:hover { background: var(--red); border-color: var(--red); color: #ffffff; }
.btn-small { flex: none; padding: 7px 16px; font-size: 14px; }

/* Tool window: the same frame for "Design the lamp" and "Separate parts" */
[hidden] { display: none !important; }
/* Without access to the STL files there is no Separate parts (see generator.js) */
[data-no-parts] [data-parts-only] { display: none; }
.tool-window {
  width: calc(100% - 56px); max-width: 1600px; margin: 0 auto 28px;
  height: calc(100vh - var(--header-height) - var(--subbar-height) - 28px); min-height: 640px;
  border-radius: 28px; background: var(--bg); color: var(--ink); overflow: hidden;
  border: 1px solid rgba(var(--ink-rgb), 0.14);
  position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr);
}
.window-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 24px; border-bottom: 1px solid rgba(var(--ink-rgb), 0.12);
}
.window-bar .buttons { flex-wrap: nowrap; }
.window-title { display: flex; align-items: center; gap: 16px; }
.window-title .btn { text-decoration: none; }
.window-meta {
  font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.3;
  padding: 4px 12px; border-radius: 999px; background: var(--yellow); color: #1f1a2e;
}
/* Rows of a fixed height (the window), so content can never stretch the window: on a large screen the
   3D canvas otherwise grew the row a little on every resize, and the drawing slid down */
.window-body { position: relative; display: grid; grid-template-rows: minmax(0, 1fr); min-height: 0; }
/* A scrolling column inside the window, separated by a thin line */
.window-column {
  display: flex; flex-direction: column; gap: 16px; padding: 24px; min-height: 0; overflow-y: auto;
  border-right: 1px solid rgba(var(--ink-rgb), 0.12);
}

/* Separate parts: shared sizes | sizes of the part | 3D preview */
.parts-body { grid-template-columns: 300px 340px minmax(0, 1fr); }
.part-column .hint { margin-top: 8px; }
.part-column .field-group > .hint { margin: -4px 0 0 4px; }
/* Colours with a fixed meaning in both tabs: green = where you work, purple = shared sizes */
.part-column, .editor-panel { background: var(--green); }
.panel-shared, #sizes-drawer { background: var(--purple); }
.drawer .panel-shared { padding: 0; border: 0; overflow: visible; background: none; }
.drawer .panel-shared > h3 { display: none; }

/* Main tabs in the header */
/* Bar below the header: back button, lamp name and the main tabs */
.subbar {
  max-width: 1600px; height: var(--subbar-height); margin: 0 auto; padding: 0 28px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
}
.subbar-left { display: flex; align-items: center; gap: 14px; }
.subbar-left .btn { text-decoration: none; }
.lamp-select select {
  width: auto; min-width: 180px; padding: 6px 42px 6px 18px;
  font-family: var(--heading-font); font-size: 17px; font-weight: 600;
}
.lamp-select::after { right: 18px; }
.main-tabs { display: flex; gap: 2px; padding: 3px; border: 2px solid var(--ink); border-radius: 999px; }
.main-tabs button {
  font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); background: none; border: 0;
  border-radius: 999px; padding: 6px 18px; cursor: pointer; transition: background .15s, color .15s;
}
.main-tabs button:hover { background: var(--yellow); color: #1f1a2e; }
.main-tabs button.is-active { background: var(--ink); color: var(--bg); }
.designer-workspace {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); min-height: 0;
}
/* Lamps without a drawing editor: settings column and the 3D view */
.designer-workspace.workspace-settings-3d { grid-template-columns: 290px minmax(0, 1fr); }
/* Settings on the left, drawing of the side on the right */
.editor-work { flex: 1; min-height: 0; display: grid; grid-template-columns: 290px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.editor-panel {
  order: -1;
  display: flex; flex-direction: column; gap: 16px; overflow-y: auto; min-height: 0; padding: 24px;
  border-right: 1px solid rgba(var(--ink-rgb), 0.12);
}
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%); z-index: 5;
  padding: 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px;
  background: var(--bg); border-left: 1px solid rgba(var(--ink-rgb), 0.12);
  box-shadow: -18px 0 40px rgba(21, 17, 29, 0.18);
  transform: translateX(105%); visibility: hidden;
  transition: transform .25s ease, visibility 0s linear .25s;
}
.drawer.open { transform: none; visibility: visible; transition: transform .25s ease; }
.drawer-left {
  right: auto; left: 0; border-left: 0; border-right: 1px solid rgba(var(--ink-rgb), 0.12);
  box-shadow: 18px 0 40px rgba(21, 17, 29, 0.18); transform: translateX(-105%);
}
/* Shared sizes and the design panels: every group in its own block */
#shared-fields { gap: 16px; }
.field-group {
  display: flex; flex-direction: column; gap: 14px;
  padding: 14px 14px 18px; border-radius: 22px;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  border: 1px solid rgba(var(--ink-rgb), 0.1);
}
.field-group-title {
  margin: 0 0 2px; padding: 2px 0 12px 4px; border-bottom: 1px solid rgba(var(--ink-rgb), 0.14);
  font-family: var(--heading-font); font-size: 17px; font-weight: 600; line-height: 1.25; color: var(--ink);
}
.side-editor {
  display: flex; flex-direction: column; gap: 14px; min-height: 0;
  border-right: 1px solid rgba(var(--ink-rgb), 0.12);
}
.editor-drawing { display: flex; flex-direction: column; align-items: center; gap: 14px; min-height: 0; padding: 24px; }
.side-tabs { align-self: center; flex: none; display: flex; gap: 2px; padding: 2px; border: 2px solid var(--ink); border-radius: 999px; }
.side-tabs button {
  font: inherit; font-size: 14px; font-weight: 500; color: var(--ink); background: none; border: 0;
  border-radius: 999px; padding: 4px 14px; cursor: pointer; transition: background .15s, color .15s;
}
.side-tabs button:hover { background: var(--yellow); color: #1f1a2e; }
.side-tabs button.is-active { background: var(--ink); color: var(--bg); }
#editor { flex: 1; width: 100%; min-height: 0; touch-action: none; user-select: none; }
.ed-frame { fill: var(--rib, var(--model)); }
/* Thin outline, so dark ribs stay visible on a dark background */
.ed-frame, .ed-rib { stroke: rgba(var(--ink-rgb), 0.25); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.ed-cell { fill: var(--panel-2d); cursor: pointer; }
.ed-cell:hover { filter: brightness(0.94); }
.ed-cell.selected { stroke: var(--ink); stroke-width: 3px; vector-effect: non-scaling-stroke; stroke-dasharray: 6 4; }
.ed-rib { fill: var(--rib, var(--model)); }
.ed-rib.h { cursor: ns-resize; }
.ed-rib.v { cursor: ew-resize; }
.ed-rib:hover { filter: brightness(0.82); }
.ed-rib.selected { fill: var(--rib-selected, var(--ink)); }
.actions { display: flex; flex-direction: column; gap: 16px; }
.actions .field-group { gap: 12px; }
.actions .buttons { gap: 8px; }
.actions p { margin: 0; }
.kicker { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.selection-text { font-weight: 600; }
.label-text { font-size: 14px; font-weight: 600; margin: 0 0 8px 4px !important; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; padding: 6px; }
/* Fold-out colour choice: a row like a select, the swatches open below it */
.color-picker summary {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 8px 44px 8px 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--bg);
  font-weight: 500; font-size: 15px; cursor: pointer; list-style: none; user-select: none;
}
.color-picker summary::-webkit-details-marker { display: none; }
.color-picker summary::after {
  content: ""; position: absolute; right: 20px; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
  transform: translateY(-70%) rotate(45deg); transition: transform .15s;
}
.color-picker[open] summary::after { transform: translateY(-25%) rotate(-135deg); }
.color-picker summary:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.color-picker summary .dot { width: 18px; height: 18px; margin: 0; flex: none; }
.color-picker .swatches {
  /* As many columns as fit, so the swatches never stick out of a narrow panel or block */
  display: grid; grid-template-columns: repeat(auto-fill, minmax(28px, 1fr)); justify-items: center; gap: 10px;
  margin-top: 8px; padding: 12px; border-radius: 20px; background: var(--bg);
}
.color-picker .swatch { width: 28px; height: 28px; }
.swatch {
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer; padding: 0;
  background: var(--swatch); border: 2px solid rgba(var(--ink-rgb), 0.3);
}
.swatch:hover { border-color: var(--ink); }
.swatch.is-active { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); }
.swatch-custom {
  position: relative; display: inline-block; overflow: hidden;
  margin: 0;   /* it is a <label>: no label margin, so it lines up with the other swatches */
  background: conic-gradient(#d0391f, #ffd23f, #3fa776, #1f9fd0, #1f4fd0, #9b4fd0, #d0391f);
}
.swatch-custom.is-active { background: radial-gradient(var(--swatch) 0 48%, transparent 50%),
  conic-gradient(#d0391f, #ffd23f, #3fa776, #1f9fd0, #1f4fd0, #9b4fd0, #d0391f); }
.swatch-custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px;
  background: var(--swatch); box-shadow: 0 0 0 1px rgba(var(--ink-rgb), 0.3);
}
#parts-list > .btn { width: 100%; margin: 4px 0 8px; }
.dl {
  font: inherit; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--ink); border: 2px solid rgba(var(--ink-rgb), 0.3);
  white-space: nowrap;   /* the lock icon (when downloading is locked) stays in front of "STL" */
}
.dl:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
#designer-viewer { position: relative; min-height: 0; overflow: hidden; background: var(--card); }
/* The canvas never takes part in the layout: it fills the viewer, whatever its pixel size */
#designer-viewer canvas { position: absolute; inset: 0; }
.drawer-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.parts-total { margin: 0 0 8px; font-family: var(--heading-font); font-size: 20px; font-weight: 600; }
.parts-section { margin-top: 20px; }
.parts-section-head { display: flex; align-items: center; gap: 8px; padding-bottom: 4px; }
.parts-section-head h3 { font-size: 17px; }
.parts-section-count { color: var(--muted); font-size: 13px; }
.parts-section-head .dl { margin-left: auto; }
.parts-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.parts-table td { padding: 7px 6px; border-top: 1px solid rgba(var(--ink-rgb), 0.14); vertical-align: top; }
.parts-table td:first-child { font-weight: 600; white-space: nowrap; padding-left: 0; }
.parts-table td:nth-child(3) { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.parts-table td:last-child { text-align: right; padding-right: 0; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* Messages and info */
#messages:empty, #designer-messages:empty { display: none; }
#messages, #designer-messages { display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.4; }
.error, .warning { padding: 10px 14px; border-radius: 16px; }
.error { background: var(--red); color: #ffffff; font-weight: 500; }
.warning { background: var(--yellow); color: #1f1a2e; }
/* The Model block only shows once there is a model */
.info-group:has(#info:empty) { display: none; }
#info { font-size: 14px; }
#info dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; }
#info dt { color: var(--muted); }
#info dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

/* 3D preview */
.preview { position: relative; min-height: 0; background: var(--card); overflow: hidden; }
#viewer { position: absolute; inset: 0; }
#empty {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 24px;
  text-align: center; color: var(--muted); pointer-events: none;
  font-family: var(--heading-font); font-size: 22px; font-weight: 500;
}
.controls-hint {
  position: absolute; left: 16px; bottom: 14px; pointer-events: none;
  font-size: 13px; color: var(--muted);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  padding: 4px 12px; border-radius: 999px;
}

/* Small screens: generator off, explanation on */
@media (max-width: 1099px) {
  .tool-window, .subbar { display: none !important; }
  .small-screen { display: block; max-width: 560px; margin: 56px auto; padding: 0 24px; }
  .small-screen p { color: var(--muted); }
  .small-screen .pill { display: inline-block; color: #1f1a2e; }
  .small-screen h1 { margin: 16px 0 12px; }
  .header-inner { padding: 0 20px; }
  /* No website link and no login in the header (the link is in the notice); the theme switch stays */
  .header-inner > .nav-link, .site-header .account { display: none; }
  .header-inner { gap: 16px; }
  .small-screen .btn { display: inline-block; margin-top: 8px; text-decoration: none; }
}
@media (max-width: 520px) {
  /* Brand on two lines and small switches, so the language and theme switch both fit */
  .header-inner { padding: 0 14px; gap: 8px; }
  .brand { font-size: 16px; gap: 8px; line-height: 1.1; }
  .brand-dot { display: none; }
  .brand-accent { display: block; }
  .theme-switch button { font-size: 12px; padding: 3px 7px; }
}

/* Back to the overview */
.back-link { align-self: flex-start; font-size: 14px; font-weight: 600; color: var(--ink); border-bottom: 2px solid currentColor; }
.back-link:hover { color: var(--red); }

/* ---------------------------------------------------------------- Overview of lamps */
.overview { max-width: 1200px; margin: 0 auto; padding: 56px 28px 80px; }
.overview-header { max-width: 640px; margin-bottom: 40px; }
.overview-header h1 { font-size: 52px; line-height: 1.04; letter-spacing: -0.02em; margin: 0 0 14px; }
.overview-header .lead { font-size: 18px; margin: 0; }
.lamp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(540px, 100%), 1fr)); gap: 28px; }
.lamp-card {
  display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 24px; align-items: start;
  padding: 26px; border-radius: 28px; background: var(--band, var(--green));
}
.lamp-card h3 { font-size: 28px; line-height: 1.15; margin: 0 0 4px; }
.lamp-card .status-label {
  display: inline-block; vertical-align: middle; margin-left: 8px; padding: 3px 10px; border-radius: 999px;
  background: var(--yellow); color: #1f1a2e; font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
}
.lamp-card .tagline { margin: 0 0 12px; font-weight: 600; color: var(--muted); }
.lamp-card .description { margin: 0 0 20px; font-size: 15px; color: var(--muted); }
.lamp-card .buttons .btn { flex: none; text-decoration: none; padding: 12px 20px; }
.lamp-card .buttons { align-items: center; }
.lamp-card .free-note { font-size: 14px; font-weight: 600; color: var(--muted); }
.drawing { background: var(--card); border-radius: 20px; padding: 16px; display: grid; place-items: center; }
.drawing svg { width: 100%; height: auto; max-height: 220px; }
.dr-rib { fill: var(--model); }
.dr-panel { fill: var(--panel-2d); }
.dr-red { fill: #d0391f; fill-opacity: .75; }
.dr-yellow { fill: #ffd23f; fill-opacity: .8; }
.dr-blue { fill: #1f4fd0; fill-opacity: .75; }
.dr-stud { fill: #ffffff; fill-opacity: .35; stroke: #1f1a2e; stroke-opacity: .25; }
.lamp-card .card-link { color: inherit; }
.lamp-card .card-link:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* ---------------------------------------------------------------- Page of one project (<id>/index.html) */
.project-page { max-width: 1100px; margin: 0 auto; padding: 32px 28px 80px; display: flex; flex-direction: column; gap: 56px; }
.breadcrumbs { font-size: 14px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: -32px; }
.breadcrumbs a { color: var(--ink); font-weight: 600; }
.breadcrumbs a:hover { color: var(--red); }
.project-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.project-intro .pill { display: inline-block; }
.project-intro h1 { font-size: 52px; line-height: 1.04; letter-spacing: -0.02em; margin: 16px 0 12px; }
.project-intro .status-label {
  display: inline-block; vertical-align: middle; padding: 3px 10px; border-radius: 999px;
  background: var(--yellow); color: #1f1a2e; font-family: inherit; font-size: 13px; font-weight: 600; letter-spacing: 0.04em;
}
.project-intro .lead { margin: 0 0 14px; font-size: 20px; font-weight: 600; }
.project-intro .description { margin: 0 0 20px; font-size: 17px; line-height: 1.5; color: var(--muted); }
.project-intro .buttons .btn { flex: none; text-decoration: none; padding: 12px 20px; }
.story-card {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: 26px 30px; border-radius: 28px; background: var(--card);
}
.story-card h2 { font-size: 26px; margin-bottom: 6px; }
.story-card p { margin: 0; color: var(--muted); }
.story-card .btn { flex: none; text-decoration: none; padding: 12px 20px; }
.project-hero .drawing { padding: 40px; border-radius: 28px; }
.project-hero .drawing svg { max-height: 360px; }
.project-section h2 { scroll-margin-top: calc(var(--header-height) + 24px); font-size: 34px; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 2px solid rgba(var(--ink-rgb), 0.12); }
.feature-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 48px; }
/* A small glowing yellow dot before every point, like the dot in the logo (.brand-dot) */
.feature-list li { position: relative; padding-left: 30px; }
.feature-list li::before {
  content: ''; position: absolute; left: 4px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--yellow);
  box-shadow: 0 0 0 3.5px rgba(255,210,63,0.35), 0 0 12px 4px rgba(255,210,63,0.45);
}
.feature-list h3 { font-size: 21px; margin-bottom: 6px; }
.feature-list p { margin: 0; color: var(--muted); line-height: 1.5; }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 20px; }
.steps li { counter-increment: step; padding: 22px; border-radius: 24px; background: var(--card); }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 12px;
  border-radius: 50%; background: var(--yellow); color: #1f1a2e; font-family: var(--heading-font); font-weight: 600;
}
.steps h3 { font-size: 21px; margin-bottom: 6px; }
.steps p { margin: 0; color: var(--muted); line-height: 1.45; }
/* "More to make": cards like those of the website, with the drawing on the colour of that project's page */
.more-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 28px 24px; }
.more-card { display: flex; flex-direction: column; gap: 4px; height: 100%; color: var(--ink); text-decoration: none; transition: transform .2s; }
.more-card:hover { transform: translateY(-5px); }
.more-drawing { position: relative; aspect-ratio: 4 / 3; margin-bottom: 10px; border-radius: 22px; background: var(--band); }
/* The drawing on a white sheet, as at the top of the page (yellow parts would fade into a yellow tile) */
.more-sheet { position: absolute; inset: 16px; border-radius: 14px; background: #ffffff; transition: box-shadow .2s; }
.more-card:hover .more-sheet { box-shadow: 0 12px 24px -14px color-mix(in srgb, var(--band-shadow) 75%, transparent); }
.more-sheet svg { position: absolute; inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); }
.more-card strong { font-family: var(--heading-font); font-weight: 600; font-size: 21px; line-height: 1.2; }
.more-card:hover strong { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.more-card span { color: var(--muted); font-size: 14px; line-height: 1.45; }
@media (max-width: 520px) {
  .more-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
  .more-sheet { inset: 10px; border-radius: 10px; }
  .more-sheet svg { inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); }
  .more-card strong { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { .more-card, .more-sheet { transition: none; } .more-card:hover { transform: none; } }
/* "Ideas to start from": the example designs, as pictures of the 3D model on the colour of this page */
.section-lead { margin: -8px 0 24px; color: var(--muted); max-width: 680px; }
.example-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.example-card .more-sheet img { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); object-fit: contain; }
.example-card .example-open { margin-top: 6px; color: var(--red); font-weight: 600; font-size: 15px; }
.example-card:hover .example-open { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 800px) { .example-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .example-list { grid-template-columns: 1fr; } }
@media (max-width: 1099px) {
  .project-intro h1 { font-size: 38px; }
}
@media (max-width: 800px) {
  .project-hero { grid-template-columns: 1fr; gap: 28px; }
  .project-hero .drawing { order: -1; padding: 24px; }
  .project-hero .drawing svg { max-height: 220px; }
  .steps { grid-auto-flow: row; }
  .feature-list { grid-template-columns: 1fr; }
}

/* Categories on the overview: Lamps, Shades, Other models */
.categories { display: flex; flex-direction: column; gap: 56px; }
.category { scroll-margin-top: calc(var(--header-height) + 20px); }
.category-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
  padding-bottom: 12px; border-bottom: 2px solid rgba(var(--ink-rgb), 0.12); }
.category-head h2 { font-size: 34px; }
.category-head p { margin: 0; color: var(--muted); font-size: 16px; }
.small-screen-note { display: none; }
@media (max-width: 1099px) {
  /* Yellow bar fixed right under the header (overview and project pages) */
  .small-screen-note {
    display: block; position: sticky; top: var(--header-height); z-index: 19; margin: 0;
    padding: 10px 20px; background: var(--yellow); color: #1f1a2e; font-size: 14px; font-weight: 500; text-align: center;
  }
  .category, .project-section h2 { scroll-margin-top: calc(var(--header-height) + 90px); }
  .overview { padding-top: 32px; }
  .overview-header h1 { font-size: 38px; }
}
@media (max-width: 520px) {
  .lamp-card { grid-template-columns: 1fr; }
  .drawing svg { max-height: 180px; }
}

/* Saved designs (dialog from the button at the top right) */
.subbar-right { grid-column: 3; display: flex; justify-content: flex-end; gap: 8px; }   /* also when the tabs in the middle are hidden */
.config-dialog {
  width: min(600px, calc(100vw - 32px)); max-height: calc(100vh - 64px); padding: 0;
  border: 1px solid rgba(var(--ink-rgb), 0.14); border-radius: 28px;
  background: var(--bg); color: var(--ink); box-shadow: 0 24px 60px rgba(21, 17, 29, 0.35);
}
.config-dialog::backdrop { background: rgba(21, 17, 29, 0.5); }
.config-body { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.config-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.config-edit { display: flex; flex-direction: column; gap: 6px; }
/* Save the current design: a block like the property groups of the designers (.field-group) */
.config-save { background: var(--card); }
.config-save textarea { display: block; }
.config-edit .buttons { margin-top: 6px; }
textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); resize: vertical;
  padding: 10px 18px; border: 2px solid var(--ink); border-radius: 18px; background: var(--bg);
}
textarea:focus { outline: 3px solid var(--yellow); outline-offset: 2px; }
.config-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.config-item {
  display: flex; flex-direction: column; gap: 12px; padding: 16px 18px;
  border: 1px solid rgba(var(--ink-rgb), 0.16); border-radius: 20px;
}
.config-item.is-current { border: 2px solid var(--ink); }
.config-item .buttons { align-items: center; }
/* A button with only an icon (with title and aria-label for the word) */
/* (as high as a text button: the 16 px icon gets the rest of the line height as padding) */
.btn-icon { display: inline-flex; align-items: center; justify-content: center; padding: calc(7px + (1.6em - 16px) / 2) 11px; }
.btn-icon svg { display: block; }
.config-delete { margin-left: auto; color: var(--red); border-color: var(--red); }
.config-delete:hover:not(:disabled) { background: var(--red); border-color: var(--red); color: #ffffff; }
.config-title { display: flex; align-items: center; gap: 10px; }
.config-title h3 { font-size: 18px; overflow-wrap: anywhere; }
.config-title .pill { align-self: center; padding: 3px 10px; font-size: 11px; }
.config-text p { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.config-text .hint { display: block; margin-left: 0; }
.config-note { font-size: 14px; font-weight: 600; }

/* Building blocks: shape buttons, the plate seen from the front, checkboxes */
.editor-hint { margin: 0; font-size: 14px; color: var(--muted); text-align: center; }
.shape-palette { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.shape-button {
  aspect-ratio: 1; padding: 5px; display: grid; place-items: center; cursor: pointer;
  border: 2px solid rgba(var(--ink-rgb), 0.2); border-radius: 12px; background: var(--bg);
}
.shape-button:hover { border-color: var(--ink); }
.shape-button.is-active { border-color: var(--ink); background: var(--yellow); }
.shape-button svg { width: 100%; height: 100%; display: block; }
.shape-button rect { fill: var(--swatch); stroke: rgba(0, 0, 0, 0.3); stroke-width: 0.05; }
.shape-button circle { fill: rgba(255, 255, 255, 0.3); }
.selection-box { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 20px; background: var(--bg); }
.check { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 14px; font-weight: 500; cursor: pointer; }
/* On/off switch: a checkbox drawn as a pill with a sliding knob (outlined when off, yellow when on) */
.check input {
  appearance: none; -webkit-appearance: none; position: relative; flex: 0 0 auto;
  width: 44px; height: 26px; margin: 0; border: 2px solid var(--ink); border-radius: 999px;
  background: transparent; cursor: pointer; transition: background 0.18s, border-color 0.18s;
}
.check input::before {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--ink); transition: transform 0.18s ease, background 0.18s;
}
.check input:checked { background: var(--yellow); }
.check input:checked::before { transform: translateX(18px); background: #1f1a2e; }
.check:hover input:not(:checked) { background: rgba(var(--ink-rgb), 0.12); }
.check input:focus { outline: none; }
.check input:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
#editor .bb-spot { fill: rgba(var(--ink-rgb), 0.2); }
#editor .bb-plate rect, #editor .bb-plate circle {
  fill: var(--fill); stroke: rgba(var(--ink-rgb), 0.35); stroke-width: 1px; vector-effect: non-scaling-stroke;
}
#editor .bb-plate .bb-magnet { fill: rgba(var(--ink-rgb), 0.22); stroke: none; }
#editor .bb-block { cursor: grab; }
#editor .bb-cells rect { fill: var(--fill); }
#editor .bb-studs circle {
  fill: var(--fill); filter: brightness(1.1);
  stroke: rgba(0, 0, 0, 0.28); stroke-width: 1px; vector-effect: non-scaling-stroke;
}
#editor .bb-edge { fill: none; stroke: rgba(0, 0, 0, 0.5); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
#editor .bb-block.selected .bb-edge { stroke: var(--ink); stroke-width: 3px; stroke-dasharray: 7 4; }
#editor .bb-block.dragging { cursor: grabbing; opacity: 0.85; }
#editor .bb-block.ghost { opacity: 0.6; pointer-events: none; }
#editor .bb-block.ghost.invalid { opacity: 0.35; }
#editor .bb-block.invalid .bb-edge { stroke: var(--red); stroke-width: 3px; stroke-dasharray: 4 3; }
#editor.placing, #editor.placing .bb-block { cursor: copy; }
#editor .bb-plate-edge {
  fill: none; pointer-events: none; stroke: var(--ink); stroke-opacity: 0.55; stroke-width: 1.5px;
  stroke-dasharray: 5 4; vector-effect: non-scaling-stroke;
}
.turn-button { min-width: 44px; padding-left: 0; padding-right: 0; font-size: 18px; line-height: 1; }

/* Access (js/core/access.js): log in / log out in the header, locked downloads, the request dialog */
.account { display: flex; align-items: center; gap: 4px; }
/* Locally only: switch to see the site as a visitor without access (js/core/access.js) */
.account .locked-view { padding: 4px 12px 4px 5px; border: 2px dashed rgba(var(--ink-rgb), 0.3); border-radius: 999px; }
.account .locked-view input { width: 38px; height: 22px; }
.account .locked-view input::before { top: 2px; left: 2px; width: 14px; height: 14px; }
.account .locked-view input:checked::before { transform: translateX(16px); }
.account button.nav-link { font: inherit; font-size: 15px; font-weight: 500; background: none; border: 0; cursor: pointer; }
.account-name {
  font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: var(--purple); color: var(--ink); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
[data-download="locked"] :is(#download, #parts-list [data-dl], #parts-list [data-zip], #parts-list [data-all]) { white-space: nowrap; }
[data-download="locked"] :is(#download, #parts-list [data-dl], #parts-list [data-zip], #parts-list [data-all])::before {
  content: ''; display: inline-block; width: 0.9em; height: 0.9em; margin-right: 0.35em; vertical-align: -0.08em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 7V5a4 4 0 0 1 8 0v2h1v8H3V7zm2 0h4V5a2 2 0 0 0-4 0z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 7V5a4 4 0 0 1 8 0v2h1v8H3V7zm2 0h4V5a2 2 0 0 0-4 0z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.download-info { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.download-info a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.download-info a:hover { color: var(--ink); }
.download-info.is-locked::before {
  content: ''; display: inline-block; width: 0.9em; height: 0.9em; margin-right: 0.4em; vertical-align: -0.08em;
  background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 7V5a4 4 0 0 1 8 0v2h1v8H3V7zm2 0h4V5a2 2 0 0 0-4 0z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 7V5a4 4 0 0 1 8 0v2h1v8H3V7zm2 0h4V5a2 2 0 0 0-4 0z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.access-intro { margin: 0; line-height: 1.45; }
.access-box { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px; border-radius: 20px; background: var(--card); }
.access-box p { margin: 0; font-size: 14px; line-height: 1.45; }
.access-box .hint { margin: 0; }
.access-box input:not([type="checkbox"]) { width: 100%; }
.access-error { font-size: 14px; }

/* Manage access (access.html): only for the owner */
.access-page { max-width: 900px; margin: 0 auto; padding: 40px 28px 80px; display: flex; flex-direction: column; gap: 22px; }
.access-page .lead { margin: 6px 0 0; color: var(--muted); line-height: 1.45; }
.access-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; align-items: start; }
.access-form .wide { grid-column: 1 / -1; }
.access-form .access-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.access-form input[type="text"], .access-form input[type="email"] { width: 100%; }
.password-row { display: flex; gap: 8px; align-items: center; }
.password-row input { flex: 1; font-family: ui-monospace, Menlo, monospace; }
.project-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 4px 0; }
.project-checks .check.is-public { opacity: .55; cursor: default; }
.project-group { margin: 10px 0 2px; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.access-result { border: 2px solid var(--ink); background: var(--yellow-panel, var(--yellow)); color: var(--ink); }
.access-result code { font-size: 18px; font-weight: 600; user-select: all; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--purple); }
@media (max-width: 700px) { .access-form { grid-template-columns: 1fr; } }

/* "At a glance" (facts) and "Questions" on the project pages and the overview */
.spec-list { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }
.spec-list div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 16px; padding: 12px 0;
  border-bottom: 1px solid rgba(var(--ink-rgb), 0.1); }
.spec-list dt { font-weight: 600; }
.spec-list dd { margin: 0; color: var(--muted); line-height: 1.45; }
.overview-faq { margin-top: 56px; }
@media (max-width: 800px) {
  .spec-list { grid-template-columns: 1fr; }
  .spec-list div { grid-template-columns: 110px minmax(0, 1fr); }
}

/* Questions as on the FAQ page of the website: question left, answer right (under each other on small screens) */
.faq-list { border-top: 1px solid rgba(var(--ink-rgb), 0.14); }
.faq-item { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 12px 48px; align-items: baseline;
  padding: 24px 0; border-bottom: 1px dashed rgba(var(--ink-rgb), 0.14); }
.faq-question { font-size: 22px; line-height: 1.25; margin: 0; text-wrap: pretty; }
.faq-answer { margin: 0; font-size: 17px; line-height: 1.55; color: var(--muted); max-width: 62ch; text-wrap: pretty; }
.project-section .faq-list { margin-top: -20px; border-top: 0; }
@media (max-width: 788px) {
  .faq-item { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 20px 0; }
  .faq-question { font-size: 20px; }
}

/* Top of a project page: a band in a pastel colour, as the series pages of the website. Always light,
   also in dark mode (like the website), so the colours of the light theme apply inside it. */
.project-band, .more-drawing, .lamp-card {
  --bg: #ffffff; --ink: #1f1a2e; --ink-rgb: 31,26,46; --muted: #4a4358; --faint: #706580;
  --red: #d0391f; --red-dark: #a82a13; --card: #f1e4cf; --panel-2d: #fff6e4; --model: #d0391f;
  color: var(--ink);
}
.project-band { background: var(--band); }
.band-yellow { --band: #ffd23f; }
.band-pink { --band: #f7b7cc; }
.band-green { --band: #bfe6d0; }
.band-purple { --band: #cdbaf5; }
/* Shadows on a band: a dark shade of the band's own colour instead of black */
:is(.band-yellow, .band-pink, .band-green, .band-purple) { --band-shadow: color-mix(in srgb, var(--band) 45%, #000000); }
.project-top { padding-top: 32px; padding-bottom: 64px; }
.project-band .pill { background: #ffffff; }
.lamp-card .drawing { background: #ffffff; }
/* The "In progress" label is yellow; white on the pastel card and top, which can be yellow too */
:is(.lamp-card, .project-band) .status-label { background: #ffffff; }
.project-band .drawing { background: #ffffff; box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--band-shadow) 65%, transparent); }
.project-band .breadcrumbs { color: var(--muted); }

/* Coloured panels further down (as the panels of the website); darker in dark mode */
.panel-green { background: var(--green); }
.panel-purple { background: var(--purple); }
.steps-panel { padding: 40px 44px 44px; border-radius: 28px; }
.steps-panel h2 { border-bottom-color: rgba(var(--ink-rgb), 0.18); }
.steps-panel .steps li { background: var(--bg); }
@media (max-width: 800px) {
  .steps-panel { padding: 28px 22px; }
  .project-top { padding-bottom: 44px; }
}
.project-band + .project-page { padding-top: 64px; }

/* Render mode (lamp.html?…&render=1, used by tools/render-examples.js): only the 3D model of the design,
   on a transparent page, for the pictures of the example designs */
html.render-mode, html.render-mode body { background: transparent !important; }
html.render-mode body > :not(#designer), html.render-mode #designer > .window-bar, html.render-mode .drawer,
html.render-mode #designer-workspace > :not(#designer-viewer), html.render-mode #designer-viewer > :not(canvas) { display: none !important; }
html.render-mode .tool-window { border: 0; background: transparent; }
html.render-mode #designer-viewer { position: fixed; inset: 0; background: transparent; }
