/* Signed-in app chrome: tab bar / sidebar, cards, feed, friends, activities.
   Ported from the Perunika — Run and Training — Webview design handoff. */

:root {
  --iris:#A06BFF; --irisDeep:#6A3FD6; --irisGlow:#D0B0FF; --bolt:#F0E8FF;
  --amber:#FFB547; --mint:#5DE0A6; --coral:#FF6B6B; --cobalt:#6B9BFF;
  --bg:#0B0A10; --bg2:#131220; --card:#1A1828; --card2:#22203A;
  --hair:rgba(255,255,255,0.08); --hairStrong:rgba(255,255,255,0.14);
  --text:#F4F1FA; --dim:rgba(244,241,250,0.64); --mute:rgba(244,241,250,0.42);
  --irisGrad:linear-gradient(135deg,#A06BFF 0%,#6A3FD6 100%);
  --safeB: env(safe-area-inset-bottom, 0px);
  --safeT: env(safe-area-inset-top, 0px);
  --tabH: 64px;
}

.mono-num { font-variant-numeric: tabular-nums; }
.muted { color: var(--dim); }
.app-fade-in { animation: app-fade .4s ease both; }
@keyframes app-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes app-pulse { 0%, 100% { opacity: .6; transform: scale(1); } 50% { opacity: 1; transform: scale(1.2); } }

/* ═════════ APP SHELL ═════════ */
.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.shell-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.top-bar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11,10,16,0.82); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--hair);
  padding: calc(var(--safeT) + 12px) 18px 12px;
  display: flex; align-items: center; gap: 10px;
}
.top-bar h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.5px; flex: 1; color: var(--text); }
.top-bar .sub { font-size: 11px; color: var(--dim); margin-top: 2px; display: none; }
.top-bar .top-action {
  width: 38px; height: 38px; border-radius: 12px; background: var(--card); border: 1px solid var(--hair);
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text);
}
.top-bar .top-action:active, .top-bar .top-action:hover { background: rgba(255,255,255,0.08); }
.top-bar .top-action.primary { background: var(--irisGrad); border: none; box-shadow: 0 6px 16px rgba(160,107,255,0.35); color: #fff; }

main.app-main {
  flex: 1;
  padding: 16px 18px calc(var(--tabH) + var(--safeB) + 24px);
  width: 100%; max-width: 780px; margin: 0 auto; color: var(--text);
}

/* Bottom tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: rgba(11,10,16,0.88); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  border-top: 1px solid var(--hair);
  padding: 8px 10px calc(var(--safeB) + 8px);
  display: flex; gap: 4px; justify-content: space-around;
}
.tab-btn {
  flex: 1; max-width: 92px; padding: 6px 4px; border-radius: 14px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--mute); font-size: 10px; font-weight: 600; position: relative; text-decoration: none;
}
.tab-btn .tab-ico { width: 32px; height: 26px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.tab-btn.active { color: var(--iris); }
.tab-btn.active .tab-ico { background: rgba(160,107,255,0.18); }
.tab-btn .badge {
  position: absolute; top: 2px; right: 50%; transform: translateX(20px);
  min-width: 16px; height: 16px; padding: 0 5px; border-radius: 8px;
  background: var(--coral); color: #fff; font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}

.avatar {
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0; color: #0B0A10;
}
.avatar.iris   { background: var(--iris);   color: #fff; }
.avatar.amber  { background: var(--amber); }
.avatar.mint   { background: var(--mint); }
.avatar.coral  { background: var(--coral); color: #fff; }
.avatar.cobalt { background: var(--cobalt); color: #fff; }
.avatar.grad   { background: linear-gradient(135deg, #A06BFF 0%, #FFB547 100%); color: #fff; }

/* Desktop shell: sidebar navigation on the left */
@media (min-width: 900px) {
  .shell { flex-direction: row; }
  .tabbar {
    position: sticky; top: 0; left: 0; height: 100vh; width: 240px;
    flex-direction: column; justify-content: flex-start;
    padding: 22px 14px;
    border-top: none; border-right: 1px solid var(--hair);
    background: var(--bg2); gap: 4px;
  }
  .tab-btn {
    max-width: none; flex: 0 0 auto; width: 100%;
    flex-direction: row; justify-content: flex-start; gap: 12px;
    padding: 10px 12px; font-size: 14px;
  }
  .tab-btn .tab-ico { width: 22px; height: 22px; border-radius: 0; background: transparent !important; }
  .tab-btn .tab-label { font-size: 14px; font-weight: 500; }
  .tab-btn.active { background: rgba(160,107,255,0.14); }
  .tab-btn .badge { position: static; transform: none; margin-left: auto; }
  main.app-main { padding: 28px 36px 40px; max-width: 1200px; }
  .top-bar { position: sticky; padding: 20px 36px; }
  .top-bar h1 { font-size: 30px; }
  .top-bar .sub { display: block; font-size: 13px; margin-top: 4px; }
}

.sidebar-brand {
  display: none;
  align-items: center; gap: 10px; padding: 4px 10px 20px;
  color: var(--text); text-decoration: none;
}
@media (min-width: 900px) { .sidebar-brand { display: flex; } }
.sidebar-brand .logo {
  width: 32px; height: 32px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; background: var(--irisGrad);
}
.sidebar-brand .name {
  font-size: 17px; font-weight: 700; letter-spacing: -0.3px;
  background: linear-gradient(135deg, #F4F1FA 0%, #D0B0FF 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.sidebar-user {
  display: none;
  padding: 10px 12px; margin-bottom: 8px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--hair);
  align-items: center; gap: 10px; color: var(--text); text-decoration: none;
  transition: border-color .15s ease, background .15s ease;
}
.sidebar-user:hover {
  border-color: rgba(160,107,255,0.35);
  background: rgba(160,107,255,0.06);
}
@media (min-width: 900px) { .sidebar-user { display: flex; } }
.sidebar-user .meta { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.sidebar-user .name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .handle { font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-signout-form {
  display: none;
  margin: auto 0 0 0; width: 100%;
}
@media (min-width: 900px) { .sidebar-signout-form { display: block; } }
.sidebar-signout {
  display: flex; width: 100%; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  background: transparent; border: 1px solid var(--hair);
  color: var(--dim); font-size: 13px; font-weight: 500;
  cursor: pointer; text-align: left;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.sidebar-signout:hover {
  color: var(--coral);
  border-color: rgba(255,107,107,0.35);
  background: rgba(255,107,107,0.06);
}
.sidebar-signout-ico {
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  color: inherit;
}

@media (min-width: 900px) {
  .desktop-only { display: block; }
  .mobile-only { display: none; }
}
@media (max-width: 899px) {
  .desktop-only { display: none; }
}

/* ═════════ GENERIC CARDS ═════════ */
.card { background: var(--card); border-radius: 18px; border: 1px solid var(--hair); }
.card-head {
  padding: 14px 16px; border-bottom: 1px solid var(--hair);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.card-head .t { font-size: 14px; font-weight: 600; }
.card-head .s { font-size: 11px; color: var(--dim); margin-top: 2px; }

.tiny-cap {
  font-size: 10px; letter-spacing: 2px; font-weight: 700;
  color: var(--mute); text-transform: uppercase;
}

.pill-btn {
  padding: 7px 12px; border-radius: 100px; font-size: 12px; font-weight: 700;
  cursor: pointer; border: none; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.pill-btn.primary { background: var(--irisGrad); color: #fff; box-shadow: 0 6px 14px rgba(160,107,255,0.3); }
.pill-btn.sent { background: rgba(93,224,166,0.15); color: var(--mint); border: 1px solid rgba(93,224,166,0.3); }
.pill-btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--hair); }
.pill-btn.ghost:hover { background: rgba(255,255,255,0.06); }
.pill-btn.danger { background: transparent; color: var(--coral); border: 1px solid rgba(255,107,107,0.35); }
.pill-btn.sm { padding: 6px 12px; font-size: 11px; }

/* ═════════ FEED ═════════ */
/* Instagram-style single column — narrow the feed on laptop/desktop so posts
   aren't stretched to the full 1200px content area. Mobile keeps full width. */
.feed-column { width: 100%; }
@media (min-width: 900px) {
  .feed-column { max-width: 560px; margin: 0 auto; }
}

/* Pair-emoji nudge banner — shows when the partner has picked their emoji and
   the viewer still needs to respond. */
.feed-emoji-nudge {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(160,107,255,0.18), rgba(255,143,184,0.14));
  border: 1px solid rgba(160,107,255,0.35);
  color: var(--text); text-decoration: none;
  margin-bottom: 12px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.feed-emoji-nudge:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(160,107,255,0.18);
  border-color: rgba(160,107,255,0.55);
}
.feed-emoji-nudge-icon { font-size: 20px; line-height: 1; }
.feed-emoji-nudge-body { flex: 1; font-size: 13px; line-height: 1.35; }
.feed-emoji-nudge-body strong { color: #fff; font-weight: 700; }
.feed-emoji-nudge-cta {
  font-size: 12px; font-weight: 700; color: var(--irisGlow);
  white-space: nowrap;
}

/* Compact top bar on the Feed: inline sync status + Log training CTA */
.feed-topbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.feed-sync {
  flex: 1; min-width: 200px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 12px; color: var(--dim); font-weight: 500;
  padding: 10px 14px; border-radius: 100px;
  background: var(--card); border: 1px solid var(--hair);
}
.feed-sync .mono-num { color: var(--text); font-weight: 700; }
.feed-sync-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 8px rgba(93,224,166,0.6);
  margin-right: 2px; flex-shrink: 0;
}

.activity { background: var(--card); border-radius: 20px; border: 1px solid var(--hair); margin-bottom: 14px; overflow: hidden; }
.activity-link {
  display: block; text-decoration: none; color: var(--text);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.activity-link:hover {
  border-color: rgba(160,107,255,0.35);
  box-shadow: 0 10px 24px rgba(160,107,255,0.10);
}
.activity-link:active { transform: scale(0.995); }

/* Compact feed card — text on the left, hero thumbnail on the right */
.feed-card {
  display: flex; align-items: stretch; gap: 12px;
  background: var(--card); border: 1px solid var(--hair); border-radius: 18px;
  padding: 12px; margin-bottom: 10px;
  text-decoration: none; color: var(--text);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.feed-card:hover {
  border-color: rgba(160,107,255,0.35);
  box-shadow: 0 10px 24px rgba(160,107,255,0.10);
}
.feed-card:active { transform: scale(0.995); }
.feed-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.feed-card-head {
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.feed-card-who {
  flex: 1; min-width: 0;
  display: flex; align-items: baseline; gap: 5px;
  font-size: 12px; color: var(--dim);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.feed-card-name {
  color: var(--text); font-weight: 600; font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.feed-card-dot { color: var(--mute); }
.feed-card-when { color: var(--dim); font-weight: 500; }
.feed-card-tag {
  padding: 2px 7px; border-radius: 100px;
  font-size: 9px; font-weight: 700; letter-spacing: 1px;
  background: rgba(160,107,255,0.18); color: var(--irisGlow);
  border: 1px solid rgba(160,107,255,0.28); white-space: nowrap; flex-shrink: 0;
}
.feed-card-title {
  font-size: 15px; font-weight: 600; letter-spacing: -0.2px;
  color: var(--text); text-transform: capitalize;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.feed-card-stats {
  font-size: 12px; color: var(--text); font-weight: 600;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline;
}
.feed-card-stats .u { font-size: 10px; color: var(--dim); font-weight: 500; margin-left: 2px; }
.feed-card-stats .sep { color: var(--mute); font-weight: 400; }
.feed-card-thumb {
  width: 96px; height: 96px; border-radius: 14px; align-self: center; flex-shrink: 0;
}
@media (max-width: 460px) {
  .feed-card-thumb { width: 84px; height: 84px; }
  .feed-card-title { font-size: 14px; }
}
.activity-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; }
.activity-who { flex: 1; min-width: 0; }
.activity-name { font-size: 14px; font-weight: 600; color: var(--text); }
.activity-when { font-size: 11px; color: var(--dim); margin-top: 2px; }
.activity-tag {
  padding: 3px 8px; border-radius: 100px; font-size: 9px; font-weight: 700; letter-spacing: 1px;
  background: rgba(160,107,255,0.15); color: var(--iris); border: 1px solid rgba(160,107,255,0.25); white-space: nowrap;
}
.activity-title { padding: 0 16px; font-size: 17px; font-weight: 600; letter-spacing: -0.3px; line-height: 1.25; color: var(--text); }
.activity-meta { padding: 4px 16px 12px; font-size: 12px; color: var(--dim); }
.activity-stats { display: flex; flex-wrap: wrap; gap: 18px; row-gap: 10px; padding: 0 16px 12px; }
.activity-stats > div { min-width: 0; }
.activity-stats .s { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; color: var(--text); }
.activity-stats .sl { font-size: 9px; color: var(--dim); letter-spacing: 0.8px; text-transform: uppercase; font-weight: 600; margin-top: 2px; }

.empty-state {
  margin-top: 16px; padding: 36px 28px; border-radius: 20px;
  background: rgba(160,107,255,0.05); border: 1px dashed rgba(160,107,255,0.25); text-align: center;
}
.empty-state h3 { margin: 12px 0 8px; color: var(--text); font-size: 18px; }
.empty-state p { color: var(--dim); margin: 0 0 16px; font-size: 13px; }

@media (min-width: 700px) {
  .activity-title { font-size: 18px; padding: 0 20px; }
  .activity-stats { gap: 28px; padding: 0 20px 14px; }
  .activity-head { padding: 16px 20px 12px; }
  .activity-meta { padding: 4px 20px 14px; }
  .activity-media { padding: 0 20px 14px; }
}

/* ═════════ CONTACTS / FRIENDS ═════════ */
.tabs {
  display: flex; gap: 6px; margin-bottom: 16px; overflow-x: auto;
  -webkit-overflow-scrolling: touch; padding-bottom: 4px;
  margin-left: -18px; margin-right: -18px; padding-left: 18px; padding-right: 18px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 8px 14px; border-radius: 100px; font-size: 12px; font-weight: 600;
  cursor: pointer; background: var(--card); border: 1px solid var(--hair);
  color: var(--dim); white-space: nowrap; flex-shrink: 0;
  display: flex; align-items: center; gap: 6px; text-decoration: none;
}
.tab.active { background: rgba(160,107,255,0.2); border-color: rgba(160,107,255,0.4); color: var(--irisGlow); }
.tab .n { padding: 1px 6px; border-radius: 100px; background: rgba(255,255,255,0.08); font-size: 10px; }
.tab.active .n { background: rgba(160,107,255,0.3); }

.search-bar { display: flex; gap: 8px; margin-bottom: 14px; }
.search-box {
  flex: 1; display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--hair); min-width: 0;
}
.search-box input {
  flex: 1; min-width: 0; background: transparent; border: none; outline: none;
  color: var(--text); font-size: 14px;
}
.invite-btn {
  padding: 11px 14px; border-radius: 12px; background: var(--irisGrad); color: #fff; border: none;
  cursor: pointer; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  box-shadow: 0 10px 20px rgba(160,107,255,0.3); text-decoration: none;
}
.invite-btn .label-full { display: none; }
@media (min-width: 500px) { .invite-btn .label-full { display: inline; } }

.contact-grid { display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 700px) {
  .contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
}
.contact-card {
  padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--hair);
  display: flex; gap: 12px; align-items: flex-start;
}
.contact-card .avatar { width: 44px; height: 44px; font-size: 17px; }
.contact-card .body { flex: 1; min-width: 0; }
.contact-card .n { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.contact-card .h { font-size: 12px; color: var(--dim); margin-top: 2px; }
.contact-card .stats { font-size: 11px; color: var(--mute); margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; }
.stacked-btns { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

/* iOS-inspired friends layout */
.friends-section { margin-bottom: 20px; }
.friends-section + .friends-section { margin-top: 4px; }
.section-caps {
  font-size: 11px; font-weight: 700; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--dim);
  margin: 0 2px 10px; display: flex; align-items: center; gap: 8px;
}
.section-count {
  font-size: 10px; font-weight: 700; letter-spacing: 0.4px;
  padding: 1px 7px; border-radius: 100px;
  background: rgba(255,255,255,0.06); color: var(--dim);
}
.friends-stack { display: flex; flex-direction: column; gap: 8px; }

.friend-card {
  padding: 14px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--hair);
  display: flex; gap: 12px; align-items: center;
}
.friend-card .avatar { width: 44px; height: 44px; font-size: 17px; flex-shrink: 0; }
.friend-card .body { flex: 1; min-width: 0; }
.friend-card .n { font-size: 15px; font-weight: 600; color: var(--text); }
.friend-card .h { font-size: 12px; color: var(--dim); margin-top: 2px; }
.friend-card.pending {
  background: rgba(160,107,255,0.08);
  border-color: rgba(160,107,255,0.25);
}
.friend-card.pending .h { color: var(--irisGlow); opacity: 0.85; }
.inline-btns { display: flex; gap: 6px; flex-shrink: 0; }

/* Invite modal extensions */
.invite-block { margin-bottom: 16px; }
.invite-block:first-of-type { margin-top: 14px; }
.invite-block:last-child { margin-bottom: 0; }
.invite-input-row {
  display: flex; gap: 8px; align-items: center;
}
.invite-input-row input {
  flex: 1; min-width: 0;
  padding: 11px 14px; border-radius: 12px;
  background: var(--card2); border: 1px solid var(--hair);
  color: var(--text); font-size: 14px; outline: none;
}
.invite-input-row input::placeholder { color: var(--mute); }
.invite-input-row input:focus { border-color: rgba(160,107,255,0.4); }
.invite-input-row .pill-btn { padding: 11px 18px; font-size: 13px; }
.invite-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--mute); font-size: 11px; font-weight: 600;
  letter-spacing: 0.8px; text-transform: uppercase;
  margin: 14px 0;
}
.invite-divider::before, .invite-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--hair);
}
.invite-hint {
  font-size: 11px; color: var(--dim); margin: 8px 2px 0;
}

/* ═════════ MY ACTIVITIES / SYNC ═════════ */
.sync-hero {
  padding: 18px; border-radius: 22px; margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(160,107,255,0.2) 0%, rgba(93,224,166,0.1) 100%);
  border: 1px solid var(--hair); display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.sync-hero .big-icon {
  width: 52px; height: 52px; border-radius: 16px; background: rgba(93,224,166,0.2);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sync-hero h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.3px; color: var(--text); }
.sync-hero p { margin: 3px 0 0; font-size: 12px; color: var(--dim); }
.sync-hero .sync-badge {
  padding: 5px 10px; border-radius: 100px; background: rgba(93,224,166,0.15); color: var(--mint);
  border: 1px solid rgba(93,224,166,0.3); font-size: 10px; font-weight: 700; letter-spacing: 1px;
  display: flex; align-items: center; gap: 6px; margin-left: auto;
}

.sync-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 700px) { .sync-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; } }
.stat-card { padding: 14px 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--hair); }
.stat-card .big { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; margin-top: 4px; color: var(--text); }
.stat-card .lbl { font-size: 10px; color: var(--dim); text-transform: uppercase; font-weight: 600; letter-spacing: 0.8px; }

