@charset "UTF-8";
:root {
  color-scheme:light;
  --bg:#f3f5f9;
  --ink:#17223c;
  --muted:#626d84;
  --accent:#304ee4;
  --line:#dfe4ef;
  --mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size:16px;
  color:var(--ink);
  background:var(--bg)
}
* {
  box-sizing:border-box
}
body {
  margin:0
}
button,input {
  font:inherit
}
button {
  cursor:pointer
}
button:focus-visible,a:focus-visible {
  outline:3px solid #7896ff;
  outline-offset:4px
}
button,input,a {
  -webkit-tap-highlight-color:transparent
}
button {
  touch-action:manipulation
}
[hidden] {
  display:none!important
}
.topbar {
  max-width:1440px;
  margin:auto;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:25px 6%;
  border-bottom:1px solid var(--line);
  gap:16px
}
.brand {
  color:var(--ink);
  display:flex;
  align-items:center;
  gap:12px;
  text-decoration:none;
  font-size:1.25rem;
  font-weight:750;
  letter-spacing:-.025em
}
.brand-mark {
  display:grid;
  place-items:center;
  width:36px;
  height:36px;
  border-radius:10px;
  background:var(--accent);
  font:700 1.125rem var(--mono);
  color:white;
  letter-spacing:-.08em
}
.brand-slash {
  color:#9ca6bd;
  font-weight:400
}
.project-badge {
  font-size:.875rem;
  color:var(--muted);
  display:flex;
  gap:10px;
  align-items:center
}
.project-badge span {
  background:#e5eafa;
  color:#314dbe;
  padding:5px 8px;
  border-radius:6px;
  font-family:var(--mono)
}
main {
  max-width:1280px;
  margin:auto;
  padding:42px 44px 22px
}
.page-heading {
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:20px;
  margin-bottom:28px
}
.eyebrow {
  font-size:.75rem;
  font-weight:700;
  letter-spacing:.13em;
  color:var(--accent);
  margin:0 0 10px
}
h1 {
  font-size:clamp(2rem,4vw,2.75rem);
  line-height:1.15;
  letter-spacing:-.05em;
  margin:0;
  font-weight:750
}
h1>span {
  color:var(--accent)
}
.intro {
  color:var(--muted);
  margin:12px 0 0;
  line-height:1.5
}
.reset-button {
  border:1px solid var(--line);
  background:white;
  color:#48536b;
  padding:11px 15px;
  border-radius:9px;
  font-size:.875rem;
  display:flex;
  align-items:center;
  gap:8px;
  white-space:nowrap
}
.reset-button:hover {
  border-color:#9caef5;
  color:var(--accent)
}
.reset-button>span {
  font-size:1.25rem;
  line-height:1
}
.workspace {
  display:grid;
  grid-template-columns:minmax(290px,.88fr) minmax(0,1.12fr);
  gap:24px;
  align-items:stretch
}
.calculator {
  padding:28px;
  background:white;
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow:0 6px 22px #18223b04;
  min-width:0
}
.section-title {
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:25px
}
.section-title h2 {
  font-size:1.125rem;
  margin:0;
  font-weight:650;
  letter-spacing:-.015em
}
.section-number {
  font:.75rem var(--mono);
  color:var(--accent);
  background:#eef1ff;
  padding:7px;
  border-radius:7px
}
.field {
  margin:0 0 19px
}
.field:last-child {
  margin-bottom:23px
}
.field label {
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:baseline;
  font-size:.9375rem;
  font-weight:550;
  margin-bottom:9px;
  flex-wrap:wrap
}
.field label code {
  font:.8125rem var(--mono);
  color:#717a91;
  font-weight:400
}
.input-wrap {
  position:relative
}
.input-wrap input {
  width:100%;
  border:1px solid #d7ddea;
  border-radius:9px;
  background:#fafbfe;
  padding:12px 61px 12px 14px;
  outline:none;
  font-size:1.125rem;
  font-weight:550;
  color:var(--ink);
  font-variant-numeric:tabular-nums;
  min-width:0
}
.input-wrap input:focus {
  border-color:var(--accent);
  box-shadow:0 0 0 3px #304ee415;
  background:white
}
.input-wrap input[aria-invalid="true"] {
  border-color:#bf454e;
  background:#fff8f8
}
.input-wrap>span {
  position:absolute;
  right:16px;
  top:50%;
  transform:translateY(-50%);
  font-size:.875rem;
  color:#6b758b;
  pointer-events:none
}
.input-wrap input::-webkit-inner-spin-button {
  appearance:none
}
.input-wrap input[type=number] {
  appearance:textfield;
  -moz-appearance:textfield
}
.field-error {
  font-size:.8125rem;
  color:#ac3641;
  line-height:1.4;
  margin:6px 0 0
}
.field-error:empty {
  display:none
}
.result {
  border-radius:12px;
  padding:20px;
  background:#eef2ff;
  border:1px solid #e0e7ff;
  transition:background-color .18s,color .18s
}
.result-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  font-size:.875rem;
  color:#34477f;
  gap:10px
}
.result-symbol {
  border:1px solid #c5d1f2;
  padding:0 6px;
  border-radius:5px;
  line-height:1.3;
  color:#425cd3;
  font-family:var(--mono)
}
.remaining {
  display:block;
  color:#253fba;
  font-size:clamp(1.8rem,3.5vw,2.6rem);
  font-weight:700;
  letter-spacing:-.045em;
  line-height:1.2;
  margin-top:10px;
  overflow-wrap:anywhere;
  font-variant-numeric:tabular-nums
}
.result-equation {
  font-size:.875rem;
  line-height:1.5;
  color:#536393;
  margin:9px 0 17px;
  overflow-wrap:anywhere;
  font-variant-numeric:tabular-nums
}
.budget-bar {
  height:6px;
  background:#d9e0f7;
  border-radius:8px;
  overflow:hidden;
  margin-bottom:14px
}
.budget-bar>div {
  height:100%;
  width:75%;
  border-radius:inherit;
  background:#566fee;
  transition:width .25s
}
.total-row {
  display:flex;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:6px 14px;
  font-size:.875rem;
  color:#3e4e7a
}
.total-row output {
  font-weight:650
}
.result-note {
  margin:12px 0 0;
  font-size:.875rem;
  line-height:1.5
}
.result.over-budget {
  background:#fff0f1;
  border-color:#f7d9dc
}
.over-budget .remaining,.over-budget .result-heading,.over-budget .result-equation,.over-budget .total-row,.over-budget .result-note {
  color:#a72d42
}
.over-budget .budget-bar {
  background:#f5d3da
}
.over-budget .budget-bar>div {
  background:#cf5066
}
.over-budget .result-symbol {
  color:#a72d42;
  border-color:#dfadb5
}
.result.invalid {
  background:#f4f5f8;
  border-color:#e3e6ed
}
.invalid .remaining,.invalid .result-equation {
  color:#737d91
}
.code-panel {
  background:#151b2a;
  color:#d9dfee;
  border-radius:18px;
  border:1px solid #252d41;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  min-width:0;
  box-shadow:0 14px 40px #18223b0a
}
.code-header {
  padding:22px 24px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid #30394c;
  gap:14px;
  flex-wrap:wrap
}
.file-title {
  display:flex;
  gap:10px;
  align-items:center
}
.file-title h2 {
  font-weight:500;
  font-size:.9375rem;
  margin:0
}
.python-mark {
  color:#b5c6ff;
  background:#26334f;
  font:600 .875rem var(--mono);
  padding:5px 6px;
  border-radius:5px
}
.readonly-label {
  color:#9aa6be;
  font-size:.75rem;
  border:1px solid #364159;
  border-radius:5px;
  padding:4px 7px
}
.editor {
  padding:28px 0 22px;
  overflow-x:auto
}
.code-line {
  display:flex;
  align-items:baseline;
  gap:21px;
  border:0;
  border-left:3px solid transparent;
  width:100%;
  min-width:max-content;
  text-align:left;
  color:#dce4f4;
  background:none;
  padding:7px 24px 7px 19px;
  font:1rem/1.65 var(--mono)
}
button.code-line:hover {
  background:#222c42
}
.code-line.active {
  border-left-color:#879dfa;
  background:#24304a
}
.line-number {
  flex:0 0 16px;
  text-align:right;
  color:#7786a4;
  font:.8125rem var(--mono);
  user-select:none
}
.code-line code {
  font:inherit;
  white-space:pre
}
.code-line .operator {
  color:#aab9d9
}
.code-line .number {
  color:#c5eba0
}
.code-line .function {
  color:#a8c4ff
}
.empty-line {
  height:24px;
  padding-top:0;
  padding-bottom:0
}
.console {
  margin:0 24px 24px;
  border:1px solid #313c54;
  border-radius:10px;
  padding:15px 17px;
  background:#111726
}
.console-label {
  color:#9faec9;
  font-size:.8125rem;
  display:flex;
  align-items:center;
  gap:9px;
  margin-bottom:12px
}
.console-icon {
  font-family:var(--mono);
  color:#6f819f
}
.console output {
  font:1.3125rem/1.4 var(--mono);
  color:#c5eba0;
  overflow-wrap:anywhere
}
.explanation {
  padding:22px 24px;
  background:#1c2435;
  border-top:1px solid #30394c;
  flex:1
}
.explanation-label {
  font-size:.75rem;
  letter-spacing:.11em;
  margin:0 0 10px;
  color:#9facd1;
  font-weight:650
}
.explanation h3 {
  font-size:1rem;
  color:#f1f4fa;
  font-weight:550;
  margin:0 0 9px;
  line-height:1.5
}
.explanation>p:last-child {
  color:#b0bbd0;
  margin:0;
  line-height:1.7;
  font-size:.9375rem
}
.code-hint {
  color:#8e9bb5;
  font-size:.8125rem;
  line-height:1.6;
  margin:0;
  padding:16px 24px;
  background:#1c2435
}
.exercise {
  display:flex;
  gap:17px;
  align-items:flex-start;
  margin-top:24px;
  padding:22px 24px;
  border:1px solid var(--line);
  border-radius:13px;
  background:#f9faff
}
.exercise-icon {
  flex:0 0 32px;
  height:32px;
  border:1px solid #d5ddf4;
  border-radius:50%;
  display:grid;
  place-items:center;
  color:var(--accent);
  font-weight:600
}
.exercise h2 {
  font-size:.9375rem;
  margin:0 0 6px;
  font-weight:650
}
.exercise p {
  color:var(--muted);
  font-size:.9375rem;
  line-height:1.65;
  margin:0
}
.exercise strong {
  font-weight:600;
  color:#34445f
}
footer {
  display:flex;
  justify-content:space-between;
  gap:10px 24px;
  flex-wrap:wrap;
  color:#758097;
  font-size:.75rem;
  line-height:1.6;
  padding:22px 2px 0
}
noscript {
  display:block;
  padding:20px;
  background:#fff1d6;
  text-align:center
}
@media(min-width:1400px) {
  main {
    padding-top:52px
  }
  .workspace {
    gap:28px
  }
  .calculator {
    padding:30px
  }
  .field {
    margin-bottom:21px
  }
  .code-line {
    font-size:1.0625rem
  }
}
@media(max-width:900px) {
  main {
    padding:30px 24px 20px
  }
  .topbar {
    padding:20px 24px
  }
  .workspace {
    gap:18px;
    grid-template-columns:minmax(250px,.88fr) minmax(0,1.12fr)
  }
  .calculator {
    padding:22px
  }
  .code-header {
    padding:20px
  }
  .code-line {
    font-size:.9375rem;
    gap:14px;
    padding-left:12px;
    padding-right:17px
  }
  .console {
    margin-left:20px;
    margin-right:20px
  }
  .explanation,.code-hint {
    padding-left:20px;
    padding-right:20px
  }
}
@media(max-width:760px) {
  .workspace {
    grid-template-columns:1fr
  }
  .page-heading {
    align-items:flex-start;
    flex-direction:column;
    gap:17px
  }
  .reset-button {
    font-size:.875rem;
    padding:10px 13px
  }
  .code-line {
    font-size:1rem;
    gap:20px;
    padding-left:17px
  }
  .code-header {
    padding:20px 24px
  }
  .console {
    margin-left:24px;
    margin-right:24px
  }
  .explanation,.code-hint {
    padding-left:24px;
    padding-right:24px
  }
  .remaining {
    font-size:2.6rem
  }
  .calculator {
    padding:25px
  }
  .intro {
    font-size:.9375rem
  }
  .exercise {
    padding:20px
  }
  .exercise-icon {
    flex-basis:28px;
    height:28px
  }
}
@media(max-width:420px) {
  main {
    padding:27px 16px 16px
  }
  .topbar {
    padding:17px 16px
  }
  .project-badge {
    font-size:.75rem;
    gap:6px
  }
  .brand {
    font-size:1.125rem;
    gap:9px
  }
  .brand-mark {
    width:32px;
    height:32px
  }
  .calculator {
    padding:20px
  }
  .section-title {
    gap:8px
  }
  .section-title h2 {
    font-size:1rem
  }
  .code-line {
    font-size:.875rem;
    gap:13px;
    padding-left:10px;
    padding-right:12px
  }
  .code-header {
    padding:18px
  }
  .file-title h2 {
    font-size:.875rem
  }
  .readonly-label {
    display:none
  }
  .explanation,.code-hint {
    padding-left:20px;
    padding-right:20px
  }
  .console {
    margin-left:20px;
    margin-right:20px
  }
  .exercise {
    gap:12px;
    padding:17px
  }
  .field label {
    font-size:.875rem
  }
  .result {
    padding:17px
  }
}
@media(prefers-reduced-motion:reduce) {
  * {
    transition:none!important
  }
}
.topbar-actions {
  display:flex;
  align-items:center;
  gap:22px
}
.source-link {
  font-size:.875rem;
  color:var(--accent);
  font-weight:550;
  text-underline-offset:4px
}
.embedded-preview .topbar,.embedded-preview .code-panel,.embedded-preview .exercise,.embedded-preview footer,.embedded-preview .page-heading .eyebrow,.embedded-preview .page-heading .intro {
  display:none
}
.embedded-preview main {
  padding:22px 18px
}
.embedded-preview .page-heading {
  margin-bottom:18px;
  gap:14px
}
.embedded-preview h1 {
  font-size:1.5rem
}
.embedded-preview .workspace {
  display:block
}
.embedded-preview .calculator {
  padding:20px
}
.embedded-preview .remaining {
  font-size:2.1rem
}
@media(max-width:580px) {
  .topbar-actions .project-badge {
    display:none
  }
  .topbar-actions {
    gap:10px
  }
  .source-link {
    font-size:.8125rem
  }
}
