/* Thème de Keep, aligné sur commun/theme.css (A4.4) : carte blanche,
   vert AnonySocial, police système, mêmes rayons et mêmes ombres que le reste
   de la suite. Les sept couleurs de notes restent (c'est une fonction), mais
   avec des teintes accordées, lisibles en clair comme en sombre. */
:root {
  color-scheme: light dark;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Menlo, monospace;
  /* Les titres de Keep passent en sans-serif, comme AnonyDoc et l'accueil. */
  --font-serif: var(--font-sans);

  --bg: #e6efe8;
  --bg-elevated: #ffffff;
  --bg-soft: #e8f3ea;
  --field-bg: #ffffff;
  --ink: #1c2b21;
  --ink-soft: #55645a;
  --ink-faint: #6b7a70;
  --line: #d7e0d9;
  --line-strong: #b9c6bc;
  --accent: #2e7d32;
  --accent-strong: #24622a;
  --accent-soft: #e8f3ea;
  --on-accent: #ffffff;
  --danger: #a3231b;
  --danger-soft: #fbeceb;
  /* Tâches (cases à cocher) : bleu, pour les distinguer du texte des notes. */
  --task-accent: #2f6ea8;
  --task-ink: #24557f;
  --task-accent-soft: rgba(47, 110, 168, 0.12);
  --focus-ring: rgba(46, 125, 50, 0.18);
  --forest: #1c2b21;
  --forest-ink: #ffffff;
  --auth-accent: #9cc9a2;
  --topbar-bg: rgba(255, 255, 255, 0.94);
  --shadow-card: 0 1px 2px rgba(28, 43, 33, 0.06);
  --shadow-float: 0 10px 28px rgba(28, 43, 33, 0.12);
  --shadow-modal: 0 24px 64px rgba(28, 43, 33, 0.24);

  --note-default-bg: #ffffff;
  --note-default-ink: #1c2b21;
  --note-default-line: #d7e0d9;
  --note-butter-bg: #fff6d8;
  --note-butter-ink: #3a3115;
  --note-butter-line: #ead9a5;
  --note-sage-bg: #e8f3ea;
  --note-sage-ink: #1b3423;
  --note-sage-line: #c4ddc9;
  --note-sky-bg: #e6f0f7;
  --note-sky-ink: #19303b;
  --note-sky-line: #c0d9e8;
  --note-blush-bg: #fbeaec;
  --note-blush-ink: #3a2225;
  --note-blush-line: #ecc8cd;
  --note-lilac-bg: #f0ecf8;
  --note-lilac-ink: #2c2638;
  --note-lilac-line: #d8cfec;
  --note-peach-bg: #fdf0e3;
  --note-peach-ink: #3a2a1c;
  --note-peach-line: #ecd3b8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111913;
    --bg-elevated: #1a231c;
    --bg-soft: #223027;
    --field-bg: #1a231c;
    --ink: #eef3ee;
    --ink-soft: #b6c2b7;
    --ink-faint: #8ea092;
    --line: rgba(215, 228, 217, 0.14);
    --line-strong: rgba(215, 228, 217, 0.28);
    --accent: #86c78d;
    --accent-strong: #a8d9ae;
    --accent-soft: #24382a;
    --on-accent: #0d1a10;
    --danger: #ff9b91;
    --danger-soft: #3a2321;
    --task-accent: #7fb4e8;
    --task-ink: #a8cdf0;
    --task-accent-soft: rgba(127, 180, 232, 0.16);
    --focus-ring: rgba(134, 199, 141, 0.2);
    --forest: #0d150f;
    --forest-ink: #ffffff;
    --topbar-bg: rgba(17, 25, 19, 0.94);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.28);
    --shadow-float: 0 10px 28px rgba(0, 0, 0, 0.4);
    --shadow-modal: 0 24px 64px rgba(0, 0, 0, 0.6);

    --note-default-bg: #1d2720;
    --note-default-ink: #eef3ee;
    --note-default-line: rgba(215, 228, 217, 0.18);
    --note-butter-bg: #3a3218;
    --note-butter-ink: #f6ecc4;
    --note-butter-line: rgba(246, 236, 196, 0.18);
    --note-sage-bg: #22352a;
    --note-sage-ink: #e4eee6;
    --note-sage-line: rgba(196, 225, 190, 0.18);
    --note-sky-bg: #1d2c36;
    --note-sky-ink: #dfeaf3;
    --note-sky-line: rgba(178, 214, 238, 0.18);
    --note-blush-bg: #382327;
    --note-blush-ink: #f4e2e4;
    --note-blush-line: rgba(245, 202, 207, 0.18);
    --note-lilac-bg: #2a2536;
    --note-lilac-ink: #eae4f6;
    --note-lilac-line: rgba(215, 199, 242, 0.18);
    --note-peach-bg: #37291e;
    --note-peach-ink: #f5e5d4;
    --note-peach-line: rgba(245, 216, 186, 0.18);
  }
}

/* Base : le strict nécessaire que commun/theme.css ne pose pas pour une
   application plein écran (le thème met une carte de 560 px et un fond pâle,
   que Keep remplace par sa propre mise en page). */
*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 12px 0 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

svg {
  display: block;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid #9cc9a2;
  outline-offset: 2px;
}

.screen {
  min-height: 100dvh;
}

.eyebrow {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow--light {
  color: var(--accent);
}

/* ---------- Boot ---------- */

.boot-screen {
  display: grid;
  place-items: center;
  padding: 32px;
}

.boot-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.boot-logo {
  width: 80px;
  height: 80px;
  border-radius: 22px;
  box-shadow: 0 18px 44px rgba(31, 38, 28, 0.18);
  animation: boot-breathe 2.4s ease-in-out infinite;
}

.boot-word {
  margin: 18px 0 6px;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.045em;
}

.boot-status {
  margin: 0;
  max-width: 30rem;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.boot-screen .text-button {
  margin-top: 14px;
}

@keyframes boot-breathe {
  0%,
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 18px 44px rgba(31, 38, 28, 0.16);
  }
  50% {
    transform: translateY(-4px) scale(1.015);
    box-shadow: 0 24px 54px rgba(31, 38, 28, 0.22);
  }
}

/* ---------- Auth ---------- */

.auth-screen {
  background: var(--bg);
}

.auth-toolbox {
  position: fixed;
  z-index: 90;
  top: 18px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(27, 33, 27, 0.12);
}

.auth-toolbox:hover,
.auth-toolbox:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
  min-height: 100dvh;
}

.auth-visual {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(28px, 4.4vw, 64px);
  color: var(--forest-ink);
  background:
    radial-gradient(circle at 80% 18%, rgba(199, 221, 177, 0.16), transparent 24rem),
    radial-gradient(circle at 10% 92%, rgba(202, 165, 112, 0.1), transparent 26rem),
    var(--forest);
}

