@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Space+Grotesk:wght@600;700&display=swap');

:root {
  color-scheme: dark;
  --ink: #07100e;
  --ink-2: #0b1714;
  --surface: #10201c;
  --surface-2: #142822;
  --surface-3: #1a3029;
  --line: rgba(219, 255, 242, 0.11);
  --line-strong: rgba(219, 255, 242, 0.19);
  --text: #f2fff9;
  --muted: #91aaa0;
  --muted-light: #b8cbc4;
  --lime: #b7ff3c;
  --lime-soft: #d8ff94;
  --teal: #28e0b9;
  --orange: #ff9c46;
  --pink: #ff668d;
  --yellow: #ffd45f;
  --danger: #ff7185;
  --shadow: 0 22px 65px rgba(0, 0, 0, 0.34);
  --radius-sm: 14px;
  --radius: 20px;
  --radius-lg: 28px;
  --font: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --display: 'Space Grotesk', 'Manrope', system-ui, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--ink);
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -20%, rgba(40, 224, 185, 0.12), transparent 42%),
    linear-gradient(180deg, #091411 0%, var(--ink) 58%, #060d0b 100%);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:not(:disabled),
select:not(:disabled) {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(183, 255, 60, 0.45);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.13;
  pointer-events: none;
}

.ambient-one {
  top: -180px;
  right: -170px;
  background: var(--teal);
}

.ambient-two {
  bottom: 0;
  left: -240px;
  background: var(--lime);
  opacity: 0.07;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--lime);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.35;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.glass-card {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(21, 42, 35, 0.9), rgba(10, 23, 19, 0.91));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand-mark {
  position: relative;
  display: grid;
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(183, 255, 60, 0.35);
  border-radius: 18px 8px 18px 8px;
  background:
    linear-gradient(135deg, rgba(183, 255, 60, 0.22), transparent 52%),
    #10221b;
  box-shadow: inset 0 0 18px rgba(183, 255, 60, 0.08), 0 8px 30px rgba(183, 255, 60, 0.08);
  color: var(--lime);
  font-family: var(--display);
  font-size: 2rem;
  font-style: italic;
  font-weight: 700;
  transform: skew(-4deg);
}

.brand-mark::after {
  position: absolute;
  right: 7px;
  bottom: 8px;
  width: 17px;
  height: 2px;
  border-radius: 99px;
  background: var(--teal);
  box-shadow: 0 -5px 0 rgba(40, 224, 185, 0.46);
  content: '';
  transform: skew(4deg);
}

.brand-mark-xl {
  width: 92px;
  height: 92px;
  border-radius: 28px 12px 28px 12px;
  font-size: 3.5rem;
}

.brand-mark-sm {
  width: 37px;
  height: 37px;
  border-radius: 12px 5px 12px 5px;
  font-size: 1.35rem;
}

.brand-mark-sm::after {
  right: 5px;
  bottom: 5px;
  width: 11px;
  box-shadow: 0 -4px 0 rgba(40, 224, 185, 0.46);
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 22px;
  background:
    radial-gradient(circle at 50% 42%, rgba(183, 255, 60, 0.1), transparent 28%),
    var(--ink);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.splash.is-done {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.splash .eyebrow {
  color: var(--muted-light);
}

.splash-loader {
  width: 132px;
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}

.splash-loader span {
  display: block;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--lime));
  animation: loading 1.05s ease-in-out infinite alternate;
}

@keyframes loading {
  from { transform: translateX(-25%); }
  to { transform: translateX(145%); }
}

.connection-banner {
  position: fixed;
  z-index: 120;
  top: calc(var(--safe-top) + 10px);
  left: 50%;
  width: min(calc(100% - 24px), 560px);
  padding: 11px 15px;
  border: 1px solid rgba(255, 212, 95, 0.24);
  border-radius: 14px;
  background: rgba(29, 29, 18, 0.96);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.35);
  color: #efe7c4;
  font-size: 0.78rem;
  text-align: center;
  transform: translateX(-50%);
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--yellow);
}

/* Authentication */
.auth-view {
  width: min(100%, 1060px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 36px) 20px calc(var(--safe-bottom) + 28px);
}

.auth-hero {
  max-width: 570px;
  margin: 0 auto 27px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 15px;
}

.brand-kicker {
  margin: 0 0 1px;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.brand-lockup h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 10vw, 3.8rem);
  letter-spacing: -0.07em;
  line-height: 0.92;
}

.brand-lockup h1 em,
.mini-brand em {
  margin-left: 5px;
  color: var(--lime);
  font-style: italic;
}

.auth-lede {
  max-width: 500px;
  margin: 26px 0 18px;
  color: var(--muted-light);
  font-size: clamp(1.03rem, 4vw, 1.34rem);
  font-weight: 500;
  line-height: 1.55;
}

.challenge-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.challenge-pills span,
.count-pill,
.role-pill {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted-light);
  font-size: 0.71rem;
  font-weight: 700;
}

.auth-card {
  width: min(100%, 510px);
  margin: 0 auto;
  padding: 10px 18px 21px;
  border-radius: var(--radius-lg);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(3, 10, 8, 0.5);
}

.auth-tabs {
  margin-bottom: 25px;
}

