:root {
  color-scheme: light;
  --ink: #23301f;
  --soft-ink: #4f5a4a;
  --muted: #879080;
  --line: #d8dfd1;
  --paper: #fbfcf7;
  --canvas: #eef3e8;
  --warm: #a99d78;
  --moss: #384235;
  --brand: #41543a;
  --mist: #f5f8f1;
  --leaf-soft: #e4ebdd;
  --shadow: 0 18px 46px rgba(47, 67, 41, 0.12);
  --tab-height: 66px;
  --ui-font: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  --brand-font: "Avenir Next Rounded", "Nunito Sans", "Arial Rounded MT Bold", "PingFang SC", "Microsoft YaHei", sans-serif;
  --script-font: "Segoe Script", "Snell Roundhand", "Brush Script MT", cursive;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  background: #e3eadc;
  color: var(--ink);
  font-family: var(--ui-font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  color: inherit;
  cursor: pointer;
}

.mini-app {
  position: relative;
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--canvas);
}

.mini-topbar {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 50%;
  width: min(100%, 430px);
  height: 70px;
  transform: translateX(-50%);
  pointer-events: none;
}

.language-toggle,
.back-button {
  position: absolute;
  pointer-events: auto;
}

.language-toggle {
  top: 38px;
  left: 14px;
  display: flex;
  gap: 2px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  padding: 2px;
  color: #ffffff;
  background: rgba(24, 20, 15, 0.2);
  backdrop-filter: blur(12px);
  font-size: 11px;
  font-weight: 800;
}

.language-toggle button {
  display: grid;
  min-width: 29px;
  min-height: 20px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: inherit;
  background: transparent;
  font: inherit;
}

.language-toggle button.active {
  background: rgba(255, 255, 255, 0.46);
}

.back-button {
  top: 38px;
  left: 14px;
  display: none;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  font-size: 34px;
  line-height: 1;
}

.back-button.visible {
  display: block;
}

.view,
.screen {
  display: none;
}

.view {
  min-height: 100vh;
  padding-bottom: calc(var(--tab-height) + env(safe-area-inset-bottom));
}

.view.active,
.screen.active {
  display: block;
}

.home-view {
  position: relative;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(20, 16, 10, 0.2), rgba(20, 16, 10, 0.28) 52%, rgba(18, 13, 8, 0.72)),
    var(--hero-image, url("/uploads/mamala-hero-fast.webp")) center/cover;
}

.home-view::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 42%;
  content: "";
  background: linear-gradient(180deg, transparent, rgba(18, 13, 8, 0.58));
}

.hero-content {
  position: absolute;
  z-index: 1;
  right: 34px;
  bottom: 92px;
  left: 34px;
  display: grid;
  justify-items: center;
  gap: 10px;
  color: #fffaf2;
  text-align: center;
}

.hero-kicker,
.section-kicker {
  margin: 0;
  color: rgba(255, 250, 242, 0.74);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.hero-logo,
.page-brand,
.notice-logo {
  color: var(--brand);
  font-family: var(--brand-font);
  font-weight: 800;
  letter-spacing: 0;
}

.hero-logo {
  width: min(78vw, 330px);
  aspect-ratio: 900 / 414;
  background: url("/uploads/mamala-logo-from-pdf.webp") center / contain no-repeat;
  color: transparent;
  font-size: 0;
  line-height: 0;
  text-shadow: none;
  filter:
    drop-shadow(0 1px 0 rgba(255, 250, 242, 0.42))
    drop-shadow(0 8px 18px rgba(0, 0, 0, 0.3));
}

.hero-copy {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.38);
}

.hero-reserve {
  min-width: 118px;
  min-height: 36px;
  border: 1px solid rgba(255, 250, 242, 0.92);
  border-radius: 999px;
  color: #fffaf2;
  background: rgba(255, 250, 242, 0.07);
  backdrop-filter: blur(8px);
  font-size: 13px;
  font-weight: 900;
}

.reserve-view,
.mine-view {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(251, 252, 247, 0.82), rgba(238, 243, 232, 0.94)),
    var(--canvas);
}

#branch-screen {
  padding: 86px 16px 88px;
}

.page-brand {
  margin: 0 0 18px;
  font-size: 34px;
  line-height: 1;
}

.section-kicker {
  color: var(--muted);
}

.page-title {
  margin: 5px 0 16px;
  font-size: 23px;
  line-height: 1.18;
}

