/* Layout: inputs column on the left, live results/report on the right; stacks on phones.
   Light only, on purpose: it sits on MWC's white site. Black on white, one wine accent for the chart. */
#mwc-calc {
  --ink: #141414;
  --ink-2: #4a4846;
  --ink-3: #6f6b67;
  --paper: #ffffff;
  --wash: #f6f5f3;
  --rule: #e3e0dc;
  --wine: #7a2236;
  --good: #2f6b3a;
  --font: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-head: "Inter Tight", "Inter", "Helvetica Neue", Arial, sans-serif;

  color-scheme: light;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  max-width: 1180px;
  margin: 0 auto;
  padding-block: 32px 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  box-sizing: border-box;
  text-align: left;
}
#mwc-calc *, #mwc-calc *::before, #mwc-calc *::after { box-sizing: border-box; }
#mwc-calc h1, #mwc-calc h2, #mwc-calc h3, #mwc-calc p, #mwc-calc ul, #mwc-calc table { margin: 0; padding: 0; }
#mwc-calc h1, #mwc-calc h2, #mwc-calc h3 {
  font-family: var(--font-head); color: var(--ink); text-wrap: balance; letter-spacing: -0.01em; text-transform: none;
}
#mwc-calc .mwcc-num { font-variant-numeric: tabular-nums; }

