:root {
  --canvas: #f7f5f0;
  --panel: #ffffff;
  --ink: #1f2a2a;
  --muted: #63706d;
  --sage: #477665;
  --sage-dark: #345e50;
  --amber: #b7791f;
  --error: #a83d35;
  --border: #dad7ce;
  --soft: #ebe7dc;
  --focus: #234f44;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

button,
input,
select,
textarea {
  font: inherit;
  font-variant-numeric: tabular-nums;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 14px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--border);
  background: rgba(247, 245, 240, 0.96);
}

.brand {
  width: max-content;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.signin {
  justify-self: end;
  color: var(--muted);
  font-size: 0.94rem;
  text-decoration: none;
}

.intro {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px clamp(16px, 4vw, 40px) 8px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 6px;
  color: var(--sage);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  line-height: 1.14;
}

h1 {
  max-width: 980px;
  font-size: clamp(2rem, 4.1vw, 3.5rem);
  text-wrap: balance;
}

.headline-keep {
  white-space: nowrap;
}

h2 {
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
}

.intro p:last-child,
.section-heading p,
.checklist-empty,
.draft-placeholder,
small,
.muted-status {
  color: var(--muted);
}

.checklist-empty {
  margin: 0;
}

.intro p:last-child {
  max-width: 760px;
  margin: 6px 0 0;
  font-size: 0.95rem;
}

.workspace {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) minmax(280px, 340px);
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto 48px;
  padding: 0 clamp(16px, 4vw, 40px);
  align-items: start;
}

.rail,
.panel,
.checklist {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
}

@media (min-width: 721px) {
  .rail {
    align-self: start;
    max-height: min(475px, calc(100vh - 112px));
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .checklist {
    align-self: start;
    position: sticky;
    top: 88px;
  }
}

.rail {
  position: sticky;
  top: 88px;
  display: grid;
}

.rail {
  padding: 14px;
}

.rail-toggle {
  display: none;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 10px 12px;
  font-weight: 700;
  text-align: left;
}

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

.stage-list li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 7px 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--soft);
  border-radius: 8px;
}

.stage-list span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--soft);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
}

.stage-list strong {
  font-size: 0.92rem;
}

.stage-list em {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.8rem;
  font-style: normal;
}

.stage-list li.complete span,
.stage-list li.active span {
  background: var(--sage);
  color: #ffffff;
}

.stage-list li.attention span {
  background: #fff4dd;
  color: var(--amber);
}

.canvas {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.canvas,
.canvas > *,
.panel {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: clamp(16px, 2.5vw, 24px);
}

.section-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.section-heading p {
  margin: 0;
}

.error-summary {
  margin-bottom: 18px;
  border: 1px solid var(--error);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff7f5;
  color: var(--error);
  font-weight: 700;
}

.error-summary:focus {
  outline: 3px solid rgba(168, 61, 53, 0.25);
  outline-offset: 2px;
}

fieldset {
  margin: 0 0 18px;
  border: 0;
  padding: 0;
}

legend,
.form-grid label > span,
.editor-label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-weight: 700;
}

.template-options {
  display: grid;
  gap: 10px;
  align-items: stretch;
}

.template-options label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  min-height: 0;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.template-options input {
  flex: 0 0 auto;
  width: auto;
  margin-top: 4px;
  accent-color: var(--sage);
  cursor: pointer;
}

.template-options label:has(input:checked) {
  border-color: var(--sage);
  box-shadow: 0 0 0 2px rgba(71, 118, 101, 0.14);
}

.template-options label > span {
  display: block;
  margin-bottom: 0;
  color: var(--ink);
  font-weight: 400;
}

.template-options strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
}

.template-options small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.35;
}

.template-options small,
label small {
  display: block;
  margin-top: 4px;
}

