/* BotGoLive dashboard - iOS-style Telegram Mini App styles.
   Animations use transform/opacity only. Colours follow the Telegram theme. */

:root {
  /* Fallback palette (iOS system colours), used outside Telegram. */
  --fb-page: #f2f2f7;
  --fb-card: #ffffff;
  --fb-text: #000000;
  --fb-hint: #6e6e73;
  --fb-accent: #007aff;
  --fb-accent-text: #ffffff;
  --fb-sep: rgba(60, 60, 67, .2);

  --page: var(--tg-theme-secondary-bg-color, var(--fb-page));
  --card: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, var(--fb-card)));
  --text: var(--tg-theme-text-color, var(--fb-text));
  --hint: var(--tg-theme-hint-color, var(--fb-hint));
  --sub: var(--tg-theme-subtitle-text-color, var(--hint));
  --head: var(--tg-theme-section-header-text-color, var(--hint));
  --accent: var(--tg-theme-button-color, var(--fb-accent));
  --accent-text: var(--tg-theme-button-text-color, var(--fb-accent-text));
  --link: var(--tg-theme-link-color, var(--accent));
  --danger: var(--tg-theme-destructive-text-color, #ff3b30);
  --sep: var(--tg-theme-section-separator-color, var(--fb-sep));

  --live: #ff3b30;
  --live-2: #ff2d6f;
  --ok: #34c759;
  --warn: #ff9500;
  --info: #5856d6;
  --muted: #8e8e93;

  --fill: rgba(118, 118, 128, .16);
  --fill-2: rgba(118, 118, 128, .1);
  --press: rgba(118, 118, 128, .14);
  --elev: var(--card);
  --seg-thumb: var(--card);
  --bar-bg: color-mix(in srgb, var(--page) 76%, transparent);
  --sheet-bg: var(--page);
  --sheet-row: var(--card);
  --shadow: 0 0 0 .5px rgba(0, 0, 0, .02), 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px -8px rgba(0, 0, 0, .08);
  --shadow-float: 0 12px 40px rgba(0, 0, 0, .14), 0 2px 8px rgba(0, 0, 0, .06);

  --r-lg: 22px;
  --r: 18px;
  --r-md: 14px;
  --r-sm: 10px;
  --gutter: 16px;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --safe-top: max(env(safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --safe-left: max(env(safe-area-inset-left, 0px), var(--tg-safe-area-inset-left, 0px));
  --safe-right: max(env(safe-area-inset-right, 0px), var(--tg-safe-area-inset-right, 0px));
  --content-top: var(--tg-content-safe-area-inset-top, 0px);
  --bar-top: calc(var(--safe-top) + var(--content-top));
  --bar-h: 44px;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --fb-page: #000000;
  --fb-card: #1c1c1e;
  --fb-text: #ffffff;
  --fb-hint: #98989f;
  --fb-accent: #0a84ff;
  --fb-sep: rgba(84, 84, 88, .6);
  --live: #ff453a;
  --live-2: #ff375f;
  --ok: #30d158;
  --warn: #ff9f0a;
  --info: #7d7aff;
  --muted: #8e8e93;
  --fill: rgba(118, 118, 128, .3);
  --fill-2: rgba(118, 118, 128, .2);
  --press: rgba(118, 118, 128, .24);
  --elev: color-mix(in srgb, var(--card) 86%, #ffffff);
  --seg-thumb: color-mix(in srgb, var(--card) 62%, #8e8e93);
  --sheet-bg: var(--card);
  --sheet-row: var(--elev);
  --shadow: none;
  --shadow-float: 0 16px 48px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

@media (min-width: 388px) { :root { --gutter: 20px; } }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: hidden; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--page);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -.008em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body { overflow-x: clip; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }

button, input { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; -webkit-user-select: none; user-select: none; }
button:disabled { cursor: default; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

[hidden] { display: none !important; }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

.noscript { padding: 24px; text-align: center; }

/* ---------- Navigation bar (collapsing large title) ---------- */

.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  padding: var(--bar-top) var(--safe-right) 0 var(--safe-left);
  pointer-events: none;
}
.navbar::before {
  content: ""; position: absolute; inset: 0;
  background: var(--bar-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 .5px 0 var(--sep);
  opacity: 0; transition: opacity .28s ease;
}
.navbar.solid::before { opacity: 1; }
.navbar.merged::before { box-shadow: none; }
.nav-inner {
  position: relative; height: var(--bar-h); max-width: 600px; margin: 0 auto; padding: 0 8px;
  display: grid; grid-template-columns: minmax(64px, 1fr) minmax(0, auto) minmax(64px, 1fr); align-items: center;
}
.nav-title {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0;
  font-size: 17px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap;
  opacity: 0; transform: translateY(8px);
  transition: opacity .25s ease, transform .4s var(--ease);
}
.nav-title span { overflow: hidden; text-overflow: ellipsis; }
.nav-title .ndot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); flex: none; }
.navbar.compact .nav-title { opacity: 1; transform: none; }
.nav-back {
  pointer-events: auto; justify-self: start;
  display: inline-flex; align-items: center; gap: 0; height: 44px; padding: 0 10px 0 2px;
  color: var(--link); font-size: 17px; letter-spacing: -.02em;
  transition: opacity .2s ease;
}
.nav-back .ico { width: 26px; height: 26px; }
.nav-back .ico svg { stroke-width: 2.4; }
.nav-back:active { opacity: .4; }

/* ---------- Views & page transitions ---------- */

#app { position: relative; min-height: 100vh; min-height: var(--tg-viewport-stable-height, 100vh); }

.view {
  max-width: 600px; margin: 0 auto;
  padding:
    calc(var(--bar-top) + 10px)
    calc(var(--gutter) + var(--safe-right))
    calc(40px + var(--safe-bottom))
    calc(var(--gutter) + var(--safe-left));
  display: flex; flex-direction: column;
}
body.bar-back .view { padding-top: calc(var(--bar-top) + var(--bar-h) + 4px); }

.view-leaving { position: fixed; left: 0; right: 0; z-index: 0; pointer-events: none; }
.v-in-fwd { animation: inFwd .5s var(--ease) both; }
.v-in-back { animation: inBack .5s var(--ease) both; }
.v-in-fade { animation: inFade .4s var(--ease-out) both; }
.v-out-fwd { animation: outFwd .42s var(--ease) both; }
.v-out-back { animation: outBack .42s var(--ease) both; }
.v-out-fade { animation: outFade .25s ease both; }
@keyframes inFwd { from { opacity: 0; transform: translate3d(36px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes inBack { from { opacity: 0; transform: translate3d(-36px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes inFade { from { opacity: 0; transform: translate3d(0, 10px, 0); } to { opacity: 1; transform: none; } }
@keyframes outFwd { to { opacity: 0; transform: translate3d(-28px, 0, 0); } }
@keyframes outBack { to { opacity: 0; transform: translate3d(36px, 0, 0); } }
@keyframes outFade { to { opacity: 0; transform: scale(.985); } }

.rise { animation: rise .55s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translate3d(0, 14px, 0); } to { opacity: 1; transform: none; } }

/* ---------- Large titles & section heads ---------- */

.large-head { padding: 6px 4px 0; margin-bottom: 24px; }
.lh-row { display: flex; align-items: flex-end; gap: 12px; }
.lh-text { flex: 1; min-width: 0; }
.lh-caption { font-size: 15px; font-weight: 600; color: var(--hint); letter-spacing: -.01em; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.large-title {
  margin: 0; font-size: 34px; line-height: 1.12; font-weight: 700; letter-spacing: -.026em;
  overflow-wrap: anywhere;
}
.large-title.t2 { font-size: 28px; line-height: 1.15; letter-spacing: -.022em; }
.lh-sub { margin-top: 4px; font-size: 15px; color: var(--hint); display: flex; align-items: center; gap: 5px; }
.lh-sub .ico { width: 14px; height: 14px; }
.lh-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-top: 12px; font-size: 13px; color: var(--sub); }
.lh-meta .m { display: inline-flex; align-items: center; gap: 5px; }
.lh-meta .ico { width: 15px; height: 15px; }
.lh-badges { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.lh-badges .grow { flex: 1; }

.section { margin-bottom: 32px; }
.section:last-child { margin-bottom: 0; }
.sec-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 0 4px 12px; font-size: 22px; font-weight: 700; letter-spacing: -.022em; line-height: 1.2;
}
.sec-head .c { font-size: 15px; font-weight: 500; color: var(--hint); letter-spacing: -.01em; }
.sec-foot { margin: 10px 16px 0; font-size: 13px; line-height: 1.38; color: var(--hint); }

.stack { display: flex; flex-direction: column; gap: 12px; }

/* ---------- Surfaces ---------- */

.card {
  position: relative; background: var(--card); border-radius: var(--r-lg);
  box-shadow: var(--shadow); padding: 18px;
}
.group { position: relative; background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.hair { height: .5px; background: var(--sep); }

.press { transition: transform .35s var(--ease), opacity .2s ease; }
.press:active { transform: scale(.97); transition-duration: .12s; }

/* ---------- Icons, pills, badges ---------- */

.ico { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ico svg { width: 100%; height: 100%; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px; border-radius: 12px;
  font-size: 13px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap;
  background: var(--fill-2); color: var(--sub);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.tone-ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.tone-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 15%, transparent); }
.tone-danger { color: var(--danger); background: color-mix(in srgb, var(--danger) 13%, transparent); }
.tone-info { color: var(--info); background: color-mix(in srgb, var(--info) 14%, transparent); }
.tone-muted { color: var(--sub); background: var(--fill-2); }
.tone-live { color: var(--live); background: color-mix(in srgb, var(--live) 13%, transparent); }

.owner-chip {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 12px;
  font-size: 13px; font-weight: 600; color: var(--info); white-space: nowrap;
  background: color-mix(in srgb, var(--info) 13%, transparent);
}

.live-badge {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px 0 9px; border-radius: 13px; flex: none;
  background: linear-gradient(135deg, var(--live), var(--live-2)); color: #fff;
  font-size: 12px; font-weight: 700; letter-spacing: .09em;
  box-shadow: 0 4px 14px -2px color-mix(in srgb, var(--live) 50%, transparent);
}
.live-badge .dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.live-badge .dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1.5px solid #fff; opacity: 0; animation: ring 1.8s var(--ease-out) infinite;
}
.live-badge.sm { height: 22px; padding: 0 8px 0 7px; font-size: 11px; }
@keyframes ring { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }

.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq i { width: 3px; height: 100%; border-radius: 1.5px; background: var(--live); transform-origin: bottom; animation: eq 1.1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.4s; }
.eq i:nth-child(3) { animation-delay: -.75s; }
@keyframes eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px; border-radius: var(--r-md);
  font-size: 17px; font-weight: 600; letter-spacing: -.02em;
  background: var(--accent); color: var(--accent-text);
  transition: transform .35s var(--ease), opacity .2s ease;
}
.btn:active { transform: scale(.97); transition-duration: .12s; }
.btn.block { width: 100%; }
.btn.secondary { background: var(--fill-2); color: var(--link); }
.btn.tinted { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--link); }
.btn.danger { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.btn:disabled { opacity: .45; }
.btn .ico { width: 20px; height: 20px; }

/* ---------- Home ---------- */


.live-card {
  position: relative; overflow: hidden; display: block; width: 100%; text-align: left;
  background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 16px 18px 18px; isolation: isolate;
}
.live-card::before {
  content: ""; position: absolute; inset: -30% -10% auto 35%; height: 160%; z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--live) 14%, transparent), transparent);
  animation: breathe 5s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes breathe { from { opacity: .55; transform: scale(1); } to { opacity: 1; transform: scale(1.12); } }
.lc-top { display: flex; align-items: center; gap: 10px; }
.lc-top .elapsed { font-size: 15px; font-weight: 600; color: var(--live); }
.lc-top .grow { flex: 1; }
.lc-title {
  margin: 14px 28px 14px 0; font-size: 20px; font-weight: 700; letter-spacing: -.022em; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lc-chev { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--hint); opacity: .55; }
.lc-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 15px; color: var(--hint); }
.lc-stats b { color: var(--text); font-weight: 600; }
.lc-stats > span { display: inline-flex; align-items: center; gap: 5px; }
.lc-stats .ico { width: 16px; height: 16px; }

.bar { position: relative; height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.bar .fill {
  position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--p, 0));
  border-radius: inherit; background: var(--accent);
  transition: transform .9s var(--ease);
}
.bar.live .fill { background: linear-gradient(90deg, var(--live), var(--live-2)); }
.bar.working .fill::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent);
  animation: sheen 1.8s linear infinite;
}
@keyframes sheen { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* Grouped project list */
.proj-row {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  min-height: 76px; padding: 14px 12px 14px 16px; transition: background .2s ease;
}
.proj-row:active { background: var(--press); transition-duration: 0s; }
.proj-row + .proj-row::before {
  content: ""; position: absolute; top: 0; left: 74px; right: 0; height: .5px; background: var(--sep);
}
.ch-avatar {
  position: relative; width: 44px; height: 44px; border-radius: 12px; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 19px; letter-spacing: -.01em;
  background: linear-gradient(135deg, hsl(var(--h, 210) 78% 64%), hsl(calc(var(--h, 210) + 48) 70% 50%));
}
:root[data-theme="dark"] .ch-avatar { background: linear-gradient(135deg, hsl(var(--h, 210) 70% 58%), hsl(calc(var(--h, 210) + 48) 64% 44%)); }
.ch-avatar .live-dot {
  position: absolute; right: -3px; top: -3px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--live); box-shadow: 0 0 0 2.5px var(--card);
}
.ch-avatar .live-dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1.5px solid var(--live); animation: ring 1.8s var(--ease-out) infinite;
}
.pr-main { flex: 1; min-width: 0; }
.pr-title { font-size: 17px; font-weight: 600; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-sub { display: flex; align-items: center; gap: 4px; margin-top: 1px; font-size: 15px; color: var(--hint); overflow: hidden; white-space: nowrap; }
.pr-sub span { overflow: hidden; text-overflow: ellipsis; }
.pr-sub .ico { width: 13px; height: 13px; }
.pr-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pr-meta .facts { font-size: 13px; color: var(--sub); flex-basis: 100%; }
.chev { color: var(--hint); opacity: .5; flex: none; }
.chev .ico, .ico.chev { width: 16px; height: 16px; }
.chev svg { stroke-width: 2.6; }

.enter { animation: rise .5s var(--ease) both; }

/* ---------- Skeletons ---------- */

.skel {
  border-radius: 8px; overflow: hidden; position: relative;
  background: var(--fill-2);
}
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--card) 55%, transparent), transparent);
  transform: translateX(-100%); animation: sheen 1.5s ease-in-out infinite;
}
.skel-card { height: 96px; border-radius: var(--r-lg); }
.skel-line { display: inline-block; height: 13px; vertical-align: middle; }
.skel-title { height: 34px; width: 60%; border-radius: 10px; }

