:root {
  --ai: #16233f;            /* indigo japonais (ai) */
  --ai-deep: #0f1830;
  --ai-night: #0b1226;
  --shu: #e60027;           /* vermillon (shu) */
  --shu-soft: #ff3d55;
  --gold: #d9b26a;
  --washi: #f4efe4;
  --ink: #1b1b24;
  --paper: #f4efe4;
  --card: #ffffff;
  --muted: #6b7280;
  --line: #e4ddcd;
  --ok: #1a8a52;
  --warn: #d97706;
  --danger: #dc2626;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 10px 30px rgba(0,0,0,.08);
  --mincho: "Shippori Mincho", "Yu Mincho", "Hiragino Mincho ProN", serif;
  --gothic: "Zen Kaku Gothic New", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* motif seigaiha (vagues) */
  --seigaiha: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='50'%3E%3Cg fill='none' stroke='%239fb3d6' stroke-opacity='0.09' stroke-width='2'%3E%3Ccircle cx='0' cy='25' r='24'/%3E%3Ccircle cx='0' cy='25' r='16'/%3E%3Ccircle cx='0' cy='25' r='8'/%3E%3Ccircle cx='50' cy='25' r='24'/%3E%3Ccircle cx='50' cy='25' r='16'/%3E%3Ccircle cx='50' cy='25' r='8'/%3E%3Ccircle cx='100' cy='25' r='24'/%3E%3Ccircle cx='100' cy='25' r='16'/%3E%3Ccircle cx='100' cy='25' r='8'/%3E%3Ccircle cx='25' cy='0' r='24'/%3E%3Ccircle cx='25' cy='0' r='16'/%3E%3Ccircle cx='25' cy='0' r='8'/%3E%3Ccircle cx='75' cy='0' r='24'/%3E%3Ccircle cx='75' cy='0' r='16'/%3E%3Ccircle cx='75' cy='0' r='8'/%3E%3Ccircle cx='25' cy='50' r='24'/%3E%3Ccircle cx='25' cy='50' r='16'/%3E%3Ccircle cx='25' cy='50' r='8'/%3E%3Ccircle cx='75' cy='50' r='24'/%3E%3Ccircle cx='75' cy='50' r='16'/%3E%3Ccircle cx='75' cy='50' r='8'/%3E%3C/g%3E%3C/svg%3E");
  font-family: var(--gothic);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }
