:root {
  --ink: #142129;
  --muted: #53605d;
  --line: #d9ded6;
  --green: #a6cb21;
  --green-dark: #688411;
  --pale: #f2f6e7;
  --r3-page: #f8f9f6;
  --r3-gutter: clamp(20px, 3.45vw, 70px);
  background: var(--r3-page);
  -webkit-font-smoothing: antialiased;
}
.shell { width: min(1610px, 100%); padding-inline: var(--r3-gutter); }
.header-inner { height: 66px; gap: clamp(30px, 4vw, 78px); }
.header-inner .brand img { width: clamp(135px, 11vw, 179px); height: auto; display: block; }
.header-divider { display: none; }
.site-nav { height: 100%; gap: clamp(20px, 2.25vw, 41px); }
.site-nav a { height: 100%; display: inline-flex; align-items: center; padding: 1px 0 0; font-size: .96rem; }
.site-nav a[aria-current] { box-shadow: inset 0 -3px var(--green); color: var(--ink); font-weight: 700; }
.utility, .primary { border-radius: 7px; }
.crumbs { margin: 15px 0 13px; }
.page-heading { gap: 20px; padding: 0; margin-bottom: clamp(18px, 2vw, 32px); }
.page-heading h1 { font-size: clamp(2.7rem, 4.65vw, 5.3rem); font-weight: 650; letter-spacing: -.068em; line-height: 1.01; }
.page-heading p { margin-top: 8px; color: var(--muted); font-size: 1rem; }
.price-jump { display: inline-flex; margin: 0 0 2px; border-radius: 7px; min-height: 43px; }
.workspace {
  display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(348px, .92fr);
  align-items: start; gap: clamp(16px, 1.7vw, 31px);
}
.panel { border-radius: 13px; }
.workspace .visual-panel,
.workspace:has(input[name="shape"][value="l"]:checked) .visual-panel {
  position: sticky; align-self: start; top: 12px;
  isolation: isolate; border: none; background: var(--r3-page); border-radius: 0;
  overflow: visible;
}
.workspace .visual-panel :is(.plan-panel, .photo-panel),
.workspace:has(input[name="shape"][value="l"]:checked) .visual-panel :is(.plan-panel, .photo-panel) {
  order: 0; width: 100%; height: auto; min-height: 0; aspect-ratio: 1.53;
  border: 1px solid #15241c10; border-radius: 13px; overflow: hidden;
}
.workspace .visual-panel .plan-panel { background: #eef1e9; }
.visual-panel .plan-bottom { padding: 4px 12px 10px; }
.visual-panel .photo-panel img { object-position: 50% 50%; }
.visual-panel .image-caption {
  inset: auto auto 13px 13px; max-width: calc(100% - 26px); border-radius: 5px;
  background: #142022c9; color: white; padding: 5px 9px; font-size: .76rem; line-height: 1.24;
}
.visual-panel .view-toolbar { order: 1; border: 0; background: none; padding: 9px 0; }
.segmented { border-radius: 9px; box-shadow: none; border-color: var(--line); }
.view-tab { min-height: 35px; font-size: .87rem; border-radius: 6px; }
.view-tab[aria-pressed=true] { background: #e8eedd; color: #223221; }
.visual-panel .material-bar {
  order: 2; border: 1px solid var(--line); background: #fff; padding: 10px 14px; gap: 12px;
  border-radius: 9px; color: var(--ink);
}
.material-bar .board-swatch { width: 52px; height: 40px; object-fit: contain; background: #fff; border-radius: 4px; }
.material-text .manufacturer { display: block; line-height: 1.2; }
.material-text h2 { font-size: 1rem; line-height: 1.18; margin-top: 3px; }
.material-text h2 #board-model-name { color: var(--ink); }
.material-link { min-height: 39px; padding: 6px 0; }
.configuration { overflow: visible; min-width: 0; padding: clamp(17px, 1.85vw, 32px); }
.config-heading { border: 0; padding: 0 0 15px; }
.config-heading h2, .price-panel h2 { font-size: clamp(1.48rem, 2vw, 2rem); font-weight: 650; letter-spacing: -.055em; line-height: 1.15; }
.r3-tabs {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px;
  padding: 3px; margin: 0 0 18px; background: #edf0e8; border-radius: 8px;
}
.r3-tab {
  border: 1px solid transparent; border-radius: 6px; background: none; color: #47534b;
  font-weight: 600; line-height: 1.2; min-height: 37px; padding: 6px; font-size: .92rem;
}
.r3-tab[aria-selected=true] { background: #fff; border-color: #ccd4c4; color: #1d2d25; box-shadow: 0 1px 3px #1723180c; }
.r3-panel { min-width: 0; }
.r3-panel > :first-child { margin-top: 0; }
.control-section { margin: 16px 0 0; }
.control-section legend, .decor-picker legend, .notch-fields legend, #edge-choices legend { font-size: .99rem; font-weight: 650; letter-spacing: -.021em; }
.choice-face { min-height: 43px; border-radius: 6px; }
.model-picker { margin-bottom: 18px; }
.model-options { gap: 6px; }
.model-options .choice-face { padding: 7px 4px; }
.decor-picker { padding-bottom: 15px; margin-bottom: 15px; }
.decor-picker legend { margin: 0 0 10px; }
.decor-options { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.decor-choice span {
  min-height: 67px; padding: 5px 4px 6px; border-radius: 7px; background: #fff;
  color: #354139; font-size: .74rem; line-height: 1.15; font-weight: 590; letter-spacing: 0;
}
.decor-choice img { height: clamp(37px, 2.8vw, 46px); margin: 0 0 5px; }
.decor-choice b { font-weight: inherit; }
.decor-choice input:checked + span { color: #243416; font-weight: 710; background: #f5f8eb; }
.decor-status, .field-hint { font-size: .83rem; line-height: 1.42; color: var(--muted); }
.r3-panel .stock-section { margin-top: 0; }
.notch-controls { border-radius: 8px; }
.number-wrap, .corner-control select, #edge-stock { border-radius: 6px; }
.number-wrap { height: 43px; }
#edge-controls { border: 0; margin: 0; padding: 0; }
#edge-controls > summary { border-bottom: 1px solid var(--line); padding: 0 0 9px; min-height: 37px; }
#edge-choices { padding-top: 8px; }
.r3-panel .comparison > h3 { font-size: .94rem; }
.r3-panel .comparison { padding: 12px; background: #f5f7f1; }
.r3-dock {
  display: grid; grid-template-columns: minmax(0, 1fr) max-content; gap: 6px 12px; align-items: center;
  border-top: 1px solid var(--line); margin-top: 21px; padding-top: 15px;
}
.r3-budget { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-height: 43px; max-width: 100%; }
.r3-budget-label { font-size: .77rem; color: var(--muted); line-height: 1.22; }
.r3-budget-total { font-size: 1.15rem; font-variant-numeric: tabular-nums; letter-spacing: -.035em; line-height: 1.22; color: #263825; text-decoration: underline; text-underline-offset: .13em; text-decoration-color: #a5b392; }
.r3-dock .primary { min-height: 44px; padding: 9px 12px; font-size: .9rem; }
.r3-feedback { grid-column: 1 / -1; color: #3e562e; font-size: .83rem; line-height: 1.3; }
.r3-another { grid-column: 1 / -1; justify-self: end; background: none; border: 0; min-height: 35px; padding: 4px; font: inherit; font-size: .85rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.summary { margin-top: clamp(20px, 2.3vw, 34px); }
.summary .save-wrap { display: flex; flex-direction: column; align-items: flex-end; }
#save-another { background: none; border: 0; font: inherit; font-size: .84rem; color: #3d5128; text-decoration: underline; text-underline-offset: 3px; }
.price-panel { padding: clamp(18px, 2.2vw, 34px); }
.price-kpis { margin-top: 16px; }
.price-kpis div { border-radius: 8px; }
#family-compare { margin: 23px 0 18px; padding-block: 18px; border-block: 1px solid var(--line); }
.price-table { margin-block: 15px; }
.price-row > :last-child strong { font-variant-numeric: tabular-nums; }
.price-panel [data-smp="shop-transfer"] { margin: 15px 0; }
.price-panel .price-contact { white-space: normal; }
dialog .dialog-actions { display: grid; gap: 8px; }
@media (min-width: 1650px) {
  .workspace .visual-panel :is(.plan-panel, .photo-panel),
  .workspace:has(input[name="shape"][value="l"]:checked) .visual-panel :is(.plan-panel, .photo-panel) {
    aspect-ratio: 1.62;
  }
}
@media (min-width: 761px) and (max-width: 1050px) {
  :root { --r3-gutter: clamp(16px, 2.7vw, 30px); }
  .workspace { grid-template-columns: minmax(0, 1.4fr) minmax(310px, 1fr); gap: 14px; }
  .workspace .visual-panel :is(.plan-panel, .photo-panel),
  .workspace:has(input[name="shape"][value="l"]:checked) .visual-panel :is(.plan-panel, .photo-panel) { aspect-ratio: 1.26; }
  .r3-dock { gap: 7px; }
  .r3-dock .primary { padding-inline: 8px; font-size: .86rem; }
}
@media (max-width: 760px) {
  :root { --r3-gutter: clamp(13px, 4vw, 28px); }
  body:has(.r3-dock) { padding-bottom: var(--r3-dock-height, calc(80px + env(safe-area-inset-bottom))); }
  .header-inner { height: 53px; gap: 12px; }
  .header-inner .brand img { width: 126px; }
  .site-nav { display: none; }
  .utility { min-height: 37px; font-size: .84rem; padding: 7px 10px; }
  .crumbs { gap: 4px; margin: 11px 0 7px; font-size: .72rem; }
  .page-heading, .page-heading:has(.price-jump) { display: block; margin-bottom: 12px; }
  .page-heading h1 { font-size: clamp(2.15rem, 7.8vw, 3.05rem); line-height: 1.02; }
  .page-heading p, .page-heading:has(.price-jump) p { margin-top: 6px; font-size: .88rem; line-height: 1.36; }
  body:has(.r3-dock) .page-heading .price-jump { display: none; }
  .workspace { display: block; }
  .workspace .visual-panel,
  .workspace:has(input[name="shape"][value="l"]:checked) .visual-panel {
    top: 0; z-index: 4; padding-top: 3px; background: var(--r3-page);
    box-shadow: 0 3px 0 var(--r3-page);
  }
  .workspace .visual-panel :is(.plan-panel, .photo-panel),
  .workspace:has(input[name="shape"][value="l"]:checked) .visual-panel :is(.plan-panel, .photo-panel) {
    flex: none; height: clamp(130px, min(54vw, 30svh), 280px); aspect-ratio: auto; border-radius: 9px;
  }
  .visual-panel .view-toolbar { padding: 5px 0 4px; }
  .segmented { display: flex; width: 100%; padding: 2px; }
  .visual-panel .view-tab { flex: 1 1 0; min-height: 33px; padding: 5px 3px; font-size: .78rem; gap: 4px; }
  .visual-panel .view-tab .icon { width: 14px; height: 14px; }
  .visual-panel .image-caption { left: 6px; bottom: 6px; padding: 3px 6px; font-size: .68rem; max-width: calc(100% - 12px); }
  .visual-panel .material-bar { display: flex; min-height: 40px; gap: 7px; border: 0; border-radius: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 2px 1px 5px; }
  .material-bar .board-swatch { width: 32px; height: 28px; }
  .material-bar .material-text .manufacturer { display: none; }
  .material-text h2 { font-size: .81rem; margin: 0; line-height: 1.23; }
  .material-text h2 span { margin-inline: 1px; }
  .material-link { font-size: .75rem; min-height: 32px; }
  .material-link .icon { width: 13px; height: 13px; }
  .visual-panel .plan-bottom { padding: 2px 6px 4px; gap: 7px; align-items: center; }
  .plan-bottom .zoom-group { padding: 0; }
  .plan-bottom .zoom-group button { width: 28px; height: 26px; }
  .plan-bottom .plan-stamp { font-size: .68rem; padding: 1px 3px; }
  .configuration { border: 0; border-radius: 0; padding: 14px 1px 0; background: transparent; }
  .config-heading { padding-bottom: 9px; }
  .config-heading h2 { font-size: 1.4rem; }
  .jump-summary { display: inline-flex; align-items: center; min-height: 34px; font-size: .8rem; color: #3d512d; text-underline-offset: 3px; }
  .r3-tabs { position: sticky; top: calc(var(--r3-gallery-height, 36svh) + 2px); z-index: 3; margin-bottom: 12px; border: 1px solid #dfe5d8; box-shadow: 0 3px 0 var(--r3-page); }
  .r3-tab { min-height: 34px; font-size: .86rem; }
  .r3-panel :is([id], input, select, button, summary, .choice, .decor-choice) { scroll-margin-top: calc(var(--r3-gallery-height, 37svh) + 55px); scroll-margin-bottom: var(--r3-dock-height, 90px); }
  .control-section legend, .decor-picker legend, .notch-fields legend, #edge-choices legend { font-size: .94rem; }
  .model-picker { margin-bottom: 14px; }
  .decor-options { gap: 6px; }
  .decor-choice span { min-height: 63px; font-size: .75rem; }
  .decor-choice img { height: 34px; margin-bottom: 4px; }
  .corner-control select, #edge-stock, .price-inputs select { font-size: 16px; }
  .r3-dock {
    position: fixed; z-index: 8; left: 0; right: 0; bottom: 0; margin: 0; column-gap: 13px; row-gap: 3px;
    border-top: 1px solid #cdd5c7; background: #fafbf8f7; backdrop-filter: blur(12px);
    padding: 7px var(--r3-gutter) calc(7px + env(safe-area-inset-bottom));
  }
  .r3-budget-label { font-size: .71rem; }
  .r3-budget-total { font-size: 1.08rem; }
  .r3-dock .primary { min-height: 42px; padding: 8px 10px; font-size: .85rem; }
  .r3-feedback { font-size: .75rem; }
  .r3-another { min-height: 28px; padding-block: 2px; font-size: .77rem; }
  .summary { margin-top: 19px; padding: 14px; }
  .summary .save-wrap, .summary .save-wrap .primary { width: 100%; align-items: center; }
  #suhrn, #material-pricing { scroll-margin-top: 8px; }
  .price-panel { margin-top: 14px; padding: 16px 12px; }
  .price-panel h2 { font-size: 1.48rem; }
  .price-row { grid-template-columns: minmax(0,.85fr) minmax(0,1.15fr) minmax(0,1fr); gap: 7px; }
  .price-row > :first-child { grid-column: 1/-1; }
  .price-row [role="cell"] { min-width: 0; }
  .price-row [role="cell"] strong { font-size: .9rem; }
  .price-row > :last-child, .price-row > :last-child strong { text-align: right; }
  .price-actions a, .price-copy { max-width: 100%; }
}
@media (max-width: 355px) {
  .r3-dock { gap: 3px 8px; }
  .r3-dock .primary { padding-inline: 9px; font-size: .81rem; }
  .visual-panel .material-bar { min-height: 33px; }
  .material-bar .board-swatch { width: 25px; height: 23px; }
  .visual-panel .plan-bottom .tool-divider { display: none; }
}
@media (max-width: 760px) and (max-height: 500px) {
  .workspace .visual-panel, .workspace:has(input[name="shape"][value="l"]:checked) .visual-panel, .r3-tabs { position: relative; top: auto; }
  .r3-dock { position: static; margin-top: 16px; padding: 9px 0; background: none; }
  body:has(.r3-dock) { padding-bottom: 0; }
}
@media print {
  .r3-tabs, .r3-dock { display: none !important; }
  body:has(.r3-dock) { padding: 0; }
}
.edge-view-note {
  order: 1; font-size: .81rem; line-height: 1.35; margin: 5px 1px 0;
  color: #425734;
}
.visual-panel:has(#tab-photo[aria-pressed="true"]) #edge-view-note { display: none; }
@media (max-width: 760px) {
  .edge-view-note { font-size: .73rem; line-height: 1.28; margin-top: 3px; }

}
@media (min-width: 380px) {
  .decor-options:has(> .decor-choice:nth-child(4):last-child) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) and (max-height: 660px) {
  .configuration .r3-tabs { position: relative; top: auto; }
  .workspace .visual-panel :is(.plan-panel, .photo-panel),
  .workspace:has(input[name="shape"][value="l"]:checked) .visual-panel :is(.plan-panel, .photo-panel) {
    height: clamp(115px, 24svh, 155px);
  }
}

@media (max-width: 760px) {
  .r3-panel .number-wrap input { font-size: 16px; }
  .price-row-header { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .price-mobile-label { display: block; color: var(--muted); font-size: .74rem; }
  .r3-budget-label, .price-contact { overflow-wrap: anywhere; }
}
@media (max-width: 760px) and (min-height: 501px) {
  /* Release the fixed controls while the mobile keyboard occupies the lower viewport. */
  body:has(input:is([type="number"], [inputmode="numeric"], [inputmode="decimal"]):focus) .r3-dock {
    position: static; margin-block: 16px 0;
  }
  body:has(input:is([type="number"], [inputmode="numeric"], [inputmode="decimal"]):focus) .workspace :is(.visual-panel, .r3-tabs) {
    position: relative; top: 0;
  }
}

/* Keep the four edges of the 4:3 inspiration plate and its registered material mask visible. */
.workspace .visual-panel #panel-photo.photo-panel {
  flex: none;
  height: auto;
  aspect-ratio: 4 / 3;
}
@media (max-width: 760px) and (min-aspect-ratio: 3/5) {
  .workspace .visual-panel:has(#tab-photo[aria-pressed="true"]),
  .workspace:has(#tab-photo[aria-pressed="true"]) .configuration .r3-tabs {
    position: relative;
    top: auto;
  }
}
.visual-panel #panel-photo .image-caption {
  top: clamp(6px, 1.1vw, 13px);
  bottom: auto;
}

.support-options {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: 6px;
}
.support-options label {
  display: flex; align-items: center; gap: 7px; min-height: 44px;
  padding: 8px 10px; border: 1px solid #cbd2d0; border-radius: 6px;
  background: #fff; font-size: .86rem; line-height: 1.25; font-weight: 590; cursor: pointer;
}
.support-options input { flex: none; margin: 0; width: 15px; height: 15px; accent-color: #647e10; }
.support-options label:has(input:checked) { border-color: var(--green-dark); background: var(--pale); color: #23300d; }
.support-options label:has(input:focus-visible), .layout-link:focus-visible,
.layout-apply:focus-visible, .board-cost-detail summary:focus-visible { outline: 2px solid #5e791b; outline-offset: 2px; }
.support-hint { margin: 7px 0 0; }
.support-hint span { display: none; }
#support-controls:has([value="fixed"]:checked) [data-hint-for="fixed"],
#support-controls:has([value="pedestals"]:checked) [data-hint-for="pedestals"],
#support-controls:has([value="advice"]:checked) [data-hint-for="advice"] { display: inline; }
.layout-link { display: inline-flex; align-items: center; min-height: 44px; font-size: .85rem; font-weight: 610; color: #365328; text-underline-offset: 3px; }
.r3-panel .comparison {
  margin-top: 20px; padding: 16px 0 0; background: transparent; border: 0; border-top: 1px solid var(--line); border-radius: 0;
}
.r3-panel .comparison h3 { margin: 0 0 6px; font-size: 1.05rem; line-height: 1.25; }
.r3-panel .comparison #compare-layouts { margin: 0; border: 0; }
#layout-options { grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); }
.layout-option { display: grid; grid-template-rows: auto 1fr auto; row-gap: 5px; padding: 10px; }
.layout-heading, .layout-actions, .layout-figures { gap: 3px 10px; margin: 0; }
.layout-actions { align-self: end; }
.layout-option .layout-apply { min-height: 44px; }
.board-cost-detail { border-top: 1px solid var(--line); margin-top: 10px; }
.board-cost-detail summary { padding: 11px 0; min-height: 44px; cursor: pointer; color: #354b29; font-size: .85rem; font-weight: 620; }
.comparison:has(#layout-invalid:not([hidden])) :is(.board-cost-detail, .metric-title) { display: none; }
