/* Quiet weekly record strip and calendar-first statistics. */
.phone.records-surface { height: var(--preview-height); background: var(--paper); }
.records-surface .page-scroll > .records-page { padding: var(--space-4) var(--page-gutter) var(--space-7); }
.records-page h1 { font: var(--weight-semibold) var(--text-3xl)/var(--leading-3xl) var(--font-body); letter-spacing: 0; }
.records-sr-only { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.records-scale { display: grid; grid-template-columns: repeat(3, 1fr); padding: 4px; border-radius: 999px; background: #f0ece5; }
.records-scale button { min-height: var(--control-height); padding: 6px 12px; border-radius: 999px; color: var(--muted); font: var(--weight-semibold) var(--text-sm)/var(--leading-sm) var(--font-body); }
.records-scale button[aria-pressed="true"] { color: var(--ink); background: var(--surface); }
.records-scale button:hover { color: var(--accent-strong); }
.records-period { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; margin: 10px -8px 8px; }
.records-period button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; color: var(--muted); }
.records-period button:hover { background: #f5f0e8; color: var(--accent-strong); }
.records-period .icon { width: 18px; height: 18px; }
.records-period p { font: var(--weight-medium) var(--text-sm)/var(--leading-sm) var(--font-body); text-align: center; text-wrap: balance; }
.records-month-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin-bottom: 8px; }
.records-month-heading > p { font: var(--weight-semibold) var(--text-md)/var(--leading-md) var(--font-body); }
.records-month-heading > div { display: flex; gap: 4px; }
.records-month-heading button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; color: var(--muted); }
.records-month-heading .icon { width: 18px; height: 18px; }
.records-month-heading button:hover { background: #f5f0e8; }
.records-calendar { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.records-days, .records-week-labels { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.records-day { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; min-width: 0; min-height: 80px; padding: 8px 0 20px; border: 1px solid transparent; border-radius: 14px; color: var(--muted); font: var(--weight-regular) var(--text-xs)/var(--leading-xs) var(--font-body); font-variant-numeric: tabular-nums; }
.records-day-week { font-size: var(--text-caption); line-height: 18px; }
.records-day-value { display: grid; place-items: center; min-height: 20px; }
.records-day-value .icon { width: 16px; height: 16px; stroke-width: 2; }
.records-day.has-record { color: var(--ink); }
.records-day[aria-pressed="true"] { border-color: #c7b4a5; color: var(--ink); background: var(--surface); font-weight: var(--weight-semibold); }
.records-day:hover { background: #f5f0e8; }
.records-day.is-today { position: relative; border-color: var(--accent); background: var(--surface); color: var(--ink); }
.records-day.is-today .records-day-value { font-size: var(--text-md); font-weight: var(--weight-semibold); }
.records-day.is-today::after { content: ''; position: absolute; bottom: 9px; left: 50%; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); transform: translateX(-50%); }
.records-week-labels { margin-bottom: 8px; color: var(--muted); font: var(--weight-regular) var(--text-xs)/var(--leading-xs) var(--font-body); text-align: center; }
.records-week-labels > span { padding-bottom: 3px; }
.records-recent { margin-top: 20px; }
.records-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; margin-bottom: 14px; }
.records-list-heading > h2 { font: var(--weight-semibold) var(--text-lg)/var(--leading-lg) var(--font-body); }
.records-list-heading button { min-height: 44px; margin-block: -6px; padding: 4px 0; color: var(--accent-strong); font: var(--weight-medium) var(--text-xs)/var(--leading-xs) var(--font-body); }
.records-date-group + .records-date-group { margin-top: 24px; }
.records-date-group > h3 { margin: 0 0 var(--space-2); color: var(--muted); font: var(--weight-regular) var(--text-xs)/var(--leading-meta) var(--font-body); }
.records-card { display: block; padding: var(--space-4); border-radius: var(--card-radius); background: var(--card-bg); }
.records-card + .records-card { margin-top: var(--space-3); }
.records-card-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.records-card-heading h4 { margin: 0; font: var(--weight-semibold) var(--text-md)/var(--leading-md) var(--font-body); text-wrap: pretty; }
.records-card-heading > .icon { width: 16px; height: 16px; flex-shrink: 0; color: var(--muted); }
.records-methods { margin-top: var(--space-2); color: var(--muted); font: var(--weight-regular) var(--text-xs)/var(--leading-meta) var(--font-body); }
.records-card-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-1) var(--space-3); margin-top: var(--space-3); color: var(--muted); font: var(--weight-regular) var(--text-xs)/var(--leading-meta) var(--font-body); }
.records-card:hover { background: #fff7ee; }
.records-empty { padding: 30px 8px; text-align: center; }
.records-empty > .icon { width: 36px; height: 36px; margin: 0 auto 18px; color: #b98363; }
.records-empty h3 { font: var(--weight-medium) var(--text-lg)/var(--leading-lg) var(--font-body); }
.records-empty p { margin-top: 10px; color: var(--muted); font: var(--weight-regular) var(--text-sm)/var(--leading-md) var(--font-body); }
.records-empty .text-link { width: 100%; margin-top: 12px; font: var(--weight-medium) var(--text-sm)/var(--leading-sm) var(--font-body); }
.records-detail-heading { padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.records-detail-date { margin-top: var(--space-3); color: var(--muted); font-size: var(--text-xs); line-height: var(--leading-meta); }
.records-detail-meta { display: flex; align-items: flex-start; gap: var(--space-2); margin-top: var(--space-3); color: var(--muted); font-size: var(--text-xs); line-height: var(--leading-meta); }
.records-detail-meta > .icon { flex-shrink: 0; width: 16px; height: 16px; margin-top: 1px; }
.records-detail-section { margin-top: 24px; }
.records-detail-section > h2, .records-detail-section-heading h2 { font: var(--weight-semibold) var(--text-lg)/var(--leading-lg) var(--font-body); }
.records-detail-section > h2 { margin-bottom: 14px; }
.records-detail-section-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 14px; }
.records-detail-section-heading > p { color: var(--muted); font-size: var(--text-xs); line-height: var(--leading-xs); }
.records-steps { list-style: none; padding: 0; margin: 0; overflow: hidden; border-radius: var(--card-radius); background: var(--card-bg); }
.records-steps li { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 16px; }
.records-steps li + li { border-top: 1px solid var(--line-subtle); }
.records-step-copy { min-width: 0; }
.records-step-copy h3 { font-size: var(--text-md); line-height: var(--leading-md); font-weight: var(--weight-semibold); }
.records-steps p { margin-top: var(--space-2); color: var(--muted); font-size: var(--text-sm); line-height: var(--leading-sm); font-weight: var(--weight-regular); }
.records-step-status { flex-shrink: 0; display: flex; padding-top: 4px; color: var(--accent); }
.records-step-status > .icon { width: 16px; height: 16px; }
.records-ending { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 96px; padding: 16px; border-radius: var(--card-radius); background: var(--accent-light); }
.records-ending > div { min-width: 0; }
.records-ending p { color: var(--muted); font-size: var(--text-xs); line-height: var(--leading-xs); }
.records-ending strong { display: block; margin-top: 4px; font-size: var(--text-lg); line-height: var(--leading-lg); font-weight: var(--weight-medium); }
.records-ending > .icon { flex-shrink: 0; width: 20px; height: 20px; color: var(--muted); }
.record-fold-plane { margin-top: 24px; }
.records-detail > .outbox-withdraw { margin-top: var(--space-6); }
.records-detail-section > .field-hint { margin-top: var(--space-2); color: var(--muted); font-size: var(--text-sm); line-height: var(--leading-sm); text-align: left; }
.record-fold-plane-card { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 96px; padding: 16px; border-radius: var(--card-radius); background: var(--surface); text-align: left; }
.record-fold-plane-card > .icon:first-child { flex-shrink: 0; align-self: flex-start; width: 22px; height: 22px; margin-top: 2px; color: var(--accent); }
.record-fold-plane-copy { flex: 1; min-width: 0; }
.record-fold-plane-copy strong { display: block; color: var(--accent-strong); font-size: var(--text-md); line-height: var(--leading-md); font-weight: var(--weight-medium); }
.record-fold-plane-copy > span { display: block; margin-top: 6px; color: var(--muted); font-size: var(--text-xs); line-height: var(--leading-xs); }
.record-fold-plane-card:hover { background: var(--surface); box-shadow: var(--shadow-card); }
.records-surface .home-indicator { height: 12px; background: var(--surface); }
.records-surface[data-screen="record"] .home-indicator,
.records-surface[data-screen="recordsStats"] .home-indicator { background: var(--paper); }

.records-statistics { --stats-chart-fill: linear-gradient(180deg, var(--accent) 0%, #ffba79 100%); }
.records-statistics .records-period { margin-bottom: 20px; }
.stats-section + .stats-section { margin-top: 28px; }
.stats-section > h1, .stats-section > h2 { margin: 0 0 12px; font: var(--weight-semibold) var(--text-lg)/var(--leading-lg) var(--font-body); }
.stats-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px var(--space-6); margin: 0; padding: var(--space-5); border-radius: var(--card-radius); background: var(--stats-card-bg); }
.stats-metrics > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.stats-metrics dt { color: var(--muted); font: var(--weight-regular) var(--text-xs)/var(--leading-xs) var(--font-body); }
.stats-metrics dd { order: -1; margin: 0; font: var(--weight-semibold) var(--text-page)/var(--leading-page) var(--font-body); font-variant-numeric: tabular-nums; }
.stats-metrics dd > span { margin-left: 4px; font-size: var(--text-sm); line-height: var(--leading-sm); font-weight: var(--weight-regular); }
.stats-panel { margin: 0; padding: var(--space-4); border-radius: var(--card-radius); background: var(--stats-card-bg); }
.stats-activity-scroll { overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; scrollbar-color: #d6b39c #f5f0e8; }
.stats-heatmap { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.stats-heat-cell { display: block; justify-self: center; width: 100%; max-width: 30px; aspect-ratio: 1; border-radius: 5px; background: #f1ece4; }
.stats-heat-cell.has-record { background: var(--accent); }
.stats-heat-cell.is-outside { visibility: hidden; }
.stats-activity.is-month .records-week-labels { column-gap: 8px; }
.stats-month-day { display: grid; justify-items: center; align-content: start; gap: var(--space-1); min-width: 0; }
.stats-month-date { color: var(--muted); font: var(--weight-regular) var(--text-xs)/var(--leading-meta) var(--font-body); font-variant-numeric: tabular-nums; }
.stats-month-day.is-outside { visibility: hidden; }
.stats-year-chart { position: relative; margin: 0; padding-top: 2px; font-variant-numeric: tabular-nums; }
.stats-year-unit { margin-bottom: 8px; text-align: right; color: var(--muted); font: var(--weight-regular) var(--text-xs)/var(--leading-xs) var(--font-body); }
.stats-year-plot { position: relative; height: 188px; padding-right: 26px; }
.stats-year-grid { position: absolute; inset: 0 26px 0 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.stats-year-grid i { border-top: 1px dashed #e8e1d8; }
.stats-year-bars { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 5px; height: 100%; }
.stats-year-slot { display: flex; justify-content: center; align-items: flex-end; min-width: 0; height: 100%; }
.stats-year-bar { display: block; width: 100%; max-width: 18px; border-radius: 7px; background: var(--stats-chart-fill); }
.stats-year-axis { position: absolute; inset: 0 0 0 auto; display: flex; flex-direction: column; justify-content: space-between; width: 20px; color: var(--muted); font: var(--weight-regular) var(--text-xs)/16px var(--font-body); text-align: right; }
.stats-year-axis span:first-child { transform: translateY(-50%); }
.stats-year-axis span:last-child { transform: translateY(50%); }
.stats-year-months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)) 21px; gap: 5px; margin-top: 12px; color: var(--muted); font: var(--weight-regular) var(--text-xs)/var(--leading-xs) var(--font-body); text-align: center; }
.stats-year-months small { font: inherit; text-align: right; }
.stats-year-empty { position: absolute; inset: 30px 26px 32px 0; display: grid; place-items: center; color: var(--muted); font: var(--weight-regular) var(--text-xs)/var(--leading-xs) var(--font-body); }
.stats-activity.stats-panel { padding: 0; background: transparent; border-radius: 0; }
.stats-spaces { margin: 0; padding: 2px 0; list-style: none; }
.stats-spaces li { display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px; align-items: center; gap: 18px; min-height: var(--button-height); font: var(--weight-medium) var(--text-sm)/var(--leading-sm) var(--font-body); }
.stats-space-track { height: 6px; border-radius: 999px; background: #f1ece4; overflow: hidden; }
.stats-space-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(to right, #ffba79 0%, var(--accent) 100%); }
.stats-space-count { text-align: right; font-variant-numeric: tabular-nums; }
.stats-space-count small { margin-left: 4px; color: var(--muted); font-size: var(--text-xs); }
.stats-spaces-empty { padding: 16px 0; color: var(--muted); font: var(--weight-regular) var(--text-sm)/var(--leading-md) var(--font-body); }
@media (max-width: 760px) {
  .phone.records-surface { height: 100dvh; min-height: 0; max-width: 430px; padding-top: var(--safe-top); }
  .records-surface .topbar { height: var(--header-mobile-height); }
  .records-surface .home-indicator { height: var(--safe-bottom); }
  .records-surface .home-indicator::after { display: none; }
}
@media (max-width: 360px) {
  .records-surface .page-scroll > .records-page { padding-left: var(--page-gutter); padding-right: var(--page-gutter); }
  .records-calendar { margin-inline: -14px; }
  .records-card { padding: 14px; }
  .records-period p { font-size: var(--text-xs); line-height: var(--leading-xs); }
}
@media (max-width: 760px) and (max-height: 700px) {
  .records-surface .page-scroll > .records-home { padding-top: var(--space-2); }
  .records-day { min-height: 80px; }
  .records-recent { margin-top: 16px; }
  .records-list-heading { margin-bottom: 12px; }
  .records-date-group > h3 { margin-bottom: 8px; }
}