.auth-visual::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 16%;
  right: -190px;
  width: 460px;
  height: 460px;
  border: 1px solid rgba(244, 240, 227, 0.12);
  border-radius: 42px;
  transform: rotate(-13deg);
}

.auth-visual::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: 15%;
  bottom: -230px;
  width: 390px;
  height: 390px;
  border: 1px solid rgba(244, 240, 227, 0.08);
  border-radius: 50%;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.auth-brand img {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(244, 240, 227, 0.2);
  border-radius: 10px;
}

.auth-pitch {
  max-width: 560px;
  margin: auto 0;
  padding: 8vh 0 5vh;
}

.auth-pitch h1 {
  margin: 18px 0 25px;
  font-family: var(--font-serif);
  font-size: clamp(46px, 5.5vw, 78px);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.auth-pitch h1 em {
  color: var(--auth-accent);
  font-style: italic;
}

.auth-pitch > p:not(.eyebrow) {
  max-width: 430px;
  margin: 0;
  font-size: 14.5px;
  line-height: 1.7;
  color: rgba(244, 240, 227, 0.67);
}

.auth-points {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-points li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: rgba(244, 240, 227, 0.78);
}

.auth-points .icon {
  width: 17px;
  height: 17px;
  color: var(--auth-accent);
}

.auth-visual-foot {
  margin: 28px 0 0;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(244, 240, 227, 0.43);
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 5vw, 72px);
}

.auth-card {
  width: min(100%, 452px);
}

.auth-mobile-brand {
  display: none;
}

.auth-card h2 {
  margin: 10px 0 12px;
  font-family: var(--font-serif);
  font-size: clamp(36px, 3.1vw, 45px);
  font-weight: 400;
  letter-spacing: -0.038em;
  line-height: 1.03;
}

.auth-intro {
  max-width: 410px;
  margin: 0 0 27px;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.65;
}

.auth-form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.field input,
.password-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field-bg);
  font-size: 16px;
  color: var(--ink);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field input::placeholder,
.password-wrap input::placeholder {
  color: var(--ink-faint);
  opacity: 0.8;
}

.field input:focus,
.password-wrap input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  place-items: center;
  color: var(--ink-faint);
  background: transparent;
}

.password-toggle:hover {
  color: var(--ink);
  background: var(--bg-soft);
}

.password-toggle .icon {
  width: 18px;
  height: 18px;
}

.hint {
  margin: 0;
  color: var(--ink-faint);
  font-size: 11.5px;
  line-height: 1.55;
}

.hint code {
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.hint--tight {
  margin-top: -10px;
}

.check-field {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.45;
  cursor: pointer;
}

.check-field input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--accent);
  flex: none;
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-color: color-mix(in srgb, var(--danger) 24%, transparent);
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12.5px;
  line-height: 1.5;
}

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.primary-button {
  width: 100%;
  background: var(--accent);
  color: var(--on-accent);
}

.primary-button:hover {
  background: var(--accent-strong);
}

.primary-button:active {
  transform: translateY(1px);
}

.primary-button--compact {
  width: auto;
  min-height: 42px;
  padding: 0 18px;
}

.secondary-button {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}

.secondary-button:hover {
  background: var(--bg-soft);
}

.danger-button {
  background: var(--danger);
  color: #fff8f6;
}

@media (prefers-color-scheme: dark) {
  .danger-button {
    color: #2a1210;
  }
}

.security-footnote {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 10.8px;
  line-height: 1.55;
}

.security-footnote .icon {
  width: 15px;
  height: 15px;
  margin-top: 1px;
}

.offline-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 16px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.5;
}

.offline-note .icon {
  width: 15px;
  height: 15px;
  margin-top: 1px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
}

.text-button:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-button--danger {
  color: var(--danger);
}

/* ---------- Workspace shell ---------- */

.workspace {
  min-height: 100dvh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: calc(11px + env(safe-area-inset-top)) clamp(16px, 4vw, 40px) 11px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  backdrop-filter: blur(18px) saturate(1.1);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.045em;
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  box-shadow: 0 4px 12px rgba(31, 38, 28, 0.13);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elevated);
}

.app-switch a {
  display: grid;
  place-items: center;
  width: 31px;
  height: 28px;
  border-radius: 999px;
  color: var(--ink-soft);
  text-decoration: none;
  transition: background 0.16s, color 0.16s;
}

.app-switch a:hover,
.app-switch a:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
  outline: none;
}

.app-switch a.is-active {
  background: var(--accent);
  color: #fffdf7;
}

.app-switch .icon {
  width: 15px;
  height: 15px;
}

@media (prefers-color-scheme: dark) {
  .app-switch a.is-active {
    color: #102015;
  }
}

.toolbox-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.toolbox-link:hover,
.toolbox-link:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 560px) {
  .topbar-actions .toolbox-link {
    display: none;
  }
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elevated);
  background: color-mix(in srgb, var(--bg-elevated) 70%, transparent);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition: background 160ms ease, border-color 160ms ease;
}

.sync-pill:hover {
  border-color: var(--line-strong);
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-faint);
  transition: background 160ms ease;
}

.sync-pill[data-status="synced"] .sync-dot {
  background: #4b8a62;
}

.sync-pill[data-status="syncing"] .sync-dot {
  background: var(--accent);
  animation: dot-pulse 1.1s ease-in-out infinite;
}

.sync-pill[data-status="pending"] .sync-dot {
  background: #c9923d;
}

.sync-pill[data-status="offline"] .sync-dot {
  background: #c9923d;
}

.sync-pill[data-status="error"] .sync-dot,
.sync-pill[data-status="auth"] .sync-dot {
  background: var(--danger);
}

@keyframes dot-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  place-items: center;
  color: var(--ink-soft);
  background: transparent;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.icon-button:hover {
  color: var(--ink);
  background: var(--bg-soft);
}

.icon-button .icon {
  width: 21px;
  height: 21px;
}

.workspace-inner {
  width: min(100%, 1200px);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) clamp(16px, 4vw, 40px) 76px;
}

.hero {
  margin-bottom: 24px;
}

.hero .eyebrow {
  color: var(--accent);
}

.hero h1 {
  margin: 8px 0 7px;
  font-family: var(--font-serif);
  font-size: clamp(36px, 4.2vw, 50px);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1;
}

.hero-subtitle {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.5;
}

.search-wrap {
  display: flex;
  width: min(100%, 560px);
  height: 46px;
  align-items: center;
  gap: 10px;
  padding: 0 8px 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-card);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.search-icon {
  width: 18px;
  height: 18px;
  color: var(--ink-faint);
}

.search-wrap input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 16px;
  color: var(--ink);
}

.search-wrap input::placeholder {
  color: var(--ink-faint);
}

