/* scheidung-mut.de — Cal.com public-page overrides
 * Audience: 40+, predominantly mobile, presbyopia.
 * Scope: only public routes (/[user], /[user]/[slug], /booking/*);
 * admin routes go through a separate nginx location block.
 *
 * UPGRADE-CHECK (на любой Cal.com major bump): пройди по всем UPGRADE-CHECK
 * блокам ниже. Селекторы привязаны к классам/data-testid Cal.com 6.2.0 —
 * могут поменяться. Проверь по апстрим-источнику, который указан в каждом
 * блоке (apps/web/modules/... или packages/...).
 */

:root {
  --sm-font: 'Source Sans 3', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --sm-c-text: #1f2937;
  --sm-c-text-strong: #111827;
  --sm-c-link: #006bff;
  --sm-c-primary: #0965e6;       /* matches Cal.com Settings → Appearance Brand color (helles Theme); WCAG AA contrast 5.17:1 with white text */
  --sm-c-primary-hover: #0052cc;
  --sm-c-border: #d1d5db;
  --sm-c-focus: #006bff;
  --sm-radius: 10px;
  --sm-tap: 52px;
  --sm-tap-lg: 56px;
}

html { -webkit-text-size-adjust: 100%; }

/* =========================================================================
 * UPGRADE-CHECK on Cal.com major version bump.
 *
 * Force-light theme globally на ВСЕХ Cal.com pages (включая 404, /[user],
 * /booking/<uid>, /bookings/upcoming, и т.д.).
 *
 * Why: Cal.com 6.2.0 уважает `prefers-color-scheme: dark` и применяет
 * собственный .dark класс на <html> через theme provider:
 *   Source: packages/lib/themeProvider, packages/embeds/embed-core/src/embed.ts
 *   .dark переопределяет CSS variables --cal-bg, --cal-text и т.п.
 *   на тёмные значения → весь UI становится чёрным при OS dark mode.
 *
 * Юлия выбрала light в кабинете Cal.com (users.theme=light), но это работает
 * только когда пользователь залогинен. Для public pages (клиенты, 404) — нет.
 *
 * Стратегия:
 *   1. `color-scheme: light` на html переопределяет UA-default canvas/
 *      scrollbar-цвет (без него браузер всё равно рендерит canvas как dark).
 *   2. Переопределяем все Cal.com `--cal-*` CSS variables на light values
 *      когда .dark или [data-theme=dark] — чтобы все `bg-default`,
 *      `text-default`, `border-default` Tailwind utility classes стали light.
 *   3. Дополнительно `<meta name="color-scheme" content="light">` через
 *      nginx sub_filter в <head> — UA hint для form controls / scrollbar.
 *
 * Если в новой версии Cal.com будут новые `--cal-*` variables — добавить сюда.
 * Список переменных верифицирован против packages/config/tailwind-preset.js.
 * ========================================================================= */
html, html.dark, html[data-theme="dark"], html[data-theme="light"] {
  color-scheme: light !important;
}
html.dark, html[data-theme="dark"] {
  --cal-bg-emphasis: #e5e7eb !important;
  --cal-bg: #ffffff !important;
  --cal-bg-subtle: #f3f4f6 !important;
  --cal-bg-muted: #f9fafb !important;
  --cal-bg-inverted: #111827 !important;
  --cal-bg-info: #dee9fc !important;
  --cal-bg-success: #b3e9c7 !important;
  --cal-bg-attention: #ffd3ad !important;
  --cal-bg-error: #f9e3e2 !important;
  --cal-bg-dark-error: #752522 !important;
  --cal-bg-default: #ffffff !important;
  --cal-bg-elevated: #ffffff !important;
  --cal-bg-darkmode: #ffffff !important;
  --cal-bg-tips: #f9fafb !important;
  --cal-border-emphasis: #9ca3af !important;
  --cal-border: #d1d5db !important;
  --cal-border-subtle: #e5e7eb !important;
  --cal-border-muted: #f3f4f6 !important;
  --cal-border-booker: #f3f4f6 !important;
  --cal-border-error: #aa2e26 !important;
  --cal-border-default: #d1d5db !important;
  --cal-text-emphasis: #111827 !important;
  --cal-text: #374151 !important;
  --cal-text-subtle: #6b7280 !important;
  --cal-text-muted: #9ca3af !important;
  --cal-text-inverted: #ffffff !important;
  --cal-text-info: #253985 !important;
  --cal-text-success: #285231 !important;
  --cal-text-attention: #73321b !important;
  --cal-text-error: #752522 !important;
  --cal-brand: #111827 !important;
  --cal-brand-emphasis: #101010 !important;
  --cal-brand-text: #ffffff !important;
  background-color: #ffffff !important;
  color: #111827 !important;
}
html.dark body, html[data-theme="dark"] body {
  background-color: #ffffff !important;
  color: #111827 !important;
}

