/* Organizer portal (/pro/). Light theme, no dark mode in v1.
   Rule: colors, radii and spacing only through the :root tokens below (spec §3 Gabarit). */
:root {
  color-scheme: light;
  --bg: #f6f5fa;
  --bg-glow: #ede3fa;
  --surface: #fff;
  --line: #e3deed;
  --line-strong: #d6cfe6;
  --control-border: #8a80a3;
  /* Sign in with Apple (HIG): title, logo and outline black on a white fill, no other color. */
  --apple-ink: #000;
  --apple-fill: #fff;
  --text: #22163a;
  --body: #2a1e44;
  --muted: #554b70;
  --accent: #6b46c1;
  --accent-hover: #5a38a8;
  --accent-soft: #efe9fb;
  --on-accent: #fff;
  --danger: #b42318;
  --danger-hover: #912018;
  --danger-soft: #fef3f2;
  --success: #067647;
  --success-soft: #ecfdf3;
  --info: #175cd3;
  --info-soft: #eff8ff;
  --warning: #b54708;
  --warning-soft: #fffaeb;
  --skeleton: #ece8f4;
  --skeleton-shine: #f8f6fc;
  --scrim: rgb(34 22 58 / 0.4);
  --shadow-xs: 0 1px 2px rgb(34 22 58 / 0.06);
  --shadow: 0 1px 2px rgb(34 22 58 / 0.04), 0 4px 12px -2px rgb(34 22 58 / 0.06), 0 16px 32px -12px rgb(34 22 58 / 0.1);
  --shadow-pop: 0 4px 12px -2px rgb(34 22 58 / 0.1), 0 24px 48px -12px rgb(34 22 58 / 0.24);
  --shadow-accent: 0 1px 2px rgb(107 70 193 / 0.24), 0 6px 16px -4px rgb(107 70 193 / 0.4);
  --shadow-logo: 0 2px 8px rgb(107 70 193 / 0.25);

  --radius-control: 10px;
  --radius-card: 16px; /* GlassSurface radius in the app */
  --radius-inner: 6px;
  /* Brand mark: the site header ratio (10 px on a 38 px logo). */
  --radius-brand: 26%;
  --radius-pill: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  --sidebar-width: 248px;
  --topbar-height: 56px;
  --content-max: 1080px;
  --card-max: 480px;
  --thumb-width: 64px;
  --thumb-height: 36px;
  --control-height: 44px;
  --menu-width: 256px; /* the longest item on one line: « Enregistrer comme modèle » with its icon */
  --dialog-width: 440px;
  --search-width: 320px;
  --logo-size: 40px;
  --logo-size-lg: 56px;
  --logo-size-xl: 96px;
  --check-size: 20px;
  /* The app's Switch (Material 3): 52 x 32 track with a 2 px outline, 16 px thumb off, 24 px on. */
  --switch-width: 52px;
  --switch-height: 32px;
  --switch-border: 2px;
  --switch-thumb: 16px;
  --switch-thumb-on: 24px;
  --series-day-min: 200px;
  --icon-size: 20px;
  --icon-size-sm: 16px;
  --icon-size-lg: 48px;
  /* Section title tile: the app's category block header (20 px icon, padding 8). */
  --icon-tile: 36px;
  --dot-size: 10px;
  --textarea-min-height: 120px;
  --legal-max: 720px;
  --form-max: 680px;
  --cover-thumb-width: 320px;
  /* Template card thumbnail: the app's 92 x 92 (all_templates_page.dart). */
  --template-thumb: 92px;
  --glow-size: 900px 480px;
  /* Cover safe zone (spec §5): the square calendar thumbnail shows 56 % of the width, the 2.7:1 home card 66 % of the height. */
  --safe-zone-width: 56%;
  --safe-zone-height: 66%;
  /* Cover previews (spec §5, W2b): the CSS widths of COVER_PREVIEWS in js/image-spec.js (guarded by tests/pro/styles). */
  --preview-site-width: 320px;
  --preview-home-width: 280px;
  --preview-detail-width: 390px;
  --preview-calendar-width: 74px;
  --line-width: 1px;
  --focus-width: 3px;
  --focus-offset: 2px;

  --font-system: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font: 'Manrope', var(--font-system);
}

*, *::before, *::after { box-sizing: border-box; }
/* Author display rules (.btn, .previous-logo, .menu...) would otherwise beat the UA [hidden] rule. */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--body);
  font: 400 1rem/1.5 var(--font);
}

h1, h2, h3 { color: var(--text); line-height: 1.25; margin: 0 0 var(--space-2); }
h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 1.125rem; font-weight: 700; }
p { margin: 0 0 var(--space-3); }
a { color: var(--accent); text-decoration-thickness: from-font; text-underline-offset: 0.18em; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; }
code { font-family: inherit; font-weight: 700; }

:focus-visible {
  outline: var(--focus-width) solid var(--accent);
  outline-offset: var(--focus-offset);
}
h1:focus { outline: none; }

.muted { color: var(--muted); }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.noscript { padding: var(--space-6); }
#app[aria-busy="true"] { padding: var(--space-6); color: var(--muted); }

/* App icons: glyphs of the Material Icons font the app draws Icons.* with (Google, CC BY 4.0, img/icons/LICENSE),
   extracted by scripts/material-icons.swift and painted in currentColor. To add one: extract it, then add its
   .icon-name rule below (tests/pro/icons.test.mjs checks file, rule and use). url() is written in each rule:
   a relative url() inside a custom property does not resolve the same way in every browser. */