@media (min-width: 1210px) {
  .template-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.template-prompts {
  margin-bottom: 20px;
  border: 1px solid #ead8b3;
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff9ec;
  color: #6c4b12;
}

.template-prompts p {
  margin: 0;
}

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

label {
  min-width: 0;
}

.wide {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfcbbf;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 11px 12px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(71, 118, 101, 0.28);
  outline-offset: 2px;
}

.invalid {
  border-color: var(--error);
}

.field-error {
  min-height: 1.3em;
  margin: 5px 0 0;
  color: var(--error);
  font-size: 0.86rem;
}

.draft-placeholder {
  min-height: 118px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 18px;
}

.draft-placeholder p {
  margin: 0 0 8px;
}

.loading-draft {
  display: grid;
  gap: 12px;
}

.loading-draft p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.skeleton {
  height: 62px;
  border-radius: 8px;
  background: linear-gradient(90deg, #ebe7dc 0%, #f5f2ea 50%, #ebe7dc 100%);
  background-size: 220% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}

.skeleton.short {
  width: 74%;
}

@keyframes shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}

.editor-wrap {
  display: grid;
  gap: 12px;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.status-chip,
.ready-message strong {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 4px 10px;
  background: #e7f0eb;
  color: var(--sage-dark);
  font-size: 0.84rem;
  font-weight: 700;
}

.muted-status {
  margin-right: auto;
  font-size: 0.9rem;
}

.secondary {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 7px 11px;
}

.checklist {
  display: grid;
  gap: 16px;
  padding: clamp(16px, 2.5vw, 17px);
}

.checklist.has-pinned-action-space {
  padding-bottom: calc(48px + 34px);
}

.checklist-header h2 {
  font-size: 1.35rem;
}

#missing-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#missing-list:empty {
  display: none;
}

#missing-list li {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  color: var(--muted);
}

#missing-list li.validation-failure {
  border-color: #ead8b3;
  border-left: 4px solid var(--amber);
  background: #fff9ec;
  color: #5c420f;
}

#missing-list li.complete {
  border-color: var(--sage);
  background: #eef6f1;
  color: var(--sage-dark);
}

.review-checkpoint {
  display: grid;
  gap: 10px;
  border: 1px solid #d9e3dd;
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfb;
}

.review-checkpoint h2 {
  font-size: 1.15rem;
}

.review-checkpoint p,
.review-checkpoint ul {
  margin: 0;
}

.review-checkpoint p:not(.section-kicker) {
  color: var(--sage-dark);
  font-weight: 700;
}

.review-checkpoint ul {
  display: grid;
  gap: 7px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

.ready-message {
  border: 1px solid #cfe0d8;
  border-radius: 8px;
  padding: 12px;
  background: #f0f7f3;
}

.ready-message p {
  margin: 8px 0 0;
  color: var(--sage-dark);
}

.primary {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--sage);
  color: #ffffff;
  padding: 12px 16px;
  font-weight: 700;
}

.primary-action-card {
  position: sticky;
  top: auto;
  bottom: 16px;
  z-index: 2;
  will-change: transform;
  transform: translateZ(0);
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 8px 18px rgba(31, 42, 42, 0.12);
}

.primary:hover {
  background: var(--sage-dark);
}

.primary:disabled {
  cursor: progress;
  opacity: 0.72;
}

@media (max-width: 720px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail,
  .checklist {
    position: static;
  }

  .primary-action-card {
    position: static;
  }

  .rail-toggle {
    display: block;
  }

  .stage-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-top: 12px;
  }

  .stage-list li {
    grid-template-columns: 1fr;
  }

  .stage-list span,
  .stage-list em {
    grid-column: auto;
  }
  .topbar {
    position: static;
    grid-template-columns: 1fr;
    gap: 6px;
    min-height: 0;
  }

  .signin {
    justify-self: start;
  }

  .intro {
    padding-top: 22px;
  }

  .stage-list {
    grid-template-columns: 1fr;
  }

  .rail.collapsed .stage-list {
    display: none;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .headline-keep {
    white-space: normal;
  }

  .template-options label {
    min-height: 0;
  }
}


/* ==========================================================================
   Mobile Sticky Action Dock
   ========================================================================== */
