/* Bundle detail: the same quiet surfaces as the photo feed, with a persistent
   mobile action. The measured action height reserves its space in the page.
   Rem sizes account for the existing 14px root: 1.142857rem = 16px body copy. */
body.bundle-route {
  --bundle-buy-height: 88px;
}
body.bundle-route > .app-header { display: none; }

#bundleScreen {
  min-width: 0;
  color: var(--ink);
}

#bundleScreen .bundle-detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  margin: 0 0 12px;
}
#bundleScreen .bundle-detail-topbar .bundle-back { margin: 0; }
#bundleScreen .bundle-detail-cart {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
}
#bundleScreen .bundle-detail-cart:hover { background: var(--surface-soft); }
#bundleScreen .bundle-detail-cart > svg { width: 26px; height: 26px; }
#bundleScreen .bundle-cart-count {
  position: absolute;
  inset: 1px 0 auto auto;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border: 2px solid var(--bg);
  border-radius: 10px;
  background: var(--bundle-accent);
  color: var(--bundle-on-accent);
  font-size: 0.785714rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

#bundleScreen .bundle-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 0 0 8px;
  padding: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.4;
  text-decoration: none;
}

#bundleScreen .bundle-back:hover { color: var(--ink); }
#bundleScreen .bundle-back svg { width: 20px; height: 20px; flex: 0 0 auto; }

#bundleScreen .bundle-detail-heading { max-width: 820px; margin: 0 0 20px; }
#bundleScreen .bundle-eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.928571rem !important;
  line-height: 1.45;
  letter-spacing: .035em;
  font-weight: 500;
  text-transform: none;
}
#bundleScreen .bundle-detail-heading h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 3.3vw, 3.142857rem);
  line-height: 1.12;
  letter-spacing: -.035em;
  font-weight: 700;
  overflow-wrap: anywhere;
}
#bundleScreen .bundle-detail-lead {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 1.142857rem;
  line-height: 1.55;
}

#bundleScreen .bundle-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr);
  align-items: start;
  gap: 28px;
}
#bundleScreen .bundle-detail-content { display: block; min-width: 0; }
#bundleScreen .bundle-detail-figure { margin: 0 0 16px; }
#bundleScreen .bundle-mosaic-large {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 3px;
  width: 100%;
  height: auto;
  aspect-ratio: 1.95;
  max-height: 380px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-soft);
}
#bundleScreen .bundle-mosaic-large .bundle-mosaic-frame {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
#bundleScreen .bundle-mosaic-large .bundle-mosaic-frame:first-child { grid-row: 1 / 3; }
#bundleScreen .bundle-mosaic-large[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#bundleScreen .bundle-mosaic-large[data-count="2"] .bundle-mosaic-frame:nth-child(2) { grid-row: 1 / 3; }
#bundleScreen .bundle-mosaic-large[data-count="1"] .bundle-mosaic-frame { grid-column: 1 / -1; }
#bundleScreen .bundle-mosaic-large.bundle-authored-cover { aspect-ratio:3 / 2; max-height:none; }
#bundleScreen .bundle-mosaic-large img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
#bundleScreen .bundle-detail-figure figcaption {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.928571rem;
  line-height: 1.5;
}

#bundleScreen .bundle-detail-event {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  margin: 0 0 24px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
}
#bundleScreen .bundle-detail-event > svg { width: 20px; height: 20px; flex: 0 0 auto; color: var(--muted); }
#bundleScreen .bundle-detail-event > svg:last-child { margin-left: auto; }
#bundleScreen .bundle-event-main { display: block; min-width: 0; font-size: 1.142857rem; font-weight: 600; line-height: 1.4; }
#bundleScreen .bundle-event-meta { display: block; min-width: 0; color: var(--muted); font-size: 1rem; line-height: 1.5; }
#bundleScreen .bundle-detail-event:hover { border-color: var(--bundle-accent); }