.search-wrap input::-webkit-search-cancel-button {
  display: none;
}

.search-clear {
  display: grid;
  width: 32px;
  height: 32px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 8px;
  place-items: center;
  color: var(--ink-faint);
  background: transparent;
}

.search-clear:hover {
  color: var(--ink);
  background: var(--bg-soft);
}

.search-clear .icon {
  width: 16px;
  height: 16px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
}

.tabs {
  display: flex;
  width: fit-content;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  background: color-mix(in srgb, var(--bg-soft) 58%, transparent);
}

.tab {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 160ms ease, color 160ms ease;
}

.tab:hover {
  color: var(--ink);
}

.tab.is-active {
  background: var(--ink);
  color: var(--bg);
}

.tab-count {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  opacity: 0.6;
}

.banner {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 16px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.55;
}

.banner .icon {
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.banner strong {
  color: var(--ink);
  font-weight: 650;
}

.banner--offline {
  background: #f5ecd9;
  border-color: rgba(154, 109, 40, 0.16);
}

.banner--error {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 18%, transparent);
}

.banner--error .icon {
  color: var(--danger);
}

.banner--auth {
  align-items: center;
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 18%, transparent);
}

.banner--auth .icon {
  color: var(--danger);
}

.banner-action {
  margin-left: auto;
  padding: 2px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--danger);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

@media (prefers-color-scheme: dark) {
  .banner--offline {
    background: #322b1d;
    border-color: rgba(228, 190, 122, 0.16);
  }
}

.notes-view {
  margin-top: 2px;
}

.notes-section {
  margin-top: 28px;
}

.notes-section[hidden] {
  display: none;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 11px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.15em;
  line-height: 1.4;
  text-transform: uppercase;
}

.section-title::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.notes-grid {
  /* repère des cartes (offsetLeft/offsetTop) pour le déplacement */
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 226px), 1fr));
  gap: 12px;
  align-items: start;
}

.note {
  --note-bg: var(--note-default-bg);
  --note-ink: var(--note-default-ink);
  --note-line: var(--note-default-line);
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 136px;
  flex-direction: column;
  padding: 16px 14px 12px;
  border: 1px solid var(--note-line);
  border-radius: 16px;
  background: var(--note-bg);
  color: var(--note-ink);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  text-align: left;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.note:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(31, 38, 28, 0.09);
}

.note:active {
  transform: translateY(0);
}

.note:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.note-title {
  margin: 0 27px 6px 0;
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

.note-body {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: inherit;
  font-size: 13px;
  line-height: 1.55;
  opacity: 0.78;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
}

.note--untitled .note-body {
  margin-top: 3px;
  padding-right: 22px;
  font-size: 14px;
  line-height: 1.55;
  opacity: 0.86;
  -webkit-line-clamp: 8;
}

.note-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 15px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.48;
}

.note-pin {
  position: absolute;
  top: 7px;
  right: 7px;
  display: grid;
  width: 31px;
  height: 31px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  place-items: center;
  color: inherit;
  background: transparent;
  opacity: 0.38;
  transition: opacity 150ms ease, background 150ms ease;
}

.note-pin:hover {
  background: rgba(128, 128, 128, 0.1);
  opacity: 0.9;
}

.note-pin.is-pinned {
  opacity: 0.9;
}

.note-pin .icon {
  width: 16px;
  height: 16px;
}

.note-media {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.note-media .icon {
  width: 12px;
  height: 12px;
}

.note-pin.is-pinned .icon {
  fill: currentColor;
  fill-opacity: 0.13;
}

/* Liste à cocher — rendu sur la carte */
.note-tasks {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 2px 0;
}

.note-task {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.45;
  opacity: 0.85;
}

.note-task.is-done {
  opacity: 0.5;
}

.note-task.is-done .task-text {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.task-check {
  display: grid;
  flex: none;
  width: 20px;
  height: 20px;
  margin: -2px 0 -2px -1px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  place-items: center;
  color: inherit;
  background: transparent;
}

.task-check:disabled {
  cursor: default;
}

.task-box {
  position: relative;
  display: block;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--task-accent);
  border-radius: 5px;
  opacity: 0.85;
  transition: background 140ms ease, opacity 140ms ease;
}

.task-box::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid var(--note-bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 140ms ease;
}

.task-check[aria-checked='true'] .task-box {
  background: var(--task-accent);
  opacity: 1;
}

.task-check[aria-checked='true'] .task-box::after {
  transform: rotate(45deg) scale(1);
}

.task-text {
  padding-top: 1px;
  color: var(--task-ink);
  overflow-wrap: anywhere;
}

.note-tasks-more {
  padding-left: 28px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.45;
}

.note-foot-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.note-tasks-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--task-ink);
  font-weight: 600;
}

.note-tasks-count.is-complete {
  opacity: 0.55;
}

.note-tasks-count .icon {
  width: 12px;
  height: 12px;
}

.note--tasks .note-body {
  margin-top: 6px;
}

/* Aperçu de la première photo, plein cadre en haut de la carte */
.note-thumb {
  position: relative;
  margin: -16px -14px 11px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 15px 15px 0 0;
  background: rgba(128, 128, 128, 0.14);
}

.note-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  object-fit: cover;
  transition: opacity 200ms ease;
}

.note-thumb img[src] {
  opacity: 1;
}

.note-thumb.is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 20%,
    rgba(255, 255, 255, 0.28) 50%,
    transparent 80%
  );
  animation: note-thumb-shimmer 1.2s ease-in-out infinite;
}

@keyframes note-thumb-shimmer {
  from {
    transform: translateX(-60%);
  }
  to {
    transform: translateX(60%);
  }
}

.note-thumb-count {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(20, 24, 20, 0.62);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
}

.color-default {
  --note-bg: var(--note-default-bg);
  --note-ink: var(--note-default-ink);
  --note-line: var(--note-default-line);
}

.color-butter {
  --note-bg: var(--note-butter-bg);
  --note-ink: var(--note-butter-ink);
  --note-line: var(--note-butter-line);
}

.color-sage {
  --note-bg: var(--note-sage-bg);
  --note-ink: var(--note-sage-ink);
  --note-line: var(--note-sage-line);
}

.color-sky {
  --note-bg: var(--note-sky-bg);
  --note-ink: var(--note-sky-ink);
  --note-line: var(--note-sky-line);
}

.color-blush {
  --note-bg: var(--note-blush-bg);
  --note-ink: var(--note-blush-ink);
  --note-line: var(--note-blush-line);
}

.color-lilac {
  --note-bg: var(--note-lilac-bg);
  --note-ink: var(--note-lilac-ink);
  --note-line: var(--note-lilac-line);
}

.color-peach {
  --note-bg: var(--note-peach-bg);
  --note-ink: var(--note-peach-ink);
  --note-line: var(--note-peach-line);
}

