/* ==========================================================================
   SOHRI · carnet de voyage — feuille de style
   Minimalisme japonais contemporain : papier washi, encre, vermillon (朱). Thèmes clair et sombre,
   polices et icônes dans l'appli (hors connexion). Sommaire : polices, couleurs, base, animations,
   squelette (en-tête, barre du bas), composants, puis chaque rubrique, et ce qui s'affiche par-dessus.
   ========================================================================== */

/* ---------- Polices (licence OFL : fonts/LICENSE-OFL.txt) ----------
   Latin et latin étendu ; les kanji de l'interface (sceaux, villes, météo) en Shippori Mincho ; le
   reste du japonais (phrases, adresses) avec les polices du téléphone. */
@font-face { font-family: "Zen Kaku Gothic New"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/zen-kaku-gothic-new-400-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Zen Kaku Gothic New"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/zen-kaku-gothic-new-400-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Zen Kaku Gothic New"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/zen-kaku-gothic-new-500-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Zen Kaku Gothic New"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/zen-kaku-gothic-new-500-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Zen Kaku Gothic New"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/zen-kaku-gothic-new-700-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Zen Kaku Gothic New"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/zen-kaku-gothic-new-700-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Shippori Mincho"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/shippori-mincho-500-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Shippori Mincho"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/shippori-mincho-500-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Shippori Mincho"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/shippori-mincho-600-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Shippori Mincho"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/shippori-mincho-600-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Shippori Mincho"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/shippori-mincho-700-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Shippori Mincho"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/shippori-mincho-700-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* Kanji de l'interface (sceaux, villes, météo) : un seul fichier, déclaré pour chaque graisse.
   (Une plage « 500 700 » ferait ignorer à Chrome, donc à l'appli Android, les fichiers latins.) */
@font-face { font-family: "Shippori Mincho"; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/shippori-mincho-kanji.woff2) format("woff2"); unicode-range: U+65c5, U+5e16, U+4e88, U+5b9a, U+4e21, U+66ff, U+652f, U+51fa, U+5929, U+6c17, U+899a, U+66f8, U+4f4f, U+6240, U+9332, U+8a00, U+8449, U+5199, U+771f, U+985e, U+4e00, U+89a7, U+5171, U+6709, U+8a2d, U+6674, U+66c7, U+96e8, U+96ea, U+9727, U+96f7, U+6771, U+4eac, U+90fd, U+5927, U+962a, U+5948, U+826f, U+5e83, U+5cf6, U+7bb1, U+6839, U+65e5, U+5149, U+938c, U+5009, U+6a2a, U+6d5c, U+540d, U+53e4, U+5c4b, U+91d1, U+6ca2, U+9ad8, U+5c71, U+672d, U+5e4c, U+798f, U+5ca1, U+90a3, U+8987, U+6c96, U+7e04, U+30d1, U+30ea, U+672c, U+6708, U+706b, U+6c34, U+6728, U+571f, U+66dc; }
@font-face { font-family: "Shippori Mincho"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/shippori-mincho-kanji.woff2) format("woff2"); unicode-range: U+65c5, U+5e16, U+4e88, U+5b9a, U+4e21, U+66ff, U+652f, U+51fa, U+5929, U+6c17, U+899a, U+66f8, U+4f4f, U+6240, U+9332, U+8a00, U+8449, U+5199, U+771f, U+985e, U+4e00, U+89a7, U+5171, U+6709, U+8a2d, U+6674, U+66c7, U+96e8, U+96ea, U+9727, U+96f7, U+6771, U+4eac, U+90fd, U+5927, U+962a, U+5948, U+826f, U+5e83, U+5cf6, U+7bb1, U+6839, U+65e5, U+5149, U+938c, U+5009, U+6a2a, U+6d5c, U+540d, U+53e4, U+5c4b, U+91d1, U+6ca2, U+9ad8, U+5c71, U+672d, U+5e4c, U+798f, U+5ca1, U+90a3, U+8987, U+6c96, U+7e04, U+30d1, U+30ea, U+672c, U+6708, U+706b, U+6c34, U+6728, U+571f, U+66dc; }
@font-face { font-family: "Shippori Mincho"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/shippori-mincho-kanji.woff2) format("woff2"); unicode-range: U+65c5, U+5e16, U+4e88, U+5b9a, U+4e21, U+66ff, U+652f, U+51fa, U+5929, U+6c17, U+899a, U+66f8, U+4f4f, U+6240, U+9332, U+8a00, U+8449, U+5199, U+771f, U+985e, U+4e00, U+89a7, U+5171, U+6709, U+8a2d, U+6674, U+66c7, U+96e8, U+96ea, U+9727, U+96f7, U+6771, U+4eac, U+90fd, U+5927, U+962a, U+5948, U+826f, U+5e83, U+5cf6, U+7bb1, U+6839, U+65e5, U+5149, U+938c, U+5009, U+6a2a, U+6d5c, U+540d, U+53e4, U+5c4b, U+91d1, U+6ca2, U+9ad8, U+5c71, U+672d, U+5e4c, U+798f, U+5ca1, U+90a3, U+8987, U+6c96, U+7e04, U+30d1, U+30ea, U+672c, U+6708, U+706b, U+6c34, U+6728, U+571f, U+66dc; }