#bundleScreen .bundle-detail-section { margin: 0 0 26px; }
#bundleScreen .bundle-detail-section h2,
#bundleScreen .bundle-summary-heading {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 1.428571rem;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -.02em;
}
#bundleScreen .bundle-composition { list-style: none; padding: 0; margin: 0; }
#bundleScreen .bundle-composition li {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
#bundleScreen .bundle-composition li:first-child { padding-top: 4px; }
#bundleScreen .bundle-composition-image {
  width: 68px;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-soft);
}
#bundleScreen .bundle-composition-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
#bundleScreen .bundle-composition-copy { min-width: 0; }
#bundleScreen .bundle-composition-title {
  display: inline;
  font-size: 1.142857rem;
  font-weight: 650;
  line-height: 1.4;
  overflow-wrap: anywhere;
  text-decoration: none;
}
#bundleScreen a.bundle-composition-title:hover { text-decoration: underline; text-underline-offset: 3px; }
#bundleScreen .bundle-composition-role { margin: 4px 0 0; font-size: 1rem; line-height: 1.5; }
#bundleScreen .bundle-composition-options { margin: 3px 0 0; color: var(--muted); font-size: 0.928571rem; line-height: 1.45; }
#bundleScreen .bundle-composition-options:empty,
#bundleScreen .bundle-composition-role:empty { display: none; }
#bundleScreen .bundle-composition-quantity {
  justify-self: end;
  align-self: start;
  margin-top: 3px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.45;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#bundleScreen .bundle-allocation {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}
#bundleScreen .bundle-detail-muted { margin: 10px 0 0; color: var(--muted); font-size: 1rem; line-height: 1.55; }

#bundleScreen .bundle-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  list-style: none;
  padding: 0;
  margin: 0;
}
#bundleScreen .bundle-steps li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: none;
  font-size: 1.142857rem;
  line-height: 1.5;
}
#bundleScreen .bundle-step-number {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  height: 28px;
  margin: 0;
  border-radius: 50%;
  color: var(--ink);
  background: var(--surface-soft);
  font-size: 0.928571rem;
  line-height: 1;
  font-weight: 600;
}
#bundleScreen .bundle-steps p { margin: 1px 0 0; }

#bundleScreen .bundle-conditions,
#bundleScreen .bundle-cost-details {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
  border-block: 1px solid var(--line-soft);
}
#bundleScreen .bundle-conditions > summary,
#bundleScreen .bundle-cost-details > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 12px 0;
  cursor: pointer;
  list-style: none;
  color: var(--ink);
  font-size: 1.142857rem;
  font-weight: 600;
  line-height: 1.4;
}
#bundleScreen .bundle-conditions > summary::-webkit-details-marker,
#bundleScreen .bundle-cost-details > summary::-webkit-details-marker { display: none; }
#bundleScreen .bundle-conditions > summary::after,
#bundleScreen .bundle-cost-details > summary::after {
  content: "";
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
}
#bundleScreen .bundle-conditions[open] > summary::after,
#bundleScreen .bundle-cost-details[open] > summary::after { transform: rotate(225deg) translate(-2px, -1px); }
#bundleScreen .bundle-conditions-body { padding: 0 0 16px; font-size: 1.142857rem; line-height: 1.6; }
#bundleScreen .bundle-conditions-body h3,
#bundleScreen .bundle-cost-breakdown h3 {
  margin: 20px 0 8px;
  color: var(--ink);
  font-size: 1.142857rem;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: 0;
}
#bundleScreen .bundle-conditions-body > h3:first-child { margin-top: 0; }
#bundleScreen .bundle-conditions-body p { margin: 0 0 12px; }
#bundleScreen .bundle-conditions-body p:last-child { margin-bottom: 0; }
#bundleScreen .bundle-conditions-body ul { margin: 0; padding-left: 20px; }
#bundleScreen .bundle-conditions-body li + li { margin-top: 8px; }
#bundleScreen .bundle-conditions-body p,
#bundleScreen .bundle-conditions-body li { overflow-wrap: anywhere; }
#bundleScreen .bundle-conditions-body .bundle-quote-assumptions:not(:empty) {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 1rem;
}
#bundleScreen .bundle-quote-assumptions:empty { display: none; }

