/* Jagruti Care — botanical palette, mobile-first */
@font-face {
  font-family: 'Fraunces';
  src: url('fonts/fraunces-var-latin.woff2') format('woff2');
  font-weight: 600 800;
  font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('fonts/manrope-var-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --bg: #F6F3EA;
  --surface: #FFFFFF;
  --ink: #26241C;
  --ink-soft: #6C685A;
  --border: #E5E0D0;
  --primary: #4A6B3D;
  --primary-soft: #E9EEDD;
  --warn: #A97B1E;
  --warn-soft: #F4EACE;
  --danger: #A84B32;
  --danger-soft: #F3E0D8;
  --shadow: 0 2px 14px rgba(84, 92, 60, 0.10);
  --radius-card: 16px;
  --radius-btn: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

.app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: 96px; /* room for tab bar */
}

/* ---------- shared ---------- */
.view { display: none; padding: 28px 20px 8px; }
.view.active { display: block; }

.brand {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 800; letter-spacing: 0.12em; color: var(--primary);
}
.brand .date { font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--ink-soft); }

h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 31px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.16;
  margin: 6px 0 4px;
}
h2.card-title { font-family: 'Fraunces', Georgia, serif; font-size: 19px; font-weight: 700; }
.sub { font-size: 15px; font-weight: 500; color: var(--ink-soft); }

.eyebrow {
  display: block; font-size: 12px; font-weight: 800; letter-spacing: 0.1em;
  color: var(--ink-soft); margin: 22px 0 10px;
}
.eyebrow.moss { color: var(--primary); }
.eyebrow.clay { color: var(--danger); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
  margin-bottom: 10px;
}
.card.hero { border: none; box-shadow: var(--shadow); padding: 18px; }
.card.outline-moss { border: 1.5px solid var(--primary); }
.card.outline-clay { border: 1.5px solid var(--danger); background: var(--danger-soft); }
.card.wash-moss { border: none; background: var(--primary-soft); }
.card.wash-amber { border: none; background: var(--warn-soft); }