.icon {
  display: inline-block;
  flex: none;
  width: var(--icon-size);
  height: var(--icon-size);
  background-color: currentColor;
  -webkit-mask: center / contain no-repeat;
  mask: center / contain no-repeat;
}
.icon-account_balance { -webkit-mask-image: url(img/icons/account_balance.svg); mask-image: url(img/icons/account_balance.svg); }
.icon-add { -webkit-mask-image: url(img/icons/add.svg); mask-image: url(img/icons/add.svg); }
.icon-add_photo_alternate_outlined { -webkit-mask-image: url(img/icons/add_photo_alternate_outlined.svg); mask-image: url(img/icons/add_photo_alternate_outlined.svg); }
.icon-bookmark_add_outlined { -webkit-mask-image: url(img/icons/bookmark_add_outlined.svg); mask-image: url(img/icons/bookmark_add_outlined.svg); }
.icon-business_center { -webkit-mask-image: url(img/icons/business_center.svg); mask-image: url(img/icons/business_center.svg); }
.icon-calendar_today_outlined { -webkit-mask-image: url(img/icons/calendar_today_outlined.svg); mask-image: url(img/icons/calendar_today_outlined.svg); }
.icon-category { -webkit-mask-image: url(img/icons/category.svg); mask-image: url(img/icons/category.svg); }
.icon-category_outlined { -webkit-mask-image: url(img/icons/category_outlined.svg); mask-image: url(img/icons/category_outlined.svg); }
.icon-celebration { -webkit-mask-image: url(img/icons/celebration.svg); mask-image: url(img/icons/celebration.svg); }
.icon-check { -webkit-mask-image: url(img/icons/check.svg); mask-image: url(img/icons/check.svg); }
.icon-close { -webkit-mask-image: url(img/icons/close.svg); mask-image: url(img/icons/close.svg); }
.icon-coffee { -webkit-mask-image: url(img/icons/coffee.svg); mask-image: url(img/icons/coffee.svg); }
.icon-content_copy { -webkit-mask-image: url(img/icons/content_copy.svg); mask-image: url(img/icons/content_copy.svg); }
.icon-dashboard_customize { -webkit-mask-image: url(img/icons/dashboard_customize.svg); mask-image: url(img/icons/dashboard_customize.svg); }
.icon-date_range { -webkit-mask-image: url(img/icons/date_range.svg); mask-image: url(img/icons/date_range.svg); }
.icon-delete_outline { -webkit-mask-image: url(img/icons/delete_outline.svg); mask-image: url(img/icons/delete_outline.svg); }
.icon-description_outlined { -webkit-mask-image: url(img/icons/description_outlined.svg); mask-image: url(img/icons/description_outlined.svg); }
.icon-directions_bike { -webkit-mask-image: url(img/icons/directions_bike.svg); mask-image: url(img/icons/directions_bike.svg); }
.icon-directions_run { -webkit-mask-image: url(img/icons/directions_run.svg); mask-image: url(img/icons/directions_run.svg); }
.icon-directions_walk { -webkit-mask-image: url(img/icons/directions_walk.svg); mask-image: url(img/icons/directions_walk.svg); }
.icon-edit { -webkit-mask-image: url(img/icons/edit.svg); mask-image: url(img/icons/edit.svg); }
.icon-egg_alt { -webkit-mask-image: url(img/icons/egg_alt.svg); mask-image: url(img/icons/egg_alt.svg); }
.icon-euro { -webkit-mask-image: url(img/icons/euro.svg); mask-image: url(img/icons/euro.svg); }
.icon-event { -webkit-mask-image: url(img/icons/event.svg); mask-image: url(img/icons/event.svg); }
.icon-event_note { -webkit-mask-image: url(img/icons/event_note.svg); mask-image: url(img/icons/event_note.svg); }
.icon-expand_more { -webkit-mask-image: url(img/icons/expand_more.svg); mask-image: url(img/icons/expand_more.svg); }
.icon-family_restroom { -webkit-mask-image: url(img/icons/family_restroom.svg); mask-image: url(img/icons/family_restroom.svg); }
.icon-fitness_center { -webkit-mask-image: url(img/icons/fitness_center.svg); mask-image: url(img/icons/fitness_center.svg); }
.icon-groups { -webkit-mask-image: url(img/icons/groups.svg); mask-image: url(img/icons/groups.svg); }
.icon-groups_outlined { -webkit-mask-image: url(img/icons/groups_outlined.svg); mask-image: url(img/icons/groups_outlined.svg); }
.icon-handyman { -webkit-mask-image: url(img/icons/handyman.svg); mask-image: url(img/icons/handyman.svg); }
.icon-hiking { -webkit-mask-image: url(img/icons/hiking.svg); mask-image: url(img/icons/hiking.svg); }
.icon-info_outline { -webkit-mask-image: url(img/icons/info_outline.svg); mask-image: url(img/icons/info_outline.svg); }
.icon-link { -webkit-mask-image: url(img/icons/link.svg); mask-image: url(img/icons/link.svg); }
.icon-local_bar { -webkit-mask-image: url(img/icons/local_bar.svg); mask-image: url(img/icons/local_bar.svg); }
.icon-lock_outline { -webkit-mask-image: url(img/icons/lock_outline.svg); mask-image: url(img/icons/lock_outline.svg); }
.icon-more_horiz { -webkit-mask-image: url(img/icons/more_horiz.svg); mask-image: url(img/icons/more_horiz.svg); }
.icon-movie { -webkit-mask-image: url(img/icons/movie.svg); mask-image: url(img/icons/movie.svg); }
.icon-museum { -webkit-mask-image: url(img/icons/museum.svg); mask-image: url(img/icons/museum.svg); }
.icon-music_note { -webkit-mask-image: url(img/icons/music_note.svg); mask-image: url(img/icons/music_note.svg); }
.icon-nightlife { -webkit-mask-image: url(img/icons/nightlife.svg); mask-image: url(img/icons/nightlife.svg); }
.icon-notes { -webkit-mask-image: url(img/icons/notes.svg); mask-image: url(img/icons/notes.svg); }
.icon-palette { -webkit-mask-image: url(img/icons/palette.svg); mask-image: url(img/icons/palette.svg); }
.icon-park { -webkit-mask-image: url(img/icons/park.svg); mask-image: url(img/icons/park.svg); }
.icon-payments_outlined { -webkit-mask-image: url(img/icons/payments_outlined.svg); mask-image: url(img/icons/payments_outlined.svg); }
.icon-people { -webkit-mask-image: url(img/icons/people.svg); mask-image: url(img/icons/people.svg); }
.icon-person_outline { -webkit-mask-image: url(img/icons/person_outline.svg); mask-image: url(img/icons/person_outline.svg); }
.icon-place_outlined { -webkit-mask-image: url(img/icons/place_outlined.svg); mask-image: url(img/icons/place_outlined.svg); }
.icon-pool { -webkit-mask-image: url(img/icons/pool.svg); mask-image: url(img/icons/pool.svg); }
.icon-public { -webkit-mask-image: url(img/icons/public.svg); mask-image: url(img/icons/public.svg); }
.icon-repeat { -webkit-mask-image: url(img/icons/repeat.svg); mask-image: url(img/icons/repeat.svg); }
.icon-restaurant { -webkit-mask-image: url(img/icons/restaurant.svg); mask-image: url(img/icons/restaurant.svg); }
.icon-rocket_launch { -webkit-mask-image: url(img/icons/rocket_launch.svg); mask-image: url(img/icons/rocket_launch.svg); }
.icon-schedule { -webkit-mask-image: url(img/icons/schedule.svg); mask-image: url(img/icons/schedule.svg); }
.icon-search { -webkit-mask-image: url(img/icons/search.svg); mask-image: url(img/icons/search.svg); }
.icon-soup_kitchen { -webkit-mask-image: url(img/icons/soup_kitchen.svg); mask-image: url(img/icons/soup_kitchen.svg); }
.icon-sports { -webkit-mask-image: url(img/icons/sports.svg); mask-image: url(img/icons/sports.svg); }
.icon-sports_basketball { -webkit-mask-image: url(img/icons/sports_basketball.svg); mask-image: url(img/icons/sports_basketball.svg); }
.icon-sports_rugby { -webkit-mask-image: url(img/icons/sports_rugby.svg); mask-image: url(img/icons/sports_rugby.svg); }
.icon-sports_soccer { -webkit-mask-image: url(img/icons/sports_soccer.svg); mask-image: url(img/icons/sports_soccer.svg); }
.icon-sports_tennis { -webkit-mask-image: url(img/icons/sports_tennis.svg); mask-image: url(img/icons/sports_tennis.svg); }
.icon-sports_volleyball { -webkit-mask-image: url(img/icons/sports_volleyball.svg); mask-image: url(img/icons/sports_volleyball.svg); }
.icon-terrain { -webkit-mask-image: url(img/icons/terrain.svg); mask-image: url(img/icons/terrain.svg); }
.icon-theater_comedy { -webkit-mask-image: url(img/icons/theater_comedy.svg); mask-image: url(img/icons/theater_comedy.svg); }
.icon-visibility_outlined { -webkit-mask-image: url(img/icons/visibility_outlined.svg); mask-image: url(img/icons/visibility_outlined.svg); }
.icon-wine_bar { -webkit-mask-image: url(img/icons/wine_bar.svg); mask-image: url(img/icons/wine_bar.svg); }
/* High contrast: forced colors would replace the background with Canvas and hide the icon. */
@media (forced-colors: active) { .icon { forced-color-adjust: none; background-color: CanvasText; } }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-height);
  padding: var(--space-2) var(--space-4);
  border: var(--line-width) solid transparent;
  border-radius: var(--radius-control);
  font: 600 0.9375rem/1.2 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); color: var(--on-accent); }
