/* ---------- Invites into a crew + the first way in (assets/js/invites.js) ---------- */

/* Crew → Add: one personal link per person */
.iv-root { width: 100%; max-width: 620px; margin: 0 auto; padding: 16px 16px calc(28px + env(safe-area-inset-bottom, 0px)); }
.iv-form { display: flex; flex-direction: column; gap: 20px; }
.iv-lead { margin: 2px 0 0; font-size: 14px; line-height: 20px; color: var(--color-ink-muted); }
.iv-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 560px) { .iv-row { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); } }
.iv-sec { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.iv-label { font-size: 13px; line-height: 16px; font-weight: 600; color: var(--color-ink-2); }
.iv-roles { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
@media (min-width: 560px) { .iv-roles { grid-template-columns: 1fr 1fr; } }
.iv-roles .tk-radio { grid-template-columns: minmax(0, 1fr) auto; align-items: start; padding: 12px 12px 12px 14px; box-shadow: inset 0 0 0 var(--hairline) var(--color-line-strong); }
.iv-roles .tk-radio small { grid-column: 1; line-height: 17px; }
.iv-roles .tk-radio .radio { grid-column: 2; grid-row: 1 / 3; align-self: center; }
.iv-roles .tk-radio[aria-checked="true"] { background: var(--color-hover); box-shadow: inset 0 0 0 1.5px var(--color-accent); }
.chips.iv-does { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; gap: 6px; }
.iv-does .chip { height: 34px; padding: 0 12px; font-size: 13.5px; }
.iv-other { height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--color-field); color: var(--color-ink); font: inherit; font-size: var(--fs-field); outline: none; width: 100%; min-width: 0; }
.iv-other:focus { background: var(--color-surface); box-shadow: inset 0 0 0 1px var(--color-line-strong); }
.iv-err { margin: -8px 0 0; font-size: 13px; line-height: 18px; color: var(--color-danger); }
.iv-go { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; border-radius: 14px; font-size: 15.5px; font-weight: 700; }
.iv-go svg { width: 18px; height: 18px; }
@media (min-width: 560px) { .iv-go { align-self: flex-start; padding: 0 22px; } }

/* The link is ready */
.iv-ready { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 12px; text-align: center; }
.iv-ready__ok { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--btn-pos-bg); box-shadow: inset 0 0 0 1px var(--btn-pos-line); color: var(--color-positive); }
.iv-ready__ok svg { width: 24px; height: 24px; }
.iv-ready h2 { margin: 0; font-size: 20px; line-height: 26px; text-wrap: balance; }
.iv-ready__chips, .iv-card__chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0; }
.iv-ready__chips span, .iv-card__chips span { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 99px; background: var(--color-field); font-size: 13px; font-weight: 600; color: var(--color-ink-2); }
.iv-link { display: flex; gap: 8px; width: 100%; padding: 6px; border-radius: 14px; background: var(--color-field); }
.iv-link input { flex: 1; min-width: 0; height: 40px; padding: 0 8px; border: 0; background: none; color: var(--color-ink-2); font: inherit; font-size: 14px; outline: none; text-overflow: ellipsis; }
.iv-link .dx-btn { flex: none; height: 40px; gap: 6px; background: var(--btn-brand-bg); color: var(--btn-brand-ink); box-shadow: inset 0 0 0 1px var(--btn-brand-line); }
.iv-share { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 100%; }
.iv-app { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: 1 1 120px; height: 44px; padding: 0 14px; border-radius: 12px; background: var(--color-surface); box-shadow: inset 0 0 0 var(--hairline) var(--color-line-strong); color: var(--color-ink); font: inherit; font-size: 14.5px; font-weight: 700; text-decoration: none; cursor: pointer; }
.iv-app svg { width: 16px; height: 16px; color: var(--color-ink-2); }
.iv-app--wa::before, .iv-app--vb::before { content: ""; width: 9px; height: 9px; border-radius: 50%; }
.iv-app--wa::before { background: #25D366; }
.iv-app--vb::before { background: #7360F2; }
@media (hover: hover) and (pointer: fine) { .iv-app:hover { background: var(--color-hover); } }
.iv-note { display: flex; align-items: flex-start; gap: 8px; margin: 0; width: 100%; padding: 10px 12px; border-radius: 12px; background: var(--color-field); font-size: 13px; line-height: 18px; color: var(--color-ink); text-align: left; }
.iv-note svg { flex: none; width: 16px; height: 16px; margin-top: 1px; color: var(--color-ink-2); }
.iv-note--quiet { padding: 0 2px; background: none; font-size: 12px; line-height: 17px; color: var(--color-ink-muted); }
.iv-note--quiet svg { width: 14px; height: 14px; color: var(--color-ink-muted); }
.iv-ready__acts { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; margin-top: 4px; }
.iv-ready__acts > * { flex: 1 1 160px; height: 46px; justify-content: center; gap: 6px; }
.iv-ready__acts .dx-btn { background: var(--color-surface); box-shadow: inset 0 0 0 var(--hairline) var(--color-line-strong); }

/* Crew: invites waiting */
.iv-pending { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px 8px 14px; border-radius: 14px; box-shadow: inset 0 0 0 var(--hairline) var(--color-line-strong); }
.iv-pending h3 { margin: 0 0 4px; font-size: 14px; }
.iv-item { display: flex; align-items: center; gap: 10px; min-height: 54px; }
.iv-item + .iv-item { border-top: var(--hairline) solid var(--color-line); }
.iv-item__ic { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--color-field); color: var(--color-ink-2); }
.iv-item__ic svg { width: 16px; height: 16px; }
.iv-item__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.iv-item__txt b { font-size: 14.5px; line-height: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iv-item__txt small { font-size: 12.5px; line-height: 16px; color: var(--color-ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iv-item.is-expired .iv-item__exp { color: var(--color-danger); }
.iv-item__acts { flex: none; display: flex; align-items: center; gap: 2px; }
.iv-item__acts .icon-btn { width: 36px; height: 36px; }
.iv-item__acts .icon-btn svg { width: 15px; height: 15px; }
.iv-item__acts .dx-btn { height: 32px; padding: 0 12px; font-size: 13px; background: var(--btn-brand-bg); color: var(--btn-brand-ink); box-shadow: inset 0 0 0 1px var(--btn-brand-line); }

/* Crew member card: days they can't play */
.tk-member__busy { display: flex; align-items: flex-start; gap: 6px; margin: 8px 0 0; font-size: 13px; line-height: 18px; color: var(--color-ink-2); }
.tk-member__busy svg { flex: none; width: 14px; height: 14px; margin-top: 2px; color: var(--color-danger); }

/* ---------- #join/<id>: the invite page ---------- */
.screen--join, .screen--join .screen-body { background: var(--color-bg); }
.screen--join .screen-inner { max-width: none; min-height: 100%; padding: 0; display: block; }
.iv-join { position: relative; min-height: 100dvh; display: flex; align-items: flex-end; justify-content: center; padding: calc(64px + env(safe-area-inset-top, 0px)) 0 0; overflow: hidden; }
.iv-join__bg { position: absolute; inset: 0 0 auto; height: 52dvh; background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--color-accent) 34%, var(--color-field)), var(--color-field)) center / cover no-repeat; }
.iv-join__bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(7, 7, 10, .22), transparent 38%, color-mix(in srgb, var(--color-bg) 70%, transparent) 72%, var(--color-bg)); }
.iv-join__x { position: absolute; z-index: 2; top: calc(12px + env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(7, 7, 10, .45); color: #FFFFFF; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.iv-join__x svg { width: 18px; height: 18px; }
.iv-card { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; max-width: 480px; padding: 0 max(24px, env(safe-area-inset-left, 0px)) calc(28px + env(safe-area-inset-bottom, 0px)); text-align: center; }
.iv-card__top { margin-bottom: 4px; }
.iv-card__av { width: 92px; height: 92px; font-size: 30px; box-shadow: 0 0 0 4px var(--color-bg), 0 10px 30px rgba(0, 0, 0, .25); }
.iv-card__eyebrow { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--color-accent-text, var(--color-accent)); }
.iv-card h1 { margin: 0; font-size: 26px; line-height: 31px; font-weight: 800; letter-spacing: -.01em; text-wrap: balance; }
.iv-card__crew { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.iv-card__crew small { font-size: 13px; color: var(--color-ink-muted); }
.iv-faces { display: flex; }
.iv-face { width: 34px; height: 34px; font-size: 12px; box-shadow: 0 0 0 2.5px var(--color-bg); }
.iv-face + .iv-face { margin-left: -8px; }
.iv-card__why { max-width: 38ch; margin: 2px 0 6px; font-size: 15px; line-height: 22px; color: var(--color-ink-2); }
.iv-card__acts { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.iv-card__acts > button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 52px; border-radius: 14px; font-size: 16px; font-weight: 700; }
.iv-card__acts > button svg { width: 18px; height: 18px; }
.iv-card__login { background: var(--color-surface); box-shadow: inset 0 0 0 var(--hairline) var(--color-line-strong); }
.iv-card__minute { font-size: 12.5px; color: var(--color-ink-muted); }
.iv-card__done { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; font-size: 15px; font-weight: 600; }
.iv-card__done svg { width: 18px; height: 18px; color: var(--color-positive); }
.iv-card__state { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 4px; border-radius: 50%; background: var(--color-surface); box-shadow: inset 0 0 0 var(--hairline) var(--color-line-strong); color: var(--color-ink-2); }
.iv-card__state svg { width: 26px; height: 26px; }
.iv-card > .dx-cta { width: 100%; height: 52px; justify-content: center; border-radius: 14px; font-size: 16px; font-weight: 700; }
@media (min-width: 768px) {
  .iv-join { align-items: center; padding: 48px 24px; }
  .iv-join__bg { inset: 0; height: auto; filter: saturate(.9); }
  .iv-join__bg::after { background: rgba(7, 7, 10, .55); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
  .iv-card { max-width: 460px; padding: 36px 36px 28px; border-radius: 28px; background: var(--color-surface); box-shadow: var(--shadow-float); }
  .iv-card__av { box-shadow: 0 0 0 4px var(--color-surface), 0 10px 30px rgba(0, 0, 0, .2); }
  .iv-face { box-shadow: 0 0 0 2.5px var(--color-surface); }
}

/* ---------- Tour: three screens ---------- */
.iv-tour { align-items: flex-end; }
.iv-tour .fsheet__panel.iv-tour__panel { display: flex; flex-direction: column; width: 100%; max-width: 460px; max-height: min(92dvh, 760px); padding: 0; border-radius: 24px; overflow: hidden; }
.iv-tour__bar { flex: none; display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 6px 10px 0 20px; }
.iv-tour__dots { display: flex; gap: 6px; }
.iv-tour__dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--color-line-strong); transition: width .2s ease, background-color .2s ease; }
.iv-tour__dots i.is-on { width: 20px; border-radius: 4px; background: var(--color-accent); }
.iv-tour__skip { height: 36px; padding: 0 12px; border-radius: 99px; font-size: 14px; font-weight: 600; color: var(--color-ink-muted); }
.iv-tour__slide { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 8px 22px 6px; overflow-y: auto; overscroll-behavior: contain; animation: iv-in .3s cubic-bezier(.16, 1, .3, 1); }
.iv-tour__slide h2 { margin: 0; font-size: 22px; line-height: 28px; font-weight: 800; text-wrap: balance; }
.iv-tour__slide > p { margin: 0; font-size: 15px; line-height: 22px; color: var(--color-ink-2); }
.iv-tour__hero { display: flex; align-items: center; gap: 14px; margin: 8px 0 6px; }
.iv-tour__av { width: 64px; height: 64px; font-size: 22px; }
.iv-tour__list { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 0; padding: 0; list-style: none; }
.iv-tour__list li { display: flex; align-items: flex-start; gap: 14px; padding: 12px 0; }
.iv-tour__list li + li { border-top: var(--hairline) solid var(--color-line); }
.iv-tour__list li > svg { flex: none; width: 22px; height: 22px; margin-top: 1px; color: var(--color-accent); }
.iv-tour__list span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.iv-tour__list b { font-size: 15.5px; line-height: 20px; }
.iv-tour__list small { font-size: 13.5px; line-height: 19px; color: var(--color-ink-muted); }
.iv-tour__foot { flex: none; padding: 14px 22px calc(18px + env(safe-area-inset-bottom, 0px)); }
.iv-tour__foot .dx-cta { width: 100%; height: 50px; justify-content: center; border-radius: 14px; font-size: 16px; font-weight: 700; }
@keyframes iv-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
@media (min-width: 640px) { .iv-tour { align-items: center; } }
@media (prefers-reduced-motion: reduce) { .iv-tour__slide { animation: none; } }

/* First steps: in the tour and in the welcome card */
.iv-steps { display: flex; flex-direction: column; gap: 6px; }
.iv-step { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 10px 10px 12px; border-radius: 14px; background: var(--color-surface); box-shadow: inset 0 0 0 var(--hairline) var(--color-line-strong); color: var(--color-ink); text-align: left; }
.iv-step__ic { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--color-field); color: var(--color-ink-2); }
.iv-step__ic svg { width: 17px; height: 17px; }
.iv-step__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.iv-step__txt b { font-size: 14.5px; line-height: 19px; }
.iv-step__txt small { font-size: 12.5px; line-height: 16px; color: var(--color-ink-muted); }
.iv-step__go { flex: none; width: 16px; height: 16px; color: var(--color-ink-muted); }
.iv-step.is-done .iv-step__ic { background: var(--color-positive); color: var(--color-on-positive); }
.iv-step.is-done .iv-step__txt b { color: var(--color-ink-muted); text-decoration: line-through; text-decoration-thickness: 1px; }
@media (hover: hover) and (pointer: fine) { .iv-step:hover { background: var(--color-hover); } }

