/* Entries own the full history. Today stays a quiet writing surface. */
.journal-review-controls{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px}
.therapy-root .journal-review-controls button{min-height:40px;padding:7px 0;border:0;background:transparent;color:var(--muted);font-size:11px}
.journal-habit-nav{display:flex;flex-wrap:wrap;gap:6px;margin:2px 0 18px}
.therapy-root .journal-habit-nav button{min-height:38px;border:1px solid var(--stroke);border-radius:9px;padding:7px 10px;background:transparent;color:var(--muted);font-size:10px}
.therapy-root .journal-habit-nav button[aria-current=step]{border-color:var(--paper);color:var(--paper)}
.record-metrics{display:flex;flex-wrap:wrap;gap:8px 14px;font-size:10px;line-height:1.5;color:var(--muted)}
.record-metrics>span{display:inline-flex;gap:5px;flex-wrap:wrap}.record-metrics strong{font-weight:400;color:var(--paper)}
.records-search{display:flex;align-items:center;gap:12px;border:1px solid var(--stroke);border-radius:13px;min-height:48px;padding:0 15px;margin:14px 0 12px;background:var(--surface)}
.records-search>span:first-child{font-size:24px;color:var(--muted)}
.records-search input{width:100%;min-width:0;min-height:46px;padding:8px 0;background:transparent;color:var(--paper);border:0;font:inherit;font-size:13px;outline:0}
.records-search:focus-within{outline:1px solid var(--paper);outline-offset:2px}
.journal-record{border:1px solid var(--stroke);border-radius:16px;background:var(--surface);margin-bottom:10px;overflow:hidden}
.journal-record summary{display:grid;grid-template-columns:1fr auto;gap:12px;list-style:none;cursor:pointer;padding:18px;touch-action:manipulation}
.journal-record summary::-webkit-details-marker{display:none}.journal-record summary:focus-visible{outline:1px solid var(--paper);outline-offset:-5px;border-radius:16px}
.record-date{font-size:14px;font-weight:700}.record-chevron{font-size:18px;color:var(--muted)}
.journal-record[open] .record-chevron{transform:rotate(180deg)}
.journal-record summary>.record-metrics,.journal-record summary>.record-excerpt,.journal-record summary>.record-test-label{grid-column:1/-1}
.record-excerpt{font-size:12px;line-height:1.7;overflow-wrap:anywhere;color:var(--muted)}.journal-record[open] .record-excerpt{display:none}
.record-detail{padding:0 18px 20px}.record-full-text{font-size:13px;line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere;margin:8px 0 24px}
.record-answer-columns{display:grid;grid-template-columns:1fr 1fr;gap:25px;border-top:1px solid var(--stroke);padding-top:18px}
.record-answer-columns h3{font-size:11px;color:var(--muted);font-weight:400;margin:0 0 10px}.record-answer-columns dl{margin:0}
.record-answer-columns dl>div{display:flex;align-items:baseline;justify-content:space-between;gap:12px;min-height:32px;font-size:11px;line-height:1.5;padding:5px 0}.record-answer-columns dd{margin:0;text-align:right;color:var(--paper)}.record-answer-columns dt{color:var(--muted)}
.record-test-label{display:block;font-size:9px;line-height:1.5;color:var(--muted);margin:0 0 10px}
.journal-record summary>.record-test-label{margin:0}.record-empty{padding:25px 16px;font-size:12px;line-height:1.6;color:var(--muted);text-align:center}
@media(max-width:699px){
 .records-search input{font-size:16px}
 .journal-record summary{padding:16px;gap:10px}.record-detail{padding:0 16px 18px}
 .record-answer-columns{gap:18px}.record-answer-columns dl>div{font-size:10px;gap:5px}
 .record-metrics{font-size:9px;gap:6px 12px}
}
@media(max-width:379px){.record-answer-columns{grid-template-columns:1fr;gap:20px}}

