@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(assets/manrope-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(assets/manrope-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #F5F7F8;
  --green: #1D8B58;
  --green-hi: #27AE6E;
  --green-dark: #17714A;
  --grad: linear-gradient(135deg, #27AE6E 0%, #1D8B58 60%, #17714A 100%);
  --ink: #0F1720;
  --gray: #8A93A0;
  --card: #FFFFFF;
  --star: #FFB800;
  --shadow: 0 10px 30px rgba(15, 23, 32, .07), 0 2px 8px rgba(15, 23, 32, .05);
  --glow: 0 12px 28px rgba(29, 139, 88, .35);
  --radius: 20px;
  --red: #D64545;
  --red-soft: #FDECEC;
  --amber: #A87700;
  --amber-soft: #FFF4DE;
  --green-soft: #E6F5EE;
  --line: #E1E5EA;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  font-family: 'Manrope', -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(120% 50% at 50% -10%, rgba(39, 174, 110, .10), transparent 60%),
    var(--bg);
  color: var(--ink);
  user-select: none;
  overscroll-behavior: none;
}

.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(16px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  animation: rise .3s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.hidden { display: none; }

.topbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  min-height: 50px;
}

.square-btn {
  width: 48px; height: 48px;
  background: var(--card);
  border: none;
  border-radius: 16px;
  box-shadow: var(--shadow);
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform .12s ease;
}
.square-btn:active { transform: scale(.92); }
.square-spacer { width: 48px; }

.lang-spacer, .lang-wrap { flex: 1 1 0; min-width: 48px; }
.lang-wrap { display: flex; justify-content: flex-end; }
.lang-select {
  height: 42px;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%230F1720' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center / 16px 16px;
  border: none;
  border-radius: 14px;
  box-shadow: var(--shadow);
  font: inherit;
  font-size: 14px; font-weight: 800; color: var(--ink);
  cursor: pointer;
  padding: 0 32px 0 14px;
  -webkit-appearance: none; appearance: none;
}

.logo { width: 150px; margin: 22px 0 6px; }
.logo-small { width: 118px; margin: 0; }

.title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.02em;
  text-align: center;
  margin: 16px 0;
}

.btn-green {
  width: 100%;
  max-width: 340px;
  height: 58px;
  background: var(--grad);
  color: #fff;
  border: none;
  border-radius: 18px;
  box-shadow: var(--glow);
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.01em;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.btn-green:active { transform: scale(.97); box-shadow: 0 6px 16px rgba(29, 139, 88, .3); }
.btn-green:disabled { opacity: .35; box-shadow: none; cursor: default; }

.hint { font-size: 14px; font-weight: 500; color: var(--gray); text-align: center; margin-top: 14px; max-width: 300px; }

.row-card {
  width: 100%; max-width: 340px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 15px 20px;
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px;
}
.row-label { font-size: 14.5px; font-weight: 600; color: var(--gray); }
.row-value { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.row-value.big { font-size: 25px; letter-spacing: -.02em; }
.row-value.green { color: var(--green-dark); }
.row-card.total { background: linear-gradient(135deg, rgba(39,174,110,.10), rgba(29,139,88,.05)); box-shadow: inset 0 0 0 1.5px rgba(29,139,88,.35), var(--shadow); }
.row-card.total .row-value { color: var(--green-dark); }

/* Home: profile */
.profile-row {
  width: 100%; max-width: 380px;
  display: flex; align-items: center; gap: 14px;
  margin-top: 6px;
}
.profile-hello { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.profile-venue { font-size: 13px; font-weight: 600; color: var(--gray); margin-top: 2px; }

/* Home: balance */
.balance-card {
  width: 100%; max-width: 380px;
  background: var(--grad);
  border-radius: var(--radius);
  box-shadow: var(--glow);
  padding: 20px;
  display: flex; flex-direction: column; align-items: flex-start;
  color: #fff;
  margin-top: 16px;
}
.balance-label { font-size: 13.5px; font-weight: 700; opacity: .85; }
.balance-amount {
  font-size: 42px; font-weight: 800; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  margin: 2px 0 16px;
}
.btn-white {
  width: 100%; height: 52px;
  background: #fff; color: var(--green-dark);
  border: none; border-radius: 16px;
  font: inherit; font-size: 16.5px; font-weight: 800;
  cursor: pointer;
  transition: transform .12s ease, opacity .12s ease;
}
.btn-white:active { transform: scale(.97); }
.btn-white:disabled { opacity: .5; cursor: default; }

.actions-row { display: flex; gap: 10px; width: 100%; max-width: 380px; margin-top: 10px; }
.action-card {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--card);
  border: none; border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 15px 10px;
  font: inherit; font-size: 14.5px; font-weight: 800; color: var(--ink);
  cursor: pointer;
  transition: transform .12s ease;
}
.action-card:active { transform: scale(.95); }
.action-card svg { color: var(--green); flex-shrink: 0; }

/* Home: history */
.list-title {
  width: 100%; max-width: 380px;
  font-size: 17px; font-weight: 800; letter-spacing: -.01em;
  margin: 22px 0 2px;
}
.history { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 8px; }
.day-label {
  font-size: 12.5px; font-weight: 700; color: var(--gray);
  text-transform: uppercase; letter-spacing: .07em;
  margin: 12px 0 2px;
}
.pay-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border: none; border-radius: 16px;
  box-shadow: 0 3px 10px rgba(15, 23, 32, .06);
  padding: 12px 14px;
  width: 100%;
  font: inherit; text-align: left;
  cursor: pointer;
  transition: transform .12s ease;
}
.pay-row:active { transform: scale(.97); }
.pay-icon {
  width: 40px; height: 40px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.pay-icon.in { background: #E6F5EE; color: var(--green); }
.pay-icon.out { background: #F0F2F5; color: var(--gray); }
.pay-mid { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.pay-title { font-size: 15px; font-weight: 800; }
.pay-sub { font-size: 12.5px; font-weight: 600; color: var(--gray); display: flex; align-items: center; gap: 7px; }
.pay-stars { color: var(--star); font-size: 11.5px; letter-spacing: 1.5px; }
.pay-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.pay-amt { font-size: 15.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pay-amt.plus { color: var(--green); }
.pay-chip {
  font-size: 10.5px; font-weight: 700;
  background: #FFF4DE; color: #A87700;
  padding: 3px 8px; border-radius: 999px;
}

/* Bottom sheet: payment detail */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .45);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 50;
  animation: fadein .2s ease both;
}
@keyframes fadein { from { opacity: 0; } }
.sheet-backdrop.hidden { display: none; }
.sheet {
  width: 100%;
  max-width: 430px;
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 12px 20px max(26px, env(safe-area-inset-bottom));
  animation: sheetup .3s cubic-bezier(.2, .9, .3, 1) both;
  display: flex; flex-direction: column; align-items: center;
}
@keyframes sheetup { from { transform: translateY(100%); } }
.sheet-handle { width: 44px; height: 5px; border-radius: 999px; background: #E1E5EA; margin-bottom: 8px; }
.detail-amount {
  font-size: 38px; font-weight: 800; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  color: var(--green); margin-top: 6px;
}
.detail-amount.out { color: var(--ink); }
.detail-date { font-size: 13.5px; font-weight: 600; color: var(--gray); margin-top: 2px; }
.detail-stars { font-size: 26px; letter-spacing: 4px; color: var(--star); margin: 8px 0 0; }
.detail-stars .off { color: #E1E5EA; }
.review-quote {
  width: 100%;
  background: #F2F7F4;
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 15px; font-weight: 600;
  text-align: center;
  margin-top: 12px;
}
.sheet .row-card { max-width: none; }
.sheet .btn-green { max-width: none; margin-top: 16px; }

/* Withdraw */
.wd-cards { width: 100%; display: flex; flex-direction: column; align-items: center; }
.wd-spacer { flex: 1 0 20px; }
.bank-cell { display: flex; flex-direction: column; align-items: flex-end; }
.bank-cell small { font-size: 12px; font-weight: 600; color: var(--gray); margin-top: 2px; }

/* Withdraw success */
.center-col {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.big-check { margin-bottom: 4px; filter: drop-shadow(0 14px 26px rgba(29, 139, 88, .35)); }

/* Analytics */
.period-row { display: flex; gap: 9px; width: 100%; max-width: 380px; margin-top: 4px; }
.period-chip {
  flex: 1;
  border: none;
  background: var(--card);
  box-shadow: 0 3px 10px rgba(15, 23, 32, .06);
  border-radius: 16px;
  padding: 12px 2px;
  font: inherit; font-size: 14.5px; font-weight: 800; color: var(--ink);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.period-chip:active { transform: scale(.95); }
.period-chip.selected { background: var(--grad); color: #fff; box-shadow: var(--glow); }
.chart-card {
  width: 100%; max-width: 380px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px 12px;
  margin-top: 14px;
}
.chart-bars { display: flex; gap: 4px; height: 110px; }
.chart-bars.labeled { height: 128px; padding-top: 18px; }
.chart-bars b { flex: 1; min-width: 0; position: relative; display: block; }
.chart-bars i {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: var(--h, 4%);
  background: linear-gradient(180deg, #27AE6E, #1D8B58);
  border-radius: 4px 4px 2px 2px;
  min-height: 4px;
  opacity: .9;
}
.chart-bars em {
  position: absolute; left: -6px; right: -6px;
  bottom: calc(var(--h, 4%) + 4px);
  font-style: normal;
  font-size: 10px; font-weight: 700; line-height: 1;
  color: var(--ink);
  text-align: center;
  white-space: nowrap;
}
.chart-days { display: flex; gap: 4px; margin-top: 7px; }
.chart-days span { flex: 1; text-align: center; font-size: 11px; font-weight: 600; color: var(--gray); }
.stats-row { display: flex; gap: 10px; width: 100%; max-width: 380px; margin-top: 12px; }
.stat-card {
  flex: 1;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.stat-label { font-size: 13px; font-weight: 600; color: var(--gray); }
.stat-value { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat-value.plus { color: var(--green); }
.an-rows { width: 100%; max-width: 380px; }
.an-rows .row-card { max-width: none; margin-top: 10px; }
.star-inline { color: var(--star); }

/* Venue tips: the waiter's place in the team, the venue amount under each part */
.pay-note { font-size: 11.5px; font-weight: 600; color: var(--gray); }
.share-banner {
  width: 100%; max-width: 380px;
  margin-top: 10px; padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px; font-weight: 800; text-align: center;
}
.share-banner[data-state="in"] { background: var(--green-soft); color: var(--green-dark); }
.share-banner[data-state="out"] { background: var(--amber-soft); color: var(--amber); }
.detail-rows { width: 100%; }
.detail-rows .row-card { margin-top: 10px; }

/* Avatar: photo over a circle with initials, the initials stay if the photo fails */
.avatar {
  position: relative;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--green-soft); color: var(--green-dark);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 800;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile-avatar { outline: 3px solid rgba(29, 139, 88, .18); outline-offset: 2px; overflow: visible; }
.profile-avatar img { border-radius: 50%; }

/* New tip toast */
.toast {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  width: calc(100% - 32px); max-width: 360px;
  background: var(--card);
  border-radius: 18px;
  box-shadow: 0 14px 40px rgba(15, 23, 32, .22);
  padding: 13px 15px;
  display: flex; align-items: center; gap: 12px;
  z-index: 60;
  cursor: pointer;
  animation: toastin .35s cubic-bezier(.2, .9, .3, 1) both;
}
.toast.hide { animation: toastout .3s ease both; }
@keyframes toastin { from { transform: translate(-50%, -130%); } to { transform: translate(-50%, 0); } }
@keyframes toastout { from { transform: translate(-50%, 0); } to { transform: translate(-50%, -140%); opacity: 0; } }
.toast-icon {
  width: 40px; height: 40px; border-radius: 13px;
  background: var(--grad);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.toast-title { font-size: 14.5px; font-weight: 800; }
.toast-sub { font-size: 13px; font-weight: 600; color: var(--gray); margin-top: 1px; }
/* «×» of the push: a 40×40 tap area on the right (brief R-16) */
.toast-body { flex: 1; min-width: 0; }
.toast-close {
  flex-shrink: 0;
  width: 40px; height: 40px; margin: -6px -8px -6px 0;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: 12px;
  font: inherit; font-size: 24px; font-weight: 600; line-height: 1; color: var(--gray);
  cursor: pointer;
}
.toast-close:active { background: var(--bg); }

/* Desktop: phone-like centered column */
@media (min-width: 700px) {
  body {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100dvh;
  }
  .screen {
    width: 430px;
    min-height: 100dvh;
    box-shadow: 0 0 0 1px rgba(15, 23, 32, .06), 0 20px 60px rgba(15, 23, 32, .12);
    background:
      radial-gradient(120% 50% at 50% -10%, rgba(39, 174, 110, .10), transparent 60%),
      var(--bg);
  }
}