/* ---------- Full-screen states ---------- */

.state {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  min-height: 72vh; padding: 24px 16px; gap: 10px;
}
.state .badge-ico {
  width: 88px; height: 88px; border-radius: 26px; display: grid; place-items: center;
  background: var(--card); box-shadow: var(--shadow); color: var(--accent); margin-bottom: 12px;
  animation: floaty 4s ease-in-out infinite;
}
:root[data-theme="dark"] .state .badge-ico { background: var(--elev); }
.state .badge-ico .ico { width: 40px; height: 40px; }
.state h1 { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -.022em; }
.state p { margin: 0; color: var(--hint); max-width: 320px; font-size: 17px; line-height: 1.35; }
.state .actions { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 340px; margin-top: 20px; }
.state.ended .badge-ico { color: var(--live); }
.state .summary { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.empty {
  text-align: center; color: var(--hint); padding: 36px 24px; font-size: 15px; line-height: 1.4;
  background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow);
}
.empty .big { font-size: 34px; margin-bottom: 10px; }
.empty b { display: block; color: var(--text); font-size: 17px; font-weight: 600; margin-bottom: 4px; letter-spacing: -.02em; }

/* ---------- Live page ---------- */

.lh-elapsed { font-size: 17px; font-weight: 600; color: var(--live); letter-spacing: -.01em; }
.conn { color: var(--warn); font-weight: 600; }
.conn .ico { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.progress-card { display: flex; align-items: center; gap: 20px; padding: 20px; }
.ring-wrap { position: relative; width: 128px; height: 128px; flex: none; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring-track { fill: none; stroke: var(--fill); stroke-width: 10; }
.ring-fill {
  fill: none; stroke-width: 10; stroke-linecap: round;
  transition: stroke-dashoffset 1s var(--ease);
}
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-num { font-size: 32px; font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.ring-of { margin-top: 5px; font-size: 13px; color: var(--hint); }
.prog-side { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.prog-state { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 17px; letter-spacing: -.02em; margin-bottom: 8px; }
.prog-state .ico { width: 18px; height: 18px; }
.prog-state.done { color: var(--ok); }
.prog-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 8px 0; font-size: 15px; color: var(--hint); box-shadow: 0 -.5px 0 var(--sep); }
.prog-line b { color: var(--text); font-weight: 600; }
.prog-line span, .prog-line b { white-space: nowrap; }
.dots { display: inline-flex; gap: 3px; margin-left: 2px; }
.dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: dot 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .2; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.tile { padding: 16px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow); min-width: 0; }
.tile-label { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--sub); letter-spacing: -.01em; }
.tile-label .sw { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.tile-val { display: flex; align-items: center; gap: 6px; margin-top: 10px; height: 34px; font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.tile-val.hidden-val { font-size: 20px; font-weight: 600; color: var(--hint); letter-spacing: -.02em; }
.tile-val .ico { width: 20px; height: 20px; }
.tile-sub { margin-top: 4px; font-size: 13px; color: var(--hint); line-height: 1.3; }
.tile.t-verified { --c: var(--ok); }
.tile.t-connecting { --c: var(--warn); }
.tile.t-failed { --c: var(--danger); }
.tile.t-others { --c: var(--info); }
.tile.t-connecting.active .sw { animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
.bump { animation: bump .5s var(--ease); }
@keyframes bump { 35% { transform: scale(1.06); } }

/* ---------- Grouped form rows (hand raise) ---------- */

.form { padding: 0; overflow: hidden; }
.f-row { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 16px; cursor: pointer; }
.f-sep { height: .5px; background: var(--sep); margin-left: 16px; }
.f-block { padding: 16px 16px 18px; }
.f-label { font-size: 17px; font-weight: 500; letter-spacing: -.02em; }
.f-hint { font-size: 13px; color: var(--hint); margin-top: 1px; }
.hand-emoji {
  width: 36px; height: 36px; border-radius: 10px; flex: none; display: grid; place-items: center;
  font-size: 20px; background: color-mix(in srgb, var(--warn) 16%, transparent);
}
.hand-card.is-on .hand-emoji span { display: inline-block; animation: wave 3s ease-in-out infinite; transform-origin: 70% 80%; }
@keyframes wave { 0%, 55%, 100% { transform: rotate(0); } 8%, 24% { transform: rotate(14deg); } 16%, 32% { transform: rotate(-8deg); } }
.hand-titles { flex: 1; min-width: 0; }
.hand-titles .t { font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.hand-status { font-size: 13px; color: var(--hint); margin-top: 1px; transition: color .3s ease; }
.hand-status.s-active { color: var(--ok); }
.hand-status.s-warn { color: var(--warn); }

.switch { position: relative; display: inline-flex; align-items: center; width: 51px; height: 44px; flex: none; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch .track {
  position: relative; width: 51px; height: 31px; border-radius: 16px; background: var(--fill);
  transition: background .3s ease;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 3px 1px rgba(0, 0, 0, .06);
  transition: transform .45s var(--ease);
}
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

.collapse { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .45s var(--ease), opacity .3s ease; }
.collapse > div { overflow: hidden; min-height: 0; }
.collapse.closed { grid-template-rows: 0fr; opacity: 0; }

.pct-head { display: flex; align-items: center; gap: 12px; }
.pct-head .grow { flex: 1; min-width: 0; }
.pct-val { font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.pct-val span { font-size: 17px; font-weight: 600; color: var(--hint); margin-left: 1px; }
.stepper { display: inline-flex; align-items: center; height: 34px; border-radius: 9px; background: var(--fill-2); flex: none; }
.stepper button { position: relative; width: 46px; height: 34px; display: grid; place-items: center; color: var(--text); transition: opacity .15s ease; }
.stepper button::before { content: ""; position: absolute; inset: -5px 0; }
.stepper button:active { opacity: .35; }
.stepper button:disabled { opacity: .25; }
.stepper i { width: .5px; height: 18px; background: var(--sep); }
.stepper .ico { width: 18px; height: 18px; }

.slider {
  --p: 50%;
  -webkit-appearance: none; appearance: none; display: block;
  width: 100%; height: 44px; margin: 10px 0 0; background: transparent; cursor: pointer;
}
.slider::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--accent) var(--p), var(--fill) var(--p));
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 28px; height: 28px; margin-top: -12px; border-radius: 50%;
  background: #fff; box-shadow: 0 .5px 4px rgba(0, 0, 0, .12), 0 6px 13px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04);
  transition: transform .3s var(--ease);
}
.slider:active::-webkit-slider-thumb { transform: scale(1.1); }
.slider::-moz-range-track { height: 4px; border-radius: 2px; background: var(--fill); }
.slider::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
.slider::-moz-range-thumb { width: 28px; height: 28px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 .5px 4px rgba(0, 0, 0, .12), 0 6px 13px rgba(0, 0, 0, .12); }
.ticks { display: flex; justify-content: space-between; margin-top: -4px; padding: 0 2px; font-size: 12px; color: var(--hint); }

.hand-preview { padding: 14px 16px; font-size: 15px; color: var(--hint); text-align: center; }
.hand-preview b { color: var(--text); font-weight: 600; }
.hand-counts { display: grid; grid-template-columns: repeat(3, 1fr); box-shadow: 0 -.5px 0 var(--sep); }
.hand-counts div { position: relative; padding: 14px 8px 16px; text-align: center; min-width: 0; }
.hand-counts div + div::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: .5px; background: var(--sep); }
.hand-counts b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.hand-counts span { display: block; margin-top: 2px; font-size: 12px; color: var(--hint); line-height: 1.25; }
.saving-note { position: absolute; right: 16px; bottom: 6px; font-size: 12px; color: var(--hint); pointer-events: none; }
.saving-note:empty { display: none; }

/* ---------- Segmented control ---------- */

.seg {
  position: relative; display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr));
  padding: 2px; border-radius: 10px; background: var(--fill-2); height: 36px;
  --i: 0;
}
.seg-thumb {
  position: absolute; top: 2px; bottom: 2px; left: 2px; width: calc((100% - 4px) / var(--n, 4));
  border-radius: 8px; background: var(--seg-thumb);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04), 0 0 0 .5px rgba(0, 0, 0, .04);
  transform: translateX(calc(var(--i) * 100%));
  transition: transform .5s var(--ease), opacity .2s ease;
}
.seg.no-anim .seg-thumb { transition: none; }
.seg.no-sel .seg-thumb { opacity: 0; }
.seg-btn {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 0; font-size: 13px; font-weight: 500; letter-spacing: -.01em; color: var(--text); white-space: nowrap;
  transition: opacity .2s ease;
}
.seg-btn::after { content: ""; position: absolute; inset: -4px 0; }
.seg-btn.on { font-weight: 600; }
.seg-btn:active:not(.on) { opacity: .5; }
.seg-btn + .seg-btn::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: .5px; background: var(--sep);
  transition: opacity .2s ease;
}
.seg-btn.on::before, .seg-btn.on + .seg-btn::before { opacity: 0; }
.seg-l { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.seg-n { font-size: 11px; font-weight: 500; color: var(--hint); line-height: 1.1; }
.seg.tall { height: 46px; border-radius: 12px; }
.seg.tall .seg-thumb { border-radius: 10px; }
.seg.tall .seg-btn::before { top: 12px; bottom: 12px; }
.f-block .seg { margin-top: 14px; }

/* ---------- Accounts list ---------- */

.acc-tools {
  position: sticky; top: calc(var(--bar-top) + var(--bar-h)); z-index: 10;
  margin: 0 calc(-1 * var(--gutter)) 4px; padding: 6px var(--gutter) 10px;
}
.acc-tools::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--bar-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 .5px 0 var(--sep);
  opacity: 0; transition: opacity .25s ease;
}
.acc-tools.stuck::before { opacity: 1; }
.search { position: relative; display: flex; align-items: center; margin-bottom: 10px; }
.search > .ico { position: absolute; left: 10px; width: 17px; height: 17px; color: var(--hint); pointer-events: none; }
.search input {
  width: 100%; height: 40px; padding: 0 40px 0 34px; border-radius: 11px; border: 0;
  background: var(--fill); font-size: 17px; letter-spacing: -.02em; outline: none;
  -webkit-appearance: none; appearance: none;
}
.search input::placeholder { color: var(--hint); }
.search input:focus-visible { outline: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 50%, transparent); }
.search .clear { position: absolute; right: 0; width: 44px; height: 44px; display: grid; place-items: center; color: var(--hint); }
.search .clear .ico { width: 16px; height: 16px; }
.search input::-webkit-search-cancel-button { display: none; }

