/* Keep the first entry simple, while retaining every editing action. */
.dream-marker{transform:scale(.9);transform-origin:top right}
.dream-marker:not(.has-dream){min-width:176px;padding-inline:18px}
#current-location,#current-location-label{z-index:3}
.gesture-hint{bottom:auto;transform:none}
#dream-dialog>.sheet-top{margin:0 0 8px;align-items:center;gap:12px}
#dream-dialog #dream-title{margin:0;font-size:18px;font-weight:400;line-height:1.5}
#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}
.dream-caption>span.dream-edit{margin-left:auto}

#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}
#entry-dialog[open]{display:flex;flex-direction:column;height:min(610px,92dvh);overflow:hidden;padding:9px 22px max(16px,env(safe-area-inset-bottom))}
#entry-dialog>.sheet-handle{flex:none;margin-bottom:5px}
#entry-dialog>.sheet-top{flex:none;min-height:44px;margin-top:0}
#entry-dialog>.sheet-top .close-button{width:44px;height:44px;flex-shrink:0}
#entry-dialog h2{flex:none;font-size:25px;line-height:1.4;margin:0 0 12px}
#entry-form{display:flex;flex-direction:column;flex:1;min-height:0}
.entry-fields{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0 2px 8px;scrollbar-gutter:stable}
#entry-dialog .entry-date-field{margin:0 0 13px;gap:10px;font-size:11px}
#entry-dialog .entry-date-field input{padding:5px 10px;line-height:1.5}
#entry-dialog .field-label{margin:11px 0 8px;font-size:12px}
#entry-dialog .field-label span{font-size:10px}
#entry-dialog #entry-body{display:block;min-height:142px;height:164px;max-height:60dvh;padding:12px;font-size:16px;line-height:1.8;resize:vertical}
#entry-dialog #entry-body::placeholder{font-size:13px;line-height:1.8;color:#81907b}
.entry-options{margin-top:9px}
.entry-options>summary{min-height:40px;padding:10px 1px;color:#647c65;font-size:12px;line-height:1.6;cursor:pointer}
.entry-options>summary>span{margin-left:5px;color:#8c9984;font-size:10px}
#entry-dialog .entry-options .field-label{margin-top:5px}
#entry-dialog .section-tools{gap:6px;margin-top:12px}
#entry-dialog .section-tools>span{display:block;width:100%;font-size:10px}
#entry-dialog .section-tools button{min-height:40px;font-size:11px;padding:8px 10px}
#entry-dialog .field-hint{font-size:10px;line-height:1.7;margin:2px 0 0;color:#7b8b75}
#entry-dialog .sheet-footnote{text-align:left;margin:11px 0 0;line-height:1.8;color:#71826b}
#entry-dialog .delete-entry-button{margin:12px 0 0}
.entry-save-area{flex:none;padding-top:11px;background:#fafaf2;border-top:1px solid #e4e9dc}
#entry-dialog .entry-save-area .form-error{margin:0 0 9px;font-size:12px;line-height:1.6}
#entry-dialog .entry-save-area .form-error:empty{display:none}
#entry-dialog .entry-save-area .save-button{height:48px;margin-top:0;font-size:14px}
.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:620px){#entry-dialog[open]{height:96dvh}#entry-dialog h2{font-size:22px;margin-bottom:8px}#entry-dialog>.sheet-handle{margin-bottom:0}#entry-dialog #entry-body{height:142px;min-height:110px}}
@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{flex:1;display:flex;align-items:center;margin:6px 0}
.preview.blank .preview-line>span:first-child{font-family:inherit;font-size:15px;line-height:1.9;font-weight:500;white-space:normal;overflow:visible;text-overflow:clip;letter-spacing:.02em;text-align:center;color:#54715a}
.preview.blank .preview-arrow,.preview.blank .preview-copy{display:none}
.preview.blank .preview-sub{display:block;align-self:center;margin-top:4px;font-size:11px;line-height:1.6;text-align:center;color:#71866c}
@media(max-height:620px){.preview.blank .preview-line>span:first-child{font-size:13px;line-height:1.7}.preview.blank .preview-sub{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}}
