:root {
  color-scheme: light;
  --ink: #19241b; --muted: #49594d; --dark: #141e17; --lime: #d8f77c;
  --paper: #f5f7f2; --white: #fff; --line: #d9e1d7; --green: #2e532b;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img, svg { vertical-align: middle; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #498234; outline-offset: 4px; }
.sr-only, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip:focus { position: fixed; top: 10px; left: 10px; z-index: 10; background: var(--lime); padding: 10px 16px; }
.shell { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.site-header { background: var(--dark); color: #f4f7ef; border-bottom: 1px solid #354136; }
.header-inner, .footer-inner { display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.24rem; font-weight: 770; letter-spacing: -.055em; text-decoration: none; white-space: nowrap; }
.brand-icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 8px; background: var(--lime); color: #25371a; }
.brand-icon svg { width: 21px; height: 21px; }
.brand-accent { color: var(--lime); }
.site-header nav { display: flex; align-items: center; gap: clamp(12px, 3vw, 36px); }
.site-header nav a, .site-footer a { text-decoration: none; font-weight: 630; }
.site-header nav a { display: grid; min-height: 44px; align-items: center; font-size: .94rem; }
.site-header a:hover, .site-footer a:hover { text-decoration: underline; text-underline-offset: 5px; }
#open-quick-calculator {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid #91ac64; border-radius: 9px; color: var(--lime); background: #25382a;
}
#open-quick-calculator:hover { background: var(--lime); color: var(--dark); }
.quick-calculator {
  width: min(350px, calc(100% - 24px)); max-height: calc(100% - 24px); border: 1px solid #9eb19a;
  border-radius: 17px; padding: 16px; background: var(--paper); color: var(--ink); box-shadow: 0 20px 60px #0e180e66;
}
.quick-calculator:not([open]) { display: none; }
.quick-calculator::backdrop { background: #101b13a3; }
.quick-calculator-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.quick-calculator-header h2 { font-size: 1.28rem; }
.quick-calculator button { font-weight: 700; color: var(--ink); border: 1px solid #b7c5b2; border-radius: 8px; background: white; }
.quick-calculator button:hover { background: #e7efdf; }
.quick-calculator-header button { width: 44px; height: 44px; font-size: 1.35rem; }
.quick-calculator input {
  width: 100%; min-height: 50px; padding: 9px; border: 1px solid #8caa80; border-radius: 8px;
  background: #fff; color: var(--ink); text-align: end; font: 650 1.2rem var(--mono);
}
.quick-calculator input[aria-invalid="true"] { border-color: #b03532; }
.quick-calculator output { display: block; min-height: 32px; text-align: end; overflow-wrap: anywhere; font: 750 1.4rem var(--mono); color: var(--green); padding-top: 7px; }
#quick-error { margin: 0; color: #9c2222; font-size: .875rem; }
#quick-error:not(:empty) { margin-bottom: 7px; }
.quick-calculator-keys { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-top: 9px; }
.quick-calculator-keys button { min-height: 45px; }
.quick-calculator-keys button:nth-child(4n) { background: #e4eedb; }
.quick-calculator-keys button:nth-child(4n):hover { background: #d4e6c6; }
.quick-calculator-keys button[type="submit"] { background: var(--lime); border-color: #9bbb5e; }
.quick-calculator-keys button[type="submit"]:hover { background: #cbea6e; }

.hero { background: var(--dark); color: #f8fbf3; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 34px; min-height: 465px; padding-block: 55px; }
.hero-copy { min-width: 0; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 17px; color: var(--lime); font: 700 .82rem var(--mono); letter-spacing: .10em; }
.eyebrow span { width: 17px; height: 1px; background: currentColor; }
.hero h1 { margin: 0; font-size: clamp(2.85rem, 5.9vw, 5.25rem); font-weight: 780; letter-spacing: -.077em; line-height: .99; }
.hero h1 em { color: var(--lime); font-style: normal; }
.hero-description { margin: 20px 0 25px; max-width: 430px; font-size: 1.12rem; color: #d0ddce; }
.search-area { max-width: 480px; }
.search { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; background: white; color: var(--ink); border-radius: 11px; }
.search svg { flex-shrink: 0; width: 20px; color: var(--muted); }
.search input { width: 100%; min-width: 0; border: 0; padding: 9px 2px; background: white; color: var(--ink); }
.search input::placeholder { color: #5b665c; }
.search button { background: var(--lime); border: 0; font-weight: 770; border-radius: 7px; min-height: 43px; padding-inline: 17px; color: #1e2c16; }
.search button:hover { background: #c5ea60; }
.quick-search { display: flex; flex-wrap: wrap; margin-top: 10px; gap: 6px 8px; align-items: center; font-size: .875rem; color: #cfdbce; }
.quick-search span { margin-right: 3px; }
.quick-search button { background: transparent; color: #edf4e7; border: 1px solid #516354; border-radius: 20px; padding: 5px 11px; min-height: 33px; }
.quick-search button:hover { background: #324636; }
.hero :focus-visible, .site-header :focus-visible, .site-footer :focus-visible { outline-color: #b1db57; }
.search input:focus-visible { outline-color: #498234; outline-offset: 1px; }

.hero-art { min-width: 0; align-self: stretch; display: grid; align-items: center; }
.art-board {
  height: 312px; isolation: isolate; position: relative; overflow: hidden; border: 1px solid #465a47;
  border-radius: 22px; background-color: #203025;
  background-image: radial-gradient(circle, #426249 1px, transparent 1.5px);
  background-size: 17px 17px; background-position: center; box-shadow: inset 0 0 70px #122319a6;
}
.art-axis { position: absolute; opacity: .62; }
.axis-h { border-top: 1px dashed #628067; top: 54%; width: 100%; }
.axis-v { border-left: 1px dashed #628067; left: 57%; height: 100%; }
.art-ring { position: absolute; border: 1px solid #6f9677; border-radius: 100%; width: 220px; height: 220px; top: 14%; right: 12%; opacity: .56; }
.art-cross { position: absolute; right: 14%; top: 12%; color: #b9d5a9; font: 1.4rem var(--mono); }
.art-ruler { width: 59%; height: 56px; position: absolute; top: 52%; left: 10%; border: 1px solid #618365; border-radius: 6px; background: #a5d6a1; transform: rotate(-28deg); box-shadow: 0 13px 26px #0d170f90; color: #254331; }
.ruler-marks { height: 15px; margin-inline: 10px; background: repeating-linear-gradient(90deg, #284932 0 1px, transparent 1px 9px); background-size: auto 9px; background-repeat: no-repeat; border-top: 1px solid #739977; }
.ruler-numbers { display: flex; justify-content: space-between; padding-inline: 11px; font: 750 .83rem var(--mono); }
.art-calculator { position: absolute; top: 16%; left: 49%; width: 124px; padding: 11px; border-radius: 12px; transform: rotate(13deg); background: #d8f77c; border: 1px solid #ecffba; box-shadow: 0 15px 30px #0c170db8; }
.calc-screen { background: #263c24; color: #f1ffd7; padding: 8px 5px; border-radius: 5px; text-align: right; font: 700 1.32rem var(--mono); }
.calc-screen span { font-size: .75rem; }
.calc-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.calc-keys i { height: 13px; background: #6f953d; border-radius: 3px; }
.calc-keys i:nth-child(3n) { background: #3f5c30; }
.art-tile { position: absolute; left: 25%; top: 18%; display: grid; place-items: center; width: 52px; height: 52px; background: #e8dcad; color: #3c3d2e; border: 1px solid #fff1c4; border-radius: 10px; transform: rotate(-13deg); font: 800 1.7rem var(--mono); box-shadow: 0 8px 16px #0d170f88; }

.home-main { padding-block: 49px 80px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; margin-bottom: 20px; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.16; letter-spacing: -.045em; margin: 0; }
.section-heading p { margin: 0; color: var(--muted); font-size: .94rem; }
#tools-heading, #categories { scroll-margin-top: 20px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 21px; }
.filters button, .empty button { border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); font-size: .875rem; font-weight: 650; min-height: 39px; padding: 6px 13px; }
.filters button:hover, .empty button:hover { background: #e6eee0; }
.filters [aria-pressed="true"] { background: #284631; color: white; border-color: #284631; }
.filters [aria-pressed="true"]:hover { background: #385d40; }
.tool-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tool-card { display: flex; flex-direction: column; height: 100%; padding: 19px; min-height: 194px; background: white; border: 1px solid var(--line); border-radius: 13px; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.tool-card:hover { border-color: #809f79; box-shadow: 0 8px 20px #25402912; }
.card-top { display: flex; align-items: center; gap: 11px; margin-bottom: 13px; }
.tool-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; color: #285338; border-radius: 9px; background: #e5f2de; }
.tool-icon svg { width: 22px; height: 22px; }
.tool-icon[data-tone="finance"] { background: #e3ede9; color: #285847; }
.tool-icon[data-tone="construction"] { background: #f7ecd8; color: #714b24; }
.tool-icon[data-tone="home-improvement"] { background: #f1e8f4; color: #6b4574; }
.tool-icon[data-tone="measurement-conversion"] { background: #e5edf7; color: #2f5376; }
.tool-icon[data-tone="math"] { background: #f4efd9; color: #635213; }
.tool-icon[data-tone="automotive"] { background: #e7edf0; color: #345165; }
.tool-icon[data-tone="everyday-life"] { background: #f8ebdf; color: #734320; }
.card-category { color: var(--muted); font-size: .85rem; font-weight: 660; }
.tool-card h3 { font-size: 1.13rem; line-height: 1.28; margin: 0 0 5px; letter-spacing: -.025em; }
.tool-card p { color: var(--muted); margin: 0 0 12px; }
.card-action { font-size: .88rem; font-weight: 730; color: var(--green); margin-top: auto; }
.card-action svg, .category-grid a > svg { width: 16px; height: 16px; }
.empty { border: 1px dashed #9eae9c; padding: 26px; border-radius: 13px; text-align: center; }
.empty p { margin: 0 0 10px; }
.category-section { margin-top: 47px; }
.category-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.category-grid a { display: flex; align-items: center; gap: 11px; min-height: 64px; padding: 10px 12px; background: #eaf0e7; border: 1px solid var(--line); border-radius: 10px; font-weight: 690; text-decoration: none; }
.category-grid a:hover { background: #e2eddf; }
.category-grid a > svg { margin-left: auto; flex-shrink: 0; }
.category-grid .tool-icon { background: white; width: 35px; height: 35px; }

.interior { padding-block: 27px 75px; }
.breadcrumbs { margin-bottom: 27px; font-size: .9rem; color: var(--muted); }
.breadcrumbs ol { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; column-gap: 9px; }
.breadcrumbs li + li::before { content: "/"; padding-right: 9px; color: #687769; }
.breadcrumbs a { text-underline-offset: 3px; }
.page-intro { margin: 0 0 29px; }
.page-intro h1 { margin: 10px 0 9px; font-size: clamp(2.15rem, 6vw, 4rem); line-height: 1.03; letter-spacing: -.065em; }
.page-intro p { margin: 0; font-size: 1.12rem; color: var(--muted); }
.workbench { display: grid; grid-template-columns: 1.1fr .9fr; gap: 17px; align-items: start; }
.input-panel, .results-panel, .guide, .result-details { border: 1px solid var(--line); background: white; border-radius: 14px; padding: clamp(16px, 3vw, 26px); min-width: 0; }
.input-panel h2, .results-panel h2, .guide h2 { font-size: 1.55rem; margin-bottom: 19px; }
fieldset { border: 0; padding: 0; margin: 0; min-inline-size: 0; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { min-width: 0; }
.field label { display: block; font-weight: 680; margin-bottom: 5px; font-size: .93rem; }
.number-control { position: relative; }
.number-control span { position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; font-size: .875rem; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; border-radius: 8px; border: 1px solid #aebbad; background-color: #fbfcfa; color: var(--ink); padding: 8px 10px; }
.field-wide { grid-column: 1 / -1; }
.field textarea { display: block; resize: vertical; }
.field input { appearance: textfield; }
.field input::-webkit-inner-spin-button { appearance: none; }
.number-control:has(span) input { padding-inline-end: 64px; }
.field select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='m3 5 4 4 4-4' fill='none' stroke='%2349594d' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
.field-help, .field-error { margin: 5px 0 0; font-size: .875rem; }
.field-help { color: var(--muted); }
.field-error { color: #9c2222; font-weight: 640; }
.field [aria-invalid="true"] { border: 2px solid #b03532; }
.form-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 18px; }
.primary, .secondary { min-height: 45px; border-radius: 8px; padding: 8px 16px; font-weight: 710; }
.primary { background: #294d31; border: 1px solid #294d31; color: white; }
.primary:hover { background: #3b6840; }
.secondary { background: white; border: 1px solid #aebbad; color: var(--ink); }
.secondary:hover { background: #eef4eb; }
button:disabled { cursor: default; opacity: .68; }
.results-panel { background: #eaf2e5; border-color: #d1dfcd; }
.metrics { display: grid; gap: 8px; margin: 0; }
.metric { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 1px 10px; padding: 9px 11px; background: #f8fbf5; border: 1px solid #d6e3d1; border-radius: 8px; }
.metric:first-child { display: block; color: #eff9e7; background: #27452f; border-color: #27452f; padding: 13px; }
.metric dt { font-size: .91rem; font-weight: 650; }
.metric dd { margin: 0; font-weight: 770; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric:first-child dd { font-size: clamp(1.45rem, 4vw, 2.25rem); color: var(--lime); line-height: 1.25; letter-spacing: -.04em; }
.privacy-note, .result-note { color: var(--muted); margin: 15px 0 0; font-size: .9rem; }
.privacy-note svg, .site-footer p svg { width: 16px; height: 16px; margin-right: 4px; }
.result-details, .guide, .related { margin-top: 20px; }
.result-details summary { cursor: pointer; font-weight: 720; }
.result-details summary span { color: var(--muted); font-weight: 500; }
.table-scroll { overflow: auto; max-height: 440px; margin-top: 12px; }
table { border-collapse: collapse; min-width: max-content; width: 100%; font-variant-numeric: tabular-nums; text-align: right; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
thead th { background: #eaf2e5; position: sticky; top: 0; }
td:first-child, th:first-child { text-align: left; }
.guide { max-width: 780px; }
.guide h3 { margin-bottom: 4px; }
.guide p { margin: 0 0 13px; color: var(--muted); }
.guide p:last-child { margin-bottom: 0; }
.related { margin-top: 36px; }
.site-footer { color: #e1eadd; background: var(--dark); padding-block: 6px; }
.site-footer p { margin: 0; }
.footer-inner { flex-wrap: wrap; }
@media (max-width: 850px) {
  .tool-grid, .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .art-board { height: 275px; }
  .art-ring { width: 180px; height: 180px; }
  .workbench { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .shell { width: calc(100% - 32px); }
  .hero-inner { grid-template-columns: 1fr; padding-block: 40px 27px; gap: 24px; min-height: auto; }
  .hero h1 { font-size: clamp(2.6rem, 9.6vw, 3.8rem); }
  .art-board { height: 165px; }
  .art-ring { width: 125px; height: 125px; }
  .art-calculator { transform: scale(.72) rotate(13deg); transform-origin: top left; }
  .art-ruler { transform: rotate(-15deg); width: 47%; height: 40px; left: 18%; }
  .art-tile { transform: scale(.72) rotate(-13deg); left: 28%; top: 10%; }
  .home-main { padding-block: 31px 49px; }
  .footer-inner { padding-block: 15px; }
}
@media (max-width: 430px) {
  .header-inner { gap: 8px; }
  .site-header nav { gap: 9px; }
  .site-header nav a { font-size: .8rem; }
  .site-header .brand { font-size: 1.04rem; gap: 6px; }
  .site-header .brand-icon { width: 29px; height: 29px; }
  .tool-grid, .category-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 0; }
  .fields { grid-template-columns: 1fr; }
  .footer-inner { align-items: flex-start; flex-direction: column; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* Ad dimensions are reserved in the first HTML paint and shared with the provider element. */
.ad-slot { container-type: inline-size; padding-block: 18px; }
main > .ad-slot { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }
.ad-frame { text-align: center; }
.ad-label { display: block; color: var(--muted); font-size: .875rem; margin-bottom: 6px; visibility: hidden; }
.ad-frame[data-filled] .ad-label { visibility: visible; }
.ad-space { margin-inline: auto; width: min(100%, 320px); height: 100px; }
.ad-space > ins { display: block; width: 100%; height: 100%; }
@container (min-width: 468px) { .ad-space { width: 468px; height: 60px; } }
@container (min-width: 728px) { .ad-space { width: 728px; height: 90px; } }
.tool-primary { min-width: 0; }
.tool-ad-layout { display: grid; gap: 20px; align-items: start; }
.guide-content { margin-top: 20px; }
.guide-content .guide { margin-top: 0; }
@media (min-width: 1100px) {
  .tool-ad-layout { grid-template-columns: minmax(0, 1fr) 250px; }
  .tool-ad-layout .workbench { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
  .tool-ad-layout .fields { grid-template-columns: 1fr; }
  [data-ad-size="rail"] { padding-block-start: 0; }
  [data-ad-size="rail"] .ad-space { width: 250px; height: 250px; }
}
.partner-section { margin-top: 26px; }
.partner-section > p { color: var(--muted); margin-block: 8px 13px; }
.partner-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr)); gap: 12px; list-style: none; padding: 0; margin: 0; }
.partner-grid li { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.partner-grid h3 { margin: 0; font-size: 1.05rem; }
.partner-grid p { color: var(--muted); margin: 5px 0 10px; }
.partner-grid a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--green); }
.footer-links { display: flex; align-items: center; flex-wrap: wrap; gap: 15px; }
.privacy-button { border: 0; padding: 4px; background: transparent; color: inherit; text-decoration: underline; min-height: 44px; }
.privacy-dialog { width: min(440px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 22px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); }
.privacy-dialog::backdrop { background: #141e17a0; }
.privacy-dialog input { accent-color: var(--green); }