/* ---------- Couleurs : clair (papier washi) et sombre (Tokyo la nuit) ---------- */
:root {
  --frame: #E7E2D8;
  --bg: #F5F2EB;
  --bg2: #EFEBE2;
  --surface: #FFFDF9;
  --field: #ECE7DE;
  --ink: #1F1E1C;
  --ink2: #4F4C46;
  --ink3: #736E65;
  --line: #E3DDD1;
  --line2: #D2CABB;
  --shu: #C93A22;
  --shu-soft: #F5E1D9;
  --on-shu: #FFFFFF;
  --sage: #6B8162;
  --sage-soft: #E4EADF;
  --ai: #3F5878;
  --ai-soft: #E0E6EE;
  --kinu: #B39A6B;
  --kinu-soft: #EFE7D8;
  --warn: #A8641A;
  --scrim: rgba(31, 28, 24, 0.36);
  --code-bg: rgba(31, 30, 28, 0.06);
  --pdf-bg: #DDD7CB;
  --shadow: 0 1px 2px rgba(31, 28, 24, 0.05), 0 10px 30px -18px rgba(31, 28, 24, 0.35);
  color-scheme: light;

  --font: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic", system-ui, -apple-system, Roboto, sans-serif;
  --mincho: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", "Noto Serif CJK JP", serif;
  --gutter: 24px;

  /* Marges des barres système (barre d'état, encoche, barre de navigation) : l'appli Android
     les remplace par les vraies valeurs ; dans un navigateur, env() les fournit. */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --frame: #06070A; --bg: #0E1116; --bg2: #0A0C10; --surface: #161A21; --field: #1B2028;
    --ink: #ECE7DD; --ink2: #ABA69B; --ink3: #86827A; --line: #232831; --line2: #333A46;
    --shu: #EE5C43; --shu-soft: #3A1F1A; --on-shu: #1B0D09; --sage: #93A88A; --sage-soft: #1C251D;
    --ai: #8FA5C6; --ai-soft: #1A2231; --kinu: #C9B48C; --kinu-soft: #272218; --warn: #E0A458;
    --scrim: rgba(0, 0, 0, 0.6); --code-bg: rgba(236, 231, 221, 0.08); --pdf-bg: #07090C;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px -16px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --frame: #06070A; --bg: #0E1116; --bg2: #0A0C10; --surface: #161A21; --field: #1B2028;
  --ink: #ECE7DD; --ink2: #ABA69B; --ink3: #86827A; --line: #232831; --line2: #333A46;
  --shu: #EE5C43; --shu-soft: #3A1F1A; --on-shu: #1B0D09; --sage: #93A88A; --sage-soft: #1C251D;
  --ai: #8FA5C6; --ai-soft: #1A2231; --kinu: #C9B48C; --kinu-soft: #272218; --warn: #E0A458;
  --scrim: rgba(0, 0, 0, 0.6); --code-bg: rgba(236, 231, 221, 0.08); --pdf-bg: #07090C;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px -16px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}
@media (max-width: 380px) { :root { --gutter: 18px; } }

/* ---------- Base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button, input, textarea, select { font-family: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid var(--shu); outline-offset: 2px; }
button:disabled { opacity: 0.45; cursor: default; }
input::placeholder, textarea::placeholder { color: var(--ink3); opacity: 1; }
[lang="ja"] { font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic", var(--font); }
.ic { display: inline-block; flex: 0 0 auto; vertical-align: middle; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::-webkit-scrollbar { width: 0; height: 0; }

/* ---------- Animations (discrètes ; « Réduire les animations » et le réglage du téléphone les coupent) ---------- */
@keyframes sIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(222, 76, 52, 0.45); } 100% { box-shadow: 0 0 0 9px rgba(222, 76, 52, 0); } }
@keyframes rowIn { 0% { background-color: var(--shu-soft); } 100% { background-color: transparent; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes viewer-next { from { transform: translateX(48px); opacity: 0.3; } to { transform: none; opacity: 1; } }
@keyframes viewer-prev { from { transform: translateX(-48px); opacity: 0.3; } to { transform: none; opacity: 1; } }
.view-in { animation: sIn 0.32s ease both; }
html.theme-anim, html.theme-anim * { transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease !important; }
html[data-reduce="1"] *, html[data-reduce="1"] *::before, html[data-reduce="1"] *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Squelette de l'appli ---------- */
#app { display: flex; flex-direction: column; height: 100%; padding-top: var(--safe-top); background: var(--bg); }

/* Version web (iPhone, navigateur mobile) : le clavier ne réduit pas la page, l'appli suit donc
   la partie visible de l'écran (--app-top, --app-height : voir app.js) et la page ne défile pas. */
html.is-web, html.is-web body { overflow: hidden; overscroll-behavior: none; }
html.is-web #app { position: fixed; left: 0; right: 0; top: var(--app-top, 0px); height: var(--app-height, 100%); }
html.is-web .dialog, html.is-web .sheet { top: var(--app-top, 0px); bottom: auto; height: var(--app-height, 100%); }

/* iPhone, appli installée : la barre d'état (heure, batterie) s'affiche en blanc par-dessus l'appli ;
   une bande d'encre derrière elle la garde lisible, même en thème clair. */
.ios-standalone body::before {
  content: ""; position: fixed; top: var(--app-top, 0px); left: 0; right: 0; z-index: 100;
  height: var(--safe-top); background: #1F1E1C; pointer-events: none;
}
:root[data-theme="dark"].ios-standalone body::before { background: #06070A; }

main {
  position: relative; flex: 1; min-height: 0;
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  padding: 0 var(--safe-right) 36px var(--safe-left);
}
#app:not(.has-tabbar):not(.has-bottom-bar):not(.has-banner) main { padding-bottom: calc(var(--safe-bottom) + 36px); }
.screen-head, .view { width: 100%; max-width: 560px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* ---------- En-tête d'un écran ----------
   Ligne du haut : retour (vers l'écran précédent) ou surtitre, et actions ; puis le titre en
   Mincho, avec son sceau en japonais (écriture verticale, vermillon). */
.screen-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: center;
  padding-top: 4px; padding-bottom: 16px;
}
.back-btn {
  grid-column: 1; grid-row: 1; justify-self: start; max-width: 100%;
  display: flex; align-items: center; gap: 2px; height: 44px; margin-left: -12px; padding: 0 8px 0 2px;
  border: 0; border-radius: 6px; background: none; color: var(--ink2); font-size: 15px;
}
.back-btn:active { color: var(--ink); }
.back-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head-overline { grid-column: 1; grid-row: 1; min-height: 44px; display: flex; align-items: center; margin: 0; }
.is-nested .head-overline { grid-column: 1 / -1; grid-row: 2; min-height: 0; margin: 2px 0 0; }
.top-actions { grid-column: 2; grid-row: 1; display: flex; align-items: center; gap: 2px; min-height: 44px; margin-right: -10px; }
#viewTitle {
  grid-column: 1; grid-row: 3; margin: 6px 0 0; min-width: 0;
  font-family: var(--mincho); font-size: 32px; font-weight: 600; line-height: 1.12; letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.is-root #viewTitle { font-size: 34px; }
.seal {
  writing-mode: vertical-rl; font-family: var(--mincho); font-size: 13px; letter-spacing: 0.25em; line-height: 1;
  color: var(--shu); border: 1px solid var(--shu); border-radius: 2px; padding: 7px 4px 4px; white-space: nowrap;
}
.screen-head .seal { grid-column: 2; grid-row: 3; align-self: end; justify-self: end; margin-bottom: 3px; }
.seal.is-large { font-size: 16px; letter-spacing: 0.3em; padding: 9px 5px 4px; }
/* Écran avec son propre titre (Accueil, éditeur de note) : le titre reste pour les lecteurs d'écran. */
.head-bar #viewTitle, .head-bar .seal, .head-overlay #viewTitle, .head-overlay .seal {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.head-bar { padding-bottom: 4px; }
/* Fiche d'un lieu : retour et actions posés sur le plan, en haut. */
.head-overlay {
  position: absolute; left: 0; right: 0; z-index: 3; padding-top: 10px; padding-bottom: 0;
  margin: 0 auto; pointer-events: none;
}
.head-overlay > * { pointer-events: auto; }
.head-overlay .back-btn { height: 38px; margin-left: -10px; padding: 0 12px 0 6px; background: var(--bg); color: var(--ink); font-size: 14px; }
.head-overlay .top-actions { gap: 6px; margin-right: -10px; }
.head-overlay .top-actions .icon-btn { width: 38px; height: 38px; background: var(--bg); }
.head-overlay .head-overline { display: none; }

/* Boutons en haut à droite */
.icon-btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--ink);
}
.icon-btn:active { background: var(--field); }
.icon-btn.is-small { width: 32px; height: 32px; color: var(--ink3); }
.top-text-btn {
  height: 36px; margin: 0 10px 0 4px; padding: 0 14px; border: 0; border-radius: 6px;
  background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 700;
}
.top-text-btn:active { opacity: 0.85; }

/* ---------- Barre de navigation du bas ---------- */
.tabbar {
  flex: 0 0 auto; position: relative; z-index: 20;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 0 var(--safe-right) var(--safe-bottom) var(--safe-left);
  background: var(--bg); border-top: 1px solid var(--line);
}
.tab {
  position: relative; height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 0; border: 0; background: none; color: var(--ink3);
}
.tab .ic { stroke-width: 1.6; }
.tab[aria-current="page"] { color: var(--ink); }
.tab[aria-current="page"] .ic { stroke-width: 2; }
.tab-mark { position: absolute; top: -1px; left: 50%; width: 20px; height: 2px; margin-left: -10px; background: var(--shu); opacity: 0; transition: opacity 0.2s; }
.tab[aria-current="page"] .tab-mark { opacity: 1; }
.tab-label { font-size: 10.5px; font-weight: 700; line-height: 1; }
.tab-add { display: flex; align-items: center; justify-content: center; }
.add-btn {
  width: 50px; height: 50px; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 7px; background: var(--shu); color: var(--on-shu);
}
.add-btn:active { transform: scale(0.96); }
.add-btn .ic { transition: transform 0.3s ease; }
.tabbar.is-adding .add-btn .ic { transform: rotate(45deg); }
/* Nouveaux commentaires (point vermillon), synchronisation en échec (point ambré) */
.tab.has-dot::after, .tab.has-alert::before {
  content: ""; position: absolute; top: 9px; left: calc(50% + 7px); width: 9px; height: 9px;
  border: 2px solid var(--bg); border-radius: 50%; background: var(--shu);
}
.tab.has-alert::before { top: 22px; background: var(--warn); }

/* ---------- Texte ---------- */
.overline {
  font-size: 11px; font-weight: 500; letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink3); line-height: 1.4;
}
.section-title {
  margin: 30px 0 8px; font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink3);
}
.section-title:first-child { margin-top: 4px; }
.hint { margin: 8px 0; color: var(--ink3); font-size: 13px; line-height: 1.55; }
.footnote { margin: 18px 0 0; text-align: center; color: var(--ink3); font-size: 12px; line-height: 1.5; }
.empty { margin: 36px 8px; color: var(--ink3); text-align: center; font-size: 14px; line-height: 1.55; }
.optional { font-weight: 400; text-transform: none; letter-spacing: 0; opacity: 0.85; }
.danger-text { color: var(--shu) !important; }
.is-muted { color: var(--ink2); }
.head-sub { margin: -10px 0 8px; font-size: 13px; color: var(--ink3); }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* En-tête de groupe : Mincho, filet d'encre */
.group-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px; width: 100%;
  margin: 18px 0 0; padding: 0 0 8px; border: 0; border-bottom: 1px solid var(--ink); background: none; text-align: left;
}
.group-head:first-child { margin-top: 4px; }
.group-title { margin: 0; font-family: var(--mincho); font-size: 17px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink); }
.group-head.is-large { padding-top: 8px; }
.group-head.is-large .group-title { font-size: 22px; }
.group-meta { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; color: var(--ink3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.group-head.is-link { cursor: pointer; }
.group-head.is-link:active .group-title { color: var(--shu); }

/* Bloc d'un écran vide */
.empty-block {
  margin: 4px 0 8px; padding: 34px 20px; border: 1px dashed var(--line2); border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; text-align: center; color: var(--ink3);
}
.empty-title { margin: 10px 0 0; font-family: var(--mincho); font-size: 19px; font-weight: 600; color: var(--ink); }
.empty-text { margin: 4px 0 0; font-size: 13px; line-height: 1.5; max-width: 300px; }
.empty-block .primary-btn { margin-top: 16px; }

/* ---------- Boutons ---------- */
.primary-btn, .outline-btn, .ghost-btn, .secondary-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 6px; font-size: 14px; font-weight: 700; line-height: 1.2; text-align: center;
}
.primary-btn { border: 0; background: var(--shu); color: var(--on-shu); }
.primary-btn:active { transform: scale(0.99); filter: brightness(0.95); }
.primary-btn.is-danger { background: var(--shu); }
.outline-btn, .secondary-btn { border: 1px solid var(--line2); background: transparent; color: var(--ink); }
.outline-btn:active, .secondary-btn:active { background: var(--field); }
.ghost-btn { border: 0; background: var(--field); color: var(--ink); }
.primary-btn.block, .outline-btn.block, .secondary-btn.block, .block-btn { display: flex; width: 100%; margin-top: 10px; }
.primary-btn.block { min-height: 52px; font-size: 15px; margin-top: 20px; }
.primary-btn.compact, .outline-btn.compact { min-height: 42px; padding: 0 14px; font-size: 13px; }
.text-btn {
  display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 2px;
  border: 0; background: none; color: var(--ink2); font-size: 13px; font-weight: 700;
}
.text-btn.is-muted { color: var(--ink3); font-size: 12px; }
.text-btn.is-accent { color: var(--shu); }
.text-btn.is-danger { color: var(--shu); font-size: 14px; }
.link-btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 8px 0; border: 0; background: none;
  color: var(--shu); font-size: 14px; font-weight: 700;
}
.muted-link { color: var(--ink3); }
.action-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px;
  border: 1px solid var(--line2); border-radius: 6px; background: transparent; color: var(--ink); font-size: 13px; font-weight: 700;
}
.action-btn:active { background: var(--field); }
.square-btn {
  width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line2); border-radius: 6px; background: transparent; color: var(--ink2);
}
.square-btn:active { background: var(--field); color: var(--ink); }
.route-btn {
  flex: 0 0 auto; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line2); border-radius: 6px; background: transparent; color: var(--ink2);
}
.route-btn:active { background: var(--field); }
.add-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 15px 0; border: 0; border-bottom: 1px solid var(--line);
  background: none; color: var(--shu); font-size: 15px; font-weight: 700; text-align: left;
}
.sign-out-btn { margin-top: 26px; }
.button-pair { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.button-pair > * { flex: 1 1 140px; }

/* ---------- Champs ---------- */
.field-label {
  display: block; margin: 20px 0 7px; font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink3);
}
.form-view > .field-label:first-child { margin-top: 2px; }
.text-input, .text-area {
  display: block; width: 100%; min-height: 48px; padding: 12px 14px;
  border: 1px solid var(--line2); border-radius: 6px; outline: none;
  background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.4; /* 16 px : sinon l'iPhone zoome */
  -webkit-appearance: none; appearance: none;
}
.text-input:focus, .text-area:focus { border-color: var(--ink); }
input[type="date"].text-input, input[type="time"].text-input, input[type="datetime-local"].text-input { text-align: left; }
.text-input::-webkit-date-and-time-value { text-align: left; }
.text-area { resize: vertical; min-height: 96px; line-height: 1.55; }
.text-area.small { min-height: 72px; }
.md-input { min-height: 180px; line-height: 1.6; resize: none; overflow-y: auto; }
.field-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.form-error { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; color: var(--shu); font-size: 13px; font-weight: 500; line-height: 1.4; animation: fade 0.2s ease both; }
.title-input {
  display: block; width: 100%; margin: 6px 0 4px; padding: 0; border: 0; outline: none; background: transparent; color: var(--ink);
  font-family: var(--mincho); font-size: 28px; font-weight: 600; line-height: 1.25;
}
.picker-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 0 14px;
  border: 1px solid var(--line2); border-radius: 6px; background: var(--bg); color: var(--ink); font-size: 15px; text-align: left;
}
.picker-btn > .ic:first-child { color: var(--ink2); }
.picker-btn > .ic:last-child { margin-left: auto; color: var(--ink3); }
.picker-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-btn.is-empty .picker-text { color: var(--ink3); }
.search-field {
  display: flex; align-items: center; gap: 10px; height: 44px; margin: 0 0 4px; padding: 0 14px;
  border-radius: 6px; background: var(--field); color: var(--ink3);
}
.search-input {
  flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: none; background: transparent;
  color: var(--ink); font-size: 16px; -webkit-appearance: none; appearance: none;
}
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.sheet .search-field { margin: 4px 0 8px; }

