/* ─── Design tokens ────────────────────────────────────────────── */
:root {
  --green:        #0A5046;
  --green-hover:  #054138;
  --cta-green:    #054138;
  --green-light:  #e8f0eb;
  --cream:        #FAF5E8;
  --accent-red:   #BE3A2C;
  --page-bg:      #F5F5F5;
  --card-bg:      #ffffff;
  --border:       #C5C5C7;
  --border-light: #B7B7B7;
  --text:         #1a1a1a;
  --text-mid:     #555;
  --text-light:   #888;
  --radius:       20px;
  --radius-sm:    10px;
  --shadow:       0 1px 2px rgba(0,0,0,.30), 0 2px 6px 2px rgba(0,0,0,.15);
  --kiosk-content-width: min(880px, calc(100vw - 96px));
  --form-control-width: 504px;
  --form-control-shift: 13px;
  --input-label-width: 91px;
  --form-content-inset: calc((100% - var(--form-control-width)) / 2);
}

html:not(.mobile-page):not([lang="ko"]) {
  --form-control-width: min(620px, calc(var(--kiosk-content-width) - 96px));
  --form-control-shift: 0px;
  --input-label-width: 132px;
}

/* ─── Reset & base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--page-bg);
  color: var(--text);
  font-family: 'Pretendard', 'Noto Sans KR', 'Noto Sans JP', 'Noto Sans SC', 'Noto Sans TC', sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ─── App container ────────────────────────────────────────────── */
.app {
  max-width: 1080px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Header ───────────────────────────────────────────────────── */
.header {
  text-align: center;
  padding: 88px 40px 34px;
}

.logo-img {
  width: 249px;
  height: 86px;
  display: block;
  margin: 0 auto;
}

.tagline {
  font-size: 22px;
  color: var(--text-light);
  margin-top: 4px;
  letter-spacing: .02em;
}

.main-title {
  width: 496px;
  margin: 28px auto 0;
  font-size: 30px;
  line-height: 50px;
  color: #000;
  word-break: keep-all;
}

.main-title strong {
  color: var(--text);
  font-weight: 700;
}

html:not(.mobile-page)[lang="ko"] .header {
  padding-bottom: 68px;
}

html:not(.mobile-page)[lang="ko"] .main-title {
  margin-top: 56px;
}

/* ─── Language bar ─────────────────────────────────────────────── */
.lang-section {
  width: var(--kiosk-content-width);
  height: 81px;
  margin: 0 auto 33px;
  background: var(--card-bg);
  border-radius: 50px;
  display: flex;
  align-items: center;
  padding: 16px 24px;
  gap: 0;
  box-shadow: inset 0 2px 7px rgba(0,0,0,.23);
  overflow-x: auto;
  scrollbar-width: none;
}
.lang-section::-webkit-scrollbar { display: none; }

html:not(.mobile-page)[lang="ko"] .lang-section {
  margin-bottom: 66px;
}

.lang-label {
  font-size: 22px;
  font-weight: 600;
  color: var(--green);
  white-space: nowrap;
  flex-shrink: 0;
  padding: 0 10px;
}

.lang-buttons {
  display: flex;
  gap: 5px;
  width: 100%;
  margin-left: 0;
  justify-content: center;
  flex-shrink: 1;
}

.lang-btn {
  width: 140px;
  height: 49px;
  padding: 0;
  background: #fff;
  border-radius: 30px;
  font-size: 22px;
  font-weight: 500;
  color: #000;
  border: 1px solid transparent;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 6px 2px rgba(0, 0, 0, .15);
  white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
}
.lang-btn:hover { background: #fff; }
.lang-btn.active {
  background: var(--green);
  color: #fff;
  font-weight: 700;
}

/* ─── Form card ────────────────────────────────────────────────── */
#form-section {
  padding: 0;
}

.form-card {
  --card-action-height: 114px;
  width: var(--kiosk-content-width);
  margin: 0 auto;
  background: var(--cta-green);
  background-clip: border-box;
  border-radius: var(--radius);
  border: 0;
  box-shadow: 0 0 0 2px var(--cta-green);
  overflow: hidden;
  position: relative;
  isolation: isolate;
  transform: translateZ(0);
}

.form-card::before {
  content: '';
  position: absolute;
  z-index: 0;
  top: 0;
  right: 0;
  bottom: var(--card-action-height);
  left: 0;
  background: var(--card-bg);
  pointer-events: none;
}

.form-card > *,
.result-card > * {
  position: relative;
  z-index: 1;
}

.form-section-title {
  text-align: center;
  padding: 56px 28px 0;
  font-size: 25px;
  font-weight: 600;
  color: var(--text);
}

/* ── Toggle row ────────────────────────────────────────────────── */
.toggle-row {
  display: flex;
  justify-content: space-between;
  width: var(--form-control-width);
  gap: 0;
  margin: 0 auto;
  padding: 58px 0 0;
  transform: translateX(var(--form-control-shift));
}

.toggle-group {
  display: flex;
  width: 181px;
  height: 68px;
  padding: 3px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--green);
  overflow: hidden;
  flex: none;
  max-width: 181px;
}

