:root {
  --green: #2E7D32;
  --green-dark: #1B5E20;
  --green-soft: #E8F5E9;
  --text: #1F2421;
  --muted: #5F6B63;
  --line: #E3E8E4;
  --warn: #C62828;
  --accent: #F57C00;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: 480px; margin: 0 auto; padding: 16px; }

h1 { font-size: 1.6rem; line-height: 1.25; margin: 8px 0 12px; }
h2 { font-size: 1.15rem; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); font-size: .9rem; }
.hidden { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; min-height: 48px; padding: 12px 16px;
  border: 0; border-radius: 10px; cursor: pointer;
  background: var(--green); color: #fff;
  font-family: inherit; font-size: 1rem; font-weight: 600; line-height: 1.2; text-decoration: none;
}
.btn:active { background: var(--green-dark); }
.btn[disabled] { opacity: .6; cursor: default; }
.btn-ghost { background: var(--green-soft); color: var(--green-dark); }
.btn-ghost:active { background: #C8E6C9; }
.btn-sm { width: auto; min-height: 36px; padding: 8px 12px; font-size: .9rem; }

/* Form */
label { display: block; font-weight: 600; font-size: .9rem; margin: 12px 0 4px; }
input[type=text], input[type=tel], input[type=email], input[type=number] {
  width: 100%; min-height: 48px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px;
  font: inherit; background: #fff; color: var(--text);
}
input:focus { outline: 2px solid var(--green); border-color: transparent; }
.seg { display: flex; gap: 8px; margin-top: 4px; }
.seg label {
  flex: 1; margin: 0; padding: 10px; text-align: center; font-weight: 600;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + span { color: var(--green); }
.seg label:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.hp { position: absolute; left: -9999px; }
.err { color: var(--warn); font-size: .9rem; min-height: 1.2em; margin: 8px 0; }

/* Landing */
.hero { padding: 24px 0 8px; }
.hero .emoji { font-size: 2.5rem; }
.benefits { list-style: none; padding: 0; margin: 0 0 16px; }
.benefits li { padding: 6px 0 6px 28px; position: relative; }
.benefits li::before { content: "✓"; position: absolute; left: 4px; color: var(--green); font-weight: 700; }
.stats { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; padding: 10px 12px; border-radius: var(--radius); background: var(--green-soft); color: var(--green-dark); font-size: .95rem; }
.stats b { font-variant-numeric: tabular-nums; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }

/* Pasang */
.step { color: var(--green); font-weight: 700; font-size: .85rem; margin: 16px 0 0; text-transform: uppercase; letter-spacing: .04em; }
.steps { padding-left: 20px; margin: 0 0 12px; }
.steps li { margin-bottom: 8px; }
.share { width: 18px; height: 18px; vertical-align: -3px; color: #007AFF; }
.arrow-down { text-align: center; font-size: 2rem; color: var(--green); animation: nudge 1.2s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(6px); } }
.skip { text-align: center; margin-top: 24px; font-size: .85rem; }
.skip a { color: var(--muted); }

/* App */
.topbar {
  position: sticky; top: 0; z-index: 5; background: #fff;
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; padding-bottom: 12px; }
.topbar strong { font-size: 1.1rem; }

.notice {
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  background: var(--green-soft); border-radius: var(--radius);
  padding: 12px; margin-bottom: 12px; font-size: .9rem;
}
.notice p { margin: 0; }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty .emoji { font-size: 3rem; }

.card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px; background: #fff;
}
.card.due { border-color: var(--accent); }
.card.flash { outline: 3px solid var(--green); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card-head h2 { margin: 0; word-break: break-word; }
.icon-btn {
  border: 0; background: none; color: var(--muted); cursor: pointer;
  font-size: 1.2rem; line-height: 1; padding: 4px 6px; border-radius: 6px;
}
.status { font-size: .9rem; margin: 4px 0 8px; color: var(--muted); }
.card.due .status { color: var(--accent); font-weight: 600; }

.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin-bottom: 12px; }
.bar span { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.card.due .bar span { background: var(--accent); }

.actions { display: flex; gap: 8px; }
.actions .water { flex: 2; }
.actions .cal { flex: none; width: auto; white-space: nowrap; font-size: .9rem; }

.promo {
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  margin-top: 12px; padding: 12px; border-radius: 10px;
  background: #FFF8E1; border: 1px dashed #FFB300;
}
.promo small { display: block; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.promo strong { display: block; font-size: .95rem; }
.promo p { margin: 2px 0 0; font-size: .85rem; color: var(--muted); }
.promo a {
  flex: none; padding: 10px 12px; border-radius: 8px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: .85rem; text-decoration: none;
}

.fab {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
  width: auto; padding: 14px 20px; border-radius: 99px;
  box-shadow: 0 4px 12px rgba(0,0,0,.18); z-index: 6;
}
main.wrap { padding-bottom: 96px; }

dialog {
  width: min(440px, calc(100% - 32px)); border: 0; border-radius: var(--radius);
  padding: 20px; color: var(--text);
}
dialog::backdrop { background: rgba(0,0,0,.4); }
.row { display: flex; gap: 8px; margin-top: 16px; }
