.identity-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.7rem 0.6rem 0.9rem;
  margin: -0.5rem 0 1.5rem;
}

.rename-toggle-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.identity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.identity-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.identity-label strong {
  color: var(--text);
}

.icon-btn {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.icon-btn svg {
  width: 0.85rem;
  height: 0.85rem;
}

.icon-btn:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.identity-card .rename-form {
  display: none;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.identity-card:has(.rename-toggle-checkbox:checked) .rename-form {
  display: flex;
}

.identity-card:has(.rename-toggle-checkbox:checked) .icon-btn {
  color: var(--accent);
  border-color: rgba(124, 158, 255, 0.4);
  background: var(--accent-dim);
}

.rename-form input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.65rem;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
}

/* step cards */

.week-start-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.segmented {
  display: flex;
  gap: 0.5rem;
}

.segmented label {
  flex: 1;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 500;
}

.segmented input {
  accent-color: var(--accent);
  margin-right: 0.35rem;
}

/* calendar widget */

.calendar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem;
  margin-bottom: 0.75rem;
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.calendar-title {
  font-weight: 600;
  font-size: 0.92rem;
}

.calendar-title-select {
  display: flex;
  gap: 0.4rem;
}

.cal-select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 7px;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
}

.cal-select:focus {
  outline: none;
  border-color: var(--accent);
}

.calendar-nav {
  background: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
}

.calendar-nav svg {
  width: 0.9rem;
  height: 0.9rem;
}

.calendar-nav:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.22rem;
}

.calendar-weekdays span {
  text-align: center;
  font-size: 0.68rem;
  color: var(--text-faint);
  padding: 0.25rem 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.calendar-day {
  aspect-ratio: 1;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.85rem;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.calendar-day:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
}

.calendar-day--muted {
  color: var(--text-faint);
  background: none;
  border-color: transparent;
}

.calendar-day-num {
  width: 1.6rem;
  height: 1.6rem;
  max-width: 100%;
  max-height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-day--today .calendar-day-num {
  box-shadow: inset 0 0 0 2px var(--accent);
  font-weight: 700;
}

.calendar-day.is-selected {
  background: #78d296;
  border-color: #78d296;
  color: #0f1115;
  font-weight: 700;
}

.calendar-day.is-selected.calendar-day--today .calendar-day-num {
  box-shadow: inset 0 0 0 2px #0f1115;
}

/* voting */

.vote-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.view-tabs {
  display: flex;
  gap: 0.4rem;
}

.view-tab-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.view-tab {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
}

.view-tab-radio:checked + .view-tab {
  color: var(--accent);
  border-color: rgba(124, 158, 255, 0.4);
  background: var(--accent-dim);
}

.responses-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
}

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

.view-panel {
  display: block;
}

#panel-calendar {
  display: none;
}

.vote-section:has(#view-calendar:checked) #panel-list {
  display: none;
}

.vote-section:has(#view-calendar:checked) #panel-calendar {
  display: block;
}

.vote-section:has(#view-calendar:checked) .sort-top-toggle {
  visibility: hidden;
  pointer-events: none;
}

.tally-inline {
  display: none;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  cursor: default;
  width: fit-content;
  flex-shrink: 0;
}

.vote-section:has(#show-responses:checked) .tally-inline {
  display: inline-flex;
}

