/* Issue #74: a separately integrable readability pass over the audit candidate.
   View-only styles. Existing finite design tokens and manual overrides win. */
.studio-container .concept-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 20px;
  margin: 0 0 32px;
  padding: 4px;
  overflow: visible;
  align-items: start;
}

.concept-grid .concept-option {
  min-width: 0;
  padding: 14px;
  border-color: #d4dfd4;
  background: #f4f5ec;
  border-radius: 20px;
}

.concept-grid .concept-option.selected {
  border-color: var(--aqua);
  background: #edf7f0;
  box-shadow: 0 0 0 3px #167c7020;
}

.concept-grid .concept-option .invitation {
  height: auto;
  min-height: 0;
  max-height: none;
  width: 100%;
}

.concept-grid .concept-option .invitation:is(.format-card, .format-editorial, .format-story) .invite-title {
  font-size: clamp(26px, 8cqw, 38px);
  line-height: 1.12;
  letter-spacing: -.025em;
  overflow-wrap: break-word;
  word-break: normal;
}

.concept-grid .concept-option .invitation .invite-copy {
  padding: 24px 16px;
}

.concept-grid .concept-option .invitation .invite-eyebrow {
  font-size: 11px;
  letter-spacing: .12em;
  margin-bottom: 14px;
}

.concept-grid .concept-option .invitation .invite-honoree,
.concept-grid .concept-option .invitation .invite-meta {
  display: flex;
  font-size: 14px;
  line-height: 1.6;
  gap: 6px 12px;
}

.concept-grid .concept-option .invitation .invite-honoree {
  display: block;
}

.concept-grid .concept-option .invitation .invite-meta span {
  min-width: 0;
  overflow-wrap: break-word;
}

.concept-grid .concept-option .invitation:is(.format-card, .format-story):is(.hero-small, .hero-medium, .hero-large) .invite-art {
  height: 180px;
  min-height: 120px;
}

.concept-grid .concept-option .invitation.format-editorial .invite-art {
  min-height: 180px;
}

.concept-grid .concept-caption {
  margin-top: 18px;
  font-size: 15px;
  line-height: 1.45;
}

.concept-grid .concept-option small {
  font-size: 13px;
  line-height: 1.6;
  margin-top: 8px;
}

.original-style-controls .btn,
.original-style-controls .text-button {
  min-height: 44px;
}

/* Keep both panes inside the viewport, not just the upper preview pane. */
.studio-workbench.design-layout,
.studio-workbench.confirmation-grid {
  scroll-margin-block-start: 88px;
  height: min(860px, calc(100dvh - 112px));
  min-height: 0;
}

@media (max-width: 700px) {
  .studio-container .concept-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .studio-container input:not([type=hidden]):not([type=checkbox]):not([type=radio]),
  .studio-container select,
  .studio-container textarea {
    font-size: 16px;
  }

  .studio-workbench.design-layout,
  .studio-workbench.confirmation-grid {
    grid-template-rows: minmax(200px, 44%) minmax(0, 1fr);
    /* Account for the fixed bottom navigation as well as the top bar. */
    height: calc(100dvh - 168px);
    min-height: 0;
  }

  .studio-workbench .preview-toolbar {
    min-height: 54px;
    padding: 5px 112px 5px 7px;
  }

  .studio-workbench .preview-toolbar > span {
    display: none;
  }

  .studio-workbench .preview-device-switcher {
    padding: 0;
  }

  .studio-workbench .preview-device-switcher button {
    min-height: 44px;
    padding-inline: 5px;
  }

  .studio-workbench .preview-zoom-toolbar [data-action=expand-preview] {
    position: absolute;
    top: 5px;
    right: 6px;
    width: 102px;
    min-height: 44px;
    padding: 4px;
    font-size: 12px;
  }

  .studio-workbench .preview-zoom-toolbar button,
  .studio-workbench .preview-zoom-toolbar select {
    min-height: 44px;
  }

  .studio-workbench .studio-controls-footer .btn {
    min-height: 44px;
  }
}

@media (max-height: 550px) and (min-width: 640px) {
  /* Landscape phones need two usable panes rather than a tiny upper row. */
  .studio-workbench.design-layout,
  .studio-workbench.confirmation-grid {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 1fr);
    grid-template-rows: minmax(0, 1fr);
    height: calc(100dvh - 168px);
  }
}

@media (max-height: 550px) and (min-width: 1101px) {
  .studio-workbench.design-layout,
  .studio-workbench.confirmation-grid {
    /* Wide desktop windows do not have the fixed mobile navigation. */
    height: calc(100dvh - 112px);
  }
}