.toggle-group.disabled {
  background: var(--border);
  pointer-events: none;
}

.toggle-btn {
  flex: 1;
  padding: 0;
  border-radius: 8px;
  font-size: 22px;
  font-weight: 400;
  color: #fff;
  background: transparent;
  transition: background .15s, color .15s;
  text-align: center;
}
.toggle-btn + .toggle-btn {
  border-left: none;
}
.toggle-group.disabled .toggle-btn {
  color: #fff;
}
.toggle-btn.active {
  background: #fff;
  color: #000;
  font-weight: 400;
}
.toggle-group.disabled .toggle-btn.active {
  background: #fff;
  color: #000;
}

/* ── Input rows ────────────────────────────────────────────────── */
.input-row {
  display: flex;
  align-items: center;
  width: var(--form-control-width);
  margin: 0 auto;
  padding: 0;
  height: 100px;
  gap: 24px;
  transform: translateX(var(--form-control-shift));
}

.input-label {
  width: var(--input-label-width);
  font-size: 23px;
  font-weight: 400;
  color: var(--text);
  flex-shrink: 0;
}

html[lang="ja"] .input-label,
html[lang="zh-Hans"] .input-label,
html[lang="zh-Hant"] .input-label {
  white-space: nowrap;
}

.input-field {
  width: 100%;
  height: 69px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 23px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  caret-color: var(--green);
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.input-field::placeholder { color: var(--border); }
.input-field-shell {
  position: relative;
  flex: 1;
  height: 69px;
  min-width: 0;
}

.input-field.focused,
.input-field-shell.focused .input-field {
  border-color: var(--green);
  background: #fbfffd;
  box-shadow: inset 0 0 0 2px rgba(10, 80, 70, .20), 0 0 0 4px rgba(10, 80, 70, .08);
}

.input-row:has(.input-field.focused) .input-label,
.input-row:has(.input-field-shell.focused) .input-label {
  color: var(--green);
  font-weight: 600;
}

.input-caret {
  display: none;
  position: absolute;
  top: 50%;
  left: var(--caret-x, 16px);
  width: 2px;
  height: 31px;
  border-radius: 2px;
  background: var(--green);
  transform: translateY(-50%);
  pointer-events: none;
  animation: input-caret-blink 1s step-end infinite;
}

.input-field-shell.focused .input-caret {
  display: block;
}

.input-field-shell.disabled .input-field,
.input-field:disabled {
  color: #8f9491;
  background: #f2f4f3;
  border-color: #d8dddb;
  box-shadow: none;
  opacity: 1;
  cursor: not-allowed;
  -webkit-text-fill-color: #8f9491;
}

.input-field-shell.disabled .input-field::placeholder,
.input-field:disabled::placeholder {
  color: #b7bbb9;
}

.input-field-shell.disabled .input-caret {
  display: none;
}

.input-row:has(#birthtime-field-shell.disabled) .input-label {
  color: #8f9491;
  font-weight: 500;
}

@keyframes input-caret-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

#birthtime-field-shell {
  flex: none;
  width: 153px;
}

#label-birthdate,
#birthdate-field-shell {
  position: relative;
  top: 9px;
}

.unknown-row {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: 48px;
  flex-shrink: 0;
  transform: translateY(-5px);
}

html:not(.mobile-page):not([lang="ko"]) .unknown-row {
  margin-left: auto;
}

.unknown-label {
  font-size: 23px;
  line-height: 38px;
  color: #000;
}

/* Toggle switch */
.switch {
  width: 93px;
  height: 56px;
  border-radius: 10px;
  background: var(--border);
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 55px; height: 50px;
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
  transition: transform .2s;
}
.switch.on { background: var(--green); }
.switch.on::after { transform: translateX(32px); }

/* Time notice */
.time-notice {
  font-size: 15px;
  color: #000;
  text-align: center;
  padding: 28px 20px 43px;
}

html:not(.mobile-page):not([lang="ko"]) .time-notice {
  padding-left: var(--form-content-inset);
  padding-right: var(--form-content-inset);
}