.segment {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 0.81rem;
  font-weight: 800;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.segment.is-active {
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.form-heading {
  margin-bottom: 22px;
}

.form-heading h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.47rem;
  letter-spacing: -0.04em;
}

.field {
  display: grid;
  gap: 8px;
  margin: 0 0 15px;
}

.field > span {
  color: var(--muted-light);
  font-size: 0.72rem;
  font-weight: 800;
}

.field input,
.field select {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  outline: none;
  background: rgba(2, 10, 8, 0.55);
  color: var(--text);
  font-size: 0.93rem;
  transition: border 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.field input::placeholder {
  color: #688078;
}

.field input:focus,
.field select:focus {
  border-color: rgba(183, 255, 60, 0.45);
  background: rgba(5, 16, 13, 0.75);
  box-shadow: 0 0 0 4px rgba(183, 255, 60, 0.07);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pin-field {
  position: relative;
}

.pin-field input {
  padding-right: 65px;
}

.reveal-button {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 54px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--lime);
  font-size: 0.68rem;
  font-weight: 800;
}

.form-hint,
.form-error {
  margin: -3px 0 16px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.5;
}

.form-error {
  margin: 15px 3px 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 113, 133, 0.22);
  border-radius: 11px;
  background: rgba(255, 113, 133, 0.07);
  color: #ffc1ca;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--lime), #91ef2e);
  box-shadow: 0 10px 24px rgba(156, 235, 50, 0.13);
  color: #0a150d;
  font-size: 0.82rem;
  font-weight: 800;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.primary-button:active,
.secondary-button:active {
  transform: scale(0.98);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.8);
  opacity: 0.48;
}

.primary-button b {
  font-size: 1.1rem;
}

.secondary-button {
  border: 1px solid rgba(183, 255, 60, 0.26);
  background: rgba(183, 255, 60, 0.08);
  box-shadow: none;
  color: var(--lime);
}

.full-width {
  width: 100%;
}

.auth-footer,
.version-label {
  margin: 18px auto 0;
  color: #60776f;
  font-size: 0.67rem;
  font-weight: 700;
  text-align: center;
}

.organizer-login-link {
  display: block;
  min-height: 44px;
  margin: 10px auto -10px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(145, 170, 160, 0.35);
  text-underline-offset: 4px;
}

/* Authenticated app shell */
.app-view {
  width: min(100%, 760px);
  min-height: 100dvh;
  margin: 0 auto;
}

.app-header {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  height: calc(67px + var(--safe-top));
  align-items: flex-end;
  justify-content: space-between;
  padding: var(--safe-top) 18px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(7, 16, 14, 0.86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.mini-brand {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

.mini-brand > span:last-child {
  font-family: var(--display);
  font-size: 0.98rem;
  letter-spacing: -0.04em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sync-status {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: transparent;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
}

.sync-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal);
}

.sync-status.is-syncing i {
  background: var(--yellow);
  animation: pulse 0.8s ease infinite alternate;
}

.sync-status.is-offline i {
  background: var(--muted);
  box-shadow: none;
}

@keyframes pulse {
  to { opacity: 0.28; transform: scale(0.75); }
}

.avatar-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(183, 255, 60, 0.22);
  border-radius: 50%;
  background: linear-gradient(145deg, #20362e, #102019);
  color: var(--lime-soft);
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 700;
}

.app-content {
  min-height: calc(100dvh - 67px);
  padding: 22px 17px calc(102px + var(--safe-bottom));
}

.app-screen {
  animation: screen-in 0.28s ease both;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(8px); }
}

.nudge-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 10px;
  border: 1px solid rgba(255, 212, 95, 0.19);
  border-radius: 16px;
  background: rgba(255, 212, 95, 0.06);
}

.nudge-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 212, 95, 0.12);
  color: var(--yellow);
}

.nudge-card div {
  min-width: 0;
  flex: 1;
}

.nudge-card strong {
  font-size: 0.75rem;
}

.nudge-card p {
  overflow: hidden;
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 0.64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nudge-card button {
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 212, 95, 0.12);
  color: var(--yellow);
  font-size: 0.68rem;
  font-weight: 800;
}

.today-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  align-items: center;
  gap: 10px;
  margin: 3px 2px 20px;
}

.today-copy h1,
.screen-hero h1,
.profile-hero h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.85rem, 8vw, 2.8rem);
  letter-spacing: -0.065em;
  line-height: 1.02;
}

.today-copy h1 span {
  color: var(--lime-soft);
}

.today-copy .muted {
  margin: 8px 0 0;
  font-size: 0.75rem;
}

.week-ring {
  position: relative;
  width: 106px;
  height: 106px;
}

.ring-track,
.ring-active {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 10px), #000 calc(100% - 9px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 10px), #000 calc(100% - 9px));
}

.ring-track {
  background: repeating-conic-gradient(from -90deg, rgba(220, 255, 241, 0.13) 0 39deg, transparent 39deg 45deg);
}

.ring-active {
  background: repeating-conic-gradient(from -90deg, var(--lime) 0 39deg, transparent 39deg 45deg);
  -webkit-mask:
    radial-gradient(farthest-side, transparent calc(100% - 10px), #000 calc(100% - 9px)),
    conic-gradient(from -90deg, #000 0 var(--challenge-angle), transparent var(--challenge-angle));
  -webkit-mask-composite: source-in;
  mask:
    radial-gradient(farthest-side, transparent calc(100% - 10px), #000 calc(100% - 9px)),
    conic-gradient(from -90deg, #000 0 var(--challenge-angle), transparent var(--challenge-angle));
  mask-composite: intersect;
  filter: drop-shadow(0 0 7px rgba(183, 255, 60, 0.38));
  transition: --challenge-angle 0.5s ease;
}

.ring-core {
  position: absolute;
  inset: 12px;
  display: grid;
  align-content: center;
  justify-items: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 28%, #173029, #0b1814 68%);
  box-shadow: inset 0 6px 18px rgba(255, 255, 255, 0.025);
}

.ring-core b {
  font-family: var(--display);
  font-size: 1.75rem;
  line-height: 0.9;
}

.ring-core span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scoreboard {
  display: grid;
  grid-template-columns: auto minmax(70px, 1fr);
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 28px;
  padding: 17px;
  border-radius: var(--radius);
}

.scoreboard p {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 700;
}

.scoreboard strong {
  display: flex;
  align-items: baseline;
  font-family: var(--display);
  font-size: 2rem;
  letter-spacing: -0.06em;
}

.scoreboard strong small {
  margin-left: 4px;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.69rem;
  letter-spacing: 0;
}

.score-progress,
.mini-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}

.score-progress span,
.mini-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--lime));
  box-shadow: 0 0 11px rgba(183, 255, 60, 0.25);
  transition: width 0.35s ease;
}

