:root {
  color-scheme: light;
  --ink: #1e2430;
  --muted: #687385;
  --line: #dde4ed;
  --paper: #ffffff;
  --surface: #f5f6f8;
  --sidebar-top: #252a70;
  --sidebar-bottom: #53147e;
  --sidebar-text: #eef1ff;
  --sidebar-muted: #aeb7d8;
  --cyan: #167f92;
  --red: #bd3d3a;
  --green: #25835f;
  --blue: #3756a6;
  --gold: #9a6a13;
  --shadow: 0 16px 40px rgba(30, 36, 48, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

h1,
h2,
p {
  margin-top: 0;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: 276px;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, var(--sidebar-top), var(--sidebar-bottom));
  color: var(--sidebar-text);
  box-shadow: 12px 0 30px rgba(31, 24, 86, 0.18);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 18px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--sidebar-text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 0;
  background: #e10808;
  color: #fff;
  font-size: 24px;
  font-weight: 900;
}

.brand strong {
  display: block;
  margin-bottom: 3px;
  font-size: 22px;
  line-height: 1.1;
}

.brand small {
  display: block;
  color: var(--sidebar-muted);
  font-size: 14px;
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
}

.menu-toggle-lines {
  display: grid;
  gap: 3px;
}

.menu-toggle-lines span {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.side-nav {
  display: grid;
  gap: 3px;
  padding: 12px 10px 22px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.34) transparent;
}

.nav-section {
  margin: 16px 12px 5px;
  color: rgba(238, 241, 255, 0.45);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-section:first-child {
  margin-top: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 7px 11px;
  border-radius: 7px;
  color: #d4daf1;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.2;
}

.nav-item span {
  display: grid;
  width: 34px;
  min-height: 24px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #bfc8e8;
  font-size: 11px;
  font-weight: 900;
}

.nav-item:hover,
.nav-item:focus-visible,
.nav-item.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.nav-item.active span {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.main-panel {
  min-height: 100vh;
  margin-left: 276px;
  padding: 20px clamp(18px, 3vw, 40px) 0;
}

.site-topbar {
  display: flex;
  justify-content: flex-end;
  max-width: 1280px;
  margin: 0 auto 12px;
}

.language-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.language-picker select {
  min-width: 148px;
  height: 36px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

.language-picker select:focus-visible {
  outline: 3px solid rgba(22, 127, 146, 0.22);
  outline-offset: 2px;
}

.page-hero,
.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: end;
  max-width: 1280px;
  margin: 0 auto 16px;
  padding: 12px 0 6px;
}

.breadcrumb {
  margin-bottom: 10px;
  color: #006dbe;
  font-size: 15px;
  font-weight: 800;
}

.breadcrumb a {
  color: #005aaf;
}

.eyebrow,
.tool-kicker,
.seo-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 820px;
  margin-bottom: 8px;
  font-size: 40px;
  line-height: 1.08;
  letter-spacing: 0;
}

.intro-copy {
  max-width: 800px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 17px;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.quick-stats div {
  padding: 18px 14px;
  border-left: 1px solid var(--line);
}

.quick-stats div:first-child {
  border-left: 0;
}

.quick-stats strong,
.quick-stats span {
  display: block;
}

.quick-stats strong {
  margin-bottom: 3px;
  font-size: 25px;
}

.quick-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  max-width: 1280px;
  margin: 0 auto;
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 1280px;
  margin: 0 auto;
}

.directory-categories {
  display: grid;
  gap: 28px;
  max-width: 1280px;
  margin: 0 auto;
}

.directory-section {
  display: grid;
  gap: 14px;
}

.directory-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.directory-section-heading h2 {
  margin: 0;
  font-size: 26px;
}

.directory-section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.compact-directory {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.directory-card {
  display: grid;
  gap: 10px;
  min-height: 190px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow);
}

.directory-card:hover,
.directory-card:focus-visible {
  border-color: #9eb5d2;
  transform: translateY(-1px);
}

.directory-card h2 {
  margin: 0;
  font-size: 24px;
}

.directory-card h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.directory-card p {
  margin: 0;
  color: var(--muted);
}

.directory-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: #e9eef7;
  color: #263271;
  font-weight: 900;
}

.placeholder-tool {
  display: grid;
  gap: 14px;
  max-width: 980px;
  margin: 0 auto;
  padding: 34px;
  border: 1px solid var(--line);
  border-left: 5px solid #3756a6;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.placeholder-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 8px;
  background: #e9eef7;
  color: #263271;
  font-weight: 900;
}

.placeholder-tool h2 {
  margin: 0;
  font-size: 28px;
}

.placeholder-tool p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.placeholder-link {
  width: fit-content;
  padding: 10px 14px;
  border-radius: 7px;
  background: #263271;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.interactive-tool {
  display: grid;
  gap: 16px;
  max-width: 980px;
  margin: 0 auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-left: 5px solid #3756a6;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.interactive-tool .result {
  margin-top: 2px;
}

.geometry-result-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.geometry-result-list span {
  display: block;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

.sudoku-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  width: min(100%, 540px);
  aspect-ratio: 1;
  border: 3px solid #263271;
  background: #263271;
}

.sudoku-grid input {
  min-height: 0;
  padding: 0;
  border: 1px solid #c8d1db;
  border-radius: 0;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
}

.sudoku-grid input:nth-child(3n) {
  border-right-color: #263271;
}

.sudoku-grid input:nth-child(n+19):nth-child(-n+27),
.sudoku-grid input:nth-child(n+46):nth-child(-n+54) {
  border-bottom-color: #263271;
}

.tool-card {
  scroll-margin-top: 22px;
  grid-column: span 6;
  display: flex;
  min-height: 410px;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.tool-card:first-child {
  grid-column: span 12;
  min-height: 290px;
}

.single-tool {
  max-width: 900px;
  min-height: auto;
  margin: 0 auto;
}

.loan-calculator {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px 8px 22px;
  border-top: 1px solid #d2d2d2;
  background: #e9e9e9;
}

.loan-calculator > h2 {
  margin: 0;
  padding: 0 0 16px;
  color: #4d5a66;
  font-size: 22px;
  text-align: center;
}

.loan-panel {
  margin: 0;
  padding: 20px 26px 16px;
  border-top: 1px solid #d2d2d2;
  background: #fff;
}

.loan-panel h3 {
  margin: 0 0 14px;
  color: #34495e;
  font-size: 18px;
}

.loan-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
  margin-bottom: 8px;
}

.loan-label {
  width: 150px;
  color: #354253;
  font-size: 15px;
  text-align: right;
}

.radio-field {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #344253;
  font-size: 15px;
}

.radio-field input {
  width: auto;
  min-height: 0;
  padding: 0;
}

.compact-input,
.rate-input,
.wide-select {
  min-height: 28px;
  padding: 3px 7px;
  border-radius: 0;
}

.compact-input {
  width: 150px;
}

.rate-input {
  width: 70px;
}

.wide-select {
  width: 220px;
}

.unit-label {
  color: #344253;
}

.loan-actions {
  display: flex;
  gap: 8px;
  margin: 12px 0 0 158px;
}

.loan-actions button {
  min-width: 88px;
  min-height: 38px;
  border-radius: 0;
  background: #f79500;
  color: #fff;
}

.loan-actions button.secondary {
  background: #f4f4f4;
  color: #444;
}

.loan-results {
  border-top: 1px solid #d0d0d0;
}

.loan-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 26px;
  margin-bottom: 10px;
}

