/*
 * Final de-boxing layer.
 * Passive information uses whitespace and type; durable actions/choices may
 * keep a container when the boundary itself carries meaning.
 */

/* Shared shell ----------------------------------------------------------- */
.site-footer,
body[data-view="home"] .site-footer {
  border-top: 0;
}

@media (max-width: 620px) {
  .footer-links {
    display: flex;
    gap: 10px 18px;
  }

  .footer-links a,
  .footer-actions .plus-settings-link {
    min-height: 36px;
    width: auto;
    padding: 6px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    text-decoration: underline;
    text-decoration-color: #69716e;
    text-underline-offset: 4px;
  }

  .footer-actions {
    display: flex;
    gap: 10px 18px;
    padding-top: 0;
    border: 0;
  }
}

/* Today ------------------------------------------------------------------ */
body[data-view="home"] .daily-side,
body[data-view="home"] .browse-invitation,
body[data-view="home"] .today-companion {
  border: 0;
}

body[data-view="home"] .browse-invitation {
  padding-left: 0;
}

body[data-view="home"] .today-companion {
  gap: clamp(30px, 5vw, 70px);
}

body[data-view="home"] .daily-path .is-current {
  box-shadow: none;
}

body[data-view="home"] .habit-pill {
  align-self: center;
  justify-content: center;
  gap: 7px;
  margin-bottom: 0;
  text-align: center;
}

body[data-view="home"] .habit-count,
body[data-view="home"] .habit-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

body[data-view="home"] .habit-count {
  gap: 4px;
}

body[data-view="home"] .daily-main > .quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0 0;
  text-align: center;
}

body[data-view="home"] .browse-invitation {
  justify-content: center;
  text-align: center;
}

body[data-view="home"] .browse-invitation > span:last-child {
  align-items: center;
  text-align: center;
}

body:not([data-view="play"]) .site-footer {
  grid-template-columns: 1fr;
}

body:not([data-view="play"]) .footer-links {
  justify-content: flex-end;
}

@media (max-width: 700px) {
  body[data-view="home"] .daily-side,
  body[data-view="home"] .browse-invitation {
    border: 0;
  }
}

/* Progress --------------------------------------------------------------- */
.progress-focus-card::before {
  display: none;
}

.progress-focus-card {
  padding-left: 0;
}

.signal-line + .signal-line {
  margin-top: 8px;
  border: 0;
}

.progress-empty,
.challenge-empty,
.retention-empty {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.progress-empty,
.challenge-empty {
  padding-inline: 0;
}

.challenge-score-grid > div,
.retention-report-grid article,
.premium-teaser-points span {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding-inline: 0;
}

/* Train / Coach ---------------------------------------------------------- */
.coach-panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.coach-more,
.plus-feature-drawer {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.coach-more > summary,
.plus-feature-drawer > summary {
  padding-inline: 0;
}

.coach-more[open] > summary,
.plus-feature-drawer[open] > summary {
  border: 0;
}

.coach-secondary-grid,
.plus-feature-drawer .plus-feature-grid {
  padding-inline: 0;
}

.weekly-ritual-card {
  border: 0;
}

/* Results ---------------------------------------------------------------- */
.circuit-recap,
.adaptive-insight,
.coach-result-note,
.plus-series,
.share-panel {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.circuit-recap,
.adaptive-insight,
.coach-result-note {
  padding-inline: 0;
}

.result-insight-accuracy {
  padding-inline: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.plus-series {
  padding-inline: 0;
}

.share-panel {
  padding-inline: 0;
}

.round-rewards .milestone-award {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  text-align: center;
}

.round-rewards .milestone-award > div {
  justify-items: center;
}

.round-rewards .milestone-award .reward-link {
  grid-column: 1;
  justify-self: center;
}

.share-actions {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.share-actions .secondary {
  min-width: 120px;
}

/* Premium --------------------------------------------------------------- */
.premium-hero,
.premium-boundary,
.premium-pricing-section,
.premium-story .premium-pricing,
.premium-story .premium-account-gate,
.premium-status-panel,
.premium-story .restore-row,
.premium-boundary-item + .premium-boundary-item {
  border: 0;
}

@media (max-width: 700px) {
  .premium-boundary-item + .premium-boundary-item {
    border: 0;
  }
}

/* Mobile release QA: leave Train's frozen artwork/hover sheet alone. */
@media (max-width: 620px) {
  /* Progress is already in the bottom navigation and the Arc companion.
     Only surface the heading shortcut if there is an actual streak. */
  body[data-view="home"] .habit-pill:not(:has(.habit-count)) {
    display: none;
  }

  /* Three narrow columns cannot hold titles such as Memory Matrix or
     Next in Line. Use a readable vertical circuit with connected steps. */
  body[data-view="home"] .daily-path {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  body[data-view="home"] .daily-path .circuit-row {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    justify-items: stretch;
    gap: 14px;
    min-width: 0;
    min-height: 68px;
    text-align: left;
  }

  body[data-view="home"] .daily-path .circuit-row::before {
    /* Begin outside the 36px node, not through its lower arc. Extend
       to the next node's top edge, including the space between rows. */
    top: calc(50% + 18px);
    bottom: -16px;
    left: 17.5px;
    right: auto;
    width: 1px;
    height: auto;
  }

  body[data-view="home"] .daily-path .circuit-row:last-child::before {
    display: block;
    /* Final line meets the completion marker without crossing it. */
    bottom: -20px;
  }

  body[data-view="home"] .daily-path .journey-node {
    width: 36px;
    height: 36px;
  }

  body[data-view="home"] .daily-path .journey-step-copy {
    align-items: flex-start;
    min-width: 0;
    text-align: left;
  }

  body[data-view="home"] .daily-path .circuit-name {
    max-width: 100%;
    font-size: 1rem;
    line-height: 1.3;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body[data-view="home"] .journey-finish {
    margin-top: 8px;
    padding-top: 12px;
    padding-left: 2.5px;
  }

  /* Footer information is a centered secondary row, not a right-aligned
     cluster that competes with the fixed bottom navigation. */
  body:not([data-view="play"]) .footer-links {
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 18px;
  }

  /* Make small labels and the primary Train action readable on phones.
     Identity illustrations, logos and hover effects are unchanged. */
  body[data-view="train"] .train-game-grid .game-instruction {
    font-size: .875rem;
    line-height: 1.45;
  }

  body[data-view="train"] .train-game-grid .game-card-heading .eyebrow,
  body[data-view="train"] .train-game-grid .game-card-number {
    font-size: .75rem;
  }

  body[data-view="train"] .train-game-grid .game-card-actions .secondary {
    min-height: 48px;
    font-size: .95rem;
  }
}