/* === Profile name ("Rechtsanwältin Julia Mut") — exact selector from Cal.com SSR === */
h1[data-testid="name-title"],
h1.font-cal {
  font-size: 2rem !important;   /* 32 px mobile */
  line-height: 1.2 !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em !important;
  color: var(--sm-c-text-strong) !important;
  margin-top: 1rem !important;
  margin-bottom: 0.75rem !important;
}
@media (min-width: 768px) {
  h1[data-testid="name-title"],
  h1.font-cal {
    font-size: 2.5rem !important;  /* 40 px desktop */
  }
}

/* === Bio / welcome text — sibling of the name h1 === */
h1[data-testid="name-title"] + div,
h1[data-testid="name-title"] + div p,
h1.font-cal + div,
h1.font-cal + div p {
  font-size: 1.125rem !important;       /* 18 px mobile */
  line-height: 1.55 !important;
  color: var(--sm-c-text) !important;   /* дарк, не серый */
  font-weight: 400 !important;
  max-width: none !important;
  text-align: left !important;
}
@media (min-width: 768px) {
  h1[data-testid="name-title"] + div,
  h1[data-testid="name-title"] + div p,
  h1.font-cal + div,
  h1.font-cal + div p {
    font-size: 1.25rem !important;    /* 20 px desktop */
    line-height: 1.6 !important;
  }
}

/* Enlarge the profile card a touch so the welcome is clearly the hero */
div.border-subtle.bg-default.rounded-xl {
  padding: 0.25rem !important;
}
div.border-subtle.bg-default.rounded-xl > .p-4 {
  padding: 1.25rem !important;
}

/* === Avatar: a bit bigger on the profile card === */
h1[data-testid="name-title"] ~ *, /* keep layout flow */
span.rounded-full {
  /* no-op but ensures sibling selectors don't break */
}

/* === Event-type cards on the profile page === */
/* h2 titles ("Telefonische Erstberatung", "Folgegespräch") */
a[href*="/julia-mut/"] h2,
[data-testid="event-type-link"] h2 {
  font-size: 1.375rem !important;
  font-weight: 700 !important;
  color: var(--sm-c-text-strong) !important;
}
/* description block within event-type card */
a[href*="/julia-mut/"] .text-subtle,
[data-testid="event-type-link"] .text-subtle p {
  font-size: 1.0625rem !important;
  line-height: 1.55 !important;
  color: #374151 !important;
}
/* Duration chip "30 Min" — Cal.com uses rounded-[4px], not rounded-md.
   Reliable selector: ul>li>div inside event-type link. */
a[href*="/julia-mut/"] ul li > div,
[data-testid="event-type-link"] ul li > div {
  font-size: 1rem !important;     /* 16 px (was native 12) */
  padding: 0.375rem 0.625rem !important;
  line-height: 1.25 !important;
}

/* === Booking form — larger inputs for older fingers === */
/* NB: input[type="tel"] is NOT in this list — react-phone-input-2 has its own
   padding-left: 48px to make room for the flag dropdown; overriding padding
   here would hide the +49 prefix and first digits. */
input[type="text"],
input[type="email"],
input[type="number"],
select,
textarea {
  font-size: 1.0625rem !important;
  min-height: var(--sm-tap) !important;
  padding: 0.75rem 1rem !important;
  line-height: 1.4 !important;
}
textarea { min-height: 100px !important; }

