/* Client dashboard. Health-app feel, tabs at the bottom on mobile. */
body.dash-app { min-height: 100dvh; padding-bottom: calc(112px + var(--safe-b)); }
.d-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: calc(12px + var(--safe-t)) 18px 12px; border-width: 0 0 1px; }
.d-top h1 { font-size: 30px; letter-spacing: -.04em; line-height: 1.1; }
.d-top .sp { flex: 1; }
.avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 750; }
.d-main { max-width: 600px; margin: 0 auto; padding: 14px 14px 0; }
.tab { display: grid; gap: 12px; }
.tab > * { animation: rise .75s var(--spring) both; animation-delay: calc(var(--i, 0) * 55ms); min-width: 0; }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } }

.dc { background: var(--bg-1); border-radius: 22px; padding: 18px; }
.dh { font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 14px; }
.dc-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.dc-top .dh { margin: 0; }
.dc p { color: var(--text-2); font-size: 15px; }
.seg.sm { width: 116px; }
.seg.sm button { min-height: 32px; font-size: 13px; }

/* Tab bar */
.tabbar {
  position: fixed; z-index: 30; left: 12px; right: 12px; bottom: calc(10px + var(--safe-b)); max-width: 480px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(6, 1fr); padding: 6px; border-radius: 30px; box-shadow: 0 20px 50px rgba(0, 0, 0, .65);
}
.tabbar button { display: grid; justify-items: center; gap: 3px; padding: 8px 0 6px; border: 0; background: none; color: var(--text-3); font-size: 11px; font-weight: 600; letter-spacing: 0; border-radius: 24px; cursor: pointer; transition: color .2s; }
.tabbar svg { width: 24px; height: 24px; transition: transform .6s var(--spring-b); }
.tabbar button[aria-selected="true"] { color: var(--accent); }
.tabbar button[aria-selected="true"] svg { transform: scale(1.12); }
.tabbar button:active svg { transform: scale(.84); transition-duration: .1s; }
@media (min-width: 960px) {
  body.dash-app { padding-bottom: 48px; }
  .tabbar { left: 24px; right: auto; top: 50%; bottom: auto; transform: translateY(-50%); grid-template-columns: 1fr; width: 96px; margin: 0; gap: 4px; }
  .tabbar button { padding: 12px 0 10px; }
}