.branch-card {
  position: relative;
  min-height: 218px;
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid rgba(23, 21, 18, 0.12);
  border-radius: 12px;
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow);
}

.branch-card::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.54)),
    rgba(0, 0, 0, 0.08);
}

.branch-list {
  display: grid;
  gap: 12px;
}

.branch-copy {
  position: absolute;
  inset: auto 18px 18px;
  display: grid;
  gap: 8px;
  color: #fffaf2;
}

.branch-copy strong {
  font-family: var(--brand-font);
  font-size: 27px;
  font-weight: 800;
  line-height: 1.05;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.36);
}

.branch-copy span {
  font-size: 14px;
  line-height: 1.45;
  font-weight: 800;
  color: rgba(255, 250, 242, 0.82);
}

.ghost-button {
  width: fit-content;
  min-width: 88px;
  margin-top: 4px;
  border: 1px solid rgba(255, 250, 242, 0.86);
  border-radius: 999px;
  padding: 7px 20px;
  color: #fffaf2;
  background: rgba(255, 250, 242, 0.08);
  font-size: 14px;
  font-weight: 900;
}

.notice-screen {
  min-height: 100vh;
  padding: 86px 18px 208px;
  background: var(--paper);
}

.notice-logo {
  margin: 0 auto 10px;
  font-size: 29px;
  text-align: center;
}

.selected-branch-label,
.booking-branch-label {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 900;
  text-align: center;
}

.notice-screen h1 {
  margin: 0 0 22px;
  font-size: 23px;
  text-align: center;
}

.notice-copy {
  color: var(--soft-ink);
  font-size: 14.5px;
  line-height: 1.58;
}

.notice-copy h2 {
  margin: 20px 0 8px;
  color: var(--ink);
  font-size: 16px;
}

.notice-copy p {
  margin: 0 0 6px;
}

.agree-row {
  position: fixed;
  z-index: 18;
  right: max(0px, calc((100vw - 430px) / 2));
  bottom: calc(var(--tab-height) + env(safe-area-inset-bottom));
  left: max(0px, calc((100vw - 430px) / 2));
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 14px 18px 68px;
  border-radius: 20px 20px 0 0;
  background: rgba(251, 252, 247, 0.98);
  box-shadow: 0 -8px 24px rgba(47, 67, 41, 0.09);
  font-size: 13px;
  font-weight: 900;
}

.agree-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--ink);
}

.pill-button {
  position: fixed;
  z-index: 21;
  right: max(54px, calc((100vw - 430px) / 2 + 54px));
  bottom: calc(var(--tab-height) + 14px + env(safe-area-inset-bottom));
  left: max(54px, calc((100vw - 430px) / 2 + 54px));
  min-height: 44px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  color: var(--paper);
  background: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.pill-button:disabled {
  border-color: #bac5b0;
  color: #8b9484;
  background: transparent;
}

.booking-screen {
  padding: 86px 0 96px;
  background: var(--paper);
}

.month-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.month-row h1 {
  margin: 0;
  font-size: 23px;
}

.month-button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--leaf-soft);
  color: var(--soft-ink);
  font-size: 26px;
  line-height: 0.7;
}

.week-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 0 18px;
}

.week-row {
  margin-top: 20px;
  color: var(--soft-ink);
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

.calendar-grid {
  row-gap: 11px;
  margin-top: 14px;
}

.day-cell {
  position: relative;
  z-index: 0;
  display: grid;
  min-height: 36px;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
}

.day-cell.past {
  color: #bac5b0;
}

.day-cell.bookable::after {
  position: absolute;
  z-index: -1;
  bottom: 6px;
  width: 24px;
  height: 14px;
  content: "";
  background: repeating-linear-gradient(-45deg, #dce6d4 0 2px, transparent 2px 5px);
}

.day-cell.selected {
  color: #fffaf2;
  z-index: 1;
}

.day-cell.selected::before {
  position: absolute;
  z-index: -1;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--ink);
  content: "";
}

.slot-strip {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  padding: 10px 14px;
  overflow-x: auto;
  background: var(--leaf-soft);
  box-shadow: inset 0 1px 0 rgba(47, 67, 41, 0.08);
}

.slot-card {
  flex: 0 0 126px;
  min-height: 58px;
  border: 1px solid rgba(47, 67, 41, 0.12);
  border-radius: 10px;
  background: rgba(251, 252, 247, 0.82);
  color: var(--muted);
}

.slot-card strong,
.slot-card span {
  display: block;
}

.slot-card strong {
  font-size: 16px;
}

.slot-card span {
  margin-top: 5px;
  font-size: 13px;
}

.slot-card.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fffaf2;
}