.plain-output {
  display: block;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid #aeb4ba;
  background: #fff;
  color: #1f2933;
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

.amortization-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  background: #fff;
}

.amortization-table th,
.amortization-table td {
  padding: 10px 8px;
  border: 1px solid #aeb4ba;
  text-align: center;
}

.amortization-table th {
  background: #eeeeee;
  color: #c00000;
  font-weight: 800;
}

.amortization-table td {
  color: #344253;
}

.calculator-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  max-width: 980px;
  margin: 18px auto 28px;
  padding: 18px 0 24px;
  border-bottom: 1px solid #d2d6dd;
}

.calculator-title h1 {
  margin: 0;
  max-width: none;
  color: #333;
  font-size: 58px;
  font-weight: 400;
}

.calculator-badge {
  display: grid;
  grid-template-columns: repeat(4, 8px);
  gap: 5px;
  width: 72px;
  height: 72px;
  justify-content: center;
  align-content: center;
  border: 4px solid #b8b8b8;
  border-radius: 14px;
  background: linear-gradient(#eeeedf, #bfc2b9);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.8), 0 3px 5px rgba(0, 0, 0, 0.25);
}

.calculator-badge span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c4a56f;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.7);
}

.calculator-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 352px;
  margin: 0 auto 14px;
  overflow: hidden;
  border: 1px solid #00a8ee;
  border-radius: 7px;
}

