@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700;800;900&family=Archivo+Black&family=IBM+Plex+Mono:wght@400;500;600;700&display=swap');

:root{
  --ground:#F4F3EF; --surface:#FFFFFF; --surface2:#F0EFEA; --line:rgba(20,20,18,0.12);
  --ink:#15171A; --ink-dim:#5B5F66; --ink-faint:#8A8F97;
  --accent:#B5501E; --accent-2:#7A3410; --gold:#B5501E; --blue:#2F6FE0; --green:#2E8B4F; --red:#D14343; --amber:#C08A1E; --purple:#7A4FD1;
  --glow: 181,80,30;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --ground:#0B0D10; --surface:#15181D; --surface2:#1B1F25; --line:rgba(255,255,255,0.11);
    --ink:#F6F7F5; --ink-dim:#9BA1A8; --ink-faint:#6A7078;
    --accent:#FFC24E; --accent-2:#FF8A3D; --gold:#FFC24E; --blue:#4E9BFF; --green:#6FD46A; --red:#FF6B6B; --amber:#FFB454; --purple:#B497FF;
    --glow: 255,194,78;
  }
}
:root[data-theme="dark"]{
  --ground:#0B0D10; --surface:#15181D; --surface2:#1B1F25; --line:rgba(255,255,255,0.11);
  --ink:#F6F7F5; --ink-dim:#9BA1A8; --ink-faint:#6A7078;
  --accent:#FFC24E; --accent-2:#FF8A3D; --gold:#FFC24E; --blue:#4E9BFF; --green:#6FD46A; --red:#FF6B6B; --amber:#FFB454; --purple:#B497FF;
  --glow: 255,194,78;
}
*{box-sizing:border-box;}
html,body{margin:0; padding:0; background:var(--ground); color:var(--ink); font-family:'Archivo',sans-serif;}
a{color:inherit;}
.mono{font-family:'IBM Plex Mono',monospace;}
.wrap{max-width:920px; margin:0 auto; padding:0 20px 80px;}
.nav{display:flex; align-items:center; justify-content:space-between; padding:18px 20px; border-bottom:1px solid var(--line); background:var(--surface); position:sticky; top:0; z-index:10;}
.nav .brand{font-family:'Archivo Black',sans-serif; font-size:20px; letter-spacing:-0.01em; text-decoration:none;}
.nav .links{display:flex; gap:4px; align-items:center; flex-wrap:wrap;}
.nav a.link{font-family:'IBM Plex Mono',monospace; font-size:13px; text-transform:uppercase; letter-spacing:0.04em; color:var(--ink-dim); text-decoration:none; padding:8px 12px; border-radius:10px;}
.nav a.link:hover{background:var(--surface2); color:var(--ink);}
.nav a.link.active{color:var(--ink); background:var(--surface2);}
h1{font-family:'Archivo Black',sans-serif; font-size:34px; letter-spacing:-0.01em; margin:28px 0 6px;}
h2{font-family:'Archivo',sans-serif; font-weight:800; font-size:20px; margin:0 0 12px; display:flex; align-items:center; gap:10px;}
p.lede{color:var(--ink-dim); font-size:16px; margin:0 0 24px;}
.card{background:var(--surface); border:1px solid var(--line); border-radius:20px; padding:22px 24px; margin-bottom:16px;}
.grid{display:grid; gap:14px;}
.grid.cols-2{grid-template-columns:1fr 1fr;}
.grid.cols-4{grid-template-columns:repeat(4,1fr);}
.grid.cols-5{grid-template-columns:repeat(5,1fr);}
@media (max-width:640px){ .grid.cols-2, .grid.cols-4, .grid.cols-5{grid-template-columns:1fr 1fr;} }
.stat .k{font-family:'IBM Plex Mono',monospace; font-size:12px; color:var(--ink-faint); text-transform:uppercase; letter-spacing:0.06em; margin-bottom:6px;}
.stat .v{font-family:'Archivo',sans-serif; font-weight:800; font-size:26px;}
.stat .v .u{font-size:13px; font-weight:600; color:var(--ink-dim); margin-left:2px;}
label{display:block; font-family:'IBM Plex Mono',monospace; font-size:12px; text-transform:uppercase; letter-spacing:0.05em; color:var(--ink-faint); margin:14px 0 6px;}
input, select, textarea{width:100%; background:var(--surface2); border:1px solid var(--line); border-radius:10px; padding:11px 12px; color:var(--ink); font-family:'Archivo',sans-serif; font-size:15px;}
textarea{resize:vertical; min-height:80px;}
button, .btn{display:inline-block; background:linear-gradient(155deg, var(--accent), var(--accent-2)); color:#15171A; border:none; border-radius:12px; padding:12px 20px; font-family:'Archivo',sans-serif; font-weight:800; font-size:14px; cursor:pointer; text-decoration:none; text-align:center; box-shadow:0 10px 24px -12px rgba(var(--glow),0.65), inset 0 1px 0 rgba(255,255,255,0.35); transition:transform .18s ease, box-shadow .18s ease;}
button:hover, .btn:hover{transform:translateY(-1px); box-shadow:0 14px 30px -12px rgba(var(--glow),0.8), inset 0 1px 0 rgba(255,255,255,0.35);}
button:active, .btn:active{transform:translateY(0px);}
button.ghost, .btn.ghost{background:transparent; color:var(--ink); border:1px solid var(--line); box-shadow:none;}
button.ghost:hover, .btn.ghost:hover{border-color:rgba(var(--glow),0.5); box-shadow:0 8px 18px -12px rgba(var(--glow),0.4);}
button.danger{background:linear-gradient(155deg, var(--red), #a02f2f); color:#fff; box-shadow:0 10px 24px -12px rgba(209,67,67,0.55), inset 0 1px 0 rgba(255,255,255,0.25);}
.row{display:flex; gap:10px; flex-wrap:wrap; align-items:center;}
.pill{display:inline-flex; align-items:center; gap:6px; font-family:'IBM Plex Mono',monospace; font-size:11px; text-transform:uppercase; letter-spacing:0.05em; background:var(--surface2); border:1px solid var(--line); border-radius:999px; padding:5px 11px; color:var(--ink-dim);}
.pill .dot{width:7px; height:7px; border-radius:50%; background:var(--gold);}
.list-item{display:flex; justify-content:space-between; align-items:center; padding:14px 0; border-bottom:1px solid var(--line); text-decoration:none; color:inherit;}
.list-item:last-child{border-bottom:none;}
.list-item .t{font-weight:700; font-size:16px;}
.list-item .d{font-size:13px; color:var(--ink-faint); font-family:'IBM Plex Mono',monospace; margin-top:3px;}
.btn.xs{padding:7px 12px; font-size:12px; border-radius:9px; display:inline-flex; align-items:center; gap:6px; flex-shrink:0;}
.btn.xs .icon-svg{width:13px; height:13px;}
.activity-row{gap:14px;}
.activity-row-link{display:flex; justify-content:space-between; align-items:center; gap:14px; flex:1; min-width:0; text-decoration:none; color:inherit;}
@media (max-width:640px){ .activity-row{flex-wrap:wrap;} .activity-row-link{width:100%;} }
.err{background:rgba(209,67,67,0.12); border:1px solid var(--red); color:var(--red); border-radius:10px; padding:10px 14px; font-size:14px; margin-bottom:14px;}
.ok{background:rgba(46,139,79,0.12); border:1px solid var(--green); color:var(--green); border-radius:10px; padding:10px 14px; font-size:14px; margin-bottom:14px;}
.bars{display:flex; align-items:flex-end; gap:6px; height:120px; margin-top:10px;}
.bars .bar{flex:1; background:linear-gradient(180deg, var(--blue), var(--gold)); border-radius:5px 5px 2px 2px; position:relative; transition:opacity .12s ease, filter .12s ease;}
.bars .bar .lbl{position:absolute; bottom:-20px; left:0; right:0; text-align:center; font-family:'IBM Plex Mono',monospace; font-size:10px; color:var(--ink-faint);}
.bars .bar-km{cursor:pointer; outline:none;}
.bars:has(.bar-km:hover) .bar-km:not(:hover){opacity:.45;}
.bars:has(.bar-km.show-tip) .bar-km:not(.show-tip){opacity:.45;}
.bars .bar-km:hover, .bars .bar-km.show-tip{filter:brightness(1.12);}
.bars .bar-km .bar-tip{position:absolute; bottom:calc(100% + 10px); left:50%; transform:translateX(-50%) translateY(4px); background:var(--surface2); border:1px solid var(--line); border-radius:12px; padding:10px 13px; min-width:136px; box-shadow:0 14px 28px -12px rgba(0,0,0,0.5); opacity:0; visibility:hidden; pointer-events:none; transition:opacity .12s ease, transform .12s ease; z-index:5;}
.bars .bar-km .bar-tip::after{content:''; position:absolute; top:100%; left:50%; transform:translateX(-50%); border:5px solid transparent; border-top-color:var(--surface2);}
.bars .bar-km .bar-tip-title{font-family:'IBM Plex Mono',monospace; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:0.05em; color:var(--accent); margin-bottom:6px; white-space:nowrap;}
.bars .bar-km .bar-tip-row{display:flex; justify-content:space-between; align-items:baseline; gap:16px; font-size:12px; color:var(--ink-dim); padding:2px 0; white-space:nowrap;}
.bars .bar-km .bar-tip-row strong{color:var(--ink); font-family:'IBM Plex Mono',monospace; font-weight:700;}
.bars .bar-km:hover .bar-tip, .bars .bar-km:focus-visible .bar-tip, .bars .bar-km.show-tip .bar-tip{opacity:1; visibility:visible; transform:translateX(-50%) translateY(0);}
@media (max-width:640px){ .bars .bar-km .bar-tip{font-size:11px; padding:8px 11px; min-width:118px;} }
.auth-box{max-width:400px; margin:60px auto; padding:0 20px;}
.center-logo{font-family:'Archivo Black',sans-serif; font-size:26px; text-align:center; margin-bottom:24px;}
.muted{color:var(--ink-faint); font-size:13px;}
.muted strong{color:var(--ink); font-weight:700;}
.post{padding:18px 0; border-bottom:1px solid var(--line);}
.post .who{font-weight:800; font-size:14px;}
.post .when{font-size:12px; color:var(--ink-faint); font-family:'IBM Plex Mono',monospace;}
.post .body{margin-top:8px; font-size:15px; line-height:1.5;}
.ai-box{background:var(--surface2); border-left:3px solid var(--accent); border-radius:8px; padding:16px 18px; margin-top:14px; font-size:14px; line-height:1.6; white-space:pre-wrap;}
.chat{display:flex; flex-direction:column; gap:12px;}
.chat-msg{max-width:82%; padding:12px 16px; border-radius:14px; font-size:14px; line-height:1.55; white-space:pre-wrap;}
.chat-msg.assistant{background:var(--surface2); border-left:3px solid var(--accent); align-self:flex-start; border-radius:4px 14px 14px 14px;}
.chat-msg.user{background:var(--accent); color:#15171A; align-self:flex-end; border-radius:14px 4px 14px 14px;}
.chat-empty{color:var(--ink-faint); font-size:14px; margin:0;}
.chat-suggestions{display:flex; flex-wrap:wrap; gap:8px; margin-top:14px;}
.chat-suggestion-chip{display:inline-block; width:auto; background:var(--surface2); color:var(--ink-dim); border:1px solid var(--line); box-shadow:none; border-radius:999px; padding:9px 14px; font-size:12.5px; font-weight:600; text-align:left; cursor:pointer; transition:border-color .15s ease, color .15s ease;}
.chat-suggestion-chip:hover{color:var(--ink); border-color:var(--accent); transform:none; box-shadow:none;}

/* ---------- micro-interactions ---------- */
.card{transition: opacity .6s cubic-bezier(.2,.7,.3,1), transform .35s cubic-bezier(.2,.7,.3,1), box-shadow .35s ease, border-color .35s ease;}
.card:hover{box-shadow:0 18px 44px -14px rgba(var(--glow),0.22), 0 8px 20px -10px rgba(0,0,0,0.18); border-color:rgba(var(--glow),0.35);}

/* ---------- icon system (glossy "3D" badges, no external icon lib) ---------- */
.icon-svg{width:100%; height:100%; display:block; filter:drop-shadow(0 2px 3px rgba(0,0,0,0.28));}
.icon-badge{width:46px; height:46px; border-radius:14px; display:flex; align-items:center; justify-content:center; padding:10px;
  background:linear-gradient(150deg, var(--surface2), var(--surface));
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.55), inset 0 -3px 5px rgba(0,0,0,0.14), 0 8px 18px -8px rgba(var(--glow),0.35);
  margin-bottom:14px;}
.h-icon{width:30px; height:30px; border-radius:10px; display:inline-flex; align-items:center; justify-content:center; padding:6px; flex-shrink:0;
  background:linear-gradient(150deg, var(--surface2), var(--surface));
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.5), inset 0 -2px 3px rgba(0,0,0,0.14), 0 4px 10px -6px rgba(var(--glow),0.4);}

/* ---------- hero badge (spinning shoe token, parallaxes with the cursor) ---------- */
.hero-badge{position:absolute; top:26px; right:26px; z-index:3; width:76px; height:76px; border-radius:22px;
  display:flex; align-items:center; justify-content:center; padding:18px;
  background:linear-gradient(150deg, rgba(255,255,255,0.16), rgba(255,255,255,0.02));
  backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px);
  border:1px solid rgba(255,255,255,0.2);
  box-shadow:0 22px 44px -16px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.28);
  transition:transform .18s ease-out; will-change:transform;}
