:root{
  --cream: #FFF6EC;
  --card: #FFFFFF;
  --coral: #FF5A5F;
  --coral-dim: #FFE0DF;
  --cobalt: #3355E6;
  --cobalt-dim: #DCE3FC;
  --teal: #17A398;
  --teal-dim: #CFF1EC;
  --gold: #FFB100;
  --gold-dim: #FFEBC2;
  --ink: #2B2420;
  --ink-soft: #8A7D70;
  --line: #F5E5D5;
  --danger: #D64545;
  --danger-dim: #FBDCDC;
  --icon-orange: #FF8A3D;
  --icon-purple: #8B5CF6;
  --icon-pink: #FF6FA5;
}
*{box-sizing:border-box; -webkit-tap-highlight-color:transparent;}
html,body{margin:0; height:100%; background:var(--cream); font-family:'Manrope',system-ui,sans-serif; color:var(--ink);}
button, input, select, textarea{font-family:inherit;}
h1,h2,h3,p{margin:0;}

#app{ display:none; max-width:480px; margin:0 auto; min-height:100vh; position:relative; flex-direction:column; background:var(--cream); }

.statusbar-safe{ height:env(safe-area-inset-top,0px); }

.view{ display:none; flex:1; padding:16px 20px 110px; overflow-y:auto; }
.view.active{ display:block; }

.hello{ font-size:13px; color:var(--ink-soft); font-weight:700; letter-spacing:.03em; text-transform:uppercase;}
h1.page-title{
  font-family:'Baloo 2', sans-serif; font-weight:800; font-size:26px; color:var(--ink);
  margin:2px 0 10px; letter-spacing:-0.01em;
}
.streak{
  display:inline-flex; align-items:center; gap:6px; background:var(--gold-dim);
  color:#8A5B00; font-size:12px; font-weight:800; padding:6px 12px; border-radius:100px;
  margin-bottom:16px;
}