.note.color-default,
.note.color-butter,
.note.color-sage,
.note.color-sky,
.note.color-blush,
.note.color-lilac,
.note.color-peach,
.editor-dialog {
  background: var(--note-bg);
  color: var(--note-ink);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 34px;
  padding: clamp(34px, 7vw, 58px) 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 20px;
  background: var(--bg-elevated);
  background: color-mix(in srgb, var(--bg-elevated) 48%, transparent);
  text-align: center;
}

.empty-art {
  position: relative;
  width: 112px;
  height: 94px;
  margin-bottom: 20px;
}

.empty-sheet {
  position: absolute;
  display: block;
  width: 76px;
  height: 88px;
  border-radius: 12px;
}

.empty-sheet--back {
  top: 3px;
  left: 13px;
  background: var(--note-butter-bg);
  transform: rotate(-9deg);
  opacity: 0.7;
}

.empty-sheet--front {
  top: 3px;
  left: 29px;
  padding: 20px 15px;
  background: var(--note-default-bg);
  border: 1px solid var(--line);
  box-shadow: 0 10px 22px rgba(31, 38, 28, 0.08);
  transform: rotate(4deg);
}

.empty-sheet--front span {
  display: block;
  height: 2px;
  margin-bottom: 8px;
  border-radius: 2px;
  background: var(--ink-faint);
  opacity: 0.3;
}

.empty-sheet--front span:nth-child(2) {
  width: 80%;
}

.empty-sheet--front span:nth-child(3) {
  width: 55%;
}

.empty-state h2 {
  margin: 0 0 7px;
  font-family: var(--font-serif);
  font-size: clamp(25px, 3vw, 30px);
  font-weight: 400;
  letter-spacing: -0.03em;
}

.empty-state p {
  max-width: 34rem;
  margin: 0 0 19px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.65;
}

.empty-state .primary-button {
  width: auto;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 54px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
}

.footer-lock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-lock .icon {
  width: 13px;
  height: 13px;
}

.footer-sep::before {
  content: "·";
  padding-right: 10px;
}

.footer-tools {
  color: var(--accent);
  text-decoration: none;
}

.footer-tools:hover,
.footer-tools:focus-visible {
  text-decoration: underline;
}

.fab {
  position: fixed;
  z-index: 30;
  right: clamp(18px, 4vw, 42px);
  bottom: calc(22px + env(safe-area-inset-bottom));
  display: grid;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 0;
  border-radius: 18px;
  place-items: center;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 14px 34px rgba(36, 72, 52, 0.3);
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.fab:hover {
  transform: translateY(-2px) scale(1.015);
  background: var(--accent-strong);
  box-shadow: 0 18px 38px rgba(36, 72, 52, 0.34);
}

.fab:active {
  transform: translateY(0) scale(0.98);
}

.fab .icon {
  width: 25px;
  height: 25px;
  stroke-width: 2;
}

/* ---------- Editor ---------- */

dialog {
  color: var(--ink);
}

dialog::backdrop {
  background: rgba(15, 22, 17, 0.46);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.editor-dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  flex-direction: column;
  background: var(--note-bg);
  color: var(--note-ink);
}

.editor-dialog[open] {
  display: flex;
}

.editor-bar {
  display: flex;
  min-height: 64px;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  border-bottom: 1px solid var(--note-line);
}

.editor-bar .icon-button:hover {
  background: rgba(128, 128, 128, 0.12);
}

.editor-bar .icon-button {
  color: inherit;
  opacity: 0.72;
}

.editor-bar .icon-button:hover {
  opacity: 1;
}

.editor-status {
  flex: 1;
  color: inherit;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
  opacity: 0.42;
  transition: opacity 160ms ease;
}

.editor-status.is-saving {
  opacity: 0.8;
}

.editor-pin.is-active {
  opacity: 1;
}

.editor-pin.is-active .icon {
  fill: currentColor;
  fill-opacity: 0.16;
}

.editor-main {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: auto;
  padding: 10px 24px 20px;
}

.editor-title {
  width: 100%;
  flex: none;
  padding: 12px 0 8px;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font-family: var(--font-sans);
  font-size: clamp(22px, 3.3vw, 29px);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.28;
}

.editor-body-input {
  width: 100%;
  min-height: 210px;
  flex: 1;
  padding: 8px 0 20px;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: inherit;
  font-size: 16px;
  line-height: 1.65;
}

.editor-title::placeholder,
.editor-body-input::placeholder {
  color: inherit;
  opacity: 0.32;
}

/* Liste à cocher — éditeur */
.editor-items {
  flex: none;
  margin: 4px 0 8px;
}

.items-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 4px;
  padding: 0;
  list-style: none;
}

.item-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  transition: background 140ms ease;
}

/* Poignée de déplacement des cases à cocher */
.item-handle {
  display: inline-grid;
  flex: none;
  width: 20px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  place-items: center;
  color: var(--task-accent);
  background: transparent;
  opacity: 0.55;
  cursor: grab;
  touch-action: none;
}

.item-handle:hover {
  background: var(--task-accent-soft);
  opacity: 1;
}

.item-handle .icon {
  width: 15px;
  height: 15px;
}

.icon-dots {
  fill: currentColor;
  stroke: none;
}

.item-row.is-moving {
  position: relative;
  z-index: 3;
  background: var(--note-bg);
  box-shadow: var(--shadow-float);
}

.item-row.is-drop-target::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -2px;
  height: 3px;
  border-radius: 2px;
  background: var(--task-accent);
}

.item-check {
  position: relative;
  display: grid;
  flex: none;
  width: 22px;
  height: 22px;
  place-items: center;
  cursor: pointer;
}

.item-done-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.item-box {
  position: relative;
  display: block;
  width: 17px;
  height: 17px;
  border: 1.5px solid var(--task-accent);
  border-radius: 5px;
  opacity: 0.9;
  transition: background 140ms ease, opacity 140ms ease;
}

.item-box::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid var(--note-bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 140ms ease;
}

.item-done-input:checked + .item-box {
  background: var(--task-accent);
  opacity: 1;
}

.item-done-input:checked + .item-box::after {
  transform: rotate(45deg) scale(1);
}

.item-done-input:focus-visible + .item-box {
  outline: 2px solid var(--task-accent);
  outline-offset: 2px;
}

.item-text {
  min-width: 0;
  flex: 1;
  padding: 7px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--task-ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
}

.item-text::placeholder {
  color: inherit;
  opacity: 0.32;
}

.item-row.is-done .item-text {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  opacity: 0.5;
}

.item-remove {
  display: inline-grid;
  flex: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  place-items: center;
  color: inherit;
  background: transparent;
  opacity: 0.35;
}

.item-remove:hover {
  background: rgba(128, 128, 128, 0.12);
  opacity: 0.9;
}