.hero-badge .icon-svg{filter:drop-shadow(0 6px 10px rgba(0,0,0,0.45));}
.hero-badge-glow{position:absolute; inset:-55%; border-radius:50%; background:radial-gradient(circle, rgba(var(--glow),0.4), transparent 70%); filter:blur(14px); z-index:-1;}
@media (max-width:640px){ .hero-badge{width:58px; height:58px; top:16px; right:16px; padding:14px;} }

/* ---------- hero ---------- */
.hero{position:relative; border-radius:26px; overflow:hidden; margin:24px 0 20px; min-height:280px; display:flex; align-items:flex-end; background:linear-gradient(160deg, #1c1006 0%, #2a1608 55%, #150c05 100%);}
.hero canvas{position:absolute; inset:0; width:100%; height:100%; display:block;}
.hero-overlay{position:absolute; inset:0; background:linear-gradient(180deg, rgba(10,8,6,0.05) 0%, rgba(10,8,6,0.78) 100%); pointer-events:none;}
.hero-content{position:relative; z-index:2; padding:32px 30px 28px; color:#fff; width:100%;}
.hero-eyebrow{font-family:'IBM Plex Mono',monospace; font-size:11px; text-transform:uppercase; letter-spacing:0.12em; color:#FFC24E; margin-bottom:10px;}
.hero-content h1{margin:0 0 6px; color:#fff; text-shadow:0 2px 20px rgba(0,0,0,0.4);}
.hero-content .lede{color:rgba(255,255,255,0.8); margin:0;}
.hero-bio{color:rgba(255,255,255,0.62); font-size:14px; line-height:1.5; margin:10px 0 0; max-width:520px;}
.hero-bio-empty a{color:#FFC24E; text-decoration:none;}
.hero-bio-empty a:hover{text-decoration:underline;}
@media (max-width:640px){ .hero{min-height:220px;} .hero-content{padding:22px 18px 20px;} }

/* ---------- collapsible trainings ---------- */
details.trn{border-bottom:1px solid var(--line); padding:4px 0;}
details.trn:last-child{border-bottom:none;}
details.trn summary{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 2px; cursor:pointer; list-style:none;}
details.trn summary::-webkit-details-marker{display:none;}
details.trn summary::before{content:'+'; font-family:'IBM Plex Mono',monospace; font-weight:700; color:var(--accent); font-size:16px; margin-right:10px; width:16px; text-align:center; display:inline-block;}
details.trn[open] summary::before{content:'–';}
.trn-main{display:flex; flex-direction:column; gap:2px;}
.trn-main .t{font-weight:700; font-size:15px;}
.trn-main .d{font-size:12px; color:var(--ink-faint); font-family:'IBM Plex Mono',monospace;}
.trn-body{padding:2px 2px 16px 26px; display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px;}
.trn-stats{display:flex; gap:18px; flex-wrap:wrap; font-family:'IBM Plex Mono',monospace; font-size:13px; color:var(--ink-dim);}
.trn-stats strong{color:var(--ink); font-size:15px; margin-right:3px;}

/* ---------- ai analysis (rich) ---------- */
.ai-analysis{background:var(--surface2); border-left:3px solid var(--accent); border-radius:8px; padding:18px 22px; margin-top:14px; font-size:14px; line-height:1.65;}
.ai-analysis h3{font-family:'Archivo',sans-serif; font-weight:800; font-size:13px; text-transform:uppercase; letter-spacing:0.04em; color:var(--accent); margin:18px 0 8px;}
.ai-analysis h3:first-child{margin-top:0;}
.ai-analysis p{margin:0 0 10px;}
.ai-analysis ul{margin:0 0 10px; padding-left:20px;}
.ai-analysis li{margin-bottom:6px;}
.ai-analysis strong{color:var(--ink); font-weight:700;}

/* ---------- nearby races ---------- */
.race-ext{display:flex; justify-content:space-between; align-items:center; gap:14px; padding:14px 0; border-bottom:1px solid var(--line);}
.race-ext:last-child{border-bottom:none;}
.race-ext-main{display:flex; align-items:center; gap:12px; min-width:0;}
.race-ext-icon{width:26px; height:26px; padding:5px;}
.race-ext .t{font-weight:700; font-size:15px;}
.race-ext .d{font-size:12px; color:var(--ink-faint); font-family:'IBM Plex Mono',monospace; margin-top:3px;}
.race-dists{display:flex; gap:5px; flex-wrap:wrap; justify-content:flex-end;}
.race-dist{font-family:'IBM Plex Mono',monospace; font-size:11px; background:var(--surface); border:1px solid var(--line); border-radius:999px; padding:4px 9px; color:var(--ink-dim);}
.race-source{font-size:11px; color:var(--ink-faint); margin-top:10px;}

/* ---------- nearby race quick-add ---------- */
.race-ext-actions{display:flex; flex-direction:column; align-items:flex-end; gap:8px;}
.race-ext-actions form{margin:0;}
.race-ext-actions button{padding:7px 14px; font-size:12px;}
.race-ext-buttons{display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end;}

/* ---------- nearby races region picker ---------- */
.race-region-head{display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; margin-bottom:14px;}
.race-region-head h2{margin:0;}
.race-region-form{display:flex; align-items:center; gap:8px; flex-wrap:wrap;}
.race-region-form select, .race-region-form input[type=text]{background:var(--surface); border:1px solid var(--line); border-radius:9px; color:var(--ink); padding:8px 10px; font-size:12px; font-family:'Archivo',sans-serif;}
.race-region-form input[type=text]{width:160px;}
.race-region-form button{padding:7px 12px; font-size:12px;}

/* ---------- dashboard month calendar ---------- */
.cal-card{overflow:hidden;}
.cal-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:14px;}
.cal-nav{display:flex; gap:8px;}
.cal-nav .btn{padding:7px 14px; font-size:13px;}
.cal-grid{display:flex; flex-direction:column; gap:4px;}
.cal-row{display:grid; grid-template-columns:repeat(7,1fr); gap:4px;}
.cal-row.dow{margin-bottom:2px;}
.cal-cell{position:relative; aspect-ratio:1/1; border-radius:10px; background:var(--surface2); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; font-family:'IBM Plex Mono',monospace;}
.cal-cell.empty{background:transparent;}
.cal-cell.dow{background:transparent; color:var(--ink-faint); font-size:11px; text-transform:uppercase; letter-spacing:0.04em; aspect-ratio:auto; padding:2px 0;}
.cal-cell.today{box-shadow:inset 0 0 0 2px var(--accent);}
.cal-daynum{font-size:12px; color:var(--ink-dim); font-weight:600;}
.cal-dots{display:flex; gap:3px; height:6px;}
.cal-dot{width:6px; height:6px; border-radius:50%; display:inline-block;}
.cal-dot.dot-training{background:var(--blue);}
.cal-dot.dot-race{background:var(--gold);}
.cal-legend{display:flex; gap:18px; margin-top:14px; font-size:12px; color:var(--ink-faint); align-items:center;}
.cal-legend span{display:flex; align-items:center; gap:6px;}
.cal-cell.has-data{cursor:pointer; transition:background .15s ease;}
.cal-cell.has-data:hover{background:var(--surface);}
@media (max-width:640px){ .cal-daynum{font-size:10px;} .cal-cell{border-radius:8px;} }

.cal-modal-backdrop{position:fixed; inset:0; background:rgba(0,0,0,0.55); display:none; align-items:center; justify-content:center; z-index:200; padding:20px;}
.cal-modal-backdrop.open{display:flex;}
.cal-modal{background:var(--surface); border:1px solid var(--line); border-radius:18px; padding:22px 24px; max-width:420px; width:100%; max-height:80vh; overflow-y:auto;}
.cal-modal-head{display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px;}
.cal-modal-head h3{margin:0; font-size:17px; font-weight:800; font-family:'Archivo',sans-serif;}
.cal-modal-close{background:none; border:none; color:var(--ink-faint); font-size:22px; line-height:1; cursor:pointer; padding:2px 6px; border-radius:8px;}
.cal-modal-close:hover{background:var(--surface2); color:var(--ink);}
.cal-modal-item{display:block; background:var(--surface2); border:1px solid var(--line); border-left:3px solid var(--blue); border-radius:12px; padding:12px 14px; margin-bottom:10px; text-decoration:none; color:var(--ink);}
.cal-modal-item:last-child{margin-bottom:0;}
.cal-modal-item:hover{border-color:var(--accent); border-left-color:var(--accent);}
.cal-modal-item.cal-modal-race{border-left-color:var(--gold);}
.cal-modal-item .t{font-weight:700; font-size:14px; margin-bottom:3px;}
.cal-modal-item .d{font-size:12px; color:var(--ink-faint); font-family:'IBM Plex Mono',monospace; text-transform:uppercase; letter-spacing:0.03em;}
.cal-modal-empty{color:var(--ink-faint); font-size:13px; margin:0;}

/* ---------- activity detail: editable title ---------- */
.title-edit-toggle{margin:28px 0 6px;}
.title-edit-toggle summary{display:flex; align-items:center; gap:10px; cursor:pointer; list-style:none; width:fit-content;}
.title-edit-toggle summary::-webkit-details-marker{display:none;}
.title-edit-toggle summary h1{margin:0;}
.title-edit-toggle .title-edit-icon{width:18px; height:18px; color:var(--ink-faint); flex-shrink:0; opacity:0; transition:opacity .15s ease;}
.title-edit-toggle:hover .title-edit-icon{opacity:1;}
.title-edit-toggle[open] .title-edit-icon{opacity:1; color:var(--accent);}
.title-edit-toggle .title-edit-form{display:flex; gap:8px; align-items:center; margin-top:10px; max-width:480px;}
.title-edit-toggle .title-edit-form input{flex:1; margin:0;}
.title-edit-toggle .title-edit-form button{padding:10px 16px; font-size:13px; flex-shrink:0;}

/* ---------- activity detail: pace por tiro (interval reps) ---------- */
.tiros-card .grid.cols-5 .card.stat{padding:14px 12px;}
.tiros-bars{display:flex; align-items:flex-end; gap:8px; height:150px; margin-top:30px; padding-bottom:24px; overflow-x:auto;}
.tiros-bars .tiro-bar{flex:1; min-width:30px; background:linear-gradient(180deg, var(--blue), var(--gold)); border-radius:6px 6px 2px 2px; position:relative;}
.tiros-bars .tiro-bar.best{background:linear-gradient(180deg, var(--accent), var(--accent-2));}
.tiros-bars .tiro-bar .pace-lbl{position:absolute; top:-22px; left:0; right:0; text-align:center; font-family:'IBM Plex Mono',monospace; font-size:11px; font-weight:700; color:var(--ink);}
.tiros-bars .tiro-bar.best .pace-lbl{color:var(--accent);}
.tiros-bars .tiro-bar .dist-lbl{position:absolute; bottom:-22px; left:0; right:0; text-align:center; font-family:'IBM Plex Mono',monospace; font-size:10px; color:var(--ink-faint);}

/* ---------- activity detail: tiro bars get the same tooltip card as km
   splits, but .tiros-bars scrolls horizontally (overflow-x:auto), and that
   forces the browser to clip overflow-y too — so a plain absolutely
   positioned tooltip here would get cut off instead of floating above the
   bar. JS clones each bar's (hidden) .bar-tip content into one shared
   .tiro-tip-float element appended to <body>, positioned with real
   on-screen coordinates, which escapes that clipping entirely. ---------- */
.tiros-bars .tiro-bar{cursor:pointer; outline:none;}
.tiros-bars .tiro-bar .bar-tip{display:none;}
.tiro-tip-float{position:fixed; transform:translate(-50%, calc(-100% - 14px)); background:var(--surface2); border:1px solid var(--line); border-radius:12px; padding:10px 13px; min-width:136px; box-shadow:0 14px 28px -12px rgba(0,0,0,0.5); opacity:0; visibility:hidden; pointer-events:none; transition:opacity .12s ease; z-index:999;}
.tiro-tip-float::after{content:''; position:absolute; top:100%; left:50%; transform:translateX(-50%); border:5px solid transparent; border-top-color:var(--surface2);}
.tiro-tip-float.show{opacity:1; visibility:visible;}
.tiro-tip-float .bar-tip-title{font-family:'IBM Plex Mono',monospace; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:0.05em; color:var(--accent); margin-bottom:6px; white-space:nowrap;}
.tiro-tip-float .bar-tip-row{display:flex; justify-content:space-between; align-items:baseline; gap:16px; font-size:12px; color:var(--ink-dim); padding:2px 0; white-space:nowrap;}
.tiro-tip-float .bar-tip-row strong{color:var(--ink); font-family:'IBM Plex Mono',monospace; font-weight:700;}
.tiros-bars:has(.tiro-bar.tip-active) .tiro-bar:not(.tip-active){opacity:.45;}
.tiros-bars .tiro-bar.tip-active{filter:brightness(1.12);}
.tiros-bars .tiro-bar .pace-lbl{transition:opacity .12s ease;}
.tiros-bars .tiro-bar.tip-active .pace-lbl{opacity:0;}
@media (max-width:640px){ .tiro-tip-float{font-size:11px; padding:8px 11px; min-width:118px;} }

/* ---------- activity detail: inline per-training coach chat ---------- */
.coach-inline-form{display:flex; gap:8px; align-items:flex-end; margin-top:12px;}
.coach-inline-form textarea{flex:1; min-height:42px; max-height:120px; resize:none; margin:0;}
.coach-inline-form button{flex-shrink:0; width:42px; height:42px; padding:0; display:flex; align-items:center; justify-content:center;}
.coach-inline-form button .icon-svg{width:18px; height:18px;}

/* ---------- coach chat: typing indicator ---------- */
.chat-typing{display:inline-flex; gap:4px; align-items:center; padding:2px 0;}
.chat-typing span{width:6px; height:6px; border-radius:50%; background:var(--ink-faint); display:inline-block; animation:chatDot 1.1s infinite ease-in-out;}
.chat-typing span:nth-child(2){animation-delay:.15s;}
.chat-typing span:nth-child(3){animation-delay:.3s;}
@keyframes chatDot{0%,60%,100%{opacity:.3; transform:translateY(0);} 30%{opacity:1; transform:translateY(-3px);}}

/* ---------- coach chat: full page ---------- */
.chat-card{display:flex; flex-direction:column; padding:18px 18px 18px;}
.chat-msgs{display:flex; flex-direction:column; gap:12px; max-height:56vh; min-height:220px; overflow-y:auto; padding:4px 4px 8px;}
.chat-form{display:flex; gap:10px; align-items:flex-end; margin-top:14px; border-top:1px solid var(--line); padding-top:14px;}
.chat-form textarea{flex:1; min-height:44px; max-height:140px; resize:none; margin:0;}
.chat-form button{flex-shrink:0; width:46px; height:46px; padding:0; display:flex; align-items:center; justify-content:center;}
.chat-form button .icon-svg{width:20px; height:20px;}

/* ---------- coach chat: full-screen app layout (/assistant) ----------
   Real chat apps (WhatsApp, iMessage, ChatGPT) fill the viewport: a slim
   header, a message list that owns its own scroll, and an input that's
   always in reach — never buried at the bottom of a long scrolling page.
   Scoped to body.chat-page / .wrap-chat so every other page keeps its
   normal document scroll untouched. */
body.chat-page{height:100vh; height:100dvh; overflow:hidden; display:flex; flex-direction:column;}
body.chat-page .nav{flex-shrink:0;}
.wrap-chat{flex:1; min-height:0; display:flex; flex-direction:column; padding:10px 10px 10px; max-width:760px;}
.wrap-chat .chat-card{flex:1; min-height:0; padding:0; margin-bottom:0; overflow:hidden; border-radius:18px; position:relative;}
.chat-topbar{display:flex; align-items:center; justify-content:space-between; gap:10px; padding:12px 16px; border-bottom:1px solid var(--line); flex-shrink:0;}
.chat-topbar-title{display:flex; align-items:center; gap:10px; min-width:0; flex:1;}
.chat-topbar-avatar{flex-shrink:0; width:36px; height:36px; border-radius:50%; display:flex; align-items:center; justify-content:center; background:linear-gradient(155deg, var(--accent), var(--accent-2));}
.chat-topbar-avatar .icon-svg{width:18px; height:18px;}
.chat-topbar-name{font-family:'Archivo Black',sans-serif; font-size:15px; line-height:1.25; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.chat-topbar-sub{font-size:12px; color:var(--ink-faint); line-height:1.3;}
.chat-topbar-clear{background:none; border:none; box-shadow:none; color:var(--ink-faint); font-size:12px; font-family:'IBM Plex Mono',monospace; text-transform:uppercase; letter-spacing:.04em; cursor:pointer; padding:6px 4px;}
.chat-topbar-clear:hover{color:var(--ink); transform:none; box-shadow:none;}
.wrap-chat .chat-msgs{flex:1; min-height:0; max-height:none; padding:14px 16px; scroll-behavior:smooth;}
.wrap-chat .chat-form{flex-shrink:0; margin:0; padding:10px 12px; border-top:1px solid var(--line);
  padding-bottom:calc(10px + env(safe-area-inset-bottom));}
@media (max-width:640px){
  .wrap-chat{padding:0;}
  .wrap-chat .chat-card{border-radius:0; border-left:none; border-right:none;}
}

/* ---------- coach chat: conversation drawer (/assistant) ----------
   Tapping the menu icon in the topbar slides a conversation list over the
   chat, like the app's own "gaveta" mockup Felipe approved: general thread
   + one per training that already has messages, with a "nova conversa"
   picker for trainings that don't have one yet. */
.chat-menu-btn{flex-shrink:0;}
.icon-btn{background:none; border:none; box-shadow:none; padding:8px; margin:0; border-radius:10px; display:flex; align-items:center; justify-content:center; color:var(--ink-dim); cursor:pointer;}
.icon-btn:hover{background:var(--surface2); color:var(--ink); transform:none; box-shadow:none;}
.icon-btn .icon-svg, .icon-btn svg{width:18px; height:18px;}
.chat-drawer-backdrop{position:absolute; inset:0; background:rgba(0,0,0,.55); opacity:0; visibility:hidden; transition:opacity .18s ease; z-index:20;}
.chat-drawer-backdrop.open{opacity:1; visibility:visible;}
.chat-drawer{position:absolute; left:0; top:0; bottom:0; width:min(302px, 84vw); background:var(--surface); border-right:1px solid var(--line); z-index:21; display:flex; flex-direction:column; box-shadow:24px 0 48px rgba(0,0,0,.35); transform:translateX(-100%); transition:transform .2s ease;}
.chat-drawer.open{transform:translateX(0);}
.chat-drawer-head{display:flex; align-items:center; gap:10px; padding:16px 14px 8px;}
.chat-drawer-title{font-family:'Archivo Black',sans-serif; font-size:16px; flex:1;}
.chat-drawer-new{width:calc(100% - 28px); margin:6px 14px 12px; padding:10px 12px; border-radius:12px; border:1px dashed var(--line); background:none; box-shadow:none; color:var(--ink-dim); font-size:12px; text-transform:uppercase; letter-spacing:.04em; display:flex; align-items:center; justify-content:center; gap:6px; cursor:pointer; font-family:'IBM Plex Mono',monospace;}
.chat-drawer-new svg, .convo-delete svg{width:14px; height:14px; flex-shrink:0;}
.chat-drawer-new:hover{color:var(--ink); border-color:var(--ink-faint); transform:none; box-shadow:none;}
.chat-drawer-list{flex:1; min-height:0; overflow-y:auto; display:flex; flex-direction:column; gap:2px; padding:0 8px 12px;}
.convo-row{display:flex; align-items:stretch; gap:2px;}
.convo-row .convo-item{flex:1; min-width:0; width:auto;}
.convo-item{display:flex; align-items:flex-start; gap:10px; width:100%; text-align:left; background:none; border:none; box-shadow:none; padding:10px 8px; border-radius:12px; color:var(--ink); cursor:pointer; font-family:'Archivo',sans-serif;}
.convo-item:hover{background:var(--surface2); transform:none; box-shadow:none;}
.convo-item.active{background:var(--surface2); box-shadow:inset 3px 0 0 var(--accent);}
.convo-item.active:hover{box-shadow:inset 3px 0 0 var(--accent);}
.convo-dot{width:30px; height:30px; border-radius:9px; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; background:var(--surface2); color:var(--ink-dim); border:1px solid var(--line); margin-top:1px;}
.convo-item.active .convo-dot{background:var(--accent); color:#15171A; border-color:var(--accent);}
.convo-text{min-width:0; flex:1;}
.convo-title{font-size:13px; font-weight:700; line-height:1.3; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.convo-sub{font-size:11.5px; color:var(--ink-faint); margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.convo-delete{flex-shrink:0; align-self:center; width:32px; height:32px; padding:0; margin:0; display:flex; align-items:center; justify-content:center; background:none; border:none; box-shadow:none; border-radius:9px; color:var(--ink-faint); cursor:pointer; opacity:0; transition:opacity .12s ease, color .12s ease, background .12s ease;}
.convo-row:hover .convo-delete, .convo-delete:focus-visible{opacity:1;}
.convo-delete:hover{background:rgba(209,67,67,0.14); color:var(--red); transform:none; box-shadow:none;}
@media (hover:none){.convo-delete{opacity:1;}}
.convo-back{width:calc(100% - 16px); margin:4px 8px 8px; text-align:left; background:none; border:none; box-shadow:none; color:var(--ink-dim); font-size:12.5px; font-family:'IBM Plex Mono',monospace; text-transform:uppercase; letter-spacing:.03em; padding:8px; border-radius:10px; cursor:pointer;}
.convo-back:hover{background:var(--surface2); color:var(--ink); transform:none; box-shadow:none;}

/* ---------- floating Coach widget (present on every screen) ---------- */
.coach-widget{position:fixed; right:22px; bottom:22px; z-index:100;}
.coach-launcher{position:relative; width:58px; height:58px; border-radius:50%; padding:14px; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(155deg, var(--accent), var(--accent-2)); border:none; cursor:pointer;
  box-shadow:0 14px 30px -10px rgba(var(--glow),0.6), inset 0 1px 0 rgba(255,255,255,0.35);
  transition:transform .18s ease, box-shadow .18s ease;}
.coach-launcher:hover{transform:translateY(-2px) scale(1.03);}
.coach-launcher.active{transform:scale(0.94);}
.coach-launcher .icon-svg{width:26px; height:26px;}
.coach-launcher-glow{position:absolute; inset:-40%; border-radius:50%; background:radial-gradient(circle, rgba(var(--glow),0.55), transparent 70%); filter:blur(10px); z-index:-1; animation:coachPulse 2.6s infinite ease-in-out;}
@keyframes coachPulse{0%,100%{opacity:.5; transform:scale(0.9);} 50%{opacity:.9; transform:scale(1.1);}}
.coach-panel{position:absolute; right:0; bottom:74px; width:min(360px, calc(100vw - 44px)); height:min(520px, calc(100vh - 140px)); background:var(--surface); border:1px solid var(--line); border-radius:20px; box-shadow:0 30px 60px -20px rgba(0,0,0,0.35); display:flex; flex-direction:column; overflow:hidden; opacity:0; transform:translateY(12px) scale(0.98); pointer-events:none; transition:opacity .18s ease, transform .18s ease;}
.coach-panel.open{opacity:1; transform:translateY(0) scale(1); pointer-events:auto;}
.coach-panel-head{display:flex; align-items:center; justify-content:space-between; padding:14px 16px; border-bottom:1px solid var(--line); flex-shrink:0;}
.coach-panel-title{display:flex; align-items:center; gap:10px; font-weight:800; font-size:14px;}
.coach-panel-close{background:none; border:none; box-shadow:none; color:var(--ink-faint); font-size:22px; line-height:1; padding:2px 6px; cursor:pointer;}
.coach-panel-close:hover{color:var(--ink); transform:none; box-shadow:none;}
.coach-panel-body{flex:1; overflow-y:auto; padding:14px 16px; display:flex; flex-direction:column; gap:10px;}
.coach-panel-body .chat-msg{max-width:88%; font-size:13px;}
.coach-panel-form{display:flex; gap:8px; align-items:flex-end; padding:12px 14px; border-top:1px solid var(--line); flex-shrink:0;}
.coach-panel-form textarea{flex:1; min-height:38px; max-height:96px; resize:none; margin:0; font-size:13px; padding:9px 10px;}
.coach-panel-form button{flex-shrink:0; width:38px; height:38px; padding:0; display:flex; align-items:center; justify-content:center;}
.coach-panel-form button .icon-svg{width:16px; height:16px;}
@media (max-width:640px){ .coach-widget{right:14px; bottom:14px;} .coach-launcher{width:52px; height:52px;} .coach-panel{bottom:64px;} }

/* ---------- feed: composer + post cards ---------- */
.feed-composer textarea{min-height:64px;}
.composer-row{display:flex; gap:12px; align-items:flex-start;}
.composer-main{flex:1; min-width:0;}
.composer-avatar{margin-top:2px;}
.photo-input-label{cursor:pointer; display:inline-block;}
.photo-btn{font-size:13px; padding:10px 16px; display:inline-flex; align-items:center; gap:7px;}
.photo-btn .icon-svg{width:15px; height:15px;}
.composer-preview-wrap{position:relative; display:inline-block; margin-top:12px; max-width:220px;}
.composer-preview-wrap[hidden]{display:none;}
.composer-preview-wrap img{display:block; width:100%; border-radius:12px; border:1px solid var(--line);}
.composer-preview-remove{position:absolute; top:-8px; right:-8px; width:26px; height:26px; padding:0; border-radius:50%; display:flex; align-items:center; justify-content:center; background:var(--ink); box-shadow:0 4px 10px -4px rgba(0,0,0,0.5);}
.composer-preview-remove .icon-svg{width:12px; height:12px;}
.composer-preview-remove:hover{transform:scale(1.08);}

.feed-list{display:flex; flex-direction:column;}
.feed-list .post-card{animation:feedCardIn .38s cubic-bezier(.2,.8,.2,1) backwards;}
.feed-list .post-card:nth-child(1){animation-delay:0s;}
.feed-list .post-card:nth-child(2){animation-delay:.04s;}
.feed-list .post-card:nth-child(3){animation-delay:.08s;}
.feed-list .post-card:nth-child(4){animation-delay:.12s;}
.feed-list .post-card:nth-child(n+5){animation-delay:.16s;}
@keyframes feedCardIn{from{opacity:0; transform:translateY(10px);} to{opacity:1; transform:translateY(0);}}
@media (prefers-reduced-motion: reduce){ .feed-list .post-card{animation:none;} }

.feed-empty{text-align:center; padding:44px 24px;}
.feed-empty-icon{width:52px; height:52px; margin:0 auto 14px; opacity:.85;}
.feed-empty-icon .icon-svg{width:100%; height:100%;}

.post-card{padding:20px 22px; transition:box-shadow .18s ease, border-color .18s ease;}
.post-card:hover{border-color:rgba(var(--glow),0.35); box-shadow:0 10px 26px -18px rgba(0,0,0,0.35);}
.post-head{display:flex; align-items:center; gap:12px; margin-bottom:12px;}
.post-avatar{width:42px; height:42px; border-radius:50%; flex-shrink:0; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(150deg, var(--accent), var(--accent-2)); color:#15171A; font-family:'Archivo',sans-serif; font-weight:800; font-size:15px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.35), 0 6px 14px -8px rgba(var(--glow),0.5);}
.post-avatar.c1{background:linear-gradient(150deg, var(--blue), color-mix(in srgb, var(--blue) 55%, black));}
.post-avatar.c2{background:linear-gradient(150deg, var(--green), color-mix(in srgb, var(--green) 55%, black));}
.post-avatar.c3{background:linear-gradient(150deg, var(--red), color-mix(in srgb, var(--red) 55%, black));}
.post-avatar.c4{background:linear-gradient(150deg, var(--amber), color-mix(in srgb, var(--amber) 55%, black));}
.post-avatar.c5{background:linear-gradient(150deg, var(--purple), color-mix(in srgb, var(--purple) 55%, black));}
img.post-avatar{object-fit:cover; background:var(--surface2); box-shadow:0 0 0 1px var(--line);}
.post-name{font-weight:800; font-size:14px; display:flex; align-items:center; gap:6px; flex-wrap:wrap;}
.post-name a{text-decoration:none;}
.post-name a:hover{text-decoration:underline;}
.post-verb{font-weight:600; font-size:12px; color:var(--ink-faint); text-transform:none; letter-spacing:0;}
.post-time{font-size:12px; color:var(--ink-faint); font-family:'IBM Plex Mono',monospace; margin-top:2px; cursor:default;}
.post-body{font-size:15px; line-height:1.55;}
.post-photo{margin-top:12px; border-radius:14px; overflow:hidden; border:1px solid var(--line);}
.post-photo img{display:block; width:100%; max-height:420px; object-fit:cover;}
.post-activity-pill{margin-top:12px;}

/* auto-posts: a training auto-shows in the feed as a stats card (see
   is_auto in postCard / activityStatBlock, views.js) instead of a typed
   caption, so the feed always has real content the moment anyone logs a
   run — closer to Strava's activity stream than an empty composer. */
.post-activity-head{display:flex; align-items:center; gap:12px; text-decoration:none; padding:12px 14px; border-radius:14px; background:var(--surface2); border:1px solid var(--line); transition:border-color .15s ease;}
.post-activity-head:hover{border-color:rgba(var(--glow),0.4);}
.post-activity-icon{width:38px; height:38px; flex-shrink:0; display:flex; align-items:center; justify-content:center; border-radius:50%; background:var(--surface); box-shadow:inset 0 0 0 1px var(--line);}
.post-activity-icon .icon-svg{width:20px; height:20px;}
.post-activity-headtext{display:flex; flex-direction:column; gap:2px; min-width:0;}
.post-activity-title{font-weight:800; font-size:15px; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.post-activity-type{font-size:11px; font-family:'IBM Plex Mono',monospace; text-transform:uppercase; letter-spacing:0.05em; color:var(--ink-faint);}
.post-stats{display:grid; grid-template-columns:repeat(auto-fit,minmax(72px,1fr)); gap:10px; margin-top:12px;}
.post-stat{text-align:center; padding:10px 6px; border-radius:12px; background:var(--surface2);}
.post-stat .v{font-family:'Archivo',sans-serif; font-weight:800; font-size:18px; color:var(--ink);}
.post-stat .v .u{font-size:11px; font-weight:600; color:var(--ink-faint); margin-left:2px;}
.post-stat .k{font-size:10px; text-transform:uppercase; letter-spacing:0.05em; color:var(--ink-faint); margin-top:3px; font-family:'IBM Plex Mono',monospace;}

/* condensed pace-by-km chart on an auto-posted feed card — reuses the same
   .bars/.bar-km markup+hover tooltips as the activity page's "Splits por
   km" card (see paceBarsHtml in views.js), just a little shorter so it
   doesn't dominate the feed. */
.post-chart{margin-top:12px; padding:14px 14px 28px; border-radius:14px; background:var(--surface2);}
.post-chart .bars{height:84px; margin-top:0;}

.post-actions{display:flex; align-items:center; gap:18px; margin-top:14px; padding-top:12px; border-top:1px solid var(--line);}
.kudos-btn{display:inline-flex; align-items:center; gap:7px; background:transparent; color:var(--ink-dim); border:1px solid var(--line); box-shadow:none; padding:7px 14px; font-size:13px; font-weight:700; transition:transform .12s ease, background .12s ease, color .12s ease, border-color .12s ease;}
.kudos-btn .icon-svg{width:16px; height:16px;}
.kudos-btn:hover{border-color:rgba(var(--glow),0.5); transform:none; box-shadow:none;}
.kudos-btn.active{background:linear-gradient(155deg, var(--accent), var(--accent-2)); color:#15171A; border-color:transparent; box-shadow:0 8px 18px -10px rgba(var(--glow),0.6);}
.kudos-btn:active{transform:scale(0.92);}
.post-comment-count{display:inline-flex; align-items:center; gap:7px; color:var(--ink-faint); font-size:13px; font-weight:700;}
.post-comment-count .icon-svg{width:16px; height:16px;}
.post-comments{margin-top:12px; display:flex; flex-direction:column; gap:8px;}
.comment-item{font-size:13px; line-height:1.5; display:flex; align-items:flex-start; gap:8px;}
.comment-main{flex:1; min-width:0; background:var(--surface2); border-radius:10px; padding:8px 12px; display:flex; flex-wrap:wrap; align-items:baseline; gap:0;}
.comment-author{font-weight:800; margin-right:6px;}
.comment-body{flex:1; min-width:120px;}
.comment-time{font-size:11px; color:var(--ink-faint); font-family:'IBM Plex Mono',monospace; margin-left:10px; white-space:nowrap;}
.comment-form{display:flex; gap:8px; margin-top:12px; align-items:center;}
.comment-avatar{width:26px; height:26px; font-size:11px; flex-shrink:0;}
.comment-form input{margin:0; font-size:13px; padding:9px 12px;}
.comment-form button{flex-shrink:0; padding:9px 16px; font-size:13px;}

/* multi-type reaction picker: a <details>/<summary> disclosure, same idiom
   as .title-edit-toggle, so one tap/click reveals the 4 reaction types
   instead of a single kudos button (see reactionPicker() in views.js). */
.reaction-picker{position:relative;}
.reaction-summary{display:inline-flex; align-items:center; gap:7px; background:transparent; color:var(--ink-dim); border:1px solid var(--line); border-radius:12px; padding:7px 14px; font-size:13px; font-weight:700; cursor:pointer; list-style:none; transition:border-color .12s ease, background .12s ease, color .12s ease;}
.reaction-summary::-webkit-details-marker{display:none;}
.reaction-summary .icon-svg{width:16px; height:16px;}
.reaction-summary:hover{border-color:rgba(var(--glow),0.5);}
.reaction-summary.active{background:linear-gradient(155deg, var(--accent), var(--accent-2)); color:#15171A; border-color:transparent; box-shadow:0 8px 18px -10px rgba(var(--glow),0.6);}
.reaction-picker[open] .reaction-summary{border-color:rgba(var(--glow),0.6);}
.reaction-menu{position:absolute; bottom:calc(100% + 8px); left:0; z-index:5; display:flex; flex-direction:column; gap:3px; background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:6px; box-shadow:0 14px 30px -12px rgba(0,0,0,0.35); min-width:168px;}
.reaction-menu form{margin:0;}
.reaction-opt{display:flex; align-items:center; gap:8px; width:100%; background:transparent; color:var(--ink); border:none; box-shadow:none; padding:8px 10px; font-size:13px; font-weight:700; border-radius:9px; justify-content:flex-start; text-align:left;}
.reaction-opt:hover{background:var(--surface2); transform:none; box-shadow:none;}
.reaction-opt.active{background:var(--surface2); color:var(--accent);}
.reaction-opt .reaction-count{margin-left:auto; color:var(--ink-faint); font-family:'IBM Plex Mono',monospace; font-weight:600; font-size:12px;}

/* personal-record badge (feed post header) + banner (activity detail) — see
   detectPersonalRecord() in lib/stats.js and p.is_pr / prInfo in views.js. */
.pr-badge{margin-left:auto; background:linear-gradient(155deg, var(--gold), var(--amber)); color:#15171A; border-color:transparent; font-weight:800;}
.pr-badge .icon-svg{width:12px; height:12px;}

/* delete-post button (feed post header, own posts only) — see POST
   /feed/:id/delete in server.js. */
.post-delete-form{margin-left:auto;}
.post-delete-btn{display:flex; align-items:center; justify-content:center; width:30px; height:30px; padding:0; border-radius:50%; background:transparent; border:1px solid transparent; color:var(--ink-faint); cursor:pointer; transition:background .15s ease, color .15s ease, border-color .15s ease;}
.post-delete-btn:hover{background:rgba(255,107,107,0.12); border-color:rgba(255,107,107,0.3); color:var(--red, #FF6B6B);}
.post-delete-btn .icon-svg{width:16px; height:16px;}
.pr-banner{display:flex; align-items:center; gap:16px; background:linear-gradient(135deg, color-mix(in srgb, var(--gold) 16%, var(--surface)), var(--surface)); border-color:rgba(var(--glow),0.4);}
.pr-banner-icon{width:40px; height:40px; flex-shrink:0; border-radius:50%; display:flex; align-items:center; justify-content:center; background:linear-gradient(155deg, var(--gold), var(--amber)); box-shadow:0 8px 18px -10px rgba(var(--glow),0.6);}
.pr-banner-icon .icon-svg{width:20px; height:20px; color:#15171A;}
.pr-banner-text{flex:1; min-width:0;}
.pr-banner-title{font-weight:800; font-size:16px;}
.pr-banner .btn{flex-shrink:0;}

/* feed scope tabs ("Todos" / "Seguindo") — see the follows table / scope
   query param in server.js. */
.feed-tabs{display:flex; gap:6px; margin-bottom:16px;}
.feed-tab{font-family:'IBM Plex Mono',monospace; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:0.05em; color:var(--ink-faint); text-decoration:none; padding:8px 14px; border-radius:10px; border:1px solid transparent;}
.feed-tab:hover{color:var(--ink);}
.feed-tab.active{background:var(--surface2); border-color:var(--line); color:var(--ink);}

/* composer "share a recent run" suggestion chips — see recentUnshared in
   the GET /feed route, server.js. */
.composer-recent{margin-bottom:10px; display:flex; flex-direction:column; gap:6px;}
.composer-recent-chips{display:flex; gap:8px; flex-wrap:wrap;}
.composer-recent-chip{text-decoration:none; cursor:pointer;}
.composer-recent-chip:hover{border-color:rgba(var(--glow),0.5);}

.feed-pagination{text-align:center; margin-top:18px;}

/* follow button + counts on the public profile — see the follows table,
   db.js, and POST /u/:slug/follow, server.js. */
.follow-form{margin-left:auto;}
.follow-counts{font-size:13px;}
.follow-counts strong{color:var(--ink);}
@media (max-width:640px){ .follow-form{margin-left:0; width:100%;} }

/* ---------- notification bell ---------- */
.notif-wrap{position:relative;}
.notif-bell{position:relative; background:transparent; box-shadow:none; border:none; padding:8px; width:36px; height:36px; display:flex; align-items:center; justify-content:center; cursor:pointer;}
.notif-bell:hover{background:var(--surface2); transform:none; box-shadow:none;}
.notif-bell .icon-svg{width:20px; height:20px;}
.notif-badge{position:absolute; top:2px; right:2px; min-width:16px; height:16px; padding:0 3px; border-radius:999px; background:var(--red); color:#fff; font-family:'IBM Plex Mono',monospace; font-size:10px; font-weight:700; display:flex; align-items:center; justify-content:center;}
.notif-panel{position:absolute; right:0; top:calc(100% + 8px); width:320px; max-width:calc(100vw - 32px); max-height:420px; overflow-y:auto; background:var(--surface); border:1px solid var(--line); border-radius:16px; box-shadow:0 24px 50px -18px rgba(0,0,0,0.35); opacity:0; transform:translateY(8px); pointer-events:none; transition:opacity .16s ease, transform .16s ease; z-index:50;}
.notif-panel.open{opacity:1; transform:translateY(0); pointer-events:auto;}
.notif-panel-head{font-weight:800; font-size:13px; text-transform:uppercase; letter-spacing:0.04em; padding:14px 16px; border-bottom:1px solid var(--line); color:var(--ink-dim);}
.notif-item{display:flex; justify-content:space-between; align-items:center; gap:10px; padding:12px 16px; border-bottom:1px solid var(--line); text-decoration:none; color:var(--ink); font-size:13px;}
.notif-item:last-child{border-bottom:none;}
.notif-item:hover{background:var(--surface2);}
.notif-item.unread{background:rgba(var(--glow),0.06);}
.notif-time{font-size:11px; color:var(--ink-faint); font-family:'IBM Plex Mono',monospace; flex-shrink:0;}

/* ---------- public profile ---------- */
.profile-hero{display:flex; align-items:center; gap:20px; flex-wrap:wrap;}
.profile-avatar{width:64px; height:64px; font-size:22px;}

/* Settings: current-photo circle + "trocar foto" control, side by side
   above the rest of the profile form. */
.settings-avatar-row{display:flex; align-items:center; gap:16px; margin-bottom:18px;}
.settings-avatar{width:64px; height:64px; font-size:22px; flex-shrink:0;}

/* Distance medals (5K/10K/Meia/Maratona) — see computeMedals, lib/stats.js.
   An achieved one is full color; a locked one sits dimmed with a dashed
   ring, reading as "not yet" rather than a broken icon. */
.medal-row{display:flex; gap:14px; flex-wrap:wrap;}
.medal-chip{display:flex; flex-direction:column; align-items:center; gap:6px; width:76px; cursor:default;}
.medal-icon{width:56px; height:56px; border-radius:50%; display:flex; align-items:center; justify-content:center; background:linear-gradient(150deg, var(--accent), var(--accent-2)); box-shadow:inset 0 1px 0 rgba(255,255,255,0.35), 0 8px 18px -10px rgba(var(--glow),0.55);}
.medal-icon .icon-svg{width:28px; height:28px;}
.medal-label{font-family:'IBM Plex Mono',monospace; font-size:11px; font-weight:700; letter-spacing:0.04em; color:var(--ink-dim);}
.medal-chip.locked .medal-icon{background:none; box-shadow:none; border:1.5px dashed var(--line);}
.medal-chip.locked .medal-icon .icon-svg{opacity:.28; filter:grayscale(1);}
.medal-chip.locked .medal-label{color:var(--ink-faint);}

/* ---------- activity detail: "este treino vs. sua média" ---------- */
.cmp-card .cmp-row{display:grid; grid-template-columns:90px 1fr 90px; align-items:center; gap:10px; margin-bottom:4px;}
.cmp-card .cmp-row-avg{margin-bottom:14px;}
.cmp-label{font-family:'IBM Plex Mono',monospace; font-size:12px; color:var(--ink-dim); text-transform:uppercase; letter-spacing:0.03em;}
.cmp-track{height:10px; border-radius:6px; background:var(--surface2); overflow:hidden;}
.cmp-fill{height:100%; border-radius:6px;}
.cmp-fill.mine{background:linear-gradient(90deg, var(--accent), var(--accent-2));}
.cmp-fill.avg{background:var(--ink-faint); opacity:.5;}
.cmp-val{font-family:'IBM Plex Mono',monospace; font-size:13px; font-weight:700; text-align:right;}

/* ---------- story image generator ---------- */
.story-card{display:flex; flex-direction:column; align-items:center;}

/* ---------- public landing page (/, logged out) — cinematic 3D scroll ----------
   Felipe's brief, twice: a 3D object that moves AS the page scrolls (not just
   on a timer), like the premium 360 sites (site-medico-premium-360 skill) —
   a persistent 3D stage pinned behind the page while numbered "chapters"
   scroll past it, a right-edge progress-dot nav, and the shoe/camera driven
   by scroll position instead of a confined, static hero box. Forced dark
   regardless of the visitor's OS theme (same reasoning as .hero/.professor:
   a cinematic product-shot backdrop can't flip to a light cream background),
   done by re-pointing the theme custom properties at this class instead of
   hardcoding hex into every rule below — every existing var(--ink)/var(--btn)
   etc. rule (nav included) picks the dark palette up for free. */
body.landing-dark{
  --ground:#0B0D10; --surface:#0B0D10; --surface2:#15181D; --line:rgba(255,255,255,0.12);
  --ink:#F6F7F5; --ink-dim:#9BA1A8; --ink-faint:#6A7078;
  --accent:#FFC24E; --accent-2:#FF8A3D; --gold:#FFC24E; --blue:#4E9BFF; --green:#6FD46A; --red:#FF6B6B; --amber:#FFB454; --purple:#B497FF;
  --glow:255,194,78;
  background:var(--ground); color:var(--ink);
}
.landing-wrap{max-width:1080px; position:relative;}

/* Full-viewport, fixed WebGL layer — behind everything (z-index:0), in
   normal flow nowhere, so it stays put while .landing-chapters scrolls over
   it. pointer-events:none so it never blocks clicks on the content above. */
.landing-3d-fixed{position:fixed; inset:0; z-index:0; pointer-events:none;}
.landing-3d-fixed canvas{position:absolute; inset:0; width:100%; height:100%; display:block;}

.landing-chapters{position:relative; z-index:1;}
.landing-chapter{min-height:90vh; display:flex; align-items:center; padding:48px 0;}
.landing-chapter-hero{align-items:flex-start; flex-direction:column; justify-content:center;}
.landing-chapter-cta{justify-content:center;}

.chapter-num{font-family:'IBM Plex Mono',monospace; font-size:12px; letter-spacing:0.16em; color:var(--gold); display:flex; align-items:center; gap:8px; margin-bottom:16px; text-transform:uppercase;}
.chapter-num .total{color:var(--ink-faint); font-weight:400;}

.chapter-card{max-width:440px; padding:34px 32px; border-radius:24px; background:rgba(11,13,16,0.6); border:1px solid rgba(255,255,255,0.1); backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px); box-shadow:0 30px 60px -30px rgba(0,0,0,0.6);}
.landing-chapter:nth-of-type(even) .chapter-card{margin-left:auto;}
.chapter-card h2{margin:0 0 10px; font-size:26px;}
.chapter-card p{margin:0; color:var(--ink-dim);}

.landing-h1{font-family:'Archivo Black',sans-serif; font-size:56px; line-height:1.03; letter-spacing:-0.01em; margin:14px 0 18px; max-width:620px;}
.landing-lede{font-size:17px; max-width:460px; margin-bottom:28px; color:var(--ink-dim);}
.landing-cta-row{display:flex; gap:12px; flex-wrap:wrap;}

.landing-cta-final{text-align:center;}
.landing-cta-final h2{margin-bottom:6px;}

/* Right-edge progress dots, echoing the reference site's section nav —
   synced to whichever chapter is in view via IntersectionObserver. */
.landing-dots{position:fixed; right:26px; top:50%; transform:translateY(-50%); z-index:5; display:flex; flex-direction:column; gap:16px;}
.landing-dots button{width:9px; height:9px; border-radius:50%; background:rgba(255,255,255,0.22); border:none; padding:0; cursor:pointer; transition:background .2s ease, transform .2s ease;}
.landing-dots button:hover{background:rgba(255,255,255,0.4);}
.landing-dots button.active{background:var(--gold); transform:scale(1.5);}

@media (max-width:760px){
  .landing-h1{font-size:36px;}
  .landing-chapter{min-height:auto; padding:40px 0;}
  .chapter-card{max-width:100%;}
  .landing-chapter:nth-of-type(even) .chapter-card{margin-left:0;}
  .landing-dots{display:none;}
}
@media (prefers-reduced-motion: reduce){
  .landing-chapter{scroll-margin-top:0;}
}

/* ---------- signup pré-diagnóstico ---------- */
.signup-step-label{font-family:'IBM Plex Mono',monospace; font-size:11px; text-transform:uppercase; letter-spacing:0.08em; color:var(--accent); margin:0 0 4px;}
.signup-step-label-2{margin-top:22px; padding-top:18px; border-top:1px solid var(--line);}

/* ---------- welcome / member number ---------- */
.welcome-number{text-align:center; margin-bottom:22px;}
.welcome-number-eyebrow{display:block; font-family:'IBM Plex Mono',monospace; font-size:12px; text-transform:uppercase; letter-spacing:0.1em; color:var(--ink-faint); margin-bottom:6px;}
.welcome-number-big{display:block; font-family:'Archivo Black',sans-serif; font-size:48px; background:linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip:text; background-clip:text; color:transparent;}
.welcome-diagnosis{background:var(--surface2); border-left:3px solid var(--accent); border-radius:8px; padding:18px 20px; font-size:14px; line-height:1.65;}

/* ---------- discover / find athletes ---------- */
.discover-search{display:flex; gap:10px; margin-bottom:18px;}
.discover-search input{flex:1;}
.discover-row{display:flex; align-items:center; gap:14px; flex-wrap:wrap;}
.discover-row-link{display:flex; align-items:center; gap:14px; flex:1; min-width:220px; text-decoration:none; color:inherit;}
.discover-avatar{width:48px; height:48px; font-size:17px; flex-shrink:0;}
.discover-row-main .t{font-weight:800;}
.discover-row-main .d{font-size:12px; color:var(--ink-faint); font-family:'IBM Plex Mono',monospace; margin-top:2px;}

/* ---------- coach chat: in-chat workout story card ---------- */
.chat-story-card{margin-top:10px; display:flex; flex-direction:column; align-items:flex-start; gap:8px;}
.chat-story-card canvas{width:100%; max-width:320px; border-radius:14px; box-shadow:0 14px 30px -16px rgba(0,0,0,0.5);}
.chat-story-download{padding:7px 12px; font-size:12px;}
.story-card canvas{width:100%; max-width:360px; aspect-ratio:1080/1350; border-radius:18px; box-shadow:0 18px 40px -16px rgba(0,0,0,0.45);}
