:root {
  color-scheme: light;
  --background: #f8f7f3;
  --paper: #fff;
  --text: #292920;
  --muted: #5b6052;
  --line: #dedfd3;
  --green: #3e5031;
  --dark-green: #2b3a24;
  --soft-green: #e5ebd9;
  --rust: #763e2a;
  --radius: 17px;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--background);
  color: var(--text);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input, select { font: inherit; }
a { color: var(--dark-green); text-underline-offset: .19em; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .54; cursor: default; }
:focus-visible { outline: 3px solid #884b2f; outline-offset: 3px; }
input:focus-visible, select:focus-visible { outline-offset: 0; }
p { margin-block: 0 1rem; }
h1, h2, h3 { margin: 0; line-height: 1.12; font-weight: 650; }
h1, .section h2, .workflow h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -.035em;
}
h2 { font-size: 1.27rem; }
.shell { width: min(1176px, calc(100% - 64px)); margin-inline: auto; }
.narrow { max-width: 780px; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: absolute; z-index: 10; background: var(--paper); padding: .65rem; left: 12px; top: 12px; }

.site-header { border-bottom: 1px solid var(--line); }
.header-row, .footer-row { display: flex; align-items: center; justify-content: space-between; min-height: 71px; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: .62rem; color: var(--text); font-size: 1.17rem; font-weight: 750; text-decoration: none; letter-spacing: -.035em; white-space: nowrap; }
.brand-mark {
  display: grid; place-items: center; width: 31px; height: 31px; border-radius: 9px;
  position: relative; background: var(--green); flex: 0 0 auto;
}
.brand-mark::before { content: ""; position: absolute; width: 9px; height: 9px; border-left: 2px solid white; border-top: 2px solid white; transform: rotate(45deg); top: 8px; left: 10px; }
.brand-mark i { width: 12px; height: 9px; margin-top: 6px; border: solid white; border-width: 0 2px 2px; border-radius: 0 0 2px 2px; }
.main-nav { display: flex; gap: 1.7rem; font-size: .94rem; }
.main-nav a, .header-shopping, .site-footer nav a { text-decoration: none; }
.main-nav a[aria-current], .header-shopping[aria-current] { font-weight: 700; }
.main-nav a:hover, .header-shopping:hover, .site-footer nav a:hover { text-decoration: underline; }
.header-shopping { font-weight: 650; font-size: .9rem; white-space: nowrap; }
.header-shopping span { margin-right: .25rem; font-size: 1.2rem; }