/* Welcome card in Crew */
.iv-wc { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; background: var(--color-field); }
.iv-wc__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; align-items: center; }
.iv-wc__head b { font-size: 15.5px; line-height: 20px; }
.iv-wc__head small { grid-column: 1; font-size: 12.5px; color: var(--color-ink-muted); }
.iv-wc__x { grid-column: 2; grid-row: 1 / 3; height: 32px; padding: 0 10px; border-radius: 99px; font-size: 13px; font-weight: 600; color: var(--color-ink-muted); }
@media (hover: hover) and (pointer: fine) { .iv-wc__x:hover { background: var(--color-hover); color: var(--color-ink); } }

/* Sheets: you in the band · days you can't play */
.iv-sheet .fsheet__panel.iv-panel { display: flex; flex-direction: column; width: 100%; max-width: 460px; max-height: min(92dvh, 720px); padding: 0; overflow: hidden; }
@media (min-width: 640px) { .iv-sheet { align-items: center; } }
.iv-panel__bar { flex: none; display: flex; align-items: center; gap: 8px; min-height: 54px; padding: 4px 8px 4px 18px; border-bottom: var(--hairline) solid var(--color-line); }
.iv-panel__bar > b { flex: 1; min-width: 0; font-size: 16px; }
.iv-panel__body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; padding: 16px 18px 20px; overflow-y: auto; overscroll-behavior: contain; }
.iv-panel__lead { margin: 0; font-size: 14px; line-height: 20px; color: var(--color-ink-2); }
.iv-panel__foot { flex: none; display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: var(--hairline) solid var(--color-line); }
.iv-panel__foot > * { height: 44px; justify-content: center; }
.iv-panel__foot .dx-cta { flex: 1 1 auto; max-width: 240px; }
.iv-panel__foot .dx-btn { background: var(--color-surface); box-shadow: inset 0 0 0 var(--hairline) var(--color-line-strong); }
.iv-me__pic { position: relative; align-self: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0; color: var(--color-ink-2); }
.iv-me__av { width: 96px; height: 96px; font-size: 30px; }
.iv-me__cam { position: absolute; top: 66px; left: calc(50% + 20px); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--color-accent); color: var(--color-on-accent); box-shadow: 0 0 0 3px var(--color-surface); }
.iv-me__cam svg { width: 15px; height: 15px; }
.iv-me__lbl { font-size: 13px; font-weight: 600; }
.iv-busy__add { display: flex; gap: 8px; }
.iv-busy__add input { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--color-field); color: var(--color-ink); font: inherit; font-size: var(--fs-field); outline: none; -webkit-appearance: none; appearance: none; }
.iv-busy__add .dx-btn { flex: none; height: 44px; gap: 6px; background: var(--btn-brand-bg); color: var(--btn-brand-ink); box-shadow: inset 0 0 0 1px var(--btn-brand-line); }
.chips.iv-busy__list { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; gap: 6px; min-height: 34px; }
.iv-busy__d { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 4px 0 12px; font-size: 13.5px; }
.iv-busy__d > span::first-letter { text-transform: uppercase; }
.iv-busy__d button { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: var(--color-ink-muted); }
.iv-busy__d button svg { width: 12px; height: 12px; }
.iv-busy__none { align-self: center; font-size: 13px; color: var(--color-ink-muted); }

/* Sign up / log in with an invite in hand */
.hl-inv { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; padding: 10px 12px; border-radius: 14px; background: var(--color-field); }
.hl-inv__av { flex: none; width: 40px; height: 40px; font-size: 14px; }
.hl-inv__av.avatar--initials { background: var(--color-surface); box-shadow: inset 0 0 0 var(--hairline) var(--color-line-strong); }
.hl-inv > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.hl-inv small { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--color-ink-muted); }
.hl-inv b { font-size: 14.5px; line-height: 19px; overflow-wrap: anywhere; }