/* Phone input (react-phone-input-2) — keep flag space, enlarge to match siblings */
.react-tel-input { width: 100% !important; }
.react-tel-input .form-control {
  font-size: 1.0625rem !important;
  min-height: var(--sm-tap) !important;
  height: var(--sm-tap) !important;
  padding: 0.75rem 1rem 0.75rem 52px !important;
  line-height: 1.4 !important;
  width: 100% !important;
}
.react-tel-input .flag-dropdown { min-height: var(--sm-tap) !important; }

/* Hide 12/24h toggle — German audience, 24h only (forced via users.timeFormat=24 too) */
[data-testid="toggle-group-item-h:mma"],
[data-testid="toggle-group-item-HH:mm"],
div:has(> [data-testid="toggle-group-item-h:mma"]) {
  display: none !important;
}

/* Hide Booker layout switcher (Month / Week / Column) — stay on Month view always,
   matches Calendly-style single layout. Month is the default for julia-mut event types. */
[data-testid="toggle-group-item-month_view"],
[data-testid="toggle-group-item-week_view"],
[data-testid="toggle-group-item-column_view"],
div:has(> [data-testid="toggle-group-item-month_view"]) {
  display: none !important;
}

/* Hide "Meinen Kalender überlagen" (attendee calendar OAuth overlay) — not needed
   for a Calendly-style simple booking flow. Requires OAuth client setup anyway.
   NB: MUST use '>' direct-child selectors — plain :has() descendant would
   cascade up and hide the whole booker wrapper. */
[data-testid="overlay-calendar-switch"],
[data-testid="overlay-calendar-settings-button"],
label[for="overlayCalendar"],
div:has(> [data-testid="overlay-calendar-switch"]),
div:has(> div > [data-testid="overlay-calendar-switch"]) {
  display: none !important;
}

label { font-size: 1rem !important; font-weight: 500 !important; line-height: 1.4 !important; }

/* Radio/checkbox option labels — Cal.com uses Radix UI (button[role=radio] + label).
   Bigger font only; NO padding/min-height on label, it breaks the flex layout. */
[role="radiogroup"] label,
[role="group"] label {
  font-size: 1.0625rem !important;
  line-height: 1.5 !important;
}
/* Breathing room between radio rows */
[role="radiogroup"] > div,
[role="radiogroup"] [role="radio"] + label {
  margin-bottom: 4px;
}

/* Align radio button to top so it sits at the first line of a wrapping label */
[role="radiogroup"] > div,
[role="radiogroup"] > label,
[role="radiogroup"] [role="radio"]:not(:only-child) {
  align-items: flex-start !important;
}
/* Compensate for line-height so the dot is visually centered on cap-height
   of first text line. label font-size = 1.0625rem (17 px), line-height = 1.5
   → first-line center ≈ 12.75 px from top; radio 16 px (Cal.com h-4 w-4)
   → margin-top = 12.75 - 8 = ~5 px. */
[role="radiogroup"] [role="radio"] {
  margin-top: 5px !important;
  flex-shrink: 0 !important;
}

/* === Time-slot picker — 56 px tap targets === */
[data-testid="time"],
button[data-testid*="slot"] {
  min-height: var(--sm-tap-lg) !important;
  font-size: 1rem !important;          /* 16 px (was 18) — Julia: -2 pt */
  font-weight: 600 !important;
  margin-bottom: 10px !important;
  color: var(--sm-c-primary) !important;
  border-color: var(--sm-c-primary) !important;
}
[data-testid="time"]:hover,
button[data-testid*="slot"]:hover {
  background-color: var(--sm-c-primary) !important;
  color: #fff !important;
  border-color: var(--sm-c-primary) !important;
}
[data-testid="day"],
button[data-testid*="day"] {
  min-height: 48px !important;
  font-size: 1.0625rem !important;
}