/* Choix segmenté (Écrire / Aperçu, devise) */
.segmented { display: flex; gap: 3px; margin: 16px 0 8px; padding: 3px; border: 1px solid var(--line2); border-radius: 6px; }
.segment {
  flex: 1; min-height: 34px; padding: 0 10px; border: 0; border-radius: 4px; background: transparent;
  color: var(--ink2); font-size: 13px; font-weight: 700; white-space: nowrap;
}
.segment[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.segmented.compact { margin: 0; flex: 0 0 auto; }
.segmented.compact .segment { min-height: 32px; padding: 0 9px; }

/* Interrupteur (case à cocher dessinée) */
.switch, .toggle {
  -webkit-appearance: none; appearance: none; position: relative; flex: 0 0 auto;
  width: 46px; height: 28px; margin: 0; border-radius: 14px; background: var(--line2); cursor: pointer; transition: background-color 0.2s;
}
.switch::after, .toggle::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #FFFFFF; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: transform 0.2s ease;
}
.switch:checked, .toggle:checked { background: var(--shu); }
.switch:checked::after, .toggle:checked::after { transform: translateX(18px); }
.switch:disabled, .toggle:disabled { opacity: 0.45; }

/* Puces : filtres, catégories, montants rapides */
.chip-row { display: flex; gap: 6px; overflow-x: auto; padding: 12px 0 6px; scrollbar-width: none; }
.chip-row.wrap { flex-wrap: wrap; overflow: visible; padding: 0; }
.chip-row.bleed { margin: 0 calc(-1 * var(--gutter)); padding-left: var(--gutter); padding-right: var(--gutter); scroll-padding: 0 var(--gutter); }
.chip-row.bleed::after { content: ""; flex: 0 0 1px; }
.filter-chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  border: 1px solid var(--line2); border-radius: 4px; background: transparent; color: var(--ink2);
  font-size: 13px; font-weight: 500; white-space: nowrap;
}
.filter-chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.filter-chip:active { background: var(--field); }
.filter-chip[aria-pressed="true"]:active { background: var(--ink); }
.filter-chip.is-more { border-style: dashed; color: var(--ink3); }
.chip-count { font-size: 12px; opacity: 0.6; font-variant-numeric: tabular-nums; }
.chips { margin-top: 4px; }
.chip {
  display: inline-block; margin: 4px 6px 0 0; padding: 2px 8px; border-radius: 4px;
  background: var(--shu-soft); color: var(--shu); font-size: 12px; font-weight: 500;
}
.chip-muted { background: var(--field); color: var(--ink2); }

/* ---------- Listes ---------- */
.list-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 0;
  border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer;
}
.list-row:active { background: var(--field); }
.list-row-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.list-row-title { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 16px; font-weight: 700; line-height: 1.3; }
.list-row-sub { display: block; margin: 3px 0 0; font-size: 13px; line-height: 1.45; color: var(--ink2); }
.list-row-address { display: flex; align-items: center; gap: 4px; margin: 4px 0 0; font-size: 13px; color: var(--shu); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { margin: 6px 0 0; font-size: 12px; color: var(--ink3); }
.row-date { flex: 0 0 auto; align-self: flex-start; margin-top: 2px; font-size: 12px; color: var(--ink3); }
.row-count { flex: 0 0 auto; font-size: 13px; color: var(--ink3); font-variant-numeric: tabular-nums; }
.row-chevron { flex: 0 0 auto; display: inline-flex; color: var(--ink3); }
.row-icon { flex: 0 0 auto; width: 38px; text-align: center; font-size: 1.3rem; line-height: 1; }
.row-lead { flex: 0 0 auto; display: inline-flex; width: 22px; justify-content: center; color: var(--ink3); }
.row-lead.is-accent { color: var(--shu); }
.icon-square {
  flex: 0 0 auto; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; background: var(--field); color: var(--ink2);
}
.icon-square.is-shared { background: var(--ai-soft); color: var(--ai); }
.address-row, .doc-row { align-items: flex-start; }
.address-row .route-btn, .doc-row .icon-btn { margin-top: -2px; }
.note-row { padding: 16px 0; }
.note-row .list-row-sub { font-size: 14px; line-height: 1.5; margin-top: 5px; }
.pin-mark { display: inline-flex; align-items: center; gap: 4px; color: var(--shu); }
.is-new { animation: rowIn 1.8s ease both; }

/* Cartes */
.card { margin: 0 0 12px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.link-card { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.link-card:active { border-color: var(--line2); }
.card-label { margin: 0 0 4px; font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink3); }
.card-text { margin: 0; font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Pastille avec une initiale (profil, contacts) */
.avatar {
  flex: 0 0 auto; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--ai-soft); color: var(--ai); font-size: 14px; font-weight: 700;
}
.avatar.is-me { width: 44px; height: 44px; background: var(--ink); color: var(--bg); font-size: 17px; }

/* Barre de progression, avec repère facultatif */
.meter { position: relative; height: 4px; margin-top: 16px; border-radius: 2px; background: var(--line); }
.meter-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--ink); }
.meter.is-over .meter-fill { background: var(--shu); }
.meter-mark { position: absolute; top: -5px; bottom: -5px; width: 1.5px; margin-left: -0.75px; background: var(--shu); }
.meter-note { margin: 6px 0 0; text-align: right; font-size: 11px; color: var(--shu); }

