:root {
  --dw-navy: #1e2b3c;
  --dw-blue: #315b7d;
  --dw-blue-soft: #eaf2f7;
  --dw-orange: #e8650a;
  --dw-orange-soft: #fff5eb;
  --dw-green: #19715f;
  --dw-line: #dfe5e8;
  --dw-muted: #687681;
  --dw-bg: #f4f6f5;
  --dw-white: #fff;
  --dw-shadow: 0 12px 35px rgba(30, 43, 60, .08);
}

[hidden] { display: none !important; }
.page-hero p { max-width: 790px; }
.drywall-app { max-width: 1280px; margin: 0 auto; padding: 28px 16px 0; color: var(--dw-navy); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 15px; border: 1px solid #f3d5b9; border-radius: 9px; background: var(--dw-orange-soft); color: #68513b; font-size: 13px; line-height: 1.55; }
.notice-icon { display: grid; place-items: center; flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; background: #fff; color: var(--dw-orange); font: 700 15px/1 Georgia, serif; }
.notice-content { min-width: 0; }
.intro-note { margin-bottom: 18px; }
.intro-note p { margin: 2px 0 0; }

.config-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.config-side { display: grid; gap: 18px; min-width: 0; }
.config-card { min-width: 0; padding: 20px; border: 1px solid var(--dw-line); border-radius: 10px; background: var(--dw-white); box-shadow: var(--shadow-sm); }
.config-card--main { position: sticky; top: 76px; align-self: start; }
.card-heading { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--dw-line); }
.card-heading > span { display: grid; place-items: center; flex: 0 0 25px; height: 25px; border-radius: 6px; background: var(--dw-orange-soft); color: var(--dw-orange); font: 700 10px/1 "Space Mono", monospace; }
.card-heading h2 { margin: 1px 0 3px; font-size: 15px; font-weight: 700; letter-spacing: 0; }
.card-heading p { margin: 0; color: var(--dw-muted); font-size: 12px; line-height: 1.4; }
.field-grid { display: grid; gap: 11px; align-items: end; }
.field-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 11px; min-width: 0; align-items: end; }
.choice-pair--custom { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; margin-bottom: 0; }
.field > span:first-child, .field-label { font-size: 11px; font-weight: 700; color: var(--dw-muted); letter-spacing: .5px; text-transform: uppercase; }
.field-label { margin: 18px 0 7px; }
.field select, .unit-input { width: 100%; height: 40px; border: 1px solid #cfd8dd; border-radius: 8px; background: #fff; color: var(--dw-navy); transition: border-color .18s, box-shadow .18s; }
.field select { appearance: none; -webkit-appearance: none; padding: 0 36px 0 12px; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; background-color: #fbfcfd; background-image: linear-gradient(45deg, transparent 50%, #536b7e 50%), linear-gradient(135deg, #536b7e 50%, transparent 50%); background-position: calc(100% - 18px) 17px, calc(100% - 13px) 17px; background-size: 5px 5px; background-repeat: no-repeat; }
.field select:hover { border-color: #9eb2c0; background-color: #fff; }
.field select option { background: #fff; color: var(--dw-navy); }
.unit-input { display: flex; align-items: stretch; overflow: hidden; }
.unit-input:focus-within { border-color: var(--dw-blue); box-shadow: 0 0 0 3px rgba(49, 91, 125, .12); outline: none; }
.field select:focus { border-color: var(--dw-orange); box-shadow: 0 0 0 3px rgba(232, 101, 10, .15); outline: none; }
.choice-pair--custom select { border-color: #efb88d; background-color: var(--dw-orange-soft); }
.unit-input input { min-width: 0; flex: 1; border: 0; outline: 0; padding: 0 10px; font-family: inherit; font-size: 13px; font-weight: 650; color: var(--dw-navy); background: transparent; }
.unit-input b { display: flex; align-items: center; padding: 0 11px; border-left: 1px solid #e4e8ea; background: #f7f8f8; color: #66737c; font-size: 12px; white-space: nowrap; }
.custom-field > span:first-child { color: var(--dw-orange); }
.custom-field .unit-input { border-color: #f3d5b9; background: var(--dw-orange-soft); }
.door-fields { margin-top: 16px; padding-top: 17px; border-top: 1px solid var(--dw-line); }
.toggle-row { display: flex; gap: 10px; align-items: center; margin-top: 13px; padding: 11px 12px; border: 1px solid var(--dw-line); border-radius: 8px; cursor: pointer; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-ui { position: relative; flex: 0 0 42px; height: 24px; border-radius: 99px; background: #bdc6cc; transition: background .2s; }
.toggle-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); transition: transform .2s; }
.toggle-row input:checked + .toggle-ui { background: var(--dw-green); }
.toggle-row input:checked + .toggle-ui::after { transform: translateX(18px); }
.toggle-row input:focus-visible + .toggle-ui { outline: 3px solid rgba(49, 91, 125, .25); }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row strong { font-size: 13px; }
.toggle-row small { margin-top: 2px; color: var(--dw-muted); line-height: 1.35; }
.layer-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 13px; }
.sides-picker { margin-bottom: 0; }
.layer-picker label { position: relative; cursor: pointer; }
.layer-picker input { position: absolute; opacity: 0; }
.layer-picker span { display: block; height: 100%; padding: 10px 11px; border: 1px solid #d7dfe3; border-radius: 8px; background: #fff; }
.layer-picker b, .layer-picker small { display: block; }
.layer-picker b { font-size: 13px; }
.layer-picker small { margin-top: 3px; color: var(--dw-muted); line-height: 1.35; }
.layer-picker input:checked + span { border-color: var(--dw-orange); background: var(--dw-orange-soft); box-shadow: inset 0 0 0 1px var(--dw-orange); }
.layer-picker input:focus-visible + span { outline: 3px solid rgba(238, 116, 69, .18); }

.validation { margin-top: 18px; }
.layout-hint { margin-top: 12px; }
.layout-hint p { margin: 0; }
.validation--error { border-color: #dcaaa5; background: #fff0ef; color: #8b352e; }
.validation--error .notice-icon { color: #b84238; }
.validation strong { display: block; margin: 1px 0 3px; font-size: 13px; }
.validation ul { margin: 0; padding-left: 18px; line-height: 1.5; }
.results { margin-top: 18px; transition: opacity .2s; }
.results--disabled { opacity: .35; pointer-events: none; }
.results-head { display: flex; gap: 10px; align-items: center; margin: 25px 0 13px; }
.results-check { display: grid; place-items: center; flex: 0 0 29px; height: 29px; border-radius: 7px; background: var(--dw-green); color: #fff; font-size: 15px; font-weight: 800; }
.results-head span, .section-kicker, .guide-title > span { color: var(--dw-orange); font: 700 11px/1.2 "Space Mono", monospace; text-transform: uppercase; letter-spacing: .1em; }
.results-head h2 { margin: 2px 0; font-size: 19px; }
.results-head p { margin: 0; color: var(--dw-muted); font-size: 13px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.summary-card { min-width: 0; padding: 14px 16px; border: 1px solid var(--dw-line); border-radius: 8px; background: var(--dw-bg); }
.summary-card--accent { border-color: var(--dw-navy); background: var(--dw-navy); }
.summary-card--accent span, .summary-card--accent small { color: rgba(255,255,255,.7); }
.summary-card--accent strong { color: var(--dw-orange); }
.summary-card span, .summary-card small, .summary-card strong { display: block; }
.summary-card span { color: var(--dw-muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.summary-card strong { margin: 6px 0 4px; font-size: 21px; line-height: 1.15; }
.summary-card small { color: #65717a; line-height: 1.35; }

.shopping-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.shopping-card, .plan-card, .advice-card { border: 1px solid var(--dw-line); border-radius: 10px; background: #fff; box-shadow: var(--shadow-sm); }
.shopping-card { padding: 20px; }
.shopping-card h3 { margin: 5px 0 12px; font-size: 16px; }
.shopping-list { display: grid; gap: 2px; }
.shop-item { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 11px 0; border-top: 1px solid #edf0f1; }
.shop-item:first-child { border-top: 0; padding-top: 3px; }
.shop-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--dw-blue-soft); }
.shop-icon img { display: block; width: 30px; height: 30px; object-fit: contain; }
.shop-icon img[src$="joint-tape.webp"] { clip-path: inset(0 1px 0 0); }
.shop-copy strong, .shop-copy span, .shop-copy small { display: block; }
.shop-copy strong { margin-bottom: 3px; font-size: 14px; }
.shop-copy span { color: #4f5d67; font-size: 13px; }
.shop-copy small { margin-top: 4px; color: #7a858c; font-size: 11px; line-height: 1.35; }
.shop-item > b { padding-top: 3px; color: var(--dw-orange); font-size: 15px; text-align: right; white-space: nowrap; }

.plan-card { padding: 20px; overflow: hidden; }
.plan-header { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.plan-header h2 { margin: 3px 0 4px; font-size: 18px; }
.plan-header p { max-width: 700px; margin: 0; color: var(--dw-muted); font-size: 13px; line-height: 1.45; }
.plan-tabs { display: flex; flex: 0 0 auto; padding: 3px; border-radius: 11px; background: #eef1f2; }
.plan-tabs button { border: 0; border-radius: 8px; padding: 9px 13px; background: transparent; color: #53616b; font: 700 12px/1 inherit; cursor: pointer; }
.plan-tabs button[aria-selected="true"] { background: #fff; color: var(--dw-navy); box-shadow: 0 2px 7px rgba(30, 43, 60, .12); }
.legend { display: flex; flex-wrap: wrap; gap: 15px; min-height: 20px; margin: 12px 0 7px; color: #58666f; font-size: 12px; }
.legend span { display: flex; gap: 6px; align-items: center; }
.legend i { width: 20px; height: 7px; border-radius: 2px; }
.legend-cw { background: #557c98; }
.legend-uw { background: #1e2b3c; }
.legend-ua { background: #ee7445; }
.legend-board { background: #bdd7e7; border: 1px solid #668da7; }
.legend-board--second { background: #f5c0aa; border-color: #d76b40; }
.legend-seam { height: 2px !important; background: #2f536d; }
.plan-viewport { overflow-x: auto; border: 1px solid #e0e6e9; border-radius: 8px; background: linear-gradient(#f8fafb 1px, transparent 1px), linear-gradient(90deg, #f8fafb 1px, transparent 1px), #fff; background-size: 20px 20px; }
#wallPlan { display: block; width: 100%; max-width: 1040px; min-width: 720px; height: auto; margin-inline: auto; }
.plan-wall-bg { fill: #f0f3f4; stroke: #667987; stroke-width: 2; }
.uw-profile { fill: #1e2b3c; }
.section-help { margin: 12px 0 0; color: #547086; font-size: 12px; line-height: 1.5; }
.cw-profile { fill: #557c98; stroke: #31536c; stroke-width: 1; }
.ua-profile { fill: #ee7445; stroke: #a94724; stroke-width: 2; }
.cw-double-profile { fill: #7a6b98; stroke: #55456e; stroke-width: 2; }
.board-piece { fill: #d8e9f2; fill-opacity: .9; stroke: #557c98; stroke-width: 2; }
.board-piece--second { fill: #f8d1c1; stroke: #d56338; }
.board-label { fill: #36566b; font: 700 14px "Space Mono", monospace; }
.board-piece--second + .board-label { fill: #984521; }
.door-opening { fill: #fff; stroke: #ee7445; stroke-width: 3; stroke-dasharray: 7 5; }
.door-label { fill: #bd572f; font: 700 12px "Space Mono", monospace; letter-spacing: .06em; }
.dim-line, .dim-tick { stroke: #81909a; stroke-width: 1.5; }
.dim-text { fill: #53616b; font: 700 13px "Space Mono", monospace; }
.plan-note { margin-top: 9px; padding: 10px 13px; border-radius: 8px; background: #f2f5f6; color: #56646e; font-size: 13px; line-height: 1.5; }
.plan-note strong { color: var(--dw-navy); }

.advice-card { margin-top: 18px; padding: 20px; }
.advice-card > h2 { margin: 4px 0 14px; font-size: 18px; }
.advice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.advice-grid article { position: relative; padding: 14px; border: 1px solid #e3e8ea; border-radius: 8px; background: #fafbfb; }
.advice-grid article > b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--dw-navy); color: #fff; font: 700 11px "Space Mono", monospace; }
.advice-grid h3 { margin: 10px 0 5px; font-size: 14px; }
.advice-grid p { margin: 0; color: #66737b; font-size: 13px; line-height: 1.5; }

.info-section { max-width: 1280px; margin: 0 auto; padding: 32px 16px 0; }
.drywall-guide { padding-top: 48px; }
.guide-title { max-width: 720px; margin-bottom: 16px; }
.guide-title h2 { margin: 4px 0 5px; font-size: 22px; color: var(--dw-navy); }
.guide-title p { margin: 0; color: var(--dw-muted); font-size: 13px; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.steps article { position: relative; overflow: hidden; padding: 17px; border: 1px solid var(--dw-line); border-radius: 10px; background: #fff; }
.steps article::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--dw-orange); }
.steps article > b { color: var(--dw-orange); font: 700 13px "Space Mono", monospace; }
.steps h3 { margin: 9px 0 5px; font-size: 14px; }
.steps p { margin: 0; color: #68757d; font-size: 13px; line-height: 1.5; }
.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.content-grid article { padding: 19px; border: 1px solid var(--dw-line); border-radius: 10px; background: #fff; }
.content-grid h2 { margin: 0 0 8px; font-size: 17px; color: var(--dw-navy); }
.content-grid p { margin: 8px 0 0; color: #5f6c74; font-size: 13px; line-height: 1.6; }
.source-box { display: flex; gap: 13px; margin-top: 24px; padding: 18px; border: 1px solid #cfdfe7; border-radius: 10px; background: var(--dw-blue-soft); }
.source-icon { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 50%; background: var(--dw-blue); color: #fff; font: 700 17px serif; }
.source-box h2 { margin: 0 0 5px; font-size: 16px; }
.source-box p { margin: 0; color: #526975; font-size: 13px; line-height: 1.55; }
.source-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 11px; }
.source-links a { color: #245a7a; font-size: 13px; font-weight: 700; text-underline-offset: 3px; }
.faq-section > h2 { margin-bottom: 4px; font-size: 22px; }
.faq-section > .sub { margin: 0 0 18px; color: var(--dw-muted); }
.faq { display: flex; flex-direction: column; gap: 10px; margin: 0; border: 0; }
.faq-item { border: 1px solid var(--dw-line); border-radius: 10px; background: #fff; overflow: hidden; }
.faq-q { display: flex; justify-content: space-between; gap: 12px; align-items: center; width: 100%; border: 0; padding: 15px 18px; background: transparent; color: var(--dw-navy); font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1.4; text-align: left; cursor: pointer; }
.faq-q svg { flex: 0 0 auto; transition: transform .2s; }
.faq-item.open .faq-q svg { transform: rotate(45deg); }
.faq-a { display: none; padding: 14px 18px 16px; border-top: 1px solid var(--dw-line); color: #65727a; font-size: 13px; line-height: 1.6; }
.faq-item.open .faq-a { display: block; }
.related-tools { padding-bottom: 50px; }
.related-tools h2 { font-size: 21px; }
.related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.related-grid a { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 14px; border: 1px solid var(--dw-line); border-radius: 10px; color: var(--dw-navy); text-decoration: none; background: #fff; transition: transform .18s, box-shadow .18s; }
.related-grid a:hover { transform: translateY(-2px); box-shadow: var(--dw-shadow); }
.related-grid a > span { font-size: 25px; }
.related-grid strong, .related-grid p { display: block; }
.related-grid p { margin: 3px 0 0; color: var(--dw-muted); font-size: 12px; line-height: 1.4; }
.related-grid a > b { color: var(--dw-orange); }

@media (max-width: 980px) {
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .shopping-layout { grid-template-columns: 1fr; }
  .advice-grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .related-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .drywall-app { padding: 22px 14px 0; }
  .config-grid { grid-template-columns: 1fr; }
  .config-card--main { position: static; }
  .config-card { padding: 17px; }
  .field-grid--2, .field-grid--3 { grid-template-columns: 1fr; }
  .plan-card { padding: 18px 14px; }
  .plan-header { display: block; }
  .plan-tabs { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 16px; }
  .plan-tabs button { padding-left: 8px; padding-right: 8px; }
  .plan-viewport { min-height: 330px; }
  .advice-grid, .content-grid { grid-template-columns: 1fr; }
  .source-box { margin-left: 14px; margin-right: 14px; width: calc(100% - 28px); }
}

@media (max-width: 520px) {
  .intro-note { font-size: 13px; }
  .choice-pair--custom { grid-template-columns: 1fr; }
  .layer-picker { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-card { padding: 15px; }
  .shop-item { grid-template-columns: 36px minmax(0, 1fr); }
  .shop-item > b { grid-column: 2; text-align: left; padding-top: 0; }
  .steps { grid-template-columns: 1fr; }
  .drywall-guide, .content-grid, .faq-section, .related-tools { padding-left: 14px; padding-right: 14px; }
}

@media print {
  .nav, .page-hero, .config-grid, .intro-note, .footer, .drywall-guide, .content-grid, .source-box, .faq-section, .related-tools, .plan-tabs { display: none !important; }
  .drywall-app { max-width: none; padding: 0; }
  .results { margin: 0; }
  .shopping-card, .plan-card, .advice-card, .summary-card { box-shadow: none; break-inside: avoid; }
}
