@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/card/fonts/manrope-cyr-400.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/card/fonts/manrope-lat-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/card/fonts/manrope-cyr-500.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/card/fonts/manrope-lat-500.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/card/fonts/manrope-cyr-600.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/card/fonts/manrope-lat-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;
  --c-bg: #ECE9E4;
  --c-surface: #F8F7F4;
  --c-inset: #F1EFEA;
  --c-pill: #E2DDD5;
  --c-pill-soft: #EFECE6;
  --c-text: #161616;
  --c-text-2: #3D3A36;
  --c-text-3: #57534E;
  --c-muted: #7D7871;
  --c-faint: #9B958D;
  --c-line: rgba(24, 22, 20, 0.08);
  --c-line-soft: #E3DED6;
  --c-div: #C7C2BA;
  --c-gold: #B68450;
  --c-gold-ink: #9E6E3C;
  --c-gold-fg: #FFFFFF;
  --c-gold-soft: rgba(182, 132, 80, 0.08);
  --c-gold-line: rgba(182, 132, 80, 0.42);
  --c-ring-soft: #DFC7AB;
  --c-next-bg: #FAF8F4;
  --c-todo-bg: #F8F7F4;
  --c-todo-line: #D8D2C9;
  --c-ico-bg: #FBF9F6;
  --c-ico-line: #C69C6D;
  --c-ico-ink: #A67644;
  --c-pwa-bg: #FAF8F5;
  --c-pwa-line: #DFD9CE;
  --c-ast: #C25949;
  --c-shadow: 0 6px 20px rgba(32, 26, 20, 0.04);
}

@media (prefers-color-scheme: dark) {
  :root {
    --c-bg: #141416;
    --c-surface: #1C1C1F;
    --c-inset: #232327;
    --c-pill: #26262B;
    --c-pill-soft: #26262B;
    --c-text: #F0ECE4;
    --c-text-2: #D4CFC6;
    --c-text-3: #B8B3AA;
    --c-muted: #8A857D;
    --c-faint: #757068;
    --c-line: rgba(240, 236, 228, 0.08);
    --c-line-soft: rgba(240, 236, 228, 0.09);
    --c-div: #38383E;
    --c-gold: #D2A36C;
    --c-gold-ink: #E1B682;
    --c-gold-fg: #181410;
    --c-gold-soft: rgba(210, 163, 108, 0.13);
    --c-gold-line: rgba(210, 163, 108, 0.38);
    --c-ring-soft: rgba(210, 163, 108, 0.35);
    --c-next-bg: #26221D;
    --c-todo-bg: #1E1E22;
    --c-todo-line: #36363C;
    --c-ico-bg: #22201C;
    --c-ico-line: rgba(210, 163, 108, 0.45);
    --c-ico-ink: #D2A36C;
    --c-pwa-bg: #252422;
    --c-pwa-line: rgba(210, 163, 108, 0.35);
    --c-ast: #DF7B6D;
    --c-shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.tnum { font-variant-numeric: tabular-nums; }

.ecard-wrap {
  max-width: 440px;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ecard-loading {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 13.5px;
  color: var(--c-muted);
}

.ecard-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid var(--c-line-soft);
  border-top-color: var(--c-gold);
  animation: ecardSpin 0.8s linear infinite;
}
@keyframes ecardSpin { to { transform: rotate(360deg); } }

/* Brand Header */
.ecard-header {
  padding: 4px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ep-logo-lockup {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.ep-logo-ring {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  color: var(--c-text);
}
.ep-logo-word {
  font-family: 'Didot', 'Bodoni MT', Georgia, 'Times New Roman', serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--c-text);
  line-height: 1;
  white-space: nowrap;
}
.ep-logo-div {
  width: 1px;
  height: 26px;
  background: var(--c-div);
  flex-shrink: 0;
}
.ep-logo-sub {
  font-size: 9.5px;
  line-height: 1.22;
  color: var(--c-text-3);
  font-weight: 400;
}
.ecard-city-pill {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--c-text-2);
  background: var(--c-pill);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Multi-abonement switcher */
.ecard-multi-tabs {
  display: flex;
  gap: 6px;
  background: var(--c-pill);
  padding: 3px;
  border-radius: 12px;
  overflow-x: auto;
}
.ecard-multi-btn {
  flex: 1 0 auto;
  appearance: none;
  border: none;
  background: transparent;
  color: var(--c-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.ecard-multi-btn.active {
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: var(--c-shadow);
}

/* Hero Certificate Card */
.cert-card {
  background: var(--c-surface);
  border-radius: 20px;
  padding: 22px 20px 18px;
  border: 1px solid var(--c-line);
  box-shadow: var(--c-shadow);
}
.cert-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.cert-h1 {
  font-family: 'Didot', 'Bodoni MT', Georgia, 'Times New Roman', serif;
  font-size: 37px;
  line-height: 0.98;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--c-text);
  margin: 0;
}
.cert-h2 {
  font-family: 'Didot', 'Bodoni MT', Georgia, 'Times New Roman', serif;
  font-size: 28px;
  line-height: 1.08;
  font-weight: 500;
  color: var(--c-gold);
  margin: 2px 0 10px;
}
.cert-status-pill {
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--c-pill-soft);
  color: var(--c-text-3);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.cert-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-gold);
}
.cert-status-pill.done .cert-status-dot,
.cert-status-pill.expired .cert-status-dot { background: var(--c-muted); }
.cert-status-pill.created .cert-status-dot { background: var(--c-gold-ink); }
.cert-status-pill.frozen .cert-status-dot { background: #6B8299; }

.cert-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--c-text-2);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.cert-num {
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--c-text-2);
}
.cert-course-tag {
  color: var(--c-muted);
  font-size: 12px;
}

/* Progress Circles */
.prog-wrap {
  background: var(--c-inset);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 16px;
  border: 1px solid var(--c-line);
}
.prog-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.prog-left-main {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
}
.prog-left-main span { color: var(--c-gold-ink); }
.prog-right-sub {
  font-size: 12px;
  color: var(--c-muted);
}

.circles-grid {
  display: grid;
  gap: 8px;
}
.circles-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.circles-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
.circles-grid.cols-6 { grid-template-columns: repeat(6, 1fr); }

.visit-circle {
  aspect-ratio: 1 / 1;
  max-width: 52px;
  width: 100%;
  margin: 0 auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
}
.visit-circle.done {
  background: var(--c-gold);
  color: var(--c-gold-fg);
  border: 1.5px solid var(--c-gold);
}
.visit-circle.next {
  background: var(--c-next-bg);
  color: var(--c-gold-ink);
  border: 1.5px solid var(--c-gold);
  font-weight: 600;
}
.visit-circle.todo {
  background: var(--c-todo-bg);
  color: var(--c-faint);
  border: 1px solid var(--c-todo-line);
}
.visit-circle svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2.1;
  fill: none;
}