/* ---------- Accueil ---------- */
#view-home { padding-bottom: 8px; }
.home-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-top: 6px; }
.home-city { margin: 0; font-family: var(--mincho); font-size: 54px; font-weight: 600; line-height: 1; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.home-sub { margin: 12px 0 0; font-size: 15px; color: var(--ink2); }
.home-sub b { color: var(--ink); }
.trip-segs { display: flex; gap: 3px; margin-top: 22px; }
.trip-segs span { flex: 1; height: 3px; border-radius: 1px; background: var(--line2); }
.trip-segs .is-past { background: var(--ink2); }
.trip-segs .is-today { background: var(--shu); }
.trip-meter { margin-top: 22px; }
.trip-dates { display: flex; justify-content: space-between; gap: 12px; margin: 8px 0 0; font-size: 12px; color: var(--ink3); }
.trip-dates b { color: var(--ink); }
.home-clocks {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; width: 100%;
  margin-top: 30px; padding: 18px 0; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: none; text-align: left;
}
.home-clocks .clock-zone { display: flex; flex-direction: column; min-width: 0; }
.home-clocks .clock-zone.is-right { text-align: right; }
.home-clocks .clock-time { margin-top: 4px; font-family: var(--mincho); font-size: 38px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.clock-time.is-muted { color: var(--ink2); }
.clock-diff { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 0 14px; color: var(--shu); font-size: 12px; font-weight: 700; white-space: nowrap; }
.clock-rule { width: 1px; height: 16px; background: var(--line2); }
.home-weather {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px 0; border: 0; border-bottom: 1px solid var(--line);
  background: none; color: var(--ink); text-align: left;
}
.home-weather > .ic:last-child { margin-left: auto; color: var(--ink3); }
.home-temp { font-family: var(--mincho); font-size: 32px; font-weight: 600; line-height: 1; }
.home-weather-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.home-cond { font-size: 15px; font-weight: 500; }
.home-wx-meta { margin-top: 2px; font-size: 13px; color: var(--ink3); }
.home-section { margin-top: 36px; }
.home-section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.home-section-head .text-btn { margin-left: auto; }
.home-h2 { margin: 0 0 14px; font-family: var(--mincho); font-size: 23px; font-weight: 600; line-height: 1.2; }
.home-section-head .home-h2 { margin: 0; }
.home-h2-meta { min-width: 0; font-size: 12px; color: var(--ink3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-current { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 13px; color: var(--ink2); }
.home-current .ic { color: var(--ink3); }
.home-current b { color: var(--ink); }
.home-note { margin: 0; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink2); }
.home-empty { padding: 18px; border: 1px dashed var(--line2); border-radius: 8px; }
.home-empty-text { margin: 0 0 14px; font-size: 14px; line-height: 1.55; color: var(--ink2); }
.next-card { padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.next-overline { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--shu); }
.pulse-dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--shu); animation: pulse 1.8s ease-out infinite; }
.next-main { display: flex; align-items: baseline; gap: 14px; margin-top: 12px; }
.next-time { font-family: var(--mincho); font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.next-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.next-title { font-size: 18px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.next-place { margin-top: 3px; font-size: 13px; color: var(--ink2); }
.next-actions { display: flex; gap: 8px; margin-top: 16px; }
.next-actions .outline-btn { flex: 1; min-height: 42px; font-size: 13px; }
.home-upcoming {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 8px; width: 100%;
  padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); text-align: left;
}
.home-upcoming .ic { color: var(--ink3); }
.home-up-time { font-size: 14px; font-weight: 700; color: var(--ink2); font-variant-numeric: tabular-nums; }
.home-up-title { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-money { display: block; width: 100%; padding: 0; border: 0; background: none; color: var(--ink); text-align: left; }
.home-money-amount { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; }
.home-money-amount .spend-int { font-size: 36px; }
.home-money-amount .spend-dec { font-size: 18px; margin-left: -5px; }
.home-money-of { margin-left: 4px; font-size: 14px; color: var(--ink3); }
.home-money-line { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 13px; color: var(--ink3); }
.home-money-line b { color: var(--ink); }
.home-section .outline-btn.block { margin-top: 18px; }
.shortcut-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.shortcut {
  aspect-ratio: 1 / 0.92; display: flex; flex-direction: column; justify-content: space-between; padding: 14px;
  border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: none; color: var(--ink); text-align: left;
}
.shortcut:active { background: var(--field); }
.shortcut-text { display: flex; flex-direction: column; }
.shortcut-label { font-size: 14px; font-weight: 700; }
.shortcut-jp { margin-top: 2px; font-family: var(--mincho); font-size: 11px; color: var(--ink3); }

/* ---------- Tout : toutes les rubriques ---------- */
.menu-group { margin: 26px 0 6px; font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink3); }
.menu-group:first-child { margin-top: 0; }
.menu-row {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto 16px; align-items: center; gap: 14px; width: 100%;
  padding: 15px 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); text-align: left;
}
.menu-row:active { background: var(--field); }
.menu-main { display: flex; flex-direction: column; min-width: 0; }
.menu-label { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.menu-meta { margin-top: 2px; font-size: 12.5px; color: var(--ink3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-meta:empty { display: none; }
.menu-jp { font-family: var(--mincho); font-size: 13px; color: var(--ink3); }
.menu-chevron { color: var(--ink3); }
.menu-foot { display: flex; align-items: center; gap: 10px; margin: 34px 0 0; color: var(--ink3); font-size: 12px; }
.menu-brand { font-family: var(--mincho); font-size: 17px; font-weight: 700; color: var(--ink2); }
.menu-badge {
  display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 10px;
  background: var(--shu); color: var(--on-shu); font-size: 11px; font-weight: 700; line-height: 1.4;
}
.menu-sync { display: inline-flex; color: var(--ink3); }
.menu-sync.is-ok { color: var(--sage); }
.menu-sync.is-alert { color: var(--warn); }
.menu-sync.is-busy .ic { animation: spin 1.1s linear infinite; }

/* ---------- Convertisseur ---------- */
.conv-from { padding: 0 0 14px; border-bottom: 1px solid var(--line); }
.conv-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 32px; }
.conv-tools { display: flex; align-items: center; gap: 14px; }
.conv-amount { position: relative; display: flex; align-items: baseline; gap: 10px; min-height: 62px; margin-top: 6px; cursor: text; }
.conv-sign { font-family: var(--mincho); font-size: 26px; color: var(--ink3); }
#yenInput, .conv-measure {
  font-family: var(--mincho); font-size: 50px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums;
}
#yenInput {
  min-width: 0.6em; max-width: 100%; height: 1.15em; padding: 0; border: 0; outline: none; background: transparent; color: var(--ink);
  line-height: 1.15; caret-color: transparent; /* hauteur fixée : Safari prendrait celle, plus grande, de la police */
}
#yenInput::placeholder { color: var(--ink); }
.conv-measure { position: absolute; left: 0; top: 0; visibility: hidden; white-space: pre; pointer-events: none; }
.conv-caret { flex: 0 0 auto; align-self: center; width: 2px; height: 38px; margin-left: -6px; background: var(--shu); animation: blink 1.05s steps(1) infinite; }
.sum-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.sum-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 9px;
  border: 1px solid var(--line2); border-radius: 4px; background: var(--surface); color: var(--ink);
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.sum-chip .ic { color: var(--ink3); }
.conv-swap { position: relative; height: 0; }
.swap-btn {
  position: absolute; right: 0; top: -23px; z-index: 1; width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line2); border-radius: 6px; background: var(--bg); color: var(--ink);
}
.swap-btn .ic { transition: transform 0.4s cubic-bezier(0.3, 0.7, 0.2, 1); }
.swap-btn:active { background: var(--field); }
.conv-to { padding: 18px 0 4px; }
.conv-amount.is-result { cursor: default; }
.conv-amount.is-result .conv-sign { color: var(--shu); }
.result-value {
  min-width: 0; font-family: var(--mincho); font-size: 50px; font-weight: 600; line-height: 1.15; letter-spacing: -0.01em;
  color: var(--shu); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.rate-block { margin-top: 6px; }
.rate-view { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 12px; color: var(--ink3); font-variant-numeric: tabular-nums; }
.rate-view .text-btn { min-height: 28px; font-size: 12px; color: var(--shu); }
.rate-edit { display: flex; align-items: center; gap: 8px; }
.rate-edit-label { font-size: 13px; color: var(--ink2); }
#rateInput {
  width: 90px; height: 36px; padding: 0 10px; border: 1px solid var(--ink); border-radius: 6px; outline: none;
  background: var(--bg); color: var(--ink); font-size: 16px; font-weight: 700;
}
.rate-save-btn { height: 36px; padding: 0 14px; border: 0; border-radius: 6px; background: var(--shu); color: var(--on-shu); font-weight: 700; font-size: 13px; }
.quick-amounts { padding-top: 8px; padding-bottom: 10px; }
.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.keypad button {
  height: 54px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 6px;
  background: none; color: var(--ink); font-family: var(--mincho); font-size: 26px; font-weight: 500;
}
.keypad button:active { background: var(--field); }
.keypad button:disabled { opacity: 0.25; }
#noteExpenseBtn { min-height: 46px; margin-top: 14px; }
/* Écran peu haut (voir fitConverterHeight) : resserré par étapes, jusqu'à tenir sans défiler. */
#view-converter.fit-1 { margin-bottom: -24px; }
#view-converter.fit-1 .keypad button { height: 46px; }
#view-converter.fit-2 #rateNote { display: none; }
#view-converter.fit-3 .conv-from { padding-bottom: 10px; }
#view-converter.fit-3 .conv-to { padding-top: 12px; }
#view-converter.fit-3 .conv-amount { min-height: 50px; margin-top: 2px; }
#view-converter.fit-3 #yenInput, #view-converter.fit-3 .conv-measure, #view-converter.fit-3 .result-value { font-size: 40px; }
#view-converter.fit-3 .conv-caret { height: 32px; }
#view-converter.fit-4 .quick-amounts { display: none; }
#view-converter.fit-4 .keypad button { height: 42px; }
#view-converter.fit-4 #noteExpenseBtn { margin-top: 8px; }