/* Home */
.status { padding: 14px 4px 8px; }
.status h2 { font-size: clamp(34px, 10.4vw, 56px); letter-spacing: -.05em; line-height: .95; margin: 6px 0 12px; color: var(--accent); }
.status.chg h2 { color: var(--text); }
.status .wk { font: 600 13px var(--mono); color: var(--text-3); }
.status p, .status li { color: var(--text-2); font-size: 16px; }
.status ul { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.status li { color: var(--text); font-weight: 600; }
.today { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 168px); align-items: center; gap: 12px; margin-bottom: 10px; font-weight: 600; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); text-align: center; }
.week span { font-size: 12px; font-weight: 600; color: var(--text-3); }
.week span.now { color: var(--accent); }
.tk { display: block; width: 100%; max-width: 30px; aspect-ratio: 1; margin: 0 auto; border-radius: 50%; border: 1.5px dashed var(--line-2); transition: transform .6s var(--spring-b), background-color .2s; }
.tk.hit { border: 0; transform: scale(1.04); background: rgba(98, 211, 148, .16) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2362D394' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 10.5l3 3 6-7'/%3E%3C/svg%3E") center / 70% no-repeat; }
.tk.miss { border: 0; background: rgba(255, 122, 122, .13) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23FF7A7A' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6.5 6.5l7 7M13.5 6.5l-7 7'/%3E%3C/svg%3E") center / 70% no-repeat; }
.week-l { grid-column: 1 / -1; text-align: left; font-size: 12px; color: var(--text-3); margin-top: 4px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { padding: 14px; border-radius: 18px; background: var(--bg-2); border: 1px solid var(--line); }
.tile span { font-size: 13px; color: var(--text-3); font-weight: 600; }
.tile b { display: block; font-size: 28px; letter-spacing: -.04em; line-height: 1.15; margin-top: 4px; }
.tile small { font-size: 13px; color: var(--text-2); }
.rowc { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rowc b { display: block; font-size: 20px; letter-spacing: -.02em; }

/* Progress */
.big { font-size: 52px; font-weight: 780; letter-spacing: -.05em; line-height: 1; }
.big small { font-size: 14px; font-weight: 550; letter-spacing: 0; color: var(--text-3); margin-left: 8px; }
.chart svg { width: 100%; height: auto; margin-top: 14px; overflow: visible; }
.chart .avg { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.5s var(--ease) forwards .25s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart .end { animation: pop .6s var(--spring-b) both 1.3s; transform-box: fill-box; transform-origin: center; }
@keyframes pop { from { transform: scale(0); opacity: 0; } }
.legend2 { display: flex; gap: 16px; font-size: 12px; color: var(--text-3); margin-top: 8px; }
.legend2 i { display: inline-block; vertical-align: middle; margin-right: 6px; }
.legend2 .l { width: 16px; height: 3px; border-radius: 3px; background: var(--accent); }
.legend2 .d { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .35); }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.stats3 span { display: block; font-size: 12px; color: var(--text-3); font-weight: 600; }
.stats3 b { font-size: 16px; letter-spacing: -.02em; white-space: nowrap; }
.li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.li:first-of-type { border-top: 0; padding-top: 0; }
.li:last-child { padding-bottom: 0; }
.li b { font-weight: 620; }
.li small { display: block; font-size: 13px; color: var(--text-3); }
.li .v { text-align: right; font-size: 19px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.li .v small { font-weight: 500; }
.pb.new { position: relative; margin: 0 -10px 4px; padding: 14px 10px; border: 0; border-radius: 18px; background: var(--accent-soft); overflow: hidden; }
.pb.new + .li { border-top: 0; }
.nstamp { display: inline-block; margin-left: 10px; padding: 1px 6px; border: 2px solid var(--accent); border-radius: 5px; font: 800 10px/1.5 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); transform: rotate(-5deg); animation: thunk .5s var(--spring-b) both .45s; }
@keyframes thunk { from { transform: rotate(-5deg) scale(2); opacity: 0; } }
.up { color: var(--ok); } .dn { color: var(--accent); }

/* Photos */
.shot { position: relative; aspect-ratio: 3 / 4; border-radius: 20px; overflow: hidden; background: radial-gradient(100% 70% at 50% 0%, rgba(255, 255, 255, .08), transparent 60%), var(--bg-2); border: 1px solid var(--line); display: grid; place-items: center; }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot .fake { width: 62%; }
.shot .guide { position: absolute; inset: 7% 16%; color: rgba(255, 255, 255, .7); pointer-events: none; transition: opacity .3s; }
.shot .guide svg { width: 100%; height: 100%; }
.shot .tag { position: absolute; left: 10px; top: 10px; z-index: 2; padding: 5px 10px; font-size: 12px; }
.shot .hint { position: absolute; left: 14px; right: 14px; bottom: 14px; text-align: center; font-size: 13px; color: var(--text-2); }
.today-shot { max-width: 300px; margin: 0 auto 14px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tl { position: relative; max-width: 300px; margin: 0 auto; }
.tl .f { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .35s ease; }
.tl .f.on { opacity: 1; }
.tl-ctl { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; margin-top: 14px; }
.play { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.scrub { -webkit-appearance: none; appearance: none; width: 100%; height: 32px; background: none; }
.scrub::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .14); }
.scrub::-moz-range-track { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .14); }
.scrub::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -9px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.scrub::-moz-range-thumb { width: 24px; height: 24px; border: 0; border-radius: 50%; background: #fff; }
.warn { padding: 14px 16px; border-radius: 18px; border: 1px solid var(--accent-line); background: var(--accent-soft); font-size: 15px; font-weight: 600; }

/* Plan */
.macro { display: grid; gap: 12px; margin-top: 16px; }
.macro div { display: grid; grid-template-columns: 70px 1fr 52px; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; }
.macro i { height: 8px; border-radius: 8px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.macro i::after { content: ""; display: block; height: 100%; width: var(--w); border-radius: 8px; background: var(--accent); transform-origin: left; animation: grow 1s var(--spring) both .2s; }
.macro div:nth-child(2) i::after { opacity: .65; } .macro div:nth-child(3) i::after { opacity: .4; }
@keyframes grow { from { transform: scaleX(0); } }
.macro span:last-child { text-align: right; color: var(--text-2); }
.demo-btn { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .05) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23F3F1EC'%3E%3Cpath d='M7.5 5.5v9l7-4.5z'/%3E%3C/svg%3E") center / 18px no-repeat; }
.ex { display: grid; grid-template-columns: 1fr auto 36px; }
.lockc { text-align: center; padding: 26px 18px; border: 1.5px dashed var(--line-2); background: none; }
.lockc b { display: block; font-size: 19px; margin-bottom: 4px; }

/* Check-in */
.f-grid { display: grid; gap: 16px; }
.f-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.f-lbl { display: block; font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.f-inp { width: 100%; min-height: 52px; padding: 12px 14px; border-radius: 15px; background: var(--bg-2); border: 1px solid var(--line-2); font-size: 17px; outline: none; transition: border-color .2s, box-shadow .2s; }
.f-inp:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea.f-inp { min-height: 110px; resize: none; }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slot { position: relative; aspect-ratio: 3 / 4; border-radius: 16px; border: 1.5px dashed var(--line-2); display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--text-3); cursor: pointer; overflow: hidden; }
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hist p { margin-top: 8px; }
.hist .when { display: flex; justify-content: space-between; gap: 10px; font-weight: 650; }
.hist .when small { color: var(--text-3); font-weight: 500; font-size: 13px; }

/* Sheets */
.set { margin-top: 18px; display: grid; gap: 8px; font-size: 15px; font-weight: 600; }
.set.row { grid-template-columns: 1fr auto; align-items: center; }
.sent-badge { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; margin: 4px auto 16px; background: var(--accent); color: var(--accent-ink); }
.sheet-wrap.open .sent-badge { animation: pop .8s var(--spring-b) both .15s; }

/* Inside the phone frame on the home page */
body.embed { padding-bottom: 96px; }
body.embed .d-top .pill, body.embed .avatar { display: none; }
body.embed::-webkit-scrollbar { display: none; }

/* Brand components inside the dashboard */
.demo-tag { font: 600 11px var(--mono); color: var(--text-3); }
.dc .chat { max-width: none; }
.dc .msg { font-size: 15px; }
.hist .chat { margin-top: 10px; }
.hist .when small { font-family: var(--mono); font-size: 12px; }
.food .dh { padding-left: 4px; }
.food .printer { width: min(100%, 360px); }
.food .receipt p + p { margin-top: 2px; }
