:root {
  color-scheme: dark;
  --ink: #202b35;
  --muted: #596b79;
  --blue: #147fc1;
  --blue-bright: #168bd2;
  --panel: #e8eef2;
  --panel-raised: #f2f5f7;
  --line: #cbd6de;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: #273744; color: var(--ink); font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif; }
.page-shell { position: relative; display: grid; min-height: 100vh; place-items: center; overflow: hidden; padding: 32px 18px; background: radial-gradient(ellipse at 12% 18%, #466477 0, transparent 36%), radial-gradient(ellipse at 90% 82%, #3b5262 0, transparent 34%), #273744; }
.page-content { position: relative; z-index: 1; display: grid; width: min(100%, 980px); gap: 12px; }
.app-stack { position: relative; z-index: 1; display: grid; width: min(100%, 980px); gap: 26px; }
.calculator { position: relative; width: 100%; padding: 36px 42px 22px; border: 1px solid #c5d2dc; border-radius: 12px; background: linear-gradient(145deg, #e4ebf0, #d9e2e9); box-shadow: 0 28px 85px #0008; }
.page-heading { text-align: center; }
h1 { margin: 0; color: #f2f6f8; text-align: center; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif; font-size: clamp(32px, 6vw, 42px); font-weight: 700; line-height: 1.08; letter-spacing: -.035em; text-transform: uppercase; }
h1 span { color: var(--blue-bright); }
.intro { max-width: 800px; margin: 11px auto 0; color: #d5e0e8; font-size: 13px; line-height: 1.6; text-align: center; }
.privacy-note { max-width: 800px; margin: 0 auto; color: #c3d0d8; font-size: 11px; line-height: 1.5; text-align: center; }
.calculator-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 20px; align-items: stretch; }
.controls { display: grid; gap: 12px; padding: 0; border: 0; background: transparent; }
.attribute-card { padding: 23px; border: 1px solid var(--line); border-radius: 9px; }
.attribute-card { background: linear-gradient(145deg, #f4f7f9, #eaf0f4); }
label { display: block; margin-bottom: 9px; color: #263746; font-size: 12px; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; }
select { width: 100%; height: 48px; margin: 0; padding: 0 40px 0 14px; appearance: none; border: 1px solid #b7c7d2; border-radius: 6px; outline: none; background-color: #fff; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23596b79' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; color: var(--ink); font: 500 13px system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif; }
select:focus-visible { border-color: var(--blue-bright); box-shadow: 0 0 0 2px #1684d444; }
.slider-value { display: flex; align-items: baseline; gap: 8px; margin: 3px 0 12px; color: var(--muted); font-size: 13px; }
.slider-value output { color: #17232d; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif; font-size: 30px; font-weight: 700; }
.slider-control { --fill: 10%; --car-position: 13.64%; position: relative; height: 42px; margin: 0; }
.slider-track { position: absolute; top: 50%; right: 0; left: 0; height: 6px; overflow: hidden; border-radius: 99px; background: #bdcbd5; transform: translateY(-50%); }
.slider-fill { display: block; width: var(--fill); height: 100%; border-radius: inherit; background: linear-gradient(90deg, #0868aa, var(--blue-bright)); box-shadow: 0 0 12px #1684d455; transition: width .16s ease; }
.car-marker { position: absolute; z-index: 1; top: 50%; left: var(--car-position); display: block; width: 62px; height: 31px; object-fit: contain; overflow: visible; pointer-events: none; filter: drop-shadow(0 2px 2px #0003); transform: translate(-50%, -70%); transition: left .16s ease; }
.slider-control input[type="range"] { position: absolute; z-index: 2; top: 0; left: 4.545%; display: block; width: 90.91%; height: 100%; margin: 0; appearance: none; opacity: 0; cursor: pointer; }
.slider-control input[type="range"]::-webkit-slider-runnable-track { height: 100%; background: transparent; }
.slider-control input[type="range"]::-moz-range-track { height: 100%; background: transparent; }
.slider-control input[type="range"]::-webkit-slider-thumb { width: 1px; height: 1px; appearance: none; background: transparent; }
.slider-control input[type="range"]::-moz-range-thumb { width: 1px; height: 1px; border: 0; background: transparent; }
.slider-control:focus-within .car-marker { filter: drop-shadow(0 2px 2px #0003) drop-shadow(0 0 4px #168bd2); }
.slider-labels { display: flex; justify-content: space-between; margin-top: 3px; color: #80909e; font-size: 10px; }
.people { display: grid; min-height: 48px; grid-template-columns: repeat(11, minmax(0, 1fr)); align-items: center; justify-items: center; margin: 8px 0 5px; }
.people::before { content: ''; }
.person { width: 22px; height: 36px; fill: #8497a5; transition: fill .15s, transform .15s; }
.person-stain { width: 29px; height: 23px; fill: #e34242; filter: drop-shadow(0 2px 1px #8b252355); animation: splat-in .2s ease-out; }
@keyframes splat-in { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: scale(1); } }
.hint { margin: 9px 1px 0; color: #61717e; font-size: 11px; }
.result { display: flex; flex-direction: column; justify-content: flex-start; padding: 8px 4px; border: 0; border-radius: 0; background: transparent; color: #101820; }
.result-prompt { margin: 0; color: #50616e; font-size: 17px; font-weight: 600; }
.result-label, .math-label { color: #344f61; font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.sentence { display: flex; flex-wrap: wrap; align-items: baseline; gap: 9px; min-height: 50px; margin: 8px 0 3px; color: #101820; font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif; }
.sentence-number { max-width: 100%; font-size: 40px; font-weight: 800; letter-spacing: -.045em; line-height: 1.2; overflow-wrap: anywhere; }
.sentence-unit { color: #344653; font-size: clamp(19px, 2.5vw, 24px); font-weight: 400; text-transform: none; }
.sentence-detail { color: #576775; font-size: 12px; line-height: 1.6; }
.description-card { margin-top: 23px; padding: 0; border: 0; border-radius: 0; background: transparent; }
.math-label { color: #344f61; font-size: 11px; letter-spacing: .12em; }
.rule { margin: 9px 0 0; color: #334451; font-size: 13px; line-height: 1.65; }
.description-divider { height: 1px; margin: 13px 0 12px; background: #cbd6dd; }
.family-heading { display: block; margin-top: 0; }
.family-description { margin-top: 8px; }
footer { margin-top: 20px; color: #71808d; font-size: 10px; text-align: center; }
footer strong { color: #9aaab6; font-weight: 600; }
.sprinkle { position: absolute; color: #297caf; opacity: .48; }
.sprinkle-one { top: 18%; left: 8%; font-size: 35px; transform: rotate(12deg); }
.sprinkle-two { right: 8%; bottom: 17%; font-size: 29px; transform: rotate(-12deg); }

@media (max-width: 680px) {
  .calculator { padding: 29px 20px 19px; }
  .app-stack { gap: 18px; }
  .calculator-layout { grid-template-columns: 1fr; gap: 14px; }
  .attribute-card { padding: 21px; }
  .result { padding: 8px 4px; }
  .sprinkle-one { top: 3%; left: 5%; }
  .sprinkle-two { right: 5%; bottom: 3%; }
}
