/* Sharing the Brain (BB-120, web/brainshare.js): the sheet of a link, Brain → «Обмін», the page of a link, the merge. */

/* what goes out, read as it will be read */
.bs-prev { max-height: 340px; overflow: auto; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--paper); }
.bs-prev .md h4:first-child { margin-top: 0; }
.bs-find { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.bs-find b { font-weight: 600; margin-bottom: 2px; }

/* the link and the ways to hand it on */
.bs-link { display: flex; flex-direction: column; gap: 8px; }
.bs-url { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 6px 6px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--paper); }
.bs-url code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--fg); }
.bs-more { gap: 4px 16px; }
.bs-more .link, .bs-pub-act .link, .bs-tab .link { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.bs-more .link svg, .bs-pub-act .link svg, .bs-tab .link svg { width: 14px; height: 14px; }

/* a list to pick from */
.bs-picks { display: flex; flex-direction: column; max-height: 360px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
.bs-pick { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; cursor: pointer; min-width: 0; }
.bs-pick:last-child { border-bottom: 0; }
.bs-pick svg { width: 16px; height: 16px; flex: none; color: var(--fg-subtle); }
.bs-pick .grow { min-width: 0; overflow-wrap: anywhere; }
.bs-pick.off { color: var(--fg-subtle); cursor: default; }
.bs-pick input { flex: none; }
.bs-pick .chip { flex: none; max-width: 52%; white-space: normal; text-align: right; }

/* Brain → «Обмін» */
.bs-top { align-items: start; }
.bs-rows { margin-top: 12px; border-top: 1px solid var(--border); }
.bs-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 2px; border-bottom: 1px solid var(--border); font-size: 13px; text-align: left; background: none; color: var(--fg); cursor: pointer; }
.bs-row svg { width: 15px; height: 15px; color: var(--fg-subtle); flex: none; }
.bs-row .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bs-req { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.bs-req:last-child { border-bottom: 0; }
.bs-req .grow { min-width: 0; overflow-wrap: anywhere; }
.bs-req-act { flex: none; gap: 6px; justify-content: flex-end; }
@media (max-width: 760px) { .bs-req { flex-direction: column; } .bs-req-act { justify-content: flex-start; } }

/* the page of a link */
.bs-pub-desc { margin-top: 10px; max-width: 640px; }
.bs-pub-act { margin-top: 22px; gap: 8px 10px; align-items: center; }
.bs-item { max-width: 820px; }
.bs-item .md { font-size: 14.5px; line-height: 1.65; }
.bs-rules { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; line-height: 1.55; }
.bs-ask textarea { min-height: 130px; }
.bs-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.bs-mine { max-width: 760px; }
.bs-answer { padding: 12px 14px; border-left: 2px solid var(--signal); background: var(--paper); border-radius: 0 10px 10px 0; max-height: 420px; overflow: auto; }

/* the Brains become one: a dark stage for the moment, whatever the look of the page */
.bm { position: fixed; inset: 0; z-index: 400; background: radial-gradient(120% 90% at 50% 45%, #15202B 0%, #0A0F14 70%, #06090C 100%); animation: bm-in .3s ease both; color: #fff; }
.bm.out { animation: bm-out .26s ease both; }
.bm-cv { position: absolute; inset: 0; display: block; }
.bm-cap { position: absolute; left: 16px; right: 16px; bottom: max(40px, calc(env(safe-area-inset-bottom) + 24px)); text-align: center; opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; pointer-events: none; }
.bm-from { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .55); overflow-wrap: anywhere; }
.bm-from span { color: rgba(255, 255, 255, .35); }
.bm-said { margin-top: 8px; font-size: clamp(21px, 3.4vw, 30px); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; overflow-wrap: anywhere; }
.bm-act { display: flex; justify-content: center; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.bm .btn.bm-go { background: #fff; color: #0A0F14; border-color: #fff; }
.bm .btn.bm-go svg { color: #0A0F14; }
.bm .btn.bm-no { background: transparent; color: rgba(255, 255, 255, .85); border: 1px solid rgba(255, 255, 255, .28); }
.bm.done .bm-cap { opacity: 1; transform: none; pointer-events: auto; }
@keyframes bm-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes bm-out { from { opacity: 1; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .bm, .bm.out { animation: none; } .bm-cap { transition: none; } }

/* «Чим поділитися» (BB-146): the Brain as folders on the left, the Brain itself in a panel joined to its right */
.bp-scrim { padding: 20px; }
.bp { display: flex; width: min(1120px, 100%); height: min(760px, calc(100vh - 40px)); height: min(760px, calc(100dvh - 40px)); border-radius: var(--r-2xl); overflow: hidden; box-shadow: var(--shadow-xl); animation: pop var(--slow) var(--enter) both; }
.bp-main { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--paper); } /* only the tree scrolls: the head and the buttons stay */
.bp-side { flex: 0 0 min(46%, 520px); display: flex; flex-direction: column; background: var(--cream); border-left: 1px solid var(--line); }
.bp-cv { flex: 1; width: 100%; min-height: 0; display: block; touch-action: manipulation; }
.bp-legend { display: flex; gap: 6px 16px; flex-wrap: wrap; padding: 10px 16px 14px; font-size: 12px; color: var(--fg-muted); }
.bp-legend span { display: inline-flex; align-items: center; gap: 7px; }
.bp-sw { width: 14px; height: 14px; border-radius: 50%; background: var(--line); display: inline-grid; place-items: center; color: var(--fg-muted); }
/* (the zones light in the hues of «Карта», web/map.js MAP_HUES) */
.bp-sw.lit { background: conic-gradient(#2a78d6, #e87ba4, #6250d6, #1baf7a, #eda100, #2a78d6); }
.bp-sw svg { width: 9px; height: 9px; }
.bp-search { padding: 12px 22px 6px; }
.bt { flex: 1; min-height: 0; overflow: auto; padding: 4px 12px 10px; }
.bt-row { display: flex; align-items: center; gap: 8px; min-height: 34px; padding-right: 8px; border-radius: 8px; font-size: 13.5px; }
.bt-row:hover { background: var(--bg-muted); }
.bt-row > svg { width: 15px; height: 15px; flex: none; color: var(--fg-subtle); }
.bt-row.lit > svg { color: var(--signal); }
.bt-row input[type=checkbox] { flex: none; margin: 0; }
.bt-chev { width: 20px; height: 20px; flex: none; display: grid; place-items: center; padding: 0; background: none; border: 0; border-radius: 6px; color: var(--fg-subtle); cursor: pointer; }
.bt-chev svg { width: 14px; height: 14px; }
.bt-chev:disabled { visibility: hidden; }
.bt-name { flex: 1; min-width: 0; padding: 0; background: none; border: 0; font: inherit; color: var(--fg); text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-name:disabled { cursor: default; }
.bt-folder .bt-name { font-weight: 600; }
.bt-n { font-size: 11.5px; color: var(--fg-subtle); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bt-tag { flex: none; font-size: 11px; color: var(--fg-subtle); white-space: nowrap; border: 1px solid var(--line); border-radius: var(--pill); padding: 1px 7px; }
.bt-row.locked .bt-name, .bt-row.empty .bt-name { color: var(--fg-subtle); font-weight: 500; }
.bt-cb { width: 16px; flex: none; display: grid; place-items: center; color: var(--fg-subtle); }
.bt-cb svg { width: 13px; height: 13px; }
.bt-why { padding: 2px 10px 8px; font-size: 12.5px; color: var(--fg-subtle); }
.bt-peek { margin: 2px 8px 10px; padding: 10px 12px; max-height: 260px; overflow: auto; font-size: 13px; background: var(--bg-muted); border-left: 2px solid var(--line); border-radius: 0 8px 8px 0; }
.bt-peek .md { font-size: 13px; }
.bp-foot { display: flex; flex-direction: column; gap: 10px; padding: 12px 22px 16px; border-top: 1px solid var(--line); }
.bp-meter { display: flex; flex-direction: column; gap: 6px; }
.bp-bar { height: 4px; overflow: hidden; background: var(--line); border-radius: 4px; }
.bp-bar i { display: block; height: 100%; background: var(--signal); transition: width var(--base) var(--enter); }
@media (max-width: 860px) {
  .bp { flex-direction: column; height: calc(100vh - 24px); height: calc(100dvh - 24px); }
  .bp-side { order: -1; flex: 0 0 200px; border-left: 0; border-bottom: 1px solid var(--line); }
  .bp-legend { padding: 2px 14px 8px; }
}
@media (max-width: 520px) { .bp-scrim { padding: 8px; } .bp-search, .bp-foot { padding-left: 14px; padding-right: 14px; } .bt { padding: 4px 6px 8px; } .bt-tag { display: none; } .bp-side { flex-basis: 190px; } }

/* the switch of the sound on the stage of the merge */
.bm-mute { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); color: rgba(255, 255, 255, .8); cursor: pointer; }
.bm-mute svg { width: 17px; height: 17px; }
.bm-mute:hover { background: rgba(255, 255, 255, .14); }

/* «Для кого» (BB-151): a link for one person, whose own Brain is made for them */
.bs-who { gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--paper); }
.bs-who > .sub { margin: 0; }
.bs-who-name { position: relative; min-width: 0; }
.bs-sugg { position: absolute; left: 0; right: 0; top: calc(100% - 4px); z-index: 5; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); box-shadow: 0 10px 30px rgba(0, 0, 0, .12); overflow: hidden; animation: bs-drop .16s ease both; }
.bs-sugg[hidden] { display: none; }
.bs-sugg-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--border); background: none; color: var(--fg); font-size: 13.5px; text-align: left; cursor: pointer; min-width: 0; }
.bs-sugg-row:last-child { border-bottom: 0; }
.bs-sugg-row:hover, .bs-sugg-row:focus-visible { background: var(--paper); }
.bs-sugg-row svg { width: 15px; height: 15px; flex: none; color: var(--fg-subtle); }
.bs-sugg-row .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bs-sugg-row .xs { flex: none; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bs-gift-done { display: flex; align-items: flex-start; gap: 10px; }
.bs-gift-done > svg { width: 22px; height: 22px; flex: none; color: var(--signal); animation: bs-pop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.bs-gift-done .sub { margin: 0; }

/* the page of a link made for one person: the greeting, and what their Brain already holds */
.bs-gift-hi { margin: 0 0 10px; font-size: 15px; font-weight: 600; color: var(--fg); max-width: 640px; }
.bs-gift { max-width: 820px; border-left: 3px solid var(--signal); }
.bs-gift-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.bs-gift-head .grow { min-width: 0; overflow-wrap: anywhere; }
.bs-gift-head .h2 { margin-top: 2px; }
.bs-gift-head .sub { margin: 4px 0 0; }
.bs-gift-note { margin: 16px 0 0; padding: 10px 14px; border-left: 2px solid var(--border); font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.bs-gift-note cite { display: block; margin-top: 6px; font-size: 12.5px; font-style: normal; color: var(--fg-subtle); }
.bs-gsteps { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.bs-gstep { display: flex; align-items: flex-start; gap: 12px; font-size: 14.5px; animation: bs-step .45s ease both; }
.bs-gstep:nth-child(2) { animation-delay: .12s; } .bs-gstep:nth-child(3) { animation-delay: .24s; }
.bs-gstep .grow { min-width: 0; overflow-wrap: anywhere; }
.bs-gstep > i { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 1px var(--border); }
.bs-gstep > i svg { width: 14px; height: 14px; }
.bs-gstep.ready > i { background: var(--success-95); color: var(--success-fg); box-shadow: none; animation: bs-pop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.bs-gstep.failed > i { background: var(--warn-95); color: var(--warn-fg); box-shadow: none; }
.bs-gstep .spin { width: 12px; height: 12px; }
.bs-gift-go { margin-top: 20px; gap: 10px 14px; align-items: center; }
.bs-gift-go .xs { min-width: 200px; }
@keyframes bs-step { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes bs-pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes bs-drop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .bs-gstep, .bs-gstep.ready > i, .bs-gift-done > svg, .bs-sugg { animation: none; } }
@media (max-width: 760px) { .bs-gift-head { align-items: flex-start; } .bs-gift-go .btn { width: 100%; justify-content: center; } }