/* ── Accuracy toggle ───────────────────────────────────────────── */
.accuracy-toggle-row {
  padding: 16px 84px;
  border-bottom: 1px solid var(--border-light);
}

html:not(.mobile-page):not([lang="ko"]) .accuracy-toggle-row {
  padding-left: var(--form-content-inset);
  padding-right: var(--form-content-inset);
}

.accuracy-toggle-btn {
  width: 100%;
  padding: 18px;
  border-radius: var(--radius-sm);
  border: 2.5px dashed var(--border);
  font-size: 22px;
  color: var(--text-mid);
  text-align: center;
  background: #fafafa;
}
.accuracy-toggle-btn:hover { border-color: var(--green); color: var(--green); }

.selected-city-row {
  position: relative;
  align-items: center;
  justify-content: center;
  padding: 14px 84px;
  gap: 8px;
}

html:not(.mobile-page):not([lang="ko"]) .selected-city-row {
  padding-left: var(--form-content-inset);
  padding-right: var(--form-content-inset);
}

.selected-city-name {
  font-size: 22px;
  color: var(--text);
  width: 100%;
  min-width: 0;
  padding: 0 48px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-change-city {
  position: absolute;
  top: 50%;
  right: 84px;
  transform: translateY(-50%);
  font-size: 28px;
  color: var(--text-light);
  padding: 2px 8px;
}

html:not(.mobile-page):not([lang="ko"]) .btn-change-city {
  right: var(--form-content-inset);
}

/* ── Form error ────────────────────────────────────────────────── */
.form-error {
  margin: 14px 84px;
  font-size: 22px;
  color: var(--accent-red);
  text-align: center;
}

html:not(.mobile-page):not([lang="ko"]) .form-error {
  width: var(--form-control-width);
  margin-left: auto;
  margin-right: auto;
}

/* ── Submit button ─────────────────────────────────────────────── */
.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  width: 100%;
  height: 114px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  color: #fff;
  font-size: 30px;
  font-weight: 700;
  font-family: inherit;
  text-align: center;
  letter-spacing: 0;
  transition: background .15s;
}
.btn-submit:hover { background: transparent; }

/* ─── Keypad ───────────────────────────────────────────────────── */
#keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  border-left: 1px solid var(--border-light);
  margin-top: 52px;
  background: var(--page-bg);
}

.key {
  height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  background: var(--card-bg);
  font-family: 'Noto Sans KR', sans-serif;
  color: var(--text);
  transition: background .1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}
.key:active,
.key.is-pressed {
  background: var(--green-light);
}

@media (hover: hover) and (pointer: fine) {
  .key:hover { background: var(--green-light); }
}

html.keypad-touch-mode .key:hover:not(.is-pressed) {
  background: var(--card-bg);
}

.key:nth-child(3n) { border-right: none; }

.key-num { font-size: 45px; font-weight: 400; }

.key-del svg {
  width: 46px;
  height: 46px;
  color: var(--text-mid);
}

.key-done {
  font-size: 45px;
  font-weight: 400;
  color: #000;
}

/* ─── Result section ───────────────────────────────────────────── */
.result-section {
  display: flex;
  justify-content: center;
  padding: 9px 0 40px;
}

.result-section.result-two {
  padding: 0 0 43px;
}

.result-section.result-balanced {
  padding: 0 0 40px;
}

.result-card {
  width: var(--kiosk-content-width);
  background: var(--cta-green);
  background-clip: border-box;
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  box-shadow: 0 0 0 2px var(--cta-green);
  overflow: hidden;
  position: relative;
  isolation: isolate;
  transform: translateZ(0);
}

.result-card::after {
  content: none;
}

.result-section.result-two .result-card {
  border-color: var(--cta-green);
}

.result-section.result-balanced .result-card {
  border-color: var(--cta-green);
}

/* ── Elements table ────────────────────────────────────────────── */
.elements-table-wrap {
  height: 175px;
  overflow: hidden;
  background: transparent;
  border-radius: 0;
}

