/* ==========================================================================
   Ronjack: the decking, fencing and cladding planners
   --------------------------------------------------------------------------
   As in site.css, each brand colour is set once in the rules below as a plain
   value. The colours drawn on the plans themselves (corner handles, edge
   lines) are in wwwroot/js/planner: search there for #927044 and #2f383e.
   ========================================================================== */

/* TINT: the page behind the planner, and quiet backgrounds */
.planner, .seg, .wall-tabs, .side, .range-card:hover, .tool:hover:not(:disabled), .reset__menu button:hover, .edge-pop__choices button:hover, .stepper button:hover:not(:disabled) { background-color: #eef0f2; }

/* CARD: white surfaces */
.stage, .options, .pcardbox, .tool, .preset, .edge-pop, .reset__menu, .range-card, .post-card, .wall-tab, .stepper, .mtable, .tool-card, .view3d__caption { background-color: #ffffff; }

/* SLATE: used as a background */
.seg button.is-on, .wall-tab.is-on, .stage__hint, .mtable thead th, .builder .opt-block h2 i { background-color: #2f383e; }

/* SLATE: used as a text colour */
.planner h1, .planner h2, .tool, .stage__stats b, .planner__total, .how summary, .linkish, .reset__menu b, .range-card b, .post-card b, .wall-tab b, .side__top, .stepper button, .mat-item a, .mat-item b, .view3d__caption, .edge-pop__title, .tool-card b { color: #2f383e; }

/* ACCENT: the bronze, for what is chosen or in focus */
.range-card.is-on, .post-card.is-on, .preset:hover, .tool-card:hover { border-color: #927044; }
.range-card.is-on, .post-card.is-on { box-shadow: inset 0 0 0 1px #927044; }
.pswatch.is-on { box-shadow: 0 0 0 2.5px #ffffff, 0 0 0 5px #927044; }
.check input { accent-color: #927044; }
.tool-card i { color: #927044; }

/* SELECTED: the pale wash behind a chosen card */
.range-card.is-on, .post-card.is-on, .edge-pop__choices button.is-on { background-color: #f5f1ec; }

/* MUTED: secondary text */
.planner__intro, .planner__label, .planner__note, .stage__stats, .opt-block__note, .range-card small, .post-card small, .side small, .mat-why, .mat-item small, .materials__sum, .planner__total-label, .reset__menu span, .reset__menu small, .edge-pop__label, .wall-tab span, .how li, .tool-card span span { color: #5b666d; }

/* LINES: borders */
.stage, .options, .pcardbox, .tool, .preset, .edge-pop, .reset__menu, .range-card, .post-card, .wall-tab, .stepper, .side, .stage__bar, .wall-tabs, .opt-block, .mtable th, .mtable td, .table-scroll, .mat-item img, .range-card img, .edge-pop input, .side__len input, .opt-sub input[type=number], .tool-card { border-color: #dde1e4; }

/* TEXT ON DARK */
.seg button.is-on, .wall-tab.is-on, .wall-tab.is-on b, .wall-tab.is-on span, .stage__hint, .stage__warn, .mtable thead th, .builder .opt-block h2 i { color: #ffffff; }

/* WARNING */
.stage__warn { background-color: #a01f1f; }
.linkish--danger { color: #a01f1f; }
.is-quoted { color: #8a949b; font-style: italic; }

/* ==========================================================================
   Layout
   ========================================================================== */

.planner { padding-block: clamp(18px, 2.5vw, 30px) clamp(52px, 6vw, 88px); }
.planner__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 32px; margin-bottom: 18px; }
.planner .crumbs { margin-bottom: 12px; }
.planner h1 { font-size: clamp(2.1rem, 4.2vw, 3.3rem); margin-bottom: 0.18em; }
.planner__intro { max-width: 60ch; margin: 0; }
.planner__presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.planner__label { margin-right: 4px; font: 600 0.9rem "Archivo", sans-serif; }
.preset { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-width: 1.5px; border-style: solid; border-radius: 6px; cursor: pointer; transition: border-color 0.15s ease, transform 0.15s ease; }
.preset:hover { transform: translateY(-1px); }
.preset svg { width: 24px; height: 24px; fill: #2f383e; }

.planner__grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: stretch; }
.planner__grid--builder { grid-template-columns: minmax(0, 1fr) 384px; align-items: start; }

/* The drawing stage */
.stage { display: flex; flex-direction: column; min-width: 0; border-width: 1px; border-style: solid; border-radius: 6px; overflow: hidden; box-shadow: 0 24px 44px -36px rgba(24, 30, 34, 0.5); }
.stage--sticky { position: sticky; top: 100px; overflow: visible; }
.stage__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 14px; border-bottom-width: 1px; border-bottom-style: solid; }
.stage__tools { display: flex; flex-wrap: wrap; gap: 5px; }
.stage__stats { margin: 0 0 0 auto; font-size: 0.94rem; }
.stage__stats b { font: 700 1.35rem "Archivo", sans-serif; letter-spacing: -0.02em; }
.stage__canvas { position: relative; flex: 1; min-height: clamp(380px, 58vh, 660px); background: #f6f7f8; overflow: hidden; }
.stage--sticky .stage__canvas { flex: none; min-height: 0; height: clamp(420px, calc(100vh - 220px), 720px); border-radius: 0 0 6px 6px; }
.plan, .view3d { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; font-family: "Archivo", sans-serif; user-select: none; }
.view3d { cursor: grab; }
.view3d:active { cursor: grabbing; }
.corner { cursor: move; outline: 0; }
.edge-hit { cursor: pointer; outline: 0; }
.edge-hit:hover, .edge-hit:focus-visible { stroke: rgba(47, 56, 62, 0.2); }
.corner:focus-visible circle:last-child { stroke: #2f383e; }
.add-corner { cursor: copy; opacity: 0.85; outline: 0; }
.add-corner:hover, .add-corner:focus-visible { opacity: 1; }
.add-corner--end { opacity: 0.7; }
.opening { cursor: move; outline: 0; }
.opening:focus-visible > rect:first-child { stroke: #927044; }
.grip { cursor: nesw-resize; }
.stage__hint { position: absolute; left: 50%; top: 14px; margin: 0; padding: 6px 16px; transform: translateX(-50%); border-radius: 999px; font: 500 0.88rem "Archivo", sans-serif; white-space: nowrap; pointer-events: none; }
.stage__warn { position: absolute; left: 14px; right: 14px; top: 14px; margin: 0; padding: 9px 15px; border-radius: 6px; font-weight: 600; }
.view3d__tools { position: absolute; top: 12px; right: 12px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.view3d__tools[hidden], .view3d__caption[hidden] { display: none; }
.view3d__tools:not([hidden]) ~ .stage__warn { top: 60px; }
.view3d__tools .tool { box-shadow: 0 2px 8px rgba(24, 30, 34, 0.18); }
.view3d__caption { position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 24px); margin: 0; padding: 6px 12px; border-radius: 6px; font: 500 0.86rem "Archivo", sans-serif; pointer-events: none; opacity: 0.95; }

/* Small buttons */
.tool { padding: 0.42em 0.85em; border-width: 1px; border-style: solid; border-radius: 6px; font: 600 0.86rem "Archivo", sans-serif; cursor: pointer; }
.tool:disabled { color: #a9b1b7; cursor: default; }
.tool--icon { width: 36px; padding-inline: 0; font-size: 1.1rem; line-height: 1.2; }
.tool--add { border-color: #2f383e; }
.tool[hidden] { display: none; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 4px; border-radius: 6px; }
.seg button { padding: 0.46em 0.95em; border: 0; border-radius: 6px; background: none; font: 600 0.88rem "Archivo", sans-serif; color: inherit; cursor: pointer; }
.seg--wide { display: flex; }
.seg--wide button { flex: 1 1 auto; }
.linkish { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.check { display: flex; gap: 9px; align-items: flex-start; margin-block: 6px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 4px; flex: none; }
.check[hidden] { display: none; }

/* Reset menu */
.reset { position: relative; }
.reset__menu { position: absolute; z-index: 6; top: calc(100% + 6px); left: 0; display: grid; gap: 2px; width: 276px; padding: 6px; border-width: 1px; border-style: solid; border-radius: 6px; box-shadow: 0 22px 44px -18px rgba(24, 30, 34, 0.45); }
.reset__menu[hidden] { display: none; }
.reset__menu button { display: grid; gap: 1px; padding: 9px 11px; border: 0; border-radius: 6px; background: none; font: inherit; text-align: left; cursor: pointer; }
.reset__menu b { font: 600 0.94rem "Archivo", sans-serif; }
.reset__menu span { font-size: 0.84rem; }
.reset__menu small { padding: 6px 11px 4px; font-size: 0.8rem; }

/* Pop-up on an edge, window or door */
.edge-pop { position: absolute; z-index: 3; width: 256px; padding: 15px; border-width: 1px; border-style: solid; border-radius: 6px; box-shadow: 0 22px 44px -18px rgba(24, 30, 34, 0.45); }
.edge-pop > label { display: flex; align-items: center; justify-content: space-between; gap: 8px; font: 600 0.9rem "Archivo", sans-serif; }
.edge-pop > label + label { margin-top: 8px; }
.edge-pop input { width: 88px; height: 38px; padding-inline: 9px; border-width: 1.5px; border-style: solid; border-radius: 6px; font: inherit; }
.edge-pop__title { margin: 0 0 8px; font: 700 1rem "Archivo", sans-serif; }
.edge-pop__label { margin: 10px 0 4px; font-size: 0.86rem; }
.edge-pop__choices { display: grid; gap: 3px; margin-bottom: 8px; }
.edge-pop__choices button { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border: 0; border-radius: 6px; background: none; font: 500 0.92rem "Public Sans", sans-serif; color: inherit; text-align: left; cursor: pointer; }
.edge-pop__choices i { flex: none; width: 16px; height: 4px; border-radius: 2px; }
.edge-pop__row { display: flex; justify-content: space-between; margin-top: 12px; }

/* Walls (cladding) */
.wall-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 9px 14px; border-bottom-width: 1px; border-bottom-style: solid; }
.wall-tabs__list { display: flex; flex-wrap: wrap; gap: 6px; margin-right: auto; }
.wall-tab { padding: 0.38em 0.8em; border-width: 1.5px; border-style: solid; border-radius: 6px; font: 500 0.88rem "Public Sans", sans-serif; color: inherit; cursor: pointer; }
.wall-tab b { font-family: "Archivo", sans-serif; font-weight: 600; }
.wall-tab.is-on { border-color: #2f383e; }

/* Options column */
.options { display: grid; align-content: start; border-width: 1px; border-style: solid; border-radius: 6px; overflow: hidden; box-shadow: 0 24px 44px -36px rgba(24, 30, 34, 0.5); }
.opt-block { padding: 16px 18px; border-bottom-width: 1px; border-bottom-style: solid; }
.opt-block:last-child { border-bottom: 0; }
.opt-block h2 { margin-bottom: 0.55em; font-size: 1.1rem; letter-spacing: -0.01em; }
.opt-block__note { margin: 0.55em 0 0; font-size: 0.86rem; line-height: 1.45; }
.opt-block__note:empty { display: none; }
.opt-inline { display: grid; gap: 5px; margin-top: 8px; font: 600 0.88rem "Archivo", sans-serif; }
.opt-sub { margin-top: 14px; }
.opt-sub[hidden] { display: none; }
.opt-sub__label { margin: 0 0 7px; font: 600 0.9rem "Archivo", sans-serif; }
.opt-sub input[type=number] { min-height: 40px; padding-inline: 9px; border-width: 1.5px; border-style: solid; border-radius: 6px; font: inherit; }
.opt__swatches { display: flex; flex-wrap: wrap; gap: 9px; padding: 3px; }
.pswatch { width: 40px; height: 40px; padding: 0; border: 1px solid rgba(0, 0, 0, 0.22); border-radius: 50%; cursor: pointer; outline-offset: 3px; transition: transform 0.15s ease; }
.pswatch:hover { transform: scale(1.08); }
.builder .opt-block h2 { display: flex; align-items: center; gap: 9px; margin-bottom: 0.7em; }
.builder .opt-block h2 i { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background-color: #927044 !important; font: 700 0.84rem "Archivo", sans-serif; font-style: normal; }
.builder .planner__presets { margin-bottom: 4px; }

/* Range and post cards */
.range-cards { display: grid; gap: 6px; max-height: 318px; overflow-y: auto; padding: 1px 2px 1px 1px; scrollbar-width: thin; }
.range-card, .post-card { display: flex; align-items: center; gap: 11px; width: 100%; padding: 7px 10px 7px 7px; border-width: 1.5px; border-style: solid; border-radius: var(--image-corner-radius); font: inherit; color: inherit; text-align: left; cursor: pointer; transition: border-color 0.15s ease, background-color 0.15s ease; }
.range-card img { flex: none; width: 52px; height: 52px; object-fit: cover; border-radius: var(--image-corner-radius); border-width: 1px; border-style: solid; }
.range-card b, .post-card b { display: block; font: 600 0.92rem/1.2 "Archivo", sans-serif; }
.range-card small, .post-card small { display: block; margin-top: 2px; font-size: 0.8rem; line-height: 1.3; }
.post-cards { display: grid; gap: 6px; }
.post-card svg { flex: none; width: 42px; height: 42px; }
.post-card:disabled { opacity: 0.45; cursor: not-allowed; }

/* Sides (fencing) */
.sides { display: grid; gap: 6px; margin: 9px 0; }
.side { padding: 9px 11px; border-width: 1px; border-style: solid; border-radius: 6px; }
.side__top { display: flex; justify-content: space-between; align-items: center; font: 600 0.88rem "Archivo", sans-serif; }
.side__remove { width: 26px; height: 26px; border: 0; border-radius: 6px; background: none; font-size: 1.15rem; line-height: 1; color: #8a949b; cursor: pointer; }
.side__remove:hover:not(:disabled) { background: #f4e3e3; color: #a01f1f; }
.side__remove:disabled { visibility: hidden; }
.side__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 3px; }
.side__len { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.side__len input { width: 82px; height: 38px; padding-inline: 9px; border-width: 1.5px; border-style: solid; border-radius: 6px; font: inherit; background: #fff; }
.side small { display: block; margin-top: 4px; font-size: 0.8rem; }
.stepper { display: inline-flex; align-items: center; border-width: 1.5px; border-style: solid; border-radius: 6px; overflow: hidden; }
.stepper button { width: 36px; height: 36px; border: 0; background: none; font-size: 1.2rem; line-height: 1; cursor: pointer; }
.stepper button:disabled { color: #c5ccd1; cursor: default; }
.stepper output { min-width: 72px; font: 600 0.88rem "Archivo", sans-serif; text-align: center; }

/* Materials and the enquiry panel */
.planner__result { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; margin-top: 18px; align-items: start; }
.pcardbox { padding: clamp(18px, 2.4vw, 28px); border-width: 1px; border-style: solid; border-radius: 6px; min-inline-size: 0; }
.materials__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 20px; }
.materials__head h2 { margin-bottom: 0.4em; font-size: 1.7rem; }
.materials__sum { margin: 0; font: 500 0.94rem "Archivo", sans-serif; }
.table-scroll { overflow-x: auto; border-width: 1px; border-style: solid; border-radius: 6px; }
.mtable { width: 100%; min-width: 620px; border-collapse: collapse; }
.mtable th, .mtable td { padding: 11px 14px; text-align: left; vertical-align: middle; border-bottom-width: 1px; border-bottom-style: solid; }
.mtable thead th { font: 600 0.84rem "Archivo", sans-serif; letter-spacing: 0.04em; border-bottom: 0; }
.mtable tbody tr:last-child > * { border-bottom: 0; }
.num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mat-item { display: flex; align-items: center; gap: 11px; min-width: 230px; }
.mat-item img { flex: none; width: 52px; height: 52px; object-fit: cover; border-width: 1px; border-style: solid; border-radius: var(--image-corner-radius); }
.mat-item a, .mat-item b { font: 600 0.96rem/1.2 "Archivo", sans-serif; }
.mat-item small { display: block; font-size: 0.84rem; }
.mat-why { font-size: 0.9rem; }
.how { margin-top: 14px; font-size: 0.93rem; }
.how summary { font: 600 0.96rem "Archivo", sans-serif; cursor: pointer; }
.how ul { margin: 0.7em 0 0; padding-left: 1.2em; list-style: disc; }
.how li { margin-bottom: 0.45em; }
.planner__buy { position: sticky; top: 108px; }
.planner__total-label { margin: 0; font: 600 0.8rem "Archivo", sans-serif; letter-spacing: 0.1em; text-transform: uppercase; }
.planner__total { margin: 0 0 0.25em; font: 700 2.5rem/1.05 "Archivo", sans-serif; letter-spacing: -0.03em; }
.planner__note { margin: 0 0 1em; font-size: 0.88rem; line-height: 1.5; }
.planner__buy .btn-block { margin-bottom: 12px; }
.planner__share { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1em; }
.planner__share .btn { flex: 1; }
.planner__link { font-size: 0.9rem; overflow-wrap: anywhere; }

/* The hub page */
.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.tool-card { display: flex; flex-direction: column; border-width: 1px; border-style: solid; border-radius: var(--image-corner-radius); overflow: hidden; text-decoration: none; transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease; }
.tool-card:hover { transform: translateY(-5px); box-shadow: 0 28px 46px -32px rgba(24, 30, 34, 0.6); }
.tool-card img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; object-position: top left; background: #eef0f2; border-bottom: 1px solid #dde1e4; }
.tool-card > span { display: flex; flex-direction: column; gap: 8px; padding: 20px 22px 24px; flex: 1; }
.tool-card b { font: 700 1.5rem/1.1 "Archivo", sans-serif; letter-spacing: -0.02em; }
.tool-card i { margin-top: auto; padding-top: 6px; font: 600 0.96rem "Archivo", sans-serif; font-style: normal; }

@media (max-width: 1100px) {
    .planner__grid--builder { grid-template-columns: minmax(0, 1fr); }
    .stage--sticky { position: static; }
    .stage--sticky .stage__canvas { height: clamp(340px, 56vh, 620px); }
}

@media (max-width: 900px) {
    .planner__grid, .planner__result { grid-template-columns: minmax(0, 1fr); }
    .planner__buy { position: static; }
    .tool-grid { grid-template-columns: minmax(0, 1fr); }
    .range-cards { max-height: 250px; }
}

@media (max-width: 600px) {
    .stage__canvas { min-height: clamp(320px, 46vh, 420px); }
    .stage__stats { margin-left: 0; width: 100%; }
    .stage__hint { white-space: normal; width: calc(100% - 28px); text-align: center; }
}

@media print {
    .topbar, .site-header, .site-footer, .dock, .cta-band, .planner__presets, .stage__bar, .options, .wall-tabs, .add-corner, .grip, .view3d__tools, .view3d__caption, .stage__hint, .how summary, .planner__buy .btn, .planner__share, .crumbs { display: none !important; }
    .planner { padding: 0; background: #fff !important; }
    .planner__grid, .planner__result { display: block; }
    .stage, .pcardbox { border: 0; box-shadow: none; }
    .stage__canvas { min-height: 0; height: 420px; }
    .how[open] ul, .how ul { display: block; }
    .planner__buy { position: static; margin-top: 12px; }
}

/* Ronjack additions */
.opt-inline select { min-height: 42px; padding: 6px 10px; border: 1.5px solid #c5ccd1; border-radius: 6px; background: #ffffff; font: 500 0.95rem "Public Sans", sans-serif; color: #1d2327; }
.seg--stack { flex-wrap: wrap; }
.mat-code { font-size: 0.82rem; letter-spacing: 0.03em; white-space: nowrap; color: #5b666d; }
