/* Member site layout. Components come from /shared/base.css. */
.app-shell { min-height: 100dvh; display: flex; flex-direction: column; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 80; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--text); color: #fff; text-decoration: none; }
.skip-link:focus { top: 12px; }
.main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 28px 24px 64px; outline: none; }

/* Top bar: the brand, the home tabs in the middle on wide screens (.tabbar), the account on the right */
.topbar { position: sticky; top: 0; z-index: 30; background: rgb(255 255 255 / .86); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1120px; margin: 0 auto; height: 64px; padding: 0 24px; display: flex; align-items: center; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: var(--fs-title-3); letter-spacing: .02em; }
.account-button { display: inline-flex; align-items: center; gap: 8px; max-width: 280px; height: 42px; padding: 0 12px 0 4px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); color: var(--text-2); cursor: pointer; transition: border-color var(--dur-1), background var(--dur-1); }
.account-button:hover { border-color: var(--border-hover); color: var(--text); }
.account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-label); font-weight: 600; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); font-size: var(--fs-small); font-weight: 700; }
.avatar-lg { width: 48px; height: 48px; font-size: var(--fs-title-2); }

/* Announcement */
.announcement { border-bottom: 1px solid var(--success-border); background: var(--success-soft); color: var(--brand-ink); }
.announcement[data-color="yellow"] { background: var(--warning-soft); border-color: var(--warning-border); color: var(--warning-ink); }
.announcement[data-color="red"] { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger-ink); }
.announcement-inner { max-width: 1120px; margin: 0 auto; padding: 8px 24px; display: flex; align-items: center; gap: 14px; }
.announcement-main { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 10px; padding: 4px 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; font-size: var(--fs-label); }
.announcement-main .icon { margin-top: 2px; }
.announcement-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.announcement.is-open .announcement-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.announcement-extra { display: inline-flex; align-items: center; gap: 8px; flex: none; font-size: var(--fs-small); }
.announcement-extra .subtle { color: inherit; opacity: .7; }
.announcement-group { font-weight: 600; }
.announcement-copy { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px; border: 1px solid currentColor; border-radius: 999px; background: rgb(255 255 255 / .55); color: inherit; font-size: var(--fs-small); font-weight: 600; cursor: pointer; opacity: .9; }
.announcement-copy:hover { opacity: 1; background: #fff; }
.page-notices { max-width: 1120px; width: 100%; margin: 0 auto; padding: 0 24px; display: grid; gap: 10px; }
.page-notices:has(> :not([hidden])) { padding-top: 16px; }

/* Screens */
.screen { animation: screen-in var(--dur-3) var(--ease); }
/* A moving container would carry the fixed tab bar along: on the home only the cards come in. */
.home-screen { animation: none; }
.home-screen > .home-grid { animation: screen-in var(--dur-3) var(--ease); }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } }
.screen-center { min-height: 50vh; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; }
.screen-narrow { max-width: 520px; margin: 4vh auto 0; }
.loading-mark .spinner { width: 28px; height: 28px; border-width: 3px; }
.failure-card { max-width: 420px; justify-items: start; text-align: left; }
.blocked-card { justify-items: start; }
.hero-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--radius-lg); background: var(--brand-soft); color: var(--brand); }
.hero-icon[data-tone="warning"] { background: var(--warning-soft); color: var(--warning); }
.page-head { display: grid; gap: 6px; margin-bottom: 22px; }

