/* QA8 public composition contracts. Loaded after the Audit 2 templates.
   Shared application layout and account/entitlement state are not addressed here. */

/* One field occupies label / control / help tracks. A longer helper must never
   stretch a neighbouring date input or move its top edge. */
.home-redesign .quick-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 7px 14px;
}
.home-redesign .quick-form-grid > label {
  grid-row: span 3;
  display: grid;
  grid-template-rows: subgrid;
  min-width: 0;
  align-content: start;
  align-self: stretch;
  row-gap: 7px;
  margin: 0 0 8px;
}
.home-redesign .quick-form-grid .quick-field-label {
  grid-row: 1;
  align-self: end;
  display: block;
  font-size: 14px;
  line-height: 1.45;
}
.home-redesign .quick-form-grid > label > :is(input, select, textarea, .public-select-control) {
  grid-row: 2;
  align-self: start;
  min-width: 0;
}
.home-redesign .quick-form-grid :is(input, select, .public-select-trigger) {
  box-sizing: border-box;
  min-height: 46px;
  height: 46px;
  max-width: 100%;
}
.home-redesign .quick-form-grid input[type="date"] { width: 100%; }
.home-redesign .quick-form-grid > label > :is(.field-guidance, .quick-field-help) {
  grid-row: 3;
  align-self: start;
  display: block;
  margin: 0;
  color: var(--okg-text-muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
}
.home-redesign .quick-status:empty { display: none; }
.home-redesign .quick-submit { margin-top: 16px; }
.home-redesign .quick-form-grid textarea { min-height: 84px; }
@supports not (grid-template-rows: subgrid) {
  .home-redesign .quick-form-grid > label { grid-template-rows: minmax(2.9em, auto) auto auto; }
}

/* The outside scenario and its inside layout switch together. At intermediate
   widths, the picture and story share one row, followed by the relevant facts. */
.home-redesign .scenario-panel { min-width: 0; }
.home-redesign .scenario-story { min-width: 0; }
.home-redesign .scenario-story .example-badge { justify-self: start; }
.home-redesign .scenario-criteria {
  align-self: start;
  min-width: 0;
  border-color: var(--okg-border-subtle);
  background: var(--okg-surface);
}
.home-redesign .scenario-criteria > div {
  min-width: 0;
  padding: 12px 14px;
  border-color: var(--okg-border-subtle);
}
.home-redesign .scenario-criteria dd {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: auto;
  line-height: 1.45;
}
.home-redesign .scenario-boundary { max-width: 95ch; }
.home-redesign .scenario-story figure { align-self: start; }

/* A card has one intentional reading inset. Photo captions and descriptions
   do not touch the reflection edge. Product pixels themselves stay unchanged. */
.public-content-page .okg-topic-scene figcaption {
  margin: 0;
  padding: 12px 14px;
  border-radius: 0 0 16px 16px;
  background: var(--okg-surface);
}
.public-content-page .topic-example-fact dd {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: auto;
}
.public-content-page .topic-example-facts {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
}
.public-content-page .editorial-checklist li { min-width: 0; }
.public-content-page .content-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, auto);
  gap: 18px 24px;
  align-items: center;
  background: linear-gradient(145deg, var(--okg-g2-tint), var(--okg-g1-tint));
  border: 1px solid var(--okg-edge-outer);
  color: var(--okg-text);
}
.public-content-page .content-cta .morelink {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  justify-self: start;
  min-height: 44px;
  max-width: 290px;
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--okg-accent);
  color: var(--okg-on-accent);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  text-decoration: none;
  box-shadow: none;
}
.public-content-page .content-cta .morelink:hover {
  filter: brightness(1.08);
}
.public-content-page .content-cta .morelink:focus-visible {
  outline: 3px solid var(--okg-accent);
  outline-offset: 3px;
}
.public-content-page .content-cta :is(h3, p) { color: var(--okg-text); }
.public-content-page .content-cta p { color: var(--okg-text-muted); }
.public-content-page .content-cta .brand-inline { color: inherit; }
.public-content-page :is(.topic-box, .help-shortcuts a) { height: auto; min-height: 0; }
.public-content-page .faq-item .okg-faq-answer p { line-height: 1.6 !important; }
.public-content-page .legalcard :is(a, .provider-details) { overflow-wrap: anywhere; }
.public-content-page .legalcard ul { padding-inline-start: 1.35em; }
.public-content-page .okg-help-contact p + p { margin-top: 10px; }
.public-content-page .topic-step-content > p { text-wrap: pretty; }
.public-content-page :is(.contentlead, .topic-section-intro p) { text-wrap: pretty; }
.public-content-page .help-shortcuts strong { line-height: 1.4; }
.public-content-page .okg-help-topic summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-height: 44px;
}
.public-content-page .okg-help-topic summary > svg { flex: none; margin-top: 3px; }
.public-content-page .okg-help-topic[open] .topic-step-chevron { transform: rotate(180deg); }

/* Public live search: a restrained photo matte, clear title and price, then
   reading information. No cropping or recolouring of merchant product photos. */
