@font-face { font-family: 'Geist'; src: url('fonts/Geist-Variable.woff2') format('woff2'); font-weight: 100 900; font-style: normal; }
@font-face { font-family: 'Geist'; src: url('fonts/Geist-Italic.woff2') format('woff2'); font-weight: 100 900; font-style: italic; }
@font-face { font-family: 'Geist Mono'; src: url('fonts/GeistMono-Variable.woff2') format('woff2'); font-weight: 100 900; }
:root {
  --bg: #ffffff;
  --side: rgba(247, 246, 243, 0.82);
  --text: #2f2e2b;
  --muted: #8a877f;
  --line: #ebe9e4;
  --hover: rgba(55, 53, 47, 0.06);
  --active: rgba(55, 53, 47, 0.1);
  --card: #faf9f7;
  --accent: #3b5bdb;
  --accent-ink: #ffffff;
  --accent-soft: rgba(59, 91, 219, 0.12);
  --serif: 'Geist', -apple-system, sans-serif;
  --danger: #d4473c;
  --ok: #3f8a5a;
  --shadow: 0 10px 30px rgba(15, 15, 15, 0.12), 0 0 0 1px rgba(15, 15, 15, 0.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f1f1e;
    --side: rgba(36, 35, 33, 0.82);
    --text: #e9e7e2;
    --muted: #9b978e;
    --line: #34332f;
    --hover: rgba(255, 255, 255, 0.06);
    --active: rgba(255, 255, 255, 0.1);
    --card: #262624;
    --accent: #8ea2ff;
    --accent-ink: #15161c;
    --accent-soft: rgba(142, 162, 255, 0.16);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
  color: var(--text);
  background: transparent;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
}
input, textarea, select, button { font: inherit; color: inherit; }
textarea, input { user-select: text; }
button { cursor: default; }
[hidden] { display: none !important; }
code, .mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; }
kbd { font: 12px ui-monospace, Menlo, monospace; padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; }

.dragbar { position: fixed; top: 0; left: 0; right: 0; height: 38px; -webkit-app-region: drag; z-index: 1; }
.dragbar ~ * button, .dragbar ~ * input { -webkit-app-region: no-drag; }

