/* 꿈해몽 사전 */
.dr {
  margin-top: 22px;
}

/* 검색 */
.dr-search {
  display: grid;
  gap: 10px;
  background:
    radial-gradient(120% 140% at 100% 0%, var(--brand-soft) 0%, transparent 60%),
    var(--surface);
}
.dr-label {
  font-weight: 800;
}
.dr-search-row {
  position: relative;
  display: flex;
  align-items: center;
}
.dr-search-row svg {
  position: absolute;
  left: 14px;
  color: var(--muted);
  pointer-events: none;
}
.dr-search-row input {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 48px 10px 44px;
  appearance: none;
}
.dr-search-row input::-webkit-search-cancel-button {
  display: none;
}
.dr-search-row input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.dr-clear {
  position: absolute;
  right: 6px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
  touch-action: manipulation;
}
.dr-clear:hover {
  background: var(--surface-2);
}
.dr-quick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 0.86rem;
}
.dr-quick span {
  color: var(--muted);
  font-weight: 700;
  margin-right: 2px;
}
.dr-quick a {
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  touch-action: manipulation;
}
.dr-quick a:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

/* 분류 칩: 휴대폰에서는 가로로 밀어 본다 */
.dr-chips {
  display: flex;
  gap: 8px;
  margin: 16px 0 0;
  padding: 2px 2px 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 720px) {
  .dr-chips {
    flex-wrap: wrap;
    overflow: visible;
  }
}
.dr-chips .chip {
  flex: none;
  white-space: nowrap;
  touch-action: manipulation;
}
.dr-chips .chip small {
  color: var(--muted);
  font-weight: 600;
  margin-left: 2px;
}
.dr-chips .chip[aria-pressed='true'] {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.dr-chips .chip[aria-pressed='true'] small {
  color: inherit;
  opacity: 0.75;
}

.dr-status {
  margin: 10px 0 6px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}
.dr-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.dr-legend .dr-k + .dr-k,
.dr-legend .dr-k {
  margin-left: 4px;
}

/* 분류 묶음 */
.dr-group {
  margin-top: 18px;
}
.dr-group[hidden] {
  display: none;
}
.dr-group-h {
  font-size: 1.12rem;
  font-weight: 800;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dr-group-h small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}
.dr-items {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.dr-item {
  border-top: 1px solid var(--line);
  scroll-margin-top: 84px;
}
/* 스크립트 전: 많이 찾는 꿈만 보인다. 스크립트가 돌면(.js) 보이고 숨기는 것은 .is-off 하나로 정한다. */
.dr .is-more {
  display: none;
}
.dr.js .dr-item {
  display: block;
}
.dr.js .dr-item.is-off {
  display: none;
}
/* 첫 번째로 보이는 줄의 윗선은 지운다 */
.dr-items > .dr-item:first-child,
.dr-items > .dr-item.is-first {
  border-top: 0;
}
.dr-item summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.dr-item summary::-webkit-details-marker {
  display: none;
}
.dr-item summary::after {
  content: '';
  flex: none;
  width: 9px;
  height: 9px;
  margin-left: 2px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-3px);
  transition: transform 0.15s ease;
}
.dr-item[open] summary::after {
  transform: rotate(-135deg) translateY(-2px);
}
.dr-item summary:hover {
  background: var(--surface-2);
}
.dr-t {
  flex: 1;
  min-width: 0;
}
.dr-k {
  flex: none;
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
}
.dr-good {
  color: var(--go);
  background: color-mix(in srgb, var(--go) 10%, transparent);
}
.dr-bad {
  color: var(--wait);
  background: color-mix(in srgb, var(--wait) 10%, transparent);
}
.dr-mid {
  color: var(--muted);
  background: var(--surface-2);
}

.dr-body {
  padding: 0 18px 16px;
}
.dr-p {
  margin: 0 0 10px;
  font-size: 0.97rem;
  line-height: 1.75;
}
.dr-lab {
  display: block;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--brand);
  margin-bottom: 2px;
}
.dr-psy {
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface-2);
}
.dr-psy .dr-lab {
  color: var(--muted);
}
.dr-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}
.dr-rel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 0.85rem;
}
.dr-rel span {
  color: var(--muted);
  font-weight: 700;
  margin-right: 2px;
}
.dr-rel a {
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  touch-action: manipulation;
}
.dr-rel a:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.dr-share {
  flex: none;
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  min-height: 36px;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
}
.dr-share:hover {
  border-color: var(--brand);
}
@media (max-width: 480px) {
  .dr-item summary {
    padding: 13px 14px;
  }
  .dr-body {
    padding: 0 14px 14px;
  }
  .dr-foot {
    flex-direction: column;
  }
  .dr-share {
    align-self: flex-end;
  }
}

