:root {
  color-scheme: light;
  --ink: #07111f;
  --muted: #53657d;
  --blue: #155eef;
  --line: #c9d5e5;
  --paper: #fff;
  --base: #f7f9fc;
  --hover: #e8efff;
  --error: #ad1b1b;
}
* {
  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 {
  touch-action: manipulation;
}
:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}
.skip-link {
  position: absolute;
  top: -5rem;
  left: 1rem;
  background: var(--paper);
  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: #07111f;
  color: #fff;
}
.site-header a {
  color: #fff;
  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;
}
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 {
  font: inherit;
}
fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
button {
  min-height: 48px;
  padding: 0.6rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-weight: 650;
}
button:hover:not(:disabled) {
  background: var(--hover);
}
button.primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
button.primary:hover:not(:disabled) {
  background: #124ecc;
  color: white;
}
button:disabled {
  opacity: 0.55;
  cursor: default;
}
input {
  border: 1px solid var(--line);
  border-radius: 0.3rem;
  padding: 0.65rem;
  background: var(--paper);
  color: var(--ink);
  width: 100%;
  min-width: 0;
  min-height: 48px;
}
input[aria-invalid='true'] {
  border-color: var(--error);
}
label {
  display: block;
  font-weight: 650;
  margin: 0.8rem 0 0.4rem;
}
small,
.privacy,
#export-note,
.result > p,
.tool-notes p {
  color: var(--muted);
}
small,
.privacy,
#export-note {
  font-size: 0.85rem;
}
small {
  display: block;
  margin-top: 0.5rem;
}
.weekdays {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.7rem;
  margin-top: 1.25rem;
}
.weekdays legend {
  font-weight: 650;
}
.weekdays legend span {
  font-weight: 400;
  color: var(--muted);
}
.weekdays label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  margin: 0;
  font-size: 0.95rem;
}
input[type='checkbox'] {
  width: 1.15rem;
  height: 1.15rem;
  min-height: 0;
  accent-color: var(--blue);
}
.builder {
  display: grid;
  grid-template-columns: 21rem minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}
.settings {
  padding-right: 2rem;
  border-right: 1px solid var(--line);
}
.settings h2 {
  margin-top: 0;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}
.privacy {
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
}
.result {
  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);
}
.result h2 {
  font-size: 2rem;
  margin: 0.25rem 0 1.25rem;
}
#summary {
  color: var(--ink);
  font-size: 1.1rem;
}
.numbers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding-block: 1rem;
  border-block: 1px solid var(--line);
}
dt {
  font-size: 0.85rem;
  color: var(--muted);
}
dd {
  margin: 0.4rem 0 0;
  font-size: clamp(1.3rem, 2.5vw, 2rem);
  font-weight: 750;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
caption {
  text-align: left;
  color: var(--muted);
  padding: 0.5rem 0;
  font-size: 0.85rem;
}
th,
td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--line);
}
th {
  color: var(--muted);
  font-size: 0.85rem;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
}
.tool-notes {
  border-top: 1px solid var(--line);
  margin-top: 3.5rem;
  padding-top: 1rem;
}
.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
}
.tool-notes p {
  font-size: 0.95rem;
}
.error {
  color: var(--error);
  font-size: 0.9rem;
}
.error:empty {
  display: none;
}
#status {
  font-size: 0.85rem;
  min-height: 1.5em;
}
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;
  font-size: 0.9rem;
}
footer a {
  padding: 0.5rem 0;
}
.notice {
  padding: 1rem;
  border: 1px solid var(--line);
}
#print-sheet {
  display: none;
}
.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;
}
[hidden] {
  display: none !important;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #edf3ff;
    --muted: #b0c0d8;
    --blue: #85b2ff;
    --line: #40536d;
    --paper: #142338;
    --base: #0b1728;
    --hover: #233a59;
    --error: #ffaaaa;
  }
  button.primary {
    background: #155eef;
  }
}
@media (max-width: 56rem) {
  .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;
  }
  .intro {
    margin-bottom: 2rem;
  }
  main {
    padding-top: 2rem;
  }
}
@media (max-width: 25rem) {
  .numbers {
    grid-template-columns: 1fr;
  }
  .numbers div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
  }
  dd {
    max-width: 50%;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
@media print {
  @page {
    margin: 15mm;
  }
  body {
    background: white;
    color: black;
    font:
      11pt/1.4 system-ui,
      sans-serif;
  }
  body > .site-header,
  body > main,
  body > footer,
  .skip-link {
    display: none;
  }
  #print-sheet {
    display: block;
  }
  #print-sheet h2 {
    font-size: 24pt;
  }
  #print-sheet table {
    font-size: 10pt;
  }
  #print-sheet th,
  #print-sheet td {
    border-color: #aaa;
    color: black;
    padding: 5pt;
  }
  tr {
    break-inside: avoid;
  }
  thead {
    display: table-header-group;
  }
}
