/* Personal reporting: all numbers and charts are backed by recorded data. */
.helpmeal-app main:has(.progress-dashboard) > .hero { display: none; }
main:has(.progress-dashboard) .app-card { overflow: visible; border: 0; background: transparent; box-shadow: none; }
main:has(.progress-dashboard) .app-head { margin-bottom: 24px; padding: 20px 24px; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; }
.app-body:has(.progress-dashboard) { padding: 0; }
.progress-dashboard { --pd-muted: #bdd4ca; --pd-grid: #dce5df; font-variant-numeric: tabular-nums; }
.progress-dashboard *, .pd-history *, .pd-entry * { min-width: 0; }
.pd-hero { padding: 30px 36px 34px; color: var(--paper); background: var(--ink); border-radius: 24px; }
.pd-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.pd-hero .pd-overline { display: block; margin: 0 0 10px; color: var(--pd-muted); font-size: .875rem; font-weight: 500; line-height: 1.5; }
.pd-hero h3 { margin: 0; color: var(--paper); font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.25; letter-spacing: -.035em; }
.pd-hero .pd-add { flex-shrink: 0; color: var(--ink); background: var(--mint); font-size: .875rem; box-shadow: none; }
.pd-hero .pd-add:hover { background: #eff7ef; }
.pd-hero button:focus-visible { outline-color: var(--mint); }
.pd-add span { flex-shrink: 0; font-size: 1.25rem; line-height: 1; }
.pd-hero-main { display: grid; grid-template-columns: minmax(0,1fr) minmax(0, .9fr); gap: 32px; align-items: center; margin-top: 34px; }
.pd-weight { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; font-size: clamp(2.75rem, 6vw, 4.75rem); line-height: 1.1; font-weight: 650; letter-spacing: -.055em; }
.pd-weight > span { color: var(--pd-muted); font-size: 1.25rem; font-weight: 400; letter-spacing: 0; }
.pd-hero .pd-last-date { margin: 12px 0 0; color: var(--pd-muted); font-size: .875rem; line-height: 1.6; }
.pd-goal { display: flex; justify-content: flex-end; align-items: center; gap: 24px; }
.pd-ring { position: relative; flex: 0 0 124px; width: 124px; height: 124px; color: var(--mint-strong); }
.pd-ring svg { display: block; width: 100%; height: 100%; }
.pd-ring > span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 1px; color: var(--paper); font-size: 2rem; font-weight: 600; letter-spacing: -.045em; }
.pd-ring small { font-size: .875rem; letter-spacing: 0; }
.pd-goal > div:last-child { max-width: 210px; }
.pd-goal strong { display: block; font-size: 2rem; line-height: 1.2; font-weight: 600; }
.pd-goal strong small { font-size: 1rem; font-weight: 400; }
.pd-hero .pd-goal p, .pd-hero .pd-reference p { margin: 8px 0 0; color: var(--pd-muted); font-size: .875rem; line-height: 1.6; }
.pd-reference { padding-left: 32px; border-left: 1px solid #58766a; }
.pd-reference strong { display: block; color: var(--paper); font-size: 1.5rem; line-height: 1.4; }
.pd-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 28px; padding: 26px 12px 30px; }
.pd-metrics > div { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; padding-left: 20px; border-left: 2px solid var(--line); }
.pd-metrics > div:first-child { border-color: var(--green); }
.pd-metrics span, .pd-metrics > div > small { color: var(--ink-soft); font-size: .875rem; line-height: 1.6; }
.pd-metrics strong { color: var(--ink); font-size: 1.875rem; line-height: 1.3; font-weight: 650; letter-spacing: -.035em; }
.pd-metrics strong small { font-size: .875rem; letter-spacing: 0; font-weight: 400; }
.pd-main-grid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 24px; align-items: start; }
.pd-chart-card, .pd-mood-card, .pd-weeks { padding: 26px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); }
.pd-chart-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pd-kicker { display: block; margin: 0 0 5px; color: var(--ink-soft); font-size: .875rem; font-weight: 500; line-height: 1.5; }
.pd-chart-card h4, .pd-mood-card h4, .pd-weeks h4 { margin: 0; font-size: 1.375rem; line-height: 1.35; font-weight: 650; letter-spacing: -.025em; }
.pd-periods { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 3px; padding: 4px; background: #eaf0e9; border-radius: 11px; }
.pd-periods button { min-height: 44px; padding: 8px 10px; border: 0; border-radius: 8px; color: var(--ink-soft); background: transparent; font: inherit; font-size: .875rem; line-height: 1.5; font-weight: 500; white-space: nowrap; }
.pd-periods button[aria-pressed="true"] { background: var(--ink); color: white; }
.pd-periods button:hover:not([aria-pressed="true"]) { color: var(--ink); background: #d9e5da; }
.pd-chart-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 24px 0 18px; }
.pd-chart-meta > span { color: var(--ink-soft); font-size: .875rem; }
.pd-selection { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; color: var(--green-dark); font-size: .875rem; }
.pd-selection strong { font-size: 1.375rem; line-height: 1.4; font-weight: 650; letter-spacing: -.02em; }
.pd-selection strong small { font-size: .875rem; font-weight: 400; }
.pd-chart-frame { display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 12px; }
.pd-y-axis { position: relative; height: 260px; color: var(--ink-soft); font-size: .875rem; line-height: 1.4; }
.pd-y-axis span { position: absolute; right: 0; transform: translateY(-50%); }
.pd-y-axis span:nth-child(1) { top: 10%; }.pd-y-axis span:nth-child(2) { top: 50%; }.pd-y-axis span:nth-child(3) { top: 90%; }
.pd-plot { position: relative; height: 260px; cursor: crosshair; touch-action: pan-y; }
.pd-plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.pd-grid-line { fill: none; stroke: var(--pd-grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
.pd-chart-line { fill: none; stroke: var(--green); stroke-width: 2.75; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.pd-target-line { fill: none; stroke: #697f73; stroke-width: 1.5; stroke-dasharray: 5 5; vector-effect: non-scaling-stroke; }
.pd-crosshair { position: absolute; top: 0; bottom: 0; border-left: 1px solid #7b8f86; pointer-events: none; }
.pd-selected-dot { position: absolute; width: 14px; height: 14px; transform: translate(-50%,-50%); border: 3px solid var(--paper); border-radius: 50%; background: var(--green); box-shadow: 0 0 0 2px var(--green); pointer-events: none; }
.pd-x-axis { display: flex; justify-content: space-between; gap: 16px; margin: 8px 0 0 54px; color: var(--ink-soft); font-size: .875rem; line-height: 1.5; }
.pd-explorer { margin: 24px 0 0 54px; }
.pd-explorer > div { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.pd-explorer label { color: var(--ink); font-size: .875rem; font-weight: 600; }
.pd-explorer span, .pd-explorer > small { color: var(--ink-soft); font-size: .875rem; line-height: 1.6; }
.pd-slider { display: block; width: 100%; min-height: 44px; margin: 4px 0; padding: 8px 0; accent-color: var(--green); cursor: pointer; }
.pd-chart-foot { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 24px; color: var(--ink-soft); font-size: .875rem; }
.pd-chart-foot > span { display: inline-flex; align-items: center; gap: 8px; }
.pd-key { display: inline-block; width: 18px; border-top: 3px solid var(--green); }
.pd-key-target { border-top: 2px dashed #697f73; }
.pd-method { margin-top: 20px; padding-top: 8px; border-top: 1px solid var(--line); }
.pd-method summary { min-height: 44px; padding-block: 10px; color: var(--green-dark); font-size: .875rem; font-weight: 500; cursor: pointer; }
.pd-method p { margin: 10px 0 0; font-size: .875rem; color: var(--ink-soft); line-height: 1.65; }
.pd-mood-card { background: #eaf1e8; }
.pd-mood-latest { display: flex; align-items: center; flex-direction: column; gap: 8px; padding: 26px 0; text-align: center; }
.pd-mood-face { display: grid; place-items: center; width: 74px; height: 74px; margin-bottom: 8px; border-radius: 50%; background: var(--mood-color); font-size: 40px; }
.pd-mood-latest strong { font-size: 1.5rem; line-height: 1.3; font-weight: 650; }
.pd-mood-latest > span:not(.pd-mood-face), .pd-mood-latest time { color: var(--ink-soft); font-size: .875rem; line-height: 1.6; }
.pd-mood-card > .btn { width: 100%; font-size: .875rem; }
.pd-mood-empty { padding: 20px 0; }
.pd-mood-empty p { font-size: 1rem; color: var(--ink-soft); line-height: 1.65; }
.pd-context { margin-top: 26px; padding-top: 22px; border-top: 1px solid #c8d6c9; }
.pd-context strong { display: block; margin-bottom: 10px; color: var(--ink); font-size: 1rem; font-weight: 600; }
.pd-context p { margin: 6px 0 0; font-size: .875rem; line-height: 1.6; color: var(--ink-soft); }
.pd-weeks { margin-top: 24px; }
.pd-section-head { display: flex; align-items: flex-end; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.pd-section-head > span { color: var(--ink-soft); font-size: .875rem; }
.pd-week-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,110px),1fr)); gap: 12px; padding: 0; margin: 24px 0; list-style: none; }
.pd-week-grid li { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 18px 8px; border: 1px solid var(--line); border-radius: 14px; background: #fff; text-align: center; }
.pd-week-grid li.is-empty { border-style: dashed; background: transparent; }
.pd-week-face { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 3px; border-radius: 50%; background: var(--mood-color,#e7ece5); color: var(--ink-soft); font-size: 25px; }
.pd-week-grid strong { font-size: .875rem; font-weight: 600; }
.pd-week-grid li > span:not(.pd-week-face), .pd-week-grid small { color: var(--ink-soft); font-size: .875rem; line-height: 1.5; }
.pd-mood-legend { display: flex; flex-wrap: wrap; gap: 12px 20px; }
.pd-mood-legend > span { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: .875rem; }
.pd-mood-legend i { width: 10px; height: 10px; border-radius: 50%; }
.pd-mood-note { margin: 18px 0 0; color: var(--ink-soft); font-size: .875rem; line-height: 1.7; }
.pd-history { margin-top: 24px; padding: 14px 26px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.pd-history summary { min-height: 48px; padding-block: 12px; color: var(--ink); font-size: 1rem; font-weight: 600; cursor: pointer; }
.pd-history summary span { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 6px; background: var(--mint); color: var(--green-dark); font-size: .875rem; }
.pd-history p { max-width: 70ch; color: var(--ink-soft); font-size: .875rem; line-height: 1.6; }
.pd-history .table-scroll { max-height: 440px; }
.pd-history table { margin-bottom: 0; font-variant-numeric: tabular-nums; }
.pd-history th { position: sticky; top: 0; background: var(--paper); }
.pd-history td { vertical-align: middle; }
.pd-entry { margin-top: 24px; padding: 26px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); }
.pd-entry h4 { margin: 0 0 22px; font-size: 1.375rem; font-weight: 650; line-height: 1.4; }
.pd-entry > p { font-size: .875rem; color: var(--ink-soft); line-height: 1.65; }
.pd-entry .mood-picker { grid-template-columns: repeat(auto-fit,minmax(min(100%,7.5rem),1fr)); margin-top: 24px; }
.pd-entry .workflow-message { color: var(--green-dark); }
.pd-entry .workflow-message.is-error { color: var(--coral); }
.pd-entry .workflow-message:empty { display: none; }
.pd-empty-chart { display: flex; align-items: flex-start; justify-content: center; flex-direction: column; min-height: 330px; max-width: 52ch; padding: 30px 8px; }
.pd-empty-mark { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 20px; border: 1px solid var(--control-border); border-radius: 50%; color: var(--green); font-size: 1.5rem; }
.pd-empty-chart h5 { margin: 0 0 14px; font-size: 1.25rem; line-height: 1.4; letter-spacing: -.02em; }
.pd-empty-chart p { margin-bottom: 24px; color: var(--ink-soft); font-size: 1rem; line-height: 1.65; }
@media (max-width: 1050px) {
  .pd-main-grid { grid-template-columns: minmax(0,1fr) 250px; gap: 18px; }
  .pd-chart-card, .pd-mood-card { padding: 22px; }
  .pd-chart-header { display: block; }
  .pd-periods { margin-top: 20px; }
  .pd-goal { gap: 18px; }
  .pd-ring { flex-basis: 100px; width: 100px; height: 100px; }
}
@media (max-width: 820px) {
  .pd-main-grid { grid-template-columns: 1fr; }
  .pd-hero { padding: 26px; }
  .pd-hero-top { display: block; }
  .pd-hero .pd-add { margin-top: 20px; }
  .pd-hero-main { gap: 20px; }
  .pd-hero .pd-goal p { font-size: .875rem; }
  .pd-goal { justify-content: flex-start; }
  .pd-chart-header { display: flex; }
  .pd-periods { margin-top: 0; }
  .pd-mood-card { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 0 24px; }
  .pd-mood-card .pd-kicker, .pd-mood-card h4 { grid-column: 1/-1; }
  .pd-mood-latest, .pd-mood-empty { grid-column: 1; }
  .pd-mood-card > .btn { grid-column: 1; }
  .pd-context { grid-column: 2; grid-row: 3/5; border: 0; padding-top: 20px; margin-top: 0; }
  .pd-context .pd-kicker { display: block; }
}
@media (max-width: 600px) {
  main:has(.progress-dashboard) .app-head { margin-bottom: 18px; padding: 20px; }
  .pd-hero { padding: 24px 22px; border-radius: 20px; }
  .pd-hero-main { grid-template-columns: 1fr; gap: 28px; margin-top: 28px; }
  .pd-weight { font-size: clamp(2.25rem,14vw,3.5rem); }
  .pd-hero .pd-add { width: 100%; justify-content: space-between; margin-top: 22px; }
  .pd-ring { flex-basis: 5.25rem; width: 5.25rem; height: 5.25rem; }
  .pd-ring > span { font-size: 1.375rem; }
  .pd-goal { flex-wrap: wrap; gap: 18px; padding-top: 22px; border-top: 1px solid #58766a; }
  .pd-goal strong { font-size: 1.5rem; }
  .pd-reference { padding: 20px 0 0; border-left: 0; border-top: 1px solid #58766a; }
  .pd-metrics { grid-template-columns: repeat(auto-fit,minmax(min(100%,8rem),1fr)); gap: 20px 12px; padding: 24px 0; }
  .pd-metrics > div { gap: 5px; padding-left: 12px; }
  .pd-metrics strong { font-size: 1.625rem; }
  .pd-metrics > div:last-child { grid-column: 1/-1; flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 8px 12px; }
  .pd-metrics > div:last-child strong { font-size: 1rem; letter-spacing: 0; }
  .pd-metrics > div:last-child > small { flex-basis: 100%; }
  .pd-chart-card, .pd-mood-card, .pd-weeks, .pd-entry { padding: 22px 18px; border-radius: 18px; }
  .pd-chart-header { display: block; }
  .pd-chart-card h4, .pd-mood-card h4, .pd-weeks h4 { font-size: 1.25rem; }
  .pd-periods { grid-template-columns: repeat(auto-fit,minmax(min(100%,4rem),1fr)); gap: 3px; margin-top: 20px; padding: 3px; }
  .pd-periods button { padding: 8px 3px; font-size: .875rem; white-space: normal; overflow-wrap: anywhere; }
  .pd-chart-meta { align-items: flex-start; flex-direction: column; gap: 10px; }
  .pd-selection { justify-content: space-between; width: 100%; }
  .pd-chart-frame { grid-template-columns: 36px minmax(0,1fr); gap: 8px; }
  .pd-plot, .pd-y-axis { height: 230px; }
  .pd-x-axis, .pd-explorer { margin-left: 44px; }
  .pd-explorer { margin-top: 22px; }
  .pd-chart-foot { gap: 12px; }
  .pd-mood-card { display: block; }
  .pd-mood-latest { padding: 24px 0; }
  .pd-context { margin-top: 24px; padding-top: 22px; border-top: 1px solid #c8d6c9; }
  .pd-week-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,105px),1fr)); gap: 10px; }
  .pd-section-head { gap: 10px; }
  .pd-mood-legend { gap: 12px 16px; }
  .pd-history { padding: 10px 18px; }
  .pd-history .table-scroll { margin-inline: -4px; }
  .pd-history .observations-table { min-width: 620px; }
  .pd-empty-chart { min-height: 280px; padding-inline: 0; }
  .pd-entry .mood-picker { gap: 10px; }
  .pd-entry .mood-choice { padding-inline: 4px; }
  .pd-entry .mood-face { width: 44px; height: 44px; font-size: 26px; }
  .pd-entry > .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .pd-slider { scroll-behavior: auto; }
}
