    * {
      box-sizing: border-box;
    }
    body {
      margin: 0;
      font-family: -apple-system, BlinkMacSystemFont, "Pretendard", system-ui, sans-serif;
      background: linear-gradient(135deg, #fdfbfb, #ebedee);
      color: #222;
    }
    header {
      background: linear-gradient(180deg, #5c277e, #813eb6);
      color: #fff;
      padding: 2.1rem 1.6rem;
      text-align: center;
      box-shadow: 0 2px 10px rgba(0,0,0,0.15);
      position: sticky;
      top: 1;
      z-index: 10;
    }
    header h1 {
      margin: 0 0 0.9rem;
      font-size: 1.4rem;
    }
    header p {
      margin: 0;
      font-size: 0.9rem;
      opacity: 0.8;
    }
    main {
      max-width: 1080px;
      margin: 1.0rem auto;
      padding: 0.2rem 1rem 1rem;
    }
    .card {
      background: #fff;
      border-radius: 18px;
      box-shadow: 0 8px 25px rgba(0,0,0,0.06);
      padding: 1.5rem;
      margin-bottom: 1.5rem;
    }
    .card h2 {
      margin-top: 0;
      font-size: 1.2rem;
      display: flex;
      align-items: center;
      gap: 0.4rem;
    }
    .card h2 span.emoji {
      font-size: 1.4rem;
    }
    .form-grid {
      display: grid;
      grid-template-columns: 1.2fr 1.3fr;
      gap: 1.5rem;
    }
    @media (max-width: 768px) {
      .form-grid {
        grid-template-columns: 1fr;
      }
    }
    label {
      font-size: 0.9rem;
      font-weight: 600;
      display: block;
      margin-bottom: 0.35rem;
    }
    input[type="date"],
    input[type="time"],
    button {
      font-size: 0.95rem;
    }
    input[type="date"],
    input[type="time"] {
      width: 100%;
      padding: 0.5rem 0.7rem;
      border-radius: 10px;
      border: 1px solid #ccd5ff;
      outline: none;
      transition: border 0.2s, box-shadow 0.2s;
      background: #fdfdff;
    }
    input[type="date"]:focus,
    input[type="time"]:focus {
      border-color: #4a6df2;
      box-shadow: 0 0 0 2px rgba(74,109,242,0.15);
    }
    .radio-group {
      display: flex;
      gap: 1rem;
      flex-wrap: wrap;
    }
    .radio-pill {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      padding: 0.35rem 0.75rem;
      border-radius: 999px;
      border: 1px solid #d0d7ff;
      cursor: pointer;
      background: #f7f8ff;
      font-size: 0.85rem;
    }
    .radio-pill input {
      accent-color: #4a6df2;
    }
    .small-note {
      font-size: 0.78rem;
      color: #666;
      margin-top: 0.15rem;
    }
    .lunar-extra {
      margin-top: 0.6rem;
      padding: 0.6rem 0.7rem;
      border-radius: 12px;
      background: #f5f7ff;
      border: 1px dashed #c3cdfd;
      display: none;
      flex-direction: column;
      gap: 0.25rem;
      font-size: 0.82rem;
    }
    .checkbox-inline {
      display: inline-flex;
      align-items: center;
      gap: 0.3rem;
      font-size: 0.87rem;
    }
    .checkbox-inline input {
      accent-color: #4a6df2;
    }
    button#calc-btn {
      margin-top: 1rem;
      width: 100%;
      padding: 1.04rem;
      border-radius: 999px;
      border: none;
      background: linear-gradient(135deg, #813eb6, #4a6df2);
      color: #fff;
      font-weight: 700;
      font-size: 1.12rem;
      cursor: pointer;
      box-shadow: 0 8px 18px rgba(74,109,242,0.3);
      transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s;
    }
    button#calc-btn:hover {
      filter: brightness(1.05);
      transform: translateY(-1px);
      box-shadow: 0 12px 22px rgba(74,109,242,0.35);
    }
    button#calc-btn:active {
      transform: translateY(0);
      box-shadow: 0 5px 12px rgba(74,109,242,0.25);
    }
    .error {
      margin-top: 0.5rem;
      padding: 0.6rem 0.7rem;
      border-radius: 12px;
      background: #fff2f2;
      border: 1px solid #ffcaca;
      color: #c0392b;
      font-size: 0.85rem;
    }
    #result {
      display: none;
      margin-top: 1rem;
    }
    .tag-row {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem;
      margin: 0.3rem 0 0.7rem;
    }
    .tag {
      padding: 0.28rem 0.7rem;
      border-radius: 999px;
      font-size: 0.78rem;
      background: #f4f4ff;
      color: #555;
      border: 1px solid #e0e3ff;
    }
    .tag.highlight {
      background: #fff8e6;
      border-color: #ffc6a1;
      color: #aa4a00;
    }
    .result-grid {
      display: grid;
      grid-template-columns: 1.2fr 1.2fr;
      gap: 1.2rem;
    }
    @media (max-width: 900px) {
      .result-grid {
        grid-template-columns: 1fr;
      }
    }
    .result-section h3 {
      margin: 0 0 0.4rem;
      font-size: 1rem;
      display: flex;
      align-items: center;
      gap: 0.3rem;
    }
    .result-section h3 span {
      font-size: 1.1rem;
    }
    .result-kv {
      font-size: 0.88rem;
      line-height: 1.5;
    }
    .result-kv div {
      margin-bottom: 0.26rem;
    }
    .pill {
      display: inline-block;
      padding: 0.15rem 0.5rem;
      border-radius: 999px;
      font-size: 0.8rem;
      background: #f5f5f5;
      margin-left: 0.3rem;
    }
    .big-zodiac {
      margin-top: 0.6rem;
      padding: 0.7rem 0.9rem;
      border-radius: 14px;
      background: linear-gradient(135deg, #fff8e6, #ffe5d3);
      border: 1px solid #ffd2a1;
      font-size: 0.92rem;
    }
    .big-zodiac strong {
      font-size: 1.05rem;
    }
    .explain-box {
      margin-top: 0.7rem;
      padding: 0.7rem 0.85rem;
      border-radius: 14px;
      background: #f7f9ff;
      border: 1px dashed #c2cdfb;
      font-size: 0.82rem;
      line-height: 1.6;
    }
    .explain-box ul {
      padding-left: 1.2rem;
      margin: 0.3rem 0 0;
    }
    .explain-box li {
      margin-bottom: 0.15rem;
    }

    div.z-top {
      text-align: center;
      position: sticky;
      top: 0px;
    }

    .z-bottom {
      text-align: center;
    }

    footer {
      text-align: center;
      font-size: 0.75rem;
      color: #888;
      margin-top: 1.8rem;
    }

    /* 결과 표시 전 로딩(회전) 오버레이 */
.spinner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner-overlay .spin-img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  animation: spinTwice 3s linear forwards;
}

@keyframes spinTwice {
  from { transform: rotate(0deg); }
  to { transform: rotate(720deg); } /* 시계방향 2회전 */
}