#bundleScreen .bundle-detail-summary {
  position: sticky;
  top: 90px;
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
#bundleScreen .bundle-summary-context { margin: 0 0 16px; color: var(--muted); font-size: 1rem; line-height: 1.5; }
#bundleScreen .bundle-detail-budget {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-soft);
  font-size: 1rem;
  line-height: 1.5;
}
#bundleScreen .bundle-detail-budget[data-state="over"] { color: var(--danger); }
#bundleScreen .bundle-detail-summary .bundle-cost-details { margin-top: 14px; }
#bundleScreen .bundle-cost-lines { padding: 0 0 16px; }
#bundleScreen .bundle-cost-row { display: flex; justify-content: space-between; gap: 14px; margin: 12px 0; font-size: 1rem; line-height: 1.5; }
#bundleScreen .bundle-cost-row > span { min-width: 0; overflow-wrap: anywhere; }
#bundleScreen .bundle-cost-row > b { min-width: 0; max-width: 48%; flex-shrink: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: normal; overflow-wrap: anywhere; text-align: right; }
#bundleScreen .bundle-cost-breakdown { margin-top: 18px; padding-top: 4px; border-top: 1px solid var(--line-soft); }
#bundleScreen .bundle-cost-breakdown h3 { margin-top: 12px; }
#bundleScreen .bundle-cost-total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 14px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 1.142857rem;
  line-height: 1.4;
}
#bundleScreen .bundle-cost-total > strong { min-width: 0; max-width: 100%; font-weight: 700; }
#bundleScreen .bundle-cost-total > strong:last-child { margin-left: auto; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; text-align: right; }
#bundleScreen .bundle-partial-explanation { margin: 12px 0 0; font-size: 1rem; line-height: 1.5; }
#bundleScreen .bundle-selection-note { margin: 14px 0; color: var(--muted); font-size: 1rem; line-height: 1.5; }
#bundleScreen .bundle-selection-note:empty { display: none; }

#bundleScreen .bundle-detail-buy {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}
#bundleScreen .bundle-detail-buy .bundle-price { min-width: 0; margin: 0; padding: 0; border: 0; }
#bundleScreen .bundle-detail-buy .bundle-price-label { display: block; margin: 0 0 4px; color: var(--muted); font-size: 0.928571rem; line-height: 1.4; }
#bundleScreen .bundle-detail-buy .bundle-price-value { display: block; color: var(--ink); font-size: 2.142857rem; font-weight: 700; line-height: 1.2; letter-spacing: -.035em; font-variant-numeric: tabular-nums; overflow-wrap: normal; }
#bundleScreen .bundle-detail-buy .bundle-price-note,
#bundleScreen .bundle-detail-buy-basis { margin: 4px 0 0; color: var(--muted); font-size: 0.928571rem; line-height: 1.4; }
#bundleScreen .bundle-detail-buy .bundle-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: 12px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--bundle-accent);
  color: var(--bundle-on-accent);
  font-size: 1.142857rem;
  line-height: 1.25;
  font-weight: 650;
  text-align: center;
}
#bundleScreen .bundle-detail-buy .bundle-add:disabled { opacity: .65; }
#bundleScreen .bundle-detail-buy .bundle-add svg { width: 20px; height: 20px; flex: 0 0 auto; }
#bundleScreen .bundle-open-cart { display: block; min-height: 44px; margin: 4px 0 0; padding: 12px 0 0; color: var(--muted); font-size: 1rem; text-align: center; }
#bundleScreen :is(a, button, summary):focus-visible { outline: 2px solid var(--bundle-accent); outline-offset: 4px; }