/* Header */
#mwc-calc .mwcc-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 40px; align-items: center; margin-bottom: 40px; }
@media (max-width: 880px) { #mwc-calc .mwcc-top { grid-template-columns: minmax(0, 1fr); gap: 24px; margin-bottom: 32px; } }
#mwc-calc .mwcc-head { display: grid; gap: 10px; max-width: 760px; }

/* Side-by-side visual */
#mwc-calc .mwcc-vs { display: grid; gap: 14px; padding: 22px 24px 20px; background: var(--wash); border: 1px solid var(--rule); border-radius: 14px; }
#mwc-calc .mwcc-vs-kicker { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
#mwc-calc .mwcc-vs-cols { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: stretch; }
#mwc-calc .mwcc-vs-col { display: grid; grid-template-rows: auto auto auto 1fr auto; padding: 16px 16px 14px; background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; min-width: 0; }
#mwc-calc .mwcc-vs-col.is-winner { border-color: var(--good); box-shadow: 0 0 0 1px var(--good); }
#mwc-calc .mwcc-vs-name { font-family: var(--font-head); font-weight: 700; font-size: 15px; line-height: 1.25; margin-bottom: 10px; }
#mwc-calc .mwcc-vs-peak { font-family: var(--font-head); font-weight: 700; font-size: clamp(24px, 3.2vw, 34px); line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
#mwc-calc .mwcc-vs-col.is-full .mwcc-vs-peak { color: var(--wine); }
#mwc-calc .mwcc-vs-cap { font-size: 12.5px; color: var(--ink-2); margin-bottom: 12px; }
#mwc-calc .mwcc-vs-barbox { position: relative; height: 170px; border-bottom: 2px solid var(--ink); }
#mwc-calc .mwcc-vs-bar, #mwc-calc .mwcc-vs-ghost { position: absolute; left: 14%; right: 14%; bottom: 0; border-radius: 6px 6px 0 0; }
#mwc-calc .mwcc-vs-bar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
#mwc-calc .mwcc-vs-ghost { border: 2px dashed var(--good); border-bottom: 0; background: rgba(47, 107, 58, 0.06); display: flex; justify-content: center; padding-top: 10px; }
#mwc-calc .mwcc-vs-ghost[hidden] { display: none; }
#mwc-calc .mwcc-vs-ghost span { font-size: 12.5px; font-weight: 700; line-height: 1.25; color: var(--good); text-align: center; font-variant-numeric: tabular-nums; }
#mwc-calc .mwcc-vs-ghost span[hidden] { display: none; }
#mwc-calc .mwcc-vs-stats { display: grid; gap: 4px; margin: 12px 0 0; }
#mwc-calc .mwcc-vs-stats div { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
#mwc-calc .mwcc-vs-stats dt { color: var(--ink-3); margin: 0; }
#mwc-calc .mwcc-vs-stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
#mwc-calc .mwcc-vs-stats .mwcc-vs-total { font-size: 14px; padding-bottom: 4px; margin-bottom: 2px; border-bottom: 1px solid var(--rule); }
#mwc-calc .mwcc-vs-stats .mwcc-vs-total dt { color: var(--ink); font-weight: 500; }
#mwc-calc .mwcc-vs-stats .mwcc-vs-total dd { font-weight: 700; }
#mwc-calc .mwcc-vs-mid { align-self: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--paper); display: flex; align-items: center; justify-content: center; font: 700 12px/1 var(--font-head); text-transform: uppercase; letter-spacing: 0.04em; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
#mwc-calc .mwcc-vs-save { font-family: var(--font-head); font-size: clamp(17px, 2vw, 20px); font-weight: 600; line-height: 1.3; text-wrap: balance; }
#mwc-calc .mwcc-vs-save strong { color: var(--good); font-weight: 700; }
#mwc-calc .mwcc-vs-basis { font-size: 13px; color: var(--ink-3); margin-top: -8px; }
@media (max-width: 520px) {
  #mwc-calc .mwcc-vs { padding: 16px 14px; }
  #mwc-calc .mwcc-vs-cols { gap: 6px; }
  #mwc-calc .mwcc-vs-col { padding: 12px 10px; }
  #mwc-calc .mwcc-vs-name { min-height: 2.5em; }
  #mwc-calc .mwcc-vs-mid { width: 26px; height: 26px; font-size: 10px; }
  #mwc-calc .mwcc-vs-barbox { height: 130px; }
  #mwc-calc .mwcc-vs-bar, #mwc-calc .mwcc-vs-ghost { left: 8%; right: 8%; }
  #mwc-calc .mwcc-vs-stats div { flex-direction: column; gap: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  #mwc-calc .mwcc-vs-bar, #mwc-calc .mwcc-vs-ghost { transition: height .35s ease; }
}
#mwc-calc .mwcc-brand { font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); }
#mwc-calc h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.1; font-weight: 700; }
#mwc-calc .mwcc-lede { font-size: 17px; color: var(--ink-2); max-width: 62ch; }

#mwc-calc .mwcc-grid { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 40px; align-items: start; }
@media (max-width: 880px) { #mwc-calc .mwcc-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; } }

/* Inputs */
#mwc-calc .mwcc-form { display: grid; gap: 22px; }
#mwc-calc fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 12px; min-width: 0; }
#mwc-calc legend {
  padding: 0 0 8px; margin: 0; width: 100%; border-bottom: 1px solid var(--rule);
  font-family: var(--font-head); font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink);
}
#mwc-calc .mwcc-field { display: grid; gap: 4px; }
#mwc-calc .mwcc-field label { font-size: 14px; font-weight: 500; color: var(--ink); }
#mwc-calc .mwcc-inputwrap { display: flex; align-items: stretch; border: 1px solid #c9c5c0; border-radius: 6px; background: var(--paper); overflow: hidden; }
#mwc-calc .mwcc-inputwrap:focus-within { border-color: var(--ink); box-shadow: 0 0 0 2px rgba(20,20,20,0.15); }
#mwc-calc .mwcc-inputwrap input {
  flex: 1 1 auto; min-width: 0; width: 100%; border: 0; outline: 0; margin: 0; background: transparent; box-shadow: none;
  padding: 9px 10px; height: auto; font: 500 16px/1.2 var(--font); color: var(--ink); font-variant-numeric: tabular-nums;
}
#mwc-calc .mwcc-prefix { flex: 0 0 auto; display: flex; align-items: center; padding-left: 10px; margin-right: -6px; font: 500 16px/1.2 var(--font); color: var(--ink-2); }
#mwc-calc .mwcc-unit { flex: 0 0 auto; display: flex; align-items: center; padding: 0 10px; background: var(--wash); color: var(--ink-2); font-size: 13px; border-left: 1px solid var(--rule); white-space: nowrap; }
#mwc-calc .mwcc-help { font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }
#mwc-calc .mwcc-field.is-bad .mwcc-inputwrap { border-color: #b3261e; }
#mwc-calc .mwcc-field .mwcc-err { font-size: 12.5px; color: #b3261e; }

#mwc-calc button {
  font: 600 14px/1 var(--font); cursor: pointer; border-radius: 6px; padding: 11px 16px; margin: 0;
  border: 1px solid var(--ink); background: var(--paper); color: var(--ink); text-transform: none; letter-spacing: 0; box-shadow: none;
}
#mwc-calc button:hover { background: var(--wash); }
#mwc-calc button.mwcc-primary { background: var(--ink); color: var(--paper); }
#mwc-calc button.mwcc-primary:hover { background: #333; }
#mwc-calc button:focus-visible, #mwc-calc a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
#mwc-calc .mwcc-linkbtn { border: 0; padding: 0; background: none; text-decoration: underline; font-weight: 500; color: var(--ink-2); }
#mwc-calc .mwcc-linkbtn:hover { background: none; color: var(--ink); }