.home-redesign .public-result-grid { align-items: start; }
.home-redesign .public-product-image {
  display: grid;
  place-items: center;
  margin: 0;
  aspect-ratio: 4 / 3;
  min-height: 0;
  padding: 12px;
  background: color-mix(in srgb, var(--okg-accent-soft) 30%, var(--okg-surface));
}
.home-redesign .public-product-image img {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  background: transparent;
  border-radius: 10px;
}
.home-redesign .public-result-content {
  padding: 16px;
  gap: 10px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: var(--okg-surface);
}
.home-redesign .public-result-content h3 {
  font-size: 18px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.home-redesign .public-result-content > p { font-size: 14px; line-height: 1.55; }
.home-redesign .public-result-content .public-price {
  font-size: 17px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.home-redesign .public-result-content .public-cost-notice {
  color: var(--okg-warning);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}
.home-redesign .public-result-top { min-width: 0; gap: 6px; flex-wrap: wrap; }
.home-redesign .public-result-top .pill {
  min-width: 0;
  max-width: 100%;
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}
.home-redesign .public-product-meta { margin: 0; padding: 10px 0 0; border-top: 1px solid var(--okg-border-subtle); }
.home-redesign .public-product-meta > span {
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: var(--okg-text-muted);
  font-size: 12px;
  line-height: 1.5;
}
.home-redesign .public-product-details { margin-top: 2px; padding-top: 8px; border-top: 1px solid var(--okg-border-subtle); }
.home-redesign .public-product-details summary {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--okg-accent);
  cursor: pointer;
}
.home-redesign .public-product-details summary::after {
  content: '';
  width: 18px;
  height: 18px;
  flex: none;
  margin-inline-start: auto;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.home-redesign .public-product-details[open] summary::after { transform: rotate(180deg); }
.home-redesign .public-product-details summary > svg { width: 16px; height: 16px; margin-inline-start: auto; flex: none; }
.home-redesign .public-product-details[open] summary > svg { transform: rotate(180deg); }
.home-redesign .public-product-details > .disclosure-note { display: grid; gap: 5px; margin: 0; padding-block: 4px; }
.home-redesign .public-product-details :is(p, span) { font-size: 13px; line-height: 1.5; }
.home-redesign .quick-no-result {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 20px;
  min-height: 0;
}
.home-redesign .quick-no-result :is(p, strong) { margin: 0; }
.home-redesign .quick-save-note {
  display: grid;
  gap: 5px;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
}
.home-redesign .plan-task-comparison .feature-benefit { text-wrap: pretty; }

/* A footer entry belongs to the same column and starts at the same text edge. */
:is(.home-redesign, .public-content-page) .footerlinks [data-preference-trigger="display"] {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  align-self: flex-start;
  margin: 0;
  padding: 8px 0;
  min-height: 44px;
  max-width: 100%;
  text-align: left;
  line-height: 1.5;
  color: var(--okg-accent);
}
.no-js [data-preference-trigger="display"] { display: none !important; }

@media (min-width: 601px) and (max-width: 1100px) {
  .home-redesign .scenario-panel { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .home-redesign .scenario-story { grid-template-columns: minmax(170px, .85fr) minmax(0, 1.15fr); gap: 10px 22px; }
  .home-redesign .scenario-story figure { grid-column: 1; grid-row: 1 / 6; }
  .home-redesign .scenario-story figure img { aspect-ratio: 4 / 3; }
  .home-redesign .scenario-story > :not(figure) { grid-column: 2; }
  .home-redesign .scenario-criteria { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
  .home-redesign .scenario-criteria > div { border-bottom: 0; border-inline-end: 1px solid var(--okg-border-subtle); }
  .home-redesign .scenario-criteria > div:last-child { border-inline-end: 0; }
}
@media (min-width: 601px) and (max-width: 900px) {
  .public-content-page .editorial-scenario { gap: 18px; }
  .public-content-page .editorial-scenario > .okg-topic-scene { grid-row: 1; }
  .public-content-page .editorial-scenario > .editorial-checklist {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }
  .public-content-page .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .public-content-page .content-cta { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .public-content-page .content-cta .morelink { max-width: 100%; }
}
@media (max-width: 600px) {
  .home-redesign .quick-form-grid { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .home-redesign .quick-form-grid > label { margin-bottom: 10px; }
  .home-redesign .quick-form-grid :is(input, select, textarea, .public-select-trigger) { font-size: 16px; }
  .home-redesign .scenario-criteria { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .home-redesign .scenario-criteria > div { padding: 11px 14px; }
  .home-redesign .scenario-story figure img { aspect-ratio: 4 / 3; }
  .home-redesign .public-product-image { aspect-ratio: 3 / 2; padding: 10px; }
  .home-redesign .public-result-content { padding: 15px; }
  .home-redesign .public-results-head { align-items: flex-start; flex-direction: column; gap: 12px; }
  .public-content-page .okg-topic-scene figcaption { padding: 10px 12px; }
  .public-content-page .topic-example-facts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); }
  .public-content-page .content-cta { gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .public-content-page .content-cta .morelink { transition: none; }
}

/* QA9: keep the product surface distinct; accessibility modes stay opaque. */
:root:is([data-theme="contrast"], [data-okg-reduced-transparency="true"]) .public-content-page .content-cta {
  background: var(--okg-surface);
  box-shadow: none;
}