.item-remove .icon {
  width: 15px;
  height: 15px;
}

.add-item-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: 1px;
  padding: 8px 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 13.5px;
  font-weight: 550;
  opacity: 0.6;
}

.add-item-button:hover {
  background: rgba(128, 128, 128, 0.1);
  opacity: 1;
}

.add-item-button .icon {
  width: 15px;
  height: 15px;
}

.editor-main.has-items .editor-body-input {
  min-height: 84px;
}

.editor-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(102px, 1fr));
  gap: 8px;
  margin: 4px 0 16px;
}

.editor-image {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--note-line);
  border-radius: 12px;
  background: rgba(128, 128, 128, 0.13);
}

.editor-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.editor-image-open {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.editor-image-placeholder {
  display: grid;
  height: 100%;
  place-items: center;
  padding: 8px;
  color: inherit;
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.45;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.5;
}

.editor-image-placeholder.is-error {
  opacity: 0.8;
}

.editor-image-retry {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: var(--font-mono);
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.editor-image-remove {
  position: absolute;
  z-index: 2;
  top: 5px;
  right: 5px;
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  place-items: center;
  color: #fff;
  background: rgba(12, 18, 13, 0.62);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.editor-image-remove:hover {
  background: rgba(12, 18, 13, 0.82);
}

.editor-image-remove .icon {
  width: 14px;
  height: 14px;
}

.editor-image-badge {
  position: absolute;
  bottom: 5px;
  left: 5px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(12, 18, 13, 0.56);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 7.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.editor-dialog.is-dragover .editor-main::after {
  content: "Dépose l’image ici";
  position: absolute;
  inset: 10px;
  display: grid;
  place-items: center;
  border: 2px dashed currentColor;
  border-radius: 14px;
  background: color-mix(in srgb, var(--note-bg) 88%, transparent);
  color: var(--note-ink);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0.9;
}

.editor-main {
  position: relative;
}

.editor-main.is-readonly {
  opacity: 0.72;
}

.editor-readonly-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--note-line);
  border-radius: 9px;
  color: inherit;
  font-size: 11.5px;
  line-height: 1.5;
  opacity: 0.7;
}

.editor-readonly-note .icon {
  width: 15px;
  height: 15px;
}

.editor-tools {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px calc(11px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--note-line);
}

.palette {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  padding: 4px 2px;
  scrollbar-width: none;
}

.palette::-webkit-scrollbar {
  display: none;
}

.swatch {
  width: 25px;
  height: 25px;
  flex: none;
  padding: 0;
  border: 1px solid rgba(28, 34, 29, 0.15);
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.12);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.swatch:hover {
  transform: scale(1.08);
}

.swatch.is-active {
  box-shadow: 0 0 0 2px var(--note-bg), 0 0 0 4px currentColor;
}

.swatch--default {
  --swatch: var(--note-default-bg);
}

.swatch--butter {
  --swatch: var(--note-butter-bg);
}

.swatch--sage {
  --swatch: var(--note-sage-bg);
}

.swatch--sky {
  --swatch: var(--note-sky-bg);
}

.swatch--blush {
  --swatch: var(--note-blush-bg);
}

.swatch--lilac {
  --swatch: var(--note-lilac-bg);
}

.swatch--peach {
  --swatch: var(--note-peach-bg);
}

.editor-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 2px;
}

.tool-button {
  display: inline-flex;
  min-width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: inherit;
  opacity: 0.68;
  transition: opacity 140ms ease, background 140ms ease;
}

.tool-button:hover {
  background: rgba(128, 128, 128, 0.12);
  opacity: 1;
}

.tool-button--danger:hover {
  color: var(--danger);
}

.tool-button--label {
  padding: 0 11px;
  font-size: 11.5px;
  font-weight: 650;
  opacity: 0.9;
}

.tool-button--label .icon {
  width: 16px;
  height: 16px;
}

@media (min-width: 760px) {
  .editor-dialog {
    inset: 0;
    width: min(720px, 92vw);
    height: min(760px, 86dvh);
    max-height: 86dvh;
    margin: auto;
    border-radius: 22px;
    box-shadow: var(--shadow-modal);
  }

  .editor-bar {
    padding-top: 10px;
  }

  .editor-tools {
    padding-bottom: 11px;
  }

  .editor-main {
    padding-left: 32px;
    padding-right: 32px;
  }

  .editor-body-input {
    min-height: 300px;
  }
}

/* Deplacement des cartes (facon Google Keep) */
.note-swipe {
  position: relative;
  min-width: 0;
  border-radius: 16px;
  touch-action: pan-y;
}

.note-swipe .note {
  position: relative;
  z-index: 1;
  height: 100%;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* Emplacement laisse vide pendant le deplacement */
.note-swipe.is-placeholder .note {
  visibility: hidden;
}

.note-swipe.is-placeholder::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px dashed var(--accent);
  border-radius: 16px;
  background: rgba(128, 128, 128, 0.06);
}

/* Carte qui suit le doigt */
.note-drag-ghost {
  position: fixed;
  z-index: 999;
  margin: 0;
  pointer-events: none;
  transform-origin: center;
  box-shadow: 0 26px 60px rgba(18, 25, 20, 0.28);
  cursor: grabbing;
  will-change: transform;
}

.note-drag-ghost.is-outside {
  outline: 2px solid var(--danger);
  outline-offset: -2px;
  opacity: 0.9;
}

.note-drag-ghost.is-outside::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: var(--danger);
  opacity: 0.22;
  pointer-events: none;
}

body.is-dragging-note {
  cursor: grabbing;
  user-select: none;
}

body.is-dragging-note .fab {
  opacity: 0.35;
}

/* Bandeau affiche quand la carte sort du plateau */
.drop-hint {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff8f6;
  box-shadow: var(--shadow-float);
  font-size: 12.5px;
  font-weight: 600;
  transform: translateX(-50%);
  pointer-events: none;
}

.drop-hint .icon {
  width: 16px;
  height: 16px;
}
/* ---------- Selecteur de photos du coffre ---------- */

.picker-dialog {
  width: min(520px, 94vw);
  max-width: none;
  max-height: min(620px, 84dvh);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--bg-elevated);
  color: var(--ink);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
}

.picker-dialog[open] {
  display: flex;
  flex-direction: column;
}

.picker-head {
  display: flex;
  flex: none;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 10px;
}

.picker-head h2 {
  margin: 2px 0 0;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
  overflow: auto;
  padding: 6px 18px 14px;
}

.picker-item {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1;
  background: rgba(128, 128, 128, 0.12);
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.picker-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}

.picker-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.picker-empty {
  margin: 0 18px 16px;
  color: var(--ink-soft);
  font-size: 13px;
}

