/* 운세 코너 태블릿(768~1023px)·데스크톱(1024px 이상) 화면. 휴대폰(767px 이하)은 unse.css 그대로 두고, 이 파일은 미디어 쿼리 안에서만 덧씌운다.
   구성: 흰 머리띠(로고·분야 메뉴·리포트 바로가기) + 연회색 바탕에 960px 가운데 단. 목록은 카드 4열(태블릿 3열), 입력·결과는 왼쪽 그림·소개, 오른쪽 입력·결과 2단.
   색은 unse.css 의 :root 토큰과 리포트 입력·결제 보라(report.css --rp-cta #8341c0)만 쓴다. 인라인 style 없음(CSP).
   index.html 이 머리띠 메뉴(#topNav, #topCta)를 hidden 으로 넣고, unse-desktop.js 가 카드 설명 줄(.dk-desc)·입력 화면 소개(.dk-side)를 hidden 으로 더한다.
   unse.css 의 [hidden] { display: none !important } 보다 구체적인 선택자로 여기서만 보이게 한다. */

@media (min-width: 768px) {
  :root { --dk-cta: #8341c0; --dk-cta-press: #6a32a0; --dk-soft: #f4eff9; --dk-line: #cfb7e5; --dk-col: min(960px, calc(100vw - 64px)); }

  /* ----- 바탕·가운데 단 ----- */
  .app { max-width: none; background: transparent; }
  .app > main, .app > footer { width: var(--dk-col); margin-left: auto; margin-right: auto; }
  .app > footer { padding-left: 0; padding-right: 0; margin-top: 48px; border-top: 1px solid var(--g400); }

  /* ----- 머리띠 ----- */
  .top { height: 64px; gap: 8px; padding: 0 calc((100% - var(--dk-col)) / 2); }
  .top .top-brand[hidden] { display: inline-flex !important; } /* 입력·결과 화면에서도 로고를 둔다 */
  .top .top-title { display: none !important; } /* 풀이 이름은 본문 왼쪽 소개가 맡는다 */
  .top-back { margin-left: -12px; }
  .top .top-nav[hidden] { display: flex !important; }
  .top-nav { flex: 1 1 auto; min-width: 0; align-self: stretch; display: flex; gap: 2px; margin-left: 20px; overflow-x: auto; scrollbar-width: none; }
  .top-nav::-webkit-scrollbar { display: none; }
  .top-nav-i { position: relative; flex: none; display: inline-flex; align-items: center; padding: 0 11px; border: 0; background: transparent; color: var(--g800); font: 600 15px/1 var(--font); cursor: pointer; white-space: nowrap; }
  .top-nav-i:first-child { margin-left: auto; }
  .top-nav-i:last-child { margin-right: auto; }
  .top-nav-i:hover { color: var(--g1000); }
  .top-nav-i:focus-visible { border-radius: 8px; }
  .top-nav-i[aria-pressed="true"] { color: var(--dk-cta); font-weight: 700; }
  .top-nav-i[aria-pressed="true"]::after { content: ""; position: absolute; left: 11px; right: 11px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--dk-cta); }
  /* 목록이 아닌 화면에서는 고른 분야 밑줄을 지운다 */
  body:has(#listView[hidden]) .top-nav-i[aria-pressed="true"] { color: var(--g800); font-weight: 600; }
  body:has(#listView[hidden]) .top-nav-i[aria-pressed="true"]::after { content: none; }
  .top-cta { flex: none; display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 999px; background: var(--dk-soft); border: 1px solid var(--dk-line); color: var(--dk-cta); font: 700 15px/1 var(--font); text-decoration: none; white-space: nowrap; }
  .top-cta:hover { background-color: #ece2f6; }

  /* ----- 목록 ----- */
  #listView .pad { padding-left: 0; padding-right: 0; }
  .intro { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 40px; padding-bottom: 4px; }
  .intro h1 { flex: 0 0 100%; margin-bottom: 10px; font-size: 34px; letter-spacing: -.02em; }
  .intro .hub-line { margin-top: 0; }
  .intro .hub-link { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 999px; background: var(--g00); border: 1px solid var(--g300); color: var(--g900); font-size: 15px; text-decoration: none; }
  .intro .hub-link:hover { border-color: var(--g500); }
  .recent { padding-top: 24px; }
  .recent .chip { background: var(--g00); border: 1px solid var(--g300); }
  .quick { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; margin-top: 24px; padding: 20px 12px 18px !important; border: 1px solid var(--g300); border-radius: 20px; background: var(--g00); }
  .quick-i { padding: 4px 0; border-radius: 14px; }
  .quick-i:hover .quick-ic { background: var(--g200); }

  /* 분류 칩: 줄바꿈해 한눈에 보이게 */
  #chipRow { flex-wrap: wrap; overflow: visible; gap: 8px; padding-top: 36px; padding-bottom: 20px; scroll-margin-top: 80px; }
  #chipRow .chip { height: 40px; padding: 0 16px 0 12px; background: var(--g00); border: 1px solid var(--g300); font-size: 15px; }
  #chipRow .chip:hover { border-color: var(--g500); }
  #chipRow .chip[aria-pressed="true"] { background: var(--dk-cta); border-color: var(--dk-cta); color: #fff; }

  /* 카드 격자: 세 구역(바로 보기·공유·준비 중)을 한 격자로 이어 붙인다(구역 제목은 원래대로 화면에서 숨김) */
  #listArea { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 16px; border-top: 0; padding-bottom: 8px; }
  #listArea .zone, #listArea .rows { display: contents; }
  #listArea .card { position: relative; display: flex; flex-direction: column; margin: 0; overflow: hidden; border: 1px solid var(--g300); border-radius: 16px; background: var(--g00); transition: transform .15s ease-out, box-shadow .15s ease-out; }
  #listArea .card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(26, 28, 32, .08); }
  #listArea .card--soon:hover { transform: none; box-shadow: none; }
  #listArea .card:focus-visible { border-radius: 16px; }
  #listArea .card:active .thumb { transform: none; }
  /* 썸네일 위 질문 글은 화면에서만 감추고(읽기 프로그램은 그대로 읽는다) 카드 아래 설명 줄로 보인다 */
  #listArea .thumb-ask { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  #listArea .thumb.is-illust::before { content: none; }
  #listArea .card-line { align-items: center; gap: 8px; min-height: 34px; box-sizing: content-box; padding: 14px 16px 0; }
  #listArea .card-name { flex: 1 1 auto; min-width: 0; font-size: 17px; font-weight: 700; }
  #listArea .dk-desc[hidden] { display: block !important; }
  #listArea .dk-desc { padding: 2px 16px 18px; font-size: 14px; line-height: 1.45; color: var(--text-sub); }
  #listArea .card--soon .dk-desc { padding-bottom: 18px; }
  /* 상태 배지: 바로 보기는 보라 원형 '무료', 공유 구역은 '공유하면 무료', 준비 중은 원래 회색 배지 */
  #freeCards .card-line::after { content: "무료"; flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--dk-cta); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: -.02em; }
  #shareCards .card-line::after { content: "공유하면 무료"; flex: none; display: inline-flex; align-items: center; height: 26px; padding: 0 9px; border-radius: 999px; background: var(--dk-soft); border: 1px solid var(--dk-line); color: var(--dk-cta); font-size: 12px; font-weight: 700; white-space: nowrap; }
  #listArea .card-badge { flex: none; }
  @media (prefers-reduced-motion: reduce) { #listArea .card { transition: none; } #listArea .card:hover { transform: none; } }

  /* 안내 글 */
  #listView .seo-info.pad { margin-top: 32px; padding: 36px 40px 32px; border: 1px solid var(--g300); border-radius: 20px; background: var(--g00); }
  .seo-info .sec-t { position: static; width: auto; height: auto; margin: 0 0 4px; overflow: visible; clip-path: none; white-space: normal; font-size: 22px; }
  .seo-info p { max-width: 46em; }

  /* ----- 입력 화면: 흰 판 ----- */
  #formView { max-width: 640px; margin: 32px auto 0; padding: 8px 36px 32px; border: 1px solid var(--g300); border-radius: 24px; background: var(--g00); }
  #formView .pad { padding-left: 0; padding-right: 0; }
  .form-wrap { padding-bottom: 8px; }
  .form-t { margin-top: 24px; font-size: 26px; }
  /* 아래 고정 버튼을 판 안 입력 칸 밑에 둔다 */
  .bar { position: static; transform: none; width: auto; max-width: none; padding: 16px 0 0; border-top: 0; background: transparent; }

  /* ----- 결과 화면: 흰 판(결과 구획 사이 회색 띠는 판 안에서 끝난다) ----- */
  #resultArea { --gutter: 32px; max-width: 720px; margin: 32px auto 0; overflow: clip; border: 1px solid var(--g300); border-radius: 24px; background: var(--g00); }
  .result > div { padding-top: 32px; }

  /* ----- 공유 팝업: 바닥 시트 대신 가운데 창 ----- */
  .sheet { inset: 0; max-width: 480px; height: fit-content; max-height: 88vh; margin: auto; border-radius: 24px; }
  .sheet-body { padding: 28px 28px 20px; }
  .snack { max-width: 448px; }

  /* ----- 리포트(/unse/report/, /unse/report/view/): 흰 판. 안쪽 2단은 report.css 끝에 있다 ----- */
  .app > main.rp { margin-top: 32px; padding: 32px 40px 40px; border: 1px solid var(--g300); border-radius: 24px; background: var(--g00); }
  .app > main.rp .rp-cta { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
  .app > .zp-foot { margin-top: 48px; }
}

@media (min-width: 1024px) {
  #listArea { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 20px; }
  .top .top-cta[hidden] { display: inline-flex !important; } /* 태블릿은 분야 메뉴만 둔다 */
  .intro h1 { font-size: 38px; }

  /* 입력 화면 2단: 왼쪽 그림·소개(unse-desktop.js 가 채운다), 오른쪽 입력 칸과 버튼 */
  #formView.dk-2col { max-width: none; display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); column-gap: 48px; align-items: start; padding: 36px 44px 40px; }
  #formView.dk-2col > .dk-side[hidden] { display: block !important; }
  #formView.dk-2col > .dk-side { grid-column: 1; grid-row: 1 / span 2; position: sticky; top: 96px; }
  #formView.dk-2col > .form-wrap, #formView.dk-2col > .bar { grid-column: 2; }
  #formView.dk-2col .form-t { margin-top: 4px; }
  #formView.dk-2col .step-t { margin-top: 4px; }
  .dk-side .thumb { aspect-ratio: 4 / 3; border-radius: 18px; }
  .dk-side .thumb.is-illust::before { content: none; }
  .dk-side .thumb-img { right: 4%; bottom: -6%; height: 92%; }
  .dk-side .thumb.is-illust .thumb-img { right: auto; bottom: auto; height: 100%; object-position: 50% 45%; }
  .dk-side-name { margin: 20px 0 0; font-size: 28px; font-weight: 800; line-height: 1.3; color: var(--g1000); }
  .dk-side-ask { margin: 6px 0 0; font-size: 18px; color: var(--g800); }
  .dk-side-note { display: inline-block; margin: 16px 0 0; padding: 8px 14px; border-radius: 999px; background: var(--dk-soft); color: var(--dk-cta); font-size: 14px; font-weight: 700; }

  /* 결과 화면 2단: 풀이 그림 머리(.r-banner)가 맨 앞이면 왼쪽에 붙여 두고 오른쪽에 풀이 글 */
  #resultArea { max-width: none; --gutter: 40px; }
  #resultBody > .r-in:has(> .r-banner:first-child) { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); column-gap: 48px; align-items: start; }
  #resultBody > .r-in > .r-banner:first-child { grid-column: 1; grid-row: 1 / span 60; position: sticky; top: 96px; margin: 0; }
  #resultBody > .r-in:has(> .r-banner:first-child) > :not(.r-banner) { grid-column: 2; }
  #resultBody > .r-in:not(:has(> .r-banner:first-child)) { max-width: 720px; margin-left: auto; margin-right: auto; }
}

/* 2026-12-02 손질: 데스크톱 입력 버튼도 입력 화면 보라로, 리포트 머리띠 메뉴(링크)의 밑줄 없앰 */
@media (min-width: 768px) {
  #formGo, #formGo[data-tone] { --f2: #6a32a0; background: linear-gradient(110deg, #8341c0 0%, #8341c0 45%, var(--f2) 100%); }
  a.top-nav-i { text-decoration: none; }
}

/* 2026-12-02: '2027 리포트' 버튼을 해돋이를 바라보는 이음보 캐릭터(호랑이·양·토끼) 그림 버튼으로. 그림은 Codex 업무 계정으로 만듦
   (assets/cta-sunrise-400·800.webp, 4:1). 글자는 그림 왼쪽 하늘 위에 흰 글씨로, 왼쪽을 살짝 어둡게 덮어 읽기 쉽게 한다. */
@media (min-width: 1024px) {
  .top-cta { position: relative; isolation: isolate; overflow: hidden; width: 240px; height: 46px; padding: 0 0 0 18px; border: 1px solid rgba(255, 255, 255, .6); color: #fff; font-weight: 800; letter-spacing: -.01em; text-shadow: 0 1px 3px rgba(40, 20, 60, .65); background: #6a4a8c url("/unse/assets/cta-sunrise-400.webp") right center / cover no-repeat; background-image: -webkit-image-set(url("/unse/assets/cta-sunrise-400.webp") 1x, url("/unse/assets/cta-sunrise-800.webp") 2x); background-image: image-set(url("/unse/assets/cta-sunrise-400.webp") 1x, url("/unse/assets/cta-sunrise-800.webp") 2x); box-shadow: 0 6px 18px rgba(131, 65, 192, .28); transition: background-position .6s ease, box-shadow .25s ease, transform .15s ease; }
  .top-cta::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(70, 40, 110, .55) 0%, rgba(70, 40, 110, .25) 45%, rgba(70, 40, 110, 0) 70%); }
  .top-cta:hover { background-color: #6a4a8c; background-position: 70% center; box-shadow: 0 8px 22px rgba(131, 65, 192, .38); }
  .top-cta:active { transform: scale(.97); }
  .top-cta:focus-visible { outline: 0; box-shadow: var(--focus-ring), 0 6px 18px rgba(131, 65, 192, .28); }
}
@media (min-width: 1024px) and (prefers-reduced-motion: reduce) { .top-cta { transition: none; } }