.mobile-sticky-dock {
  display: none;
  position: sticky;
  top: 68px;
  z-index: 25;
  padding: 8px clamp(16px, 4vw, 40px);
  background: rgba(247, 245, 240, 0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.mobile-jump-btn {
  width: 100%;
  min-height: 44px !important;
  background: var(--sage);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 2px 8px rgba(71, 118, 101, 0.3);
  display: inline-flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 8px;
}

@media (max-width: 720px) {
  .mobile-sticky-dock {
    display: block;
  }
}

/* ==========================================================================
   Layer 1: Marketing Layer (Smart-Fold Architecture)
   ========================================================================== */
.marketing-layer {
  max-width: 1280px;
  margin: 16px auto 28px;
  padding: 28px clamp(16px, 4vw, 40px);
  background: linear-gradient(180deg, #ffffff 0%, #f7f9f8 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(31, 42, 42, 0.05);
  transition: all 0.3s ease;
}

.marketing-layer.is-collapsed {
  padding: 6px clamp(16px, 4vw, 40px);
  background: #fbfdfc;
  margin: 6px auto 10px;
}

.marketing-layer.is-collapsed .marketing-intro,
.marketing-layer.is-collapsed .pricing-cards-container,
.marketing-layer.is-collapsed .sample-preview-btn {
  display: none;
}

.marketing-layer.is-collapsed .marketing-bottom-bar {
  justify-content: center;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.marketing-intro {
  text-align: center;
  max-width: 860px;
  margin: 0 auto 26px;
}

.marketing-badge-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.mkt-pill {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: 14px;
  background: var(--sage);
  color: #fff;
}

.mkt-pill.outline {
  background: transparent;
  border: 1px solid var(--sage);
  color: var(--sage-dark);
}

.marketing-headline {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
  line-height: 1.2;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
}

.marketing-subhead {
  margin: 0 0 16px;
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.5;
}

.hipaa-badge-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #eef6f2;
  border: 1px solid #c2ded2;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.88rem;
  color: var(--sage-dark);
}

.shield-icon {
  font-size: 1.1rem;
}

/* Pricing Cards */
.pricing-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 20px;
  max-width: 880px;
  margin: 0 auto 24px;
}

.tier-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(31, 42, 42, 0.04);
}

.tier-card.pro-tier {
  border: 2px solid var(--sage);
  background: #fbfdfc;
  box-shadow: 0 4px 16px rgba(71, 118, 101, 0.14);
}

.tier-top {
  margin-bottom: 12px;
}

.tier-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
  background: #e8e5dc;
  color: #1e293b !important;
  margin-bottom: 8px;
}

.tier-badge.pro-accent-badge {
  background: var(--sage-dark, #345e50) !important;
  color: #ffffff !important;
}

.tier-title {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 700;
  font-family: Georgia, "Times New Roman", serif;
}

.tier-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.tier-price {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--ink);
}

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

.tier-or {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.tier-price-alt {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--sage-dark);
}

.tier-summary {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 16px;
  line-height: 1.45;
}

.tier-feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.tier-feature-list li {
  line-height: 1.4;
  color: var(--ink);
}

.tier-feature-list strong {
  color: var(--ink);
}

.tier-action-wrap {
  margin-top: auto;
}

.tier-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}

.active-tier-btn {
  background: #efece5;
  color: #334155;
  border-color: var(--border);
}

.pro-checkout-btn {
  background: var(--sage);
  color: #fff;
  box-shadow: 0 3px 10px rgba(71, 118, 101, 0.3);
  transition: background 0.15s ease, transform 0.1s ease;
}

.pro-checkout-btn:hover {
  background: var(--sage-dark);
  transform: translateY(-1px);
}

.marketing-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--soft);
}

.sample-preview-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 44px !important;
  background: transparent;
  border: 1px solid var(--sage);
  color: var(--sage-dark);
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.88rem;
  transition: all 0.15s ease;
}