.acc-list { position: relative; }
.acc {
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 62px; padding: 9px 12px 9px 16px;
  cursor: pointer; content-visibility: auto; contain-intrinsic-size: auto 62px;
  transition: background .2s ease;
}
.acc + .acc::before { content: ""; position: absolute; top: 0; left: 68px; right: 0; height: .5px; background: var(--sep); }
.acc:active { background: var(--press); transition-duration: 0s; }
.sdot { position: relative; width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--muted); }
.st-verified .sdot { background: var(--ok); }
.st-connecting .sdot { background: var(--warn); }
.st-connecting .sdot::after, .st-retrying .sdot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid var(--warn);
  animation: ring 1.5s var(--ease-out) infinite;
}
.st-retrying .sdot { background: var(--warn); }
.st-failed .sdot { background: var(--danger); }
.st-left .sdot { background: var(--muted); opacity: .55; }
.acc-main { flex: 1; min-width: 0; }
.acc-label { display: flex; align-items: center; gap: 7px; font-size: 17px; font-weight: 500; letter-spacing: -.02em; }
.acc-label .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-sub { margin-top: 1px; font-size: 13px; color: var(--hint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-sub .lowered { color: var(--warn); }
.hbadge {
  display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px; border-radius: 10px; flex: none;
  font-size: 12px; font-weight: 600; letter-spacing: 0;
  background: color-mix(in srgb, var(--warn) 16%, transparent); color: color-mix(in srgb, var(--warn) 70%, var(--text));
  animation: pop .45s var(--ease);
}
.hbadge.manual { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--link); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.hand-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-width: 74px; height: 32px; padding: 0 14px; border-radius: 16px; flex: none;
  font-size: 15px; font-weight: 600; letter-spacing: -.01em; color: var(--link); background: var(--fill-2);
  transition: transform .3s var(--ease), opacity .2s ease;
}
.hand-btn::before { content: ""; position: absolute; inset: -6px -4px; }
.hand-btn:active { transform: scale(.94); transition-duration: .1s; }
.hand-btn.lower { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.hand-btn:disabled { opacity: .3; }
.hand-btn.busy { color: transparent; }
.hand-btn.busy::after {
  content: ""; position: absolute; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--hint); border-top-color: transparent; animation: spin .7s linear infinite;
}
.list-foot { padding: 12px 0 0; }
.list-empty { padding: 36px 16px; text-align: center; color: var(--hint); font-size: 15px; }

/* ---------- Project page ---------- */

.ph-row { display: flex; align-items: center; gap: 14px; }
.ph-row .ch-avatar { width: 60px; height: 60px; border-radius: 16px; font-size: 26px; }
.ph-row .lh-text { min-width: 0; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); padding: 0; }
.kpis > div { position: relative; padding: 16px 14px; min-width: 0; }
.kpis > div + div::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: .5px; background: var(--sep); }
.kpis b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.025em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpis span { display: block; margin-top: 2px; font-size: 13px; color: var(--hint); }