/* Primary actions — Calendly-style solid blue */
button[type="submit"],
button[data-testid*="confirm"],
button[data-testid*="book"],
a[data-testid*="book"] {
  min-height: var(--sm-tap) !important;
  font-size: 1.0625rem !important;
  font-weight: 600 !important;
  padding: 0.875rem 1.5rem !important;
  border-radius: var(--sm-radius) !important;
  background-color: var(--sm-c-primary) !important;
  color: #fff !important;
  border-color: var(--sm-c-primary) !important;
}
button[type="submit"]:hover,
button[data-testid*="confirm"]:hover,
button[data-testid*="book"]:hover,
a[data-testid*="book"]:hover {
  background-color: var(--sm-c-primary-hover) !important;
  border-color: var(--sm-c-primary-hover) !important;
}

/* Focus-ring a11y */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid var(--sm-c-focus) !important;
  outline-offset: 2px !important;
}

/* Errors */
[role="alert"],
[data-testid*="error"] {
  font-size: 1rem !important;
  font-weight: 500 !important;
  color: #b91c1c !important;
  line-height: 1.5 !important;
}

/* Hide Cal.com's built-in "Powered by" logo block — our sm-footer.js attribution
   "betrieben mit Cal.com (Open Source, AGPL v3)" serves as the AGPL acknowledgement.
   AGPL v3 does not require retention of upstream UI branding. */
a[href*="go.cal.com"],
a[href*="go.cal.com"] img,
img[alt="Cal.com Logo"],
img[alt*="Cal.com"] {
  display: none !important;
}

/* Hide the old floating "Cookies" pill — we now have a footer button */
#cc-reopen-btn { display: none !important; }

/* === Texts NOT covered by existing overrides — floor for 40+ audience === */

/* Timezone / language selectors & generic small Cal.com chrome on booker */
[data-testid*="timezone"],
[data-testid*="timezone"] *,
select[name*="timezone"],
button[data-testid*="language"],
[data-testid*="language-select"] {
  font-size: 1rem !important;
  line-height: 1.4 !important;
}

/* Helper texts / form hints under inputs (Cal.com uses .text-subtle or .text-sm) */
form .text-subtle,
form [class*="text-subtle"],
form .text-sm:not(button):not(a) {
  font-size: 1rem !important;
  line-height: 1.5 !important;
}

/* Generic floor: leftover Tailwind text-xs → at least 14 px, excluding
   elements we style explicitly (e.g., rounded-[4px] duration chip above
   and icon SVG children). */
.text-xs:not([class*="rounded-"]):not(svg *) {
  font-size: 0.875rem !important;
}

