/* Shared flow UI — create · respond · merge (components showcase + reference) */

/* admin — progress */
.progress-bar {
  display: flex;
  margin: 0 24px 16px;
  background: var(--grey-300);
  border-radius: 10px;
  overflow: hidden;
}
.progress-step {
  flex: 1;
  height: 4px;
  background: var(--grey-300);
  transition: background 0.2s ease;
}
.progress-step.done,
.progress-step.active { background: var(--blue); }

/* admin — calendar */
.calendar-card h3 { margin-bottom: 12px; }
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cal-header span { font-size: 15px; font-weight: 600; color: var(--grey-900); }
.cal-nav {
  border: none;
  background: none;
  color: var(--grey-700);
  cursor: pointer;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}
.cal-weekdays span {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--grey-500);
  padding: 4px 0;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
}
.cal-day {
  aspect-ratio: 1;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--grey-900);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-day.empty { pointer-events: none; }
.cal-day:hover:not(.empty):not(.range):not(.start):not(.end) { background: var(--bg); }
.cal-day.range { background: var(--blue-50); color: var(--blue); }
.cal-day.start,
.cal-day.end { background: var(--blue); color: var(--white); font-weight: 600; }
.cal-day.disabled { color: var(--grey-300); cursor: not-allowed; pointer-events: none; }
.cal-selected {
  font-size: 12px;
  font-weight: 500;
  color: var(--grey-500);
  margin-top: 20px;
  text-align: right;
}

/* admin — member row & role select */
.member { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.member-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }

.member-row {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.member-row:has(.role-select-trigger[aria-expanded="true"]) { z-index: 40; }
.member-row .member-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 0 1 auto;
}
.member-row .member-name {
  width: auto;
  min-width: 3ch;
  max-width: 10em;
  field-sizing: content;
  border: none;
  background: transparent;
  font-size: 15px;
  font-weight: 500;
  color: var(--grey-900);
  outline: none;
  padding: 0;
}
.member-row .member-name::placeholder { color: var(--grey-500); }

.role-select { position: relative; flex-shrink: 0; }
.role-select-trigger {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 4px 5px 8px;
  cursor: pointer;
  transition: opacity 0.15s ease;
  line-height: 1;
}
.role-select-trigger.required { background: #E8F3FF; color: var(--blue); }
.role-select-trigger.optional { background: var(--grey-300); color: var(--grey-700); }
.role-select-trigger[aria-expanded="true"] { opacity: 0.92; }
.role-select-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  opacity: 0.7;
  transition: transform 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}
.role-select-trigger[aria-expanded="true"] .role-select-chevron { transform: rotate(180deg); }
.role-select-content {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 88px;
  background: var(--white);
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
  z-index: 30;
  transform-origin: top right;
  opacity: 0;
  transform: scale(0.96) translateY(-4px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s cubic-bezier(0.32, 0.72, 0, 1);
}
.role-select-content.open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}
.role-select-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 10px 10px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--grey-900);
  cursor: pointer;
  text-align: left;
}
.role-select-item:hover,
.role-select-item:focus-visible { background: var(--bg); outline: none; }
.role-select-item[aria-selected="true"] { font-weight: 600; }
.role-select-check {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  flex-shrink: 0;
}

.member-delete {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--grey-500);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.member-delete:hover { color: var(--grey-700); }
.member-delete svg { width: 16px; height: 16px; }
.member-row[data-host="true"] .member-delete { visibility: hidden; pointer-events: none; }

