:root {
  color-scheme: light;
  --red: #ce1126;
  --white: #ffffff;
  --bg: #ce1126;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --accent: #ce1126;
  --border: #e5c3c8;
  --input-bg: #fafafa;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom, var(--red) 0%, var(--red) 45%, var(--white) 45%, var(--white) 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding: 24px;
}

.card {
  width: 100%;
  max-width: 460px;
  background: var(--card);
  border: 2px solid var(--red);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

h1 {
  margin: 0 0 8px;
  font-size: 28px;
  color: var(--text);
}

.target { color: var(--accent); }

.tagline {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.subtitle {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.mode-switch {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.mode-btn {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
}

.mode-btn.active {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
  font-weight: 600;
}

#solve-form {
  margin-bottom: 16px;
}

.input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.input-row input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 14px;
  min-width: 0;
}

.date-fields {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
}

.date-fields[hidden] {
  display: none;
}

.date-fields input {
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
}

.date-fields input::-webkit-outer-spin-button,
.date-fields input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#day-input,
#month-input {
  flex: 0 1 56px;
}

#year-input {
  flex: 0 1 80px;
}

.sep {
  color: var(--muted);
}

.input-row button {
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: var(--white);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.toggles {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.toggles[hidden] {
  display: none;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

.toggle input {
  accent-color: var(--accent);
}

#status {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

#results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

#results li {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: "SF Mono", Menlo, monospace;
  font-size: 14px;
  color: var(--text);
}