.elements-table {
  width: 100%;
  height: 175px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.elements-table th,
.elements-table td {
  text-align: center;
  padding: 0 10px;
  font-size: 23px;
  border-right: 1px solid rgba(5,65,56,.45);
  line-height: 30px;
}
.elements-table td {
  font-size: 23px;
  font-weight: 700;
  color: var(--cta-green);
}

.elements-table thead tr { height: 85px; }
.elements-table tbody tr { height: 90px; }

.elements-table thead tr {
  background: transparent;
  color: #fff;
}

.elements-table th {
  background: transparent;
  border-right-color: rgba(255,255,255,.18);
}

.elements-table th:last-child,
.elements-table td:last-child {
  border-right: none;
}

.elements-table tbody tr {
  background: #f6f6f6;
}

.elements-table tbody td {
  border-bottom: 1px solid rgba(5,65,56,.45);
}

.elements-table th.col-label {
  font-size: 23px;
  font-weight: 700;
  min-width: 100px;
}
.elements-table td.row-label {
  font-size: 23px;
  font-weight: 700;
  color: var(--cta-green);
  line-height: 1.3;
  min-width: 100px;
}

.elements-table th.lacking { color: #fff; font-weight: 700; }
.elements-table td.lacking { color: var(--cta-green); font-weight: 700; }

.result-section.result-two .elements-table th.lacking {
  color: #fff;
}

.result-section.result-two .elements-table td,
.result-section.result-two .elements-table td.row-label,
.result-section.result-two .elements-table td.lacking {
  color: var(--cta-green);
  font-weight: 700;
}

.result-section.result-balanced .elements-table thead tr {
  background: transparent;
}

.result-section.result-balanced .elements-table td,
.result-section.result-balanced .elements-table td.row-label {
  color: var(--cta-green);
  font-weight: 700;
}

/* ── Result body (cream) ───────────────────────────────────────── */
.result-body {
  background: var(--cream);
  min-height: 709px;
  padding: 58px 56px 58px;
}

.result-section.result-two .result-body {
  min-height: 1071px;
  padding-top: 38px;
}

.result-section.result-balanced .result-body {
  min-height: 509px;
  padding: 67px 56px 58px;
}

.result-message {
  font-size: 25px;
  font-weight: 700;
  color: var(--accent-red);
  margin-bottom: 58px;
  line-height: 34px;
}

.result-section.result-two .result-message {
  margin-bottom: 26px;
}

.result-message.balanced {
  color: var(--green);
  margin-bottom: 4px;
}

.result-section.result-balanced .result-message.balanced {
  color: var(--cta-green);
  margin-bottom: 0;
}

.result-sub {
  display: block;
  font-size: 22px;
  font-weight: 400;
  color: var(--text-mid);
  margin-top: 10px;
}

.result-message.balanced .result-sub {
  color: var(--green);
  font-size: 24px;
  font-weight: 600;
  margin-top: 10px;
}

.result-section.result-balanced .result-message.balanced .result-sub {
  color: var(--cta-green);
  font-size: 25px;
  font-weight: 700;
  line-height: 34px;
  margin-top: 16px;
}

.element-divider {
  border: none;
  border-top: 1px solid rgba(0,0,0,.1);
  margin: 34px 0;
}

.element-divider-intro {
  border-top-color: rgba(10,80,70,.45);
  margin: 0 -5px 51px -13px;
}

.result-section.result-two .element-divider-intro {
  margin: 0 -10px 31px -8px;
}

.element-divider-between {
  border-top-color: rgba(10,80,70,.45);
  margin: 46px -5px 51px -13px;
}

.result-section.result-two .element-divider-between {
  margin: 47px -10px 34px -8px;
}

.result-section.result-balanced .element-divider {
  border-top-color: rgba(5,65,56,.5);
  margin: 49px -5px 43px -13px;
}

/* ── Element card ──────────────────────────────────────────────── */
.element-card { margin-top: 0; }

.element-card-title {
  display: inline-block;
  background: var(--cta-green);
  color: #fff;
  font-size: 22px;
  font-weight: 600;
  line-height: 29px;
  padding: 8px 30px;
  border-radius: 999px;
  margin-bottom: 52px;
}

html[lang="ko"] .result-section.result-two .element-card-title {
  width: 241px;
  padding-right: 0;
  padding-left: 0;
  text-align: center;
  margin-bottom: 25px;
}

.element-benefits {
  list-style: none;
  width: 633px;
  max-width: 100%;
  margin-bottom: 53px;
}

.result-section.result-two .element-benefits {
  width: 595px;
  margin-bottom: 41px;
}

html[lang="en"] .element-benefits,
html[lang="en"] .result-section.result-two .element-benefits {
  width: 100%;
}

.element-benefits li {
  font-size: 20px;
  line-height: 37px;
  color: var(--cta-green);
  padding: 0;
  position: relative;
}
.element-benefits li::before {
  content: '·';
  display: inline-block;
  margin-right: 4px;
  font-size: inherit;
  line-height: inherit;
}

.fortune-guide {
  width: 590px;
  max-width: 100%;
}

.result-section.result-two .fortune-guide {
  width: 595px;
}

html[lang="en"] .fortune-guide,
html[lang="en"] .result-section.result-two .fortune-guide {
  width: 100%;
}

.fortune-item {
  font-size: 20px;
  line-height: 38px;
  color: var(--green);
  padding: 0;
}

.fortune-label {
  font-weight: 700;
  color: var(--cta-green);
}

.fortune-sep {
  margin: 0;
  color: var(--cta-green);
  font-weight: 400;
}

.fortune-text { color: var(--cta-green); }

.element-recommend-list { list-style: none; }
.element-recommend-list li {
  font-size: 22px;
  line-height: 1.7;
  color: var(--text-mid);
  padding: 6px 0 6px 26px;
  position: relative;
}

.result-section.result-balanced .element-recommend-list {
  width: 805px;
  max-width: 100%;
}

.result-section.result-balanced .element-recommend-list li {
  color: var(--cta-green);
  font-size: 20px;
  line-height: 45px;
  padding: 0 0 0 26px;
}

.result-section.result-balanced .element-recommend-list li::before {
  color: var(--cta-green);
  left: 4px;
  line-height: 45px;
}

.result-section.result-balanced .element-recommend-list strong {
  color: var(--cta-green);
}
.element-recommend-list li::before {
  content: '•';
  position: absolute;
  left: 4px;
  color: var(--cta-green);
  line-height: 1.7;
}
.element-recommend-list strong {
  font-weight: 700;
  color: var(--cta-green);
}

/* ── Reset button ──────────────────────────────────────────────── */
.btn-reset {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  width: 100%;
  height: 85px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  color: #fff;
  font-size: 25px;
  line-height: 34px;
  font-weight: 700;
  font-family: inherit;
  text-align: center;
  letter-spacing: 0;
  transition: background .15s;
}
.btn-reset:hover { background: transparent; }

.result-section.result-balanced .btn-reset {
  background: transparent;
}

/* ─── Map panel ─────────────────────────────────────────────────── */
.map-panel {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.map-container { flex: 1; }

.map-pin-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -100%);
  font-size: 52px;
  pointer-events: none;
}

.map-bottom-bar {
  background: var(--card-bg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 -2px 8px rgba(0,0,0,.1);
}

.map-city-name {
  font-size: 26px;
  font-weight: 600;
  text-align: center;
  color: var(--text);
}

.map-actions { display: flex; gap: 16px; }

.btn-map-cancel {
  flex: 0;
  padding: 22px 34px;
  border-radius: var(--radius-sm);
  border: 2.5px solid var(--border);
  font-size: 26px;
  color: var(--text-mid);
  background: #fff;
}

.btn-map-confirm {
  flex: 1;
  padding: 22px;
  border-radius: var(--radius-sm);
  background: var(--green);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  font-family: inherit;
}

/* ─── Responsive: ≤680px (phone / small tablet) ────────────────── */
@media (max-width: 680px) {
  :root { --radius: 14px; --radius-sm: 8px; }

  .header { padding: 72px 24px 20px; }
  .logo-img { width: 160px; }
  .tagline { font-size: 13px; }
  .main-title { font-size: 15px; margin-top: 20px; }

  .lang-section { margin: 0 16px 16px; padding: 8px 12px; gap: 6px; }
  .lang-label { font-size: 13px; padding: 0 6px; }
  .lang-btn { padding: 6px 14px; font-size: 13px; }

  #form-section { padding: 0 16px; }

  .form-section-title { padding: 18px 20px 14px; font-size: 15px; border-bottom: 1px solid var(--border-light); }

  .toggle-row { justify-content: flex-start; gap: 10px; padding: 14px 16px 0; border-bottom: 1px solid var(--border-light); }
  .toggle-group { flex: 1; max-width: none; border-width: 1.5px; }
  .toggle-btn { padding: 9px 0; font-size: 14px; }
  .toggle-btn + .toggle-btn { border-left-width: 1.5px; }

  .input-row { padding: 0 16px; height: 56px; gap: 10px; border-bottom: 1px solid var(--border-light); }
  .input-label { font-size: 14px; width: 72px; }
  .input-field { height: 38px; border-width: 1.5px; padding: 0 12px; font-size: 15px; }
  #input-birthtime { flex: 1; width: auto; }
  .unknown-label { font-size: 13px; }

  .switch { width: 44px; height: 26px; }
  .switch::after { top: 3px; left: 3px; width: 20px; height: 20px; }
  .switch.on::after { transform: translateX(18px); }

  .time-notice { font-size: 11px; padding: 8px 16px; border-bottom: 1px solid var(--border-light); }

  .accuracy-toggle-row { padding: 10px 16px; }
  .accuracy-toggle-btn { padding: 10px; font-size: 13px; border-width: 1.5px; }
  .selected-city-row { padding: 8px 16px; }
  .selected-city-name { font-size: 13px; }
  .btn-change-city { font-size: 16px; }

  .form-error { margin: 8px 16px; font-size: 13px; }
  .btn-submit { padding: 18px; font-size: 17px; }

  #keypad { margin-top: 24px; }
  .key { height: 72px; }
  .key-num { font-size: 24px; }
  .key-del svg { width: 28px; height: 28px; }
  .key-done { font-size: 16px; }

  .result-section { padding: 0 16px 24px; }
  .btn-reset { padding: 18px; font-size: 17px; }
  .result-message { font-size: 17px; margin-bottom: 14px; }
  .result-sub { font-size: 13px; }
  .result-message.balanced .result-sub { font-size: 15px; }
  .elements-table th, .elements-table td { padding: 12px 6px; font-size: 14px; }
  .elements-table td { font-size: 16px; }
  .elements-table th.col-label { font-size: 13px; min-width: 64px; }
  .elements-table td.row-label { font-size: 12px; min-width: 64px; }
  .result-body { padding: 20px 16px 16px; }
  .element-card-title { font-size: 13px; padding: 5px 14px; margin-bottom: 12px; }
  .element-benefits li { font-size: 14px; padding: 2px 0 2px 14px; }
  .element-benefits li::before { font-size: 18px; left: 2px; }
  .element-benefits { margin-bottom: 14px; }
  .fortune-item { font-size: 14px; }
  .fortune-sep { margin: 0 3px; }
  .element-recommend-list li { font-size: 14px; padding: 4px 0 4px 16px; }
  .element-recommend-list li::before { left: 2px; }
  .element-divider { margin: 20px 0; }

  .map-pin-overlay { font-size: 32px; }
  .map-bottom-bar { padding: 16px; gap: 12px; }
  .map-city-name { font-size: 15px; }
  .map-actions { gap: 10px; }
  .btn-map-cancel { padding: 14px 20px; font-size: 16px; border-width: 1.5px; }
  .btn-map-confirm { padding: 14px; font-size: 15px; }
}

/* ─── Mobile-only page (/m) ───────────────────────────────────── */
html.mobile-page,
html.mobile-page body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
}

html.mobile-page .app {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  overflow-x: hidden;
}

html.mobile-page .header {
  padding: 24px 20px 22px;
}

html.mobile-page .logo-img {
  width: 160px;
  height: auto;
}

html.mobile-page .main-title {
  width: auto;
  max-width: 320px;
  margin: 12px auto 0;
  font-size: 17px;
  line-height: 1.65;
}

html.mobile-page .lang-section {
  width: auto;
  height: auto;
  margin: 0 16px 18px;
  padding: 12px;
  display: block;
  border-radius: 22px;
  overflow-x: visible;
}

html.mobile-page .lang-label {
  display: block;
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1;
  text-align: center;
  padding: 0 4px;
}

html.mobile-page .lang-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  margin-left: 0;
  flex-shrink: 1;
}

