/* Couche compacte de l'application Ákros — après app.css et mobile.css. */
:root {
  --bg:#f7f7f4;--surface:#fff;--text:#1e211e;--muted:#62665f;
  --line:#e4e3dd;--strong-line:#a5a69e;--soft:#f0f0ec;
  --accent:#745d25;--accent-soft:#f4efe2;--gold-ink:#6c5520;
  --room-open:#176b40;--room-closed:#a02f3d;--app-tab-height:60px;
  --sans:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

/* Socle : hiérarchie courte et contrôles tactiles. */
body { font:15px/1.5 var(--sans);background:var(--bg); }
h1,h2,h3,.team-screen-title { font-family:var(--sans);font-weight:600;letter-spacing:-.025em; }
h1,.page-heading h1 { font-size:clamp(24px,3vw,28px);line-height:1.15; }
h2,.section-heading h2 { font-size:17px;line-height:1.3; }
h3 { font-size:16px;line-height:1.35; }
.eyebrow { font-size:11px;line-height:1.4;letter-spacing:.08em; }
.helper,.caption { font-size:13px;line-height:1.55; }
.button,.text-button,.quiet,.segmented button { min-height:44px;font-size:14px; }
.button { padding:9px 16px;border-radius:7px;font-weight:600; }
.button.secondary { border-color:var(--line);background:var(--surface); }
.icon-button { min-width:44px;min-height:44px;border-radius:8px; }

/* Structure ordinateur. */
.shell { grid-template-columns:178px minmax(0,1fr); }
.rail { padding:24px 18px; }
.brand { gap:10px;font-family:'Montserrat',Arial,sans-serif; }
.brand img { width:26px;height:40px; }
.brand span { font-size:17px;letter-spacing:.12em; }
.brand small { margin-top:4px;font-size:7px;letter-spacing:.06em; }
.app-nav { gap:4px;margin-top:44px; }
.app-nav a { min-height:48px;gap:12px;padding:10px 11px;border-radius:7px;font-size:12px; }
.app-nav a[aria-current] { background:#262721;border-color:transparent; }
.rail-footer { font-size:10px; }
.workspace main { max-width:960px;padding:32px; }
.page-heading { margin-bottom:20px; }
.page-heading h1 { margin-block:4px; }
.global-feedback,.storage-error { margin:12px 32px 0;border-radius:7px; }
.app-footer { max-width:960px;padding:0 32px 24px; }

/* La barre supérieure rejoint l'en-tête sur téléphone. */
.trial-bar { min-height:48px;padding:4px 32px;border-color:var(--line); }
.trial-bar>span {
  padding:4px 8px;border:1px solid var(--line);border-radius:999px;
  background:var(--surface);font-size:10px;
}
.trial-bar.live>span,body[data-mode="live"] .trial-bar>span { display:none; }
.trial-actions { display:flex;align-items:center;gap:2px;margin-left:auto; }
.installation-shortcut {
  display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:8px 10px;
  border-radius:8px;color:var(--accent);font:600 12px/1 var(--sans);text-decoration:none;
}
.installation-shortcut:hover { background:var(--soft); }
.settings-trigger {
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-height:44px;padding:8px 10px;border:0;border-radius:8px;
  color:var(--text);background:transparent;font:600 12px/1 var(--sans);
}
.settings-trigger:hover { background:var(--soft); }
.settings-trigger svg { width:18px;height:18px; }
.demo-notice { margin:0 0 12px;color:var(--muted);font-size:11px; }
body[data-mode="live"] .demo-notice { display:none; }

/* Salle : état immédiat sans grand aplat coloré. */
.salle-hero { gap:0;margin-bottom:24px; }
.status-panel,body[data-theme="dark"] .status-panel {
  --state:var(--room-open);min-height:0;padding:16px;color:var(--text);
  background:var(--surface);border:1px solid var(--line);border-radius:10px;
}
.status-panel.closed { --state:var(--room-closed);background:var(--surface); }
.status-panel.unknown,.status-panel.stale { --state:var(--muted);background:var(--surface); }
.status-panel>.eyebrow { color:var(--muted);font-size:11px;font-weight:500; }
.status-value { gap:10px;margin:8px 0; }
.status-value h2 { color:var(--state);font:600 26px/1.15 var(--sans);letter-spacing:-.03em; }
.status-panel .status-value .dot {
  width:8px;height:8px;background:var(--state);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--state) 14%,transparent);
}
.status-panel.unknown .status-value .dot,.status-panel.stale .status-value .dot {
  background:transparent;box-shadow:inset 0 0 0 1.5px var(--muted);
}
.status-panel p.status-message { color:var(--text);font-size:14px; }
.status-panel .source-updated { margin-top:6px;color:var(--muted);font-size:12px; }
.status-bottom { gap:9px;margin-top:14px;padding-top:12px;border-color:var(--line); }
.status-bottom svg { width:18px;height:18px;color:var(--muted); }
.status-bottom small { color:var(--muted);font-size:12px; }
.status-bottom strong { color:var(--text);font-size:14px; }
.salle-shortcuts { display:none; }

