:root {
  --bg: #f8f8f3;
  --paper: #ffffff;
  --paper-soft: #fbfbf7;
  --ink: #111827;
  --text: #263142;
  --muted: #667085;
  --faint: #8b95a6;
  --line: #e1e6dc;
  --line-strong: #cbd6c3;
  --accent: #4a6516;
  --accent-dark: #32470b;
  --accent-soft: #eef3df;
  --amber: #87510c;
  --amber-soft: #fff7e6;
  --blue: #2f5f7f;
  --red: #b42318;
  --red-soft: #fff2f0;
  --green-soft: #edf7ed;
  --shadow: 0 20px 60px rgba(17, 24, 39, 0.08);
  --shadow-soft: 0 10px 30px rgba(17, 24, 39, 0.06);
  --radius: 8px;
  --radius-sm: 6px;
  --header-height: 72px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% -10%, rgba(183, 119, 22, 0.08), transparent 30rem),
    linear-gradient(180deg, #fbfbf7 0%, var(--bg) 42rem, #ffffff 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

img,
svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.shell {
  width: min(100% - 40px, 1280px);
  margin: 0 auto;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 1000;
  padding: 10px 14px;
  color: #fff;
  background: var(--ink);
  border-radius: var(--radius-sm);
  transform: translateY(-140%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 252, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.header-inner {
  min-height: var(--header-height);
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr) minmax(260px, 360px);
  align-items: center;
  gap: 26px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
  color: var(--accent-dark);
  font-weight: 800;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--accent);
}

.brand-svg {
  width: 42px;
  height: 42px;
}

.brand-svg-shell {
  fill: #f2f7e4;
  stroke: #8fa35c;
  stroke-width: 1.5;
}

.brand-svg-display,
.brand-svg-key,
.brand-svg-equals,
.brand-svg-corner {
  fill: none;
  stroke: currentColor;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-name-main {
  display: block;
  font-size: 1.22rem;
  line-height: 1;
  letter-spacing: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 700;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.active {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-color: #d8e6bd;
}

.tool-icon-svg {
  width: 22px;
  height: 22px;
  color: currentColor;
  stroke-width: 2.1;
}

.tool-icon-svg.nav {
  width: 17px;
  height: 17px;
}

.tool-icon-svg.tiny {
  width: 18px;
  height: 18px;
}

.tool-icon-svg.small {
  width: 21px;
  height: 21px;
}

.tool-icon-svg.hero {
  width: 42px;
  height: 42px;
}

.tool-search {
  position: relative;
}

.tool-search label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-weight: 660;
}

.header-search label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
}

.search-field input {
  width: 100%;
  height: 48px;
  padding: 0 48px 0 46px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 2px 0 rgba(17, 24, 39, 0.02);
  outline: none;
}

.search-field input:focus {
  border-color: #8ea74c;
  box-shadow: 0 0 0 4px rgba(74, 101, 22, 0.12);
}

.search-leading-icon {
  position: absolute;
  left: 15px;
  color: var(--muted);
}

.search-shortcut {
  position: absolute;
  right: 12px;
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  color: var(--muted);
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 650;
}

.search-results {
  position: absolute;
  inset: calc(100% + 8px) 0 auto 0;
  z-index: 30;
  display: none;
  max-height: 390px;
  overflow: auto;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.search-results.active {
  display: grid;
  gap: 4px;
}

.search-results a {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: start;
  gap: 10px;
  padding: 10px;
  border-radius: 7px;
}

.search-results a:hover,
.search-results a:focus-visible {
  background: var(--accent-soft);
}

.search-results strong {
  display: block;
  color: var(--ink);
  font-size: 0.96rem;
}

.search-results small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  line-height: 1.35;
}

.search-empty {
  margin: 0;
  padding: 10px;
  color: var(--muted);
}

.home-hero {
  padding: 62px 0 36px;
}

.home-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.home-primary,
.document-card,
.contact-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.home-primary {
  padding: clamp(28px, 5vw, 56px);
  text-align: center;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  line-height: 1.08;
  letter-spacing: 0;
}

.home-primary h1 {
  max-width: 940px;
  margin-inline: auto;
  font-size: clamp(3rem, 7vw, 5.7rem);
  font-weight: 760;
}

.lead {
  max-width: 900px;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 1.7vw, 1.35rem);
  line-height: 1.65;
}