@media (max-width: 999px) {
  body.bundle-route { padding-bottom: calc(var(--bundle-buy-height, 88px) + 20px); }
  body.bundle-route main { padding-top: 8px; }
  body.bundle-route .toast { bottom: calc(var(--bundle-buy-height, 88px) + 14px); }
  #bundleScreen .bundle-detail-heading { margin-bottom: 16px; }
  #bundleScreen .bundle-detail-heading h1 { font-size: 2.142857rem; }
  #bundleScreen .bundle-detail-layout { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  #bundleScreen .bundle-detail-content { display: block; }
  #bundleScreen .bundle-detail-figure { margin: 0 0 14px; }
  #bundleScreen .bundle-mosaic-large { aspect-ratio: 2; border-radius: 14px; }
  #bundleScreen .bundle-detail-event { margin-bottom: 22px; }
  #bundleScreen .bundle-detail-summary { position: static; grid-row: auto; padding: 0; border: 0; border-radius: 0; background: none; }
  #bundleScreen .bundle-summary-heading { margin-bottom: 8px; }
  #bundleScreen .bundle-detail-summary .bundle-cost-details { margin-top: 14px; }
  #bundleScreen .bundle-detail-buy {
    position: fixed;
    z-index: 45;
    inset: auto 0 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 78px;
    margin: 0;
    padding: 10px max(16px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: var(--bg);
  }
  #bundleScreen .bundle-detail-buy .bundle-price-value { font-size: clamp(1.571429rem, 5.7vw, 2rem); }
  #bundleScreen .bundle-detail-buy .bundle-price-label { margin-bottom: 2px; }
  #bundleScreen .bundle-detail-buy .bundle-add { width: auto; min-width: 132px; min-height: 46px; padding: 12px 14px; font-size: 1.071429rem; }
  #bundleScreen .bundle-detail-buy .bundle-price-note,
  #bundleScreen .bundle-detail-buy-basis { margin-top: 3px; }
  #bundleScreen .bundle-open-cart { margin-bottom: 12px; }
  #bundleScreen .bundle-detail-section,
  #bundleScreen .bundle-conditions,
  #bundleScreen .bundle-cost-details { scroll-margin-bottom: calc(var(--bundle-buy-height, 88px) + 24px); }
}

@media (max-width: 580px) {
  #bundleScreen .bundle-detail-heading h1 { font-size: 2rem; }
  #bundleScreen .bundle-detail-section { margin-bottom: 22px; }
  #bundleScreen .bundle-composition li { grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; padding-block: 13px; }
  #bundleScreen .bundle-composition-image { width: 56px; }
  #bundleScreen .bundle-steps { grid-template-columns: minmax(0, 1fr); gap: 0; }
  #bundleScreen .bundle-steps li { padding-block: 10px; }
}

@media (max-width: 430px) {
  #bundleScreen .bundle-detail-buy[data-long-price="true"] { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  #bundleScreen .bundle-detail-buy[data-long-price="true"] .bundle-add { width: 100%; }
}

@media (max-width: 359px) {
  #bundleScreen .bundle-detail-buy { padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right)); gap: 8px; }
  #bundleScreen .bundle-detail-buy .bundle-price-value { font-size: 1.571429rem; }
  #bundleScreen .bundle-detail-buy .bundle-add { min-width: 118px; padding-inline: 10px; }
  #bundleScreen .bundle-composition li { grid-template-columns: 50px minmax(0, 1fr) auto; gap: 8px; }
  #bundleScreen .bundle-composition-image { width: 50px; }
  #bundleScreen .bundle-composition-title { font-size: 1.071429rem; }
}

@media (forced-colors: active) {
  #bundleScreen .bundle-detail-buy,
  #bundleScreen .bundle-detail-summary,
  #bundleScreen .bundle-detail-event { border-color: CanvasText; }
  #bundleScreen .bundle-detail-buy .bundle-add { border: 1px solid ButtonText; background: ButtonFace; color: ButtonText; }
}

@media print {
  body.bundle-route { padding-bottom: 0; }
  #bundleScreen .bundle-detail-buy { position: static; display: block; }
  #bundleScreen .bundle-detail-buy .bundle-add,
  #bundleScreen .bundle-back,
  #bundleScreen .bundle-open-cart { display: none; }
  #bundleScreen .bundle-detail-layout { display: block; }
  #bundleScreen .bundle-detail-summary { position: static; }
}

.bundle-mechanic-cover { position: relative; }
.activity-mechanic-trigger {
  position: absolute;
  z-index: 2;
  inset-inline-start: 50%;
  inset-block-end: 12px;
  transform: translateX(-50%);
  min-height: 44px;
  max-width: calc(100% - 24px);
  padding: 7px 17px;
  border: 1px solid rgb(255 255 255 / 52%);
  border-radius: 999px;
  background: rgb(18 22 29 / 90%);
  color: white;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.activity-mechanic-trigger:hover { background: #171d26; }
.activity-mechanic-trigger:focus-visible { outline: 3px solid white; outline-offset: 2px; }
.activity-mechanic-trigger[aria-busy='true'] { cursor: progress; }
@media print { .activity-mechanic-trigger { display: none; } }
