/* Share growth (/app/share-growth, public/views/brag.js): settings on the left, live slide preview on the right, saved posts below.
 * Phone: one column, slides become a swipe carousel with arrows inside its own box (the page never scrolls sideways). */
.bg { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.bg-grid { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 14px; align-items: start; }
.bg-ctl, .bg-prev { min-width: 0; }
.bg-prev { position: sticky; top: 12px; }

/* settings */
.bg-fs { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 12px 0 14px; min-width: 0; }
.bg-fs:first-child { border-top: 0; padding-top: 0; }
.bg-fs legend { font-weight: 600; font-size: 13px; padding: 0 0 8px; }
.bg-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.bg-seg .btn.on, .bg-mv .btn.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.bg-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.bg-dates .field { margin: 0; min-width: 0; }
.bg-dates[hidden] { display: none; }
.bg-sum { margin-top: 10px; }
.bg-facts { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.bg-facts li { display: grid; grid-template-columns: minmax(0, 1fr) auto 62px; align-items: baseline; gap: 2px 8px; font-size: 12px; }
.bg-facts li span { color: var(--muted); min-width: 0; }
.bg-facts li .bg-d { text-align: right; }
.bg-facts li b { font-variant-numeric: tabular-nums; font-weight: 600; }
.bg-d { font: 500 11px/1.3 var(--mono); color: var(--muted); }
.bg-d.good { color: var(--good); } .bg-d.bad { color: var(--bad); }
.bg-extra { margin-top: 6px; color: var(--muted); }
.bg-missing { margin-top: 8px; border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: 8px; padding: 8px 10px; font-size: 12px; background: var(--soft); }
.bg-missing p { margin: 4px 0 0; }

.bg-tones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.bg-tone, .bg-fmt { font: inherit; color: inherit; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; cursor: pointer; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bg-tone:hover, .bg-fmt:hover { border-color: var(--ink); }
.bg-tone.on, .bg-fmt.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.bg-tone b, .bg-fmt b { font-size: 13px; font-weight: 600; }
.bg-tone span, .bg-fmt span { font-size: 11px; color: var(--muted); line-height: 1.3; overflow-wrap: anywhere; }
.bg-formats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.bg-fmt { align-items: flex-start; }
.bg-fmt i { display: block; height: 26px; max-width: 100%; border: 1.5px solid currentColor; border-radius: 3px; margin-bottom: 4px; opacity: .7; }

.bg-sl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.bg-sl li { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; min-width: 0; }
.bg-sl li.off { opacity: .6; }
.bg-sl .check { font-size: 13px; min-width: 0; flex: 1 1 auto; }
.bg-sl .check span, .bg-ai .check span, .bg-cmt .check span { display: flex; flex-direction: column; min-width: 0; }
.bg-sl small, .bg-ai small, .bg-cmt small { font-size: 11px; line-height: 1.35; }
.bg-mv { display: inline-flex; gap: 4px; flex: none; }
.bg-mv .btn { padding: 2px 8px; }
.bg-checks { display: flex; flex-direction: column; gap: 6px; }
.bg-checks .check { font-size: 13px; }

.bg-accent { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 10px; }
.bg-accent .field { margin: 0; }
.bg-accent input[type="color"] { width: 56px; height: 34px; padding: 2px; cursor: pointer; }
.bg-accent .small { padding-bottom: 8px; font-family: var(--mono); }
.bg-accent .btn { margin-bottom: 4px; }
#bgHeadReset { margin: -6px 0 10px; }
.bg-ai { margin-top: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.bg-ai p { margin: 6px 0 0; }
.bg-ai input:disabled + span { opacity: .6; }

/* preview */
.bg-prev-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 8px 14px; }
.bg-prev-head h2 { margin: 0 0 2px; }
.bg-prev-head > div:first-child { flex: 1 1 240px; min-width: 0; }
.bg-prev-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.bg-warn { margin: 10px 0 0; padding: 8px 10px 8px 26px; border-radius: 8px; background: var(--soft); font-size: 12px; color: var(--muted); }
.bg-car { position: relative; margin-top: 12px; }
.bg-slides { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; align-items: start; min-width: 0; transition: opacity .15s; }
.bg-slides[data-format="story"] { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.bg-slides[data-format="landscape"] { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.bg-slides.busy { opacity: .55; }
.bg-slides:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 6px; }
.bg-slide { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bg-slide img { display: block; width: 100%; height: auto; aspect-ratio: var(--ar); border-radius: 8px; border: 1px solid var(--line); background: var(--soft); }
.bg-slide figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 6px; }
.bg-sbtns { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.bg-empty { grid-column: 1 / -1; border: 1px dashed var(--line); border-radius: 10px; padding: 28px 16px; text-align: center; color: var(--muted); }
.bg-empty b { color: var(--ink); }
.bg-arrow { display: none; }

.bg-copy { margin-top: 10px; }
#bgShare h3 { margin: 18px 0 2px; }
.bg-copy-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-bottom: 4px; }
.bg-copy-head label { flex: 1 1 auto; font-size: 13px; }
.bg-copy-head .mono { color: var(--muted); }
.bg-copy-head .over { color: var(--bad); font-weight: 600; }
.bg-copy textarea { resize: vertical; font-size: 13px; line-height: 1.45; }

/* recommended looks + theme (one click) */
.bg-lgrid { display: flex; flex-direction: column; gap: 6px; }
.bg-look { font: inherit; color: inherit; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; cursor: pointer; display: flex; align-items: center; gap: 10px; min-width: 0; position: relative; }
.bg-look:hover { border-color: var(--ink); }
.bg-look.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.bg-lsw { flex: none; width: 46px; height: 46px; border-radius: 8px; border: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 0 7px; box-sizing: border-box; font-style: normal; }
.bg-lsw b { align-self: flex-start; font-size: 11px; font-weight: 800; line-height: 1; padding: 2px 4px; border-radius: 3px; }
.bg-lsw s { display: block; height: 3px; width: 70%; border-radius: 2px; opacity: .8; }
.bg-lt { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.bg-lt b { font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.bg-lt small { font-size: 11px; color: var(--muted); line-height: 1.35; overflow-wrap: anywhere; }
.bg-lon { flex: none; font: 600 10px/1 var(--mono); font-style: normal; padding: 4px 6px; border-radius: 99px; background: #d4ff3a; color: #121212; border: 1px solid #121212; } /* fixed lime: --accent-ink turns #121212 in dark mode */
.bg-more { margin-top: 8px; }
.bg-more summary { cursor: pointer; color: var(--muted); margin-bottom: 6px; }
.bg-themes { display: flex; flex-direction: column; gap: 6px; }
.bg-theme { font: inherit; color: inherit; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; cursor: pointer; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 1px 10px; min-width: 0; }
.bg-theme:hover { border-color: var(--ink); }
.bg-theme.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.bg-theme b { font-size: 13px; font-weight: 650; line-height: 1.25; }
.bg-theme > span:last-child { grid-column: 2; font-size: 11px; color: var(--muted); line-height: 1.3; overflow-wrap: anywhere; }
.bg-dots { grid-row: span 2; display: flex; gap: 3px; min-width: 48px; }
.bg-dots i { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(127, 127, 127, .45); box-sizing: border-box; }

/* journey (day counter, off by default) */
.bg-switch b { font-size: 13px; }
.bg-switch span { display: flex; flex-direction: column; min-width: 0; }
.bg-switch small { font-size: 11px; line-height: 1.35; }
.bg-jhead { display: flex; align-items: center; gap: 12px; margin: 12px 0 10px; min-width: 0; }
.bg-jday { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 74px; padding: 6px 10px; border-radius: 10px; background: #d4ff3a; color: #121212; border: 1.5px solid #121212; line-height: 1; }
.bg-jday small { font: 700 10px/1 var(--mono); letter-spacing: .06em; }
.bg-jday b { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 2px; }
.bg-jmeta { flex: 1 1 auto; min-width: 0; }
.bg-jsum { margin: 0 0 6px; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.bg-jbar { height: 8px; border-radius: 99px; background: var(--soft); border: 1px solid var(--line); overflow: hidden; }
.bg-jbar i { display: block; height: 100%; background: #d4ff3a; border-right: 1.5px solid #121212; box-sizing: border-box; }
.bg-jrow { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 10px; min-width: 0; }
.bg-jrow > .small:first-child { width: 36px; }
.bg-jcustom { width: 84px; padding: 4px 8px; font-size: 12px; }
.bg-jstart { align-items: flex-end; }
.bg-jstart .field { margin: 0; }
.bg-jstart .small { padding-bottom: 8px; }
.bg-jgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(28px, 1fr)); gap: 4px; margin: 4px 0 8px; }
.bg-jd { font: 500 11px/1 var(--mono); height: 28px; min-width: 0; padding: 0; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; }
.bg-jd:disabled { cursor: default; }
.bg-jd.run, .bg-jkey i.run { background: #d4ff3a; color: #121212; border-color: #121212; }
.bg-jd.own, .bg-jkey i.own { background: #eefcb4; color: #121212; border: 1.5px dashed #121212; }
.bg-jd.skip, .bg-jkey i.skip { background: var(--soft); color: var(--muted); border-style: dotted; }
.bg-jd.miss, .bg-jkey i.miss { color: var(--bad); border-color: var(--bad); }
.bg-jd.today { border: 2px solid var(--ink); font-weight: 700; }
.bg-jd.future, .bg-jkey i.future { opacity: .45; }
.bg-jd:not(:disabled):hover { box-shadow: 0 0 0 1px var(--ink); }
.bg-jd:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.bg-jkey { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 6px; color: var(--muted); }
.bg-jkey span { display: inline-flex; align-items: center; gap: 5px; }
.bg-jkey i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line); box-sizing: border-box; background: var(--panel); }
.bg-jsave { display: flex; gap: 6px; margin: 4px 0 10px; }
.bg-jr > .check:last-child { margin-top: 8px; font-size: 13px; }

/* research (cited web facts) */
.bg-rs .field { margin-bottom: 8px; }
.bg-rgo { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.bg-rpick { margin-top: 10px; }
.bg-rpick select { max-width: 100%; }
.bg-rnote { margin: 10px 0 6px; }
.bg-rfacts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bg-rfacts li { border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; min-width: 0; }
.bg-rfacts .check { font-size: 12.5px; line-height: 1.4; }
.bg-rfacts .check span { overflow-wrap: anywhere; min-width: 0; }
.bg-rsrc { display: block; margin: 3px 0 0 24px; font-family: var(--mono); overflow-wrap: anywhere; }
.bg-rsrc a { color: var(--muted); }
.bg-rh { margin: 10px 0 6px; }
.bg-angles { display: flex; flex-wrap: wrap; gap: 6px; }
.bg-angle { font: inherit; font-size: 12px; line-height: 1.35; text-align: left; color: var(--ink); background: var(--soft); border: 1px solid var(--line); border-radius: 99px; padding: 5px 11px; cursor: pointer; max-width: 100%; overflow-wrap: anywhere; }
.bg-angle:hover { border-color: var(--ink); }

/* export extras: video coming soon */
.bg-video { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 12px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 8px; }
.bg-video:empty { display: none; }
.bg-copy-head label small { font-weight: 400; font-size: 11px; }

/* saved posts */
.bg-hist h2 { margin-bottom: 2px; }
.bg-hl { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; }
.bg-hrow { display: flex; justify-content: space-between; align-items: center; gap: 6px 12px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.bg-hmain { display: flex; flex-direction: column; min-width: 0; flex: 1 1 260px; }
.bg-hmain b { overflow-wrap: anywhere; }
.bg-hbtns { display: inline-flex; gap: 6px; }

@media (max-width: 1080px) {
  .bg-grid { grid-template-columns: minmax(0, 1fr); }
  .bg-prev { position: static; order: -1; }
}
@media (max-width: 760px) {
  .bg-formats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* one slide at a time, swipe or use the arrows */
  .bg-slides, .bg-slides[data-format] { display: flex; grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; overscroll-behavior-x: contain; scrollbar-width: none; }
  .bg-slides::-webkit-scrollbar { display: none; }
  .bg-slide { flex: 0 0 100%; scroll-snap-align: start; }
  .bg-slides[data-format="story"] .bg-slide img { max-height: 70vh; width: auto; max-width: 100%; margin: 0 auto; }
  .bg-arrow { display: grid; place-items: center; position: absolute; top: 38%; z-index: 1; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
  .bg-arrow[hidden] { display: none; }
  .bg-arrow.prev { left: 4px; } .bg-arrow.next { right: 4px; }
}
@media (max-width: 420px) {
  .bg-dates { grid-template-columns: minmax(0, 1fr); }
}

/* entry links on the Overview run-history card and the Run history toolbar (public/views/overview.js shareGrowthLink) */
.ov-h-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
a.btn.small[href*="/app/share-growth"] { text-decoration: none; display: inline-block; }

/* optional COMMENT “keyword” banner */
.bg-cmt { margin-top: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.bg-cmt-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 6px; }
.bg-cmt-row input, .bg-cmt-row select { width: 100%; min-width: 0; }
@media (max-width: 520px) { .bg-cmt-row { grid-template-columns: 1fr; } }
