:root {
  color-scheme: light;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
}

body {
  margin: 0;
  padding: 48px;
  background: #f6f7fb;
  color: #111827;
}

main {
  max-width: 900px;
  background: #ffffff;
  padding: 32px;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(17, 24, 39, 0.08);
}

h1 {
  margin: 0 0 12px;
  font-size: 32px;
}

a {
  color: #2563eb;
}

ul {
  padding-left: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

thead th {
  text-align: left;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 8px;
}

tbody td {
  padding: 10px 0;
  border-bottom: 1px solid #e5e7eb;
}

button {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #111827;
  color: #ffffff;
  cursor: pointer;
}

button:hover {
  opacity: 0.9;
}

body.home {
  background: radial-gradient(circle at top left, #edf4ff 0%, #f7f1ec 35%, #f3f5fb 70%, #eef7f2 100%);
  color: #101525;
  font-family: "Avenir Next", "Gill Sans", "Trebuchet MS", "Segoe UI", sans-serif;
  position: relative;
  overflow-x: hidden;
}

body.home::before,
body.home::after {
  content: "";
  position: absolute;
  inset: auto;
  border-radius: 999px;
  filter: blur(0px);
  opacity: 0.55;
  z-index: 0;
  animation: float 18s ease-in-out infinite;
}

body.home::before {
  width: 320px;
  height: 320px;
  top: -120px;
  right: -60px;
  background: radial-gradient(circle, rgba(255, 201, 150, 0.7), rgba(255, 201, 150, 0));
}

body.home::after {
  width: 420px;
  height: 420px;
  bottom: -160px;
  left: -120px;
  background: radial-gradient(circle, rgba(160, 197, 255, 0.6), rgba(160, 197, 255, 0));
  animation-delay: -6s;
}

.home-shell {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(12px);
}

.home-shell h1,
.home-shell h2,
.home-shell h3 {
  font-family: "Iowan Old Style", "Palatino", "Times New Roman", serif;
  letter-spacing: -0.02em;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
  align-items: center;
  margin-bottom: 48px;
}

.hero-copy h1 {
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  margin: 0 0 16px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.7rem;
  font-weight: 700;
  color: #5b6c91;
  margin-bottom: 12px;
}

.lede {
  font-size: 1.15rem;
  color: #344054;
  margin-bottom: 24px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.page-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-wrap: nowrap;
}

.cta {
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta.primary {
  background: #111827;
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(17, 24, 39, 0.2);
}

.cta.ghost {
  border: 1px solid #c7d2fe;
  color: #1f2937;
  background: #ffffff;
}

.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.18);
}

.hero-panel .panel-card {
  padding: 28px;
  border-radius: 20px;
  background: linear-gradient(140deg, #ffffff 0%, #f6f3ef 100%);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.hero-panel ul {
  margin: 18px 0 0;
  padding-left: 18px;
  color: #475467;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.page-title {
  margin: 0;
  font-size: clamp(2rem, 3.4vw, 2.9rem);
}

.page-subtitle {
  margin: 6px 0 0;
  color: #4b5563;
}

.page-card {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  padding: 22px;
  box-shadow: 0 16px 30px rgba(148, 163, 184, 0.12);
  margin-bottom: 22px;
}

.section-title {
  margin: 0 0 14px;
  font-size: 1.2rem;
}

.form-grid p {
  display: grid;
  gap: 6px;
  margin: 0 0 14px;
}

.form-grid label {
  font-weight: 600;
  color: #1f2937;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #d0d5dd;
  font: inherit;
  background: #ffffff;
}

.form-grid textarea {
  min-height: 110px;
  resize: vertical;
}

.form-actions {
  margin-top: 6px;
}

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

.nav-list a {
  text-decoration: none;
  font-weight: 600;
  color: #111827;
}

.nav-list form,
.link-row form {
  margin: 0;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.link-row a {
  color: #1f2937;
  font-weight: 600;
  text-decoration: none;
}

button.link-button {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #1f2937;
  font: inherit;
  font-weight: 600;
}

button.link-button:hover {
  opacity: 1;
  text-decoration: underline;
}

.table-card table {
  margin-top: 0;
}

.table-wrap {
  overflow-x: auto;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.action-row form {
  margin: 0;
}

.segment-edit-form {
  margin: 16px 4px 0;
  max-width: 100%;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  gap: 10px;
}

.segment-edit-form .form-control {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.segment-list {
  display: grid;
  gap: 18px;
  padding: 4px 0;
}

.segment-item {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 20px 22px;
  background: #ffffff;
  margin-bottom: 2px;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
}

.segment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.segment-content p {
  margin: 0 0 12px;
  line-height: 1.6;
}

.pagination-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 6px 0 14px;
  flex-wrap: wrap;
}

.pagination-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pagination-form input,
.pagination-form select {
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  min-width: 92px;
}

.variant-actions-wrap {
  padding: 4px 2px;
}

.variant-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.variant-action-form {
  flex: 1 1 220px;
  margin: 0;
}

.pagination-form button {
  padding: 6px 10px;
}

.speaker-picker {
  position: relative;
  min-width: 190px;
}

.speaker-picker-toggle {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  text-align: left;
  background: #ffffff;
}

.speaker-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 240px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.15);
  padding: 6px;
}

.speaker-option {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
  margin: 2px 0;
  padding: 8px 10px;
}

.speaker-option.active {
  border-color: rgba(0, 0, 0, 0.2);
}

.speaker-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #e0f2fe;
  color: #075985;
}

.pill.muted {
  background: #f3f4f6;
  color: #6b7280;
}

.module-grid {
  padding: 32px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
}

.module-grid.alt {
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.module-grid header h2 {
  margin: 6px 0 10px;
  font-size: clamp(1.6rem, 2.6vw, 2.3rem);
}

.subtle {
  color: #4b5563;
  margin: 0 0 18px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
}

.cards article {
  padding: 18px 20px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 16px 30px rgba(148, 163, 184, 0.12);
  animation: rise 0.6s ease both;
}

.cards article:nth-child(2) {
  animation-delay: 0.06s;
}

.cards article:nth-child(3) {
  animation-delay: 0.12s;
}

.cards article:nth-child(4) {
  animation-delay: 0.18s;
}

.closing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  padding-top: 36px;
}

.closing .cta-row {
  justify-content: flex-start;
  align-items: center;
}

.closing .cta-row .cta {
  flex: 1 1 auto;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(18px);
  }
}

@media (max-width: 720px) {
  body {
    padding: 24px;
  }

  .home-shell {
    padding: 28px;
  }

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

  .cta-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-nav {
    align-self: flex-end;
    align-items: flex-end;
  }
}