.btn-primary:active:not(:disabled) { box-shadow: none; }
.btn-secondary, .btn-provider { background: var(--surface); color: var(--text); border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.btn-secondary:hover:not(:disabled), .btn-provider:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--control-border); color: var(--text); }
.btn-danger { background: var(--danger); color: var(--on-accent); box-shadow: var(--shadow-xs); }
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--accent-soft); }
.btn-icon { min-width: var(--control-height); padding: 0; font-size: 1.25rem; }
.btn-provider { width: 100%; gap: var(--space-3); border-color: var(--control-border); }
.btn-provider img { flex: none; }
/* HIG « white with outline »: black only, the system font the HIG prefers, no hover color. High contrast keeps
   it black on white, or its black logo (an <img>, never adjusted) would vanish on a dark theme. */
.btn-apple, .btn-apple:hover:not(:disabled) { background: var(--apple-fill); border-color: var(--apple-ink); color: var(--apple-ink); }
.btn-apple { font-family: var(--font-system); }
@media (forced-colors: active) {
  .btn-apple { forced-color-adjust: none; }
  .btn-apple:focus-visible { outline-color: Highlight; }
}
.btn-link {
  min-height: var(--control-height);
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: 600 0.9375rem/1.2 var(--font);
  text-decoration: underline;
  text-decoration-thickness: from-font;
  text-underline-offset: 0.18em;
  border-radius: var(--radius-inner);
  cursor: pointer;
}
.btn-link:disabled { opacity: 0.6; cursor: not-allowed; }
.actions, .store-links { display: flex; flex-wrap: wrap; gap: var(--space-3); margin: var(--space-4) 0 0; }

