/* Boutons, champs, pastilles, liens, notifications */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: var(--r-ctrl); border: 1px solid var(--trait); background: var(--surface);
  font-size: 13px; white-space: nowrap; transition: border-color .15s, background-color .15s;
}
.btn:hover { border-color: var(--ardoise); }
.btn.primary { background: var(--graphite); border-color: var(--graphite); color: var(--surface); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ardoise); }
.btn.ghost:hover { color: var(--graphite); background: var(--surface-2); }
.btn.danger { color: var(--erreur); }
.btn.large { height: 40px; padding: 0 16px; font-size: 14px; }
.btn svg.icon { width: 16px; height: 16px; }

.field {
  height: 36px; width: 100%; padding: 0 10px; border-radius: var(--r-ctrl);
  border: 1px solid var(--trait); background: var(--surface); outline: 0; transition: border-color .15s;
}
.field:focus { border-color: var(--prusse); }
.field::placeholder { color: var(--ardoise); }
.label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; }
.hint { margin-top: 4px; font-size: 12px; color: var(--ardoise); }
.form-row + .form-row { margin-top: var(--sp-4); }

kbd { font: 500 11px/1 var(--f-donnees); padding: 4px 6px; border-radius: 4px; border: 1px solid var(--trait); color: var(--ardoise); background: var(--porcelaine); }
.link { font-size: 13px; color: var(--prusse); white-space: nowrap; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.icon-btn { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-ctrl); color: var(--ardoise); transition: background-color .15s, color .15s; flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--graphite); }
.badge { position: absolute; top: 4px; right: 3px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 99px; background: var(--ambre); color: #1C1F22; font: 500 10px/15px var(--f-donnees); text-align: center; }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 99px; background: var(--surface-2); color: var(--graphite); font-size: 12px; }
.status { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--succes); }
.status.warn { background: var(--ambre); }
.status.err { background: var(--erreur); }
.status.off { background: var(--trait); }

.meter { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter > i { display: block; height: 100%; width: var(--v, 0%); background: var(--graphite); border-radius: 99px; transform-origin: left; }
.meter.warn > i { background: var(--ambre); }

.card { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--r-widget); padding: var(--sp-5); }
.empty { color: var(--ardoise); font-size: 13px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; translate: -50% 0; z-index: 60;
  display: flex; align-items: center; gap: var(--sp-4); max-width: calc(100vw - 32px);
  padding: 10px 16px; border-radius: 8px; background: var(--graphite); color: var(--porcelaine); font-size: 13px;
}
.toast.alert { background: var(--erreur); color: #fff; }
.toast form { display: contents; }
.toast-action { color: var(--ambre); font-weight: 500; padding: 4px 8px; margin: -4px -8px -4px 0; border-radius: var(--r-ctrl); }
.toast-action:hover { background: rgb(255 255 255 / .08); }
@media (max-width: 767px) { .toast { bottom: calc(96px + env(safe-area-inset-bottom)); } }

/* Verre (« liquid glass ») : navigation uniquement — DESIGN.md §7 */
.glass {
  position: relative; isolation: isolate;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%);
  box-shadow: inset 0 1px 0 var(--glass-edge), inset 0 0 0 1px var(--glass-line), var(--glass-shadow);
}
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: linear-gradient(160deg, var(--glass-shine) 0%, transparent 38%, transparent 70%, var(--glass-shine) 100%);
  opacity: .7;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .glass { background: var(--surface); } }
@media (prefers-reduced-transparency: reduce) {
  .glass { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .glass::before { display: none; }
}

/* Brouillon remis (controllers/draft_controller) */
.draft-notice { flex-basis: 100%; margin: 0 0 var(--sp-2); font-size: 12.5px; }
.draft-notice .link { margin-left: 4px; }

/* « Actions rapides » (accueil, agenda) : un bouton, et sous lui un menu d'icônes en verre, comme la barre de commande */
.quick-actions { position: relative; display: inline-flex; }
.qa-trigger svg.icon { transition: transform .25s; }
.qa-trigger[aria-expanded="true"] svg.icon { transform: rotate(-12deg) scale(1.08); color: var(--ambre); }
.qa-panel { /* au-dessus de la barre des widgets (collante, z-index 200) */
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 300; width: min(340px, calc(100vw - 32px)); padding: 14px;
  border: 1px solid var(--glass-line); border-radius: 18px; color: var(--graphite);
  background: color-mix(in oklab, var(--surface) 95%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%);
  box-shadow: inset 0 1px 0 var(--glass-edge), 0 24px 50px -20px rgb(0 0 0 / .45);
}
.qa-panel[hidden] { display: none; }
.qa-accounts { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px; margin-bottom: 10px; border-radius: 10px; background: var(--surface-2); }
.qa-account { flex: 1 1 auto; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 6px 8px; border: 0; border-radius: 8px; background: none; color: var(--ardoise); font: 500 12.5px/1.2 var(--f-texte); cursor: pointer; transition: background-color .15s, color .15s; }
.qa-account.is-on { background: var(--surface); color: var(--graphite); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
.qa-group { margin: 4px 2px 6px; font: 500 10.5px/1 var(--f-donnees); letter-spacing: .08em; text-transform: uppercase; color: var(--ardoise); }
.qa-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 8px; }
.qa-grid:last-child { margin-bottom: 0; }
.qa-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 2px; border: 0; border-radius: 12px; background: none; color: var(--graphite); font: 500 11.5px/1.15 var(--f-texte); text-align: center; text-decoration: none; cursor: pointer; transition: background-color .15s; }
.qa-tile:hover, .qa-tile:focus-visible { background: color-mix(in oklab, var(--graphite) 6%, transparent); outline: none; }
.qa-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--trait); transition: transform .18s; }
.qa-tile:hover .qa-icon { transform: translateY(-1px) scale(1.04); }
.qa-tile:active .qa-icon { transform: scale(.94); }
.qa-icon svg.icon { width: 20px; height: 20px; }
.qa-icon.qa-meet { background: color-mix(in oklab, var(--cal-sarcelle) 18%, var(--surface)); color: var(--cal-sarcelle); }
.qa-icon.qa-drive { background: color-mix(in oklab, var(--cal-ocre) 18%, var(--surface)); color: var(--cal-ocre); }
.qa-icon.qa-gmail { background: color-mix(in oklab, var(--cal-brique) 16%, var(--surface)); color: var(--cal-brique); }
.qa-icon.qa-link { font: 600 17px/1 var(--f-titre); color: var(--prusse); background: color-mix(in oklab, var(--prusse) 12%, var(--surface)); }
.qa-icon.qa-add { background: none; box-shadow: inset 0 0 0 1px var(--trait); color: var(--ardoise); }
.qa-label { max-width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .top .tools .qa-trigger span { display: none; }
  .qa-panel { position: fixed; top: 64px; left: 16px; right: 16px; width: auto; max-height: calc(100vh - 160px); overflow-y: auto; }
}
.qa-anchor { display: inline-flex; }
.qa-tile[hidden] { display: none; }
/* Épinglées en haut à droite quand l'en-tête sort de l'écran (place gardée dans l'en-tête) */
.quick-actions.is-pinned { position: fixed; top: 12px; right: 16px; z-index: 260; }
.quick-actions.is-pinned .qa-trigger {
  border: 1px solid var(--glass-line); border-radius: 999px; color: var(--graphite);
  background: var(--glass-bg); -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%);
  box-shadow: inset 0 1px 0 var(--glass-edge), var(--glass-shadow);
}
@media (max-width: 720px) { .quick-actions.is-pinned { top: 10px; right: 12px; } }