/* Sign in */
.auth-screen { display: grid; grid-template-columns: minmax(0, 1fr) 420px; grid-template-areas: "intro card" "features card"; column-gap: 64px; row-gap: 36px; align-items: start; padding-top: 5vh; }
.auth-intro { grid-area: intro; align-self: end; display: grid; gap: 18px; }
.auth-title { font-size: clamp(28px, 4.4vw, var(--fs-hero)); line-height: 1.12; letter-spacing: -.035em; font-weight: 700; }
.auth-lead { font-size: var(--fs-title-2); color: var(--text-2); max-width: 30em; }
.auth-card { grid-area: card; padding: 28px; }
.auth-card-title { font-size: var(--fs-title-1); }
.auth-card .segmented { display: flex; }
.auth-card .segment { flex: 1; }
.auth-note { text-align: center; }
.captcha-row { display: flex; align-items: center; gap: 8px; }
.captcha-row .input { flex: 1; min-width: 0; }
.captcha-refresh { flex: none; display: block; width: 120px; height: 44px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); cursor: pointer; }
.captcha-picture { display: block; width: 120px; height: 44px; }
.features { grid-area: features; list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; max-width: 460px; }
.feature { display: flex; gap: 14px; align-items: flex-start; }
.feature-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--brand); box-shadow: var(--shadow-sm); }
.feature-title { font-weight: 600; }
.feature-body { color: var(--text-2); font-size: var(--fs-label); }

/* Setup */
.setup-screen { max-width: 680px; margin: 0 auto; }
.progress { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.progress-bar { flex: 1; max-width: 220px; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; --value: 0; }
.progress-fill { display: block; height: 100%; width: calc(var(--value) * 100%); background: var(--brand); border-radius: inherit; transition: width var(--dur-3) var(--ease); }
.progress-text { font-size: var(--fs-small); color: var(--text-3); font-weight: 600; }
.steps { list-style: none; margin: 0; padding: 8px 0; }
.step { position: relative; padding: 18px 24px; }
.step + .step { border-top: 1px solid var(--border); }
.step-head { display: flex; align-items: flex-start; gap: 14px; }
.step-marker { position: relative; display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text-3); font-size: var(--fs-label); font-weight: 700; }
.step-check { display: none; }
.step[data-state="current"] .step-marker { border-color: var(--brand); background: var(--brand); color: #fff; box-shadow: var(--ring); }
.step[data-state="done"] .step-marker { border-color: var(--brand-soft); background: var(--brand-soft); color: var(--brand); }
.step[data-state="done"] .step-num { display: none; }
.step[data-state="done"] .step-check { display: block; }
.step-titles { flex: 1; min-width: 0; display: grid; gap: 2px; padding-top: 4px; }
.step-title { font-size: var(--fs-title-3); }
.step[data-state="upcoming"] .step-title { color: var(--text-3); }
.step-summary { font-size: var(--fs-small); color: var(--text-3); overflow-wrap: anywhere; }
.step[data-state="done"] .step-summary { color: var(--text-2); }
.step-extra { flex: none; padding-top: 2px; }
.step-extra:empty { display: none; }
.step-body { display: grid; gap: 16px; margin: 18px 0 4px 46px; }

.qr-panel { display: flex; gap: 24px; align-items: flex-start; }
.qr-frame { display: grid; justify-items: center; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-sm); }
.qr-code { width: 184px; height: 184px; display: grid; place-items: center; }
.qr-image { width: 100%; height: 100%; image-rendering: pixelated; color-scheme: only light; }
.qr-caption { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: var(--fs-small); font-weight: 600; }
.qr-caption .icon { color: var(--wechat); }
.qr-side { flex: 1; min-width: 0; display: grid; gap: 14px; }
.qr-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--text-2); font-size: var(--fs-label); }
.watch-line { display: flex; align-items: center; gap: 8px; min-height: 22px; font-size: var(--fs-small); color: var(--text-3); }
.watch-line:empty { display: none; }
.watch-line.is-live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); animation: breathe 1.6s ease-in-out infinite; }

/* Home: one tab at a time on every width. Wide screens: two columns (the side one stays in view). */
.home-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 24px; align-items: start; }
.home-main, .home-side { display: grid; gap: 24px; min-width: 0; align-content: start; }
.home-side { position: sticky; top: 88px; }
.home-grid .card-head h2 { font-size: var(--fs-title-3); }
.home-screen[data-tab="today"] :is(.plan-card, .tasks-card),
.home-screen[data-tab="plan"] :is(.upload-card, .recent-card, .tasks-card, .week-card, .next-adjust),
.home-screen[data-tab="records"] :is(.upload-card, .next-card, .recent-card, .membership-notice, .plan-card) { display: none; }
.home-grid.tab-in .card { animation: tab-in var(--dur-3) var(--ease-out) both; }
.home-grid.tab-in :is(.next-card, .tasks-card) { animation-delay: 40ms; }
.home-grid.tab-in :is(.recent-card, .week-card) { animation-delay: 80ms; }
@keyframes tab-in { from { opacity: 0; transform: translateY(8px); } }