/* Ruled Zones */
.zones-ruled {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}
.zones-caption {
  font-size: 11px;
  color: var(--c-muted);
  margin-bottom: 4px;
}
.zone-line {
  padding: 7px 0;
  border-bottom: 1px solid var(--c-line-soft);
  font-size: 13px;
  color: var(--c-text-2);
}
.cert-validity {
  font-size: 11.5px;
  color: var(--c-muted);
  line-height: 1.4;
}
.cert-validity .ast {
  color: var(--c-ast);
  margin-right: 3px;
}

/* Secondary Cards */
.l-card {
  background: var(--c-surface);
  border-radius: 18px;
  padding: 16px 18px;
  border: 1px solid var(--c-line);
}
.l-card-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--c-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ecard-rel-accent { color: var(--c-gold-ink); }

.appt-date {
  font-size: 16px;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 4px;
}
.appt-meta {
  font-size: 13px;
  color: var(--c-text-3);
  line-height: 1.45;
  margin-bottom: 14px;
}

.btn-call-primary {
  width: 100%;
  appearance: none;
  border: none;
  background: var(--c-gold);
  color: var(--c-gold-fg);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}
.btn-call-primary:active { transform: scale(0.985); }

.btn-call-secondary {
  width: 100%;
  appearance: none;
  border: 1px solid var(--c-gold-line);
  background: var(--c-gold-soft);
  color: var(--c-gold-ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-decoration: none;
}

/* Studio Contacts */
.studio-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.studio-row + .studio-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--c-line-soft);
}
.bronze-ico-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--c-ico-line);
  color: var(--c-ico-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--c-ico-bg);
}
.bronze-ico-circle svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
}
.studio-phone-link {
  font-size: 16px;
  font-weight: 500;
  color: var(--c-text);
  text-decoration: none;
  display: block;
  line-height: 1.25;
}
.studio-hours {
  font-size: 11.5px;
  color: var(--c-muted);
  margin-top: 2px;
}
.studio-addr {
  font-size: 13px;
  line-height: 1.42;
  color: var(--c-text-2);
}

/* Accordions */
.acc-card {
  background: var(--c-surface);
  border-radius: 16px;
  border: 1px solid var(--c-line);
  overflow: hidden;
}
.acc-head {
  width: 100%;
  appearance: none;
  border: none;
  background: transparent;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--c-text);
  cursor: pointer;
  text-align: left;
}
.acc-head-right {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--c-muted);
  font-weight: 400;
}
.acc-chev {
  width: 16px;
  height: 16px;
  stroke: var(--c-muted);
  stroke-width: 1.7;
  fill: none;
  transition: transform 0.18s ease;
}
.acc-card.open .acc-chev { transform: rotate(180deg); }
.acc-body {
  display: none;
  padding: 0 18px 16px;
  border-top: 1px solid var(--c-line-soft);
}
.acc-card.open .acc-body { display: block; }

.prep-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.prep-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  line-height: 1.42;
  color: var(--c-text-2);
}
.prep-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--c-gold);
  margin-top: 6px;
  flex-shrink: 0;
}
.prep-item b {
  font-weight: 600;
  color: var(--c-text);
}

.hist-empty {
  padding-top: 12px;
  font-size: 12.5px;
  color: var(--c-muted);
}
.hist-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--c-line-soft);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.hist-row:last-child { border-bottom: none; padding-bottom: 0; }
.hist-date {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--c-text);
  white-space: nowrap;
}
.hist-zones {
  font-size: 12px;
  color: var(--c-text-3);
  text-align: right;
}

/* Home Screen Banner */
.pwa-tip {
  background: var(--c-pill-soft);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--c-line);
}
.pwa-app-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--c-pwa-bg);
  border: 1px solid var(--c-pwa-line);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
  position: relative;
}
.pwa-app-icon::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 1px solid var(--c-gold);
}
.pwa-tip-text {
  font-size: 12px;
  line-height: 1.35;
  color: var(--c-text-2);
}
.pwa-tip-text b {
  display: block;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 1px;
}

/* Legal Footer */
.ecard-legal {
  padding: 4px 4px 2px;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--c-muted);
}
.ecard-legal-links {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.ecard-legal a {
  color: var(--c-text-3);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ecard-error {
  margin-top: 40px;
  text-align: center;
}
.ecard-error h2 {
  font-family: 'Didot', Georgia, serif;
  font-size: 26px;
  font-weight: 500;
  margin: 0 0 8px;
  color: var(--c-text);
}
.ecard-error p {
  font-size: 13.5px;
  color: var(--c-text-3);
  line-height: 1.5;
  margin: 0 0 16px;
}