.calculator-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #000;
  font-size: 16px;
}

.calculator-tabs button.active {
  background: #04acec;
  color: #fff;
}

.calculator-panel:not(.active) {
  display: none;
}

.classic-calculator {
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 14px 36px;
  border: 1px solid #b8c2cc;
  border-radius: 8px;
  background: linear-gradient(135deg, #ededed 0%, #ededed 52%, #dadada 52%, #d1d1d1 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 5px 0 #aaa;
}

.calculator-screen {
  width: 100%;
  height: 104px;
  margin-bottom: 26px;
  padding: 0 12px;
  border: 2px solid #c2c8c8;
  border-radius: 7px;
  background: #fffdeb;
  color: #303030;
  font-size: 64px;
  line-height: 104px;
  text-align: right;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.16);
}

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

.classic-keypad button,
.scientific-keypad button {
  min-height: 62px;
  border: 1px solid #9fa2a4;
  border-radius: 7px;
  background: linear-gradient(#f2f3f4, #d7d9dc);
  color: #5a6168;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95), 0 2px 2px rgba(0, 0, 0, 0.18);
  font-size: 30px;
  font-weight: 400;
}

.classic-keypad button.memory,
.scientific-keypad button.memory {
  color: #636a70;
}

.classic-keypad button.operator,
.scientific-keypad button.operator {
  border-color: #5a402b;
  background: linear-gradient(#8a6d50, #68492d);
  color: #fff;
  font-weight: 800;
}

.classic-keypad button.danger,
.scientific-keypad button.danger {
  border-color: #bb5d22;
  background: linear-gradient(#e68a46, #c65f18);
  color: #fff;
  font-weight: 800;
}

.classic-keypad button.equals,
.scientific-keypad button.equals {
  border-color: #202020;
  background: linear-gradient(#4b4b4b, #282828);
  color: #fff;
  font-weight: 800;
}

.scientific-calculator {
  max-width: 1040px;
}

.scientific-options {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px 18px;
  margin: 0 0 16px;
  color: #4d5963;
  font-size: 15px;
  text-align: center;
}

.scientific-options label {
  display: grid;
  justify-items: center;
  gap: 5px;
}

.scientific-options input {
  width: auto;
  min-height: 0;
  padding: 0;
}

.scientific-keypad {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 26px 22px;
}

.scientific-keypad button {
  min-height: 62px;
  padding: 0 8px;
  font-size: 28px;
}

.scientific-keypad button.function {
  border-color: #65727a;
  background: linear-gradient(#9aa4aa, #7b858c);
  color: #fff;
  font-weight: 800;
}

.scientific-keypad button.hex {
  background: linear-gradient(#ffffff, #d7dadd);
  color: #8a9095;
}

.scientific-keypad button.wide-fn {
  min-height: 62px;
  font-size: 28px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.accent-cyan {
  --accent: var(--cyan);
}

.accent-red {
  --accent: var(--red);
}

.accent-green {
  --accent: var(--green);
}

.accent-blue {
  --accent: var(--blue);
}

.accent-gold {
  --accent: var(--gold);
}

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

.tool-heading h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1.15;
  letter-spacing: 0;
}

.tool-title {
  margin: 0;
  color: var(--ink);
  font-size: 25px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0;
}

.tool-icon {
  display: grid;
  min-width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, white);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 11%, white);
  color: var(--accent);
  font-size: 15px;
  font-weight: 900;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field.wide {
  grid-column: 1 / -1;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #c8d1db;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

input:focus,
select:focus {
  border-color: var(--accent, #17324d);
  outline: 3px solid color-mix(in srgb, var(--accent, #17324d) 18%, transparent);
}

.hint {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--accent, #17324d);
  border-radius: 7px;
  background: var(--accent, #17324d);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

button:hover {
  filter: brightness(0.95);
}

button.secondary,
.segmented button {
  background: #fff;
  color: var(--ink);
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(88px, 1fr));
  width: min(100%, 240px);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf1f5;
}

.segmented button {
  min-height: 36px;
  border-color: transparent;
}

.segmented button.active {
  background: var(--accent);
  color: #fff;
}

.result-stack {
  display: grid;
  gap: 6px;
}

.result {
  display: block;
  overflow-wrap: anywhere;
  padding: 16px;
  border-radius: 8px;
  background: #f0f4f8;
  color: var(--ink);
  font-size: 26px;
  font-weight: 900;
  line-height: 1.2;
}

.mini-result {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.geometry-result {
  display: grid;
  gap: 7px;
  font-size: 20px;
}

.sudoku-library-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.sudoku-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.sudoku-card h3 {
  margin: 0;
  font-size: 18px;
}

.sudoku-card code {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.sudoku-card a {
  width: fit-content;
  color: var(--accent, #17324d);
  font-weight: 800;
}

.hidden {
  display: none;
}

.seo-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 1220px;
  margin: 24px auto 0;
}

.seo-layout.single-column {
  grid-template-columns: 1fr;
  max-width: 980px;
}

.seo-card {
  scroll-margin-top: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.seo-card h2 {
  margin-bottom: 12px;
  font-size: 24px;
  line-height: 1.2;
}

.seo-card p {
  color: var(--muted);
}

.seo-card p:last-child {
  margin-bottom: 0;
}

.faq-card {
  display: grid;
  gap: 12px;
}

.faq-card details {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.faq-card summary {
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.faq-card details p {
  margin: 10px 0 0;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1220px;
  margin: 26px auto 0;
  padding: 22px 0 28px;
  color: var(--muted);
  font-size: 14px;
}

.footer p {
  margin: 0;
}

@media (max-width: 980px) {
  .sidebar {
    position: sticky;
    top: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
    max-height: none;
    overflow: visible;
  }

  .brand {
    min-width: 0;
    padding: 10px 12px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }

  .brand strong {
    font-size: 19px;
  }

  .brand small {
    font-size: 12px;
  }

  .menu-toggle {
    display: inline-flex;
    align-self: center;
    justify-self: end;
    margin-right: 12px;
    padding: 8px 10px;
  }

  .side-nav {
    display: none;
    grid-column: 1 / -1;
    gap: 8px;
    max-height: calc(100vh - 84px);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 12px 14px;
  }

  .sidebar.menu-open .side-nav {
    display: grid;
  }

  .nav-section {
    display: block;
    margin: 14px 7px 4px;
  }

  .nav-item {
    min-height: 40px;
    font-size: 14px;
  }

  .main-panel {
    margin-left: 0;
    padding-top: 10px;
  }

  .site-topbar {
    margin-bottom: 8px;
  }

  .hero-panel,
  .page-hero,
  .seo-layout {
    grid-template-columns: 1fr;
  }

  .sudoku-library-list {
    grid-template-columns: 1fr;
  }
}

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

  .brand {
    gap: 9px;
    padding: 9px 10px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }

  .brand strong {
    font-size: 17px;
  }

  .brand small {
    font-size: 11px;
  }

  .menu-toggle {
    margin-right: 10px;
    padding: 7px 9px;
    font-size: 13px;
  }

  .side-nav {
    max-height: calc(100vh - 62px);
  }

  .main-panel {
    padding-top: 8px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .site-topbar {
    justify-content: flex-end;
    margin-bottom: 8px;
  }

  .language-picker {
    flex-direction: row;
    gap: 6px;
    font-size: 12px;
  }

  .language-picker select {
    width: auto;
    min-width: 112px;
    height: 30px;
    padding-right: 26px;
  }

  h1 {
    font-size: 30px;
  }

  .page-hero,
  .hero-panel {
    gap: 10px;
    margin-bottom: 12px;
    padding: 6px 0 2px;
  }

  .breadcrumb {
    margin-bottom: 6px;
    font-size: 13px;
  }

  .intro-copy {
    font-size: 15px;
  }

  .interactive-tool {
    gap: 14px;
    padding: 16px;
    border-left-width: 4px;
  }

  .geometry-result-list {
    grid-template-columns: 1fr;
  }

  .button-row,
  .loan-actions {
    display: grid;
    grid-template-columns: 1fr;
    margin-left: 0;
  }

  .button-row button,
  .loan-actions button {
    width: 100%;
    min-height: 44px;
  }

  input,
  select {
    min-height: 42px;
  }

  .loan-calculator {
    padding: 12px 6px 18px;
  }

  .loan-calculator > h2 {
    padding-bottom: 10px;
    font-size: 20px;
  }

  .loan-panel {
    padding: 16px 14px;
  }

  .loan-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    margin-bottom: 12px;
  }

  .loan-label {
    width: auto;
    text-align: left;
  }

  .compact-input,
  .rate-input,
  .wide-select {
    width: 100%;
    border-radius: 6px;
  }

  .loan-summary-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .quick-stats {
    grid-template-columns: 1fr;
  }

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

  .compact-directory {
    grid-template-columns: 1fr;
  }

  .calculator-title {
    gap: 12px;
    justify-content: flex-start;
  }

  .calculator-title h1 {
    font-size: 36px;
  }

  .calculator-badge {
    width: 54px;
    height: 54px;
    grid-template-columns: repeat(4, 6px);
    gap: 4px;
  }

  .calculator-badge span {
    width: 6px;
    height: 6px;
  }

  .classic-calculator {
    padding: 14px 10px 22px;
  }

  .calculator-screen {
    height: 74px;
    margin-bottom: 18px;
    font-size: 40px;
    line-height: 74px;
  }

  .classic-keypad {
    gap: 10px 8px;
  }

  .classic-keypad button,
  .scientific-keypad button {
    min-height: 50px;
    padding: 0 6px;
    font-size: 20px;
    line-height: 1.1;
    overflow-wrap: anywhere;
  }

  .classic-keypad button[data-short],
  .scientific-keypad button[data-short] {
    font-size: 0;
  }

  .classic-keypad button[data-short]::after,
  .scientific-keypad button[data-short]::after {
    content: attr(data-short);
    font-size: 20px;
    line-height: 1;
  }

  .scientific-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    font-size: 13px;
  }

  .scientific-keypad {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .scientific-keypad button.wide-fn {
    font-size: 20px;
  }

  .quick-stats div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .quick-stats div:first-child {
    border-top: 0;
  }

  .tool-card,
  .tool-card:first-child {
    grid-column: 1 / -1;
    min-height: auto;
    padding: 18px;
  }

  .tool-heading {
    align-items: center;
  }

  .tool-heading h2 {
    font-size: 22px;
  }

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

  .loan-calculator {
    padding: 14px 0 20px;
  }

  .loan-panel {
    padding: 18px 14px;
  }

  .loan-label {
    width: 100%;
    text-align: left;
  }

  .loan-actions {
    margin-left: 0;
  }

  .compact-input,
  .wide-select {
    width: min(100%, 260px);
  }

  .loan-summary-grid {
    grid-template-columns: 1fr;
  }

  .result {
    font-size: 22px;
  }

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