/* Beautiful Upgrades — Dimension Planner (Design Tools)
   Built from the planner preview by build_site.py. Every rule is scoped under .dp,
   so nothing here can change the rest of the site. */

.dp { --ink-3: #313338; --accent-ink: #0f2230; --warn: #e6c27f; --radius: 16px; }
.dp p { margin: 0; }
.dp .note { margin: 0; }
.dp h4 { font-weight: 300; line-height: 1.15; text-wrap: balance; margin: 0; }
.dp button { font-family: inherit; }
/* The site's contact form and portfolio hero use .field and .stage too: reset what they add */
.dp .field { display: block; gap: 0; }
.dp .stage { overflow: visible; color: inherit; }
.dp .hint { margin-bottom: 0; }
/* The tool strip under the page title */
.tools-strip a { white-space: nowrap; }

/* ---------- Calculator ---------- */
.dp .calc { padding-block: 44px 64px; display: grid; gap: 24px; }
.dp .calc-top { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px; }
.dp .calc-top h2 { font-size: clamp(30px, 4vw, 40px); }
.dp .calc-top .sub { color: var(--muted); font-size: 15px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.dp .ctl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dp .ctl-label { font-size: 13.5px; color: var(--muted); }
.dp .pills { display: inline-flex; flex-wrap: wrap; background: #2c2d31; border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 2px; }
.dp .pills button {
  border: 0; background: transparent; color: var(--body); border-radius: 999px; cursor: pointer;
  font-size: 15px; font-weight: 700; padding: 8px 15px; min-width: 44px; min-height: 38px;
  transition: background-color .2s var(--ease), color .2s var(--ease);
  font-variant-numeric: tabular-nums;
}
.dp .pills button:hover { color: var(--text); }
.dp .pills button[aria-pressed="true"] { background: var(--text); color: var(--ink); }
.dp .pills button:disabled { opacity: .35; cursor: not-allowed; }
.dp .toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 32px;
  padding-block: 14px; border-block: 1px solid var(--line);
}
.dp .switch { display: inline-flex; align-items: center; gap: 12px; background: none; border: 0; color: var(--body); font-size: 15px; cursor: pointer; padding: 6px 0; }
.dp .switch .track { width: 42px; height: 24px; border-radius: 999px; background: #3a3c41; position: relative; transition: background-color .2s var(--ease); flex: none; }
.dp .switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text); transition: transform .2s var(--ease); }
.dp .switch[aria-checked="true"] .track { background: var(--blue); }
.dp .switch[aria-checked="true"] .track::after { transform: translateX(18px); }
.dp .switch small { color: var(--muted); font-size: 13px; }

.dp .calc-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 920px) { .dp .calc-grid { grid-template-columns: minmax(0, 1fr); } }
.dp .panel { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 2.4vw, 26px); }
.dp .panel-title { font-size: 12px; font-weight: 700; letter-spacing: .28em; text-transform: uppercase; color: var(--accent); margin-bottom: 16px; }
/* Board panel: the title with the board size choice beside it */
.dp .panel-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 20px; margin-bottom: 16px; }
.dp .panel-head .panel-title { margin-bottom: 0; }
.dp .stage {
  border-radius: 12px; padding: clamp(10px, 2vw, 22px);
  background: radial-gradient(120% 95% at 50% 25%, #3a3c42 0%, #2a2b30 55%, #1f2023 100%);
  border: 1px solid #34363b;
}
.dp .stage svg { display: block; width: 100%; height: auto; max-height: 620px; }
.dp .side { display: grid; gap: 24px; }

/* Fields */
.dp .fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 22px; margin-top: 22px; }
@media (max-width: 640px) { .dp .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dp .field label, .dp .field .label {
  display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px;
}
.dp .control { display: flex; align-items: baseline; gap: 6px; border-bottom: 1px solid var(--field-line); transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.dp .control:focus-within { border-bottom-color: var(--accent); box-shadow: 0 1px 0 var(--accent); }
.dp .control input {
  flex: 1; min-width: 0; width: 100%; background: transparent; border: 0; outline: none; color: var(--text);
  font: 300 24px/1.3 var(--font); padding: 2px 0 6px; font-variant-numeric: tabular-nums;
}
.dp .control .unit { color: var(--muted); font-size: 14px; flex: none; }
.dp .fields-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .dp .fields-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 14px; } .dp .fields-3 .control input { font-size: 21px; } }
.dp .board-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 32px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.dp .board-opts .opt { width: min(200px, 100%); }
.dp .board-opts { align-items: flex-start; }
.dp .board-type .label { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.dp .board-opts .field.opt label { margin-bottom: 6px; }
.dp .opt .control { border: 1px solid var(--field-line); border-radius: 10px; padding: 2px 12px; background: #26272b; box-shadow: none; }
.dp .opt .control:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.dp .field.opt[data-invalid] .control { border-color: var(--error); box-shadow: 0 0 0 1px var(--error); }
.dp .opt .control input { font-size: 20px; padding: 6px 0; }
.dp .opts-note { flex-basis: 100%; margin-top: -4px; }
.dp .field .alt { font-size: 12.5px; color: var(--muted); margin-top: 5px; min-height: 1.4em; font-variant-numeric: tabular-nums; }
.dp .field[data-invalid] .control { border-bottom-color: var(--error); box-shadow: 0 1px 0 var(--error); }
.dp .field[data-invalid] .alt { color: var(--error); }
.dp .field.derived .control input { color: var(--body); }

.dp .hint { margin-top: 18px; font-size: 14.5px; color: var(--body); display: block; padding: 12px 14px; border-radius: 10px; background: #26272b; border: 1px solid var(--line); }
.dp .hint.warn { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.dp .hint.warn::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); margin-right: 10px; vertical-align: .1em; }
.dp .hint .link-btn { margin-left: 10px; }
.dp .link-btn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }

/* Proportions */
.dp .sets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dp .set-opt {
  text-align: left; background: #26272b; border: 1px solid var(--line); border-radius: 12px; color: var(--text);
  padding: 11px 14px; cursor: pointer; transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.dp .set-opt:hover { border-color: var(--field-line); }
.dp .set-opt strong { display: block; font-size: 15.5px; font-weight: 700; }
.dp .set-opt span { display: block; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dp .set-opt[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, #26272b); }
.dp .preset-note { margin-top: 14px; }
.dp .set-opt .set-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--text); }
.dp .set-opt .glyph { color: var(--muted); flex: none; }
.dp .set-opt[aria-pressed="true"] .glyph { color: var(--accent); }

/* Board stage with the piece size slider beside it */
.dp .stage-wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: stretch; }
.dp .size-ctl { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 84px; padding-block: 4px; }
.dp .size-label { font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); text-align: center; line-height: 1.3; }
.dp .vslider { position: relative; flex: 1; min-height: 180px; width: 44px; cursor: pointer; touch-action: none; border-radius: 22px; outline: none; }
.dp .vslider:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.dp .vtrack { position: absolute; left: 50%; top: 12px; bottom: 12px; width: 4px; margin-left: -2px; border-radius: 4px; background: #3a3c41; }
.dp .vmid { position: absolute; left: -7px; right: -7px; top: 50%; height: 2px; margin-top: -1px; background: var(--muted); border-radius: 2px; opacity: .8; }
.dp .vfill { position: absolute; left: 0; right: 0; top: 50%; bottom: 50%; border-radius: 4px; background: var(--accent); }
.dp .vthumb { position: absolute; left: 50%; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; background: var(--text); border: 3px solid var(--accent);
  top: calc(12px + (100% - 24px) * (1 - var(--p, .5)) - 11px); box-shadow: 0 2px 6px rgba(0,0,0,.4); pointer-events: none; }
.dp .vslider.dragging .vthumb { transform: scale(1.1); }
/* Space under the slider is always there, so the panel never changes size when the button shows */
.dp .size-reset-slot { height: 84px; width: 100%; display: flex; align-items: flex-start; justify-content: center; }
.dp .size-reset {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #26272b; color: var(--text); cursor: pointer;
  font: 700 11.5px/1.25 var(--font); padding: 8px 6px; text-align: center; text-wrap: balance;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.dp .size-reset::before { content: "↺"; display: block; font-size: 15px; line-height: 1.1; margin-bottom: 3px; color: var(--accent); }
.dp .size-reset:hover { border-color: var(--accent); background: #2c2e33; }
.dp .size-reset.is-hidden { visibility: hidden; }
/* Fingertip controls */
.dp .finger-row { margin-top: 14px; display: flex; align-items: center; min-height: 36px; }
.dp .switch small.is-hidden { visibility: hidden; }
.dp .btn.small { min-height: 38px; padding: 8px 16px; font-size: 13.5px; margin-top: 14px; }
.dp .btn.small[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.dp #board-stage .pc { cursor: pointer; outline: none; }
.dp #board-stage .pc:hover, .dp #board-stage .pc:focus-visible { stroke: #7fb3cf; }
/* Room for the border's reset link is always kept, so nothing shifts when it appears */
.dp .field-reset { min-height: 1.5em; margin-top: 2px; font-size: 13px; }
.dp .field-reset .link-btn::before { content: "↺ "; text-decoration: none; }
.dp .link-btn.is-hidden { visibility: hidden; }
/* Narrow screens: the slider sits under the board and runs left to right (right = larger) */
@media (max-width: 600px) {
  .dp .stage-wrap { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .dp .size-ctl { width: auto; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "label reset" "slider slider"; align-items: center; gap: 6px 12px; padding: 0; }
  .dp .size-label { grid-area: label; text-align: left; }
  .dp .vslider { grid-area: slider; width: auto; height: 44px; min-height: 0; flex: none; }
  .dp .vtrack { left: 12px; right: 12px; top: 50%; bottom: auto; width: auto; height: 4px; margin: -2px 0 0; }
  .dp .vmid { left: 50%; right: auto; top: -7px; bottom: -7px; width: 2px; height: auto; margin: 0 0 0 -1px; }
  .dp .vfill { top: 0; bottom: 0; }
  .dp .vthumb { top: 50%; margin: -11px 0 0; left: calc(12px + (100% - 24px) * var(--p, .5) - 11px); }
  .dp .size-reset-slot { grid-area: reset; height: 34px; width: auto; justify-content: flex-end; align-items: center; }
  .dp .size-reset { width: auto; white-space: nowrap; border-radius: 999px; padding: 7px 13px; font-size: 12.5px; }
  .dp .size-reset::before { display: inline; margin: 0 6px 0 0; font-size: 13px; }
}
.dp .suggest { font-size: 12.5px; color: var(--accent); margin-top: 3px; font-variant-numeric: tabular-nums; }
.dp .suggest .link-btn { margin-left: 6px; font-size: 12.5px; }
.dp input[type="range"] {
  --pct: 60%;
  -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 6px 0 4px; cursor: pointer;
}
.dp input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--accent) var(--pct), #3a3c41 var(--pct)); }
.dp input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--accent) var(--pct), #3a3c41 var(--pct)); }
.dp input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: var(--text); border: 3px solid var(--accent); }
.dp input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--text); border: 3px solid var(--accent); }
.dp .note { font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.dp .stat { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 14px; margin-top: 16px; border-top: 1px solid var(--line); font-size: 15px; color: var(--body); }
.dp .stat-note { margin-top: 6px; }
.dp .stat b { font-weight: 400; color: var(--text); font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Counts */
.dp .count-row { display: grid; gap: 2px; }
.dp .count-row + .count-row { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.dp .count-big { font-size: 26px; font-weight: 300; font-variant-numeric: tabular-nums; }
.dp .count-big em { font-style: normal; color: var(--muted); font-size: 18px; }
.dp .count-cap { font-size: 13.5px; color: var(--muted); }

/* Pieces */
.dp .pieces-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px 20px; margin-top: 12px; }
.dp .pieces-head h3 { font-size: clamp(24px, 3vw, 30px); }
.dp .shape-pickers { display: flex; flex-wrap: wrap; gap: 14px 40px; }
.dp .player-label { display: inline-flex; align-items: center; gap: 8px; }
.dp .swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.dp .swatch.light { background: #ebe6dc; }
.dp .swatch.dark { background: #16171a; box-shadow: inset 0 0 0 1px #80848b; }
.dp .shape-pills button { display: inline-flex; align-items: center; gap: 8px; }
.dp .shape-pills .glyph { color: currentColor; opacity: .75; }
.dp .pieces { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 18px; }
.dp .piece .diagram svg { max-width: 360px; margin-inline: auto; }
@media (max-width: 1080px) { .dp .pieces { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .dp .pieces { grid-template-columns: minmax(0, 1fr); } }
.dp .piece { display: grid; grid-template-rows: auto auto 1fr; gap: 12px; }
.dp .piece h4 { font-size: 21px; font-weight: 400; }
.dp .piece .desc { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.dp .piece .diagram { border-radius: 10px; background: #25262a; border: 1px solid #34363b; padding: 6px; }
.dp .piece .diagram svg { display: block; width: 100%; height: auto; }
.dp .piece .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0; gap: 14px 16px; align-self: start; }
.dp .piece .field.wide { grid-column: 1 / -1; }
.dp .piece .control input { font-size: 21px; }

/* Actions */
.dp .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.dp .btn {
  border: 1px solid var(--line); background: #2f3034; color: var(--text); border-radius: 10px;
  font-size: 15px; font-weight: 700; padding: 12px 22px; cursor: pointer; min-height: 46px;
  transition: background-color .2s var(--ease), border-color .2s var(--ease);
}
.dp .btn:hover { border-color: var(--field-line); background: #35363b; }
.dp .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.dp .btn.primary:hover { background: #95c2da; }
.dp .actions .note { flex-basis: 100%; }
.dp .status { color: var(--accent); font-size: 14px; font-weight: 700; }
.dp .copy-fallback { flex-basis: 100%; width: 100%; background: #26272b; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: 14px var(--font); }

/* Method */
.dp .method { border-top: 1px solid var(--line); padding-top: 8px; }
.dp .method summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding-block: 16px; font-size: 21px; font-weight: 300;
}
.dp .method summary::-webkit-details-marker { display: none; }
.dp .method summary::after { content: "+"; font-size: 26px; font-weight: 300; color: var(--accent); line-height: 1; }
.dp .method[open] summary::after { content: "−"; }
.dp .method-body { display: grid; gap: 18px; padding-bottom: 12px; color: var(--body); max-width: 860px; }
.dp .method-body ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.dp .method-body h4 { font-size: 12px; font-weight: 700; letter-spacing: .28em; text-transform: uppercase; color: var(--accent); }
.dp .table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.dp table { border-collapse: collapse; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
.dp th, .dp td { text-align: right; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.dp th:first-child, .dp td:first-child { text-align: left; }
.dp thead th { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); background: #26272b; }
.dp tbody tr:last-child td { border-bottom: 0; }
.dp tr.avg td { color: var(--text); background: color-mix(in srgb, var(--accent) 8%, transparent); }

/* Save-image modal */
.dp .modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(12, 12, 14, .74); backdrop-filter: blur(6px); }
.dp .modal-card { width: min(560px, 100%); max-height: calc(100% - 20px); overflow: auto; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 14px; }
.dp .modal-card img { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); background: var(--ink); }
.dp .modal-card .actions { justify-content: flex-end; }
.dp .modal-card h3 { font-size: 22px; }

/* On the site, the request section below adds its own space */
.dp .calc { padding-bottom: 12px; }
