/* Responsive concept: live screens inside the tablet and phone frames */
.gd-screen {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--r) - var(--bw));
  background: #f7f7fb;
}
.gd-device--tablet .gd-screen { aspect-ratio: 600 / 860; }
.gd-device--phone .gd-screen { aspect-ratio: 310 / 672; }

.gm-app {
  --p: #6453e0; --p-dark: #5241cf; --p-200: #dcd8fb; --p-100: #efedfd;
  --t1: #1e2235; --t2: #4a5068; --t3: #6b7085;
  --green: #1f8a4c; --green-bg: #dcf2e3; --amber: #8a6100; --amber-bg: #fcefc7;
  --track: #f3f3f7; --border: #e6e7ee; --ease: cubic-bezier(.2,.8,.2,1);
  position: absolute;
  top: 0; left: 0;
  width: calc(var(--w) * 1px);
  height: calc(var(--hgt) * 1px);
  transform-origin: 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f7f7fb;
  color: var(--t1);
  font: 400 12px/1.4 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  text-align: left;
  -webkit-font-smoothing: antialiased;
}
.gm-app * { box-sizing: border-box; }
.gm-app button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.gm-app button:focus-visible { outline: 2px solid var(--p); outline-offset: 2px; border-radius: 6px; }
.gm-app ul { list-style: none; margin: 0; padding: 0; }
.gm-app h3, .gm-app h4, .gm-app p { margin: 0; }
.gm-app h3 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.gm-app h4 { font-size: 13px; font-weight: 700; }
.gm-app img { display: block; border: 0; box-shadow: none; }
.gm-app .gm-me { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.gm-app .num { font-variant-numeric: tabular-nums; }
.gm-spacer { flex: 1; }
.gm-sub, .gm-greet p { color: var(--t3); font-size: 11px; }

/* Entrance */
.gm-in { opacity: 0; transform: translateY(10px); }
.gm-app.is-live .gm-in {
  opacity: 1; transform: none;
  transition: opacity .5s var(--ease), transform .6s var(--ease);
  transition-delay: calc(var(--d) * 1ms);
}
.gm-app.no-anim, .gm-app.no-anim * { transition: none !important; animation: none !important; }

/* Building blocks */
.gm-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}
.gm-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.gm-logo { font-weight: 800; font-size: 16px; color: var(--p); letter-spacing: -.02em; }
.gm-me { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.gm-iconbtn { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--t2); }
.gm-iconbtn:hover { background: var(--track); }
.gm-link { color: var(--p); font-weight: 600; font-size: 11px; }
.gm-link:hover { text-decoration: underline; }

