:root {
  --bg: #f5f1ea;
  --card: #ffffff;
  --ink: #1e1e1e;
  --muted: #6b6b6b;
  --line: #e3ddd1;
  --accent: #0b6e4f;
  --accent-ink: #ffffff;
  --yes: #2e7d32;
  --yes-bg: #e8f5e9;
  --yes-strong: #1b5e20;
  --maybe: #c77c00;
  --maybe-bg: #fff4e0;
  --maybe-strong: #8a5500;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

body {
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 12px 48px;
}

.topbar {
  padding: 8px 4px 12px;
}

.topbar h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.me-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 7px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  max-width: 100%;
}

.me-pill-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.me-pill strong {
  font-size: 0.95rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60vw;
}

.me-pill .link-btn {
  margin-left: 4px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 14px 16px;
  margin: 0 0 14px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.field {
  display: block;
  margin-bottom: 10px;
}

.field span {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 4px;
}

input[type="text"], select.select {
  width: 100%;
  padding: 14px 12px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
  font-weight: 600;
}

select.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b6e4f' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 20px;
  padding-right: 44px;
}

input:focus, select.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11,110,79,0.15);
}

button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}

button.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

button.big {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  margin-top: 8px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  padding: 0;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
}

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.hint {
  margin: 0 4px 10px;
}

/* Calendar */
.cal-month {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 8px 10px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.cal-month h3 {
  margin: 0 0 10px;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-head {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 0 6px;
}

.cal-head.we {
  color: var(--accent);
}

.cal-day {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1.5px solid transparent;
  background: transparent;
  font-size: 0.95rem;
  color: var(--ink);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.cal-day.empty {
  visibility: hidden;
}

.cal-day.weekday {
  color: #c2bdb2;
  background: transparent;
}

.cal-day.weekend {
  background: #fff;
  border-color: var(--line);
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.06s ease;
}

.cal-day.weekend:active {
  transform: scale(0.94);
}

.cal-day.weekend.yes {
  background: var(--yes-bg);
  border-color: var(--yes);
  color: var(--yes-strong);
}

.cal-day.weekend.maybe {
  background: var(--maybe-bg);
  border-color: var(--maybe);
  color: var(--maybe-strong);
}

.cal-day .d {
  font-size: 1rem;
  line-height: 1.05;
}

.cal-day .counts {
  display: flex;
  gap: 4px;
  margin-top: 2px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
}

.cal-day .c-y { color: var(--yes); }
.cal-day .c-m { color: var(--maybe); }

.cal-day .me-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yes);
}

.cal-day.maybe .me-dot {
  background: var(--maybe);
}

/* Auswertung */
.summary-card h2 { margin-bottom: 12px; }

#summary {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#summary li {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8f5ef;
  border: 1px solid transparent;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px 8px;
}

#summary li.best {
  background: var(--yes-bg);
  border-color: var(--yes);
}

#summary .date-label {
  font-weight: 700;
  font-size: 0.95rem;
  grid-row: 1;
  grid-column: 1;
}

#summary .count-pill {
  grid-row: 1;
  grid-column: 2;
  background: var(--accent);
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  align-self: center;
}

#summary li.best .count-pill {
  background: var(--yes);
}

#summary .pills {
  grid-row: 1;
  grid-column: 2;
  display: flex;
  gap: 4px;
  align-items: center;
}

#summary .count-pill.maybe {
  background: var(--maybe);
}

#summary li.best .count-pill.maybe {
  background: var(--maybe);
}

#summary .names {
  grid-row: 2;
  grid-column: 1 / -1;
  font-size: 0.85rem;
  color: #444;
}

#summary .names .line {
  margin-top: 2px;
}

#summary .names .label-yes {
  color: var(--yes);
  font-weight: 700;
}

#summary .names .label-maybe {
  color: var(--maybe);
  font-weight: 700;
}

#summary .empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.footer {
  text-align: center;
  padding: 20px 0 10px;
}

@media (min-width: 500px) {
  body { padding: 16px 16px 64px; }
  .topbar h1 { font-size: 1.4rem; }
  .cal-day .d { font-size: 1.05rem; }
}
