:root{
  --bg: #F3F6F4;
  --card: #FFFFFF;
  --ink: #33423B;
  --ink-soft: #7C8A83;
  --ink-faint: #A9B3AD;
  --line: #E6ECE8;

  --mint: #8FD6A6;
  --mint-deep: #4FAE73;
  --mint-bg: #EAF8EF;

  --sky: #8FCBE0;
  --sky-deep: #4C93AC;
  --sky-bg: #EAF5F9;

  --amber: #F0C36B;
  --amber-deep: #C99A3C;
  --amber-bg: #FBF3E1;

  --olive: #CADD8A;
  --olive-deep: #96AD52;
  --olive-bg: #F2F6E6;

  --coral: #F0A090;
  --coral-deep: #C96B58;
  --coral-bg: #FBEBE7;

  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;

  --shadow-card: 0 2px 0 var(--line), 0 10px 24px -18px rgba(51,66,59,0.35);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
}

*{
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

html, body{
  margin:0;
  padding:0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Nunito', sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

body{
  display:flex;
  justify-content:center;
  min-height: 100vh;
}

button, a{ outline: none; -webkit-tap-highlight-color: transparent; }
button:focus, a:focus{ outline: none; }

.hidden{ display:none !important; }

/* ---------- Boot Screen ---------- */
.boot-screen{
  width:100%;
  min-height:100vh;
}

/* ---------- User Select Screen ---------- */
.user-select-screen{
  width:100%;
  max-width:480px;
  min-height:100vh;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding: 32px 20px;
}

.user-select-prompt{
  font-family:'Baloo 2', sans-serif;
  font-weight:800;
  font-size:22px;
  color: var(--ink);
  text-align:center;
  margin: 0 0 22px;
}

.user-select-list{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.user-select-card{
  display:flex;
  align-items:center;
  gap:12px;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 14px 14px;
  cursor:pointer;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.25s var(--ease);
}
.user-select-card:active{ transform: scale(0.97); }

.user-select-text{
  display:flex;
  flex-direction:column;
  min-width:0;
  flex:1;
}

.user-select-name{
  font-family:'Baloo 2', sans-serif;
  font-weight:700;
  font-size:16px;
  color: var(--ink);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.user-select-username{
  font-size:12px;
  font-weight:700;
  color: var(--ink-faint);
  margin-top:1px;
}

.user-select-joined{
  font-size:11px;
  font-weight:600;
  color: var(--ink-faint);
  margin-top:3px;
}

.user-select-enter{
  flex-shrink:0;
  width:40px;
  height:40px;
  border-radius:50%;
  background: var(--mint-bg);
  color: var(--mint-deep);
  display:flex;
  align-items:center;
  justify-content:center;
}
.user-select-enter svg{ width:18px; height:18px; }

.user-select-empty{
  text-align:center;
  font-size:13px;
  font-weight:600;
  color: var(--ink-faint);
  padding: 20px;
}

/* ---------- App Shell ---------- */
.app{
  width:100%;
  max-width: 480px;
  min-height:100vh;
  display:flex;
  flex-direction:column;
  position:relative;
}

/* ---------- Top App Bar ---------- */
.topbar{
  position: sticky;
  top:0;
  z-index: 30;
  background: var(--bg);
  padding: 18px 16px 6px;
}

.topbar-row{
  display:flex;
  align-items:center;
  gap:10px;
}

.profile-switch{
  position: relative;
  flex: 1 1 auto;
  min-width:0;
}

.ps-main{
  display:flex;
  align-items:center;
  gap:10px;
  background: var(--card);
  border-radius: 999px;
  padding: 6px 16px 6px 6px;
  box-shadow: var(--shadow-card);
  cursor:pointer;
}

.ps-avatar{
  width:40px;
  height:40px;
  border-radius:50%;
  flex-shrink:0;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-family:'Baloo 2', sans-serif;
  font-weight:700;
  font-size:16px;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.08);
  background: linear-gradient(160deg, var(--mint) 0%, var(--mint-deep) 100%);
}

.ps-text{
  display:flex;
  flex-direction:column;
  min-width:0;
  flex:1;
}

.ps-name{
  font-family:'Baloo 2', sans-serif;
  font-weight:700;
  font-size:15px;
  color: var(--ink);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.ps-username{
  font-size:12px;
  font-weight:700;
  color: var(--ink-faint);
  max-height:0;
  opacity:0;
  overflow:hidden;
  transition: max-height 0.3s var(--ease), opacity 0.25s var(--ease), margin-top 0.3s var(--ease);
}
.profile-switch.expanded .ps-username{
  max-height:18px;
  opacity:1;
  margin-top:1px;
}

.ps-view-badge{
  display:none;
  font-size:9.5px;
  font-weight:800;
  letter-spacing:0.03em;
  color: var(--amber-deep);
  background: var(--amber-bg);
  border-radius:999px;
  padding:1px 7px;
  margin-left:7px;
  vertical-align:middle;
  transform: translateY(-1px);
}
.profile-switch.expanded .ps-view-badge{ display:inline-block; }

.ps-chevron{
  flex-shrink:0;
  color: var(--ink-faint);
  display:flex;
  transition: transform 0.35s var(--ease);
}
.ps-chevron svg{ width:16px; height:16px; }
.profile-switch.expanded .ps-chevron{ transform: rotate(180deg); }

.side-btn{
  flex-shrink:0;
  width:auto;
  max-width:44px;
  min-width:44px;
  height:44px;
  padding:0;
  border:none;
  border-radius:999px;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: var(--shadow-card);
  cursor:pointer;
  overflow:hidden;
  transition: opacity 0.3s var(--ease), max-width 0.3s var(--ease), min-width 0.3s var(--ease), padding 0.3s var(--ease), margin 0.3s var(--ease), transform 0.2s var(--ease-spring), background 0.3s var(--ease), gap 0.3s var(--ease);
}
.side-btn svg{ width:20px; height:20px; flex-shrink:0; transition: transform 0.3s var(--ease); }
.side-btn-icon{
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  transition: opacity 0.15s var(--ease);
}
.side-btn-icon.swap-out{ opacity:0; }

.side-btn-label{
  font-family:'Nunito', sans-serif;
  font-weight:800;
  font-size:12.5px;
  white-space:nowrap;
  opacity:0;
  max-width:0;
  transition: opacity 0.25s var(--ease), max-width 0.3s var(--ease);
}

.side-btn.has-label{
  max-width:140px;
  min-width:44px;
  padding:0 16px 0 13px;
  gap:6px;
}
.side-btn.has-label .side-btn-label{
  opacity:1;
  max-width:80px;
}

.add-btn{ background: var(--mint-deep); }
.add-btn.is-login{ background: var(--sky-deep); }
.add-btn.is-logout{ background: linear-gradient(160deg, var(--coral) 0%, var(--coral-deep) 100%); }

.topbar-row.expanded .side-btn{
  opacity:0;
  max-width:0;
  min-width:0;
  padding:0;
  height:44px;
  pointer-events:none;
}
.topbar-row.expanded .add-btn{ margin-left:-10px; }

.ps-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(51,66,59,0.28);
  opacity: 0;
  visibility: hidden;
  z-index: 40;
  transition: opacity 0.25s var(--ease), visibility 0.25s var(--ease);
}
.ps-backdrop.show{
  opacity:1;
  visibility:visible;
}

.ps-dropdown{
  position: absolute;
  top: calc(100% + 10px);
  left:0;
  right:0;
  z-index: 50;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 44px -12px rgba(51,66,59,0.32), var(--shadow-card);
  padding: 8px;
  opacity:0;
  transform: translateY(-8px) scale(0.96);
  transform-origin: top center;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.3s var(--ease-spring);
}
.ps-dropdown.open{
  opacity:1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.ps-dropdown-inner{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-height:0;
  max-height: min(320px, 55vh);
  overflow-y:auto;
  overflow-x:hidden;
}

.ps-dropdown-row{
  display:flex;
  align-items:center;
  gap:10px;
  background: var(--card);
  border-radius: 999px;
  padding: 6px 6px;
  box-shadow: var(--shadow-card);
  cursor:pointer;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.25s var(--ease);
}
.ps-dropdown-row:active{ transform: scale(0.97); }

.ps-switch-icon{
  flex-shrink:0;
  margin-left:auto;
  width:34px;
  height:34px;
  border-radius:50%;
  background: var(--mint-bg);
  color: var(--mint-deep);
  display:flex;
  align-items:center;
  justify-content:center;
}
.ps-switch-icon svg{ width:16px; height:16px; }

/* ---------- Pages ---------- */
.pages{
  flex:1;
  padding: 10px 16px 24px;
}

.page{ display:none; }
.page.active{ display:block; animation: fadeUp 0.4s var(--ease); }

@keyframes fadeUp{
  from{ opacity:0; transform: translateY(10px) scale(0.99); }
  to{ opacity:1; transform: translateY(0) scale(1); }
}

/* ---------- Bottom Navigation ---------- */
.bottom-nav{
  position: fixed;
  bottom:0;
  left:50%;
  transform: translateX(-50%);
  width:100%;
  max-width:480px;
  display:flex;
  justify-content:space-around;
  align-items:stretch;
  background: var(--card);
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 0 var(--line), 0 -10px 24px -18px rgba(51,66,59,0.35);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: 40;
}

.nav-highlight{
  position:absolute;
  top:0;
  left:0;
  height:60px;
  width:0;
  border-radius: 14px;
  background: var(--mint-bg);
  transition: transform 0.4s var(--ease-spring), width 0.4s var(--ease), height 0.4s var(--ease);
  z-index:0;
  pointer-events:none;
  opacity:0;
}
.nav-highlight.ready{ opacity:1; }

.nav-btn{
  position:relative;
  z-index:1;
  border:none;
  background: transparent;
  flex:1 1 0;
  min-width:0;
  height:60px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  border-radius: 14px;
  color: var(--ink-faint);
  cursor:pointer;
  transition: transform 0.2s var(--ease-spring);
}
.nav-btn:active{ transform: scale(0.93); }

.nav-icon{
  position:relative;
  width:23px;
  height:23px;
}
.nav-icon svg{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease-spring);
}
.nav-icon .icon-stroke{
  opacity:1;
  transform: scale(1);
  color: var(--ink-faint);
}
.nav-icon .icon-filled{
  opacity:0;
  transform: scale(0.7);
  color: var(--mint-deep);
}
.nav-btn.active .icon-stroke{ opacity:0; transform: scale(1.25); }
.nav-btn.active .icon-filled{ opacity:1; transform: scale(1); }

.nav-label{
  font-size:10.5px;
  font-weight:800;
  color: var(--ink-faint);
  transition: color 0.3s var(--ease);
}
.nav-btn.active .nav-label{ color: var(--mint-deep); }

.nav-spacer{ height: 88px; }

/* ---------- PIN Modal ---------- */
.modal-overlay{
  position:fixed;
  inset:0;
  background: rgba(51,66,59,0.4);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:100;
  padding:20px;
  opacity:0;
  pointer-events:none;
  visibility:hidden;
  transition: opacity 0.3s var(--ease), visibility 0s linear 0.3s;
}
.modal-overlay.open{
  opacity:1;
  pointer-events:auto;
  visibility:visible;
  transition: opacity 0.3s var(--ease), visibility 0s linear 0s;
}

.pin-modal{
  width:100%;
  max-width:340px;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 18px 22px 22px;
  text-align:center;
  transform: scale(0.92) translateY(8px);
  transition: transform 0.35s var(--ease-spring);
}
.modal-overlay.open .pin-modal{
  transform: scale(1) translateY(0);
}

.pin-modal-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:6px;
}

.pin-nav-btn{
  border:none;
  background: var(--bg);
  color: var(--ink-soft);
  font-family:'Nunito', sans-serif;
  font-weight:800;
  font-size:12.5px;
  border-radius:999px;
  padding:8px 13px;
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:4px;
  transition: transform 0.2s var(--ease-spring), background 0.25s var(--ease), color 0.25s var(--ease);
}
.pin-nav-btn svg{ width:14px; height:14px; }
.pin-nav-btn:active{ transform: scale(0.94); }

.pin-reset-btn{
  background: var(--amber-bg);
  color: var(--amber-deep);
}

.pin-modal-avatar{
  width:52px;
  height:52px;
  border-radius:50%;
  margin: 4px auto 12px;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-family:'Baloo 2', sans-serif;
  font-weight:700;
  font-size:20px;
  background: linear-gradient(160deg, var(--mint) 0%, var(--mint-deep) 100%);
}

.pin-modal-title{
  font-family:'Baloo 2', sans-serif;
  font-weight:800;
  font-size:17px;
  color: var(--ink);
  margin-bottom:2px;
}

.pin-modal-sub{
  font-size:12.5px;
  font-weight:600;
  color: var(--ink-faint);
  margin-bottom:20px;
}
.pin-modal-sub.checking{ color: var(--mint-deep); }

.pin-dots{
  display:flex;
  justify-content:center;
  gap:12px;
  margin-bottom:8px;
}

.pin-dot{
  width:14px;
  height:14px;
  border-radius:50%;
  border:2px solid var(--line);
  background: transparent;
  transition: background 0.2s var(--ease-spring), border-color 0.2s var(--ease), transform 0.2s var(--ease-spring);
}
.pin-dot.filled{
  background: var(--mint-deep);
  border-color: var(--mint-deep);
  transform: scale(1.1);
}
.pin-dots.shake{ animation: pinShake 0.4s var(--ease); }
.pin-dot.error{
  background: var(--coral-deep);
  border-color: var(--coral-deep);
}

@keyframes pinShake{
  0%, 100%{ transform: translateX(0); }
  20%{ transform: translateX(-8px); }
  40%{ transform: translateX(7px); }
  60%{ transform: translateX(-5px); }
  80%{ transform: translateX(3px); }
}

.pin-error{
  min-height:16px;
  font-size:12px;
  font-weight:700;
  color: var(--coral-deep);
  margin: 10px 0 6px;
}

.pin-keypad{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:10px;
  margin-top:6px;
}

.pin-key{
  border:none;
  background: var(--bg);
  color: var(--ink);
  font-family:'Baloo 2', sans-serif;
  font-weight:700;
  font-size:20px;
  border-radius: var(--radius-md);
  padding:14px 0;
  cursor:pointer;
  transition: transform 0.15s var(--ease-spring), background 0.15s var(--ease);
}
.pin-key:active{ background: var(--mint-bg); transform: scale(0.92); }
.pin-key.pin-key-back{
  background: var(--coral-bg);
  color: var(--coral-deep);
  display:flex;
  align-items:center;
  justify-content:center;
}
.pin-key.pin-key-back svg{ width:20px; height:20px; }

.pin-key.pin-key-view{
  background: var(--sky-bg);
  color: var(--sky-deep);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
}
.pin-key.pin-key-view svg{ width:18px; height:18px; }
.pin-key.pin-key-view .pin-key-view-label{
  font-family:'Nunito', sans-serif;
  font-size:9.5px;
  font-weight:800;
}

/* ---------- Common/Shared App Shell Inner Layouts ---------- */
.app-shell, .screen {
  width: 100%;
  max-width: 480px;
  padding: 10px 0 40px;
  margin: 0 auto;
}

.section-label{
  font-family:'Baloo 2',sans-serif; font-weight:600; font-size:13px;
  text-transform:uppercase; letter-spacing:0.6px; color: var(--ink-faint);
  margin: 26px 4px 12px;
}
.section-label:first-of-type{ margin-top:0; }

/* ---------- Greeting header ---------- */
.hp-greeting{ display:flex; flex-direction:column; gap:3px; margin-bottom:16px; }
.hp-greeting-line{ font-family:'Baloo 2',sans-serif; font-weight:700; font-size:20px; color: var(--ink); line-height:1.2; }
.hp-date-line{ font-size:12.5px; font-weight:700; color: var(--ink-faint); }

/* ---------- Streak bar ---------- */
.hp-streak-bar{ display:flex; align-items:center; gap:14px; background: linear-gradient(135deg, var(--amber-bg), #FDF7E8); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding:16px 18px; margin-bottom:22px; }
.streak-bar-icon{ width:50px; height:50px; border-radius:15px; background:#fff; color: var(--amber-deep); display:flex; align-items:center; justify-content:center; flex-shrink:0; box-shadow: 0 2px 0 rgba(201,154,60,0.15); }
.streak-bar-icon svg{ width:26px; height:26px; }
.streak-bar-text{ display:flex; flex-direction:column; }
.streak-bar-value{ font-family:'Baloo 2',sans-serif; font-weight:800; font-size:28px; color: var(--amber-deep); line-height:1; }
.streak-bar-value span{ font-family:'Nunito',sans-serif; font-weight:800; font-size:13px; text-transform:uppercase; letter-spacing:0.3px; margin-left:6px; opacity:.8; }
.streak-bar-sub{ font-size:12px; font-weight:700; color: var(--amber-deep); opacity:.75; margin-top:5px; }

/* ---------- Horizontal date picker ---------- */
.date-picker-scroll{ display:flex; gap:8px; overflow-x:auto; padding:2px 2px 6px; scroll-behavior:smooth; scrollbar-width:none; -ms-overflow-style:none; }
.date-picker-scroll::-webkit-scrollbar{ display:none; }
.date-pill{ flex:0 0 auto; width:50px; display:flex; flex-direction:column; align-items:center; gap:5px; padding:11px 0 10px; border-radius:16px; background: var(--card); box-shadow: var(--shadow-card); border:2px solid transparent; cursor:pointer; transition: background .18s ease, border-color .18s ease, transform .15s ease; }
.date-pill:active{ transform: scale(0.94); }
.date-pill .dow{ font-size:10px; font-weight:800; color: var(--ink-faint); text-transform:uppercase; letter-spacing:0.2px; }
.date-pill .dnum{ font-family:'Baloo 2',sans-serif; font-weight:700; font-size:16px; color: var(--ink); }
.date-pill .dstatus{ width:6px; height:6px; border-radius:50%; background: var(--line); }
.date-pill.hit .dstatus{ background: var(--mint-deep); }
.date-pill.under .dstatus{ background: var(--amber-deep); }
.date-pill.mid .dstatus{ background: var(--olive-deep); }
.date-pill.today{ border-color: var(--mint-deep); }
.date-pill.selected{ background: var(--mint-deep); box-shadow: 0 2px 0 rgba(51,66,59,0.1), 0 10px 20px -12px rgba(79,174,115,0.55); }
.date-pill.selected .dow{ color: rgba(255,255,255,0.8); }
.date-pill.selected .dnum{ color:#fff; }
.date-pill.selected .dstatus{ background: rgba(255,255,255,0.85); }

/* ---------- Goal progress card ---------- */
.goal-dash-card{ background: var(--card); border-radius: var(--radius-lg); border: 1.5px solid rgba(51,66,59,0.10); box-shadow: 0 3px 0 var(--line), 0 16px 30px -18px rgba(51,66,59,0.45); padding:20px; display:flex; align-items:center; gap:16px; }
.goal-dash-left{ flex:1 1 0; min-width:0; display:flex; justify-content:center; }
.goal-dash-title{ font-family:'Baloo 2',sans-serif; font-weight:800; font-size:14.5px; color: var(--ink); margin-bottom:14px; }
.goal-radial-wrap{ position:relative; width:104px; height:104px; }
.goal-radial-wrap svg{ width:104px; height:104px; transform: rotate(-90deg); }
.goal-ring-track{ fill:none; stroke: var(--line); stroke-width:11; }
.goal-ring-fill{ fill:none; stroke: var(--mint-deep); stroke-width:11; stroke-linecap:round; transition: stroke-dashoffset .6s ease, stroke .4s ease; }
.goal-radial-center{ position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.goal-radial-pct{ font-family:'Baloo 2',sans-serif; font-weight:800; font-size:22px; color: var(--ink); line-height:1; }
.goal-radial-fraction{ font-size:9.5px; font-weight:800; color: var(--ink-faint); margin-top:3px; }

.goal-divider{ width:2px; align-self:stretch; background: var(--line); flex:0 0 auto; border-radius:2px; }
.goal-dash-right{ flex:1 1 0; min-width:0; }

.goal-mini-stats{ display:flex; gap:6px; }
.mini-stat{ flex:1; min-width:0; display:flex; flex-direction:column; align-items:center; gap:5px; background: var(--bg); border-radius:14px; padding:10px 3px 8px; }
.mini-stat-icon{ width:28px; height:28px; min-width:28px; border-radius:9px; display:flex; align-items:center; justify-content:center; }
.mini-stat-icon svg{ width:14px; height:14px; }
.mini-stat-icon.mint{ background: var(--mint-bg); color: var(--mint-deep); }
.mini-stat-icon.coral{ background: var(--coral-bg); color: var(--coral-deep); }
.mini-stat-icon.amber{ background: var(--amber-bg); color: var(--amber-deep); }
.mini-stat-value{ font-family:'Baloo 2',sans-serif; font-weight:800; font-size:12.5px; color: var(--ink); white-space:nowrap; }
.mini-stat-label{ font-size:8.5px; font-weight:800; color: var(--ink-faint); text-transform:uppercase; letter-spacing:.3px; }

/* ---------- Weekly card & chart ---------- */
.week-card{ background: var(--card); border-radius: var(--radius-lg); border: 1.5px solid rgba(51,66,59,0.10); box-shadow: 0 3px 0 var(--line), 0 16px 30px -18px rgba(51,66,59,0.45); padding:20px 16px 16px; }
.week-head{ display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:16px; }
.week-total-value{ font-family:'Baloo 2',sans-serif; font-weight:800; font-size:22px; color: var(--ink); line-height:1; }
.week-total-label{ font-size:11.5px; font-weight:700; color: var(--ink-faint); margin-top:5px; }
.week-avg-plain{ font-family:'Baloo 2',sans-serif; font-weight:700; font-size:13px; color: var(--ink-soft); flex-shrink:0; padding-top:4px; }
.week-avg-plain .avg-unit{ font-family:'Nunito',sans-serif; font-weight:700; font-size:10px; text-transform:uppercase; opacity:.75; margin-left:2px; }
.week-bars{ display:flex; align-items:flex-end; justify-content:space-between; gap:8px; height:150px; padding:0 2px; }
.week-bar-item{ flex:1; display:flex; flex-direction:column; align-items:center; }
.week-bar-value{ font-family:'Baloo 2',sans-serif; font-weight:700; font-size:11.5px; color: var(--ink-soft); margin-bottom:6px; height:14px; line-height:14px; }
.week-bar{ width:26px; border-radius:14px 14px 8px 8px; margin-bottom:10px; box-shadow: 0 2px 6px rgba(51,66,59,0.15); transition: height .5s ease; }
.week-bar.hit{ background: var(--mint-deep); }
.week-bar.under{ background: var(--amber); }
.week-bar.mid{ background: var(--olive); }
.week-bar.empty{ width:22px; height:10px; border-radius:8px; background: var(--line); }
.week-bar-x{ font-family:'Nunito',sans-serif; font-weight:800; font-size:10.5px; color: var(--ink-faint); }
.week-bar-x.today{ color: var(--mint-deep); }
.chart-legend{ display:flex; align-items:center; gap:12px; margin-top:10px; padding-top:12px; border-top:1px solid var(--line); flex-wrap:wrap; }
.legend-item{ display:flex; align-items:center; gap:6px; font-size:11px; font-weight:700; color: var(--ink-soft); }
.legend-dot{ width:9px; height:9px; border-radius:3px; }
.legend-dot.mint{ background: var(--mint-deep); }
.legend-dot.amber{ background: var(--amber); }
.legend-dot.olive{ background: var(--olive); }

.settings-tile{ display:flex; align-items:center; gap:14px; background: var(--card); border-radius: var(--radius-lg); border: 1.5px solid rgba(51,66,59,0.10); box-shadow: var(--shadow-card); padding:14px 16px; margin-top:16px; cursor:pointer; width:100%; text-align:left; border:none; }
.settings-tile:active{ transform: scale(0.98); }
.settings-tile-icon{ width:42px; height:42px; min-width:42px; border-radius:13px; background: var(--mint-bg); color: var(--mint-deep); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.settings-tile-icon svg{ width:21px; height:21px; }
.settings-tile-text{ flex:1; min-width:0; font-family:'Baloo 2',sans-serif; font-weight:800; font-size:15.5px; color: var(--ink); }
.settings-tile-arrow{ width:18px; height:18px; color: var(--ink-faint); flex-shrink:0; }

.week-log-list{ margin-top:14px; padding-top:14px; border-top:1px solid var(--line); }
.week-log-title{ font-family:'Baloo 2',sans-serif; font-weight:800; font-size:12px; text-transform:uppercase; letter-spacing:0.5px; color: var(--ink-faint); margin-bottom:8px; }
.week-log-row{ display:flex; align-items:center; gap:11px; padding:9px 0; border-bottom:1px solid var(--line); }
.week-log-row:last-child{ border-bottom:none; }
.week-log-dot{ width:9px; height:9px; border-radius:50%; background: var(--line); flex:0 0 auto; }
.week-log-dot.hit{ background: var(--mint-deep); }
.week-log-dot.under{ background: var(--amber); }
.week-log-dot.mid{ background: var(--olive); }
.week-log-info{ display:flex; flex-direction:column; gap:1px; min-width:0; }
.week-log-day{ font-family:'Baloo 2',sans-serif; font-weight:600; font-size:14.5px; color: var(--ink); }
.week-log-date{ font-size:10px; font-weight:700; color: var(--ink-faint); }
.week-log-value{ margin-left:auto; font-family:'Baloo 2',sans-serif; font-weight:600; font-size:15px; color: var(--ink); white-space:nowrap; }

.hp-block{ animation: fadeUp .35s ease; }

/* ---------- Overview grids ---------- */
.overview-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-card{
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  box-shadow: var(--shadow-card);
  display:flex;
  flex-direction:column;
  gap: 10px;
}

.stat-icon{
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.stat-icon svg{ width:18px; height:18px; }
.stat-icon.mint{ background: var(--mint-bg); color: var(--mint-deep); }
.stat-icon.sky{ background: var(--sky-bg); color: var(--sky-deep); }
.stat-icon.amber{ background: var(--amber-bg); color: var(--amber-deep); }
.stat-icon.coral{ background: var(--coral-bg); color: var(--coral-deep); }

.stat-value{
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
  line-height: 1;
}

.stat-title{
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
}

/* ---------- Reports Logs & Switcher ---------- */
.month-switch{
  display:flex;
  align-items:center;
  justify-content:space-between;
  background: var(--card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 10px 12px;
  margin-bottom: 22px;
}

.month-btn{
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--mint-bg);
  color: var(--mint-deep);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  flex-shrink:0;
  transition: background 0.2s ease, opacity 0.2s ease;
}
.month-btn svg{ width:18px; height:18px; }
.month-btn:hover{ background: #DCF3E4; }
.month-btn:disabled{ opacity: 0.35; cursor: default; }

.month-title{
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 19px;
  color: var(--ink);
  text-align:center;
}

.logs-container{
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.log-row{
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.log-row:last-child{ border-bottom: none; }

.log-date{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  width: 40px;
  flex-shrink:0;
}
.log-date .day{
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
  line-height:1;
}
.log-date .mon{
  font-size: 9.5px;
  font-weight: 800;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.log-body{ flex:1; min-width:0; }
.log-top{ display:flex; align-items:center; }
.log-hours{ font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 15px; color: var(--ink); }
.log-status-col{ flex-shrink: 0; display:flex; align-items:center; justify-content:flex-end; }

.log-status-text{
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-align:center;
}
.log-status-text.failed{ color: var(--coral-deep); }
.log-status-text.break{ color: var(--sky-deep); }
.log-status-text.waived{ color: var(--amber-deep); }

.row-sub{ font-size: 11.5px; font-weight: 700; color: var(--ink-faint); margin-top: 2px; }

/* ---------- Book Fund Table Cards ---------- */
.table-card{
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 6px;
  overflow: hidden;
}

.row{
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
}
.row:last-child{ border-bottom: none; }

.row-icon{
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 12px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.row-icon svg{ width: 18px; height: 18px; }
.row-icon.coral{ background: var(--coral-bg); color: var(--coral-deep); }
.row-icon.mint{ background: var(--mint-bg); color: var(--mint-deep); }
.row-icon.sky{ background: var(--sky-bg); color: var(--sky-deep); }

.row-body{ flex: 1; min-width: 0; display:flex; flex-direction:column; gap: 2px; }

.row-title{
  font-weight: 800;
  font-size: 14px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-sub{ font-size: 11.5px; font-weight: 700; color: var(--ink-faint); }
.row-amount{ font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 15px; white-space: nowrap; color: var(--ink); }

.empty-state{ text-align:center; padding: 24px 10px; color: var(--ink-faint); font-weight: 700; font-size: 13px; }

/* ---------- Pagination ---------- */
.pagination{ display:flex; align-items:center; justify-content:center; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.page-btn{
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 13px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.page-btn:disabled{ opacity: 0.4; cursor: default; }
.page-btn.active{ background: var(--mint-deep); border-color: var(--mint-deep); color: #fff; }
.page-dots{ color: var(--ink-faint); font-weight: 800; font-size: 13px; padding: 0 2px; }

/* ---------- Errors & Loading Skeletons ---------- */
.error-state, .state-view{
  display:none;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  min-height: 65vh;
  padding: 24px 20px;
}
.error-state.show, .state-view:not(.hidden){ display:flex; }

.error-icon{
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--coral-bg);
  color: var(--coral-deep);
  display:flex;
  align-items:center;
  justify-content:center;
  margin-bottom: 18px;
}
.error-icon svg{ width: 30px; height: 30px; }
.error-title{ font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 18px; color: var(--ink); margin-bottom: 8px; }
.error-message{ font-size: 13.5px; font-weight: 600; color: var(--ink-soft); line-height: 1.5; max-width: 280px; }

.sync-bar{
  position: fixed; top: 0; left: 0; height: 3px; width: 100%;
  background: var(--mint-deep); transform: scaleX(0); transform-origin: left;
  transition: transform .25s ease, opacity .25s ease; opacity: 0; z-index: 10;
}
.sync-bar.active{ opacity: 1; animation: sync-progress 1.1s ease-in-out infinite; }
@keyframes sync-progress{
  0%{ transform: scaleX(0.1); }
  50%{ transform: scaleX(0.6); }
  100%{ transform: scaleX(0.95); }
}

/* ---------- Profile Layout ---------- */
.profile-header{ display:flex; flex-direction:column; align-items:center; text-align:center; padding: 28px 22px 24px; margin-bottom: 22px; }
.avatar-ring{
  width: 88px;
  height: 88px;
  border-radius: 50%;
  padding: 5px;
  background: conic-gradient(var(--mint-deep) 0% var(--streak-pct, 60%), var(--line) var(--streak-pct, 60%) 100%);
  display:flex;
  align-items:center;
  justify-content:center;
  margin-bottom: 14px;
}
.avatar{
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--mint) 0%, var(--mint-deep) 100%);
  color: #fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 30px;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,0.08);
}
.name{ font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 21px; margin: 0 0 8px; color: var(--ink); }
.chip-row{ display:flex; align-items:center; justify-content:center; flex-wrap: wrap; gap: 8px; }
.chip{ display:inline-flex; align-items:center; gap:5px; font-weight: 800; font-size: 12.5px; padding: 6px 12px; border-radius: 999px; line-height: 1; }
.chip svg{ width:12px; height:12px; }
.chip.username-chip{ background: var(--mint-bg); color: var(--mint-deep); }
.chip.role-chip{ background: var(--amber-bg); color: var(--amber-deep); }
.header-divider{ width: 32px; height: 3px; background: var(--line); border-radius: 999px; margin: 18px 0 14px; }
.bio-text{ font-size: 13.5px; font-weight: 600; color: var(--ink-soft); max-width: 320px; line-height: 1.55; text-align: center; }
.bio-text.empty{ font-style: italic; font-weight: 600; color: var(--ink-faint); }

.records-grid{ display:grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.record-card{
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  aspect-ratio: 3 / 4;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:space-between;
  padding: 16px 8px 12px;
  text-align:center;
}
.record-icon{ width: 46px; height: 46px; border-radius: 50%; display:flex; align-items:center; justify-content:center; margin-bottom: 4px; }
.record-icon svg{ width: 22px; height:22px; }
.record-icon.mint{ background: var(--mint-bg); color: var(--mint-deep); }
.record-icon.sky{ background: var(--sky-bg); color: var(--sky-deep); }
.record-icon.amber{ background: var(--amber-bg); color: var(--amber-deep); }

.record-body{ display:flex; flex-direction:column; align-items:center; gap: 4px; }
.record-value{ font-family: 'Baloo 2', sans-serif; font-weight: 700; font-size: 21px; color: var(--ink); }
.record-title{ font-size: 11.5px; font-weight: 800; color: var(--ink-soft); line-height: 1.25; }
.record-date{ font-size: 10px; font-weight: 700; color: var(--ink-faint); opacity: 0.7; text-align:center; letter-spacing: 0.2px; }

.retry-btn{
  margin-top: 4px; border: none; background: var(--mint-deep); color: #fff; font-family: 'Nunito', sans-serif;
  font-weight: 800; font-size: 13.5px; padding: 10px 22px; border-radius: 999px; cursor: pointer; transition: filter 0.2s ease;
}
.retry-btn:hover{ filter: brightness(0.94); }

/* ---------- Forgot Pin Screen Component Overlay ---------- */
#forgotPinScreen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  width: 100%;
}

.field-wrap{ text-align:left; margin-bottom:4px; }
.field-label{ display:block; font-size:11.5px; font-weight:800; letter-spacing:.02em; color: var(--ink-faint); margin-bottom:8px; padding-left:2px; }
.field-input{
  width:100%; background: var(--bg); border: 2px solid var(--bg); border-radius: var(--radius-md); padding: 13px 14px;
  font-family:'Nunito', sans-serif; font-size:14.5px; font-weight:700; color: var(--ink); transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.field-input::placeholder{ color: var(--ink-faint); font-weight:600; }
.field-input:focus{ outline:none; background:#fff; border-color: var(--sky); }
.field-input.error{ background: var(--coral-bg); border-color: var(--coral); }
.field-wrap.shake{ animation: pinShake 0.4s var(--ease); }

.pin-submit-btn{
  width:100%; border:none; background: var(--mint-deep); color:#fff; font-family:'Baloo 2', sans-serif; font-weight:700; font-size:15px;
  border-radius: var(--radius-md); padding:14px 0; margin-top:10px; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:8px;
  transition: transform 0.15s var(--ease-spring), background 0.2s var(--ease), opacity 0.2s var(--ease);
}
.pin-submit-btn:active{ transform: scale(0.97); }
.pin-submit-btn:disabled{ background: var(--ink-faint); cursor:not-allowed; }

.btn-spinner{
  width:14px; height:14px; border-radius:50%; border:2.5px solid rgba(255,255,255,0.4); border-top-color:#fff;
  animation:spin .7s linear infinite; display:none;
}
.pin-submit-btn.loading .btn-spinner{ display:inline-block; }
@keyframes spin{ to{ transform:rotate(360deg);} }

.resend-row{ margin-top:18px; font-size:12.5px; font-weight:700; color: var(--ink-faint); }
.pin-resend-btn{ margin: 8px auto 0; background: var(--amber-bg); color: var(--amber-deep); }
.pin-resend-btn:disabled{ background: var(--bg); color: var(--ink-faint); }

.view-block{ display:none; }
.view-block.show{ display:block; }
.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }

.skeleton{
  background: linear-gradient(90deg, var(--line) 25%, #F2F5F3 37%, var(--line) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 6px;
}
.skeleton-value{ width: 46px; height: 20px; margin-bottom: 6px; }
.skeleton-title{ width: 64px; height: 11px; }
.skeleton-icon{ width: 32px; height: 32px; border-radius: 9px; margin-bottom: 10px; }
.skeleton-row{ display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.skeleton-row:last-child{ border-bottom: none; }
.skeleton-date{ width: 34px; height: 34px; flex-shrink: 0; }
.skeleton-lines{ flex: 1; }
.skeleton-line-main{ width: 40%; height: 14px; margin-bottom: 8px; }
.skeleton-line-sub{ width: 65%; height: 10px; }

@keyframes shimmer{
  0%{ background-position: -120% 0; }
  100%{ background-position: 120% 0; }
}

@media (min-width: 420px){
  .overview-grid{ grid-template-columns: repeat(4, 1fr); }
  .stat-card{ padding: 16px 12px; }
  .stat-value{ font-size: 18px; }
}

@media (max-width: 340px){
  .records-grid{ grid-template-columns: 1fr 1fr; }
  .records-grid .record-card:last-child{ grid-column: 1 / -1; max-width: calc(50% - 6px); margin: 0 auto; }
}

/* Styling for Report's dynamic state message */
.state-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}
.state-title {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: var(--ink);
  margin-bottom: 6px;
}
.state-sub {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-faint);
}