:root {
  color-scheme: light;
  --ink: #07111f;
  --muted: #53657d;
  --blue: #155eef;
  --line: #c9d5e5;
  --paper: #fff;
  --base: #f7f9fc;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--base);
  color: var(--ink);
  font:
    17px/1.65 system-ui,
    sans-serif;
}
a {
  color: var(--blue);
  text-underline-offset: 0.2em;
}
a,
button,
input,
select,
textarea {
  touch-action: manipulation;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #155eef;
  outline-offset: 4px;
}
.skip-link {
  position: absolute;
  top: -5rem;
  left: 1rem;
  background: white;
  padding: 0.75rem;
  z-index: 2;
}
.skip-link:focus {
  top: 1rem;
}
.site-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem max(1.25rem, calc((100vw - 76rem) / 2));
  background: var(--ink);
  color: white;
}
.site-header a {
  color: white;
  text-decoration: none;
  display: inline-block;
  padding: 0.5rem 0;
}
.brand {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  margin-right: auto;
}
.brand span {
  color: #84b2ff;
}
.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}
main {
  max-width: 76rem;
  margin: auto;
  padding: 3rem 1.25rem 4rem;
}
.intro {
  max-width: 48rem;
  margin-bottom: 2.5rem;
}
.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  font-weight: 750;
  color: var(--muted);
}
h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.07;
  letter-spacing: -0.045em;
  text-wrap: balance;
  margin: 0.7rem 0 1.25rem;
}
h2 {
  font-size: 1.4rem;
  line-height: 1.25;
  letter-spacing: -0.025em;
}
h3 {
  font-size: 1.1rem;
  line-height: 1.4;
}
p {
  max-width: 72ch;
}
button,
input,
textarea,
select {
  font: inherit;
}
fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
button {
  min-height: 48px;
  padding: 0.6rem 1rem;
  border: 1px solid #8599b3;
  border-radius: 0.4rem;
  background: white;
  color: var(--ink);
  cursor: pointer;
  font-weight: 650;
}
button:hover {
  background: #e8efff;
}
button.primary {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}
input,
textarea,
select {
  border: 1px solid #8599b3;
  border-radius: 0.3rem;
  padding: 0.65rem;
  background: white;
  color: var(--ink);
  width: 100%;
  min-height: 48px;
}
textarea {
  resize: vertical;
  line-height: 1.5;
}
label {
  display: block;
  font-weight: 650;
  margin: 0.8rem 0 0.4rem;
}
label span,
small {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
}
small {
  display: block;
  margin-top: 0.5rem;
}
input[type='checkbox'] {
  width: 1.15rem;
  height: 1.15rem;
  min-height: 0;
  accent-color: var(--blue);
}
.checkbox {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.9rem;
  min-height: 44px;
}
.builder {
  display: grid;
  grid-template-columns: 19rem minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}
.settings {
  padding-right: 2rem;
  border-right: 1px solid var(--line);
}
.settings h2 {
  margin-top: 0;
}
.settings button {
  width: 100%;
  margin-top: 0.75rem;
}
.exports {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  margin-top: 2rem;
}
.exports p,
.privacy,
.caption,
#calendar-help {
  font-size: 0.85rem;
  color: var(--muted);
}
.privacy {
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
}
.preview {
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  border-radius: 0.3rem;
  padding: clamp(1rem, 3vw, 2rem);
  box-shadow: 0 8px 24px #07111f08;
}
.preview-heading h2 {
  font-size: 2rem;
  margin: 0.25rem 0 1.25rem;
}
.preview-heading .eyebrow {
  margin: 0;
}

[hidden] {
  display: none !important;
}
.actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.settings .actions button {
  width: auto;
  flex: 1;
}
#answer {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.2;
  font-weight: 750;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  margin: 0.5rem 0 1.5rem;
  overflow-wrap: anywhere;
}
#result-label {
  color: var(--muted);
  margin-bottom: 0;
}
#summary {
  white-space: pre-line;
  font-variant-numeric: tabular-nums;
}
#arithmetic {
  overflow-wrap: anywhere;
}
#status {
  min-height: 1.5em;
  font-size: 0.9rem;
}
button:disabled {
  opacity: 0.55;
  cursor: default;
}
.error {
  color: #ad1b1b;
  font-size: 0.9rem;
}
.error:empty {
  display: none;
}
[aria-invalid='true'] {
  border-color: #ad1b1b;
}
.tool-notes {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
  padding-top: 1rem;
}
.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
}
.notes-grid p {
  font-size: 0.95rem;
  color: var(--muted);
}
footer {
  border-top: 1px solid var(--line);
  max-width: 76rem;
  margin: auto;
  padding: 1.5rem 1.25rem;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
footer a {
  padding: 0.5rem 0;
}
.notice {
  padding: 1rem;
  border: 1px solid var(--line);
}
@media (max-width: 52rem) {
  .builder {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }
  .settings {
    border-right: 0;
    padding-right: 0;
  }
  .notes-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .site-header nav {
    gap: 1rem;
    font-size: 0.85rem;
  }
  main {
    padding-top: 2rem;
  }
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #edf3fc;
    --muted: #b6c7df;
    --blue: #91baff;
    --line: #45566e;
    --paper: #142237;
    --base: #0b1524;
  }
  .site-header {
    background: #07111f;
  }
  input,
  select,
  textarea,
  button {
    background: var(--paper);
    color: var(--ink);
  }
  button.primary {
    background: #155eef;
    color: #fff;
    border-color: #155eef;
  }
  button:hover {
    background: #2b3e59;
  }
  button.primary:hover {
    background: #104bc5;
  }
  .error {
    color: #ffb4b4;
  }
  .skip-link {
    background: var(--paper);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