/* ---------- Écrans centrés ---------- */
.screen { height: 100%; }
.center { display: grid; place-items: center; background: var(--bg); padding: 40px 20px; overflow: auto; }
.card { width: 100%; max-width: 420px; text-align: center; }
.welcome { max-width: 440px; }
.stack { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.lockcard { align-items: stretch; text-align: center; }
h1 { font-size: 28px; font-weight: 700; margin: 8px 0 2px; letter-spacing: -0.02em; }
h2 { font-size: 18px; margin: 0; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 22px 0 8px; font-weight: 600; }
.muted { color: var(--muted); margin: 0 0 18px; }
.hint { font-size: 12.5px; color: var(--muted); margin: 0; }
.hint.warn { color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.error { color: var(--danger); font-size: 13px; margin: 0; }
.pad { padding: 8px 12px; }
.small { font-size: 12px; }
label { font-size: 13px; font-weight: 500; display: flex; flex-direction: column; gap: 5px; }

.logo {
  width: 64px; height: 64px; margin: 0 auto; border-radius: 18px;
  background:
    radial-gradient(circle at 36% 46%, #2f2e2b 0 3px, transparent 3.5px),
    radial-gradient(circle at 64% 46%, #2f2e2b 0 3px, transparent 3.5px),
    radial-gradient(ellipse at 50% 62%, #3b2a1e 0 4px, transparent 4.5px),
    radial-gradient(ellipse at 50% 64%, #f3dcc0 0 12px, transparent 12.5px),
    radial-gradient(circle at 24% 26%, #8b5a33 0 6px, transparent 6.5px),
    radial-gradient(circle at 76% 26%, #8b5a33 0 6px, transparent 6.5px),
    radial-gradient(ellipse at 50% 55%, #b5773f 0 24px, transparent 24.5px),
    linear-gradient(160deg, #f7e9d7, #ecd2b2);
  box-shadow: 0 6px 18px rgba(181, 101, 43, 0.25);
}

input[type='password'], input[type='text'], input[type='search'], input:not([type]), select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }

.primary, .ghost {
  padding: 9px 14px; border-radius: 8px; border: 1px solid transparent; font-weight: 600; white-space: nowrap;
}
.primary { background: var(--accent); color: var(--accent-ink); }
.primary:hover { filter: brightness(1.05); }
.primary:disabled { opacity: 0.6; }
.ghost { background: transparent; border-color: var(--line); font-weight: 500; }
.ghost:hover { background: var(--hover); }
.link { background: none; border: 0; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }

.tabs { display: flex; gap: 4px; background: var(--card); border: 1px solid var(--line); padding: 3px; border-radius: 10px; margin-bottom: 16px; }
.tab { flex: 1; padding: 7px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; }
.tab.active { background: var(--bg); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }

.meter { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: -4px; }
#meter-bar { height: 100%; width: 0; transition: width 0.2s, background 0.2s; background: var(--danger); }
#meter-bar[data-score='2'] { background: #d99a2b; }
#meter-bar[data-score='3'], #meter-bar[data-score='4'] { background: var(--ok); }

.path-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.label { font-size: 12px; color: var(--muted); }
.path { font: 12px ui-monospace, Menlo, monospace; color: var(--muted); word-break: break-all; margin: 0; user-select: text; }

/* ---------- Application ---------- */
#app { display: grid; grid-template-columns: 250px 1fr; }
#sidebar {
  background: var(--side);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 44px 8px 10px;
  min-height: 0;
}
.side-top { padding: 0 4px 8px; }
#search { padding: 6px 10px; font-size: 13.5px; background: var(--hover); border-color: transparent; }
#page-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; padding: 2px 0; }
.page-item, .side-btn {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 5px 10px; border: 0; border-radius: 6px; background: transparent; text-align: left; font-size: 14px;
}
.page-item:hover, .side-btn:hover { background: var(--hover); }
.page-item.active { background: var(--active); font-weight: 600; }
.pi-icon { width: 20px; text-align: center; flex: none; }
.pi-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-btn { color: var(--muted); }
.side-bottom { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 6px; }

#main { background: var(--bg); overflow-y: auto; position: relative; }
.topbar { position: sticky; top: 0; height: 38px; background: var(--bg); z-index: 2; }
.empty { display: grid; place-items: center; height: 70%; color: var(--muted); }

#page { max-width: 760px; margin: 0 auto; padding: 40px 64px 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; }
.page-icon { font-size: 52px; line-height: 1; background: none; border: 0; padding: 4px; border-radius: 8px; }
.page-icon:hover { background: var(--hover); }
.page-icon.placeholder { opacity: 0.35; }
.page-title {
  width: 100%; border: 0; outline: none; resize: none; overflow: hidden; background: transparent;
  font-size: 38px; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; margin: 8px 0 14px; padding: 0;
}
.page-title::placeholder { color: var(--line); }
.icon-btn { background: none; border: 0; border-radius: 6px; padding: 3px 7px; color: var(--muted); font-size: 15px; line-height: 1.2; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.on { color: var(--accent); }
.page-tail { min-height: 40vh; cursor: text; }

/* ---------- Blocs ---------- */
.block { position: relative; display: flex; align-items: flex-start; margin: 1px 0 1px -28px; padding: 1px 0; }
.handle {
  width: 24px; flex: none; margin-right: 4px; margin-top: 4px; padding: 2px 0;
  border: 0; background: none; color: var(--muted); font-size: 12px; letter-spacing: -2px; border-radius: 4px;
  opacity: 0; cursor: grab; transition: opacity 0.1s;
}
.block:hover .handle, .block:focus-within .handle { opacity: 0.6; }
.handle:hover { background: var(--hover); opacity: 1 !important; }
.block-body { flex: 1; min-width: 0; }
.block.dragging { opacity: 0.4; }
.block.drop-before { box-shadow: 0 -2px 0 var(--accent); }
.block.drop-after { box-shadow: 0 2px 0 var(--accent); }

.block textarea.text, .block textarea.heading {
  display: block; width: 100%; border: 0; outline: none; resize: none; overflow: hidden; background: transparent; padding: 3px 2px;
}
.block textarea.heading { font-size: 22px; font-weight: 650; margin-top: 14px; letter-spacing: -0.01em; }
.block textarea::placeholder { color: transparent; }
.block textarea:focus::placeholder { color: var(--muted); opacity: 0.7; }
.block-divider hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.block-divider .handle { margin-top: 6px; }

.card-block { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 8px 10px 6px; margin: 6px 0; }
.card-head { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.card-icon { font-size: 14px; }
.card-label { border: 0 !important; background: transparent !important; padding: 2px 4px !important; font-weight: 600; box-shadow: none !important; }
.card-label::placeholder { color: var(--muted); font-weight: 500; }
.field { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding: 3px 0; }
.field-label { width: 104px; flex: none; font-size: 12.5px; color: var(--muted); padding-left: 4px; }
.field-input { flex: 1; border: 0 !important; background: transparent !important; padding: 5px 4px !important; box-shadow: none !important; min-width: 0; }
.field-input:focus { background: var(--hover) !important; border-radius: 6px; }
.field-tools { display: flex; gap: 1px; opacity: 0.55; }
.field:hover .field-tools, .field:focus-within .field-tools { opacity: 1; }

/* ---------- Popover / menus ---------- */
.popover { position: fixed; z-index: 50; background: var(--bg); border-radius: 10px; box-shadow: var(--shadow); padding: 5px; min-width: 200px; max-width: 320px; }
.menu, .slash { display: flex; flex-direction: column; }
.menu-item, .slash-item { display: flex; align-items: center; gap: 10px; text-align: left; border: 0; background: none; padding: 6px 10px; border-radius: 6px; font-size: 14px; }
.menu-item:hover:not(:disabled), .slash-item:hover, .slash-item.active { background: var(--hover); }
.menu-item:disabled { opacity: 0.35; }
.menu-item.danger { color: var(--danger); }
.slash-title { font-size: 11.5px; color: var(--muted); padding: 4px 10px 6px; }
.slash-icon { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: var(--card); font-weight: 700; flex: none; }
.slash-item small { display: block; color: var(--muted); font-size: 12px; }
.emoji-grid { display: grid; grid-template-columns: repeat(6, 36px); gap: 2px; }
.emoji-grid button { font-size: 20px; border: 0; background: none; border-radius: 6px; height: 36px; }
.emoji-grid button:hover { background: var(--hover); }
.emoji-grid .wide { grid-column: 1 / -1; font-size: 13px; color: var(--muted); height: 30px; }

/* ---------- Réglages ---------- */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); display: grid; place-items: center; z-index: 40; }
.modal-card { background: var(--bg); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 60px); overflow-y: auto; border-radius: 14px; box-shadow: var(--shadow); padding: 20px 24px 24px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row input { flex: 1; min-width: 160px; }
.row select { width: auto; }
#settings .hint { margin-top: 6px; }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60;
  background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px; font-size: 13px; box-shadow: var(--shadow);
}
#set-path { margin-bottom: 10px; }

/* ---------- Accueil minimaliste ---------- */
.mini { width: 100%; max-width: 300px; display: flex; flex-direction: column; align-items: stretch; gap: 12px; text-align: center; }
.mini .logo { box-shadow: none; transform: scale(0.8); margin-bottom: -6px; }
.mini h1 { font-size: 22px; font-weight: 600; margin: 0 0 14px; }
.mini input { text-align: center; padding: 11px 12px; border-radius: 10px; }
.mini .meter { margin: -6px 6px 0; height: 2px; background: transparent; }
.mini .primary { padding: 10px; border-radius: 10px; }
.mini-links { display: flex; justify-content: center; gap: 8px; color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.mini-links .link { text-decoration: none; font-size: 12.5px; padding: 0; }
.mini-links .link:hover { color: var(--text); }
.mini .path { text-align: center; }
.mini { max-width: 260px; gap: 22px; }
.mini .logo { margin-bottom: 0; }
.mini .logo.touch { cursor: pointer; }
.mini input { border-color: transparent; background: var(--card); }
.mini input:disabled { opacity: 0.5; }
.mini .error { font-size: 12.5px; margin-top: -10px; }
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding-left: 40px !important; padding-right: 40px !important; }
.pw-wrap .eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; display: grid; place-items: center;
  border: 0; border-radius: 6px; background: none; color: var(--muted); opacity: 0.7;
}
.pw-wrap .eye:hover { opacity: 1; background: var(--hover); }
.pw-wrap.shown .eye .slash { display: none; }
.pw-wrap.shown .eye { color: var(--accent); opacity: 1; }

/* ---------- Bloc Champ : nom · valeur ---------- */
.block-field .handle { margin-top: 5px; }
.f-row {
  display: grid; grid-template-columns: minmax(90px, 150px) 1fr auto; align-items: center; gap: 10px;
  padding: 2px 6px; margin: 1px 0; border-radius: 6px;
}
.f-row:hover, .f-row:focus-within { background: var(--hover); }
.f-row input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 4px 0 !important; min-width: 0; width: 100%; border-radius: 0; }
.f-label { color: var(--muted); font-size: 14px; }
.f-label::placeholder, .f-value::placeholder { color: var(--muted); opacity: 0.45; }
.f-value { font-size: 15px; }
.f-row.blurred .f-value { filter: blur(5px); cursor: pointer; transition: filter 0.15s; user-select: none; }
.f-tools { display: flex; gap: 2px; opacity: 0; transition: opacity 0.1s; }
.f-row:hover .f-tools, .f-row:focus-within .f-tools { opacity: 1; }
.f-btn { width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 5px; background: none; color: var(--muted); }
.f-btn:hover { color: var(--text); background: var(--active); }
.f-row.blurred .f-tools .f-btn:first-child { color: var(--accent); }
.touch-btn {
  align-self: center; display: inline-flex; align-items: center; gap: 7px;
  border: 0; background: none; color: var(--muted); font-size: 13px; padding: 6px 12px; border-radius: 8px; margin-top: -8px;
}
.touch-btn:hover { color: var(--accent); background: var(--hover); }


/* =========================================================
   Éditeur v2 : texte riche, gouttière, sélection de blocs
   ========================================================= */
#page { padding: 28px 72px 0; max-width: 780px; }
.page-title { font-family: var(--serif); font-weight: 650; font-size: 40px; letter-spacing: -0.015em; }

.block { margin: 0 0 0 -52px; padding: 1px 0; border-radius: 6px; position: relative; }
.gutter { width: 48px; flex: none; display: flex; justify-content: flex-end; gap: 0; padding-top: 3px; margin-right: 4px; opacity: 0; transition: opacity 0.12s; }
.block:hover .gutter, .block.selected .gutter { opacity: 1; }
.g-btn { width: 22px; height: 24px; display: grid; place-items: center; border: 0; background: none; border-radius: 4px; color: var(--muted); padding: 0; cursor: pointer; }
.g-btn:hover { background: var(--hover); color: var(--text); }
.g-btn.handle { cursor: grab; }
.ico { display: inline-grid; place-items: center; line-height: 0; }
.block-body { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.block-divider .gutter, .block-field .gutter { padding-top: 4px; }

/* Sélection de blocs */
.block.selected .block-body { background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent-soft); border-radius: 4px; }
.marquee { position: fixed; z-index: 30; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 3px; pointer-events: none; }

/* Texte riche */
.rt { flex: 1; min-width: 0; outline: none; white-space: pre-wrap; word-break: break-word; padding: 3px 2px; line-height: 1.6; caret-color: var(--accent); cursor: text; user-select: text; }
.rt:empty::before { content: attr(data-placeholder); color: var(--muted); opacity: 0; pointer-events: none; }
.rt:focus:empty::before, .rt-heading:empty::before, .rt-bullet:empty::before, .rt-todo:empty::before { opacity: 0.55; }
.rt-heading { font-family: var(--serif); font-size: 24px; font-weight: 650; line-height: 1.3; margin-top: 18px; letter-spacing: -0.01em; }
.block-heading .gutter { padding-top: 24px; }
.rt strong { font-weight: 650; }
.rt code { font: 0.88em ui-monospace, 'SF Mono', Menlo, monospace; background: var(--hover); border: 1px solid var(--line); border-radius: 4px; padding: 0.05em 0.3em; color: var(--accent); }
.rt .blur { filter: blur(5px); border-radius: 3px; background: var(--hover); cursor: pointer; transition: filter 0.18s ease; }
.rt.revealed .blur { filter: none; background: transparent; box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--accent) 60%, transparent); cursor: text; }
.rt::selection, .rt *::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }

.bullet { width: 18px; flex: none; display: grid; place-items: center; height: 1.6em; margin-top: 3px; }
.bullet::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--text); opacity: 0.8; }
.todo-box { width: 17px; height: 17px; flex: none; margin: 6px 1px 0 0; border: 1.5px solid var(--muted); border-radius: 4px; background: none; color: transparent; padding: 0; display: grid; place-items: center; cursor: pointer; transition: background 0.12s, border-color 0.12s; }
.todo-box.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.rt.done { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 70%, transparent); }

