* { box-sizing: border-box; }
body { margin: 0; }
button { font: inherit; cursor: pointer; color: var(--text); border: 1px solid var(--line); }
a, button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { color: var(--accent); text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button:disabled { opacity: .45; cursor: wait; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.amber { color: var(--accent); }
.green { color: #b6f1d1; }
.label { font-size: 11px; text-transform: uppercase; letter-spacing: .11em; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel { overflow: hidden; }
.sub-card { display: flex; flex-direction: column; }
.sub-card h3 { margin: 0; }
.sub-card .sub-meta { font-size: 12px; }
.empty { text-align: center; }
.visit-card h3 { margin: 12px 0; }
.visit-card p { font-size: 12px; line-height: 1.7; margin: 5px 0; }
.visit-foot { display: flex; justify-content: space-between; border-top: 1px solid var(--line); font-size: 12px; }
.client-footer { text-align: center; }
.tag { display: inline-flex; align-items: center; white-space: nowrap; }
table { border-collapse: collapse; width: 100%; text-align: left; white-space: nowrap; }
th { color: var(--dim); font-weight: 400; }
td, th { border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
.loading span { display: block; margin-top: 16px; font-size: 13px; color: var(--muted); }
:root {
  color-scheme: dark; color: var(--text); font-size: 14px;
  --bg: #08050c;
  --text: #fcf9ff;
  --muted: #d3c8dd;
  --dim: #b8a9c6;
  --accent: #ead9ff;
  --line: #ffffff24;
  --logo-space: max(112px, 14vh);
  --edge-blur: 100px;
  --mono: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
}
html, body { height: 100%; overflow: hidden; }
body { min-width: 0; background: var(--bg); }
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none;
  background: url('/mini-background.jpg') center bottom / cover no-repeat;
}
/* Keep the logo baked into the photograph unobstructed, including while scrolling. */
#app {
  position: fixed; inset: 0 0 var(--logo-space) 0;
  overflow-y: auto; overscroll-behavior-y: contain;
}
@supports (height: 1svh) { :root { --logo-space: max(112px, 14svh); } }
/* Separate backdrop layers preserve the cards' own glass effect. Never mask #app. */
.scroll-blur {
  position: fixed; z-index: 2; left: 0; right: 0;
  bottom: var(--logo-space); height: var(--edge-blur); pointer-events: none;
}
.scroll-blur i {
  position: absolute; inset: 0; pointer-events: none;
  -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur));
  -webkit-mask-image: linear-gradient(to bottom, transparent var(--start), #000 var(--end));
  mask-image: linear-gradient(to bottom, transparent var(--start), #000 var(--end));
}
.scroll-blur i:nth-child(1) { --blur: 5px; --start: 0%; --end: 55%; }
.scroll-blur i:nth-child(2) { --blur: 20px; --start: 30%; --end: 100%; }
/* Reveal the identical, aligned photograph under the blurred content, without a seam. */
body::after {
  content: ''; position: fixed; left: 0; right: 0; bottom: 0;
  height: calc(var(--logo-space) + 65px); pointer-events: none; z-index: 3;
  background-image: url('/mini-background.jpg');
  background-position: center bottom; background-repeat: no-repeat;
  background-size: max(100vw, 56.28vh) auto;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 65px);
  mask-image: linear-gradient(to bottom, transparent, #000 65px);
}

.client-shell {
  max-width: 480px; min-height: 0; margin: auto;
  padding: max(24px, env(safe-area-inset-top), var(--tg-content-safe-area-inset-top, 0px)) 20px calc(var(--edge-blur) + 28px);
  overflow-wrap: anywhere;
}
.client-top { display: flex; align-items: center; justify-content: space-between; margin: 0 0 22px; }
.cabinet-label { font-size: 12px; font-weight: 500; letter-spacing: .08em; color: var(--muted); }
#refresh {
  width: 44px; height: 44px; padding: 0; border-radius: 50%;
  font-size: 28px; font-weight: 300; line-height: 1;
}
.client-greeting { margin: 0; font-size: 13px; color: var(--muted); }
.client-shell h1 { font-size: 34px; font-weight: 650; letter-spacing: -.045em; margin: 5px 0 0; }
.refresh-status { min-height: 26px; padding: 5px 0 8px; font-size: 10px; color: var(--dim); }
/* Light rims and inner reflections on tinted, blurred glass. */
.client-balance, .client-shell .panel, .visit-card, .client-shell .notice.neutral,
.client-tabs, .client-shell > .empty, #refresh, .manager-link {
  background: linear-gradient(135deg, #ffffff1f, #ffffff07 48%, #d3afff15);
  border: 1px solid #ffffff2e;
  border-top-color: #ffffff52;
  border-radius: 24px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 #ffffff18, inset 0 -1px 0 #ffffff06, 0 12px 32px #00000024;
}
.client-balance { padding: 22px 24px; margin-bottom: 14px; }
.client-balance .label { font-size: 10px; letter-spacing: .14em; color: #e5d9f0; }
.client-balance .balance-number {
  font-size: 46px; line-height: 1.12; font-weight: 600; letter-spacing: -.055em;
  color: #fff; margin: 14px 0 12px; text-shadow: 0 0 28px #e2c1ff30;
}
.client-balance p { font-size: 12px; line-height: 1.65; margin: 0; color: var(--muted); }
.client-shell .notice.neutral { padding: 16px 20px; margin: 0 0 16px; font-size: 12px; color: var(--muted); border-radius: 20px; }
.client-shell .sub-card { padding: 22px; gap: 12px; margin-bottom: 16px; }
.sub-card h3 { font-size: 15px; font-weight: 550; }
.sub-card .sub-meta { color: var(--muted); line-height: 1.8; }
.client-tabs { display: flex; gap: 3px; padding: 5px; margin: 18px 0 14px; border-radius: 30px; }
.client-tabs button {
  flex: 1; min-width: 0; min-height: 44px; padding: 10px 4px;
  border: 1px solid transparent; border-radius: 24px; background: transparent;
  font-size: 12px; font-weight: 500; color: var(--muted);
}
.client-tabs button.active {
  color: #fff; border-color: #ffffff35;
  background: linear-gradient(130deg, #ffffff32, #ffffff16);
  box-shadow: inset 0 1px 0 #ffffff2e, 0 3px 10px #0002;
}
.client-tabs button:hover { color: white; background-color: #ffffff0b; }
.client-shell .empty { padding: 25px 20px; color: var(--muted); }
.client-shell .empty h3 { font-size: 15px; font-weight: 550; color: #f4ecfc; margin: 0 0 7px; }
.client-shell .empty p { font-size: 12px; line-height: 1.65; margin: 0; }
.visit-card { padding: 22px; margin-bottom: 14px; }
.visit-card h3 { font-size: 19px; font-weight: 550; letter-spacing: -.02em; }
.visit-card .label { font-size: 10px; letter-spacing: .08em; }
.visit-card p { color: var(--muted); }
.visit-card .visit-foot { border-color: var(--line); padding-top: 16px; margin-top: 16px; }
.client-shell .tag { border: 1px solid #ffffff20; background: #ffffff0c; color: #e5d9f0; border-radius: 20px; padding: 5px 9px; font-size: 10px; }
.client-shell .tag.active, .client-shell .tag.completed { color: #b6f1d1; background: #84e6b414; }
.client-shell .tag.booked, .client-shell .tag.in_progress { color: #ead9ff; background: #c2a2fa20; }
.manager-link {
  display: flex; align-items: center; justify-content: center; min-height: 54px;
  text-align: center; text-decoration: none; padding: 16px 20px; margin-top: 18px;
  border-radius: 30px; color: #fff; font-size: 14px; font-weight: 550;
  background: linear-gradient(115deg, #e5ccff38, #c798ed22);
}
.manager-link:hover, #refresh:hover { background-color: #ffffff15; }
.manager-link:active, #refresh:active { transform: scale(.98); }
.client-footer { color: #d1bddb; font-size: 10px; line-height: 1.7; margin-top: 20px; }
.client-shell .table-wrap { overflow-x: auto; }
.client-shell th, .client-shell td { padding: 14px 12px; font-size: 11px; border-color: var(--line); }
.mini-error { padding: 24px; margin-top: 36px; }
.mini-error h1 { font-size: 25px; }
.mini-error p { line-height: 1.7; color: var(--muted); }
.mini-error #refresh { width: auto; padding: 12px 20px; height: auto; font-size: 14px; border-radius: 24px; color: white; background: #ffffff22; }
.loading { padding: 40px 24px; font-size: 15px; letter-spacing: 0; font-weight: 500; }
@media (min-aspect-ratio: 3/4) {
  body::before { background-size: auto 100%; }
  body::after { background-size: auto 100vh; }
}
@media (max-width: 360px) {
  .client-shell { padding-left: 14px; padding-right: 14px; }
  .client-tabs button { font-size: 11px; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .client-balance, .client-shell .panel, .visit-card, .client-shell .notice.neutral,
  .client-tabs, .client-shell > .empty, #refresh, .manager-link { background-color: #24162ee8; }
}
@media (prefers-reduced-transparency: reduce) {
  .scroll-blur { display: none; }
  .client-balance, .client-shell .panel, .visit-card, .client-shell .notice.neutral,
  .client-tabs, .client-shell > .empty, #refresh, .manager-link { background-color: #24162ef5; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