.home-search {
  max-width: 860px;
  margin: 30px auto 0;
}

.home-search .search-field input {
  height: 64px;
  font-size: 1.08rem;
}

.category-chip-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.category-chip-grid button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-width: 178px;
  min-height: 46px;
  padding: 9px 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.03);
  text-align: left;
}

.category-chip-grid button:hover,
.category-chip-grid button:focus-visible {
  border-color: #a9bb75;
  box-shadow: 0 0 0 4px rgba(74, 101, 22, 0.1);
}

.category-chip-grid strong {
  min-width: 0;
  font-size: 0.94rem;
  font-weight: 640;
  line-height: 1.15;
}

.category-chip-grid em {
  justify-self: end;
  min-width: 20px;
  text-align: right;
  color: var(--muted);
  font-style: normal;
  font-weight: 650;
}

.section-band {
  padding: 34px 0 72px;
}

.library-band {
  padding-top: 10px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading h2 {
  font-size: clamp(1.7rem, 3vw, 2.35rem);
}

.calculator-groups {
  display: grid;
  gap: 18px;
}

.calculator-group {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 2px 18px rgba(17, 24, 39, 0.04);
}

.calculator-group-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.calculator-group-head h3 {
  font-size: 1.25rem;
}

.calculator-group-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.group-icon,
.tool-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid #d7e5bd;
  border-radius: 7px;
}

.group-icon {
  width: 42px;
  height: 42px;
}

.tool-icon.small,
.tool-icon.tiny {
  width: 36px;
  height: 36px;
}

.tool-icon.tiny {
  width: 30px;
  height: 30px;
}

.tool-icon.hero {
  width: 72px;
  height: 72px;
  color: var(--accent-dark);
  background: #f1f6df;
  border-color: #d1dfad;
}

.group-tool-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.group-tool,
.related-card {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  min-height: 104px;
  padding: 14px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.group-tool:hover,
.group-tool:focus-visible,
.related-card:hover,
.related-card:focus-visible {
  border-color: #aabd79;
  background: #fff;
  box-shadow: 0 10px 24px rgba(74, 101, 22, 0.08);
}

.group-tool strong,
.related-card strong {
  display: block;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.25;
}

.group-tool small,
.related-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.42;
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.94rem;
}

.breadcrumb a {
  color: var(--accent-dark);
  font-weight: 640;
}

.breadcrumb a:hover,
.breadcrumb a:focus-visible {
  text-decoration: underline;
}

.tool-page,
.page-shell {
  padding: 34px 0 78px;
}

.tool-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.tool-heading {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: start;
  gap: 18px;
  min-width: 0;
}

.tool-hero h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.7rem);
}

.tool-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.tool-trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tool-trust-row svg {
  color: var(--accent);
}

.tool-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.icon-button,
.secondary-button,
.primary-button,
.cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
}

.icon-button:hover,
.secondary-button:hover,
.icon-button:focus-visible,
.secondary-button:focus-visible {
  border-color: #aabd79;
  background: var(--accent-soft);
}

.icon-button.copied {
  color: var(--accent-dark);
  border-color: #aac06f;
  background: var(--accent-soft);
}

.primary-button {
  min-height: 46px;
  color: #fff;
  background-color: #293616;
  background-image: none;
  border-color: #293616;
  box-shadow: 0 6px 14px rgba(41, 54, 22, 0.12);
}

.primary-button:hover,
.primary-button:focus-visible {
  background-color: #1f2a11;
  background-image: none;
  border-color: #1f2a11;
}

.full-width {
  width: 100%;
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 282px;
  gap: 24px;
  align-items: start;
}

.tool-main {
  min-width: 0;
}

.calculator-surface {
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.calc-header {
  display: flex;
  align-items: start;
  justify-content: flex-start;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.calc-header h2 {
  font-size: 1.12rem;
}

.calc-header p {
  margin: 5px 0 0;
  color: var(--muted);
}

.calculator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.92fr);
  gap: 18px;
  align-items: stretch;
}

