:root {
  --ink: #26313d;
  --muted: #6d7a89;
  --line: #dce7ee;
  --teal: #009c9c;
  --teal-dark: #007d80;
  --blue: #2f7bb7;
  --paper: #f3f8fa;
}

* {
  box-sizing: border-box;
}

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

.deck-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.deck-toolbar button,
.toolbar-link,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-weight: 850;
  text-decoration: none;
}

.toolbar-link,
.ghost-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--teal-dark);
}

.deck-shell {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.details-panel {
  position: sticky;
  top: 75px;
  align-self: start;
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.details-panel img {
  width: 170px;
}

.details-panel h1,
.details-panel p {
  margin: 0;
}

.details-panel h1 {
  color: var(--teal-dark);
  font-size: 22px;
}

.details-panel p {
  color: var(--muted);
  font-weight: 650;
}

#deck-details-form {
  display: grid;
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  color: var(--ink);
  font: inherit;
}

.deck-preview {
  display: grid;
  gap: 18px;
}

.readiness-panel {
  display: grid;
  gap: 10px;
  width: min(1120px, 100%);
  padding: 16px 18px;
  border: 1px solid #f0d5ad;
  border-radius: 8px;
  background: #fff9f0;
  color: #8a5514;
}

.readiness-panel.ready {
  border-color: #bfe4d7;
  background: #f0fbf6;
  color: #117a59;
}

.readiness-panel strong,
.readiness-panel span,
.readiness-panel a {
  display: block;
}

.readiness-panel a {
  color: inherit;
  font-weight: 900;
}

.readiness-panel ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 16px;
  margin: 0;
  padding-left: 18px;
}

.loading-card {
  display: grid;
  place-items: center;
  min-height: 420px;
  gap: 14px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.loading-card img {
  width: 240px;
}

.slide {
  position: relative;
  overflow: hidden;
  width: min(1120px, 100%);
  aspect-ratio: 16 / 9;
  padding: 42px 54px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(38, 49, 61, 0.12);
  break-after: page;
}

.slide::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 156, 156, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(0, 156, 156, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
}

.slide > * {
  position: relative;
  z-index: 1;
}

.slide-number {
  position: absolute;
  top: 34px;
  right: 42px;
  color: rgba(0, 125, 128, 0.7);
  font-size: 30px;
  font-weight: 900;
}

.clinic-footer {
  position: absolute;
  right: 42px;
  bottom: 28px;
  color: var(--teal-dark);
  font-size: 14px;
  font-weight: 850;
}

.brand-mark {
  width: 220px;
  height: auto;
}

.cover-slide {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 36px;
}

.cover-slide h1,
.cover-slide h2,
.slide h2,
.slide h3,
.slide p {
  margin: 0;
}

.cover-slide h1 {
  color: var(--teal-dark);
  font-size: clamp(38px, 5vw, 72px);
  letter-spacing: 0;
  text-transform: uppercase;
}

.cover-slide h2 {
  margin-top: 14px;
  color: var(--ink);
  font-size: 30px;
  font-weight: 750;
}

.cover-slide .doctor {
  margin-top: 26px;
  color: var(--teal-dark);
  font-size: 24px;
  font-weight: 800;
}

.cover-photo {
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  aspect-ratio: 4 / 5;
  background: #e8f5f5;
}

.cover-photo img,
.image-card img,
.grid-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide-title {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.slide-title p {
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.slide-title h2 {
  color: var(--ink);
  font-size: 34px;
  text-transform: uppercase;
}

.summary-text,
.bullet-text {
  color: var(--ink);
  font-size: 24px;
  line-height: 1.52;
  font-weight: 650;
  white-space: pre-line;
}

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

.summary-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.65fr);
  gap: 16px;
}

.summary-layout .summary-text {
  grid-row: span 2;
}

.assessment-card {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(243, 248, 250, 0.72);
}

.assessment-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.assessment-card strong {
  white-space: pre-line;
  font-size: 18px;
  line-height: 1.38;
}

.image-layout {
  display: grid;
  grid-template-columns: 1fr 0.75fr;
  gap: 22px;
  align-items: stretch;
}

.image-card {
  overflow: hidden;
  min-height: 370px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e8f5f5;
}

.findings-box {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(243, 248, 250, 0.84);
}

.photo-grid-slide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.grid-photo {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e8f5f5;
  aspect-ratio: 4 / 3;
}

.empty-photo {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 18px;
  color: var(--muted);
  font-weight: 850;
  text-align: center;
}

@media print {
  @page {
    size: 13.333in 7.5in;
    margin: 0;
  }

  body {
    background: #fff;
  }

  .deck-toolbar,
  .details-panel,
  .no-print {
    display: none;
  }

  .deck-shell {
    display: block;
    padding: 0;
  }

  .deck-preview {
    gap: 0;
  }

  .slide {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }
}

@media (max-width: 980px) {
  .deck-shell {
    grid-template-columns: 1fr;
  }

  .details-panel {
    position: static;
  }
}
