/* timobox — design system.
   ONE font stack app-wide: Nunito (Latin/digits — rounded terminals,
   matching the logo's letterforms) leads; Noto Sans SC / JP supply
   the CJK glyphs. The stack is IDENTICAL for every language — glyph
   coverage decides per character, so switching language never
   changes the look: Latin is always Nunito, CJK always Noto.
   Headings 700 (800/900 rendered blobby for CJK), body 400,
   emphasis 600–700. Everything inherits via --font-main.
   ONE accent: --accent comes from families.theme_color and drives every
   primary button, selected nav item, segmented control and accent. */
:root {
  --accent:#2f9e8f;
  --ink:#26302c; --muted:#7d8a84; --line:#e7e2d8; --bg:#faf8f3; --card:#ffffff;
  --font-main:"Nunito","Noto Sans SC","Noto Sans JP",sans-serif;
  --shadow:0 1px 2px rgba(38,48,44,.05),0 8px 24px rgba(38,48,44,.06);
}
* { box-sizing:border-box; }
body { margin:0; font-family:var(--font-main); font-size:15.5px; line-height:1.55;
       background:var(--bg); color:var(--ink); padding-bottom:96px; }
button, input, select, textarea { font:inherit; color:inherit; }
h1, h2, h3, .brandname, .kname, .ss-title { font-family:var(--font-main); line-height:1.2; }
h1 { font-size:25px; font-weight:700; } h2 { font-size:17px; font-weight:700; margin:22px 0 10px; }
/* tab page titles (Timeline / Reminders / Growth / Settings) */
#tab-timeline h2, #tab-reminders h2, #tab-growth h2, #tab-settings h2 { font-size:20px; }
h3 { font-size:16.5px; font-weight:700; margin:4px 0 10px; }
.hidden { display:none !important; }
.view { max-width:560px; margin:0 auto; padding:16px; }
.centerbox { text-align:center; display:flex; flex-direction:column; gap:12px;
  min-height:calc(100dvh - 32px); justify-content:center;
  padding:calc(10px + env(safe-area-inset-top)) 0 calc(10px + env(safe-area-inset-bottom)); }
