/* Styles de l'application « Gestion des heures » */
.heures { max-width: 1280px; }
.heures-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
@supports (display: grid) { .heures-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; } .heures-head .user-chip { justify-self: end; } }
.card h3 { margin: 0 0 14px; font-size: 1.05rem; }
.mono { font-family: var(--mono); letter-spacing: .08em; }
.spacer { flex: 1; }
.hint.center { text-align: center; }
.btn.block { width: 100%; padding: 12px; }
.linklike { background: none; border: 0; padding: 0; color: var(--accent-2); cursor: pointer; font-size: .9rem; text-decoration: underline; text-underline-offset: 3px; }

/* ---- Chargement ---- */
.loading { display: flex; align-items: center; gap: 12px; color: var(--text-2); padding: 40px 0; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Utilisateur ---- */
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: .8rem; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); flex: none; }
.avatar.sm { width: 24px; height: 24px; font-size: .66rem; }
.user-name { font-weight: 600; }

/* ---- Authentification ---- */
.auth-layout { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 40px; align-items: start; }
@media (max-width: 860px) { .auth-layout { grid-template-columns: 1fr; } }
.auth-card { padding: 26px; }
.auth-tabs { width: 100%; margin-bottom: 18px; }
.auth-tabs button { flex: 1; padding: 9px; }
.auth-form h2 { margin: 0 0 16px; font-size: 1.3rem; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.auth-side h2 { font-size: 1.6rem; font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 10px 0 18px; letter-spacing: -0.02em; }
.features { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.features li { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: var(--text-2); }
.features b { color: var(--text); display: block; }
.pw-meter { height: 5px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.pw-meter i { display: block; height: 100%; width: 0; transition: width .25s, background .25s; background: var(--danger); }
.pw-meter i.s2 { background: var(--warn); } .pw-meter i.s3 { background: var(--accent-2); } .pw-meter i.s4 { background: var(--ok); }

/* ---- Onglets ---- */
.tabs { display: flex; gap: 6px; margin-bottom: 20px; overflow-x: auto; padding: 4px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); width: fit-content; max-width: 100%; }
.tabs button { border: 0; background: transparent; padding: 9px 16px; border-radius: 12px; cursor: pointer; color: var(--text-2); font-weight: 600; white-space: nowrap; }
.tabs button[aria-selected="true"] { background: linear-gradient(135deg, var(--accent), var(--accent-mid, var(--accent-2))); color: #fff; }

/* ---- Barre d'outils ---- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar-end { margin-left: auto; display: flex; gap: 8px; }
.period-nav { display: flex; align-items: center; gap: 6px; }
.period-label { min-width: 210px; text-align: center; font-size: .95rem; }
.icon-btn.sm { width: 36px; height: 36px; border-radius: 11px; }
.icon-btn.sm svg { width: 18px; height: 18px; }
.input.sm { padding: 8px 12px; width: auto; min-width: 160px; }
@media (max-width: 700px) { .toolbar-end { margin-left: 0; } .period-label { min-width: 0; } }

/* ---- Statistiques ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { position: relative; overflow: hidden; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); display: flex; flex-direction: column; gap: 2px; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--accent)); }
.stat-label { font-size: .8rem; color: var(--text-2); font-weight: 600; }
.stat strong { font-size: 1.45rem; letter-spacing: -0.01em; }
.stat-sub { font-size: .76rem; color: var(--text-3); }
.stat.main { grid-column: span 2; background: linear-gradient(135deg, rgba(var(--accent-rgb, 139, 130, 219), 0.28), var(--surface)); }
.stat.main strong { font-size: 2rem; }
@media (max-width: 480px) { .stat.main { grid-column: span 1; } }
.t-travail { --c: var(--t-travail); } .t-attente { --c: var(--t-attente); } .t-astreinte { --c: var(--t-astreinte); }
.t-repos_hebdo { --c: var(--t-repos_hebdo); } .t-repos_anticipe { --c: var(--t-repos_anticipe); }

/* ---- Gantt chronologique ---- */
.gantt-card { margin-bottom: 18px; }
.gantt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 6px 0 10px; }
.gantt-head h3 { margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 4px; font-size: .82rem; color: var(--text-2); align-items: center; }
button.legend-item, .legend-item { display: inline-flex; align-items: center; gap: 6px; }
button.legend-item { border: 1px solid transparent; background: transparent; color: var(--text-2); font-size: .82rem; padding: 4px 9px; border-radius: 999px; cursor: pointer; transition: opacity .15s, background .15s; }
button.legend-item:hover { background: var(--surface-2); color: var(--text); }
button.legend-item[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
button.legend-item[aria-pressed="false"] .sw { background: transparent !important; box-shadow: inset 0 0 0 2px var(--c, var(--text-3)); }
.legend-group { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); margin-left: 6px; }
.gantt-tools { display: flex; gap: 6px; margin-right: auto; margin-left: 8px; }
.legend .sw { width: 12px; height: 12px; border-radius: 4px; background: var(--c); }
.gantt-wrap { overflow: hidden; -ms-touch-action: pan-y; border-radius: 12px; border: 1px solid var(--border); background: rgba(var(--surface-solid-rgb, 18, 23, 40), 0.55); touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.gantt-wrap.panning, .gantt-wrap.panning * { cursor: grabbing !important; }
.gantt-svg { display: block; font-family: var(--font); }
.g-row { fill: transparent; }
.g-row.odd { fill: rgba(var(--text-rgb, 238, 241, 255), 0.03); }
.g-weekend { fill: rgba(var(--accent-2-rgb, 72, 174, 189), 0.06); }
.g-today { fill: rgba(var(--accent-rgb, 139, 130, 219), 0.1); }
.g-hcell rect { fill: rgba(var(--surface-solid-rgb, 18, 23, 40), 0.7); stroke: var(--border); stroke-width: 1; cursor: zoom-in; transition: fill .15s; }
.g-hcell:hover rect { fill: rgba(var(--accent-rgb, 139, 130, 219), 0.18); }
.g-hcell.month rect { fill: rgba(var(--accent-rgb, 139, 130, 219), 0.1); }
.g-hcell.week rect { fill: rgba(var(--accent-2-rgb, 72, 174, 189), 0.07); }
.g-hcell.day.we rect { fill: rgba(var(--accent-2-rgb, 72, 174, 189), 0.12); }
.g-hcell.day.today rect { fill: rgba(var(--accent-rgb, 139, 130, 219), 0.3); }
.g-htext { fill: var(--text); font-size: 11.5px; font-weight: 600; pointer-events: none; }
.g-hcell.month .g-htext { font-weight: 700; text-transform: capitalize; }
.g-axis-name { fill: var(--text-3); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.g-hour { fill: var(--text-3); font-size: 10.5px; }
.g-grid { stroke: var(--border); stroke-width: 1; }
.g-grid.day { stroke: rgba(var(--text-rgb, 238, 241, 255), 0.18); }
.g-grid.week { stroke: rgba(var(--text-rgb, 238, 241, 255), 0.38); stroke-width: 1.5; }
.g-grid.half { stroke-dasharray: 2 4; }
.g-head-line { stroke: rgba(var(--text-rgb, 238, 241, 255), 0.25); stroke-width: 1; }
.g-label { fill: var(--text); font-size: 12.5px; font-weight: 600; }
.g-label.me { fill: var(--accent-2); }
.g-label-sub { fill: var(--text-3); font-size: 10.5px; font-weight: 700; }
.g-empty { fill: var(--text-3); font-size: 13px; }
.g-bar rect { fill: var(--c); fill-opacity: .92; stroke: rgba(0, 0, 0, .35); stroke-opacity: .3; }
.g-bar.sys rect:first-child { stroke: rgba(0,0,0,.25); }
.g-bar .g-typestrip { fill: var(--c); fill-opacity: 1; stroke: none; }
.g-bar.clickable { cursor: pointer; }
.g-bar.clickable:hover rect:first-child { fill-opacity: 1; stroke: var(--text); stroke-opacity: .8; }
.g-bar-text { fill: #0b0e1a; font-size: 10.5px; font-weight: 700; pointer-events: none; }
.g-bar-text.on-sys { fill: #fff; paint-order: stroke; stroke: rgba(0,0,0,.35); stroke-width: 2px; }
.g-now { stroke: var(--danger); stroke-width: 2; }
.t-pause { --c: var(--t-pause); }

.timeline-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.zoom-btns { display: flex; gap: 4px; }

/* ---- Tableaux ---- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data td.note { color: var(--text-2); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.data td.actions { text-align: right; white-space: nowrap; }
table.data td.actions .btn { margin-left: 4px; }
table.data td.empty { text-align: center; color: var(--text-3); padding: 26px; }
table.data tr.me td { background: rgba(var(--accent-rgb, 139, 130, 219), 0.08); }
td.who { font-weight: 600; white-space: nowrap; }
td.who .avatar { vertical-align: middle; margin-right: 8px; }
td.total { min-width: 150px; }
.meter { display: block; height: 5px; border-radius: 4px; background: var(--surface-2); margin-top: 5px; overflow: hidden; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; color: #0b0e1a; background: var(--c); white-space: nowrap; }

/* ---- Équipes ---- */
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; margin-bottom: 18px; }
.inline-form { margin-bottom: 18px; }
.inline-form .btn { margin-bottom: 14px; }
.teams-list { display: grid; gap: 12px; }
.team { border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: grid; gap: 10px; background: rgba(var(--surface-solid-rgb, 18, 23, 40), 0.4); }
.team-top { display: flex; align-items: center; gap: 8px; }
.invite { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.invite code { padding: 4px 10px; border-radius: 8px; background: var(--surface-2); font-weight: 700; }
.members { display: flex; flex-wrap: wrap; gap: 6px; }
.member { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 3px; border-radius: 999px; border: 1px solid var(--border); font-size: .85rem; }
.member .x { border: 0; background: transparent; color: var(--text-3); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 2px; }
.member .x:hover { color: var(--danger); }

.compare-head h3 { margin-bottom: 12px; }
.member-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--border); background: transparent; cursor: pointer; font-size: .88rem; opacity: .5; transition: opacity .2s, background .2s; }
.chip[aria-pressed="true"] { opacity: 1; background: var(--surface-2); }
table.recap { margin-bottom: 18px; }

/* ---- Mode présentation ---- */
.compare-card.presenting { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 100; border-radius: 0; overflow: auto; padding: 28px 36px; background: var(--bg); }
.compare-card.presenting .g-label { font-size: 14px; }
.compare-card.presenting table.data { font-size: 1.05rem; }
.compare-card.presenting h3 { font-size: 1.4rem; }
:fullscreen.compare-card { background: var(--bg); }

/* ---- Compte ---- */
.checks { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.check { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--border); cursor: pointer; font-size: .9rem; }
.check input { accent-color: var(--accent); }
.danger-zone { border-color: rgba(var(--danger-rgb, 215, 119, 132), 0.35); }

/* ---- Fenêtre de saisie ---- */
.types { border: 0; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.type-chip { position: relative; cursor: pointer; }
.type-chip input { position: absolute; opacity: 0; top: 0; right: 0; bottom: 0; left: 0; margin: 0; cursor: pointer; }
.type-chip span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); font-size: .88rem; font-weight: 600; transition: background .15s, color .15s; }
.type-chip span::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.type-chip input:checked + span { background: var(--c); color: #0b0e1a; border-color: transparent; }
.type-chip input:checked + span::before { background: #0b0e1a; opacity: .5; }
.type-chip input:focus-visible + span { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
.duration { margin: 0 0 12px; font-weight: 600; color: var(--accent-2); }
.duration.bad { color: var(--danger); }
.dlg-actions { display: flex; gap: 8px; align-items: center; margin-top: 6px; }

/* ---- Notification ---- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; padding: 12px 18px; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: .92rem; max-width: calc(100vw - 32px); }
.toast.error { border-color: rgba(var(--danger-rgb, 215, 119, 132), 0.5); color: var(--danger); }

@media print {
  #bg-canvas, .bg-grain, .topbar, .tabs, .toolbar, .site-foot, .user-chip { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ---- Mot de passe : œil ---- */
.pw-wrap { position: relative; display: block; }
.pw-wrap .input { padding-right: 46px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--text-3); cursor: pointer; display: grid; place-items: center; }
.pw-eye:hover, .pw-eye[aria-pressed="true"] { color: var(--text); background: var(--surface-2); }
.pw-eye svg { width: 19px; height: 19px; }

/* ---- Chantiers ---- */
.empty-state { text-align: center; padding: 40px 20px; }
.empty-state .btn { margin-top: 10px; }
.chantiers-admin { margin-bottom: 18px; }
.ch-item { border: 1px solid var(--border); border-radius: 14px; margin-top: 12px; background: rgba(var(--surface-solid-rgb, 18, 23, 40), 0.4); }
.ch-item > summary { cursor: pointer; padding: 14px 16px; display: flex; gap: 12px; align-items: baseline; list-style: none; }
.ch-item > summary::-webkit-details-marker { display: none; }
.ch-item > summary::before { content: "▸"; color: var(--text-3); transition: transform .2s; display: inline-block; }
.ch-item[open] > summary::before { transform: rotate(90deg); }
.ch-item > *:not(summary) { margin-left: 16px; margin-right: 16px; }
.ch-item > *:last-child { margin-bottom: 16px; }
.ch-item h4 { margin: 6px 16px 8px; font-size: .9rem; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.admin-list { display: grid; gap: 8px; margin-bottom: 14px; }
.admin-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.admin-row .input { flex: 1 1 160px; width: auto; padding: 8px 12px; }
.admin-row select.input { flex: 0 1 220px; }
.admin-row.add { padding-top: 8px; border-top: 1px dashed var(--border); }
.color-in { width: 42px; height: 38px; padding: 2px; border-radius: 10px; border: 1px solid var(--border); background: transparent; cursor: pointer; flex: none; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
tr.total-row td { font-weight: 700; border-top: 2px solid var(--border); background: rgba(var(--accent-rgb, 139, 130, 219), 0.06); }
.multi-preview { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; background: var(--surface); }
.multi-preview ul { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.quick .btn[aria-pressed="true"] { background: var(--surface-2); border-color: var(--accent); }

/* ---- Invitation ---- */
.share-text { resize: vertical; font-size: .9rem; line-height: 1.5; margin-bottom: 14px; }
.share-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }

/* ---- Surveillance des repos ---- */
.rest-card { margin-bottom: 18px; }
.rest-card.inner { margin: 4px 0 18px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; }
.rest-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rest-head h3 { margin: 0; }
.rest-badge { padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.rest-badge.good { color: #04221b; background: var(--ok); }
.rest-badge.bad { color: #fff; background: var(--danger); }
.rest-ok { margin: 6px 0 0; color: var(--ok); font-weight: 600; }
.rest-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.rest-list li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; border: 1px solid; font-size: .92rem; line-height: 1.45; }
.rest-error { border-color: rgba(var(--danger-rgb, 215, 119, 132), 0.45); background: rgba(var(--danger-rgb, 215, 119, 132), 0.1); }
.rest-warn { border-color: rgba(var(--warn-rgb, 200, 165, 76), 0.45); background: rgba(var(--warn-rgb, 200, 165, 76), 0.1); }
.rest-info { border-color: var(--border); background: var(--surface); color: var(--text-2); }
.rest-ico { flex: none; }
.g-alert .g-alert-bg { fill: rgba(215, 119, 132, .16); stroke: rgba(215, 119, 132, .7); stroke-width: 1; stroke-dasharray: 4 3; }
.g-alert.warn .g-alert-bg { fill: rgba(200, 165, 76, .14); stroke: rgba(200, 165, 76, .7); }
.g-alert.info .g-alert-bg { fill: rgba(72, 174, 189, .08); stroke: rgba(72, 174, 189, .45); }
.g-hatch { fill: rgba(215, 119, 132, .28); }
.g-alert.warn .g-alert-hatch { opacity: .5; }

/* ---- Copier un jour ---- */
.copy-box { border: 1px dashed var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; display: grid; gap: 8px; }
.copy-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.copy-row select.input { flex: 1 1 200px; width: auto; padding: 8px 12px; }

/* ---- Astuces : version souris / version tactile ---- */
.hint-touch { display: none; }
.touch .hint-touch { display: inline; }
.touch .hint-desktop { display: none; }
.gantt-svg { touch-action: pan-y; -ms-touch-action: pan-y; }

/* ==========================================================================
   Persotime — tablettes et téléphones
   ========================================================================== */
.table-wrap { -webkit-overflow-scrolling: touch; }
.tabs { -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }

@media (max-width: 1000px) {
  .toolbar-end { margin-left: 0; }
}
@media (max-width: 760px) {
  .heures-head { align-items: stretch; }
  .heures-head h1 { margin-bottom: 4px; }
  .user-chip { justify-content: space-between; }
  .tabs { width: auto; max-width: none; margin-left: -4px; margin-right: -4px; }
  .tabs button { padding: 9px 13px; }
  .toolbar { gap: 8px; }
  .timeline-bar, .period-nav { width: 100%; }
  .period-nav { justify-content: space-between; }
  .period-label { min-width: 0; flex: 1 1 auto; font-size: .86rem; }
  .toolbar-end { width: 100%; }
  .toolbar-end > .btn { flex: 1 1 auto; }
  .toolbar-end > .seg { width: 100%; }
  .toolbar-end > .seg button { flex: 1; }
  #ch-select, #cmp-team { width: 100%; min-width: 0; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 11px 12px; }
  .stat strong { font-size: 1.15rem; }
  .stat.main { grid-column: span 2; }
  .stat.main strong { font-size: 1.6rem; }
  .team-grid { grid-template-columns: 1fr; gap: 12px; }
  .gantt-head { flex-direction: column; align-items: flex-start; }
  .gantt-tools { margin-left: 0; flex-wrap: wrap; }
  .legend { gap: 2px; }
  table.data { font-size: .84rem; }
  table.data th, table.data td { padding: 8px 6px; }
  #mine-table th:nth-child(6), #mine-table td.note { display: none; }
  td.actions .btn { padding: 6px 9px; }
  .admin-row .input, .admin-row select.input { flex: 1 1 100%; }
  .admin-row.add .btn { flex: 1 1 100%; }
  .ch-item > summary { flex-wrap: wrap; }
  .compare-card.presenting { padding: 12px; }
  .auth-card { padding: 18px; }
  .dlg-actions { flex-wrap: wrap; }
  .dlg-actions .btn { flex: 1 1 auto; }
  .quick .btn { flex: 1 1 auto; }
  .share-btns .btn { flex: 1 1 40%; }
  .rest-list li { font-size: .86rem; }
  .invite { gap: 6px; }
}
@media (max-width: 380px) {
  .tabs button { padding: 8px 10px; font-size: .88rem; }
  .stat strong { font-size: 1.05rem; }
}
/* Tablettes en mode portrait */
@media (min-width: 761px) and (max-width: 1024px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* Très petits écrans (320 px) : rien ne doit dépasser */
.team-grid > *, .stats > *, .auth-layout > * { min-width: 0; }
@media (max-width: 760px) {
  .toolbar-end { flex-wrap: wrap; }
  .team-top { flex-wrap: wrap; }
  .member { max-width: 100%; }
}
@media (max-width: 760px) { .quick .btn, .gantt-tools .btn { white-space: normal; text-align: center; } }

/* ---- Fenêtre « Journée » ---- */
#dlg-day { width: 640px; }
.day-group { border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; }
.day-group-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.day-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.day-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--border); }
.day-list li:first-child { border-top: 0; }
.day-time { font-variant-numeric: tabular-nums; font-weight: 600; }
.day-dur { color: var(--text-2); font-size: .9rem; }
.day-note { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-actions { flex-wrap: wrap; margin-top: 12px; }
.no-flexgap .day-group-head > *, .no-flexgap .day-list li > * { margin-right: 8px; }

/* ---- Sites (CNPE) -> chantiers ---- */
.site-block { border: 1px solid var(--border); border-radius: 16px; padding: 14px; margin-top: 14px; background: rgba(var(--accent-rgb, 139, 130, 219), 0.04); }
.site-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.site-ico { font-size: 1.1rem; color: var(--accent-2); }
.site-name { font-size: 1.08rem; }
.site-block .admin-row { margin-bottom: 8px; }
.site-block .ch-item { background: rgba(var(--surface-solid-rgb, 18, 23, 40), 0.5); }
#ch-site { max-width: 260px; }
@media (max-width: 760px) { #ch-site { max-width: none; width: 100%; } .site-block { padding: 10px; } }
.no-flexgap .site-head > * { margin-right: 8px; }

/* ---- Diagramme en plein écran ---- */
.card.gantt-full {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 900; margin: 0; border-radius: 0;
  overflow: auto; -webkit-overflow-scrolling: touch; background: var(--bg); padding: 16px 20px;
}
@supports (padding: max(0px)) {
  .card.gantt-full { padding: max(16px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
}
.card.gantt-full .g-label { font-size: 13.5px; }
.card.gantt-full .g-htext { font-size: 12.5px; }
.card.gantt-full .gantt-head h3 { font-size: 1.25rem; }
html.has-gantt-full, html.has-gantt-full body { overflow: hidden; }
:fullscreen.card { background: var(--bg); }

/* ---- N° de tranche ---- */
.row > .field.field-tranche { flex: 0 1 120px; }
.admin-row .input.tranche-in, .site-block .admin-row .input.tranche-in { flex: 0 0 110px; width: 110px; max-width: 110px; }
@media (max-width: 760px) { .row > .field.field-tranche { flex: 1 1 100px; } .admin-row .input.tranche-in { flex: 1 1 100%; } }

/* ---- Chantier en cours (en haut au milieu) ---- */
.work-site { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 22px 12px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); min-width: 240px; max-width: 440px; }
.work-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 700; }
.work-name { font-size: 1.55rem; line-height: 1.15; letter-spacing: -0.01em; color: var(--text); }
.work-sub { font-size: .9rem; color: var(--text-2); }
.work-site .btn { margin-top: 6px; }
.work-site.none { border-color: rgba(var(--warn-rgb, 200, 165, 76), 0.55); background: rgba(var(--warn-rgb, 200, 165, 76), 0.08); }
.work-site.none .work-name { color: var(--warn); font-size: 1.2rem; }
td.chantier-col { white-space: nowrap; color: var(--text-2); }
@media (max-width: 900px) {
  .heures-head { grid-template-columns: 1fr auto; }
  .work-site { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; max-width: none; }
}
@media (max-width: 600px) { #mine-table th:nth-child(7), #mine-table td.chantier-col { display: none; } }
@media (max-width: 600px) {
  .heures-head { grid-template-columns: 1fr; }
  .work-site { grid-row: auto; }
  .heures-head .user-chip { justify-self: stretch; }
}

/* ---- Équipe du chantier ---- */
#ch-team { margin-bottom: 18px; }
.team-editor .team-row .input { flex: 1 1 150px; }
.team-editor .team-row .poste-in { flex: 1 1 200px; }
.team-editor .team-row .qual-in { flex: 0 1 120px; }
.team-editor .team-row.me { border-left: 3px solid var(--accent-2); padding-left: 8px; }
.me-add { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
td.role { color: var(--text-2); white-space: nowrap; font-size: .85rem; }
@media (min-width: 761px) and (max-width: 999px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } .stat.main { grid-column: span 4; } }
@media (min-width: 1000px) { .stats { grid-template-columns: 2fr 1fr 1fr 1fr 1fr; } .stat.main { grid-column: auto; } }
@media (max-width: 760px) { .team-editor .team-row .input, .team-editor .team-row select.input { flex: 1 1 100%; } .team-editor .team-row .btn { flex: 1 1 auto; } }
.no-flexgap .me-add > * { margin-right: 8px; }

/* ---- Feuille d'heures de la semaine ---- */
dialog.panel.center.week-dlg { width: 1020px; max-width: calc(100vw - 16px); }
.week-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.week-bar #wk-iv { flex: 1 1 240px; width: auto; }
.week-quick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.week-grid { display: grid; gap: 8px; }
.wk-day { border: 1px solid var(--border); border-radius: 14px; padding: 8px 10px; background: rgba(var(--surface-solid-rgb, 18, 23, 40), 0.35); }
.wk-day.we { background: rgba(var(--accent-2-rgb, 72, 174, 189), 0.05); }
.wk-day.today { border-color: var(--accent); }
.wk-dayhead { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.wk-dayhead strong { min-width: 118px; }
.wk-daytot { font-weight: 700; color: var(--accent-2); font-variant-numeric: tabular-nums; }
.chip-btn { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 4px 10px; font-size: .8rem; font-weight: 700; cursor: pointer; }
.chip-btn:hover { color: var(--text); background: var(--surface-2); }
.chip-btn.t-travail, .chip-btn.t-attente, .chip-btn.t-repos_hebdo, .chip-btn.t-repos_anticipe { border-color: var(--c); }
.wk-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 3px 0; }
.wk-line + .wk-line { border-top: 1px dashed var(--border); }
.wk-line .input { width: auto; padding: 7px 9px; min-height: 0; }
.wk-type { flex: 0 1 150px; border-left: 4px solid var(--c, var(--border)) !important; }
.wk-time { flex: 0 0 auto; width: 124px !important; }
.wk-brk { flex: 0 1 120px; }
.wk-sys { flex: 0 1 140px; }
.wk-arrow { color: var(--text-3); }
.wk-dur { color: var(--text-2); font-size: .86rem; flex: 1 1 auto; font-variant-numeric: tabular-nums; }
.wk-line.empty .wk-time, .wk-line.empty .wk-brk, .wk-line.empty .wk-sys { opacity: .45; }
.week-total { font-weight: 700; }
.week-total.dirty { color: var(--warn); }
.week-foot { position: sticky; bottom: -16px; background: var(--surface-solid); padding: 10px 0 4px; margin-top: 10px; z-index: 1; }
@media (max-width: 760px) {
  .wk-line .input { flex: 1 1 45%; }
  .wk-time { width: auto !important; }
  .wk-arrow { display: none; }
  .wk-dayhead strong { min-width: 0; flex: 1 1 100%; }
}
.no-flexgap .wk-line > *, .no-flexgap .wk-dayhead > *, .no-flexgap .week-bar > *, .no-flexgap .week-quick > * { margin-right: 6px; margin-bottom: 4px; }