/* Results */
#mwc-calc .mwcc-results { display: grid; gap: 28px; min-width: 0; }

#mwc-calc .mwcc-tablewrap { overflow-x: auto; }
#mwc-calc table.mwcc-compare { width: 100%; border-collapse: collapse; font-size: 15px; }
#mwc-calc .mwcc-compare th, #mwc-calc .mwcc-compare td { padding: 11px 10px; border: 0; border-bottom: 1px solid var(--rule); text-align: right; vertical-align: top; background: none; }
#mwc-calc .mwcc-compare th:first-child, #mwc-calc .mwcc-compare td:first-child { text-align: left; padding-left: 0; color: var(--ink-2); font-weight: 400; }
#mwc-calc .mwcc-compare thead th { font-family: var(--font-head); font-size: 14px; font-weight: 700; color: var(--ink); border-bottom: 2px solid var(--ink); vertical-align: bottom; }
#mwc-calc .mwcc-compare thead th small { display: block; font-family: var(--font); font-weight: 400; font-size: 12px; color: var(--ink-3); }
#mwc-calc .mwcc-compare td { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
#mwc-calc .mwcc-compare td.is-better { color: var(--good); }
#mwc-calc .mwcc-compare td.is-better::after { content: " \2193"; font-weight: 400; }
#mwc-calc .mwcc-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }

#mwc-calc h2 { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
#mwc-calc h3 { font-size: 16px; font-weight: 700; }

/* Chart */
#mwc-calc .mwcc-chart { position: relative; }
#mwc-calc .mwcc-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
#mwc-calc .mwcc-legend span { display: inline-flex; align-items: center; gap: 6px; }
#mwc-calc .mwcc-legend i { display: inline-block; width: 16px; height: 2px; border-radius: 1px; }
#mwc-calc svg.mwcc-svg { display: block; width: 100%; height: auto; max-width: 100%; overflow: visible; touch-action: pan-y; }
#mwc-calc .mwcc-svg text { font-family: var(--font); fill: var(--ink-3); font-size: 11px; }
#mwc-calc .mwcc-svg text.mwcc-dl { fill: var(--ink); font-size: 12px; font-weight: 600; }
#mwc-calc .mwcc-tip {
  position: absolute; pointer-events: none; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.10); padding: 8px 10px; font-size: 13px; line-height: 1.45; min-width: 170px; z-index: 2;
}
#mwc-calc .mwcc-tip b { font-weight: 600; }
#mwc-calc .mwcc-tip .row { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
#mwc-calc .mwcc-caption { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
#mwc-calc details { border-top: 1px solid var(--rule); padding-top: 10px; }
#mwc-calc summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink); }
#mwc-calc table.mwcc-monthly { border-collapse: collapse; font-size: 13px; margin-top: 10px; width: 100%; }
#mwc-calc .mwcc-monthly th, #mwc-calc .mwcc-monthly td { padding: 5px 8px; border: 0; border-bottom: 1px solid var(--rule); text-align: right; font-variant-numeric: tabular-nums; background: none; }
#mwc-calc .mwcc-monthly th { font-weight: 600; color: var(--ink-2); }

/* Takeaways */
#mwc-calc ul.mwcc-takeaways { list-style: none; display: grid; gap: 12px; }
#mwc-calc .mwcc-takeaways li { padding-left: 18px; position: relative; max-width: 68ch; color: var(--ink); }
#mwc-calc .mwcc-takeaways li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 7px; height: 7px; background: var(--ink); border-radius: 50%; }

/* Contact */
#mwc-calc .mwcc-contact { display: grid; gap: 14px; padding: 24px; border: 1px solid var(--ink); border-radius: 10px; }
#mwc-calc .mwcc-contact p { color: var(--ink-2); max-width: 62ch; }
#mwc-calc .mwcc-person { display: grid; gap: 2px; font-size: 15px; }
#mwc-calc .mwcc-person strong { color: var(--ink); }
#mwc-calc .mwcc-person a { color: var(--ink); }
#mwc-calc .mwcc-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
#mwc-calc a.mwcc-btnlink { display: inline-block; font: 600 14px/1 var(--font); padding: 12px 16px; border-radius: 6px; background: var(--ink); color: var(--paper); text-decoration: none; }
#mwc-calc a.mwcc-btnlink:hover { background: #333; color: var(--paper); }
#mwc-calc .mwcc-status { font-size: 13px; color: var(--ink-2); min-height: 1em; overflow-wrap: anywhere; }
#mwc-calc button:disabled { opacity: 0.55; cursor: default; }

