  @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=block');

  /* ─── Registered custom properties (enables color transitions) ───────────── */
@property --orange       { syntax: '<color>'; inherits: true; initial-value: #fb923c; }
@property --orange-dark  { syntax: '<color>'; inherits: true; initial-value: #ea580c; }
@property --rose         { syntax: '<color>'; inherits: true; initial-value: #f43f5e; }
@property --bg           { syntax: '<color>'; inherits: true; initial-value: #1a1110; }
@property --bg-surface   { syntax: '<color>'; inherits: true; initial-value: #1c1412; }
@property --bg-input     { syntax: '<color>'; inherits: true; initial-value: rgba(0,0,0,0.3); }
@property --border       { syntax: '<color>'; inherits: true; initial-value: #432c2a; }
@property --border-orange{ syntax: '<color>'; inherits: true; initial-value: rgba(251,146,60,0.3); }
@property --text         { syntax: '<color>'; inherits: true; initial-value: #f8fafc; }
@property --text-muted   { syntax: '<color>'; inherits: true; initial-value: #94a3b8; }
@property --glow-color-start { syntax: '<color>'; inherits: true; initial-value: rgba(251,146,60,0.7); }
@property --glow-color-end   { syntax: '<color>'; inherits: true; initial-value: rgba(251,146,60,0); }

  /* ─── Variables ─────────────────────────────────────────────────────────── */
  :root {
    --bg:          #1a1110;
    --bg-surface:  #1c1412;
    --bg-input:    rgba(0,0,0,0.3);
    --border:      #432c2a;
    --border-orange: rgba(251,146,60,0.3);
    --text:        #f8fafc;
    --text-muted:  #94a3b8;
    --orange:      #fb923c;
    --orange-dark: #ea580c;
    --rose:        #f43f5e;
    --grad:        linear-gradient(90deg, #fb923c, #f43f5e);
  }

  /* ─── Theme transition ───────────────────────────────────────────────────── */
  .theme-transitioning, .theme-transitioning * {
    transition: color 0.5s ease, background-color 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease, background 0.5s ease !important;
  }

  /* ─── Base ───────────────────────────────────────────────────────────────── */
  body { background: var(--bg); color: var(--text); font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; margin: 0; padding: 0; overflow-x: hidden; min-height: 100vh; display: flex; flex-direction: column; line-height: 1.5; }
  body > *:not(dialog):not(#toast):not(#importFile):not(.logo):not(.top-bar):not(#mdTooltip) { padding-top: 100px; }
  .container { position: relative; max-width: 1000px; margin: 0 auto; padding: 20px 20px 60px; display: flex; flex-direction: column; align-items: center; flex: 1; width: 100%; box-sizing: border-box; }
  footer { flex-shrink: 0; }

  /* ─── Gradient text utilitaire ───────────────────────────────────────────── */
  .grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

  /* ─── Logo & titre ───────────────────────────────────────────────────────── */
  .logo { position: absolute; top: 25px; left: 25px; z-index: 2000; font-weight: 700; font-size: 1.5rem; text-transform: uppercase; letter-spacing: 2px; white-space: nowrap; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
  h1.main-title { text-align: center; font-size: 3.5rem; margin: 10px 0 0; background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: 2px; text-transform: uppercase; cursor: pointer; overflow-wrap: break-word; word-break: break-word; max-width: 100%; }

  /* ─── Top bar ────────────────────────────────────────────────────────────── */
  .top-bar { position: absolute; top: 25px; right: 25px; display: flex; gap: 10px; align-items: center; z-index: 2000; flex-wrap: wrap; justify-content: flex-end; }
  .top-btn, .top-select { background: var(--bg-surface); border: 1px solid var(--border-orange); color: var(--text); padding: 8px 15px; border-radius: 8px; cursor: pointer; font-family: inherit; font-size: 0.85rem; transition: 0.2s; white-space: nowrap; box-sizing: border-box; }
  .top-btn:hover { background: rgba(251,146,60,0.1); color: var(--orange); border-color: var(--orange); }
  .top-select { outline: none; padding: 8px 10px; appearance: auto; }

  /* ─── Save dot ───────────────────────────────────────────────────────────── */
  .save-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; opacity: 0; transition: opacity 0.3s; }
  .save-dot--saving { opacity: 1; background: var(--orange); animation: save-pulse 0.8s ease-in-out infinite; }
  .save-dot--saved  { opacity: 1; background: #10b981; animation: save-fade 2.2s ease forwards; }
  .save-dot--error  { opacity: 1; background: #ef4444; }
  @keyframes save-pulse { 0%,100% { transform: scale(1); opacity: 0.6; } 50% { transform: scale(1.5); opacity: 1; } }
  @keyframes save-fade  { 0%,60%  { opacity: 1; } 100% { opacity: 0; } }

  /* ─── Toast ──────────────────────────────────────────────────────────────── */
  #toast { position: fixed; top: 50px; left: 50%; transform: translateX(-50%); color: white; padding: 12px 24px; border-radius: 8px; font-weight: 600; z-index: 3000; opacity: 0; pointer-events: none; transition: opacity 0.3s; box-shadow: 0 4px 15px rgba(0,0,0,0.3); max-width: 90vw; text-align: center; }
  #toast.toast-success { background: linear-gradient(135deg, #10b981, #059669); }
  #toast.toast-error   { background: linear-gradient(135deg, #ef4444, #dc2626); }
  #toast.toast-warning { background: linear-gradient(135deg, var(--orange), var(--orange-dark)); }
  .toast-show { opacity: 1 !important; }

  /* ─── Timeline Card Picker (menu dropdown) ───────────────────────────────── */
  .timeline-cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
  @media (max-width: 768px) { .timeline-cards-grid { grid-template-columns: repeat(2, 1fr); } }
  @media (max-width: 550px) { .timeline-cards-grid { grid-template-columns: 1fr; } }
  .timeline-card-item { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 6px; border-radius: 8px; cursor: pointer; border: 1px solid rgba(251,146,60,0.15); background: rgba(251,146,60,0.03); transition: 0.15s; text-align: center; }
  .timeline-thumb { pointer-events: none; margin-top: 4px; opacity: 0.8; }
  .timeline-card-item:hover { background: rgba(251,146,60,0.1); border-color: rgba(251,146,60,0.4); }
  .timeline-card-item.active { background: rgba(251,146,60,0.12); border-color: var(--orange); }
  .timeline-card-item span { display: block; font-size: 0.95rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; word-break: break-word; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
  .timeline-picker-actions { display: flex; gap: 6px; border-top: 1px solid rgba(251,146,60,0.15); padding-top: 10px; }
  .timeline-picker-btn { display: flex; align-items: center; justify-content: center; gap: 5px; flex: 1; background: transparent; border: 1px solid rgba(251,146,60,0.15); color: var(--text-muted); padding: 7px 6px; font-family: inherit; font-size: 0.88rem; cursor: pointer; border-radius: 7px; transition: 0.15s; white-space: nowrap; box-sizing: border-box; }
  .timeline-picker-btn:hover { background: rgba(251,146,60,0.08); border-color: rgba(251,146,60,0.4); color: var(--orange); }
  .timeline-picker-btn.danger { border-color: rgba(244,63,94,0.3); color: var(--rose); }
  .timeline-picker-btn.danger:hover { background: rgba(244,63,94,0.08); border-color: var(--rose); }
  #settingsTimelineName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* ─── Ligne centrale ─────────────────────────────────────────────────────── */
  .line-wrapper { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; padding-bottom: 20px; }
  .line { position: absolute; top: 0; bottom: 60px; left: 50%; width: 4px; background: linear-gradient(to bottom, rgba(251,146,60,0.2) 0%, var(--orange) 20%, var(--orange) 80%, rgba(251,146,60,0.2) 100%); transform: translateX(-50%); z-index: 0; border-radius: 4px; transition: background 0.4s; }

  /* ─── Items passés ───────────────────────────────────────────────────────── */
  .item-past .node { border-color: #44403c; box-shadow: none; }
  .item-past .date-day, .item-past .date-month, .item-past .date-year { color: #78716c; }
  .item-past .time-badge { background: #44403c; color: #a8a29e; }
  .item-past .duration-badge { border-color: #44403c; color: #78716c; background: transparent; }
  .item-past .left .card::after { background: linear-gradient(to right, rgba(68,64,60,0.2), rgba(68,64,60,0.5)); }
  .item-past .right .card::after { background: linear-gradient(to left, rgba(68,64,60,0.2), rgba(68,64,60,0.5)); }

  /* ─── Nœud Today ─────────────────────────────────────────────────────────── */
  .node-today { border-color: #ef4444 !important; box-shadow: 0 0 12px rgba(239,68,68,0.8) !important; background: var(--bg) !important; }
  .today-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.5); color: #ef4444; font-size: 0.75rem; font-weight: 700; padding: 4px 12px; border-radius: 20px; text-transform: uppercase; letter-spacing: 1.5px; white-space: nowrap; }
  .today-badge::before { content: ''; width: 6px; height: 6px; background: #ef4444; border-radius: 50%; display: inline-block; }

  /* ─── Type Information ───────────────────────────────────────────────────── */
  .info-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 700; padding: 4px 12px; border-radius: 20px; letter-spacing: 0.5px; white-space: normal; word-break: break-word; cursor: pointer; transition: transform 0.2s; }
  .info-badge:hover { transform: scale(1.03); }
  .info-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
  .info-red    { background: rgba(239,68,68,0.12);  border: 1px solid rgba(239,68,68,0.5);  color: #ef4444; }
  .info-red::before    { background: #ef4444; }
  .info-green  { background: rgba(34,197,94,0.12);  border: 1px solid rgba(34,197,94,0.5);  color: #22c55e; }
  .info-green::before  { background: #22c55e; }
  .info-blue   { background: rgba(59,130,246,0.12); border: 1px solid rgba(59,130,246,0.5); color: #3b82f6; }
  .info-blue::before   { background: #3b82f6; }
  .info-yellow { background: rgba(234,179,8,0.12);  border: 1px solid rgba(234,179,8,0.5);  color: #eab308; }
  .info-yellow::before { background: #eab308; }
  .node-info-red    { border-color: #ef4444 !important; box-shadow: 0 0 10px rgba(239,68,68,0.6) !important;  background: var(--bg) !important; }
  .node-info-green  { border-color: #22c55e !important; box-shadow: 0 0 10px rgba(34,197,94,0.6) !important;  background: var(--bg) !important; }
  .node-info-blue   { border-color: #3b82f6 !important; box-shadow: 0 0 10px rgba(59,130,246,0.6) !important; background: var(--bg) !important; }
  .node-info-yellow { border-color: #eab308 !important; box-shadow: 0 0 10px rgba(234,179,8,0.6) !important;  background: var(--bg) !important; }

  /* ─── Type Card Picker (modal) ───────────────────────────────────────────── */
  .type-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .type-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px 6px; border-radius: 8px; cursor: pointer; border: 1px solid var(--border); background: var(--bg-input); transition: 0.15s; text-align: center; min-height: 54px; }
  .type-card:hover { background: rgba(251,146,60,0.07); border-color: var(--border-orange); }
  .type-card.active { background: rgba(251,146,60,0.1); border-color: var(--orange); }
  .type-card-icon { display: flex; align-items: center; justify-content: center; }
  .type-card-icon svg { width: 20px; height: 20px; }
  .type-card-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

  /* ─── Sélecteur de couleur ───────────────────────────────────────────────── */
  .color-picker-wrapper { display: none; margin-bottom: 16px; }
  .color-picker-wrapper.visible { display: block; }
  .color-picker-label { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }
  .color-swatches { display: flex; gap: 10px; }
  .color-swatch { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; transition: 0.15s; flex-shrink: 0; }
  .color-swatch:hover { transform: scale(1.15); }
  .color-swatch.selected { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,0.3); }
  .swatch-red    { background: #ef4444; }
  .swatch-green  { background: #22c55e; }
  .swatch-blue   { background: #3b82f6; }
  .swatch-yellow { background: #eab308; }

  /* ─── Timeline items ─────────────────────────────────────────────────────── */
  #timeline { width: 100%; position: relative; }
  .item { display: flex; width: 100%; margin: 60px 0; align-items: center; z-index: 1; position: relative; justify-content: center; }
  .half { flex: 1 1 0%; position: relative; display: flex; align-items: flex-start; min-width: 0; }
  .left  { justify-content: flex-end;   padding-right: 60px; }
  .right { justify-content: flex-start; padding-left:  60px; }
  .item.flag-grid { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; margin: 40px 0; }
  .node { width: 20px; height: 20px; background: var(--bg); border: 4px solid var(--orange); border-radius: 20px; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); box-shadow: 0 0 15px rgba(251,146,60,0.5); z-index: 2; box-sizing: border-box; }

  /* ─── Dates ──────────────────────────────────────────────────────────────── */
  .date { display: flex; align-items: center; gap: 4px; }
  .date-container { display: flex; flex-direction: column; align-items: flex-start; font-family: inherit; line-height: 1; }
  .left  .date-container { align-items: flex-end;   text-align: right; }
  .right .date-container { align-items: flex-start; text-align: left; }
  .date-day { font-size: 1.8rem; font-weight: 600; color: var(--orange); letter-spacing: -1px; }
  .date-month, .date-year { font-size: 1rem; text-transform: uppercase; color: #fed7aa; letter-spacing: 1px; opacity: 0.8; }
  .time-badge { display: inline-block; margin-top: 5px; padding: 2px 4px; background: rgba(251,146,60,0.8); border-radius: 4px; font-size: 0.75rem; color: #2a1e1c; }
  .date-period-separator-h { width: 20px; height: 2px; background: rgba(251,146,60,0.3); }
  .duration-badge { background: rgba(251,146,60,0.15); border: 1px solid rgba(251,146,60,0.3); padding: 4px 10px; border-radius: 6px; font-size: 0.8rem; color: var(--orange); font-weight: 600; white-space: nowrap; margin: 0 5px; }

  /* ─── Jalon (flag) ───────────────────────────────────────────────────────── */
  .flag { background: linear-gradient(135deg, var(--rose), var(--orange-dark)); color: #fff; padding: 10px 24px; border-radius: 30px; z-index: 3; font-size: 1em; font-weight: 600; cursor: pointer; box-shadow: 0 4px 15px rgba(234,88,12,0.4); transition: transform 0.3s ease; border: 1px solid rgba(255,255,255,0.1); position: relative; max-width: 300px; text-align: center; word-wrap: break-word; }
  .flag:hover { transform: scale(1.05); }

  /* ─── Carte ──────────────────────────────────────────────────────────────── */
  .card { background: linear-gradient(#f8fafc, #f8fafc) padding-box, linear-gradient(135deg, var(--orange), var(--rose), var(--orange-dark)) border-box; border: 1px solid transparent; padding: 10px 20px 15px; border-radius: 12px; position: relative; text-align: left; width: 100%; max-width: 400px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); transition: box-shadow 0.3s ease; color: var(--bg); cursor: pointer; }
  .card:hover { box-shadow: 0 15px 40px rgba(251,146,60,0.4); }
  .card-title { font-size: 1.3em; color: var(--bg); margin: 0; display: flex; justify-content: space-between; align-items: center; font-weight: 600; overflow-wrap: break-word; word-break: break-word; min-width: 0; }
  .card-subtitle { font-size: 1em; color: #475569; margin: 0; line-height: 1.5; overflow-wrap: break-word; word-break: break-word; }
  .card-subtitle input[type="checkbox"] { cursor: pointer; transform: scale(1.1); margin-right: 5px; }
  .left  .card::after { content: ''; position: absolute; top: 50%; right: -60px; width: 58px; height: 2px; background: linear-gradient(to right, rgba(251,146,60,0.2), rgba(251,146,60,0.5)); transform: translateY(-50%); border-radius: 2px; }
  .right .card::after { content: ''; position: absolute; top: 50%; left:  -60px; width: 58px; height: 2px; background: linear-gradient(to left,  rgba(251,146,60,0.2), rgba(251,146,60,0.5)); transform: translateY(-50%); border-radius: 2px; }

  /* ─── Bouton + ───────────────────────────────────────────────────────────── */
  #addBtn { display: block; margin: 40px auto 0; background: linear-gradient(135deg, var(--orange), var(--orange-dark)); color: #fff; border: none; border-radius: 50%; width: 64px; height: 64px; font-size: 32px; font-weight: 300; cursor: pointer; box-shadow: 0 10px 10px rgba(251,146,60,0.2); z-index: 10; position: relative; transition: transform 0.3s cubic-bezier(0.175,0.885,0.32,1.275); }
  #addBtn:hover { transform: scale(1.1) rotate(90deg); }
  #addBtn.floating { position: fixed; bottom: 28px; right: 28px; margin: 0; z-index: 1500; box-shadow: 8px var (glow-color-start)}

  /* ─── Modals ─────────────────────────────────────────────────────────────── */
  dialog { background: var(--bg-surface); color: var(--text); border: 1px solid rgba(251,146,60,0.2); border-radius: 12px; padding: 30px; width: 450px; box-shadow: 0 20px 50px rgba(0,0,0,0.9); font-family: inherit; overflow: hidden; }
  dialog::backdrop { background: rgba(10,5,5,0.85); backdrop-filter: blur(5px); }
  dialog h3 { font-size: 1.5rem; margin: 0; color: var(--orange); text-transform: uppercase; letter-spacing: 1px; }
  .modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
  .modal-close-btn { background: transparent; border: 1px solid var(--border-orange); color: var(--text-muted); border-radius: 6px; width: 32px; height: 32px; font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; flex-shrink: 0; }
  .modal-close-btn:hover { background: rgba(239,68,68,0.1); border-color: #ef4444; color: #ef4444; }
  .input-wrapper { display: flex; flex-direction: column; margin-bottom: 20px; }
  .input-wrapper label { font-size: 0.85em; color: var(--orange); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.5px; }
  dialog input:not([type="checkbox"]), dialog textarea { width: 100%; padding: 12px 15px; background: var(--bg-input); border: 1px solid var(--border); color: var(--text); border-radius: 8px; box-sizing: border-box; font-size: 1rem; font-family: inherit; }
  dialog input:focus, dialog textarea:focus { outline: none; border-color: var(--orange); }
  dialog input[type="date"]::-webkit-calendar-picker-indicator,
  dialog input[type="time"]::-webkit-calendar-picker-indicator { filter: var(--calendar-filter, invert(1)); opacity: 0.5; cursor: pointer; }
  dialog input[type="date"]::-webkit-calendar-picker-indicator:hover,
  dialog input[type="time"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }
  .datetime-group { display: flex; gap: 10px; margin-bottom: 20px; }
  .datetime-group .input-wrapper { flex: 1; margin-bottom: 0; }
  .checkbox-wrapper { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; cursor: pointer; }
  #error-msg { background: rgba(239,68,68,0.1); color: #ef4444; padding: 10px; border-radius: 8px; margin-bottom: 20px; border: 1px solid #ef4444; display: none; font-size: 0.9rem; }
  .modal-actions { display: flex; gap: 10px; margin-top: 10px; }
  dialog button.btn { padding: 12px 20px; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 1rem; }
  .btn-save   { background: linear-gradient(90deg, var(--orange), var(--orange-dark)); color: #fff; flex: 1; }
  .btn-cancel { background: transparent; color: var(--text-muted); flex: 1; border: 1px solid var(--border) !important; }

  /* ─── Éditeur markdown ───────────────────────────────────────────────────── */
  .editor-toolbar { display: flex; gap: 5px; background: rgba(0,0,0,0.4); padding: 8px; border: 1px solid var(--border); border-bottom: none; border-radius: 8px 8px 0 0; flex-wrap: wrap; }
  .editor-toolbar button { background: var(--border); border: none; color: white; padding: 6px 10px; border-radius: 4px; cursor: pointer; font-family: inherit; font-size: 0.8rem; transition: 0.2s; }
  .editor-toolbar button:hover { background: #5c3b37; color: var(--orange); }
  .editor-content { width: 100%; min-height: 120px; background: rgba(0,0,0,0.2); border: 1px solid var(--border); color: var(--text); border-radius: 0 0 8px 8px; padding: 12px 15px; box-sizing: border-box; font-size: 1rem; overflow-y: auto; outline: none; margin-bottom: 20px; resize: vertical; }

  /* ─── Actions modal (Dupliquer / Supprimer) ──────────────────────────────── */
  .modal-item-actions { display: none; border-top: 1px solid rgba(251,146,60,0.15); margin-top: 16px; padding-top: 12px; }
  .modal-item-actions.visible { display: flex; gap: 8px; align-items: center; }
  .modal-item-actions-label { font-size: 0.72rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; margin-right: 4px; white-space: nowrap; }
  .item-action-btn { display: flex; align-items: center; gap: 5px; background: transparent; border: 1px solid rgba(255,255,255,0.1); color: var(--text-muted); padding: 5px 12px; border-radius: 6px; font-family: inherit; font-size: 0.78rem; cursor: pointer; transition: 0.15s; white-space: nowrap; }
  .item-action-btn:hover { background: rgba(251,146,60,0.08); border-color: var(--orange); color: var(--orange); }
  .item-action-btn.danger:hover { background: rgba(239,68,68,0.1); border-color: #ef4444; color: #ef4444; }

  /* ─── Modal Confirm ──────────────────────────────────────────────────────── */
  #confirmModal { max-width: 380px; text-align: center; }
  #confirmModal .confirm-icon { margin-bottom: 12px; display: flex; justify-content: center; color: var(--text-muted); }
  #confirmModal .confirm-msg  { font-size: 1rem; color: var(--text); margin-bottom: 6px; font-weight: 600; }
  #confirmModal .confirm-sub  { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 24px; word-break: break-word; }
  #confirmModal .modal-actions { justify-content: center; }
  .btn-confirm-danger   { background: rgba(239,68,68,0.15); color: #ef4444; border: 1px solid #ef4444 !important; flex: 1; }
  .btn-confirm-neutral  { background: linear-gradient(90deg, var(--orange), var(--orange-dark)); color: #fff; flex: 1; }

  /* ─── Modal Input ────────────────────────────────────────────────────────── */
  #inputModal { max-width: 380px; }
  #inputModal .confirm-msg { text-align: left; margin-bottom: 4px; font-size: 1rem; font-weight: 600; color: var(--orange); }
  #inputModal input { width: 100%; padding: 12px 15px; background: var(--bg-input); border: 1px solid var(--border); color: var(--text); border-radius: 8px; box-sizing: border-box; font-size: 1rem; font-family: inherit; margin-bottom: 8px; }
  #inputModal input:focus { outline: none; border-color: var(--orange); }
  #inputModal .input-error { color: #ef4444; font-size: 0.82rem; min-height: 18px; margin-bottom: 12px; display: none; }
  #inputModal .input-error.visible { display: block; }

  /* ─── Modal Share ────────────────────────────────────────────────────────── */
  #shareModal { max-width: 440px; }
  #shareModal h3 { font-size: 1.1rem; margin-top: 0; margin-bottom: 14px; color: var(--orange); text-transform: uppercase; letter-spacing: 1px; }
  /* Lien */
  .share-link-row { display: flex; gap: 8px; margin-bottom: 4px; }
  .share-link-row input { flex: 1; min-width: 0; padding: 10px 12px; background: var(--bg-input); border: 1px solid var(--border); color: var(--text-muted); border-radius: 10px; font-family: inherit; font-size: 0.8rem; }
  .share-link-row input:focus { outline: none; border-color: var(--orange); color: var(--text); }
  .btn-copy { background: linear-gradient(135deg, var(--orange), var(--orange-dark)); color: #fff; border: none; border-radius: 10px; padding: 10px 18px; font-family: inherit; font-weight: 700; font-size: 0.85rem; cursor: pointer; white-space: nowrap; transition: opacity 0.15s; }
  .btn-copy:hover { opacity: 0.85; }
  /* Option row — icône + texte + toggle */
  .share-option-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--border); cursor: pointer; }
  .share-option-icon-wrap { width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,0.05); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
  .share-option-text { flex: 1; min-width: 0; }
  .share-option-label { font-size: 0.88rem; font-weight: 600; color: var(--text); }
  .share-option-sub { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }
  /* Toggle pill */
  .ui-switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
  .ui-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
  .ui-switch-track { position: absolute; inset: 0; border-radius: 26px; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.1); transition: background 0.22s, border-color 0.22s; pointer-events: none; }
  .ui-switch input:checked + .ui-switch-track { background: var(--orange); border-color: var(--orange); }
  .ui-switch-thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.35); transition: left 0.22s; pointer-events: none; }
  .ui-switch input:checked + .ui-switch-track .ui-switch-thumb { left: 23px; }
  /* Zone de détail (expand) */
  .share-option-detail { display: none; flex-direction: column; gap: 8px; padding: 0 0 14px 48px; }
  .share-option-detail.open { display: flex; }
  /* Password / Edit unified container */
  .pwd-display-row,
  .share-detail-actions { display: flex; background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px; transition: border-color 0.15s; }
  .share-detail-actions { overflow: hidden; }
  .pwd-display-row:focus-within,
  .share-detail-actions:focus-within { border-color: var(--orange); }
  dialog .pwd-display-row input,
  dialog .share-detail-actions input { flex: 1; min-width: 0; width: auto; border: none; background: transparent; color: var(--text); padding: 9px 12px; font-family: inherit; font-size: 0.82rem; border-radius: 0; outline: none; }
  dialog .pwd-display-row input { letter-spacing: 0.12em; }
  .pwd-icon-btn { background: transparent; border: none; color: var(--text-muted); cursor: pointer; padding: 8px 11px; display: flex; align-items: center; flex-shrink: 0; }
  .pwd-icon-btn svg { width: 15px; height: 15px; }
  .share-detail-actions button.apply-btn { background: var(--orange); border: none; color: #fff; cursor: pointer; padding: 9px 16px; font-size: 0.82rem; font-weight: 600; font-family: inherit; white-space: nowrap; flex-shrink: 0; transition: opacity 0.15s; }
  .share-detail-actions button.apply-btn:hover { opacity: 0.85; }
  /* Custom tooltips */
  [data-tooltip] { position: relative; }
  [data-tooltip]::after { content: attr(data-tooltip); position: absolute; bottom: calc(100% + 7px); left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); font-size: 0.68rem; font-family: 'Poppins', sans-serif; font-weight: 500; padding: 4px 9px; border-radius: 6px; white-space: nowrap; pointer-events: none; opacity: 0; z-index: 9999; transition: opacity 0.12s ease 0s; }
  [data-tooltip]:hover::after { opacity: 1; transition: opacity 0.12s ease 250ms; }
  /* Markdown tooltip (milestone descriptions) */
  .md-tooltip { position: fixed; z-index: 10000; background: var(--text); color: var(--bg); font-size: 0.75rem; font-family: 'Poppins', sans-serif; font-weight: 400; padding: 6px 10px; border-radius: 7px; width: max-content; max-width: 280px; line-height: 1.45; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity 0.15s ease; word-break: break-word; }
  .md-tooltip.visible { opacity: 1; visibility: visible; }
  .md-tooltip strong { font-weight: 700; }
  .md-tooltip em { font-style: italic; }
  .md-tooltip s { text-decoration: line-through; }
  .md-tooltip code { font-family: monospace; background: rgba(128,128,128,0.25); padding: 1px 4px; border-radius: 3px; font-size: 0.88em; }
  [data-tooltip].tt-edge-left::after  { left: 0; transform: none; }
  [data-tooltip].tt-edge-right::after { left: auto; right: 0; transform: none; }
  /* Share actions grid */
  .share-actions-grid { display: flex; justify-content: space-between; gap: 8px; padding: 14px 0; margin-bottom: 8px; }
  .share-actions-grid + .share-option-row { border-top: none; }
  .share-action-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 14px; padding: 10px 8px 8px; cursor: pointer; flex: 1; transition: border-color 0.15s, background 0.15s; font-family: inherit; }
  .share-action-btn:hover { border-color: var(--orange); background: rgba(251,146,60,0.08); }
  .share-action-icon { font-size: 1.35rem; line-height: 1; color: var(--text); display: flex; align-items: center; justify-content: center; }
  .share-action-icon svg { width: 22px; height: 22px; }
  .share-option-icon-wrap svg { width: 18px; height: 18px; display: block; }
  .share-action-icon--text { font-size: 1.15rem; font-weight: 700; font-family: serif; color: var(--text); }
  .share-action-label { font-size: 0.63rem; color: var(--text-muted); text-align: center; white-space: nowrap; }
  .share-qr-panel { display: flex; justify-content: center; padding: 12px 0 4px; }
  .share-qr-panel img { border-radius: 10px; border: 2px solid var(--border); background: #fff; }

  /* ─── Theme picker ───────────────────────────────────────────────────────── */
  .theme-picker { border-top: 1px solid rgba(251,146,60,0.15); padding-top: 10px; margin-bottom: 10px; display: none; }
  .theme-picker.visible { display: block; }
  .theme-picker-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
  .theme-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
  .theme-swatch { width: 32px; height: 32px; border-radius: 50%; cursor: pointer; border: none; outline: 3px solid transparent; outline-offset: 2px; transition: 0.15s; flex-shrink: 0; }
  .theme-swatch:hover { transform: scale(1.15); }
  .theme-swatch.selected { outline-color: #fff; }
  @media (max-width: 768px) {
    .logo { left: 50%; transform: translateX(-50%); top: 15px; font-size: 1.2rem; }
    .top-bar { justify-content: center; width: 100%; left: 0; top: 60px; }
    h1.main-title { margin-top: 10px; }
  }
  @media (max-width: 640px) {
    .logo { position: static; display: block; text-align: center; padding: 12px 0 4px; font-size: 1rem; transform: none; }
    .top-bar { position: static; justify-content: center; width: 100%; padding: 0 8px 8px; box-sizing: border-box; gap: 6px; }
    .top-btn { padding: 6px 10px; font-size: 0.8rem; }
    .container { padding-top: 10px !important; }
    h1.main-title { font-size: 2rem; margin-top: 10px; }
  }
  /* ─── Read-only mode ────────────────────────────────────────────────────── */
  .readonly-badge { display:inline-flex; align-items:center; gap:6px; background:rgba(var(--orange-rgb, 251,146,60),0.12); border:1px solid rgba(var(--orange-rgb, 251,146,60),0.35); color:var(--orange); font-size:0.72rem; font-weight:700; padding:4px 12px; border-radius:20px; text-transform:uppercase; letter-spacing:1px; white-space:nowrap; }
  .readonly-badge::before { content:''; width:6px; height:6px; background:var(--orange); border-radius:50%; animation: pulse-ro 1.5s infinite; }
  @keyframes pulse-ro { 0%,100%{opacity:1} 50%{opacity:0.3} }
  .readonly-import-btn { background:var(--grad); color:#fff; border:none; border-radius:8px; padding:8px 18px; font-size:0.85rem; font-weight:600; cursor:pointer; font-family:'Poppins',sans-serif; white-space:nowrap; transition:0.2s; }
  .readonly-import-btn:hover { opacity:0.85; }
  .cloud-edit-badge { display:inline-flex; align-items:center; gap:6px; background:rgba(var(--orange-rgb,251,146,60),0.15); border:1px solid rgba(var(--orange-rgb,251,146,60),0.4); color:var(--orange); font-size:0.72rem; font-weight:700; padding:4px 12px; border-radius:20px; text-transform:uppercase; letter-spacing:1px; white-space:nowrap; }
  .offline-badge { display:inline-flex; align-items:center; gap:6px; background:rgba(251,191,36,0.12); border:1px solid rgba(251,191,36,0.4); color:#fbbf24; font-size:0.72rem; font-weight:700; padding:4px 12px; border-radius:20px; text-transform:uppercase; letter-spacing:1px; white-space:nowrap; }
  body.readonly #addBtn { display:none !important; }
  body.readonly .item { cursor:default; }
  body.readonly .item:hover .item-actions { display:none !important; }

  /* ─── Animation de modification (Pulse Glow) ─────────────────────────────── */
  @keyframes pulse-glow {
    0%,
    100% {
      transform: scale(1);
      box-shadow: 0 0 0 0 var(--glow-color-start, rgba(52, 152, 219, 0.7));
    }
    50% {
      transform: scale(1);
      box-shadow: 0 0 0 10px var(--glow-color-end, rgba(52, 152, 219, 0));
    }
  }

  .pulse-glow .card,
  .pulse-glow .flag,
  .pulse-glow .info-badge {
    animation: pulse-glow 2s infinite;
    z-index: 10;
    position: relative;
  }

  /*

  :root {
  --bg: rgba(50,225,50, 1);
  --color0: rgba(0,255,0, 0.7);
  --color70: rgba(0,255,0,0.0);
  --color100: rgba(0,255,0,0);
  --size: 5px;
}

.pulse {
  margin:10px;
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg);
  cursor: pointer;
  box-shadow: 0 0 0 var(--color40);
  animation: pulse 2s infinite;
}
.pulse:hover {
  animation: none;
}

@-webkit-keyframes pulse {
  0% { -webkit-box-shadow: 0 0 0 0 var(--color0); }
  70% { -webkit-box-shadow: 0 0 0 var(--size) var(--color70); } 
  100% { -webkit-box-shadow: 0 0 0 0 var(--color100); }
}
@keyframes pulse {
  0% {
    -moz-box-shadow: 0 0 0 0 var(--color0);
    box-shadow: 0 0 0 0 var(--color0);
  }
  70% {
      -moz-box-shadow: 0 0 0 var(--size) var(--color70);
      box-shadow: 0 0 0 var(--size) var(--color70);
  }
  100% {
      -moz-box-shadow: 0 0 0 0 var(--color100);
      box-shadow: 0 0 0 0 var(--color100);
  }
}*/

/* FLIGHT TYPE — désactivé, pas encore bien pensé
.flight-card { display: flex; flex-direction: column; gap: 5px; }
.flight-header { display: flex; justify-content: space-between; align-items: center; }
.flight-number { font-weight: 700; font-size: 1.05rem; overflow-wrap: break-word; word-break: break-word; display: flex; align-items: center; gap: 5px; }
.flight-airline { font-size: 0.8rem; opacity: 0.65; overflow-wrap: break-word; word-break: break-word; }
.flight-route { display: flex; align-items: center; gap: 10px; margin: 2px 0; }
.flight-airport { display: flex; flex-direction: column; align-items: center; }
.flight-code { font-weight: 700; font-size: 1.15rem; letter-spacing: 1px; }
.flight-city { font-size: 0.72rem; opacity: 0.6; overflow-wrap: break-word; word-break: break-word; }
.flight-arrow { opacity: 0.45; display: flex; align-items: center; }
.flight-times { font-size: 0.85rem; opacity: 0.75; }
.flight-meta { font-size: 0.75rem; opacity: 0.55; margin-top: 1px; }
.flight-inputs-row { display: flex; gap: 12px; }
.flight-inputs-row .input-wrapper { flex: 1; }
.flight-airport-group { display: flex; gap: 6px; }
.iata-input { width: 74px !important; text-transform: uppercase; font-weight: 700; letter-spacing: 2px; flex-shrink: 0; }
*/

/* Page loader */
#pageLoader { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
#pageLoader::after { content: ''; width: 32px; height: 32px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.1); border-top-color: var(--orange); animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#pageLoader.hidden { display: none; }