/* Groupes séparés plutôt qu'empilement de cartes. */
.dashboard-grid { grid-template-columns:1fr 1fr;gap:32px; }
.panel { padding:0;margin-bottom:30px;border:0;border-radius:0;background:transparent; }
.section-heading { gap:12px;margin-bottom:10px; }
.section-heading h2 { font-size:17px; }
.schedule-row { padding:11px 0; }
.schedule-day,.schedule-day strong,.schedule-time { font-size:14px; }
.schedule-day span { font-size:12px; }
.next-event .section-heading { flex-wrap:nowrap;align-items:center; }
.next-event .section-heading>div { width:auto;flex:1; }
.next-event .section-heading .text-button { flex:none;margin:0; }
.panel .empty { padding:6px 0; }
.next-event h3 { margin:7px 0;font-size:18px; }
.event-meta { margin:10px 0; }
.announcement { padding:12px 0;font-size:14px; }
.announcements { padding-top:18px;border-top:1px solid var(--line); }
#infos-equipe {
  margin-bottom:24px;padding:14px 16px;border:0;border-left:3px solid var(--gold-ink);
  border-radius:0 8px 8px 0;background:var(--accent-soft);
}
#infos-equipe .section-heading { align-items:center;margin-bottom:6px; }
#infos-equipe .section-heading>div { width:auto; }
#infos-equipe .section-heading>svg { width:18px;height:18px;color:var(--gold-ink); }
#infos-equipe h2 { font-size:15px; }
#infos-equipe .announcement { padding:0; }
#infos-equipe .announcement p {
  display:-webkit-box;overflow:hidden;margin:8px 0 0;
  -webkit-box-orient:vertical;-webkit-line-clamp:4;
}
#infos-equipe .text-button { margin:4px 0 0;padding:8px 0;min-height:44px;font-size:13px; }
.access-panel { gap:16px;padding:18px 0 24px;border-top:1px solid var(--line); }
.access-panel h2 { font:600 17px/1.3 var(--sans);letter-spacing:-.02em; }
.access-panel>div>svg { width:22px;height:22px; }
.messages-feed { gap:0;max-width:760px;border-top:1px solid var(--line); }
.messages-feed .message-card,.message-card {
  padding:16px 0;border:0;border-bottom:1px solid var(--line);
  border-radius:0;background:transparent;font-size:14px;
}