.option-rows {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.option-row,
.result-row {
  order: 0;
}

.vote-section:has(#sort-top:checked) .option-row,
.results:has(#sort-top:checked) .result-row {
  order: var(--rank, 0);
}

.option-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.6rem 0.55rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

.option-label {
  font-weight: 600;
  font-size: 0.88rem;
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.vote-buttons {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.vote-btn {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-faint);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vote-btn svg {
  width: 0.9rem;
  height: 0.9rem;
}

.vote-btn--yes.is-active {
  background: rgba(120, 210, 150, 0.16);
  border-color: #78d296;
  color: #78d296;
}

.vote-btn--maybe.is-active {
  background: rgba(239, 190, 120, 0.16);
  border-color: #efbe78;
  color: #efbe78;
}

.vote-btn--no.is-active {
  background: rgba(239, 120, 120, 0.16);
  border-color: #ef7878;
  color: #ef7878;
}

/* tally tooltip: hover/focus the tally itself to see who responded */

.info-tip-content {
  display: none;
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background: #05070c;
  color: var(--text);
  border: 1px solid var(--border-hover);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.5;
  white-space: normal;
  width: max-content;
  max-width: 12rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  z-index: 20;
}

.tally-inline:hover .info-tip-content,
.tally-inline:focus .info-tip-content {
  display: block;
}

/* calendar voting view */

.vote-calendar-legend {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.vote-calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot--yes {
  background: #78d296;
}

.legend-dot--maybe {
  background: #efbe78;
}

.legend-dot--no {
  background: #ef7878;
}

.vote-calendar-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.2rem 0.4rem;
  min-height: 6.4rem;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

.vote-calendar-num {
  width: 1.7rem;
  height: 1.7rem;
  min-width: 1.7rem;
  min-height: 1.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.8rem;
  color: var(--text-faint);
  flex-shrink: 0;
}

.vote-calendar-cell--option .vote-calendar-num {
  color: var(--text);
  font-weight: 600;
}

.vote-calendar-num--today {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.vote-mini-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 100%;
  flex: 1;
}

.vote-mini-btn {
  width: 100%;
  flex: 1;
  min-height: 1.3rem;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-faint);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.vote-mini-btn:hover {
  border-color: var(--border-hover);
}

.vote-mini-btn svg {
  width: 0.62rem;
  height: 0.62rem;
}

.vote-mini-btn--yes.is-active {
  background: #78d296;
  border-color: #78d296;
  color: #0f1115;
}

.vote-mini-btn--maybe.is-active {
  background: #efbe78;
  border-color: #efbe78;
  color: #0f1115;
}

.vote-mini-btn--no.is-active {
  background: #ef7878;
  border-color: #ef7878;
  color: #0f1115;
}

.vote-calendar-tally {
  gap: 0.2rem !important;
  justify-content: center;
  flex-wrap: wrap;
}

.vc-tally {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.2rem;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
}

.vc-tally--yes {
  background: rgba(120, 210, 150, 0.18);
  color: #78d296;
}

.vc-tally--maybe {
  background: rgba(239, 190, 120, 0.18);
  color: #efbe78;
}

.vc-tally--no {
  background: rgba(239, 120, 120, 0.18);
  color: #ef7878;
}

/* results */

.results {
  margin-bottom: 1.5rem;
}

.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.results-head .section-title {
  margin-bottom: 0;
}

.empty {
  color: var(--text-faint);
  font-size: 0.85rem;
}

.result-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.result-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.9rem;
}

.result-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.result-tally {
  display: flex;
  gap: 0.7rem;
  flex-shrink: 0;
}

.tally-count {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-faint);
}

.tally-count svg {
  width: 0.85rem;
  height: 0.85rem;
}

.tally-count--yes {
  color: #78d296;
}

.tally-count--maybe {
  color: #efbe78;
}

.tally-count--no {
  color: #ef7878;
}

.result-detail {
  margin-top: 0.4rem;
}

.result-detail summary {
  cursor: pointer;
  font-size: 0.76rem;
  color: var(--text-faint);
  font-weight: 500;
}

.result-detail p {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.detail-label--maybe {
  background: rgba(239, 190, 120, 0.16);
  color: #efbe78;
}

.detail-label--no {
  background: rgba(239, 120, 120, 0.16);
  color: #ef7878;
}

.dash {
  color: var(--text-faint);
}

/* larger, roomier layout on computer-sized screens; unchanged (compact) on mobile */

@media (min-width: 48rem) {
  .page {
    max-width: 56rem;
  }

  .page--narrow {
    max-width: 36rem;
  }

  .page-title {
    font-size: clamp(1.9rem, 3.2vw, 2.4rem);
  }

  .page-sub {
    font-size: 1.05rem;
  }

  .btn {
    font-size: 0.95rem;
    padding: 0.65rem 1.15rem;
  }

  /* calendar, scaled up and centered so it doesn't hug the left edge
     of a wider page */

  .calendar {
    padding: 1.5rem;
    max-width: 36rem;
    margin: 0 auto 0.75rem;
  }

  .calendar-title,
  .cal-select {
    font-size: 1rem;
  }

  .calendar-nav {
    width: 2.1rem;
    height: 2.1rem;
  }

  .calendar-nav svg {
    width: 1.05rem;
    height: 1.05rem;
  }

  .calendar-weekdays span {
    font-size: 0.76rem;
  }

  .calendar-days {
    gap: 0.32rem;
  }

  .calendar-day {
    font-size: 1rem;
    border-radius: 9px;
  }

  .calendar-day-num {
    width: 2.05rem;
    height: 2.05rem;
  }

  .vote-calendar-cell {
    min-height: 7.2rem;
    gap: 0.4rem;
    padding: 0.4rem 0.3rem 0.5rem;
  }

  .vote-calendar-num {
    width: 2.05rem;
    height: 2.05rem;
    min-width: 2.05rem;
    min-height: 2.05rem;
    font-size: 0.92rem;
  }

  .vote-mini-buttons {
    gap: 0.22rem;
  }

  .vote-mini-btn {
    min-height: 1.5rem;
    border-radius: 5px;
  }

  .vote-mini-btn svg {
    width: 0.68rem;
    height: 0.68rem;
  }

  .vote-calendar-tally {
    font-size: 0.7rem;
  }

  /* list rows */

  .option-row,
  .result-row {
    padding: 0.7rem 0.85rem 0.7rem 1.1rem;
  }

  .option-label {
    font-size: 0.98rem;
  }

  .vote-btn {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 8px;
  }

  .vote-btn svg {
    width: 1rem;
    height: 1rem;
  }
}

/* wide desktop: roomy enough for the calendar's 3 vote buttons to sit
   side by side again instead of stacked */

@media (min-width: 64rem) {
  .page {
    max-width: 64rem;
  }

  .calendar {
    max-width: 52rem;
    padding: 1.65rem;
  }

  .calendar-day-num,
  .vote-calendar-num {
    width: 2.3rem;
    height: 2.3rem;
    min-width: 2.3rem;
    min-height: 2.3rem;
  }

  .vote-calendar-cell {
    min-height: 4.6rem;
    gap: 0.3rem;
  }

  .vote-mini-buttons {
    flex-direction: row;
    gap: 0.22rem;
  }

  .vote-mini-btn {
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 5px;
  }

  .vote-mini-btn svg {
    width: 0.72rem;
    height: 0.72rem;
  }

  /* align the response sums in a matching 3-column row directly under
     the 3 vote buttons, instead of a flowing badge list */

  .vote-calendar-tally {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
    width: 100%;
    gap: 0.22rem !important;
  }

  .vc-tally {
    flex: 1;
    min-width: 0;
  }
}

/* large monitors: there's still room to spread out further */

@media (min-width: 80rem) {
  .page {
    max-width: 72rem;
  }

  .calendar {
    max-width: 60rem;
    padding: 1.85rem;
  }

  .calendar-day-num,
  .vote-calendar-num {
    width: 2.5rem;
    height: 2.5rem;
    min-width: 2.5rem;
    min-height: 2.5rem;
    font-size: 1rem;
  }

  .vote-calendar-cell {
    min-height: 5rem;
  }

  .vote-mini-btn {
    width: 1.45rem;
    height: 1.45rem;
  }

  .vote-mini-btn svg {
    width: 0.78rem;
    height: 0.78rem;
  }

  .calendar-days {
    gap: 0.4rem;
  }
}