.test-toggle{ display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; gap:10px; flex-wrap:wrap;}
.test-toggle-label-row{ display:flex; align-items:center; gap:6px; }
.test-toggle-label{ font-size:12px; font-weight:800; color:var(--ink-soft); text-transform:uppercase; letter-spacing:.04em; white-space:nowrap;}
.info-btn{
  width:18px; height:18px; border-radius:50%; background:var(--cobalt); border:none;
  color:#fff; font-size:11px; font-weight:800;
  display:flex; align-items:center; justify-content:center; cursor:pointer; padding:0;
}
.icon-btn-flip{ display:inline-flex; transform:scaleX(-1); }
.test-pills{ display:flex; gap:6px; background:var(--card); border:1px solid var(--line); border-radius:100px; padding:4px;}
.test-pill{
  border:none; background:transparent; padding:7px 12px; border-radius:100px;
  font-size:11.5px; font-weight:800; color:var(--ink-soft); cursor:pointer; white-space:nowrap;
}
.test-pill.active{ background:var(--gold); color:#4A3300; }

.toggle{ display:flex; background:var(--card); border-radius:14px; padding:4px; border:1px solid var(--line); margin-bottom:14px;}
.toggle button{ flex:1; border:none; background:transparent; padding:10px 0; font-weight:800; font-size:13.5px; border-radius:10px; color:var(--ink-soft); cursor:pointer;}
.toggle button.active{ background:var(--coral); color:#fff; }

.card{ background:var(--card); border-radius:22px; padding:18px; margin-bottom:14px; border:1px solid var(--line);}
.card-top{ display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:14px; gap:10px;}
.prop-name{ font-family:'Baloo 2', sans-serif; font-weight:700; font-size:16.5px; color:var(--ink); line-height:1.25;}
.prop-sub{ font-size:12px; color:var(--ink-soft); margin-top:2px; font-weight:600;}
.badge{ font-size:10.5px; font-weight:800; padding:5px 10px; border-radius:100px; background:var(--teal-dim); color:#0A7F76; white-space:nowrap; text-transform:uppercase; letter-spacing:.03em; flex-shrink:0;}
.badge.behind{ background:var(--coral-dim); color:var(--coral); }
.badge.gold{ background:var(--gold-dim); color:#9C6B00; }

.ring-row{ display:flex; align-items:center; gap:18px; }
.ring-wrap{ position:relative; width:112px; height:112px; flex-shrink:0; }
.ring-wrap svg{ transform:rotate(-90deg); }
.ring-center{ position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center;}
.ring-center .num{ font-family:'Baloo 2', sans-serif; font-size:21px; font-weight:800; color:var(--ink); line-height:1;}
.ring-center .goal{ font-size:9.5px; color:var(--teal); font-weight:800; margin-top:2px;}

.legend{ flex:1; display:flex; flex-direction:column; gap:10px; min-width:0;}
.legend-item{ display:flex; align-items:center; gap:8px; }
.legend-dot{ width:11px; height:11px; border-radius:50%; flex-shrink:0; }
.legend-text{ font-size:13px; font-weight:700; color:var(--ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.legend-hrs{ font-size:13px; font-weight:800; color:var(--ink); margin-left:auto; flex-shrink:0;}

.card-actions{ display:flex; gap:8px; margin-top:14px; padding-top:14px; border-top:1px dashed var(--line);}
.card-actions button{ flex:1; border:1px solid var(--line); background:var(--cream); color:var(--ink); font-weight:700; font-size:12.5px; padding:9px 0; border-radius:10px; cursor:pointer;}

.section-label{ font-size:12px; font-weight:800; color:var(--ink-soft); text-transform:uppercase; letter-spacing:.06em; margin:20px 2px 10px;}

.quicklog{ display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:6px;}
.qbtn{ background:var(--card); border:1px solid var(--line); border-radius:16px; padding:14px 4px 10px; text-align:center; cursor:pointer; border-top:3px solid var(--teal); display:flex; flex-direction:column; align-items:center; gap:7px;}
.qbtn.other{}
.qbtn .label{ font-size:10px; font-weight:700; color:var(--ink); line-height:1.2;}

#home-activity-list{ padding-right:86px; }
.activity{ display:flex; align-items:center; gap:12px; padding:12px 0; border-bottom:1px solid var(--line);}
.activity:last-child{ border-bottom:none; }
.act-icon{ width:38px; height:38px; border-radius:12px; background:var(--teal-dim); display:flex; align-items:center; justify-content:center; font-size:16px; flex-shrink:0;}
.act-body{ flex:1; min-width:0; }
.act-title{ font-size:13.5px; font-weight:700; color:var(--ink); }
.act-sub{ font-size:11.5px; color:var(--ink-soft); font-weight:600; margin-top:1px;}
.edited-tag{ font-size:9.5px; color:var(--ink-soft); font-weight:700; margin-top:2px;}
.act-time{ font-size:13px; font-weight:800; color:var(--coral); flex-shrink:0;}
.act-row{ display:flex; align-items:center; gap:10px; width:100%; cursor:pointer; background:none; border:none; padding:0; text-align:left; font-family:inherit;}

.empty-state{ text-align:center; padding:50px 20px; color:var(--ink-soft); }
.empty-state .icon{ font-size:40px; margin-bottom:12px; }
.empty-state h3{ font-family:'Baloo 2',sans-serif; color:var(--ink); font-size:17px; margin-bottom:6px;}
.empty-state p{ font-size:13px; line-height:1.5; margin-bottom:18px;}

.fab-wrap{ position:fixed; bottom:96px; right:calc((100vw - min(480px,100vw))/2 + 20px); display:flex; flex-direction:column; align-items:center; gap:14px; z-index:20;}
.fab{ width:58px; height:58px; border-radius:50%; background:var(--coral); display:flex; align-items:center; justify-content:center; box-shadow:0 12px 26px rgba(255,90,95,0.5); cursor:pointer; border:3px solid #fff;}
.fab.fab-secondary{ width:50px; height:50px; background:var(--teal); box-shadow:0 10px 20px rgba(23,163,152,0.45);}
.fab.listening{ background:var(--danger); animation:pulse 1.2s infinite; }
@keyframes pulse{ 0%{box-shadow:0 0 0 0 rgba(214,69,69,0.5);} 70%{box-shadow:0 0 0 16px rgba(214,69,69,0);} 100%{box-shadow:0 0 0 0 rgba(214,69,69,0);} }
.fab svg{ width:26px; height:26px; }
.fab-label{ font-size:10px; font-weight:800; color:var(--coral); background:#fff; padding:3px 9px; border-radius:100px; border:1px solid var(--coral-dim); white-space:nowrap;}

.tabbar{ position:fixed; bottom:0; left:50%; transform:translateX(-50%); width:100%; max-width:480px; height:calc(72px + env(safe-area-inset-bottom,0px)); background:rgba(255,246,236,0.94); backdrop-filter:blur(12px); border-top:1px solid var(--line); display:flex; padding-top:8px; z-index:10;}
.tab{ flex:1; display:flex; flex-direction:column; align-items:center; gap:4px; background:none; border:none; cursor:pointer; padding:4px 0;}
.tab .dot{ width:21px; height:21px; color:var(--ink-soft); }
.tab span{ font-size:9.5px; font-weight:700; color:var(--ink-soft); }
.tab.active span, .tab.active .dot{ color:var(--coral); }

/* Forms */
.field{ margin-bottom:16px; }
.field label{ display:block; font-size:12px; font-weight:800; color:var(--ink-soft); text-transform:uppercase; letter-spacing:.03em; margin-bottom:6px;}
.field input, .field select, .field textarea{
  width:100%; padding:12px 14px; border-radius:12px; border:1px solid var(--line);
  background:var(--card); font-size:14px; color:var(--ink); font-weight:600;
}
.field textarea{ resize:vertical; min-height:70px; font-weight:500;}
.chip-row{ display:flex; gap:8px; flex-wrap:wrap; }
.chip{ padding:9px 14px; border-radius:100px; border:1px solid var(--line); background:var(--card); font-size:12.5px; font-weight:700; color:var(--ink-soft); cursor:pointer;}
.chip.active{ background:var(--coral); border-color:var(--coral); color:#fff; }
.chip.active.alt{ background:var(--cobalt); border-color:var(--cobalt); }

.btn-primary{ width:100%; background:var(--coral); color:#fff; border:none; padding:15px; border-radius:14px; font-weight:800; font-size:15px; cursor:pointer; margin-top:8px;}
.btn-secondary{ width:100%; background:var(--card); color:var(--ink); border:1px solid var(--line); padding:14px; border-radius:14px; font-weight:800; font-size:14px; cursor:pointer; margin-top:8px;}
.btn-danger{ width:100%; background:var(--danger-dim); color:var(--danger); border:none; padding:14px; border-radius:14px; font-weight:800; font-size:14px; cursor:pointer; margin-top:8px;}

/* Top bar for sub-pages */
.subpage-header{ display:flex; align-items:center; gap:12px; margin-bottom:18px; }
.back-btn{ width:34px; height:34px; border-radius:50%; background:var(--card); border:1px solid var(--line); display:flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0;}
.subpage-header h2{ font-family:'Baloo 2',sans-serif; font-size:19px; color:var(--ink); }

/* Modals */
.modal-overlay{ display:none; position:fixed; inset:0; background:rgba(43,36,32,0.55); align-items:flex-end; justify-content:center; z-index:50;}
.modal-overlay.active{ display:flex; }
#photoLightbox{ z-index:80; align-items:center; }
#newPersonRoleModal{ z-index:80; }
.modal{ background:var(--card); border-radius:24px 24px 0 0; padding:22px 20px calc(28px + env(safe-area-inset-bottom,0px)); max-height:85vh; overflow-y:auto; width:100%; max-width:480px;}
.modal h2{ font-family:'Baloo 2', sans-serif; font-size:19px; margin:0 0 14px; color:var(--ink); }
.modal-block{ margin-bottom:14px; padding:14px; border-radius:14px; }
.modal-block.coral{ background:var(--coral-dim); }
.modal-block.cobalt{ background:var(--cobalt-dim); }
.modal-block.teal{ background:var(--teal-dim); }
.example-chip-list{ display:flex; flex-wrap:wrap; gap:6px; }
.example-chip{ background:#fff; border:1px solid rgba(0,0,0,0.06); color:var(--ink); font-size:11px; font-weight:700; padding:6px 10px; border-radius:100px; }

.cat-tile{ border-radius:50%; display:flex; align-items:center; justify-content:center; flex-shrink:0; color:#fff; }
.cat-tile svg{ width:56%; height:56%; }
.cat-tile.emoji-tile span{ line-height:1; }

.photo-thumbs{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:8px; }
.photo-thumb{ width:64px; height:64px; border-radius:10px; overflow:hidden; position:relative; border:1px solid var(--line); cursor:pointer; }
.photo-thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.photo-thumb .remove-btn{ position:absolute; top:2px; right:2px; width:19px; height:19px; border-radius:50%; background:rgba(0,0,0,0.6); color:#fff; font-size:12px; display:flex; align-items:center; justify-content:center; cursor:pointer; z-index:2; }

.suggestion-card{
  background:linear-gradient(135deg, var(--gold-dim), #fff); border:1px solid var(--gold);
  border-radius:18px; padding:14px 16px; margin-bottom:12px;
}
.suggestion-top{ display:flex; align-items:flex-start; gap:10px; margin-bottom:12px; }
.suggestion-icon{ font-size:22px; flex-shrink:0; }
.suggestion-text{ font-size:13px; font-weight:700; color:var(--ink); line-height:1.4; }
.suggestion-sub{ font-size:11.5px; color:var(--ink-soft); font-weight:600; margin-top:2px;}
.suggestion-actions{ display:flex; gap:8px; }
.suggestion-actions button{ border:none; border-radius:10px; padding:9px 0; font-weight:800; font-size:12.5px; cursor:pointer; flex:1;}
.suggestion-accept{ background:var(--gold); color:#4A3300; }
.suggestion-dismiss{ background:transparent; color:var(--ink-soft); border:1px solid var(--line) !important; }

.reminder-banner{
  background:linear-gradient(135deg, var(--cobalt-dim), #fff); border:1px solid var(--cobalt);
  border-radius:18px; padding:14px 16px; margin-bottom:12px;
}
.reminder-banner .suggestion-top{ margin-bottom:12px; }
.reminder-accept{ background:var(--cobalt); color:#fff; }

.auth-gate{
  display:flex; align-items:center; justify-content:center; min-height:100vh;
  background:var(--cream); padding:20px;
}
.auth-card{
  width:100%; max-width:360px; background:var(--card); border-radius:24px;
  padding:36px 24px; text-align:center; box-shadow:0 8px 30px rgba(43,36,32,0.08);
}
.auth-logo{ width:56px; height:auto; margin:0 auto 10px; display:block; }
.auth-wordmark{ font-family:'Manrope',sans-serif; font-weight:800; font-size:15px; letter-spacing:.06em; color:var(--cobalt); margin-bottom:28px; }
.auth-card h2{ font-family:'Baloo 2',sans-serif; font-size:20px; margin-bottom:8px; }
.auth-sub{ font-size:12.5px; color:var(--ink-soft); font-weight:600; line-height:1.5; margin-bottom:18px; }
.auth-card input{ width:100%; padding:13px 14px; border-radius:12px; border:1px solid var(--line); font-size:15px; margin-bottom:12px; text-align:center; }
.auth-status{ font-size:12px; font-weight:700; margin-top:10px; min-height:16px; }

.hm-row{ display:flex; gap:10px; }
.hm-field{ flex:1; }
.hm-field label{ font-size:10.5px; font-weight:700; color:var(--ink-soft); text-transform:uppercase; letter-spacing:.03em; display:block; margin-top:5px; text-align:center;}
.hm-field input{ text-align:center; }

.about-section{ text-align:center; padding:36px 20px 20px; margin-top:8px; }
.about-logo{ width:64px; height:auto; display:block; margin:0 auto 12px; }
.about-wordmark{ font-family:'Manrope',system-ui,sans-serif; font-weight:800; font-size:18px; letter-spacing:.06em; color:var(--cobalt); }
.about-version{ font-size:11.5px; color:var(--ink-soft); font-weight:600; margin-top:6px; }
.modal-block h3{ font-size:14px; margin:0 0 6px; color:var(--ink); font-weight:800;}
.modal-block p{ font-size:12.5px; line-height:1.5; color:var(--ink); margin:0 0 6px;}
.modal-block .cite{ font-size:11px; color:var(--ink-soft); font-weight:700;}
.modal-disclaimer{ background:var(--gold-dim); border-radius:14px; padding:12px 14px; font-size:12px; color:#5C3E00; font-weight:600; line-height:1.5;}
.modal-close{ display:block; margin:16px auto 0; background:var(--coral); color:#fff; border:none; padding:12px 32px; border-radius:100px; font-weight:800; font-size:14px; cursor:pointer;}

.voice-panel{ text-align:center; padding:20px 4px; }
.voice-ring{ width:120px; height:120px; border-radius:50%; background:var(--coral-dim); display:flex; align-items:center; justify-content:center; margin:0 auto 18px; position:relative;}
.voice-ring.listening{ background:rgba(214,69,69,0.15); }
.voice-ring .mic{ width:56px; height:56px; border-radius:50%; background:var(--coral); display:flex; align-items:center; justify-content:center;}
.voice-ring.listening .mic{ background:var(--danger); }
.voice-status{ font-weight:800; color:var(--ink); margin-bottom:6px; }
.voice-transcript{ font-size:13px; color:var(--ink-soft); min-height:20px; margin-bottom:16px; padding:0 10px;}
.voice-hint{ font-size:11.5px; color:var(--ink-soft); background:var(--gold-dim); padding:10px 14px; border-radius:12px; text-align:left; line-height:1.5;}

.timer-display{ font-family:'Baloo 2', sans-serif; font-size:44px; font-weight:800; color:var(--danger); letter-spacing:0.02em; margin-bottom:8px;}

.toast{ position:fixed; bottom:110px; left:50%; transform:translateX(-50%); background:var(--ink); color:#fff; padding:11px 20px; border-radius:100px; font-size:13px; font-weight:700; z-index:100; opacity:0; transition:opacity .25s; pointer-events:none;}
.toast.show{ opacity:1; }

.disclaimer-box{ background:var(--gold-dim); border-radius:14px; padding:14px; font-size:12px; color:#5C3E00; line-height:1.5; font-weight:600; margin-bottom:16px;}
.settings-row{ display:flex; align-items:center; justify-content:space-between; padding:14px 0; border-bottom:1px solid var(--line);}
.settings-row:last-child{ border-bottom:none; }
.settings-row-text{ font-size:14px; font-weight:700; color:var(--ink); }
.settings-row-sub{ font-size:11.5px; color:var(--ink-soft); font-weight:600; margin-top:2px;}

.range-scroll{
  display:flex; gap:8px; overflow-x:auto; padding:2px 2px 10px; margin-bottom:2px;
  scrollbar-width:none;
}
.range-scroll::-webkit-scrollbar{ display:none; }
.range-chip{
  flex-shrink:0; padding:9px 16px; border-radius:100px; border:1px solid var(--line);
  background:var(--card); font-size:12.5px; font-weight:800; color:var(--ink-soft); cursor:pointer; white-space:nowrap;
}
.range-chip.active{ background:var(--ink); border-color:var(--ink); color:#fff; }
.range-caption{ font-size:11.5px; color:var(--ink-soft); font-weight:600; font-style:italic; margin-bottom:16px;}

.stat-strip{ display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-bottom:22px;}
.stat-box{ background:var(--card); border:1px solid var(--line); border-radius:16px; padding:14px 8px; text-align:center;}
.stat-num{ font-family:'Baloo 2', sans-serif; font-size:19px; font-weight:800; color:var(--coral);}
.stat-label{ font-size:9.5px; font-weight:700; color:var(--ink-soft); text-transform:uppercase; letter-spacing:.02em; margin-top:3px; line-height:1.3;}

.propcard-scroll{ display:flex; gap:10px; overflow-x:auto; padding:2px 2px 10px; scrollbar-width:none; margin-bottom:6px;}
.propcard-scroll::-webkit-scrollbar{ display:none; }
.propcard{
  flex-shrink:0; width:132px; background:var(--card); border:1px solid var(--line); border-radius:18px;
  padding:14px; text-align:center;
}
.propcard-ring{ position:relative; width:72px; height:72px; margin:0 auto 8px;}
.propcard-ring svg{ transform:rotate(-90deg); }
.propcard-ring-center{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-family:'Baloo 2',sans-serif; font-weight:800; font-size:14px; color:var(--ink);}
.propcard-name{ font-size:12px; font-weight:800; color:var(--ink); line-height:1.25; margin-bottom:2px;}
.propcard-sub{ font-size:10.5px; color:var(--ink-soft); font-weight:700;}

.catbar-row{ margin-bottom:14px; }
.catbar-row:last-child{ margin-bottom:0; }
.catbar-top{ display:flex; justify-content:space-between; align-items:center; margin-bottom:6px;}
.catbar-label{ font-size:12.5px; font-weight:700; color:var(--ink); display:flex; align-items:center; gap:6px;}
.catbar-hrs{ font-size:12.5px; font-weight:800; color:var(--ink);}
.catbar-track{ height:9px; background:var(--cream); border-radius:6px; overflow:hidden;}
.catbar-fill{ height:100%; border-radius:6px; background:linear-gradient(90deg, var(--teal), #29CFB8);}

.heatstrip{ display:grid; grid-template-columns:repeat(12,1fr); gap:5px; }
.heatcell{ display:flex; flex-direction:column; align-items:center; gap:6px; }
.heatsq{ width:100%; aspect-ratio:1; border-radius:7px; background:var(--cream); border:1px solid var(--line);}
.heatcell-label{ font-size:9px; font-weight:700; color:var(--ink-soft);}
.heatcell-val{ font-size:7.5px; font-weight:800; color:var(--coral); }

.footer-disclaimer{ text-align:center; font-size:10.5px; color:var(--ink-soft); font-weight:600; margin:26px 0 8px; opacity:0.8; line-height:1.4;}

.avatar-picker{ display:flex; align-items:center; gap:14px; }
.avatar-preview{
  width:56px; height:56px; border-radius:50%; background:var(--card); border:1px solid var(--line);
  display:flex; align-items:center; justify-content:center; font-size:26px; overflow:hidden; flex-shrink:0;
}
.avatar-preview img{ width:100%; height:100%; object-fit:cover; }
.avatar-picker .chip{ font-size:11.5px; padding:8px 12px; margin-right:6px; margin-bottom:6px; display:inline-block;}
#category-emoji-input{ padding:10px 12px; border-radius:10px; border:1px solid var(--line); font-size:18px; width:150px; background:var(--card);}
.emoji-grid{ display:grid; grid-template-columns:repeat(8,1fr); gap:6px; margin-top:10px; }
.emoji-grid button{
  font-size:20px; background:var(--card); border:1px solid var(--line); border-radius:10px;
  padding:8px 0; cursor:pointer;
}
.emoji-grid button.selected{ border-color:var(--coral); background:var(--coral-dim); }

.avatar-sm{
  width:36px; height:36px; border-radius:50%; background:var(--cream); border:1px solid var(--line);
  display:flex; align-items:center; justify-content:center; font-size:18px; overflow:hidden; flex-shrink:0;
}
.avatar-sm img{ width:100%; height:100%; object-fit:cover; }
.prop-name-row{ display:flex; align-items:center; gap:10px; }