.activity-row {
  display: block;
  padding: 12px 14px; border-bottom: 1px solid var(--hair);
  text-decoration: none; color: var(--text);
  transition: background .15s ease;
}
.activity-row:last-child { border: none; }
.activity-row:hover { background: rgba(255,255,255,0.03); }
.activity-row:active { background: rgba(255,255,255,0.06); }
.activity-row-top { display: flex; align-items: center; gap: 12px; }
.activity-row .main { flex: 1; min-width: 0; }
.activity-row .title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-row .sub { font-size: 11px; color: var(--dim); margin-top: 3px; }
.activity-row .right {
  display: flex; align-items: center; gap: 6px;
  text-align: right; font-size: 10px; flex-shrink: 0;
}
.activity-row .when { color: var(--dim); font-size: 11px; }
.activity-row .chev { display: flex; opacity: 0.6; }

.hero-thumb {
  position: relative;
  width: 84px; height: 64px; flex-shrink: 0;
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--hair);
  background: var(--card2);
}
.hero-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.hero-thumb.placeholder {
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(160,107,255,0.30) 0%, rgba(160,107,255,0.0) 65%),
    var(--card2);
  display: flex; align-items: center; justify-content: center;
}
.hero-thumb-badge {
  position: absolute; right: 4px; bottom: 4px;
  padding: 2px 6px; border-radius: 100px;
  background: rgba(11,10,16,0.72);
  color: var(--text); font-size: 10px; font-weight: 700;
  letter-spacing: 0.3px;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}

.activity-media {
  display: flex; overflow-x: auto; gap: 4px;
  padding: 0 16px 12px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.activity-media::-webkit-scrollbar { display: none; }
.activity-photo {
  height: 200px; width: auto; min-width: 120px;
  object-fit: cover; flex-shrink: 0; border-radius: 10px;
}
.activity-photo:only-child { width: 100%; height: 240px; }

/* ═════════ WORKOUT DETAIL ═════════ */
.back-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px 8px 10px; border-radius: 100px;
  background: var(--card); border: 1px solid var(--hair);
  color: var(--text); font-size: 12px; font-weight: 600;
  text-decoration: none; margin-bottom: 14px;
  transition: background .15s ease;
}
.back-pill:hover { background: rgba(255,255,255,0.05); }

.workout-hero {
  position: relative;
  padding: 22px 20px 24px;
  border-radius: 22px;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(160,107,255,0.24) 0%, rgba(160,107,255,0.0) 55%),
    radial-gradient(120% 120% at 100% 100%, rgba(106,63,214,0.28) 0%, rgba(106,63,214,0.0) 55%),
    var(--card);
  border: 1px solid var(--hair);
  overflow: hidden;
  margin-bottom: 14px;
}
.workout-hero-tags {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.workout-tag {
  padding: 4px 10px; border-radius: 100px;
  font-size: 10px; font-weight: 700; letter-spacing: 1.2px;
  background: rgba(160,107,255,0.2); color: var(--irisGlow);
  border: 1px solid rgba(160,107,255,0.3); white-space: nowrap;
}
.workout-hero-date {
  font-size: 11px; color: var(--dim); font-weight: 600;
  letter-spacing: 0.4px; text-transform: uppercase;
}
.workout-hero-title {
  margin: 12px 0 4px;
  font-size: 30px; font-weight: 700; letter-spacing: -0.6px; line-height: 1.15;
  color: var(--text);
  text-transform: capitalize;
}
.workout-hero-source {
  margin: 0; font-size: 12px; color: var(--dim);
}
.workout-hero-owner {
  display: flex; align-items: center; gap: 10px; margin-top: 12px;
}
.workout-hero-owner-name {
  font-size: 13px; font-weight: 600; color: var(--text);
}

.workout-gallery {
  display: flex; overflow-x: auto; gap: 6px;
  margin-bottom: 14px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.workout-gallery::-webkit-scrollbar { display: none; }
.workout-gallery-photo {
  height: 280px; width: auto; min-width: 200px;
  object-fit: cover; flex-shrink: 0; border-radius: 16px;
}
.workout-gallery-photo:only-child { width: 100%; height: 340px; }

.workout-map {
  height: 320px; border-radius: 18px; overflow: hidden;
  border: 1px solid var(--hair); background: var(--card);
  margin-bottom: 14px;
}
.workout-map .leaflet-container { height: 100%; width: 100%; background: var(--bg2); }
.workout-map .leaflet-tile-pane { filter: brightness(0.72) contrast(1.08) saturate(0.6); }
.workout-map .leaflet-control-attribution { display: none !important; }
.workout-map .leaflet-control-zoom a {
  background: var(--card); color: var(--text); border: 1px solid var(--hair);
}
.workout-map .leaflet-control-zoom a:hover { background: rgba(255,255,255,0.05); }

/* Stats grid — sprava-style hairline dividers with our dark palette */
.workout-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  background: var(--hair);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--hair);
  margin-bottom: 14px;
}
.workout-stat-cell {
  background: var(--card);
  padding: 14px 16px;
}
.workout-stat-cell .lbl {
  font-size: 9px; color: var(--dim); letter-spacing: 1.2px;
  text-transform: uppercase; font-weight: 700; margin-bottom: 6px;
}
.workout-stat-cell .val {
  font-size: 22px; font-weight: 700; letter-spacing: -0.4px;
  color: var(--text); line-height: 1.05;
  display: flex; align-items: baseline; gap: 4px;
}
.workout-stat-cell .val .unit {
  font-size: 11px; font-weight: 600; color: var(--dim);
}

/* Analysis chart panels (pace / elevation / HR) */
.chart-panel {
  background: var(--card); border: 1px solid var(--hair);
  border-radius: 18px; padding: 16px 16px 12px;
  margin-bottom: 14px;
}
.chart-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
.chart-head h3 {
  margin: 0; font-size: 11px; font-weight: 700;
  letter-spacing: 1.4px; text-transform: uppercase; color: var(--dim);
}
.chart-head .chart-sub {
  font-size: 12px; color: var(--text); font-weight: 600;
  font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: center; gap: 6px;
}
.analysis-canvas {
  display: block; width: 100%;
}

