:root {
  font-family: system-ui, sans-serif;
  color: #222128;
  background: #ffffff;
  line-height: 1.6;
  --ink: #222128;
  --red: #922e31;
  --rust: #742326;
  --edge: #e7e3e5;
  --paper: #ffffff;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: var(--red); text-underline-offset: .2em; }
.wrap { width: min(1150px, calc(100% - 44px)); margin-inline: auto; }
header {
  color: #222128;
  background: #ffffff;
  border-bottom: 1px solid var(--edge);
}
.bar, nav, footer { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.bar { justify-content: space-between; min-height: 86px; padding-block: 12px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 48px; height: 48px; flex: none; object-fit: contain; }
.brand-name { display: grid; font: 800 1.22rem/1 system-ui, sans-serif; letter-spacing: .07em; }
.brand-name span { margin-top: 6px; font-size: .75em; color: var(--red); letter-spacing: .13em; }
nav { gap: 24px; }
nav a { color: #222128; text-decoration: none; font-weight: 650; }
nav a:hover, nav a[aria-current="page"] { color: var(--red); text-decoration: underline; }
.hero { padding: clamp(38px, 7vw, 86px) 0 clamp(22px, 4vw, 38px); }

.hero h1 { max-width: 930px; font-size: clamp(2.15rem, 6.1vw, 5rem); line-height: 1.04; letter-spacing: -.055em; margin: 0; }
.hero p { max-width: 700px; margin: 19px 0 0; font-size: clamp(1rem, 2vw, 1.15rem); color: #5e5861; }
.cards, .layout, .fields { display: grid; gap: 18px; }
.cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.layout { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; }
.fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
article, form, .guide, .result { min-width: 0; border: 1px solid var(--edge); border-radius: 18px; padding: clamp(17px, 3vw, 34px); background: var(--paper); }
article { display: flex; flex-direction: column; align-items: start; background: #f9f8f9; }
article p { flex: 1; }
.symbol { display: grid; place-items: center; width: 50px; height: 50px; background: #f5e8e9; color: var(--red); font: 750 1.45rem system-ui, sans-serif; border-radius: 13px; }
h2 { font-size: clamp(1.45rem, 2.6vw, 2.15rem); line-height: 1.15; margin: 0; }
article h2 { margin-top: 22px; }
.result { position: sticky; top: 20px; color: #282129; border: 1px solid #eedfe2; background: #fbf6f7; }
.result h2 { margin-bottom: 15px; }
.main-value { display: block; font: 700 clamp(2.1rem, 5vw, 4.2rem)/1.05 system-ui, sans-serif; color: var(--red); overflow-wrap: anywhere; }
dl { margin: 20px 0 0; }
dl div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-top: 1px solid #eadde0; }
dd { margin: 0; text-align: right; font-weight: 700; overflow-wrap: anywhere; }
dt { color: #5e5861; }
button, .button { display: inline-block; padding: 10px 15px; color: white; background: var(--red); border: 1px solid transparent; border-radius: 9px; text-decoration: none; font: inherit; font-weight: 700; cursor: pointer; }
button:hover, .button:hover { background: var(--rust); }
.secondary, .remove { background: #f5eff0; color: var(--red); border-color: #e9dfe1; }
.secondary:hover, .remove:hover { background: #efe3e6; }
fieldset { min-width: 0; margin: 0 0 22px; padding: 0 0 22px; border: 0; border-bottom: 1px solid var(--edge); }
legend { padding: 0; margin-bottom: 12px; font-size: 1.45rem; font-weight: 700; }
label { display: flex; flex-direction: column; gap: 5px; min-width: 0; font-size: .93rem; font-weight: 650; }
input, select { width: 100%; font: inherit; padding: 9px 10px; border: 1px solid #d8d2d6; background: #ffffff; border-radius: 9px; color: var(--ink); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #922e31 50%), linear-gradient(135deg, #922e31 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 25px; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.ingredient { margin: 0 0 12px; padding: 14px; background: #f9f8f9; border: 1px solid var(--edge); border-radius: 9px; }
.ingredient .remove { margin-top: 8px; }
.muted { color: #5e5861; margin: 10px 0; }
.guide { margin-top: 26px; max-width: 880px; }
.guide details, form details { margin-top: 14px; border-top: 1px solid var(--edge); padding-top: 12px; }
summary { color: var(--rust); cursor: pointer; font-weight: 700; }
.seo { background: #faf9fa; }
.seo h3 { font-size: 1.35rem; margin: 24px 0 8px; }
.seo p:last-child { margin-bottom: 0; }
footer { justify-content: space-between; margin-top: 32px; padding: 22px 0; border-top: 1px solid var(--edge); color: #5e5861; }
footer a { font-weight: 700; }
@media (max-width: 760px) {
  .wrap { width: calc(100% - 28px); }
  .cards, .layout { grid-template-columns: 1fr; }
  .result { position: static; order: -1; }
}
@media (max-width: 450px) {
  .bar { gap: 10px; }
  nav { gap: 12px; font-size: .875rem; }
  .brand { gap: 6px; }
  .brand-mark { width: 39px; height: 39px; }
  .brand-name { font-size: 1.03rem; }
}
@media (max-width: 375px) { .fields { grid-template-columns: 1fr; } }
.brand-mark { padding: 5px; background: #fbf3f3; border-radius: 13px; }
.subtotal, .subtotals { margin: 14px 0 0; font-weight: 650; }
.subtotal { display: flex; justify-content: space-between; gap: 12px; padding-top: 9px; border-top: 1px solid var(--edge); }
.subtotals div { border-color: var(--edge); }
.subtotals output, .subtotal output { color: var(--red); font-weight: 750; }

/* A narrow embroidery band keeps the calculator area clear. */
header::after,
footer::before {
  --stitch: #922e31;
  --thread: #bc716e;
  content: "";
  height: 16px;
  background-color: #fff8f7;
  background-image:
    conic-gradient(from 45deg, var(--stitch) 0 25%, transparent 0 50%, var(--stitch) 0 75%, transparent 0),
    conic-gradient(from 45deg, transparent 0 25%, var(--stitch) 0 50%, transparent 0 75%, var(--stitch) 0),
    conic-gradient(from 45deg, var(--thread) 0 25%, transparent 0 50%, var(--thread) 0 75%, transparent 0),
    conic-gradient(from 45deg, transparent 0 25%, var(--thread) 0 50%, transparent 0 75%, var(--thread) 0),
    linear-gradient(transparent 0 1px, #e9c6c3 1px 2px, transparent 2px 14px, #e9c6c3 14px 15px, transparent 15px);
  background-size: 32px 6px, 32px 6px, 16px 4px, 16px 4px, auto;
  background-position: center 2px, center 8px, center 4px, center 8px, center;
  background-repeat: repeat-x;
}
header::after { display: block; }
footer {
  position: relative;
  border-top: 0;
  padding-top: 34px;
}
footer::before {
  position: absolute;
  inset: 0 0 auto;
  opacity: .68;
}
