/* The signed-in user page. One screen: top bar, a main view that always fits, and a bottom nav.
   Nothing here makes the page scroll; any card with more than it can show scrolls inside itself (scrollbars are hidden site-wide). */
body.shell { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }

/* ---------- top bar ---------- */
.topbar { flex: none; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 20px; background: #000; border-bottom: 1px solid var(--line); position: relative; z-index: 40; }
.me { display: flex; align-items: center; gap: 12px; min-width: 0; }
.uname { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.avatar-btn { appearance: none; border: 2px solid transparent; background: var(--grad) border-box; padding: 0; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; flex: none; display: grid; place-items: center; overflow: hidden; }
.avatar-btn:hover, .avatar-btn[aria-expanded="true"] { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.27); }
.pic { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: #1f1f1f; color: #ececec; font-weight: 800; text-transform: uppercase; user-select: none; }
.avatar-btn .pic { border: 2px solid #000; }

/* ---------- account card ---------- */
.acct { position: fixed; z-index: 70; top: 70px; inset-inline-end: 16px; width: min(340px, calc(100vw - 24px)); max-height: calc(100dvh - 150px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid #313131; border-radius: 20px; box-shadow: 0 24px 80px rgba(0, 0, 0, .75); animation: pop .18s ease-out; }
.acct-head { display: flex; align-items: center; gap: 14px; padding: 18px 18px 14px; flex: none; }
.acct-av { width: 72px; height: 72px; border-radius: 50%; flex: none; overflow: hidden; font-size: 30px; display: grid; }
.acct-id { min-width: 0; display: grid; gap: 2px; justify-items: start; }
.acct-id b { font-size: 18px; letter-spacing: -.01em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-id span:not(.chip) { color: var(--muted); font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-body { padding: 0 18px; display: grid; gap: 10px; overflow-y: auto; min-height: 0; flex: 1 1 auto; }
.acct-row { display: flex; flex-wrap: wrap; gap: 8px; }
.acct-form { display: flex; gap: 8px; }
.acct-form .input { font-size: 15px; padding: 9px 12px; min-width: 0; }
.acct-plan { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 8px; }
.acct-plan .msg { margin: 0; min-height: 0; }
.acct .msg { margin: 0; min-height: 0; }
.acct .msg:empty { display: none; }
.acct-foot { flex: none; display: flex; justify-content: space-between; gap: 8px; padding: 14px 18px 18px; border-top: 1px solid var(--line); margin-top: 14px; }

/* ---------- main viewport ---------- */
.viewport { flex: 1 1 0; min-height: 0; position: relative; }
.view { position: absolute; inset: 0; padding: 16px 20px 12px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; animation: pop .22s ease-out; }
.view[hidden] { display: none; }
.view > .grid { --h: 100%; height: 100%; padding-bottom: 0; width: min(1500px, 100%); margin: 0 auto; }
.sc { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.view-analytics iframe, #view-analytics iframe { width: 100%; height: 100%; border: 0; display: block; background: var(--bg); }
#view-analytics { padding: 0; overflow: hidden; }
/* short windows: keep each page a readable height and let the view scroll instead of squashing cards to nothing */
.view > .grid { min-height: 560px; }
.dash { min-height: 440px; }
.report { min-height: 560px; }
.tl { min-height: 420px; }

/* ---------- bottom nav ---------- */
.dock { flex: none; display: flex; justify-content: center; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, #000 40%); position: relative; z-index: 30; }
.dock-bar { display: flex; align-items: center; gap: 6px; padding: 7px; width: 100%; max-width: 100%; background: rgba(28, 28, 44, .6); -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5); border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px; box-shadow: 0 12px 40px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .08); }
.dock-tabs { display: flex; align-items: center; gap: 4px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.dock-tabs::-webkit-scrollbar, .dock-bar::-webkit-scrollbar, .dock::-webkit-scrollbar { display: none; width: 0; height: 0; }
.dock button { appearance: none; border: 0; background: transparent; color: #dddddd; font: inherit; font-weight: 700; font-size: 14px; padding: 10px 17px; border-radius: 999px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; flex: none; }
.dock button:hover:not([disabled]) { background: rgba(255, 255, 255, .09); color: #fff; }
.dock button.on { background: rgba(255, 255, 255, 0.21); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.36); }
.dock button[disabled] { opacity: .35; cursor: default; }
.dock .dyn { animation: dockin .4s cubic-bezier(.2, .9, .3, 1.2) both; }
.dock .ctx { color: #ededed; }
.dock .ctx.load { background: var(--grad); color: var(--on-grad); }
.dock .ctx.load:hover:not([disabled]) { background: var(--grad); filter: brightness(1.12); }
.dock .sep { width: 1px; height: 22px; background: rgba(255, 255, 255, .16); flex: none; margin: 0 4px; }
.dock .xb { width: 24px; height: 24px; padding: 0; justify-content: center; background: rgba(255, 255, 255, .12); font-size: 15px; line-height: 1; margin-left: -4px; }
.dock .xb:hover:not([disabled]) { background: rgba(255, 255, 255, .26); }
.dock .arrow { width: 40px; padding: 10px 0; justify-content: center; font-size: 17px; font-weight: 800; }
.dock button > span { display: inline-flex; align-items: center; gap: 8px; }
.dock .dot { display: inline-block; width: 8px; height: 8px; flex: none; }
.dock-arrows { display: flex; gap: 2px; flex: none; }
@keyframes dockin { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }

/* ---------- Dash Board ---------- */
.dash { width: min(1500px, 100%); height: 100%; margin: 0 auto; display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 14px; }
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.dash-head h1 { margin: 0; font-size: clamp(22px, 3vw, 30px); letter-spacing: -.025em; }
.dash-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.dash-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.dash-tiles .tile { padding: 10px 14px; }
.dash-tiles .tile b { font-size: 22px; }
.dash-list { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.dash-list > header, .rep-card > header { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.dash-list > header b, .rep-card > header b { color: var(--text); font-variant-numeric: tabular-nums; }
.sess-grid { flex: 1 1 0; padding: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; align-content: start; }
.sess-grid > .msg { grid-column: 1 / -1; padding: 20px; text-align: center; }
.scard { appearance: none; text-align: start; font: inherit; color: inherit; cursor: pointer; background: var(--panel-2); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: grid; gap: 10px; transition: border-color .15s, transform .15s, background .15s; }
.scard:hover, .scard:focus-visible { border-color: #6a6a6a; background: #1b1b1b; transform: translateY(-2px); outline: none; }
.scard-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.scard-top b { font-size: 17px; letter-spacing: -.01em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scard-top .open { color: #d0d0d0; font-size: 12px; font-weight: 700; opacity: 0; transition: opacity .15s; white-space: nowrap; }
.scard:hover .open, .scard:focus-visible .open { opacity: 1; }
.scard small { color: var(--muted); font-size: 13px; display: block; margin-top: -6px; }
.scard-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.scard-nums div { background: #0d0d0d; border-radius: 10px; padding: 6px 8px; min-width: 0; }
.scard-nums b { display: block; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.scard-nums span { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scard-top3 { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-width: 0; min-height: 28px; }
.scard-top3 .nm { color: var(--text); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scard-top3 .av { pointer-events: none; }

/* ---------- full session report ---------- */
.report { width: min(1500px, 100%); height: 100%; margin: 0 auto; display: grid; grid-template-rows: auto auto minmax(110px, 0.42fr) minmax(0, 1fr); gap: 12px; }
.rep-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rep-head h1 { margin: 0; font-size: clamp(20px, 2.6vw, 28px); letter-spacing: -.02em; }
.rep-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.rep-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rep-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.rep-tiles .tile { padding: 9px 14px; } .rep-tiles .tile b { font-size: 21px; }
.rep-card { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.timeline { flex: 1 1 0; min-height: 0; padding: 10px 16px 8px; display: flex; flex-direction: column; gap: 4px; }
.timeline svg { flex: 1 1 0; min-height: 0; width: 100%; display: block; }
.timeline .axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); flex: none; }
.legend { display: inline-flex; gap: 12px; text-transform: none; letter-spacing: 0; font-weight: 600; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-inline-end: 5px; }
.rep-lists { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; min-height: 0; }
.rep-list { list-style: none; margin: 0; padding: 6px 10px 8px; flex: 1 1 0; min-height: 0; }
.rep-list li { display: flex; align-items: center; gap: 10px; padding: 6px 4px; font-size: 14px; border-radius: 10px; }
.rep-list li .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-list li b { font-variant-numeric: tabular-nums; }
.rep-list .empty { padding: 14px 6px; }

/* ---------- narrow screens: stack, and let the view scroll inside itself ---------- */
@media (max-width: 1080px) {
  .view > .grid { height: auto; min-height: 0; }
  .dash, .report, .tl { min-height: 0; }
  .dash, .report { height: auto; grid-template-rows: none; }
  .dash-list { min-height: 360px; }
  .report .rep-card.tl { height: 170px; }
  .rep-lists { grid-template-columns: 1fr; }
  .rep-lists .rep-card { height: 260px; }
  .dash-tiles, .rep-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .topbar { padding: 0 12px; }
  .view { padding: 12px; }
  .dock { padding-inline: 8px; }
  .dock-bar { gap: 2px; padding: 5px; }
  .dock button { padding: 8px 11px; font-size: 13px; }
  .dock .arrow { width: 32px; }
  .dock .sep { margin: 0 2px; }
  .dash-head .btn { display: none; }
}

/* ---------- account card: language + translation ---------- */
.acct-pref { display: grid; gap: 8px; }
.acct-pref label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.acct-pref select.input { font-size: 15px; padding: 8px 10px; }
.acct-pref label.chk { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; cursor: pointer; }
.acct-pref .msg { font-size: 12px; }
html[dir="rtl"] .dock .arrow { transform: scaleX(-1); }

/* ---------- Comment Translator ---------- */
.tl { width: min(1500px, 100%); height: 100%; margin: 0 auto; display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 12px; }
.tl-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.tl-head h1 { margin: 0; font-size: clamp(22px, 3vw, 30px); letter-spacing: -.025em; }
.tl-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.tl-form { display: flex; gap: 8px; align-items: center; }
.tl-form .input { font-size: 16px; padding: 10px 14px; width: min(260px, 50vw); }
.tl-status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 34px; }
.tl-status .msg { margin: 0; min-height: 0; }
.tl-live { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.tr-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.tl-card { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.tl-card > header { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 11px 18px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tl-list { list-style: none; margin: 0; padding: 4px 10px; flex: 1 1 0; }
.tl-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 10px 8px; border-bottom: 1px solid #181818; animation: pop .25s ease-out; }
.tl-orig { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.tl-orig .who { min-width: 0; line-height: 1.35; }
.tl-orig .who b { display: block; font-size: 13px; color: #d0d0d0; }
.tl-orig .who span { font-size: 16px; overflow-wrap: anywhere; }
.tl-out { font-size: 17px; line-height: 1.4; overflow-wrap: anywhere; min-width: 0; }
.tl-out.dim { color: #636363; font-size: 15px; }
.tl-out.wait { color: #636363; }
@media (max-width: 720px) {
  .tl-card > header { grid-template-columns: 1fr; } .tl-card > header span:last-child { display: none; }
  .tl-row { grid-template-columns: 1fr; gap: 4px; } .tl-out { padding-inline-start: 38px; }
}

.acct-form.stack { flex-direction: column; }
.acct-form.stack .btn { align-self: flex-start; }

/* bottom nav: when the tabs are wider than the window they scroll sideways; the edges fade so it is clear there is more */
.dock-tabs { scroll-behavior: smooth; }
.dock-tabs[data-more~="l"] { -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px); mask-image: linear-gradient(90deg, transparent, #000 28px); }
.dock-tabs[data-more~="r"] { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.dock-tabs[data-more~="l"][data-more~="r"] { -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
@media (max-width: 380px) { .dock .sep { display: none; } .dock button { padding: 8px 9px; font-size: 12px; } .dock .arrow { width: 28px; } }

/* ---------- Share: the animated 9:16 card next to its controls ---------- */
.shr { width: min(1100px, 100%); height: 100%; min-height: 560px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, auto) minmax(300px, 460px); gap: 22px; justify-content: center; align-items: stretch; }
.shr[hidden], .shr-empty[hidden] { display: none; }
.shr-stage { min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.shr-canvas { height: 100%; width: auto; max-height: 100%; max-width: 100%; flex: none; aspect-ratio: 9 / 16; border-radius: 20px; border: 1px solid var(--line); background: #070707; box-shadow: 0 18px 60px rgba(0, 0, 0, .55); }
.shr-side { padding: 20px; display: flex; flex-direction: column; gap: 14px; align-self: start; }
.shr-side h1 { margin: 0; font-size: clamp(22px, 3vw, 28px); letter-spacing: -.02em; }
.shr-side p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.shr-field { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.shr-field .input { font-size: 15px; padding: 10px 12px; font-weight: 500; color: var(--text); min-width: 0; }
.shr-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.shr-note { color: var(--muted); font-size: 12px; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.shr-acts .btn { flex: 1 1 auto; justify-content: center; }
.shr-side .msg { margin: 0; min-height: 20px; }
.shr-empty { width: min(560px, 100%); margin: 40px auto; padding: 28px; text-align: center; }
.shr-empty p { margin: 0 0 12px; color: var(--muted); }
.shr-empty a { color: #d0d0d0; font-weight: 700; }
.share-cta { display: flex; justify-content: center; padding: 6px 0 0; }
@media (max-width: 1080px) {
  .shr { height: auto; min-height: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .shr-stage { height: auto; }
  .shr-canvas { height: min(560px, 70vh); }
  .shr-side { align-self: stretch; }
}

.shr-stage { position: relative; }
.shr-canvas.off { opacity: .35; }
.shr-hint { position: absolute; inset: 0; display: grid; place-items: center; padding: 0 24px; text-align: center; color: var(--muted); font-size: 15px; pointer-events: none; margin: 0; }
.shr-hint[hidden] { display: none; }
.shr-source { color: #d0d0d0; font-weight: 600; font-size: 12px; }
.shr-source:empty { display: none; }

/* ---------- Share: template cards on an arc, chips, speed slider ---------- */
.shr { grid-template-columns: minmax(0, auto) minmax(320px, 500px); grid-template-rows: minmax(0, 1fr); }
.shr-stage { height: 100%; }
.shr-side { max-height: 100%; overflow-y: auto; overscroll-behavior: contain; }
.shr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chipbtn { appearance: none; font: inherit; font-size: 13px; font-weight: 700; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.chipbtn:hover { border-color: #404040; color: var(--text); }
.chipbtn.on { color: #fff; background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.42); }
.shr-speed { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: var(--muted); margin-top: 4px; }
.shr-speed input { flex: 1; min-width: 0; accent-color: #ffffff; }
.shr-speed output { min-width: 3ch; text-align: end; color: var(--text); font-variant-numeric: tabular-nums; }
.shr-tplname { color: var(--text); font-size: 14px; text-align: center; margin-top: 2px; }

.fan-box { position: relative; height: 218px; overflow: hidden; margin-top: 2px; }
.fan { --card-width: 82px; --card-h: calc(var(--card-width) * 1.5); --radius: 232px; --cards: 8; --arc-size: .27; --arc-center: .75; --arc-start: calc(var(--arc-center) - var(--arc-size) / 2); --arc-delta: .012;
  --ease: linear(0, 0.01 0.8%, 0.038 1.6%, 0.154 3.4%, 0.781 9.7%, 1.01 12.5%, 1.089 13.8%, 1.153 15.2%, 1.195 16.6%, 1.219 18%, 1.224 19.7%, 1.208 21.6%, 1.172 23.6%, 1.057 28.6%, 1.007 31.2%, 0.969 34.1%, 0.951 37.1%, 0.953 40.9%, 0.998 50.4%, 1.011 56%, 0.998 74.7%, 1);
  position: absolute; left: 50%; top: calc(var(--radius) - var(--card-h) + 8px); width: var(--card-width); height: var(--card-h); margin-left: calc(var(--card-width) / -2); }
.fan > div { --arc-step: calc(var(--arc-size) / (var(--cards) - 1)); --arc-shift: 0; position: absolute; width: var(--card-width); height: var(--card-h); border-radius: 10px;
  offset-path: circle(var(--radius) at 50% 100%); offset-distance: calc((var(--arc-start) + (var(--card-i) - 1) * var(--arc-step) + var(--arc-shift)) * 100%); offset-rotate: auto; offset-anchor: 50% 0%;
  transition: all 700ms var(--ease); box-shadow: 0 8px 22px rgba(0, 0, 0, .5); }
.fan > div:nth-child(1) { --card-i: 1; z-index: 0; } .fan > div:nth-child(2) { --card-i: 2; z-index: 1; } .fan > div:nth-child(3) { --card-i: 3; z-index: 2; } .fan > div:nth-child(4) { --card-i: 4; z-index: 3; }
.fan > div:nth-child(5) { --card-i: 5; z-index: 3; } .fan > div:nth-child(6) { --card-i: 6; z-index: 2; } .fan > div:nth-child(7) { --card-i: 7; z-index: 1; } .fan > div:nth-child(8) { --card-i: 8; z-index: 0; }
.fan-btn { appearance: none; display: block; width: 100%; height: 100%; padding: 0; border: 2px solid rgba(255, 255, 255, .16); border-radius: inherit; background: #000; cursor: pointer; overflow: hidden; }
.fan-btn img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.fan > div:hover { offset-anchor: 50% 14%; z-index: 20; }
.fan > div:hover + div { --arc-shift: calc(var(--arc-delta) * 3); }
.fan > div:hover + div + div { --arc-shift: calc(var(--arc-delta) * 2); }
.fan > div:hover + div + div + div { --arc-shift: calc(var(--arc-delta) * 1); }
.fan > div:has(+ div:hover) { --arc-shift: calc(var(--arc-delta) * -3); }
.fan > div:has(+ div + div:hover) { --arc-shift: calc(var(--arc-delta) * -2); }
.fan > div:has(+ div + div + div:hover) { --arc-shift: calc(var(--arc-delta) * -1); }
.fan > div.on { offset-anchor: 50% 26%; z-index: 30; }
.fan > div.on .fan-btn { border-color: #d4d4d4; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.33); }
.fan-btn:focus-visible { outline: 3px solid #d0d0d0; outline-offset: 2px; }
@media (max-width: 720px) { .fan-box { height: 186px; } .fan { --card-width: 66px; --radius: 190px; } }
@media (prefers-reduced-motion: reduce) { .fan > div { transition: none; } }

/* Share on tablets and phones: one column (kept last so it wins over the desktop rules above) */
@media (max-width: 1080px) {
  .shr { height: auto; min-height: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .shr-stage { height: auto; }
  .shr-canvas { height: min(560px, 68vh); width: auto; }
  .shr-side { align-self: stretch; max-height: none; overflow: visible; }
}

/* Shout Out: the link row */
.shr-field .input[readonly] { cursor: text; }
.shr-row .input { flex: 1 1 200px; min-width: 0; }

/* ---------- Overlay: a preview of the transparent layer on a checkerboard, next to its setup ---------- */
.ovv-prev { height: 100%; width: auto; max-height: 100%; max-width: 100%; flex: none; aspect-ratio: 9 / 16; border-radius: 20px; border: 1px solid var(--line); overflow: hidden; box-shadow: 0 18px 60px rgba(0, 0, 0, .55);
  background: repeating-conic-gradient(#2d2d2d 0 25%, #1e1e1e 0 50%) 0 0 / 28px 28px; }
.ovv-prev[hidden] { display: none; }
.ovv-prev.off { opacity: .45; }
.ovv-prev iframe { width: 100%; height: 100%; border: 0; background: transparent; display: block; }
@media (max-width: 760px) { .ovv-prev { height: min(560px, 68vh); width: auto; } }
.ovv.ovv-lock { grid-template-columns: minmax(300px, 460px); }
.shr-stage[hidden] { display: none; }

/* Pro: views a free account sees locked, and the small Pro tag in the bottom nav */
.view.locked > :not(.lockcard) { display: none !important; }
.lockcard { max-width: 520px; margin: 40px auto; padding: 26px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.lockcard h2 { margin: 0; font-size: 22px; }
.lockcard p { margin: 0; color: var(--muted); }
.pro-tag { font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 1px 6px; border-radius: 99px; background: var(--grad); color: var(--on-grad); vertical-align: middle; }
.shr-need { outline: 2px solid var(--err); outline-offset: 2px; }

/* overlay setup: the two size numbers and the check */
.ovv-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ovv-chip { appearance: none; display: grid; gap: 2px; text-align: center; min-width: 96px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: inherit; cursor: pointer; }
.ovv-chip small { color: var(--muted); font-size: 12px; }
.ovv-chip b { font-size: 22px; font-variant-numeric: tabular-nums; }
.ovv-chip.done { border-color: var(--ok); }
.ovv-x { color: var(--muted); font-size: 20px; }
.ovv-chk { margin: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); font-size: 14px; line-height: 1.45; }
.ovv-chk[hidden] { display: none; }
.ovv-chk.ok { border-color: var(--ok); color: var(--ok); }
.ovv-chk.bad { border-color: #f59e0b; color: #fbbf24; }
.ovv-chk.old, .ovv-chk.wait { color: var(--muted); }

/* the picture walkthrough in the overlay setup */

/* Overlay tab: styles of overlay and the avatar circle editor */
.ovo-modes { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.ovo-mode { appearance: none; display: grid; gap: 4px; text-align: start; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: inherit; cursor: pointer; }
.ovo-mode b { font-size: 14px; }
.ovo-mode small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.ovo-mode.on { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok) inset; }
.ovo-mvp { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--line); justify-items: start; }
.ovo-mvp[hidden] { display: none; }
.ovo-circ { display: grid; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); }
.ovo-lab { color: var(--muted); font-size: 12px; font-weight: 600; }
.ovo-sw { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ovo-swatch { appearance: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.ovo-swatch.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--ok); }
.ovo-color { width: 34px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; cursor: pointer; }
.ovo-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.ovo-opt { appearance: none; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.ovo-opt.on { border-color: var(--ok); color: var(--ok); font-weight: 700; }
.ovo-chk { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.ovo-tests { display: flex; flex-wrap: wrap; gap: 8px; }
.ovo-bat { font-size: 13px; color: var(--muted); }
.ovo-bat.on { color: var(--ok); }
.ovo-bat.on::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-inline-end: 6px; }
.ovo-bats { display: grid; gap: 6px; }

/* Dance off settings (Overlay tab) and the gift picker */
.ovo-dance { display: grid; gap: 10px; margin-top: 10px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); }
.ovo-dance[hidden] { display: none; }
.ovo-field { display: grid; gap: 6px; }
.ovo-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.gpk { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .72); display: grid; place-items: center; padding: 14px; }
.gpk-card { width: min(560px, 100%); max-height: min(86vh, 720px); display: grid; grid-template-rows: auto auto auto auto minmax(0, 1fr) auto auto; gap: 10px; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel, #111); color: var(--text); }
.gpk-card h3 { margin: 0; font-size: 18px; }
.gpk-list { overflow: auto; display: grid; gap: 6px; align-content: start; min-height: 120px; }
.gpk-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 10px; background: var(--panel-2); }
.gpk-row:has(input) { grid-template-columns: 36px minmax(0, 1fr) auto 64px auto; }
.gpk-row img, .gpk-row > span:first-child { width: 36px; height: 36px; object-fit: contain; display: grid; place-items: center; }
.gpk-row b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.gpk-row input { width: 64px; padding: 6px; text-align: center; }

/* the bottom nav uses the whole screen width: the tabs share the space */
.dock-tabs > button { flex: 1 0 auto; justify-content: center; padding-inline: 12px; }
.dock-tabs > button.xb { flex: none; padding-inline: 10px; }
@media (max-width: 760px) { .dock { padding-inline: 6px; } .dock-tabs > button { font-size: 13px; padding-inline: 10px; } }

/* Visitors: top bar controls and the "create a free account" card */
.g-lang { width: auto; max-width: 150px; padding: 6px 10px; font-size: 14px; }
.gate { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .72); }
.gate-card { width: min(440px, 100%); background: #141414; border: 1px solid #313131; border-radius: 22px; padding: 26px 24px 20px; box-shadow: 0 24px 80px rgba(0, 0, 0, .75); animation: pop .18s ease-out; }
.gate-card h2 { margin: 0 0 10px; font-size: 22px; }
.gate-card p { margin: 0 0 18px; color: #cfcfcf; line-height: 1.5; }
.gate-row { display: flex; flex-wrap: wrap; gap: 10px; }
.gate-card small { display: block; margin-top: 14px; color: #8d8d8d; }