/* Forms */
.form { display: grid; gap: var(--space-3); }
.field { display: grid; gap: var(--space-1); }
.field label { color: var(--text); font-weight: 600; font-size: 0.9375rem; }
input, select, textarea {
  width: 100%;
  min-height: var(--control-height);
  padding: var(--space-2) var(--space-3);
  border: var(--line-width) solid var(--control-border);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font: 400 1rem/1.4 var(--font);
  transition: border-color 0.15s ease;
}
:is(input:not([type="checkbox"], [type="radio"], [type="range"]), select, textarea):focus-visible { outline-offset: 0; }
:is(input:not([type="checkbox"], [type="radio"], [type="range"]), select, textarea):focus-visible:not([aria-invalid="true"]) { border-color: var(--accent); }
.form-error { color: var(--danger); font-weight: 600; margin: var(--space-3) 0 0; }
.form-info { color: var(--success); margin: var(--space-3) 0 0; }
.form-error:empty, .form-info:empty { display: none; }
textarea { min-height: var(--textarea-min-height); resize: vertical; }
input[type="checkbox"] {
  flex: none;
  width: var(--check-size);
  height: var(--check-size);
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}
/* The app's Switch (« Événement payant »): a checkbox with role="switch" drawn as a track and a thumb. It stays a native
   checkbox (Space and its label toggle it); the thumb's side and size, not only the color, say on or off. */
input[type="checkbox"][role="switch"] {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  width: var(--switch-width);
  height: var(--switch-height);
  border: var(--switch-border) solid var(--control-border);
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
input[type="checkbox"][role="switch"]::before {
  content: '';
  position: absolute;
  inset-block: 0;
  inset-inline-start: calc((var(--switch-height) - 2 * var(--switch-border) - var(--switch-thumb)) / 2);
  width: var(--switch-thumb);
  height: var(--switch-thumb);
  margin-block: auto;
  border-radius: var(--radius-pill);
  background: var(--control-border);
  transition: inset-inline-start 0.15s ease, width 0.15s ease, height 0.15s ease;
}
input[type="checkbox"][role="switch"]:checked { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"][role="switch"]:checked::before {
  inset-inline-start: calc(100% - var(--switch-thumb-on) - (var(--switch-height) - 2 * var(--switch-border) - var(--switch-thumb-on)) / 2);
  width: var(--switch-thumb-on);
  height: var(--switch-thumb-on);
  background: var(--on-accent);
}
input[type="checkbox"][role="switch"]:disabled { opacity: 0.6; cursor: not-allowed; }
/* High contrast: system colors, the thumb kept visible on the track. */
@media (forced-colors: active) {
  input[type="checkbox"][role="switch"] { forced-color-adjust: none; background: Canvas; border-color: CanvasText; }
  input[type="checkbox"][role="switch"]::before { background: CanvasText; }
  input[type="checkbox"][role="switch"]:checked { background: Highlight; border-color: Highlight; }
  input[type="checkbox"][role="switch"]:checked::before { background: HighlightText; }
  input[type="checkbox"][role="switch"]:disabled { border-color: GrayText; }
  input[type="checkbox"][role="switch"]:disabled::before { background: GrayText; }
  input[type="checkbox"][role="switch"]:focus-visible { outline-color: Highlight; }
}
input[type="file"] { padding: var(--space-2); }
input[type="file"]::file-selector-button { margin-right: var(--space-3); padding: var(--space-2) var(--space-3); border: var(--line-width) solid var(--line-strong); border-radius: var(--radius-inner); background: var(--accent-soft); color: var(--text); font: 600 0.875rem/1.2 var(--font); cursor: pointer; }
[aria-invalid="true"] { border-color: var(--danger); }
.field-hint { font-size: 0.875rem; margin: 0; }
.field-error { color: var(--danger); font-size: 0.875rem; font-weight: 600; margin: 0; }
.field-hint:empty, .field-error:empty { display: none; }
.prefixed { display: flex; align-items: center; gap: var(--space-2); }
.prefix { color: var(--muted); font-weight: 700; }
/* The app's field icons (InputDecoration.prefixIcon, deepPurple): in the box, before the text, never clickable. */
.field-icon { position: relative; }
.field-icon > .icon { position: absolute; inset-inline-start: var(--space-3); top: 50%; transform: translateY(-50%); color: var(--accent); pointer-events: none; }
.field-icon > input { padding-inline-start: calc(var(--space-3) * 2 + var(--icon-size)); }
.check-field { display: flex; align-items: flex-start; gap: var(--space-3); color: var(--text); }
.check-field:has(> [role="switch"]) { align-items: center; }
.fieldset { display: grid; gap: var(--space-2); min-width: 0; margin: 0; padding: 0; border: 0; }
.fieldset legend { display: flex; align-items: center; gap: var(--space-2); padding: 0; margin-bottom: var(--space-2); color: var(--text); font-weight: 600; font-size: 0.9375rem; }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-height);
  padding: 0 var(--space-3);
  border: var(--line-width) solid var(--line-strong);
  border-radius: var(--radius-pill);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}
.chip:has(:checked) { background: var(--accent-soft); border-color: var(--accent); }
/* Editor chips (the app's buildTypeChip): the native control stays under the chip, focusable, and is drawn as
   the check mark, the cue that does not rely on color. */