.scoreboard-meta {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  padding-top: 5px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 700;
}

.scoreboard-meta b {
  color: var(--text);
}

.section-heading {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 13px;
}

.section-heading.compact {
  margin-top: 27px;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.22rem;
  letter-spacing: -0.04em;
}

.date-chip {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted-light);
  font-size: 0.7rem;
  font-weight: 800;
}

.date-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  width: 140px;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: #12221e;
  box-shadow: var(--shadow);
}

.date-menu button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
}

.date-menu button:hover {
  background: rgba(255, 255, 255, 0.04);
}

.habit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.habit-card {
  position: relative;
  display: grid;
  min-height: 104px;
  grid-template-columns: 39px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: 8px 9px;
  overflow: hidden;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(18, 35, 30, 0.92), rgba(10, 21, 18, 0.92));
  color: var(--text);
  text-align: left;
  transition: border-color 0.18s ease, transform 0.15s ease, background 0.18s ease;
}

.habit-card:active {
  transform: scale(0.98);
}

.habit-card.is-complete {
  border-color: rgba(183, 255, 60, 0.34);
  background:
    radial-gradient(circle at 100% 0, rgba(183, 255, 60, 0.13), transparent 44%),
    linear-gradient(145deg, rgba(20, 42, 33, 0.96), rgba(10, 24, 19, 0.94));
}

.habit-card.is-locked {
  cursor: default;
  opacity: 0.76;
}

.habit-card.is-linked {
  border-color: rgba(255, 212, 95, 0.16);
  background:
    radial-gradient(circle at 100% 0, rgba(255, 212, 95, 0.08), transparent 43%),
    linear-gradient(145deg, rgba(18, 35, 30, 0.92), rgba(10, 21, 18, 0.92));
}

.habit-card.is-linked .habit-icon {
  background: rgba(255, 212, 95, 0.08);
  color: var(--yellow);
}

.habit-card.is-linked:not(.is-complete) .habit-check {
  color: var(--yellow);
}

.habit-icon {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--teal);
  font-size: 1rem;
  font-weight: 800;
}

.habit-copy {
  align-self: center;
  min-width: 0;
}

.habit-copy b {
  display: block;
  overflow: hidden;
  font-size: 0.76rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.habit-copy small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.habit-points {
  grid-column: 1 / 3;
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 800;
}

.habit-card.is-complete .habit-points {
  color: var(--lime);
}

.habit-check {
  position: absolute;
  right: 9px;
  bottom: 9px;
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: transparent;
  font-size: 0.68rem;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.habit-card.is-complete .habit-check {
  border-color: var(--lime);
  background: var(--lime);
  color: #0b160e;
  transform: scale(1.05);
}

.exercise-card {
  margin-top: 12px;
  overflow: hidden;
  padding: 16px;
  border: 1px solid rgba(40, 224, 185, 0.16);
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0, rgba(40, 224, 185, 0.11), transparent 42%),
    linear-gradient(145deg, #122921, #0b1915);
}

.exercise-top {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.exercise-icon {
  width: 42px;
  height: 42px;
  color: var(--lime);
}

.exercise-top h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1rem;
}

.exercise-top p:not(.eyebrow) {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.59rem;
}

.point-badge {
  align-self: start;
  padding: 6px 8px;
  border-radius: 99px;
  background: rgba(40, 224, 185, 0.09);
  color: var(--teal);
  font-size: 0.63rem;
  font-weight: 800;
}

.exercise-control {
  display: grid;
  grid-template-columns: 54px 1fr 54px;
  align-items: center;
  gap: 10px;
  margin: 17px 0 16px;
}

.exercise-control button {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted-light);
  font-size: 1.4rem;
  font-weight: 600;
}

.exercise-control button.plus {
  border-color: var(--lime);
  background: var(--lime);
  box-shadow: 0 10px 24px rgba(183, 255, 60, 0.13);
  color: #0a160d;
}

.exercise-control > div {
  text-align: center;
}

.exercise-control strong {
  display: block;
  font-family: var(--display);
  font-size: 2rem;
  line-height: 1;
}

.exercise-control span {
  color: var(--muted);
  font-size: 0.6rem;
}

.exercise-bank {
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.exercise-bank > div:first-child {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 700;
}

.exercise-bank b {
  color: var(--muted-light);
}

.exercise-source {
  margin: 0.2rem 0 0.8rem;
  color: var(--muted-light);
  font-size: 0.78rem;
  line-height: 1.4;
  text-align: center;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.metric-row article {
  min-width: 0;
  padding: 14px 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  text-align: center;
}

.metric-icon {
  display: block;
  height: 20px;
  color: var(--teal);
  font-size: 0.83rem;
}

.metric-icon.flame {
  color: var(--orange);
}

.metric-row strong {
  display: block;
  margin-top: 3px;
  font-family: var(--display);
  font-size: 1.28rem;
}

.metric-row p {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Private food journal */
.food-screen {
  --food-accent: #ffd45f;
  --food-soft: rgba(255, 212, 95, 0.11);
}

.food-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 3px 2px 17px;
}

.food-hero-copy {
  min-width: 0;
}

.food-hero h1 {
  margin: 3px 0 0;
  font-family: var(--display);
  font-size: clamp(2rem, 9vw, 3rem);
  letter-spacing: -0.065em;
  line-height: 0.98;
}

.food-hero-copy > p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.food-private-pill {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding: 0 9px;
  border: 1px solid rgba(40, 224, 185, 0.2);
  border-radius: 99px;
  background: rgba(40, 224, 185, 0.06);
  color: var(--teal);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.food-private-pill span,
.food-connection-note > span {
  font-size: 0.45rem;
}

.food-add-button {
  display: inline-flex;
  min-height: 46px;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--lime), #91ef2e);
  box-shadow: 0 10px 25px rgba(183, 255, 60, 0.12);
  color: #09130c;
  font-size: 0.71rem;
  font-weight: 800;
}

.food-add-button span {
  font-family: var(--display);
  font-size: 1.1rem;
}

.food-add-button:disabled,
.scan-quick-button:disabled,
.meal-add-button:disabled,
.food-entry-main:disabled {
  cursor: not-allowed;
  filter: grayscale(0.5);
  opacity: 0.48;
}

.food-date-tabs {
  margin-bottom: 11px;
}

.food-connection-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid rgba(40, 224, 185, 0.13);
  border-radius: 13px;
  background: rgba(40, 224, 185, 0.04);
  color: var(--teal);
}

.food-connection-note.is-offline {
  border-color: rgba(255, 212, 95, 0.2);
  background: rgba(255, 212, 95, 0.06);
  color: var(--yellow);
}

.food-connection-note p {
  display: grid;
  gap: 1px;
  margin: 0;
}

.food-connection-note strong {
  color: var(--muted-light);
  font-size: 0.65rem;
}

.food-connection-note small {
  color: var(--muted);
  font-size: 0.58rem;
  line-height: 1.45;
}

.food-loading {
  display: flex;
  min-height: 170px;
  align-items: center;
  justify-content: center;
  gap: 11px;
  color: var(--muted);
  font-size: 0.69rem;
}

.food-loading span {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.09);
  border-top-color: var(--lime);
  border-radius: 50%;
  animation: food-spin 0.75s linear infinite;
}

@keyframes food-spin { to { transform: rotate(360deg); } }

.calorie-setup-card {
  display: grid;
  grid-template-columns: 51px minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius);
}

