/* ===========================================================
   HowzitToday — dark premium app theme (Image-1 direction)
   =========================================================== */
:root {
  --bg-0: #0b201b;
  --bg-1: #103029;
  --bg-2: #0a1a16;
  --ink: #f5f1e8;
  --muted: #9fb3a6;
  --muted-2: #7c9286;
  --gold: #f0b43f;
  --gold-soft: #f6c659;
  --gold-deep: #c8852f;
  --green: #2f9760;
  --green-bright: #4fae6f;
  --wa: #25d366;
  --card-dark: rgba(20, 46, 39, 0.72);
  --card-line: rgba(255, 255, 255, 0.08);
  --light: #f5f1e8;
  --light-ink: #1f3d34;
  --light-muted: #6f7d70;
  --radius: 22px;
  --font-d: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-u: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-2);
  color: var(--ink);
  font: 16px/1.5 var(--font-u);
  display: flex;
  justify-content: center;
}

.app {
  position: relative;
  width: 100%;
  max-width: 440px;
  min-height: 100vh;
  padding: 0 20px 104px;
  overflow: hidden;
  background:
    radial-gradient(120% 42% at 78% 4%, rgba(246, 198, 89, 0.22) 0%, rgba(246, 198, 89, 0) 46%),
    radial-gradient(140% 60% at 50% 0%, #16382f 0%, rgba(22, 56, 47, 0) 60%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 40%, var(--bg-2) 100%);
}
.scene { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.scene .leaf { position: absolute; top: -24px; right: -46px; width: 230px; opacity: .15; transform: rotate(8deg); }
.scene .grain { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .05; mix-blend-mode: overlay; }
.app > *:not(.scene) { position: relative; z-index: 1; }

/* top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 22px 0 14px; }
.brand { display: flex; align-items: center; gap: 9px; }
.brand .mk { width: 26px; height: 26px; }
.brand .wm { font-family: var(--font-d); font-weight: 700; font-size: 21px; letter-spacing: -.02em; color: var(--ink); }
.brand .wm b { color: var(--gold); font-weight: 700; }
.topbar .back { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--card-line); background: rgba(255,255,255,.05); display: flex; align-items: center; justify-content: center; color: var(--ink); text-decoration: none; }
.topbar .title { font-family: var(--font-d); font-weight: 600; font-size: 19px; color: var(--ink); }
.avatar { width: 42px; height: 42px; border-radius: 50%; border: 2px solid rgba(246,198,89,.55); background: #2a4a3d; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--gold-soft); font-family: var(--font-d); font-size: 16px; }

/* heading */
.over { font-size: 11px; letter-spacing: .2em; font-weight: 700; color: var(--gold-deep); text-transform: uppercase; margin: 12px 0 0; }
.hello { font-family: var(--font-d); font-weight: 700; font-size: 37px; line-height: 1.05; letter-spacing: -.025em; margin: 6px 0 0; color: var(--ink); }
.hello .nm { color: var(--gold); }
.lead { font-size: 15.5px; line-height: 1.55; color: var(--muted); margin: 12px 0 0; max-width: 30ch; }

/* hero tactile button */
.herowrap { display: flex; justify-content: center; margin: 30px 0 26px; }
.hero {
  position: relative; width: 216px; height: 216px; border-radius: 50%; border: 0; cursor: pointer;
  background: radial-gradient(circle at 42% 36%, #1d4639 0%, #143329 55%, #0f261f 100%);
  color: var(--ink); font: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  box-shadow:
    0 0 0 3px var(--gold-soft),
    0 0 0 9px rgba(246, 198, 89, 0.12),
    0 0 46px rgba(246, 198, 89, 0.40),
    0 26px 46px rgba(0, 0, 0, 0.5),
    inset 0 2px 10px rgba(255, 255, 255, 0.08),
    inset 0 -18px 34px rgba(0, 0, 0, 0.4);
  transition: transform .14s cubic-bezier(.34,1.56,.64,1), box-shadow .14s;
}
.hero::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; box-shadow: 0 0 30px rgba(246,198,89,.5); opacity: .5; animation: glow 3.2s ease-in-out infinite; }
@keyframes glow { 0%,100% { opacity: .3; } 50% { opacity: .8; } }
.hero:active { transform: translateY(7px) scale(.975);
  box-shadow: 0 0 0 3px var(--gold-soft), 0 0 0 9px rgba(246,198,89,.10), 0 0 30px rgba(246,198,89,.3), 0 8px 16px rgba(0,0,0,.45), inset 0 6px 16px rgba(0,0,0,.5); }
.hero .sun { width: 70px; height: 70px; margin-bottom: 2px; }
.hero-title { font-family: var(--font-d); font-weight: 700; font-size: 25px; letter-spacing: -.01em; }
.hero-sub { font-size: 13.5px; color: var(--muted); }
.hero.done { background: radial-gradient(circle at 42% 36%, #2f7d57 0%, #1f6043 55%, #154734 100%);
  box-shadow: 0 0 0 3px #6fd29a, 0 0 0 9px rgba(90,200,140,.12), 0 0 46px rgba(80,200,130,.45), 0 22px 40px rgba(0,0,0,.5), inset 0 2px 10px rgba(255,255,255,.1), inset 0 -18px 34px rgba(0,0,0,.35);
  animation: pop .5s ease; }
@keyframes pop { 0%{transform:scale(1)} 40%{transform:scale(1.05)} 100%{transform:scale(1)} }
.hero.done::after { box-shadow: 0 0 30px rgba(90,200,140,.5); }

/* cards */
.card { background: var(--card-dark); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--card-line); border-radius: var(--radius); padding: 18px; margin: 0 0 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; }
.card-head .h { font-size: 12px; letter-spacing: .16em; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.card-head .n { font-family: var(--font-d); font-size: 14px; font-weight: 600; color: var(--gold); }

.week { display: flex; justify-content: space-between; margin: 14px 0 4px; }
.cell { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.fl { width: 30px; height: 30px; display: block; color: #43554c; }
.cell.on .fl { color: var(--pc, var(--gold)); filter: drop-shadow(0 0 6px rgba(240,180,63,.4)); }
.fl .pp ellipse { fill: currentColor; }
.fl .cc { fill: #11241d; }
.cell.on .fl .cc { fill: #fff7e6; }
.dl { font-size: 11px; font-weight: 700; color: var(--muted-2); }
.cell.today .dl { color: var(--gold); }
.weeknote { text-align: center; font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.progress { height: 7px; border-radius: 99px; background: rgba(255,255,255,.08); margin: 14px 0 2px; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--green-bright), var(--green)); transition: width .5s ease; }

.info { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.info .wa { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(150deg, #2bbe5b, #1c8f46); display: flex; align-items: center; justify-content: center; }
.info .wa svg { width: 26px; height: 26px; }
.info .tx { flex: 1; }
.info .tx b { font-family: var(--font-d); font-weight: 600; font-size: 15.5px; color: var(--ink); display: block; margin-bottom: 3px; }
.info .tx span { font-size: 13px; line-height: 1.45; color: var(--muted); }
.info .chev { color: var(--muted-2); font-size: 22px; line-height: 1; }

/* bottom nav */
.nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 440px; z-index: 5;
  display: flex; justify-content: space-around; align-items: center; padding: 12px 10px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(10,26,22,0.4), rgba(8,20,17,0.97) 45%); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--card-line); }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--muted-2); font-size: 11px; font-weight: 600; }
.nav a svg { width: 23px; height: 23px; }
.nav a.active { color: var(--gold); }

/* light cards (family / details) */
.lcard { background: var(--light); border-radius: var(--radius); padding: 20px; margin: 0 0 14px; color: var(--light-ink); box-shadow: 0 14px 30px rgba(0,0,0,.28); }
.lcard .lh { font-family: var(--font-d); font-weight: 700; font-size: 19px; color: var(--light-ink); }
.lcard .week .fl { color: #d3ddd2; }
.lcard .week .cell.on .fl { color: var(--pc, var(--gold-deep)); }
.lcard .week .fl .cc { fill: #fff; }
.lcard .dl { color: var(--light-muted); }
.lcard .cell.today .dl { color: var(--gold-deep); }
.lcard .weeknote { color: var(--light-muted); }
.lcard .card-head .h { color: var(--light-muted); }
.lcard .card-head .n { color: var(--gold-deep); }

.sec-head { display: flex; align-items: flex-start; gap: 13px; margin: 0 0 16px; }
.sec-head .ic { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(150deg, #2f9760, #1f6043); display: flex; align-items: center; justify-content: center; }
.sec-head .ic svg { width: 24px; height: 24px; }
.sec-head .t b { font-family: var(--font-d); font-weight: 700; font-size: 18px; display: block; }
.sec-head .t span { font-size: 13.5px; color: var(--light-muted); line-height: 1.45; }

.field { margin: 0 0 14px; }
.field label { display: block; font-size: 13.5px; font-weight: 700; color: var(--light-ink); margin: 0 0 6px; }
.field .inp { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid #e2ddd0; border-radius: 13px; padding: 0 14px; }
.field input { flex: 1; font: inherit; font-size: 16px; color: var(--light-ink); border: 0; background: transparent; padding: 14px 0; outline: none; }
.field input::placeholder { color: #b3b0a4; }
.field .inp:focus-within { border-color: var(--gold-deep); box-shadow: 0 0 0 3px rgba(200,133,47,.12); }
.field .badge { flex: 0 0 auto; color: #9aa79b; display: flex; }
.field .badge.wa { width: 30px; height: 30px; border-radius: 8px; background: var(--wa); color: #fff; align-items: center; justify-content: center; }

.note { display: flex; align-items: center; gap: 9px; background: #e9efe3; border-radius: 12px; padding: 11px 14px; font-size: 13px; color: #4f5d4c; margin: 0 0 16px; }
.note svg { width: 16px; height: 16px; flex: 0 0 auto; }

.btn-primary { width: 100%; min-height: 56px; border: 0; border-radius: 15px; background: linear-gradient(150deg, var(--green), #1c6e48); color: #fff; font: inherit; font-family: var(--font-d); font-weight: 700; font-size: 17px; cursor: pointer; box-shadow: 0 12px 24px rgba(31,110,72,.35); transition: transform .12s; }
.btn-primary:active { transform: translateY(1px); }
.summary-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; background: none; border: 0; color: var(--gold-deep); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; padding: 0; }
.preview { background: #f0f4ec; border: 1px solid #dfe6d6; border-radius: 13px; padding: 14px; margin: 14px 0 0; white-space: pre-wrap; line-height: 1.5; font-size: 14px; color: #3a473a; }
.wa-open { display: inline-flex; align-items:center; justify-content:center; gap: 8px; width: 100%; min-height: 52px; margin-top: 12px; border-radius: 14px; background: var(--wa); color: #073a1c; font-weight: 800; text-decoration: none; }
.saved-note { font-size: 13px; color: var(--green); font-weight: 700; margin: 10px 0 0; text-align: center; }
.disclaimer { color: var(--muted-2); font-size: 12.5px; line-height: 1.5; text-align: center; margin: 18px 8px 0; }

.spark { position: fixed; transform: translate(-50%,-50%); animation: fly 1s ease-out forwards; pointer-events: none; z-index: 50; }
@keyframes fly { to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--r)) scale(.4); opacity: 0; } }

/* ---------- tab page heading ---------- */
.ptitle { font-family: var(--font-d); font-weight: 700; font-size: 30px; letter-spacing: -.02em; margin: 16px 0 2px; color: var(--ink); }
.psub { font-size: 14px; color: var(--muted); margin: 0 0 18px; }

/* ---------- stats row ---------- */
.stats { display: flex; gap: 11px; margin: 0 0 14px; }
.stat { flex: 1; background: var(--card-dark); border: 1px solid var(--card-line); border-radius: 18px; padding: 15px 10px; text-align: center; }
.stat .v { font-family: var(--font-d); font-weight: 700; font-size: 27px; color: var(--gold); line-height: 1; }
.stat .k { font-size: 10.5px; letter-spacing: .04em; color: var(--muted); margin-top: 5px; }

/* ---------- calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 14px; }
.cal-title { font-family: var(--font-d); font-weight: 600; font-size: 16px; color: var(--ink); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { font-size: 10px; font-weight: 700; color: var(--muted-2); text-align: center; padding-bottom: 2px; text-transform: uppercase; }
.cal-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 11px; font-size: 13px; color: var(--muted); }
.cal-day.empty { visibility: hidden; }
.cal-day.future { color: #3a4a42; }
.cal-day.checked { color: #4a2c08; font-weight: 700; background: radial-gradient(circle at 40% 35%, #ffd98a, #e89a3c); box-shadow: 0 0 12px rgba(232, 154, 60, 0.4); }
.cal-day.today { outline: 2px solid var(--gold-soft); outline-offset: -2px; }

/* ---------- settings rows + toggle ---------- */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-top: 1px solid #e8e2d4; }
.set-row:first-of-type { border-top: 0; padding-top: 2px; }
.set-row .lab b { display: block; font-size: 15px; font-weight: 700; color: var(--light-ink); }
.set-row .lab span { font-size: 12.5px; color: var(--light-muted); }
.time-in { font: inherit; font-family: var(--font-d); font-size: 16px; font-weight: 600; color: var(--light-ink); border: 1px solid #e2ddd0; border-radius: 10px; padding: 9px 11px; background: #fff; }
.switch { position: relative; display: inline-block; width: 50px; height: 30px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.track { position: absolute; inset: 0; border-radius: 99px; background: #cfd8d0; transition: .25s; cursor: pointer; }
.track::before { content: ""; position: absolute; width: 24px; height: 24px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: .25s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::before { transform: translateX(20px); }
.about { font-size: 13.5px; line-height: 1.6; color: var(--light-muted); }
.about b { color: var(--light-ink); }
.about .ver { display: block; margin-top: 10px; font-size: 12px; color: #a7b0a3; }

@media (prefers-reduced-motion: reduce) {
  .hero::after, .hero.done { animation: none; }
  .hero, .btn-primary, .track, .track::before { transition: none; }
}
