:root {
  color-scheme: light;
  --brand: #c90000;
  --brand-border: color-mix(in srgb, var(--brand) 78%, black);
  --brand-hover: color-mix(in srgb, var(--brand) 86%, black);
  --brand-pressed: color-mix(in srgb, var(--brand) 72%, black);
  --brand-soft: color-mix(in srgb, var(--brand) 8%, white);
  --light-gray: #eeeeee;
  --border: #cccccc;
  --ink: #111111;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: white;
  font-family: Arial, sans-serif;
  text-align: left;
}

a {
  color: var(--brand);
}

button,
select,
input {
  font: inherit;
}

button,
select,
input[type="range"],
input[type="checkbox"] {
  cursor: pointer;
}

.site-header {
  position: relative;
  height: 3em;
  max-height: 6vh;
  padding: 0.5em;
  color: white;
  background: var(--brand);
}

.site-logo {
  display: block;
  height: 100%;
  width: auto;
}

.site-nav {
  padding: 1em;
  background: var(--light-gray);
}

.app-shell {
  padding: 1em;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  margin-bottom: 1em;
}

h1,
h2 {
  margin: 0;
  font-family: Arial, sans-serif;
}

h1 {
  font-size: 1.6em;
}

h2 {
  font-size: 1.35em;
}

.generate-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  min-height: 2.5em;
  padding: 0.55em 1em;
  border: 1px solid var(--brand-border);
  border-radius: 0;
  color: white;
  background: var(--brand);
  font-weight: bold;
}

.generate-button:hover {
  background: var(--brand-hover);
}

.generate-button:active {
  background: var(--brand-pressed);
}

.score-card {
  overflow: hidden;
  border: 1px solid var(--border);
  background: white;
}

.score-scroll {
  overflow-x: auto;
  padding: 1em;
}

#score {
  display: block;
  width: 100%;
  min-width: 760px;
  height: auto;
}

.settings-card {
  margin-top: 1em;
  padding: 1em;
  border: 1px solid var(--border);
  background: white;
}

.settings-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1em;
  margin-bottom: 1.25em;
}

.text-button {
  padding: 0;
  border: 0;
  color: var(--brand);
  background: transparent;
  text-decoration: underline;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25em 2em;
}

.field {
  display: flex;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  flex-direction: column;
}

.field-label {
  display: block;
  margin-bottom: 0.2em;
  font-weight: bold;
}

select {
  width: 100%;
  height: 2.5em;
  margin-top: 0.6em;
  padding: 0 0.5em;
  border: 1px solid #999999;
  border-radius: 0;
  color: var(--ink);
  background: white;
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.duration-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin-top: 0.6em;
}

.check-option {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.45em 0.6em;
  border: 1px solid #999999;
  background: white;
  font-size: 0.85em;
}

.check-option:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.check-option.fixed {
  cursor: default;
}

.check-option input {
  width: 1em;
  height: 1em;
  margin: 0;
  accent-color: var(--brand);
}

.note-icon {
  min-width: 0.8em;
  font-family: "Segoe UI Symbol", serif;
  font-size: 1.2em;
  line-height: 1;
}

.range-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75em;
}

.range-field {
  grid-column: 1 / -1;
}

output {
  color: var(--brand);
  font-weight: bold;
}

input[type="range"] {
  width: 100%;
  margin: 1.2em 0 0.4em;
  accent-color: var(--brand);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  color: #555555;
  font-size: 0.75em;
}

.toggle-field {
  display: flex;
  position: relative;
  align-items: flex-start;
  flex-direction: column;
  cursor: pointer;
}

.toggle-row {
  display: flex;
  height: 2.5em;
  margin-top: 0.6em;
  align-items: center;
}

.toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toggle {
  position: relative;
  flex: 0 0 auto;
  width: 2.5em;
  height: 1.35em;
  border: 1px solid #777777;
  background: #cccccc;
}

.toggle::after {
  position: absolute;
  top: 0.12em;
  left: 0.12em;
  width: 1em;
  height: 1em;
  border: 1px solid #777777;
  background: white;
  content: "";
}

.toggle-input:checked + .toggle {
  border-color: var(--brand);
  background: var(--brand);
}

.toggle-input:checked + .toggle::after {
  transform: translateX(1.1em);
}

.toggle-input:focus-visible + .toggle {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.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;
}

@media (max-width: 720px) {
  .hero {
    align-items: stretch;
    flex-direction: column;
  }

  .generate-button {
    justify-content: center;
  }

  .settings-heading {
    align-items: flex-start;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .range-field {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