/* ---------- Dépenses ---------- */
.spend { padding-top: 2px; }
.spend-amount { display: flex; align-items: baseline; margin: 6px 0 0; }
.spend-amount .spend-dec { margin-left: 1px; }
.spend-int { font-family: var(--mincho); font-size: 48px; font-weight: 600; line-height: 1.05; font-variant-numeric: tabular-nums; }
.spend-dec { font-family: var(--mincho); font-size: 22px; font-weight: 600; color: var(--ink2); font-variant-numeric: tabular-nums; }
.spend-sub { margin: 4px 0 0; font-size: 13px; color: var(--ink3); font-variant-numeric: tabular-nums; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { display: flex; flex-direction: column; min-width: 0; padding: 14px 0 14px 12px; border-left: 1px solid var(--line); }
.stat:first-child { padding-left: 0; border-left: 0; }
.stat-label { font-size: 11px; color: var(--ink3); }
.stat-value { margin-top: 3px; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-sub { font-size: 12px; color: var(--ink3); font-variant-numeric: tabular-nums; }
.stat.is-left .stat-value { color: var(--sage); }
.stat.is-over .stat-value { color: var(--shu); }
.budget-link { margin-top: 8px; color: var(--shu); }
.split-bar { display: flex; gap: 2px; height: 10px; margin-top: 12px; border-radius: 2px; overflow: hidden; }
.split-bar span { min-width: 3px; }
.split-legend { margin-top: 8px; }
.expense-category { display: grid; grid-template-columns: 10px 20px minmax(0, 1fr) auto 44px; align-items: center; gap: 10px; padding: 9px 0; font-size: 14px; }
.expense-category .ic { color: var(--ink2); }
.split-dot { width: 8px; height: 8px; border-radius: 2px; }
.expense-category-amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.expense-category-share { font-size: 12px; color: var(--ink3); text-align: right; }
.expense-row { align-items: center; }
.expense-amounts { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; }
.expense-amount { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.expense-amount-other { margin-top: 2px; font-size: 12px; color: var(--ink3); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Formulaire d'une dépense */
.money-row { display: flex; align-items: center; gap: 10px; padding-bottom: 6px; border-bottom: 1.5px solid var(--ink); }
.money-sign { font-family: var(--mincho); font-size: 28px; color: var(--ink3); }
#expenseAmount {
  flex: 1; min-width: 0; padding: 0; border: 0; outline: none; background: transparent; color: var(--ink);
  font-family: var(--mincho); font-size: 44px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.expense-converted { min-height: 1.4em; margin: 8px 0 0; font-size: 13px; color: var(--ink3); font-variant-numeric: tabular-nums; }
.cat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cat-tile {
  height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  border: 1px solid var(--line2); border-radius: 6px; background: transparent; color: var(--ink2); font-size: 12px; font-weight: 500;
}
.cat-tile[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--bg); }

/* ---------- Programme ---------- */
.day-strip {
  display: flex; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 0 calc(var(--gutter) - 6px);
  border-bottom: 1px solid var(--line); scrollbar-width: none; scroll-snap-type: x proximity;
}
.strip-day {
  flex: 0 0 50px; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 0 10px;
  margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--ink3); scroll-snap-align: center;
}
.strip-wk { font-size: 11px; }
.strip-num {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 50%;
  font-family: var(--mincho); font-size: 18px; font-weight: 600; color: var(--ink);
}
.strip-day.is-past .strip-num { color: var(--ink3); }
.strip-day.is-today .strip-num { background: var(--shu); color: var(--on-shu); }
.strip-day.is-selected { border-bottom-color: var(--ink); color: var(--ink); }
.strip-dots { display: flex; gap: 3px; height: 4px; }
.strip-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--line2); }
.strip-day.is-selected .strip-dot { background: var(--ink2); }
.day-head { padding: 22px 0 4px; }
.day-head-top { display: flex; align-items: center; gap: 10px; }
.day-tag {
  padding: 3px 8px; border: 1px solid var(--line2); border-radius: 3px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink2);
}
.day-tag.is-past { color: var(--ink3); }
.day-tag.is-today { border-color: var(--shu); background: var(--shu); color: var(--on-shu); }
.day-nav-sub { font-size: 13px; color: var(--ink3); }
.day-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 12px 0 0; }
.day-nav-date { font-family: var(--mincho); font-size: 28px; font-weight: 600; line-height: 1.15; }
.day-jp { font-family: var(--mincho); font-size: 15px; color: var(--shu); }
.day-area { margin: 2px 0 0; font-size: 15px; color: var(--ink2); }
.day-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; font-size: 13px; color: var(--ink2); }
.day-fact { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: inherit; font-size: inherit; }
.day-weather { text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; }
.tl-label { margin-top: 26px; }
.timeline { padding: 4px 0 0; margin-left: -12px; }
.tl-item { display: grid; grid-template-columns: 48px 16px minmax(0, 1fr); column-gap: 12px; border-radius: 6px; }
.tl-time { padding-top: 1px; text-align: right; display: flex; flex-direction: column; }
.event-time { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.tl-end { margin-top: 2px; font-size: 12px; color: var(--ink3); font-variant-numeric: tabular-nums; }
.tl-rail { position: relative; display: flex; justify-content: center; }
.tl-rail::before { content: ""; position: absolute; top: 18px; bottom: 0; left: 50%; width: 1px; margin-left: -0.5px; background: var(--line2); }
.tl-item.is-last .tl-rail::before { display: none; }
.tl-node { position: relative; margin-top: 4px; width: 11px; height: 11px; border: 1.5px solid var(--ink2); border-radius: 50%; background: var(--bg); }
.tl-body {
  display: flex; flex-direction: column; min-width: 0; padding: 0 0 26px; border: 0; background: none;
  color: var(--ink); text-align: left;
}
.tl-cat { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink3); }
.event-badge { color: var(--shu); font-weight: 700; letter-spacing: 0.08em; }
.event-badge::before { content: "· "; }
.event-title { margin-top: 5px; font-size: 16px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.tl-body .event-place { display: flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 13px; color: var(--ink2); min-width: 0; }
.tl-body .event-place span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-desc { margin-top: 6px; font-size: 13px; line-height: 1.5; color: var(--ink3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tl-files { display: flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 12px; color: var(--ink3); }
.tl-item.is-past .event-time { color: var(--ink3); }
.tl-item.is-past .event-title { color: var(--ink2); }
.tl-item.is-past .tl-node { border-color: var(--ink3); background: var(--ink3); }
.tl-item.is-past .tl-rail::before { background: var(--ink3); }
.tl-item.is-now .event-time { color: var(--shu); }
.tl-item.is-now .tl-node { border-color: var(--shu); background: var(--shu); animation: pulse 1.8s ease-out infinite; }
.tl-now { display: grid; grid-template-columns: 48px 16px minmax(0, 1fr); column-gap: 12px; align-items: center; height: 30px; margin-bottom: 6px; }
.tl-now-time { font-size: 12px; font-weight: 700; color: var(--shu); text-align: right; font-variant-numeric: tabular-nums; }
.tl-now-dot { justify-self: center; width: 9px; height: 9px; border-radius: 50%; background: var(--shu); animation: pulse 1.8s ease-out infinite; }
.tl-now.is-end .tl-now-dot { animation: none; }
.tl-now-line { height: 1px; background: var(--shu); }
.tl-now-label { font-size: 12px; color: var(--shu); }
.overview-days { margin-bottom: 8px; }
.ov-day {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 14px; width: 100%;
  padding: 13px 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); text-align: left;
}
.ov-day:active { background: var(--field); }
.ov-day.is-past { opacity: 0.6; }
.ov-date { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ov-wk { font-size: 10.5px; color: var(--ink3); }
.ov-num { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-family: var(--mincho); font-size: 17px; font-weight: 600; }
.ov-day.is-today .ov-num { background: var(--shu); color: var(--on-shu); }
.ov-main { min-width: 0; display: flex; flex-direction: column; }
.ov-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.ov-today { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--shu); }
.ov-summary { margin-top: 3px; font-size: 13px; color: var(--ink3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-count { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink3); }
#scheduleShared:not(:empty) { margin-top: 28px; }
/* Fiche d'une étape (feuille du bas) */
.sheet-overline { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink3); }
.sheet-heading { margin: 10px 0 0; font-family: var(--mincho); font-size: 27px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.sheet-meta { display: flex; align-items: center; gap: 7px; margin: 8px 0 0; font-size: 15px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.place-card { margin-top: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); overflow: hidden; }
.place-card-main { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border: 0; background: none; color: var(--ink); text-align: left; }
.place-card-main > .ic:first-child { color: var(--shu); }
.place-card-main > .ic:last-child { color: var(--ink3); }
.place-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.place-card-name { font-size: 15px; font-weight: 700; }
.place-card-addr { margin-top: 2px; font-size: 13px; color: var(--shu); overflow-wrap: anywhere; }
.place-card-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 14px; }
.event-sheet .markdown { margin-top: 6px; }
.event-sheet .section-title { margin-top: 18px; }
.sheet-actions { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; margin-top: 24px; }
.sheet-actions.is-single { grid-template-columns: 1fr; }
.sheet-actions .primary-btn, .sheet-actions .outline-btn { min-height: 48px; padding: 0 10px; }
.confirm-box { margin-top: 24px; padding: 16px; border-radius: 8px; background: var(--shu-soft); animation: fade 0.2s ease both; }
.confirm-title { margin: 0; font-size: 15px; font-weight: 700; }
.confirm-text { margin: 4px 0 0; font-size: 13px; color: var(--ink2); }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.confirm-actions .outline-btn { background: var(--surface); min-height: 44px; }
.confirm-actions .primary-btn { min-height: 44px; }

/* ---------- Météo & heure ---------- */
.world-clock { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.world-clock .clock-zone { display: flex; flex-direction: column; min-width: 0; padding: 16px 0; }
.world-clock .clock-zone + .clock-zone { padding-left: 18px; border-left: 1px solid var(--line); }
.world-clock .clock-time { margin-top: 4px; font-family: var(--mincho); font-size: 42px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.clock-day { font-size: 12px; color: var(--ink3); }
.clock-ahead { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 13px; color: var(--ink2); }
.clock-ahead .ic { color: var(--shu); }
.clock-ahead b { color: var(--ink); }
#weatherCities { padding-top: 26px; }
.weather-now { position: relative; padding: 20px 0 22px; overflow: hidden; }
.wx-kanji {
  position: absolute; right: -18px; top: -6px; font-family: var(--mincho); font-size: 190px; font-weight: 500; line-height: 1;
  color: var(--line); pointer-events: none; user-select: none;
}
.weather-head { position: relative; display: flex; align-items: center; gap: 6px; color: var(--ink2); }
.weather-city { margin: 0; font-size: 14px; font-weight: 400; }
.wx-temp-row { position: relative; display: flex; align-items: flex-start; gap: 14px; margin-top: 4px; }
.wx-temp-row .ic { margin-top: 14px; }
.weather-now-temp { font-family: var(--mincho); font-size: 92px; font-weight: 600; line-height: 1; letter-spacing: -0.03em; }
.wx-cond { position: relative; margin: 6px 0 0; font-size: 19px; font-weight: 500; }
.wx-cond.is-muted { font-size: 15px; color: var(--ink3); }
.wx-details { position: relative; display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0 0; font-size: 14px; color: var(--ink2); }
.wx-rain { display: inline-flex; align-items: center; gap: 5px; color: var(--ai); }
.weather-hours {
  display: flex; gap: 2px; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 0 calc(var(--gutter) - 4px);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); scrollbar-width: none; scroll-snap-type: x proximity;
}
.weather-hour {
  flex: 0 0 54px; display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 6px 0; padding: 14px 0;
  border-radius: 6px; scroll-snap-align: start;
}
.weather-hour.is-now { background: var(--field); }
.weather-hour-time { font-size: 11px; font-weight: 700; color: var(--ink3); white-space: nowrap; }
.weather-hour.is-now .weather-hour-time { color: var(--shu); }
.weather-hour-icon { display: inline-flex; }
.weather-hour-temp { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.weather-hour-rain { min-height: 1.2em; font-size: 10.5px; color: var(--ai); white-space: nowrap; }
.weather-hour-rain.is-low { opacity: 0.5; }
.weather-hour-rain.is-likely { font-weight: 700; }
.weather-week { margin-top: 4px; }
.weather-day {
  display: grid; grid-template-columns: minmax(0, 96px) 24px 40px minmax(0, 1fr); align-items: center; gap: 8px;
  padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.weather-day-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.weather-day.is-today .weather-day-name { color: var(--shu); }
.weather-day.is-past { opacity: 0.5; }
.weather-day-icon { display: inline-flex; }
.weather-day-rain { font-size: 12px; color: var(--ink3); }
.weather-day-rain.is-likely { color: var(--ai); }
.weather-day-temps { display: grid; grid-template-columns: 30px minmax(0, 1fr) 30px; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.weather-min { color: var(--ink3); text-align: right; }
.weather-max { font-weight: 700; }
.temp-bar { position: relative; height: 4px; border-radius: 2px; background: var(--line); }
.temp-bar span { position: absolute; top: 0; bottom: 0; border-radius: 2px; background: var(--ink2); }
.weather-credit { margin-top: 4px; font-size: 11px; }

/* ---------- Notes ---------- */
#noteFolders { padding-bottom: 4px; }
#view-note-edit .segmented { margin-top: 12px; }
.note-body { min-height: 260px; border: 0; padding: 4px 0; background: transparent; font-size: 16px; line-height: 1.7; }
.note-body:focus { border: 0; }
.md-preview { min-height: 200px; margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); }
.detail-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin: -6px 0 16px; font-size: 12px; color: var(--ink3); }
.image-grid { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.image-cell { position: relative; width: 80px; height: 80px; padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: var(--field); }
.image-cell img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.image-remove {
  position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.6); color: #FFFFFF;
}

/* ---------- Carnet d'adresses ---------- */
#addressFilters { padding-bottom: 6px; }
.map-hero {
  position: relative; height: 176px; margin: 0 calc(-1 * var(--gutter)); overflow: hidden; background-color: var(--field);
  background-image: linear-gradient(var(--line2) 1px, transparent 1px), linear-gradient(90deg, var(--line2) 1px, transparent 1px);
  background-size: 28px 28px; background-position: -1px -1px;
}
.map-road { position: absolute; background: var(--bg); opacity: 0.85; }
.map-road.is-a { left: -10%; right: -10%; top: 58%; height: 14px; transform: rotate(-8deg); }
.map-road.is-b { top: -10%; bottom: -10%; left: 62%; width: 10px; transform: rotate(12deg); }
.map-pin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%); color: var(--shu); }
.detail-overline { display: flex; align-items: center; gap: 7px; margin: 20px 0 0; font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink3); }
.detail-title { margin: 8px 0 0; font-family: var(--mincho); font-size: 28px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.address-card { margin-top: 20px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.address-main { margin: 6px 0 0; font-size: 19px; font-weight: 500; line-height: 1.45; color: var(--shu); white-space: pre-wrap; overflow-wrap: anywhere; }
.address-ja { display: flex; align-items: flex-start; gap: 6px; margin: 6px 0 0; font-size: 15px; line-height: 1.5; color: var(--ink2); white-space: pre-wrap; overflow-wrap: anywhere; }
.address-ja span { flex: 1; min-width: 0; }
.address-ja .icon-btn { margin: -4px -6px 0 0; }
.address-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 14px; }
.address-action {
  height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 1px solid var(--line2); border-radius: 6px; background: transparent; color: var(--ink); font-size: 12px; font-weight: 700;
}
.address-action.is-primary { border-color: var(--shu); background: var(--shu); color: var(--on-shu); }
.address-action:active { filter: brightness(0.95); }
.info-row {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%;
  padding: 16px 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); text-align: left;
}
.info-row > .ic:first-child { color: var(--ink3); }
.info-row > .ic:last-child { color: var(--ink3); }
.info-text { display: flex; flex-direction: column; min-width: 0; }
.info-label { font-size: 12px; color: var(--ink3); }
.info-value { margin-top: 2px; font-size: 15px; overflow-wrap: anywhere; }

/* ---------- Phrases utiles ---------- */
#phraseThemes { padding-bottom: 8px; }
.phrases-hint { margin: 4px 0 0; font-size: 12px; }
.phrase-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.phrase-main { display: flex; flex-direction: column; min-width: 0; padding: 0; border: 0; background: none; color: var(--ink); text-align: left; }
.phrase-ja { font-size: 21px; font-weight: 500; line-height: 1.4; letter-spacing: 0.02em; overflow-wrap: anywhere; }
.phrase-romaji { margin-top: 3px; font-size: 13px; font-style: italic; color: var(--ink3); }
.phrase-fr { margin-top: 4px; font-size: 15px; color: var(--ink2); }
.phrase-tools { display: flex; flex-direction: column; gap: 6px; }
.emergency-card { margin-top: 14px; background: var(--shu-soft); border-color: transparent; }

/* ---------- Images ---------- */
.album-news:not(:empty) { margin-bottom: 8px; }
.shared-strip { margin-bottom: 6px; }
.shared-strip-row { display: flex; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; margin: 0 calc(-1 * var(--gutter)); padding: 6px var(--gutter) 8px; scrollbar-width: none; }
.person-tile { flex: 0 0 auto; width: 72px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 0; border: 0; background: none; color: var(--ink); }
.person-avatar { position: relative; width: 66px; height: 66px; padding: 2px; border-radius: 50%; background: var(--line2); }
.person-avatar.has-new { background: var(--shu); }
.person-avatar img, .person-emoji {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; border-radius: 50%;
  border: 3px solid var(--bg); object-fit: cover; background: var(--field); color: var(--ink3);
}
.unread-count {
  flex: 0 0 auto; min-width: 22px; padding: 2px 7px; border-radius: 11px; background: var(--shu); color: var(--on-shu);
  font-size: 12px; font-weight: 700; text-align: center;
}
.person-unread { position: absolute; top: -4px; right: -8px; }
.person-name { max-width: 100%; margin-top: 3px; font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-sub { font-size: 11px; color: var(--ink3); white-space: nowrap; }
.person-sub.is-new { color: var(--shu); font-weight: 700; }
.album-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
.album-card { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 0; border: 0; background: none; color: var(--ink); text-align: left; }
.album-cover { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1; margin-bottom: 8px; border-radius: 6px; overflow: hidden; background: var(--field); color: var(--ink3); }
.album-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-name { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.album-count { font-size: 12px; color: var(--ink3); }
.album-count.has-unread { color: var(--shu); font-weight: 700; }
.album-badge {
  position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 12px;
  background: var(--shu); color: var(--on-shu); font-size: 12px; font-weight: 700;
}
.bleed-x { margin: 0 calc(-1 * var(--gutter)); }
.photo-day { margin: 20px var(--gutter) 8px; font-size: 13px; font-weight: 700; color: var(--ink2); }
.photo-day:first-child { margin-top: 4px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; grid-auto-flow: dense; }
.photo-grid.has-lead .photo-cell:first-child { grid-column: span 2; grid-row: span 2; }
.photo-cell { position: relative; aspect-ratio: 1; padding: 0; border: 0; overflow: hidden; background: var(--field); }
.photo-cell img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.12s; }
img.is-missing { opacity: 0; }
.selecting .photo-cell::after {
  content: ""; position: absolute; top: 6px; right: 6px; width: 22px; height: 22px;
  border: 2px solid #FFFFFF; border-radius: 50%; background: rgba(0, 0, 0, 0.25); box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}
.selecting .photo-cell.is-selected::after {
  background: var(--shu) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.selecting .photo-cell.is-selected img { transform: scale(0.86); border-radius: 4px; }
.photo-badge {
  position: absolute; right: 4px; bottom: 4px; display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border-radius: 10px;
  background: rgba(0, 0, 0, 0.62); color: #FFFFFF; font-size: 11px; font-weight: 700; line-height: 1.5;
}
.photo-badge.is-unread { background: var(--shu); color: var(--on-shu); }
.row-thumb { flex: 0 0 auto; width: 46px; height: 46px; object-fit: cover; border-radius: 6px; background: var(--field); }

/* ---------- Documents ---------- */
.doc-thumb {
  flex: 0 0 auto; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; overflow: hidden; background: var(--field); color: var(--ink2);
}
.doc-thumb.has-image { width: 44px; height: 44px; }
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.doc-thumb.is-page { padding: 3px; }
.doc-thumb.is-page img { object-fit: contain; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25)); }
.doc-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.folder-head { margin-top: 20px; }
#docsContent .add-row { margin-top: 12px; }
#docsShared:not(:empty), #docsContent:not(:empty), #notesShared:not(:empty), #addressShared:not(:empty) { margin-top: 12px; }
#docsContent > .group-head:first-child { margin-top: 16px; }

/* ---------- Pièces jointes ---------- */
.attachments { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.attachments:empty { display: none; }
.attachment { display: flex; align-items: center; gap: 12px; padding: 8px 6px 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; }
.attachment-icon { flex: 0 0 auto; display: inline-flex; color: var(--ink2); }
.attachment-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.attachment-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attachment-size { font-size: 12px; color: var(--ink3); }

/* ---------- Partage ---------- */
.share-intro { padding: 4px 0; }
.intro-icon { display: inline-flex; width: 52px; height: 52px; align-items: center; justify-content: center; border-radius: 50%; background: var(--sage-soft); color: var(--sage); }
.share-intro-title { margin: 14px 0 6px; font-family: var(--mincho); font-size: 22px; font-weight: 600; }
.status-card { display: flex; align-items: flex-start; gap: 14px; padding: 18px; border-radius: 8px; background: var(--sage-soft); }
.status-icon { flex: 0 0 auto; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--sage); color: var(--bg); }
.status-card.is-busy { background: var(--ai-soft); }
.status-card.is-busy .status-icon { background: var(--ai); }
.status-card.is-busy .status-icon .ic { animation: spin 1.1s linear infinite; }
.status-card.is-off { background: var(--field); }
.status-card.is-off .status-icon { background: var(--ink3); }
.status-card.is-alert { background: var(--shu-soft); }
.status-card.is-alert .status-icon { background: var(--shu); color: var(--on-shu); }
.status-text { min-width: 0; }
.status-title { margin: 0; font-size: 16px; font-weight: 700; }
.cloud-status { min-height: 1.4em; margin: 3px 0 0; font-size: 13px; line-height: 1.5; color: var(--ink2); }
.cloud-status .link-btn { padding: 0; font-size: inherit; }
.profile-head { display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.profile-main { min-width: 0; }
.profile-name { margin: 0; font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.profile-email { margin: 2px 0 0; font-size: 13px; color: var(--ink3); overflow-wrap: anywhere; }
.code-row { display: flex; align-items: center; gap: 10px; }
.profile-code {
  flex: 1; min-width: 0; height: 48px; display: flex; align-items: center; margin: 0; padding: 0 14px;
  border: 1px solid var(--line2); border-radius: 6px; font-size: 16px; font-weight: 700; letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums; user-select: all;
}
.code-row .primary-btn { min-height: 48px; }
.images-hint .link-btn { padding: 0; font-size: inherit; }
.toggle-row { cursor: pointer; }
.toggle-row .list-row-title, .toggle-row .list-row-sub { display: block; }
.usage-card { margin-top: 4px; }
.usage-total { margin: 0 0 10px; font-size: 15px; font-weight: 700; }
.usage-bar { display: block; height: 4px; margin-bottom: 6px; border-radius: 2px; background: var(--line); overflow: hidden; }
.usage-bar-fill { display: block; height: 100%; border-radius: 2px; background: var(--sage); }
.usage-card.is-full .usage-bar-fill { background: var(--warn); }
.usage-warning { color: var(--warn); font-weight: 700; }
.usage-card .link-btn { padding: 4px 0 0; }
.source-card { margin-top: 18px; }
.source-card .card-text { font-size: 14px; }
.account-form .hint { margin-top: 6px; }
.shared-note { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.shared-entry .list-row-title { font-size: 15px; }

/* ---------- Paramètres ---------- */
.setting-label { margin: 0 0 10px; font-size: 15px; font-weight: 500; }
.theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.theme-tile {
  height: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line2); border-radius: 6px; background: transparent; color: var(--ink2); font-size: 13px; font-weight: 700;
}
.theme-tile[aria-checked="true"] { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.setting-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 13px 0;
  border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); text-align: left;
}
button.setting-row:active { background: var(--field); }
.setting-row > .ic { color: var(--ink3); }
.switch-row { margin-top: 10px; cursor: pointer; }
.setting-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.setting-title { font-size: 15px; font-weight: 500; }
.setting-sub { margin-top: 2px; font-size: 12px; color: var(--ink3); }
.setting-value { flex: 0 0 auto; max-width: 50%; font-size: 14px; color: var(--ink2); text-align: right; }
.backup-info { margin: 10px 0 4px; font-size: 13px; font-weight: 700; line-height: 1.45; color: var(--sage); }
.backup-info.is-late { color: var(--warn); }

/* ---------- Photo : description et commentaires ---------- */
.photo-detail-img { display: block; width: 100%; max-height: 62vh; object-fit: contain; border-radius: 8px; background: #0B0B0C; cursor: zoom-in; }
#photoDetail.is-editing .photo-detail-img { max-height: 26vh; }
.caption-card { margin-top: 14px; }
.caption-meta { margin: 0 0 6px; font-size: 12px; color: var(--ink3); }
.caption-author { font-weight: 700; color: var(--ink); }
.caption-text { margin: 0; font-size: 15px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.caption-empty { margin: 0; }
.caption-input { min-height: 84px; }
.caption-intro { margin: 0 0 4px; }
.caption-card .link-btn { margin-top: 6px; }
.location-link {
  display: inline-flex; align-items: center; gap: 5px; margin: 0 0 6px; padding: 2px 0; border: 0; background: none;
  color: var(--shu); font-size: 14px; font-weight: 700; text-align: left;
}
.comments { margin-top: 6px; }
.comment { padding: 12px 0 8px; border-bottom: 1px solid var(--line); }
.comment.is-new { margin: 2px -10px; padding-left: 10px; padding-right: 10px; border-radius: 6px; background: var(--shu-soft); }
.comment.is-pending { opacity: 0.6; }
.comment-head { margin: 0 0 2px; font-size: 14px; }
.comment-author { font-weight: 700; }
.comment-time { margin-left: 8px; font-size: 12px; color: var(--ink3); }
.comment-text { margin: 0; font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-actions { display: flex; gap: 16px; }
.comment-actions .link-btn { padding: 6px 0; font-size: 12px; }
.comment-failed { margin: 2px 0 0; font-size: 12px; color: var(--shu); }

/* ---------- Texte mis en forme (markdown) ---------- */
.markdown { margin: 8px 0 12px; font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.markdown > :first-child { margin-top: 0; }
.markdown p { margin: 0 0 0.8em; }
.markdown h1, .markdown h2, .markdown h3, .markdown h4, .markdown h5, .markdown h6 { margin: 1.1em 0 0.5em; font-family: var(--mincho); font-weight: 600; line-height: 1.3; }
.markdown h1 { font-size: 1.5rem; }
.markdown h2 { font-size: 1.3rem; }
.markdown h3 { font-size: 1.12rem; }
.markdown h4, .markdown h5, .markdown h6 { font-size: 1rem; }
.markdown ul, .markdown ol { margin: 0 0 0.8em; padding-left: 1.4em; }
.markdown li { margin: 0.2em 0; }
.markdown li > p { margin: 0; }
.markdown li.task-item { list-style: none; margin-left: -1.4em; }
.markdown li.task-item li.task-item { margin-left: -1.4em; }
.markdown .task-box { width: 1.15em; height: 1.15em; margin: 0 0.45em 0 0; vertical-align: -0.2em; accent-color: var(--shu); }
.markdown li.task-item:has(> .task-box:checked),
.markdown li.task-item:has(> p > .task-box:checked) { color: var(--ink3); text-decoration: line-through; }
.markdown blockquote { margin: 0 0 0.8em; padding: 2px 0 2px 14px; border-left: 2px solid var(--shu); color: var(--ink2); }
.markdown code { font-family: ui-monospace, "Roboto Mono", monospace; font-size: 0.9em; background: var(--code-bg); border-radius: 4px; padding: 1px 5px; }
.markdown pre { margin: 0 0 0.8em; padding: 10px 12px; border-radius: 6px; background: var(--code-bg); overflow-x: auto; }
.markdown pre code { background: none; padding: 0; }
.markdown hr { border: none; border-top: 1px solid var(--line); margin: 1.2em 0; }
.markdown a { color: var(--shu); }
.markdown del { color: var(--ink3); }
.md-table { overflow-x: auto; margin: 0 0 0.8em; }
.markdown table { border-collapse: collapse; font-size: 0.92rem; }
.markdown th, .markdown td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.markdown th { background: var(--code-bg); }

/* ---------- Barres du bas : mise en forme, sélection, commentaire ---------- */
.md-toolbar {
  display: flex; gap: 2px; flex: 0 0 auto; overflow-x: auto; scrollbar-width: none;
  padding: 6px calc(var(--safe-right) + 8px) calc(var(--safe-bottom) + 6px) calc(var(--safe-left) + 8px);
  background: var(--surface); border-top: 1px solid var(--line);
}
.md-toolbar button {
  flex: 0 0 auto; width: 44px; height: 40px; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 6px; background: transparent; color: var(--ink);
}
.md-toolbar button:active { background: var(--field); color: var(--shu); }
.selection-bar {
  display: flex; align-items: center; gap: 8px; flex: 0 0 auto;
  padding: 10px calc(var(--safe-right) + 12px) calc(var(--safe-bottom) + 10px) calc(var(--safe-left) + 12px);
  background: var(--surface); border-top: 1px solid var(--line);
}
.selection-count { flex: 1; font-size: 14px; font-weight: 700; }
.comment-bar {
  display: flex; align-items: flex-end; gap: 8px; flex: 0 0 auto;
  padding: 8px calc(var(--safe-right) + 10px) calc(var(--safe-bottom) + 8px) calc(var(--safe-left) + 10px);
  background: var(--surface); border-top: 1px solid var(--line);
}
.comment-input {
  flex: 1; min-width: 0; height: 42px; max-height: 120px; padding: 10px 14px;
  border: 1px solid var(--line2); border-radius: 6px; outline: none; resize: none;
  background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.3;
}
.comment-input:focus { border-color: var(--ink); }
.comment-send { flex: 0 0 auto; height: 42px; padding: 0 16px; border: 0; border-radius: 6px; background: var(--shu); color: var(--on-shu); font-weight: 700; font-size: 14px; }

/* ---------- Bandeau (mise à jour, installation) ----------
   Dans #app, sous le contenu et au-dessus de la barre du bas : il ne cache rien. */
.banner {
  flex: 0 0 auto; align-self: center; width: calc(100% - 24px - var(--safe-left) - var(--safe-right)); max-width: 520px;
  margin: 8px 0; display: flex; align-items: center; gap: 10px; padding: 10px 6px 10px 16px; border-radius: 8px;
  background: var(--ink); color: var(--bg); animation: sIn 0.25s ease both;
}
#app:not(.has-tabbar):not(.has-bottom-bar) .banner { margin-bottom: calc(var(--safe-bottom) + 12px); }
.banner-text { flex: 1; margin: 0; font-size: 13px; line-height: 1.45; }
.banner-action { flex: 0 0 auto; height: 36px; padding: 0 14px; border: 0; border-radius: 6px; background: var(--shu); color: var(--on-shu); font-weight: 700; font-size: 13px; }
.banner-close { flex: 0 0 auto; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; background: transparent; color: inherit; opacity: 0.7; }

/* ---------- Feuille du bas ---------- */
.sheet { position: fixed; inset: 0; z-index: 45; }
.sheet-backdrop { position: absolute; inset: 0; background: var(--scrim); animation: fade 0.22s ease both; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; max-height: 88%; margin: 0 auto; overflow-y: auto;
  border-radius: 14px 14px 0 0; background: var(--surface);
  padding: 0 calc(var(--safe-right) + 24px) calc(var(--safe-bottom) + 20px) calc(var(--safe-left) + 24px);
  animation: sheetUp 0.34s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.sheet-grabber { display: block; width: 36px; height: 4px; margin: 10px auto 10px; border-radius: 2px; background: var(--line2); }
.sheet-title { margin: 4px 0 6px; font-family: var(--mincho); font-size: 20px; font-weight: 600; overflow-wrap: anywhere; }
.sheet-heading { margin: 4px 0 0; font-family: var(--mincho); font-size: 24px; font-weight: 600; }
.sheet-intro { margin: 4px 0 0; font-size: 13px; color: var(--ink3); }
.sheet-list { display: flex; flex-direction: column; }
.sheet-item {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 52px; padding: 10px 0;
  border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 15px; text-align: left;
}
.sheet-item:last-child { border-bottom: 0; }
.sheet-item:active { background: var(--field); }
.sheet-item.is-danger { color: var(--shu); }
.sheet-item.is-selected { font-weight: 700; }
.sheet-icon { flex: 0 0 auto; width: 24px; display: inline-flex; justify-content: center; color: var(--ink2); }
.sheet-item.is-danger .sheet-icon { color: var(--shu); }
.sheet-item-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.sheet-item-sub { font-size: 12px; font-weight: 400; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-check { flex: 0 0 auto; display: inline-flex; color: var(--shu); }
.sheet-create { color: var(--shu); font-weight: 700; }
.sheet-create .sheet-icon { color: var(--shu); }
.sheet-empty { margin: 0; padding: 16px; color: var(--ink3); text-align: center; }
/* Ajout rapide */
.quick-sheet { padding-bottom: 4px; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.quick-tile {
  height: 104px; display: flex; flex-direction: column; justify-content: space-between; padding: 14px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); text-align: left;
}
.quick-tile .ic { color: var(--shu); }
.quick-tile:active { border-color: var(--ink); }
.quick-text { display: flex; flex-direction: column; }
.quick-label { font-size: 15px; font-weight: 700; }
.quick-sub { margin-top: 2px; font-size: 12px; color: var(--ink3); }
/* Sélecteur d'emojis (texte des notes) */
.emoji-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 0 0 8px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.emoji-tab { flex: 0 0 auto; width: 44px; height: 40px; border: 0; border-radius: 6px; background: transparent; font-size: 1.35rem; }
.emoji-tab[aria-selected="true"] { background: var(--field); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); max-height: 42vh; overflow-y: auto; padding-top: 8px; }
.emoji-cell { height: 46px; padding: 0; border: 0; border-radius: 6px; background: transparent; font-size: 1.6rem; }
.emoji-cell:active { background: var(--field); }

/* ---------- Boîte de dialogue, progression ---------- */
.dialog { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px; }
#progress { z-index: 55; }
.dialog-backdrop { position: absolute; inset: 0; background: var(--scrim); animation: fade 0.2s ease both; }
.dialog-box {
  position: relative; width: 100%; max-width: 360px; padding: 22px 20px 16px; border-radius: 10px;
  background: var(--surface); box-shadow: var(--shadow); animation: sIn 0.22s ease both;
}
.dialog-title { margin: 0 0 10px; font-family: var(--mincho); font-size: 20px; font-weight: 600; line-height: 1.3; }
.dialog-message { margin: 0 0 20px; font-size: 15px; line-height: 1.55; white-space: pre-line; }
.dialog-field { margin: 0 0 20px; }
.dialog-actions { display: flex; gap: 10px; }
.dialog-actions > * { flex: 1; }
.progress-track { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.progress-bar { width: 0; height: 100%; background: var(--shu); transition: width 0.2s; }

/* ---------- Message temporaire ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-bottom) + 86px); z-index: 60;
  display: flex; align-items: center; gap: 8px; width: max-content; max-width: calc(100% - 48px); /* (sans width : coupé à mi-écran) */
  padding: 11px 16px; border-radius: 6px; background: var(--ink); color: var(--bg);
  font-size: 14px; font-weight: 500; line-height: 1.35; box-shadow: var(--shadow); transform: translateX(-50%);
}
.toast.toast-in { animation: toastIn 0.25s ease both; }
#app.has-banner ~ .toast { bottom: calc(var(--safe-bottom) + 150px); }

/* ---------- Visionneuse de photos : sombre, sans distraction ---------- */
.viewer { position: fixed; inset: 0; z-index: 30; background: #0B0B0C; color: #F2F0EA; animation: fade 0.25s ease both; }
.viewer-scroll {
  position: absolute; inset: 0; overflow: auto; display: flex;
  padding: calc(var(--safe-top) + 60px) calc(var(--safe-right) + 8px) calc(var(--safe-bottom) + 16px) calc(var(--safe-left) + 8px);
}
.viewer:not(.zoomed) .viewer-scroll { touch-action: none; }
/* margin:auto centre la photo tout en la laissant défiler entièrement une fois agrandie */
.viewer-scroll img { display: block; margin: auto; max-width: 100%; max-height: 100%; cursor: zoom-in; transition: transform 0.18s ease-out; }
.viewer.zoomed .viewer-scroll img { max-width: none; max-height: none; cursor: zoom-out; }
.viewer-scroll img.slide-next { animation: viewer-next 0.22s ease-out; }
.viewer-scroll img.slide-prev { animation: viewer-prev 0.22s ease-out; }
.viewer-status { position: absolute; left: 24px; right: 24px; top: 50%; transform: translateY(-50%); margin: 0; text-align: center; color: rgba(242, 240, 234, 0.8); font-size: 15px; pointer-events: none; }
.viewer-bar {
  position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 8px;
  padding: calc(var(--safe-top) + 6px) calc(var(--safe-right) + 8px) 8px calc(var(--safe-left) + 8px);
  background: linear-gradient(rgba(11, 11, 12, 0.7), rgba(11, 11, 12, 0)); pointer-events: none;
}
.viewer-bar > * { pointer-events: auto; }
.viewer-btn { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #F2F0EA; }
.viewer-btn:active { background: rgba(242, 240, 234, 0.14); }
.viewer-counter { flex: 1; text-align: center; color: #F2F0EA; opacity: 0.8; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; pointer-events: none; }
.viewer-actions { display: flex; gap: 4px; }
.viewer-nav {
  position: absolute; top: 50%; z-index: 1; width: 40px; height: 40px; margin-top: -20px; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 6px; background: rgba(11, 11, 12, 0.55); color: #F2F0EA;
}
.viewer-nav.is-prev { left: calc(var(--safe-left) + 8px); }
.viewer-nav.is-next { right: calc(var(--safe-right) + 8px); }
.viewer.zoomed .viewer-nav { display: none; }
.viewer-info {
  position: absolute; left: 0; right: 0; bottom: 0; color: #F2F0EA;
  padding: 32px calc(var(--safe-right) + 22px) calc(var(--safe-bottom) + 14px) calc(var(--safe-left) + 22px);
  background: linear-gradient(rgba(11, 11, 12, 0), rgba(11, 11, 12, 0.85));
}
.viewer-location { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 14px; font-weight: 700; cursor: pointer; }
.viewer-caption {
  margin: 0 0 10px; font-family: var(--mincho); font-size: 17px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; cursor: pointer;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.viewer-info-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px;
  border: 1px solid rgba(242, 240, 234, 0.3); border-radius: 6px; background: transparent; color: #F2F0EA; font-weight: 700; font-size: 13px;
}.viewer-info-btn.is-unread { border-color: var(--shu); background: var(--shu); color: var(--on-shu); }
.viewer.has-info .viewer-scroll { padding-bottom: calc(var(--safe-bottom) + 120px); }

/* ---------- Visionneuse de documents ---------- */
.doc-viewer { position: fixed; inset: 0; z-index: 31; display: flex; flex-direction: column; background: var(--bg); animation: fade 0.2s ease both; }
.doc-bar {
  flex: 0 0 auto; display: flex; align-items: center; gap: 4px;
  padding: calc(var(--safe-top) + 6px) calc(var(--safe-right) + 6px) 6px calc(var(--safe-left) + 6px);
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.doc-heading { flex: 1; min-width: 0; }
.doc-title { margin: 0; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-info { margin: 2px 0 0; font-size: 12px; color: var(--ink3); }
.doc-body { position: relative; flex: 1; overflow: auto; overscroll-behavior: contain; touch-action: pan-x pan-y; padding: 0 var(--safe-right) var(--safe-bottom) var(--safe-left); }
.kind-pdf .doc-body { background: var(--pdf-bg); }
.kind-image .doc-body, .kind-video .doc-body { background: #0B0B0C; }
.doc-loading { margin: 48px 16px; text-align: center; color: var(--ink3); }
.pdf-pages { width: max-content; min-width: 100%; padding: 8px 8px 72px; }
.pdf-page { position: relative; margin: 0 auto 10px; background: #FFFFFF; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); }
.pdf-page canvas { display: block; width: 100%; height: 100%; }
.zoom-image { display: flex; width: max-content; min-width: 100%; min-height: 100%; padding: 8px; }
.zoom-image img { display: block; margin: auto; max-width: none; }
.doc-media { display: flex; align-items: center; justify-content: center; height: 100%; }
.doc-media video { display: block; max-width: 100%; max-height: 100%; }
.doc-card {
  display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 420px; margin: 40px auto; padding: 28px 20px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); text-align: center;
}
.doc-card-icon { display: inline-flex; color: var(--ink3); }
.doc-card-name { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.doc-card .hint { margin: 0; }
.doc-card button { flex: 0 0 auto; width: 100%; }
.doc-card audio { width: 100%; }
.doc-paper { max-width: 760px; margin: 12px auto; padding: 18px 16px; border-radius: 8px; background: var(--surface); }
.doc-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, "Roboto Mono", monospace; font-size: 0.85rem; line-height: 1.5; }
.doc-page {
  position: absolute; left: calc(var(--safe-left) + 14px); bottom: calc(var(--safe-bottom) + 22px);
  padding: 6px 12px; border-radius: 6px; background: rgba(11, 11, 12, 0.65); color: #F2F0EA;
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; pointer-events: none;
}
.doc-zoom { position: absolute; right: calc(var(--safe-right) + 14px); bottom: calc(var(--safe-bottom) + 18px); display: flex; flex-direction: column; gap: 8px; }
.doc-zoom button {
  width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; padding: 0;
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}

/* ---------- À montrer en plein écran : adresse pour le taxi, phrase en japonais ---------- */
.show-card {
  position: fixed; inset: 0; z-index: 35; display: flex; flex-direction: column; overflow-y: auto;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  background: var(--surface); color: var(--ink); animation: fade 0.22s ease both;
}
.show-bar { display: flex; justify-content: space-between; align-items: center; padding: 4px 10px; }
.show-main { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 12px 28px 48px; }
.show-kicker { margin: 0 0 14px; font-size: 20px; color: var(--ink2); }
.show-ja { margin: 0; font-size: clamp(30px, 10vw, 44px); font-weight: 700; line-height: 1.4; letter-spacing: 0.02em; overflow-wrap: anywhere; white-space: pre-wrap; }
.show-accent { display: block; width: 36px; height: 2px; margin: 24px 0 18px; background: var(--shu); }
.show-sub { margin: 0; font-size: 15px; font-style: italic; color: var(--ink3); overflow-wrap: anywhere; }
.show-fr { margin: 6px 0 0; font-size: 18px; color: var(--ink2); }
.show-foot { margin: 0 28px 24px; font-size: 12px; color: var(--ink3); text-align: center; }