.calorie-setup-card .primary-button {
  grid-column: 1 / -1;
  margin-top: 2px;
}

.calorie-setup-icon {
  display: grid;
  width: 51px;
  height: 51px;
  place-items: center;
  border: 1px solid rgba(255, 212, 95, 0.25);
  border-radius: 16px 7px 16px 7px;
  background: var(--food-soft);
  color: var(--food-accent);
  font-family: var(--display);
  font-size: 1.5rem;
}

.calorie-setup-card h2,
.calorie-range-card h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.18rem;
  letter-spacing: -0.04em;
}

.calorie-setup-card p:last-child {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.55;
}

.calorie-range-card {
  padding: 18px;
  overflow: hidden;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 100% 0, rgba(255, 212, 95, 0.1), transparent 35%),
    linear-gradient(145deg, rgba(21, 42, 35, 0.94), rgba(10, 23, 19, 0.94));
}

.calorie-card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.icon-text-button,
.scan-quick-button {
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted-light);
  font-size: 0.62rem;
  font-weight: 800;
}

.calorie-readout {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr;
  align-items: end;
  gap: 8px;
  margin: 20px 0 14px;
  text-align: center;
}

.calorie-readout > div {
  display: grid;
  gap: 3px;
}

.calorie-readout span {
  color: var(--muted);
  font-size: 0.55rem;
  font-weight: 800;
  text-transform: uppercase;
}

.calorie-readout strong {
  font-family: var(--display);
  font-size: 0.95rem;
}

.calorie-readout .calorie-total strong {
  color: var(--food-accent);
  font-size: 2.4rem;
  letter-spacing: -0.07em;
  line-height: 0.9;
}

.calorie-total small {
  color: var(--muted);
  font-size: 0.55rem;
  font-weight: 800;
}

.calorie-range-track {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
}

.calorie-range-track i,
.calorie-target-band {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  border-radius: inherit;
}

.calorie-target-band {
  z-index: 1;
  border: 1px solid rgba(255, 212, 95, 0.45);
  background: rgba(255, 212, 95, 0.13);
}

.calorie-range-track i {
  z-index: 2;
  width: 0;
  background: linear-gradient(90deg, var(--teal), var(--lime));
  box-shadow: 0 0 9px rgba(183, 255, 60, 0.22);
  transition: width 0.3s ease;
}

.calorie-range-card.is-over .calorie-range-track i {
  background: linear-gradient(90deg, var(--yellow), var(--pink));
}

.calorie-message {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.5;
  text-align: center;
}

.food-energy-credit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.food-energy-credit > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.food-energy-credit span,
.fraction-picker > span {
  color: var(--muted);
  font-size: 0.51rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.food-energy-credit strong {
  color: var(--muted-light);
  font-family: var(--display);
  font-size: 0.82rem;
}

.food-energy-credit small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.49rem;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.recent-foods-section {
  margin-top: 26px;
}

.recent-foods-list {
  display: flex;
  gap: 9px;
  margin: 0 -17px;
  padding: 0 17px 5px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.recent-foods-list::-webkit-scrollbar {
  display: none;
}

.recent-food-button {
  display: grid;
  min-width: 154px;
  min-height: 98px;
  grid-template-columns: 1fr auto;
  align-content: space-between;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(24, 46, 39, 0.8), rgba(12, 26, 22, 0.88));
  text-align: left;
  scroll-snap-align: start;
}

.recent-food-button strong {
  overflow: hidden;
  font-size: 0.68rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-food-button small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.56rem;
}

.recent-food-button b {
  color: var(--lime);
  font-family: var(--display);
  font-size: 1rem;
}

.food-section-heading {
  align-items: center;
}

.scan-quick-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--teal);
}

.food-meals {
  display: grid;
  gap: 11px;
}

.meal-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(14, 29, 24, 0.68);
}

.meal-card-header {
  display: flex;
  min-height: 55px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
}

.meal-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.meal-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  background: var(--food-soft);
  color: var(--food-accent);
  font-family: var(--display);
}

.meal-heading strong {
  display: block;
  font-size: 0.72rem;
}

.meal-heading small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.55rem;
}

.meal-add-button {
  display: grid;
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(183, 255, 60, 0.2);
  border-radius: 12px;
  background: rgba(183, 255, 60, 0.06);
  color: var(--lime);
  font-family: var(--display);
  font-size: 1.1rem;
}

.meal-entries {
  border-top: 1px solid var(--line);
}