html.mobile-page .lang-btn {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 8px;
  font-size: 13px;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0,0,0,.18);
}

html.mobile-page .lang-btn[data-locale="zh-Hans"],
html.mobile-page .lang-btn[data-locale="zh-Hant"] {
  font-size: 12px;
}

html.mobile-page #form-section {
  padding: 0 16px 28px;
}

html.mobile-page .form-card {
  --card-action-height: 62px;
  width: 100%;
  border-radius: 14px;
}

html.mobile-page .form-section-title {
  padding: 24px 20px 18px;
  font-size: 17px;
  line-height: 1.45;
  border-bottom: none;
}

html.mobile-page .toggle-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: auto;
  gap: 10px;
  margin: 0;
  padding: 16px 16px 8px;
  transform: none;
  border-bottom: none;
}

html.mobile-page .toggle-group {
  width: 100%;
  max-width: none;
  height: 46px;
  padding: 2px;
  border-radius: 9px;
}

html.mobile-page .toggle-btn {
  min-width: 0;
  border-radius: 7px;
  font-size: 15px;
}

html.mobile-page .input-row {
  width: auto;
  height: auto;
  min-height: 70px;
  margin: 0;
  padding: 12px 16px;
  gap: 10px;
  border-bottom: none;
  transform: none;
}

