/* 대사주 — 옛 daesaju.com 리뉴얼 크롬. 웹폰트·외부 URL 없음. */
:root {
  --bar: #000000;
  --ink: #222222;
  --sub: #666666;
  --line: #CCCCCC;
  --pill: #EEEEEE;
  --blue: #1E6FD9;
  --orange: #C2410C;
  --orange-deco: #E8641B;
  --c-fortune: #555555;
  --c-saju: #5BB8E8;
  --c-gunghap: #FF6FAE;
  --c-name: #7CC35A;
  --c-today: #FF9A3C;
  --c-sinnyeon: #FFC000;
  --band: var(--c-fortune);
  --band-ink: #FFFFFF;
}
.p-saju { --band: var(--c-saju); --band-ink: #000000; }
.p-gunghap { --band: var(--c-gunghap); --band-ink: #000000; }
.p-name, .p-korea-name { --band: var(--c-name); --band-ink: #000000; }
.p-today { --band: var(--c-today); --band-ink: #000000; }
.p-sinnyeon { --band: var(--c-sinnyeon); --band-ink: #000000; }

[hidden] { display: none !important; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; } /* 스크롤바 자리를 늘 잡아 둔다 — 짧은 페이지로 옮길 때 가운데 칼럼이 옆으로 튀지 않게 */
body { margin: 0; background: #FFFFFF; color: var(--ink); font: 13px/1.6 "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; }
a { color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; z-index: 10; padding: 4px 8px; background: #FFFFFF; }
.wrap { max-width: 640px; margin: 0 auto; }

/* 상단 검은 바 */
/* 로고 SVG 는 금색 고정이라, 고대비 모드에서도 바를 검정/흰색 그대로 둔다(로고가 흰 배경에 묻히지 않게) */
.bar { display: flex; align-items: center; padding: 0 12px; background: var(--bar); color: #FFFFFF; forced-color-adjust: none; }
.logo { flex: none; margin: 0; }
.logo a, .logo img { display: block; }
/* 빈 ::before 를 첫 칸으로 두어, 로고-첫 메뉴 간격도 메뉴끼리 간격과 같게 나눈다 */
.nav { display: flex; flex: 1; justify-content: space-between; gap: 12px; overflow-x: auto; scrollbar-width: none; }
.nav::before { content: ""; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 12px 0; color: #FFFFFF; font-weight: 700; line-height: 20px; text-decoration: none; white-space: nowrap; }
.nav a:hover { text-decoration: underline; }
.nav a:focus-visible { outline-offset: -2px; } /* .nav 의 overflow 에 잘리지 않게 안쪽으로 */
.nav a[aria-current="page"] { color: var(--c-sinnyeon); }
.intro { margin: 4px 2px 10px; color: var(--sub); font-size: 12px; line-height: 1.5; }

/* 메인 폼 박스 */
.box { display: grid; grid-template-columns: 1fr 96px; gap: 6px 12px; align-items: center; margin: 0 0 10px; padding: 8px 12px 12px; border: 3px dashed var(--line); }
.box-title { grid-column: 1 / -1; margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -1px; }
.box-title em { color: var(--blue); font-style: normal; }
.big-btn { width: 96px; height: 96px; padding: 0 12px; border: 1px solid #AAAAAA; border-radius: 10px; background: linear-gradient(#F6F6F6, #D2D2D2); color: #333333; font-family: inherit; font-size: 16px; font-weight: 700; line-height: 1.35; word-break: keep-all; cursor: pointer; }
.big-btn:disabled, .small-btn:disabled { opacity: .6; cursor: wait; }

/* 입력 표 (메인·세부 공통) */
.fields { width: 100%; border-collapse: collapse; }
.fields th { width: 76px; padding: 5px 6px; font-weight: 700; text-align: left; white-space: nowrap; vertical-align: top; }
.fields td { padding: 4px 6px; }
.fields .who th { padding-top: 10px; color: var(--orange); }
.fields select, .fields input[type="text"] { height: 26px; margin: 0 2px 2px 0; padding: 0 2px; border: 1px solid #999999; border-radius: 0; background: #FFFFFF; color: var(--ink); font-family: inherit; font-size: 12px; }
.fields input[type="text"] { width: 120px; padding: 0 6px; }
.fields .leap { font-size: 12px; white-space: nowrap; }
.hint { margin: 2px 0 0; color: var(--sub); font-size: 11px; }

/* 세부 페이지: 서브메뉴 · 탭 · 입력 패널 */
.submenu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 10px; margin: 10px 0 12px; }
.submenu a { display: block; padding: 4px 0; border-radius: 12px; background: var(--pill); color: #333333; font-size: 12px; text-align: center; text-decoration: none; }
.submenu a[aria-current="page"] { background: var(--band); color: var(--band-ink); font-weight: 700; }
.tab { display: inline-block; margin: 0; padding: 4px 14px 3px; border-radius: 10px 10px 0 0; background: var(--band); color: var(--band-ink); font-size: 13px; font-weight: 700; }
.tab::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 6px; border: 2px solid var(--orange-deco); border-radius: 50%; background: #FFFFFF; vertical-align: -1px; }
.desc { margin: 0 0 10px; padding: 6px 2px 0; border-top: 2px solid var(--band); line-height: 1.6; }
.panel { margin: 0 0 10px; border: 1px solid var(--line); }
.panel-head { margin: 0; padding: 5px; background: var(--band); color: var(--band-ink); font-size: 13px; font-weight: 700; text-align: center; }
.panel .fields { margin: 6px 0 0; }
.small-btn { display: block; min-height: 28px; margin: 8px auto 10px; padding: 3px 18px; border: 1px solid #AAAAAA; border-radius: 4px; background: linear-gradient(#FAFAFA, #DEDEDE); color: #333333; font-family: inherit; font-size: 12px; cursor: pointer; }

/* 메인: 타일 · 테마별 운세 · 무료운세 서비스 */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 14px; padding: 6px; background: #E6E6E6; }
.tile { display: flex; flex-direction: column; padding: 6px 6px 0; border: 1px solid #FFFFFF; color: #333333; text-align: center; text-decoration: none; background-image: radial-gradient(rgba(0, 0, 0, .05) 1px, transparent 1px); background-size: 7px 7px; }
.tile small { color: #555555; font-size: 11px; }
.tile b { margin: 0 0 4px; font-size: 15px; letter-spacing: 6px; }
.tile img { display: block; width: 100%; height: auto; margin-top: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.t-saju { background-color: #FFF4BF; }
.t-name { background-color: #DDF3C8; }
.t-gunghap { background-color: #FFD9E6; }
.sec-h { margin: 16px 0 10px; padding-left: 6px; border-left: 3px solid #555555; font-size: 12px; font-weight: 700; }
.themes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 10px; margin: 0; padding: 0; list-style: none; }
.themes a { display: flex; gap: 10px; align-items: center; text-decoration: none; }
.themes img { flex: none; width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }
.themes span { color: var(--sub); line-height: 1.5; }
.themes b { display: block; color: var(--orange); font-size: 16px; }
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.svc { display: block; border: 1px solid var(--line); font-size: 12px; text-align: center; text-decoration: none; }
form.svc { display: flex; flex-direction: column; }
form.svc > div { margin: auto 0; } /* 옆 칸 높이에 맞춰 늘어난 칸에서 입력부를 상하 중앙에 */
.svc .svc-h { display: block; margin: 0; padding: 3px; background: var(--orange-deco); color: #000000; font-size: 12px; font-weight: 700; }
.svc select { height: 22px; margin: 6px 1px 0; font-size: 11px; }
.svc img { display: block; width: 72px; height: 72px; margin: 8px auto 4px; border-radius: 50%; }
.svc span { display: block; padding: 0 4px 8px; color: var(--sub); }

/* 결과 */
.form-error { margin: 8px 0; padding: 8px 10px; border: 1px solid #D00000; color: #B00000; }
.empty { margin: 8px 0; color: var(--sub); font-size: 12px; }
.wait p { margin: 10px 0 4px; }
.track { height: 12px; overflow: hidden; border: 1px solid #999999; background: #FFFFFF; }
.fill { width: 100%; height: 100%; background: repeating-linear-gradient(45deg, var(--band) 0 10px, #FFFFFF 10px 20px); background-size: 28px 28px; animation: stripe 1s linear infinite; }
@keyframes stripe { to { background-position: 28px 0; } }
.result { margin: 0 0 12px; }
.widget-head { margin: 14px 0 6px; font-size: 13px; font-weight: 700; }
.chart { width: 100%; margin: 10px 0 6px; border-collapse: collapse; text-align: center; }
.chart caption { padding: 0 0 4px; font-weight: 700; text-align: left; }
.chart th, .chart td { padding: 4px; border: 1px solid var(--line); }
.chart thead th { background: var(--band); color: var(--band-ink); }
.chart .han { font-size: 22px; line-height: 1.2; }
.chart .han small { display: block; color: var(--sub); font-size: 12px; }
.chart .unknown { color: var(--sub); }
.me-badge { display: block; color: var(--orange); font-size: 11px; font-style: normal; }
.ohang-line { display: flex; justify-content: space-between; gap: 8px; margin: 4px 0 6px; font-weight: 700; }
.ohang-line small { color: var(--sub); font-size: 12px; font-weight: 400; }
/* 오방색 기반. --el 채움, --el-ink 채움 위 글자 */
.e-wood { --el: #2F7D46; --el-ink: #FFFFFF; }
.e-fire { --el: #CC3B28; --el-ink: #FFFFFF; }
.e-earth { --el: #D9A406; --el-ink: #222222; }
.e-metal { --el: #A3ABB3; --el-ink: #222222; }
.e-water { --el: #26446E; --el-ink: #FFFFFF; }
.ohang-bar { display: flex; height: 26px; border: 1px solid #999999; }
.ohang-bar span { display: flex; align-items: center; justify-content: center; min-width: 0; overflow: hidden; background: var(--el); color: var(--el-ink); font-size: 12px; font-weight: 700; white-space: nowrap; }
.ohang-bar span + span { border-left: 1px solid #FFFFFF; }
.ohang-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 8px; padding: 0; list-style: none; font-size: 12px; }
.ohang-legend li::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 4px; background: var(--el); vertical-align: -1px; }
.ohang-legend .zero { color: var(--sub); }
.ohang-legend .zero::before { border: 1px dashed #999999; background: none; }
.daewoon .grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.daewoon .grid div { display: flex; flex-direction: column; align-items: center; padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.daewoon .grid .now { background: #FFF4BF; }
.daewoon .han { font-size: 18px; }
.noon { color: var(--sub); font-size: 12px; }
.pair, .sewoon, .today-card, .name-ohang, .name-card { margin: 10px 0; padding: 8px 10px; border: 1px solid var(--line); }
.pair .vs { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: center; }
.pair .day { display: block; font-size: 24px; }
.pair .day small { display: block; color: var(--sub); font-size: 11px; }
.pair .ar { display: flex; flex-direction: column; font-size: 12px; }
.pair .ar b { margin-left: 4px; }
.sub { margin: 8px 0 4px; font-size: 12px; font-weight: 700; }
.ohang-vs .ob { display: grid; grid-template-columns: 24px 1fr 28px 1fr 24px; gap: 4px; align-items: center; font-size: 12px; }
.ohang-vs .tr { height: 8px; background: var(--pill); }
.ohang-vs .tr.l { transform: scaleX(-1); }
.ohang-vs .f { display: block; height: 100%; background: #888888; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-block; padding: 1px 8px; border: 1px solid #999999; border-radius: 10px; font-size: 12px; }
.chip.good { border-color: #3C8D2F; background: #E6F4DF; }
.chip.bad { border-color: #C0306A; background: #FCE3EE; }
.sew-big { margin: 0; font-size: 28px; }
.sew-cap { color: var(--sub); font-size: 11px; }
.name-ohang table { width: 100%; border-collapse: collapse; text-align: center; }
.name-ohang th, .name-ohang td { padding: 4px; border: 1px solid var(--line); }
.name-ohang thead th { background: var(--band); color: var(--band-ink); }
/* 한자이름풀이 — 입력 타일 · 고르기 시트 · 이름 카드 */
.picker { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.picker:empty { display: none; }
.pick-tile { display: flex; flex-direction: column; align-items: center; width: 72px; padding: 6px 2px; border: 1px solid #999999; border-radius: 6px; background: #FFFFFF; color: var(--ink); font-family: inherit; cursor: pointer; }
.pick-tile b { font-size: 26px; line-height: 1.2; }
.pick-tile span { color: var(--sub); font-size: 11px; }
.pick-tile.none { border-style: dashed; }
.pick-tile.none b { color: var(--sub); font-weight: 400; }
.hsheet { width: 100%; max-width: 480px; max-height: 80vh; margin: auto auto 0; padding: 12px 16px 20px; border: 0; border-radius: 12px 12px 0 0; overflow: auto; }
.hsheet::backdrop { background: rgba(0, 0, 0, .45); }
.hsheet h2 { margin: 0 0 10px; font-size: 15px; }
.hs-q { width: 100%; height: 30px; margin: 0 0 8px; padding: 0 8px; border: 1px solid #999999; font-family: inherit; font-size: 13px; }
.hs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.hs-tile { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border: 1px solid var(--line); border-radius: 6px; background: #FFFFFF; color: var(--ink); font-family: inherit; cursor: pointer; }
.hs-tile b { font-size: 26px; line-height: 1.25; }
.hs-tile span { font-size: 12px; }
.hs-tile small { color: var(--sub); font-size: 11px; }
.hs-tile[aria-pressed="true"] { border: 2px solid var(--orange); }
.hs-extra { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.hs-text { padding: 6px 12px; border: 1px solid #AAAAAA; border-radius: 4px; background: #F6F6F6; color: #333333; font-family: inherit; font-size: 12px; cursor: pointer; }
/* 한자 / 한글 이름풀이 전환 — 탭 바로 위, 지금 페이지는 띠색 테두리 */
.name-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.name-switch a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #FFFFFF; color: var(--ink); text-decoration: none; }
.name-switch a:hover { border-color: #999999; }
.name-switch b { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 4px; background: var(--pill); font-size: 20px; line-height: 1; }
.name-switch span { display: flex; flex-direction: column; min-width: 0; font-size: 13px; font-weight: 700; line-height: 1.35; }
.name-switch small { color: var(--sub); font-size: 11px; font-weight: 400; }
.name-switch a[aria-current="page"] { border: 2px solid var(--band); padding: 7px 9px; background: #F3FAEE; }
.name-switch a[aria-current="page"] b { background: var(--band); color: var(--band-ink); }
.nc-full { margin: 0 0 6px; font-size: 13px; }
.nc-full b { font-size: 22px; }
.nc-chars { display: flex; flex-wrap: wrap; gap: 6px; }
.nc-char { display: flex; flex-direction: column; align-items: center; min-width: 76px; padding: 6px; border: 1px solid var(--line); font-size: 12px; }
.nc-char .han { font-size: 26px; line-height: 1.2; }
.nc-char .han { border-bottom: 3px solid var(--el, transparent); } /* 흙·쇠 색은 흰 바탕 글자로 대비가 모자라 밑줄로만 */
.nc-line .han { padding: 0 5px; background: var(--el, var(--pill)); color: var(--el-ink, var(--ink)); font-weight: 700; }
.suri { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.grid-item { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border: 1px solid var(--line); text-align: center; font-size: 12px; }
.grid-item em { font-style: normal; font-weight: 700; }
.grid-item b { font-size: 18px; }
.grid-item small { color: var(--sub); font-size: 11px; line-height: 1.4; }
.grid-item.good { border-color: #3C8D2F; background: #E6F4DF; }
.grid-item.bad { border-color: #C0306A; background: #FCE3EE; }
.nc-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 8px 0 0; }
.nc-line em { min-width: 64px; font-style: normal; font-weight: 700; }
.nc-line .fk { color: var(--sub); font-size: 11px; }
.nc-note { margin: 8px 0 0; color: var(--orange); }
.today-card .t-big { margin: 0; font-size: 20px; font-weight: 700; }
.read h2 { margin: 16px 0 6px; padding-left: 8px; border-left: 4px solid var(--band); font-size: 14px; }
.read p { margin: 0 0 8px; line-height: 1.8; }

/* 하단 */
.about { margin: 20px 0 10px; padding: 10px 12px; border: 1px solid var(--line); background: #FAFAFA; color: #444444; }
.about h2 { margin: 0 0 6px; font-size: 13px; }
.about h3 { margin: 12px 0 4px; font-size: 12px; }
.about p { margin: 0 0 6px; font-size: 12px; line-height: 1.7; }
.foot { margin: 10px 0 20px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--sub); font-size: 12px; text-align: center; }

@media (max-width: 660px) {
  .wrap { padding: 0 8px; }
  .bar { margin: 0 -8px; }
  .box { grid-template-columns: 1fr; }
  .big-btn { width: 100%; height: 48px; }
  .fields th, .fields td { display: block; width: auto; }
  .fields th { padding-bottom: 0; }
  .submenu { grid-template-columns: repeat(2, 1fr); }
  .themes, .services { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  /* 두 줄: 윗줄 로고 44px, 아랫줄 메뉴 34px 를 바 끝에서 끝까지 */
  .bar { flex-wrap: wrap; }
  .logo { padding: 10px 0 9px; }
  .nav { flex-basis: calc(100% + 24px); gap: 4px; margin: 0 -12px; padding: 0 12px; border-top: 1px solid #262626; }
  .nav::before { content: none; }
  .nav a { padding: 7px 0; font-size: 12px; }
  .tiles { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .fill { animation: none; }
}