.meal-empty {
  margin: 0;
  padding: 13px 14px 15px;
  color: #60776e;
  font-size: 0.6rem;
}

.food-entry {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 7px 4px 13px;
  border-bottom: 1px solid var(--line);
}

.food-entry:last-child {
  border-bottom: 0;
}

.food-entry-main {
  display: grid;
  min-width: 0;
  min-height: 53px;
  flex: 1;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  gap: 2px 10px;
  padding: 7px 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.food-entry-main strong {
  overflow: hidden;
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.food-entry-main small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.54rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.food-entry-main b {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  color: var(--muted-light);
  font-family: var(--display);
  font-size: 0.75rem;
}

.food-entry-edit {
  width: 37px;
  height: 37px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
}

.food-finish-card {
  margin-top: 22px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.018);
}

.food-finish-card.is-finished {
  border-color: rgba(183, 255, 60, 0.22);
  background: rgba(183, 255, 60, 0.045);
}

.food-finish-copy {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 12px;
}

.food-finish-copy > span {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: rgba(183, 255, 60, 0.08);
  color: var(--lime);
}

.food-finish-copy strong {
  font-size: 0.73rem;
}

.food-finish-copy p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.59rem;
  line-height: 1.45;
}

.paper-journal-button {
  min-height: 42px;
  margin-top: 8px;
  border: 1px dashed rgba(255, 212, 95, 0.32);
  border-radius: 13px;
  background: rgba(255, 212, 95, 0.045);
  color: var(--food-accent);
  font-size: 0.65rem;
  font-weight: 850;
}

.paper-journal-button:disabled {
  opacity: 0.45;
}

.nutrition-toggle {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 14px 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.nutrition-toggle input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  accent-color: var(--lime);
}

.nutrition-toggle span {
  display: grid;
  gap: 3px;
}

.nutrition-toggle strong {
  font-size: 0.68rem;
}

.nutrition-toggle small {
  color: var(--muted);
  font-size: 0.56rem;
  line-height: 1.45;
}

.energy-modal-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(40, 224, 185, 0.045);
  color: var(--muted);
  font-size: 0.6rem;
}

.energy-modal-summary strong {
  color: var(--teal);
}

.fraction-picker {
  display: grid;
  gap: 7px;
  margin: -2px 0 12px;
}

.fraction-picker > div {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.fraction-picker button {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted-light);
  font-size: 0.72rem;
  font-weight: 850;
}

.fraction-picker button.is-selected {
  border-color: rgba(255, 212, 95, 0.55);
  background: rgba(255, 212, 95, 0.12);
  color: var(--food-accent);
}

.food-privacy-note {
  margin-top: 13px;
}

.food-source-note {
  margin: 12px 4px 0;
  color: #5f766d;
  font-size: 0.55rem;
  line-height: 1.55;
  text-align: center;
}

.food-source-note a {
  color: var(--muted);
  text-decoration-color: rgba(145, 170, 160, 0.35);
  text-underline-offset: 3px;
}

/* Food search and entry sheets */
.modal.is-food-modal {
  max-height: min(92dvh, 820px);
  padding-bottom: 24px;
}

.food-modal-tabs {
  grid-template-columns: repeat(3, 1fr);
  margin: 14px 0;
}

.food-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.food-search-form input,
.barcode-manual-row input {
  width: 100%;
  min-height: 49px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: none;
  background: rgba(2, 10, 8, 0.55);
  color: var(--text);
}

.food-search-form button,
.barcode-manual-row button {
  min-height: 49px;
  padding: 0 15px;
  border: 0;
  border-radius: 12px;
  background: var(--lime);
  color: #08110a;
  font-size: 0.67rem;
  font-weight: 800;
}

.food-search-status {
  min-height: 20px;
  margin: 8px 2px;
  color: var(--muted);
  font-size: 0.6rem;
}

.food-search-results {
  display: grid;
  gap: 7px;
  max-height: 43dvh;
  overflow-y: auto;
}

.food-result-button {
  display: grid;
  width: 100%;
  min-height: 65px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  gap: 3px 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
}

