:root {
  color-scheme: light dark;
  --bg: #f8f9fb;
  --surface: #fff;
  --text: #111827;
  --muted: #4b5563;
  --line: #d1d5db;
  --brand: #047857;
  --tint: #ecfdf5;
  --error: #b91c1c;
  font:
    16px/1.6 'Geist',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  color: var(--text);
  background: var(--bg);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0e14;
    --surface: #151821;
    --text: #f0f2f5;
    --muted: #c9cdd5;
    --line: #414754;
    --brand: #6ee7b7;
    --tint: #15362e;
    --error: #fca5a5;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: var(--brand);
  text-underline-offset: 3px;
}
a,
button,
input {
  -webkit-tap-highlight-color: transparent;
}
:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 4px;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
[hidden] {
  display: none !important;
}
.skip {
  position: absolute;
  top: -6rem;
  left: 1rem;
  background: var(--surface);
  padding: 1rem;
  z-index: 1;
}
.skip:focus {
  top: 0;
}
.site-nav {
  border-bottom: 1px solid var(--line);
  padding: 1rem max(1rem, calc((100vw - 1080px) / 2));
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  background: var(--surface);
}
.brand {
  font-weight: 750;
  text-decoration: none;
  color: var(--text);
}
main {
  max-width: 1080px;
  margin: auto;
  padding: 2.5rem 1rem 4rem;
}
h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.035em;
  margin: 0.5rem 0 1rem;
  text-wrap: balance;
}
h2 {
  font-size: 1.4rem;
  line-height: 1.3;
}
p {
  max-width: 76ch;
}
.intro {
  color: var(--muted);
  margin-bottom: 2rem;
}
.workspace {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}
fieldset {
  border: 0;
  margin: 0;
  padding: 1.5rem;
  min-width: 0;
}
legend {
  float: left;
  padding: 0;
  font-weight: 650;
  margin-bottom: 0.6rem;
}
.expression-row {
  clear: both;
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}
input {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  padding: 0.65rem 0.75rem;
  min-height: 46px;
  font-family: 'Geist Mono', ui-monospace, monospace;
}
#expression {
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  letter-spacing: 0.04em;
}
input[aria-invalid='true'] {
  border-color: var(--error);
}
button {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.6rem 0.9rem;
  min-height: 44px;
  color: var(--text);
  background: var(--surface);
}
button:hover {
  border-color: var(--brand);
}
button[aria-pressed='true'] {
  border-color: var(--brand);
  background: var(--tint);
  color: var(--brand);
}
#copy {
  white-space: nowrap;
  font-weight: 650;
}
.hint {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0.65rem 0;
}
.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0;
}
.fields {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.8rem;
}
.fields label {
  display: block;
  font-size: 0.85rem;
  font-weight: 650;
  margin-bottom: 0.3rem;
}
.fields small {
  color: var(--muted);
}
#error {
  color: var(--error);
}
#feedback {
  font-weight: 600;
}
#error:empty,
#feedback:empty {
  margin: 0;
}
.result {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--line);
  background: var(--tint);
}
.result h2 {
  margin: 0 0 0.5rem;
}
#summary {
  font-size: 1.2rem;
  font-weight: 550;
  margin: 0 0 0.5rem;
}
code {
  font-family: 'Geist Mono', ui-monospace, monospace;
  overflow-wrap: anywhere;
}
.breakdown {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.8rem;
  padding: 1.5rem;
  border-top: 1px solid var(--line);
}
.breakdown dt {
  font-weight: 650;
  margin-bottom: 0.5rem;
}
.breakdown dd {
  margin: 0;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
  color: var(--muted);
}
.warnings {
  border-left: 3px solid var(--brand);
  margin: 1.5rem 0;
  padding: 0.1rem 1rem;
}
.warnings h2 {
  font-size: 1.1rem;
}
.warnings li {
  margin-bottom: 0.5rem;
}
.notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin-top: 2rem;
}
.notes p,
.notes li {
  color: var(--muted);
}
.notes ul {
  padding-left: 1.25rem;
}
footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 0;
  margin-top: 2rem;
}
a,
button,
input {
  scroll-margin: 1rem;
}
@media (max-width: 640px) {
  main {
    padding-top: 1.5rem;
  }
  fieldset,
  .result,
  .breakdown {
    padding: 1rem;
  }
  .expression-row {
    flex-wrap: wrap;
  }
  #copy {
    width: 100%;
  }
  .fields,
  .breakdown {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .notes {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .site-nav {
    gap: 0.75rem 1.25rem;
  }
}
.calculators {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
.workspace > h2 {
  padding: 1.5rem 1.5rem 0;
  margin: 0;
}
.entry-row {
  clear: both;
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: 0.75rem;
}
label {
  display: block;
  font-weight: 600;
  margin: 0.35rem 0;
}
select,
textarea {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.65rem 0.75rem;
  min-height: 46px;
  max-width: 100%;
}
select {
  width: 100%;
}
textarea {
  width: 100%;
  font-family: ui-monospace, monospace;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.actions button:first-child {
  color: var(--brand);
  background: var(--tint);
  border-color: var(--brand);
}
.error {
  color: var(--error);
}
.error:empty {
  margin: 0;
}
.result {
  overflow-wrap: anywhere;
}
table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}
caption {
  text-align: left;
  font-weight: 650;
  margin-bottom: 0.5rem;
}
th,
td {
  text-align: left;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th:first-child {
  width: 4rem;
}
td {
  font-family: ui-monospace, monospace;
}
h3 {
  margin: 0;
  font-size: 1rem;
}
#cpu-summary {
  font-size: 1.2rem;
}
@media (max-width: 760px) {
  .calculators {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .workspace > h2 {
    padding: 1rem 1rem 0;
  }
}
legend {
  float: none;
}
