:root{
  --page-max:1180px;
  --page-pad:24px;
  --brand:#0f766e;
  --line:#e5e7eb;
  --text:#111827;
  --muted:#6b7280;
}
*{box-sizing:border-box}
html{min-height:100%}
body{
  min-height:100vh;
  margin:0;
  font-family:Arial,"Noto Sans KR",sans-serif;
  background:#f7f8fa;
  color:var(--text);
  display:flex;
  flex-direction:column;
}
.siteHeader{
  min-height:72px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  padding:0 max(28px,calc((100vw - var(--page-max)) / 2 + var(--page-pad)));
  background:#fff;
  border-bottom:1px solid var(--line);
}
.siteFooter{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
  align-items:center;
  padding:18px max(28px,calc((100vw - var(--page-max)) / 2 + var(--page-pad)));
  background:#fff;
  border-top:1px solid var(--line);
}
.brand{font-weight:800;color:var(--brand);text-decoration:none;font-size:19px;white-space:nowrap}
nav{display:flex;gap:16px;align-items:center;justify-content:flex-end;flex-wrap:wrap}
a{color:#2563eb;text-decoration:none}
.page{
  width:min(var(--page-max),calc(100% - (var(--page-pad) * 2)));
  margin:0 auto;
  flex:1;
  padding:56px 0;
}
.hero{
  min-height:calc(100vh - 72px - 97px - 112px);
  display:flex;
  align-items:center;
}
.heroInner{width:100%;max-width:760px;margin:0 auto;text-align:left}
.hero h1{font-size:clamp(38px,4vw,64px);line-height:1.08;margin:10px 0 16px;letter-spacing:0}
.hero p{font-size:18px;line-height:1.7;margin:0 0 22px}
.eyebrow{font-weight:800;color:var(--brand);letter-spacing:0}
.button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:0 18px;
  border-radius:6px;
  border:1px solid #d1d5db;
  background:#fff;
  color:var(--text);
  font-weight:700;
  white-space:nowrap;
}
.button.primary{background:var(--brand);border-color:var(--brand);color:#fff}
.button:disabled{opacity:.55;cursor:not-allowed}
.actions{display:flex;gap:10px;flex-wrap:wrap}
.authLayout{
  min-height:calc(100vh - 72px - 97px - 112px);
  display:grid;
  place-items:center;
  padding:12px 0;
}
.authCard{width:min(480px,100%)}
.authCard h1{font-size:34px;line-height:1.2;margin:0 0 22px;text-align:left}
.formPanel{display:grid;gap:14px;width:100%;padding:22px;background:#fff;border:1px solid var(--line);border-radius:8px}
.formPanel label{display:grid;gap:7px;font-weight:700}
.formPanel input,.formPanel select{height:40px;border:1px solid #d1d5db;border-radius:6px;padding:0 10px;min-width:0}
.alert{padding:12px 14px;border-radius:6px;margin:0 0 16px}
.alert.error{background:#fee2e2;color:#991b1b}
.alert.ok{background:#dcfce7;color:#166534}
.statGrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px;width:100%}
.stat{background:#fff;border:1px solid var(--line);border-radius:8px;padding:22px}
.stat span{display:block;color:var(--muted);margin-bottom:8px}
.pageTitle{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:16px;
  margin:0 0 24px;
}
.pageTitle h1{font-size:36px;line-height:1.2;margin:4px 0 0}
.productGrid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:18px;
}
.productCard{
  display:flex;
  flex-direction:column;
  min-width:0;
  background:#fff;
  border:1px solid var(--line);
  border-radius:8px;
  overflow:hidden;
}
.productThumb,.detailVisual{
  position:relative;
  min-height:178px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  padding:18px;
  color:#fff;
  background:linear-gradient(135deg,#0f766e,#155e75 52%,#7c2d12);
}
.productThumb{color:#fff;text-decoration:none}
.productThumb.hasImage,.detailVisual.hasImage{background:#111827;overflow:hidden}
.productThumb.hasImage::after,.detailVisual.hasImage::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(180deg,rgba(17,24,39,.18),rgba(17,24,39,.76));
  z-index:1;
}
.productThumb img,.detailVisual img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.productThumb span,.productThumb strong,.detailVisual span,.detailVisual strong{position:relative;z-index:2}
.productThumb span,.detailVisual span{font-weight:800}
.productThumb strong,.detailVisual strong{font-size:28px;line-height:1}
.productBody{display:grid;gap:12px;padding:18px;flex:1}
.productBody h2,.cartItem h2{font-size:19px;line-height:1.35;margin:0}
.productCategory{margin:0;color:var(--brand);font-weight:800;font-size:13px}
.productSummary{margin:0;color:var(--muted);line-height:1.55}
.productMeta,.productActions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.productMeta span{color:var(--muted);font-weight:700}
.productActions form{margin:0}
.emptyState{
  display:grid;
  gap:10px;
  place-items:start;
  background:#fff;
  border:1px solid var(--line);
  border-radius:8px;
  padding:28px;
}
.emptyState strong{font-size:22px}
.emptyState p{margin:0;color:var(--muted);line-height:1.6}
.panel{background:#fff;border:1px solid var(--line);border-radius:8px;padding:18px}
.contentPanel{background:#fff;border:1px solid var(--line);border-radius:8px;padding:28px}
.contentBody{line-height:1.8;font-size:16px;color:#1f2937}
.detailLayout{
  display:grid;
  grid-template-columns:minmax(280px,0.9fr) minmax(320px,1.1fr);
  gap:28px;
  align-items:start;
}
.detailVisual{min-height:420px;border-radius:8px}
.detailInfo h1{font-size:40px;line-height:1.18;margin:6px 0 14px}
.detailSummary{font-size:18px;line-height:1.65;color:var(--muted);margin:0 0 20px}
.detailFacts,.cartSummary dl{
  display:grid;
  gap:0;
  margin:0 0 18px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:8px;
}
.detailFacts div,.cartSummary dl div{
  display:flex;
  justify-content:space-between;
  gap:16px;
  padding:14px 16px;
  border-bottom:1px solid var(--line);
}
.detailFacts div:last-child,.cartSummary dl div:last-child{border-bottom:0}
.detailFacts dt,.cartSummary dt{color:var(--muted);font-weight:700}
.detailFacts dd,.cartSummary dd{margin:0;font-weight:800}
.buyPanel,.descriptionPanel{
  display:grid;
  gap:14px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:8px;
  padding:18px;
}
.buyPanel label{display:grid;gap:7px;font-weight:800}
.buyPanel input,.quantityForm input{
  height:40px;
  border:1px solid #d1d5db;
  border-radius:6px;
  padding:0 10px;
  min-width:0;
}
.descriptionPanel{margin-top:22px}
.descriptionPanel h2{font-size:24px;margin:0}
.descriptionPanel p{margin:0;line-height:1.7;color:#374151}
.cartLayout{
  display:grid;
  grid-template-columns:minmax(0,1fr) 320px;
  gap:20px;
  align-items:start;
}
.cartItems{display:grid;gap:12px}
.cartItem{
  display:grid;
  grid-template-columns:minmax(0,1fr) 170px 130px auto;
  gap:14px;
  align-items:center;
  background:#fff;
  border:1px solid var(--line);
  border-radius:8px;
  padding:16px;
}
.cartItem p{margin:5px 0 0;color:var(--muted)}
.quantityForm{display:grid;gap:8px}
.quantityForm label{display:grid;gap:6px;font-weight:800}
.lineTotal{display:grid;gap:4px;text-align:right}
.lineTotal span{color:var(--muted);font-weight:700}
.textButton{
  border:0;
  background:transparent;
  color:#b91c1c;
  font-weight:800;
  cursor:pointer;
  padding:8px 0;
}
.cartSummary{
  position:sticky;
  top:20px;
  display:grid;
  gap:14px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:8px;
  padding:18px;
}
.cartSummary h2{font-size:22px;margin:0}
.cartSummary p{margin:0;color:var(--muted);line-height:1.55}
.sectionActions{margin-top:18px}
.pageTitle.subTitle{margin-top:28px}
.mutedText{margin:0;color:var(--muted);line-height:1.6}
.flatForm{padding:0;border:0;background:transparent}
.tableWrap{overflow:auto;background:#fff;border:1px solid var(--line);border-radius:8px}
.dataTable{width:100%;border-collapse:collapse;min-width:860px}
.dataTable th,.dataTable td{padding:12px 14px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}
.dataTable th{font-size:13px;color:#374151;background:#f9fafb}
.dataTable tr:last-child td{border-bottom:0}
.muted{display:inline-block;color:var(--muted);font-size:12px;margin-left:4px}
.badge{display:inline-flex;align-items:center;min-height:26px;padding:0 10px;border-radius:999px;background:#eef2ff;color:#3730a3;font-weight:800;font-size:12px}
.rankProgressList{display:grid;gap:14px}
.rankProgress{display:grid;gap:8px}
.rankProgress>div:first-child{display:flex;justify-content:space-between;gap:12px;align-items:center}
.rankProgress strong{font-size:15px}
.rankProgress span,.rankProgress small{color:var(--muted)}
.rankProgress.optional{padding:10px 12px;border:1px dashed var(--line);border-radius:8px;background:#f9fafb}
.progressTrack{height:10px;border-radius:999px;background:#e5e7eb;overflow:hidden}
.progressTrack span{display:block;height:100%;border-radius:999px;background:var(--brand)}
.binaryGrid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.binarySlot{display:grid;gap:8px;border:1px solid var(--line);border-radius:8px;padding:16px;background:#fff}
.binarySlot>span{color:var(--muted);font-weight:800;font-size:13px}
.binarySlot>strong{font-size:20px}
.binarySlot>small{color:var(--muted)}
.binarySlot dl{display:grid;gap:0;margin:4px 0 0;border-top:1px solid var(--line)}
.binarySlot dl div{display:flex;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px solid var(--line)}
.binarySlot dt{color:var(--muted);font-weight:700}
.binarySlot dd{margin:0;font-weight:800}
.checkoutLayout{
  display:grid;
  grid-template-columns:minmax(0,1fr) 340px;
  gap:20px;
  align-items:start;
}
.checkoutPanel{
  display:grid;
  gap:14px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:8px;
  padding:18px;
}
.checkoutPanel h2{font-size:22px;margin:0}
.checkoutPanel label{display:grid;gap:7px;font-weight:800}
.checkoutPanel input{
  height:40px;
  border:1px solid #d1d5db;
  border-radius:6px;
  padding:0 10px;
  min-width:0;
}
.formGrid{display:grid;grid-template-columns:150px minmax(0,1fr);gap:12px}
.choiceList{display:grid;gap:10px}
.choiceList label{
  display:flex;
  align-items:center;
  gap:8px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:8px;
}
.choiceList input{width:18px;height:18px}
.checkoutSummary{grid-row:1 / span 2}
.paymentNotice{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  margin:0 0 18px;
  padding:16px 18px;
  background:#ecfdf5;
  border:1px solid #a7f3d0;
  border-radius:8px;
}
.paymentNotice div{display:grid;gap:4px}
.paymentNotice strong{font-size:18px;color:#065f46}
.paymentNotice span{color:#047857}
.kcpPaymentLayout{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(320px,0.8fr);
  gap:18px;
  align-items:start;
}
.kcpPayForm{display:grid;gap:12px}
.orderComplete{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px;
  margin-bottom:18px;
}
.compactRows{display:grid;gap:10px}
.compactRows div,.orderRow{
  display:grid;
  gap:8px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
}
.compactRows span,.orderRow span{color:var(--muted)}
.orderList{display:grid;gap:10px}
.orderRow{
  grid-template-columns:minmax(180px,1fr) 1fr 120px 110px auto;
  align-items:center;
}
.orderRow div:first-child{display:grid}
.orderActions{display:flex;gap:8px;align-items:center;justify-content:flex-end;flex-wrap:wrap}
.orderActions form{margin:0}
@media (max-width:900px){
  :root{--page-pad:20px}
  .siteHeader{align-items:flex-start;padding-top:14px;padding-bottom:14px}
  nav{gap:10px}
  .siteFooter{grid-template-columns:1fr 1fr}
  .page{padding:42px 0}
  .hero,.authLayout{min-height:auto}
  .detailLayout,.cartLayout,.checkoutLayout,.orderComplete,.kcpPaymentLayout{grid-template-columns:1fr}
  .detailVisual{min-height:280px}
  .cartSummary{position:static}
  .checkoutSummary{grid-row:auto}
  .cartItem{grid-template-columns:minmax(0,1fr) 160px 120px}
  .cartItem form:last-child{grid-column:1 / -1}
  .orderRow{grid-template-columns:1fr 1fr}
}
@media (max-width:560px){
  :root{--page-pad:16px}
  .siteHeader{display:grid;grid-template-columns:1fr;gap:10px}
  nav{justify-content:flex-start}
  .siteFooter{grid-template-columns:1fr;gap:10px}
  .hero h1,.authCard h1{font-size:32px}
  .hero p{font-size:16px}
  .pageTitle{display:grid;align-items:start}
  .pageTitle h1,.detailInfo h1{font-size:30px}
  .actions{display:grid}
  .button{width:100%}
  .paymentNotice{display:grid}
  .productActions{display:grid}
  .productActions form,.productActions .button{width:100%}
  .detailVisual{min-height:220px}
  .detailFacts div,.cartSummary dl div{display:grid;gap:6px}
  .formGrid,.orderRow{grid-template-columns:1fr}
  .cartItem{grid-template-columns:1fr}
  .binaryGrid{grid-template-columns:1fr}
  .lineTotal{text-align:left}
}