/* Your rhythm: one quiet surface, with a single acknowledgement on save. */
.rhythm-panel{max-width:640px;margin:24px auto 30px;padding:28px;border:1px solid var(--stroke);border-radius:24px;background:var(--ink)}
.rhythm-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:24px}
.rhythm-heading h1{font-size:27px;line-height:1.2;letter-spacing:-.6px;font-weight:400;margin:0 0 10px}
.rhythm-heading p{font-size:11px;line-height:1.6;color:var(--muted);margin:0}
.therapy-root .rhythm-heading button{font-size:11px;color:var(--muted);padding:8px 0;min-height:44px;background:none;border:0}
.records-month-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 -6px 14px}
.records-month-heading h2{font-size:16px;font-weight:400;text-transform:capitalize;margin:0}
.therapy-root .records-month-heading button{min-width:44px;min-height:44px;padding:0;border:0;background:none;color:var(--paper);font-size:28px}
.therapy-root .records-month-heading button:disabled{opacity:.25;cursor:default}
.records-weekdays,.records-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));text-align:center}
.records-weekdays{font-size:10px;text-transform:uppercase;color:var(--muted);padding:0 0 9px}
.therapy-root .records-days .rhythm-day{position:relative;display:grid;place-items:center;min-width:0;width:100%;height:58px;padding:4px;border:0;background:transparent;color:var(--paper);touch-action:manipulation}
.rhythm-tile{display:grid;place-items:center;width:46px;max-width:calc(100% - 6px);height:44px;border-radius:9px;font-size:15px;font-weight:400;background:transparent;color:var(--muted)}
[data-day-kind=saved] .rhythm-tile{background:#f4f3ed;color:#10100e}
[data-day-kind=empty] .rhythm-tile{visibility:hidden}
.therapy-root .brand-mark.rhythm-scribble{position:absolute;inset:50% auto auto 50%;width:31px;height:31px;transform:translate(-50%,-50%);opacity:.43;pointer-events:none}
.rhythm-day:not([data-day-kind=empty]):not(.is-revealing) .rhythm-scribble,.rhythm-mini:not([data-day-kind=empty]):not(.is-revealing) .rhythm-scribble{display:none}
.rhythm-day[aria-current=date]::before{content:'';position:absolute;width:48px;max-width:calc(100% - 6px);height:46px;border:1px solid var(--muted);border-radius:11px;pointer-events:none}
.rhythm-day[aria-pressed=true]::after{content:'';position:absolute;width:23px;height:2px;bottom:0;border-radius:2px;background:var(--paper)}
.therapy-root .rhythm-day:focus-visible{outline:2px solid var(--paper);outline-offset:-3px}
.therapy-root .rhythm-day:hover:not(:disabled){background:var(--surface)}
.therapy-root .rhythm-day:disabled{opacity:.45;cursor:default}
.rhythm-thread{display:none;position:absolute;top:50%;left:50%;width:32px;height:1px;background:var(--paper);transform-origin:center;pointer-events:none}
.records-calendar-key{display:flex;align-items:center;gap:24px;margin:24px 0 26px;color:var(--muted);font-size:10px}
.records-calendar-key>span{display:flex;align-items:center;gap:9px;min-height:24px}
.rhythm-key-tile{width:18px;height:18px;border-radius:5px;background:#f4f3ed}
.therapy-root .brand-mark.rhythm-key-scribble{width:23px;height:23px;opacity:.6}
.records-selected{border-top:1px solid var(--stroke);padding-top:20px;min-width:0}
.records-selected h2{font-size:12px;line-height:1.6;font-weight:400;color:var(--muted);margin:0 0 14px}
.therapy-root #record-note{display:block;width:100%;min-height:100px;max-height:400px;resize:vertical;box-sizing:border-box;border:1px solid var(--stroke);border-radius:12px;padding:14px;background:transparent;color:var(--paper);font:inherit;font-size:16px;line-height:1.65;outline:none}
.therapy-root #record-note:focus{border-color:var(--muted);box-shadow:0 0 0 1px var(--muted)}
#record-note::placeholder{color:var(--muted)}
.record-autosave{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:38px;font-size:10px;line-height:1.5;color:var(--muted);padding-top:8px}
.therapy-root .record-autosave button{min-height:44px;padding:6px 10px;font-size:11px;background:none;color:var(--paper);border:1px solid var(--stroke)}
.record-selected-text{white-space:pre-wrap;overflow-wrap:anywhere;font-size:15px;line-height:1.8;max-height:280px;overflow:auto;margin:0 0 20px}
.record-selected-actions{display:flex;gap:12px;align-items:center;justify-content:space-between}
.therapy-root .record-edit,.therapy-root .record-open{min-height:44px;padding:9px 14px;border:1px solid var(--stroke);background:none;color:var(--paper);font-size:11px}
.therapy-root .record-open{border-color:transparent;color:var(--muted)}
.record-detail>.record-edit{margin-top:20px}
.records-heading h2{font-size:16px;font-weight:400;margin:0 0 10px}.records-heading{margin-top:24px}
.therapy-root .rhythm-link{display:inline-flex;align-items:center;justify-content:flex-end;gap:9px;padding:0;border:0;background:none;color:var(--muted);min-height:44px;font-size:10px;white-space:nowrap}
.rhythm-mini{display:grid;place-items:center;position:relative;width:28px;height:32px}
.rhythm-mini .rhythm-tile{width:24px;height:24px;font-size:10px;border-radius:5px;max-width:none}
.therapy-root .rhythm-mini .brand-mark.rhythm-scribble{width:23px;height:23px}
#journal-rhythm-link{margin-left:auto}.journal-autosave-row{flex-wrap:wrap}
.is-revealing .rhythm-tile{animation:rhythm-date-in 720ms cubic-bezier(.2,.7,.2,1) both}
.therapy-root .is-revealing .brand-mark.rhythm-scribble{animation:rhythm-unwind 720ms cubic-bezier(.2,.7,.2,1) both}
.is-revealing .rhythm-thread{display:block;animation:rhythm-thread 720ms ease both}
@keyframes rhythm-unwind{0%,12%{opacity:.5;transform:translate(-50%,-50%) rotate(0) scale(1)}45%{opacity:.4;transform:translate(-50%,-50%) rotate(-24deg) scale(1.1,.13)}66%,100%{opacity:0;transform:translate(-50%,-50%) rotate(-24deg) scale(1.2,.03)}}
@keyframes rhythm-thread{0%,28%{opacity:0;transform:translate(-50%,-50%) scaleX(.25)}48%{opacity:.7;transform:translate(-50%,-50%) scaleX(1)}70%,100%{opacity:0;transform:translate(-50%,-50%) scaleX(.3)}}
@keyframes rhythm-date-in{0%,50%{opacity:0;transform:translateY(3px) scale(.88)}100%{opacity:1;transform:translateY(0) scale(1)}}
@media(max-width:699px){
 .rhythm-panel{padding:20px 12px;border-radius:20px;margin-top:20px}.rhythm-heading{padding:0 6px;margin-bottom:18px}.rhythm-heading h1{font-size:27px}.rhythm-heading p{font-size:11px}
 .therapy-root .records-days .rhythm-day{height:52px;padding:0}.rhythm-tile{height:39px;max-width:calc(100% - 5px);font-size:13px}.rhythm-day[aria-current=date]::before{height:41px;max-width:calc(100% - 3px)}
 .records-selected{margin:0 4px;padding-top:18px}.records-calendar-key{gap:20px;margin:20px 4px;font-size:9px}.records-month-heading{margin-left:0;margin-right:0}.records-month-heading h2{font-size:14px}
}
@media(max-width:379px){.rhythm-panel{padding:18px 5px}.rhythm-heading{padding:0 9px}.records-selected{margin:0 8px}.therapy-root .brand-mark.rhythm-scribble{width:27px;height:27px}.record-autosave{font-size:9px}}
@media(prefers-reduced-motion:reduce){.is-revealing .rhythm-tile{animation:none}.therapy-root .is-revealing .brand-mark.rhythm-scribble,.is-revealing .rhythm-thread{display:none;animation:none}}
.therapy-root[data-reduced=true] .is-revealing .rhythm-tile{animation:none}
.therapy-root .rhythm-panel .records-selected{border-radius:0}
.therapy-root .journal-autosave-row .rhythm-link{border:0;padding:0;font-size:10px}
.therapy-root [data-record-retry][hidden]{display:none}
.therapy-root[data-reduced=true] .is-revealing .brand-mark.rhythm-scribble,.therapy-root[data-reduced=true] .is-revealing .rhythm-thread{display:none;animation:none}
.therapy-root[data-theme=light] [data-day-kind=saved] .rhythm-tile{background:#20201e;color:#fff}
.therapy-root[data-theme=light] .rhythm-key-tile{background:#20201e}

.calendar-demo-note{display:flex;align-items:center;justify-content:space-between;gap:12px;color:var(--muted);font-size:10px;margin:-10px 0 12px}
.therapy-root .calendar-demo-note button{min-height:44px;padding:7px 0;background:transparent;border:0;font-size:10px;color:var(--muted);text-decoration:underline;text-underline-offset:4px}

/* Desktop preview restores the separate day card; mobile keeps its current flow. */
.records-day-preview{display:none}
@media(min-width:1100px){
 .journal-records .rhythm-panel{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;max-width:none;padding:0;border:0;background:transparent;align-items:start}
 .journal-records #records-calendar-wrap{display:contents}
 .journal-records .rhythm-heading{grid-column:1/-1;margin:0 0 6px}
 .therapy-root .journal-records .records-calendar{grid-column:1;grid-row:2;border:1px solid var(--stroke);border-radius:24px;padding:20px;background:var(--ink);min-width:0}
 .journal-records .records-month-heading{margin:0 0 10px}
 .journal-records .records-month-heading h2{font-size:14px}
 .journal-records .records-weekdays,.journal-records .records-days{width:100%;grid-template-columns:repeat(7,minmax(0,1fr));column-gap:4px}
 .therapy-root .journal-records .records-days .rhythm-day{display:flex;align-items:center;justify-content:center;height:44px;min-width:0;padding:0;overflow:visible}
 .journal-records .rhythm-day .rhythm-tile{flex:0 1 32px;width:32px;min-width:0;max-width:100%;height:34px;font-size:13px}
 .journal-records .rhythm-day[aria-current=date]::before{left:50%;top:50%;transform:translate(-50%,-50%);width:36px;max-width:100%;height:38px}
 .journal-records .rhythm-day[aria-pressed=true]::after{left:50%;bottom:0;transform:translateX(-50%);width:16px}
 .therapy-root .journal-records .rhythm-day .rhythm-scribble{width:26px;height:26px}
 .journal-records .records-calendar-key{gap:14px;flex-wrap:wrap;margin:14px 0 10px}
 .journal-records .calendar-demo-note{flex-wrap:wrap;margin:0}
 .therapy-root .journal-records .records-selected{display:none}
 .therapy-root .journal-records .records-day-preview,
 .therapy-root .journal-records .is-editing-record .records-selected{grid-column:2;grid-row:2;display:flex;flex-direction:column;border:1px solid var(--stroke);border-radius:24px;background:var(--ink);padding:24px;min-width:0;min-height:0;margin:0;align-self:stretch;contain:size;overflow:hidden}
 .therapy-root .journal-records .is-editing-record .records-day-preview{display:none}
 .records-day-preview .records-eyebrow{font-size:10px;line-height:1.5;color:var(--muted);margin:0 0 12px}
 .records-day-preview h2,.therapy-root .journal-records .is-editing-record .records-selected h2{font-size:clamp(20px,1.85vw,26px);font-weight:600;line-height:1.35;letter-spacing:-.6px;color:var(--paper);margin:0 0 24px;overflow-wrap:anywhere}
 .records-day-preview>.record-metrics{border-top:1px solid var(--stroke);padding-top:18px;font-size:11px;line-height:1.8;gap:8px 14px}
 /* The calendar alone sizes the row; the preview fits inside that height. */
 .records-day-preview>.records-eyebrow,.records-day-preview>h2,.records-day-preview>.record-test-label,.records-day-preview>.record-metrics{flex-shrink:0}
 .record-preview-text{font-size:14px;font-weight:400;line-height:1.85;white-space:pre-wrap;overflow-wrap:anywhere;margin:20px 0 0;min-height:0;flex:0 1 auto;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:6;overflow:hidden}
 .record-preview-text.is-empty{color:var(--muted)}
 .record-preview-actions{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-top:auto;padding-top:24px;flex-shrink:0}
 .therapy-root .record-preview-actions .record-open{background:var(--paper);color:var(--ink);border:1px solid var(--paper);border-radius:12px;min-height:48px;padding:12px 16px}
 .therapy-root .record-preview-actions .record-edit{border-radius:12px;min-height:44px}
 .therapy-root .journal-records .is-editing-record #record-note{min-height:80px;height:0;font-size:15px;flex:1;resize:none}
 .journal-records .is-editing-record .record-autosave{flex-shrink:0}
}