/* Save this plan */
#mwc-calc .mwcc-save { display: grid; gap: 10px; }
#mwc-calc .mwcc-save h2 { margin-bottom: 0; }
#mwc-calc .mwcc-saverow { display: flex; flex-wrap: wrap; gap: 10px; }
#mwc-calc .mwcc-saverow .mwcc-inputwrap { flex: 1 1 240px; }
#mwc-calc .mwcc-inputwrap input[type="text"], #mwc-calc .mwcc-inputwrap input[type="email"] { font-weight: 400; }
#mwc-calc ul.mwcc-plans { list-style: none; display: grid; }
#mwc-calc .mwcc-plans li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 16px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
#mwc-calc .mwcc-plans li:first-child { border-top: 1px solid var(--rule); }
#mwc-calc .mwcc-planname { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
#mwc-calc .mwcc-planacts { display: flex; gap: 14px; }

/* Email me my results */
#mwc-calc .mwcc-emailform { display: grid; gap: 12px; padding-top: 4px; }
#mwc-calc .mwcc-emailgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
#mwc-calc .mwcc-opt { font-weight: 400; color: var(--ink-3); }
#mwc-calc .mwcc-check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer; }
#mwc-calc .mwcc-check input { width: 18px; height: 18px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--ink); }
#mwc-calc .mwcc-help a { color: var(--ink-2); }
#mwc-calc .mwcc-help-cta { color: var(--ink-2); font-weight: 500; }
#mwc-calc .mwcc-help-cta a { color: var(--wine); font-weight: 600; }
#mwc-calc .mwcc-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
#mwc-calc .mwcc-person { border-top: 1px solid var(--rule); padding-top: 14px; }
#mwc-calc .mwcc-person > span:first-child { color: var(--ink-3); font-size: 13px; }

#mwc-calc .mwcc-fine { font-size: 12.5px; color: var(--ink-3); display: grid; gap: 6px; max-width: 80ch; }
#mwc-calc .mwcc-fine ul { padding-left: 18px; display: grid; gap: 4px; }

#mwc-calc .mwcc-print-only { display: none; }

@media (prefers-reduced-motion: no-preference) {
  #mwc-calc .mwcc-compare td { transition: color .2s; }
}

/* Print: the report */
@media print {
  @page { margin: 0.6in; }
  body * { visibility: hidden !important; }
  #mwc-calc, #mwc-calc * { visibility: visible !important; }
  #mwc-calc { position: absolute; left: 0; top: 0; width: 100%; max-width: none; padding: 0; font-size: 11pt; }
  #mwc-calc .mwcc-form, #mwc-calc .mwcc-no-print, #mwc-calc details, #mwc-calc .mwcc-tip { display: none !important; }
  #mwc-calc .mwcc-print-only { display: block; }
  #mwc-calc .mwcc-grid { display: block; }
  #mwc-calc .mwcc-results { gap: 18px; }
  #mwc-calc .mwcc-top { display: block; margin-bottom: 18px; }
  #mwc-calc .mwcc-vs { break-inside: avoid; background: none; padding: 12px 14px; }
  #mwc-calc .mwcc-vs-barbox { height: 120px; }
  #mwc-calc .mwcc-vs-bar, #mwc-calc .mwcc-vs-ghost { transition: none; }
  #mwc-calc .mwcc-chart, #mwc-calc .mwcc-contact, #mwc-calc table { break-inside: avoid; }
  #mwc-calc .mwcc-head { margin-bottom: 14px; }
  #mwc-calc .mwcc-lede { display: none; }
  #mwc-calc table.mwcc-inputs { width: 100%; border-collapse: collapse; font-size: 9.5pt; margin-bottom: 18px; columns: 2; }
  #mwc-calc .mwcc-inputs td { padding: 3px 6px; border-bottom: 1px solid var(--rule); }
  #mwc-calc .mwcc-inputs td:nth-child(2n) { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
  #mwc-calc .mwcc-inputs td:nth-child(3) { padding-left: 24px; }
}
