/* CalcFlow: Swiss minimalist aesthetic; consistent data-grid cards. */
:root {
  --cream: #f6f5ec;
  --paper: #ffffff;
  --ink: #14221c;
  --green: #0d392d;
  --green-mid: #204c3c;
  --lime: #d5f76b;
  --muted: #536256;
  --line: #cbd2c6;
  --error: #9d281b;
  --s1: 4px;
  --s2: 8px;
  --s3: 16px;
  --s4: 24px;
  --s5: 40px;
  --s6: 64px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 1.6; }
body, h1, h2, h3, p, a, nav, address, label, button, output { overflow-wrap: anywhere; }
div, section, article, aside, nav, form, header, footer, main, a, button, input, select, textarea { min-width: 0; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.08; letter-spacing: -0.045em; font-weight: 700; }
h1 { font-size: clamp(2.5rem, 5.7vw, 5rem); }
h2 { font-size: clamp(1.8rem, 3.1vw, 2.8rem); }
h3 { font-size: 1.65rem; }
p + p { margin-top: 16px; }
a { color: inherit; text-underline-offset: 5px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button { line-height: 1.3; }
button, input, textarea, select { max-width: 100%; }
button { border: 0; }
button:disabled { cursor: not-allowed; opacity: .65; }
:focus-visible { outline: 3px solid #806500; outline-offset: 4px; }
[hidden] { display: none !important; }
.container { width: min(1200px, calc(100% - 80px)); margin-inline: auto; }
main > section + section { margin-top: 64px; }
.skip-link { position: fixed; z-index: 200; top: 8px; left: 16px; padding: 16px; background: var(--lime); color: var(--green); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.site-header { height: 64px; padding-inline: 40px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 24px; border-bottom: 1px solid var(--line); background: var(--cream); color: var(--ink); position: relative; z-index: 20; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-size: .9rem; font-weight: 700; line-height: 1.1; }
.brand svg { flex: 0 0 32px; }
.brand span { min-width: 0; overflow-wrap: anywhere; }
.header-nav { display: flex; justify-content: center; align-items: center; gap: 24px; }
.header-nav a { font-size: .9rem; text-decoration: none; padding-block: 8px; }
.header-nav a:hover, .header-nav a[aria-current="page"] { text-decoration: underline; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 16px; padding: 16px 24px; min-height: 48px; background: var(--green); color: var(--paper); text-decoration: none; border: 1px solid var(--green); font-size: .95rem; font-weight: 700; line-height: 1.3; transition: background-color .18s, color .18s; text-align: center; }
.button:hover { background: var(--green-mid); color: var(--paper); }
.button.secondary { background: transparent; color: var(--green); border-color: #7d8c7d; }
.button.secondary:hover { background: #e6ebdd; color: var(--green); }
.button.compact { padding: 8px 16px; min-height: 40px; font-size: .8rem; }
.header-cta { justify-self: end; }
.menu-toggle { display: none; background: var(--green); color: white; padding: 8px; min-height: 36px; font-size: .8rem; }
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .85fr); gap: 64px; padding-top: 64px; padding-bottom: 40px; align-items: center; }
.hero-copy { display: grid; gap: 24px; }
.eyebrow { font-size: .7rem; letter-spacing: .14em; font-weight: 700; line-height: 1.5; }
.muted-heading { color: var(--muted); }
.lead { font-size: clamp(1.05rem, 1.7vw, 1.25rem); line-height: 1.6; max-width: 680px; color: #405044; }
.actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.text-link { font-size: .95rem; font-weight: 700; }
.small { font-size: .8rem; line-height: 1.6; color: var(--muted); }
.hero-art { background: var(--green); color: var(--cream); padding: 24px; display: grid; gap: 40px; }
.art-top, .art-bottom { display: flex; justify-content: space-between; gap: 24px; align-items: center; }
.art-top { font-size: .65rem; letter-spacing: .15em; }
.art-top > span:last-child { font-size: 2rem; color: var(--lime); }
.art-equation { display: grid; gap: 16px; font-size: clamp(2.4rem, 4.8vw, 4.6rem); font-variant-numeric: tabular-nums; letter-spacing: -.04em; line-height: 1; }
.art-operator { color: #b8cebe; }
.art-equation strong { color: var(--lime); border-top: 1px solid #6a8c79; padding-top: 24px; }
.art-label { display: block; font-size: .6rem; letter-spacing: .1em; margin-top: 16px; color: var(--cream); line-height: 1.6; }
.art-bottom { border-top: 1px solid #6a8c79; padding-top: 24px; font-size: .85rem; }
.art-bottom strong { font-size: 2rem; color: var(--lime); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 24px; }
.section-heading .eyebrow { margin-bottom: 16px; }
.section-heading > p { color: var(--muted); font-size: .9rem; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border: 1px solid var(--line); }
.input-panel { background: var(--paper); color: var(--ink); padding: 40px; display: flex; flex-direction: column; gap: 24px; }
.input-panel > label { font-weight: 700; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label { font-size: .9rem; font-weight: 700; }
input, select, textarea { width: 100%; padding: 16px; border: 1px solid #859080; border-radius: 0; background: #fff; color: var(--ink); line-height: 1.4; }
input::placeholder, textarea::placeholder { color: #627062; opacity: 1; }
textarea { resize: vertical; }
input[type="number"] { font-variant-numeric: tabular-nums; }
input[type="checkbox"] { width: 20px; height: 20px; flex: 0 0 20px; margin: 0; accent-color: var(--green); }
select { padding-right: 24px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.input-panel form { display: grid; gap: 24px; }
.currency-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.currency-fields > button { grid-column: 1 / -1; }
.calculate-button { width: 100%; }
.output-panel { padding: 40px; background: var(--green); color: var(--cream); display: flex; flex-direction: column; gap: 24px; }
.display-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.status-dot { font-size: .65rem; color: #d4e3d7; }
.status-dot::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--lime); color: var(--green); }
.number-display { display: grid; gap: 16px; }
.result-label { font-size: .9rem; color: #d4e3d7; }
.number-display output { display: block; font-size: clamp(2rem, 4.5vw, 4rem); line-height: 1.08; font-weight: 700; letter-spacing: -.04em; font-variant-numeric: tabular-nums; color: var(--lime); }
.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; border-top: 1px solid #658472; padding-top: 24px; }
.result-stat { display: flex; flex-direction: column; gap: 12px; }
.result-stat strong { font-size: 1.25rem; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.result-stat span { font-size: .75rem; color: #d4e3d7; }
.result-grid.is-updated { animation: result-appear .3s ease-out; }
@keyframes result-appear { from { opacity: .35; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.formula { padding: 16px; background: #184738; color: #e5eedf; font-size: .8rem; }
.keypad { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.keypad button { min-height: 48px; padding: 16px; font-size: 1.05rem; background: #285442; color: white; border: 1px solid #5f806d; transition: background-color .15s; }
.keypad button:hover { background: #3b6550; color: white; }
.keypad .key-equals { grid-column: span 2; background: var(--lime); color: var(--green); border-color: var(--lime); font-weight: 700; }
.keypad .key-equals:hover { background: #e0ff89; color: var(--green); }
.output-panel .small { color: #d4e3d7; }
.output-panel :focus-visible, .site-footer :focus-visible { outline-color: var(--lime); }
.history-panel { margin-top: 24px; padding: 40px; border: 1px solid var(--line); background: #eeefe5; color: var(--ink); }
.history-panel > .small { margin-top: 24px; }
.history-save { display: flex; align-items: end; gap: 24px; }
.history-save .field { flex: 1; }
.history-list { padding: 0; margin: 24px 0 0; list-style: none; display: grid; gap: 24px; }
.history-entry { background: white; color: var(--ink); padding: 24px; display: grid; gap: 24px; border: 1px solid var(--line); }
.history-entry-header { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.history-entry-header > div { display: grid; gap: 12px; }
.history-entry-header strong { font-size: 1.2rem; }
.history-entry-header span, .history-entry time { font-size: .75rem; color: var(--muted); }
.history-entry h4 { margin: 0; font-size: 1.05rem; }
.history-entry p { font-size: .85rem; }
.history-entry .button { padding: 8px 16px; font-size: .8rem; min-height: 40px; }
.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.guide-card { border: 1px solid var(--line); background: var(--paper); color: var(--ink); padding: 24px; display: flex; flex-direction: column; gap: 24px; }
.card-data { display: flex; justify-content: space-between; align-items: start; gap: 24px; border-bottom: 1px solid var(--line); padding-bottom: 24px; }
.card-data > div { display: flex; flex-direction: column; gap: 12px; }
.card-data strong { font-size: 2.25rem; font-weight: 400; letter-spacing: -.05em; line-height: 1; }
.card-data span { font-size: .65rem; color: var(--muted); line-height: 1.5; }
.card-data .card-index { font-size: .6rem; letter-spacing: .07em; text-align: right; }
.guide-card > p { font-size: .95rem; color: var(--muted); margin: 0; }
.guide-card > .text-link { margin-top: auto; }
.guide-card h2 { font-size: 1.65rem; }
.guide-card:hover { border-color: #80927f; }
.supporting-section { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 64px; border-top: 1px solid var(--line); padding-top: 64px; margin-bottom: 64px; }
.supporting-section .eyebrow { margin-bottom: 16px; }
.supporting-copy { font-size: 1.05rem; }
.supporting-copy .text-link { display: inline-block; margin-top: 24px; }
.site-footer { padding-block: 64px; background: var(--green); color: var(--cream); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr); gap: 64px; }
.footer-brand { display: inline-block; font-size: 1.15rem; font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.footer-grid > div > p { margin-top: 24px; }
.footer-grid > div > a:last-child { display: inline-block; margin-top: 24px; font-size: .85rem; }
.site-footer .small { color: #c5d7c8; }
.site-footer nav { display: flex; flex-direction: column; align-items: start; gap: 16px; }
.site-footer nav h2 { font-size: .85rem; letter-spacing: 0; margin-bottom: 8px; }
.site-footer nav a, .footer-cookie { font-size: .85rem; color: #d9e5d5; text-decoration: none; }
.site-footer nav a:hover { text-decoration: underline; }
.footer-cookie { background: transparent; color: #d9e5d5; padding: 0; text-align: left; text-decoration: underline; text-underline-offset: 4px; }
.article-main, .legal-main, .contact-main { padding-top: 64px; }
.article-hero { display: flex; flex-direction: column; align-items: start; gap: 24px; max-width: 900px; margin-bottom: 64px; }
.article-hero h1 { font-size: clamp(2.5rem, 5.4vw, 4.5rem); }
.article-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 64px; align-items: start; }
.article-body > section + section { margin-top: 64px; }
.article-body h2 { font-size: 1.8rem; margin-bottom: 24px; }
.article-body p { line-height: 1.85; color: #34473a; }
.article-body strong { color: var(--ink); }
.article-sidebar .guide-card { padding: 24px; }
.link-stack { display: flex; flex-direction: column; gap: 24px; font-size: .9rem; font-weight: 700; }
.next-guide { margin-top: 64px; margin-bottom: 64px; padding: 40px 0; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); }
.next-guide .eyebrow { margin-bottom: 16px; }
.legal-body { max-width: 850px; margin-bottom: 64px; }
.table-wrapper { overflow-x: auto; margin-block: 24px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
caption { padding: 16px; text-align: left; font-weight: 700; background: #e5ebde; color: var(--green); }
th, td { padding: 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
thead { background: var(--green); color: var(--cream); }
td { overflow-wrap: anywhere; }
tr:last-child td, tr:last-child th { border-bottom: 0; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 64px; }
.contact-form-panel { padding: 40px; background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.contact-form-panel > p { margin-block: 24px; color: var(--muted); }
.contact-form-panel form { display: flex; flex-direction: column; gap: 24px; }
.contact-details { display: flex; flex-direction: column; gap: 64px; }
.address-block h2 { font-size: 1.65rem; margin-bottom: 24px; }
address { font-style: normal; }
.address-block .small { margin-top: 24px; }
.static-map { border: 1px solid var(--line); }
.bristol-location-schematic { display: block; width: 100%; height: auto; }
.map-caption { padding: 24px; display: grid; gap: 12px; background: #e6ebdd; color: var(--green); }
.map-caption span { font-size: .75rem; }
.checkbox-label { display: flex; flex-wrap: wrap; align-items: start; gap: 8px; font-size: .9rem; }
.checkbox-label input { margin-top: 4px; }
.form-message, .notice { padding: 16px; background: #e9efdc; color: var(--green); border: 1px solid #98aa83; font-size: .9rem; }
.form-message.is-invalid { background: #fff0e9; color: var(--error); border-color: var(--error); }
input.is-invalid, textarea.is-invalid { border: 2px solid var(--error); background: #fffaf6; color: var(--ink); }
.field-error { color: var(--error); font-size: .8rem; }
.draft-actions { display: flex; flex-wrap: wrap; gap: 16px; }
.cookie-banner { position: fixed; z-index: 80; bottom: 16px; left: 16px; right: 16px; padding: 24px; max-width: 1200px; margin-inline: auto; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; align-items: center; border: 1px solid #81917d; box-shadow: 0 8px 32px #12251b26; background: var(--cream); color: var(--ink); max-height: 70dvh; overflow-y: auto; }
.cookie-banner p { margin-top: 8px; font-size: .8rem; }
.cookie-banner a { font-size: .75rem; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cookie-actions .button { flex: 1 1 120px; font-size: .75rem; padding: 16px; }
.cookie-dialog { max-width: 560px; width: calc(100% - 32px); padding: 24px; border: 1px solid #80927f; background: var(--cream); color: var(--ink); max-height: 85dvh; overflow-y: auto; }
.cookie-dialog::backdrop { background: #071f17b3; color: white; }
.cookie-dialog[open] { display: flex; flex-direction: column; gap: 24px; }
.cookie-dialog h2 { font-size: 1.8rem; }
.cookie-dialog p + p { margin: 0; }
@media (max-width: 1050px) {
  .site-header { padding-inline: 24px; }
  .container { width: calc(100% - 48px); }
  .hero { gap: 40px; }
  .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .input-panel, .output-panel, .history-panel, .contact-form-panel { padding: 24px; }
  .footer-grid, .article-layout, .contact-grid { gap: 40px; }
  .brand { font-size: .8rem; }
}
@media (max-width: 767px) {
  .site-header { height: 52px; padding-inline: 16px; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
  .brand { font-size: .72rem; }
  .brand svg { width: 24px; height: 24px; flex-basis: 24px; }
  .header-cta { padding: 8px !important; min-height: 36px !important; font-size: .65rem !important; gap: 4px; }
  .menu-toggle { display: block; }
  .header-nav { position: fixed; inset: 52px 0 0; background: var(--cream); color: var(--ink); padding: 40px 24px; flex-direction: column; align-items: start; justify-content: start; gap: 24px; visibility: hidden; pointer-events: none; overflow-y: auto; }
  .header-nav.is-visible { visibility: visible; pointer-events: auto; }
  .header-nav a { font-size: 2rem; }
  .container { width: calc(100% - 32px); }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 40px; padding-bottom: 0; }
  .hero-art { gap: 24px; }
  .art-equation { font-size: clamp(3rem, 11vw, 5rem); }
  .hero-copy h1 { font-size: clamp(2.5rem, 8vw, 4.2rem); }
  .section-heading { align-items: start; flex-direction: column; }
  .workspace, .article-layout, .contact-grid, .supporting-section { grid-template-columns: minmax(0, 1fr); }
  .output-panel { padding: 24px; }
  .number-display output { font-size: clamp(2rem, 9vw, 4rem); }
  .guide-grid { grid-template-columns: minmax(0, 1fr); }
  .supporting-section { gap: 24px; }
  .history-save { flex-direction: column; align-items: stretch; }
  .history-panel .actions { width: 100%; }
  .history-panel .actions .button { flex: 1; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 24px; }
  .footer-grid > div { grid-column: 1 / -1; }
  .article-main, .legal-main, .contact-main { padding-top: 40px; }
  .article-layout, .contact-grid { gap: 64px; }
  .article-sidebar { order: 1; }
  .next-guide { flex-direction: column; align-items: start; }
  .cookie-banner { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 16px; }
  .cookie-actions .button { flex-basis: 100px; padding: 16px 8px; }
  .contact-form-panel { padding: 24px; }
  .table-wrapper table { min-width: 560px; }
}
@media (max-width: 399px) {
  .site-header { gap: 4px; }
  .brand { font-size: .64rem; gap: 4px; }
  .brand svg { width: 20px; height: 20px; flex-basis: 20px; }
  .header-cta { font-size: .6rem !important; max-width: 80px; }
  .menu-toggle { font-size: .7rem; }
  .hero-copy h1, .article-hero h1 { font-size: 2.4rem; }
  .input-panel, .output-panel, .history-panel, .contact-form-panel { padding: 16px; }
  .field-grid { grid-template-columns: minmax(0, 1fr); }
  .guide-card { padding: 16px; }
  .article-sidebar .guide-card { padding: 16px; }
  .keypad button { padding: 16px 8px; font-size: .9rem; }
  .display-heading { flex-direction: column; align-items: start; gap: 8px; }
  .actions { align-items: stretch; }
  .actions > .button { width: 100%; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-grid > div { grid-column: auto; }
  .cookie-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cookie-actions > :last-child { grid-column: 1 / -1; }
  .history-entry { padding: 16px; }
  .history-entry-header { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}