/* Liste de stages compacte ; visuel entier dans la fiche. */
.event-card {
  display:grid;grid-template-columns:96px minmax(0,1fr);gap:16px;
  min-height:0;margin:0;padding:16px 0;overflow:visible;
  border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent;
}
.event-card:first-child { border-top:1px solid var(--line); }
.event-card>img { width:96px;height:112px;border-radius:6px;object-fit:cover; }
.event-card .event-copy { min-width:0;padding:0; }
.event-card .event-meta,.next-event .event-meta { display:block;margin:6px 0;color:var(--muted);font-size:12px;line-height:1.6; }
.event-card .event-meta span,.next-event .event-meta span { display:inline;padding:0;border:0;border-radius:0;background:transparent;font-size:inherit; }
.event-card .event-meta span+span::before,.next-event .event-meta span+span::before { content:' · '; }
.event-card h2 { margin:4px 0 7px;font-size:19px;line-height:1.25; }
.event-card .event-description,.event-copy>.event-description {
  display:-webkit-box;margin-bottom:6px;overflow:hidden;font-size:13px;
  -webkit-box-orient:vertical;-webkit-line-clamp:3;
}
.event-detail-image { height:auto;max-height:none;object-fit:contain; }
.calendar-grid { gap:3px; }
.calendar-cell { min-width:44px;min-height:44px; }
.calendar-cell[aria-pressed="true"] { background:var(--ink); }
#month-label { font-size:20px; }
#calendar-day h3 { font-size:18px; }

/* Équipe : actions groupées puis éditeurs contenus. */
.team-home>nav { display:block;border-block:1px solid var(--line); }
.team-action {
  grid-template-columns:32px minmax(0,1fr) 20px;gap:12px;
  min-height:68px;padding:10px 4px;border:0;border-bottom:1px solid var(--line);
  border-radius:0;background:transparent;
}
.team-action:last-child { border-bottom:0; }
.team-action:hover,.team-action:active { background:var(--soft);border-color:var(--line); }
.team-action-icon,.team-action[href="#equipe/ouverture"] .team-action-icon {
  width:32px;height:32px;border-radius:8px;color:var(--gold-ink);background:var(--accent-soft);
}
.team-action-icon svg { width:18px;height:18px; }
.team-action-copy strong { font-size:15px; }
.team-action-copy small { margin-top:2px;font-size:12px; }
.team-intro { padding:12px 0;border:0;border-radius:0;background:transparent; }
.team-screen-title { font-size:24px; }
#team-login,[data-team-screen].panel {
  max-width:760px;padding:20px;border:1px solid var(--line);
  border-radius:10px;background:var(--surface);
}
.editor label,.editor-dialog label,.choice-field legend { font-size:14px; }
.editor input:not([type="radio"]),.editor textarea,
.editor-dialog input:not([type="hidden"]),.editor-dialog textarea {
  border-color:var(--line);border-radius:7px;
}
#form-status .choice-field { gap:10px;margin-block:8px 20px; }
#form-status .status-choice {
  min-width:120px;min-height:48px;padding:8px 14px;
  border:1px solid transparent;border-radius:8px;font-size:15px;
}
#form-status .status-choice-open { background:#176b40;color:#fff; }
#form-status .status-choice-close { background:#a02f3d;color:#fff; }
#form-status .status-choice:has(input:checked) { border-color:#fff;box-shadow:0 0 0 2px var(--text); }

