/* 레이아웃 정리 (2026-11): 차트를 크게, 화면 순서를 단순하게. 다른 CSS 뒤에 불러와 덮어쓴다. */
@media (min-width:901px){
  .analysis-layout{grid-template-columns:minmax(0,1fr) 360px!important}
  .wheel-card{grid-template-columns:minmax(0,1fr) 196px!important;grid-template-rows:auto auto auto auto!important;
    grid-template-areas:"head head" "wheel ref" "tabs tabs" "cap cap"!important;align-items:start}
  .wheel-card>svg.astro-wheel{width:100%!important;max-width:880px!important;min-width:0!important;height:auto!important;aspect-ratio:1;justify-self:center;align-self:start}
  .wheel-card>.wheel-reference{align-self:start;position:sticky;top:12px}
  .charts.split .wheel-card{grid-template-columns:1fr!important;grid-template-areas:"head" "wheel" "tabs" "cap" "ref"!important}
}
/* 위쪽 버튼과 겹치는 '트랜짓 켜기' 버튼은 숨김 (트랜짓은 차트 위 도구줄에서 켠다) */
html body .transit-stage:not(.transit-active) .transit-control-slot{display:none!important}
.wheel-card>.wheel-caption{margin:6px 0 2px!important;text-align:center}
/* 오른쪽 패널: 아무것도 고르지 않았을 때는 짧은 안내만 */
.inspector:not(.is-open) #close-panel{display:none}
.inspector:not(.is-open) .panel-empty{padding:14px 6px 10px!important;min-height:0!important}
.inspector:not(.is-open) .panel-empty span{font-size:22px!important;margin-bottom:4px!important}
.inspector:not(.is-open) .panel-empty h2{font-size:18px!important;margin:4px 0 6px!important}
.inspector:not(.is-open) .panel-empty p{font-size:13.5px!important;margin:0 0 4px!important}
/* 행성 버튼 줄: 차트 바로 아래에 붙여서 */
.planet-dock{padding-top:4px!important;padding-bottom:10px!important}
/* 제목줄과 '살펴볼 주제'를 한 줄로: 차트가 화면 위로 올라오게 */
@media (min-width:1101px){
  .analysis-main{display:grid!important;grid-template-columns:minmax(0,1fr) auto;column-gap:16px;align-items:center}
  .analysis-main>*{grid-column:1/-1}
  .analysis-main>.workspace-heading{grid-column:1;margin-bottom:10px!important;padding-bottom:0!important}
  .analysis-main>.analysis-toolbar{grid-column:2;grid-row:1;margin:0 0 10px!important;border:0!important;background:transparent!important;padding:0!important;gap:10px!important}
  .analysis-toolbar #topic-hint{display:none}
  .workspace-heading{display:flex!important;align-items:center;gap:16px}
  .workspace-heading>div:first-child{display:flex;align-items:baseline;gap:14px;flex-wrap:wrap;min-width:0}
  .workspace-heading h1{margin:0!important}
  .workspace-heading .mode-switch{margin-left:auto}
}
/* 한 장만 볼 때 차트 위 'D1 라시' 제목은 탭과 겹치므로 작게 한 줄로 */
.charts:not(.split) .wheel-card>.wheel-heading h2{display:none}
.charts:not(.split) .wheel-card>.wheel-heading{min-height:0!important;padding:0!important;margin:0!important;justify-content:flex-end}
@media (min-width:901px){
  .charts:not(.split) .wheel-card>svg.astro-wheel{max-width:min(880px,max(620px,calc(100dvh - 205px)))!important}
}
.inspector:not(.is-open) .inspector-top{display:none!important}
.transit-filter-bar[hidden],[hidden].transit-filter-bar{display:none!important}
/* 모바일: 차트를 화면 폭 가득, 도구 버튼은 한 줄 가로 스크롤 */
@media (max-width:900px){
  .wheel-card>svg.astro-wheel{width:calc(100% + 28px)!important;max-width:none!important;margin:0 -14px!important;background-size:100%!important}
  .chart-controls{flex-wrap:wrap;gap:8px!important}
  .chart-tools{flex-wrap:nowrap!important;overflow-x:auto;scrollbar-width:none;max-width:100%;padding-bottom:2px}
  .chart-tools::-webkit-scrollbar{display:none}
  .chart-tools button{flex:none;white-space:nowrap}
  .analysis-toolbar #topic-hint{display:none}
  #chart-meta{font-size:12.5px!important}
}
.charts.split{align-items:start!important}.charts.split .wheel-card{align-content:start!important}.charts.split .wheel-card>svg.astro-wheel{max-width:100%!important}
/* 행성 디그니티: 요가 차트처럼 아이콘 위에 한 줄, 좋음은 초록 · 나쁨은 빨강 */
.charts svg .dignity-label{font:700 15px var(--font-body,'SUIT',sans-serif)!important;letter-spacing:-.01em;text-anchor:middle;dominant-baseline:central;paint-order:stroke;stroke:#0b1026!important;stroke-width:3.5px!important;stroke-linejoin:round;fill:#c9d0ea!important}
.charts svg .dignity-label.dl-exalted,.charts svg .dignity-label.dl-mula,.charts svg .dignity-label.dl-own{fill:#8fe3b0!important}
.charts svg .dignity-label.dl-debilitated,.charts svg .dignity-label.dl-enemy{fill:#ff9a8f!important}
.charts svg .wheel-degree{font-weight:600!important;fill:#e6e9f7!important;stroke:#0b1026!important;stroke-width:3.5px!important}

/* ---------- 로고 ---------- */
.brand-logo{width:44px;height:44px;border-radius:50%;display:block;flex:none;box-shadow:0 0 0 1px rgba(233,196,106,.45),0 0 18px rgba(233,196,106,.25)}
.brand .brand-mark{display:none}
@media (max-width:520px){.brand-logo{width:38px;height:38px}}

/* ---------- 시작 화면: 요가 확인 사이트와 같은 구성 ---------- */
#empty.empty{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,520px);gap:48px;align-items:start!important;justify-content:stretch!important;text-align:left!important;
  min-height:calc(100dvh - 140px)!important;padding:4vh 2vw 0!important;background:url("./img/meditate.webp") left -2% bottom/auto 68% no-repeat!important}
#empty[hidden]{display:none!important}
#empty .landing-copy{padding-top:4vh;text-shadow:0 2px 18px rgba(11,16,38,.9)}
#empty .landing-copy h2{font-size:clamp(28px,3.3vw,42px)!important;line-height:1.38!important;margin:0 0 16px!important}
#empty .landing-copy p{font-size:17px!important;max-width:34em;margin:0;color:var(--star-2,#c9d0ea)!important}
#empty .landing-form{margin-top:2vh}
.landing-actions{display:flex;gap:10px;margin-top:12px}
.landing-actions .secondary{flex:1;padding:13px 18px!important;border-radius:999px!important;font-size:16px!important}

/* 화면에 펼친 입력칸 */
#birth-form.inline-birth{display:grid;grid-template-columns:1fr 1fr;gap:14px 16px;background:rgba(17,26,58,.86);backdrop-filter:blur(6px);border:1px solid var(--edge,rgba(150,170,255,.22));border-radius:20px;padding:24px 26px}
#birth-form.inline-birth>*{grid-column:1/-1;margin:0!important}
#birth-form.inline-birth>label:nth-of-type(2),#birth-form.inline-birth>label:nth-of-type(3),
#birth-form.inline-birth>label:nth-of-type(4),#birth-form.inline-birth>label:nth-of-type(5){grid-column:auto}
#birth-form.inline-birth label{display:flex;flex-direction:column;gap:6px;font-size:14px}
#birth-form.inline-birth input,#birth-form.inline-birth select{width:100%;min-height:46px;border-radius:12px!important;font-size:16px}
#birth-form.inline-birth .section-heading{display:flex;align-items:baseline;justify-content:space-between}
#birth-form.inline-birth .section-heading h2{font-size:20px!important;margin:0!important}
#birth-form.inline-birth #submit{min-height:52px;border-radius:999px!important;font-size:17px}
#birth-form.inline-birth #status:empty,#birth-form.inline-birth #status{font-size:13px}

@media (max-width:980px){
  #empty.empty{grid-template-columns:1fr;gap:20px;padding:360px 4px 30px!important;background:url("./img/meditate-m.webp") center 0/350px no-repeat!important;text-align:left!important}
  #empty .landing-copy{padding-top:0}
}
@media (max-width:520px){
  #birth-form.inline-birth{grid-template-columns:1fr;padding:20px}
  #birth-form.inline-birth>label{grid-column:1/-1!important}
}
#empty>.landing-copy,#empty>.landing-form{display:block!important;margin-top:0!important}
#empty>.landing-form{margin-top:2vh!important}
#empty .landing-actions{display:flex!important}
#birth-form.inline-birth>label:first-of-type{display:block}
#birth-form.inline-birth>label:first-of-type input{display:block;margin-top:6px}
#birth-form.inline-birth .help{display:none}
#birth-form.inline-birth label small{font-size:12px;line-height:1.45}
#birth-form.inline-birth .two-inputs{display:grid;grid-template-columns:1fr 1fr;gap:16px}
#birth-form.inline-birth #time-hint{font-size:13px}

/* ---------- 차트 더 크게 (2026-11-17 2차) ---------- */
/* 카라카 목록을 차트 옆에서 아래로 내려 차트가 칸 너비를 다 쓰게 */
@media (min-width:901px){
  .charts:not(.split) .wheel-card{grid-template-columns:minmax(0,1fr)!important;grid-template-areas:"head" "wheel" "tabs" "cap" "ref"!important}
  .charts:not(.split) .wheel-card>svg.astro-wheel{max-width:min(100%,1000px)!important}
  .charts:not(.split) .wheel-card>.wheel-reference{position:static;width:100%}
  .charts:not(.split) .wheel-reference .karaka-strip{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;overflow:visible!important}
  .charts:not(.split) .wheel-reference .karaka-item{border-right:0!important;border-bottom:1px solid var(--edge,rgba(150,170,255,.18))}
  .analysis-layout{grid-template-columns:minmax(0,1fr) 340px!important}
}
/* 고른 행성 확대는 부드럽게 */
.wheel-planet .planet-marker{transition:transform .18s ease}
@media (prefers-reduced-motion:reduce){.wheel-planet .planet-marker{transition:none}}

/* ---------- 다샤: 가로 띠 대신 세로 세 칸 (MD › AD › PD) ---------- */
#dasha-expanded{display:none!important}
.dv-head{display:flex;align-items:center;gap:12px;margin-bottom:10px}
.dv-head b{font-size:16px}
.dv-path{color:var(--star-2,#c9d0ea);font-size:14px}
.dv-head button{margin-left:auto;border:1px solid var(--edge-2,rgba(150,170,255,.35));background:transparent;color:inherit;border-radius:999px;padding:6px 14px;font-size:13px}
.dv-cols{display:grid;grid-template-columns:1.1fr 1fr 1fr;gap:10px}
.dv-cols section{min-width:0;border:1px solid var(--edge,rgba(150,170,255,.18));border-radius:12px;background:rgba(10,16,40,.55);padding:8px}
.dv-cols h3{font-size:12.5px!important;font-weight:600!important;color:var(--star-3,#9aa3c7);margin:2px 6px 6px!important;font-family:var(--font-body)!important}
.dv-list{display:grid;gap:3px;max-height:340px;overflow:auto;scrollbar-width:thin}
.dv-row{position:relative;display:grid;grid-template-columns:auto 1fr;align-items:baseline;column-gap:8px;text-align:left;width:100%;border:1px solid transparent;background:transparent;color:inherit;border-radius:9px;padding:7px 9px;overflow:hidden}
.dv-row:hover{background:rgba(255,255,255,.05)}
.dv-row .dv-lord{font-weight:700;font-size:14px;white-space:nowrap}
.dv-row .dv-when{font-size:12.5px;color:var(--star-2,#c9d0ea);text-align:right;font-variant-numeric:tabular-nums}
.dv-row small{grid-column:1/-1;font-size:11.5px;color:var(--star-3,#9aa3c7)}
.dv-row.on{background:rgba(240,244,255,.95);color:#101733;border-color:transparent}
.dv-row.on .dv-when,.dv-row.on small{color:#2a3350}
.dv-row.live:not(.on){border-color:rgba(233,196,106,.55)}
.dv-now{position:absolute;top:7px;right:9px;font-style:normal;font-size:10.5px;font-weight:700;color:#e9c46a;display:none}
.dv-bar{position:absolute;left:0;bottom:0;height:2px;width:var(--p);background:#e9c46a}
.dv-empty{font-size:13px;color:var(--star-3,#9aa3c7);margin:10px 6px}
@media (max-width:760px){.dv-cols{grid-template-columns:1fr}.dv-list{max-height:260px}}

/* ---------- '더 보기' 메뉴가 다른 칸 뒤로 숨던 문제 ---------- */
.more-menu{position:relative;z-index:60}
.more-menu .more-list{z-index:61!important;background:#141c44!important;opacity:1!important;box-shadow:0 18px 40px rgba(0,0,0,.55)!important}
body>header{position:relative;z-index:50}

/* ---------- 샷발라: 행성별 막대 (기준치 표시) ---------- */
.bala-chart{display:grid;gap:9px;margin:4px 0 14px}
.bala-row{display:grid;grid-template-columns:96px minmax(0,1fr) 170px;align-items:center;gap:12px}
.bala-track{position:relative;height:22px;border-radius:6px;background:rgba(255,255,255,.05);overflow:visible}
.bala-track i{position:absolute;top:0;bottom:0;display:block}
.bala-track i:first-child{border-radius:6px 0 0 6px}
.bala-neg{background:repeating-linear-gradient(135deg,rgba(255,107,94,.85) 0 4px,rgba(11,16,38,.9) 4px 8px)!important}
.bala-total{position:absolute;top:-3px;bottom:-3px;width:2px;background:#fff;transform:translateX(-1px)}
.bala-need{position:absolute;top:-6px;bottom:-6px;width:0;border-left:2px dashed #e9c46a;transform:translateX(-1px)}
.bala-val{font-size:13px;color:var(--star-2,#c9d0ea);font-variant-numeric:tabular-nums}
.bala-val b{font-size:16px;color:#fff}
.bala-val small{display:block;font-size:11.5px}
.bala-val.ok small{color:#8fe3b0}.bala-val.low small{color:#ff9a8f}
.bala-legend{display:flex;flex-wrap:wrap;gap:6px 14px;font-size:12px;color:var(--star-3,#9aa3c7);margin-top:4px}
.bala-legend i{display:inline-block;width:12px;height:10px;border-radius:2px;margin-right:5px;vertical-align:-1px}
.bala-legend .lg-neg{background:repeating-linear-gradient(135deg,rgba(255,107,94,.85) 0 3px,rgba(11,16,38,.9) 3px 6px)}
.bala-legend .lg-need{width:0;height:12px;border-left:2px dashed #e9c46a;border-radius:0}
.strength-table>summary{margin:6px 0 8px;font-weight:600}
@media (max-width:640px){.bala-row{grid-template-columns:72px minmax(0,1fr);}.bala-val{grid-column:2}}

/* ---------- 오른쪽 상세창: 요약 카드 + 탭 ---------- */
.wheel-card>.chart-core-tabs{display:none!important}
.chart-core-content button{display:none}
.pv-head{display:flex;align-items:center;gap:12px;margin:2px 0 12px}
.pv-sym{font-size:30px;line-height:1;width:46px;height:46px;border-radius:50%;display:grid;place-items:center;background:rgba(240,244,255,.08);border:1px solid var(--edge,rgba(150,170,255,.25))}
.pv-head h2{margin:0!important;font-size:24px!important}
.pv-head small{color:var(--star-3,#9aa3c7);font-size:12.5px}
.pv-sum{display:grid;grid-template-columns:auto 1fr;gap:9px 14px;margin:0 0 14px;padding:14px 14px;border-radius:14px;background:rgba(240,244,255,.05);border:1px solid var(--edge,rgba(150,170,255,.18));font-size:14px}
.pv-sum dt{color:var(--star-3,#9aa3c7);font-size:12.5px;padding-top:2px;white-space:nowrap}
.pv-sum dd{margin:0;display:flex;flex-wrap:wrap;gap:5px;align-items:center;line-height:1.5}
.pv-dig{font-weight:700;padding:1px 9px;border-radius:999px;background:rgba(201,208,234,.12);color:#c9d0ea;font-size:13px}
.pv-dig.dl-exalted,.pv-dig.dl-mula,.pv-dig.dl-own{background:rgba(143,227,176,.14);color:#8fe3b0}
.pv-dig.dl-debilitated,.pv-dig.dl-enemy{background:rgba(255,154,143,.14);color:#ff9a8f}
.pv-flag{font-size:12px;padding:1px 8px;border-radius:999px;border:1px solid var(--edge-2,rgba(150,170,255,.35))}
.pv-flag.soft{opacity:.65}
.pv-tabs{display:grid;grid-template-columns:repeat(4,1fr);gap:4px;padding:4px;border-radius:12px;background:rgba(255,255,255,.05);margin-bottom:12px;position:sticky;top:0;z-index:2;backdrop-filter:blur(6px)}
.pv-tabs button{border:0;background:transparent;color:var(--star-2,#c9d0ea);border-radius:9px;padding:8px 4px;font-size:13.5px;font-weight:600}
.pv-tabs button[aria-selected="true"]{background:rgba(240,244,255,.95);color:#101733}
.pv-pane details{border-top:1px solid var(--edge,rgba(150,170,255,.16));padding:10px 0}
.pv-pane>details:first-child{border-top:0;padding-top:0}
.pv-h{font-size:15px!important;margin:0 0 8px!important}
.pv-pane .dignity-investigation>.state-pills{display:none}