.live-banner {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  min-height: 60px; margin-top: 12px; padding: 10px 16px; border-radius: var(--r-lg);
  background: linear-gradient(120deg, var(--live), var(--live-2)); color: #fff; font-weight: 600; font-size: 17px; letter-spacing: -.02em;
  box-shadow: 0 10px 26px -10px color-mix(in srgb, var(--live) 70%, transparent);
}
.live-banner::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .22), transparent 70%);
  transform: translateX(-100%); animation: sheen 2.8s ease-in-out infinite;
}
.live-banner .grow { flex: 1; }
.live-banner .small { display: block; font-weight: 500; font-size: 13px; opacity: .88; letter-spacing: -.005em; }
.live-banner .dotw { position: relative; width: 10px; height: 10px; border-radius: 50%; background: #fff; flex: none; }
.live-banner .dotw::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1.5px solid #fff; animation: ring 1.8s var(--ease-out) infinite; }
.live-banner .ico { width: 18px; height: 18px; }

.run { display: block; width: 100%; text-align: left; padding: 16px 18px 14px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow); }
.run.is-live { box-shadow: var(--shadow), inset 0 0 0 1.5px color-mix(in srgb, var(--live) 45%, transparent); }
.run-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.run-date { font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.run-dur { margin-top: 1px; font-size: 13px; color: var(--hint); }
.run .bar { margin: 14px 0 12px; height: 4px; }
.run-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 10px; }
.run-grid div { min-width: 0; }
.run-grid b { display: block; font-size: 17px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-grid span { display: block; font-size: 12px; color: var(--hint); }
.run-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 12px; box-shadow: 0 -.5px 0 var(--sep); font-size: 15px; color: var(--link); font-weight: 600; }
.run-foot .ico { width: 16px; height: 16px; }