.calc-input-card,
.calc-result-card {
  min-width: 0;
  padding: 18px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.calc-form {
  display: grid;
  gap: 14px;
}

.calc-form label,
.contact-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
}

.calc-form input,
.calc-form select,
.calc-form textarea,
.contact-form input,
.contact-form textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  font-weight: 500;
}

.calc-form textarea,
.contact-form textarea {
  resize: vertical;
}

.calc-form input:focus,
.calc-form select:focus,
.calc-form textarea:focus,
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: #8fa952;
  box-shadow: 0 0 0 4px rgba(74, 101, 22, 0.12);
}

.input-row,
.fraction-grid,
.gpa-row,
.button-row {
  display: grid;
  gap: 12px;
}

.input-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fraction-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fraction-grid label:nth-child(3) {
  grid-column: 1 / -1;
}

.gpa-row {
  grid-template-columns: 1fr 150px 120px;
  align-items: end;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.button-row {
  grid-template-columns: 1fr 1fr;
}

.calc-keypad {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.calc-keypad button {
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-weight: 600;
}

.calc-keypad button:hover,
.calc-keypad button:focus-visible {
  border-color: #aabd79;
  background: var(--accent-soft);
}

.calc-keypad .key-op {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.calc-keypad .key-fn {
  color: var(--blue);
  background: #eef6fb;
}

.calc-keypad .key-eq {
  color: #fff;
  background: #293616;
  border-color: #293616;
}

.result-panel {
  position: relative;
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 186px;
  background:
    linear-gradient(135deg, rgba(255, 247, 230, 0.85), rgba(255, 255, 255, 0.96) 42%),
    #fff;
  border-color: #ead6ad;
}

.result-panel strong {
  color: var(--accent-dark);
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  line-height: 1.08;
}

.result-panel.result-success strong {
  font-size: clamp(1.7rem, 3vw, 2.45rem);
}

.result-panel span {
  color: var(--muted);
}

.result-lines {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.result-line,
.result-lines > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.result-line span:first-child,
.result-lines > div span:first-child {
  color: var(--muted);
}

.result-line span:last-child,
.result-line b,
.result-lines > div span:last-child,
.result-lines > div b,
.result-lines > div strong {
  color: var(--ink);
  font-weight: 700;
  text-align: right;
}

.result-panel.result-error {
  background: var(--red-soft);
  border-color: #f4b3ad;
}

.result-panel.result-error strong {
  color: var(--red);
  font-size: 1.2rem;
}

.copy-result-btn {
  position: absolute;
  right: 12px;
  top: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.copy-result-btn svg {
  width: 17px;
  height: 17px;
}

.copy-result-btn:hover,
.copy-result-btn:focus-visible,
.copy-result-btn.copied {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-color: #aabd79;
}

.mobile-tool-nav {
  display: none;
  gap: 8px;
  margin: 18px 0;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.mobile-tool-nav::-webkit-scrollbar {
  display: none;
}

.mobile-tool-nav a {
  flex: 0 0 auto;
  padding: 8px 11px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 640;
}

.mobile-tool-nav a.active {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-color: #cfe0aa;
}

.tool-side {
  position: sticky;
  top: calc(var(--header-height) + 18px);
}

.side-panel {
  display: grid;
  gap: 4px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.05);
}

.side-panel h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 680;
}

.side-panel a {
  display: block;
  padding: 8px 10px;
  color: var(--muted);
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  font-size: 0.92rem;
  font-weight: 560;
  line-height: 1.35;
}

.side-panel a:hover,
.side-panel a:focus-visible {
  color: var(--accent-dark);
  background: var(--paper-soft);
}

.side-panel a.active {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-left-color: var(--accent);
  font-weight: 700;
}

.content-stack {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.content-block {
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 2px 18px rgba(17, 24, 39, 0.04);
}

.content-block h2 {
  margin-bottom: 12px;
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
}

.content-block h3 {
  margin: 18px 0 8px;
  font-size: 1.1rem;
}

.content-block p,
.content-block li {
  color: var(--text);
}

.content-block p {
  margin: 0 0 13px;
}

.content-block p:last-child {
  margin-bottom: 0;
}

.content-block ul,
.content-block ol {
  margin: 12px 0 0;
  padding-left: 1.25rem;
}

.content-block a,
.prose a,
.contact-copy a {
  color: var(--accent-dark);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.content-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.related-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.content-block .related-card,
.content-block .related-card:hover,
.content-block .related-card:focus-visible,
.content-block .related-card *,
.content-block .related-card:hover *,
.content-block .related-card:focus-visible * {
  text-decoration: none;
}

.content-block .related-card {
  font-weight: 400;
}

.content-block .related-card small {
  font-weight: 400;
}

.related-card {
  position: relative;
  min-height: 132px;
  padding: 16px 36px 16px 16px;
  font-weight: 400;
}

.related-card::after {
  content: ">";
  position: absolute;
  right: 16px;
  bottom: 15px;
  color: var(--muted);
  font-weight: 650;
}

.related-card:hover::after,
.related-card:focus-visible::after {
  color: var(--accent-dark);
}

.faq-open {
  display: grid;
  gap: 16px;
}

.faq-item {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.faq-item:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.faq-item h3 {
  margin-top: 0;
}

.document-card {
  max-width: 920px;
  padding: clamp(24px, 5vw, 54px);
}

.document-hero {
  padding-bottom: 18px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.document-hero h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.prose {
  color: var(--text);
  font-size: 1.03rem;
}

.prose h2 {
  margin: 30px 0 10px;
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1.2;
}

.prose h3 {
  margin: 22px 0 8px;
  color: var(--ink);
  font-size: 1.15rem;
}

.prose p,
.prose li {
  color: var(--text);
}

.prose p {
  margin: 0 0 14px;
}

.prose ul,
.prose ol {
  margin: 12px 0 18px;
  padding-left: 1.25rem;
}

.contact-card {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1fr);
  gap: 26px;
  padding: clamp(22px, 4vw, 42px);
}

.contact-copy h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.contact-copy > p {
  max-width: 520px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.contact-note {
  margin-top: 28px;
  padding: 18px;
  background: var(--amber-soft);
  border: 1px solid #ead6ad;
  border-radius: var(--radius);
}

.contact-note h2 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.contact-note p {
  margin: 0;
}

.contact-form {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.notice {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-weight: 780;
}

.notice.success {
  color: #176234;
  background: var(--green-soft);
  border: 1px solid #b9dfc6;
}

.notice.error {
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid #f4b3ad;
}

.site-footer {
  padding: 42px 0 24px;
  background: #fff;
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.footer-logo {
  align-items: center;
}

.footer-section h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 0.95rem;
}

.footer-section ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-section a {
  color: var(--muted);
  font-size: 0.94rem;
}

.footer-section a:hover,
.footer-section a:focus-visible {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
  padding-top: 18px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
}

.footer-cookie-link {
  padding: 0;
  color: var(--accent-dark);
  background: transparent;
  border: 0;
  font-weight: 650;
}

.footer-cookie-link:hover,
.footer-cookie-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-consent {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  width: min(100% - 40px, 520px);
}

.cookie-bar,
.cookie-panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.cookie-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
}

.cookie-copy {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: start;
}

.cookie-mark {
  width: 32px;
  height: 32px;
  background:
    radial-gradient(circle at 62% 35%, #fff 0 3px, transparent 4px),
    radial-gradient(circle at 40% 62%, #fff 0 2px, transparent 3px),
    var(--accent);
  border-radius: 50%;
}

.cookie-copy h2,
.cookie-panel h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.cookie-copy p,
.cookie-panel p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.cookie-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.cookie-btn {
  min-height: 38px;
  padding: 0 12px;
  font-size: 0.9rem;
}

.cookie-btn.ghost {
  background: #fff;
}

.cookie-btn.primary {
  color: #fff;
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.cookie-panel {
  padding: 16px;
}

.cookie-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.cookie-close {
  width: 34px;
  height: 34px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  line-height: 1;
}

.cookie-options {
  display: grid;
  gap: 10px;
}

.cookie-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.cookie-choice strong {
  display: block;
  color: var(--ink);
}

.cookie-choice small {
  display: block;
  color: var(--muted);
}

.cookie-choice input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.cookie-actions.panel {
  justify-content: flex-end;
  margin-top: 4px;
}

@media (max-width: 1180px) {
  .header-inner {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .header-search {
    grid-column: 1 / -1;
    margin-bottom: 12px;
  }

  .site-header {
    position: static;
  }

  .group-tool-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .category-chip-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .category-chip-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-layout {
    grid-template-columns: 1fr;
  }

  .tool-side {
    display: none;
  }

  .mobile-tool-nav {
    display: flex;
  }

  .calculator-grid {
    grid-template-columns: 1fr;
  }

  .related-list,
  .group-tool-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-card {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px 22px;
  }

  .footer-brand,
  .footer-section:last-child {
    grid-column: 1 / -1;
  }

  .footer-section:last-child ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 18px;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 24px, 1280px);
  }

  .site-header {
    background: #fff;
  }

  .header-inner {
    min-height: 62px;
    gap: 12px;
  }

  .brand-mark,
  .brand-svg {
    width: 36px;
    height: 36px;
  }

  .brand-name-main {
    font-size: 1.05rem;
  }

  .site-nav {
    display: none;
  }

  .header-search {
    grid-column: 1 / -1;
    order: 2;
    margin: 0;
  }

  .home-hero {
    padding-top: 24px;
  }

  .home-primary {
    padding: 22px;
  }

  .home-primary h1,
  .document-hero h1,
  .contact-copy h1 {
    font-size: clamp(2.2rem, 11vw, 3.1rem);
  }

  .tool-hero h1 {
    font-size: clamp(2rem, 9vw, 2.55rem);
  }

  .lead {
    font-size: 1rem;
  }

  .home-search .search-field input {
    height: 56px;
  }

  .category-chip-grid,
  .group-tool-list,
  .related-list,
  .button-row,
  .input-row,
  .fraction-grid,
  .gpa-row {
    grid-template-columns: 1fr;
  }

  .category-chip-grid {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .category-chip-grid::-webkit-scrollbar {
    display: none;
  }

  .category-chip-grid button {
    flex: 0 0 auto;
    min-width: 132px;
    min-height: 40px;
    grid-template-columns: 20px auto auto;
    gap: 8px;
    padding: 8px 10px;
  }

  .category-chip-grid strong {
    font-size: 0.9rem;
  }

  .tool-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 16px;
  }

  .tool-heading {
    grid-template-columns: 48px 1fr;
    gap: 12px;
  }

  .tool-icon.hero {
    width: 48px;
    height: 48px;
  }

  .tool-icon-svg.hero {
    width: 28px;
    height: 28px;
  }

  .tool-actions {
    width: 100%;
  }

  .tool-actions .icon-button {
    flex: 1 1 0;
  }

  .calculator-surface,
  .content-block,
  .document-card,
  .contact-card {
    padding: 16px;
  }

  .calc-header {
    flex-direction: column;
  }

  .result-panel strong {
    padding-right: 40px;
    font-size: 1.75rem;
  }

  .cookie-consent {
    right: 12px;
    bottom: 12px;
    width: calc(100% - 24px);
  }

  .cookie-bar {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .cookie-copy {
    grid-template-columns: 26px 1fr;
  }

  .cookie-mark {
    width: 26px;
    height: 26px;
  }

  .cookie-actions.compact,
  .cookie-actions.panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
  }

  .cookie-actions.compact .cookie-btn,
  .cookie-actions.panel .cookie-btn {
    width: 100%;
    padding: 0 8px;
  }

  .cookie-actions.panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 460px) {
  .category-chip-grid button {
    grid-template-columns: 20px auto auto;
  }

  .group-tool,
  .related-card {
    grid-template-columns: 34px 1fr;
  }

  .category-chip-grid button em {
    grid-column: auto;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media print {
  .site-header,
  .site-footer,
  .tool-actions,
  .mobile-tool-nav,
  .cookie-consent,
  .copy-result-btn {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .shell {
    width: 100%;
  }

  .calculator-surface,
  .content-block,
  .tool-hero,
  .document-card,
  .contact-card {
    box-shadow: none;
  }
}