.food-result-button strong {
  overflow: hidden;
  font-size: 0.67rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.food-result-button small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.55rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.food-result-button b {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  color: var(--lime);
  font-family: var(--display);
  font-size: 0.75rem;
}

.food-data-disclaimer {
  margin: 11px 2px 0 !important;
  color: #647b72;
  font-size: 0.55rem;
  line-height: 1.5;
}

.food-data-disclaimer a {
  color: var(--muted);
}

.barcode-panel {
  display: grid;
  gap: 11px;
}

.barcode-camera {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: #050c0a;
}

.barcode-camera video {
  display: block;
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.barcode-camera::after {
  position: absolute;
  top: 50%;
  right: 13%;
  left: 13%;
  height: 1px;
  background: var(--lime);
  box-shadow: 0 0 12px var(--lime);
  content: '';
}

.barcode-camera-placeholder {
  display: grid;
  min-height: 190px;
  align-content: center;
  justify-items: center;
  gap: 7px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.barcode-camera-placeholder span {
  color: var(--teal);
  font-size: 2rem;
}

.barcode-camera-placeholder strong {
  color: var(--muted-light);
  font-size: 0.7rem;
}

.barcode-camera-placeholder p {
  margin: 0;
  font-size: 0.58rem;
}

.barcode-manual-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.food-entry-form .field-row {
  align-items: end;
}

.food-entry-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 15px;
  padding: 12px;
  border: 1px solid rgba(255, 212, 95, 0.18);
  border-radius: 13px;
  background: var(--food-soft);
}

.food-entry-summary span {
  color: var(--muted);
  font-size: 0.61rem;
}

.food-entry-summary strong {
  color: var(--food-accent);
  font-family: var(--display);
  font-size: 1.25rem;
}

.food-form-actions {
  display: grid;
  gap: 8px;
}

.food-delete-button {
  min-height: 44px;
  border: 1px solid rgba(255, 113, 133, 0.2);
  border-radius: 12px;
  background: rgba(255, 113, 133, 0.05);
  color: #ff9eac;
  font-size: 0.65rem;
  font-weight: 800;
}

/* Leaderboard */
.screen-hero {
  margin: 6px 2px 22px;
}

.screen-hero > p:last-child {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.leaderboard-tabs {
  margin-bottom: 9px;
}

.updated-label {
  margin: 0 4px 24px;
  color: #5f766d;
  font-size: 0.59rem;
  font-weight: 700;
  text-align: right;
}

.podium {
  display: grid;
  min-height: 190px;
  grid-template-columns: 1fr 1.1fr 1fr;
  align-items: end;
  gap: 8px;
  margin: 0 1px 18px;
}

.podium-person {
  position: relative;
  display: grid;
  justify-items: center;
  padding: 12px 5px 13px;
  border: 1px solid var(--line);
  border-radius: 17px 17px 8px 8px;
  background: linear-gradient(180deg, rgba(28, 47, 41, 0.8), rgba(12, 25, 21, 0.9));
  text-align: center;
}

.podium-person.place-1 {
  min-height: 184px;
  border-color: rgba(183, 255, 60, 0.24);
  background:
    radial-gradient(circle at 50% 0, rgba(183, 255, 60, 0.13), transparent 40%),
    linear-gradient(180deg, rgba(31, 55, 44, 0.9), rgba(12, 25, 21, 0.9));
  order: 2;
}

.podium-person.place-2 {
  min-height: 155px;
  order: 1;
}

.podium-person.place-3 {
  min-height: 136px;
  order: 3;
}

.podium-rank {
  position: absolute;
  top: -10px;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--muted-light);
  font-size: 0.65rem;
  font-weight: 800;
}

.place-1 .podium-rank {
  background: var(--lime);
  color: var(--ink);
}

.podium-avatar,
.leader-avatar,
.boost-avatar {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  background: linear-gradient(145deg, #29483e, #13251f);
  color: var(--lime-soft);
  font-family: var(--display);
  font-size: 0.82rem;
}

.place-1 .podium-avatar {
  width: 58px;
  height: 58px;
  margin-top: 8px;
  border-color: rgba(183, 255, 60, 0.28);
  box-shadow: 0 0 0 5px rgba(183, 255, 60, 0.05);
}

.podium-person strong {
  width: 100%;
  margin-top: 9px;
  overflow: hidden;
  font-size: 0.71rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-person b {
  margin-top: 2px;
  color: var(--lime);
  font-family: var(--display);
  font-size: 1rem;
}

.podium-person small {
  color: var(--muted);
  font-size: 0.51rem;
}

.leaderboard-list {
  display: grid;
  gap: 8px;
}

.leader-row {
  display: grid;
  grid-template-columns: 27px 43px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 68px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.022);
}

.leader-row.is-you {
  border-color: rgba(40, 224, 185, 0.24);
  background: rgba(40, 224, 185, 0.05);
}

.leader-rank {
  color: var(--muted);
  font-family: var(--display);
  font-size: 0.76rem;
  text-align: center;
}

.leader-avatar {
  width: 39px;
  height: 39px;
  font-size: 0.69rem;
}

.leader-main {
  min-width: 0;
}

.leader-main strong {
  display: block;
  overflow: hidden;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-main small {
  color: var(--muted);
  font-size: 0.55rem;
}

.leader-score {
  text-align: right;
}

.leader-score strong {
  display: block;
  font-family: var(--display);
  font-size: 0.92rem;
}

.leader-score small {
  color: var(--teal);
  font-size: 0.53rem;
  font-weight: 800;
}

.privacy-note {
  display: flex;
  gap: 11px;
  margin-top: 22px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--muted);
}

.privacy-note > span {
  color: var(--teal);
}

.privacy-note p {
  margin: 0;
  font-size: 0.63rem;
  line-height: 1.55;
}

.privacy-note strong {
  color: var(--muted-light);
}

/* Boosts */
.boost-hero {
  position: relative;
  padding-right: 96px;
}

.boost-counter {
  position: absolute;
  top: 12px;
  right: 0;
  display: grid;
  width: 78px;
  height: 78px;
  align-content: center;
  justify-items: center;
  border: 1px solid rgba(183, 255, 60, 0.18);
  border-radius: 24px 10px 24px 10px;
  background: rgba(183, 255, 60, 0.055);
}

.boost-counter strong {
  color: var(--lime);
  font-family: var(--display);
  font-size: 1.65rem;
  line-height: 1;
}

.boost-counter span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.48rem;
  font-weight: 800;
  text-align: center;
}

.boost-member-list {
  display: flex;
  gap: 10px;
  margin: 0 -17px;
  overflow-x: auto;
  padding: 2px 17px 8px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.boost-member-list::-webkit-scrollbar {
  display: none;
}

.boost-member {
  display: grid;
  min-width: 91px;
  min-height: 105px;
  justify-items: center;
  align-content: center;
  gap: 7px;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.025);
  scroll-snap-align: start;
}

.boost-member.is-selected {
  border-color: rgba(183, 255, 60, 0.34);
  background: rgba(183, 255, 60, 0.06);
}

.boost-member span:last-child {
  width: 100%;
  overflow: hidden;
  font-size: 0.64rem;
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.boost-member.is-disabled {
  cursor: default;
  opacity: 0.42;
}

.boost-composer {
  position: relative;
  margin-top: 15px;
  padding: 18px;
  border-radius: 21px;
  animation: screen-in 0.24s ease both;
}

.boost-composer h2 {
  margin: 0 0 16px;
  font-family: var(--display);
  font-size: 1.3rem;
}

.close-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted-light);
  font-size: 1.28rem;
}

.boost-composer .close-button {
  position: absolute;
  top: 8px;
  right: 8px;
}

.boost-presets {
  display: grid;
  gap: 8px;
  margin-bottom: 15px;
}

.boost-preset {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
}

.boost-preset.is-selected {
  border-color: rgba(183, 255, 60, 0.36);
  background: rgba(183, 255, 60, 0.055);
}

.boost-preset span {
  color: var(--lime);
  font-size: 0.9rem;
}

.received-boosts {
  display: grid;
  gap: 8px;
}

.received-boost {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.022);
}