/* Heart-rate zones gradient bar */
.hr-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--coral); display: inline-block;
}
.hr-bar-container {
  position: relative; margin-top: 6px;
}
.hr-bar {
  height: 30px; border-radius: 8px;
  background: linear-gradient(90deg,
    #3498db 0%, #2ecc71 20%, #f1c40f 40%,
    #e67e22 60%, #e74c3c 80%, #8e44ad 100%);
  opacity: 0.28;
}
.hr-bar-fill {
  position: absolute; top: 0; bottom: 0;
  background: linear-gradient(90deg,
    #3498db 0%, #2ecc71 20%, #f1c40f 40%,
    #e67e22 60%, #e74c3c 80%, #8e44ad 100%);
  border-radius: 8px; opacity: 1;
  box-shadow: 0 2px 10px rgba(160,107,255,0.15);
}
.hr-bar-avg {
  position: absolute; top: -4px; bottom: -4px;
  width: 3px; background: #fff; border-radius: 2px;
  box-shadow: 0 0 6px rgba(0,0,0,0.45);
}
.hr-bar-labels {
  display: flex; justify-content: space-between;
  margin-top: 8px; font-size: 10px; color: var(--mute);
  letter-spacing: 0.4px;
}
.hr-bar-labels .z { color: var(--mute); font-weight: 600; }

/* Splits table */
.splits-panel {
  background: var(--card); border: 1px solid var(--hair);
  border-radius: 18px; padding: 16px;
  margin-bottom: 14px;
}
.splits-table {
  width: 100%; border-collapse: collapse; margin-top: 6px;
}
.splits-table th, .splits-table td {
  text-align: left; padding: 8px 10px 8px 0;
  font-size: 12px; color: var(--text);
}
.splits-table th {
  font-size: 9px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--dim); font-weight: 700; padding-bottom: 6px;
  border-bottom: 1px solid var(--hair);
}
.splits-table td {
  border-bottom: 1px solid var(--hair);
}
.splits-table tbody tr:last-child td { border-bottom: none; }
.splits-table td.km { width: 32px; color: var(--dim); font-weight: 600; }
.splits-table td.pace { font-weight: 700; }
.splits-table td.pace.fast { color: var(--iris); }
.splits-table td.hr { color: var(--dim); }
.splits-table td.elev .up    { color: var(--mint); font-weight: 600; }
.splits-table td.elev .down  { color: var(--coral); font-weight: 600; }
.splits-table td.elev .mute  { color: var(--mute); }
.splits-table td .u { font-size: 10px; color: var(--dim); font-weight: 500; margin-left: 2px; }
.splits-table td.bar-col { width: 34%; padding-right: 0; }
.pace-bar-bg {
  height: 6px; background: rgba(255,255,255,0.05); border-radius: 3px; overflow: hidden;
}
.pace-bar-fill { height: 100%; border-radius: 3px; }
.pace-bar-fill.fast { background: var(--iris); }
.pace-bar-fill.slow { background: var(--mute); opacity: 0.5; }
.splits-legend {
  display: flex; gap: 14px; flex-wrap: wrap;
  margin-top: 12px; font-size: 11px; color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.splits-legend .dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 6px; vertical-align: middle;
}
.splits-legend .dot.fast { background: var(--iris); }
.splits-legend .dot.slow { background: var(--mute); opacity: 0.7; }

/* Sync badge */
.workout-sync {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 18px;
  background: linear-gradient(135deg, rgba(93,224,166,0.10), rgba(93,224,166,0.02));
  border: 1px solid rgba(93,224,166,0.22);
  margin-bottom: 14px;
}
.workout-sync-icon {
  width: 36px; height: 36px; border-radius: 12px;
  background: rgba(93,224,166,0.15);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.workout-sync-text { flex: 1; min-width: 0; }
.workout-sync-text .t { font-size: 13px; font-weight: 600; color: var(--text); }
.workout-sync-text .s { font-size: 11px; color: var(--dim); margin-top: 2px; }
.workout-sync-check {
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(93,224,166,0.2);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

@media (min-width: 700px) {
  .workout-hero { padding: 28px 26px 30px; }
  .workout-hero-title { font-size: 36px; }
  .workout-stat-cell .val { font-size: 26px; }
  .workout-stat-cell { padding: 18px 20px; }
  .chart-panel { padding: 20px 20px 14px; }
  .splits-panel { padding: 20px; }
}

/* ═════════ INVITE / SHEET MODAL ═════════ */
.modal-bg {
  position: fixed; inset: 0; background: rgba(11,10,16,0.78); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  z-index: 100; display: flex; align-items: flex-end; justify-content: center; animation: app-fade .25s ease;
}
.modal-bg[hidden] { display: none; }
@media (min-width: 600px) { .modal-bg { align-items: center; padding: 20px; } }
.modal {
  width: 100%; max-width: 460px; background: var(--card); border-radius: 24px 24px 0 0;
  border: 1px solid var(--hair); border-bottom: none;
  padding: 22px 20px calc(var(--safeB) + 22px); box-shadow: 0 -20px 60px rgba(0,0,0,0.6);
  animation: app-slide-up .3s ease;
}
@media (min-width: 600px) { .modal { border-radius: 24px; border-bottom: 1px solid var(--hair); padding: 26px 24px; } }
@keyframes app-slide-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--hair); margin: -6px auto 14px; }
@media (min-width: 600px) { .modal-handle { display: none; } }
.modal h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; margin: 0 0 4px; color: var(--text); }
.modal p { font-size: 13px; color: var(--dim); margin: 0 0 18px; }
.invite-field {
  display: flex; gap: 10px; padding: 14px; border-radius: 14px;
  background: var(--bg); border: 1px solid var(--hair);
  align-items: center; margin-bottom: 10px; font-size: 13px; color: var(--text); cursor: pointer; text-decoration: none;
}
.invite-field:hover { background: var(--bg2); }
.invite-field .label { flex: 1; }
.invite-link {
  display: flex; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--bg2);
  border: 1px dashed var(--hair); align-items: center;
  font-family: 'SF Mono', Menlo, monospace; font-size: 11px; color: var(--irisGlow);
}
.invite-link .link { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.copy-btn {
  padding: 6px 10px; border-radius: 100px; background: rgba(160,107,255,0.2); color: var(--irisGlow);
  border: 1px solid rgba(160,107,255,0.4); cursor: pointer; font-size: 11px; font-weight: 600; flex-shrink: 0;
}

.route-wrap {
  margin: 0 16px 12px; height: 130px; border-radius: 14px; overflow: hidden; position: relative;
  background: linear-gradient(180deg, #1F1A3A 0%, #0B0A10 100%);
}

/* ═════════ PROFILE PAGE · mirrors iOS YouView / UserProfileView ═════════
   Visual refs (from SwiftUI):
   • 96pt avatar with iris-tinted outer shadow
   • 22pt bold name, 13pt dim handle, 11pt uppercase joined date
   • 2×2 progress tiles: emoji / 24pt tinted value / label / sub
   • Activity heatmap card with "N active days"
   • All-time stats card with hairline dividers between cells
   • Pair chip, iOS-style settings rows (read-only on the web)
────────────────────────────────────────────────────────────────── */

.up-hero {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 28px 20px 22px; margin-bottom: 16px;
  border-radius: 24px;
  background:
    radial-gradient(60% 55% at 50% 0%, rgba(160,107,255,0.18) 0%, transparent 72%),
    var(--card);
  border: 1px solid var(--hair);
}
.up-hero-avatar {
  margin-bottom: 14px;
  filter: drop-shadow(0 10px 24px rgba(160,107,255,0.35));
}
.up-hero-name {
  margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.3px;
  color: var(--text);
}
.up-hero-handle {
  margin-top: 4px; font-size: 13px; color: var(--dim);
  font-family: "SF Mono", Menlo, monospace;
}
.up-hero-joined {
  margin-top: 8px; font-size: 11px; color: var(--mute);
  text-transform: uppercase; letter-spacing: 0.9px; font-weight: 600;
}

/* HealthKit sync status — self-only pill under the hero. Same dot
   treatment as the old feed-sync but tighter (the profile hero is
   centered and we don't want a full-width pill). */
.up-sync {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 12px;
  padding: 6px 12px; border-radius: 100px;
  background: var(--card2, rgba(255,255,255,0.04));
  border: 1px solid var(--hair);
  font-size: 12px; color: var(--dim); font-weight: 500;
}

/* Relationship CTA card for viewing someone else */
.up-rel-card {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px; margin-bottom: 16px;
  border-radius: 20px;
  background: var(--card); border: 1px solid var(--hair);
}
.up-rel-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; border-radius: 100px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.2px;
}
.up-rel-pill.friend {
  background: rgba(93,224,166,0.15); color: var(--mint);
  border: 1px solid rgba(93,224,166,0.30);
}
.up-rel-pill.pending {
  background: rgba(255,181,71,0.15); color: var(--amber);
  border: 1px solid rgba(255,181,71,0.30);
}
.up-rel-primary {
  flex: 1; min-width: 140px;
  border: none; cursor: pointer;
  padding: 12px 18px; border-radius: 14px;
  background: var(--irisGrad); color: #fff;
  font-size: 14px; font-weight: 700; letter-spacing: 0.1px;
  box-shadow: 0 10px 24px rgba(160,107,255,0.28);
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .12s ease, box-shadow .15s ease;
}
.up-rel-primary:hover  { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(160,107,255,0.38); }
.up-rel-primary:active { transform: translateY(0); }
.up-rel-secondary {
  border: 1px solid var(--hairStrong); background: transparent;
  color: var(--text); cursor: pointer;
  padding: 10px 16px; border-radius: 14px;
  font-size: 13px; font-weight: 600;
  transition: background-color .12s ease;
}
.up-rel-secondary:hover { background: var(--card2); }

/* Section caps */
.up-section-caps {
  font-size: 11px; font-weight: 700; letter-spacing: 1.4px; color: var(--mute);
  text-transform: uppercase;
}

/* GitHub-style contribution graph: 26 weeks × 7 days, 5 intensity levels.
   Columns = weeks (Mon→Sun top to bottom), rows = weekdays. Cells scale
   with container width using aspect-ratio: 1. */
.up-gh-card {
  padding: 16px; margin-bottom: 14px;
  border-radius: 20px;
  background: var(--card); border: 1px solid var(--hair);
}
.up-gh-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}
.up-gh-meta {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; color: var(--dim);
}
.up-gh-streak { color: var(--coral); font-weight: 700; }

.up-gh-months {
  display: grid; grid-template-columns: repeat(26, 1fr); gap: 3px;
  margin-bottom: 4px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.3px;
  color: var(--mute); text-transform: uppercase;
}
.up-gh-month {
  text-align: left; white-space: nowrap; overflow: hidden;
}

.up-gh-grid {
  display: grid;
  grid-template-columns: repeat(26, 1fr);
  grid-template-rows: repeat(7, 1fr);
  grid-auto-flow: column;
  gap: 3px;
}
.up-gh-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: rgba(255,255,255,0.05);
  transition: transform .08s ease, box-shadow .12s ease;
}
.up-gh-cell.l0 { background: rgba(255,255,255,0.05); }
.up-gh-cell.l1 { background: rgba(160,107,255,0.28); }
.up-gh-cell.l2 { background: rgba(160,107,255,0.52); }
.up-gh-cell.l3 { background: rgba(160,107,255,0.78); }
.up-gh-cell.l4 {
  background: var(--iris);
  box-shadow: 0 0 6px rgba(160,107,255,0.55);
}
.up-gh-cell.future { background: rgba(255,255,255,0.025); }
.up-gh-cell.today  { outline: 1.5px solid var(--mint); outline-offset: 1px; }
.up-gh-cell:hover  { transform: scale(1.35); }

/* Buttoned tiles (cells with at least one activity) — strip native
   <button> chrome so they look identical to the static .up-gh-cell
   tiles next to them, but get pointer cursor + a focus ring. */
button.up-gh-cell-btn {
  appearance: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
}
button.up-gh-cell-btn:focus-visible {
  outline: 2px solid var(--iris);
  outline-offset: 2px;
}

/* Day-detail dialog: list of activities for a clicked heatmap tile.
   Mirrors the existing .cs-dialog (comments) shape so the page has
   one dialog grammar across drilldowns. */