.sample-preview-btn:hover {
  background: #eef6f2;
}

.smart-fold-toolbar {
  text-align: center;
}

.fold-toggle-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 44px !important;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 14px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  gap: 6px;
}

.fold-toggle-btn:hover {
  background: #ede9e1;
  color: var(--ink);
}

/* ==========================================================================
   Clinical Presets Strip
   ========================================================================== */
.preset-strip {
  max-width: 1280px;
  margin: 0 auto 10px;
  padding: 0 clamp(16px, 4vw, 40px);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--sage-dark);
}

.preset-chips-container {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.preset-chip {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.76rem;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(31, 42, 42, 0.04);
  max-width: 100%;
  white-space: normal;
  text-align: left;
  word-break: break-word;
}

.preset-chip:hover {
  border-color: var(--sage);
  background: #f2f7f4;
  color: var(--sage-dark);
}

.preset-chip.active {
  background: #eef6f2;
  border-color: var(--sage);
  box-shadow: 0 0 0 2px rgba(71, 118, 101, 0.2);
}

.preset-tag {
  background: var(--soft);
  color: var(--sage-dark);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ==========================================================================
   Executive Clinical SOAP Deliverable (#executive-deliverable)
   ========================================================================== */
.deliverable-panel {
  border-top: 3px solid var(--sage);
}

.deliverable-sheet {
  background: #ffffff;
  border: 2px solid #1f2a2a;
  border-radius: 8px;
  padding: 26px;
  box-shadow: 0 6px 20px rgba(31, 42, 42, 0.08);
  margin-top: 14px;
  color: #1a1a1a;
  line-height: 1.5;
}

.clipboard-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 2px solid #1f2a2a;
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.clipboard-badge {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: #1f2a2a;
  color: #ffffff;
  padding: 5px 12px;
  border-radius: 4px;
}

.deliverable-actions-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.deliverable-actions-bar button {
  white-space: nowrap;
  height: 38px;
  max-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.primary-print {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 44px !important;
  background: var(--sage);
  color: #ffffff;
  border: 0;
  padding: 0 14px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.86rem;
  box-shadow: 0 2px 6px rgba(71, 118, 101, 0.25);
  cursor: pointer;
}

.primary-print:hover {
  background: var(--sage-dark);
}

.deliverable-actions-bar .secondary-button {
  background: #f7f5f0;
  color: var(--ink);
  border: 1px solid var(--border);
  padding: 0 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.84rem;
  cursor: pointer;
}

.deliverable-actions-bar .secondary-button:hover {
  background: #ede9e1;
}

.export-csv-btn {
  background: #f7f5f0;
  color: var(--ink);
  border: 1px solid var(--border);
  padding: 0 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.84rem;
  cursor: pointer;
}

.export-csv-btn:hover {
  background: #ede9e1;
}

/* Whitelabel Practice Letterhead */
.practice-letterhead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  background: #f9fbf9;
  border: 1px solid #d4dfd8;
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 18px;
}

.clinic-name {
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-weight: 800;
  color: #1a2a24;
  font-family: Georgia, "Times New Roman", serif;
}

.clinic-subhead {
  margin: 0 0 4px;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
}

.clinic-contact {
  margin: 0;
  font-size: 0.8rem;
  color: #777;
}

.letterhead-compliance {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.confidential-seal {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: #c34b3e;
  color: #fff;
  padding: 3px 8px;
  border-radius: 3px;
}

.hipaa-statement {
  margin: 0;
  font-size: 0.75rem;
  color: #666;
}

.verification-stamp {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--sage-dark);
  border: 1px solid var(--sage);
  padding: 2px 6px;
  border-radius: 3px;
  background: #fff;
}

/* Session Demographics Grid */
.session-demographics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  background: #faf8f5;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 20px;
}

.demo-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.demo-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}

.demo-val {
  font-size: 0.88rem;
  color: var(--ink);
}

.demo-val.mono {
  font-family: monospace;
  font-size: 0.8rem;
}

.cpt-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--sage-dark);
  background: #eef6f2;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #cce2d7;
}