.centerbox p { margin:0; }
.logoimg { width:200px; max-width:72%; height:auto; align-self:center; display:block; }
.gsi-wrap { display:flex; justify-content:center; }
/* small print sits directly under the form (~22px), operated-by under it */
#view-auth .centerbox > p[data-i18n="signinNote"] { margin-top:10px; }
.tagline { color:var(--muted); margin:0; }
.brandname { font-size:21px; font-weight:700; }
.muted { color:var(--muted); } .small { font-size:13px; } .center { text-align:center; }
.page { display:flex; flex-direction:column; gap:12px; }
.field { display:flex; flex-direction:column; gap:6px; font-size:14px; text-align:left; font-weight:600; }
.field input, .field select, .field textarea { padding:11px 12px; border:1.5px solid var(--line);
  border-radius:12px; font-size:16px; background:#fff; width:100%; font-weight:400; }
.btn { border:1.5px solid var(--line); background:#fff; color:var(--ink); border-radius:999px;
  padding:10px 18px; font-size:15px; font-weight:700; cursor:pointer; }
.btn.primary { background:var(--accent); border-color:var(--accent); color:#fff; font-weight:700; }
.btn.ghost { background:transparent; border-color:transparent; color:var(--muted); }
.btn.big { width:100%; padding:14px; font-size:16px; }
.btn.smallbtn { padding:7px 14px; font-size:14px; }
.btn:disabled { opacity:.55; cursor:default; }
.divider { color:var(--muted); font-size:13px; }
.msg { min-height:20px; font-size:14px; color:var(--accent); white-space:pre-wrap; font-weight:600; }
.msg.err { color:#c0392b; }

/* language: globe button + dropdown (replaces the old text pills) */
.langbar { position:fixed; top:8px; right:10px; z-index:70; }
.langglobe { display:flex; align-items:center; gap:6px; border:1.5px solid var(--line); background:#fff;
  border-radius:999px; padding:6px 12px 6px 9px; font-size:13px; font-weight:700; color:var(--ink);
  cursor:pointer; box-shadow:var(--shadow); }
.langglobe svg { width:17px; height:17px; color:var(--accent); }
.langmenu { position:absolute; top:calc(100% + 6px); right:0; z-index:70; max-width:calc(100vw - 20px); background:#fff; border:1.5px solid var(--line);
  border-radius:14px; box-shadow:0 10px 28px rgba(38,48,44,.12); padding:5px; min-width:132px;
  display:flex; flex-direction:column; }
.langmenu button { display:flex; justify-content:space-between; align-items:center; gap:14px; border:0;
  background:transparent; padding:9px 11px; border-radius:9px; font-size:14px; font-weight:700;
  color:var(--ink); cursor:pointer; text-align:left; }
.langmenu button:hover { background:var(--bg); }
.langmenu button .ck { color:var(--accent); font-weight:700; visibility:hidden; }
.langmenu button.sel .ck { visibility:visible; }

.swatches { display:flex; gap:10px; }
.swatch { width:34px; height:34px; border-radius:50%; border:2px solid transparent; cursor:pointer; }
.swatch.sel { border-color:var(--ink); }
.apphead { display:flex; justify-content:space-between; align-items:flex-start; padding:2px 104px 8px 0; min-height:42px; border-bottom:1px solid var(--line); }
#hdr-role { font-size:12px; }
#view-onboard-family, #view-onboard-child, #view-onboard-drive { padding-top:54px; }
.hdr-brandwrap { display:flex; align-items:center; gap:11px; min-width:0; }
.hdrlogo-slot { flex:none; display:inline-flex; }
.hdrlogo { width:36px; height:36px; border-radius:10px; object-fit:cover; border:1px solid var(--line); display:block; flex:none; }
.logotile { width:40px; height:40px; border-radius:12px; background:var(--accent); color:#fff;
  display:inline-grid; place-items:center; font-family:var(--font-main); font-weight:700; font-size:20px; }
.row { display:flex; gap:10px; align-items:center; } .row.between { justify-content:space-between; }
.card { background:var(--card); border:1px solid var(--line); border-radius:18px; padding:16px; margin:12px 0;
  display:flex; flex-direction:column; gap:10px; box-shadow:var(--shadow); }
.kidlist { display:flex; flex-direction:column; gap:10px; }
.kidcard { background:var(--card); border:1px solid var(--line); border-radius:16px; padding:14px 16px; box-shadow:var(--shadow); }
.kidcard .kname { font-size:18px; font-weight:700; }

/* home: kid chips, slideshow hero, recent moments */
.kidchips { display:grid; grid-template-columns:1fr 1fr; gap:9px; margin:4px 0 6px; }
.kidchips .kidchip:nth-child(3):last-child { grid-column:span 2; }
.kidchip { display:flex; align-items:center; gap:10px; padding:8px 14px 8px 9px; border-radius:16px;
  background:var(--card); border:1.5px solid var(--line); cursor:pointer; text-align:left; box-shadow:var(--shadow); }
.kidchip.active { border-color:var(--accent); }
.kidchip .av { width:40px; height:40px; border-radius:50%; display:grid; place-items:center;
  font-family:var(--font-main); font-weight:700; color:#fff; flex:none; font-size:17px; }
.kidchip .kn { font-weight:700; font-size:15px; line-height:1.2; }
.kidchip .ka { color:var(--muted); font-size:12px; font-weight:600; }
.showcard { display:block; width:100%; text-align:left; background:var(--card); border:1px solid var(--line);
  border-radius:18px; padding:0; overflow:hidden; cursor:pointer; box-shadow:var(--shadow);
  margin:4px 0 18px; color:var(--ink); }
.showcard-art { display:block; position:relative; height:168px; background:#14423b linear-gradient(150deg,#175e52,#57b7a5);
  background-size:cover; background-position:center; }
.showcard-art img.artimg { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block; }
.showcard-ring { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); width:60px; height:60px;
  border-radius:50%; background:rgba(255,255,255,.95); display:grid; place-items:center;
  box-shadow:0 8px 22px rgba(0,0,0,.28); color:var(--accent); }
.showcard-ring svg { width:26px; height:26px; margin-left:3px; }
.showcard-meta { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 15px; }
.showcard-meta .lbl { font-family:var(--font-main); font-size:17.5px; font-weight:700; white-space:nowrap;
  display:inline-flex; align-items:center; gap:8px; }
.showcard-meta .lbl svg { width:19px; height:19px; color:var(--accent); }
.showcard-cap { color:var(--muted); font-weight:700; font-size:13px; text-align:right; min-width:0;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.recent { display:flex; flex-direction:column; gap:9px; }
.recentrow { display:flex; gap:11px; align-items:flex-start; width:100%; text-align:left; background:var(--card);
  border:1px solid var(--line); border-radius:18px; padding:12px; cursor:pointer; box-shadow:var(--shadow); }
.recentrow .rthumb { width:56px; height:56px; border-radius:12px; object-fit:cover; flex:none; }
.recentrow .rthumbph { width:56px; height:56px; border-radius:12px; flex:none; display:grid; place-items:center;
  color:#fff; font-family:var(--font-main); font-weight:700; font-size:20px; }
.recentrow .rbody { flex:1; min-width:0; }
.recentrow .rtext { font-weight:600; font-size:14.5px; overflow:hidden; text-overflow:ellipsis;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.recentrow .rmeta { display:flex; gap:7px; flex-wrap:wrap; align-items:center; font-size:12px; color:var(--muted); margin-bottom:3px; }

/* timeline entries */
.entry { background:var(--card); border:1px solid var(--line); border-radius:18px; padding:14px 16px; margin:10px 0; box-shadow:var(--shadow); }
.entry .meta { display:flex; gap:8px; flex-wrap:wrap; align-items:center; font-size:12px; color:var(--muted); }
.chip { border-radius:999px; padding:2px 9px; font-size:12px; background:#eef4f2; color:var(--accent); font-weight:700; }
.chip.kid { background:#fdf1e7; color:#b05f2a; }
.entry .quote { font-size:17px; font-weight:700; margin:6px 0; font-family:var(--font-main); }
.entry img.photo { width:100%; border-radius:12px; margin-top:8px; }
.photonote { font-size:13px; color:var(--muted); border:1px dashed var(--line); border-radius:12px; padding:10px; margin-top:8px; }
.photonote .btn { margin-top:8px; }
.entry .actions { display:flex; gap:6px; margin-top:10px; }
.btn.danger { background:#c0392b; border-color:#c0392b; color:#fff; font-weight:700; }
.delconfirm { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-top:10px; font-size:14px; color:#c0392b; }
@keyframes tlflash { 0%,100% { box-shadow:var(--shadow); } 25%,60% { box-shadow:0 0 0 3px var(--accent); } }
.entry.flash { animation:tlflash 1.1s ease-in-out 2; }
.thumbs { display:flex; gap:10px; flex-wrap:wrap; margin:4px 0; }
.thumb { position:relative; width:72px; height:72px; flex:none; }
.thumb img { width:100%; height:100%; object-fit:cover; border-radius:10px; display:block; }
.thumb.ph { border:1px dashed var(--line); border-radius:10px; display:flex; align-items:center; justify-content:center; }
.thumb .phlabel { font-size:12px; color:var(--muted); }
.thumb .rm { position:absolute; top:-7px; right:-7px; width:22px; height:22px; border-radius:50%;
  border:1px solid var(--line); background:#fff; color:var(--ink); font-size:14px; line-height:1; cursor:pointer; padding:0; }
.field.rowcheck { flex-direction:row; align-items:center; gap:8px; }
.field.rowcheck input { width:auto; }

/* growth chart */
.chartcard { background:var(--card); border:1px solid var(--line); border-radius:18px; padding:16px; margin:12px 0;
  box-shadow:var(--shadow); display:flex; flex-direction:column; gap:10px; }
.seg { display:inline-flex; gap:4px; background:var(--bg); border:1.5px solid var(--line); border-radius:999px; padding:4px; align-self:flex-start; }
.seg button { border:0; background:transparent; padding:7px 16px; border-radius:999px; font-weight:700;
  cursor:pointer; color:var(--muted); font-size:14px; }
.seg button.active { background:var(--accent); color:#fff; }
.chiprow { display:flex; gap:7px; flex-wrap:wrap; }
.gkid { border:1.5px solid var(--line); background:#fff; color:var(--muted); padding:6px 13px; border-radius:999px;
  font-weight:700; font-size:13px; cursor:pointer; display:inline-flex; align-items:center; gap:7px; }
.gkid .dotc { width:9px; height:9px; border-radius:50%; flex:none; }
.gkid.active { color:var(--ink); border-color:var(--accent); }
.ref-chip { display:inline-flex; align-items:center; gap:7px; border:1.5px solid var(--line); background:#fff;
  color:var(--muted); padding:6px 12px; border-radius:999px; font-weight:700; font-size:13px; cursor:pointer; opacity:.55; }
.ref-chip .rsw { width:10px; height:10px; border-radius:3px; flex:none; }
.ref-chip.on { opacity:1; color:var(--ink); }
.chartwrap { background:#fffdf8; border:1px solid var(--line); border-radius:16px; padding:8px 4px; }
.chartwrap svg { width:100%; height:auto; display:block; color:var(--ink); }
#meas-panel { border-top:1px dashed var(--line); padding-top:12px; margin-top:2px; }
#meas-panel-head .mp-name { font-family:var(--font-main); font-weight:700; font-size:17px; }
#meas-panel-head .mp-big { font-family:var(--font-main); font-size:21px; font-weight:700; margin-top:2px; }
.mp-sub { font-weight:700; font-size:13.5px; margin:10px 0 6px; color:var(--muted); }
.meas-moment { display:flex; gap:10px; align-items:center; width:100%; text-align:left; background:var(--bg);
  border:1px solid var(--line); border-radius:12px; padding:9px 12px; margin:6px 0; cursor:pointer; font-size:14px; }
.meas-moment .mm-dot { width:9px; height:9px; border-radius:50%; flex:none; }
.meas-moment .mm-body { flex:1; min-width:0; }
.meas-moment .mm-text { font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:block; }

/* stories */
.storycard { background:var(--card); border:1px solid var(--line); border-radius:18px; padding:15px 16px; margin:10px 0; box-shadow:var(--shadow); }
.storycard .stitle { font-family:var(--font-main); font-size:18px; font-weight:700; }
.storycard .sexcerpt { color:var(--ink); font-size:14.5px; margin-top:5px; overflow:hidden; text-overflow:ellipsis;
  display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; }
.favstar { color:#e9a13b; }

/* settings: logo card + family tree */
.logorow { display:flex; align-items:center; gap:14px; }
.logoprev { flex:none; display:inline-flex; }
.logoprev img { width:62px; height:62px; border-radius:16px; object-fit:cover; border:1px solid var(--line); display:block; }
.logoprev .logotile { width:62px; height:62px; border-radius:16px; font-size:29px; }
.logobtns { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.logobtns label.btn { margin:0; }
.ftree { padding-top:2px; }
.froot { display:flex; align-items:center; justify-content:center; gap:9px; font-family:var(--font-main);
  font-weight:700; font-size:17px; border:2px solid var(--accent); color:var(--ink); border-radius:16px;
  padding:10px 14px; background:#fff; text-align:center; }
.froot .hdrlogo, .froot .logotile { width:30px; height:30px; border-radius:9px; font-size:15px; }
.fspine { width:2px; height:16px; background:var(--line); margin:0 auto; }
.frail { border-left:2px solid var(--line); margin-left:16px; padding-left:0; display:flex; flex-direction:column; gap:13px; }
.fgroup { position:relative; padding-left:16px; }
.fgroup::before { content:""; position:absolute; left:0; top:15px; width:14px; height:2px; background:var(--line); }
.fglabel { display:inline-block; font-weight:700; font-size:12.5px; letter-spacing:.02em; color:var(--accent);
  background:#eef4f2; border-radius:999px; padding:3px 11px; margin-bottom:7px; }
.fnodes { display:flex; flex-direction:column; gap:6px; }
.fnode { display:flex; align-items:center; gap:9px; background:var(--bg); border:1px solid var(--line);
  border-radius:12px; padding:7px 11px; font-size:14px; }
.fnode .fav { width:27px; height:27px; border-radius:50%; display:grid; place-items:center; color:#fff;
  font-family:var(--font-main); font-weight:700; font-size:13px; flex:none; }
.fnode .fn-name { font-weight:700; }
.fnode .fn-sub { color:var(--muted); font-size:12.5px; font-weight:600; }
.fnode.pending { border-style:dashed; color:var(--muted); background:#fff; }
.fnode .wait { margin-left:auto; font-size:11.5px; font-weight:700; color:#b97e10; background:#fdf3d3;
  border-radius:999px; padding:2px 8px; flex:none; }
.fnode .invremove { background:none; border:none; cursor:pointer; font:inherit; font-size:12.5px;
  font-weight:700; color:#c0564f; padding:2px; flex:none; }
.fnode .invremove:hover { text-decoration:underline; }
.fnodewrap .delconfirm { margin:6px 2px 2px; }

/* members + invite duplicate warning */
.memberrow { display:flex; justify-content:space-between; padding:8px 0; border-bottom:1px solid var(--line); font-size:14px; }
.dupwarn { background:#fdf3d3; border:1px solid #ecd9a0; border-radius:14px; padding:12px 14px; }
.dupwarn p { margin:0 0 9px; font-size:14px; font-weight:600; }

/* slideshow (full screen) */
.ss-top { display:flex; justify-content:space-between; align-items:center; padding:2px 104px 10px 0; }
.ss-title { font-size:19px; font-weight:700; }
.ss-stage { position:relative; border-radius:22px; overflow:hidden; background:#14423b linear-gradient(150deg,#175e52,#57b7a5);
  min-height:340px; display:flex; }
.ss-slide { position:absolute; inset:0; opacity:0; transition:opacity .45s ease; display:flex; align-items:flex-end; }
.ss-slide.active { opacity:1; }
.ss-slide img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.ss-slide .photonote { position:absolute; top:14px; left:14px; right:14px; z-index:3; margin:0;
  background:rgba(255,255,255,.92); color:#33524b; border:0; text-align:center; }
.ss-cap { position:relative; z-index:2; width:100%; box-sizing:border-box;
  padding:44px 18px 16px; background:linear-gradient(transparent, rgba(9,32,27,.74)); color:#fff; }
.ss-badge { display:inline-block; font-size:12.5px; font-weight:700; letter-spacing:.02em;
  background:rgba(255,255,255,.22); border-radius:999px; padding:3px 10px; margin-bottom:7px; }
.ss-text { font-size:19px; font-weight:700; line-height:1.45; }
.ss-note { margin:auto; padding:26px 22px; text-align:center; color:#fff; font-size:15.5px;
  display:flex; flex-direction:column; align-items:center; gap:14px; }
.ss-controls { display:flex; align-items:center; justify-content:center; gap:14px; padding:12px 0 2px; }
.ss-controls .btn { display:inline-flex; align-items:center; justify-content:center; }
.ss-controls .btn svg { width:22px; height:22px; display:block; }
.ss-controls #ss-play { min-width:104px; }
.ss-controls #ss-counter { min-width:44px; }
.dots { display:flex; justify-content:center; align-items:center; gap:7px; padding:9px 0 2px; }
.dots .dot { width:9px; height:9px; border-radius:50%; border:0; padding:0; flex:none;
  background:#ccd6d0; cursor:pointer; transition:all .25s ease; }
.dots .dot.on { background:var(--accent); transform:scale(1.3); }
.remgroup { margin:18px 0 8px; font-size:15px; font-weight:700; }
/* bottom navigation: a real fixed bar — transparent buttons, 24px icons */
#bottomnav { position:fixed; left:0; right:0; bottom:0; z-index:55; display:flex;
  background:rgba(255,255,255,.97); border-top:1px solid var(--line);
  padding:6px 4px calc(6px + env(safe-area-inset-bottom));
  box-shadow:0 -4px 18px rgba(38,48,44,.05); }
#bottomnav .navbtn { flex:1 1 0; display:flex; flex-direction:column; align-items:center; gap:2px;
  background:transparent; border:0; border-radius:12px; padding:4px 0 3px;
  font-size:11px; font-weight:700; line-height:1.15; color:var(--muted); cursor:pointer; }
#bottomnav .navbtn svg { width:23px; height:23px; flex:none; display:block; }
#bottomnav .navbtn.sel { color:var(--accent); }

/* One stack for every language (see --font-main): no per-language
   overrides — those were what made the font visibly change on switch. */

/* timeline: filters + month groups on a rail (demo parity) */
.tl-filters { display:flex; gap:10px; flex-wrap:wrap; align-items:center; justify-content:space-between; margin:12px 0 2px; }
.tl-kid-select { padding:8px 10px; border:1.5px solid var(--line); border-radius:999px; background:#fff; font-size:14px; font-weight:600; }
.tl-month { font-weight:700; font-size:16px; margin:18px 0 2px 2px; color:var(--accent); }
.tl-group { position:relative; margin-left:8px; padding-left:20px; }
.tl-group::before { content:""; position:absolute; left:0; top:8px; bottom:8px; width:2px; background:var(--line); border-radius:2px; }
.tl-group .entry { position:relative; }
.tl-dot { position:absolute; left:-27px; top:20px; width:11px; height:11px; border-radius:50%;
  border:2px solid #fff; box-shadow:0 0 0 1.5px var(--line); z-index:1; }

/* kids manager rows (Settings) */
.kidrow { display:flex; gap:9px; align-items:center; flex-wrap:wrap; padding:9px 0; border-bottom:1px solid var(--line); }
.kidrow .av { width:34px; height:34px; border-radius:50%; display:inline-grid; place-items:center; color:#fff; font-weight:700; font-size:15px; flex:none; }
.kidrow .kbody { flex:1; min-width:110px; display:flex; flex-direction:column; }
.kidrow .kn { font-weight:700; }
.kidrow .ka { font-size:12px; color:var(--muted); }
.kidrow .delconfirm, .kidrow .msg { flex-basis:100%; }

/* reminders rows (Home) */
.remrow { display:flex; gap:8px; align-items:center; flex-wrap:wrap; background:var(--card);
  border:1px solid var(--line); border-radius:14px; padding:10px 12px; margin:8px 0; box-shadow:var(--shadow); }
.remrow .remdate { font-weight:700; font-size:13px; }
.remrow .remtitle { font-weight:600; flex:1; min-width:110px; }
.remrow.done { opacity:.55; }
.remrow .remover { color:#c0392b; font-size:12px; font-weight:700; }