.received-boost .boost-avatar {
  width: 38px;
  height: 38px;
  font-size: 0.64rem;
}

.received-boost strong {
  display: block;
  font-size: 0.67rem;
}

.received-boost p {
  margin: 2px 0 0;
  color: var(--muted-light);
  font-size: 0.6rem;
}

.received-boost time {
  color: var(--muted);
  font-size: 0.5rem;
}

.empty-state {
  padding: 27px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 17px;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.55;
  text-align: center;
}

/* Profile */
.profile-hero {
  display: grid;
  justify-items: center;
  margin: 5px 0 20px;
  text-align: center;
}

.profile-avatar {
  display: grid;
  width: 78px;
  height: 78px;
  margin-bottom: 15px;
  place-items: center;
  border: 1px solid rgba(183, 255, 60, 0.3);
  border-radius: 28px 12px 28px 12px;
  background:
    radial-gradient(circle at 35% 28%, rgba(183, 255, 60, 0.2), transparent 37%),
    #153027;
  box-shadow: 0 0 0 7px rgba(183, 255, 60, 0.035);
  color: var(--lime-soft);
  font-family: var(--display);
  font-size: 1.5rem;
}

.profile-hero > p:last-child {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 15px 4px;
  border-radius: 18px;
}

.profile-stats > div {
  display: grid;
  justify-items: center;
  padding: 0 5px;
  border-right: 1px solid var(--line);
}

.profile-stats > div:last-child {
  border: 0;
}

.profile-stats strong {
  font-family: var(--display);
  font-size: 1.25rem;
}

.profile-stats span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.52rem;
  font-weight: 700;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.badge-card {
  display: grid;
  min-height: 112px;
  align-content: center;
  justify-items: center;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.022);
  text-align: center;
}

.badge-card.is-locked {
  filter: grayscale(1);
  opacity: 0.42;
}

.badge-medallion {
  display: grid;
  width: 45px;
  height: 45px;
  place-items: center;
  border: 1px solid rgba(255, 212, 95, 0.24);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 212, 95, 0.22), rgba(255, 156, 70, 0.07));
  color: var(--yellow);
  font-family: var(--display);
  font-size: 1rem;
}

.badge-card strong {
  width: 100%;
  margin-top: 8px;
  overflow: hidden;
  font-size: 0.59rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.47rem;
}

.install-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  margin-top: 28px;
  padding: 16px;
  border: 1px solid rgba(183, 255, 60, 0.2);
  border-radius: 21px;
  background:
    radial-gradient(circle at 0 100%, rgba(40, 224, 185, 0.12), transparent 40%),
    rgba(183, 255, 60, 0.045);
}

.install-art {
  display: grid;
  align-items: start;
}

.install-card .brand-mark {
  width: 51px;
  height: 51px;
  border-radius: 16px 7px 16px 7px;
  font-size: 1.65rem;
}

.install-card h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1rem;
  letter-spacing: -0.035em;
}

.install-card p:not(.eyebrow) {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.61rem;
  line-height: 1.5;
}

.install-card .secondary-button {
  grid-column: 1 / -1;
  min-height: 46px;
}

.native-install-card {
  margin-top: 12px;
  border-color: rgba(40, 224, 185, 0.24);
  background:
    radial-gradient(circle at 100% 0, rgba(40, 224, 185, 0.14), transparent 44%),
    rgba(40, 224, 185, 0.045);
}

.native-install-card .native-brand-mark {
  border-color: rgba(40, 224, 185, 0.35);
  background: linear-gradient(145deg, rgba(40, 224, 185, 0.2), rgba(183, 255, 60, 0.12));
  color: var(--teal);
}

.native-download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.native-download-meta {
  grid-column: 1 / -1;
  margin-top: -5px;
  color: var(--muted);
  font-size: 0.55rem;
  text-align: center;
}

.role-pill {
  border-color: rgba(40, 224, 185, 0.18);
  background: rgba(40, 224, 185, 0.06);
  color: var(--teal);
}

.admin-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.admin-actions button {
  display: grid;
  min-height: 100px;
  grid-template-columns: 34px 1fr;
  grid-template-rows: auto auto;
  align-content: center;
  gap: 2px 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.023);
  text-align: left;
}

.admin-actions button > span {
  grid-row: 1 / 3;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: rgba(40, 224, 185, 0.08);
  color: var(--teal);
}

.admin-actions button b {
  align-self: end;
  font-size: 0.67rem;
}

.admin-actions button small {
  align-self: start;
  color: var(--muted);
  font-size: 0.53rem;
}

.profile-menu {
  margin-top: 28px;
  overflow: hidden;
  padding: 2px 14px;
  border-radius: 18px;
}

.profile-menu button {
  display: flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  font-size: 0.69rem;
  font-weight: 700;
}

.profile-menu button:last-child {
  border: 0;
}

.profile-menu button b {
  color: var(--muted);
  font-size: 0.62rem;
}

.profile-menu button.danger-row {
  color: #ff9eac;
}

