/* Team page (Oct 24): pyramid, leaderboard, goals. Hub design tokens (--h-*) so every theme applies.
   Restrained: maroon only on Save buttons, no pills, gradients or emoji. Prefix htp-. */
.htp{--a:var(--h-accent,#7a1f2b);--on:var(--h-on-accent,#fffaf6);--ink:var(--h-ink,#1f1a1c);--mut:var(--h-muted,#625a57);--line:var(--h-line,#e3dbcd);--surf:var(--h-surface,#fffdf9);--ok:var(--h-ok,#2f7d4f);--soft:color-mix(in srgb,var(--line) 40%,transparent);color:var(--ink)}
.htp-loading{color:var(--h-muted,#625a57);padding:24px 0}
.htp-head{display:flex;align-items:flex-end;gap:16px}
.htp-head>div{margin-right:auto}
.htp-online{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.htp-online-dot{width:8px;height:8px;border-radius:50%;background:var(--ok)}
.htp-check{display:inline-flex;align-items:center;gap:8px;color:var(--mut);font:500 13px/1.3 var(--h-ui,inherit);cursor:pointer;white-space:nowrap;padding-bottom:4px}
.htp-check input{width:16px;height:16px;margin:0;accent-color:var(--ink)}
/* Sticky glass bar under the Hub top bar */
.htp-bar-sticky{position:sticky;top:var(--htp-top,0px);z-index:5;display:flex;align-items:center;gap:16px;margin:8px 0 20px;border-bottom:1px solid var(--line);background:color-mix(in srgb,var(--h-bg,#f8f5ef) 78%,transparent);-webkit-backdrop-filter:saturate(1.4) blur(14px);backdrop-filter:saturate(1.4) blur(14px)}
.htp-tabs,.htp-seg{display:flex;gap:22px}
.htp-tabs{margin-right:auto}
.htp-tabs button,.htp-seg button{height:44px;padding:0;border:0;border-bottom:2px solid transparent;margin-bottom:-1px;background:none;color:var(--mut);font:600 14px/1 var(--h-ui,inherit);cursor:pointer}
.htp-tabs button[aria-selected=true],.htp-seg button[aria-selected=true]{color:var(--ink);border-bottom-color:var(--ink)}
.htp-seg{border-bottom:1px solid var(--line)}
.htp-seg button{height:36px}
.htp-week{display:flex;align-items:center;gap:4px;color:var(--mut);font:500 13px/1 var(--h-ui,inherit);white-space:nowrap}
.htp-icon{width:32px;height:32px;display:grid;place-items:center;border:0;border-radius:6px;background:none;color:var(--mut);cursor:pointer}
.htp-icon:hover{background:var(--soft);color:var(--ink)}
.htp-icon svg,.htp-nav svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.htp :focus-visible,.htp-card :focus-visible{outline:2px solid var(--h-focus,var(--a));outline-offset:2px}
.htp-tools{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin:0 0 18px}
.htp-search{width:240px;height:36px;padding:0 12px;border:1px solid var(--line);border-radius:8px;background:var(--surf);color:var(--ink);font:400 14px/1 var(--h-ui,inherit)}
.htp-select{display:inline-flex;align-items:center;gap:8px;color:var(--mut);font:500 13px/1 var(--h-ui,inherit)}
.htp-select select,.htp-field select,.htp-field input{height:36px;padding:0 10px;border:1px solid var(--line);border-radius:8px;background:var(--surf);color:var(--ink);font:400 14px/1 var(--h-ui,inherit)}
.htp-text{border:0;background:none;padding:6px 0;color:var(--mut);font:600 13px/1.2 var(--h-ui,inherit);cursor:pointer;text-decoration:none}
.htp-text:hover{color:var(--ink)}
.htp-empty{color:var(--mut);margin:12px 0}
.htp-note{color:var(--mut);font-size:13px;line-height:1.5;margin:8px 0 0}
/* Pyramid */
.htp-pyr{display:flex;flex-direction:column;align-items:center;gap:28px;padding:4px 0 12px}
.htp-tier{width:100%;display:flex;flex-direction:column;align-items:center}
.htp-tier+.htp-tier{position:relative}
.htp-tier+.htp-tier::before{content:"";position:absolute;top:-28px;left:50%;width:1px;height:20px;background:var(--line)}
.htp-tier-head{margin:0 0 12px;color:var(--mut);font:600 12px/1 var(--h-ui,inherit);letter-spacing:.06em;text-transform:uppercase}
.htp-tier-head span{color:var(--ink);margin-left:4px}
.htp-row{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;width:100%;padding-bottom:20px;border-bottom:1px solid var(--line)}
.htp-tier:last-child .htp-row{border-bottom:0}
.htp-tile{width:116px;display:flex;flex-direction:column;align-items:center;gap:4px;padding:12px 6px 10px;border:1px solid transparent;border-radius:10px;background:none;color:var(--ink);font:inherit;text-align:center;cursor:pointer;transition:background .15s,opacity .2s,border-color .15s}
.htp-tile:hover{background:var(--soft)}
.htp-tile.htp-on{border-color:var(--ink);background:var(--surf)}
.htp-tile.htp-dim{opacity:.32}
.htp-tile.htp-pending .htp-av{opacity:.6}
.htp-tname{font:600 13px/1.25 var(--h-ui,inherit);overflow-wrap:anywhere}
.htp-tsub{color:var(--mut);font:400 12px/1.2 var(--h-ui,inherit)}
.htp-av{position:relative;flex:none;width:48px;height:48px;border-radius:50%;display:grid;place-items:center;background:color-mix(in srgb,var(--ink) 8%,var(--surf));color:var(--ink);font:600 15px/1 var(--h-ui,inherit)}
.htp-av img{width:100%;height:100%;border-radius:50%;object-fit:cover}
.htp-av-sm{width:36px;height:36px;font-size:13px}
.htp-av-lg{width:64px;height:64px;font-size:20px}
.htp-dot{position:absolute;right:0;bottom:0;width:11px;height:11px;border-radius:50%;background:var(--ok);box-shadow:0 0 0 2px var(--surf)}
.htp-av-sm .htp-dot{width:9px;height:9px}
/* Hover card */
.htp-tip{position:fixed;z-index:60;max-width:280px;padding:12px 14px;border:1px solid var(--h-line,#e3dbcd);border-radius:10px;background:var(--h-surface,#fffdf9);color:var(--h-ink,#1f1a1c);box-shadow:0 14px 34px -16px rgba(20,10,12,.35);font:400 13px/1.45 var(--h-ui,Manrope,"Segoe UI",Arial,sans-serif);pointer-events:none}
.htp-tip p{margin:0}
.htp-tip-name{font-weight:700;font-size:14px}
.htp-tip-sub{color:var(--h-muted,#625a57)}
.htp-tip-nums{margin-top:6px!important;padding-top:6px;border-top:1px solid var(--h-line,#e3dbcd)}
/* Leaderboard */
.htp-summary{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:0;margin:0 0 22px;border:1px solid var(--line);border-radius:10px;background:var(--surf)}
.htp-summary>div{display:flex;flex-direction:column;gap:3px;padding:14px 16px}
.htp-summary>div+div{border-left:1px solid var(--line)}
.htp-summary span{color:var(--mut);font:500 12px/1.3 var(--h-ui,inherit)}
.htp-summary strong{font:600 20px/1.2 var(--h-ui,inherit);font-variant-numeric:tabular-nums}
.htp-summary small{color:var(--mut);font-size:12px}
.htp-board{list-style:none;margin:0;padding:0;border-top:1px solid var(--line)}
.htp-board li{border-bottom:1px solid var(--line)}
.htp-brow{width:100%;display:flex;align-items:center;gap:12px;padding:10px 8px;border:0;background:none;color:var(--ink);font:inherit;text-align:left;cursor:pointer}
.htp-brow:hover,.htp-brow.htp-on{background:var(--soft)}
.htp-rank{width:24px;flex:none;color:var(--mut);font:600 13px/1 var(--h-ui,inherit);text-align:right;font-variant-numeric:tabular-nums}
.htp-who{min-width:0;flex:1 1 180px;display:flex;flex-direction:column}
.htp-who strong{font:600 14px/1.3 var(--h-ui,inherit);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.htp-who small{color:var(--mut);font-size:12px}
.htp-cols{display:grid;grid-template-columns:repeat(6,88px);gap:8px;flex:none}
.htp-col{display:flex;flex-direction:column;align-items:flex-end;gap:2px}
.htp-col small{color:var(--mut);font-size:11px;letter-spacing:.02em}
.htp-col b{font:500 14px/1.2 var(--h-ui,inherit);font-variant-numeric:tabular-nums}
.htp-col.htp-main b{font-weight:700}
.htp-bar{display:block;width:100%;height:4px;border-radius:2px;background:color-mix(in srgb,var(--ink) 10%,transparent);overflow:hidden}
.htp-bar span{display:block;height:100%;background:color-mix(in srgb,var(--ink) 70%,transparent)}
.htp-bar.htp-met span{background:var(--ok)}
/* Goals + stats */
.htp-panel{margin:0 0 18px;padding:20px 22px;border:1px solid var(--line);border-radius:10px;background:var(--surf)}
.htp-panel h2{margin:0;font:600 16px/1.3 var(--h-ui,inherit)}
.htp-goal-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px 16px;margin-top:16px}
.htp-field{display:flex;flex-direction:column;gap:6px;color:var(--mut);font:500 13px/1.2 var(--h-ui,inherit)}
.htp-field input,.htp-field select{width:100%}
.htp-wide{margin-top:14px;max-width:420px}
.htp-actions{display:flex;justify-content:flex-end;margin-top:16px}
.htp-primary{min-height:38px;padding:0 16px;border:0;border-radius:8px;background:var(--a);color:var(--on);font:600 14px/1 var(--h-ui,inherit);cursor:pointer}
.htp-primary:hover{filter:brightness(1.08)}
.htp-primary:disabled{opacity:.6;cursor:default}
.htp-err{margin:10px 0 0;color:var(--h-danger,#a12a2a);font-size:13px}
.htp-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 18px;margin:12px 0 0}
.htp-panel .htp-stats{grid-template-columns:repeat(3,minmax(0,1fr))}
.htp-stats>div{display:flex;flex-direction:column;gap:4px}
.htp-stats dt{color:var(--mut);font:500 12px/1.3 var(--h-ui,inherit)}
.htp-stats dd{margin:0;font:600 16px/1.2 var(--h-ui,inherit);font-variant-numeric:tabular-nums}
.htp-stats dd small{color:var(--mut);font-weight:400;font-size:12px}
/* Account card: side sheet on desktop; the Hub's phone rules turn it into a bottom sheet */
.htp-card{--a:var(--h-accent,#7a1f2b);--on:var(--h-on-accent,#fffaf6);--ink:var(--h-ink,#1f1a1c);--mut:var(--h-muted,#625a57);--line:var(--h-line,#e3dbcd);--surf:var(--h-surface,#fffdf9);--ok:var(--h-ok,#2f7d4f);--soft:color-mix(in srgb,var(--line) 40%,transparent);
 position:fixed;inset:0 0 0 auto;margin:0;width:min(440px,100vw);max-width:none;height:100dvh;max-height:none;padding:0;border:0;border-left:1px solid var(--line);background:var(--surf);color:var(--ink);box-shadow:-24px 0 60px -30px rgba(20,10,12,.35);font:400 14px/1.5 var(--h-ui,Manrope,"Segoe UI",Arial,sans-serif);overflow:auto}
.htp-card::backdrop{background:rgba(20,12,14,.28)}
.htp-card-in{padding:22px 24px 32px}
.htp-card-head{display:flex;align-items:center;gap:14px}
.htp-card-head>div{margin-right:auto;min-width:0}
.htp-card-name{margin:0;font:500 22px/1.2 var(--h-display,Georgia,serif)}
.htp-card-sub{margin:2px 0 0;color:var(--mut);font-size:13px}
.htp-x{align-self:flex-start}
.htp-dl{display:grid;grid-template-columns:110px 1fr;gap:8px 12px;margin:20px 0 8px}
.htp-dl dt{color:var(--mut)}
.htp-dl dd{margin:0;overflow-wrap:anywhere}
.htp-card-h{margin:22px 0 0;padding-top:16px;border-top:1px solid var(--line);font:600 13px/1.2 var(--h-ui,inherit);color:var(--mut);letter-spacing:.04em;text-transform:uppercase}
.htp-edit{margin-top:22px;padding-top:16px;border-top:1px solid var(--line);display:grid;gap:12px}
.htp-edit h3{margin:0;font:600 14px/1.2 var(--h-ui,inherit)}
@media (max-width:1100px){.htp-cols{grid-template-columns:repeat(6,72px)}.htp-summary{grid-template-columns:repeat(3,minmax(0,1fr))}.htp-summary>div:nth-child(4){border-left:0}.htp-summary>div:nth-child(n+4){border-top:1px solid var(--line)}}
@media (max-width:760px){
 .htp-head{flex-direction:column;align-items:flex-start;gap:8px}
 .htp-bar-sticky{flex-wrap:wrap;gap:0;margin:4px -16px 16px;padding:0 16px}
 .htp-tabs{width:100%;gap:20px}
 .htp-week{width:100%;justify-content:space-between;height:40px;border-top:1px solid var(--line)}
 .htp-search{width:100%;height:44px;font-size:16px}
 .htp-select{width:100%}.htp-select select{flex:1;height:44px;font-size:16px}
 .htp-pyr{gap:20px}
 .htp-tier{width:100%}
 .htp-tier+.htp-tier::before{display:none}
 .htp-row{gap:4px}
 .htp-tile{width:calc(33.333% - 4px);min-width:96px;padding:10px 2px}
 .htp-summary{grid-template-columns:repeat(2,minmax(0,1fr));margin:0 -16px 18px;border-radius:0;border-width:1px 0}
 .htp-summary>div{padding:12px 16px}
 .htp-summary>div:nth-child(n){border-left:0;border-top:0}
 .htp-summary>div:nth-child(even){border-left:1px solid var(--line)}
 .htp-summary>div:nth-child(n+3){border-top:1px solid var(--line)}
 .htp-cols{grid-template-columns:72px}
 .htp-col:not(.htp-main){display:none}
 .htp-brow{padding:12px 0;min-height:56px}
 .htp-panel{margin:0 -16px 16px;padding:18px 16px;border-radius:0;border-width:1px 0}
 .htp-goal-grid,.htp-panel .htp-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
 .htp-field input,.htp-field select{height:44px;font-size:16px}
 .htp-primary{width:100%;min-height:44px}
 .htp-card{height:auto;border-left:0;box-shadow:none}
 .htp-card-in{padding:20px 16px calc(24px + env(safe-area-inset-bottom))}
}
