.story-dream {--story-ink:#594383}
.dream-studio {display:grid;gap:1rem;color:#342b48}
.dream-paper {padding:clamp(1.15rem,3vw,2.25rem);border:1px solid #e1dae7;border-radius:18px;background:#fff}
.dream-paper h2,.dream-paper h3,.dream-paper h4 {line-height:1.4;word-break:keep-all;margin:0 0 .65em}
.dream-paper p {max-width:48em;line-height:1.78;word-break:keep-all;overflow-wrap:anywhere;margin:.4em 0 .9em}
.dream-paper label {display:grid;gap:.35rem;color:#413354;font-weight:650}
.dream-paper textarea,.dream-paper input:not([type=checkbox]),.dream-paper select {box-sizing:border-box;max-width:100%;font:inherit;padding:.65rem .78rem;border:1px solid #cfc6d9;border-radius:9px;background:#fff;color:inherit}
.dream-paper textarea {width:100%;margin-top:.45rem;resize:vertical}
.dream-paper button,.dream-paper nav a {font:inherit;font-weight:650;padding:.5rem .85rem;border:1px solid #dbd2e5;border-radius:9px;background:#f7f4fa;color:#443550;cursor:pointer}
.dream-paper button:disabled {opacity:.65}
.dream-paper .dream-primary {background:#392e56;color:white;margin-top:.9rem;padding:.7rem 1.1rem}
.dream-tools,.dream-fields,.dream-actions,.dream-paper nav,#dream-examples,#dream-journal div>div {display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}
.dream-fields {align-items:end;margin:.65rem 0}
.dream-paper section {margin:1.4rem 0;padding-top:1rem;border-top:1px solid #e7e2ec}
.dream-paper details {margin:.45rem 0}.dream-paper summary {cursor:pointer;padding:.5rem 0;color:#504065;font-weight:650}
#dream-dict {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(14rem,100%),1fr));gap:.3rem 1rem;align-items:start;margin:.8rem 0}
#dream-result h2:focus {outline:none}.dream-paper nav {margin-top:1rem}
.dream-library {display:flow-root}
.dream-library h2 {display:inline-block}
.dream-library .dl-write {float:right;margin-bottom:.6rem}
.dream-library label[for=dream-find] {clear:both}
.dream-library input[type=search] {width:100%;margin:.35rem 0}
#dream-dict {display:block}
#dream-dict h3 {margin:1.2rem 0 .55rem}
.dl-categories {display:flex;flex-wrap:wrap;gap:.45rem}
.dl-subjects {display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px}
.dl-card {position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:6px;min-height:168px;padding:14px;border:1px solid #e1dbeb;border-radius:14px;background:#fff;text-align:left;cursor:pointer;font:inherit;color:#2f2840;transition:border-color .15s,box-shadow .15s}
.dl-card:hover {border-color:#b9a9d8;box-shadow:0 4px 14px #4a3a7814}
.dl-card[aria-pressed=true] {border-color:#463864;box-shadow:0 0 0 2px #463864 inset}
.dl-card img {width:56px;height:56px;border-radius:50%;object-fit:cover}
.dl-card b {font-size:1rem;font-weight:700;margin-top:4px}
.dl-card small {font-size:.86rem;line-height:1.45;color:#5f5870;word-break:keep-all}
.dl-grade {position:absolute;top:12px;right:12px;padding:2px 8px;border-radius:999px;font-size:.76rem;font-weight:700}
.dl-good {background:#e5f5ea;color:#24744a}.dl-bad {background:#fde8ea;color:#b0303f}.dl-mixed {background:#efe9fa;color:#5d45a0}
@media(max-width:520px){.dl-subjects {grid-template-columns:repeat(2,minmax(0,1fr))}}
.dl-scenes {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(15rem,100%),1fr));gap:.5rem}
.dl-scenes button {text-align:left;min-height:2.8rem}
#dream-dict button[aria-pressed=true] {background:#443558;color:white;border-color:#443558}
.dl-detail {margin-top:1rem;padding:1rem;background:#f6f2f9;border-radius:.75rem}
.dl-detail label {max-width:18rem}.dl-detail p {max-width:40em}
.dl-detail,#dream-result{scroll-margin-top:9rem}
.dream-paper section.dream-conclusion{padding:.95rem 1.2rem;border:0;border-inline-start:4px solid #8166a0;background:#f5f1f8;border-radius:0 .7rem .7rem 0;margin:1rem 0}
.dream-paper section.dream-conclusion p{margin:0;max-width:40em}.dl-detail .dream-actions{margin-top:1rem}
.dream-sequence{list-style-position:inside;padding:0;display:flex;flex-wrap:wrap;gap:.5rem}
.dream-sequence li{padding:.5rem .75rem;border-radius:.55rem;background:#f5f1f8;font-weight:650}
#dream-dict [hidden]{display:none}

#app-dream .dream-birth-fields {
 display:grid;
 grid-template-columns:minmax(5rem,7rem) minmax(0,12rem);
 align-items:start;
 gap:.5rem .8rem;
 margin:.35rem 0 0;
}
#app-dream .dream-birth-fields > label {min-width:0;margin:0;line-height:1.5;gap:.4rem}
#app-dream .dream-birth-fields :is(select,#dream-birth) {
 display:block;box-sizing:border-box;width:100%;min-width:0;height:2.9rem;
 margin:0;padding:.45rem .65rem;font:inherit;line-height:1.4;
}
#app-dream .dream-date {position:relative;min-width:0}
#app-dream #dream-birth {padding-right:2.8rem}
#app-dream #dream-birth::placeholder {color:inherit;opacity:1}
#app-dream .dream-date-picker {position:absolute;inset:1px 1px 1px auto;width:2.65rem;display:grid;place-items:center;margin:0}
#app-dream #dream-picker {position:absolute;inset:0;width:100%;height:100%;padding:0;margin:0;opacity:0;cursor:pointer}
#app-dream .dream-date-picker:focus-within {outline:2px solid #655089;border-radius:.4rem}
#app-dream #dream-leap-row:not([hidden]) {grid-column:1/-1;display:flex;align-items:center}
#app-dream #dream-leap-row input {margin:0}
#app-dream form.dream-paper {container-type:inline-size}
#app-dream .dream-tools {
 display:grid;grid-template-columns:minmax(max-content,1fr) auto auto auto;
 align-items:center;gap:.5rem;margin:.65rem 0 0;
}
#app-dream .dream-tools .dream-mood {display:flex;align-items:center;gap:.55rem;margin:0;white-space:nowrap}
#app-dream .dream-tools :is(button,select) {box-sizing:border-box;min-width:0;height:2.85rem;margin:0;white-space:nowrap}
#app-dream .dream-tools #dream-examples {display:flex;flex-wrap:nowrap;gap:.4rem}
#app-dream .dream-birth {margin:.35rem 0 0 auto;width:fit-content;max-width:100%}
#app-dream .dream-birth > summary {width:fit-content;margin-left:auto;padding:.2rem 0}
@container (max-width:52rem) {
 #app-dream .dream-tools {grid-template-columns:1fr auto}
 #app-dream .dream-tools .dream-mood {justify-self:end}
 #app-dream .dream-tools #dream-examples {flex-wrap:wrap}
}
@container (max-width:32rem) {
 #app-dream .dream-tools {grid-template-columns:minmax(0,1fr);row-gap:.65rem}
 #app-dream .dream-tools .dream-mood {justify-self:start;flex-wrap:wrap;white-space:normal}
 #app-dream .dream-tools #dream-examples {display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
 #app-dream .dream-tools #dream-examples button {height:auto;min-height:2.75rem;padding:.35rem;white-space:normal;word-break:keep-all}
 #app-dream .dream-tools .dream-primary {width:100%}
}


#dream-dict .dl-card,#dream-dict .dl-card[aria-pressed="true"] {background:#fff;color:#2f2840;border-color:#e1dbeb}
#dream-dict .dl-card[aria-pressed="true"] {border-color:#463864;box-shadow:0 0 0 2px #463864 inset;background:#faf7ff}

.dream-lucky{list-style:none;display:flex;flex-wrap:wrap;gap:8px;margin:6px 0 14px;padding:0}
.dream-lucky li{display:grid;gap:2px;min-width:110px;padding:8px 12px;border:1px solid #e4def0;border-radius:10px;background:#faf8fd}
.dream-lucky small{font-size:.78rem;color:#6a6380}
.dream-lucky b{font-size:.95rem;color:#352c4c}
.dream-lucky .dl-grade{position:static;justify-self:start}