/* Today: a light card — the steps Zepp holds, the uploads left, the automatic upload's range and the entry. */
.upload-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 28px 32px; background: radial-gradient(560px 280px at 100% 0%, var(--brand-tint), transparent 70%), var(--surface); box-shadow: var(--shadow); }
.today-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.today-label { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.today-label h2 { font-size: var(--fs-body); font-weight: 600; color: var(--text-2); letter-spacing: 0; white-space: nowrap; }
.today-date { font-size: var(--fs-small); font-weight: 400; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quota { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text-2); font-size: var(--fs-small); font-weight: 600; white-space: nowrap; transition: background-color var(--dur-3) var(--ease), border-color var(--dur-3) var(--ease), color var(--dur-3) var(--ease); }
.quota-label { color: var(--text-3); font-weight: 500; }
.quota b { color: var(--brand); font-size: var(--fs-body); font-weight: 700; }
.quota[data-tone="neutral"] b { color: var(--text-2); }
.quota[data-tone="warning"] { background: var(--warning-soft); border-color: var(--warning-border); color: var(--warning-ink); }
.quota[data-tone="warning"] b { color: var(--warning); }
.today-figure { display: flex; align-items: baseline; gap: 10px; }
.today-value { font-size: var(--fs-display); line-height: 1; font-weight: 700; letter-spacing: -.04em; color: var(--text); }
.today-value.is-bump { animation: bump .7s var(--ease-out); }
.today-value.is-zero { color: var(--placeholder); }
@keyframes bump { 0% { color: var(--brand); transform: translateY(3px); } 100% { color: var(--text); } }
.today-unit { font-size: var(--fs-title-2); font-weight: 600; color: var(--text-3); }
.today-sub { display: inline-flex; align-items: center; gap: 8px; margin-top: -8px; font-size: var(--fs-small); color: var(--text-3); transition: color var(--dur-3) var(--ease); }
.today-sub::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--control-off); }
.today-sub[data-tone="success"]::before { background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.today-sub[data-tone="pending"] { color: var(--pending); }
.today-sub[data-tone="pending"]::before { background: var(--pending); animation: breathe 1.6s ease-in-out infinite; }
/* Steps track: the automatic upload's range as a hatched band, today's steps as the fill. */
.rail { display: grid; gap: 6px; }
.rail-bar { position: relative; height: 10px; border-radius: var(--radius-pill); background: var(--surface-3); overflow: hidden; }
.rail-band { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(-45deg, rgb(19 127 92 / .24) 0 3px, rgb(19 127 92 / .1) 3px 6px); }
.rail-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: var(--radius-pill); background: linear-gradient(90deg, #4dbb8f, var(--brand)); transition: width 600ms var(--ease-out); }
.rail:not(.is-reached) .rail-fill { background: linear-gradient(90deg, #a3dbc0, #4dbb8f); }
.rail-labels { position: relative; height: 16px; }
.rail-label { position: absolute; top: 0; transform: translateX(-50%); font-size: var(--fs-caption); color: var(--text-3); white-space: nowrap; }
.upload-form { display: grid; }
.upload-form .field-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.upload-form .entry .input { height: 48px; padding: 0 20px; font-weight: 600; }
.upload-form .entry .input::placeholder { font-weight: 400; }
.upload-form .entry .btn { min-height: 48px; min-width: 112px; padding: 0 32px; }
.upload-form :is(.field-hint, .field-error) { padding-left: 20px; }
.upload-live { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 12px 14px; border-radius: var(--radius); background: var(--pending-soft); color: var(--pending-ink); font-size: var(--fs-label); font-weight: 600; animation: rise var(--dur-3) var(--ease-out); }
.upload-live .subtle { flex-basis: 100%; padding-left: 26px; font-weight: 400; }

/* Next automatic upload: the way as a tag, the time large, one bar per walking upload (the next one hollow). */
.next-card .card-head { gap: 10px; }
.next-card .card-body { padding-top: 14px; }
.next-upload { display: grid; gap: 6px; }
.next-upload-title { font-size: var(--fs-small); font-weight: 600; color: var(--pending); }
.next-upload-time { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.next-upload-clock { font-size: var(--fs-metric); line-height: 1.15; font-weight: 700; letter-spacing: -.03em; color: var(--text); }
.next-upload-steps { font-weight: 600; color: var(--text-2); }
.next-upload-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.next-upload-foot:not(:has(> :not([hidden]))) { display: none; }
.next-upload-count { font-size: var(--fs-small); color: var(--text-3); }
.next-dots { display: flex; gap: 6px; }
.next-dot { width: 22px; height: 6px; border-radius: 3px; background: var(--chart-track); transition: background-color var(--dur-3) var(--ease), box-shadow var(--dur-3) var(--ease); }
.next-dot[data-state="done"] { background: var(--chart-ok); }
.next-dot[data-state="current"] { background: var(--surface); box-shadow: inset 0 0 0 2px var(--brand); }
.next-adjust { justify-self: start; }
.next-idle { display: flex; align-items: center; gap: 12px; }
.next-idle-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.next-state { font-size: var(--fs-title-2); font-weight: 600; }
.next-note { font-size: var(--fs-small); color: var(--text-3); }

/* Plan (.range and .facts live in /shared/base.css) */
.range-part { display: grid; gap: 4px; }
.plan-card .segmented { display: flex; }
.plan-card .segment { flex: 1; }
.plan-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; border: 0; border-radius: 0; overflow: visible; }
.plan-facts > div { display: grid; gap: 2px; justify-content: stretch; align-items: start; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); }
.plan-facts > div + div { border-top: 0; }
.plan-facts > div:first-child { grid-column: 1 / -1; }
.plan-facts dt { font-size: var(--fs-small); }
.plan-facts dd { text-align: left; font-size: var(--fs-title-3); }
.rules-box { border-radius: var(--radius); background: var(--surface-2); color: var(--text-2); font-size: var(--fs-small); }
.rules-box > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 14px; font-weight: 600; cursor: pointer; list-style: none; border-radius: inherit; }
.rules-box > summary::-webkit-details-marker { display: none; }
.rules-box > summary::after { content: ""; width: 8px; height: 8px; border: solid var(--text-3); border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); transition: transform var(--dur-2) var(--ease); }
.rules-box[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.rules-box[open] .rules { animation: rise var(--dur-2) var(--ease-out); }
.rules { margin: 0; padding: 0 14px 12px 30px; display: grid; gap: 4px; }

/* Records */
.tasks-card .card-head .row { gap: 6px; }
.recent-card .card-head .btn-link { margin-right: -2px; }
.freshness { white-space: nowrap; }
.task-filters { display: flex; justify-self: start; }
.task-none { padding: 6px 0; }
.task-list { list-style: none; margin: 0; padding: 0; display: grid; }
.task-day + .task-day, .task + .task-day { border-top: 1px solid var(--border); }
.task-day-toggle { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 4px 0; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text-2); font: inherit; font-size: var(--fs-small); font-weight: 600; letter-spacing: .02em; text-align: left; cursor: pointer; }
.task-day-toggle:hover { color: var(--text); }
.task-day-sum { margin-left: auto; color: var(--text-3); font-weight: 400; letter-spacing: 0; }
.task-day-toggle svg { flex: none; color: var(--text-3); transition: transform var(--dur-2) var(--ease); }
.task-day-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.task { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; }
.task + .task { border-top: 1px solid var(--border); }
.task.row-in { animation: row-in var(--dur-3) var(--ease-out); }
.task-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: var(--radius); background: var(--surface-3); color: var(--text-2); transition: background-color var(--dur-3) var(--ease), color var(--dur-3) var(--ease); }
.task[data-tone="success"] .task-icon { background: var(--success-soft); color: var(--success); }
.task[data-tone="warning"] .task-icon { background: var(--warning-soft); color: var(--warning); }
.task[data-tone="danger"] .task-icon { background: var(--danger-soft); color: var(--danger); }
.task[data-tone="pending"] .task-icon { background: var(--pending-soft); color: var(--pending); }
.task-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.task-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.task-steps { font-weight: 700; font-size: var(--fs-title-3); }
.task-meta { font-size: var(--fs-small); color: var(--text-3); }
.task-note { font-size: var(--fs-small); color: var(--text-2); overflow-wrap: anywhere; }
.badge.is-live .badge-dot { animation: breathe 1.6s ease-in-out infinite; }
.task-skeleton { display: grid; gap: 10px; }
.task-skeleton .skeleton { height: 52px; }
/* The last days: one bar per day, today in brand green; a day without a verified upload stays a stub. */
.week-card .card-head { flex-wrap: wrap; gap: 4px 10px; }
.week-bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; }
.week-day { display: grid; gap: 6px; justify-items: center; min-width: 0; }
.week-value { font-size: var(--fs-caption); color: var(--text-3); white-space: nowrap; }
.week-day.is-today .week-value { color: var(--brand); font-weight: 700; }
.week-plot { display: flex; align-items: flex-end; justify-content: center; width: 100%; height: 120px; }
.week-plot i { display: block; width: 100%; max-width: 30px; min-height: 3px; border-radius: 8px 8px 4px 4px; background: var(--success-border); transition: height var(--dur-3) var(--ease-out); }
.week-day.is-today .week-plot i { background: var(--brand); }
.week-day.is-none .week-plot i { background: var(--chart-track); }
.week-label { font-size: var(--fs-caption); color: var(--text-3); }
.week-day.is-today .week-label { color: var(--text); font-weight: 600; }