.empty-slot {
  display: none;
  min-height: 340px;
  place-content: center;
  justify-items: center;
  gap: 22px;
  color: var(--ink);
  background: var(--leaf-soft);
  font-size: 17px;
}

.empty-slot.active {
  display: grid;
}

.door-icon {
  width: 34px;
  height: 54px;
  border: 5px solid var(--muted);
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
}

.door-icon::after {
  display: block;
  width: 7px;
  height: 7px;
  margin: 22px 0 0 20px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
}

.booking-form {
  display: none;
  margin: 14px 14px 0;
  padding: 14px;
  border: 1px solid rgba(47, 67, 41, 0.08);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.booking-form.active {
  display: grid;
  gap: 12px;
}

.selected-summary {
  display: grid;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.selected-summary strong {
  font-size: 17px;
}

.selected-summary span {
  color: var(--muted);
  font-size: 15px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.readonly-field {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.readonly-field strong {
  display: grid;
  min-height: 43px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--mist);
  color: var(--muted);
  padding: 0 12px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--mist);
  outline: none;
  padding: 10px 11px;
  font-size: 15px;
  line-height: 1.45;
}

textarea {
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.submit-button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  color: #fffaf2;
  background: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.form-message.error {
  color: #a93c2d;
}

.form-message.success {
  color: var(--moss);
}

.mine-view {
  padding: 132px 22px 120px;
}

.profile-card {
  padding: 24px 20px;
  border: 1px solid rgba(47, 67, 41, 0.08);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.profile-head,
.arrival-row {
  display: flex;
  align-items: center;
}

.profile-head {
  gap: 14px;
}

.profile-head div {
  flex: 1;
  min-width: 0;
}

.profile-head strong {
  display: block;
  font-size: 18px;
  font-weight: 900;
}

.profile-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.profile-head button {
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--paper);
  background: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.avatar-icon {
  width: 54px;
  height: 54px;
  border: 3px solid var(--warm);
  border-radius: 50%;
}

.arrival-row {
  width: 100%;
  justify-content: space-between;
  margin-top: 28px;
  border: 0;
  border-bottom: 1.5px solid var(--ink);
  background: transparent;
  padding: 0 0 16px;
  font-size: 19px;
  font-weight: 900;
}

.upcoming-card {
  display: grid;
  min-height: 112px;
  place-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
  font-size: 15px;
  font-weight: 800;
}

.upcoming-card strong {
  color: var(--ink);
  font-size: 16px;
}

.upcoming-card span {
  font-size: 14px;
}

.mine-list {
  margin-top: 32px;
}

.mine-list h2 {
  margin: 0 0 14px;
  font-size: 19px;
}

.my-bookings {
  display: grid;
  gap: 12px;
}

.booking-card,
.empty-card {
  border: 1px solid rgba(47, 67, 41, 0.08);
  border-radius: 12px;
  background: var(--paper);
  padding: 17px;
}

.booking-card {
  display: grid;
  gap: 6px;
}

.booking-card.cancelled {
  opacity: 0.62;
}

.booking-card strong {
  font-size: 15px;
}

.booking-card span {
  color: var(--muted);
  font-size: 14px;
}

.booking-card em {
  width: fit-content;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  padding: 4px 9px;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.empty-card {
  color: var(--muted);
  text-align: center;
}

.provider {
  margin: 48px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.tabbar {
  position: fixed;
  z-index: 30;
  right: max(0px, calc((100vw - 430px) / 2));
  bottom: 0;
  left: max(0px, calc((100vw - 430px) / 2));
  display: grid;
  height: calc(var(--tab-height) + env(safe-area-inset-bottom));
  grid-template-columns: repeat(3, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid rgba(47, 67, 41, 0.1);
  background: rgba(251, 252, 247, 0.96);
  backdrop-filter: blur(14px);
}

.tab {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  border: 0;
  color: #99a190;
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.tab.active {
  color: var(--ink);
}

.tab-icon {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

@media (min-width: 431px) {
  .mini-app {
    min-height: 920px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.14);
  }
}

@media (max-width: 360px) {
  .notice-copy {
    font-size: 16px;
  }

  .branch-card {
    min-height: 280px;
  }

  .slot-card {
    flex-basis: 120px;
  }
}