.chip-check { position: relative; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check .icon-check { display: none; width: var(--icon-size-sm); height: var(--icon-size-sm); }
.chip-check:has(:checked) { color: var(--accent); box-shadow: inset 0 0 0 var(--line-width) var(--accent); }
.chip-check:has(:checked) .icon-check { display: inline-block; }
.chip-check:has(:focus-visible) { outline: var(--focus-width) solid var(--accent); outline-offset: var(--focus-offset); }
.chip-check:has(:disabled) { opacity: 0.6; cursor: not-allowed; }
.logo-picker { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
.logo-picker-fields { display: grid; gap: var(--space-2); flex: 1 1 0; min-width: 0; }
.previous-logo { display: grid; gap: var(--space-2); }
.previous-logo p { margin: 0; }

/* Banners and badges */
.banner {
  display: grid;
  gap: var(--space-2);
  justify-items: start;
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-control);
  border: var(--line-width) solid var(--line);
}
.banner p { margin: 0; }
.banner-info { background: var(--info-soft); color: var(--text); border-color: var(--info); }
.banner-error { background: var(--danger-soft); color: var(--text); border-color: var(--danger); }
.banner-success { background: var(--success-soft); color: var(--text); border-color: var(--success); }
.banner-warning { background: var(--warning-soft); color: var(--text); border-color: var(--warning); }
.error-code { color: var(--muted); font-size: 0.8125rem; }
.badges { display: inline-flex; flex-wrap: wrap; gap: var(--space-1); }
.badge {
  padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}
.badge-neutral { background: var(--accent-soft); color: var(--text); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-success { background: var(--success-soft); color: var(--success); }

/* Cards and logos */
.card {
  background: var(--surface);
  border: var(--line-width) solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: var(--space-6);
}
.card-inner { box-shadow: none; padding: var(--space-4); margin: var(--space-4) 0 0; }
.logo {
  flex: none;
  width: var(--logo-size);
  height: var(--logo-size);
  border-radius: var(--radius-pill);
  object-fit: cover;
  background: var(--accent-soft);
}
.logo-lg { width: var(--logo-size-lg); height: var(--logo-size-lg); }
.logo-xl { width: var(--logo-size-xl); height: var(--logo-size-xl); }
.logo-fallback { display: inline-grid; place-items: center; color: var(--accent); font-weight: 800; }
.brand { display: flex; align-items: center; gap: var(--space-2); color: var(--text); font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.brand img { display: block; flex: none; object-fit: cover; border-radius: var(--radius-brand); box-shadow: var(--shadow-logo); }

/* Standalone pages (sign-in, org choice, notices) */
.standalone { min-height: 100vh; display: grid; grid-template-rows: 1fr auto; padding: var(--space-6) var(--space-4); background: radial-gradient(var(--glow-size) at 50% 0, var(--bg-glow), var(--bg)); }
.standalone-main { width: 100%; max-width: var(--card-max); margin: 0 auto; align-self: center; display: grid; gap: var(--space-4); }
.standalone-main > .brand { font-size: 1.25rem; }
.standalone-main > .brand img { width: var(--logo-size); height: var(--logo-size); }
.standalone-card { padding: var(--space-8); }
.standalone-footer { width: 100%; max-width: var(--card-max); margin: var(--space-6) auto 0; }
.standalone-footer .account { display: flex; flex-wrap: wrap; align-items: end; gap: var(--space-3); }
.standalone-footer .account-email { margin: 0; }
.same-method { margin: var(--space-4) 0 var(--space-3); padding: var(--space-1) var(--space-3); border-left: var(--focus-width) solid var(--accent); color: var(--text); font-weight: 600; }
.providers { display: grid; gap: var(--space-3); }
.separator { display: flex; align-items: center; gap: var(--space-3); color: var(--muted); margin: var(--space-4) 0; }
.separator::before, .separator::after { content: ''; flex: 1; border-top: var(--line-width) solid var(--line); }
.divider { border: 0; border-top: var(--line-width) solid var(--line); margin: var(--space-6) 0 var(--space-4); }
.handle-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.handle { font-size: 1.125rem; color: var(--text); }
.org-list { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: grid; gap: var(--space-2); }
.org-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--control-height);
  padding: var(--space-3);
  border: var(--line-width) solid var(--line);
  border-radius: var(--radius-control);
  color: var(--text);
  text-decoration: none;
}
.org-card:hover { background: var(--accent-soft); color: var(--text); }
.org-card-text, .org-current-text { display: grid; min-width: 0; }
.org-card-text strong, .org-current-text strong { overflow-wrap: anywhere; }

/* Organization requests (W1c) */
.unread-dot { flex: none; width: var(--dot-size); height: var(--dot-size); margin-left: auto; border-radius: var(--radius-pill); background: var(--accent); }
.request-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.recap { margin: var(--space-4) 0 0; }
.recap dt { color: var(--muted); font-size: 0.875rem; font-weight: 600; }
.recap dd { margin: 0 0 var(--space-3); color: var(--text); overflow-wrap: anywhere; white-space: pre-wrap; }
.pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.section { margin-top: var(--space-6); padding-top: var(--space-4); border-top: var(--line-width) solid var(--line); }
.thread { list-style: none; margin: var(--space-3) 0; padding: 0; display: grid; gap: var(--space-2); }
.thread:empty { display: none; }
.message { padding: var(--space-3); border: var(--line-width) solid var(--line); border-radius: var(--radius-control); }
.message-team { background: var(--accent-soft); border-color: var(--accent-soft); }
.message-meta { margin: 0 0 var(--space-1); color: var(--muted); font-size: 0.8125rem; }
.message-meta strong { color: var(--text); }
.message-text { margin: 0; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }

/* Terms of Use page (conditions.html) */
.standalone-main.legal { max-width: var(--legal-max); }
.legal li { margin-bottom: var(--space-2); }

/* Org shell */
.shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.topbar, .scrim { display: none; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-5) var(--space-4);
  background: var(--surface);
  border-right: var(--line-width) solid var(--line);
}
.org-switcher { display: grid; gap: var(--space-3); }
.org-current { display: flex; align-items: center; gap: var(--space-3); }
.nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); }
.nav-link {
  display: flex;
  align-items: center;
  min-height: var(--control-height);
  padding: 0 var(--space-3);
  border-radius: var(--radius-control);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.nav-link:hover { background: var(--accent-soft); color: var(--text); }
.nav-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.sidebar .account { margin-top: auto; display: grid; gap: var(--space-3); }
.account-email { font-size: 0.875rem; overflow-wrap: anywhere; margin: 0; }
.main { width: 100%; max-width: var(--content-max); padding: var(--space-6); }
.page.narrow { max-width: var(--card-max); }

/* Events page */
.page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-5); }
.org-identity { display: flex; align-items: center; gap: var(--space-4); min-width: 0; }
.org-identity h1 { margin: 0; overflow-wrap: anywhere; }
.org-identity p { margin: 0; }
.eyebrow { color: var(--muted); font-size: 0.8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); margin: 0 0 var(--space-5); }
.stat { background: var(--surface); border: var(--line-width) solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow); padding: var(--space-3) var(--space-4); }
.stat dt { color: var(--muted); font-size: 0.875rem; font-weight: 600; }
.stat dd { margin: 0; display: grid; }
.stat-value { color: var(--text); font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-note { font-size: 0.75rem; }
.toolbar { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-4); }
.tabs { display: flex; gap: var(--space-1); border-bottom: var(--line-width) solid var(--line); }
.tab {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-height);
  padding: 0 var(--space-4);
  border-bottom: var(--focus-width) solid transparent;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}