.add-member {
  width: 100%;
  padding: 16px;
  border: 1.5px dashed var(--grey-300);
  border-radius: 16px;
  background: transparent;
  color: var(--blue);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

/* attendee — day row */
.day-list {
  display: flex;
  flex-direction: column;
  gap: var(--card-gap);
}

.day-row {
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 56px;
  padding: var(--s-4) var(--s-5);
  background: var(--white);
  border-radius: var(--radius-card, 16px);
  border: 2px solid transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.day-list .day-row { margin-bottom: 0; }
.day-row:focus { outline: none; }
.day-row:not(.blocked):focus:not(:focus-visible) { border-color: transparent; }
.day-row:focus-visible { border-color: var(--blue); }
.day-row:active:not(.blocked) { background: var(--bg); }
.day-row.blocked {
  background: #FFF5F5;
  border-color: var(--red);
  color: var(--red);
}
.day-row.blocked:focus-visible { border-color: var(--red); }
.day-row.blocked:active { background: #FFEBEB; }
.day-row-hint { color: var(--grey-500); }

.name-error { font-size: 14px; color: var(--red); margin-top: 8px; }

/* grids — attendee input & host heatmap */
.grid-wrap { background: var(--white); border-radius: 16px; overflow-x: auto; }
.grid-wrap.interactive { user-select: none; -webkit-user-select: none; }
.grid { display: grid; grid-template-columns: 36px repeat(5, 1fr); gap: 2px; font-size: 10px; }
.grid.input-grid .day { font-size: 11px; font-weight: 600; color: var(--grey-700); text-align: center; }
.grid.input-grid .hour { font-size: 10px; color: var(--grey-500); display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; align-self: center; }
.grid.input-grid .cell { width: 100%; }
.grid .day { text-align: center; font-weight: 600; color: var(--grey-700); padding: 4px; }
.grid .hour { color: var(--grey-500); display: flex; align-items: center; }
.cell { border-radius: 4px; background: rgba(209, 214, 219, 0.3); cursor: pointer; touch-action: none; }
.cell.unavail { background: rgba(240, 68, 82, 0.25); }
.cell.pref { background: rgba(255, 220, 100, 0.35); }
.cell.blocked { background: rgba(209, 214, 219, 0.6); cursor: not-allowed; }

.mode-toggle {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg);
  border-radius: 12px;
  margin-bottom: 12px;
}
.mode-toggle button {
  flex: 1;
  height: 40px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  cursor: pointer;
}
.mode-toggle button.unavail { background: var(--red); color: var(--white); font-weight: 600; }
.mode-toggle button.unavail.inactive { background: transparent; color: var(--grey-700); font-weight: 500; }
.mode-toggle button.pref { background: var(--amber-bg); color: #8B6914; font-weight: 600; }
.mode-toggle button.pref.inactive { background: transparent; color: var(--grey-700); font-weight: 500; }

/* host — heatmap */
.heatmap .cell.best { background: var(--blue-50); border: 2px solid transparent; }
.heatmap .cell.coord { background: rgba(49, 130, 246, 0.12); border: 2px solid transparent; }
.heatmap .cell.ok { background: rgba(209, 214, 219, 0.3); border: 2px solid transparent; }
.heatmap .cell.bad,
.heatmap .cell.disabled {
  background: rgba(209, 214, 219, 0.55);
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
.heatmap .cell.selectable {
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.heatmap .cell.selectable.selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px rgba(49, 130, 246, 0.08);
  background: var(--white);
}
.heatmap .cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  overflow: hidden;
  border-radius: 4px;
  border: 2px solid transparent;
}

.layer-grid .layer-cell {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(209, 214, 219, 0.22);
}
.cell-label { font-size: 12px; font-weight: 600; text-align: center; line-height: 1.15; pointer-events: none; }
.cell-label.all-ok { color: var(--blue); }
.avail-badge.heat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 5px;
  border-radius: 4px;
  line-height: 1;
}
.avail-badge.unavail { background: rgba(240, 68, 82, 0.2); color: var(--red); }
.avail-badge.pref { background: rgba(255, 220, 100, 0.45); color: #8B6914; }

/* host — layer toggles */
.member-toggles { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.member-toggle {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--grey-300);
  background: var(--white);
  font-size: 13px;
  font-weight: 600;
  color: var(--grey-700);
  cursor: pointer;
}
.member-toggle.active {
  border-color: var(--blue);
  background: var(--blue-50);
  color: var(--blue);
}
.member-toggle.pending {
  cursor: not-allowed;
  border: 1px solid #EEF0F2;
  background: #F9FAFB;
  color: #C5CBD3;
  font-weight: 500;
}
.member-toggle.pending .mandatory-mark { color: #C5CBD3; }
.member-toggle .mandatory-mark { font-size: 12px; }

.submission-count,
.screen-meta {
  color: var(--blue);
  font-size: var(--text-sub);
  font-weight: 600;
  margin-bottom: var(--s-2);
}

.attendee-row { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; font-size: 14px; }

/* components showcase layout */
.showcase-panel {
  background: var(--bg);
  border-radius: 20px;
  padding: 20px 24px;
  max-width: 390px;
}
.showcase-panel h2 { font-size: 22px; margin-bottom: 8px; }
.showcase-panel .sub { margin-bottom: 16px; }
.showcase-source {
  font-size: 12px;
  color: var(--grey-500);
  margin-top: 14px;
}
.showcase-source a {
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
}
.showcase-source a:hover { text-decoration: underline; }
.showcase-cta-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.showcase-cta-row .cta {
  position: static;
  width: 100%;
}