/* SOAP Clinical Sections */
.soap-sections-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 22px;
}

.soap-section {
  border: 1px solid #e1ded6;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.soap-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f4f2ec;
  padding: 8px 14px;
  border-bottom: 1px solid #e1ded6;
}

.soap-indicator-badge {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--sage);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
}

.soap-section-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.soap-section-body {
  padding: 14px 16px;
  font-size: 0.92rem;
  line-height: 1.55;
}

.soap-line {
  margin: 0 0 8px;
}

.soap-line:last-child {
  margin-bottom: 0;
}

.soap-line.mt-2 {
  margin-top: 10px;
}

/* Mental Status Examination (MSE) Grid */
.mse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  background: #fbfbf9;
  border: 1px solid #eae7de;
  border-radius: 4px;
  padding: 10px;
  font-size: 0.85rem;
}

.mse-cell {
  line-height: 1.35;
}

.mse-cell strong {
  color: #333;
}

/* Assessment Diagnostic Banner & Risk Box */
.diagnostic-banner {
  background: #f1f7f4;
  border-left: 4px solid var(--sage);
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 0 4px 4px 0;
  font-size: 0.9rem;
}

.dx-code {
  color: var(--muted);
  font-size: 0.8rem;
  margin-right: 6px;
}

.risk-fieldset {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  background: #faf8f5;
  margin-top: 6px;
}

.risk-fieldset legend {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  padding: 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.risk-tri-state {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.risk-pill-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.risk-pill-option:hover {
  border-color: var(--sage);
}

.risk-pill-option input[type="radio"] {
  accent-color: var(--sage);
}

.risk-pill-badge {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.risk-pill-badge.warning {
  background: #fef3c7;
  color: #92400e;
}

.risk-pill-badge.safe {
  background: #dcfce7;
  color: #166534;
}

.risk-pill-badge.danger {
  background: #fee2e2;
  color: #991b1b;
}

.risk-pill-desc {
  font-size: 0.78rem;
  color: var(--muted);
}

.mse-control-group {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  background: #faf8f5;
  margin-top: 6px;
}

.mse-control-title {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mse-control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 640px) {
  .mse-control-grid {
    grid-template-columns: 1fr;
  }
}

.risk-assessment-box {
  background: #fffdf5;
  border: 1px solid #fae7ba;
  border-left: 4px solid #b7791f;
  border-radius: 4px;
  padding: 10px 14px;
  margin-top: 10px;
  transition: all 0.2s ease;
}

.risk-assessment-box.status-unassessed {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  border-left: 4px solid #d97706;
}

.risk-assessment-box.status-unassessed .risk-title {
  color: #b45309;
}

.risk-assessment-box.status-unassessed .risk-statement {
  color: #92400e;
  font-style: italic;
}

.risk-assessment-box.status-low-risk {
  background: #f0fdf4;
  border: 1px solid #dcfce7;
  border-left: 4px solid #16a34a;
}

.risk-assessment-box.status-low-risk .risk-title {
  color: #15803d;
}

.risk-assessment-box.status-low-risk .risk-statement {
  color: #166534;
}

.risk-assessment-box.status-elevated-risk {
  background: #fef2f2;
  border: 1px solid #fee2e2;
  border-left: 4px solid #dc2626;
}

.risk-assessment-box.status-elevated-risk .risk-title {
  color: #b91c1c;
}

.risk-assessment-box.status-elevated-risk .risk-statement {
  color: #991b1b;
  font-weight: 600;
}

.risk-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: #8c5b14;
  margin-bottom: 4px;
}

.risk-statement {
  margin: 0;
  font-size: 0.88rem;
  color: #5c420f;
  line-height: 1.45;
}

/* Dual Signature Blocks */
.doc-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  border-top: 2px solid #1f2a2a;
  padding-top: 18px;
  margin-top: 20px;
}

.signature-column {
  display: flex;
  flex-direction: column;
}

.signature-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 8px;
}

