:root { --mizu-css:"2.7.11"; }
:root { --ink:#182356; --muted:#465279; --brand:#1F2A7A; --tint:#edf3ff; --track:#dce7fa; --line:#c3d3ef; --bg:#ffffff; --card:#ffffff; --tinted:#f4f8ff; --on-brand:#ffffff; --water:#d6e5ff; }
:root[data-theme=dark] { --ink:#eff4ff; --muted:#adbcdf; --brand:#bccbff; --tint:#172655; --track:#273c72; --line:#3f5487; --bg:#0b1434; --card:#111f46; --tinted:#14244c; --on-brand:#0b1434; --water:#2e477b; }
body { background-image:radial-gradient(ellipse at 100% 0%,var(--tint),transparent 55%); background-attachment:fixed; }
.card { border-radius:26px; }
.home-stage .page-head { text-align:start; padding:10px 6px; }
.page-title { font-size:2.4rem; letter-spacing:-.055em; line-height:1.04; max-width:330px; }
.kicker { text-transform:uppercase; letter-spacing:.12em; font-size:.76rem; font-weight:600; margin-bottom:9px; }
.home-stage .kicker { color:var(--ink); font-size:.8rem; }
.ring-card { border-radius:70px 28px 36px 28px; background:var(--tinted); border-color:var(--line); box-shadow:0 12px 30px rgb(31 42 122 / 7%); padding-top:28px; position:relative; isolation:isolate; overflow:hidden; }
.ring-wrap { background:var(--card); border-radius:50%; isolation:isolate; box-shadow:0 0 0 8px var(--card); }
.water-window { position:absolute; inset:18px; overflow:hidden; border-radius:50%; z-index:-1; pointer-events:none; }
.water-fill { position:absolute; inset:0 -15%; background:var(--water); transform:translateY(100%); transition:transform .9s cubic-bezier(.2,.65,.3,1); transform-origin:50% 0; }
.water-fill::before,.water-fill::after { content:''; position:absolute; width:200%; height:16px; left:0; top:-15px; background:var(--water); -webkit-mask:url('/assets/wave.svg') repeat-x bottom / 120px 16px; mask:url('/assets/wave.svg') repeat-x bottom / 120px 16px; transform-origin:50% 100%; animation:water-drift 5s linear infinite; }
.water-fill::after { top:-19px; height:20px; -webkit-mask-size:120px 20px; mask-size:120px 20px; opacity:.5; animation-direction:reverse; animation-duration:7s; }
.water-window.slosh .water-fill { animation:water-slosh 1.6s cubic-bezier(.3,.6,.4,1); }
.water-window.slosh .water-fill::before { animation:water-drift 5s linear infinite, wave-surge 1.6s ease-out; }
.water-window.slosh .water-fill::after { animation:water-drift 7s linear infinite reverse, wave-surge 1.6s ease-out .12s; }
@keyframes water-slosh { 0% { rotate:0deg; } 15% { rotate:-7deg; } 35% { rotate:5deg; } 55% { rotate:-3deg; } 75% { rotate:1.5deg; } 100% { rotate:0deg; } }
@keyframes wave-surge { 0%,100% { scale:1 1; } 20% { scale:1 2.6; } 45% { scale:1 1.6; } 70% { scale:1 1.25; } }
.ring-label { z-index:1; }
.ring-count { font-size:3rem; letter-spacing:-.06em; }
.ring-bg { stroke:var(--line); }
.ring-goal { color:var(--ink); font-weight:500; }
.ring-litres { margin-top:6px; padding:2px 10px; border-radius:999px; background:var(--tint); color:var(--brand); font-size:.82rem; font-weight:600; font-variant-numeric:tabular-nums; }
.ring-sub { max-width:290px; line-height:1.5; font-size:.95rem; color:var(--ink); }
.is-empty .ring-sub { font-weight:500; }
.actions { position:relative; z-index:1; }
.btn-primary,.btn-solid { background:#1F2A7A; color:#ffffff; box-shadow:0 5px 12px rgb(31 42 122 / 13%); }
.tip { position:relative; isolation:isolate; overflow:hidden; border-color:var(--line); border-radius:24px 24px 24px 10px; transition:background .25s,border-color .25s,box-shadow .25s; }
.tip::after { content:''; position:absolute; z-index:-1; pointer-events:none; left:0; bottom:0; width:calc(100% + 240px); height:32px; background:url('/assets/wave.svg') repeat-x bottom / 240px 32px; opacity:0; transition:opacity .25s; }
@media(hover:hover) {
  .tips .tip:hover { background:var(--tint); border-color:var(--brand); box-shadow:0 6px 20px rgb(31 42 122 / 12%); }
  .tip:hover::after { opacity:.12; animation:tip-wave 3s linear infinite; }
  :root[data-theme=dark] .tip:hover { background:var(--track); }
  :root[data-theme=dark] .tip:hover::after { filter:brightness(3); opacity:.2; }
}
@keyframes tip-wave { to { transform:translateX(-240px); } }
.tip:nth-child(2),.tip:nth-child(3) { background:var(--tinted); }
.tip-ico { border-radius:50% 50% 50% 15%; background:var(--tint); }
.pill { border-radius:16px 16px 10px 10px; }
.pill-fill { background:#1F2A7A; border-radius:45% 40% 0 0 / 7px 6px 0 0; }
.tabbar { background:var(--card); box-shadow:0 -5px 24px rgb(31 42 122 / 4%); }
.wrap { padding-bottom:calc(140px + env(safe-area-inset-bottom, 0px)); }
/* Active tab: coloured icon + label with a soft pill behind the icon (no box outline) */
.tab-btn { gap:3px; padding-top:8px; -webkit-tap-highlight-color:transparent; }
.tab-btn:focus, .tab-btn:focus-visible { outline:none; }
.tab-ico { display:flex; align-items:center; justify-content:center; width:56px; height:30px; border-radius:999px; transition:background .2s,color .2s,box-shadow .2s; }
.tab-btn.active .tab-ico { background:var(--tint); color:var(--brand); }
.tab-btn.active svg { stroke-width:2.1; }
.tab-btn:focus-visible .tab-ico { box-shadow:0 0 0 2px var(--brand); }
/* Language toggle: globe + code + caret, rounded like the other controls so it doesn't read as an avatar */
.lang { display:inline-flex; align-items:center; gap:5px; min-width:0; padding:6px 9px 6px 10px; border-radius:12px; background:var(--tinted); font-size:.8rem; font-weight:600; letter-spacing:.02em; }
.lang .ico { width:16px; height:16px; }
.lang .lang-caret { width:14px; height:14px; margin-inline-start:-2px; }
.streak { font-size:.8rem; padding:6px 10px; border-radius:999px; background:var(--tint); }
.stack-label { display:block; font-size:.85rem; color:var(--ink); margin-bottom:6px; }
.goal-summary { background:var(--tint); border-radius:12px; padding:12px 14px; margin:0 0 14px; }
.goal-calc { font-family:'Space Grotesk', sans-serif; font-weight:700; color:var(--brand); font-size:1rem; }
.goal-hint { font-size:.8rem; color:var(--muted); line-height:1.45; margin-top:4px; }
button { transition:transform .18s,background .18s; }
button:hover { filter:brightness(.96); }
:focus-visible { outline:3px solid var(--brand); outline-offset:4px; }
@keyframes water-drift { to { transform:translateX(-120px); } }
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important; transition:none!important; } }

@media (max-width:380px) { .streak { white-space:normal; text-align:end; line-height:1.25; max-width:130px; } }

/* Accessibility: visible week bars and switch track in dark mode, screen-reader-only labels */
:root[data-theme=dark] .pill-fill { background:var(--brand); }
.slider { background:var(--muted); }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
.tab:focus { outline:none; }

/* Quick-add amounts on the Today ring */
.quick-add { display:flex; gap:8px; margin-top:12px; width:100%; position:relative; z-index:1; }
.chip { flex:1; min-height:40px; padding:8px 6px; border-radius:999px; background:var(--card); color:var(--brand); border:1.5px solid var(--line); font-size:.82rem; font-weight:600; }
.chip[aria-expanded=true] { border-color:var(--brand); background:var(--tint); }
.custom-form { display:flex; gap:8px; margin-top:10px; width:100%; position:relative; z-index:1; }
.custom-form[hidden], .past-form[hidden] { display:none; }
.custom-form input { flex:1; min-width:0; padding:10px 12px; border:1.5px solid var(--brand); border-radius:12px; font:inherit; font-size:.95rem; color:var(--ink); background:var(--card); }
.custom-form button { flex:none; padding:10px 18px; }

/* Goal celebration: droplets burst from the ring */
.celebrate { position:absolute; left:50%; top:122px; width:0; height:0; pointer-events:none; z-index:2; }
.drop { position:absolute; left:-5px; top:-7px; width:10px; height:14px; background:var(--brand); border-radius:50% 50% 50% 50% / 60% 60% 40% 40%; opacity:0; animation:drop-burst 1.1s cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes drop-burst { 0% { opacity:1; transform:translate(0,0) scale(.6); } 70% { opacity:1; } 100% { opacity:0; transform:translate(var(--dx),var(--dy)) scale(1); } }
.ring-card.celebrating .ring-wrap { animation:ring-pop .6s ease; }
@keyframes ring-pop { 0%,100% { transform:scale(1); } 40% { transform:scale(1.06); } }

/* Personal impact */
.impact { font-weight:600; color:var(--ink); }

/* History calendar */
.cal-head .section-title { flex:1; text-align:center; text-transform:capitalize; }
.cal-nav { font-size:1.4rem; min-width:44px; }
.cal-nav:disabled { opacity:.3; cursor:default; }
.cal-week, .cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:5px; }
.cal-week { font-size:.7rem; color:var(--muted); text-align:center; margin:4px 0 6px; }
.cal-day { position:relative; aspect-ratio:1; min-height:36px; padding:0; border-radius:10px; font-size:.8rem; font-weight:500; background:var(--tint); color:var(--ink); border:1.5px solid transparent; font-variant-numeric:tabular-nums; }
.cal-day.lv1 { background:color-mix(in srgb, var(--brand) 22%, var(--card)); }
.cal-day.lv2 { background:color-mix(in srgb, var(--brand) 45%, var(--card)); }
.cal-day.lv3 { background:color-mix(in srgb, var(--brand) 70%, var(--card)); color:var(--on-brand); }
.cal-day.lv4 { background:var(--brand); color:var(--on-brand); font-weight:700; }
.cal-day.today { border-color:var(--brand); }
.cal-day.sel { box-shadow:0 0 0 2px var(--card), 0 0 0 4px var(--brand); }
.cal-day:disabled { background:transparent; color:var(--muted); opacity:.5; cursor:default; }
.cal-blank { aspect-ratio:1; }
.cal-hint { margin:12px 0 0; }
.day-total { font-size:.85rem; color:var(--muted); margin:-2px 0 10px; }
.past-form { background:var(--tint); border-radius:14px; padding:12px; margin-bottom:12px; }
.past-fields { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.past-fields .stack-field { margin-bottom:10px; }
.log-list li .log-right { display:flex; align-items:center; gap:6px; }
.log-del { flex:none; min-height:36px; min-width:36px; padding:0; display:inline-flex; align-items:center; justify-content:center; border-radius:10px; background:transparent; color:var(--muted); }
.log-del:hover { color:var(--danger); }
.stats { grid-template-columns:repeat(3,1fr); }

/* First-run onboarding */
.ob-overlay { position:fixed; inset:0; z-index:80; background:var(--bg); display:flex; align-items:center; justify-content:center; padding:calc(20px + env(safe-area-inset-top,0px)) 18px calc(20px + env(safe-area-inset-bottom,0px)); overflow-y:auto; }
.ob-overlay[hidden] { display:none; }
.ob-card { width:100%; max-width:420px; display:flex; flex-direction:column; gap:6px; }
.ob-top { display:flex; justify-content:space-between; align-items:center; }
.ob-step { font-size:.78rem; text-transform:uppercase; letter-spacing:.12em; font-weight:600; color:var(--muted); }
.ob-title { margin:8px 0 10px; }
.ob-body { font-size:1rem; line-height:1.55; color:var(--ink); margin:0 0 18px; }
.ob-pane[hidden] { display:none; }
.ob-actions { display:flex; gap:10px; margin-top:18px; }

/* Intro: step progress bar and a water level that rises behind the card */
.ob-overlay { overflow-x:hidden; }
.ob-card { position:relative; z-index:1; }
.ob-progress { height:4px; border-radius:999px; background:var(--track); overflow:hidden; margin:2px 0 4px; }
.ob-progress span { display:block; height:100%; background:var(--brand); border-radius:inherit; transform:scaleX(0); transform-origin:left center; }
[dir=rtl] .ob-progress span { transform-origin:right center; }
.ob-water { position:fixed; left:0; right:0; bottom:0; height:100%; pointer-events:none; transform:translateY(100%); }
.ob-water-fill { position:absolute; inset:0 -15%; background:var(--water); opacity:.55; }
.ob-water-fill::before { content:''; position:absolute; left:0; top:-15px; width:200%; height:16px; background:var(--water); -webkit-mask:url('/assets/wave.svg') repeat-x bottom / 120px 16px; mask:url('/assets/wave.svg') repeat-x bottom / 120px 16px; animation:water-drift 5s linear infinite; }

/* Welcome screen hero */
.ob-hero { display:flex; flex-direction:column; align-items:flex-start; gap:14px; margin:18px 0 6px; }
.ob-logo { width:84px; height:auto; display:block; }
:root[data-theme=dark] .ob-logo { content:url(/icons/logo-light.png); }
.ob-kicker { margin:0; }
.ob-title:focus { outline:none; }
.ob-bottle { display:flex; align-items:center; gap:10px; margin:0 0 6px; padding:12px 14px; border-radius:16px; background:var(--tint); color:var(--brand); font-weight:600; font-size:.92rem; line-height:1.35; }
.ob-bottle .ico { flex:none; }

/* Impact card */
.impact-stats { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:12px; }
.impact-stat { display:flex; flex-direction:column; gap:2px; padding:14px; border-radius:18px 18px 18px 8px; background:var(--tint); min-width:0; }
.impact-num { font-family:'Space Grotesk',sans-serif; font-weight:700; font-size:1.9rem; letter-spacing:-.04em; line-height:1.05; color:var(--brand); overflow-wrap:anywhere; }
.impact-lbl { font-size:.8rem; line-height:1.3; color:var(--muted); }
.impact-line { margin:0; }

/* About Mizu */
.about-body { font-size:.95rem; line-height:1.55; color:var(--ink); margin:0 0 16px; }
.about-cta { display:block; text-align:center; text-decoration:none; padding:13px 14px; border-radius:12px; font-weight:600; font-size:.95rem; box-shadow:0 5px 12px rgb(31 42 122 / 13%); }

/* Account */
.acc-wide { width:100%; }
#accCodeForm .btn-row > * { flex:1; }
#accCode { letter-spacing:.3em; font-weight:600; }
.acc-who { font-weight:600; color:var(--ink); margin:0 0 4px; overflow-wrap:anywhere; }
#accIn .btn-row > * { flex:1; }
.acc-delete { display:block; margin:10px 0 0; padding:0; color:var(--muted); text-decoration:underline; }
.acc-msg { margin:12px 0 0; min-height:1.2em; }
.acc-msg:empty { display:none; }

/* First-launch account pop-up */
.acc-prompt { position:fixed; inset:0; z-index:85; background:var(--bg); display:flex; align-items:center; justify-content:center; padding:calc(20px + env(safe-area-inset-top,0px)) 18px calc(20px + env(safe-area-inset-bottom,0px)); overflow-y:auto; }
.acc-prompt[hidden] { display:none; }
.acc-prompt-card { width:100%; max-width:420px; display:flex; flex-direction:column; gap:6px; }
.acc-prompt-card .page-title { margin:14px 0 6px; }
#accPromptSlot [data-i=accIntro] { display:none; }
.acc-later { align-self:center; margin-top:10px; padding:0 12px; }

/* Challenges */
.ch-top { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:10px; min-height:24px; }
.ch-badge { font-size:.7rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase; padding:4px 10px; border-radius:999px; background:var(--tint); color:var(--brand); }
.ch-days { font-size:.82rem; font-weight:600; color:var(--muted); }
.ch-name { font-family:'Space Grotesk',sans-serif; font-weight:700; font-size:1.6rem; letter-spacing:-.04em; line-height:1.1; color:var(--brand); margin:0 0 8px; }
.ch-progress { height:14px; border-radius:999px; background:var(--track); overflow:hidden; }
.ch-progress span { display:block; height:100%; width:0; border-radius:inherit; background:var(--brand); transition:width .5s cubic-bezier(.2,.8,.2,1); }
.ch-nums { display:flex; justify-content:space-between; font-size:.85rem; font-weight:600; color:var(--ink); margin:8px 0 16px; }
.ch-state { margin:12px 0 0; }
.ch-leave { display:block; margin:8px auto 0; color:var(--muted); text-decoration:underline; }
.ch-board { list-style:none; margin:0 0 12px; padding:0; display:flex; flex-direction:column; gap:6px; }
.ch-row { display:flex; align-items:center; gap:12px; padding:11px 14px; border-radius:14px; background:var(--card); border:1.5px solid var(--line); }
.ch-row.me { border-color:var(--brand); background:var(--tint); font-weight:700; }
.ch-rank { flex:none; width:22px; font-family:'Space Grotesk',sans-serif; font-weight:700; color:var(--muted); }
.ch-row.me .ch-rank { color:var(--brand); }
.ch-who { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--ink); }
.ch-val { flex:none; font-variant-numeric:tabular-nums; color:var(--ink); }
.ch-board-hint { margin:0; }
.tab-btn { min-width:0; }
.tab-btn > span:last-child { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Motion for newer screens */
.ch-row { transition:background .3s, border-color .3s; }
.impact-num, #chPct { display:inline-block; transform-origin:left center; }
#chPct { transform-origin:right center; }
.acc-prompt-card, .ch-card { will-change:transform; }
@media (prefers-reduced-motion: reduce) { .ch-progress span { transition:none; } }

/* Grouped layout: small section label, then one card of rows */
.grp-label { font-size:.74rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--muted); margin:24px 8px 8px; }
.card.grp { padding:4px 18px; border-radius:22px; margin-bottom:10px; }
.card.grp > .section-title { margin:16px 0 12px; font-size:.95rem; }
.card.grp > :last-child { margin-bottom:16px; }
.card.grp .stack-field { margin:0; padding:13px 0; border-bottom:1px solid var(--line); }
.card.grp .set-row { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.card.grp .set-row label { margin:0; flex:1; min-width:0; font-size:.95rem; }
.card.grp .set-row input { width:96px; flex:none; text-align:center; font-weight:600; }
.card.grp .toggle-row { margin:0; padding:13px 0; border-bottom:1px solid var(--line); }
.card.grp .goal-summary { margin:14px 0 16px; }
.card.grp .hint { margin:12px 0 16px; }
.card.grp .lang-grid, .card.grp .theme-grid { margin-bottom:16px; }
.card.grp .stack-field .theme-grid { margin-bottom:0; }
.set-save { display:block; width:100%; margin:8px 0 4px; }
.set-account { margin-top:4px; }
.set-version { display:flex; justify-content:space-between; padding:14px 0 0; margin-top:6px; border-top:1px solid var(--line); font-size:.85rem; color:var(--muted); }

/* Same section-label style on every tab */
.card.grp { border-radius:26px; }
.section-title.tips-title { font-family:inherit; font-size:.74rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--muted); margin:24px 8px 10px; }
.tab > .card, .home-stage > .card { margin-bottom:14px; }

/* Team dashboard: a plain full-screen view over the app */
.admin-view { position:fixed; inset:0; z-index:90; background:var(--bg); overflow-y:auto; padding:calc(22px + env(safe-area-inset-top,0px)) 18px calc(28px + env(safe-area-inset-bottom,0px)); }
.admin-view[hidden] { display:none; }
.admin-inner { max-width:460px; margin:0 auto; display:flex; flex-direction:column; gap:12px; }
.admin-head { display:flex; justify-content:space-between; align-items:flex-end; gap:12px; }
.admin-exit { flex:none; padding:10px 18px; }
.admin-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.admin-tile { display:flex; flex-direction:column; gap:4px; padding:16px; border:1.5px solid var(--line); border-radius:18px; background:var(--card); min-width:0; }
.admin-tile.wide { grid-column:1 / -1; background:var(--tint); border-color:transparent; }
.admin-num { font-family:'Space Grotesk',sans-serif; font-weight:700; font-size:2rem; letter-spacing:-.04em; line-height:1.05; color:var(--brand); display:inline-block; transform-origin:left center; overflow-wrap:anywhere; }
.admin-lbl { font-size:.8rem; line-height:1.3; color:var(--muted); }
.admin-chart-card { padding:16px; border:1.5px solid var(--line); border-radius:18px; background:var(--card); }
.admin-chart { display:flex; align-items:flex-end; gap:5px; height:140px; }
.admin-col { flex:1; min-width:0; height:100%; display:flex; flex-direction:column; justify-content:flex-end; align-items:center; gap:6px; }
.admin-bar { display:block; width:100%; border-radius:6px 6px 2px 2px; background:var(--brand); transform-origin:bottom; }
.admin-day { font-size:.62rem; color:var(--muted); font-variant-numeric:tabular-nums; }
.acc-team { display:block; margin:12px 0 0; padding:0; color:var(--brand); }
#accTeamForm { margin-top:8px; }

/* Settings rows sit flat inside their group card */
.card.grp .toggle-row { background:none; border-radius:0; box-shadow:none; }
/* The area behind the page follows the theme too (seen when a page is pulled past its edge) */
html { background:var(--bg); }

/* Challenges on real data */
.ch-official { border-color:var(--brand); box-shadow:0 8px 26px rgb(31 42 122 / 10%); }
.ch-prize { margin:0 0 12px; font-size:.92rem; color:var(--ink); }
.ch-board-title { font-size:.74rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--muted); margin:4px 0 8px; }
.ch-card .ch-board { margin-bottom:14px; }
.ch-foot { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.ch-members { font-size:.82rem; color:var(--muted); }
.ch-share { padding:9px 14px; font-size:.82rem; font-variant-numeric:tabular-nums; }
.ch-code-form { margin:4px 0 16px; }
.ch-code-form input, #chJoinIn, #adCodeIn { text-transform:uppercase; letter-spacing:.08em; font-weight:600; }
.ch-code-hint { margin:10px 0 0; }
.ch-actions { margin:6px 0 4px; }
.ch-actions > * { flex:1; }
.ch-form { margin-top:10px; }
.ch-form-btns { margin:14px 0 16px; }
.ch-form-btns > * { flex:1; }
.ch-two { grid-template-columns:1fr 1fr; }
.ch-kind-hint { margin:10px 0 0 !important; }
.ch-empty { margin:4px 8px 14px; }
.ch-nick-edit { display:block; margin:14px auto 0; color:var(--muted); text-decoration:underline; }
#chGate .ch-name, #chNickCard .ch-name { font-size:1.35rem; }
.admin-chart-card .btn-row > * { flex:1; }

/* Dashboard: winner check */
.admin-off { display:flex; flex-direction:column; gap:8px; margin-bottom:12px; }
.admin-off-row { padding:12px 14px; border:1.5px solid var(--line); border-radius:14px; }
.admin-off-top { display:flex; align-items:baseline; gap:10px; }
.admin-off-rank { flex:none; width:20px; font-family:'Space Grotesk',sans-serif; font-weight:700; color:var(--muted); }
.admin-off-name { flex:1; min-width:0; font-weight:700; color:var(--ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.admin-off-ml { flex:none; font-family:'Space Grotesk',sans-serif; font-weight:700; color:var(--brand); }
.admin-off-mail { font-size:.82rem; color:var(--ink); overflow-wrap:anywhere; margin:2px 0 0 30px; }
.admin-off-meta { font-size:.76rem; color:var(--muted); margin:2px 0 0 30px; }
button[data-armed] { color:var(--brand) !important; font-weight:700; }

/* Challenge cards, cleaner: one headline number, a slim bar, a plain list */
.ch-card.v2 { padding:20px 20px 16px; }
.ch-card.v2 .ch-head { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; margin-bottom:14px; }
.ch-card.v2 .ch-titles { min-width:0; }
.ch-card.v2 .ch-badge { display:inline-block; margin-bottom:8px; }
.ch-card.v2 .ch-name { font-size:1.3rem; letter-spacing:-.03em; margin:0 0 4px; overflow-wrap:anywhere; }
.ch-card.v2 .ch-meta { font-size:.8rem; color:var(--muted); line-height:1.35; }
.ch-card.v2 .ch-pct { flex:none; font-family:'Space Grotesk',sans-serif; font-weight:700; font-size:1.7rem; letter-spacing:-.04em; line-height:1; color:var(--brand); }
.ch-card.v2 .ch-progress { height:8px; }
.ch-card.v2 .ch-sub { font-size:.82rem; color:var(--muted); margin:8px 0 0; }
.ch-card.v2 .ch-prize { margin:12px 0 0; padding:10px 12px; border-radius:12px; background:var(--tint); font-size:.88rem; color:var(--ink); }
.ch-card.v2 .ch-prize b { color:var(--brand); }
.ch-card.v2 .ch-code-form { margin:16px 0 0; }
.ch-card.v2 .ch-board { margin:16px 0 0; gap:0; border-top:1px solid var(--line); }
.ch-card.v2 .ch-row { padding:11px 2px; border:0; border-bottom:1px solid var(--line); border-radius:0; background:none; font-weight:400; gap:10px; }
.ch-card.v2 .ch-row:last-child { border-bottom:0; }
.ch-card.v2 .ch-row.me { background:none; }
.ch-card.v2 .ch-row.me .ch-who, .ch-card.v2 .ch-row.me .ch-val { font-weight:700; }
.ch-card.v2 .ch-rank { width:18px; font-size:.85rem; }
.ch-card.v2 .ch-who { flex:0 1 auto; }
.ch-card.v2 .ch-you { flex:none; font-size:.66rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; padding:2px 7px; border-radius:999px; background:var(--tint); color:var(--brand); }
.ch-card.v2 .ch-val { margin-inline-start:auto; font-size:.92rem; }
.ch-card.v2 .ch-foot { margin-top:12px; padding-top:12px; border-top:1px solid var(--line); }
.ch-card.v2 .ch-share { display:inline-flex; align-items:center; gap:8px; padding:6px 0; min-height:36px; background:none; border:0; box-shadow:none; color:var(--brand); font-weight:600; }
.ch-card.v2 .ch-share .ico { width:18px; height:18px; }
.ch-card.v2 .ch-code { font-size:.9rem; letter-spacing:.06em; font-variant-numeric:tabular-nums; }
.ch-card.v2 .ch-leave { margin:0 0 0 auto; min-height:36px; font-size:.82rem; text-decoration:none; color:var(--muted); }
.ch-card.v2.ch-official { box-shadow:none; }
#tab-today .tips-title[hidden], #tab-today .tips[hidden] { display:none; }

/* Consent step */
.consent { position:fixed; inset:0; z-index:95; background:var(--bg); display:flex; align-items:center; justify-content:center; padding:calc(20px + env(safe-area-inset-top,0px)) 18px calc(20px + env(safe-area-inset-bottom,0px)); overflow-y:auto; }
.consent[hidden] { display:none; }
body.consent-open { overflow:hidden; }
.consent-card { width:100%; max-width:420px; display:flex; flex-direction:column; gap:6px; }
.consent-card .page-title { margin:14px 0 6px; }
.consent-links { margin:0 0 14px; }
.consent-check { display:flex; align-items:flex-start; gap:12px; padding:14px; margin:0 0 14px; border:1.5px solid var(--line); border-radius:16px; font-size:.92rem; line-height:1.45; color:var(--ink); cursor:pointer; }
.consent-check input { flex:none; width:22px; height:22px; margin:1px 0 0; accent-color:var(--brand); }
.acc-agree { margin:10px 0 0; font-size:.76rem; }
.ch-card.v2 .ch-rules { margin:10px 0 0; font-size:.76rem; line-height:1.4; color:var(--muted); }
.admin-off-row.flagged { border-color:#c2410c; }
.admin-off-flag { font-size:.78rem; font-weight:600; color:#c2410c; margin:4px 0 0 30px; }
:root[data-theme=dark] .admin-off-flag { color:#fdba74; }
:root[data-theme=dark] .admin-off-row.flagged { border-color:#fdba74; }
.admin-off-clear { font-size:.76rem; color:var(--muted); margin:4px 0 0 30px; }

/* Dashboard tabs, users and moderation */
.admin-tabs { display:grid; grid-template-columns:1fr 1fr; gap:6px; padding:5px; border-radius:16px; background:var(--tint); }
.admin-tab { padding:10px 8px; border-radius:12px; background:none; border:0; box-shadow:none; color:var(--muted); font-weight:600; font-size:.9rem; }
.admin-tab.active { background:var(--card); color:var(--brand); box-shadow:0 2px 8px rgb(31 42 122 / 10%); }
.admin-pane { display:flex; flex-direction:column; gap:12px; }
.admin-pane[hidden] { display:none; }
.admin-users { display:flex; flex-direction:column; gap:8px; margin:4px 0 12px; }
.admin-user { border:1.5px solid var(--line); border-radius:14px; overflow:hidden; }
.admin-user-head { display:flex; align-items:center; gap:10px; width:100%; padding:12px 14px; background:none; border:0; box-shadow:none; border-radius:0; text-align:start; color:var(--ink); }
.admin-user-main { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.admin-user-name { font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.admin-user-mail { font-size:.8rem; font-weight:400; color:var(--muted); overflow-wrap:anywhere; }
.admin-user-l { flex:none; font-family:'Space Grotesk',sans-serif; font-weight:700; color:var(--brand); }
.admin-user-tags { display:flex; flex-wrap:wrap; gap:6px; padding:0 14px 10px; }
.admin-tag { font-size:.66rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase; padding:3px 8px; border-radius:999px; background:var(--tint); color:var(--brand); }
.admin-tag.warn { background:#ffedd5; color:#9a3412; }
.admin-user-more { padding:10px 14px 14px; border-top:1px solid var(--line); }
.admin-user-more .admin-off-meta { margin:0 0 10px; }
.admin-user-acts { display:flex; flex-direction:column; gap:8px; }
.admin-user-acts button { width:100%; padding:10px 12px; font-size:.86rem; }
.admin-danger { border-color:#c2410c !important; color:#c2410c !important; }
:root[data-theme=dark] .admin-danger { border-color:#fdba74 !important; color:#fdba74 !important; }

/* Label on the intro screens of preview builds */
.preview-tag { display:flex; flex-direction:column; gap:2px; align-self:stretch; padding:10px 14px; margin:0 0 16px; border-radius:12px; border:1.5px solid #c2410c; background:#fff7ed; color:#9a3412; text-transform:uppercase; letter-spacing:.1em; font-size:.72rem; line-height:1.35; }
.preview-tag strong { font-weight:800; }
.preview-tag span { font-weight:600; }
:root[data-theme=dark] .preview-tag { background:#3b1d0a; border-color:#fdba74; color:#fed7aa; }

/* Connect: streak card, section switch, people rows */
.cx-me { padding:18px 20px; }
.cx-me[hidden] { display:none; }
.cx-me-top { display:flex; align-items:center; gap:14px; }
.cx-flame { flex:none; width:46px; height:46px; border-radius:50% 50% 50% 15%; display:flex; align-items:center; justify-content:center; font-size:1.5rem; background:var(--tint); filter:grayscale(1); opacity:.55; transition:filter .3s, opacity .3s; }
.cx-me.done .cx-flame { filter:none; opacity:1; }
.cx-me-text { min-width:0; }
.cx-me-streak { display:inline-block; transform-origin:left center; font-family:'Space Grotesk',sans-serif; font-weight:700; font-size:1.35rem; letter-spacing:-.03em; color:var(--brand); }
.cx-me-sub { font-size:.85rem; color:var(--ink); margin-top:2px; }
.cx-me-meta { font-size:.8rem; color:var(--muted); margin-top:12px; padding-top:12px; border-top:1px solid var(--line); }
.cx-seg { display:grid; grid-template-columns:repeat(3, 1fr); gap:4px; padding:4px; margin:0 0 14px; border-radius:16px; background:var(--tint); }
.cx-seg[hidden] { display:none; }
.cx-seg-btn { position:relative; display:flex; align-items:center; justify-content:center; gap:6px; padding:10px 4px; border-radius:12px; background:none; border:0; box-shadow:none; color:var(--muted); font-weight:600; font-size:.86rem; min-width:0; }
.cx-seg-btn.active { background:var(--card); color:var(--brand); box-shadow:0 2px 8px rgb(31 42 122 / 10%); }
.cx-seg-btn > span[data-i] { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cx-badge { flex:none; min-width:18px; height:18px; padding:0 5px; border-radius:999px; background:var(--brand); color:var(--bg); font-size:.68rem; font-weight:700; line-height:18px; }
.cx-badge[hidden] { display:none; }
.cx-pane[hidden] { display:none; }
.cx-board-switch { margin-bottom:12px; }
.cx-board-card { padding:6px 18px 14px; }
.cx-board-card .ch-board { margin:0; gap:0; }
.cx-board-card .ch-row { padding:12px 2px; border:0; border-bottom:1px solid var(--line); border-radius:0; background:none; font-weight:400; gap:10px; }
.cx-board-card .ch-row:last-child { border-bottom:0; }
.cx-board-card .ch-row.me .ch-who { font-weight:700; }
.cx-board-card .ch-who { flex:0 1 auto; }
.cx-board-card .ch-you { flex:none; font-size:.66rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; padding:2px 7px; border-radius:999px; background:var(--tint); color:var(--brand); }
.cx-val { margin-inline-start:auto; display:flex; align-items:baseline; gap:8px; }
.cx-val b { font-variant-numeric:tabular-nums; }
.cx-mini { font-size:.76rem; color:var(--muted); }
.cx-board-empty { margin:12px 0 0; }
.cx-board-hint { margin:12px 0 0; font-size:.76rem; }
.cx-code-card { display:flex; flex-direction:column; gap:8px; }
.cx-mycode { align-self:flex-start; padding:10px 16px; border-radius:14px; background:var(--tint); border:0; box-shadow:none; color:var(--brand); font-family:'Space Grotesk',sans-serif; font-weight:700; font-size:1.5rem; letter-spacing:.12em; }
.cx-add-btn { margin:14px 0 16px; }
.cx-list { display:flex; flex-direction:column; gap:8px; margin-bottom:6px; }
.cx-row { display:flex; align-items:center; gap:12px; padding:12px 14px; border:1.5px solid var(--line); border-radius:16px; background:var(--card); }
.cx-row-text { flex:1; min-width:0; }
.cx-row-name { font-weight:700; color:var(--ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cx-row-meta { font-size:.78rem; color:var(--muted); margin-top:2px; }
.cx-row-acts { flex:none; display:flex; align-items:center; gap:6px; }
.cx-act.btn-primary, .cx-act.btn-soft { padding:8px 12px; font-size:.82rem; min-height:36px; }
.cx-act.link-btn { min-height:36px; font-size:.78rem; color:var(--muted); }
.cx-out .cx-row { border-style:dashed; background:none; }
.cx-out .cx-row-name { font-weight:500; color:var(--muted); }

/* Share card preview */
.share-view { position:fixed; inset:0; z-index:92; background:var(--bg); overflow-y:auto; padding:calc(18px + env(safe-area-inset-top,0px)) 18px calc(22px + env(safe-area-inset-bottom,0px)); }
.share-view[hidden] { display:none; }
body.share-open { overflow:hidden; }
.share-inner { max-width:420px; margin:0 auto; display:flex; flex-direction:column; gap:14px; }
.share-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.share-head .page-title { font-size:1.6rem; margin:0; }
.share-x { flex:none; padding:9px 16px; }
.share-img { display:block; width:100%; max-width:340px; margin:0 auto; aspect-ratio:9 / 16; border-radius:22px; box-shadow:0 14px 40px rgb(11 20 52 / 28%); background:#1F2A7A; }
.share-note { text-align:center; margin:0; }
.cx-share-btn, .impact-share { display:flex; align-items:center; justify-content:center; gap:8px; width:100%; margin-top:14px; padding:11px 14px; font-size:.9rem; }
.cx-share-btn .ico, .impact-share .ico { width:18px; height:18px; }

/* Connect: section button and bottom sheet */
.cx-seg { display:block; padding:0; background:none; margin:0 0 14px; }
.cx-pick { display:flex; align-items:center; gap:12px; width:100%; padding:12px 16px; border-radius:20px; background:var(--card); border:1.5px solid var(--line); box-shadow:none; color:var(--ink); text-align:start; transition:border-color .2s, box-shadow .2s; }
.cx-pick:active { border-color:var(--brand); box-shadow:0 4px 14px rgb(31 42 122 / 12%); }
.cx-pick-ico, .cx-opt-ico { flex:none; width:42px; height:42px; border-radius:50% 50% 50% 15%; background:var(--tint); display:flex; align-items:center; justify-content:center; font-size:1.25rem; }
.cx-pick-ico [hidden], .cx-pick-label [hidden] { display:none; }
.cx-pick-text { flex:1; min-width:0; display:flex; flex-direction:column; gap:1px; }
.cx-pick-kicker { font-size:.68rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--muted); }
.cx-pick-label { font-family:'Space Grotesk',sans-serif; font-weight:700; font-size:1.12rem; letter-spacing:-.02em; color:var(--brand); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cx-pick-chev { flex:none; width:20px; height:20px; color:var(--muted); }
.cx-sheet { position:fixed; inset:0; z-index:88; }
.cx-sheet[hidden] { display:none; }
body.sheet-open { overflow:hidden; }
.cx-sheet-back { position:absolute; inset:0; background:rgb(11 20 52 / 45%); }
.cx-sheet-panel { position:absolute; left:0; right:0; bottom:0; max-width:520px; margin:0 auto; background:var(--card); border-radius:28px 28px 0 0; padding:10px 14px calc(18px + env(safe-area-inset-bottom,0px)); box-shadow:0 -10px 40px rgb(11 20 52 / 25%); }
.cx-sheet-grip { width:42px; height:5px; border-radius:999px; background:var(--line); margin:4px auto 14px; }
.cx-sheet-title { font-size:.74rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--muted); margin:0 8px 8px; }
.cx-opt { display:flex; align-items:center; gap:14px; width:100%; padding:13px 12px; margin:2px 0; border-radius:18px; background:none; border:0; box-shadow:none; text-align:start; color:var(--ink); }
.cx-opt.active { background:var(--tint); }
.cx-opt-text { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.cx-opt-name { font-weight:700; font-size:1rem; }
.cx-opt-desc { font-size:.8rem; color:var(--muted); line-height:1.35; }
.cx-opt-check { flex:none; width:22px; text-align:center; font-weight:700; color:var(--brand); opacity:0; }
.cx-opt.active .cx-opt-check { opacity:1; }

/* Connect tab: badge on the icon and the pop-out menu */
.tab-ico { position:relative; }
.cx-tab-badge { position:absolute; top:-6px; right:-10px; min-width:16px; height:16px; padding:0 4px; font-size:.62rem; line-height:16px; }
.cx-title [hidden] { display:none; }
.cx-pop { position:fixed; inset:0; z-index:89; }
.cx-pop[hidden] { display:none; }
.cx-pop-back { position:absolute; inset:0; background:rgb(11 20 52 / 35%); }
.cx-pop-list { position:absolute; display:flex; flex-direction:column; align-items:stretch; gap:8px; min-width:200px; }
.cx-pop-btn { display:flex; align-items:center; gap:12px; padding:10px 18px 10px 10px; border-radius:999px; background:var(--card); border:1.5px solid var(--line); box-shadow:0 8px 24px rgb(11 20 52 / 22%); color:var(--ink); font-weight:700; font-size:.95rem; text-align:start; }
.cx-pop-btn[hidden] { display:none; }
.cx-pop-btn.active { border-color:var(--brand); color:var(--brand); }
.cx-pop-btn .cx-badge { margin-inline-start:auto; }
.cx-pop-ico { flex:none; width:38px; height:38px; border-radius:50%; background:var(--tint); display:flex; align-items:center; justify-content:center; font-size:1.1rem; }
/* Today: your challenges */
.today-ch-list { display:flex; flex-direction:column; gap:10px; }
.today-ch-row { display:flex; flex-direction:column; gap:6px; width:100%; padding:12px 14px; border-radius:16px; background:var(--tint); border:0; box-shadow:none; text-align:start; color:var(--ink); }
.today-ch-top { display:flex; align-items:baseline; justify-content:space-between; gap:10px; }
.today-ch-name { font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.today-ch-pct { flex:none; font-family:'Space Grotesk',sans-serif; font-weight:700; color:var(--brand); }
.today-ch-bar { display:block; height:6px; border-radius:999px; background:var(--track); overflow:hidden; }
.today-ch-bar span { display:block; height:100%; border-radius:inherit; background:var(--brand); }
.today-ch-meta { font-size:.78rem; color:var(--muted); }
/* Settings: your data */
.data-card { padding-top:4px; }
.data-row { display:flex; align-items:center; gap:12px; width:100%; padding:14px 0; background:none; border:0; border-bottom:1px solid var(--line); border-radius:0; box-shadow:none; text-align:start; color:var(--ink); }
.data-row[hidden] { display:none; }
.data-row .ico { flex:none; width:20px; height:20px; color:var(--muted); }
.data-row-text { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.data-row-name { font-weight:600; }
.data-row-desc { font-size:.78rem; color:var(--muted); line-height:1.35; }
.data-row.danger .data-row-name, .data-row.danger .ico { color:#c2410c; }
:root[data-theme=dark] .data-row.danger .data-row-name, :root[data-theme=dark] .data-row.danger .ico { color:#fdba74; }
.data-card .acc-msg { margin:12px 0 4px; }

/* Simplified Chinese: prefer Simplified fonts for Chinese characters */
html:lang(zh-Hans) body { font-family:'IBM Plex Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', 'Noto Sans CJK SC', sans-serif; }

/* Settings sections */
.set-pane[hidden] { display:none; }
.set-pane > .grp-label { display:none; }
.set-pane > .card:first-child, .set-pane > .card.grp:first-of-type { margin-top:4px; }
.set-title [hidden] { display:none; }
.set-nick .stack-field input { width:100%; }
.set-nick-save { margin:12px 0 4px; }
#setPop .cx-pop-list { min-width:220px; }

/* Narrow phones: five tab names must fit (e.g. "Impostazioni") */
@media (max-width: 374px) {
  .tab-btn { font-size: 0.66rem; padding-left: 2px; padding-right: 2px; }
}

/* Settings > Your data: destructive actions in their own Danger zone */
.danger-zone { border:1.5px solid rgba(194,65,12,.45); }
.danger-head { display:flex; align-items:center; gap:10px; font-weight:700; color:#c2410c; letter-spacing:.02em; }
.danger-head .ico { width:20px; height:20px; flex:none; }
.danger-note { margin:6px 0 4px; font-size:.8rem; color:var(--muted); line-height:1.4; }
.danger-zone .data-row { margin-top:10px; padding:12px 14px; border:1px solid rgba(194,65,12,.35); border-radius:14px; background:rgba(194,65,12,.06); }
.danger-zone .data-row:active { background:rgba(194,65,12,.12); }
:root[data-theme=dark] .danger-zone { border-color:rgba(253,186,116,.45); }
:root[data-theme=dark] .danger-head { color:#fdba74; }
:root[data-theme=dark] .danger-zone .data-row { border-color:rgba(253,186,116,.35); background:rgba(253,186,116,.07); }

/* My Mizu: team list and social links */
.mz-team { list-style:none; margin:10px 0 0; padding:0; }
.mz-team li { display:flex; flex-direction:column; gap:1px; padding:10px 0; border-bottom:1px solid var(--line); }
.mz-team li:last-child { border-bottom:0; }
.mz-team b { font-weight:600; color:var(--ink); }
.mz-team span { font-size:.8rem; color:var(--muted); }
.mz-links { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.mz-link { padding:9px 14px; border:1px solid var(--line); border-radius:999px; font-size:.86rem; font-weight:600; color:var(--ink); text-decoration:none; }
.mz-link:active { background:var(--line); }

/* My Mizu sections */
.mz-pane[hidden] { display:none; }
#mzPop .cx-pop-list { min-width:220px; }

/* Streak badges (History) and the weekly summary (Today) */
.badges { display:grid; grid-template-columns:repeat(7, 1fr); gap:6px; margin-top:12px; }
.badge { display:flex; flex-direction:column; align-items:center; justify-content:center; aspect-ratio:1; border-radius:50%; border:1.5px dashed var(--line); color:var(--muted); opacity:.55; }
.badge.on { border:0; opacity:1; color:#fff; background:linear-gradient(150deg, #3b4fc4, #1f2a7a); box-shadow:0 6px 14px -8px rgba(31,42,122,.8); }
.badge-n { font-weight:700; font-size:.95rem; line-height:1; }
.badge-l { font-size:.56rem; text-transform:uppercase; letter-spacing:.06em; margin-top:2px; }
.freeze-line { margin-top:12px; }
.week-sum .ws-grid { display:grid; grid-template-columns:repeat(3, 1fr); gap:10px; margin:12px 0 6px; }
.week-sum .ws-grid div { display:flex; flex-direction:column; gap:2px; }
.week-sum .ws-grid b { font-size:1.35rem; font-weight:700; color:var(--ink); }
.week-sum .ws-grid span { font-size:.76rem; color:var(--muted); }
.week-sum #wsShare { margin-top:8px; }

/* ================= 2.7.0 layout ================= */
/* Tab bar: Today, History, the round Scan button, Connect, Me */
.tabbar-inner { align-items:flex-end; }
.tab-scan { flex:0 0 78px; display:flex; justify-content:center; align-items:flex-start; background:none; border:0; padding:0; min-height:56px; -webkit-tap-highlight-color:transparent; }
.tab-scan-ico { width:62px; height:62px; margin-top:-24px; border-radius:50%; background:var(--brand); color:var(--on-brand); display:flex; align-items:center; justify-content:center;
  box-shadow:0 10px 22px -8px rgb(31 42 122 / 70%), 0 0 0 6px var(--bg); transition:transform .15s; }
.tab-scan-ico svg { width:27px; height:27px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.tab-scan:active .tab-scan-ico { transform:scale(.93); }
.tab-scan:focus-visible .tab-scan-ico { outline:3px solid var(--line); outline-offset:3px; }

/* Today: one card under the ring */
.ctx-card { border-inline-start:4px solid var(--brand); }
.ctx-card p { margin:0; font-size:.93rem; line-height:1.45; color:var(--ink); }

/* History: Week / Month */
.seg-ctl { display:grid; grid-template-columns:1fr 1fr; gap:4px; background:var(--tint); border-radius:14px; padding:4px; margin:0 0 14px; }
.seg-ctl button { border:0; background:transparent; color:var(--muted); font:inherit; font-weight:600; font-size:.9rem; padding:9px; border-radius:11px; box-shadow:none; }
.seg-ctl button.on { background:var(--card); color:var(--brand); box-shadow:0 2px 6px -3px rgb(31 42 122 / 45%); }

/* Connect: the menu is one panel that grows out of the Connect tab */
#cxPop .cx-pop-back { background:rgb(11 20 52 / 28%); -webkit-backdrop-filter:blur(2px); backdrop-filter:blur(2px); }
.cx-panel { gap:2px; width:264px; min-width:0; padding:6px; background:var(--card); border:1px solid var(--line); border-radius:22px; box-shadow:0 26px 50px -18px rgb(7 11 34 / 60%); }
.cx-panel::after { content:''; position:absolute; bottom:-7px; left:var(--caret, 50%); width:14px; height:14px; margin-left:-7px; background:var(--card); border-right:1px solid var(--line); border-bottom:1px solid var(--line); transform:rotate(45deg); }
.cx-panel-head { font-size:.66rem; font-weight:600; letter-spacing:.14em; text-transform:uppercase; color:var(--muted); padding:8px 10px 4px; }
.cx-panel .cx-pop-btn { border:0; box-shadow:none; border-radius:16px; background:none; padding:10px; font-weight:600; text-align:start; }
.cx-panel .cx-pop-btn.active { background:var(--tint); color:var(--ink); }
.cx-panel .cx-pop-btn.active .cx-pop-ico { background:var(--brand); }
.cx-pop-txt { flex:1; min-width:0; display:flex; flex-direction:column; }
.cx-pop-txt small { font-size:.74rem; font-weight:400; color:var(--muted); margin-top:1px; line-height:1.3; }
.cx-check { color:var(--brand); font-weight:700; opacity:0; }
.cx-pop-btn.active .cx-check { opacity:1; }
.cx-panel .cx-pop-ico { border-radius:12px; }

/* Me: overview with profile, impact, bottle and a settings list; each row opens its own page */
#tab-settings.me-home .set-head { display:none; }
.me-back { border:0; background:none; box-shadow:none; color:var(--brand); font:inherit; font-weight:600; padding:4px 0; margin:4px 0 2px; }
.me-back[hidden] { display:none; }
.me-prof { display:flex; align-items:center; gap:14px; margin:6px 2px 16px; }
.me-ava { width:62px; height:62px; flex:none; border-radius:50%; background:var(--brand); color:var(--on-brand); display:flex; align-items:center; justify-content:center; font-family:'Space Grotesk', 'IBM Plex Sans', sans-serif; font-weight:700; font-size:1.6rem; }
.me-who b { display:block; font-family:'Space Grotesk', 'IBM Plex Sans', sans-serif; font-size:1.35rem; color:var(--ink); }
.me-who span { font-size:.85rem; color:var(--muted); }
.me-bottle .qr-frame { margin-top:4px; }
.set-pane > .grp-label.me-label { display:block; margin:22px 6px 8px; }
.me-menu { padding:4px 16px; }
.me-row { width:100%; display:flex; align-items:center; gap:12px; padding:13px 0; border:0; border-bottom:1px solid var(--line); border-radius:0; background:none; box-shadow:none; color:var(--ink); font:inherit; font-size:.96rem; font-weight:500; text-align:start; }
.me-row:last-child { border-bottom:0; }
.me-ico { width:34px; height:34px; flex:none; border-radius:11px; background:var(--tint); display:flex; align-items:center; justify-content:center; font-size:1rem; }
.me-row-t { flex:1; }
.me-arrow { color:var(--muted); font-size:1.2rem; }
[dir=rtl] .me-arrow, [dir=rtl] .me-back span[aria-hidden] { transform:scaleX(-1); display:inline-block; }

/* First launch */
.ob-big { white-space:pre-line; font-size:2rem; line-height:1.08; }
.ob-consent { display:flex; gap:10px; align-items:flex-start; margin-top:14px; padding:12px; border:1px solid var(--line); border-radius:16px; background:var(--tinted); font-size:.85rem; line-height:1.45; color:var(--ink); }
.ob-consent input { width:20px; height:20px; flex:none; margin:1px 0 0; accent-color:var(--brand); }
.ob-consent a { color:var(--brand); font-weight:600; }
.ob-two { grid-template-columns:1fr 1fr !important; }
.ob-notif { display:flex; gap:12px; align-items:flex-start; padding:12px 14px; margin:6px 0 18px; border:1px solid var(--line); border-radius:20px; background:var(--card); box-shadow:0 14px 30px -18px rgb(7 11 34 / 55%); }
.ob-notif-ico { width:38px; height:38px; flex:none; border-radius:10px; background:var(--brand); color:var(--on-brand); display:flex; align-items:center; justify-content:center; font-weight:700; }
.ob-notif-txt { display:flex; flex-direction:column; gap:2px; font-size:.88rem; line-height:1.4; color:var(--ink); }
.ob-sip-ring { position:relative; width:150px; height:150px; margin:10px auto 6px; }
.ob-sip-ring svg { width:100%; height:100%; transform:rotate(-90deg); }
.ob-sip-ring .ring-fg { transition:stroke-dashoffset .8s cubic-bezier(.22,1,.36,1); }
.ob-sip-ring span { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-family:'Space Grotesk', 'IBM Plex Sans', sans-serif; font-weight:700; font-size:1.7rem; color:var(--brand); }
.ob-pane[data-step="4"] .ob-title, .ob-pane[data-step="4"] .ob-body { text-align:center; }
#obNext[disabled] { opacity:.4; }
#obSipBtns[hidden] { display:none; }
.ring-card .actions[hidden] { display:none; }
/* Signed out, Connect shows one title and one sign-in card */
.cx-out-only { display:none; }
#tab-challenges.cx-out .cx-out-only { display:inline; }
#tab-challenges.cx-out .cx-title > span:not(.cx-out-only), #tab-challenges.cx-out .page-head .kicker { display:none !important; }

/* 2.7.1 Buttons: clearer hierarchy. Primary = solid with depth, secondary = tinted with a border,
   text buttons = underlined, disabled = clearly faded. Every button presses down a little. */
.btn-primary,.btn-solid { border:0; font-weight:700; letter-spacing:.01em; box-shadow:inset 0 1px 0 rgb(255 255 255 / 16%), inset 0 -3px 0 rgb(0 0 0 / 22%), 0 8px 18px -6px rgb(31 42 122 / 55%); }
.btn-primary:active,.btn-solid:active { transform:translateY(1px) scale(.985); box-shadow:inset 0 -1px 0 rgb(0 0 0 / 22%), 0 3px 8px -4px rgb(31 42 122 / 50%); }
:root[data-theme=dark] .btn-primary,:root[data-theme=dark] .btn-solid { box-shadow:inset 0 0 0 1.5px #5d6fd8, inset 0 -3px 0 rgb(0 0 0 / 30%), 0 8px 18px -6px rgb(0 0 0 / 60%); }
.btn-soft,.btn-ghost { background:var(--tint); color:var(--brand); font-weight:700; border:1.5px solid var(--line); border-color:color-mix(in srgb, var(--brand) 40%, transparent); box-shadow:0 2px 0 var(--line); }
.btn-soft:active,.btn-ghost:active { transform:translateY(1px) scale(.985); box-shadow:0 1px 0 var(--line); }
@media(hover:hover) { .btn-soft:hover,.btn-ghost:hover { border-color:var(--brand); } }
.link-btn:not(.cal-nav) { font-weight:600; text-decoration:underline; text-decoration-thickness:1.5px; text-underline-offset:4px; border-radius:10px; }
.link-btn:not(.cal-nav):active { background:var(--tint); }
.chip,.cx-pop-btn,.theme-option { box-shadow:0 2px 0 var(--line); }
.chip:active,.cx-pop-btn:active,.theme-option:active { transform:translateY(1px); box-shadow:0 1px 0 var(--line); }
.me-row:active,.data-row:active { background:var(--tinted); }
button:disabled { opacity:.45; cursor:not-allowed; box-shadow:none; filter:none; transform:none; }
.acc-resend { display:block; margin:12px auto 0; padding:0 8px; font-variant-numeric:tabular-nums; }
.acc-resend:disabled { opacity:.6; text-decoration:none; color:var(--muted); }
/* Me: Settings comes straight after the name, Your impact is last */
.set-pane > .me-prof + .grp-label.me-label { margin-top:4px; }

/* Today: a bigger ring card */
.ring-card { padding:34px 20px 22px; }
.ring-wrap { width:min(240px, 66vw); height:min(240px, 66vw); margin:4px 0 8px; }
.ring-wrap svg { width:100%; height:100%; }
.water-window { inset:9.5%; }
.ring-count { font-size:3.7rem; }
.ring-goal { font-size:.98rem; margin-top:6px; }
.ring-litres { font-size:.86rem; }
.ring-sub { font-size:1.02rem; margin-top:12px; max-width:320px; }
.ring-card .quick-add { margin-top:16px; }
.ring-card .quick-add .chip { min-height:46px; font-size:.9rem; }
.quick-chip { -webkit-touch-callout:none; user-select:none; -webkit-user-select:none; }
/* Goal reached: a soft halo around the ring for the rest of the day */
.ring-card.goal-hit .ring-wrap { box-shadow:0 0 0 8px var(--card), 0 0 0 15px var(--tint), 0 10px 34px -8px rgb(31 42 122 / 35%); }
.goal-ripple { position:absolute; left:-60px; top:-60px; width:120px; height:120px; border-radius:50%; border:3px solid var(--brand); opacity:0; animation:goal-ripple 1.2s cubic-bezier(.2,.7,.3,1) forwards; }
.goal-ripple.late { animation-delay:.25s; }
@keyframes goal-ripple { 0% { opacity:.7; transform:scale(.6); } 100% { opacity:0; transform:scale(2.6); } }

/* Today's drinks on the card */
.today-drinks { width:100%; margin-top:18px; padding-top:14px; border-top:1px dashed var(--line); position:relative; z-index:1; }
.today-drinks[hidden] { display:none; }
.td-title { font-size:.74rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--muted); margin:0 0 10px; }
.td-list { list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; gap:8px; justify-content:center; }
.td-item { display:inline-flex; align-items:center; gap:6px; padding:3px 3px 3px 12px; border-radius:999px; background:var(--card); border:1.5px solid var(--line); box-shadow:0 2px 0 var(--line); font-size:.84rem; color:var(--ink); }
.td-time { color:var(--muted); font-variant-numeric:tabular-nums; }
.td-ml { font-weight:700; color:var(--brand); }
.td-del { flex:none; width:32px; height:32px; min-height:32px; padding:0; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; background:transparent; color:var(--muted); box-shadow:none; }
.td-del .ico { width:15px; height:15px; }
.td-del:active { background:var(--tint); }
.td-more { flex:none; min-height:38px; padding:6px 14px; border-radius:999px; background:var(--tint); color:var(--brand); font-size:.84rem; font-weight:700; box-shadow:none; }

/* Undo bar, above the tab bar */
.snack { position:fixed; left:50%; bottom:calc(96px + env(safe-area-inset-bottom, 0px)); transform:translate(-50%, 160%); opacity:0; display:flex; align-items:center; gap:12px; width:min(380px, calc(100% - 32px)); padding:8px 8px 8px 18px; border-radius:16px; background:var(--ink); color:var(--bg); box-shadow:0 14px 34px -10px rgb(11 20 52 / 55%); z-index:65; transition:transform .3s cubic-bezier(.2,.7,.3,1), opacity .2s; pointer-events:none; }
.snack.show { transform:translate(-50%, 0); opacity:1; pointer-events:auto; }
.snack-msg { flex:1; min-width:0; font-size:.92rem; font-weight:600; }
.snack-btn { flex:none; min-height:40px; padding:8px 16px; border-radius:12px; background:rgb(255 255 255 / 14%); color:var(--bg); font-weight:700; box-shadow:none; }
.snack-btn[hidden] { display:none; }
:root[data-theme=dark] .snack-btn { background:rgb(11 20 52 / 12%); }

/* Settings: your own quick amounts */
.quick-edit { display:flex; gap:10px; }
.quick-in { flex:1; display:flex; align-items:center; gap:6px; padding:0 12px; border:1.5px solid var(--line); border-radius:12px; background:var(--card); color:var(--muted); font-weight:600; min-height:46px; }
.quick-in:focus-within { border-color:var(--brand); }
.quick-in input { flex:1; min-width:0; width:100%; border:0; background:transparent; font:inherit; font-size:1rem; color:var(--brand); font-weight:700; padding:10px 0; }
.quick-in input:focus { outline:none; }
.quick-hint { margin:8px 0 0; }
.stack-field label.quick-in { display:flex; margin:0; font-size:1rem; color:var(--muted); }
.stack-field .quick-in input { width:100%; padding:10px 0; border:0; border-radius:0; background:transparent; color:var(--brand); font-weight:700; font-size:1rem; }

/* ---------- Avatars and the Mizu team badge */
.ava { flex:none; width:40px; height:40px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; background:var(--brand); color:var(--on-brand); font-family:'Space Grotesk','IBM Plex Sans',sans-serif; font-weight:700; font-size:1rem; line-height:1; background-size:cover; background-position:center; overflow:hidden; user-select:none; }
.ava.has-img { background-color:var(--tint); }
.ava-sm { width:32px; height:32px; font-size:.85rem; }
.ava-lg { width:52px; height:52px; font-size:1.3rem; }
.ava-xl { width:104px; height:104px; font-size:2.6rem; }
.mz-badge { display:inline-block; flex:none; width:18px; height:18px; margin-inline-start:6px; vertical-align:-3px; padding:2px; border-radius:50%; background:#ffffff; box-shadow:0 0 0 1.5px var(--line); object-fit:contain; }
.ch-who .mz-badge, .cx-row-name .mz-badge { width:16px; height:16px; vertical-align:-3px; }
.tappable { cursor:pointer; }
.tappable:focus-visible { outline:3px solid var(--brand); outline-offset:2px; }
@media(hover:hover) { .ch-row.tappable:hover, .cx-row.tappable:hover { border-color:var(--brand); } }

/* Me: the name block is a button that opens Edit profile */
button.me-prof { width:100%; padding:10px 12px; margin:2px 0 14px; border-radius:22px; background:transparent; color:inherit; font:inherit; text-align:start; box-shadow:none; border:1.5px solid transparent; transition:background .18s, border-color .18s; }
button.me-prof:active { background:var(--tinted); }
@media(hover:hover) { button.me-prof:hover { background:var(--tinted); border-color:var(--line); filter:none; } }
.me-ava.ava { width:62px; height:62px; font-size:1.6rem; }
.me-who { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.me-name-line { display:flex; align-items:center; min-width:0; }
.me-name-line b { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.me-name-line .mz-badge { width:22px; height:22px; }
.me-who > span:last-child { font-size:.85rem; color:var(--muted); }
.me-edit { flex:none; width:38px; height:38px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; background:var(--tint); color:var(--brand); }
.me-edit .ico { width:17px; height:17px; }
#meBadge[hidden], #profCardBadge[hidden], #profBadgeNote[hidden], #psTeam[hidden], #cxSusp[hidden], .sheet[hidden] { display:none; }

/* Settings > Profile: the same card, with an Edit button */
.prof-card { width:100%; display:flex; align-items:center; gap:14px; text-align:start; padding:16px; font:inherit; color:inherit; background:var(--card); border:1.5px solid var(--line); box-shadow:0 2px 0 var(--line); }
.prof-card-text { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.prof-card-name { display:flex; align-items:center; min-width:0; }
.prof-card-name b { font-family:'Space Grotesk','IBM Plex Sans',sans-serif; font-size:1.1rem; color:var(--ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.prof-card-sub { font-size:.8rem; color:var(--muted); }
.prof-card-btn { flex:none; padding:8px 14px; border-radius:12px; font-size:.85rem; font-weight:700; }

/* ---------- Bottom sheets */
body.sheet-open { overflow:hidden; }
.sheet { position:fixed; inset:0; z-index:80; display:flex; align-items:flex-end; justify-content:center; }
.sheet-back { position:absolute; inset:0; background:rgb(5 10 48 / 42%); }
.sheet-panel { position:relative; width:100%; max-width:480px; max-height:calc(100% - 40px); overflow-y:auto; background:var(--bg); border-radius:28px 28px 0 0; padding:10px 20px calc(24px + env(safe-area-inset-bottom, 0px)); box-shadow:0 -12px 40px -10px rgb(11 20 52 / 40%); }
.sheet-panel::before { content:""; display:block; width:42px; height:5px; border-radius:3px; background:var(--line); margin:0 auto 8px; }
@media (min-width:560px) { .sheet { align-items:center; } .sheet-panel { border-radius:28px; } .sheet-panel::before { display:none; } }
.sheet-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:6px; }
.sheet-title { font-family:'Space Grotesk',sans-serif; font-weight:700; font-size:1.35rem; color:var(--brand); margin:0; }
.sheet-x { flex:none; width:40px; height:40px; min-height:40px; padding:0; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; background:var(--tint); color:var(--brand); box-shadow:none; }
.prof-photo { display:flex; flex-direction:column; align-items:center; gap:10px; margin:6px 0 16px; }
.prof-ava-btn { position:relative; flex:none; padding:0; min-height:0; border-radius:50%; background:none; box-shadow:none; }
.prof-ava-btn .ava { box-shadow:0 0 0 4px var(--bg), 0 0 0 6px var(--line); }
.prof-cam { position:absolute; right:-2px; bottom:-2px; width:36px; height:36px; border-radius:50%; display:flex; align-items:center; justify-content:center; background:var(--brand); color:var(--on-brand); box-shadow:0 0 0 3px var(--bg); }
.prof-cam .ico { width:17px; height:17px; }
.prof-photo-acts { display:flex; align-items:center; gap:10px; }
.prof-photo-acts .btn-soft { flex:none; padding:9px 16px; min-height:40px; font-size:.88rem; }
.prof-badge-note { display:flex; align-items:center; gap:10px; padding:10px 14px; border-radius:14px; background:var(--tint); color:var(--ink); font-size:.84rem; margin:0 0 14px; }
.prof-badge-note .mz-badge { width:24px; height:24px; margin:0; }
.prof-hint { margin:6px 0 0; }
#profForm .stack-field input { width:100%; }
#profForm .stack-field input:disabled { opacity:.55; }
.prof-signin { display:block; margin:-4px 0 12px; padding:0; min-height:36px; }
.ps-top { display:flex; flex-direction:column; align-items:center; text-align:center; gap:8px; margin:0 0 14px; }
.ps-name { font-family:'Space Grotesk',sans-serif; font-weight:700; font-size:1.5rem; color:var(--ink); margin:4px 0 0; overflow-wrap:anywhere; }
.ps-team { display:inline-flex; align-items:center; gap:6px; padding:4px 12px 4px 6px; border-radius:999px; background:var(--tint); color:var(--brand); font-size:.82rem; font-weight:700; }
.ps-team .mz-badge { margin:0; }
.ps-meta { margin:0; }
.ps-report-open { display:flex; align-items:center; justify-content:center; gap:6px; margin:4px auto 0; color:var(--muted); }
.ps-report-open .ico { width:16px; height:16px; }
.ps-report { margin-top:10px; padding-top:14px; border-top:1px dashed var(--line); }
.ps-report[hidden] { display:none; }
.ps-why { display:grid; grid-template-columns:repeat(auto-fit, minmax(110px, 1fr)); gap:8px; margin:0 0 14px; }
.ps-report textarea { width:100%; padding:10px 12px; border:1.5px solid var(--line); border-radius:12px; font:inherit; font-size:.95rem; color:var(--ink); background:var(--card); resize:vertical; }
.ps-report textarea:focus { outline:none; border-color:var(--brand); }
.ch-report { display:block; margin:10px 0 0 auto; padding:0 4px; min-height:32px; font-size:.78rem; color:var(--muted); }

/* Connect: suspended */
.cx-susp { border-color:#c2410c; background:#fff7ed; }
.cx-susp .section-title { color:#9a3412; }
.cx-susp .hint { color:#7c2d12; margin:0; }
:root[data-theme=dark] .cx-susp { background:#3b1d0c; }
:root[data-theme=dark] .cx-susp .section-title, :root[data-theme=dark] .cx-susp .hint { color:#fed7aa; }

/* ---------- Team dashboard (overhaul) */
.admin-tabs { display:flex; grid-template-columns:none; overflow-x:auto; scrollbar-width:none; -webkit-overflow-scrolling:touch; }
.admin-tabs::-webkit-scrollbar { display:none; }
.admin-tab { flex:none; padding:10px 14px; white-space:nowrap; display:inline-flex; align-items:center; gap:6px; }
.admin-count { min-width:20px; height:20px; padding:0 6px; border-radius:999px; background:#c2410c; color:#fff; font-size:.72rem; font-weight:700; display:inline-flex; align-items:center; justify-content:center; }
.admin-count[hidden], .admin-alert[hidden] { display:none; }
.admin-alert { width:100%; text-align:start; padding:14px 16px; border-radius:16px; background:#fff7ed; color:#9a3412; border:1.5px solid #fdba74; font-weight:700; box-shadow:none; }
:root[data-theme=dark] .admin-alert { background:#3b1d0c; color:#fed7aa; border-color:#9a3412; }
.admin-seg3 { grid-template-columns:1fr 1fr 1fr; }
.admin-toggle { margin:0 0 12px; }
.admin-list { display:flex; flex-direction:column; gap:10px; }
.admin-rep { padding:14px; border:1.5px solid var(--line); border-radius:16px; display:flex; flex-direction:column; gap:8px; }
.admin-rep-top { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.admin-rep-when { font-size:.76rem; color:var(--muted); font-variant-numeric:tabular-nums; }
.admin-rep-who { display:flex; align-items:center; gap:12px; }
.admin-rep-wt { flex:1; min-width:0; }
.admin-rep-wt .admin-user-name { display:flex; flex-wrap:wrap; align-items:center; gap:6px; white-space:normal; }
.admin-rep-line { font-size:.84rem; color:var(--ink); }
.admin-rep-note { font-size:.9rem; color:var(--ink); padding:8px 12px; border-radius:12px; background:var(--tinted); }
.admin-rep-by { margin:0; }
.admin-photo { flex:none; width:72px; height:72px; border-radius:14px; object-fit:cover; border:1.5px solid var(--line); background:var(--tint); }
.admin-detail-top { display:flex; gap:12px; align-items:flex-start; margin-bottom:10px; }
.admin-detail-tx { flex:1; min-width:0; }
.admin-detail-tx .admin-off-meta { margin:0 0 4px; }
.admin-susp { padding:10px 12px; border-radius:12px; background:#fff7ed; color:#9a3412; font-size:.84rem; font-weight:600; margin:0 0 10px; }
:root[data-theme=dark] .admin-susp { background:#3b1d0c; color:#fed7aa; }
.admin-sub { margin:0 0 12px; }
.admin-sub-t { font-size:.72rem; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--muted); margin:0 0 6px; }
.admin-sub-row { font-size:.82rem; color:var(--ink); padding:6px 0; border-bottom:1px dashed var(--line); overflow-wrap:anywhere; }
.admin-sub-row:last-child { border-bottom:0; }
.admin-member { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px dashed var(--line); }
.admin-member:last-child { border-bottom:0; }
.admin-member-tx { flex:1; min-width:0; }
.admin-member-name { font-weight:700; font-size:.9rem; color:var(--ink); display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.admin-user-acts .admin-mini { flex:none; width:auto; min-height:34px; padding:6px 12px; font-size:.8rem; }
.admin-member .admin-mini { flex:none; width:auto; min-height:34px; padding:6px 12px; font-size:.8rem; }
.admin-suspend { display:flex; flex-wrap:wrap; gap:8px; padding:10px; border:1.5px dashed var(--line); border-radius:14px; }
.admin-suspend > * { flex:1 1 140px; }
.admin-user-acts .admin-suspend button { flex:1 1 100%; }
.admin-select, .admin-input { min-height:42px; padding:8px 10px; border:1.5px solid var(--line); border-radius:10px; font:inherit; font-size:.88rem; color:var(--ink); background:var(--card); min-width:0; }
.admin-select:focus, .admin-input:focus { outline:none; border-color:var(--brand); }
.admin-words { display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
.admin-word { display:inline-flex; align-items:center; gap:2px; padding:2px 2px 2px 10px; border-radius:999px; background:var(--tint); color:var(--ink); font-size:.8rem; font-weight:600; }
.admin-word.whole { box-shadow:inset 0 0 0 1.5px var(--brand); }
.admin-word.armed { background:#ffedd5; color:#9a3412; }
.admin-words .admin-word-x { flex:none; width:26px; height:26px; min-height:26px; padding:0; border-radius:50%; background:transparent; border:0; color:var(--muted); font-size:1rem; line-height:1; box-shadow:none; }
.admin-log { display:flex; flex-direction:column; gap:2px; margin-bottom:10px; }
.admin-log-row { padding:8px 0; border-bottom:1px dashed var(--line); }
.admin-log-note { font-size:.84rem; color:var(--ink); overflow-wrap:anywhere; }
.admin-log-row.refused .admin-log-note { color:#c2410c; }
.admin-log-row .admin-off-meta { margin:2px 0 0; }
.prof-signin[hidden], .ps-report-open[hidden], #profPhotoDel[hidden], .ch-report[hidden] { display:none; }

/* Adjust photo: a square stage, everything outside the circle dimmed */
#profSheet.cropping .prof-photo, #profSheet.cropping #profBadgeNote, #profSheet.cropping #profForm { display:none; }
.crop[hidden], #profPhotoAdj[hidden] { display:none; }
.crop { display:flex; flex-direction:column; align-items:center; gap:12px; margin:4px 0 6px; }
.crop-stage { position:relative; width:min(300px, 100%); aspect-ratio:1 / 1; border-radius:22px; overflow:hidden; background:#0b1434; touch-action:none; cursor:grab; user-select:none; -webkit-user-select:none; }
.crop-stage:active { cursor:grabbing; }
.crop-stage:focus-visible { outline:3px solid var(--brand); outline-offset:3px; }
.crop-stage canvas { display:block; width:100%; height:100%; }
.crop-ring { position:absolute; inset:0; border-radius:50%; box-shadow:0 0 0 999px rgb(11 20 52 / 55%); border:2px solid rgb(255 255 255 / 85%); pointer-events:none; }
.crop-hint { margin:0; text-align:center; }
.crop-tools { display:flex; align-items:center; gap:10px; width:min(300px, 100%); }
.crop-tools input[type=range] { flex:1; min-width:0; accent-color:var(--brand); height:28px; }
.crop-zi { flex:none; width:18px; height:18px; color:var(--muted); }
.crop-tools .crop-rot { flex:none; width:44px; height:44px; min-height:44px; padding:0; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; }
.crop-acts { width:100%; }
.crop-acts > * { flex:1; }
.prof-photo-acts .link-btn { padding:0 6px; }

/* How-to tips only for people who are new (a week, or 15 drinks) */
body.seasoned .tip-new { display:none !important; }

/* Header: streak fire and your photo (language moved to Me > Look & language) */
.streak-fire { flex:none; display:inline-flex; align-items:center; gap:4px; min-width:44px; min-height:40px; padding:4px 12px; border-radius:999px; background:var(--tint); color:var(--brand); box-shadow:none; font-family:'Space Grotesk','IBM Plex Sans',sans-serif; font-weight:700; font-size:1rem; }
.streak-fire .fire { font-size:1.25rem; line-height:1; filter:grayscale(1) brightness(1.1); opacity:.4; transition:filter .4s, opacity .4s, transform .4s; }
.streak-fire.lit .fire { filter:drop-shadow(0 0 6px rgb(255 140 40 / 55%)); opacity:1; animation:fire-flicker 2.4s ease-in-out infinite; transform-origin:50% 90%; }
.streak-fire .fire-n:empty { display:none; }
@keyframes fire-flicker { 0%,100% { transform:scale(1) rotate(0); } 30% { transform:scale(1.06) rotate(-2deg); } 60% { transform:scale(.97) rotate(1.5deg); } }
.head-ava { flex:none; width:42px; height:42px; min-height:42px; padding:0; border-radius:50%; background:none; box-shadow:0 0 0 2px var(--bg), 0 0 0 3.5px var(--line); }
.head-ava .ava { width:42px; height:42px; font-size:1.05rem; }
@media(hover:hover) { .head-ava:hover { box-shadow:0 0 0 2px var(--bg), 0 0 0 3.5px var(--brand); filter:none; } }

/* 2.7.8: Connect tabs at the top, Me settings in a bottom sheet */
.seg-ctl.seg3 { grid-template-columns:repeat(3, 1fr); }
.seg-ctl[hidden] { display:none; }
.seg-ctl.seg3 button { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-width:0; }
.seg-ctl.seg3 button > span[data-i] { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.seg-ctl.seg3 .cx-badge { flex:none; }
#tab-challenges.cx-out .page-head .kicker { display:none !important; }
.set-sheet .sheet-panel { max-width:560px; }
.set-sheet .set-pane > .card:first-child { margin-top:2px; }

/* 2.7.9: full-screen scanner with a how-to animation */
body.scan-open { overflow:hidden; }
.scan-view { position:fixed; inset:0; z-index:93; display:flex; flex-direction:column; gap:12px; background:#0B1030; color:#fff; padding:calc(16px + env(safe-area-inset-top,0px)) 18px calc(22px + env(safe-area-inset-bottom,0px)); }
.scan-view[hidden] { display:none; }
.scan-top { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.scan-title { margin:0; font-family:'Space Grotesk',sans-serif; font-weight:700; font-size:1.3rem; line-height:1.2; color:#fff; }
.scan-x { flex:none; width:44px; height:44px; min-height:44px; padding:0; border-radius:50%; background:rgb(255 255 255 / 12%); color:#fff; display:inline-flex; align-items:center; justify-content:center; box-shadow:none; }
.scan-stage { flex:1; min-height:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:16px; }
.scan-finder { position:relative; width:min(80vw, 48vh, 330px); aspect-ratio:1 / 1; border-radius:30px; overflow:hidden; background:#000; }
.scan-finder video { position:absolute; inset:0; width:100%; height:100%; max-width:none; object-fit:cover; border-radius:0; }
.scan-corner { position:absolute; z-index:2; width:46px; height:46px; border:4px solid #fff; pointer-events:none; transition:border-color .25s; }
.scan-corner.tl { top:16px; left:16px; border-right:0; border-bottom:0; border-top-left-radius:18px; }
.scan-corner.tr { top:16px; right:16px; border-left:0; border-bottom:0; border-top-right-radius:18px; }
.scan-corner.bl { bottom:16px; left:16px; border-right:0; border-top:0; border-bottom-left-radius:18px; }
.scan-corner.br { bottom:16px; right:16px; border-left:0; border-top:0; border-bottom-right-radius:18px; }
.scan-view.found .scan-corner { border-color:#5ED39A; }
.scan-line { position:absolute; z-index:2; left:22px; right:22px; top:22px; height:3px; border-radius:3px; background:linear-gradient(90deg, transparent, #8FB6FF 20%, #8FB6FF 80%, transparent); box-shadow:0 0 16px 3px rgb(143 182 255 / 55%); animation:scan-sweep 2.2s ease-in-out infinite alternate; }
.scan-view.found .scan-line { display:none; }
@keyframes scan-sweep { from { top:22px; } to { top:calc(100% - 25px); } }
.scan-how { position:absolute; inset:0; z-index:3; display:flex; align-items:center; justify-content:center; background:radial-gradient(circle at 50% 40%, #1A2566, #0B1030 75%); transition:opacity .5s ease, visibility .5s; }
.scan-how.gone { opacity:0; visibility:hidden; }
.scan-how svg { width:84%; height:84%; overflow:visible; }
.how-phone { transform-box:fill-box; transform-origin:center; animation:how-phone 3.6s cubic-bezier(.2,.8,.2,1) infinite; }
.how-beam { animation:how-beam 3.6s ease-in-out infinite; }
.how-check { transform-box:fill-box; transform-origin:center; animation:how-check 3.6s ease-out infinite; }
.how-qr { animation:how-qr 3.6s ease-out infinite; }
@keyframes how-phone {
  0% { opacity:0; transform:translate(46px, 56px) rotate(14deg); }
  10% { opacity:1; }
  32%, 86% { opacity:1; transform:translate(-14px, 4px) rotate(-4deg); }
  100% { opacity:0; transform:translate(-14px, 4px) rotate(-4deg); }
}
@keyframes how-beam {
  0%, 34% { opacity:0; transform:translateY(0); }
  38% { opacity:1; transform:translateY(0); }
  52% { opacity:1; transform:translateY(33px); }
  66% { opacity:1; transform:translateY(0); }
  70%, 100% { opacity:0; transform:translateY(0); }
}
@keyframes how-check {
  0%, 68% { opacity:0; transform:scale(.4); }
  76% { opacity:1; transform:scale(1.12); }
  82%, 88% { opacity:1; transform:scale(1); }
  100% { opacity:0; transform:scale(1); }
}
@keyframes how-qr { 0%, 68% { filter:none; } 76%, 88% { filter:drop-shadow(0 0 8px #5ED39A); } 100% { filter:none; } }
.scan-hint { margin:0; max-width:330px; text-align:center; font-size:.95rem; line-height:1.45; color:#D6DCF5; }
.scan-view .scan-status { min-height:1.3em; text-align:center; color:#fff; font-weight:600; font-size:.92rem; }
.scan-bottom { display:flex; justify-content:center; }
.scan-photo { flex:none; width:min(100%, 330px); background:rgb(255 255 255 / 12%); color:#fff; box-shadow:none; }
@media (prefers-reduced-motion: reduce) {
  .scan-line, .how-phone, .how-beam, .how-check, .how-qr { animation:none; }
  .how-phone { transform:translate(-14px, 4px) rotate(-4deg); }
  .how-beam { opacity:0; }
  .how-check { opacity:1; }
}

/* 2.7.10: joining the official challenge happens in a sheet with a trophy that fills with water */
.ch-join { margin-top:12px; }
.ch-how { display:block; margin:10px auto 0; }
.jn-kicker { font-size:.7rem; font-weight:700; letter-spacing:.14em; text-transform:uppercase; color:#7A4F00; background:#FDF3DC; border-radius:999px; padding:5px 11px; }
:root[data-theme=dark] .jn-kicker { color:#F2C76E; background:rgb(232 176 74 / 16%); }
.jn-hero { display:flex; justify-content:center; margin:0 0 4px; color:var(--brand); }
.jn-hero svg { width:160px; height:120px; overflow:visible; }
.jn-cup { stroke:currentColor; stroke-width:4; stroke-linejoin:round; stroke-linecap:round; }
.jn-cup-bg { fill:var(--tint); }
.jn-stem { fill:currentColor; }
.jn-wave { fill:#6FA0F2; }
.jn-water { transform:translateY(34px); }
.jn-hero.play .jn-water { animation:jn-rise 1.7s cubic-bezier(.2,.8,.2,1) .15s both; }
.jn-hero.play .jn-wave { animation:jn-drift 2.4s linear infinite; }
@keyframes jn-rise { from { transform:translateY(82px); } to { transform:translateY(34px); } }
@keyframes jn-drift { from { transform:translateX(0); } to { transform:translateX(-40px); } }
.jn-spark { fill:#E8B04A; transform-box:fill-box; transform-origin:center; opacity:0; }
.jn-hero.play .jn-spark { animation:jn-twinkle 2.4s ease-in-out 1s infinite; }
.jn-hero.play .s2 { animation-delay:1.5s; } .jn-hero.play .s3 { animation-delay:2s; } .jn-hero.play .s4 { animation-delay:2.5s; }
@keyframes jn-twinkle { 0%, 100% { opacity:0; transform:scale(.3) rotate(0deg); } 40% { opacity:1; transform:scale(1) rotate(45deg); } 75% { opacity:0; transform:scale(.4) rotate(90deg); } }
.jn-title { text-align:center; font-size:1.6rem; }
.jn-dates { text-align:center; margin:4px 0 0; color:var(--muted); font-size:.92rem; font-weight:600; }
.jn-prize { display:table; margin:12px auto 0; padding:8px 14px; border-radius:999px; background:#FDF3DC; color:#7A4F00; font-size:.92rem; }
.jn-prize[hidden] { display:none; }
.jn-prize b { margin-inline-end:.35em; }
:root[data-theme=dark] .jn-prize { background:rgb(232 176 74 / 16%); color:#F2C76E; }
.jn-steps { list-style:none; padding:0; margin:16px 0 8px; display:flex; flex-direction:column; gap:8px; }
.jn-steps li { display:flex; gap:12px; align-items:flex-start; padding:12px 14px; border-radius:16px; background:var(--card); border:1px solid var(--line); font-size:.93rem; line-height:1.45; color:var(--ink); }
.jn-num { flex:none; width:28px; height:28px; border-radius:50%; background:var(--brand); color:var(--on-brand); display:flex; align-items:center; justify-content:center; font-family:'Space Grotesk',sans-serif; font-weight:700; font-size:.88rem; }
.jn-rules { margin:6px 2px 14px; font-size:.8rem; }
#jnForm[hidden] { display:none; }
#jnForm .stack-field { margin-bottom:10px; }
.jn-codehint { margin-top:6px; }
@media (prefers-reduced-motion: reduce) {
  .jn-hero.play .jn-water, .jn-hero.play .jn-wave, .jn-hero.play .jn-spark { animation:none; }
  .jn-spark { opacity:.9; }
}
