:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --surface-strong: #f1ede6;
  --ink: #1d2521;
  --muted: #64706a;
  --line: #d9d2c7;
  --accent: #28675a;
  --accent-strong: #174d42;
  --danger: #a53a32;
  --danger-soft: #f8e6e3;
  --shadow: 0 18px 45px rgba(29, 37, 33, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input,
textarea {
  font: inherit;
}

select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(246, 243, 238, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand,
.nav a {
  color: var(--ink);
  text-decoration: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.brand-logo {
  display: block;
  width: clamp(118px, 18vw, 164px);
  height: auto;
}

.brand-name {
  padding-left: 12px;
  border-left: 1px solid var(--line);
  font-size: clamp(1.45rem, 4vw, 1.92rem);
  line-height: 1;
  letter-spacing: 0;
}

.nav {
  display: flex;
  gap: 14px;
  font-weight: 700;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.booking-shell,
.speaker-portal-shell,
.admin-shell {
  padding: clamp(32px, 6vw, 72px) 0;
}

.intro {
  max-width: 680px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 12px;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: 0.95;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  line-height: 1.1;
}

h3 {
  margin-bottom: 0;
  font-size: 1.1rem;
}

.intro p:not(.eyebrow),
.selected-slot,
.section-heading {
  color: var(--muted);
}

.timezone-note {
  color: var(--accent-strong);
  font-weight: 800;
}

.booking-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 20px;
  align-items: start;
}

.calendar-panel,
.booking-panel,
.admin-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.calendar-panel,
.booking-panel {
  padding: clamp(18px, 3vw, 28px);
}

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

.slot-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.day-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(0, 1.4fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.day-label {
  font-weight: 800;
}

.day-date {
  color: var(--muted);
  font-size: 0.92rem;
}

.slot-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.slot-button,
.primary-button,
.ghost-button,
.danger-button {
  min-height: 42px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 800;
}

.slot-button {
  display: grid;
  place-items: center;
  gap: 2px;
  background: var(--surface);
  border-color: var(--line);
  color: var(--accent-strong);
  padding: 8px;
}

.slot-button small {
  max-width: 100%;
  overflow: hidden;
  color: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-button:hover:not(:disabled),
.slot-button.selected,
.slot-button.booked-slot {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.slot-button:disabled,
.slot-button.booked-slot {
  cursor: pointer;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.slot-button:disabled > span,
.slot-button.booked-slot > span {
  text-decoration: line-through;
}

.slot-button:disabled small,
.slot-button.booked-slot small {
  color: #fff;
  text-decoration: none;
}

.slot-button.booked-slot {
  cursor: pointer;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-strong);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.ghost-button {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
  padding: 0 14px;
}

.danger-button {
  background: var(--danger-soft);
  color: var(--danger);
  padding: 0 14px;
}

.stacked-form,
.inline-form {
  display: grid;
  gap: 14px;
}

.checkbox-label {
  grid-template-columns: 22px 1fr;
  align-items: start;
  font-weight: 700;
}

.checkbox-label input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.bot-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
}

.radio-field {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.radio-field legend {
  padding: 0 4px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
}

.radio-field label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.radio-field input {
  width: 18px;
  min-height: 18px;
}

input,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(40, 103, 90, 0.22);
  outline-offset: 2px;
}

.form-message {
  min-height: 24px;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.form-message.error {
  color: var(--danger);
}

.form-message.success {
  color: var(--accent-strong);
}

.section-heading {
  margin-bottom: 16px;
}

.admin-card {
  padding: clamp(16px, 3vw, 24px);
}

.admin-card + .admin-card {
  margin-top: 16px;
}

.inline-form {
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
}

.hidden {
  display: none;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 16px;
}

.booking-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.35fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
}

.filter-count {
  min-width: 120px;
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.health-card {
  display: grid;
  gap: 10px;
  min-height: 126px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.health-card div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.health-card strong,
.health-card span {
  font-weight: 900;
}

.health-card code {
  display: block;
  max-height: 72px;
  overflow: auto;
  padding: 8px;
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 0.74rem;
  white-space: pre-wrap;
}

.health-ok {
  border-color: #b8ddce;
}

.health-warning {
  border-color: #ead58b;
}

.health-critical {
  border-color: #e0aaa4;
}

.queue-health {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.speaker-task-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.speaker-archive-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.speaker-archive-card {
  display: grid;
  grid-template-columns: 64px minmax(160px, 0.7fr) minmax(220px, 1fr) minmax(180px, 0.8fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.speaker-archive-card img,
.archive-avatar {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.archive-avatar {
  display: grid;
  place-items: center;
  background: var(--surface-strong);
  color: var(--accent-strong);
  font-weight: 900;
}

.speaker-archive-card strong,
.speaker-archive-card span {
  display: block;
}

.speaker-archive-card span {
  color: var(--muted);
  font-weight: 800;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-list span {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 900;
}

.speaker-task-card {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(140px, 0.7fr) auto minmax(220px, 1.2fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.speaker-task-card strong,
.speaker-task-card span {
  display: block;
}

.speaker-task-card span,
.speaker-task-card p,
.speaker-task-card li {
  color: var(--muted);
  font-weight: 800;
}

.speaker-task-card p {
  margin: 0;
}

.speaker-task-card ul {
  margin: 0;
  padding-left: 18px;
}

.readiness-meter {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-strong);
}

.readiness-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.settings-summary {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.settings-summary dl {
  display: grid;
  grid-template-columns: minmax(110px, 0.35fr) 1fr;
  gap: 8px 14px;
  margin: 0;
}

.settings-summary dt {
  color: var(--muted);
  font-weight: 800;
}

.settings-summary dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.dashboard-card {
  display: grid;
  gap: 4px;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.dashboard-card[data-status] {
  cursor: pointer;
}

.dashboard-card[data-status]:hover {
  border-color: var(--accent);
}

.dashboard-card span,
.dashboard-card small {
  color: var(--muted);
  font-weight: 800;
}

.dashboard-card strong {
  font-size: 2rem;
  line-height: 1;
}

.dashboard-card-wide {
  grid-column: span 2;
}

.admin-calendar {
  margin-top: 16px;
}

.calendar-sync-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}

.calendar-sync-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 12px;
}

.calendar-sync-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.calendar-steps {
  margin: 16px 0 0;
  padding-left: 22px;
  color: var(--muted);
  font-weight: 800;
}

.calendar-private-note {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid #fff0c7;
  border-radius: 8px;
  background: #fff8dd;
  color: #745214;
  font-weight: 900;
}

.admin-calendar .fc {
  color: var(--ink);
}

.admin-calendar .fc-button-primary {
  background: var(--accent);
  border-color: var(--accent);
}

.admin-calendar .calendar-open {
  background: #dff2ea;
  border-color: #174d42;
  color: #174d42;
}

.admin-calendar .calendar-booked {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.booking-select {
  width: 20px;
  height: 20px;
  min-height: 20px;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-links a {
  color: var(--accent-strong);
  font-weight: 800;
}

.table-muted {
  color: var(--muted);
  font-size: 0.88rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
}

.calendar-feed-pill {
  display: inline-flex;
  margin-top: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #dff2ea;
  color: #174d42;
  font-size: 0.72rem;
  font-weight: 900;
}

.calendar-feed-pill-muted {
  background: var(--surface-strong);
  color: var(--muted);
}

.readiness-pill {
  display: inline-flex;
  margin-top: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
}

.readiness-good {
  background: #dff2ea;
  color: #174d42;
}

.readiness-needs-work {
  background: #fff0c7;
  color: #745214;
}

.readiness-list {
  margin: 8px 0 0;
  padding-left: 18px;
}

.checklist-field {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.checklist-field legend {
  padding: 0 6px;
  color: var(--muted);
  font-weight: 900;
}

.checklist-summary {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.checklist-summary li {
  color: var(--muted);
  font-weight: 800;
}

.checklist-summary li.done {
  color: var(--accent-strong);
}

.google-sync-pill {
  display: inline-flex;
  margin-top: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.google-sync-ok {
  background: #dff2ea;
  color: #174d42;
}

.google-sync-pending {
  background: #fff0c7;
  color: #745214;
}

.google-sync-failed {
  background: var(--danger-soft);
  color: var(--danger);
}

.google-sync-muted {
  background: var(--surface-strong);
  color: var(--muted);
}

.status-confirmed {
  background: #dff2ea;
  color: #174d42;
}

.status-follow-up {
  background: #fff0c7;
  color: #745214;
}

.status-completed {
  background: #e2ecff;
  color: #274674;
}

.status-cancelled {
  background: var(--danger-soft);
  color: var(--danger);
}

.booking-detail {
  display: grid;
  gap: 18px;
  margin-top: 16px;
}

.booking-detail h4 {
  margin: 0 0 4px;
  font-size: 1.25rem;
}

.booking-detail dl {
  display: grid;
  grid-template-columns: minmax(120px, 0.28fr) 1fr;
  gap: 10px 18px;
  margin: 0;
}

.booking-detail dt {
  color: var(--muted);
  font-weight: 800;
}

.booking-detail dd {
  margin: 0;
}

.booking-detail .copy-portal-link {
  margin-left: 8px;
}

.booking-quick-actions {
  justify-content: flex-start;
}

.edit-booking-form {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(29, 37, 33, 0.48);
}

.modal.hidden {
  display: none;
}

.modal-panel {
  width: min(640px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  padding: clamp(18px, 3vw, 28px);
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.speaker-detail {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.speaker-headshot {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.speaker-detail h3 {
  margin: 0;
  font-size: 1.45rem;
}

.speaker-detail dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.speaker-detail dt {
  color: var(--muted);
  font-weight: 800;
}

.speaker-detail dd {
  margin: 0;
}

.status-note {
  padding: 10px 12px;
  border: 1px solid #d9d2c7;
  border-radius: 6px;
  background: #fbfaf7;
  color: var(--muted);
  font-weight: 800;
}

.reminder-form {
  margin-top: 16px;
}

#waitlist-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.template-manager {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.template-manager h4 {
  margin: 0;
  font-size: 1rem;
}

.template-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.template-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

#template-form {
  margin-top: 14px;
}

.template-actions {
  justify-content: flex-start;
}

#test-email-form {
  grid-template-columns: minmax(220px, 1fr) auto;
  margin-top: 12px;
}

.email-log {
  margin: 8px 0 0;
  padding-left: 18px;
}

.email-summary {
  font-weight: 900;
}

.email-summary.success {
  color: var(--accent-strong);
}

.email-summary.error {
  color: var(--danger);
}

.booking-timeline {
  display: grid;
  gap: 8px;
}

.timeline-event {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.timeline-event span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.audit-log {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.activity-feed {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.activity-event {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.activity-event span,
.activity-event small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 800;
}

.audit-event {
  display: grid;
  grid-template-columns: minmax(160px, 0.35fr) minmax(180px, 0.3fr) minmax(240px, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.audit-event span {
  color: var(--muted);
  font-weight: 800;
}

.audit-event code {
  overflow-wrap: anywhere;
}

th {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

td:last-child,
th:last-child {
  text-align: right;
}

.schedule-editor {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.schedule-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.55fr) minmax(220px, 1fr) minmax(140px, auto) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.schedule-row .danger-button {
  min-width: 96px;
}

.schedule-lock {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

@media (max-width: 860px) {
  .booking-grid,
  .day-row,
  .inline-form,
  .booking-filters,
  .dashboard-grid,
  .health-grid,
  .queue-health,
  .speaker-archive-card,
  .speaker-task-card,
  .calendar-sync-grid,
  .calendar-sync-status,
  .settings-grid,
  .settings-summary dl,
  .schedule-row,
  .template-row,
  .audit-event {
    grid-template-columns: 1fr;
  }

  .dashboard-card-wide {
    grid-column: auto;
  }

  .slot-buttons {
    grid-template-columns: repeat(3, minmax(82px, 1fr));
  }
}

@media (max-width: 560px) {
  .topbar,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .slot-buttons {
    grid-template-columns: 1fr;
  }

  .admin-actions {
    width: 100%;
  }

  .admin-actions button {
    flex: 1;
  }

  .booking-detail dl {
    grid-template-columns: 1fr;
  }

  .calendar-sync-actions {
    justify-content: flex-start;
  }
}
