/* Keep the first entry simple, while retaining every editing action. */
.dream-marker{transform:scale(.9);transform-origin:top right;padding-left:13px;padding-right:3px}
.dream-marker:not(.has-dream){min-width:118px}
.dream-marker .dream-caption{display:block}
.dream-marker #dream-caption-text{margin-left:0}
#current-location,#current-location-label{z-index:3}
.gesture-hint{bottom:auto;transform:none}
#dream-dialog{margin:auto;width:min(460px,calc(100% - 28px));max-height:calc(100dvh - 40px);border-radius:24px;padding:14px 22px 26px}
#dream-dialog>.sheet-top{margin:0 0 4px;align-items:center;justify-content:flex-end;gap:12px}
#dream-dialog #dream-title{margin:2px 0 14px;font-size:clamp(19px,6.1vw,27px);font-weight:500;letter-spacing:.04em;line-height:1.6}
#dream-description{margin:0 0 22px;font-size:12px;line-height:1.9;color:#7e8b75}
#dream-dialog label[for="dream-input"]{margin:0 0 9px;font-size:12px;font-weight:500}
#dream-dialog .dream-trial-note{font-size:10px;line-height:1.65;color:#7e8b75;margin:12px 0 0}
#dream-dialog .close-button{flex:none;width:44px;height:44px}
#dream-dialog #dream-progress-hint{margin:0;font-size:10px;line-height:1.5}
#dream-dialog #dream-error:empty{display:none}
#dream-dialog .save-button{margin-top:20px}
/* Use the same slim green slider on desktop and mobile browsers. */
#dream-dialog #dream-progress-range{-webkit-appearance:none;appearance:none;--range-progress:0%;height:36px;margin:0;outline:none}
#dream-progress-range::-webkit-slider-runnable-track{height:6px;border:1px solid #bfc5bd;border-radius:999px;background:linear-gradient(to right,#547d62 0 var(--range-progress),#ededed var(--range-progress) 100%)}
#dream-progress-range::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:16px;height:16px;margin-top:-6px;border:0;border-radius:50%;background:#547d62;box-shadow:none}
#dream-progress-range::-moz-range-track{height:4px;border:1px solid #bfc5bd;border-radius:999px;background:#ededed}
#dream-progress-range::-moz-range-progress{height:6px;border:0;border-radius:999px;background:#547d62}
#dream-progress-range::-moz-range-thumb{width:16px;height:16px;border:0;border-radius:50%;background:#547d62;box-shadow:none}
#dream-dialog #dream-progress-range:focus-visible{outline:2px solid #78966d;outline-offset:2px;border-radius:6px}
#dream-dialog #dream-progress-input{-moz-appearance:textfield;appearance:textfield}
#dream-progress-input::-webkit-inner-spin-button,#dream-progress-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}

#reset-demo{background:#f4f7ec;border:1px solid #cbd6bf;border-radius:9px;color:#4b654f;font-weight:500;font-size:11px;min-height:40px;padding:7px 10px;text-decoration:none}
#dream-caption-text{font-size:inherit}
/* Preserve the original diary form; keep its close button at the right. */
#entry-dialog>.sheet-top{justify-content:flex-end}
#entry-kind{margin-right:auto}
.first-save-install{position:fixed;left:50%;bottom:max(18px,env(safe-area-inset-bottom));transform:translateX(-50%);z-index:19;width:min(400px,calc(100% - 28px));padding:18px 20px;border:1px solid #cbd8be;border-radius:16px;background:#fafbf1;box-shadow:0 6px 30px #344c382e;color:var(--ink)}
.first-save-install[hidden]{display:none}
.first-save-install>p:first-of-type{margin:0;padding-right:28px;font-size:14px;line-height:1.6;font-weight:600}
.first-save-install-copy{margin:5px 0 13px;padding-right:15px;font-size:11px;line-height:1.8;color:#71826b}
.first-save-dismiss{position:absolute;right:5px;top:5px;width:44px;height:44px;background:transparent;font-size:24px;color:#7c8f73;line-height:1}
.first-save-install-button{display:flex;justify-content:space-between;align-items:center;width:100%;min-height:44px;padding:10px 13px;border-radius:10px;background:#e8efdf;color:#395b47;font-size:12px;text-align:left}
.first-save-install-button[hidden]{display:none}
@media(max-height:500px) and (min-width:500px){.app{grid-template-rows:49px minmax(0,1fr) 157px}.app:has(#compact-record-control:not([hidden])){grid-template-rows:49px minmax(0,1fr) 189px}}
@media(display-mode:standalone){.first-save-install{display:none}}
/* Leave room for the current-location marker above the first-use controls. */
@media(max-height:740px) and (min-height:501px) and (max-width:499px){.preview{height:133.2px}.preview-copy .preview-body{-webkit-line-clamp:3}}

/* Keep the sample action beside the diary it applies to. */
.preview-footer{display:flex;align-items:center;justify-content:flex-end;gap:8px;width:90%;margin:6px auto 0}
.preview-footer:has(#reset-demo[hidden]){display:none}
.preview-footer #reset-demo{flex:none;max-width:72%;line-height:1.5;text-align:center}
.preview-footer #reset-demo[hidden]{display:none}
@media(max-height:500px) and (min-width:500px){.preview-wrap{display:flex;flex-direction:column;gap:6px;min-height:0}.preview{flex:1;min-height:0;height:auto}.preview-footer{flex:none;margin-top:0}}

/* One date control, and a clear invitation inside an unwritten diary card. */
.controls .step-row{height:auto;min-height:44px;margin:0 0 7px;gap:4px}
.controls .step-button{width:44px;height:44px;font-size:24px;flex:none}
.controls .period-label{min-width:0;min-height:44px;padding:7px 10px;font-size:12px;line-height:1.6;letter-spacing:.02em;color:#5c735d;text-decoration:underline;text-underline-offset:4px}
.preview.blank .preview-line{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;margin:0;padding:30px 12px;pointer-events:none}
.preview.blank .preview-line>span:first-child{font-family:inherit;font-size:11px;line-height:1.6;font-weight:400;white-space:normal;overflow:visible;text-overflow:clip;letter-spacing:.02em;text-align:center;color:#71866c}
.preview.blank .preview-arrow,.preview.blank .preview-copy{display:none}
.preview.blank .preview-sub{display:none}
@media(max-height:620px){.preview.blank .preview-line>span:first-child{font-size:10px}}
/* Long dreams remain fully editable; compact their preview on short phones. */
@media(max-height:620px) and (max-width:499px){.dream-marker.long-dream strong{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.app:has(.dream-marker.long-dream) .preview{height:113.4px}.app:has(.dream-marker.long-dream) .preview-body{-webkit-line-clamp:2}}
@media(max-height:500px) and (min-width:500px){.app{grid-template-rows:49px minmax(0,1fr) 141px}.app:has(#compact-record-control:not([hidden])){grid-template-rows:49px minmax(0,1fr) 173px}}