/* === Footer with legal links + cookie settings (injected via sm-footer.js) === */
.sm-legal-footer {
  margin: 24px auto 32px;
  max-width: 48rem;
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 20px;
  font-size: 1rem;
  line-height: 1.4;
}
.sm-legal-footer a,
.sm-legal-footer button.sm-legal-link {
  color: var(--sm-c-link) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
  background: transparent;
  border: 0;
  padding: 10px 4px;
  font: inherit;
  font-size: 0.875rem !important;   /* 14 px — legal small print */
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.sm-legal-footer a:hover,
.sm-legal-footer button.sm-legal-link:hover {
  color: var(--sm-c-primary-hover) !important;
}
.sm-legal-footer .sm-sep {
  color: #9ca3af;
  user-select: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================================================
 * Booking-view left column — readable sizes for 40+ audience.
 * Selectors verified against Cal.com source in the calcom container:
 *   - apps/web/modules/bookings/components/EventMeta.tsx
 *       container: [data-testid="event-meta"]
 *       description: [data-testid="event-meta-description"]
 *       timezone:    [data-testid="event-meta-current-timezone"]
 *   - apps/web/modules/bookings/components/event-meta/Title.tsx
 *       h1[data-testid="event-title"]
 *   - apps/web/modules/bookings/components/event-meta/Members.tsx
 *       host-name paragraph: <p class="text-subtle mt-2 text-sm font-semibold">
 *       (no data-testid — we match by position inside event-meta)
 *   - apps/web/modules/bookings/components/event-meta/Details.tsx
 *       EventMetaBlock wrapper: first-level flex children of event-meta
 *         (icon + text), rendered as .text-sm rows
 * Only font-size / line-height / font-weight changes; no decorations.
 * ========================================================================= */

/* Host name ("Rechtsanwältin Julia Mut") — first <p> inside event-meta.
   Cal.com uses .text-subtle + .text-sm + .font-semibold; we only enlarge. */
[data-testid="event-meta"] > p.text-subtle {
  font-size: 1.25rem !important;    /* 20 px mobile */
  line-height: 1.35 !important;
  font-weight: 600 !important;
  color: var(--sm-c-text) !important;
}
@media (min-width: 768px) {
  [data-testid="event-meta"] > p.text-subtle {
    font-size: 1.375rem !important; /* 22 px desktop */
  }
}

/* Event title ("Telefonische Erstberatung") — Cal.com uses .text-xl = 20 px.
   Bump to 24 / 28 for the hero line. */
h1[data-testid="event-title"] {
  font-size: 1.5rem !important;     /* 24 px mobile */
  line-height: 1.25 !important;
  font-weight: 700 !important;
}
@media (min-width: 768px) {
  h1[data-testid="event-title"] {
    font-size: 1.75rem !important;  /* 28 px desktop */
  }
}

/* Description block + "Kosten & Vorbereitung" markdown content.
   EventMetaBlock renders as a flex container; the text lives in its
   inner <div> (contentClassName="mb-8"). */
[data-testid="event-meta-description"],
[data-testid="event-meta-description"] p,
[data-testid="event-meta-description"] li {
  font-size: 1rem !important;       /* 16 px */
  line-height: 1.55 !important;
  color: var(--sm-c-text) !important;
}
@media (min-width: 768px) {
  [data-testid="event-meta-description"],
  [data-testid="event-meta-description"] p,
  [data-testid="event-meta-description"] li {
    font-size: 1rem !important;      /* 16 px — Julia: -1 pt (match mobile) */
  }
}

/* Section headers inside description.
   description in DB uses <strong>...</strong> on its own line as a
   visual h2 (Cal.com inlines plain text → <p>...<br>; we override
   <strong> to render as a block-level header). */
[data-testid="event-meta-description"] strong {
  display: block;
  font-size: 1.125rem !important;    /* 18 px mobile */
  line-height: 1.35 !important;
  font-weight: 700 !important;
  color: var(--sm-c-text) !important;
  margin: 1.1rem 0 0.35rem 0 !important;
  letter-spacing: -0.005em;
}
[data-testid="event-meta-description"] > p:first-child > strong:first-child,
[data-testid="event-meta-description"] > strong:first-child {
  margin-top: 0 !important;
}
@media (min-width: 768px) {
  [data-testid="event-meta-description"] strong {
    font-size: 1.2rem !important;    /* 19.2 px desktop */
  }
}

/* Description scroll container: +30% height per Julia.
   Cal.com sets .max-h-[180px] via Tailwind arbitrary value; override 180 → 234. */
[data-testid="event-meta-description"] [class*="max-h-[180px]"],
[data-testid="event-meta-description"] .overflow-y-auto {
  max-height: 234px !important;
}

/* Booker card shadow — lift the white block off the gray page background. */
body > main > div > div {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
}

/* Time-slot column date header: "Mittwoch, 6. Mai".
   Cal.com wraps the day-number in <span class="... text-xs font-medium">;
   uniform 18 px / weight 600 matches the weekday, kills the rounded pill. */
header > span > span:first-child,
header > span > span:nth-child(2),
header span.rounded-3xl {
  font-size: 1.125rem !important;
  line-height: 1.5 !important;
  font-weight: 600 !important;
}
header span.rounded-3xl {
  padding: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  min-width: 0 !important;
  min-height: 0 !important;
  color: inherit !important;
  display: inline !important;
}

/* Icon-label rows: "30 Min" (duration), "Telefonnummer" (location),
   timezone row. They are direct flex children of event-meta with
   .text-sm. Scope narrowly so nothing else is affected. */
[data-testid="event-meta"] .text-sm,
[data-testid="event-meta-current-timezone"],
[data-testid="event-meta-current-timezone"] * {
  font-size: 0.9375rem !important;  /* 15 px floor */
  line-height: 1.45 !important;
}

/* =========================================================================
 * Calendar (DatePicker) — Calendly-style blue highlights.
 * Source: packages/features/calendars/components/DatePicker.tsx
 *   day cells:   [data-testid="day"]
 *   selected:    adds class .bg-brand-default
 *   today:       inner <span class="...bg-brand-default"> dot
 *   disabled:    data-disabled="true"
 *   nav:         [data-testid="decrementMonth" | "incrementMonth"]
 * Cal.com's brand color default is dark/gray; we override to #006bff.
 * ========================================================================= */

/* Selected day — solid blue circle, white text */
[data-testid="day"].bg-brand-default {
  background-color: var(--sm-c-primary) !important;
  color: #fff !important;
}
[data-testid="day"].bg-brand-default:hover {
  background-color: var(--sm-c-primary-hover) !important;
}

/* "Today" indicator dot (inner span with .bg-brand-default) — 2× larger,
   and on mobile nudged 1 px down so it doesn't crowd the day number. */
[data-testid="day"] span.bg-brand-default {
  background-color: var(--sm-c-primary) !important;
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
}
@media (max-width: 767px) {
  [data-testid="day"] span.bg-brand-default {
    margin-top: 1px !important;
  }
}

/* Next-month label shown under the first day of the following month
   (e.g. "MAY" under "1" when the current month's grid spills into the next).
   Target: the second direct child <div> inside a calendar cell
   (the first child is the day <button>). Cal.com ships this at ~8 px;
   Julia asked for 14 px. */
.grid.grid-cols-7.grid-rows-6 > div > div {
  font-size: 14px !important;
  line-height: 1.2 !important;
  font-weight: 500 !important;
  margin-top: 1px !important;
}

/* NoAvailabilityDialog close button ("Schließen") — Radix Dialog (not Popover).
   Exact selector from Cal.com source:
   packages/features/calendars/components/NoAvailabilityDialog.tsx
   data-testid="close_dialog_button" is unique to this dialog. */
button[data-testid="close_dialog_button"] {
  background-color: var(--sm-c-primary) !important;
  color: #fff !important;
  border-color: var(--sm-c-primary) !important;
}
button[data-testid="close_dialog_button"]:hover {
  background-color: var(--sm-c-primary-hover) !important;
  border-color: var(--sm-c-primary-hover) !important;
}

/* Available days (non-disabled, non-selected) — translucent blue bg.
   Opacity 0.12 (was 0.067) for better visibility on low-brightness phone
   screens while still staying visually distinct from the solid selected day. */
[data-testid="day"]:not([data-disabled="true"]):not(.bg-brand-default) {
  background-color: rgba(0, 105, 255, 0.12) !important;
}
[data-testid="day"]:not([data-disabled="true"]):not(.bg-brand-default):hover {
  background-color: rgba(0, 105, 255, 0.22) !important;
}

/* Month navigation arrows — larger, circular, translucent blue bg */
[data-testid="decrementMonth"],
[data-testid="incrementMonth"] {
  color: var(--sm-c-primary) !important;
  background-color: rgba(0, 105, 255, 0.067) !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
[data-testid="decrementMonth"] svg,
[data-testid="incrementMonth"] svg {
  width: 22px !important;
  height: 22px !important;
  color: inherit !important;
  stroke: currentColor !important;
}
[data-testid="decrementMonth"]:hover,
[data-testid="incrementMonth"]:hover {
  background-color: rgba(0, 105, 255, 0.15) !important;
  color: var(--sm-c-primary-hover) !important;
}
/* Disabled month nav (e.g. can't go before current month) — no blue bg, gray chevron */
[data-testid="decrementMonth"]:disabled,
[data-testid="incrementMonth"]:disabled,
[data-testid="decrementMonth"][disabled],
[data-testid="incrementMonth"][disabled] {
  background-color: transparent !important;
  color: #9ca3af !important;
  cursor: not-allowed !important;
}
[data-testid="decrementMonth"]:disabled:hover,
[data-testid="incrementMonth"]:disabled:hover {
  background-color: transparent !important;
  color: #9ca3af !important;
}

/* Avatar thumbnail in booker left column (grid-area:meta) — hidden per
   Julia request 2026-04-20. Target avatar specifically via /api/avatar
   URL, so that location icons (Phone, etc.) from /app-store/* remain.
   To restore, remove this rule. */
[data-testid="event-meta"] img[src*="/api/avatar"],
[data-testid="event-meta"] span:has(> img[src*="/api/avatar"]) {
  display: none !important;
}

/* Back-to-event-types button on booker — blue arrow */
button[aria-label*="zurück" i],
button[aria-label*="Back" i] svg,
[data-testid="back-btn"] {
  color: var(--sm-c-primary) !important;
}

/* =========================================================================
 * Right column — day header in the time-slot picker.
 * Source: apps/web/modules/bookings/components/AvailableTimesHeader.tsx
 *   <header class="... flex flex-row items-center font-medium ...">
 *     <span><span>Do</span><span>23</span></span> ... <TimeFormatToggle />
 *   </header>
 * sm-weekday-full.js rewrites the header text to "Donnerstag, 23. April".
 * We just make sure the replaced text is readable.
 * ========================================================================= */
header[data-sm-weekday-full="1"],
header[data-sm-weekday-full="1"] > span,
header[data-sm-weekday-full="1"] > span > span {
  font-size: 1.125rem !important;   /* 18 px */
  line-height: 1.35 !important;
  font-weight: 600 !important;
  color: var(--sm-c-text-strong) !important;
  letter-spacing: 0 !important;
  text-transform: none !important;  /* override text-xs uppercase on column view */
}

/* Success / cancel page — hide Cal.com self-promo block.
   Source: apps/web/modules/bookings/views/bookings-single-view.tsx
   i18n key: create_booking_link_with_calcom. Julia доменов и e-mail
   с Cal.com не делит, блок клиенту показывать незачем. */
div.text-center.text-xs:has(> a[href*="cal.com/signup"]) {
  display: none !important;
}
hr.border-subtle.mt-8:has(+ div.text-center.text-xs > a[href*="cal.com/signup"]) {
  display: none !important;
}

/* =========================================================================
 * UPGRADE-CHECK on Cal.com major version bump.
 * Themen multiselect (Erstberatung bookingFields) — chip styling.
 * react-select v5 рендерит классы либо .react-select__multi-value
 * (если classNamePrefix дотекает) либо emotion-hashed .css-*-multiValue.
 * Используем wildcard [class*="multiValue"] для устойчивости.
 * Скоуп #themen — оборачивающий div поля.
 * ========================================================================= */
#themen [class*="multiValue"] {
  background: var(--cal-brand-color, #2F3C7E) !important;
  border-radius: 8px !important;
  padding: 4px 8px !important;
  margin: 4px 6px 4px 0 !important;
}

#themen [class*="multiValue"] > div,
#themen [class*="multiValue"] > div > div {
  color: #FFFFFF !important;
  font-weight: 700 !important;
  font-size: 0.875rem !important;
  line-height: 1.3 !important;
}

#themen [class*="multiValue__remove"],
#themen [class*="multiValue"] [role="button"] {
  color: #FFFFFF !important;
  background: transparent !important;
  min-width: 28px !important;
  min-height: 28px !important;
  padding: 0 4px !important;
  margin-left: 4px !important;
  border-radius: 4px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#themen [class*="multiValue__remove"] svg,
#themen [class*="multiValue"] [role="button"] svg {
  width: 18px !important;
  height: 18px !important;
  color: #FFFFFF !important;
  fill: #FFFFFF !important;
  stroke: #FFFFFF !important;
  stroke-width: 2.5 !important;
}

#themen [class*="multiValue__remove"]:hover,
#themen [class*="multiValue"] [role="button"]:hover {
  background: rgba(255, 255, 255, 0.2) !important;
}