.sig-line-drawn {
  border-bottom: 1px solid #444;
  height: 48px;
  display: flex;
  align-items: flex-end;
  padding-bottom: 4px;
  margin-bottom: 8px;
}

.drawn-signature {
  font-family: "Brush Script MT", "Caveat", "Segoe Script", cursive;
  font-size: 1.5rem;
  color: #123326;
  font-style: italic;
}

.drawn-signature.supervisor {
  color: #242c3d;
}

.sig-metadata {
  font-size: 0.8rem;
  color: #555;
  line-height: 1.35;
}

.sig-metadata p {
  margin: 0 0 3px;
}

.deliverable-watermark {
  text-align: center;
  font-size: 0.75rem;
  color: #888;
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px dashed #dcd8ce;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ==========================================================================
   Media Queries & Print Isolation
   ========================================================================== */
@media (max-width: 720px) {
  .marketing-layer {
    padding: 20px 16px;
  }
  .pricing-cards-container {
    grid-template-columns: 1fr;
  }
  .doc-signatures {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .practice-letterhead {
    flex-direction: column;
  }
  .letterhead-compliance {
    text-align: left;
    align-items: flex-start;
  }
}

@media print {
  @page {
    margin: 10mm;
    size: letter portrait;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 9.5pt;
    line-height: 1.35;
  }

  .topbar,
  .mobile-sticky-dock,
  .marketing-layer,
  .preset-strip,
  .intro,
  .rail,
  .intake-panel,
  .draft-panel,
  .checklist,
  .primary-action-card,
  .deliverable-actions-bar,
  .no-print,
  button {
    display: none !important;
  }

  .workspace {
    display: block !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .canvas {
    display: block !important;
  }

  .deliverable-panel {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
  }

  #executive-deliverable {
    display: block !important;
    border: 2px solid #000000 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 14px !important;
    page-break-after: avoid;
    break-inside: avoid;
  }

  .practice-letterhead {
    border: 1px solid #333 !important;
    background: #fff !important;
  }

  .clipboard-badge {
    background: #000000 !important;
    color: #ffffff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .soap-section,
  .doc-signatures,
  .session-demographics-grid {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .deliverable-watermark {
    color: #444 !important;
  }
}

/* Tactile Button Feedback & Tabular Figures */
button:active,
.primary-action:active,
.tier-btn:active,
.preset-chip:active,
.mobile-jump-btn:active,
.sample-preview-btn:active,
.fold-toggle-btn:active,
.print-button:active,
.secondary-button:active {
  transform: translateY(1px) scale(0.98);
}

.tabular-nums,
.demo-val.mono,
.tier-price {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.brand {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 44px;
  padding: 0 4px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.signin {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  min-height: 44px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.94rem;
  text-decoration: none;
}

.clinic-contact {
  color: var(--muted);
}


/* accessibility-guard:2026-10-22 */
@media (max-width: 900px) {
  button,
  a.btn,
  [role="button"],
  select,
  input[type="button"],
  input[type="submit"],
  .masthead .nav-tools-link,
  a.nav-tools-link,
  .nav-tools-link,
  a.jump-tool-btn,
  .jump-tool-btn,
  .preset-chip,
  [data-preset-chip],
  .step-chip,
  .pro-link,
  a.pro-link,
  .checkout-btn,
  a.checkout-btn,
  .masthead-actions button,
  .masthead-actions a,
  .masthead-actions .btn,
  [class*="cookie"] button,
  [id*="cookie"] button,
  .header-brand,
  a.header-brand,
  .skip-link,
  .btn-remove-row,
  .icon-btn {
    min-height: 44px !important;
  }
  .btn-remove-row,
  .icon-btn {
    min-width: 44px !important;
  }
}

/* accessibility-guard: round2 */
@media (max-width: 900px) {
  a.btn-primary, .btn-primary, a.wordmark, .wordmark { min-height: 44px !important; }
  a.wordmark, .wordmark { min-width: 44px !important; }
}