.chip {
  display: inline-block; padding: 7px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 700;
}
.chip.moss { background: var(--primary-soft); color: var(--ink); }
.chip.clay { background: var(--danger-soft); color: var(--danger); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.badge {
  flex-shrink: 0; padding: 5px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.04em; white-space: nowrap;
}
.badge.neutral { background: var(--surface); border: 1px solid var(--border); color: var(--ink-soft); }
.badge.moss { background: var(--primary-soft); color: var(--primary); }
.badge.amber { background: var(--warn-soft); color: var(--warn); }

.btn {
  display: flex; align-items: center; justify-content: center;
  min-height: 54px; border: none; border-radius: var(--radius-btn);
  font-family: inherit; font-size: 17px; font-weight: 800; cursor: pointer;
  width: 100%;
}
.btn.moss { background: var(--primary); color: #fff; }
.btn.clay { background: var(--danger); color: #fff; }
.btn.outline-clay { background: var(--surface); border: 1.5px solid var(--danger); color: var(--danger); }
.btn:active { transform: scale(0.985); }

/* ---------- today ---------- */
.hero-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.hero-label { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; color: var(--warn); }
.hero-label.moss { color: var(--primary); }
.hero-time { font-family: 'Fraunces', Georgia, serif; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.hero-meds { display: flex; align-items: center; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.hero-note { font-size: 13px; font-weight: 500; color: var(--ink-soft); }

.slot {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 14px 16px; margin-bottom: 10px;
  cursor: pointer; user-select: none;
}
.slot .time { width: 60px; flex-shrink: 0; font-size: 13px; font-weight: 800; color: var(--ink-soft); }
.slot .mid { flex: 1; min-width: 0; }
.slot .name { display: block; font-size: 16px; font-weight: 700; }
.slot .note { display: block; font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.slot .check {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 999px;
  border: 2px solid var(--border); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 800; color: #fff;
}
.slot.taken .check { background: var(--primary); border-color: var(--primary); }
.slot.due { background: var(--warn-soft); border: 1.5px solid var(--warn); }
.slot.due .time { color: var(--ink); }
.slot.due .note { color: var(--warn); font-weight: 600; }
.slot.due .check { border-color: var(--warn); }
.slot.missed { border: 1.5px solid var(--danger); }
.slot.missed .note { color: var(--danger); font-weight: 600; }

.quick-row { display: flex; gap: 10px; margin-top: 22px; }
.quick {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 14px 16px; cursor: pointer;
  font-family: inherit; text-align: left;
}
.quick .q-title { display: block; font-size: 15px; font-weight: 800; color: var(--ink); }
.quick .q-sub { display: block; font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-top: 3px; }

.streak { display: flex; align-items: center; gap: 8px; padding: 14px 0 6px; font-size: 14px; }
.streak b { color: var(--primary); font-weight: 700; }
.streak span { color: var(--ink-soft); font-weight: 500; font-size: 13px; }

/* ---------- medicines ---------- */
.med { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.med .ico {
  width: 40px; height: 40px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); border-radius: 12px; font-size: 18px;
}
.med .mid { flex: 1; min-width: 0; }
.med .name { display: block; font-size: 16px; font-weight: 700; }
.med .cap { display: block; font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.med-details { display: none; padding-top: 12px; }
.card.open .med-details { display: block; }
.med-details p { font-size: 14px; font-weight: 500; line-height: 1.5; margin-bottom: 8px; }
.med-details .pt { font-size: 13px; font-weight: 600; color: var(--ink-soft); line-height: 1.55; }
.med-details .pt.clay { color: var(--danger); }

/* ---------- routine ---------- */
.tt { padding: 4px 16px; }
.tt-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.tt-row + .tt-row { border-top: 1px solid var(--border); }
.tt-row .t { width: 46px; flex-shrink: 0; font-size: 13px; font-weight: 800; color: var(--ink-soft); }
.tt-row .dot { width: 8px; height: 8px; flex-shrink: 0; border-radius: 999px; background: var(--border); }
.tt-row .dot.med-dot { background: var(--primary); }
.tt-row .a { display: block; font-size: 15px; font-weight: 700; }
.tt-row .n { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-soft); }
.rule-line { font-size: 14px; font-weight: 600; line-height: 1.6; }

/* ---------- readings ---------- */
.seg { display: flex; gap: 6px; padding: 4px; background: #EDE9DC; border-radius: 999px; margin-top: 14px; }
.seg button {
  flex: 1; padding: 8px 0; border: none; background: transparent; border-radius: 999px;
  font-family: inherit; font-size: 13px; font-weight: 700; color: var(--ink-soft); cursor: pointer;
}
.seg button.active { background: var(--primary); color: #fff; font-weight: 800; }

.big-reading { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.big-reading .v { font-family: 'Fraunces', Georgia, serif; font-size: 44px; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; }
.big-reading .u { font-size: 13px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.trend-chip { padding: 4px 10px; background: var(--primary-soft); border-radius: 999px; font-size: 12px; font-weight: 800; color: var(--primary); white-space: nowrap; }
.spark-note { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }

.lab-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; }
.lab-row + .lab-row { border-top: 1px solid var(--border); }
.lab-row .dot { width: 9px; height: 9px; flex-shrink: 0; border-radius: 999px; }
.dot.red { background: var(--danger); } .dot.amber { background: var(--warn); } .dot.green { background: var(--primary); }
.lab-row .lname { flex: 1; font-size: 14.5px; font-weight: 700; }
.lab-row .lval { text-align: right; }
.lab-row .lval b { display: block; font-size: 14.5px; font-weight: 800; }
.lab-row .lval span { display: block; font-size: 11.5px; font-weight: 600; color: var(--ink-soft); }

.test-row { display: flex; align-items: center; gap: 12px; }
.test-row .when { width: 64px; flex-shrink: 0; font-family: 'Fraunces', Georgia, serif; font-size: 16px; font-weight: 700; white-space: nowrap; }
.test-row .when.amber { color: var(--warn); }
.test-row .what { font-size: 14px; font-weight: 600; }
.test-row .what span { font-weight: 500; color: var(--ink-soft); }

.log-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.log-row + .log-row { border-top: 1px solid var(--border); }
.log-row .lv { font-size: 15px; font-weight: 800; width: 76px; white-space: nowrap; }
.log-row .lm { flex: 1; font-size: 13px; font-weight: 600; color: var(--ink-soft); }

/* ---------- care ---------- */
.list-item { font-size: 14px; font-weight: 600; line-height: 1.5; margin-bottom: 7px; }
.step { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.step .num {
  width: 28px; height: 28px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); border-radius: 999px;
  font-family: 'Fraunces', Georgia, serif; font-size: 14px; font-weight: 800; color: var(--primary);
}
.step p { font-size: 14px; font-weight: 600; }
.warn-line { font-size: 13px; font-weight: 700; color: var(--danger); }
.btn-row { display: flex; gap: 10px; margin-top: 14px; }
.btn-row .btn { min-height: 48px; font-size: 15px; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px calc(14px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--border);
  z-index: 50;
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 64px; padding: 6px 0; border: none; background: transparent;
  font-family: inherit; font-size: 11px; font-weight: 600; color: var(--ink-soft);
  border-radius: 12px; cursor: pointer;
}
.tab svg { stroke: var(--ink-soft); }
.tab svg .fill { fill: var(--ink-soft); }
.tab.active { background: var(--primary-soft); color: var(--primary); font-weight: 800; }
.tab.active svg { stroke: var(--primary); }
.tab.active svg .fill { fill: var(--primary); }

/* ---------- sheet (log modal) ---------- */
.sheet-back {
  display: none; position: fixed; inset: 0; background: rgba(38, 36, 28, 0.45); z-index: 100;
}
.sheet-back.open { display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 430px; background: var(--surface);
  border-radius: 20px 20px 0 0; padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
}
.sheet h3 { font-family: 'Fraunces', Georgia, serif; font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.sheet .sheet-sub { font-size: 13.5px; color: var(--ink-soft); font-weight: 500; margin-bottom: 14px; }
.sheet .fields { display: flex; gap: 10px; margin-bottom: 10px; }
.sheet label { display: block; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; color: var(--ink-soft); margin-bottom: 6px; }
.sheet input, .sheet select {
  width: 100%; padding: 14px; border: 1.5px solid var(--border); border-radius: 12px;
  font-family: inherit; font-size: 20px; font-weight: 700; color: var(--ink); background: var(--bg);
}
.sheet input:focus, .sheet select:focus { outline: none; border-color: var(--primary); }
.sheet .f { flex: 1; }
.sheet .btn { margin-top: 6px; }
.sheet .cancel { margin-top: 10px; min-height: 44px; background: transparent; color: var(--ink-soft); font-weight: 700; }

.footnote { font-size: 12.5px; font-weight: 500; color: var(--ink-soft); padding: 8px 0 16px; }