/* Dialogues et réglages. */
dialog { border-radius:12px; }
.dialog-heading { margin-bottom:16px; }
.dialog-heading h2,#event-editor .dialog-heading h2,.confirmation h2 { font-size:22px; }
.event-step { padding:16px 20px 24px; }
.event-steps { padding:8px 16px; }
.event-step-actions { padding:12px 20px; }
.event-detail-body { padding:20px; }
.event-detail-body h2 { font-size:24px; }
#app-settings.settings-dialog,.settings-dialog {
  width:min(440px,calc(100% - 32px));padding:20px;border-radius:16px;
}
.settings-dialog .dialog-heading { align-items:center;margin-bottom:12px; }
.settings-dialog .dialog-heading h2 { margin:0; }
#settings-actions,.settings-links { border-top:1px solid var(--line); }
.settings-row {
  display:flex;align-items:center;justify-content:flex-start;gap:12px;width:100%;
  min-height:56px;padding:6px 0;border:0;border-bottom:1px solid var(--line);
  color:var(--text);background:transparent;text-align:left;text-decoration:none;font:500 14px/1.4 var(--sans);
}
.settings-row:hover { background:var(--soft); }
.settings-row>svg { width:19px;height:19px;color:var(--muted); }
.settings-row .button,.settings-row .icon-button { flex:none; }
.theme-switch {
  position:relative;width:42px;height:24px;margin-left:auto;border:1px solid var(--strong-line);
  border-radius:999px;background:var(--soft);transition:background-color 140ms ease;
}
.theme-switch>span {
  position:absolute;top:3px;left:3px;width:16px;height:16px;
  border-radius:50%;background:var(--muted);transition:transform 140ms ease,background-color 140ms ease;
}
.theme-toggle[aria-checked="true"] .theme-switch { background:var(--accent-soft); }
.theme-toggle[aria-checked="true"] .theme-switch>span { background:var(--gold-ink);transform:translateX(18px); }
.settings-links { margin-top:12px; }
.settings-dialog #live-services { margin:12px 0 0;padding:0;border:0;background:transparent; }
#live-services h3 { margin:0 0 12px;font-size:16px; }
#live-services #app-notifications { width:100%;min-height:48px; }
#live-services .helper { margin:8px 0 12px; }
#live-services #notifications-online { margin:0 0 12px;font-size:13px; }
#installation-settings { margin:12px 0 16px;border-top:1px solid var(--line); }
#installation-settings summary { min-height:48px;padding:12px 0;font-size:14px;cursor:pointer; }
#installation-settings[open] summary { margin-bottom:4px; }
#installation-settings .installation-actions { display:grid;gap:8px; }
#installation-settings #app-install { width:100%; }
#installation-settings .helper { margin:0; }
#installation-online { justify-self:start; }
#settings-sync { margin-top:12px; }

/* Sombre : même hiérarchie, contrastes dédiés. */
body[data-theme="dark"] {
  --bg:#141614;--surface:#1e201d;--text:#f3f0e8;--muted:#c0bdb5;
  --line:#44463f;--strong-line:#8c8d84;--soft:#292b27;--accent-soft:#343024;
  --gold-ink:#d6be83;
  --room-open:#78d9a1;--room-closed:#ff9eaa;
}
body[data-theme="dark"] .button.secondary { background:var(--surface); }
body[data-theme="dark"] .app-nav { border-color:var(--line); }