.picker-foot {
  display: flex;
  flex: none;
  justify-content: flex-end;
  padding: 12px 18px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

@media (min-width: 760px) {
  .picker-foot {
    padding-bottom: 14px;
  }
}

/* ---------- Menu ---------- */

.menu-dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.menu-dialog[open] {
  display: block;
}

.menu-panel {
  display: flex;
  width: min(91vw, 380px);
  height: 100%;
  flex-direction: column;
  margin-left: auto;
  padding: calc(24px + env(safe-area-inset-top)) 22px calc(22px + env(safe-area-inset-bottom));
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: var(--bg-elevated);
  box-shadow: -24px 0 70px rgba(18, 25, 20, 0.2);
  animation: menu-in 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes menu-in {
  from {
    transform: translateX(22px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.menu-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.menu-head h2 {
  margin: 6px 0 0;
  font-family: var(--font-serif);
  font-size: 31px;
  font-weight: 400;
  letter-spacing: -0.035em;
}

.menu-sync-card {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 22px 0 18px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
}

.menu-sync-card div {
  display: grid;
  gap: 3px;
}

.menu-sync-card strong {
  font-size: 12px;
  font-weight: 650;
}

.menu-sync-card span:not(.menu-sync-dot) {
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.menu-sync-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: #4b8a62;
}

.menu-sync-dot[data-status="syncing"],
.menu-sync-dot[data-status="pending"] {
  background: #c9923d;
}

.menu-sync-dot[data-status="offline"] {
  background: #c9923d;
}

.menu-sync-dot[data-status="error"],
.menu-sync-dot[data-status="auth"] {
  background: var(--danger);
}

.menu-nav {
  display: grid;
  gap: 3px;
}

.menu-item {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  transition: background 150ms ease;
}

.menu-item:hover {
  background: var(--bg-soft);
}

.menu-item > .icon:first-child {
  width: 18px;
  height: 18px;
  color: var(--ink-faint);
}

.menu-item--accent {
  color: var(--accent);
}

.menu-item--accent > .icon:first-child {
  color: var(--accent);
}

.menu-chevron {
  width: 14px;
  height: 14px;
  margin-left: auto;
  color: var(--ink-faint);
  opacity: 0.5;
}

.menu-security {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: auto;
  padding: 20px 2px 0;
  color: var(--ink-faint);
}

.menu-security .icon {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  color: var(--accent);
}

.menu-security p {
  margin: 0;
  font-size: 10.8px;
  line-height: 1.6;
}

.menu-security strong {
  color: var(--ink-soft);
  font-weight: 650;
}

.menu-version {
  margin: 20px 0 0;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Visionneuse photo ---------- */

.image-viewer-dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #0b0f0c;
  color: #f4f0e3;
}

.image-viewer-dialog[open] {
  display: grid;
  /* Sans taille de piste, la ligne prend la hauteur de l'image et `height: 100%`
     sur l'img ne se rapporte plus a l'ecran : la photo est coupee en plein ecran.
     Les deux minmax(0, 1fr) bornent la piste a la place disponible. */
  grid-template-rows: minmax(0, 1fr);
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
}

.image-viewer-dialog img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.image-viewer-close {
  position: fixed;
  z-index: 2;
  top: calc(14px + env(safe-area-inset-top));
  right: calc(14px + env(safe-area-inset-right));
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  place-items: center;
  color: #fff;
  background: rgba(12, 18, 13, 0.64);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.image-viewer-close .icon {
  width: 20px;
  height: 20px;
}

/* ---------- Small dialogs ---------- */

.confirm-dialog,
.info-dialog {
  width: min(430px, calc(100vw - 32px));
  max-width: none;
  margin: auto;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-modal);
  color: var(--ink);
}

.confirm-dialog[open],
.info-dialog[open] {
  display: block;
}

.confirm-dialog h2,
.info-dialog h2 {
  margin: 8px 0 10px;
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.confirm-dialog p:not(.eyebrow),
.info-dialog p:not(.eyebrow) {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.65;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 24px;
}

.confirm-actions .secondary-button,
.confirm-actions .danger-button {
  width: auto;
  min-height: 42px;
}

.install-steps {
  display: grid;
  gap: 11px;
  margin: 18px 0;
  padding-left: 20px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.6;
}

.install-steps strong {
  color: var(--ink);
  font-weight: 650;
}

.info-dialog .primary-button {
  margin-top: 20px;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  z-index: 100;
  bottom: calc(92px + env(safe-area-inset-bottom));
  left: 50%;
  display: flex;
  width: max-content;
  max-width: min(92vw, 520px);
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-float);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast-text {
  min-width: 0;
}

.toast-action {
  flex: none;
  padding: 4px 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
  opacity: 0.85;
  /* Le toast ignore les clics : le bouton doit les reprendre. */
  pointer-events: auto;
}

.toast-action:hover {
  background: rgba(255, 255, 255, 0.14);
  opacity: 1;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast--error {
  background: var(--danger);
  color: #fff8f6;
}

@media (prefers-color-scheme: dark) {
  .toast--error {
    color: #2a1210;
  }
}

.noscript {
  position: fixed;
  z-index: 200;
  inset: auto 16px 16px;
  padding: 14px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  text-align: center;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    min-height: auto;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: calc(18px + env(safe-area-inset-top)) 22px 18px;
  }

  .auth-pitch,
  .auth-points,
  .auth-visual-foot {
    display: none;
  }

  .auth-visual::before {
    top: -130px;
    right: -90px;
    width: 250px;
    height: 250px;
    border-radius: 30px;
  }

  .auth-visual::after {
    display: none;
  }

  .auth-panel {
    align-items: flex-start;
    padding: 30px 22px calc(44px + env(safe-area-inset-bottom));
  }

  .auth-card {
    margin: 0 auto;
  }

  .auth-card h2 {
    font-size: 37px;
  }

  .auth-intro {
    margin-bottom: 23px;
  }
}

@media (max-width: 560px) {
  .topbar {
    min-height: 58px;
    padding: calc(8px + env(safe-area-inset-top)) 13px 8px 16px;
  }

  .brand {
    gap: 8px;
    font-size: 17px;
  }

  .brand img {
    width: 29px;
    height: 29px;
    border-radius: 8px;
  }

  .sync-pill {
    min-height: 31px;
    padding: 0 9px;
  }

  .sync-label {
    display: none;
  }

  .sync-pill[data-status="error"],
  .sync-pill[data-status="auth"] {
    padding-right: 11px;
  }

  .icon-button {
    width: 37px;
    height: 37px;
  }

  .workspace-inner {
    padding: 24px 13px calc(92px + env(safe-area-inset-bottom));
  }

  .hero {
    margin-bottom: 20px;
  }

  .hero h1 {
    margin-top: 7px;
    font-size: 34px;
  }

  .hero-subtitle {
    font-size: 12px;
  }

  .search-wrap {
    height: 44px;
    border-radius: 12px;
  }

  .toolbar {
    margin-top: 16px;
  }

  .tabs {
    width: 100%;
  }

  .tab {
    flex: 1;
    justify-content: center;
    gap: 5px;
    padding: 0 6px;
  }

  .toolbar {
    flex-wrap: wrap;
  }

  .toolbar .text-button--danger {
    margin-left: auto;
    font-size: 11px;
  }

  .notes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .note {
    min-height: 124px;
    padding: 14px 11px 10px;
    border-radius: 14px;
  }

  .note-title {
    margin-right: 23px;
    font-size: 14px;
  }

  .note-body {
    font-size: 12px;
    line-height: 1.5;
    -webkit-line-clamp: 5;
  }

  .note--untitled .note-body {
    font-size: 13px;
    -webkit-line-clamp: 7;
  }

  .note-foot {
    padding-top: 12px;
    font-size: 8px;
  }

  .note-pin {
    top: 4px;
    right: 4px;
    width: 29px;
    height: 29px;
  }

  .section-title {
    margin-bottom: 9px;
  }

  .notes-section {
    margin-top: 23px;
  }

  .empty-state {
    padding: 34px 18px;
  }

  .empty-state h2 {
    font-size: 25px;
  }

  .app-footer {
    margin-top: 40px;
    font-size: 8px;
  }

  .footer-sep {
    display: none;
  }

  .fab {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    right: 16px;
    bottom: calc(18px + env(safe-area-inset-bottom));
  }

  .fab .icon {
    width: 23px;
    height: 23px;
  }

  .banner {
    font-size: 11px;
  }

  .banner--auth {
    flex-wrap: wrap;
  }

  .banner-action {
    margin-left: 25px;
  }

  .menu-panel {
    width: min(94vw, 380px);
    padding-left: 19px;
    padding-right: 19px;
  }

  .editor-main {
    padding: 4px 18px 14px;
  }

  .editor-title {
    padding-top: 10px;
    font-size: 24px;
  }

  .editor-tools {
    gap: 8px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .palette {
    gap: 6px;
  }

  .swatch {
    width: 23px;
    height: 23px;
  }

  .tool-button {
    min-width: 37px;
    height: 37px;
    padding: 0 6px;
  }

  .tool-button--label {
    padding: 0 8px;
    font-size: 10.5px;
  }

  .tool-button--label .icon {
    display: none;
  }

  .editor-actions {
    gap: 0;
  }

  .toast {
    bottom: calc(84px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 380px) {
  .sync-pill {
    display: none;
  }

  .auth-card h2 {
    font-size: 34px;
  }

  .note {
    min-height: 118px;
  }

  .note-body {
    -webkit-line-clamp: 4;
  }

  .tab {
    font-size: 10.5px;
  }

  .tab-count {
    display: none;
  }
}

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

/* -------------------------------------------------------------------------- */
/* Mots de passe                                                              */
/* -------------------------------------------------------------------------- */

.vault-shortcut {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  margin: 0 0 14px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-elevated);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s;
}

.vault-shortcut:hover,
.vault-shortcut:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.vault-shortcut-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}

.vault-shortcut-icon .icon {
  width: 17px;
  height: 17px;
}

.vault-shortcut-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.vault-shortcut-copy strong {
  font-size: 13px;
  font-weight: 700;
}

.vault-shortcut-copy small {
  color: var(--ink-soft);
  font-size: 10px;
}

.vault-shortcut-arrow {
  color: var(--ink-faint);
  font-size: 22px;
  line-height: 1;
}

.vault-dialog {
  width: min(560px, calc(100vw - 28px));
  max-height: 88dvh;
  padding: 20px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-elevated);
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(20, 30, 23, 0.28);
}

.vault-dialog::backdrop {
  background: rgba(20, 30, 23, 0.45);
  backdrop-filter: blur(3px);
}

.vault-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.vault-head h2 {
  margin: 3px 0 0;
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.vault-intro {
  margin: 9px 0 16px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.5;
}

.vault-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.vault-count {
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.vault-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vault-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}

.vault-entry-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.vault-entry-label {
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vault-entry-user {
  overflow: hidden;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vault-entry-secret {
  grid-column: 1 / -1;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.vault-entry-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.vault-entry-actions button {
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg-elevated);
  color: var(--ink-soft);
  font: inherit;
  font-size: 9.5px;
  font-weight: 650;
  cursor: pointer;
}

.vault-entry-actions button:hover,
.vault-entry-actions button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.vault-entry-actions .vault-delete {
  color: var(--danger);
}

.vault-empty {
  margin: 10px 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.vault-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.vault-form .field {
  margin-bottom: 9px;
}

.vault-secret-field {
  position: relative;
  display: flex;
  align-items: center;
}

.vault-secret-field input {
  padding-right: 68px;
}

.vault-inline-button {
  position: absolute;
  right: 7px;
  min-height: 26px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--ink-soft);
  font: inherit;
  font-size: 9px;
  cursor: pointer;
}

.vault-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

@media (max-width: 560px) {
  .vault-dialog {
    width: calc(100vw - 18px);
    padding: 16px;
  }

  .vault-entry {
    grid-template-columns: 1fr;
  }

  .vault-entry-actions {
    justify-content: flex-start;
  }
}

/* oeil centre verticalement dans le champ */
.password-toggle {
  top: 50% !important;
  transform: translateY(-50%) !important;
  bottom: auto !important;
}

/* -------------------------------------------------------------------------- */
/* A4.4 — composants alignés sur commun/theme.css                             */
/* -------------------------------------------------------------------------- */

/* En-tête : barre blanche de la suite, sans dégradé ni police serif. */
.topbar {
  top: 10px;
  width: min(100% - 24px, 900px);
  min-height: 56px;
  margin: 0 auto;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.brand { color: var(--ink); font-size: 16px; font-weight: 700; letter-spacing: 0; }
.brand img { width: 30px; height: 30px; border-radius: 8px; box-shadow: none; }
.sync-pill {
  border-color: var(--line);
  background: var(--bg-elevated);
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
}
.workspace-inner { width: min(100%, 900px); padding: 22px 0 76px; }

/* Titre de page : même échelle que les autres pages de la suite. */
.hero { margin-bottom: 18px; }
.hero h1 {
  margin: 4px 0 6px;
  font-family: var(--font-sans);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.3;
}
.hero .eyebrow { color: var(--accent); font-size: 0.72rem; }
.hero-subtitle { color: var(--ink-soft); font-size: 0.93rem; }

/* Recherche, onglets, boutons : les champs et les pastilles du thème. */
.search-wrap {
  width: 100%;
  max-width: none;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--bg-elevated);
  box-shadow: none;
}
.search-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
.toolbar { margin-top: 14px; }
.tabs { padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-elevated); }
.tab { min-height: 32px; padding: 0 14px; border-radius: 999px; color: var(--ink-soft); font-size: 0.9rem; font-weight: 600; }
.tab.is-active { background: var(--accent); color: #fff; }
.tab-count { font-family: var(--font-sans); font-size: 0.78em; opacity: 0.8; }
.text-button { font-size: 0.9rem; font-weight: 600; }

/* Cartes : blanches, même rayon et même ombre que les cartes de la suite. */
.notes-section { margin-top: 24px; }
.section-title {
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.note { border-radius: 12px; box-shadow: var(--shadow-card); }
.note:hover { transform: none; box-shadow: 0 4px 14px rgba(28, 43, 33, 0.1); }
.note-title { font-size: 1rem; font-weight: 650; }
.note-body, .note-task { font-size: 0.9rem; }
.note-body { opacity: 0.82; }
.note-foot { font-family: var(--font-sans); font-size: 0.72rem; letter-spacing: 0; text-transform: none; opacity: 0.6; }

/* Coffre à mots de passe : même carte que le reste. */
.vault-shortcut {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-card);
}
.vault-shortcut:hover { border-color: var(--accent); background: var(--accent-soft); }
.vault-shortcut-copy strong { font-size: 0.98rem; }
.vault-shortcut-copy small { color: var(--ink-soft); font-size: 0.82rem; }
.vault-dialog { border-color: var(--line); border-radius: 14px; box-shadow: var(--shadow-modal); }
.vault-dialog::backdrop,
.editor-dialog::backdrop,
dialog::backdrop { background: rgba(28, 43, 33, 0.35); -webkit-backdrop-filter: none; backdrop-filter: none; }
.vault-head h2 { font-family: var(--font-sans); font-size: 1.25rem; font-weight: 700; letter-spacing: 0; }
.vault-intro, .vault-empty { font-size: 0.92rem; }
.vault-count { font-family: var(--font-sans); font-size: 0.75rem; letter-spacing: 0; text-transform: none; }
.vault-entry { border-color: var(--line); border-radius: 10px; background: var(--bg-soft); }
.vault-entry-label { font-size: 0.95rem; }
.vault-entry-user, .vault-entry-secret { font-family: var(--font-sans); font-size: 0.82rem; }

/* Éditeur : plein écran conservé (geste Keep), avec les champs du thème. */
.editor-dialog { background: var(--note-bg); color: var(--note-ink); }
#editor-title {
  width: 100%;
  margin: 0;
  padding: 8px 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0;
}
#editor-title:focus { border-color: transparent; outline: none; box-shadow: none; }
#editor-body-input { padding: 8px 0 20px; border: 0; border-radius: 0; background: transparent; font-size: 1rem; }
.editor-bar { border-bottom-color: var(--note-line); }
.editor-status { font-family: var(--font-sans); font-size: 0.75rem; letter-spacing: 0; text-transform: none; opacity: 0.55; }

/* Menu latéral. */
.menu-panel {
  width: min(92vw, 400px);
  border-left-color: var(--line);
  background: var(--bg-elevated);
  box-shadow: -16px 0 44px rgba(28, 43, 33, 0.16);
}
.menu-head h2 { font-family: var(--font-sans); font-size: 1.25rem; font-weight: 700; letter-spacing: 0; }
.menu-sync-card { margin: 18px 0 14px; border-color: #c4ddc9; border-radius: 10px; background: var(--accent-soft); }
.menu-sync-card strong { font-size: 0.95rem; }
.menu-sync-card span:not(.menu-sync-dot) { font-family: var(--font-sans); font-size: 0.78rem; letter-spacing: 0; text-transform: none; }
.menu-item { min-height: 44px; border-radius: 8px; font-size: 0.95rem; }
.menu-security p { font-size: 0.82rem; }
.menu-version { font-family: var(--font-sans); font-size: 0.75rem; letter-spacing: 0; text-transform: none; }

/* Messages, confirmations, partage. */
.banner { margin-top: 12px; border-radius: 10px; background: var(--bg-elevated); font-size: 0.88rem; }
.banner--offline { background: #fdf4e3; border-color: #e6cfa4; }
.banner--error, .banner--auth { background: var(--danger-soft); border-color: #e5b4b0; }
.confirm-dialog, .info-dialog { border-radius: 14px; }
.confirm-dialog h2, .info-dialog h2 { font-family: var(--font-sans); font-size: 1.2rem; font-weight: 700; letter-spacing: 0; }
.confirm-dialog p:not(.eyebrow), .info-dialog p:not(.eyebrow) { font-size: 0.92rem; }
.toast { border-radius: 12px; background: var(--ink); color: var(--bg-elevated); font-size: 0.9rem; }

/* Pied de page et bouton flottant. */
.app-footer {
  margin-top: 40px;
  border-top-color: var(--line);
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0;
  text-transform: none;
}
.fab {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 8px 22px rgba(46, 125, 50, 0.3);
}
.fab:hover { background: var(--accent-strong); box-shadow: 0 10px 26px rgba(46, 125, 50, 0.34); }

/* Boutons du thème partout (les composants gardent leur gabarit). */
.primary-button { border-radius: 10px; background: var(--accent); color: var(--on-accent); font-weight: 600; }
.primary-button:hover { background: var(--accent-strong); }
.secondary-button { border: 1px solid #b9d4bd; border-radius: 10px; background: var(--bg-elevated); color: var(--accent); }
.danger-button { border-radius: 10px; }

@media (max-width: 560px) {
  .hero h1 { font-size: 1.3rem; }
  .workspace-inner { padding: 16px 16px 76px; }
  .topbar { top: 8px; width: calc(100% - 24px); min-height: 52px; padding: calc(7px + env(safe-area-inset-top)) 12px 7px; border-radius: 12px; }
  .sync-pill { font-size: 10px; padding: 0 9px; gap: 5px; }
  /* A4.2 : le témoin de synchronisation reste lisible sur téléphone. */
  .sync-label { display: inline; }
  .note { min-height: 120px; }
}

/* A4.4 : à 375 px, le témoin de synchronisation reste visible (A4.2). */
@media (max-width: 380px) {
  .sync-pill { display: inline-flex; }
}

/* A4.4 : sur téléphone, la palette et les actions de l'éditeur passent sur deux
   lignes plutôt que de couper la septième couleur. */
@media (max-width: 560px) {
  .editor-tools { flex-wrap: wrap; gap: 8px; }
  /* D14 — les actions (dont l'appareil photo) passent au-dessus de la palette :
     sur un écran de téléphone, la deuxième ligne était sous la barre de
     navigation et l'appareil photo devenait inaccessible. */
  .editor-actions { order: -1; flex: 1 1 100%; justify-content: flex-start; }
  .palette { flex: 1 1 100%; }
}