/* The home tabs: a pill group in the middle of the top bar on wide screens, a bar at the bottom on phones. */
.tabbar { position: fixed; top: 12px; left: 50%; z-index: 35; transform: translateX(-50%); display: flex; gap: 2px; padding: 3px; border-radius: var(--radius-pill); background: var(--surface-3); }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border: 0; border-radius: var(--radius-pill); background: none; color: var(--text-2); font-size: var(--fs-label); font-weight: 600; white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: color var(--dur-2) var(--ease), background-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease); }
.tab:hover { color: var(--text); }
.tab-icon { display: grid; place-items: center; transition: transform var(--dur-1) var(--ease); }
.tab-icon .icon { width: 16px; height: 16px; }
.tab[aria-current="page"] { color: var(--text); background: var(--surface); box-shadow: 0 1px 2px rgb(15 26 21 / .12), 0 0 0 1px rgb(15 26 21 / .04); }
.tabbar > .slider-thumb { border-radius: var(--radius-pill); background: var(--surface); box-shadow: 0 1px 2px rgb(15 26 21 / .12), 0 0 0 1px rgb(15 26 21 / .04); }
.tabbar.slider-on .tab[aria-current="page"] { background: none; box-shadow: none; }
.tab:active .tab-icon { transform: scale(.9); }

