:root{
  --bg:#0b1220;
  --bg2:#0d1628;
  --card: rgba(255,255,255,.06);
  --card2: rgba(255,255,255,.04);
  --line: rgba(255,255,255,.10);
  --txt: rgba(244,250,255,.92);
  --muted: rgba(244,250,255,.65);

  --green:#22c55e;
  --mint:#7fffe0;
  --blue:#60a5fa;
  --amber:#fbbf24;
  --red:#fb7185;

  --r:18px;
  --shadow: 0 18px 60px rgba(0,0,0,.45);
}

*{box-sizing:border-box}
html,body{height:100%;margin:0}
body{
  background:
    radial-gradient(1100px 750px at 18% 8%, rgba(34,197,94,.14), transparent 55%),
    radial-gradient(950px 700px at 85% 25%, rgba(96,165,250,.14), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  color:var(--txt);
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial;
}

.app{min-height:100%; display:flex; flex-direction:column; padding-bottom:72px;}

.topbar{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 14px 10px;
  background: linear-gradient(180deg, rgba(11,18,32,.96), rgba(11,18,32,.55));
  backdrop-filter: blur(10px);
  border-bottom:1px solid rgba(255,255,255,.08);
}

.brand{display:flex; gap:10px; align-items:center}
.logo{
  width:36px;height:36px;border-radius:12px;
  display:grid; place-items:center;
  background: rgba(127,255,224,.12);
  border:1px solid rgba(127,255,224,.22);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  font-weight:800;
}
.title{font-weight:850; letter-spacing:.2px}
.subtitle{font-size:12px; color:var(--muted); margin-top:1px}

.iconBtn{
  width:38px; height:38px; border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color:var(--txt);
  font-size:16px;
}

.screenWrap{flex:1; padding:14px; max-width:980px; width:100%; margin:0 auto;}
.screen{display:flex; flex-direction:column; gap:12px;}

.card{
  border:1px solid rgba(255,255,255,.10);
  border-radius: var(--r);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.04));
  box-shadow: var(--shadow);
  overflow:hidden;
}

.cardHd{
  padding:14px 14px 10px;
  display:flex; align-items:flex-start; justify-content:space-between; gap:10px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.cardTitle{font-weight:850}
.cardSub{font-size:12px; color:var(--muted); margin-top:3px}

.badge{
  font-size:12px; color:var(--txt);
  padding:7px 10px; border-radius:999px;
  background: rgba(127,255,224,.12);
  border:1px solid rgba(127,255,224,.18);
  white-space:nowrap;
}
.badge.soft{
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  color: var(--muted);
}

.formGrid{
  display:grid; grid-template-columns: 1fr 1fr;
  gap:10px;
  padding:14px;
}
.formGrid.compact{padding-top:10px}
@media (max-width:700px){ .formGrid{grid-template-columns:1fr;} }

.field label{display:block; font-size:12px; color:var(--muted); margin:0 0 6px;}
.field input,.field select{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(10,16,28,.70);
  color:var(--txt);
  outline:none;
}
.field input:disabled{opacity:.7}

.hint{
  margin:0 14px 12px;
  padding:10px 12px;
  border-radius:14px;
  background: rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.08);
  font-size:12px; color:var(--muted);
}

.btnRow{display:flex; gap:10px; padding:0 14px 14px; flex-wrap:wrap;}
.btn{
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color:var(--txt);
  border-radius:14px;
  padding:12px 12px;
  font-weight:800;
  cursor:pointer;
}
.btn.primary{
  background: linear-gradient(180deg, rgba(34,197,94,.22), rgba(34,197,94,.10));
  border:1px solid rgba(34,197,94,.28);
}
.btn.ghost{
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.10);
  color:var(--muted);
}
.btn.small{padding:10px 12px; font-weight:750}

.bigTapGrid{
  padding:14px;
  display:grid; grid-template-columns:1fr 1fr; gap:10px;
}
@media (max-width:700px){ .bigTapGrid{grid-template-columns:1fr;} }
.btn.tap{
  padding:16px 14px;
  font-size:18px;
  border-radius:18px;
}

.tinyRow{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px;
  padding:0 14px 14px;
}
.tiny{font-size:12px; color:var(--muted)}
.linkDanger{
  background:none; border:none; padding:0; margin:0;
  color: var(--red);
  font-weight:800;
  cursor:pointer;
}

.kpiGrid{
  padding:14px;
  display:grid; grid-template-columns: 1fr 1fr;
  gap:10px;
}
@media (max-width:700px){ .kpiGrid{grid-template-columns:1fr;} }
.kpi{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  border-radius:16px;
  padding:12px;
}
.kpi .t{font-size:12px; color:var(--muted); margin-bottom:6px;}
.kpi .v{font-size:20px; font-weight:900;}
.kpi .s{font-size:12px; color:var(--muted); margin-top:4px;}

.tableWrap{padding:14px; overflow:auto;}
.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.14);
}
.table th,.table td{
  padding:10px 10px;
  font-size:12px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.table th{
  text-align:left;
  color:var(--muted);
  font-weight:850;
  background: rgba(255,255,255,.04);
}
.table tr:last-child td{border-bottom:none;}
.right{text-align:right}
.ok{color:var(--green)}
.warn{color:var(--amber)}
.bad{color:var(--red)}

.achList{padding:14px; display:flex; flex-direction:column; gap:10px;}
.ach{
  display:flex; justify-content:space-between; align-items:center; gap:10px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.16);
  border-radius:16px;
  padding:12px;
}
.ach .name{font-weight:900}
.ach .desc{font-size:12px; color:var(--muted); margin-top:3px}
.ach .state{
  font-size:12px; font-weight:900;
  padding:7px 10px; border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: var(--muted);
  white-space:nowrap;
}
.ach.done .state{
  border:1px solid rgba(34,197,94,.28);
  background: rgba(34,197,94,.14);
  color: rgba(244,250,255,.92);
}

.nav{
  position:fixed; left:0; right:0; bottom:0;
  padding:10px 10px calc(10px + env(safe-area-inset-bottom));
  display:flex; gap:10px; justify-content:center;
  background: linear-gradient(180deg, rgba(11,18,32,.10), rgba(11,18,32,.92));
  backdrop-filter: blur(12px);
  border-top:1px solid rgba(255,255,255,.08);
}
.navBtn{
  flex:1; max-width:220px;
  border-radius:16px;
  padding:12px 10px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  color: var(--muted);
  font-weight:900;
  cursor:pointer;
}
.navBtn.on{
  color: var(--txt);
  border:1px solid rgba(127,255,224,.20);
  background: rgba(127,255,224,.10);
}

/* --- Profile chips (House/Work/Gym) --- */
.profileBar{
  display:flex;
  gap:10px;
  padding: 12px 14px 0;
  flex-wrap:wrap;
}
.chip{
  border-radius:999px;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  color: var(--muted);
  font-weight:900;
  cursor:pointer;
}
.chip.on{
  color: var(--txt);
  border:1px solid rgba(127,255,224,.22);
  background: rgba(127,255,224,.10);
}
.chip.locked::after{
  content:"  🔒";
  opacity:.85;
}