.jp { font-family: var(--mincho); }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(1000px 500px at 50% -5%, #22345c 0%, var(--ai-deep) 55%, var(--ai-night) 100%); }
.login::before { content: ''; position: fixed; inset: 0; background-image: var(--seigaiha); background-size: 120px 60px; opacity: .5; pointer-events: none; }
.login-card { position: relative; background: rgba(20,28,52,.9); border: 1px solid #2c3a5e; border-radius: 20px; padding: 38px 30px;
  width: 100%; max-width: 350px; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.55); color: #fff; backdrop-filter: blur(8px); }
.login-flag { width: 58px; height: 58px; margin: 0 auto 6px; border-radius: 50%; background: var(--shu); box-shadow: 0 0 40px rgba(230,0,39,.6); }
.login-card h1 { margin: 12px 0 2px; font-size: 30px; font-family: var(--mincho); font-weight: 800; letter-spacing: .06em; }
.login-card p { margin: 0 0 22px; color: #9fb0cc; }
.login-card input { width: 100%; padding: 13px 14px; border: 1px solid #33436a; border-radius: 12px; font-size: 16px; margin-bottom: 12px; background: #0e1730; color: #fff; }
.login-card button { width: 100%; padding: 13px; border: none; border-radius: 12px; background: var(--shu); color: #fff; font-size: 16px; font-weight: 700; letter-spacing: .02em; }
.login-error { color: #ff9d9d; font-size: 14px; margin-top: 10px; min-height: 18px; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(11,18,38,.92); backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid #23304f; color: #fff; }
.topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -8px; height: 8px; background: var(--seigaiha); background-size: 80px 40px; opacity: .5; }
.brand { display: flex; align-items: center; gap: 11px; cursor: pointer; }
.brand .torii { font-size: 22px; filter: drop-shadow(0 2px 6px rgba(230,0,39,.5)); }
.brand-title { font-weight: 800; font-size: 18px; line-height: 1.1; letter-spacing: .01em; }
.brand-title .jp { color: var(--shu-soft); margin-right: 4px; }
.brand-sub { font-size: 12px; color: #93a4c4; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.modeswitch { display: flex; background: #14203c; border: 1px solid #2b3a5e; border-radius: 999px; padding: 3px; }
.modeswitch button { border: none; background: none; color: #aebbd6; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.modeswitch button.active { background: var(--shu); color: #fff; box-shadow: 0 3px 12px rgba(230,0,39,.4); }
.save-state { font-size: 12px; color: #93a4c4; min-width: 10px; }
.save-state.saving { color: var(--gold); }
.save-state.saved { color: #74e0a3; }
.ghost { background: none; border: 1px solid #33436a; border-radius: 10px; padding: 6px 10px; font-size: 15px; color: #aebbd6; }

/* =======================================================
   MODE VISUEL — carnet japonais
   ======================================================= */
#visuel { position: relative; background: radial-gradient(1200px 700px at 50% -8%, #22345c 0%, var(--ai-deep) 45%, var(--ai-night) 100%); min-height: calc(100vh - 56px); color: #fff; }
#visuel::before { content: ''; position: fixed; inset: 56px 0 0 0; background-image: var(--seigaiha); background-size: 140px 70px; opacity: .45; pointer-events: none; z-index: 0; }

.vhome-head { position: relative; z-index: 2; padding: 34px 20px 10px; text-align: center; }
.vhome-kanji { font-family: var(--mincho); font-size: 68px; font-weight: 800; letter-spacing: .1em; line-height: 1; color: #fff;
  text-shadow: 0 4px 30px rgba(0,0,0,.5); }
.vhome-kanji .sun { display: inline-block; width: 46px; height: 46px; border-radius: 50%; background: var(--shu); vertical-align: middle; margin: 0 6px; box-shadow: 0 0 34px rgba(230,0,39,.65); }
.vhome-title { font-family: var(--mincho); font-size: 22px; font-weight: 700; margin-top: 10px; letter-spacing: .04em; }
.vhome-sub { color: #9fb0cc; margin-top: 4px; font-size: 14px; }
.vhome-countdown { display: inline-block; margin-top: 12px; font-family: var(--mincho); font-weight: 700; font-size: 15px; color: #fff; background: var(--shu); padding: 7px 18px; border-radius: 999px; box-shadow: 0 6px 20px rgba(230,0,39,.4); }
.vhome-struct { display: block; margin: 12px auto 0; width: fit-content; font-size: 12px; color: #d6def0; background: rgba(255,255,255,.06); border: 1px solid #33436a; padding: 6px 14px; border-radius: 999px; }
.vcard.today { outline: 3px solid var(--shu); outline-offset: 0; box-shadow: 0 0 0 6px rgba(230,0,39,.25), 0 14px 34px rgba(0,0,0,.4); }
.vcard .today-flag { position: absolute; top: 40px; left: 14px; z-index: 2; font-size: 10px; font-weight: 800; background: var(--shu); color: #fff; padding: 3px 8px; border-radius: 999px; }
.vhome-actions { position: relative; z-index: 2; text-align: center; margin-top: 16px; }
.jbtn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--shu); background: rgba(230,0,39,.14); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 700; }
.jbtn:hover { background: var(--shu); }
.jbtn.small { padding: 7px 12px; font-size: 12px; }

.vgrid { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; padding: 20px 20px 100px; max-width: 1120px; margin: 0 auto; }
.vcard { position: relative; border-radius: 18px; overflow: hidden; aspect-ratio: 3/4; cursor: pointer; background: #14203c;
  border: 1px solid #2a3a5e; box-shadow: 0 14px 34px rgba(0,0,0,.4); transition: transform .14s, box-shadow .14s; }
.vcard:hover { transform: translateY(-4px); box-shadow: 0 22px 46px rgba(0,0,0,.5); }
.vcard img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .45s ease, transform .5s; }
.vcard img.bg.loaded { opacity: 1; }
.vcard:hover img.bg { transform: scale(1.06); }
.vcard .veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(9,14,30,.15) 0%, rgba(9,14,30,.15) 38%, rgba(9,14,30,.86) 100%); }
.vcard .kanji { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--mincho); font-size: 88px; font-weight: 800; opacity: .16; color: #fff; }
.vcard .content { position: absolute; inset: 0; padding: 15px; display: flex; flex-direction: column; justify-content: flex-end; }
.vcard .cid { position: absolute; top: 12px; left: 14px; font-family: var(--mincho); font-weight: 800; font-size: 16px; text-shadow: 0 1px 6px rgba(0,0,0,.7); }
.vcard .ccity { position: absolute; top: 13px; right: 13px; font-size: 10px; font-weight: 800; letter-spacing: .06em; padding: 4px 9px; border-radius: 999px; background: rgba(0,0,0,.45); backdrop-filter: blur(4px); }
.vcard .cdate { font-size: 11px; color: #dbe3f2; margin-bottom: 3px; letter-spacing: .04em; }
.vcard .ctitle { font-family: var(--mincho); font-size: 16px; font-weight: 700; line-height: 1.25; text-shadow: 0 1px 8px rgba(0,0,0,.7); }
.vcard .cmeta { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.vcard .chip { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.16); backdrop-filter: blur(3px); }
.vcard .chip.hotelok { background: rgba(116,224,163,.22); color: #8ff0ba; }
.vcard .chip.hotelno { background: rgba(255,138,138,.2); color: #ffa2a2; }
.vcard .chip.doc { background: rgba(217,178,106,.24); color: #f0d29a; }

/* ---- Page jour immersive ---- */
.vday { position: relative; min-height: calc(100vh - 56px); }
.vday-bg { position: fixed; inset: 56px 0 0 0; z-index: 0; overflow: hidden; background: #0b1226; }
.vday-bg-img { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity .5s ease; }
.vday-bg-img.loaded { opacity: 1; }
.vday-bg .veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(9,14,30,.55) 0%, rgba(9,14,30,.4) 26%, rgba(9,14,30,.94) 100%); }
.vday-bg .kanji-water { position: absolute; right: 2vw; top: 4vh; font-family: var(--mincho); font-size: 34vh; font-weight: 800; color: #fff; opacity: .06; line-height: 1; user-select: none; }
.vday-inner { position: relative; z-index: 2; max-width: 1120px; margin: 0 auto; padding: 18px 18px 120px; }
.vday-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vday-nav button { border: 1px solid rgba(255,255,255,.28); background: rgba(9,14,30,.4); color: #fff; border-radius: 999px; padding: 9px 16px; font-size: 14px; font-weight: 700; backdrop-filter: blur(6px); }
.vday-nav button:disabled { opacity: .35; }
.vday-head { margin-top: 12px; }
.vday-kicker { font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.vday-title { font-family: var(--mincho); font-size: clamp(28px, 5.4vw, 50px); font-weight: 800; letter-spacing: .01em; line-height: 1.06; margin: 8px 0; text-shadow: 0 3px 26px rgba(0,0,0,.6); }
.vday-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.vbadge { font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.14); backdrop-filter: blur(4px); }
.vbadge.risk.low { background: rgba(116,224,163,.22); color: #8ff0ba; }
.vbadge.risk.mid { background: rgba(217,178,106,.26); color: #f0d29a; }
.vbadge.risk.high { background: rgba(255,120,120,.24); color: #ffa2a2; }
.vbadge.act { cursor: pointer; border: 1px solid rgba(255,255,255,.3); }

.vlayout { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 22px; }
@media (min-width: 880px) { .vlayout { grid-template-columns: 1.45fr .9fr; align-items: start; } }

.panel-label { font-family: var(--mincho); font-size: 15px; font-weight: 700; color: #ffd9dd; letter-spacing: .05em; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.panel-label::before { content: ''; width: 7px; height: 18px; background: var(--shu); border-radius: 2px; }

/* timeline */
.timeline { position: relative; }
.tl-item { position: relative; display: grid; grid-template-columns: 60px 1fr; gap: 14px; padding: 2px 0 18px; }
.tl-item::before { content: ''; position: absolute; left: 68px; top: 26px; bottom: -4px; width: 2px; background: rgba(255,255,255,.16); }
.tl-item:last-child::before { display: none; }
.tl-time { text-align: right; font-family: var(--mincho); font-weight: 700; font-size: 15px; color: #ffd9dd; padding-top: 5px; }
.tl-time.empty { color: #7f8db0; }
.tl-body { position: relative; background: rgba(14,22,42,.74); border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 12px 15px; backdrop-filter: blur(8px); }
.tl-body::before { content: ''; position: absolute; left: -16px; top: 14px; width: 12px; height: 12px; border-radius: 50%; background: var(--shu); box-shadow: 0 0 0 4px rgba(230,0,39,.22); }
.tl-title { font-size: 15px; font-weight: 700; line-height: 1.3; }
.tl-note { font-size: 13px; color: #c3ccdf; margin-top: 4px; line-height: 1.4; }
.tl-empty { color: #9fb0cc; font-style: italic; padding: 10px 0; }
.tl-map { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 700; color: #cdd6ea; text-decoration: none; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; padding: 4px 9px; }
.tl-map:hover { background: rgba(255,255,255,.08); }
.tl-edit-btn { position: absolute; top: 8px; right: 8px; border: none; background: rgba(255,255,255,.12); color: #fff; border-radius: 9px; width: 36px; height: 36px; font-size: 15px; opacity: .7; transition: opacity .15s; }
.tl-body:hover .tl-edit-btn { opacity: 1; }
.tl-title { padding-right: 40px; }
.tl-body { position: relative; }
.tl-in { width: 100%; border: 1px solid rgba(255,255,255,.25); background: rgba(9,14,30,.6); color: #fff; border-radius: 9px; padding: 9px 10px; font-size: 14px; font-family: inherit; }
.tl-in::placeholder { color: #8090b0; }
.tl-editrow { display: grid; grid-template-columns: 110px 1fr; gap: 8px; margin-bottom: 8px; }
.tl-in.time { text-align: center; }
textarea.tl-in { min-height: 48px; resize: vertical; margin-bottom: 8px; }
.tl-editacts { display: flex; gap: 8px; }
.tl-ok { flex: 1; border: none; background: var(--shu); color: #fff; border-radius: 9px; padding: 9px; font-weight: 700; font-size: 13px; }
.tl-del { border: 1px solid rgba(255,138,138,.4); background: none; color: #ffa2a2; border-radius: 9px; padding: 9px 12px; font-weight: 700; font-size: 13px; }
.tl-add { width: 100%; margin-top: 4px; border: 1px dashed rgba(255,255,255,.25); background: rgba(255,255,255,.04); color: #dbe3f2; border-radius: 12px; padding: 12px; font-size: 14px; font-weight: 700; }
.tl-add:hover { background: rgba(255,255,255,.09); }
.vday-title-in { width: 100%; font-family: var(--mincho); font-size: clamp(26px, 5.2vw, 46px); font-weight: 800; letter-spacing: .01em; line-height: 1.06; margin: 8px 0; color: #fff; background: none; border: none; border-bottom: 2px solid transparent; text-shadow: 0 3px 26px rgba(0,0,0,.6); }
.vday-title-in:focus { outline: none; border-bottom-color: rgba(255,255,255,.4); }

.vside { display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 880px) { .vside { position: sticky; top: 74px; } }

/* carte hôtel */
.hotelcard { background: rgba(16,24,46,.86); border: 1px solid rgba(255,255,255,.12); border-radius: 18px; overflow: hidden; backdrop-filter: blur(10px); box-shadow: 0 18px 50px rgba(0,0,0,.5); }
.hotelcard .hc-photo { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; background: #1c2846; }
.hotelcard .hc-photo.placeholder { display: flex; align-items: center; justify-content: center; color: #4b5b80; font-size: 34px; }
.hotelcard .hc-body { padding: 15px; }
.hc-status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; padding: 4px 11px; border-radius: 999px; margin-bottom: 8px; }
.hc-status.ok { background: rgba(116,224,163,.18); color: #8ff0ba; }
.hc-status.no { background: rgba(255,138,138,.16); color: #ffa2a2; }
.hc-name { font-family: var(--mincho); font-size: 17px; font-weight: 700; line-height: 1.25; }
.hc-site { font-size: 12px; color: #9fb0cc; margin-top: 2px; }
.hc-addr { font-size: 13px; color: #cdd6ea; margin-top: 8px; line-height: 1.35; }
.hc-actions { display: flex; gap: 8px; margin-top: 12px; }
.hc-btn { flex: 1; text-align: center; text-decoration: none; font-size: 13px; font-weight: 700; padding: 10px; border-radius: 11px; border: 1px solid rgba(255,255,255,.18); color: #fff; background: rgba(255,255,255,.06); }
.hc-btn.primary { background: var(--shu); border-color: var(--shu); }
.hc-map { width: 100%; height: 150px; border: none; display: block; background: #1c2846; }
.hc-empty { padding: 24px 16px; text-align: center; }
.hc-empty p { color: #9fb0cc; font-size: 13px; margin: 6px 0 12px; }
.hc-empty button { background: var(--shu); color: #fff; border: none; border-radius: 11px; padding: 10px 16px; font-weight: 700; font-size: 13px; }

/* documents card (visuel) */
.doccard { background: rgba(16,24,46,.86); border: 1px solid rgba(255,255,255,.12); border-radius: 18px; padding: 15px; backdrop-filter: blur(10px); box-shadow: 0 18px 50px rgba(0,0,0,.45); }
.doc-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.doc-row:last-child { border-bottom: none; }
.doc-ico { font-size: 22px; flex: none; }
.doc-info { min-width: 0; flex: 1; }
.doc-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { font-size: 11px; color: #9fb0cc; }
.doc-dl { text-decoration: none; color: #fff; border: 1px solid rgba(255,255,255,.2); border-radius: 9px; padding: 6px 10px; font-size: 12px; font-weight: 700; flex: none; }
.vloading { font-size: 12px; color: #9fb0cc; padding: 8px 0; }

/* =======================================================
   MODE GESTION (clair, accents japonais)
   ======================================================= */
#gestion { background: var(--paper); min-height: calc(100vh - 56px); }
#gestion::before { content: ''; position: fixed; inset: 56px 0 0 0; background-image: var(--seigaiha); background-size: 160px 80px; opacity: .25; pointer-events: none; filter: grayscale(1); }
.tabs { position: sticky; top: 56px; z-index: 15; background: rgba(244,239,228,.96); backdrop-filter: blur(6px); display: flex; gap: 6px; padding: 10px 12px;
  overflow-x: auto; border-bottom: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
.tabs button { white-space: nowrap; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.tabs button.active { background: var(--ai); color: #fff; border-color: var(--ai); }
main#main { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; padding: 16px 14px 90px; }
.section-title { font-family: var(--mincho); font-size: 15px; letter-spacing: .04em; color: var(--ai); margin: 18px 4px 12px; font-weight: 700; }

.days-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.day-card { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--shu); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-height: 118px; }
.day-head { display: flex; align-items: baseline; justify-content: space-between; }
.day-id { font-family: var(--mincho); font-weight: 800; font-size: 16px; }
.day-date { font-size: 11px; color: var(--muted); }
.day-city { font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.day-title { font-size: 13px; font-weight: 600; line-height: 1.25; }
.day-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.risk { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.risk.low { background: #d7f0e0; color: #15803d; }
.risk.mid { background: #fdeecb; color: #b45309; }
.risk.high { background: #fcdede; color: #b91c1c; }
.day-budget { font-size: 11px; color: var(--muted); }

/* Modal éditeur */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(11,18,38,.55); }
.modal-card { position: relative; background: var(--paper); width: 100%; max-width: 680px; max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.3); padding: 18px 16px 34px; }
@media (min-width: 680px) { .modal { align-items: center; } .modal-card { border-radius: 20px; } }
.modal-grip { width: 40px; height: 4px; background: var(--line); border-radius: 4px; margin: 0 auto 14px; }
.md-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.md-id { font-size: 13px; color: var(--muted); font-weight: 700; }
.md-close { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 6px 12px; font-size: 15px; }

.field { margin: 14px 0; }
.field > label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--ai); margin-bottom: 6px; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; font-size: 15px; background: var(--card); color: var(--ink); font-family: inherit; }
.field textarea { resize: vertical; min-height: 60px; line-height: 1.4; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.title-input { font-family: var(--mincho); font-size: 20px; font-weight: 800; border: none; background: none; width: 100%; padding: 4px 0; color: var(--ink); }
.title-input:focus { outline: none; border-bottom: 2px solid var(--shu); }

.tledit { display: flex; flex-direction: column; gap: 8px; }
.tlrow { display: grid; grid-template-columns: 20px 76px 1fr auto; gap: 8px; align-items: start; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.tlrow.dragging { opacity: .5; border-color: var(--shu); }
.tlrow .grip { cursor: grab; color: var(--muted); font-size: 16px; padding-top: 8px; text-align: center; user-select: none; touch-action: none; }
.tlrow .grip:active { cursor: grabbing; }
.tlrow input.t { border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-size: 14px; text-align: center; }
.tlrow .tt { display: flex; flex-direction: column; gap: 6px; }
.tlrow .tt input, .tlrow .tt textarea { border: 1px solid transparent; background: none; padding: 6px; font-size: 14px; border-radius: 8px; font-family: inherit; }
.tlrow .tt input:focus, .tlrow .tt textarea:focus { outline: none; border-color: var(--line); background: #faf7f0; }
.tlrow .tt .maintxt { font-weight: 600; }
.tlrow .del { border: none; background: none; color: var(--muted); font-size: 18px; padding: 4px 8px; }
.tlrow .del:hover { color: var(--danger); }
.add-item { border: 1px dashed var(--line); background: none; color: var(--muted); border-radius: 11px; padding: 10px; font-size: 14px; width: 100%; font-weight: 600; }

.media { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.media .preview { width: 92px; height: 60px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); background: #eee; flex: none; }
.media .preview.empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 20px; }
.media .mbtns { display: flex; gap: 8px; flex-wrap: wrap; }
.smallbtn { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 600; }
.smallbtn.accent { border-color: var(--shu); color: var(--shu); }

.unfurl { display: flex; gap: 10px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); margin-top: 8px; }
.unfurl img { width: 96px; height: 72px; object-fit: cover; flex: none; }
.unfurl .uf { padding: 8px 10px; min-width: 0; }
.unfurl .uf b { display: block; font-size: 14px; }
.unfurl .uf small { color: var(--muted); font-size: 12px; }

.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; min-width: 560px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
th { background: #faf6ec; font-size: 12px; letter-spacing: .03em; color: var(--ai); font-weight: 700; position: sticky; top: 0; }
tr:last-child td { border-bottom: none; }
td input, td select, td textarea { width: 100%; border: 1px solid transparent; background: none; padding: 6px; border-radius: 8px; font-size: 14px; font-family: inherit; color: var(--ink); }
td input:focus, td select:focus, td textarea:focus { outline: none; border-color: var(--line); background: #faf7f0; }
.status-pill { padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; border: none; cursor: pointer; }
.st-todo { background: #fcdede; color: #b91c1c; }
.st-wip { background: #fdeecb; color: #b45309; }
.st-done { background: #d7f0e0; color: #15803d; }

.check-cat { margin-top: 18px; }
.check-item { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; box-shadow: var(--shadow); }
.check-item input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--ok); flex: none; }
.check-item.done span { text-decoration: line-through; color: var(--muted); }
.check-item span { font-size: 15px; }

.budget-total { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; box-shadow: var(--shadow); flex: 1; min-width: 130px; }
.stat .k { font-size: 12px; color: var(--muted); letter-spacing: .03em; }
.stat .v { font-family: var(--mincho); font-size: 23px; font-weight: 800; }
.stat .v.small { font-size: 18px; }

.info-block { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.info-block h3 { margin: 0 0 10px; font-size: 15px; font-family: var(--mincho); color: var(--ai); }
.info-block ul { margin: 0; padding-left: 18px; }
.info-block li { margin-bottom: 8px; line-height: 1.4; font-size: 14px; }
.flights { display: grid; gap: 8px; }
.flight { font-size: 14px; line-height: 1.4; }
.flight b { color: var(--shu); }
.add-row { margin-top: 10px; border: 1px dashed var(--line); background: none; color: var(--muted); border-radius: 11px; padding: 11px; font-size: 14px; width: 100%; font-weight: 600; }
.del { cursor: pointer; }

/* Documents (gestion) */
.docwrap { display: flex; flex-direction: column; gap: 10px; }
.docitem { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); }
.docitem .big { font-size: 28px; flex: none; }
.docitem .grow { flex: 1; min-width: 0; }
.docitem .dn { font-weight: 700; font-size: 15px; word-break: break-word; }
.docitem .dm { font-size: 12px; color: var(--muted); margin-top: 2px; }
.docitem select { border: 1px solid var(--line); border-radius: 9px; padding: 7px; font-size: 13px; background: #faf7f0; font-family: inherit; }
.docitem .acts { display: flex; gap: 6px; flex: none; }
.docitem a.mini, .docitem button.mini { text-decoration: none; border: 1px solid var(--line); background: var(--card); border-radius: 9px; padding: 7px 10px; font-size: 13px; font-weight: 700; color: var(--ink); }
.dropzone { border: 2px dashed var(--line); border-radius: 16px; padding: 26px; text-align: center; color: var(--muted); background: var(--card); }
.dropzone.drag { border-color: var(--shu); background: #fff6f6; color: var(--shu); }
.dropzone .up { font-size: 34px; }
.dropzone button { background: var(--ai); color: #fff; border: none; border-radius: 11px; padding: 10px 18px; font-weight: 700; font-size: 14px; }
.docitem.todo { border-style: dashed; background: #fbf8f1; }
.docitem .mini.accentbtn { border-color: var(--shu); color: var(--shu); }
.daymulti { position: relative; }
.daymulti summary { list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 13px; font-weight: 600; background: #faf7f0; white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.daymulti summary::-webkit-details-marker { display: none; }
.daymulti[open] summary { border-color: var(--shu); }
.daymulti-panel { position: absolute; z-index: 20; right: 0; margin-top: 6px; width: 260px; max-height: 260px; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.daychip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 600; color: var(--ink); }
.daychip.on { background: var(--shu); color: #fff; border-color: var(--shu); }

/* ============ Optimisations mobile ============ */
@media (max-width: 640px) {
  /* évite le zoom auto iOS au focus (champs < 16px) */
  input, textarea, select, .title-input, .tl-in, .vday-title-in, td input, td select, td textarea { font-size: 16px !important; }

  /* barre du haut compacte */
  .topbar { padding: 9px 12px; }
  .brand .torii { font-size: 20px; }
  .brand-title { font-size: 15px; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .brand-sub { display: none; }
  .modeswitch button { padding: 8px 11px; font-size: 12px; }
  .topbar-right { gap: 7px; }

  /* cibles tactiles plus grandes */
  .vday-nav button { padding: 11px 16px; }
  .tabs button { padding: 10px 15px; }
  .hc-btn { padding: 12px; }

  /* documents : actions qui passent à la ligne proprement */
  .docitem { flex-wrap: wrap; }
  .docitem .acts { width: 100%; justify-content: flex-end; }
  .daymulti-panel { max-width: calc(100vw - 48px); }

  /* home un peu plus aérée */
  .vhome-kanji { font-size: 56px; }
  .vgrid { gap: 12px; padding: 16px 14px 90px; }
}

/* ============ Tableau de bord Rappels ============ */
.rem-cards { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.rem-card { flex: 1; min-width: 150px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.rem-card.shu { background: linear-gradient(135deg, var(--shu), #b3001f); color: #fff; border: none; }
.rem-card .rk { font-size: 12px; opacity: .85; letter-spacing: .03em; }
.rem-card .rv { font-family: var(--mincho); font-size: 20px; font-weight: 800; margin-top: 4px; }
.rem-todo { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px 6px; box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; }
.rem-todo-h { font-weight: 700; font-size: 13px; color: var(--ai); padding: 10px 12px 6px; }
.rem-line { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--line); font-size: 14px; }
.rem-line.urgent { background: #fff4f5; }
.rem-p { flex: none; font-size: 11px; font-weight: 800; color: #fff; background: var(--muted); border-radius: 6px; padding: 2px 6px; }
.rem-line.urgent .rem-p { background: var(--shu); }
.rem-item { flex: 1; font-weight: 600; }
.rem-cat { flex: none; font-size: 12px; color: var(--muted); }
.rem-info { background: #fff8ec; border: 1px solid #f0dcae; border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.4; margin-bottom: 12px; }
.rem-mail { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 6px; }
.rem-mail-h { font-weight: 800; font-size: 15px; margin-bottom: 6px; }
.rem-mail-p { font-size: 13px; color: var(--muted); line-height: 1.5; }
.rem-mail-p code { background: #f1ece0; padding: 2px 6px; border-radius: 6px; font-size: 12px; }
.rem-mail-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
@media (max-width: 640px){ .rem-line { flex-wrap: wrap; } .rem-cat { width: 100%; padding-left: 34px; } }

/* ============ Onglet Alertes / réglages ============ */
.alert-banner { border-radius: 12px; padding: 12px 16px; font-weight: 700; font-size: 14px; margin-bottom: 14px; }
.alert-banner.ok { background: #d7f0e0; color: #15803d; border: 1px solid #9fdcb5; }
.alert-banner.off { background: #fdeecb; color: #a15a06; border: 1px solid #f0dcae; }
.alert-banner .ab-sub { font-weight: 500; opacity: .85; }
.settings-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow); }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.types-box { display: flex; flex-direction: column; gap: 8px; }
.type-row { display: flex; align-items: center; gap: 10px; background: #faf7f0; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; cursor: pointer; }
.type-row input { width: 20px; height: 20px; accent-color: var(--shu); flex: none; }
.settings-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.jbtn2 { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 11px; padding: 11px 16px; font-size: 14px; font-weight: 700; }
.jbtn2.primary { background: var(--shu); color: #fff; border-color: var(--shu); }
.jbtn2:disabled { opacity: .5; cursor: not-allowed; }
.alert-msg { font-size: 13px; font-weight: 700; margin-top: 10px; min-height: 18px; color: var(--muted); }
.alert-msg.ok { color: var(--ok); }