/* ---------- Bottom sheet ---------- */

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .38);
  opacity: 0; transition: opacity .4s var(--ease);
}
.sheet-backdrop.open { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  max-width: 600px; margin: 0 auto; max-height: 88vh; overflow-y: auto; overscroll-behavior: contain;
  padding: 8px calc(16px + var(--safe-right)) calc(20px + var(--safe-bottom)) calc(16px + var(--safe-left));
  background: var(--sheet-bg); border-radius: 14px 14px 0 0; box-shadow: var(--shadow-float);
  transform: translate3d(0, 105%, 0); transition: transform .5s var(--ease);
  touch-action: pan-y; will-change: transform;
}
.sheet.open { transform: translate3d(0, 0, 0); }
.sheet.dragging { transition: none; }
.sheet-grip { width: 36px; height: 5px; border-radius: 3px; background: var(--fill); margin: 0 auto 14px; }
.sheet h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.022em; }
.sh-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 4px; }
.sh-close {
  width: 44px; height: 44px; margin: -8px -10px -8px 0; display: grid; place-items: center; color: var(--hint); border-radius: 50%;
}
.sh-close span.ico { width: 30px; height: 30px; padding: 7px; border-radius: 50%; background: var(--fill-2); }
.sh-rows { margin: 18px 0 16px; border-radius: var(--r); background: var(--sheet-row); overflow: hidden; }
.sh-row { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; padding: 12px 16px; font-size: 17px; letter-spacing: -.02em; }
.sh-row + .sh-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--sep); }
.sh-row span:first-child { color: var(--text); }
.sh-row span:last-child { color: var(--hint); text-align: right; overflow-wrap: anywhere; }
.sh-note { display: flex; gap: 8px; margin: 12px 8px 0; font-size: 13px; line-height: 1.38; color: var(--hint); }
.sh-note .ico { width: 15px; height: 15px; margin-top: 1px; }
.sh-actions { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Toasts ---------- */

#toasts {
  position: fixed; left: 0; right: 0; bottom: calc(20px + var(--safe-bottom)); z-index: 60;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px;
}
.toast {
  display: flex; align-items: center; gap: 10px; max-width: 520px;
  padding: 13px 18px; border-radius: 16px; font-size: 15px; font-weight: 500; letter-spacing: -.01em;
  background: color-mix(in srgb, #1c1c1e 88%, transparent); color: #fff;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .22);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  animation: toastIn .5s var(--ease) both; pointer-events: auto;
}
:root[data-theme="dark"] .toast { background: color-mix(in srgb, #3a3a3c 88%, transparent); }
.toast .ico { width: 18px; height: 18px; }
.toast.error .ico { color: #ff6961; }
.toast.ok .ico { color: #32d74b; }
.toast.out { animation: toastOut .3s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translate3d(0, 18px, 0) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translate3d(0, 10px, 0) scale(.98); } }

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* =====================================================================
   Colour & artwork layer: vivid gradient families, icon badges,
   illustrated hero, live header wash, audience card, avatars.
   Everything animates transform/opacity only.
   ===================================================================== */

:root {
  --g-live: linear-gradient(135deg, #ff375f, #bf5af2);
  --g-obs: linear-gradient(135deg, #2dd4bf, #3b82f6);
  --g-hand: linear-gradient(135deg, #fbbf24, #f97316);
  --g-ok: linear-gradient(135deg, #4ade80, #10b981);
  --g-fail: linear-gradient(135deg, #fb7185, #e11d48);
  --g-violet: linear-gradient(135deg, #a78bfa, #6366f1);
  --g-info: linear-gradient(135deg, #60a5fa, #6366f1);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  --wash-a: rgba(167, 139, 250, .24);
  --wash-b: rgba(244, 114, 182, .16);
  --wash-c: rgba(45, 212, 191, .12);
  --au-num: linear-gradient(135deg, #6d28d9, #db2777);
}
:root[data-theme="dark"] {
  --fb-page: #070b14;
  --fb-card: #121827;
  --wash-a: rgba(139, 92, 246, .26);
  --wash-b: rgba(236, 72, 153, .16);
  --wash-c: rgba(20, 184, 166, .12);
  --au-num: linear-gradient(135deg, #c4b5fd, #f9a8d4);
}

/* Airy pastel wash (light) / soft glow (dark) behind the top of every page */
body::before {
  content: ""; position: fixed; left: 0; right: 0; top: 0; height: 75vh; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 45% at 12% 0%, var(--wash-a), transparent 70%),
    radial-gradient(55% 40% at 92% 4%, var(--wash-b), transparent 70%),
    radial-gradient(70% 45% at 50% 34%, var(--wash-c), transparent 72%);
}

/* Spring press */
.press { transition: transform .55s cubic-bezier(.34, 1.56, .64, 1), opacity .2s ease; }
.press:active { transform: scale(.97); transition: transform .12s ease; }

/* Icon badges (iOS Settings style) */
.ibadge {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  display: inline-grid; place-items: center; color: #fff;
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .28), 0 3px 8px -3px rgba(0, 0, 0, .3);
}
.ibadge .ico { width: 16px; height: 16px; }
.ibadge .ico svg { stroke-width: 2.4; }
.ib-emoji { font-size: 15px; line-height: 1; }
.g-live { background: var(--g-live); }
.g-obs { background: var(--g-obs); }
.g-hand { background: var(--g-hand); }
.g-ok { background: var(--g-ok); }
.g-fail { background: var(--g-fail); }
.g-violet { background: var(--g-violet); }
.g-info { background: var(--g-info); }
.sec-head .sh-t { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.tile-label .ibadge { width: 26px; height: 26px; border-radius: 8px; }
.tile-label .ibadge .ico { width: 14px; height: 14px; }

/* LIVE badge: rose to violet with a soft breathing halo */
.live-badge { background: var(--g-live); isolation: isolate; box-shadow: 0 6px 18px -6px rgba(255, 55, 95, .7); }
.live-badge::before {
  content: ""; position: absolute; inset: -5px; z-index: -1; border-radius: inherit;
  background: var(--g-live); filter: blur(10px); opacity: .45;
  animation: halo 2.6s ease-in-out infinite;
}
@keyframes halo { 0%, 100% { opacity: .25; transform: scale(.92); } 50% { opacity: .7; transform: scale(1.08); } }
.bar.live .fill { background: var(--g-live); }
.bar .fill { background: var(--g-obs); }
.eq i { background: linear-gradient(#ff375f, #bf5af2); }

/* Live cards: gradient hairline border */
.live-card {
  border: 1.5px solid transparent;
  background: linear-gradient(var(--card), var(--card)) padding-box,
    linear-gradient(135deg, rgba(255, 55, 95, .55), rgba(191, 90, 242, .5), rgba(59, 130, 246, .35)) border-box;
}
.live-card::before { background: radial-gradient(closest-side, rgba(191, 90, 242, .16), transparent); }

/* Decorative wash behind the Live / Project large titles */
.live-head { position: relative; isolation: isolate; }
.live-wash {
  position: absolute; z-index: -1; pointer-events: none; overflow: hidden;
  left: calc(-1 * var(--gutter) - 4px); right: calc(-1 * var(--gutter) - 4px);
  top: -140px; bottom: -40px;
  -webkit-mask-image: linear-gradient(#000 62%, transparent); mask-image: linear-gradient(#000 62%, transparent);
}
.live-wash i { position: absolute; border-radius: 50%; filter: blur(40px); will-change: transform; }
.live-wash .b1 { width: 240px; height: 240px; left: -60px; top: 60px; background: #ff375f; opacity: .26; animation: drift1 12s ease-in-out infinite alternate; }
.live-wash .b2 { width: 260px; height: 260px; right: -80px; top: 30px; background: #bf5af2; opacity: .26; animation: drift2 14s ease-in-out infinite alternate; }
.live-wash .b3 { width: 200px; height: 200px; left: 35%; top: 150px; background: #3b82f6; opacity: .16; animation: drift3 10s ease-in-out infinite alternate; }
.live-wash.calm .b1 { background: #2dd4bf; opacity: .2; }
.live-wash.calm .b2 { background: #6366f1; opacity: .2; }
.live-wash.calm .b3 { background: #ec4899; opacity: .1; }
:root[data-theme="dark"] .live-wash i { opacity: .3; }
:root[data-theme="dark"] .live-wash.calm i { opacity: .22; }

/* Live audience card */
.audience {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 18px 18px 16px; border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--card) 86%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px);
  box-shadow: var(--shadow), inset 0 0 0 .5px color-mix(in srgb, var(--sep) 80%, transparent);
}
.au-glow {
  position: absolute; z-index: -1; pointer-events: none; right: -70px; top: -90px; width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(236, 72, 153, .22), rgba(139, 92, 246, .12) 55%, transparent);
  animation: breathe 5s ease-in-out infinite alternate;
}
.au-top { display: flex; align-items: center; gap: 10px; }
.au-top .grow { flex: 1; }
.au-kicker { font-size: 15px; font-weight: 600; color: var(--sub); letter-spacing: -.01em; }
.au-pulse { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--live); }
.au-pulse i { position: relative; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.au-pulse i::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid currentColor; animation: ring 1.8s var(--ease-out) infinite; }
.au-num { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; margin-top: 12px; }
.au-num b {
  font-size: 54px; font-weight: 800; letter-spacing: -.05em; line-height: 1;
  background: var(--au-num); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.au-num span { font-size: 17px; font-weight: 600; color: var(--hint); letter-spacing: -.02em; }
.au-measuring { display: flex; align-items: center; gap: 12px; margin-top: 12px; height: 54px; color: var(--hint); font-size: 15px; font-weight: 500; }
.au-measuring .skel { border-radius: 12px; }
.au-bar { position: relative; height: 8px; margin-top: 16px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.au-bar i { position: absolute; top: 0; bottom: 0; width: 100%; transition: transform 1s var(--ease); transform: scaleX(0); }
.au-bar .bot { left: 0; transform-origin: left; background: var(--g-obs); }
.au-bar .oth { right: 0; transform-origin: right; background: linear-gradient(90deg, #f472b6, #a855f7); }
.au-bar.unknown .bot { opacity: .45; }
.au-split { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 15px; color: var(--hint); }
.au-split b { color: var(--text); font-weight: 700; margin-right: 1px; }
.au-split .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
.au-split .sw.bot { background: var(--g-obs); }
.au-split .sw.oth { background: linear-gradient(135deg, #f472b6, #a855f7); }

/* Ring gradient + glow */
.ring-glow { fill: none; stroke-width: 10; stroke-linecap: round; opacity: .35; filter: blur(5px); transition: stroke-dashoffset 1s var(--ease); }
.working .ring-glow { animation: ringGlow 1.8s ease-in-out infinite; }
@keyframes ringGlow { 0%, 100% { opacity: .15; } 50% { opacity: .55; } }

/* Tiles: coloured corner glow */
.tile { position: relative; overflow: hidden; isolation: isolate; }
.tile::after {
  content: ""; position: absolute; z-index: -1; right: -36px; top: -36px; width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--c) 24%, transparent), transparent);
  pointer-events: none;
}
.tile.t-others { --c: #a855f7; }
.tile.t-connecting.active .ibadge { animation: blink 1.2s ease-in-out infinite; }

/* Hand raise accents */
.hand-emoji { background: var(--g-hand); box-shadow: 0 4px 12px -4px rgba(249, 115, 22, .6); }
.slider::-webkit-slider-runnable-track { background: linear-gradient(to right, #fbbf24, #f97316 var(--p), var(--fill) var(--p)); }
.slider::-moz-range-progress { background: linear-gradient(90deg, #fbbf24, #f97316); }

/* Illustrations */
.art { width: 160px; height: 120px; margin: 0 auto 10px; color: var(--text); }
.art svg { width: 100%; height: 100%; overflow: visible; }
.art .art-wave { animation: blink 2.4s ease-in-out infinite; }
.art .w2 { animation-delay: .7s; }
.state .art { width: 210px; height: 158px; margin-bottom: 8px; animation: floaty 5s ease-in-out infinite; }
.empty { position: relative; overflow: hidden; isolation: isolate; }
.empty::before {
  content: ""; position: absolute; inset: -40% -20% auto; height: 120%; z-index: -1;
  background: radial-gradient(closest-side, var(--wash-a), transparent); pointer-events: none;
}

/* Account avatars */
.acc-av { position: relative; display: inline-block; width: 38px; height: 38px; flex: none; }
.av {
  display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  color: #fff; font-weight: 600;
  background: linear-gradient(135deg, hsl(var(--h, 210) 78% 64%), hsl(calc(var(--h, 210) + 48) 70% 48%));
}
.av.photo { background: var(--fill-2); }
.av img { display: block; width: 100%; height: 100%; object-fit: cover; }
.av-ini { font-size: 14px; letter-spacing: -.02em; line-height: 1; }
.av-ini.long { font-size: 11px; font-variant-numeric: tabular-nums; }
.acc-av .sdot { position: absolute; right: -2px; bottom: -2px; width: 13px; height: 13px; box-shadow: 0 0 0 2.5px var(--card); }
.acc-av.lg { display: block; width: 64px; height: 64px; margin: 0 auto; }
.acc-av.lg .av-ini { font-size: 24px; }
.acc-av.lg .av-ini.long { font-size: 18px; }
.acc-av.lg .sdot { width: 16px; height: 16px; right: 0; bottom: 0; box-shadow: 0 0 0 3px var(--sheet-bg); }
.acc-label .name { min-width: 0; }

/* Sheet profile header */
.sh-profile { text-align: center; margin-top: -26px; }
.sh-profile h2 { margin-top: 12px; padding: 0 24px; font-size: 22px; line-height: 1.2; overflow-wrap: anywhere; }
.sh-sub { margin-top: 3px; font-size: 15px; color: var(--hint); overflow-wrap: anywhere; }

/* Live banner on project page uses the live gradient family */
.live-banner { background: var(--g-live); }

@media (prefers-reduced-motion: reduce) {
  .live-wash i, .au-glow { animation: none !important; }
}
.pct-head .f-hint { overflow: hidden; text-overflow: ellipsis; }
.acc.plain .acc-av { width: 10px; height: 10px; margin: 0 4px; }
.acc.plain .acc-av .sdot { position: relative; right: auto; bottom: auto; display: block; width: 10px; height: 10px; box-shadow: none; }
.acc + .acc.plain::before { left: 44px; }

/* =====================================================================
   Tabs layer: bottom tab bar, tab pages (Home, Live, Projects, Plan,
   Profile, Owner), grouped rows, paged day-grouped history.
   ===================================================================== */

:root { --tab-h: 50px; }

/* Bottom tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
  padding: 0 var(--safe-right) var(--safe-bottom) var(--safe-left);
  transition: transform .45s var(--ease), opacity .3s ease;
}
.tabbar::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--bar-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 -.5px 0 var(--sep);
}
.tabbar.away { transform: translate3d(0, 110%, 0); opacity: 0; pointer-events: none; }
.tb-inner { display: flex; max-width: 600px; margin: 0 auto; height: var(--tab-h); }
.tb-btn {
  position: relative; flex: 1 1 0; min-width: 0; min-height: 44px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--hint); transition: color .2s ease;
}
.tb-btn:active .tb-ico { transform: scale(.88); }
.tb-ico { position: relative; display: inline-flex; transition: transform .45s cubic-bezier(.34, 1.56, .64, 1); }
.tb-ico .ico { width: 25px; height: 25px; }
.tb-ico .ico svg { stroke-width: 1.8; }
.tb-btn.on { color: var(--accent); }
.tb-btn.on .tb-ico { animation: tabPop .45s cubic-bezier(.34, 1.56, .64, 1); }
.tb-btn.on .tb-ico .ico svg { stroke-width: 2.2; }
@keyframes tabPop { 40% { transform: scale(1.14); } }
.tb-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; font-weight: 500; letter-spacing: 0; }
.tb-btn.on .tb-label { font-weight: 600; }
.tb-badge {
  position: absolute; top: -3px; right: -9px; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px;
  font-size: 11px; font-weight: 700; line-height: 17px; text-align: center; color: #fff;
  background: var(--g-live); box-shadow: 0 0 0 2px var(--page);
}

body.tabs-on .view { padding-bottom: calc(var(--tab-h) + var(--safe-bottom) + 32px); }
body.tabs-on #toasts { bottom: calc(var(--tab-h) + var(--safe-bottom) + 14px); }

/* Quick crossfade between tabs */
.v-in-xfade { animation: inXfade .22s ease-out both; }
.v-out-xfade { animation: outXfade .18s ease-in both; }
@keyframes inXfade { from { opacity: 0; } to { opacity: 1; } }
@keyframes outXfade { to { opacity: 0; } }

/* Root-tab header extras */
.lh-right { flex: none; display: flex; align-items: flex-end; }
.lh-right:empty { display: none; }

/* Dashboard tiles */
.dash-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dash-tile {
  position: relative; overflow: hidden; isolation: isolate; text-align: left; min-width: 0;
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; min-height: 116px;
  border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow);
}
.dash-tile::after {
  content: ""; position: absolute; z-index: -1; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--c, #8b5cf6) 22%, transparent), transparent); pointer-events: none;
}
.dash-tile.t-info { --c: #6366f1; }
.dash-tile.t-live { --c: #ff375f; }
.dash-tile.t-obs { --c: #3b82f6; }
.dash-tile.t-ok { --c: #10b981; }
.dash-tile.t-violet { --c: #8b5cf6; }
.dt-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.dt-top .ibadge { width: 26px; height: 26px; }
.dt-top .ibadge .ico { width: 14px; height: 14px; }
.dt-label { font-size: 15px; font-weight: 600; color: var(--sub); letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-val { font-size: 28px; font-weight: 750; letter-spacing: -.03em; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt-sub { font-size: 13px; color: var(--hint); }
.dt-bar { position: relative; display: block; height: 5px; margin: 4px 0 2px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.dt-bar i { position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); background: var(--g-obs); border-radius: inherit; transition: transform 1s var(--ease); }

/* Plan alert banner */
.plan-alert {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; margin-bottom: 32px;
  padding: 14px 14px 14px 16px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow);
}
.plan-alert.tone-warn { background: color-mix(in srgb, var(--warn) 12%, var(--card)); box-shadow: var(--shadow), inset 0 0 0 1px color-mix(in srgb, var(--warn) 35%, transparent); }
.plan-alert.tone-danger { background: color-mix(in srgb, var(--danger) 11%, var(--card)); box-shadow: var(--shadow), inset 0 0 0 1px color-mix(in srgb, var(--danger) 35%, transparent); }
.pa-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pa-main b { font-size: 17px; font-weight: 600; letter-spacing: -.02em; color: var(--text); }
.pa-main span { font-size: 13px; color: var(--sub); line-height: 1.35; }

/* Grouped list rows */
.list-row {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  min-height: 52px; padding: 10px 14px 10px 16px; font-size: 17px; letter-spacing: -.02em;
}
.list-row + .list-row::before { content: ""; position: absolute; top: 0; left: 58px; right: 0; height: .5px; background: var(--sep); }
.list-row.tap { transition: background .2s ease; }
.list-row.tap:active { background: var(--press); transition-duration: 0s; }
.lr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lr-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-sub { font-size: 13px; color: var(--hint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-value { flex: none; max-width: 55%; color: var(--hint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-btn { position: relative; width: 36px; height: 36px; margin: -6px -6px -6px 0; display: grid; place-items: center; border-radius: 50%; color: var(--link); background: var(--fill-2); flex: none; }
.copy-btn::before { content: ""; position: absolute; inset: -4px; }
.copy-btn .ico { width: 17px; height: 17px; }
.copy-btn:active { transform: scale(.9); }
.sec-foot.center { text-align: center; }

/* Plan card */
.plan-card {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 18px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--card) 88%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px);
  box-shadow: var(--shadow), inset 0 0 0 .5px color-mix(in srgb, var(--sep) 80%, transparent);
}
.pc-glow {
  position: absolute; z-index: -1; left: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(99, 102, 241, .2), rgba(45, 212, 191, .1) 55%, transparent);
  animation: breathe 6s ease-in-out infinite alternate;
}
.pc-top { display: flex; align-items: center; gap: 10px; }
.pc-top .grow { flex: 1; }
.pc-kicker { font-size: 15px; font-weight: 600; color: var(--sub); }
.pc-main { display: flex; align-items: center; gap: 18px; margin-top: 16px; }
.pc-main .ring-wrap { width: 124px; height: 124px; }
.pc-side { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pc-stat { display: flex; flex-direction: column; padding: 8px 0; box-shadow: 0 -.5px 0 var(--sep); }
.pc-stat:first-child { box-shadow: none; padding-top: 0; }
.pc-stat span { font-size: 13px; color: var(--hint); }
.pc-stat b { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.pc-pbar { position: relative; height: 5px; margin-top: 4px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.pc-pbar i { position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); background: var(--g-violet); border-radius: inherit; transition: transform 1s var(--ease); }
.pc-exp {
  display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--fill-2); color: var(--sub);
}
.pc-exp > .ico { width: 20px; height: 20px; color: var(--accent); }
.pc-exp.bad > .ico { color: var(--danger); }
.pe-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pe-label { font-size: 13px; color: var(--hint); }
.pe-main b { font-size: 16px; font-weight: 600; color: var(--text); letter-spacing: -.02em; overflow-wrap: anywhere; }
.plan-msg { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.plan-msg .art { width: 84px; height: 64px; margin: 0; flex: none; }
.plan-msg b { display: block; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.plan-msg p { margin: 2px 0 0; font-size: 14px; line-height: 1.38; color: var(--sub); }

/* Profile */
.profile-card {
  position: relative; overflow: hidden; isolation: isolate; text-align: center;
  padding: 26px 18px 20px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow);
}
.pf-glow {
  position: absolute; z-index: -1; left: 50%; top: -120px; width: 340px; height: 260px; margin-left: -170px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(191, 90, 242, .22), rgba(59, 130, 246, .12) 60%, transparent);
}
.pf-avatar {
  width: 88px; height: 88px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center;
  font-size: 36px; font-weight: 600; color: #fff; letter-spacing: -.02em;
  background: linear-gradient(135deg, hsl(var(--h, 260) 78% 64%), hsl(calc(var(--h, 260) + 48) 70% 48%));
  box-shadow: 0 10px 28px -10px hsl(var(--h, 260) 70% 45% / .7), inset 0 0 0 .5px rgba(255, 255, 255, .3);
}
.pf-name { margin: 14px 0 0; font-size: 24px; font-weight: 700; letter-spacing: -.022em; overflow-wrap: anywhere; }
.pf-user { margin-top: 2px; font-size: 15px; color: var(--hint); }
.pf-role { margin-top: 10px; display: flex; justify-content: center; }
.pf-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pf-stat {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0;
  padding: 14px; border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow);
}
.pf-stat b { font-size: 24px; font-weight: 750; letter-spacing: -.03em; line-height: 1; margin-top: 4px; }
.pf-stat span { font-size: 12px; color: var(--hint); }
.pf-stat .ibadge { width: 26px; height: 26px; }
.pf-stat .ibadge .ico { width: 14px; height: 14px; }

/* Stream history: summary, sticky day headers, run cards */
.hist-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: -2px 4px 16px; }
.hist-days { display: flex; flex-direction: column; gap: 20px; }
.day { position: relative; }
.day-head {
  position: sticky; top: calc(var(--bar-top) + var(--bar-h)); z-index: 4;
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin: 0 calc(-1 * var(--gutter)) 8px; padding: 8px calc(var(--gutter) + 4px);
  background: var(--bar-bg); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
}
.dh-label { font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.dh-count { font-size: 13px; color: var(--hint); }
.hist-sentinel { height: 1px; }
.section .btn.tinted { margin-top: 14px; }

.schip {
  display: inline-flex; align-items: baseline; gap: 3px; padding: 5px 10px; border-radius: 10px;
  font-size: 13px; color: var(--sub); background: var(--fill-2); white-space: nowrap;
}
.schip b { font-weight: 700; color: var(--c, var(--text)); }
.schip.c-obs { --c: #2563eb; background: rgba(59, 130, 246, .1); }
.schip.c-ok { --c: #059669; background: rgba(16, 185, 129, .11); }
.schip.c-hand { --c: #c2410c; background: rgba(249, 115, 22, .11); }
.schip.c-fail { --c: #e11d48; background: rgba(244, 63, 94, .1); }
.schip.c-info { --c: #4f46e5; background: rgba(99, 102, 241, .1); }
.schip.c-live { --c: #db2777; background: rgba(236, 72, 153, .1); }
:root[data-theme="dark"] .schip.c-obs { --c: #93c5fd; }
:root[data-theme="dark"] .schip.c-ok { --c: #6ee7b7; }
:root[data-theme="dark"] .schip.c-hand { --c: #fdba74; }
:root[data-theme="dark"] .schip.c-fail { --c: #fda4af; }
:root[data-theme="dark"] .schip.c-info { --c: #a5b4fc; }
:root[data-theme="dark"] .schip.c-live { --c: #f9a8d4; }

.run-date .run-arrow { color: var(--hint); font-weight: 500; }
.run-live { color: var(--live); }
.run-peak { margin: 14px 0 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--fill-2); }
.run-peak.none { padding: 10px 14px; }
.rp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.rp-label { font-size: 13px; font-weight: 600; color: var(--sub); }
.run-peak.none .rp-label { font-weight: 500; color: var(--hint); }
.rp-num { font-size: 26px; font-weight: 800; letter-spacing: -.04em; line-height: 1; background: var(--au-num); -webkit-background-clip: text; background-clip: text; color: transparent; }
.au-bar.sm { height: 6px; margin-top: 10px; }
.au-bar.sm i { transition: none; }
.au-split.sm { margin-top: 8px; font-size: 13px; }
.run-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.run .bar { display: none; }

/* Owner panel */
.owner-seg { margin-bottom: 14px; }
.owner-tools { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.owner-tools .search { margin-bottom: 0; }
.user-row {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  min-height: 68px; padding: 10px 10px 10px 16px; transition: background .2s ease;
}
.user-row:active { background: var(--press); transition-duration: 0s; }
.user-row + .user-row::before { content: ""; position: absolute; top: 0; left: 66px; right: 0; height: .5px; background: var(--sep); }
.user-row .av { width: 38px; height: 38px; flex: none; font-size: 15px; }
.ur-main { flex: 1; min-width: 0; }
.ur-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ur-title .name { font-size: 17px; font-weight: 600; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ur-title .pill { flex: none; height: 20px; font-size: 11.5px; padding: 0 7px; }
.ur-meta { margin-top: 2px; font-size: 13px; color: var(--hint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ur-meta.warn { color: var(--warn); }
.ur-meta.bad { color: var(--danger); }
.ur-side { flex: none; width: 76px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ur-side b { font-size: 14px; font-weight: 700; }
.ur-bar { position: relative; width: 100%; height: 4px; border-radius: 2px; background: var(--fill); overflow: hidden; }
.ur-bar i { position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); background: var(--g-obs); border-radius: inherit; }
.ur-cap { font-size: 11px; color: var(--hint); }

@media (max-width: 370px) {
  .dt-val { font-size: 24px; }
  .pc-main { gap: 12px; }
  .pc-main .ring-wrap { width: 108px; height: 108px; }
  .pf-stat { padding: 12px 10px; }
  .pf-stat b { font-size: 20px; }
}
.ur-st { background: none !important; font-weight: 600; }
.user-row { padding-right: 14px; }
.gap-24 { height: 24px; }
.plan-alert { margin-bottom: 24px; }

/* Project page: history entry row */
.hist-row { min-height: 64px; }
.hist-row .lr-title { font-weight: 600; }
.grow-1 { flex: 1; }
.gap-10 { height: 10px; }

/* History page */
.hist-range { margin-top: -8px; }
.hist-range .seg-btn { font-size: 12.5px; }
.hist-sum {
  position: relative; overflow: hidden; isolation: isolate; padding: 18px;
  border-radius: var(--r-lg); background: color-mix(in srgb, var(--card) 88%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px);
  box-shadow: var(--shadow), inset 0 0 0 .5px color-mix(in srgb, var(--sep) 80%, transparent);
  transition: opacity .25s ease;
}
.section.stale .hist-sum { opacity: .45; }
.hs-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hs-streams { font-size: 34px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.hs-streams-l { font-size: 17px; font-weight: 600; color: var(--sub); }
.hs-peak { margin-top: 14px; padding: 12px 14px; border-radius: var(--r-md); background: var(--fill-2); }
.hs-peak.none { padding: 12px 14px; }
.hs-peak-at { margin-top: 6px; font-size: 12px; color: var(--hint); }
.hs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 8px; margin-top: 14px; }
.hs-stat { display: flex; flex-direction: column; min-width: 0; }
.hs-stat b { font-size: 19px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-stat span { font-size: 12px; color: var(--hint); }
.rp-num.sm { font-size: 20px; }

/* Plan ring by usage: amber from 80%, red when full */
.plan-card.use-warn .ring-fill, .plan-card.use-warn .ring-glow { stroke: var(--warn); }
.plan-card.use-full .ring-fill, .plan-card.use-full .ring-glow { stroke: var(--danger); }
.plan-card.use-warn .ring-num { color: var(--warn); }
.plan-card.use-full .ring-num { color: var(--danger); }
.pc-pbar.use-warn i { background: var(--warn); }
.pc-pbar.use-full i { background: var(--danger); }

/* User page */
.pf-stats.two { grid-template-columns: repeat(2, 1fr); }
.id-chip {
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 14px;
  font-size: 13px; font-weight: 600; color: var(--link); background: var(--fill-2);
}
.id-chip::before { content: ""; position: absolute; inset: -8px -2px; }
.id-chip .ico { width: 14px; height: 14px; }
.id-chip:active { opacity: .5; }
.owner-chip.tap { cursor: pointer; }
.list-empty.card { padding: 28px 16px; }

/* Live page: Others in the call */
.oth-pane { display: flex; flex-direction: column; gap: 10px; }
.oth-head { margin: 0 4px; font-size: 13px; color: var(--sub); line-height: 1.4; }
.oth-skel { width: 70%; height: 13px; }
.oth-hidden, .oth-note {
  display: flex; align-items: flex-start; gap: 8px; padding: 10px 14px; border-radius: var(--r-md);
  font-size: 13px; line-height: 1.38; color: var(--sub); background: var(--fill-2);
}
.oth-hidden .ico, .oth-note .ico { width: 16px; height: 16px; margin-top: 1px; flex: none; }
.oth-note { color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.oth-tags { display: inline-flex; align-items: center; gap: 5px; flex: none; }
.oth-tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 10px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.oth-tag.bot { color: var(--info); background: color-mix(in srgb, var(--info) 14%, transparent); }
.oth-tag.ch { color: var(--sub); background: var(--fill); }
.oth-row .name.unnamed { color: var(--hint); font-style: italic; }
.oth-row { padding-right: 16px; }
.copy-btn.sm { width: 28px; height: 28px; margin: -6px -8px -6px 4px; vertical-align: middle; display: inline-grid; }
.copy-btn.sm .ico { width: 14px; height: 14px; }