html.mobile-page .input-label {
  width: 76px;
  font-size: 15px;
  line-height: 1.35;
}

html.mobile-page .input-field {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border-width: 1.5px;
  font-size: 17px;
}

html.mobile-page #input-birthtime {
  flex: none;
  width: 100%;
}

html.mobile-page #label-birthdate,
html.mobile-page #birthdate-field-shell {
  top: 0;
}

html.mobile-page #birthtime-field-shell {
  flex: none;
  width: 100%;
  min-width: 0;
}

html.mobile-page .input-field-shell {
  height: 44px;
}

html.mobile-page .input-caret {
  display: none !important;
}

html.mobile-page .unknown-row {
  flex: 0 0 auto;
  min-width: 78px;
  gap: 8px;
  margin-left: 0;
  justify-content: flex-end;
  transform: none;
  white-space: nowrap;
}

html.mobile-page .unknown-label {
  flex: 0 0 auto;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}

html.mobile-page .switch {
  width: 46px;
  height: 28px;
  border-radius: 8px;
}

html.mobile-page .switch::after {
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 7px;
}

html.mobile-page .switch.on::after {
  transform: translateX(18px);
}

html.mobile-page .input-row:has(#birthtime-field-shell) {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: center;
}

html.mobile-page .input-row:has(#birthtime-field-shell) .input-label {
  width: auto;
}