@media (max-width: 640px) {
  #themen [class*="multiValue__remove"],
  #themen [class*="multiValue"] [role="button"] {
    min-width: 36px !important;
    min-height: 36px !important;
  }
}

/* =========================================================================
 * UPGRADE-CHECK on Cal.com major version bump — verify selectors below.
 *
 * Hide green dot before time-slot text in booker.
 * Source: /calcom/apps/web/modules/bookings/components/AvailableTimes.tsx
 *   line 167 <Button data-testid="time" ...>, lines 178-193 spans
 *   class="...rounded-full bg-emerald-400" (overlay-calendar / seats indicator)
 * ========================================================================= */
[data-testid="time"] span.rounded-full {
  display: none !important;
}

/* =========================================================================
 * UPGRADE-CHECK on Cal.com major version bump — verify selectors below.
 *
 * Force-light Cal.com 404 / error page (otherwise OS dark-mode → bg #000 + #fff text).
 *
 * Why three layers of selectors:
 *   1. <html id="__next_error__"> — Next.js framework error fallback.
 *      Source: Next.js app router built-in (any error route).
 *   2. <html class="dark"> — Cal.com theme system применяет .dark class
 *      когда browser имеет prefers-color-scheme:dark.
 *      Source: packages/lib/themeProvider (Cal.com).
 *   3. [data-testid="404-page"] / .next-error-h1 — wrapper inside body
 *      after React hydration. Source: apps/web/app/notFoundClient.tsx.
 *
 * `color-scheme: light` важно: переопределяет UA-default canvas/scrollbar.
 * Без него браузер при prefers-color-scheme:dark рендерит элементы без явного
 * background как темные, даже если у нас есть `background:#fff !important`.
 * ========================================================================= */