.hero { display: grid; grid-template-columns: 1.08fr .92fr; margin-top: 37px; border-radius: 24px; overflow: hidden; background: var(--soft-green); min-height: 398px; }
.hero-copy { padding: clamp(34px, 5vw, 68px) clamp(30px, 5vw, 62px); align-self: center; }
.eyebrow { color: var(--dark-green); font-size: .875rem; font-weight: 750; letter-spacing: .065em; text-transform: uppercase; margin-bottom: 1rem; }
.hero h1 { font-size: clamp(2.6rem, 4.4vw, 4.4rem); }
.hero-copy p:not(.eyebrow) { max-width: 39ch; margin: 20px 0 25px; color: var(--muted); }
.hero-image { min-height: 100%; position: relative; background: #4c5140; }
.hero-image img { width: 100%; height: 100%; position: absolute; display: block; object-fit: cover; object-position: 55% center; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.button { display: inline-flex; align-items: center; min-height: 44px; justify-content: center; border-radius: 9px; border: 1px solid transparent; padding: 10px 17px; font-size: .9375rem; line-height: 1.25; font-weight: 680; text-decoration: none; }
.button.primary { background: var(--green); color: white; }
.button.primary:not(:disabled):hover { background: var(--dark-green); }
.button.secondary { color: var(--dark-green); border-color: #b6bdaa; background: var(--paper); }
.button.secondary:not(:disabled):hover { background: #f1f3e9; }
.button.small { padding-inline: 12px; font-size: .875rem; }
.section { margin-top: 46px; margin-bottom: 42px; }
.section h2, .workflow h2 { font-size: clamp(1.6rem, 3vw, 2.45rem); }
.section-heading { display: flex; gap: 12px 24px; flex-wrap: wrap; align-items: baseline; justify-content: space-between; margin-bottom: 19px; }
.section-heading p { margin: 0; color: var(--muted); }
.tool-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.tool-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; align-items: flex-start; min-height: 158px; padding: 16px 18px; text-decoration: none; color: var(--text); }
.tool-card:hover { border-color: var(--green); box-shadow: 0 6px 22px #2929200b; }
.tool-icon { display: inline-grid; place-items: center; width: 41px; height: 41px; border-radius: 9px; font-size: 1.45rem; line-height: 1; font-weight: 700; flex: 0 0 auto; }
.tool-icon.area { background: #e6eadb; color: #394527; }
.tool-icon.wallpaper { background: #f4e6d8; color: #69452d; }
.tool-icon.tile { background: #e4ebe9; color: #354d48; }
.tool-icon.paint { background: #ebead8; color: #5d4f29; }
.tool-card strong { display: block; font-size: 1.11rem; margin-top: 10px; }
.tool-summary { color: var(--muted); font-size: .875rem; margin: 2px 0 11px; }
.tool-open { display: block; color: var(--dark-green); margin-top: auto; font-weight: 650; font-size: .875rem; text-decoration: underline; text-underline-offset: .24em; }
.workflow { display: flex; align-items: center; justify-content: space-between; gap: 16px 30px; margin-top: 36px; padding: 25px; border-radius: var(--radius); border: 1px solid var(--line); background: #efefe7; }
.workflow p { margin: 8px 0 0; max-width: 65ch; color: var(--muted); }
.workflow .button { flex-shrink: 0; }

.page { margin-block: 24px 65px; }
.crumbs { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; font-size: .9rem; color: var(--muted); margin-bottom: 23px; }
.page-heading { margin: 28px 0 26px; }
.page-heading h1 { font-size: clamp(2.35rem, 5vw, 4.15rem); }
.page-heading p { max-width: 65ch; margin: 12px 0 0; color: var(--muted); }
.heading-with-icon { display: flex; gap: 13px; align-items: center; }
.heading-with-icon .tool-icon { width: 49px; height: 49px; }
.calculator-layout { display: grid; grid-template-columns: minmax(0, 1.37fr) minmax(0, 1fr); gap: 17px; align-items: start; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 2.5vw, 26px); }
.panel-title { display: block; font-size: 1.32rem; }
.fields { display: grid; gap: 12px; }
.fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fields.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fields.three > .field { justify-content: flex-end; }
.panel > .fields, .room-name-row { margin-top: 15px; }
.room-name-row { width: min(100%, 52%); }
.field { display: flex; flex-direction: column; align-items: stretch; gap: 5px; min-width: 0; font-size: .9rem; font-weight: 600; }
.field-box { position: relative; display: flex; min-width: 0; }
.field input, .field select { min-width: 0; border: 1px solid #bfc4b4; background: #fafbf7; color: var(--text); border-radius: 8px; min-height: 45px; padding: 9px 11px; width: 100%; font-size: 1rem; }
.field input[inputmode="decimal"] { padding-right: 36px; }
.unit { position: absolute; inset: 0 9px 0 auto; display: flex; align-items: center; font-size: .86rem; color: var(--muted); pointer-events: none; }
.field small { color: var(--muted); font-size: .875rem; font-weight: 400; }
.subheading { margin: 22px 0 11px; font-size: 1rem; }
#openings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.opening { padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.opening-head { display: flex; align-items: baseline; gap: 2px 8px; justify-content: space-between; flex-wrap: wrap; font-weight: 680; font-size: .9rem; }
.text-button { border: 0; background: transparent; font-weight: 580; text-decoration: underline; text-underline-offset: .18em; padding: 7px 2px; color: var(--dark-green); font-size: .9rem; }
.opening-head .text-button { min-height: 34px; color: var(--rust); }
.opening-actions, .form-bottom { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 13px; margin-top: 12px; }
.form-note, .result-note, .status, .shopping-note { color: var(--muted); font-size: .9rem; }
.form-note { margin: 13px 0 0; }
.settings { margin-top: 12px; }
.result-panel { background: #f4f6ee; border-color: #c4ceba; position: sticky; top: 15px; }
.result-figure { margin: 15px 0; border-radius: 12px; background: var(--soft-green); padding: 16px; display: grid; gap: 2px; color: var(--dark-green); }
.result-figure strong { font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.85rem, 4vw, 3.15rem); line-height: 1.12; font-weight: 500; letter-spacing: -.04em; }
.result-figure span { font-size: .92rem; }
.result-stats { margin: 0 0 14px; }
.result-stats > div { display: flex; gap: 8px 14px; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line); padding: 8px 0; }
.result-stats dt { color: var(--muted); font-size: .9rem; }
.result-stats dd { margin: 0; font-weight: 650; text-align: right; }
.result-actions { display: flex; gap: 10px 13px; align-items: center; flex-wrap: wrap; }
.result-link { font-weight: 650; font-size: .9rem; }
.status { margin-bottom: 0; }
.status:not(:empty) { margin-top: 10px; }
.error { color: #842d23; background: #fae8e3; padding: 12px; border-radius: 8px; margin: 10px 0 0; }
.result-empty { margin-top: 16px; }
.calculator-notes { max-width: 750px; }
.calculator-notes h2, .related h2 { margin-bottom: 12px; }
.related .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.method { margin-top: 12px; }
.method h2 { margin-bottom: 12px; }
.shopping-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; padding-bottom: 10px; }
.empty-list { margin: 14px 0 2px; color: var(--muted); }
.shopping-list { padding: 0; margin: 8px 0 0; list-style: none; }
.shopping-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 12px 2px; border-top: 1px solid var(--line); }
.purchase-check { display: flex; align-items: center; gap: 5px; font-size: .875rem; cursor: pointer; }
.purchase-check input { accent-color: var(--green); width: 18px; height: 18px; }
.shopping-title, .shopping-row > strong { font-weight: 700; }
.shopping-row.bought > strong, .shopping-row.bought .shopping-title { text-decoration: line-through; }
.shopping-row > .text-button { color: var(--rust); }
.site-footer { border-top: 1px solid var(--line); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .875rem; }

@media (max-width: 930px) {
  .hero { min-height: 350px; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #openings { grid-template-columns: 1fr; }
}
@media (max-width: 850px) {
  .calculator-layout { grid-template-columns: 1fr; }
  .result-panel { position: static; }
  #openings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .shell { width: calc(100% - 32px); }
  .main-nav { order: 3; width: 100%; gap: 16px; border-top: 1px solid var(--line); padding: 7px 0; }
  .header-row { min-height: 57px; flex-wrap: wrap; gap: 0 8px; padding-top: 12px; }
  .header-shopping { font-size: .86rem; }
  .hero { grid-template-columns: 1fr; min-height: 0; margin-top: 20px; border-radius: 16px; }
  .hero-copy { padding: 24px 19px 23px; }
  .hero h1 { font-size: clamp(2.35rem, 9vw, 3.6rem); }
  .hero-image { min-height: 175px; }
  .hero-image img { object-position: center 68%; }
  .section { margin-top: 31px; margin-bottom: 30px; }
  .tool-card { padding: 12px; }
  .tool-grid, .related .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .workflow, .footer-row { align-items: flex-start; flex-direction: column; }
  .footer-row { padding-block: 15px; gap: 9px; }
  .workflow { padding: 17px; }
  .room-name-row { width: 100%; }
  .heading-with-icon { align-items: flex-start; gap: 9px; }
  .heading-with-icon .tool-icon { width: 38px; height: 38px; }
  .shopping-row { grid-template-columns: 1fr auto; gap: 5px 8px; }
  .shopping-row .purchase-check { grid-row: 2; }
  .shopping-row .text-button { grid-row: 2; justify-self: end; }
}
@media (max-width: 400px) {
  #openings { grid-template-columns: 1fr; }
  .fields.three { gap: 6px; }
}
@media print {
  :root { background: white; color: black; }
  .site-header, .site-footer, .shopping-actions, .shopping-row button, .status { display: none !important; }
  .shell { width: 100%; }
  .page-heading { margin-top: 0; }
  .shopping { border: 0; padding: 0; }
  .shopping-row { break-inside: avoid; }
  a { color: black; text-decoration: none; }
}
