/* Phone-first layout. Wider screens progressively add space and columns. */
html { scroll-padding-bottom: 110px; }
body { font-size: 15px; -webkit-text-size-adjust: 100%; }
button, a, select, input, textarea, .import-label { touch-action: manipulation; }
button { -webkit-tap-highlight-color: transparent; }
.sidebar {
  position: relative; inset: auto; width: 100%; padding: max(20px, env(safe-area-inset-top)) 20px 18px;
  flex-direction: row; flex-wrap: nowrap; gap: 16px; align-items: center;
  background: #fcfefd; border: 0; border-bottom: 1px solid var(--line);
}
.sidebar .brand { font-size: 29px; padding: 0; }
.sidebar .brand .icon { width: 28px; height: 32px; }
.sidebar .brand-dot { display: none; }
.sidebar nav, .workspace-label, .sidebar-bottom, .sidebar:after { display: none; }
.habit-select { margin: 0 0 0 auto; max-width: 190px; padding: 8px 10px; min-height: 44px; }
.habit-select>.icon { display: none; }
.habit-select select { font-size: 12px; padding: 0; margin: 0; min-height: 28px; }
main { margin: 0; min-height: calc(100dvh - 85px); }
.topbar { height: auto; padding: 10px 20px 0; border: 0; justify-content: stretch; }
.topbar>span, .topbar .date, .mobile-settings { display: none; }
.topbar>div { width: 100%; }
.help-btn { width: 100%; min-height: 44px; justify-content: center; border-radius: 12px; font-size: 13px; gap: 9px; color: #254e4c; background: #e3f1ed; }
.help-btn .icon { width: 18px; height: 18px; }
.content { padding: 23px 20px 0; width: 100%; max-width: 640px; }
.page-heading { display: block; margin-bottom: 21px; }
.page-heading h1 { font-size: clamp(27px, 7.3vw, 34px); line-height: 1.22; letter-spacing: -.8px; }
.page-heading .eyebrow { font-size: 10px; letter-spacing: 1.5px; margin-bottom: 10px; }
.page-heading p { font-size: 13px; line-height: 1.7; }
.page-heading>.primary { margin-top: 16px; width: 100%; }
.card { padding: 21px; border-radius: 20px; }
h2, .section-title h2 { font-size: 18px; }
.section-title { align-items: start; gap: 12px; }
.section-title p { font-size: 12px; line-height: 1.6; }
.primary, .secondary, .import-label { min-height: 48px; padding: 12px 17px; font-size: 14px; border-radius: 12px; }
.text-button { min-height: 44px; font-size: 12px; }
.primary .icon, .secondary .icon { width: 18px; height: 18px; }
.dashboard-grid { display: flex; flex-direction: column; gap: 16px; }
.hero { order: 0; padding: 21px 23px; }
.hero-top .light-badge { font-size: 9px; letter-spacing: 1.2px; }
.hero-dots { display: none; }
.hero-body { min-height: 174px; }
.hero-caption { font-size: 12px; margin-top: 18px; }
.hero .streak strong { font-size: 80px; line-height: 1.12; }
.hero .streak>span { font-size: 28px; }
.hero-time { font-size: 11px; max-width: 180px; margin: 8px 0 20px; }
.plant-scene { width: clamp(75px, 27vw, 130px); height: 155px; margin-right: -7px; flex-shrink: 1; min-width: 65px; }
.plant-halo { width: 120px; height: 120px; left: 2px; top: 15px; }
.hero-bottom { font-size: 11px; padding-top: 14px; gap: 12px; }
.hero-bottom .progress { height: 5px; }
.stats-row { order: 1; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.stat-card { padding: 16px 10px; display: flex; flex-direction: column; align-items: start; gap: 9px; min-width: 0; border-radius: 16px; }
.stat-card .icon-box { width: 30px; height: 30px; border-radius: 9px; }
.stat-card div { min-width: 0; }
.stat-card div>span { font-size: 11px; line-height: 1.4; min-height: 31px; display: block; color: #637b74; }
.stat-card strong { font-size: clamp(18px,5.1vw,25px); font-weight: 600; letter-spacing: -.5px; overflow-wrap: anywhere; margin-top: 4px; }
.stat-card small { display: none; }
.stat-card .word-stat { font-size: 15px; }
.checkin-card { order: 2; }
.checkin-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.checkin-actions .primary { width: 100%; flex: auto; font-size: 14px; }
.checkin-actions .secondary { width: 100%; flex: auto; font-size: 13px; background: #f7faf8; }
.week { padding: 23px 0 17px; }
.week-day { font-size: 11px; }
.day-dot { width: 32px; height: 32px; font-size: 11px; }
.soft-note { font-size: 11px; line-height: 1.5; }
.toolkit-preview { order: 3; }
.toolkit-preview .secondary { font-size: 13px; }
.breath-preview { margin: 22px 0; gap: 17px; }
.breath-preview strong { font-size: 14px; }
.breath-preview p { font-size: 12px; }
.breath-circle { width: 70px; height: 70px; }
.reason-card { order: 4; }
.card-heading .eyebrow { font-size: 10px; }
.quote-mark { margin-top: 8px; height: 30px; font-size: 45px; }
.reason-card blockquote { font-size: 24px; max-width: none; }
.reason-bottom { font-size: 11px; padding-top: 18px; }
.journey-card { order: 5; }
.journey-card .section-title { flex-wrap: wrap; gap: 2px; }
.journey-card .section-title h2 { font-size: 18px; }
.journey-card .section-title p { font-size: 12px; }
.journey-card .text-button { font-size: 12px; }
.milestone-mini { gap: 12px; align-items: start; }
.milestone-mini strong { font-size: 14px; }
.milestone-mini p { font-size: 12px; }
.milestone-time { font-size: 10px; white-space: nowrap; }
.reward-banner { order: 6; padding: 19px; gap: 12px; flex-wrap: wrap; }
.reward-banner strong { font-size: 14px; }
.reward-banner p { font-size: 12px; }
.reward-banner>div { flex: 1; min-width: 190px; }
.reward-banner .text-button { font-size: 13px; margin-left: 0; }
footer { padding: 25px 20px calc(104px + env(safe-area-inset-bottom)); max-width: 640px; font-size: 10px; }
footer>span { display: none; }
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 2px; padding: 8px max(10px,env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left)); background: #fcfefdfa; border-top: 1px solid #dce8e3; box-shadow: 0 -4px 24px #14262406; backdrop-filter: blur(15px); }
.bottom-tab { min-height: 56px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 5px; border: 0; background: transparent; color: #7a8c85; font-size: 11px; font-weight: 550; border-radius: 13px; padding: 7px 2px; }
.bottom-tab .icon { width: 23px; height: 23px; }
.bottom-tab.is-active { color: #254e4c; background: #e1f1ed; }
.progress-tabs { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; padding: 5px; margin-bottom: 24px; background: #e7efeb; border-radius: 14px; }
.progress-tabs button { min-height: 44px; border: 0; background: transparent; border-radius: 10px; color: #657e74; font-size: 13px; }
.progress-tabs button[aria-current] { background: white; color: #254e4c; box-shadow: 0 2px 5px #14262407; }
.more-profile { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.more-profile .avatar { width: 48px; height: 48px; font-size: 25px; }
.more-profile h2 { margin: 0 0 3px; }
.more-profile p { margin: 0; font-size: 12px; }
.more-menu { display: grid; gap: 12px; }
.more-item { display: flex; gap: 15px; align-items: center; text-align: left; width: 100%; min-height: 90px; }
.more-item>span:nth-child(2) { flex: 1; }
.more-item strong { display: block; font-size: 15px; font-weight: 550; }
.more-item small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.more-item>.icon { width: 18px; color: #7b968c; }
.three-columns,.two-columns,.journal-grid,.two-columns.insights-columns { display: grid; grid-template-columns: minmax(0,1fr); gap: 16px; }
.toolkit-hero { display: block; padding: 25px; }
.toolkit-hero h2 { font-size: 30px; }
.toolkit-hero p { font-size: 14px; }
.toolkit-hero .primary { width: 100%; }
.big-breath { display: none; }
.tool-card h2 { font-size: 19px; }
.tool-card p { font-size: 14px; min-height: auto; }
.tool-card>span:last-child { font-size: 12px; min-height: 30px; }
.calendar-day { min-height: 40px; font-size: 14px; }
.calendar-label { font-size: 12px; }
.calendar .square { width: 44px; height: 44px; }
.legend { flex-wrap: wrap; font-size: 10px; }
.legend>span { margin: 0; }
.entries { max-height: none; }
.entry strong { font-size: 14px; }
.entry p { font-size: 13px; }
.entry small { font-size: 11px; }
.empty-state p { font-size: 14px; }
.health-summary { padding: 20px; gap: 12px; }
.health-summary p { font-size: 12px; }
.health-summary>.badge { display: none; }
.milestone { padding: 20px 16px; gap: 12px; }
.milestone h2 { font-size: 17px; }
.milestone p { font-size: 13px; }
.milestone .eyebrow { font-size: 10px; }
.milestone-node { width: 36px; height: 36px; }
.milestone-pct { font-size: 11px; }
.savings-hero { display: block; padding: 27px; }
.savings-hero h2 { font-size: 55px; }
.savings-hero p { font-size: 13px; }
.savings-projection { max-width: none; padding: 20px 0 0; margin-top: 20px; border-left: 0; border-top: 1px solid #ffffff25; }
.savings-projection>span { font-size: 12px; }
.goal-card p { font-size: 23px; }
.goal-card small, .goal-card p span { font-size: 13px; }
.add-goal p { font-size: 14px; }
.settings-stack .section-title { flex-wrap: wrap; }
.settings-stack .muted { font-size: 14px; }
.settings-stack .section-title .secondary { font-size: 13px; }
.settings-summary { grid-template-columns: 1fr 1fr; font-size: 12px; }
.settings-summary strong { font-size: 14px; }
.button-row { gap: 10px; }
.button-row>.secondary,.button-row>.primary,.button-row>.import-label { flex: 1; }
.reminder-row { flex-wrap: wrap; font-size: 13px; }
.source-note { font-size: 12px; line-height: 1.8; }
.trigger-row { font-size: 14px; }
.insights-columns .muted { font-size: 13px; }
.chart-col>span { font-size: 11px; }
dialog { position: fixed; inset: auto 0 0; width: 100%; max-width: 640px; margin: 0 auto; border-radius: 25px 25px 0 0; padding: 30px 23px calc(28px + env(safe-area-inset-bottom)); max-height: 92dvh; overscroll-behavior: contain; }
dialog::before { content: ''; display: block; height: 4px; width: 35px; margin: -17px auto 23px; border-radius: 4px; background: #d0dfd8; }
body:has(dialog[open]) { overflow: hidden; }
.goal-delete, .entry>.text-button { min-width: 44px; }
dialog h2 { font-size: 29px; padding-right: 14px; }
dialog p { font-size: 14px; }
.close { right: 11px; top: 16px; width: 44px; height: 44px; }
.modal-eyebrow { font-size: 10px; padding-right: 30px; }
form label { font-size: 13px; margin: 19px 0; }
input,select,textarea { font-size: 16px; min-height: 48px; padding: 12px; border-radius: 10px; }
textarea { min-height: 96px; }
form .two-columns { grid-template-columns: minmax(0,1fr); gap: 5px; }
form .form-three { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
form .form-three label { font-size: 11px; }
label small { font-size: 11px; }
.checkbox-label { min-height: 48px; font-size: 13px; }
.checkbox-label input { width: 20px; height: 20px; min-height: 20px; flex-shrink: 0; }
.welcome { min-height: 100dvh; padding: 30px 23px max(30px,env(safe-area-inset-bottom)); }
.welcome .brand { align-self: center; }
.welcome h1 { font-size: clamp(34px,9.5vw,48px); }
.welcome>p { font-size: 15px; }
.welcome>p br { display: none; }
.welcome-art { width: 130px; height: 130px; margin: 35px 0 30px; }
.welcome .large,.welcome>.text-button { width: 100%; max-width: 360px; min-height: 52px; font-size: 15px; }
.welcome-perks { flex-direction: column; gap: 13px; margin: 22px 0; }
.welcome-perks>span { font-size: 12px; }
.welcome>small { font-size: 11px; max-width: 340px; }
#toast { bottom: calc(89px + env(safe-area-inset-bottom)); font-size: 14px; width: max-content; max-width: calc(100% - 32px); }
@media (min-width: 600px) {
  .checkin-actions { flex-wrap: nowrap; }
  .checkin-actions .primary { flex: 1.6; }
  .checkin-actions .secondary { flex: 1; }
  .plant-scene { width: 170px; height: 180px; }
  .hero-body { min-height: 195px; }
  .stat-card { padding: 18px 16px; }
  .stat-card div>span { min-height: auto; }
  .three-columns { grid-template-columns: repeat(2,minmax(0,1fr)); }
  form .two-columns { grid-template-columns: 1fr 1fr; gap: 15px; }
}
@media (min-width: 900px) {
  .bottom-nav { display: none; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 242px; padding: 34px 22px 18px; flex-direction: column; align-items: stretch; flex-wrap: nowrap; border-right: 1px solid var(--line); border-bottom: 0; gap: 0; }
  .sidebar .brand { padding: 0 12px; font-size: 31px; }
  .sidebar .brand-dot { display: block; }
  .sidebar nav,.workspace-label,.sidebar-bottom { display: block; }
  .sidebar-bottom { margin-top: auto; }
  .sidebar .habit-select { max-width: none; margin: 0 4px 26px; }
  .habit-select>.icon { display: block; }
  .sidebar nav .nav-link { width: 100%; padding: 12px 13px; margin: 5px 0; font-size: 12px; }
  main { margin-left: 242px; min-height: 100vh; }
  .topbar { height: 82px; padding: 20px 36px; border-bottom: 1px solid var(--line); justify-content: space-between; }
  .topbar>span,.topbar .date { display: inline; }
  .topbar>div { width: auto; gap: 24px; }
  .help-btn { width: auto; min-height: 44px; padding: 9px 15px; font-size: 12px; }
  .content { padding: 35px 36px 0; max-width: 1450px; }
  .page-heading { display: flex; }
  .page-heading h1 { font-size: 36px; }
  .page-heading>.primary { width: auto; margin: 0; }
  .dashboard-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; }
  .dashboard-grid>* { order: initial; }
  .hero-body { min-height: 210px; }
  .hero .streak strong { font-size: 87px; }
  .plant-scene { width: 145px; height: 180px; }
  .stats-row { grid-column: 1/-1; }
  .stat-card { flex-direction: row; align-items: center; gap: 13px; }
  .stat-card strong { font-size: 25px; }
  .stat-card small { display: block; font-size: 10px; }
  .stat-card .icon-box { width: 35px; height: 35px; }
  .checkin-actions { flex-wrap: wrap; }
  .checkin-actions .primary,.checkin-actions .secondary { flex: auto; }
  .journey-card,.reward-banner { grid-column: 1/-1; }
  .journey-card .section-title { flex-wrap: nowrap; }
  .three-columns { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .two-columns,.two-columns.insights-columns { grid-template-columns: 1fr 1fr; }
  .journal-grid { grid-template-columns: 1fr 1.3fr; }
  .big-breath { display: flex; }
  .toolkit-hero,.savings-hero { display: flex; }
  .toolkit-hero .primary { width: auto; }
  .savings-projection { border-left: 1px solid #ffffff25; border-top: 0; margin-top: 0; padding: 0 0 0 25px; max-width: 45%; }
  .settings-summary { grid-template-columns: repeat(4,1fr); }
  footer { max-width: 1450px; padding: 30px 36px; font-size: 11px; }
  footer>span { display: inline; }
  dialog { inset: 0; margin: auto; width: 560px; max-width: calc(100% - 40px); max-height: 90vh; padding: 35px; border-radius: 20px; }
  dialog::before { display: none; }
  #toast { bottom: 25px; }
  .more-menu { grid-template-columns: 1fr 1fr; }
}
.checkin-card{order:1}.stats-row{order:2}@media(min-width:900px){.dashboard-grid>.hero{grid-column:1;grid-row:1}.dashboard-grid>.reason-card{grid-column:2;grid-row:1}.dashboard-grid>.stats-row{grid-column:1/-1;grid-row:2;order:initial}.dashboard-grid>.checkin-card{grid-column:1;grid-row:3;order:initial}.dashboard-grid>.toolkit-preview{grid-column:2;grid-row:3}}