/* Barre de mise en forme (apparaît sur une sélection de texte) */
.fmtbar { position: fixed; z-index: 55; display: flex; align-items: center; gap: 2px; padding: 4px; background: var(--bg); border-radius: 9px; box-shadow: var(--shadow); }
.fmt { height: 28px; min-width: 30px; padding: 0 8px; border: 0; border-radius: 6px; background: none; color: var(--text); font-size: 13.5px; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.fmt:hover { background: var(--hover); }
.fmt.on { color: var(--accent); background: var(--accent-soft); }
.fmt-b { font-weight: 800; }
.fmt-i { font-style: italic; font-family: var(--serif); font-size: 15px; }
.fmt-s { text-decoration: line-through; }
.fmt-c { font: 12px ui-monospace, Menlo, monospace; }
.fmt-sep { width: 1px; height: 18px; background: var(--line); margin: 0 3px; }
.fmt-h-sample { filter: blur(2.2px); font-weight: 600; letter-spacing: 0.02em; }

/* Menus */
.menu-item { justify-content: space-between; gap: 18px; }
.menu-item kbd { border: 0; color: var(--muted); font-size: 11.5px; padding: 0; }
.slash { min-width: 210px; }
.slash-item { padding: 5px 8px; }
.slash-icon { width: 28px; height: 28px; font-size: 13px; }

/* Champs : aligner sur le texte */
.f-row { margin-left: -6px; }
.gutter .handle { opacity: 1; margin: 0; width: 22px; padding: 0; letter-spacing: 0; font-size: inherit; }
.toast { bottom: 84px; }


/* =========================================================
   v3 : police Geist, tailles, couleurs, flou au survol
   ========================================================= */
body { font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif; font-feature-settings: 'ss01', 'cv11'; }
code, .mono, kbd, .path { font-family: 'Geist Mono', ui-monospace, Menlo, monospace; }
.rt code { font-family: 'Geist Mono', ui-monospace, Menlo, monospace; }
.page-title { font-family: 'Geist', sans-serif; font-weight: 700; font-size: 38px; letter-spacing: -0.035em; line-height: 1.15; }

.rt { font-size: 15.5px; letter-spacing: -0.005em; }
.rt.size-l { font-size: 25px; font-weight: 650; letter-spacing: -0.025em; line-height: 1.3; margin-top: 14px; }
.rt.size-s { font-size: 13px; color: var(--muted); line-height: 1.55; }
.block:has(.size-l) .gutter { padding-top: 20px; }
.block:has(.size-s) .gutter { padding-top: 1px; }

/* Flou : toujours flouté, net seulement au survol */
.rt .blur { filter: blur(5px); background: var(--hover); border-radius: 3px; cursor: default; transition: filter 0.15s ease; }
.rt .blur:hover { filter: none; background: transparent; }
.f-row.blurred .f-value { filter: blur(5px); cursor: default; user-select: auto; transition: filter 0.15s ease; }
.f-row.blurred .f-value:hover, .f-row.blurred .f-value:focus { filter: none; }

/* Couleurs du texte */
:root { --c-gray: #8b8a85; --c-red: #e03e3e; --c-orange: #d9730d; --c-yellow: #c29200; --c-green: #2f9e6a; --c-blue: #3b6fe0; --c-purple: #8b5cf6; --c-pink: #d6409f; }
@media (prefers-color-scheme: dark) {
  :root { --c-gray: #9b9a95; --c-red: #ff7b72; --c-orange: #ffa657; --c-yellow: #f2cc60; --c-green: #56d38c; --c-blue: #7aa2ff; --c-purple: #b794ff; --c-pink: #ff7ac6; }
}
.col-gray { color: var(--c-gray); } .col-red { color: var(--c-red); } .col-orange { color: var(--c-orange); } .col-yellow { color: var(--c-yellow); }
.col-green { color: var(--c-green); } .col-blue { color: var(--c-blue); } .col-purple { color: var(--c-purple); } .col-pink { color: var(--c-pink); }
.col-default { color: var(--text); }

.fmt-k-a { font-weight: 700; padding: 0 1px 1px; background: linear-gradient(90deg, var(--c-red), var(--c-yellow), var(--c-green), var(--c-blue), var(--c-purple)) bottom / 100% 2px no-repeat; }
.palette { display: grid; grid-template-columns: repeat(9, 26px); gap: 3px; padding: 4px; }
.swatch { width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 6px; background: none; font-weight: 700; font-size: 13px; cursor: pointer; display: grid; place-items: center; }
.swatch:hover { background: var(--hover); }

/* Menu de bloc : puces de taille et de type */
.block-menu { min-width: 280px; }
.block-menu .palette { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 4px 0; padding: 8px 6px; }
.chips { display: flex; gap: 4px; padding: 6px; }
.chip { flex: 1; height: 30px; border: 1px solid var(--line); border-radius: 7px; background: none; font-size: 13px; cursor: pointer; padding: 0 6px; }
.chip:hover { background: var(--hover); }
.chip.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.size-chip.size-s { font-size: 11.5px; }
.size-chip.size-l { font-size: 14.5px; font-weight: 650; }

/* Barre latérale : réglages + bouton de verrouillage rouge */
.side-bottom { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 4px 2px; }
.side-bottom .side-btn { width: auto; flex: 1; gap: 8px; }
.lock-btn {
  width: 30px; height: 30px; flex: none; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 35% 30%, #ff7a70, #e5483d 60%, #c9362c);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), inset 0 0 0 0.5px rgba(0, 0, 0, 0.25);
  transition: transform 0.12s ease, filter 0.12s ease;
}
.lock-btn:hover { filter: brightness(1.08); transform: scale(1.06); }
.lock-btn:active { transform: scale(0.96); }
.lock-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.toast { bottom: 22px; background: var(--card); color: var(--text); border: 1px solid var(--line); font-size: 12.5px; padding: 7px 12px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18); }

/* Copié au clic */
:root { --flash: 0; }
::highlight(copied) { background-color: color-mix(in srgb, var(--accent) calc(var(--flash) * 26%), transparent); }
.rt .blur.copied { animation: copied 0.7s ease; }
.f-row.copied { animation: copied-row 1.05s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes copied { 0% { background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); } 100% { background: transparent; box-shadow: none; } }
@keyframes copied-row { 0% { background: transparent; } 12% { background: var(--accent-soft); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .rt .blur.copied, .f-row.copied { animation: none; } }

.rt .blur, .f-value, .f-label { cursor: text; }

/* =========================================================
   v4 : voile anti-capture, épingles, corbeille
   ========================================================= */
#app #main > *, #page-list { transition: filter 0.25s ease; }
body.veiled #app #main > *:not(.topbar), body.veiled #page-list { filter: blur(14px) saturate(0.6); }
body.veiled .fmtbar, body.veiled .popover { display: none !important; }
.veil-note {
  position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 70;
  display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
  font-size: 12.5px; color: var(--muted); -webkit-app-region: no-drag;
}
.veil-note button { border: 0; background: var(--hover); color: var(--text); font: inherit; padding: 5px 10px; border-radius: 7px; cursor: pointer; }
.veil-note button:hover { background: var(--active); }

/* Épingles */
.page-item { position: relative; }
.pi-title { flex: 1; }
.pi-pin { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 5px; color: var(--muted); opacity: 0; flex: none; transition: opacity 0.1s; }
.page-item:hover .pi-pin { opacity: 0.7; }
.pi-pin:hover { opacity: 1 !important; background: var(--active); color: var(--text); }
.pi-pin.on { opacity: 0.85; color: var(--accent); }
.pin-sep { height: 1px; background: var(--line); margin: 6px 10px; }

/* Corbeille */
.trash-btn { gap: 8px; }
.trash-btn.active { background: var(--active); color: var(--text); }
.trash-btn .count { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.trash-view { max-width: 720px; margin: 0 auto; padding: 28px 72px 60px; }
.trash-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.trash-head h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.035em; margin: 0; text-align: left; }
.trash-view > .hint { margin: 6px 0 22px; }
.trash-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 8px; border-bottom: 1px solid var(--line); }
.trash-row:hover { background: var(--hover); }
.trash-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.trash-info strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-info small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-row .ghost { padding: 5px 10px; font-size: 13px; }
.danger-ghost { color: var(--danger); }
.danger-ghost:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.trash-empty { color: var(--muted); padding: 30px 0; }
.veil-note { white-space: nowrap; }
.sync-on { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: #34c759; box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.18); }
.m-back { display: none; align-items: center; gap: 4px; border: 0; background: none; color: var(--accent); font: inherit; font-size: 16px; padding: 6px 8px; cursor: pointer; }
body:not(.web) .mac-only:not([hidden]) { }
body.web .mac-only { display: none !important; }

/* Bouton « Ouvrir » : affiché sur le téléphone (sur le Mac, Entrée suffit) */
.go-btn { display: none; }
body.web .go-btn {
  display: block; width: 100%; padding: 13px; margin-top: -8px; border: 0; border-radius: 12px;
  background: var(--accent); color: var(--accent-ink); font: inherit; font-size: 16px; font-weight: 600; cursor: pointer;
}
body.web .go-btn:active { filter: brightness(0.92); }
body.web .go-btn:disabled { opacity: 0.6; }