.tab:hover { color: var(--text); }
.tab[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.field-inline { min-width: 0; flex: 0 1 var(--search-width); }
/* separate, not collapse: collapse ignores the radius. No overflow: hidden, it would clip the ⋯ menu. */
.events-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: var(--line-width) solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}
.events-table th {
  text-align: left;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 700;
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--line-width) solid var(--line);
}
.events-table td { padding: var(--space-3) var(--space-4); border-top: var(--line-width) solid var(--line); vertical-align: middle; }
/* Lines above the rows: a folded series (hidden last rows, one <tbody> each) leaves no stray line. */
.events-table tbody:first-of-type > tr:first-child > td { border-top: 0; }
.cell-date { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.when-part { white-space: nowrap; }
.event-cell { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
/* break-word, not anywhere: anywhere lets the table squeeze the column to one letter per line. */
.cell-location { overflow-wrap: break-word; }
.cell-num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.cell-actions { width: 1%; text-align: right; }
.thumb {
  flex: none;
  width: var(--thumb-width);
  height: var(--thumb-height);
  border-radius: var(--radius-inner);
  object-fit: cover;
  background: var(--accent-soft);
}
.event-title { display: grid; gap: var(--space-1); min-width: 0; }
.event-name { color: var(--text); font-weight: 700; overflow-wrap: anywhere; }
/* A series (one <tbody>): its row shows the next date's figures, its dates are indented below it. */
.cell-note { display: block; color: var(--muted); font-size: 0.75rem; font-weight: 400; }
.series-toggle { justify-self: start; padding: 0 var(--space-2); color: var(--accent); }
.series-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.series-date > .cell-date { padding-left: var(--space-8); }
.menu-wrap { position: relative; display: inline-block; }
.menu {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 10;
  min-width: var(--menu-width);
  margin: var(--space-1) 0 0;
  padding: var(--space-1);
  list-style: none;
  text-align: left;
  background: var(--surface);
  border: var(--line-width) solid var(--line);
  border-radius: var(--radius-control);
  box-shadow: var(--shadow-pop);
}
.menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-height: var(--control-height);
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-inner);
  background: none;
  color: var(--text);
  font: 600 0.9375rem/1.2 var(--font);
  text-decoration: none;
  cursor: pointer;
}
.menu-item:hover { background: var(--accent-soft); color: var(--text); }
.menu-danger, .menu-danger:hover { color: var(--danger); }
.menu-note { display: block; padding: var(--space-2) var(--space-3); font-size: 0.875rem; }
.empty { padding: var(--space-6); text-align: center; background: var(--surface); border: var(--line-width) dashed var(--line); border-radius: var(--radius-card); }
.empty .btn { margin-top: var(--space-2); }
.empty-icon { display: block; color: var(--muted); }
.empty-icon .icon { width: var(--icon-size-lg); height: var(--icon-size-lg); }
.empty-title { color: var(--text); font-weight: 700; }
.empty .note { justify-content: center; text-align: left; }
/* Templates tab (views/templates.js): the app's template card, two columns from 768 px. */
.template-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.template-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  height: 100%;
  padding: var(--space-4);
  background: var(--surface);
  border: var(--line-width) solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}
