:root {
  --ink: #2a211c; --sub: #6b5b50; --red: #a0281e; --red2: #c2402f; --paper: #faf4e8; --card: #fffdf8; --line: #e6dccb; --gold: #b8892e;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --ink: #f2e9dc; --sub: #c9b8a6; --paper: #1d1714; --card: #27201b; --line: #3d332b; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Pretendard", system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; line-height: 1.6; }
a { color: var(--red); }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
header.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; gap: 10px; height: 56px; }
header.top img { width: 34px; height: 34px; border-radius: 8px; }
header.top b { font-size: 17px; flex: 1; }
header.top a.btn { padding: 8px 14px; font-size: 14px; }
.hero { text-align: center; padding: 36px 0 20px; }
.hero h1 { font-size: clamp(26px, 6.4vw, 40px); line-height: 1.25; margin: 10px 0; letter-spacing: -0.5px; }
.hero h1 em { font-style: normal; color: var(--red); }
.hero p { color: var(--sub); margin: 0 auto; max-width: 560px; }
.hero .seal { width: 92px; height: 92px; }
.btn { display: inline-block; background: var(--red); color: #fff; text-decoration: none; border: 0; border-radius: 12px; padding: 14px 22px; font-size: 16px; font-weight: 700; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--red); border: 1.5px solid var(--red); }
.btn:disabled { background: #9a8f86; cursor: not-allowed; }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
section { padding: 26px 0; border-top: 1px solid var(--line); }
section h2 { font-size: 22px; margin: 0 0 6px; }
section .lead { color: var(--sub); margin: 0 0 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.mat { background: var(--card); border: 2px solid var(--line); border-radius: 16px; overflow: hidden; cursor: pointer; text-align: left; padding: 0; color: inherit; font: inherit; }
.mat.on { border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 20%, transparent); }
.mat img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; background: #eee; }
.mat .t { padding: 8px 10px 10px; }
.mat .t b { display: block; font-size: 15px; }
.mat .t span { font-size: 12px; color: var(--sub); }
.el { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; color: #fff; margin-right: 4px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.step b { color: var(--red); }
form .f { margin-bottom: 12px; }
label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 4px; }
input, select, textarea { width: 100%; padding: 12px; font-size: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: 12px; color: var(--sub); margin-top: 3px; }
.sum { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 14px 0; }
.sum .p { font-size: 26px; font-weight: 800; color: var(--red); }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.check input { width: auto; margin-top: 4px; }
.err { color: var(--red2); font-weight: 700; min-height: 1.2em; }
.badge { display: inline-block; background: #f3c74c; color: #3a2b00; font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 6px; }
.qr { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.qr canvas, .qr img { width: 150px; height: 150px; background: #fff; padding: 8px; border-radius: 12px; }
details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
details summary { font-weight: 700; cursor: pointer; }
footer { font-size: 12px; color: var(--sub); padding: 24px 0 90px; border-top: 1px solid var(--line); }
.sticky-buy { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--paper) 94%, transparent); border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; justify-content: center; z-index: 20; }
.sticky-buy .btn { flex: 1; max-width: 420px; text-align: center; }
.preview { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.preview canvas { width: 110px; height: 110px; }
@media (max-width: 420px) { .two { grid-template-columns: 1fr; } }

/* ── 사주 철학도장 사이트 추가 스타일 */
header.top b small { font-weight: 500; color: var(--sub); font-size: 13px; margin-left: 4px; }
.hero-seal { width: 120px; height: 120px; object-fit: contain; }
.price-tag { display: inline-flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 8px; margin-top: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 18px; }
.price-tag span { color: var(--sub); font-size: 14px; }
.price-tag b { font-size: 26px; color: var(--red); }
.price-tag small { color: var(--sub); font-size: 13px; }
.note { font-size: 13px; color: var(--sub); }
h3.sub { font-size: 16px; margin: 18px 0 10px; padding-left: 10px; border-left: 4px solid var(--red); }
.palbang { display: grid; grid-template-columns: 170px 1fr; gap: 16px; align-items: center; }
.palbang > img { width: 170px; height: 170px; }
.luck8 { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.luck8 li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 4px; text-align: center; font-weight: 700; font-size: 14px; }
.luck8 li b { display: block; color: var(--red); font-size: 20px; line-height: 1.2; }
.luck8 li span { display: block; color: var(--sub); font-size: 11px; font-weight: 500; }
#matGrid { grid-template-columns: repeat(auto-fill, minmax(min(220px, 44%), 1fr)); gap: 12px; }
.mat-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.mat-card > img { width: 100%; aspect-ratio: 4/5; object-fit: cover; display: block; background: #eee; }
.mat-card .t { padding: 12px 14px 14px; }
.mat-card .t b { font-size: 17px; }
.mat-card .t small { display: block; color: var(--sub); font-size: 12px; }
.mat-card .t p { font-size: 14px; margin: 8px 0; }
.mat-card .case { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--sub); }
.mat-card .case img { width: 14px; height: 44px; object-fit: cover; border-radius: 3px; }
.mat-card .mp { margin-top: 8px; font-weight: 800; color: var(--red); }
.grid.mini { grid-template-columns: repeat(5, 1fr); gap: 8px; }
.grid.mini .mat img { aspect-ratio: 1; }
.grid.mini .mat .t { padding: 6px; font-size: 12px; }
.grid.mini .mat .t b { font-size: 12px; display: inline; }
table.spec { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 14px; overflow: hidden; font-size: 14px; }
table.spec th, table.spec td { border-bottom: 1px solid var(--line); padding: 11px 12px; text-align: left; vertical-align: top; }
table.spec th { width: 110px; color: var(--sub); font-weight: 700; background: color-mix(in srgb, var(--line) 35%, transparent); }
table.spec tr:last-child th, table.spec tr:last-child td { border-bottom: 0; }
.stamps { display: flex; justify-content: space-around; flex-wrap: wrap; gap: 10px; }
.stamps figure { margin: 0; text-align: center; flex: 0 0 auto; }
.stamps img { width: 104px; height: 104px; display: block; margin: 0 auto; }
.stamps figcaption { display: inline-block; margin-top: 6px; border: 1.5px solid var(--gold); border-radius: 99px; padding: 0 12px; font-weight: 800; font-size: 14px; }
.stamps.small img { width: 74px; height: 74px; }
.use { display: grid; grid-template-columns: 160px 1fr; gap: 16px; align-items: center; }
.use img { width: 160px; border-radius: 10px; border: 1px solid var(--line); }
.use ol { margin: 0; padding-left: 20px; }
.use li { margin-bottom: 8px; }
.addr { display: flex; gap: 8px; margin-bottom: 6px; }
.addr input { flex: 1; }
.addr .btn { padding: 10px 14px; font-size: 14px; white-space: nowrap; }
.sum-row { display: flex; justify-content: space-between; padding: 4px 0; }
.sum-row.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; align-items: baseline; }
.check { margin: 8px 0; }
.btn.block { display: block; width: 100%; margin-top: 8px; font-size: 18px; padding: 16px; }
.center { text-align: center; }
.done { background: var(--card); border: 2px solid var(--red); border-radius: 16px; padding: 18px; }
.done h3 { margin: 0 0 6px; color: var(--red); }
footer .links { margin-bottom: 10px; font-size: 13px; }
footer .links a { color: var(--ink); text-decoration: none; }
.seller { display: flex; flex-wrap: wrap; gap: 4px 14px; line-height: 1.7; }
.seller em { font-style: normal; color: var(--ink); font-weight: 700; margin-right: 2px; }
.seller .biz { font-size: 12px; }
.seller .pg { flex-basis: 100%; margin: 6px 0 0; }
.copy { margin-top: 10px; }
.doc h1 { font-size: 26px; margin: 26px 0 6px; }
.doc h2 { font-size: 18px; margin: 22px 0 6px; }
.doc p, .doc li { font-size: 14.5px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--card); }
.doc th, .doc td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
@media (max-width: 560px) {
  .palbang, .use { grid-template-columns: 1fr; justify-items: center; }
  .luck8 { grid-template-columns: repeat(4, 1fr); width: 100%; }
  .grid.mini { grid-template-columns: repeat(3, 1fr); }
  .stamps img { width: 84px; height: 84px; }
  .stamps.small img { width: 64px; height: 64px; }
  table.spec th { width: 84px; }
  .mat-card > img { aspect-ratio: 1; }
  .mat-card .t { padding: 10px; }
  .mat-card .t p { font-size: 13px; }
  .stamps figure { flex-basis: 30%; }
}

.badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.badges span { font-size: 12.5px; font-weight: 700; background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px; }
.policy { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.pol { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.pol h3 { margin: 0 0 8px; font-size: 16px; color: var(--red); }
.pol ul { margin: 0; padding-left: 18px; font-size: 14px; }
.pol li { margin-bottom: 4px; }
.seller .tax { color: var(--red); font-weight: 700; }

.pm { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pm-opt { display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 12px 6px; cursor: pointer; text-align: center; font-weight: 400; margin: 0; }
.pm-opt input { display: none; }
.pm-opt b { font-size: 15px; }
.pm-opt small { font-size: 11.5px; color: var(--sub); }
.pm-opt:has(input:checked) { border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 18%, transparent); }

.refund7 { background: color-mix(in srgb, var(--red) 8%, var(--card)); border: 2px solid var(--red); border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; font-size: 15px; }
.refund7 > b:first-child { display: inline-block; background: var(--red); color: #fff; border-radius: 6px; padding: 1px 8px; margin-right: 6px; font-size: 13px; }

/* ── 상품 목록·상세 */
a.mat-card { display: block; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
a.mat-card:hover { border-color: var(--red); transform: translateY(-2px); }
.mat-card .code, .pd-info .code { display: block; font-size: 11.5px; color: var(--sub); letter-spacing: .02em; }
.mat-card .mp small { font-weight: 500; color: var(--sub); font-size: 12px; }
.mat-card .more { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--red); }
h2 .cnt { font-size: 14px; color: var(--red); margin-left: 4px; }
.crumb { font-size: 13px; color: var(--sub); padding: 14px 0 0; }
.crumb a { color: var(--sub); text-decoration: none; }
.pd { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; border-top: 0; padding-top: 14px; }
.pd-img > img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 16px; border: 1px solid var(--line); background: #eee; display: block; }
.pd-thumbs { display: flex; gap: 8px; margin-top: 8px; }
.pd-thumbs img { width: 64px; height: 64px; object-fit: contain; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.pd-info h1 { font-size: 24px; margin: 4px 0 2px; line-height: 1.3; }
.pd-hanja { color: var(--sub); margin: 0 0 10px; font-size: 14px; }
.pd-price { margin: 14px 0; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pd-price b { font-size: 30px; color: var(--red); }
.pd-price small { color: var(--sub); }
.pd-meta { list-style: none; padding: 0; margin: 0 0 16px; font-size: 14px; }
.pd-meta li { padding: 4px 0; }
.pd-meta em { font-style: normal; display: inline-block; width: 74px; color: var(--sub); font-weight: 700; }
.grid.other { grid-template-columns: repeat(4, 1fr); }
.grid.other .mat-card > img { aspect-ratio: 1; }
.grid.other .t { padding: 8px 10px; font-size: 13px; }
@media (max-width: 640px) {
  .pd { grid-template-columns: 1fr; }
  .grid.other { grid-template-columns: repeat(2, 1fr); }
}
