:root {
  color-scheme: light;
  --ink: #251b19; --muted: #6e5d55; --page: #fcf6ee; --surface: #fffdfa;
  --line: #e9ded3; --red: #a51f22; --red-dark: #7c111a; --blush: #fae7e2;
  --focus: #b52b25; --round: 22px;
  font: 16px/1.45 "DM Sans", "Segoe UI", system-ui, sans-serif;
  color: var(--ink); background: var(--page);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; }
button, select, summary { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 3px;
}
.wrap { width: min(1120px, calc(100% - 64px)); margin: auto; }
.top { border-bottom: 1px solid var(--line); background: #fffaf3; }
.top-inner { display: flex; justify-content: space-between; align-items: center; min-height: 72px; }
.brand { display: flex; align-items: center; width: 140px; }
.brand img { width: 100%; height: auto; mix-blend-mode: multiply; }
button { border: 0; }
.secondary, .primary, .text-button { padding: 10px 15px; border-radius: 10px; font-weight: 700; }
.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.secondary:hover { background: var(--blush); }
.primary { background: var(--red); color: white; }
.primary:hover { background: var(--red-dark); }
.primary span { margin-left: 8px; }
.text-button { color: var(--red-dark); background: none; }
.text-button:hover { background: var(--blush); }
.count { display: inline-grid; place-items: center; margin-left: 6px; min-width: 23px; height: 23px; padding-inline: 4px; border-radius: 20px; background: var(--blush); color: var(--red-dark); font-size: .8rem; }
.intro { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; overflow: hidden; min-height: 284px; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 10px; font-size: .77rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; color: var(--red-dark); }
h1, h2, h3, p { margin-top: 0; }
h1 { font: 700 clamp(3rem, 6.4vw, 6rem)/.94 Georgia, serif; letter-spacing: -.075em; margin-bottom: 16px; }
h1 span { color: var(--red); }
.intro > div:first-child { padding-block: 27px; }
.sub { max-width: 415px; color: var(--muted); font-size: 1.06rem; margin: 0; }
.intro-art { position: relative; min-height: 254px; display: grid; place-items: center; isolation: isolate; }
.table-lines { width: clamp(204px, 32vw, 390px); aspect-ratio: 1.75; position: absolute; border: 1px solid #db9b8c; border-radius: 44% 46% 44% 46%; background: #f5ddd3; transform: rotate(-19deg); }
.table-lines::before, .table-lines::after { content: ""; position: absolute; border: 1px solid #db9b8c; border-radius: inherit; inset: 12px; }
.table-lines::after { inset: 24px; }
.intro-art img { width: clamp(260px, 33vw, 390px); height: auto; z-index: 1; mix-blend-mode: multiply; transform: rotate(-8deg); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 17px 0; }
.example { display: flex; align-items: center; gap: 10px; }
.example label { color: var(--muted); font-size: .82rem; }
.example select { width: auto; min-width: 160px; }
.workspace { display: grid; grid-template-columns: minmax(0,1.37fr) minmax(0,1fr); gap: 20px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--round); }
.editor { overflow: hidden; }
.steps { display: grid; grid-template-columns: repeat(3,1fr); background: #fbf3ea; border-bottom: 1px solid var(--line); }
.steps button { white-space: nowrap; padding: 13px 8px; background: none; color: var(--muted); font-weight: 700; border-bottom: 3px solid transparent; }
.steps button:hover { background: #f9e9df; }
.steps button[aria-current] { color: var(--red-dark); border-color: var(--red); background: var(--surface); }
.steps button span { display: inline-grid; place-items: center; background: #efe4d9; border-radius: 50%; width: 22px; height: 22px; margin-right: 3px; font-size: .75em; }
.steps button[aria-current] span { background: var(--red); color: white; }
#calculator { padding: 23px; }
h2 { font: 700 1.62rem/1.14 Georgia, serif; letter-spacing: -.035em; margin-bottom: 6px; }
h3 { font-size: .98rem; margin-bottom: 3px; }
.hint { font-size: .87rem; color: var(--muted); margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-bottom: 13px; }
.split { grid-template-columns: 1.44fr 1fr; }
label { display: block; font-size: .84rem; font-weight: 670; min-width: 0; }
input, select { display: block; width: 100%; color: var(--ink); background: white; border: 1px solid #d9c7bb; border-radius: 9px; padding: 8px 10px; min-height: 43px; }
label input, label select { margin-top: 4px; }
input::placeholder { color: #786b63; }
input[aria-invalid="true"] { border-color: var(--red); }
.section-top { display: flex; gap: 6px; align-items: flex-start; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 17px; }
.tag { background: #f5ecdf; border-radius: 20px; padding: 5px 9px; white-space: nowrap; font-size: .76rem; font-weight: 700; color: var(--red-dark); }
.material { margin-bottom: 9px; }
.material-grid { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,.8fr) 36px; gap: 8px; align-items: end; }
.remove { padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--red-dark); min-height: 43px; font-size: 1.25rem; }
.remove:hover { background: var(--blush); }
.add { margin-left: -9px; margin-bottom: 5px; padding-inline: 9px; }
.optional { padding-top: 13px; border-top: 1px solid var(--line); }
.optional summary { font-size: .88rem; font-weight: 700; color: var(--red-dark); }
.optional .grid, .optional > label { margin-top: 11px; }
.conversion { margin-top: 5px; }
.conversion summary { font-size: .76rem; color: var(--muted); }
.conversion .grid { margin: 8px 0; }
.inline-hint { font-size: .76rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 19px; }
.notice { margin: 10px 0 0; font-size: .85rem; font-weight: 600; color: var(--red-dark); }
.note { padding: 11px 13px; border-radius: 10px; background: #f8efe4; color: var(--muted); font-size: .84rem; }
.check { display: flex; align-items: center; gap: 8px; margin: 3px 0 12px; }
.check input { width: 17px; height: 17px; min-height: 0; margin: 0; accent-color: var(--red); }
.compare-title { margin-top: 17px; }
.results { display: grid; gap: 13px; }
.score { background: #831620; color: #fff8ee; padding: 23px 25px; border-radius: var(--round); }
.score .eyebrow { color: #ffe0d4; }
.price { font: 700 clamp(2.5rem, 4.7vw, 4.7rem)/1 Georgia, serif; letter-spacing: -.05em; overflow-wrap: anywhere; }
#price-context { margin: 5px 0 14px; font-size: .83rem; color: #ffe0d4; }
.price-error { font-size: .85rem; color: #fff3ca; }
.score-pair, .targets { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.score-pair { border-top: 1px solid #a64f54; padding-top: 12px; }
.score-pair span, .targets span { display: block; font-size: .78rem; }
.score-pair strong, .targets strong { display: block; margin-top: 3px; font-size: 1.17rem; overflow-wrap: anywhere; }
.breakdown { padding: 19px 21px; }
.targets { margin: 13px 0 5px; }
.targets > div { background: #f8efe4; padding: 9px 11px; border-radius: 11px; }
.targets strong { color: var(--red-dark); }
.metrics { margin: 12px 0; }
.metrics > div { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; border-bottom: 1px solid var(--line); padding: 8px 0; font-size: .82rem; }
.metrics > div:last-child { border-bottom: none; }
.metrics dd { margin: 0; font-weight: 750; text-align: right; max-width: 138px; overflow-wrap: anywhere; }
.metrics small { color: var(--muted); display: block; }
.scenario p { margin: 8px 0 0; }
.footer { display: flex; justify-content: space-between; gap: 9px; padding: 20px 0; color: var(--muted); font-size: .77rem; }
dialog { border: 1px solid var(--line); border-radius: var(--round); width: min(480px, calc(100% - 28px)); background: var(--surface); color: var(--ink); padding: 22px; }
dialog::backdrop { background: #3219199c; }
.dialog-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 9px; }
.saved-list { list-style: none; padding: 0; margin: 0; }
.saved-list li + li { margin-top: 6px; }
.saved-list button { width: 100%; text-align: left; overflow-wrap: anywhere; }
@media (max-width: 800px) {
  .wrap { width: calc(100% - 36px); }
  .score { padding: 18px; }
  .breakdown { padding: 15px; }
  #calculator { padding: 16px; }
}
@media (max-width: 650px) {
  .wrap { width: calc(100% - 26px); }
  .intro { min-height: 0; grid-template-columns: 1fr; position: relative; }
  .intro > div:first-child { padding-block: 22px; }
  .intro h1 { position: relative; z-index: 2; width: max-content; max-width: 100%; font-size: clamp(3rem, 9.4vw, 4.5rem); }
  .sub { position: relative; z-index: 2; font-size: .91rem; max-width: 31ch; }
  .intro-art { position: absolute; right: 0; top: 13px; min-height: 0; width: 28%; opacity: .55; pointer-events: none; }
  .intro-art img { width: 100%; }
  .table-lines { width: 95%; }
  .table-lines::before { inset: 5px; }
  .table-lines::after { inset: 10px; }
  .workspace { grid-template-columns: minmax(0,1fr); gap: 14px; }
  .toolbar { flex-wrap: wrap; margin-block: 12px; }
  .example { flex-wrap: wrap; gap: 4px 8px; }
  .example select { min-width: 0; }
  .footer { flex-direction: column; }
  .price { font-size: clamp(3rem, 13vw, 4.7rem); }
  #calculator input, #calculator select, #current-price { font-size: 1rem; }
}
@media (max-width: 370px) {
  .grid { grid-template-columns: 1fr; }
  .top-inner { min-height: 59px; }
  .brand { width: 112px; }
  .steps button { font-size: .76rem; }
}
.price-details { margin-bottom: 12px; }
.offline-status { display: inline-flex; align-items: center; gap: 7px; margin: 10px 0 0; font-size: .82rem; font-weight: 700; color: var(--muted); }
.offline-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #a57e50; flex: none; }
.offline-status.offline-ready { color: #2e6246; }
.offline-status.offline-ready::before { background: #3f815d; }