.template-thumb {
  flex: none;
  display: grid;
  place-items: center;
  width: var(--template-thumb);
  height: var(--template-thumb);
  border-radius: var(--radius-control);
  object-fit: cover;
  background: var(--accent-soft);
  color: var(--accent);
}
.template-body { display: grid; gap: var(--space-2); min-width: 0; }
.template-name { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.template-facts { display: grid; gap: var(--space-1); margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 0.875rem; }
.template-facts li { display: flex; align-items: center; gap: var(--space-2); min-width: 0; overflow-wrap: anywhere; }
.template-facts .icon { width: var(--icon-size-sm); height: var(--icon-size-sm); }
.template-body .actions { margin: 0; }
.skeleton-list { display: grid; gap: var(--space-2); }
.skeleton {
  height: calc(var(--space-6) * 2 + var(--space-4));
  border-radius: var(--radius-control);
  background: linear-gradient(90deg, var(--skeleton) 25%, var(--skeleton-shine) 50%, var(--skeleton) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* Event editor (W2a) */
.editor-page { display: flex; flex-direction: column; }
.editor-bar {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  margin: calc(var(--space-6) * -1) calc(var(--space-6) * -1) var(--space-5);
  padding: var(--space-3) var(--space-6);
  background: var(--surface);
  border-bottom: var(--line-width) solid var(--line);
}
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; font-size: 0.875rem; }
.breadcrumb li + li::before { content: '›'; margin-right: var(--space-2); color: var(--muted); }
.breadcrumb [aria-current="page"] { color: var(--text); font-weight: 600; }
/* One line from 768 px: the buttons keep their label (« Créer la série (12 dates) »), the status gives way. */
.editor-status { flex: 1 1 0; min-width: 0; margin: 0; overflow: hidden; font-size: 0.875rem; text-align: right; white-space: nowrap; text-overflow: ellipsis; }
.editor-actions, .page-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.editor-actions { flex: none; }
.editor-actions .btn { white-space: nowrap; }
.editor { max-width: var(--form-max); }
.editor-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); max-width: var(--form-max); margin-bottom: var(--space-2); }
.editor-heading h1 { margin: 0; }
.editor-form { display: grid; gap: var(--space-5); }
.editor-section {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
  margin: 0;
  padding: var(--space-5);
  background: var(--surface);
  border: var(--line-width) solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}
.editor-section > legend { float: left; display: flex; align-items: center; width: 100%; gap: var(--space-3); padding: 0; margin-bottom: var(--space-1); color: var(--text); font-size: 1.125rem; font-weight: 700; }
.editor-section > legend + * { clear: both; }
.icon-tile {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--icon-tile);
  height: var(--icon-tile);
  border-radius: var(--radius-control);
  background: var(--accent-soft);
  color: var(--accent);
}
.editor-footer { margin-top: var(--space-5); }
.error-summary {
  margin: 0 0 var(--space-5);
  padding: var(--space-4);
  background: var(--danger-soft);
  border: var(--line-width) solid var(--danger);
  border-radius: var(--radius-card);
  color: var(--text);
}
.error-summary:focus-visible { outline-offset: var(--focus-offset); }
.error-summary ul { margin: var(--space-2) 0 0; padding-left: var(--space-5); }
.error-summary a { color: var(--danger); font-weight: 600; }
.radio-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.radio-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: var(--line-width) solid var(--line-strong);
  border-radius: var(--radius-control);
  cursor: pointer;
}
.radio-card:has(:checked) { background: var(--accent-soft); border-color: var(--accent); }
.radio-card > .icon { color: var(--accent); }
.radio-card-text { display: grid; gap: var(--space-1); }
.radio-card-text strong { color: var(--text); }
.radio-card-text .muted { font-size: 0.875rem; }
input[type="radio"] { flex: none; width: var(--check-size); height: var(--check-size); min-height: 0; margin: 0; padding: 0; accent-color: var(--accent); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.field-label { margin: 0; color: var(--text); font-weight: 600; font-size: 0.9375rem; }
.locked-dates { display: grid; gap: var(--space-2); }
.locked-dates p { margin: 0; }
.day-list { margin: 0; padding-left: var(--space-5); color: var(--text); }
.counter { text-align: right; }
.note { display: flex; align-items: flex-start; gap: var(--space-2); }
.note > .icon { color: var(--info); }
.banner-warning > .icon { color: var(--warning); }
.editor-section > .banner { margin: 0; }
/* Series planner (views/series-planner.js): the dates of the preview, one column on a phone. */
.series-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--series-day-min), 1fr)); gap: var(--space-1) var(--space-3); margin: 0; padding: 0; list-style: none; }
.series-day { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); min-height: var(--control-height); color: var(--text); }
.series-day:has(:checked) .series-excluded { display: none; }
.series-day:has(input:not(:checked)) label { color: var(--muted); text-decoration: line-through; }
.actions-start { margin: 0; }
.cover-spec { margin: 0; padding-left: var(--space-5); color: var(--muted); font-size: 0.875rem; }
.cover-body { display: grid; gap: var(--space-4); }
.dropzone {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
  border: var(--line-width) dashed var(--control-border);
  border-radius: var(--radius-card);
  background: var(--bg);
}
.dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-label { color: var(--text); font-weight: 600; }
.cover-cropper { display: grid; gap: var(--space-2); }
/* No overflow: hidden here: it would clip the canvas focus ring (drawn outside it). */
.cover-frame { position: relative; border-radius: var(--radius-control); background: var(--skeleton); }
.cover-canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: var(--radius-control); cursor: grab; touch-action: none; }
.cover-canvas:active { cursor: grabbing; }
.cover-canvas[aria-disabled="true"], .cover-canvas[role="img"] { cursor: default; }
.cover-safe {
  position: absolute;
  top: calc((100% - var(--safe-zone-height)) / 2);
  left: calc((100% - var(--safe-zone-width)) / 2);
  width: var(--safe-zone-width);
  height: var(--safe-zone-height);
  border: var(--focus-width) dashed var(--on-accent);
  outline: var(--line-width) solid var(--text);
  pointer-events: none;
}
.cover-cropper .field-hint, .cover-cropper .actions { margin: 0; }
input[type="range"] { padding: 0; border: 0; background: transparent; accent-color: var(--accent); }
.cover-previews { display: grid; gap: var(--space-2); }
.cover-preview-list { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-4); }
.cover-preview { display: grid; gap: var(--space-1); max-width: 100%; margin: 0; }
.cover-preview canvas { display: block; max-width: 100%; height: auto; border-radius: var(--radius-control); background: var(--skeleton); }
.cover-preview figcaption { font-size: 0.8125rem; }
.cover-preview-site canvas { width: var(--preview-site-width); }
.cover-preview-home canvas { width: var(--preview-home-width); }
.cover-preview-detail canvas { width: var(--preview-detail-width); }
.cover-preview-calendar canvas { width: var(--preview-calendar-width); }
.cover-warning {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-control);
  background: var(--warning-soft);
  color: var(--warning);
  font-weight: 600;
}
.cover-current { display: grid; gap: var(--space-2); justify-items: start; }
.cover-current .actions { margin: 0; }
.cover-image { width: 100%; max-width: var(--cover-thumb-width); height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-control); }
.place-results { display: grid; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.place-results:empty { display: none; }
.place-result {
  width: 100%;
  min-height: var(--control-height);
  padding: var(--space-2) var(--space-3);
  border: var(--line-width) solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font: 400 0.9375rem/1.4 var(--font);
  text-align: left;
  cursor: pointer;
}
.place-result:hover { background: var(--accent-soft); }
.place-status { margin: 0; color: var(--text); font-weight: 600; font-size: 0.875rem; }
.toast-action {
  margin-left: var(--space-3);
  padding: 0;
  border: 0;
  background: none;
  color: var(--on-accent);
  font: 700 0.9375rem/1.2 var(--font);
  text-decoration: underline;
  cursor: pointer;
}

/* Dialog and toast */
.dialog {
  width: min(var(--dialog-width), calc(100vw - var(--space-4) * 2));
  padding: var(--space-6);
  border: 0;
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--body);
  box-shadow: var(--shadow-pop);
}
.dialog::backdrop { background: var(--scrim); }
.dialog .actions { justify-content: flex-end; }
.toast {
  position: fixed;
  left: 50%;
  bottom: var(--space-6);
  transform: translateX(-50%);
  z-index: 30;
  max-width: calc(100vw - var(--space-4) * 2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-control);
  background: var(--text);
  color: var(--on-accent);
  font-weight: 600;
  box-shadow: var(--shadow-pop);
  overflow-wrap: anywhere;
}
.toast:empty { padding: 0; box-shadow: none; }

