:root {
  color-scheme: light;
  --ink: #18323a;
  --muted: #65777b;
  --teal: #0d7781;
  --teal-dark: #17505d;
  --orange: #e66d38;
  --sand: #f1eadc;
  --paper: #fffdf8;
  --line: #d8dfda;
  --shadow: 0 18px 48px rgba(20, 54, 62, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: linear-gradient(180deg, #eef5f2 0, #f8f5ed 48rem);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}

button, input { font: inherit; }

.site-header {
  min-height: 120px;
  padding: 12px clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(24, 50, 58, .12);
  background: rgba(255, 253, 248, .82);
  backdrop-filter: blur(12px);
}

.brand { display: flex; gap: 11px; align-items: center; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50% 46% 52% 42%; color: white; background: var(--teal-dark); font-weight: 800; font-size: 14px; transform: rotate(-4deg); }
.brand strong, .brand small { display: block; line-height: 1.1; }
.brand strong { font-size: 18px; }
.brand small { margin-top: 3px; color: var(--teal); font-size: 12px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.free-tool { color: var(--muted); font-size: 14px; }

main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.intro { padding: clamp(42px, 7vw, 82px) 0 30px; max-width: 780px; }
.eyebrow { margin: 0 0 8px; color: var(--orange); font-size: 13px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(38px, 6vw, 68px); line-height: 1.02; letter-spacing: -.045em; }
.intro > p:last-child { margin: 20px 0 0; color: var(--muted); font-size: clamp(17px, 2vw, 21px); max-width: 700px; }

.calculator { display: grid; grid-template-columns: minmax(300px, .82fr) minmax(420px, 1.18fr); border: 1px solid var(--line); border-radius: 24px; background: var(--paper); box-shadow: var(--shadow); overflow: hidden; }
.controls-panel { padding: clamp(24px, 4vw, 42px); border-right: 1px solid var(--line); }
.field-group + .field-group { margin-top: 26px; }
.field-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.field-heading label { font-weight: 700; }
.field-heading output { color: var(--teal); font-size: 13px; font-weight: 800; text-transform: uppercase; }
.number-row { display: flex; align-items: center; border: 1px solid #bdc9c5; border-radius: 10px; background: white; overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.number-row:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13, 119, 129, .14); }
.number-row input { min-width: 0; width: 100%; padding: 10px 12px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 18px; font-weight: 700; }
.unit { padding: 0 12px; color: var(--muted); white-space: nowrap; font-size: 13px; }
.slider { width: 100%; margin: 12px 0 0; accent-color: var(--teal); cursor: pointer; }
.error { margin: 18px 0 0; padding: 10px 12px; border-radius: 8px; color: #842d23; background: #fbe7e1; font-size: 14px; }

.result-card { margin-top: 30px; padding: 22px; border-radius: 16px; color: white; background: linear-gradient(135deg, var(--teal-dark), #0b7f83); }
.result-card > span { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.result-card strong { display: block; margin-top: 2px; font-size: clamp(44px, 7vw, 64px); line-height: 1.05; letter-spacing: -.04em; }
.result-card p { margin: 7px 0 0; opacity: .86; font-size: 14px; }
.actions { display: flex; gap: 10px; margin-top: 14px; }
button { min-height: 44px; padding: 0 18px; border: 1px solid var(--teal-dark); border-radius: 10px; color: white; background: var(--teal-dark); cursor: pointer; font-weight: 700; }
button:hover { background: #0d6873; }
button.secondary { color: var(--teal-dark); background: transparent; }
button.secondary:hover { background: #eaf3f1; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid rgba(230, 109, 56, .45); outline-offset: 2px; }

.visuals-panel { display: grid; grid-template-rows: 1fr 1fr; min-height: 650px; }
.diagram-card { display: flex; min-height: 0; padding: 25px 28px; flex-direction: column; }
.diagram-card + .diagram-card { border-top: 1px solid var(--line); }
.diagram-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; }
.diagram-heading span { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.diagram-heading h2 { margin: 1px 0 0; font-size: 22px; }
.legend { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.legend i { display: inline-block; width: 18px; height: 3px; margin-left: 8px; border-radius: 2px; }
.legend i:first-child { margin-left: 0; }
.dip-key { background: var(--orange); }
.section-key { background: var(--teal); }
.apparent-key { background: var(--orange); }
canvas { display: block; width: 100%; min-height: 225px; flex: 1; }

.explanation { display: grid; grid-template-columns: .75fr 1.25fr; gap: 32px 60px; margin: 70px 0; }
.explanation h2 { margin: 0; font-size: clamp(28px, 4vw, 42px); line-height: 1.12; letter-spacing: -.03em; }
.explanation > p { margin: 24px 0 0; color: var(--muted); font-size: 17px; }
details { grid-column: 2; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 700; }
details p { color: var(--muted); }
code { color: var(--teal-dark); font-size: 14px; }

footer { padding: 28px clamp(20px, 5vw, 72px); display: flex; justify-content: space-between; gap: 20px; color: var(--muted); border-top: 1px solid var(--line); font-size: 13px; }
.rockware-footer-link { margin-left:auto; display:inline-flex; align-items:center; border-radius:6px; background:white; overflow:hidden; }
.rockware-footer-link img { display:block; width:72px; height:72px; object-fit:cover; }
.main-footer-logo { padding:9px 12px; background:#173f4f; }
.main-footer-logo img { width:220px; height:auto; object-fit:contain; }
.main-footer { justify-content:center; }
.rockware-site-button { display:inline-flex; min-height:44px; padding:0 22px; align-items:center; justify-content:center; border:1px solid var(--teal-dark); border-radius:10px; color:white; background:var(--teal-dark); text-decoration:none; font-size:14px; font-weight:800; }
.rockware-site-button:hover { background:#0d6873; }
.rockware-site-button:focus-visible { outline:3px solid rgba(230,109,56,.45); outline-offset:2px; }

/* RockWare Widgets family hub */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.hub-page { background: #f7f4ec; }
.hub-page main { width: min(1240px, calc(100% - 40px)); }
.hub-page > .site-header { background:#173f4f; border-bottom-color:rgba(255,255,255,.13); }
.main-logo-link { display:inline-flex; align-items:center; }
.main-logo-link img { display:block; width:425px; height:auto; }
.tool-page > .site-header { background:#173f4f; border-bottom-color:rgba(255,255,255,.13); }
.tool-page > .site-header .back-link { color:rgba(255,255,255,.88); }
.tool-page > .site-header .back-link:hover { color:white; }
.hub-nav { display: flex; gap: 28px; }
.hub-nav a { color: rgba(255,255,255,.82); text-decoration: none; font-size: 14px; font-weight: 700; }
.hub-nav a:hover { color: white; }

.hub-hero { display: block; min-height: 0; padding: 42px 0 28px; }
.hero-copy { max-width: 1100px; }
.hero-copy h1 { font-size: clamp(38px, 5.4vw, 68px); white-space: nowrap; }
.hero-copy h1 span { color: var(--teal); }
.hero-copy > p:last-child { max-width: 900px; margin: 14px 0 0; color: var(--muted); font-size: 18px; }
.featured-widget { position: relative; min-height: 430px; padding: 34px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; border-radius: 30px; color: white; background: linear-gradient(145deg, #164d59, #0b747b); box-shadow: 0 26px 65px rgba(16, 73, 80, .25); text-decoration: none; transition: transform .25s ease, box-shadow .25s ease; }
.featured-widget:hover { transform: translateY(-5px); box-shadow: 0 32px 75px rgba(16, 73, 80, .3); }
.featured-label { align-self: flex-start; padding: 6px 11px; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.featured-widget p { margin: 0 0 3px; color: rgba(255,255,255,.68); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.featured-widget h2 { margin: 0; max-width: 330px; font-size: clamp(30px, 4vw, 44px); line-height: 1.05; letter-spacing: -.035em; }
.open-tool { display: inline-block; margin-top: 18px; font-size: 14px; font-weight: 800; }
.open-tool b, .card-action b { display: inline-block; margin-left: 5px; transition: transform .2s ease; }
.featured-widget:hover .open-tool b, .tool-card.available:hover .card-action b { transform: translateX(5px); }
.featured-compass { position: absolute; top: 45px; right: 30px; width: 220px; height: 220px; border: 1px solid rgba(255,255,255,.17); border-radius: 50%; }
.featured-compass::before, .featured-compass::after { content: ""; position: absolute; background: rgba(255,255,255,.12); }
.featured-compass::before { left: 50%; top: 0; width: 1px; height: 100%; }
.featured-compass::after { top: 50%; left: 0; width: 100%; height: 1px; }
.featured-compass i { position: absolute; color: rgba(255,255,255,.55); font-style: normal; font-size: 10px; font-weight: 800; }
.featured-compass .north { top: 8px; left: 50%; transform: translateX(-50%); }
.featured-compass .east { right: 9px; top: 50%; transform: translateY(-50%); }
.featured-compass .south { bottom: 8px; left: 50%; transform: translateX(-50%); }
.featured-compass .west { left: 9px; top: 50%; transform: translateY(-50%); }
.featured-compass b, .featured-compass em { position: absolute; left: 50%; top: 50%; height: 4px; border-radius: 5px; transform-origin: left center; }
.featured-compass b { width: 83px; background: #f18a58; transform: rotate(42deg); }
.featured-compass em { width: 95px; height: 3px; background: #8ad8d7; transform: rotate(-15deg); }

.tool-browser { padding: 22px 0 70px; border-top: 1px solid var(--line); }
.widget-controls { display:flex; justify-content:flex-end; }
.browser-heading { display: flex; justify-content: space-between; align-items: end; gap: 40px; }
.browser-heading h2 { margin: 0; font-size: clamp(36px, 5vw, 56px); line-height: 1.08; letter-spacing: -.04em; }
.browser-heading > div > p:last-child { margin: 12px 0 0; color: var(--muted); }
.search-box { width: min(340px, 100%); display: flex; align-items: center; padding: 0 15px; border: 1px solid #bdc9c5; border-radius: 12px; background: var(--paper); }
.search-box:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,119,129,.12); }
.search-icon { position: relative; width: 16px; height: 16px; flex: 0 0 auto; border: 2px solid var(--teal); border-radius: 50%; }
.search-icon::after { content: ""; position: absolute; width: 6px; height: 2px; right: -5px; bottom: -2px; background: var(--teal); transform: rotate(45deg); }
.search-box input { width: 100%; min-height: 50px; padding: 0 0 0 13px; border: 0; outline: 0; background: transparent; color: var(--ink); }
.category-filters { display: flex; gap: 8px; margin: 18px 0 22px; padding-bottom: 4px; overflow-x: auto; scrollbar-width: thin; }
.filter-button { min-height: 40px; flex: 0 0 auto; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: transparent; font-size: 13px; }
.filter-button:hover { color: var(--ink); background: white; }
.filter-button.active { color: white; border-color: var(--teal-dark); background: var(--teal-dark); }
.filter-button span { margin-left: 5px; opacity: .66; font-size: 11px; }
.tool-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tool-card { position: relative; min-height: 250px; padding: 22px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 17px; color: var(--ink); background: rgba(255,253,248,.7); text-decoration: none; }
.tool-card[hidden] { display: none; }
.tool-card.available { border-color: var(--teal); background: var(--paper); box-shadow: 0 12px 35px rgba(20,54,62,.1); transition: transform .2s, box-shadow .2s; }
.tool-card.available:hover { transform: translateY(-4px); box-shadow: 0 18px 42px rgba(20,54,62,.15); }
.card-topline { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.category-name { color: var(--card-accent); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.tool-status { padding: 4px 7px; border-radius: 5px; color: var(--muted); background: #efeee8; font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.available .tool-status { color: #17634d; background: #e0f1e9; }
.tool-symbol { width: 32px; height: 32px; margin: 20px 0 14px; display: grid; place-items: center; border-radius: 8px; color: var(--card-accent); background: color-mix(in srgb, var(--card-accent) 11%, white); }
.tool-symbol img { width:16px; height:16px; image-rendering:auto; }
.tool-card h3 { margin: 0; font-size: 20px; }
.tool-card p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.card-action { margin-top: auto; padding-top: 17px; color: var(--teal); font-size: 12px; font-weight: 800; }
.no-results { padding: 60px 20px; text-align: center; color: var(--muted); }

.hub-about { display: grid; grid-template-columns: .9fr 1.1fr; gap: 70px; margin-bottom: 90px; padding: 75px; border-radius: 26px; color: white; background: #193f4b; }
.hub-about h2 { margin: 0; font-size: clamp(38px, 5vw, 60px); line-height: 1.04; letter-spacing: -.04em; }
.about-copy > p:first-child { margin: 20px 0 28px; color: rgba(255,255,255,.76); font-size: 18px; }
.roadmap-note { padding-top: 22px; border-top: 1px solid rgba(255,255,255,.18); color: rgba(255,255,255,.68); font-size: 14px; }
.roadmap-note span { display: inline-grid; width: 28px; height: 28px; margin-right: 8px; place-items: center; border-radius: 50%; color: white; background: var(--orange); }

@media (max-width: 1000px) {
  .hero-copy h1 { white-space: normal; }
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 800px) {
  main { width: min(100% - 24px, 620px); }
  .calculator { grid-template-columns: 1fr; border-radius: 18px; }
  .controls-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .visuals-panel { min-height: 580px; }
  .explanation { grid-template-columns: 1fr; gap: 8px; margin: 50px 8px; }
  details { grid-column: 1; margin-top: 20px; }
  .hub-page main { width: min(100% - 24px, 680px); }
  .hub-hero { padding: 35px 0 24px; }
  .featured-widget { min-height: 390px; }
  .widget-controls { justify-content:stretch; }
  .search-box { width: 100%; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .hub-about { grid-template-columns: 1fr; gap: 25px; padding: 45px 35px; }
  .tool-intro,.application-intro { gap:20px; }
  .application-cartoon { width:150px; max-height:105px; }
  .amortization-toolbar { align-items:stretch; flex-direction:column; }
  .amortization-toolbar > div { flex-wrap:wrap; }
  .bayes-tree { grid-template-columns:1fr; }
}

@media (max-width: 500px) {
  .free-tool { display: none; }
  .site-header { min-height: 86px; }
  .intro { padding-top: 36px; }
  .diagram-card { padding: 20px 16px; }
  .diagram-heading { align-items: start; }
  .legend { max-width: 150px; flex-wrap: wrap; justify-content: end; }
  .actions button { flex: 1; padding-inline: 10px; }
  footer { flex-direction: column; }
  .hub-nav { gap: 16px; }
  .main-logo-link img { width:280px; }
  .hub-hero { min-height: auto; }
  .hero-copy h1 { font-size: 48px; }
  .featured-widget { min-height: 370px; padding: 26px; }
  .featured-compass { width: 190px; height: 190px; }
  .tool-browser { padding: 18px 0 55px; }
  .tool-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 240px; }
  .tool-symbol { margin-top: 22px; }
  .tool-intro,.application-intro { align-items:flex-start; }
  .application-cartoon { width:95px; max-height:80px; }
  .three-d-heading { align-items:flex-start; flex-direction:column; }
  .amortization-table th,.amortization-table td { padding:9px 10px; }
  .hub-about { margin-bottom: 60px; padding: 35px 25px; }
}

@media (prefers-reduced-motion: no-preference) {
  .result-card { transition: transform .2s ease; }
  .result-card.updated { transform: scale(1.012); }
}

/* Shared calculator pages */
.back-link { color: var(--teal-dark); text-decoration: none; font-size: 14px; font-weight: 800; }
.tool-page main { width: min(1100px, calc(100% - 40px)); }
.tool-intro { max-width:none; padding:45px 0 30px; display:flex; align-items:center; justify-content:space-between; gap:40px; }
.tool-intro-copy { max-width:820px; }
.tool-intro h1 { font-size: clamp(44px,7vw,72px); }
.tool-intro-copy > p:last-child { max-width: 680px; margin: 18px 0 0; color: var(--muted); font-size: 19px; }
.application-intro { max-width:none; display:flex; align-items:center; justify-content:space-between; gap:40px; }
.application-intro > div { max-width:780px; }
.application-intro > div > p:last-child { margin:20px 0 0; color:var(--muted); font-size:clamp(17px,2vw,21px); max-width:700px; }
.application-cartoon { width:min(230px,24vw); max-height:145px; flex:0 0 auto; object-fit:contain; mix-blend-mode:multiply; }
.universal-calculator { display:grid; grid-template-columns:.9fr 1.1fr; min-height:520px; overflow:hidden; border:1px solid var(--line); border-radius:24px; background:var(--paper); box-shadow:var(--shadow); }
.universal-inputs,.universal-results { padding:clamp(25px,4vw,45px); }
.universal-inputs { border-right:1px solid var(--line); }
.universal-inputs h2 { margin:0 0 24px; font-size:25px; }
.universal-field { position:relative; display:block; margin-bottom:18px; }
.universal-field > span { display:block; margin-bottom:7px; font-size:14px; font-weight:700; }
.universal-field input,.universal-field select,.universal-field textarea { width:100%; min-height:48px; padding:0 13px; border:1px solid #bdc9c5; border-radius:9px; color:var(--ink); background:white; outline:0; }
.universal-field textarea { min-height:142px; padding:11px 13px; resize:vertical; font:13px/1.45 Consolas,"Courier New",monospace; white-space:pre; }
.universal-field input:focus,.universal-field select:focus { border-color:var(--teal); box-shadow:0 0 0 3px rgba(13,119,129,.13); }
.universal-field small { position:absolute; right:13px; bottom:14px; color:var(--muted); pointer-events:none; }
.universal-results { display:flex; flex-direction:column; background:linear-gradient(145deg,#f4f8f5,#f6f0e5); }
.results-list { border-top:1px solid var(--line); }
.result-row { min-height:65px; display:flex; align-items:center; justify-content:space-between; gap:25px; border-bottom:1px solid var(--line); }
.result-row > span { color:var(--muted); font-size:13px; }
.result-row strong { text-align:right; font-size:21px; overflow-wrap:anywhere; }
.result-row strong small { margin-left:5px; color:var(--muted); font-size:12px; font-weight:600; }
.color-result { display:flex; align-items:center; gap:9px; }
.color-result i { width:30px; height:30px; border:1px solid rgba(0,0,0,.15); border-radius:50%; }
.result-placeholder { color:var(--muted); }
.tool-visual { min-height:135px; margin-top:auto; padding-top:25px; display:grid; place-items:center; }
.breakeven-chart-heading { width:100%; display:flex; align-items:center; justify-content:space-between; gap:16px; color:var(--ink); font-size:13px; }
.breakeven-chart-heading span { display:flex; align-items:center; gap:6px; color:var(--muted); font-size:11px; }
.breakeven-chart-heading i { width:18px; height:3px; margin-left:8px; border-radius:2px; }
.breakeven-chart-heading i:first-child { margin-left:0; }
.revenue-key { background:var(--teal); }
.cost-key { background:var(--orange); }
.breakeven-chart { display:block; width:100%; min-height:0; max-width:100%; }
.breakeven-axis-label { margin:-9px 0 0; color:var(--muted); font-size:11px; }
.three-d-heading { width:100%; display:flex; align-items:center; justify-content:space-between; gap:12px; font-size:13px; }
.three-d-heading span { color:var(--muted); font-size:11px; }
.three-d-canvas { display:block; width:100%; min-height:0; max-width:100%; border:1px solid var(--line); border-radius:10px; cursor:grab; touch-action:none; }
.three-d-canvas:active { cursor:grabbing; }
.view-reset { min-height:34px; margin-top:8px; padding:0 12px; font-size:11px; }
.simple-diagram { display:block; width:100%; min-height:0; max-width:100%; border:1px solid var(--line); border-radius:10px; }
.diagram-result-strip { width:100%; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; margin-top:10px; }
.diagram-result-strip span { min-width:0; padding:8px 10px; display:flex; align-items:baseline; justify-content:space-between; gap:8px; border:1px solid var(--line); border-radius:8px; background:rgba(255,253,248,.78); }
.diagram-result-strip small { overflow:hidden; color:var(--muted); font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.diagram-result-strip strong { color:var(--teal-dark); font-size:13px; white-space:nowrap; }
.geometry-visual { position:relative; width:145px; height:92px; border:3px solid var(--teal); transform:skewY(-8deg); }
.geometry-visual::before { content:""; position:absolute; inset:13px -19px -17px 20px; border:2px solid rgba(230,109,56,.65); }
.geometry-visual i { position:absolute; left:18px; bottom:-18px; width:2px; height:110px; background:var(--teal); transform:rotate(55deg); }
.geometry-visual b { position:absolute; left:50%; top:50%; color:var(--teal-dark); font-size:11px; transform:translate(-50%,-50%) skewY(8deg); }
.slope-visual { position:relative; width:85%; height:90px; border-bottom:2px dashed #aebbb6; }
.slope-visual i { position:absolute; left:8%; bottom:0; width:84%; height:5px; border-radius:4px; background:var(--orange); transform-origin:left center; }
.slope-visual b { position:absolute; right:5px; bottom:10px; color:var(--teal-dark); }
.conversion-visual { display:flex; align-items:center; gap:12px; color:var(--teal); }
.conversion-visual i { width:18px; height:45px; border-radius:4px; background:linear-gradient(var(--orange),var(--teal)); opacity:.65; }
.conversion-visual b { font-size:18px; }
.tool-notes { display:grid; grid-template-columns:.8fr 1.2fr; gap:60px; margin:70px 0; }
.tool-notes h2 { margin:0; font-size:36px; line-height:1.1; }
.tool-notes > div:last-child > p { margin-top:12px; color:var(--muted); font-size:17px; }
.tool-notes details { margin-top:25px; }
.product-promotion { display:flex; align-items:center; justify-content:space-between; gap:35px; margin:-25px 0 70px; padding:25px 30px; border:1px solid rgba(13,119,129,.25); border-radius:18px; background:linear-gradient(120deg,#edf5f1,#f7f1e5); box-shadow:var(--shadow); }
.product-promotion[hidden] { display:none; }
.product-promotion h2 { max-width:720px; margin:4px 0 8px; font-size:clamp(21px,3vw,29px); line-height:1.16; }
.product-promotion p:last-child { max-width:760px; margin:0; color:var(--muted); }
.product-promotion > a { flex:0 0 auto; padding:13px 18px; border-radius:9px; color:#fff; background:var(--teal-dark); font-weight:800; text-decoration:none; }
.product-promotion > a:hover { background:var(--teal); }
.legacy-help { grid-column:1 / -1; }
.tool-extra { margin:28px 0 10px; }
.amortization-panel { padding:0; overflow:hidden; border:1px solid var(--line); border-radius:18px; background:var(--paper); box-shadow:var(--shadow); }
.amortization-panel > summary { padding:20px 24px; border:0; cursor:pointer; font-size:17px; font-weight:800; }
.amortization-panel[open] > summary { border-bottom:1px solid var(--line); }
.amortization-toolbar { padding:16px 20px; display:flex; align-items:center; justify-content:space-between; gap:16px; background:#f2f5ef; }
.amortization-toolbar label { display:flex; align-items:center; gap:10px; font-size:13px; font-weight:700; }
.amortization-toolbar select { min-height:40px; padding:0 10px; border:1px solid #bdc9c5; border-radius:8px; background:white; }
.amortization-toolbar > div { display:flex; gap:8px; }
.amortization-toolbar button { min-height:38px; padding:0 12px; font-size:12px; }
.table-scroll { max-height:520px; overflow:auto; }
.amortization-table { width:100%; border-collapse:collapse; font-variant-numeric:tabular-nums; }
.amortization-table th,.amortization-table td { padding:10px 14px; border-bottom:1px solid var(--line); text-align:right; white-space:nowrap; }
.amortization-table thead th { position:sticky; top:0; color:white; background:var(--teal-dark); font-size:12px; }
.amortization-table th:first-child,.amortization-table td:first-child { text-align:center; }
.amortization-table tbody th { color:var(--teal-dark); }
.amortization-table tbody tr:nth-child(even) { background:#f7f4ec; }
.amortization-table .negative { color:#a23c2d; }
.amortization-table .positive { color:#17634d; }
.amortization-table .selected-row { outline:2px solid var(--orange); outline-offset:-2px; background:#fff4dd; }
.loan-chart-wrap { padding:14px 20px 4px; overflow-x:auto; border-bottom:1px solid var(--line); }
.loan-chart-wrap canvas { display:block; max-width:100%; }
.classification-table { width:100%; border-collapse:collapse; }
.classification-table th,.classification-table td { padding:13px; border:1px solid var(--line); text-align:center; }
.classification-table thead th { color:white; background:var(--teal-dark); }
.classification-table tbody th { color:var(--teal-dark); background:#f2f5ef; }
.classification-table .selected-rock { color:white; background:var(--orange); font-weight:800; }
.bayes-tree { padding:20px; display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
.bayes-tree div { padding:14px; border-radius:10px; background:#f2f5ef; }
.bayes-tree strong,.bayes-tree span { display:block; }
.bayes-tree span { margin:4px 0 9px; color:var(--teal-dark); font-size:22px; font-weight:800; }
.bayes-tree i { display:block; width:100%; height:8px; overflow:hidden; border-radius:5px; background:#d8dfda; }
.bayes-tree i::after { content:""; display:block; width:calc(var(--portion) * 100%); height:100%; background:var(--orange); }
.compact-extra { display:flex; justify-content:flex-end; }
.compact-extra button { min-height:38px; font-size:12px; }

/* Reference applications rebuilt from the established Delphi data */
.reference-application { margin-bottom:40px; border:1px solid var(--line); border-radius:22px; background:var(--paper); box-shadow:var(--shadow); overflow:hidden; }
.reference-toolbar,.geotime-toolbar { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:18px 22px; border-bottom:1px solid var(--line); background:#f2f5ef; }
.reference-toolbar label { display:flex; align-items:center; gap:12px; font-weight:700; }
.reference-toolbar input { width:260px; min-height:42px; padding:0 12px; border:1px solid #b9c7c1; border-radius:8px; }
.reference-toolbar > span { display:flex; align-items:center; gap:6px; color:var(--muted); font-size:11px; }
.reference-toolbar > span i { width:11px; height:11px; margin-left:7px; border-radius:2px; }
.state-solid{background:#e8e4d6}.state-liquid{background:#a8cced}.state-gas{background:#f4b0a6}.state-synthetic{background:#b5afc9}
.periodic-grid { display:grid; grid-template-columns:repeat(18,minmax(35px,1fr)); gap:4px; padding:22px; overflow-x:auto; }
.element-cell { position:relative; min-width:35px; min-height:50px; padding:5px 2px; border:1px solid #bac6c0; border-radius:5px; color:var(--ink); background:#e8e4d6; cursor:pointer; }
.element-cell small { position:absolute; left:4px; top:2px; font-size:7px; opacity:.7; }
.element-cell b { font-size:16px; }
.element-cell.gas{background:#f4b0a6}.element-cell.liquid{background:#a8cced}.element-cell.synthetic{color:white;background:#6f6983}.element-cell.selected{outline:3px solid var(--orange);outline-offset:1px}.element-cell.search-miss{opacity:.18}.series-placeholder{font-size:9px;color:var(--muted);background:#eee9dc}
.periodic-series { display:grid; grid-template-columns:95px repeat(15,minmax(35px,1fr)); gap:4px; padding:0 22px 22px; align-items:center; overflow-x:auto; }
.periodic-series > strong { font-size:11px; color:var(--muted); }
.element-details { display:grid; grid-template-columns:220px 1fr; gap:30px; padding:28px; border-top:1px solid var(--line); background:#f4f0e6; }
.element-identity { display:grid; grid-template-columns:42px 1fr; align-items:center; }
.element-identity > span { color:var(--muted); }
.element-identity strong { font-size:55px; line-height:1; color:var(--teal-dark); }
.element-identity h2 { grid-column:1/-1; margin:5px 0 0; font-size:26px; }
.element-details dl { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin:0; }
.element-details dl div { padding:9px 12px; border-radius:7px; background:rgba(255,255,255,.65); }
.element-details dl .wide { grid-column:span 3; }
.element-details dt,.time-details dt { color:var(--muted); font-size:10px; font-weight:700; text-transform:uppercase; }
.element-details dd,.time-details dd { margin:2px 0 0; font-weight:700; }

.geotime-toolbar { justify-content:flex-start; }
.geotime-layout { display:grid; grid-template-columns:minmax(340px,.8fr) 1.2fr; min-height:620px; }
.geotime-tree { max-height:720px; padding:12px; overflow:auto; border-right:1px solid var(--line); }
.time-entry { width:calc(100% - var(--level)*14px); min-height:38px; margin:0 0 3px calc(var(--level)*14px); padding:5px 9px; display:flex; align-items:center; justify-content:space-between; gap:10px; border:1px solid transparent; border-radius:6px; color:var(--ink); background:transparent; text-align:left; }
.time-entry:hover { color:var(--ink); background:#e9f2ef; }.time-entry.selected{color:white;background:var(--teal-dark)}.time-entry small{opacity:.65;font-size:9px;white-space:nowrap}
.time-scales { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; padding:24px; border-bottom:1px solid var(--line); }
.time-scales div { display:grid; gap:6px; }.time-scales b{font-size:12px}.time-scales small{color:var(--muted);font-size:9px}.time-scales i{position:relative;height:110px;border-radius:6px;background:linear-gradient(#d9e3dd,#eee9dc);overflow:hidden}.time-scales em{position:absolute;bottom:0;height:100%;background:var(--orange);opacity:.8}
.time-details { padding:30px; }.time-details h2{margin:0;font-size:36px}.time-details dl{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.time-details dl div{padding:10px;border-radius:7px;background:#f1eee5}.time-details li{margin-bottom:7px;color:var(--muted)}
@media(max-width:800px){.reference-toolbar{align-items:stretch;flex-direction:column}.reference-toolbar label{align-items:stretch;flex-direction:column}.reference-toolbar input{width:100%}.periodic-grid{grid-template-columns:repeat(18,42px)}.periodic-series{grid-template-columns:90px repeat(15,42px)}.element-details{grid-template-columns:1fr}.geotime-layout{grid-template-columns:1fr}.geotime-tree{max-height:430px;border-right:0;border-bottom:1px solid var(--line)}.time-scales{padding:15px}.time-details{padding:22px}}
@media(max-width:760px){.tool-page main{width:min(100% - 24px,620px)}.universal-calculator{grid-template-columns:1fr}.universal-inputs{border-right:0;border-bottom:1px solid var(--line)}.tool-notes{grid-template-columns:1fr;gap:15px}.product-promotion{align-items:flex-start;flex-direction:column;gap:18px}.tool-intro{padding-top:42px;gap:12px}.tool-intro-copy{min-width:0}.application-cartoon{width:min(76px,22vw)}}
@media(max-width:500px){.diagram-result-strip{grid-template-columns:1fr}.amortization-table th,.amortization-table td{padding:9px 10px}}

@media print {
  body.tool-page > header,body.tool-page main > :not(.tool-extra),body.tool-page > footer,.amortization-panel > summary,.amortization-toolbar { display:none !important; }
  body.tool-page main,.tool-extra { width:100%; margin:0; }
  .amortization-panel { border:0; box-shadow:none; }
  .table-scroll { max-height:none; overflow:visible; }
  .amortization-table thead th { position:static; color:#000; background:#ddd; }
}
