/* Page 4 · Personal page (/personal) + the shared app shell (header, tab bars) of the signed-in pages. Mobile-first: one column + bottom tab bar; desktop: two columns, tabs in the header. */

.app { padding-bottom: calc(76px + env(safe-area-inset-bottom)); } /* room for the tab bar */
.app-header .wrap { height: 56px; }
.top-tabs { display: none; }

.home { padding-top: 8px; padding-bottom: 24px; }
.home h2 { font-size: 1.05rem; }
.label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* Greeting */
.hello { display: flex; align-items: center; gap: 12px; }
.avatar { width: 44px; height: 44px; flex: none; border-radius: 14px; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; }
.hello-text { flex: 1; min-width: 0; }
.hello h1 { font-size: 1.35rem; }
.hello-text p { font-size: 0.85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.streak { display: inline-flex; align-items: center; gap: 4px; flex: none; padding: 6px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; font-size: 0.85rem; white-space: nowrap; }
.streak.zero { background: var(--paper-2); color: var(--muted); }

.home-grid { display: grid; gap: 16px; margin-top: 16px; }
.col { display: grid; gap: 16px; align-content: start; min-width: 0; }

/* Goal */
.goal { padding: 16px; }
.goal-top { display: flex; align-items: center; gap: 16px; }
.ring { flex: none; }
#ring-bar { transition: stroke-dasharray 0.5s ease; }
.goal-main { font-weight: 800; margin-top: 2px; }
.goal-sub { font-size: 0.85rem; color: var(--muted); }
.week { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.week li { display: grid; justify-items: center; gap: 4px; font-size: 0.72rem; color: var(--muted); }
.week .dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 0.7rem; font-weight: 800; border: 1.5px dashed var(--line); }
.week .done .dot { border: 0; background: #e5f4e4; color: var(--ok); }
.week .today { color: var(--ink); font-weight: 800; }
.week .today .dot { border: 2.5px solid var(--ok); color: var(--ok); }
.week .today.done .dot { border: 0; background: var(--ok); color: #fff; }

/* Continue */
.continue { padding: 18px; border-radius: var(--radius); background: var(--ink); color: #fff; }
.cont-label { color: var(--gold); }
.continue h2 { font-size: 1.25rem; margin-top: 4px; }
.cont-meta { display: flex; align-items: center; gap: 8px; margin: 6px 0 14px; font-size: 0.85rem; color: #c9cbe0; }
.stars { display: inline-flex; gap: 1px; }
.stars svg { width: 16px; height: 16px; }
.continue .btn svg { flex: none; }

/* Blocks */
.block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.badge { font-size: 0.75rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); }
.row-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 64px; text-decoration: none; color: inherit; box-shadow: none; }
.row-link:active { background: var(--paper-2); }
.row-icon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--teal-soft); color: var(--teal); }
.row-text { flex: 1; min-width: 0; display: grid; }
.row-text strong { font-weight: 800; }
.row-text span { font-size: 0.82rem; color: var(--muted); }
.chev { color: var(--muted); flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 700; font-size: 0.88rem; text-decoration: none; color: var(--ink); }
.chip:active { background: var(--paper-2); }
.trouble .row-text strong { font-size: 1.05rem; margin-top: 2px; }
.trouble .row-text > span { font-size: 0.82rem; }
.link-text { flex: none; font-weight: 800; font-size: 0.88rem; color: var(--accent-ink); }
.tip { padding: 14px; font-size: 0.9rem; color: var(--ink-2); box-shadow: none; }

/* Prototype-only switcher (same look as on /login) */
.proto-states { margin-top: 24px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 0.82rem; color: var(--muted); }
.proto-states span { width: 100%; }
.proto-states button { min-height: 36px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: 0.82rem; font-weight: 600; }
.proto-states button.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Bottom tab bar (phones and tablets) */
.learn-link { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 12px; margin-right: 4px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--card); color: var(--ink); font-weight: 800; font-size: 0.85rem; text-decoration: none; }
.learn-link:hover { background: var(--paper-2); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
.tabbar a { display: grid; justify-items: center; gap: 2px; min-height: 52px; padding-top: 4px; text-decoration: none; font-size: 0.72rem; font-weight: 700; color: var(--muted); }
.tabbar svg { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--ink); }
.tabbar a[aria-current="page"] svg { color: var(--accent); }

/* Proto toast sits above the tab bar */
.app .proto-toast { bottom: calc(92px + env(safe-area-inset-bottom)); }

@media (min-width: 900px) {
  .app { padding-bottom: 0; }
  .tabbar { display: none; }
  .top-tabs { display: flex; gap: 4px; margin-left: 28px; }
  .top-tabs a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-weight: 700; font-size: 0.95rem; }
  .top-tabs a:hover { background: var(--paper-2); color: var(--ink); }
  .top-tabs a[aria-current="page"] { background: var(--ink); color: #fff; }
  .home { padding-top: 32px; max-width: 1040px; }
  .hello h1 { font-size: 1.9rem; }
  .home-grid { grid-template-columns: 1.1fr 1fr; gap: 24px; margin-top: 24px; }
  .col { gap: 24px; }
  .app .proto-toast { bottom: 32px; }
}

/* Age question and parent's consent (assets/consent-card.js) */
.age-card { margin-top: 14px; padding: 14px 16px; box-shadow: none; border: 1.5px solid #f3dfb8; background: #fff8ec; }
.age-card h2 { font-size: 1.05rem; }
.age-card .age-text { margin-top: 4px; font-size: 0.9rem; color: var(--ink-2); }
.age-card .age-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.age-card form .btn-block { width: 100%; margin-top: 10px; }
.age-card .link-btn { width: auto; text-align: left; padding: 0; color: var(--accent-ink); }
