/* === 사주쌤 Phase 3 스튜디오 (자미두수 12궁 · 성명학 · 3D 엽전 주역) === */
.ss-p3-wrap {
  margin: 18px 0 24px; padding: 22px; border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #faf7f0 100%);
  border: 1px solid #e5dfd4; color: #182131; max-width: 100%; box-sizing: border-box;
}
.ss-p3-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.ss-p3-eyebrow { display: block; font-size: 12px; font-weight: 800; color: #8b6a3e; margin-bottom: 4px; }
.ss-p3-wrap h2 { margin: 0 0 6px; font-family: 'Gowun Batang', Georgia, serif; font-size: 21px; line-height: 1.38; color: #182131; word-break: keep-all; text-wrap: balance; }
.ss-p3-sub { margin: 0; font-size: 14px; line-height: 1.66; color: #3d4654; word-break: keep-all; overflow-wrap: break-word; text-wrap: pretty; }

.ss-p3-form, .ss-nm-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 12px; }
.ss-p3-field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 150px; min-width: 0; }
.ss-p3-field-sm { flex: 0.7 1 110px; }
.ss-p3-field-xs { flex: 0.45 1 78px; }
.ss-p3-field span { font-size: 12px; font-weight: 700; color: #434d5c; white-space: nowrap; }
.ss-p3-form input, .ss-p3-form select, .ss-nm-form input, .ss-nm-lookup input {
  width: 100%; height: 42px; padding: 0 11px; border-radius: 10px; border: 1px solid #d5ccb9;
  background: #ffffff; color: #182131; font-size: 13.5px; min-width: 0; box-sizing: border-box;
}
.ss-p3-btn-primary {
  min-height: 42px; padding: 0 18px; border-radius: 10px; border: 1px solid #182131;
  background: #182131; color: #f8f5ef; font-size: 13.5px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.ss-p3-btn-primary:hover { background: #26354d; }
.ss-p3-btn-soft {
  min-height: 42px; padding: 0 15px; border-radius: 10px; border: 1px solid #d5cab7;
  background: #f2ece0; color: #182131; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.ss-p3-btn-soft:hover { background: #e8decb; }
.ss-p3-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ss-p3-err { margin: 8px 0 0; font-size: 13px; font-weight: 600; color: #a8332c; }

/* Ziwei 4x4 Traditional Astrolabe Grid */
.ss-zw-legend {
  display: flex; flex-wrap: wrap; gap: 5px 12px; align-items: center;
  padding: 10px 13px; border-radius: 12px; background: #f8f5ef; border: 1px solid #e5dfd4;
  font-size: 12.5px; line-height: 1.56; color: #364050; word-break: keep-all; margin-top: 10px;
}
.ss-zw-legend strong { color: #7a5c32; font-weight: 800; }
.ss-zw-legend b { color: #182131; font-weight: 800; }
.ss-zw-board {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(104px, auto));
  gap: 6px; margin-top: 10px;
}
.ss-zw-center {
  grid-column: 2 / 4; grid-row: 2 / 4; padding: 16px; border-radius: 14px;
  background: #f8f5ef; border: 1px solid #dfd5c2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px;
}
.ss-zw-center strong { font-family: 'Gowun Batang', Georgia, serif; font-size: 20px; color: #182131; }
.ss-zw-cmeta { display: grid; gap: 4px; font-size: 12.5px; color: #3b4454; word-break: keep-all; }
.ss-zw-chint { margin: 4px 0 0; font-size: 12px; color: #7a5c32; font-weight: 700; word-break: keep-all; }
.ss-zw-cell {
  display: flex; flex-direction: column; justify-content: space-between; gap: 4px;
  padding: 9px; border-radius: 12px; border: 1px solid #e5dfd4; background: #ffffff;
  color: #182131; text-align: left; cursor: pointer; transition: all .18s ease; min-width: 0;
}
.ss-zw-cell:hover { border-color: #8b6a3e; }
.ss-zw-cell.is-sanfang { background: #fbf8f1; border-color: #c8ae82; }
.ss-zw-cell.is-selected { background: #182131; border-color: #182131; color: #f8f5ef; }
.ss-zw-ctop { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; gap: 4px; }
.ss-zw-ctop strong { font-weight: 800; }
.ss-zw-ctop span { font-size: 11px; opacity: .82; }
.ss-zw-ceasy { font-size: 10.5px; font-weight: 700; color: #7a5c32; line-height: 1.25; }
.ss-zw-cell.is-selected .ss-zw-ceasy { color: #f2dfb8; }
.ss-zw-stars { display: flex; flex-wrap: wrap; gap: 3px; }
.ss-zw-mstar { font-size: 11.5px; font-weight: 800; padding: 2px 6px; border-radius: 5px; background: #f2ece0; color: #182131; display: inline-flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.ss-zw-cell.is-selected .ss-zw-mstar { background: rgba(255,255,255,.15); color: #ffffff; }
.ss-zw-mstar small { font-size: 10px; font-weight: 600; color: #5b4523; margin-left: 2px; }
.ss-zw-cell.is-selected .ss-zw-mstar small { color: #f2dfb8; }
.ss-zw-mut { font-style: normal; margin-left: 2px; padding: 0 4px; border-radius: 4px; font-size: 10px; background: #8b6a3e; color: #fff; }
.ss-zw-mut.is-기 { background: #b24337; }
.ss-zw-mut.is-록 { background: #2b664b; }
.ss-zw-minors { display: flex; flex-wrap: wrap; gap: 3px; font-size: 10.5px; color: #4b5565; }
.ss-zw-cell.is-selected .ss-zw-minors { color: rgba(248,245,239,.85); }
.ss-zw-empty-star { font-size: 10.5px; color: #555e6d; word-break: keep-all; }
.ss-zw-cell.is-selected .ss-zw-empty-star { color: rgba(248,245,239,.85); }
.ss-zw-cbot { display: flex; justify-content: space-between; align-items: center; font-size: 10.5px; color: #4a5363; }
.ss-zw-cell.is-selected .ss-zw-cbot { color: rgba(248,245,239,.86); }
.ss-zw-body-tag { font-style: normal; padding: 1px 5px; border-radius: 4px; background: #8b6a3e; color: #fff; font-weight: 700; font-size: 10px; }
.ss-zw-detail { margin-top: 12px; padding: 16px 18px; border-radius: 14px; background: #ffffff; border: 1px solid #dfd6c6; }
.ss-zw-det-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; font-size: 14.5px; }
.ss-zw-det-pill { padding: 4px 11px; border-radius: 999px; background: #182131; color: #f2dfb8; font-size: 12px; font-weight: 700; }
.ss-zw-detail p { margin: 0; font-size: 14px; line-height: 1.68; color: #2b3545; word-break: keep-all; overflow-wrap: break-word; text-wrap: pretty; }

/* Naming Studio */
.ss-nm-lookup { display: grid; gap: 10px; padding: 13px 14px; border-radius: 12px; background: #f8f5ef; border: 1px solid #e5dfd4; margin-bottom: 14px; }
.ss-nm-lookup-top { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.ss-nm-chips { width: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.ss-nm-hchip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 8px; border: 1px solid #d5ccb9; background: #ffffff; cursor: pointer; font-size: 12.5px; color: #182131; }
.ss-nm-hchip:hover { border-color: #8b6a3e; background: #faf7f0; }
.ss-nm-hchip strong { font-family: 'Gowun Batang', serif; font-size: 15px; }
.ss-nm-tip { font-size: 13px; color: #4a5363; word-break: keep-all; }
.ss-nm-res { display: grid; gap: 12px; }
.ss-nm-row-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.ss-nm-box { padding: 15px 17px; border-radius: 14px; background: #ffffff; border: 1px solid #e5dfd4; }
.ss-nm-box h4 { margin: 0 0 6px; font-size: 15px; font-weight: 800; color: #182131; word-break: keep-all; }
.ss-nm-sub { margin: 0 0 11px; font-size: 12.5px; line-height: 1.56; color: #4a5363; word-break: keep-all; text-wrap: pretty; }
.ss-nm-tiles { display: flex; flex-wrap: wrap; gap: 8px; }
.ss-nm-tile { padding: 9px 12px; border-radius: 10px; background: #f8f5ef; border: 1px solid #e5dfd4; display: flex; flex-direction: column; gap: 2px; min-width: 86px; }
.ss-nm-tile.is-ok { border-color: #b7d5c4; background: #f3f9f5; }
.ss-nm-tile strong { font-family: 'Gowun Batang', serif; font-size: 20px; }
.ss-nm-tile span { font-size: 12px; color: #364050; }
.ss-nm-tile small { font-size: 11px; font-weight: 700; color: #1f4f38; }
.ss-nm-suri-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.ss-nm-suri { padding: 11px 13px; border-radius: 11px; background: #faf8f3; border: 1px solid #e5dfd4; }
.ss-nm-suri.is-good { border-left: 3.5px solid #2b664b; }
.ss-nm-suri.is-neutral { border-left: 3.5px solid #8b6a3e; }
.ss-nm-suri.is-caution { border-left: 3.5px solid #b24337; }
.ss-nm-suri-top { display: flex; justify-content: space-between; gap: 6px; font-size: 12.5px; margin-bottom: 5px; flex-wrap: wrap; }
.ss-nm-suri p { margin: 0; font-size: 13px; line-height: 1.6; color: #313b4b; word-break: keep-all; text-wrap: pretty; }
.ss-nm-samjae { margin: 11px 0 0; font-size: 13.5px; line-height: 1.62; color: #2b3545; word-break: keep-all; text-wrap: pretty; }
.ss-nm-comp { padding: 15px 18px; border-radius: 14px; background: linear-gradient(135deg, #182131 0%, #24334b 100%); color: #f8f5ef; }
.ss-nm-comp strong { display: block; font-size: 13.5px; color: #f2dfb8; margin-bottom: 5px; }
.ss-nm-comp p { margin: 0; font-size: 14px; line-height: 1.66; color: #eef1f6; word-break: keep-all; text-wrap: pretty; }

/* 3D Coin I-Ching Studio */
.ss-ic-arena {
  display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 16px; align-items: center;
  padding: 18px; border-radius: 16px; background: #f8f5ef; border: 1px solid #e5dfd4;
}
.ss-ic-legend { margin: 9px 0 0; font-size: 12.5px; line-height: 1.56; color: #4a5363; word-break: keep-all; text-wrap: pretty; }
.ss-ic-coins { display: flex; justify-content: center; gap: 18px; perspective: 800px; }
.ss-ic-coin { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 68px; }
.ss-ic-coin svg { width: 64px; height: 64px; filter: drop-shadow(0 6px 10px rgba(24,33,49,.16)); }
.ss-ic-coin span { font-size: 12px; font-weight: 700; color: #5b4523; }
.ss-ic-coin.is-spinning svg { animation: ssIcCoinSpin .68s cubic-bezier(0.22,1,0.36,1); }
@keyframes ssIcCoinSpin {
  0% { transform: translateY(0) rotateX(0deg) rotateY(0deg); }
  45% { transform: translateY(-28px) rotateX(540deg) rotateY(180deg); }
  100% { transform: translateY(0) rotateX(1080deg) rotateY(360deg); }
}
.ss-ic-hex-svg { width: 100%; max-width: 170px; height: auto; display: block; margin: 0 auto; }
.ss-ic-res-card { margin-top: 14px; padding: 17px 19px; border-radius: 16px; background: #ffffff; border: 1px solid #dfd6c6; display: grid; gap: 10px; }
.ss-ic-res-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 15px; }
.ss-ic-res-top strong { font-family: 'Gowun Batang', serif; font-size: 19.5px; color: #182131; }
.ss-ic-res-top span { font-size: 13px; color: #4a5363; }
.ss-ic-res-sum { margin: 0; font-size: 14.5px; line-height: 1.7; color: #242e3e; word-break: keep-all; overflow-wrap: break-word; text-wrap: pretty; }
.ss-ic-res-move { margin: 0; padding: 10px 13px; border-radius: 11px; background: #faf7f0; border: 1px solid #e5dfd4; font-size: 13.5px; line-height: 1.64; color: #4a391e; word-break: keep-all; text-wrap: pretty; }
.ss-ic-changed { padding: 12px 14px; border-radius: 12px; background: #f3f9f5; border: 1px solid #c3dccd; }
.ss-ic-changed strong { display: block; font-size: 14px; color: #1f4f38; margin-bottom: 4px; word-break: keep-all; }
.ss-ic-changed p { margin: 0; font-size: 13.5px; line-height: 1.64; color: #244032; word-break: keep-all; text-wrap: pretty; }

@media (max-width: 760px) {
  .ss-p3-wrap { padding: 16px 14px; }
  .ss-zw-board { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto; }
  .ss-zw-cell { grid-column: auto !important; grid-row: auto !important; }
  .ss-zw-center { grid-column: 1 / -1 !important; grid-row: 1 !important; }
  .ss-nm-suri-grid, .ss-ic-arena { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .ss-ic-coin.is-spinning svg { animation: none !important; }
}