.day-detail-dialog {
  position: fixed; inset: 0;
  margin: auto;
  max-width: 480px; width: calc(100% - 32px);
  max-height: min(80vh, 640px);
  border: 1px solid var(--hair);
  border-radius: 18px;
  padding: 0;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  overflow: hidden;
}
.day-detail-dialog::backdrop {
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}
.day-detail-dialog .day-detail-frame {
  display: block;
  max-height: inherit;
  overflow-y: auto;
}
.day-detail-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--hair);
}
.day-detail-title {
  margin: 0; font-size: 16px; font-weight: 700; color: var(--text);
}
.day-detail-sub {
  margin-top: 2px;
  font-size: 11px; color: var(--mute);
  text-transform: uppercase; letter-spacing: 0.9px; font-weight: 600;
}
.day-detail-close {
  appearance: none; border: 0; background: transparent;
  color: var(--dim); cursor: pointer;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 22px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.day-detail-close:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.day-detail-list { padding: 8px 8px 12px; }
.day-detail-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 13px; color: var(--mute);
}
.day-detail-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  text-decoration: none; color: var(--text);
  transition: background .12s ease;
}
.day-detail-row:hover { background: rgba(255,255,255,0.06); }
.day-detail-emoji { font-size: 22px; line-height: 1; flex-shrink: 0; }
.day-detail-row-body { flex: 1; min-width: 0; }
.day-detail-row-title {
  font-size: 14px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.day-detail-row-meta {
  margin-top: 2px;
  font-size: 12px; color: var(--dim); font-weight: 500;
}
.day-detail-arrow {
  color: var(--mute); font-size: 18px; line-height: 1;
}

.up-gh-legend {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 4px; margin-top: 10px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.9px;
  color: var(--mute); text-transform: uppercase;
}
.up-gh-legend .up-gh-cell {
  width: 10px; height: 10px; aspect-ratio: auto;
}
.up-gh-legend .up-gh-cell:hover { transform: none; }

/* All-time stats card: 2×2 with hairline dividers between cells */
.up-alltime {
  margin-bottom: 14px; padding: 16px;
  border-radius: 20px; background: var(--card); border: 1px solid var(--hair);
}
.up-alltime-head { display: block; margin-bottom: 12px; }
.up-alltime-grid {
  display: grid; grid-template-columns: 1fr 1fr;
}
.up-stat-cell {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 12px; min-width: 0;
}
.up-stat-cell:nth-child(even) { border-left: 1px solid var(--hair); }
.up-stat-cell:nth-child(n+3)  { border-top:  1px solid var(--hair); }
.up-stat-cell .lbl {
  font-size: 9px; font-weight: 700; letter-spacing: 1.1px; color: var(--mute);
  text-transform: uppercase;
}
.up-stat-cell .val {
  font-size: 18px; font-weight: 700; letter-spacing: -0.2px; color: var(--text);
  display: flex; align-items: baseline; gap: 3px;
  font-variant-numeric: tabular-nums;
}
.up-stat-cell .val .u { font-size: 11px; color: var(--dim); font-weight: 600; }

/* Pair chip */
.up-pair {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px; padding: 12px 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,143,184,0.12), rgba(126,184,255,0.10)), var(--card);
  border: 1px solid rgba(255,143,184,0.25);
  text-decoration: none; color: var(--text);
  transition: border-color .15s ease;
}
.up-pair:hover { border-color: rgba(255,143,184,0.55); }
.up-pair-heart {
  width: 28px; height: 28px; border-radius: 10px;
  background: rgba(255,107,107,0.15);
  display: inline-flex; align-items: center; justify-content: center;
}
.up-pair-meta { min-width: 0; }
.up-pair-cap {
  font-size: 10px; font-weight: 700; letter-spacing: 1.2px; color: var(--mute);
  text-transform: uppercase;
}
.up-pair-name {
  font-size: 15px; font-weight: 700; color: var(--text); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.up-pair-handle {
  font-size: 12px; font-weight: 500; color: var(--dim); margin-left: 6px;
  font-family: "SF Mono", Menlo, monospace;
}

/* Read-only meta card (self only) — iOS settings-row aesthetic */
.up-meta-card {
  margin-bottom: 14px; padding: 4px 14px;
  border-radius: 20px; background: var(--card); border: 1px solid var(--hair);
}
.up-meta-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
}
.up-meta-ico {
  width: 32px; height: 32px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.up-meta-ico.iris  { background: rgba(160,107,255,0.15); color: var(--iris); }
.up-meta-ico.mint  { background: rgba(93,224,166,0.15);  color: var(--mint); }
.up-meta-ico.amber { background: rgba(255,181,71,0.15);  color: var(--amber); }
.up-meta-ico.coral { background: rgba(255,107,107,0.15); color: var(--coral); }
.up-meta-main { flex: 1; min-width: 0; }
.up-meta-title {
  font-size: 13px; font-weight: 600; color: var(--dim); letter-spacing: 0.1px;
}
.up-meta-val {
  font-size: 15px; font-weight: 600; color: var(--text); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.up-meta-div { height: 1px; background: var(--hair); margin: 0 -14px 0 58px; }

/* "Edit in app" footer hint */
.up-edit-hint {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(160,107,255,0.08);
  border: 1px dashed rgba(160,107,255,0.35);
}
.up-edit-hint-ico { font-size: 22px; line-height: 1; }
.up-edit-hint-title {
  font-size: 13px; font-weight: 700; color: var(--text);
}
.up-edit-hint-sub {
  font-size: 12px; color: var(--dim); margin-top: 2px;
}

/* User chip — clickable avatar/name on cards */
.wc-user-chip {
  text-decoration: none; color: inherit;
  transition: opacity .15s ease, transform .12s ease;
}
.wc-user-chip:hover { opacity: 0.82; }
.wc-user-chip:active { transform: scale(0.97); }

/* Friend-card link wrapper */
.friend-card-link {
  display: flex; flex: 1; align-items: center; gap: 12px; min-width: 0;
  text-decoration: none; color: inherit;
  transition: opacity .15s ease;
}
.friend-card-link:hover { opacity: 0.85; }

/* ═════════ WORKOUT CARD · Instagram-style (feed + activity list) ═════════ */
.wc-card {
  display: block; color: var(--text);
  background: var(--card); border: 1px solid var(--hair);
  border-radius: 20px; overflow: hidden;
  margin-bottom: 16px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.wc-card:has(.wc-body-link:hover) {
  border-color: rgba(160,107,255,0.35);
  box-shadow: 0 14px 30px rgba(160,107,255,0.12);
}
.wc-body-link {
  display: block; text-decoration: none; color: inherit;
  transition: transform .18s ease;
}
.wc-body-link:active { transform: scale(0.997); }

.wc-header {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 14px 14px 12px;
}
.wc-header-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.wc-name {
  font-size: 14px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wc-title {
  font-size: 17px; font-weight: 600; letter-spacing: -0.2px;
  color: var(--text); text-transform: capitalize;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wc-header-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--dim);
}
.wc-pill {
  padding: 2px 8px; border-radius: 100px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.4px;
}
.wc-pill.outdoor {
  background: rgba(160,107,255,0.18); color: var(--irisGlow);
  border: 1px solid rgba(160,107,255,0.30);
}
.wc-pill.indoor {
  background: rgba(255,181,71,0.18); color: var(--amber);
  border: 1px solid rgba(255,181,71,0.30);
}
.wc-when { color: var(--dim); font-weight: 500; }
.wc-source {
  font-size: 11px; font-weight: 500; color: var(--mute);
  max-width: 110px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  flex-shrink: 0; padding-top: 4px;
}

.wc-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 1.1 / 1;
  background: var(--card2);
  overflow: hidden;
}
.wc-hero-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.wc-hero-badge {
  position: absolute; right: 12px; bottom: 12px;
  padding: 4px 10px; border-radius: 100px;
  background: rgba(0,0,0,0.55);
  color: #fff; font-size: 11px; font-weight: 700;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}

/* Instagram-style media carousel on activity cards. Trackpad / touch swipe
   horizontally; dots update via Stimulus. */
.wc-carousel-root { position: absolute; inset: 0; }
.wc-carousel {
  display: flex;
  width: 100%; height: 100%;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.wc-carousel::-webkit-scrollbar { display: none; }
.wc-slide {
  flex: 0 0 100%;
  width: 100%; height: 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}
.wc-slide-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  background: #000;
}
.wc-dots {
  position: absolute; left: 0; right: 0; bottom: 10px;
  display: flex; gap: 5px; justify-content: center;
  pointer-events: none; z-index: 2;
}
.wc-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.55);
  box-shadow: 0 1px 2px rgba(0,0,0,0.35);
  transition: background .18s ease, transform .18s ease;
}
.wc-dot.is-active { background: #fff; transform: scale(1.25); }
.wc-hero-map, .wc-hero-topo {
  position: absolute; inset: 0;
}
.wc-hero-map-svg {
  width: 100%; height: 100%; display: block;
}

.wc-stats {
  display: flex; align-items: stretch;
  padding: 14px;
  gap: 0;
}
.wc-stat {
  flex: 1; min-width: 0;
  padding: 0 10px;
  display: flex; flex-direction: column; gap: 3px;
  justify-content: center;
  border-right: 1px solid var(--hair);
}
.wc-stat:first-child { padding-left: 2px; }
.wc-stat:last-child  { padding-right: 2px; border-right: none; }
.wc-stat-label {
  font-size: 9px; font-weight: 700; letter-spacing: 1.1px;
  color: var(--mute);
}
.wc-stat-value {
  font-size: 15px; font-weight: 700; letter-spacing: -0.2px;
  color: var(--text);
  display: flex; align-items: baseline; gap: 3px;
}
.wc-stat-unit {
  font-size: 10px; font-weight: 600; color: var(--dim);
}
@media (max-width: 420px) {
  .wc-stat-value { font-size: 14px; }
  .wc-stat { padding: 0 8px; }
}

/* Training-specific bits on the card */
.wc-pill.training {
  background: rgba(93,224,166,0.15); color: var(--mint);
  border: 1px solid rgba(93,224,166,0.30);
}

/* Post-specific bits on the card */
.wc-pill.post {
  background: rgba(208,176,255,0.15); color: #D0B0FF;
  border: 1px solid rgba(208,176,255,0.32);
}
.wc-post-body {
  padding: 0 14px 12px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.wc-post-body p { margin: 0 0 6px; }
.wc-post-body p:last-child { margin-bottom: 0; }

/* ═════════ Feed card header — mirrors iOS FeedCardHeader ═════════ */
.fch {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 14px 12px;
}
.fch.no-user { padding-left: 14px; }
.fch-avatar { flex-shrink: 0; text-decoration: none; }
.fch-body {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column; gap: 3px;
}
.fch-name {
  font-size: 15px; font-weight: 600; color: var(--text);
  text-decoration: none; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fch-meta {
  font-size: 12px; font-weight: 500; color: var(--dim);
  line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fch-meta-sep { margin: 0 4px; color: var(--mute); }
.fch-kind { display: flex; align-items: center; gap: 5px; line-height: 1.3; }
.fch-kind-emoji { font-size: 13px; }
.fch-kind-text {
  font-size: 12px; font-weight: 500; color: var(--dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ═════════ Big workout / training title block ═════════ */
.wc-title-block {
  padding: 0 14px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.wc-title-big {
  margin: 0;
  font-size: 22px; font-weight: 700; letter-spacing: -0.3px; line-height: 1.2;
  color: var(--text);
  text-transform: capitalize;
}
.wc-desc {
  margin: 0;
  font-size: 14px; color: var(--dim); line-height: 1.4;
}

/* Primary stats row for the new layout — uses explicit dividers between
   cells (mirrors the SwiftUI Divider inside the HStack on iOS) instead
   of the old border-right approach. */
.wc-stats.wc-stats-primary { padding: 0 14px 12px; gap: 0; }
.wc-stats-primary .wc-stat { border-right: none; padding: 0 8px; }
.wc-stats-primary .wc-stat:first-child { padding-left: 0; }
.wc-stats-primary .wc-stat:last-child  { padding-right: 0; }
.wc-stat-divider {
  width: 1px; height: 28px; background: var(--hair); align-self: center;
}

/* Hero overlay chips (AVG HR / MAX HR / ENERGY / ELEV) — only render on
   the route/topo fallback hero so they don't compete with photo media. */
.wc-hero { position: relative; }
.wc-hero-overlay-chips {
  position: absolute; right: 12px; bottom: 12px; left: 12px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  pointer-events: none;
}
.wc-hero-overlay-row {
  display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end;
}
.wc-overlay-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 8px; border-radius: 100px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.18);
  white-space: nowrap;
}
.wc-overlay-chip-label {
  font-size: 9px; font-weight: 700; letter-spacing: 0.6px;
  color: rgba(255,255,255,0.75);
}
.wc-overlay-chip-value {
  font-size: 11px; font-weight: 700; letter-spacing: -0.1px;
}
.wc-overlay-chip[data-tint="coral"] .wc-overlay-chip-value { color: var(--coral); }
.wc-overlay-chip[data-tint="amber"] .wc-overlay-chip-value { color: var(--amber); }
.wc-overlay-chip[data-tint="mint"]  .wc-overlay-chip-value { color: var(--mint); }
.wc-overlay-chip[data-tint="iris"]  .wc-overlay-chip-value { color: var(--irisGlow); }

/* ═════════ Post header — compact (smaller avatar, location inline) ═════════ */
.post-header {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 14px 14px 12px;
}
.post-header-avatar { flex-shrink: 0; text-decoration: none; }
.post-header-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.post-header-name {
  font-size: 14px; font-weight: 600; color: var(--text);
  text-decoration: none; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.post-header-meta {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--mute);
  line-height: 1.3;
  flex-wrap: wrap;
}
.post-header-loc {
  display: inline-flex; align-items: center; gap: 3px;
  font-weight: 500; color: var(--dim);
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.post-header-pin { font-size: 9px; }
.post-header-when { color: var(--mute); }
.post-header-sep { color: var(--mute); }

/* ═════════ Reactions strip — mirrors iOS ReactionsStrip ═════════ */
.wc-footer {
  border-top: 1px solid var(--hair);
  padding: 10px 14px 12px;
}
.rs-frame { display: block; }
.rs-strip {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.rs-form { margin: 0; padding: 0; display: inline-flex; }
.rs-pill {
  display: inline-flex; align-items: center; gap: 4px;
  height: 28px; padding: 0 10px;
  border-radius: 100px;
  background: var(--card2);
  border: 1px solid var(--hair);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .12s ease;
}
.rs-pill:hover { transform: translateY(-1px); }
.rs-pill.is-mine {
  background: rgba(160,107,255,0.18);
  border-color: rgba(160,107,255,0.55);
  color: var(--irisGlow);
}
.rs-pill-emoji { font-size: 14px; line-height: 1; }
.rs-pill-count { font-size: 12px; font-weight: 700; }
.rs-pill.is-mine .rs-pill-count { color: var(--irisGlow); }

.rs-add, .rs-comment {
  display: inline-flex; align-items: center; gap: 3px;
  height: 28px; padding: 0 10px;
  border-radius: 100px;
  background: var(--card2);
  border: 1px solid var(--hair);
  color: var(--dim);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.rs-add:hover, .rs-comment:hover:not(:disabled) {
  background: rgba(160,107,255,0.10);
  color: var(--text);
}
.rs-comment:disabled { opacity: 0.55; cursor: default; }
.rs-add-plus { font-size: 11px; font-weight: 800; }

.rs-reactor-stack {
  display: inline-flex; align-items: center;
  margin-right: 2px;
}
.rs-reactor-avatar {
  display: inline-block;
  width: 24px; height: 24px;
  margin-left: -8px;
  border-radius: 50%;
  border: 2px solid var(--card);
  overflow: hidden;
  position: relative;
}
.rs-reactor-avatar:first-child { margin-left: 0; }
.rs-reactor-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rs-reactor-avatar .avatar { display: inline-flex; align-items: center; justify-content: center; }

/* ═════════ Reactions picker dialog ═════════ */
.rs-picker {
  border: none;
  background: transparent;
  padding: 0;
  margin: auto;
  max-width: 480px;
  width: calc(100% - 32px);
  color: var(--text);
}
.rs-picker::backdrop {
  background: rgba(11, 10, 16, 0.75);
  backdrop-filter: blur(8px);
}
.rs-picker-card {
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0,0,0,0.45);
}
.rs-picker-header {
  display: flex; align-items: center; justify-content: center;
  padding: 14px 14px 6px;
  position: relative;
}
.rs-picker-header h3 {
  margin: 0;
  font-size: 17px; font-weight: 700; letter-spacing: -0.2px;
  color: var(--text);
}
.rs-picker-grab {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 40px; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,0.18);
}
.rs-picker-close {
  position: absolute; right: 14px; top: 14px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--card2); color: var(--dim);
  border: 1px solid var(--hair);
  font-size: 18px; line-height: 1; font-weight: 600;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.rs-picker-grid {
  padding: 8px 14px 18px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
.rs-picker-cell-form { margin: 0; padding: 0; }
.rs-picker-cell {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background: var(--card2);
  border: 1px solid var(--hair);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s ease, border-color .15s ease, transform .12s ease;
}
.rs-picker-cell:hover { background: rgba(160,107,255,0.12); transform: translateY(-1px); }
.rs-picker-cell.is-picked {
  background: rgba(160,107,255,0.18);
  border-color: var(--iris);
  border-width: 1.5px;
}
.rs-picker-cell-emoji { font-size: 26px; line-height: 1; }
@media (max-width: 480px) {
  .rs-picker-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ═════════ Comments preview (under the reactions strip) ═════════ */
.cp-block {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 10px;
}
.cp-viewall {
  align-self: flex-start;
  padding: 0; margin: 0;
  background: transparent; border: 0;
  color: var(--dim); font-size: 13px; font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.cp-viewall:hover { color: var(--text); }
.cp-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 0; margin: 0;
  background: transparent; border: 0;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
}
.cp-row:hover .cp-row-text { color: var(--bolt); }
.cp-row-avatar {
  display: inline-flex; flex-shrink: 0;
  margin-top: 1px;
}
.cp-row-avatar img {
  width: 20px; height: 20px;
  border-radius: 50%;
  object-fit: cover;
}
.cp-row-text {
  font-size: 14px; color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cp-row-name { font-weight: 600; margin-right: 4px; }

/* ═════════ Comments sheet dialog ═════════ */
.cs-dialog {
  border: none;
  background: transparent;
  padding: 0;
  margin: auto;
  width: calc(100% - 32px);
  max-width: 560px;
  max-height: calc(100vh - 32px);
  color: var(--text);
}
.cs-dialog::backdrop {
  background: rgba(11, 10, 16, 0.78);
  backdrop-filter: blur(8px);
}
.cs-frame {
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0,0,0,0.45);
  max-height: calc(100vh - 32px);
}
.cs-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--hair);
  background: var(--card);
  flex-shrink: 0;
}
.cs-header h3 {
  margin: 0;
  font-size: 17px; font-weight: 700; letter-spacing: -0.2px;
  color: var(--text);
}
.cs-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--card2); color: var(--dim);
  border: 1px solid var(--hair);
  font-size: 18px; line-height: 1; font-weight: 600;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}

.cs-thread {
  overflow-y: auto;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 14px;
  flex: 1 1 auto;
  min-height: 240px;
  max-height: 60vh;
}
.cs-empty {
  padding: 30px 12px;
  text-align: center;
}
.cs-empty-title {
  font-size: 15px; font-weight: 600; color: var(--dim);
}
.cs-empty-body {
  font-size: 13px; color: var(--mute); margin-top: 4px;
}

.cs-row {
  display: flex; align-items: flex-start; gap: 10px;
}
.cs-row-body { flex: 1 1 auto; min-width: 0; }
.cs-row-line {
  font-size: 14px; line-height: 1.4; color: var(--text);
  word-wrap: break-word;
}
.cs-row-name { font-weight: 600; margin-right: 6px; }
.cs-row-text { color: var(--text); }
.cs-row-meta {
  margin-top: 2px;
  font-size: 11px; color: var(--mute);
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.cs-row-sep { color: rgba(255,255,255,0.20); }
.cs-row-action {
  background: transparent; border: 0; padding: 0; margin: 0;
  font: inherit;
  color: var(--dim); font-size: 11px;
  cursor: pointer;
}
.cs-row-action:hover { color: var(--text); }
.cs-row-action.danger { color: var(--coral); }
.cs-row-action.danger:hover { color: #ff8a8a; }
.cs-row-deleteform { display: inline; margin: 0; padding: 0; }
.cs-row-deleteform .cs-row-action { background: transparent; }

.cs-row-editform {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 4px;
}
.cs-row-editinput {
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--card2);
  border: 1px solid var(--hair);
  color: var(--text);
  font-size: 14px; font-family: inherit;
  resize: vertical;
}
.cs-row-editinput:focus {
  outline: none;
  border-color: var(--iris);
}
.cs-row-editactions {
  display: flex; align-items: center; gap: 10px;
  justify-content: flex-end;
}

.cs-composer {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--hair);
  background: var(--card);
  flex-shrink: 0;
}
.cs-composer-input {
  flex: 1 1 auto;
  resize: none;
  padding: 9px 12px;
  border-radius: 14px;
  background: var(--card2);
  border: 1px solid var(--hair);
  color: var(--text);
  font: inherit; font-size: 14px;
  line-height: 1.4;
  max-height: 120px;
}
.cs-composer-input:focus {
  outline: none;
  border-color: var(--iris);
}
.cs-composer-submit {
  padding: 9px 14px;
  border-radius: 100px;
  background: var(--irisGrad);
  color: #fff; font-weight: 700; font-size: 13px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.cs-composer-submit:hover { filter: brightness(1.05); }
.cs-error {
  padding: 8px 14px;
  font-size: 12px; color: var(--coral);
  background: rgba(255,107,107,0.10);
  border-top: 1px solid rgba(255,107,107,0.25);
}
.wc-hero-reps {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 20px;
  background:
    radial-gradient(60% 50% at 50% 30%, rgba(93,224,166,0.22) 0%, rgba(93,224,166,0) 70%),
    radial-gradient(60% 50% at 50% 100%, rgba(160,107,255,0.20) 0%, rgba(160,107,255,0) 70%),
    var(--card2);
  color: var(--text); text-align: center;
}
.wc-hero-reps-emoji { font-size: 48px; line-height: 1; }
.wc-hero-reps-number {
  font-size: 72px; font-weight: 700; letter-spacing: -2px;
  background: linear-gradient(180deg, #F4F1FA 0%, #D0B0FF 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  line-height: 0.95;
}
.wc-hero-reps-label {
  font-size: 11px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: var(--dim);
}
.wc-hero-reps-note {
  margin-top: 6px; max-width: 80%;
  font-size: 13px; color: var(--dim); line-height: 1.4;
}

/* ═════════ TRAININGS · new form (mobile-first) ═════════ */
.tr-form { max-width: 560px; margin: 0 auto; }
.tr-section { margin-top: 20px; }
.tr-section:first-child { margin-top: 14px; }
.tr-label {
  display: block; font-size: 13px; font-weight: 600; color: var(--text);
  margin-bottom: 8px;
}
.tr-hint { margin: 6px 0 0; font-size: 12px; color: var(--mute); line-height: 1.4; }

.tr-input {
  width: 100%; padding: 13px 14px; border-radius: 12px;
  background: var(--bg2); border: 1px solid var(--hair);
  color: var(--text); font-size: 16px; /* 16px avoids iOS zoom on focus */
  font-family: inherit; line-height: 1.2;
  -webkit-appearance: none; appearance: none;
}
.tr-input:focus { outline: 2px solid rgba(160,107,255,0.55); outline-offset: 0; }
.tr-input-lg {
  font-size: 24px; font-weight: 700; letter-spacing: -0.3px;
  font-variant-numeric: tabular-nums;
  padding: 16px 14px;
}

.tr-kind-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
@media (max-width: 380px) { .tr-kind-grid { grid-template-columns: repeat(3, 1fr); } }
.tr-kind-card {
  position: relative; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 12px 6px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--hair);
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.tr-kind-card:active { transform: scale(0.96); }
.tr-kind-card:has(.pair-choice-radio:checked) {
  border-color: rgba(93,224,166,0.55);
  background: rgba(93,224,166,0.10);
}
.tr-kind-emoji { font-size: 26px; line-height: 1; }
.tr-kind-label { font-size: 11px; font-weight: 600; color: var(--text); text-align: center; }

/* Reps / Duration toggle by kind.
   Default: reps shown, duration hidden.
   Plank:  duration shown, reps hidden.
   Other:  both shown. */
.tr-duration-field { display: none; }
.tr-form:has(#training_kind_plank:checked) .tr-reps-field { display: none; }
.tr-form:has(#training_kind_plank:checked) .tr-duration-field { display: block; }
.tr-form:has(#training_kind_other:checked) .tr-duration-field { display: block; }

/* Unified media picker */
.tr-media-input {
  position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0;
}
.tr-media-drop {
  display: block; position: relative; cursor: pointer;
  padding: 18px; border-radius: 14px;
  background: var(--card); border: 1.5px dashed var(--hair);
  transition: border-color .15s ease, background .15s ease;
}
.tr-media-drop:hover { border-color: rgba(160,107,255,0.45); background: rgba(160,107,255,0.04); }
.tr-media-empty {
  display: flex; align-items: center; gap: 12px;
}
.tr-media-ico {
  width: 40px; height: 40px; border-radius: 12px;
  background: rgba(160,107,255,0.12);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tr-media-msg { display: flex; flex-direction: column; gap: 2px; }
.tr-media-msg > span:first-child { font-size: 14px; font-weight: 600; color: var(--text); }
.tr-media-filled {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 600; color: var(--mint);
}
.tr-media-filled .tr-media-count { font-variant-numeric: tabular-nums; }
.tr-media-clear {
  margin-left: auto; padding: 6px 12px; border-radius: 100px;
  background: transparent; border: 1px solid var(--hair);
  color: var(--dim); font-size: 12px; font-weight: 600; cursor: pointer;
}
.tr-media-clear:hover { color: var(--coral); border-color: rgba(255,107,107,0.35); }

/* Share location button */
.tr-location-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 13px 14px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--hair);
  color: var(--text); font-size: 15px; font-weight: 600;
  font-family: inherit; cursor: pointer; text-align: left;
  transition: border-color .15s ease, background .15s ease;
}
.tr-location-btn:hover { border-color: rgba(160,107,255,0.45); }
.tr-location-btn .tr-location-ico { font-size: 20px; line-height: 1; }
.tr-location-btn.loading {
  color: var(--dim); border-color: rgba(160,107,255,0.45);
}
.tr-location-btn.captured {
  color: var(--mint);
  border-color: rgba(93,224,166,0.45);
  background: rgba(93,224,166,0.06);
}

/* Submit area — sticky bottom on mobile */
.tr-actions {
  margin-top: 28px; padding-bottom: 24px;
  display: flex; flex-direction: column; gap: 10px;
}
.tr-submit {
  width: 100%; padding: 16px; border-radius: 14px; border: none;
  background: var(--irisGrad); color: #fff;
  font-family: inherit; font-size: 16px; font-weight: 700; letter-spacing: -0.1px;
  cursor: pointer; box-shadow: 0 10px 24px rgba(160,107,255,0.28);
  transition: transform .12s ease, box-shadow .15s ease;
}
.tr-submit:active { transform: scale(0.985); }
.tr-cancel {
  width: 100%; padding: 14px; border-radius: 14px;
  background: transparent; border: 1px solid var(--hair);
  color: var(--dim); text-align: center; text-decoration: none;
  font-size: 14px; font-weight: 600;
}

/* ═════════ SHARE PAGE (public, no auth) ═════════ */
.share-page {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  background:
    radial-gradient(80% 50% at 50% 0%, rgba(160,107,255,0.12) 0%, transparent 60%),
    radial-gradient(60% 40% at 50% 100%, rgba(93,224,166,0.08) 0%, transparent 60%),
    var(--bg);
}
.share-head {
  padding: calc(var(--safeT) + 18px) 20px 10px;
  display: flex; justify-content: center;
}
.share-brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
  font-size: 15px; font-weight: 700; letter-spacing: -0.2px;
}
.share-brand-logo {
  width: 32px; height: 32px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--irisGrad);
}
.share-brand-name {
  background: linear-gradient(135deg, #F4F1FA 0%, #D0B0FF 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.share-main {
  flex: 1; width: 100%; max-width: 560px; margin: 0 auto;
  padding: 18px 20px 24px; display: flex; flex-direction: column; gap: 16px;
}

.share-card {
  padding: 22px; border-radius: 24px;
  background: var(--card); border: 1px solid var(--hair);
  box-shadow: 0 30px 60px rgba(0,0,0,0.35);
}

.share-owner {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.share-owner-name {
  font-size: 15px; font-weight: 700; color: var(--text);
}
.share-owner-when {
  font-size: 12px; color: var(--dim); margin-top: 2px;
}

.share-title {
  margin: 0 0 16px; font-size: 24px; font-weight: 700;
  letter-spacing: -0.5px; line-height: 1.2; color: var(--text);
}

.share-hero {
  margin: 0 -6px 16px;
  border-radius: 16px; overflow: hidden;
  background: var(--card2); border: 1px solid var(--hair);
  aspect-ratio: 1.1 / 1;
  display: flex; align-items: center; justify-content: center;
}
.share-hero-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.share-hero-fallback {
  background:
    radial-gradient(60% 50% at 50% 30%, rgba(160,107,255,0.25) 0%, rgba(160,107,255,0) 70%),
    var(--card2);
}
.share-hero-big {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.share-hero-emoji { font-size: 56px; line-height: 1; }
.share-hero-number {
  font-size: 80px; font-weight: 700; letter-spacing: -2px;
  line-height: 0.95;
  background: linear-gradient(180deg, #F4F1FA 0%, #D0B0FF 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.share-hero-label {
  font-size: 11px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: var(--dim);
}

.share-stats {
  display: flex; flex-wrap: wrap; gap: 14px 20px;
  padding: 14px 0 0;
  border-top: 1px solid var(--hair);
}
.share-stats > div {
  display: flex; flex-direction: column; gap: 3px;
}
.share-stats .lbl {
  font-size: 9px; font-weight: 700; letter-spacing: 1.1px; color: var(--mute);
}
.share-stats .val {
  font-size: 17px; font-weight: 700; letter-spacing: -0.2px; color: var(--text);
}
.share-stats .u {
  font-size: 11px; color: var(--dim); font-weight: 600; margin-left: 2px;
}

.share-note {
  margin: 14px 0 0; padding: 12px 14px; border-radius: 12px;
  background: rgba(160,107,255,0.08); border: 1px solid rgba(160,107,255,0.20);
  font-size: 14px; color: var(--text); font-style: italic; line-height: 1.45;
}

.share-cta-group { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.share-cta {
  display: flex; align-items: center; justify-content: center;
  padding: 16px; border-radius: 14px; text-decoration: none;
  font-size: 15px; font-weight: 700;
  transition: transform .12s ease, box-shadow .15s ease;
}
.share-cta.primary {
  background: var(--irisGrad); color: #fff;
  box-shadow: 0 10px 24px rgba(160,107,255,0.28);
}
.share-cta.primary:active { transform: scale(0.985); }
.share-cta.secondary {
  background: transparent; color: var(--text);
  border: 1px solid var(--hair);
}
.share-cta-hint {
  margin: 10px 0 0; font-size: 12px; color: var(--dim);
  line-height: 1.5; text-align: center;
}

.share-footer {
  padding: 16px 20px calc(var(--safeB) + 20px);
  text-align: center; font-size: 12px; color: var(--mute);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.share-footer a { color: var(--dim); text-decoration: none; }
.share-footer-dot { opacity: 0.5; }

/* Share button on detail pages */
.share-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 100px;
  background: rgba(160,107,255,0.12); border: 1px solid rgba(160,107,255,0.28);
  color: var(--irisGlow); font-size: 12px; font-weight: 600;
  cursor: pointer; text-decoration: none; font-family: inherit;
}
.share-btn:hover { background: rgba(160,107,255,0.18); }
.share-btn.captured {
  background: rgba(93,224,166,0.12); border-color: rgba(93,224,166,0.30); color: var(--mint);
}

/* Training show page */
.tr-show-gallery {
  display: flex; flex-direction: column; gap: 12px;
  margin: 16px 0 20px;
}
.tr-show-photo, .tr-show-video {
  width: 100%; max-height: 70vh; border-radius: 16px;
  background: var(--card2); object-fit: cover; display: block;
  border: 1px solid var(--hair);
}
.tr-show-video { background: #000; }
.tr-show-actions { margin-top: 28px; display: flex; justify-content: center; }

/* Floating "log training" FAB on activities page */
.tr-log-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 100px;
  background: linear-gradient(135deg, #5DE0A6 0%, #A06BFF 100%);
  color: #0B0A10; font-size: 13px; font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(93,224,166,0.25);
  transition: transform .15s ease, box-shadow .15s ease;
}
.tr-log-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(93,224,166,0.32); }
.tr-log-btn.ghost {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: none;
}
.tr-log-btn.ghost:hover {
  background: rgba(255,255,255,0.10);
  box-shadow: none;
}
.feed-create-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  /* Topbar is now actions-only (sync moved to /profile); push the
     buttons to the right edge of the column so the row mirrors the
     prior layout with the pill on the left, actions on the right. */
  margin-left: auto;
}

/* ═════════ TOGETHER v2 · simplified dashboard ═════════ */
.tg2-hero {
  display: flex; align-items: center; gap: 8px; padding: 18px;
  border-radius: 22px;
  background:
    radial-gradient(60% 50% at 20% 20%, rgba(126,184,255,0.18), transparent 70%),
    radial-gradient(60% 50% at 80% 90%, rgba(255,143,184,0.20), transparent 70%),
    var(--card);
  border: 1px solid var(--hair);
  flex-wrap: wrap;
}
.tg2-hero-av { flex-shrink: 0; text-decoration: none; display: block; }
.tg2-hero-av-wrap {
  position: relative; flex-shrink: 0; line-height: 0;
}
.tg2-hero-heart {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,143,184,0.18); border: 1px solid rgba(255,143,184,0.35);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tg2-hero-matched {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
  font-size: 22px; line-height: 1;
}

/* Pair-emoji badge that sits on the avatar's bottom-right — Instagram-style
   overlap. Also used in the readonly form for the partner's side. */
.tg-emoji-badge {
  position: absolute; right: -4px; bottom: -4px;
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; line-height: 1;
  background: var(--card2);
  border: 2px solid var(--bg);
  color: var(--text);
  cursor: pointer; padding: 0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.35);
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.tg-emoji-badge:hover { transform: scale(1.08); }
.tg-emoji-badge.readonly { cursor: default; }
.tg-emoji-badge.readonly:hover { transform: none; }
.tg-emoji-badge.is-empty {
  background: rgba(160,107,255,0.28);
  color: #fff; font-weight: 700; font-size: 16px;
}
.tg-emoji-badge.is-prompt {
  background: rgba(255,181,71,0.30);
  color: #fff; font-weight: 700; font-size: 14px;
  animation: tg-emoji-pulse 1.6s ease-in-out infinite;
}
.tg-emoji-badge.is-pending {
  box-shadow: 0 0 0 2px rgba(160,107,255,0.35), 0 4px 10px rgba(0,0,0,0.35);
}
@keyframes tg-emoji-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,181,71,0.55), 0 4px 10px rgba(0,0,0,0.35); }
  50%      { box-shadow: 0 0 0 6px rgba(255,181,71,0.00), 0 4px 10px rgba(0,0,0,0.35); }
}

.tg2-hero-status {
  margin-top: 6px; font-size: 12px; color: var(--dim);
}
.tg2-hero-status-link {
  background: transparent; border: 0; padding: 0; margin: 0;
  color: var(--irisGlow); cursor: pointer; font: inherit;
  text-decoration: underline; text-decoration-color: rgba(160,107,255,0.45);
}
.tg2-hero-status-link:hover { color: #fff; text-decoration-color: #fff; }

/* Emoji picker dialog — reuses the tg-sched-dialog chrome */
.tg-emoji-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 4px;
}
.tg-emoji-choice {
  background: var(--bg2); border: 1px solid var(--hair);
  border-radius: 12px; padding: 10px 0;
  font-size: 22px; line-height: 1;
  cursor: pointer;
  transition: transform .1s ease, border-color .1s ease, background .1s ease;
}
.tg-emoji-choice:hover {
  transform: scale(1.06);
  border-color: rgba(160,107,255,0.45);
  background: rgba(160,107,255,0.10);
}
@media (max-width: 420px) {
  .tg-emoji-grid { grid-template-columns: repeat(5, 1fr); }
}

/* Optional one-liner hint attached to an emoji submission. */
.tg-emoji-hint-field {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px;
  padding: 0 12px;
  height: 40px;
  background: var(--bg2);
  border: 1px solid var(--hair);
  border-radius: 12px;
}
.tg-emoji-hint-icon { font-size: 14px; line-height: 1; opacity: 0.8; }
.tg-emoji-hint-input {
  flex: 1;
  background: transparent;
  border: 0; outline: none;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.tg-emoji-hint-input::placeholder { color: var(--dim); }
.tg-emoji-hint-counter {
  font-size: 11px; font-weight: 600; color: var(--dim);
  font-variant-numeric: tabular-nums;
  min-width: 1.5em; text-align: right;
}

/* Hint bubble — used in the picker (partner's hint above the grid) and
   in the hero (own hint while waiting, partner's hint when it's my turn). */
.tg-emoji-hint-bubble {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--bg2);
  border: 1px solid var(--hair);
  font-size: 13px; line-height: 1.35;
}
.tg-emoji-hint-bubble.is-partner {
  border-color: rgba(255,181,71,0.35);
  background: rgba(255,181,71,0.08);
}
.tg-emoji-hint-bubble.is-mine {
  border-color: rgba(160,107,255,0.35);
  background: rgba(160,107,255,0.08);
}
.tg-emoji-hint-who {
  font-size: 10px; font-weight: 700; letter-spacing: 0.6px;
  color: var(--dim); text-transform: uppercase;
  margin-bottom: 2px;
}
.tg-emoji-hint-text { color: var(--text); }
.tg2-hero-body { flex: 1; min-width: 150px; }
.tg2-hero-tag {
  font-size: 10px; font-weight: 700; letter-spacing: 1.2px;
  color: var(--dim);
}
.tg2-hero-names {
  margin-top: 4px; font-size: 18px; font-weight: 700; letter-spacing: -0.3px;
  color: var(--text);
}
.tg2-hero-amp { color: var(--dim); font-weight: 500; margin: 0 4px; }

.tg2-linked-list {
  display: flex; flex-direction: column; gap: 14px; margin-top: 8px;
}

/* Merged card — single card representing a paired moment between two users */
.tg2-linked-merged {
  padding: 18px; border-radius: 20px;
  background:
    radial-gradient(50% 60% at 20% 0%, rgba(126,184,255,0.08), transparent 70%),
    radial-gradient(60% 70% at 100% 100%, rgba(255,143,184,0.10), transparent 70%),
    var(--card);
  border: 1px solid var(--hair);
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}
.tg2-merged-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.tg2-merged-date {
  font-size: 10px; font-weight: 700; letter-spacing: 1.2px;
  color: var(--dim); text-transform: uppercase;
}
.tg2-merged-who {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-bottom: 14px;
}
.tg2-merged-av { text-decoration: none; position: relative; display: inline-flex; }
.tg2-merged-av.mine   { transform: translateX(8px); }
.tg2-merged-av.theirs { transform: translateX(-8px); }
.tg2-merged-join {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,143,184,0.18); border: 1px solid rgba(255,143,184,0.40);
  display: flex; align-items: center; justify-content: center;
  z-index: 1; position: relative;
}

/* Combined hero stat */
.tg2-merged-combined {
  text-align: center; margin: 4px 0 18px;
}
.tg2-merged-big {
  font-size: 42px; font-weight: 700; letter-spacing: -1px;
  line-height: 1.05; color: var(--text);
  background: linear-gradient(135deg, #F4F1FA 0%, #D0B0FF 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.tg2-merged-big .u {
  font-size: 16px; font-weight: 600; color: var(--dim);
  margin-left: 4px; -webkit-text-fill-color: var(--dim);
}
.tg2-merged-sub {
  margin-top: 2px; font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--mute); text-transform: uppercase;
}
.tg2-merged-overlap {
  display: inline-block; margin-top: 10px;
  padding: 4px 10px; border-radius: 100px;
  background: rgba(93,224,166,0.15); color: var(--mint);
  border: 1px solid rgba(93,224,166,0.30);
  font-size: 11px; font-weight: 600;
}

/* Dual timeline */
.tg2-timeline {
  margin-top: 4px; padding: 12px 14px 4px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--hair);
}
.tg2-timeline-scale {
  display: flex; justify-content: space-between;
  font-size: 10px; font-weight: 700; color: var(--mute);
  font-variant-numeric: tabular-nums;
  letter-spacing: 1.2px;
  margin-bottom: 8px;
  padding: 0 100px 0 110px;
}
.tg2-timeline-scale > span:nth-child(2) {
  color: var(--dim); font-weight: 700; letter-spacing: 2px;
}
.tg2-timeline-row {
  display: grid; grid-template-columns: 110px 1fr 80px;
  gap: 10px; align-items: center; padding: 6px 0;
  text-decoration: none; color: inherit;
}
.tg2-timeline-row:hover .tg2-timeline-label,
.tg2-timeline-row:hover .tg2-timeline-meta { color: var(--irisGlow); }
.tg2-timeline-label {
  font-size: 12px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tg2-timeline-track {
  position: relative; height: 10px;
  background: rgba(255,255,255,0.05); border-radius: 5px;
  overflow: visible;
}
.tg2-timeline-bar {
  position: absolute; top: 0; bottom: 0;
  border-radius: 5px;
  display: flex; align-items: center;
  z-index: 1;
}
/* Runblock: each person's timeline row + below-line time & details */
.tg2-runblock {
  padding: 10px 0;
  border-top: 1px dashed var(--hair);
}
.tg2-runblock:first-of-type { border-top: none; padding-top: 4px; }
.tg2-runblock-below {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px 0 2px 110px;
  align-items: center;
}
.tg2-runblock-time {
  font-size: 11px; font-weight: 700; color: var(--dim);
  letter-spacing: 0.2px;
  padding: 3px 10px; border-radius: 100px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--hair);
}
.tg2-runblock-sep { color: var(--mute); margin: 0 4px; font-weight: 400; }
.tg2-detail-chip {
  display: inline-block;
  font-size: 11px; font-weight: 600; color: var(--dim);
  padding: 3px 10px; border-radius: 100px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--hair);
  white-space: nowrap;
}
.tg2-runblock.mine   .tg2-detail-chip { border-color: rgba(126,184,255,0.20); }
.tg2-runblock.theirs .tg2-detail-chip { border-color: rgba(255,143,184,0.20); }
@media (max-width: 560px) {
  .tg2-runblock-below { padding-left: 0; }
}
.tg2-timeline-bar.mine   {
  background: linear-gradient(90deg, rgba(126,184,255,0.55), rgba(126,184,255,0.95));
  box-shadow: 0 0 10px rgba(126,184,255,0.35);
}
.tg2-timeline-bar.theirs {
  background: linear-gradient(90deg, rgba(255,143,184,0.55), rgba(255,143,184,0.95));
  box-shadow: 0 0 10px rgba(255,143,184,0.35);
}
/* Flag-style start / end markers */
.tg2-flag {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  font-size: 14px; line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
  pointer-events: none;
}
.tg2-flag.start { left: 0; }
.tg2-flag.end   { left: 100%; }

/* Overlap band — sits under the bars, shaded mint */
.tg2-overlap-band {
  position: absolute; top: 0; bottom: 0;
  background: repeating-linear-gradient(
    -45deg,
    rgba(93,224,166,0.18) 0 6px,
    rgba(93,224,166,0.08) 6px 12px
  );
  border-radius: 5px;
  z-index: 0;
}
.tg2-timeline-meta {
  font-size: 11px; font-weight: 600; color: var(--dim);
  text-align: right;
}

@media (max-width: 480px) {
  .tg2-timeline-row { grid-template-columns: 1fr; gap: 4px; }
  .tg2-timeline-label { font-size: 13px; }
  .tg2-timeline-meta { text-align: left; }
  .tg2-timeline-scale { padding: 0; }
}

.tg2-linked-note {
  margin-top: 14px; padding: 10px 12px; border-radius: 10px;
  background: rgba(160,107,255,0.08); border: 1px solid rgba(160,107,255,0.20);
  font-size: 13px; color: var(--text); font-style: italic;
}
.tg2-linked-actions { display: flex; justify-content: flex-end; margin-top: 12px; }

.tg2-suggestion-list {
  display: flex; flex-direction: column; gap: 10px; margin-top: 8px;
}
.tg2-suggestion {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: 14px;
  background: var(--card); border: 1px dashed var(--hair);
}
.tg2-suggestion:hover { border-color: rgba(160,107,255,0.45); border-style: solid; }
.tg2-suggestion-date {
  font-size: 10px; font-weight: 700; letter-spacing: 0.8px;
  color: var(--dim); text-transform: uppercase;
  padding: 6px 10px; border-radius: 8px;
  background: rgba(255,255,255,0.04);
}
.tg2-suggestion-sides {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center;
  min-width: 0;
}
.tg2-suggestion-side {
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.tg2-suggestion-plus {
  font-size: 16px; font-weight: 700; color: var(--dim);
}
@media (max-width: 560px) {
  .tg2-suggestion { grid-template-columns: 1fr; }
  .tg2-suggestion-sides { grid-template-columns: 1fr; gap: 6px; }
  .tg2-suggestion-plus { display: none; }
}

/* ═════════ TOGETHER · CHALLENGES ═════════ */
.ch-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 22px 0 10px;
}

/* Compact challenge card (shown on Together dashboard) */
.ch-card-list { display: flex; flex-direction: column; gap: 10px; }
.ch-card {
  display: block; padding: 14px; border-radius: 16px;
  background:
    radial-gradient(70% 50% at 0% 0%, rgba(255,181,71,0.10), transparent 60%),
    var(--card);
  border: 1px solid var(--hair);
  text-decoration: none; color: var(--text);
  transition: border-color .15s ease, transform .1s ease;
}
.ch-card:hover  { border-color: rgba(255,181,71,0.40); }
.ch-card:active { transform: scale(0.995); }

.ch-card-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.ch-card-emoji { font-size: 24px; line-height: 1; }
.ch-card-head-body { flex: 1; min-width: 0; }
.ch-card-title {
  font-size: 15px; font-weight: 700; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ch-card-meta {
  margin-top: 2px; font-size: 11px; color: var(--dim);
}

/* Per-user row — avatar, name, best, full-width track, +/- delta */
.ch-card-user {
  display: grid;
  grid-template-columns: 26px minmax(60px, 90px) 40px 1fr 46px;
  gap: 8px; align-items: center;
  padding: 6px 0;
}
.ch-card-user-name {
  font-size: 12px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ch-card-user-best {
  font-size: 18px; font-weight: 700; letter-spacing: -0.3px;
  color: var(--text); text-align: right;
  line-height: 1;
}
.ch-card-user.mine   .ch-card-user-best { color: #7EB8FF; }
.ch-card-user.theirs .ch-card-user-best { color: #FF8FB8; }
.ch-card-user-track {
  position: relative; height: 8px;
  background: rgba(255,255,255,0.06); border-radius: 4px; overflow: visible;
}
.ch-card-progress-fill {
  height: 100%; border-radius: 4px; transition: width .4s ease;
}
.ch-card-progress-fill.mine   { background: linear-gradient(90deg, #5C8FE8, #7EB8FF); }
.ch-card-progress-fill.theirs { background: linear-gradient(90deg, #D95F8E, #FF8FB8); }
.ch-card-progress-target {
  position: absolute; top: -2px; bottom: -2px; width: 2px;
  background: var(--amber); border-radius: 1px;
}
.ch-card-user-delta {
  font-size: 11px; font-weight: 700; letter-spacing: -0.1px;
  padding: 2px 6px; border-radius: 100px; text-align: center;
}
.ch-card-user-delta.over  { background: rgba(93,224,166,0.15); color: var(--mint); }
.ch-card-user-delta.under { background: rgba(255,181,71,0.15); color: var(--amber); }

@media (max-width: 480px) {
  .ch-card-user {
    grid-template-columns: 26px 1fr 46px;
    row-gap: 4px;
  }
  .ch-card-user-best   { grid-column: 3; }
  .ch-card-user-track  { grid-column: 1 / -1; }
  .ch-card-user-delta  { grid-column: 3; justify-self: end; }
}

.ch-empty {
  display: flex; align-items: center; gap: 14px;
  padding: 16px; border-radius: 14px;
  background: var(--card); border: 1px dashed var(--hair);
}
.ch-empty-emoji { font-size: 32px; }
.ch-empty-title { font-size: 14px; font-weight: 700; color: var(--text); }
.ch-empty-sub   { font-size: 12px; color: var(--dim); margin-top: 2px; line-height: 1.4; }

/* Challenge detail page */
.ch-hero {
  padding: 28px 20px 22px; border-radius: 22px;
  background:
    radial-gradient(70% 60% at 50% 0%, rgba(255,181,71,0.20), transparent 70%),
    radial-gradient(70% 60% at 100% 100%, rgba(160,107,255,0.14), transparent 70%),
    var(--card);
  border: 1px solid var(--hair);
  text-align: center;
}
.ch-hero-kind { font-size: 44px; line-height: 1; margin-bottom: 4px; }

/* Two-up hero — both users' best reps side by side */
.ch-hero-pair {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  align-items: stretch;
  max-width: 440px; margin: 14px auto 6px;
}
.ch-hero-slot {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 10px; border-radius: 16px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--hair);
}
.ch-hero-slot.mine   { border-color: rgba(126,184,255,0.30); }
.ch-hero-slot.theirs { border-color: rgba(255,143,184,0.30); }
.ch-hero-name {
  font-size: 10px; font-weight: 700; letter-spacing: 0.6px;
  color: var(--dim); text-transform: uppercase;
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ch-hero-best {
  font-size: 56px; font-weight: 700; letter-spacing: -2px;
  line-height: 1; color: var(--text);
}
.ch-hero-slot.mine   .ch-hero-best { color: #7EB8FF; }
.ch-hero-slot.theirs .ch-hero-best { color: #FF8FB8; }
.ch-hero-delta {
  padding: 2px 8px; border-radius: 100px;
  font-size: 11px; font-weight: 700; letter-spacing: -0.1px;
}
.ch-hero-delta.over  { background: rgba(93,224,166,0.18); color: var(--mint); }
.ch-hero-delta.under { background: rgba(255,181,71,0.18); color: var(--amber); }

.ch-hero-label {
  margin-top: 10px;
  font-size: 12px; font-weight: 700; letter-spacing: 1.2px;
  color: var(--dim); text-transform: uppercase;
}
/* Dual per-user progress bars with today's-target marker */
.ch-progress-dual {
  margin: 22px auto 0; max-width: 520px;
  display: flex; flex-direction: column; gap: 12px;
}
.ch-progress-row {
  display: grid; grid-template-columns: 110px 1fr 80px; gap: 10px;
  align-items: center;
}
.ch-progress-who {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--text);
  overflow: hidden;
}
.ch-progress-who > span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ch-progress-track {
  position: relative;
  height: 14px; border-radius: 7px;
  background: rgba(255,255,255,0.06);
  overflow: visible;
}
.ch-progress-fill {
  height: 100%; border-radius: 7px;
  transition: width .4s ease;
}
.ch-progress-fill.mine   {
  background: linear-gradient(90deg, #5C8FE8, #7EB8FF);
  box-shadow: 0 0 10px rgba(126,184,255,0.4);
}
.ch-progress-fill.theirs {
  background: linear-gradient(90deg, #D95F8E, #FF8FB8);
  box-shadow: 0 0 10px rgba(255,143,184,0.4);
}
.ch-progress-target {
  position: absolute; top: -3px; bottom: -3px; width: 2px;
  background: var(--amber);
  box-shadow: 0 0 6px rgba(255,181,71,0.7);
  border-radius: 1px;
}
.ch-progress-target::after {
  content: ""; position: absolute; left: -3px; top: -4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--amber);
}
.ch-progress-val {
  font-size: 18px; font-weight: 700; color: var(--text);
  display: flex; flex-direction: column; align-items: flex-end;
  letter-spacing: -0.3px; line-height: 1;
}
.ch-progress-delta {
  margin-top: 4px; font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 100px; letter-spacing: -0.1px;
}
.ch-progress-delta.over  { background: rgba(93,224,166,0.15); color: var(--mint); }
.ch-progress-delta.under { background: rgba(255,181,71,0.15); color: var(--amber); }

.ch-progress-scale {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 90px 0 110px;
  font-size: 11px; font-weight: 600; color: var(--mute);
}
.ch-progress-scale .ch-progress-target-hint {
  color: var(--amber); font-weight: 700;
}
@media (max-width: 560px) {
  .ch-progress-row { grid-template-columns: 90px 1fr 60px; }
  .ch-progress-scale { padding: 0; }
}

.ch-hero-actions {
  margin-top: 22px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}

/* Daily log — each day is a card with both users' actual training previews */
.ch-day-list {
  display: flex; flex-direction: column; gap: 12px; margin-top: 8px;
}
.ch-day {
  padding: 12px 14px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--hair);
}
.ch-day.both-hit {
  border-color: rgba(93,224,166,0.40);
  background:
    radial-gradient(40% 70% at 0% 0%, rgba(93,224,166,0.06), transparent 70%),
    var(--card);
}

.ch-day-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.ch-day-date { display: flex; align-items: baseline; gap: 6px; }
.ch-day-dow { font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; font-size: 10px; color: var(--dim); }
.ch-day-num { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -0.4px; }
.ch-day-mon { font-size: 10px; color: var(--mute); }
.ch-day-target { font-size: 12px; color: var(--dim); }
.ch-day-target .mono-num {
  font-size: 14px; font-weight: 700; color: var(--amber); margin-left: 2px;
}

.ch-day-entries {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
@media (max-width: 560px) {
  .ch-day-entries { grid-template-columns: 1fr; }
}

/* A day entry = one user's training for that day */
.ch-entry {
  display: flex; flex-direction: column; gap: 8px;
  padding: 8px; border-radius: 14px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--hair);
  text-decoration: none; color: var(--text);
  transition: border-color .15s ease, transform .1s ease;
}
.ch-entry.mine   { border-color: rgba(126,184,255,0.18); }
.ch-entry.theirs { border-color: rgba(255,143,184,0.18); }
.ch-entry:hover  { border-color: rgba(160,107,255,0.40); }
.ch-entry:active { transform: scale(0.995); }
.ch-entry.hit { border-color: rgba(93,224,166,0.45); }

.ch-entry-empty {
  flex-direction: row; align-items: center; gap: 10px;
  opacity: 0.55; padding: 14px;
}
.ch-entry-avatar { flex-shrink: 0; }
.ch-entry-who  { font-size: 12px; font-weight: 600; color: var(--text); }
.ch-entry-sub  { font-size: 11px; color: var(--mute); margin-top: 2px; }

.ch-entry-media {
  position: relative;
  width: 100%; aspect-ratio: 1 / 1;
  border-radius: 10px; overflow: hidden;
  background: var(--card2);
}
.ch-entry-video, .ch-entry-photo {
  width: 100%; height: 100%; object-fit: cover; display: block;
  background: #000;
}
.ch-entry-nomedia {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(50% 70% at 50% 30%, rgba(160,107,255,0.18), transparent 70%),
    var(--card2);
  font-size: 48px;
}
.ch-entry-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(0,0,0,0.55); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; backdrop-filter: blur(4px);
  pointer-events: none;
}
.ch-entry-reps {
  position: absolute; top: 8px; left: 8px;
  padding: 6px 12px; border-radius: 100px;
  background: rgba(0,0,0,0.70); color: #fff;
  font-size: 22px; font-weight: 700; letter-spacing: -0.4px;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.ch-entry-reps > span {
  font-size: 13px; font-weight: 500; opacity: 0.6; margin-left: 3px;
}
.ch-entry-check {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--mint);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(93,224,166,0.4);
}

.ch-entry-foot {
  display: flex; align-items: center; gap: 6px; padding: 0 4px 2px;
  font-size: 12px; color: var(--dim);
  overflow: hidden;
}
.ch-entry-foot .ch-entry-who {
  font-size: 12px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ch-entry-note {
  color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ═════════ TOGETHER · create / pending states ═════════ */
.pair-intro {
  text-align: center; padding: 22px 16px 4px;
}
.pair-intro-icon {
  width: 64px; height: 64px; border-radius: 22px; margin: 0 auto 14px;
  background: linear-gradient(135deg, rgba(126,184,255,0.25), rgba(255,143,184,0.25));
  border: 1px solid rgba(255,143,184,0.35);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px rgba(255,143,184,0.15);
}
.pair-intro h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
.pair-intro p  { margin: 6px auto 0; max-width: 420px; font-size: 13px; line-height: 1.55; color: var(--dim); }

.pair-form { margin-top: 4px; }
.pair-choice-radio {
  position: absolute; opacity: 0; pointer-events: none;
}
.pair-choice, .pair-type-card {
  position: relative; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.pair-choice .pair-choice-mark,
.pair-type-card .pair-choice-mark {
  opacity: 0; transition: opacity 0.15s ease;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--irisGrad); color: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.pair-choice:has(.pair-choice-radio:checked) {
  border-color: rgba(160,107,255,0.55);
  background: rgba(160,107,255,0.08);
}
.pair-choice:has(.pair-choice-radio:checked) .pair-choice-mark { opacity: 1; }

.pair-rejected-chip {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 100px;
  background: rgba(255,181,71,0.18); color: var(--amber);
  font-size: 10px; font-weight: 600; letter-spacing: 0.4px;
}

.pair-type-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px;
}
.pair-type-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--hair);
}
.pair-type-card:has(.pair-choice-radio:checked) {
  border-color: rgba(160,107,255,0.55);
  background: rgba(160,107,255,0.1);
}
.pair-type-card .pt-emoji { font-size: 22px; line-height: 1; }
.pair-type-card .pt-body  { flex: 1; min-width: 0; }
.pair-type-card .pt-label { font-size: 14px; font-weight: 700; color: var(--text); }
.pair-type-card .pt-sub   { font-size: 11px; color: var(--dim); margin-top: 2px; }
@media (max-width: 480px) {
  .pair-type-grid { grid-template-columns: 1fr; }
}

.pair-submit-row {
  margin-top: 22px; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.pair-submit-row .pill-btn { min-width: 220px; }
.pair-submit-hint { font-size: 11px; color: var(--mute); }

/* Pending states */
.pair-pending { padding: 24px 12px; display: flex; justify-content: center; }
.pair-pending-card {
  max-width: 460px; width: 100%; padding: 28px 22px;
  border-radius: 24px; text-align: center;
  background: linear-gradient(160deg, rgba(126,184,255,0.1) 0%, rgba(255,143,184,0.1) 100%), var(--card);
  border: 1px solid var(--hair);
  box-shadow: 0 30px 60px rgba(0,0,0,0.35);
}
.pair-pending-avatars {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 14px;
}
.pair-pending-avatars .avatar { width: 56px; height: 56px; font-size: 20px; }
.pair-pending-heart {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,143,184,0.18); border: 1px solid rgba(255,143,184,0.35);
  display: flex; align-items: center; justify-content: center;
}
.pair-pending-tag {
  display: inline-flex; padding: 4px 10px; border-radius: 100px;
  background: rgba(255,181,71,0.15); color: var(--amber);
  font-size: 10px; font-weight: 700; letter-spacing: 1.2px;
}
.pair-pending-card h2 { margin: 12px 0 6px; font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
.pair-pending-card p  { margin: 0 auto 20px; max-width: 380px; font-size: 13px; line-height: 1.55; color: var(--dim); }
.pair-pending-hint {
  margin-top: 6px; padding: 10px 14px; border-radius: 12px;
  background: rgba(255,255,255,0.04); border: 1px dashed var(--hair);
  font-size: 12px; color: var(--mute);
}

/* ═════════ TOGETHER · Schedule Together ═════════ */
.tg-sched-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 22px 0 10px;
}
.tg-sched-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 100px;
  background: var(--irisGrad); color: #fff;
  border: none; cursor: pointer;
  font-size: 13px; font-weight: 700; letter-spacing: 0.1px;
  box-shadow: 0 8px 20px rgba(160,107,255,0.32);
  transition: transform .12s ease, box-shadow .15s ease;
}
.tg-sched-cta:hover  { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(160,107,255,0.40); }
.tg-sched-cta:active { transform: translateY(0); }
.tg-sched-cta-ico { font-size: 16px; line-height: 1; }

.tg-sched-list {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 8px;
}
.tg-sched-empty {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 16px;
  background: var(--card); border: 1px dashed var(--hair);
  margin-bottom: 8px;
}
.tg-sched-empty-ico   { font-size: 26px; line-height: 1; }
.tg-sched-empty-title { font-size: 13px; font-weight: 700; color: var(--text); }
.tg-sched-empty-sub   { font-size: 12px; color: var(--dim); margin-top: 2px; line-height: 1.4; }

/* Feed wrapper around schedule tiles */
.tg-sched-feed {
  margin-bottom: 18px;
  padding: 14px; border-radius: 20px;
  background: linear-gradient(135deg, rgba(160,107,255,0.10), rgba(93,224,166,0.06)), var(--card);
  border: 1px solid rgba(160,107,255,0.20);
}
.tg-sched-feed-cap {
  font-size: 10px; font-weight: 700; letter-spacing: 1.4px;
  color: var(--iris); text-transform: uppercase;
  margin-bottom: 10px;
}
.tg-sched-feed .tg-sched-tile { background: rgba(255,255,255,0.02); }
.tg-sched-feed .tg-sched-tile + .tg-sched-tile { margin-top: 10px; }

/* A single schedule tile */
.tg-sched-tile {
  padding: 14px;
  border-radius: 16px;
  background: var(--card); border: 1px solid var(--hair);
  display: flex; flex-direction: column; gap: 10px;
}
.tg-sched-tile.pending.invitee  { border-color: rgba(160,107,255,0.45); }
.tg-sched-tile.accepted          { border-color: rgba(93,224,166,0.40); }
.tg-sched-tile-head {
  display: flex; align-items: center; gap: 12px;
}
.tg-sched-tile-emoji {
  width: 44px; height: 44px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(160,107,255,0.14); font-size: 22px;
}
.tg-sched-tile-body { flex: 1; min-width: 0; }
.tg-sched-tile-kind {
  font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -0.1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tg-sched-tile-when {
  font-size: 12px; color: var(--dim); margin-top: 2px;
  display: flex; align-items: center; gap: 6px;
}
.tg-sched-tile-day  { font-weight: 600; color: var(--text); }
.tg-sched-tile-dot  { color: var(--mute); }
.tg-sched-tile-time { color: var(--text); }

.tg-sched-tile-status {
  font-size: 11px; font-weight: 700; letter-spacing: 0.3px;
  padding: 6px 10px; border-radius: 100px;
  background: var(--bg2); color: var(--dim);
  white-space: nowrap;
}
.tg-sched-tile-status.pending  { background: rgba(255,181,71,0.14); color: var(--amber); }
.tg-sched-tile-status.accepted { background: rgba(93,224,166,0.18); color: var(--mint); }

.tg-sched-tile-who {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--dim);
  flex-wrap: wrap;
}
.tg-sched-tile-who > span { color: var(--text); font-weight: 600; }
.tg-sched-tile-arr { color: var(--mute); margin: 0 2px; }

.tg-sched-tile-note {
  font-size: 13px; color: var(--dim); line-height: 1.45;
  padding: 10px 12px; border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--hair);
}

.tg-sched-tile-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
}

/* Native <dialog> styling */
.tg-sched-dialog {
  border: none; padding: 0;
  background: transparent;
  color: var(--text);
  max-width: 440px; width: 92vw;
  border-radius: 22px;
  box-shadow: 0 40px 120px rgba(0,0,0,0.6), 0 0 0 1px var(--hairStrong);
  overflow: visible;
}
.tg-sched-dialog::backdrop {
  background: rgba(11,10,16,0.72);
  backdrop-filter: blur(6px);
}
.tg-sched-form {
  background: var(--card);
  border-radius: 22px;
  padding: 18px 18px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.tg-sched-form-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 4px;
}
.tg-sched-form-title { font-size: 17px; font-weight: 700; color: var(--text); }
.tg-sched-form-sub   { font-size: 12px; color: var(--dim); margin-top: 2px; }
.tg-sched-close {
  background: transparent; border: none; cursor: pointer;
  color: var(--dim); font-size: 18px; line-height: 1;
  width: 32px; height: 32px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
}
.tg-sched-close:hover { color: var(--text); background: var(--card2); }

.tg-sched-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.2px;
  color: var(--mute); text-transform: uppercase;
  margin-top: 4px;
}
.tg-sched-input {
  padding: 12px 14px; border-radius: 12px;
  background: var(--bg2); border: 1px solid var(--hair);
  color: var(--text); font-size: 15px; /* prevents iOS zoom */
  font-family: inherit; outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.tg-sched-input:focus {
  border-color: rgba(160,107,255,0.55);
  box-shadow: 0 0 0 3px rgba(160,107,255,0.18);
}
.tg-sched-select { appearance: none; cursor: pointer; }

.tg-sched-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px;
}

/* ═════════ NOTIFICATIONS INBOX ═════════ */

.notif-section { margin-bottom: 22px; }
.notif-section-cap {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--mute);
  padding: 0 4px 8px;
}

.notif-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: 14px;
  background: var(--bg2); border: 1px solid var(--hair);
  margin-bottom: 6px; text-decoration: none; color: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.notif-row:hover { background: rgba(160,107,255,0.08); border-color: rgba(160,107,255,0.35); }
.notif-row.unread {
  background: rgba(160,107,255,0.10);
  border-color: rgba(160,107,255,0.30);
}

.notif-row-actor { position: relative; flex-shrink: 0; }
.notif-row-emoji {
  position: absolute; right: -4px; bottom: -4px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--bg2); border: 1px solid var(--hair);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; line-height: 1;
}

.notif-row-body { flex: 1; min-width: 0; }
.notif-row-title { font-size: 14px; color: #fff; line-height: 1.35; }
.notif-row-sub {
  margin-top: 2px; font-size: 13px; color: var(--mute); line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.notif-row-meta { margin-top: 4px; font-size: 11px; color: var(--mute); }

.notif-row-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--iris); flex-shrink: 0;
}

.notif-empty {
  padding: 40px 16px; text-align: center; border-radius: 16px;
  background: var(--bg2); border: 1px solid var(--hair);
}
.notif-empty-icon { font-size: 36px; margin-bottom: 8px; }
.notif-empty-title { font-size: 16px; color: #fff; font-weight: 600; }
.notif-empty-body { margin-top: 6px; font-size: 13px; color: var(--mute); }

.notif-clear-form { margin: 0; }
.notif-clear-btn {
  background: transparent; color: var(--iris);
  border: 1px solid rgba(160,107,255,0.4); border-radius: 999px;
  padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.notif-clear-btn:hover { background: rgba(160,107,255,0.10); }


/* ---------------------------------------------------------------- */
/*  Weekly Activity Chart (.wac-*)                                   */
/*  Web counterpart of iOS WeeklyActivityChart. Renders on /feed     */
/*  (viewer's own data) and /u/:handle (profile owner's data).       */
/* ---------------------------------------------------------------- */

.wac-card {
  margin-bottom: 14px; padding: 16px;
  border-radius: 20px; background: var(--card); border: 1px solid var(--hair);
}

.wac-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.wac-head-label {
  font-size: 11px; font-weight: 700; letter-spacing: 1.4px;
  color: var(--text); text-transform: uppercase;
}
.wac-head-month {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: 1.4px;
  color: var(--mute); text-transform: uppercase;
}
.wac-head-month-cap { color: var(--mute); }
.wac-head-month-val {
  color: var(--iris); font-size: 14px; letter-spacing: -0.2px;
  font-variant-numeric: tabular-nums;
}

.wac-pills {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px;
}
.wac-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--card2); color: var(--dim);
  border: 1px solid var(--hair);
  font-size: 11px; font-weight: 700; letter-spacing: 1.2px;
  cursor: pointer; transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.wac-pill:hover { color: var(--text); border-color: rgba(160,107,255,0.35); }
.wac-pill.is-active {
  background: var(--iris); color: #fff;
  border-color: var(--iris);
  box-shadow: 0 0 10px rgba(160,107,255,0.35);
}
.wac-pill-emoji { font-size: 13px; line-height: 1; }
.wac-pill-label { letter-spacing: 1.2px; }

.wac-chart {
  width: 100%;
  min-height: 120px;
}
/* `display: flex` on .wac-chart would override the HTML `hidden`
   attribute Stimulus toggles when switching kinds — the chart node
   stays `display: flex` and all four kinds render at once. Block-level
   is enough for the SVG to fill width 100%, and `[hidden]` keeps its
   default `display: none` semantics. */
.wac-chart[hidden] { display: none; }
.wac-svg { width: 100%; height: auto; display: block; }

.wac-grid { stroke: rgba(244,241,250,0.08); stroke-width: 1; }
.wac-axis-y {
  fill: var(--mute);
  font-size: 8px; font-weight: 600; letter-spacing: 0.4px;
  font-family: ui-sans-serif, system-ui, sans-serif;
}
.wac-axis-x {
  fill: var(--mute);
  font-size: 8px; font-weight: 600; letter-spacing: 0.4px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  text-transform: uppercase;
}

.wac-bar { fill: rgba(160,107,255,0.55); }
.wac-bar.is-current {
  fill: var(--irisGlow);
  filter: drop-shadow(0 0 4px rgba(208,176,255,0.5));
}
.wac-bar-empty { fill: rgba(244,241,250,0.10); }

.wac-bar-annot {
  fill: var(--text);
  font-size: 8px; font-weight: 700; letter-spacing: 0.4px;
  font-variant-numeric: tabular-nums;
  font-family: ui-sans-serif, system-ui, sans-serif;
}

.wac-empty {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 120px;
  color: var(--mute); font-size: 12px; text-align: center;
}

/* ---------------------------------------------------------------- */
/*  Custom-activity strip (.wac-tk-*)                                */
/*  Sits below the WeeklyActivityChart on /feed and /u/:handle.      */
/*  One tile per Training kind (excluding yoga, which has its own    */
/*  pill in the upper widget) the user has logged in 12 weeks.       */
/* ---------------------------------------------------------------- */

.wac-tk-card {
  margin-bottom: 14px; padding: 16px;
  border-radius: 20px; background: var(--card); border: 1px solid var(--hair);
}

.wac-tk-cap {
  font-size: 11px; font-weight: 700; letter-spacing: 1.4px;
  color: var(--mute); text-transform: uppercase;
  margin-bottom: 12px;
}

.wac-tk-row {
  display: flex; gap: 10px; flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(160,107,255,0.35) transparent;
  padding-bottom: 4px;
}
.wac-tk-row::-webkit-scrollbar { height: 6px; }
.wac-tk-row::-webkit-scrollbar-track { background: transparent; }
.wac-tk-row::-webkit-scrollbar-thumb {
  background: rgba(160,107,255,0.35); border-radius: 3px;
}

.wac-tk-tile {
  flex: 0 0 auto;
  width: 144px;
  padding: 12px;
  border-radius: 14px;
  background: var(--card2);
  border: 1px solid var(--hair);
  display: flex; flex-direction: column; gap: 6px;
}

.wac-tk-head {
  display: flex; align-items: center; gap: 6px;
}
.wac-tk-emoji { font-size: 18px; line-height: 1; }
.wac-tk-label {
  font-size: 11px; font-weight: 700; letter-spacing: 1.2px;
  color: var(--text); text-transform: uppercase;
}

.wac-tk-stat {
  font-size: 16px; font-weight: 700; letter-spacing: -0.2px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.wac-tk-sub {
  font-size: 10px; font-weight: 600; letter-spacing: 0.6px;
  color: var(--mute); text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.wac-tk-spark {
  width: 100%; height: 28px; display: block; margin-top: 4px;
}
.wac-tk-bar { fill: rgba(160,107,255,0.55); }
.wac-tk-bar.is-current {
  fill: var(--irisGlow);
  filter: drop-shadow(0 0 3px rgba(208,176,255,0.5));
}
.wac-tk-bar-empty { fill: rgba(244,241,250,0.10); }
