:root {
  --ivory: #f7f6eb;
  --paper: #fffaf0;
  --cocoa: #5d402c;
  --ink: #2f211a;
  --terracotta: #cc6e55;
  --mustard: #ddc470;
  --green: #5d9b84;
  --camel: #ae9477;
  --mist: #dbd2c2;
  --line: #06c755;
  --line-bg: #86a5c1;
  --white: #fff;
  --shadow: 0 24px 70px rgba(48, 29, 18, 0.22);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--ivory);
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

button, input, select, textarea { font: inherit; }

button { -webkit-tap-highlight-color: transparent; }

body {
  background:
    radial-gradient(circle at 18% 10%, rgba(221, 196, 112, .34), transparent 26rem),
    radial-gradient(circle at 82% 84%, rgba(93, 155, 132, .22), transparent 30rem),
    linear-gradient(135deg, #f7f6eb 0%, #efe5d4 100%);
}

.prototype-stage {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 430px) 430px;
  align-items: center;
  justify-content: center;
  gap: clamp(36px, 7vw, 110px);
  padding: 48px 32px;
}

.prototype-note { align-self: center; }
.prototype-logo { width: 112px; aspect-ratio: 1; object-fit: contain; display: block; margin-bottom: 24px; border: 6px solid #fff; box-shadow: 8px 8px 0 rgba(204,110,85,.48); }
.prototype-note .eyebrow,
.screen-eyebrow {
  letter-spacing: .16em;
  font-size: 11px;
  font-weight: 800;
  color: var(--terracotta);
}

.prototype-note h1 {
  margin: 18px 0;
  font-family: "Noto Serif TC", "Songti TC", serif;
  font-size: clamp(36px, 5vw, 60px);
  line-height: 1.18;
  letter-spacing: -.04em;
  color: var(--cocoa);
}

.prototype-note p { line-height: 1.85; color: #6e5a4d; max-width: 390px; }
.legend { display: flex; gap: 18px; margin-top: 26px; font-size: 13px; font-weight: 700; color: var(--cocoa); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.dot-orange { background: var(--terracotta); }
.dot-green { background: var(--green); }
.prototype-switch {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  margin-top: 28px;
  padding: 0 18px;
  border: 1px solid var(--cocoa);
  border-radius: 999px;
  color: var(--cocoa);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}
.prototype-switch:hover { background: var(--cocoa); color: var(--ivory); }

.phone-shell {
  position: relative;
  width: 390px;
  height: min(844px, calc(100vh - 52px));
  min-height: 680px;
  border: 10px solid #211914;
  border-radius: 46px;
  background: #211914;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.phone-speaker {
  position: absolute;
  z-index: 20;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 105px;
  height: 27px;
  border-radius: 0 0 18px 18px;
  background: #211914;
}

.app-frame { height: 100%; background: var(--ivory); overflow: hidden; border-radius: 35px; }
.screen { height: 100%; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.screen-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.screen-scroll::-webkit-scrollbar { display: none; }

.status-bar {
  height: 31px;
  padding: 8px 18px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  flex: 0 0 auto;
}

.status-icons { display: flex; gap: 5px; align-items: center; }
.status-icons span { width: 12px; height: 7px; border: 1.5px solid currentColor; border-radius: 2px; }

.line-header {
  height: 52px;
  padding: 6px 14px 10px;
  display: grid;
  grid-template-columns: 36px 1fr 70px;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #e9e9e9;
}

.icon-button { border: 0; background: transparent; width: 40px; height: 40px; font-size: 24px; cursor: pointer; color: #222; }
.line-title { text-align: center; font-weight: 800; font-size: 15px; }
.line-title small { display: block; font-weight: 500; color: #8a8a8a; font-size: 10px; margin-top: 1px; }
.line-actions { display: flex; justify-content: flex-end; gap: 4px; font-size: 18px; }

.chat-body {
  background: var(--line-bg);
  padding: 18px 14px 24px;
  min-height: 100%;
}

.date-pill {
  width: max-content;
  margin: 0 auto 20px;
  padding: 4px 11px;
  border-radius: 14px;
  background: rgba(60, 80, 98, .36);
  color: #fff;
  font-size: 10px;
}

.message-row { display: flex; gap: 8px; margin-bottom: 14px; align-items: flex-start; }
.message-row.me { justify-content: flex-end; }
.avatar {
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--cocoa);
  color: var(--ivory);
  display: grid;
  place-items: center;
  font-family: serif;
  font-size: 18px;
  border: 2px solid rgba(255,255,255,.75);
}

.bubble {
  max-width: 76%;
  padding: 10px 13px;
  border-radius: 5px 17px 17px 17px;
  background: #fff;
  font-size: 13px;
  line-height: 1.55;
  box-shadow: 0 2px 5px rgba(0,0,0,.06);
}

.me .bubble { background: #8de055; border-radius: 17px 5px 17px 17px; }
.message-meta { color: rgba(255,255,255,.9); font-size: 9px; align-self: flex-end; padding-bottom: 2px; }

.carousel-wrap { margin: 4px -14px 18px 43px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-right: 50px; }
.carousel-wrap::-webkit-scrollbar { display: none; }
.service-carousel { display: flex; gap: 10px; width: max-content; }

.service-card {
  position: relative;
  width: 272px;
  flex: 0 0 auto;
  scroll-snap-align: start;
  background: #fff;
  border-radius: 7px;
  overflow: hidden;
  box-shadow: 0 7px 18px rgba(42,52,61,.14);
}
.service-card::before {
  content: "GUTENG SERVICE  ·  EST. 1993";
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 12px;
  padding: 5px 8px;
  background: rgba(93,64,44,.88);
  color: #f7f6eb;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .12em;
}

.service-art { width: 100%; aspect-ratio: 1.45 / 1; object-fit: cover; object-position: center 45%; display: block; }
.service-copy { padding: 13px 14px 12px; }
.service-copy h3 { margin: 0 0 6px; font-family: "Noto Serif TC", serif; font-size: 20px; color: var(--cocoa); }
.service-copy p { margin: 0 0 11px; font-size: 11px; line-height: 1.55; color: #716158; }
.service-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 800; color: var(--cocoa); margin-bottom: 11px; }
.service-meta .sample { font-size: 9px; color: #9c887b; font-weight: 600; }
.card-cta {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 3px;
  background: var(--cocoa);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.card-cta.green { background: #416f5f; }

.chat-compose { background: #fff; padding: 8px 9px max(8px, env(safe-area-inset-bottom)); border-top: 1px solid #eee; }
.compose-row { display: grid; grid-template-columns: 32px 1fr 32px; align-items: center; gap: 7px; }
.compose-input { height: 34px; border-radius: 18px; background: #f2f2f2; display: flex; align-items: center; padding: 0 13px; color: #9b9b9b; font-size: 12px; }
.rich-menu { margin-top: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.rich-button { min-height: 42px; border: 1px solid #e2d8cc; background: var(--ivory); color: var(--cocoa); font-weight: 800; border-radius: 5px; cursor: pointer; }

.liff-header {
  background: var(--cocoa);
  color: var(--ivory);
  flex: 0 0 auto;
}
.liff-nav { height: 58px; display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; padding: 0 4px; }
.liff-nav button { color: inherit; }
.liff-brand { display: flex; align-items: center; justify-content: center; gap: 8px; text-align: left; }
.liff-brand img { width: 34px; height: 34px; object-fit: cover; object-position: center; border-radius: 50%; border: 2px solid rgba(247,246,235,.85); background: #fff; }
.liff-brand strong { display: block; font-family: "Noto Serif TC", serif; font-size: 14px; letter-spacing: .1em; }
.liff-brand small { display: block; margin-top: 1px; color: #d9c9b6; font-size: 7px; font-weight: 800; letter-spacing: .12em; }

.progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 0 20px 13px; }
.progress span { height: 3px; border-radius: 4px; background: rgba(255,255,255,.25); }
.progress span.active { background: var(--mustard); }

.booking-body {
  position: relative;
  min-height: 100%;
  padding: 22px 20px 120px;
  background:
    linear-gradient(rgba(247,246,235,.93), rgba(247,246,235,.96)),
    radial-gradient(circle at 10px 10px, rgba(93,64,44,.16) 1px, transparent 1px);
  background-size: auto, 18px 18px;
}
.booking-body::before {
  content: "✦";
  position: absolute;
  z-index: 0;
  right: -45px;
  top: -42px;
  width: 118px;
  height: 118px;
  border: 1px solid rgba(204,110,85,.22);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: rgba(221,196,112,.42);
  font-size: 38px;
}
.booking-body > * { position: relative; z-index: 1; }

.selected-service {
  position: relative;
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 12px;
  align-items: center;
  padding-bottom: 17px;
  border-bottom: 1px solid #d7cbbb;
  margin-bottom: 22px;
}
.selected-service::after { content: "EST. 1993"; position: absolute; right: 0; top: 2px; color: var(--terracotta); font-family: serif; font-size: 8px; letter-spacing: .12em; }
.selected-service img { width: 62px; height: 62px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: 0 3px 12px rgba(79,53,36,.13); }
.selected-service h2 { margin: 0 0 4px; font-family: "Noto Serif TC", serif; font-size: 20px; color: var(--cocoa); }
.selected-service p { margin: 0; color: #7b675a; font-size: 12px; }

.section-heading { margin-bottom: 17px; }
.section-heading h2 { margin: 5px 0 6px; font-family: "Noto Serif TC", serif; font-size: 26px; line-height: 1.25; color: var(--cocoa); }
.section-heading p { margin: 0; font-size: 12px; line-height: 1.65; color: #78675c; }

.month-label { margin: 24px 0 12px; color: var(--cocoa); font-family: "Noto Serif TC", serif; font-size: 18px; font-weight: 800; }
.month-section + .month-section .month-label { border-top: 1px solid #d7cbbb; padding-top: 20px; margin-top: 24px; }
.date-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.availability-state { grid-column: 1 / -1; padding: 34px 12px; border: 1px dashed #cdbbaa; border-radius: 8px; text-align: center; color: #806d60; font-size: 12px; }
.date-button {
  min-height: 68px;
  border: 1px solid #d8cdbf;
  background: rgba(255,255,255,.72);
  border-radius: 8px;
  color: var(--cocoa);
  cursor: pointer;
}
.date-button strong { display: block; font-size: 18px; }
.date-button small { font-size: 10px; color: #8f7a6d; }
.date-button.selected { border-color: var(--terracotta); background: var(--terracotta); color: #fff; }
.date-button.selected small { color: #fff; }
.date-button.closed { opacity: .38; text-decoration: line-through; cursor: not-allowed; }

.time-group { margin-top: 22px; }
.time-group h3 { font-size: 13px; color: #6e5a4e; margin: 0 0 10px; }
.time-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.time-button { min-height: 48px; border: 1px solid #cfc1b1; background: #fff; border-radius: 6px; color: var(--cocoa); font-weight: 800; cursor: pointer; }
.time-button.selected { color: #fff; border-color: var(--green); background: var(--green); }
.time-button.closed { opacity: .34; text-decoration: line-through; cursor: not-allowed; }

.info-note { margin-top: 20px; padding: 13px 14px; border-left: 3px solid var(--mustard); background: rgba(255,255,255,.64); color: #715f52; font-size: 11px; line-height: 1.65; }
.error-note { border-left-color: var(--terracotta); color: #8c3e2d; background: #fff0ea; }
.text-link { border: 0; background: transparent; color: var(--terracotta); font-weight: 800; text-decoration: underline; cursor: pointer; padding: 14px 0; }

.bottom-action {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  padding: 12px 18px max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(93,64,44,.11);
  background: rgba(247,246,235,.96);
  backdrop-filter: blur(12px);
}
.bottom-action::before { content: ""; position: absolute; left: 18px; right: 18px; top: -1px; height: 2px; background: linear-gradient(90deg, var(--terracotta) 0 28%, var(--mustard) 28% 58%, var(--green) 58% 78%, transparent 78%); opacity: .72; }
.primary-button { width: 100%; min-height: 52px; border: 0; border-radius: 7px; background: var(--terracotta); color: #fff; font-weight: 900; letter-spacing: .03em; cursor: pointer; box-shadow: 0 7px 18px rgba(204,110,85,.23); }
.primary-button:disabled { opacity: .42; cursor: not-allowed; box-shadow: none; }
.secondary-button { width: 100%; min-height: 48px; border: 1px solid #cdbbaa; border-radius: 7px; background: transparent; color: var(--cocoa); font-weight: 800; cursor: pointer; }

.summary-card { padding: 16px; border: 1px solid #d5c7b7; background: rgba(255,255,255,.72); margin: 16px 0 22px; }
.summary-line { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 13px; }
.summary-line span { color: #846f61; }
.summary-line strong { text-align: right; color: var(--cocoa); }
.summary-line.total { margin-top: 6px; padding-top: 12px; border-top: 1px solid #ddd0c1; }

.field { margin: 0 0 16px; }
.field label { display: block; font-size: 12px; font-weight: 800; color: var(--cocoa); margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid #ccbdaa;
  border-radius: 6px;
  background: rgba(255,255,255,.88);
  padding: 0 13px;
  color: var(--ink);
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--terracotta); box-shadow: 0 0 0 3px rgba(204,110,85,.12); }
.field textarea { min-height: 88px; padding-top: 12px; resize: vertical; }
.field-help { display: block; margin-top: 5px; color: #8c796c; font-size: 10px; }
.birthday-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.disclosure { border: 0; background: transparent; color: var(--cocoa); padding: 9px 0 16px; font-weight: 800; cursor: pointer; text-align: left; }
.consent { display: grid; grid-template-columns: 22px 1fr; gap: 9px; align-items: start; font-size: 11px; color: #705f53; line-height: 1.55; margin-top: 20px; }
.consent input { width: 19px; height: 19px; accent-color: var(--terracotta); }

.state-body { min-height: 100%; padding: 42px 22px 120px; text-align: center; background: var(--ivory); }
.state-mark { width: 94px; height: 94px; margin: 6px auto 23px; border-radius: 50%; display: grid; place-items: center; position: relative; background: #efe0c2; color: var(--cocoa); font-family: serif; font-size: 36px; }
.state-mark::after { content: ""; position: absolute; inset: -8px; border: 1px dashed var(--terracotta); border-radius: 50%; }
.state-mark::before { content: "EST. 1993"; position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); color: var(--terracotta); font-family: sans-serif; font-size: 6px; font-weight: 900; letter-spacing: .12em; white-space: nowrap; }
.state-body h2 { margin: 0 0 10px; font-family: "Noto Serif TC", serif; color: var(--cocoa); font-size: 28px; }
.state-body > p { margin: 0 auto; max-width: 300px; color: #745f52; font-size: 13px; line-height: 1.75; }
.my-bookings-body { padding-bottom: 112px; }
.my-booking-card { border: 1px solid #d5c7b7; border-left: 6px solid var(--green); border-radius: 9px; background: rgba(255,255,255,.82); padding: 16px; margin: 14px 0; box-shadow: 0 4px 14px rgba(93,64,44,.05); }
.my-booking-top { display: flex; justify-content: space-between; gap: 10px; color: var(--terracotta); font-size: 12px; font-weight: 800; }
.my-booking-top strong { color: var(--cocoa); }
.my-booking-time { color: var(--cocoa); font-family: "Noto Serif TC", serif; font-size: 30px; font-weight: 800; margin: 6px 0; }
.my-booking-service { color: #715f52; font-size: 13px; }
.my-booking-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 16px; }
.my-booking-actions button { min-height: 46px; border: 1px solid #cdbbaa; border-radius: 6px; background: #fff; color: var(--cocoa); font-weight: 800; cursor: pointer; }
.my-booking-actions button:last-child { color: #9d4b39; }
.request-hint { margin-top: 14px; padding: 10px 12px; border-left: 3px solid var(--mustard); background: #fbf4df; color: #68513e; font-size: 12px; line-height: 1.6; }
.empty-bookings { text-align: center; padding: 24px 8px; color: var(--cocoa); }
.empty-bookings h3 { font-size: 19px; margin: 0 0 8px; }
.empty-bookings p { color: #715f52; font-size: 12px; line-height: 1.8; }
.empty-bookings .secondary-button { margin-top: 12px; }
.success-note { border-left-color: var(--green); }
.line-link-body { padding-top: 30px; }
.link-success { padding: 13px 14px; border-radius: 7px; background: #e4f2e9; color: #356b56; font-weight: 800; line-height: 1.6; }
.confirm-overlay { position: absolute; inset: 0; z-index: 20; background: rgba(31,21,16,.65); display: grid; place-items: center; padding: 20px; }
.confirm-panel { width: 100%; max-width: 350px; padding: 22px; border-radius: 12px; background: var(--paper); color: var(--cocoa); box-shadow: var(--shadow); }
.confirm-panel h3 { margin: 0 0 12px; font-family: "Noto Serif TC", serif; font-size: 22px; }
.confirm-panel p { line-height: 1.7; font-size: 13px; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }
.confirm-actions .primary-button, .confirm-actions .secondary-button { min-height: 50px; font-size: 13px; }
.prototype-badge { display: inline-block; margin: 20px auto 0; padding: 5px 9px; border: 1px solid var(--terracotta); color: var(--terracotta); font-size: 9px; letter-spacing: .12em; font-weight: 900; }

.confirmed-card { background: #fff; border-radius: 8px; overflow: hidden; margin: 0 0 14px 43px; box-shadow: 0 6px 16px rgba(42,52,61,.13); }
.confirmed-band { position: relative; background: var(--green); color: #fff; padding: 14px; overflow: hidden; }
.confirmed-band::after { content: "✦"; position: absolute; right: 14px; top: 4px; color: rgba(255,255,255,.3); font-size: 45px; }
.confirmed-band small { display: block; opacity: .8; font-size: 9px; letter-spacing: .12em; margin-bottom: 4px; }
.confirmed-band strong { font-family: "Noto Serif TC", serif; font-size: 20px; }
.confirmed-content { padding: 14px; }
.confirmed-content p { margin: 0 0 10px; font-size: 12px; line-height: 1.6; color: #705f53; }
.confirmed-actions { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid #eee; }
.confirmed-actions button { min-height: 44px; border: 0; background: #fff; color: var(--green); font-weight: 800; cursor: pointer; }
.confirmed-actions button + button { border-left: 1px solid #eee; color: var(--terracotta); }

.toast { position: absolute; z-index: 30; left: 50%; bottom: 86px; transform: translateX(-50%); background: rgba(42,29,21,.92); color: #fff; padding: 10px 14px; border-radius: 6px; font-size: 11px; white-space: nowrap; animation: toast 2.4s forwards; }
@keyframes toast { 0%,100% { opacity: 0; transform: translate(-50%, 8px); } 12%,82% { opacity: 1; transform: translate(-50%, 0); } }

@media (max-width: 780px) {
  body { background: #211914; }
  .prototype-stage { display: block; min-height: 100vh; padding: 0; }
  .prototype-note { display: none; }
  .phone-shell { width: 100%; height: 100dvh; min-height: 640px; border: 0; border-radius: 0; box-shadow: none; }
  .phone-speaker { display: none; }
  .app-frame { border-radius: 0; }
}

@media (max-height: 730px) and (min-width: 781px) {
  .phone-shell { height: calc(100vh - 24px); min-height: 620px; }
  .prototype-stage { padding-block: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; }
}