/* Below 1024 px: top bar + drawer */
@media (max-width: 1023.98px) {
  .shell { display: block; }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 15;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    height: var(--topbar-height);
    padding: 0 var(--space-4);
    background: var(--surface);
    border-bottom: var(--line-width) solid var(--line);
  }
  .topbar-title { color: var(--text); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 25;
    width: min(var(--sidebar-width), 85vw);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.2s ease, visibility 0.2s;
  }
  .drawer-open .sidebar { transform: none; visibility: visible; }
  .drawer-open .scrim { display: block; position: fixed; inset: 0; z-index: 20; background: var(--scrim); }
  .main { margin: 0 auto; }
  .editor-bar { top: var(--topbar-height); }
  .events-table th, .events-table td { padding: var(--space-2) var(--space-3); }
}

/* Below 768 px: one column, cards instead of the table */
@media (max-width: 767.98px) {
  .main { padding: var(--space-4); }
  h1 { font-size: 1.5rem; }
  .standalone { padding: var(--space-4); }
  .card:not(.card-inner) { padding: var(--space-5); }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .toolbar { display: grid; }
  .field-inline { flex: auto; }
  .events-table, .events-table tbody, .events-table tr, .events-table td { display: block; }
  .events-table { background: none; border: 0; box-shadow: none; }
  .events-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .events-table tr {
    position: relative;
    margin-bottom: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--surface);
    border: var(--line-width) solid var(--line);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
  }
  .events-table td { padding: var(--space-1) 0; border: 0; text-align: left; }
  .events-table td[data-label]:not(.cell-event)::before { content: attr(data-label); display: block; color: var(--muted); font-size: 0.75rem; font-weight: 600; }
  .events-table td.cell-event { padding-right: calc(var(--space-6) * 2); }
  .cell-actions { position: absolute; top: var(--space-2); right: var(--space-2); width: auto; }
  .events-table .series-date { margin-left: var(--space-4); }
  .events-table .series-date > .cell-date { padding-left: 0; }
  /* Editor: the action bar sticks to the bottom of the screen. */
  .editor-bar {
    flex-wrap: wrap;
    top: auto;
    bottom: 0;
    order: 99;
    margin: var(--space-5) calc(var(--space-4) * -1) 0;
    padding: var(--space-3) var(--space-4);
    border-top: var(--line-width) solid var(--line);
    border-bottom: 0;
  }
  .editor-bar .breadcrumb { display: none; }
  .editor-status { flex-basis: 100%; text-align: left; white-space: normal; }
  .editor-actions { width: 100%; }
  .editor-actions .btn { flex: 1 1 0; white-space: normal; }
  .editor-section { padding: var(--space-4); }
  .radio-cards, .field-row, .template-list { grid-template-columns: minmax(0, 1fr); }
}

@media (hover: hover) {
  :is(input:not([type="checkbox"], [type="radio"], [type="range"]), select, textarea):hover:not(:disabled, [readonly], [aria-invalid="true"], :focus-visible) { border-color: var(--muted); }
  .chip:not(:has(:disabled)):hover, .radio-card:not(:has(:disabled)):hover { border-color: var(--control-border); }
  .chip:has(:checked):hover, .radio-card:has(:checked):hover { border-color: var(--accent); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
