body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 24px;
  background-color: #f5f7fb;
}

h1 {
  color: #1f2a44;
}

.page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.nav-button {
  border: 2px solid #3457d5;
  border-radius: 8px;
  padding: 10px 14px;
  color: #3457d5;
  background-color: #ffffff;
  cursor: pointer;
}

.nav-button.active {
  color: #ffffff;
  background-color: #3457d5;
}

button {
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  color: #ffffff;
  background-color: #3457d5;
  cursor: pointer;
}

button:hover {
  background-color: #2947b2;
}

.nav-button:hover {
  background-color: #e8edff;
}

.nav-button.active:hover {
  background-color: #2947b2;
}

.page {
  max-width: 640px;
}

.pet-generator {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  width: min(420px, 100%);
  margin-top: 16px;
}

.pet-image {
  display: block;
  max-width: 100%;
  max-height: 65vh;
  border-radius: 12px;
}

.pet-actions {
  display: block;
}

.chuck-quote {
  margin: 16px 0;
  padding: 16px 20px;
  border-left: 4px solid #3457d5;
  border-radius: 0 12px 12px 0;
  background-color: #ffffff;
  color: #1f2a44;
  font-size: 1.1rem;
  line-height: 1.5;
}

.weather-card {
  margin: 16px 0;
  padding: 16px 20px;
  border-left: 4px solid #3457d5;
  border-radius: 0 12px 12px 0;
  background-color: #ffffff;
  color: #1f2a44;
}

.weather-summary {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-weight: 700;
}

.weather-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 0;
}

.weather-detail {
  margin: 0;
}

.weather-detail dt {
  color: #3457d5;
  font-weight: 700;
}

.weather-detail dd {
  margin: 4px 0 0;
}

.quiz-card {
  display: inline-flex;
  flex-direction: column;
  gap: 16px;
  width: min(420px, 100%);
  margin-top: 16px;
  padding: 16px;
  border-left: 4px solid #3457d5;
  border-radius: 0 12px 12px 0;
  background-color: #ffffff;
  color: #1f2a44;
}

.quiz-painting {
  display: block;
  width: 100%;
  max-height: 58vh;
  object-fit: contain;
  border-radius: 12px;
  background-color: #edf1ff;
}

.quiz-painting.is-loading {
  opacity: 0;
}

.quiz-question {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.quiz-streak {
  margin: -6px 0 0;
  color: #3457d5;
  font-weight: 700;
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.quiz-option {
  text-align: left;
}

.quiz-option:disabled {
  cursor: not-allowed;
  opacity: 0.85;
}

.quiz-option.selected {
  outline: 3px solid #ffcf33;
  outline-offset: 2px;
}

.quiz-result {
  min-height: 1.5em;
  margin: 0;
  font-weight: 700;
}

.quiz-result.success {
  color: #157347;
}

.quiz-result.error {
  color: #b02a37;
}

.flags-quiz-mode-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: #3457d5;
  font-weight: 700;
  cursor: pointer;
}

.flags-quiz-mode-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #3457d5;
  cursor: pointer;
}

.flags-quiz-card[data-mode="choice"] .flags-quiz-type-panel,
.flags-quiz-card[data-mode="type"] .flags-quiz-choice-panel {
  display: none !important;
}

.flags-quiz-type-panel {
  display: flex;
  margin: 0;
}

.flags-quiz-answer {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #3457d5;
  border-radius: 8px;
  color: #1f2a44;
  background-color: #ffffff;
  font: inherit;
}

.flags-quiz-answer:focus {
  outline: 3px solid #ffcf33;
  outline-offset: 2px;
}

.flags-quiz-answer:disabled {
  cursor: not-allowed;
  opacity: 0.85;
}

.calculator-card {
  display: inline-flex;
  flex-direction: column;
  gap: 16px;
  width: min(320px, 100%);
  margin-top: 16px;
  padding: 16px;
  border-left: 4px solid #3457d5;
  border-radius: 0 12px 12px 0;
  background-color: #ffffff;
  color: #1f2a44;
}

.calculator-display {
  display: block;
  width: 100%;
  padding: 16px;
  border-radius: 8px;
  background-color: #edf1ff;
  color: #1f2a44;
  font-size: 2rem;
  font-weight: 700;
  text-align: right;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calculator-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.calculator-key {
  min-height: 52px;
  font-size: 1.1rem;
  font-weight: 700;
}

.calculator-key-clear {
  background-color: #b02a37;
}

.calculator-key-clear:hover {
  background-color: #922932;
}

.calculator-key-operator {
  background-color: #5a6fd6;
}

.calculator-key-operator:hover {
  background-color: #4a5fc0;
}

.calculator-key-equals {
  grid-row: span 2;
}

.calculator-key-zero {
  grid-column: span 2;
}