html.mobile-page .time-notice {
  padding: 12px 16px 16px;
  font-size: 12px;
  line-height: 1.45;
}

html.mobile-page .accuracy-toggle-row,
html.mobile-page .selected-city-row {
  padding: 12px 16px;
}

html.mobile-page .accuracy-toggle-btn {
  padding: 12px;
  border-width: 1.5px;
  font-size: 14px;
}

html.mobile-page .selected-city-name {
  min-width: 0;
  padding: 0 32px;
  font-size: 14px;
  line-height: 1.4;
}

html.mobile-page .btn-change-city {
  right: 16px;
  font-size: 18px;
}

html.mobile-page .form-error {
  margin: 12px 16px;
  font-size: 14px;
  line-height: 1.4;
}

html.mobile-page .btn-submit {
  width: 100%;
  height: 62px;
  margin: 0;
  padding: 0 16px;
  border-radius: 0;
  font-size: 18px;
}

html.mobile-page .form-card::after {
  content: none;
}

html.mobile-page .result-card::after {
  border-radius: 0;
}

html.mobile-page .btn-reset {
  width: 100%;
  margin: 0;
  border-radius: 0;
}

html.mobile-page #keypad {
  display: none !important;
}

html.mobile-page .result-section,
html.mobile-page .result-section.result-two,
html.mobile-page .result-section.result-balanced {
  padding: 0 16px 28px;
}

html.mobile-page .result-card {
  width: 100%;
  border-radius: 14px;
}

html.mobile-page .elements-table-wrap {
  width: 100%;
  height: auto;
  overflow: hidden;
}

html.mobile-page .elements-table {
  width: 100%;
  height: auto;
  table-layout: fixed;
}

html.mobile-page .elements-table thead tr,
html.mobile-page .elements-table tbody tr {
  height: auto;
}

html.mobile-page .elements-table th,
html.mobile-page .elements-table td {
  padding: 14px 3px;
  font-size: 13px;
  line-height: 1.25;
  word-break: keep-all;
}

html.mobile-page .elements-table td {
  font-size: 16px;
}

html.mobile-page .elements-table th.col-label,
html.mobile-page .elements-table td.row-label {
  min-width: 0;
  font-size: 12px;
}

html.mobile-page[lang="en"] .elements-table th.col-label,
html.mobile-page[lang="en"] .elements-table td.row-label {
  width: 20%;
  font-size: 11px;
  line-height: 1.15;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}

html.mobile-page .result-body,
html.mobile-page .result-section.result-two .result-body,
html.mobile-page .result-section.result-balanced .result-body {
  width: 100%;
  min-height: 0;
  padding: 22px 12px 26px;
  text-align: left;
}

html.mobile-page .result-message {
  margin-bottom: 22px;
  font-size: 16px;
  line-height: 1.55;
  text-align: left;
}

html.mobile-page .result-sub,
html.mobile-page .result-message.balanced .result-sub,
html.mobile-page .result-section.result-balanced .result-message.balanced .result-sub {
  font-size: 15px;
  line-height: 1.55;
}

html.mobile-page .result-section.result-balanced .result-message.balanced .result-sub {
  margin-top: 13px;
}

html.mobile-page .element-divider,
html.mobile-page .element-divider-intro,
html.mobile-page .element-divider-between,
html.mobile-page .result-section.result-two .element-divider-intro,
html.mobile-page .result-section.result-two .element-divider-between,
html.mobile-page .result-section.result-balanced .element-divider {
  margin: 22px 0;
}