html#__next_error__,
html#__next_error__ body,
html.dark#__next_error__,
html.dark#__next_error__ body {
  color-scheme: light !important;
  background: #fff !important;
  background-color: #fff !important;
  color: #070a0d !important;
}
/* Любой Cal.com bg-default / bg-subtle wrapper внутри 404 — белый */
html#__next_error__ [data-testid="404-page"],
html#__next_error__ [class*="bg-default"],
html#__next_error__ [class*="bg-subtle"],
html#__next_error__ main,
html#__next_error__ main > div {
  background-color: #fff !important;
  color: #070a0d !important;
}
html#__next_error__ [data-testid="404-page"] .text-subtle,
html#__next_error__ [class*="text-subtle"],
html#__next_error__ [class*="text-emphasis"] {
  color: #6b7280 !important;
}
html#__next_error__ [data-testid="404-page"] a,
html#__next_error__ a {
  color: #006bff !important;
}
html#__next_error__ .next-error-h1 {
  border-right-color: rgba(0,0,0,.3) !important;
  color: #070a0d !important;
}

/* =========================================================================
 * UPGRADE-CHECK on Cal.com major version bump.
 *
 * Success / cancel page (/booking/<uid>, /booking/<uid>?cancel=true) —
 * фикс наложения футера на контент карточки. Cal.com оборачивает карточку в
 *   <div class="h-screen" data-testid="success-page">
 * с фиксированной высотой 100vh. На cancel-странице карточка содержит
 * полный booking-метадатный блок + Reason-textarea + кнопки и обычно длиннее
 * 100vh. Контент переполняет враппер, а наш sm-footer.js, аппендящийся в
 * <body> после h-screen-враппера, сидит на body-позиции 100vh — ровно туда,
 * куда визуально вылезает overflow карточки. Получаем наложение текста
 * футера на текст формы.
 *
 * Source: apps/web/modules/bookings/views/bookings-single-view.tsx
 *   <div data-testid="success-page" className="h-screen">…</div>
 *
 * Fix: меняем height: 100vh → min-height: 100vh, чтобы враппер рос с
 * контентом. flex items-end на внутреннем `<div class="…flex items-end…">`
 * остаётся валидным (когда контент короткий — карточка анкорится к низу
 * 100vh-минимума как раньше; когда длинный — враппер растёт, всё помещается,
 * футер ложится ниже в нормальный flow).
 * ========================================================================= */
div[data-testid="success-page"] {
  height: auto !important;
  min-height: 100vh !important;
}