@media (max-width:820px),(max-height:500px) and (pointer:coarse) {
  :root { --app-gutter:max(16px,env(safe-area-inset-left),env(safe-area-inset-right)); }
  html { scroll-padding-top:calc(68px + env(safe-area-inset-top)); }
  .rail {
    justify-content:flex-start;height:calc(60px + env(safe-area-inset-top));
    padding:calc(6px + env(safe-area-inset-top)) var(--app-gutter) 6px;
  }
  .brand { min-height:48px; }
  .brand img { width:22px;height:34px; }
  .brand span { font-size:16px; }
  .brand small { display:none; }
  .trial-bar {
    position:absolute;top:calc(6px + env(safe-area-inset-top));right:var(--app-gutter);z-index:24;
    width:auto;min-height:48px;padding:0;border:0;background:transparent;
  }
  .trial-bar>span {
    position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;
    overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;
  }
  .settings-trigger { min-height:48px;padding:8px 4px 8px 10px;color:#f3f0e8; }
  .installation-shortcut { min-height:48px;padding:8px;color:#f3f0e8; }
  .installation-shortcut:hover { background:#ffffff14; }
  .app-nav {
    min-height:calc(var(--app-tab-height) + env(safe-area-inset-bottom));
    padding-bottom:env(safe-area-inset-bottom);border-color:var(--line);background:var(--surface);
  }
  .app-nav a {
    position:relative;min-height:var(--app-tab-height);gap:3px;padding:6px 4px;
    color:var(--muted);background:transparent;border-radius:0;font-size:10px;
  }
  .app-nav a::before {
    content:'';position:absolute;top:0;left:30%;right:30%;height:2px;background:transparent;
  }
  .app-nav a[aria-current] { color:var(--gold-ink);background:transparent;border-radius:0; }
  .app-nav a[aria-current]::before { background:var(--gold-ink); }
  .app-nav svg { width:20px;height:20px; }
  .workspace { padding-bottom:calc(var(--app-tab-height) + 16px + env(safe-area-inset-bottom)); }
  .workspace main { padding:18px var(--app-gutter) 12px; }
  .page-heading { gap:10px;margin-bottom:16px; }
  .page-heading h1 { font-size:25px; }
  .global-feedback,.storage-error { margin-inline:var(--app-gutter); }
  .status-panel,body[data-theme="dark"] .status-panel { padding:15px;border-radius:9px; }
  .status-value { margin-block:7px; }
  .status-value h2 { font-size:25px; }
  .status-panel p.status-message { font-size:14px; }
  .salle-hero { margin-bottom:22px; }
  .dashboard-grid { display:block; }
  .panel { padding:0;margin-bottom:20px; }
  .section-heading { margin-bottom:8px; }
  .section-heading h2 { font-size:16px; }
  .access-panel { align-items:stretch;padding-block:18px; }
  .access-panel .actions>.button { flex:1; }
  .app-footer { display:none; }
  .event-card { grid-template-columns:96px minmax(0,1fr);gap:14px;padding:14px 0; }
  .event-card>img { width:96px;height:112px; }
  .event-card h2 { margin-top:2px;font-size:17px; }
  .event-card .event-description { -webkit-line-clamp:3;font-size:13px; }
  #events-calendar { width:auto;margin-inline:calc(-1 * var(--app-gutter));padding:16px 6px; }
  .calendar-grid { grid-template-columns:repeat(7,minmax(0,1fr));gap:0; }
  .calendar-cell { min-width:0;min-height:44px;padding:0; }
  .team-home>nav { display:block; }
  .team-action { min-height:68px;padding-block:10px; }
  .team-action-icon { width:32px;height:32px; }
  .team-screen-title { font-size:23px; }
  #team-login,[data-team-screen].panel { padding:16px; }
  dialog { max-height:calc(100dvh - 16px); }
  .dialog-heading { margin-bottom:12px; }
  .dialog-heading h2,#event-editor .dialog-heading h2 { font-size:22px; }
  #event-editor>.dialog-heading { padding:16px; }
  .event-steps { padding:8px; }
  .event-step { padding:16px; }
  .event-step-actions { padding:12px 16px; }
  #app-settings.settings-dialog,.settings-dialog {
    position:fixed;inset:auto 0 0;width:100%;max-width:none;max-height:85dvh;margin:0;
    padding:16px max(16px,env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));
    overflow-y:auto;border-width:1px 0 0;border-radius:20px 20px 0 0;
  }
  .settings-dialog .dialog-heading {
    position:sticky;top:-16px;z-index:1;padding-block:4px 10px;background:var(--surface);
  }
}

@media (max-width:359px) {
  :root { --app-gutter:max(14px,env(safe-area-inset-left),env(safe-area-inset-right)); }
  .workspace main { padding-inline:14px; }
  .event-card { grid-template-columns:88px minmax(0,1fr);gap:12px; }
  .event-card>img { width:88px;height:104px; }
}

@media (prefers-reduced-motion:reduce) {
  .button,.icon-button,.team-action,.status-choice,.theme-switch,.theme-switch>span { transition:none; }
}

/* La navigation fixe ne masque pas le champ sélectionné sur téléphone. */
input,textarea,select,button,a { scroll-margin-block:90px; }
select:focus-visible { outline:3px solid var(--accent);outline-offset:4px; }
@media(max-width:720px){
  input,textarea,select { font-size:16px; }
  .live-sync.is-error { overflow-wrap:anywhere; }
}