/* Account sheet */
.sheet { width: min(420px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); margin: 72px max(16px, calc((100vw - 1120px) / 2 + 24px)) auto auto; padding: 0; border: 0; border-radius: var(--radius-xl); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); overflow: auto; }
.sheet::backdrop { background: rgb(12 20 16 / .32); animation: fade var(--dur-2) var(--ease); }
.sheet[open] { animation: sheet-in var(--dur-2) var(--ease-out); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
@keyframes fade { from { opacity: 0; } }
.sheet-grab { display: none; }
.sheet-body { display: grid; gap: 16px; padding: 20px; }
.sheet-head { display: flex; align-items: center; gap: 12px; }
.sheet-who { flex: 1; min-width: 0; display: grid; }
.sheet-title { font-size: var(--fs-small); font-weight: 600; color: var(--text-3); letter-spacing: 0; }
.sheet-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-close { align-self: flex-start; }
/* The invite row in the account panel */
.menu-value { flex: none !important; font-size: var(--fs-label); color: var(--text-3); }
.menu-item.invite-entry { padding: 13px 14px; border-radius: var(--radius); background: var(--surface-2); }
.menu-item.invite-entry > .icon:first-child { color: var(--brand); }
.menu-item.invite-entry:hover { background: var(--surface-3); }
/* Membership in the account panel and the subscribe sheet (055) */
.member-section { display: grid; gap: 10px; padding: 14px; border-radius: var(--radius); background: var(--surface-2); }
.member-section-head { display: flex; align-items: center; gap: 8px; }
.member-section-title { font-weight: 600; }
.member-section .facts { background: var(--surface); }
.input-readonly { color: var(--text-3); background: var(--surface-3); pointer-events: none; }
/* 058: the days left large, and the invite card under it */
.member-days { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 6px; }
.member-days-label { font-size: var(--fs-label); color: var(--text-3); }
.member-days-num { font-size: var(--fs-metric); font-weight: 700; line-height: 1.1; letter-spacing: -.02em; color: var(--brand); }
.member-days.is-out .member-days-num { color: var(--text-3); }
.member-days-unit { font-weight: 600; }
.member-days-until { flex-basis: 100%; font-size: var(--fs-label); color: var(--text-2); }
.invite-reward { color: var(--text-2); }
.invite-link { padding: 10px 14px; border-radius: var(--radius); background: var(--surface-2); color: var(--text-2); font-size: var(--fs-label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.invite-hint { margin-top: -6px; }
.invite-friends { display: grid; gap: 6px; padding: 0; margin: 0; list-style: none; }
.invite-friends:empty { display: none; }
.invite-friends li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--fs-label); }
.invite-email { min-width: 0; overflow-wrap: anywhere; }
.subscribe-sheet { width: min(760px, calc(100vw - 32px)); margin: auto; }
/* What the account panel opens: invites, password, email, feedback (the subscribe sheet is the wide one) */
.sheet-center { width: min(480px, calc(100vw - 32px)); margin: auto; }
.subscribe-title { font-size: var(--fs-title-2); font-weight: 700; }
.subscribe-status { font-size: var(--fs-small); color: var(--text-3); }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.plan-offer { display: flex; flex-direction: column; gap: 10px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.plan-offer.is-featured { border-color: var(--brand); box-shadow: var(--ring); }
.offer-tag { padding: 2px 8px; border-radius: var(--radius-pill); background: var(--brand-soft); color: var(--brand-ink); font-size: var(--fs-caption); font-weight: 700; }
.plan-offer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-offer-head h3 { font-size: var(--fs-title-3); font-weight: 700; }
.plan-offer-price { display: flex; align-items: baseline; gap: 2px; color: var(--text); }
.plan-offer-yuan { font-size: var(--fs-title-3); font-weight: 600; }
.plan-offer-amount { font-size: var(--fs-metric); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.plan-offer-period { margin-left: 2px; font-size: var(--fs-label); color: var(--text-3); }
.plan-periods { justify-self: center; }
.plan-periods .segment { display: inline-flex; align-items: center; gap: 4px; }
.segment-tag { padding: 0 5px; border-radius: 999px; font-size: var(--fs-caption); font-weight: 600; line-height: 16px; color: var(--brand-ink); background: var(--brand-soft); }
.plan-offer-was { margin-left: 8px; font-size: var(--fs-label); color: var(--text-3); }
.plan-offer-daily { font-size: var(--fs-label); font-weight: 600; color: var(--brand); }
.plan-offer-features { display: grid; align-content: start; gap: 7px; flex: 1; padding: 0; margin: 2px 0 4px; list-style: none; font-size: var(--fs-label); color: var(--text-2); }
.plan-offer-features li { display: flex; align-items: flex-start; gap: 7px; }
.plan-offer-features .icon { flex: none; margin-top: 2px; color: var(--brand); }
.plan-offer-buy { width: 100%; }
.conn-list { list-style: none; margin: 0; padding: 4px 14px; border-radius: var(--radius); background: var(--surface-2); }
.conn { display: flex; align-items: center; gap: 10px; padding: 10px 0; font-size: var(--fs-label); }
.conn + .conn { border-top: 1px solid var(--border); }
.conn-icon { color: var(--text-3); display: grid; }
.conn[data-ok="true"] .conn-icon { color: var(--brand); }
.conn-label { color: var(--text-2); }
.conn-value { margin-left: auto; text-align: right; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.menu { display: grid; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); font-size: var(--fs-body); text-align: left; cursor: pointer; transition: background-color var(--dur-1), transform var(--dur-1); }
.menu-item:hover { background: var(--surface-2); }
.menu-item:active { background: var(--surface-3); transform: scale(.99); }
.menu-item > .icon:first-child { color: var(--text-3); }
.menu-item > span { flex: 1; }
.menu-chevron { color: var(--text-3); }
.menu-item.is-danger, .menu-item.is-danger > .icon:first-child { color: var(--danger); }

/* Tablet: one column, every card */
@media (max-width: 960px) {
  .auth-screen { grid-template-columns: minmax(0, 1fr) 380px; column-gap: 36px; }
  .home-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .home-main, .home-side { display: contents; }
  .upload-card, .plan-card { order: 1; } .next-card { order: 2; } .recent-card { order: 3; } .week-card { order: 4; } .tasks-card { order: 5; }
  .home-screen[data-tab="today"] .week-card { display: none; }
  .account-name { display: none; }
}

/* Phone: the home shows one tab at a time above a fixed tab bar */
@media (max-width: 720px) {
  .main { padding: 16px 16px 40px; }
  .topbar-inner, .announcement-inner, .page-notices { padding-left: 16px; padding-right: 16px; }
  .topbar-inner { height: 56px; }
  .account-button { padding-right: 8px; }
  /* Package cards on a phone: name and price, then features and the daily price, then the button */
  .plan-offer { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "head price" "features daily" "buy buy"; gap: 4px 12px; padding: 14px 16px; }
  .plan-offer-head { grid-area: head; justify-content: flex-start; }
  .plan-offer-price { grid-area: price; justify-self: end; }
  .plan-offer-amount { font-size: var(--fs-title-1, 24px); }
  .plan-offer-daily { grid-area: daily; justify-self: end; align-self: start; font-size: var(--fs-small); }
  .plan-offer-features { grid-area: features; gap: 2px; margin: 0; font-size: var(--fs-small); }
  .plan-offer-features .icon { display: none; }
  .plan-offer-buy { grid-area: buy; margin-top: 8px; }
  .announcement-inner { flex-wrap: wrap; gap: 4px 12px; padding-top: 6px; padding-bottom: 8px; }
  .announcement-extra { margin-left: 28px; }

  .auth-screen { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "card" "features"; row-gap: 22px; padding-top: 8px; }
  .auth-intro { gap: 10px; }
  .auth-title { font-size: var(--fs-metric); }
  .auth-lead { font-size: var(--fs-body); }
  .auth-card { padding: 20px 18px; }
  .features { gap: 14px; padding: 4px 2px; }

  .page-head { margin-bottom: 16px; }
  .page-head h1 { font-size: var(--fs-title-1); }
  .step { padding: 16px; }
  .step-body { margin-left: 0; margin-top: 16px; }
  .qr-panel { flex-direction: column; align-items: stretch; }
  .qr-frame { justify-self: center; align-self: center; }
  .qr-code { width: 208px; height: 208px; }

  .home-screen { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .home-grid { gap: 12px; }
  .tabbar { top: auto; bottom: 0; left: 0; right: 0; transform: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-radius: 0; background: rgb(255 255 255 / .92); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); border-top: 1px solid var(--border); transition: transform var(--dur-2) var(--ease), visibility var(--dur-2); }
  .tab { display: grid; justify-items: center; gap: 3px; padding: 6px 0; border-radius: 0; color: var(--text-3); font-size: var(--fs-caption); }
  .tab-icon .icon { width: 22px; height: 22px; }
  .tab[aria-current="page"], .tabbar.slider-on .tab[aria-current="page"] { color: var(--brand); background: none; box-shadow: none; }
  /* The current tab's mark: a short brand line along the top edge that slides between tabs. */
  .tabbar > .slider-thumb { top: -1px; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); box-shadow: none; transform: translateX(calc(var(--thumb-x, 0px) + var(--thumb-w, 0px) / 2 - 14px)); }
  /* The keyboard needs the room; the bar comes back when typing ends. */
  body:has(:is(input, select, textarea):focus) .tabbar { transform: translateY(100%); visibility: hidden; }
  body:has(.home-screen) .toast { bottom: calc(78px + env(safe-area-inset-bottom)); }

  .upload-card { gap: 14px; padding: 20px 18px 18px; background: radial-gradient(300px 200px at 100% 0%, var(--brand-tint), transparent 70%), var(--surface); }
  .quota-label { display: none; }
  .today-value { font-size: clamp(44px, 14vw, 56px); }
  .today-sub { margin-top: -6px; font-size: var(--fs-caption); }
  .upload-form .entry .input { height: 46px; padding: 0 16px; }
  .upload-form .entry .btn { min-height: 46px; min-width: 0; padding: 0 22px; }
  .upload-form :is(.field-hint, .field-error) { padding-left: 16px; }
  .next-upload-clock { font-size: var(--fs-title-1); }
  .next-dot { width: 16px; height: 5px; }
  .week-bars { gap: 6px; }
  .week-plot { height: 92px; }
  .week-plot i { max-width: 26px; border-radius: 7px 7px 3px 3px; }

  .sheet { width: 100vw; max-width: 100vw; max-height: 88dvh; margin: auto 0 0; border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding-bottom: env(safe-area-inset-bottom); transition: transform var(--dur-2) var(--ease-out); }
  .sheet.is-dragging { transition: none; }
  .sheet[open] { animation: sheet-up var(--dur-3) var(--ease-out); }
  @keyframes sheet-up { from { transform: translateY(100%); } }
  .sheet-grab { display: grid; place-items: center; height: 26px; padding-top: 6px; touch-action: none; cursor: grab; }
  .sheet-handle { width: 40px; height: 5px; border-radius: 999px; background: var(--border-strong); }
  .sheet-body { padding: 6px 16px 22px; }
}

/* Feedback */
.unread-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.menu-item > .unread-dot { flex: none; }
.unread-dot[hidden] { display: none; }
.feedback-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.feedback-list:empty { display: none; }
.feedback-item { padding-top: 12px; border-top: 1px solid var(--border); }
.feedback-item p { margin: 0 0 4px; overflow-wrap: anywhere; white-space: pre-wrap; }
.feedback-composer { margin-top: 8px; }
.auth-contact { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.auth-contact[hidden] { display: none; }

/* The day strip on the automatic upload card: 72 slots of 20 minutes, Beijing time. */
.day-strip { display: grid; gap: 4px; margin-top: 6px; }
.day-svg { width: 100%; height: 30px; overflow: visible; }
.day-slot { fill: var(--chart-track); }
.day-slot.is-on { fill: var(--chart-window); }
.day-slot.is-done { fill: var(--chart-ok); }
.day-slot.is-next { fill: var(--surface); stroke: var(--brand); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.day-slot.is-maintenance { fill: var(--border-strong); opacity: .5; }
.day-now { stroke: var(--text); stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.day-axis { display: flex; justify-content: space-between; font-size: var(--fs-caption); color: var(--text-3); }
/* A step's body comes in when it becomes the current one. */
.step-body:not([hidden]) { animation: rise var(--dur-3) var(--ease-out); }
