:root {
  --bg: #f7f5f2;
  --text: #1f1f1f;
  --muted: #5f5f5f;
  --primary: #1a5a96;
  --primary-hover: #164c7e;
  --border: #d8d2c8;
  --error: #b42318;
  --success: #0f766e;
  --focus: #f59e0b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

header {
  padding: 1.5rem 1rem 0;
}

main {
  max-width: 820px;
  margin: 2rem auto;
  padding: 0 1rem 3rem;
}

h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
}

h2 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

form {
  display: grid;
  gap: 1rem;
}

.form-row {
  display: grid;
  gap: 0.5rem;
}

.step-indicator {
  color: var(--muted);
  font-size: 0.95rem;
}

label {
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  font-size: 1rem;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
}

legend {
  font-weight: 700;
  padding: 0 0.5rem;
}

.form-help {
  color: var(--muted);
  font-size: 0.9rem;
}

.form-error {
  color: var(--error);
  font-size: 0.9rem;
  font-weight: 600;
}

.input-error {
  border-color: var(--error);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--error) 25%, transparent);
}

.actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.7rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  background: var(--primary-hover);
}

.icon-button {
  background: white;
  color: var(--primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  font-weight: 700;
  cursor: pointer;
}

.icon-button:hover {
  background: #eef3f9;
}

button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.htmx-indicator {
  display: none;
  color: var(--muted);
  font-size: 0.9rem;
}

.htmx-request .htmx-indicator {
  display: inline;
}

.summary-list {
  padding-left: 1.2rem;
}

.stack {
  display: grid;
  gap: 0.5rem;
}

.votes-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.votes-table th,
.votes-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #e6e0d7;
  text-align: center;
}

.votes-table__name {
  text-align: left;
  font-weight: 700;
  background: #f2f6fb;
}

.votes-table__month {
  background: #5f4c7a;
  color: white;
  font-weight: 700;
}

.votes-table__date {
  background: #e9edf4;
  font-weight: 600;
}

.votes-table__cell {
  background: #f6f3e2;
}

.votes-table__marker {
  font-size: 1.1rem;
}

.votes-table__summary-label {
  text-align: left;
  font-weight: 700;
}

.votes-table__summary {
  background: #e7f1ff;
  font-weight: 700;
}

.votes-table__best {
  color: #1a5a96;
  margin-left: 0.35rem;
}

.votes-add {
  margin-top: 1.5rem;
  padding: 1rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
}
