/*
 * Who's Available - compact live room board.
 */

:root {
  --bg: #f4f7f3;
  --surface: #ffffff;
  --surface-soft: #eef4ef;
  --surface-strong: #17211d;
  --ink: #17211d;
  --ink-soft: #52605a;
  --ink-muted: #829089;
  --line: rgba(23, 33, 29, 0.13);
  --line-strong: rgba(23, 33, 29, 0.22);
  --accent: #16745c;
  --accent-strong: #0f5a47;
  --accent-soft: #e0f1ea;
  --warn: #b3422f;
  --warn-soft: #f8e7e2;
  --gold: #b9842e;
  --shadow: 0 18px 45px rgba(21, 32, 27, 0.12);
  --shadow-soft: 0 8px 22px rgba(21, 32, 27, 0.08);
  --radius: 8px;
  --radius-sm: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

.dark-mode {
  --bg: #121714;
  --surface: #1b231f;
  --surface-soft: #202d27;
  --surface-strong: #edf5ef;
  --ink: #edf5ef;
  --ink-soft: #b7c3bc;
  --ink-muted: #7d8b83;
  --line: rgba(237, 245, 239, 0.13);
  --line-strong: rgba(237, 245, 239, 0.24);
  --accent: #61c4a3;
  --accent-strong: #91dec5;
  --accent-soft: rgba(97, 196, 163, 0.14);
  --warn: #f09a89;
  --warn-soft: rgba(240, 154, 137, 0.15);
  --gold: #e4bd70;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
  --shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.22);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background:
    linear-gradient(140deg, rgba(22, 116, 92, 0.10), transparent 36%),
    radial-gradient(circle at top right, rgba(185, 132, 46, 0.13), transparent 30%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(22, 116, 92, 0.28);
  outline-offset: 2px;
}

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(780px, 100%);
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--accent);
}

header h1 {
  margin: 0;
  font-size: clamp(24px, 5vw, 36px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.guide-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  color: var(--accent-strong);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.guide-link:hover {
  border-color: var(--line-strong);
}

.comment-pill {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 10px;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-soft);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.icon-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

main {
  width: min(780px, 100%);
  margin: 0 auto;
  padding: 18px;
  padding-bottom: calc(28px + var(--safe-bottom));
}

.panel {
  margin-bottom: 14px;
}

#availabilitySection {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.availability-header,
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.availability-header {
  margin-bottom: 16px;
}

.availability-header h2,
.panel-header h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0;
}

.panel-header {
  padding: 2px 0 10px;
}

.panel-header h2 {
  font-size: 18px;
}

.room-chip,
.count-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.count-badge {
  justify-content: center;
  min-width: 30px;
  color: var(--accent-strong);
}

.quick-taps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
  gap: 10px;
}

.quick-tap {
  --tile-accent: var(--accent);
  --tile-soft: var(--surface-soft);
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  min-height: 132px;
  padding: 14px;
  text-align: left;
  background: var(--tile-soft);
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
  -webkit-user-select: none;
  user-select: none;
}

.quick-tap:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.quick-tap:active {
  transform: translateY(0);
}

.quick-tap.selected {
  color: var(--surface);
  background: color-mix(in srgb, var(--tile-accent) 76%, var(--surface-strong));
  border-color: color-mix(in srgb, var(--tile-accent) 70%, var(--surface-strong));
}

.quick-tap.selected::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 9px;
  height: 9px;
  background: var(--tile-accent);
  border-radius: 50%;
}

.quick-tap-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 42px;
  height: 30px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
  color: color-mix(in srgb, var(--tile-accent) 78%, var(--surface-strong));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.quick-tap.selected .quick-tap-icon {
  color: var(--surface-strong);
  background: color-mix(in srgb, var(--surface) 80%, var(--tile-accent));
  border-color: transparent;
}

.quick-tap[data-kind="quick-hello"] {
  --tile-accent: #16745c;
  --tile-soft: #e7f4ee;
}

.quick-tap[data-kind="phone-call"] {
  --tile-accent: #1c64a0;
  --tile-soft: #e7f0f8;
}

.quick-tap[data-kind="facetime-video"] {
  --tile-accent: #7b4bb2;
  --tile-soft: #f0eaf8;
}

.quick-tap[data-kind="drive-time-call"] {
  --tile-accent: #b06019;
  --tile-soft: #f7eee5;
}

.quick-tap[data-kind="async-text"] {
  --tile-accent: #b43b58;
  --tile-soft: #f8e9ee;
}

.quick-tap-label {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.quick-tap-sub {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
}

.quick-tap.selected .quick-tap-sub {
  color: color-mix(in srgb, var(--surface) 72%, transparent);
}

.audience-row,
.call-length-row,
.duration-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.conversation-note-row {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.conversation-note-row label {
  margin: 0;
}

.conversation-note-row textarea {
  min-height: 108px;
}

.field-hint {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-muted);
}

.preview-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.audience-row {
  align-items: flex-start;
}

.duration-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
}