/* 앵커로 왔을 때 잠깐 반짝 */
.dr-item.is-flash {
  animation: dr-flash 1.6s ease;
}
@keyframes dr-flash {
  0%,
  40% {
    background: var(--brand-soft);
  }
  100% {
    background: transparent;
  }
}

.dr-more {
  display: block;
  width: 100%;
  margin-top: 8px;
  appearance: none;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  min-height: 44px;
  border-radius: 14px;
  cursor: pointer;
  touch-action: manipulation;
}
.dr-more:hover {
  background: var(--brand-soft);
}
.dr-more[hidden],
.dr-all-wrap[hidden],
.dr-clear[hidden] {
  display: none;
}
.dr-all-wrap {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}
.dr-empty {
  margin-top: 14px;
  text-align: center;
}
.dr-empty p {
  margin: 0 0 6px;
}

/* 공유 알림: 화면 아래에 잠깐 */
.dr-toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 20;
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.dr-toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (prefers-reduced-motion: reduce) {
  .dr-item.is-flash {
    animation: none;
  }
  .dr-toast {
    transition: none;
  }
}

/* ---------- 꿈해몽 모아 보기 쪽(/dream/<주제>/ · /dream/<분류>/, 2026-11-26) ---------- */
.drp-intro {
  margin-top: 18px;
}
.drp-intro p {
  margin: 0 0 10px;
  line-height: 1.8;
}
.drp-sum {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 !important;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
}
.drp-sum .dr-k + .dr-k {
  margin-left: 0;
}
.drp-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0 4px;
}
.drp-toc a,
.drp-chip {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}
.drp-toc a:hover,
a.drp-chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.drp-chip.is-on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.drp-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.drp-item {
  scroll-margin-top: 80px;
}
.drp-item:target {
  outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent);
  outline-offset: 2px;
}
.drp-t {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 1.12rem;
  font-weight: 800;
}
.drp-t .dr-k {
  margin-left: 0;
}
.drp-item .dr-rel a {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}
.drp-item .dr-rel a:hover {
  color: var(--brand);
}
.drp-minis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 10px;
}
.drp-mini {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
}
.drp-mini b {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.98rem;
}
.drp-mini b .dr-k {
  margin-left: 0;
}
.drp-mini small {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}
.drp-mini:hover {
  border-color: var(--brand);
}
.drp-topics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr));
  gap: 10px;
}
.drp-topic {
  display: grid;
  gap: 4px;
  text-decoration: none;
  color: var(--ink);
}
.drp-topic b {
  font-size: 1.02rem;
}
.drp-topic small {
  color: var(--brand);
  font-weight: 700;
}
.drp-nav-h {
  margin: 0 0 8px;
  font-weight: 800;
}
.drp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
}
.drp-search {
  margin: 4px 0 0;
}
.drp-fine {
  margin-top: 10px;
}

/* 검색 사전(/dream/) 항목 아래 "모아 보기" 링크 · 주제 길잡이 */
.dr-page {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
  white-space: nowrap;
}
.dr-topics {
  margin-top: 22px;
}