.gm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 8px;
  font-weight: 600; font-size: 12px; white-space: nowrap;
  transition: background .2s, color .2s, transform .15s;
}
.gm-btn:active { transform: scale(.97); }
.gm-app .gm-btn--primary { background: var(--p); color: #fff; }
.gm-app .gm-btn--primary:hover { background: var(--p-dark); }
.gm-app .gm-btn--ghost { background: var(--p-100); color: var(--p-dark); }
.gm-app .gm-btn--ghost:hover { background: var(--p-200); }
.gm-btn--block { width: 100%; }

.gm-pill {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px;
  border-radius: 999px; font-size: 10px; font-weight: 600; white-space: nowrap;
}
.gm-pill--green { background: var(--green-bg); color: var(--green); }
.gm-pill--amber { background: var(--amber-bg); color: var(--amber); }
.gm-pill--grey { background: var(--track); color: var(--t2); }

.gm-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.gm-who b { font-weight: 600; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-who span { color: var(--t3); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.gm-track { height: 6px; border-radius: 99px; background: var(--track); overflow: hidden; }
.gm-track i, .gm-capbar i {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: var(--c, var(--p));
}
.gm-app.is-live .gm-track i { width: var(--w); transition: width 1s var(--ease) calc(700ms + var(--i) * 90ms); }

/* KPIs */
.gm-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gm-kpi { padding: 12px 14px; }
.gm-k-label { color: var(--t3); font-size: 11px; font-weight: 500; }
.gm-k-value { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 2px 0; }
.gm-k-delta { color: var(--green); font-size: 10.5px; font-weight: 600; }
.gm-k-delta.muted { color: var(--t3); font-weight: 500; }

/* Revenue chart */
.gm-revenue { display: flex; flex-direction: column; }
.gm-readout { text-align: right; }
.gm-ro-val { display: block; font-size: 18px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.gm-ro-sub { color: var(--t3); font-size: 10.5px; }
.gm-ro-chg { font-style: normal; font-weight: 700; }
.gm-ro-chg.up { color: var(--green); }
.gm-ro-chg.down { color: #b42318; }
.gm-plot {
  position: relative;
  flex: 1;
  min-height: 90px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: end;
  margin-top: 14px;
}
.gm-grid { position: absolute; left: 0; right: 0; bottom: var(--y); border-top: 1px dashed var(--border); pointer-events: none; }
.gm-col { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.gm-app .gm-col { border-radius: 6px; }
.gm-bar {
  position: relative; display: block; width: 58%; height: 0;
  border-radius: 6px 6px 2px 2px; background: var(--p-200);
  transition: background .2s;
}
.gm-app.is-live .gm-bar { height: var(--h); transition: height .9s var(--ease) calc(500ms + var(--i) * 80ms), background .2s; }
.gm-col:hover .gm-bar { background: #c3bcf8; }
.gm-col.is-picked .gm-bar { background: var(--p); }
.gm-v {
  position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%);
  font-size: 10px; font-weight: 600; color: var(--t3); white-space: nowrap;
  opacity: 0; transition: opacity .3s;
}
.gm-app.is-live .gm-v { opacity: 1; transition-delay: calc(1100ms + var(--i) * 80ms); }
.gm-col.is-picked .gm-v { color: var(--p-dark); }
.gm-months { display: grid; grid-template-columns: repeat(6, 1fr); text-align: center; margin-top: 6px; color: var(--t3); font-size: 10.5px; }

/* Lists */
.gm-list > li { display: flex; align-items: center; gap: 10px; }
.gm-classes .gm-list > li, .gm-expiring .gm-list > li { padding: 8px 0; border-top: 1px solid var(--track); }
.gm-classes .gm-list > li:first-child, .gm-expiring .gm-list > li:first-child { border-top: 0; padding-top: 0; }
.gm-time { width: 38px; flex: none; font-weight: 600; font-size: 11px; color: var(--t2); font-variant-numeric: tabular-nums; }
.gm-cap { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; width: 54px; flex: none; font-size: 10.5px; font-weight: 600; color: var(--t2); }
.gm-cap .gm-pill { height: 16px; padding: 0 6px; font-size: 9.5px; }
.gm-capbar { display: block; width: 100%; height: 4px; border-radius: 99px; background: var(--track); overflow: hidden; }
.gm-app.is-live .gm-capbar i { width: var(--w); transition: width .9s var(--ease) calc(var(--d) * 1ms + 200ms); }
.gm-class:has(.gm-pill--amber) .gm-capbar i { background: #e0a000; }

.gm-list img, .gm-initials { width: 30px; height: 30px; flex: none; border-radius: 50%; object-fit: cover; }
.gm-initials { display: grid; place-items: center; background: var(--p-100); color: var(--p-dark); font-size: 11px; font-weight: 700; }

/* Renew */
.gm-renew {
  display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px;
  border-radius: 7px; font-size: 11px; font-weight: 600;
}
.gm-app .gm-renew { background: var(--p-100); color: var(--p-dark); }
.gm-app .gm-renew:hover { background: var(--p-200); }
.gm-renew svg { display: none; }
.gm-app .gm-renew.is-done { background: var(--green-bg); color: var(--green); cursor: default; }
.gm-renew.is-done svg { display: block; }
.gm-member.is-done .gm-exp { color: var(--green); }
.gm-count { display: inline-block; }
.gm-count.bump { animation: gm-bump .4s var(--ease); }
@keyframes gm-bump { 40% { transform: scale(1.4); } }

/* Toast */
.gm-toast {
  position: absolute; left: 50%; bottom: 20px; z-index: 30;
  display: flex; align-items: center; gap: 6px;
  max-width: calc(100% - 32px); padding: 9px 14px; border-radius: 10px;
  background: var(--t1); color: #fff; font-size: 11.5px; font-weight: 500; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(30,34,53,.25);
  opacity: 0; transform: translate(-50%, 10px); pointer-events: none;
  transition: opacity .25s, transform .3s var(--ease);
}
.gm-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.gm-toast svg { color: #7ee2a8; flex: none; }
.gm-toast span { overflow: hidden; text-overflow: ellipsis; }
.gm-phone .gm-toast { bottom: 78px; }

/* Scrim, drawer, sheets */
.gm-scrim {
  position: absolute; inset: 0; z-index: 20; background: rgba(30,34,53,.35);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.gm-app.is-drawer .gm-scrim, .gm-app.is-sheet .gm-scrim { opacity: 1; pointer-events: auto; }

/* ---------- Tablet ---------- */
.gm-top {
  display: flex; align-items: center; gap: 8px; flex: none;
  height: 52px; padding: 0 16px 0 10px;
  background: #fff; border-bottom: 1px solid var(--border);
}
.gm-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px;
  border: 1px solid var(--border) !important; border-radius: 99px; font-size: 11px; font-weight: 600; color: var(--t2);
}
.gm-tablet .gm-page { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.gm-greet { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gm-tablet .gm-revenue { flex: 1; min-height: 0; }
.gm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gm-row > .gm-card { display: flex; flex-direction: column; }
.gm-mix { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 16px; }
.gm-mix ul { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.gm-mix-top { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 11px; color: var(--t2); }
.gm-mix-top b { color: var(--t1); }

.gm-drawer {
  position: absolute; top: 0; bottom: 0; left: 0; z-index: 25; width: 210px;
  padding: 16px 10px; background: #fff; box-shadow: 8px 0 32px rgba(30,34,53,.18);
  transform: translateX(-104%); transition: transform .35s var(--ease);
}
.gm-app.is-drawer .gm-drawer { transform: none; }
.gm-drawer .gm-logo { display: block; padding: 0 10px 14px; }
.gm-drawer button {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px;
  border-radius: 8px; font-weight: 500; color: var(--t2);
}
.gm-drawer button:hover { background: var(--track); }
.gm-app .gm-drawer button.is-active { background: var(--p-100); color: var(--p-dark); font-weight: 600; }

/* ---------- Phones ---------- */
.gm-status {
  position: relative; display: flex; align-items: center; justify-content: space-between; flex: none;
  height: 38px; padding: 4px 22px 0 26px; font-size: 12.5px; font-weight: 700; background: #fff;
}
.gm-island { position: absolute; top: 9px; left: 50%; width: 84px; height: 22px; margin-left: -42px; border-radius: 12px; background: #0d0f18; }
.gm-sys { display: flex; align-items: center; gap: 5px; }
.gm-sys svg { fill: currentColor; }
.gm-ptop { display: flex; align-items: center; gap: 6px; flex: none; height: 44px; padding: 0 12px 0 14px; background: #fff; border-bottom: 1px solid var(--border); }
.gm-scroll {
  position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 12px 12px 80px; scrollbar-width: none;
}
.gm-scroll::-webkit-scrollbar { display: none; }
.gm-phone .gm-kpis { gap: 8px; }
.gm-phone .gm-kpi { padding: 10px 11px; }
.gm-phone .gm-k-value { font-size: 18px; }
.gm-phone .gm-card { border-radius: 12px; }
.gm-phone .gm-greet { display: block; margin-bottom: 12px; }
.gm-phone .gm-revenue, .gm-phone .gm-classes { margin-top: 10px; }
.gm-phone .gm-plot { flex: none; height: 92px; min-height: 0; margin-top: 18px; }
.gm-phone .gm-bar { width: 62%; }
.gm-phone .gm-v { font-size: 9px; opacity: 0 !important; }
.gm-phone .gm-col.is-picked .gm-v { opacity: 1 !important; }
.gm-phone .gm-ro-val { font-size: 16px; }

.gm-view { display: none; }
.gm-view.is-on { display: block; animation: gm-fade .3s var(--ease); }
@keyframes gm-fade { from { opacity: 0; transform: translateY(6px); } }
.gm-vtitle { margin-bottom: 12px !important; }
.gm-subhead { margin: 16px 0 8px !important; }
.gm-search {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; margin-bottom: 10px;
  border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--t3);
}
.gm-filters { display: flex; gap: 6px; margin-bottom: 10px; }
.gm-filters button {
  height: 28px; padding: 0 12px; border-radius: 99px; font-size: 11px; font-weight: 600;
  border: 1px solid var(--border) !important; background: #fff !important; color: var(--t2);
  transition: background .2s, color .2s;
}
.gm-app .gm-filters button.is-active { background: var(--t1) !important; border-color: var(--t1) !important; color: #fff; }
.gm-people > li, .gm-blist > li, .gm-menu > li, .gm-bk > li, .gm-pk > li, .gm-notes > li {
  padding: 10px 12px; margin-bottom: 8px; background: #fff; border: 1px solid var(--border); border-radius: 12px;
}
.gm-person[hidden] { display: none !important; }
.gm-blist .gm-cap { width: 60px; }
.gm-menu > li { gap: 10px; font-weight: 500; color: var(--t1); }
.gm-menu > li > span { flex: 1; }
.gm-menu > li > svg { color: var(--t3); }
.gm-kpi--wide { margin-top: 10px; }

.gm-tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: 64px; padding: 6px 4px 14px; background: rgba(255,255,255,.96);
  border-top: 1px solid var(--border);
}
.gm-tabbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 9.5px; font-weight: 500; color: var(--t3); transition: color .2s;
}
.gm-app .gm-tabbar button.is-active { color: var(--p); font-weight: 700; }
.gm-tabbar button:hover { color: var(--t1); }

/* Member profile */
.gm-backlink { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; color: var(--p) !important; }
.gm-hero { display: flex; align-items: center; gap: 12px; }
.gm-hero img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.gm-hero > div { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.gm-hero b { font-size: 16px; font-weight: 700; }
.gm-hero span:not(.gm-pill) { color: var(--t3); font-size: 11px; }
.gm-hero .gm-pill { margin-top: 4px; }
.gm-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 12px; }
.gm-ptabs { position: relative; display: flex; gap: 2px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.gm-ptabs button { flex: 1; height: 34px; font-size: 11.5px; font-weight: 600; color: var(--t3); transition: color .2s; }
.gm-app .gm-ptabs button.is-active { color: var(--p); }
.gm-ink { position: absolute; bottom: -1px; left: 0; width: 0; height: 2px; border-radius: 2px; background: var(--p); transition: left .3s var(--ease), width .3s var(--ease); }
.gm-panel { display: none; }
.gm-panel.is-on { display: block; animation: gm-fade .3s var(--ease); }
.gm-term { margin-top: 10px; }
.gm-term-row { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 11px; color: var(--t2); }
.gm-term-row span:first-child { font-weight: 600; color: var(--t1); }
.gm-term-track { margin-bottom: 12px; }
.gm-term-track i { transition: width .8s var(--ease) !important; }
.gm-app .gm-term-renew.is-done { background: var(--green-bg); color: var(--green); cursor: default; }
.gm-pkic { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 9px; background: var(--p-100); color: var(--p); }
.gm-bk .gm-time { width: 30px; }
.gm-bk .is-new { animation: gm-fade .4s var(--ease); border-color: var(--p-200); }

.gm-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 26;
  padding: 8px 14px 22px; border-radius: 18px 18px 0 0; background: #fff;
  box-shadow: 0 -12px 32px rgba(30,34,53,.18);
  transform: translateY(105%); transition: transform .35s var(--ease);
}
.gm-sheet.is-on { transform: none; }
.gm-grab { display: block; width: 36px; height: 4px; margin: 0 auto 12px; border-radius: 4px; background: var(--border); }
.gm-sheet h4 { margin-bottom: 10px; }
.gm-slot {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px !important; margin-bottom: 8px;
  border: 1px solid var(--border) !important; border-radius: 12px; text-align: left; transition: border-color .2s, background .2s;
}
.gm-slot:hover:not(:disabled) { border-color: var(--p) !important; background: var(--p-100); }
.gm-slot:disabled { opacity: .55; cursor: not-allowed; }
.gm-slot > svg { color: var(--p); }

@media (prefers-reduced-motion: reduce) {
  .gm-app *, .gm-app *::before, .gm-app *::after { transition-duration: 0s !important; transition-delay: 0s !important; animation: none !important; }
}