.audience-pills,
.call-length-pills,
.duration-pills {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.audience-pill,
.call-length-pill,
.dur-pill {
  min-height: 34px;
  padding: 6px 11px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.audience-pill:hover,
.call-length-pill:hover,
.dur-pill:hover {
  color: var(--ink);
}

.audience-pill.active,
.call-length-pill.active,
.dur-pill.active {
  color: var(--surface);
  background: var(--accent);
}

.status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px 16px;
  color: var(--surface);
  background: var(--surface-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.status-banner.hidden {
  display: none;
}

.status-text {
  min-width: 0;
}

#statusMessage {
  display: block;
  font-size: 15px;
  font-weight: 800;
}

.status-timer {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 700;
  color: color-mix(in srgb, var(--surface) 72%, transparent);
  font-variant-numeric: tabular-nums;
}

.status-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.pill-btn,
.secondary-btn,
.primary-btn,
.record-btn,
.file-label {
  min-height: 42px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 800;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.pill-btn {
  color: var(--surface);
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.pill-btn:hover {
  background: rgba(255, 255, 255, 0.17);
}

.done-btn {
  color: #ffd5cc;
}

.primary-btn {
  color: var(--surface);
  background: var(--accent);
  border: 1px solid var(--accent);
}

.primary-btn:hover,
.record-btn:hover {
  transform: translateY(-1px);
}

.primary-btn:disabled,
.secondary-btn:disabled,
.record-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.secondary-btn,
.file-label {
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
}

.secondary-btn:hover,
.file-label:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.small-action {
  min-height: 30px;
  padding: 4px 9px;
  font-size: 12px;
}

.record-btn {
  color: var(--surface);
  background: var(--warn);
  border: 1px solid var(--warn);
}

.link-btn {
  padding: 4px 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-strong);
  background: none;
  border: none;
  cursor: pointer;
}

.link-btn:hover {
  text-decoration: underline;
}

.full-width {
  width: 100%;
}

label {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-soft);
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 11px;
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

input::placeholder,
textarea::placeholder {
  color: var(--ink-muted);
}

textarea {
  min-height: 82px;
  resize: vertical;
}

.slim-input {
  width: 64px;
  padding: 7px 8px;
  text-align: center;
}

.setup-panel {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.setup-panel.hidden {
  display: none;
}

.guide-panel {
  padding: 13px 14px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.purpose-panel {
  background: color-mix(in srgb, var(--accent-soft) 42%, var(--surface));
}

.guide-summary {
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  list-style: none;
}

.guide-summary::-webkit-details-marker {
  display: none;
}

.guide-copy {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 14px;
}

.guide-copy p {
  margin: 0;
}

.guide-copy a {
  width: fit-content;
  color: var(--accent-strong);
  font-weight: 900;
  text-decoration: none;
}

.preview-panel {
  padding: 16px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

#cardPreview {
  margin-top: 10px;
}

.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.setup-details {
  margin-bottom: 12px;
}

.setup-details summary,
.topic-extras summary {
  padding: 8px 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-strong);
  cursor: pointer;
  list-style: none;
}

.setup-hint {
  margin: -2px 0 10px;
  color: var(--ink-soft);
  font-size: 13px;
}

.setup-details summary::-webkit-details-marker,
.topic-extras summary::-webkit-details-marker,
details.topics-panel > summary::-webkit-details-marker {
  display: none;
}

.setup-actions,
.record-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.reach-readiness {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 12px 0 14px;
  padding: 12px;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--accent-soft) 54%, var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.reach-readiness strong {
  display: block;
  color: var(--ink);
}

.reach-readiness span {
  display: block;
  margin-top: 2px;
  font-size: 13px;
}

.contact-method-row {
  display: grid;
  grid-template-columns: minmax(104px, 0.5fr) 1fr auto 36px;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.contact-test-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.contact-test-empty {
  color: var(--ink-muted);
  background: var(--surface);
}

.remove-btn,
.del-btn {
  border: 0;
  background: none;
  color: var(--ink-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.remove-btn {
  width: 36px;
  height: 36px;
  font-size: 18px;
}

.remove-btn:hover,
.del-btn:hover {
  color: var(--warn);
  background: var(--warn-soft);
}

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  color: var(--ink-soft);
  cursor: pointer;
}

.check-label input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

#list {
  display: grid;
  gap: 8px;
}

.person-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.preview-card {
  padding: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.person-card:last-child {
  border-bottom: 1px solid var(--line);
}

.person-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--surface);
  background: var(--accent);
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 900;
}

.person-info {
  min-width: 0;
}

.person-name {
  font-size: 17px;
  font-weight: 900;
}

.person-kinds,
.person-contacts,
.person-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.kind-badge,
.audience-badge,
.call-length-badge,
.primary-contact-link,
.contact-link,
.conversation-link,
.badge-sm {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.primary-contact-link {
  justify-content: center;
  width: fit-content;
  min-height: 42px;
  margin-top: 10px;
  padding: 9px 13px;
  color: var(--surface);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: var(--shadow-soft);
}

.conversation-link {
  color: var(--ink-soft);
  background: var(--surface);
  border-color: var(--line);
  cursor: pointer;
}

.audience-badge {
  color: var(--surface);
  background: var(--surface-strong);
}

.call-length-badge {
  color: color-mix(in srgb, var(--gold) 70%, var(--ink));
  background: color-mix(in srgb, var(--gold) 18%, var(--surface));
}

.primary-contact-link:hover,
.contact-link:hover,
.conversation-link:hover {
  color: var(--ink);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.primary-contact-link:hover {
  color: var(--surface);
  background: var(--accent-strong);
}

.no-contact {
  width: fit-content;
  margin-top: 10px;
  padding: 7px 9px;
  color: var(--warn);
  background: var(--warn-soft);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 800;
}

.primary-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.primary-cta-row .primary-contact-link {
  margin-top: 0;
}

.copy-cta-btn {
  min-height: 42px;
  padding: 9px 14px;
  flex-shrink: 0;
}

.cta-confirm {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 11px;
  background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.cta-confirm-q {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.cta-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.orphan-confirm {
  margin-top: 0;
}

.person-note {
  margin-top: 5px;
  font-size: 13px;
  color: var(--ink-soft);
}

.conversation-note {
  margin-top: 9px;
  padding: 10px 11px;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface-soft) 70%, var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.conversation-note span {
  display: block;
  margin-bottom: 3px;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.person-timer {
  padding: 5px 8px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.empty-state {
  display: grid;
  gap: 4px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
}

.empty-state strong {
  color: var(--ink);
  font-size: 17px;
}

.empty-state span {
  font-size: 14px;
}

details.topics-panel {
  margin-top: 18px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

details.topics-panel > summary {
  cursor: pointer;
  list-style: none;
}

details.topics-panel > summary .panel-header {
  margin: 0;
  padding: 10px 0;
}

details.topics-panel > summary::after {
  content: "Optional";
  float: right;
  margin-top: -38px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-muted);
}

.topics-content {
  display: grid;
  gap: 14px;
  margin-top: 6px;
}

.topic-form,
.record-section,
.topic-item {
  padding: 14px;
  background: color-mix(in srgb, var(--surface) 74%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.topic-form input[type="text"],
.topic-extras textarea {
  margin-bottom: 8px;
}

.topic-options-row {
  display: flex;
  gap: 12px;
  align-items: end;
  margin-bottom: 8px;
}

.topic-options-row input[type="datetime-local"] {
  flex: 1;
}

.inline-field {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.inline-field label {
  margin: 0;
}

.record-row {
  margin-bottom: 8px;
}

.record-section-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 12px;
}

.record-section-header h3 {
  margin: 2px 0 0;
  font-size: 17px;
}

.record-section-header .badge-sm {
  max-width: 44%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-row label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.topic-select {
  margin-bottom: 6px;
}

.file-label input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.audio-preview {
  width: 100%;
  height: 36px;
  margin-top: 8px;
  border-radius: var(--radius-sm);
}

.topic-item {
  margin-bottom: 8px;
}

.topic-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.topic-title {
  font-size: 15px;
  font-weight: 900;
}

.topic-meta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--ink-muted);
}

.topic-badges {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.topic-prompt {
  margin-top: 6px;
}

.topic-responses {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.response-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
}

.response-item + .response-item {
  border-top: 1px solid var(--line);
}

.slim-audio {
  height: 32px;
  max-width: 170px;
  border-radius: var(--radius-sm);
}

.del-btn {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
}

footer {
  padding: 12px 18px 22px;
  text-align: center;
}

footer a {
  color: var(--accent-strong);
  text-decoration: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  z-index: 1000;
  max-width: min(360px, calc(100vw - 32px));
  padding: 11px 16px;
  color: var(--surface);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.muted { color: var(--ink-muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

[data-tooltip] {
  position: relative;
}

@media (hover: hover) {
  [data-tooltip]:hover::after,
  [data-tooltip]:focus-visible::after {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 9px);
    z-index: 300;
    width: max-content;
    max-width: min(300px, calc(100vw - 36px));
    padding: 8px 10px;
    color: var(--surface);
    background: var(--surface-strong);
    border: 1px solid color-mix(in srgb, var(--surface-strong) 80%, white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    content: attr(data-tooltip);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.35;
    pointer-events: none;
    text-align: left;
    white-space: normal;
    transform: translateX(-50%);
  }

  [data-tooltip]:hover::before,
  [data-tooltip]:focus-visible::before {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 3px);
    z-index: 301;
    width: 10px;
    height: 10px;
    background: var(--surface-strong);
    content: "";
    pointer-events: none;
    transform: translateX(-50%) rotate(45deg);
  }

  /* Header sits at the top of the viewport, so its tooltips would render above
     the screen ("the ceiling"). Drop them below the control instead, and anchor
     to the control's right edge so wide tooltips never spill off-screen. */
  header [data-tooltip]:hover::after,
  header [data-tooltip]:focus-visible::after {
    bottom: auto;
    top: calc(100% + 9px);
    left: auto;
    right: 0;
    transform: none;
  }

  header [data-tooltip]:hover::before,
  header [data-tooltip]:focus-visible::before {
    display: none;
  }
}

.name-prompt {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 14, 12, 0.56);
  backdrop-filter: blur(10px);
}

.name-prompt-card {
  width: min(340px, 100%);
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.name-prompt-card h2 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 900;
}

.name-prompt-card p {
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-size: 14px;
}

.name-prompt-card input {
  margin-bottom: 12px;
}

.name-cancel {
  margin-top: 8px;
}

.reach-prompt-card select,
.reach-prompt-card input {
  margin-bottom: 12px;
}

.reach-save-label {
  margin: 0 0 14px;
}

.walkthrough-main {
  display: grid;
  gap: 18px;
}

.walkthrough-hero,
.walkthrough-grid article,
.walkthrough-note {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.walkthrough-hero {
  box-shadow: var(--shadow);
}

.walkthrough-hero h2 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(30px, 6vw, 54px);
  line-height: 1;
  letter-spacing: 0;
}

.walkthrough-hero p:not(.eyebrow),
.walkthrough-grid p,
.walkthrough-note p {
  margin: 10px 0 0;
  color: var(--ink-soft);
}

.walkthrough-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.walkthrough-grid article {
  min-height: 190px;
}

.status-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.status-card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.status-card h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
}

.status-list {
  display: grid;
  gap: 9px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.status-list li {
  position: relative;
  padding-left: 24px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.4;
}

.status-list li strong {
  color: var(--ink);
  font-weight: 800;
}

.status-list.now li::before {
  content: "\2713"; /* check mark */
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent-strong);
  font-weight: 900;
}

.status-list.next li::before {
  content: "\2192"; /* right arrow */
  position: absolute;
  left: 0;
  top: 0;
  color: color-mix(in srgb, var(--gold) 80%, var(--ink));
  font-weight: 900;
}

.status-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.status-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.step-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 18px;
  color: var(--surface);
  background: var(--accent);
  border-radius: var(--radius-sm);
  font-weight: 900;
}

.walkthrough-grid h2,
.walkthrough-note h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
}

@media (max-width: 680px) {
  main,
  .header-inner {
    padding-left: 14px;
    padding-right: 14px;
  }

  .quick-taps {
    grid-template-columns: 1fr 1fr;
  }

  .quick-tap {
    min-height: 118px;
  }

  .walkthrough-grid,
  .status-cols {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  header h1 {
    font-size: 24px;
  }

  .comment-pill {
    display: none;
  }

  #availabilitySection {
    padding: 16px;
  }

  .availability-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .duration-row,
  .call-length-row {
    align-items: stretch;
    flex-direction: column;
  }

  .audience-row {
    align-items: stretch;
    flex-direction: column;
  }

  .audience-pills,
  .call-length-pills,
  .duration-pills {
    display: grid;
  }

  .audience-pills {
    grid-template-columns: 0.8fr 1.2fr;
  }

  .duration-pills {
    grid-template-columns: repeat(4, 1fr);
  }

  .call-length-pills {
    grid-template-columns: repeat(3, 1fr);
  }

  .status-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .status-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .setup-grid,
  .contact-method-row {
    grid-template-columns: 1fr;
  }

  .reach-readiness {
    align-items: stretch;
    flex-direction: column;
  }

  .reach-readiness button,
  .contact-test-link,
  .primary-contact-link {
    width: 100%;
  }

  .primary-cta-row {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .primary-cta-row .primary-contact-link {
    width: 100%;
  }

  .cta-confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .cta-confirm-actions .primary-btn {
    grid-column: 1 / -1;
  }

  .contact-method-row .remove-btn {
    width: 100%;
  }

  .person-card {
    grid-template-columns: 40px 1fr;
  }

  .person-timer {
    grid-column: 2;
    width: fit-content;
  }

  .topic-item-header,
  .response-item {
    flex-direction: column;
    align-items: stretch;
  }

  .slim-audio {
    max-width: 100%;
  }
}