html.mobile-page .element-card-title,
html.mobile-page[lang="ko"] .result-section.result-two .element-card-title {
  width: auto;
  max-width: 100%;
  margin-bottom: 18px;
  padding: 7px 14px;
  font-size: 13px;
  line-height: 1.3;
  text-align: left;
  white-space: nowrap;
}

html.mobile-page .element-benefits,
html.mobile-page .result-section.result-two .element-benefits,
html.mobile-page .fortune-guide,
html.mobile-page .result-section.result-two .fortune-guide,
html.mobile-page .result-section.result-balanced .element-recommend-list {
  width: 100%;
  max-width: 100%;
}

html.mobile-page .element-benefits {
  margin-bottom: 24px;
  width: calc(100% + 10px);
  max-width: none;
  margin-left: -10px;
}

html.mobile-page .elements-detail,
html.mobile-page .element-card,
html.mobile-page .element-benefits,
html.mobile-page .fortune-guide,
html.mobile-page .element-recommend-list {
  text-align: left;
}

html.mobile-page .element-benefits li,
html.mobile-page .fortune-item,
html.mobile-page .element-recommend-list li,
html.mobile-page .result-section.result-balanced .element-recommend-list li {
  font-size: clamp(10px, 3vw, 12px);
  line-height: 1.75;
  letter-spacing: 0;
  overflow-wrap: break-word;
}

html.mobile-page .element-benefits li {
  line-height: 1.38;
}

html.mobile-page .result-section.result-balanced .element-recommend-list {
  list-style: disc;
  padding-left: 1em;
}

html.mobile-page .result-section.result-balanced .element-recommend-list li {
  padding-left: 0;
  position: static;
}

html.mobile-page .result-section.result-balanced .element-recommend-list li::before {
  content: none;
}

html.mobile-page[lang="ko"] .element-benefits li,
html.mobile-page[lang="ko"] .fortune-item,
html.mobile-page[lang="ko"] .fortune-text {
  white-space: nowrap;
}

html.mobile-page:is([lang="ko"], [lang="ja"], [lang="zh-Hans"], [lang="zh-Hant"]) .element-benefits li,
html.mobile-page:is([lang="ko"], [lang="ja"], [lang="zh-Hans"], [lang="zh-Hant"]) .fortune-item,
html.mobile-page:is([lang="ko"], [lang="ja"], [lang="zh-Hans"], [lang="zh-Hant"]) .fortune-text,
html.mobile-page:is([lang="ko"], [lang="ja"], [lang="zh-Hans"], [lang="zh-Hant"]) .element-recommend-list li {
  word-break: keep-all;
}

html.mobile-page .fortune-item {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

html.mobile-page .fortune-label,
html.mobile-page .fortune-sep {
  flex: 0 0 auto;
}

html.mobile-page .fortune-text {
  flex: 1 1 auto;
  min-width: 0;
}

html.mobile-page .fortune-sep {
  margin: 0;
}

html.mobile-page .btn-reset {
  width: 100%;
  height: 58px;
  padding: 0 16px;
  font-size: 17px;
  line-height: 1.35;
}

html.mobile-page .map-pin-overlay {
  font-size: 34px;
}

html.mobile-page .map-bottom-bar {
  padding: 16px;
  gap: 12px;
}

html.mobile-page .map-city-name {
  font-size: 15px;
  line-height: 1.4;
}

html.mobile-page .map-actions {
  gap: 10px;
}

html.mobile-page .btn-map-cancel {
  padding: 14px 18px;
  border-width: 1.5px;
  font-size: 16px;
}

html.mobile-page .btn-map-confirm {
  padding: 14px;
  font-size: 15px;
}

@media (max-width: 360px) {
  html.mobile-page .header {
    padding-right: 16px;
    padding-left: 16px;
  }

  html.mobile-page #form-section,
  html.mobile-page .result-section,
  html.mobile-page .result-section.result-two,
  html.mobile-page .result-section.result-balanced {
    padding-right: 12px;
    padding-left: 12px;
  }

  html.mobile-page .toggle-row {
    grid-template-columns: 1fr;
  }

  html.mobile-page .input-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  html.mobile-page .input-label {
    width: 100%;
  }

  html.mobile-page .element-benefits li,
  html.mobile-page .fortune-item,
  html.mobile-page .element-recommend-list li,
  html.mobile-page .result-section.result-balanced .element-recommend-list li {
    font-size: 11px;
  }
}