/* Bottom navigation */
.bottom-nav {
  position: fixed;
  z-index: 50;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  height: calc(72px + var(--safe-bottom));
  grid-template-columns: repeat(5, 1fr);
  padding: 6px max(8px, calc((100% - 720px) / 2)) var(--safe-bottom);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(7, 16, 14, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.app-view.is-admin .bottom-nav {
  grid-template-columns: repeat(2, 1fr);
}

.app-view.is-admin .nav-button[data-view='today'],
.app-view.is-admin .nav-button[data-view='boosts'],
.app-view.is-admin .nav-button[data-view='food'] {
  display: none;
}

.nav-button {
  position: relative;
  display: grid;
  min-height: 58px;
  align-content: center;
  justify-items: center;
  gap: 3px;
  border: 0;
  background: transparent;
  color: #6f887f;
}

.nav-button::before {
  position: absolute;
  top: -7px;
  width: 27px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--lime);
  content: '';
  opacity: 0;
  transform: scaleX(0.3);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-button.is-active {
  color: var(--text);
}

.nav-button.is-active::before {
  opacity: 1;
  transform: scaleX(1);
}

.nav-icon {
  display: grid;
  min-width: 25px;
  height: 26px;
  place-items: center;
  color: inherit;
  font-size: 1rem;
}

.nav-button b {
  font-size: 0.56rem;
  font-weight: 800;
}

.boost-nav .nav-icon {
  width: 36px;
  height: 36px;
  margin-top: -14px;
  border: 1px solid rgba(183, 255, 60, 0.3);
  border-radius: 13px 6px 13px 6px;
  background: #1b332a;
  color: var(--lime);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.3);
}

/* Modal, toast, and celebration */
.modal-backdrop {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  align-items: end;
  padding: 16px 12px calc(12px + var(--safe-bottom));
  background: rgba(1, 6, 5, 0.77);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fade-in 0.18s ease both;
}

@keyframes fade-in { from { opacity: 0; } }

.modal {
  position: relative;
  width: min(100%, 520px);
  max-height: min(86dvh, 720px);
  margin: 0 auto;
  overflow-y: auto;
  padding: 25px 20px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 27px 27px 20px 20px;
  background:
    radial-gradient(circle at 0 0, rgba(40, 224, 185, 0.1), transparent 34%),
    #10201c;
  box-shadow: 0 -20px 70px rgba(0, 0, 0, 0.55);
  animation: modal-in 0.24s ease both;
}

@keyframes modal-in { from { transform: translateY(24px); } }

.modal > .close-button {
  position: absolute;
  top: 10px;
  right: 10px;
}

.modal-icon {
  display: grid;
  width: 53px;
  height: 53px;
  margin-bottom: 14px;
  place-items: center;
  border: 1px solid rgba(183, 255, 60, 0.26);
  border-radius: 17px 7px 17px 7px;
  background: rgba(183, 255, 60, 0.07);
  color: var(--lime);
  font-family: var(--display);
  font-size: 1.5rem;
}

.modal h2 {
  max-width: calc(100% - 45px);
  margin: 0;
  font-family: var(--display);
  font-size: 1.45rem;
  letter-spacing: -0.04em;
}

.modal-body {
  margin-top: 12px;
  color: var(--muted-light);
  font-size: 0.73rem;
  line-height: 1.6;
}

.modal-body p {
  margin: 0 0 10px;
}

.modal-body ol,
.modal-body ul {
  margin: 8px 0;
  padding-left: 20px;
}

.modal-body li {
  margin: 7px 0;
}

.modal-body .field {
  color: var(--text);
}

.modal-actions {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.modal-list {
  display: grid;
  gap: 7px;
}

.modal-list-row {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.modal-list-row button {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--lime);
  font-size: 0.61rem;
  font-weight: 800;
}

.toast-region {
  position: fixed;
  z-index: 250;
  top: calc(var(--safe-top) + 72px);
  right: 12px;
  left: 12px;
  display: grid;
  justify-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  width: min(100%, 430px);
  min-height: 48px;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(20, 39, 33, 0.97);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
  color: var(--muted-light);
  font-size: 0.68rem;
  font-weight: 700;
  animation: toast-in 0.25s ease both;
}

.toast::before {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: rgba(183, 255, 60, 0.1);
  color: var(--lime);
  content: '✓';
}

.toast.is-error::before {
  background: rgba(255, 113, 133, 0.1);
  color: var(--danger);
  content: '!';
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.97); }
}

.celebration {
  position: fixed;
  z-index: 245;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti {
  position: absolute;
  top: 42%;
  left: 50%;
  width: 7px;
  height: 13px;
  border-radius: 2px;
  background: var(--lime);
  animation: confetti-pop 0.9s cubic-bezier(0.15, 0.7, 0.24, 1) forwards;
}

@keyframes confetti-pop {
  to {
    opacity: 0;
    transform: translate(var(--x), var(--y)) rotate(var(--r));
  }
}

@media (min-width: 760px) {
  .auth-view {
    display: grid;
    min-height: 100dvh;
    grid-template-columns: 1fr 480px;
    align-items: center;
    gap: 55px;
    padding-right: 35px;
    padding-left: 35px;
  }

  .auth-hero,
  .auth-card {
    width: 100%;
    margin: 0;
  }

  .auth-footer {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
  }

  .app-view {
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    border-left: 1px solid rgba(255, 255, 255, 0.04);
  }

  .app-content {
    padding-right: 28px;
    padding-left: 28px;
  }

  .habit-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .bottom-nav {
    right: 50%;
    left: auto;
    width: min(100%, 760px);
    padding-right: 8px;
    padding-left: 8px;
    transform: translateX(50%);
  }

  .modal-backdrop {
    align-items: center;
  }

  .modal {
    border-radius: 27px;
  }
}

@media (max-width: 370px) {
  .app-content {
    padding-right: 12px;
    padding-left: 12px;
  }

  .today-hero {
    grid-template-columns: minmax(0, 1fr) 90px;
  }

  .week-ring {
    width: 88px;
    height: 88px;
  }

  .ring-core b {
    font-size: 1.4rem;
  }

  .habit-grid {
    gap: 7px;
  }

  .habit-card {
    min-height: 100px;
    padding: 10px;
  }

  .boost-member-list {
    margin-right: -12px;
    margin-left: -12px;
    padding-right: 12px;
    padding-left: 12px;
  }
}

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

@media (display-mode: standalone) {
  .install-card {
    display: none;
  }
}

@media print {
  .app-header,
  .bottom-nav,
  .ambient,
  .install-card,
  .profile-menu {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }
}
