
  :root {
    --bg-deep: #0c0c0e;
    --bg-surface: #141416;
    --bg-card: #1a1a1e;
    --bg-card-hover: #202024;
    --accent: #8a7aff;
    --accent-dim: rgba(138, 122, 255, 0.12);
    --accent-glow: rgba(138, 122, 255, 0.08);
    --green: #4ade80;
    --red: #f87171;
    --orange: #fb923c;
    --text-primary: #e8e8ec;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }

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

  body {
    background: linear-gradient(to right, #1a1825 0%, #1e1a28 35%, #231d2a 65%, #261e2d 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: 'IBM Plex Sans', -apple-system, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
  }

  .container {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 28px 32px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    min-height: 100vh;
  }

  /* ==================== HEADER ==================== */
  .header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .logo-mark {
    width: 36px; height: 36px;
    border: 1.5px solid var(--accent);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 15px;
    color: var(--accent);
    opacity: 0.8;
  }
  .logo-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: 6px; }

  .logo-text { display: flex; flex-direction: column; gap: 0; line-height: 1.2; }
  .logo-text .logo-title { font-size: 18px; font-weight: 600; letter-spacing: 2px; color: var(--text-primary); text-transform: uppercase; }
  .logo-text .logo-subtitle { font-size: 10px; font-weight: 400; letter-spacing: 1px; color: var(--text-muted); text-transform: uppercase; margin-top: 1px; }

  .header-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px 20px;
    font-size: 13px;
    color: var(--text-secondary);
  }
  .header-sync {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-basis: 100%;
  }
  @media (min-width: 769px) {
    .header-info { justify-content: flex-end; }
    .header-sync { flex-basis: auto; justify-content: flex-end; }
  }
  .header-sync .sync-badge {
    font-size: 10px; color: var(--green); letter-spacing: 1px;
  }
  .header-sync button {
    font-family: 'IBM Plex Mono', monospace; font-size: 11px;
    background: none; border: 1px solid var(--border); color: var(--text-muted);
    padding: 4px 10px; border-radius: 6px; cursor: pointer;
  }
  .header-sync button:hover { border-color: var(--accent); color: var(--accent); }
  .header-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 6px 10px; font-size: 16px; line-height: 1;
    background: none; border: 1px solid var(--border); color: var(--text-secondary);
    border-radius: 8px; cursor: pointer;
  }
  .header-icon-btn:hover { border-color: var(--accent); color: var(--accent); }
  .header-icon-btn .header-icon { flex-shrink: 0; vertical-align: middle; }

  .weather { display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 4px 8px; margin: -4px -8px; border-radius: 6px; }
  .weather:hover { background: var(--accent-glow); }
  .weather-temp { color: var(--text-primary); font-weight: 500; }

  /* ==================== CLOCK ==================== */
  .clock-section { text-align: center; padding: 16px 0 4px; }

  .clock {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 80px;
    font-weight: 300;
    letter-spacing: 6px;
    color: var(--text-primary);
    line-height: 1;
  }

  .clock-sep { opacity: 0.3; animation: pulse 2s ease-in-out infinite; }

  @keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.08; }
  }

  .greeting {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 12px;
    font-weight: 300;
    letter-spacing: 1px;
  }

  .greeting b { color: var(--text-secondary); font-weight: 500; }
  .greeting .user-name {
    cursor: pointer;
    border-bottom: 1px dotted var(--text-muted);
    padding: 0 2px;
  }
  .greeting .user-name:hover { color: var(--accent); border-bottom-color: var(--accent); }

  /* ==================== SEARCH ==================== */
  .search-block {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    z-index: 10;
  }

  .search-row {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
  }

  .search-wrap {
    flex: 1;
    position: relative;
    min-width: 0;
  }

  .search-input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
  }

  .search-input::placeholder { color: var(--text-secondary); }
  .search-input:hover { border-color: var(--border-hover); }
  .search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

  .search-ico {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--text-secondary); font-size: 14px; pointer-events: none;
  }

  .search-engine-select {
    flex-shrink: 0;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
    min-width: 0;
    max-width: 140px;
  }

  .search-engine-select:hover { border-color: var(--border-hover); }
  .search-engine-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
  .search-engine-select option { background: var(--bg-surface); color: var(--text-primary); }

  .search-suggestions {
    position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
    max-height: 280px; overflow-y: auto; z-index: 2000;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    display: none;
  }
  .search-suggestions.open { display: block; }
  .search-suggestions-section { padding: 6px 0 2px; }
  .search-suggestions-section-title {
    font-size: 10px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
    color: var(--text-muted); padding: 4px 12px 6px;
  }
  .search-suggestion-item {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px;
    cursor: pointer; font-size: 13px; color: var(--text-primary);
    border: none; background: none; width: 100%; text-align: left;
    font-family: inherit; border-radius: 6px; margin: 0 6px; width: calc(100% - 12px);
  }
  .search-suggestion-item:hover,
  .search-suggestion-item.highlight { background: var(--bg-card-hover); color: var(--accent); }
  .search-suggestion-item .suggestion-name { font-weight: 500; }
  .search-suggestion-item .suggestion-url { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* ==================== SECTIONS ==================== */
  .section {
    margin-top: 8px;
  }

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

  .section-head .section-toggle {
    background: none; border: none; color: var(--text-muted);
    padding: 4px 8px; cursor: pointer; font-size: 14px; line-height: 1;
    border-radius: 6px; transition: color 0.2s, background 0.2s;
  }
  .section-head .section-toggle:hover { color: var(--accent); background: var(--accent-dim); }
  .section-head .section-toggle:focus-visible { outline-offset: 2px; }
  .section .section-body { max-height: 3000px; overflow: visible; transition: max-height 0.35s ease, opacity 0.25s; }
  .section.collapsed .section-body { max-height: 0; overflow: hidden; opacity: 0; transition: max-height 0.35s ease, opacity 0.2s; }
  .section.collapsed .section-toggle { transform: rotate(-90deg); transition: transform 0.2s; }

  .fade-in { animation: fadeIn 0.4s ease forwards; }
  @keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

  .section-count { font-weight: 400; color: var(--text-muted); font-size: 12px; }
  .section-title {
    font-size: 11px; font-weight: 600;
    letter-spacing: 2.5px; text-transform: uppercase;
    color: var(--text-secondary);
  }

  .edit-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 32px;
  }

  .edit-btn:hover { border-color: var(--border-hover); color: var(--text-primary); background: var(--bg-card-hover); }
  .edit-btn:focus-visible { border-color: var(--accent); color: var(--accent); }
  .edit-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

  /* ==================== LINKS ==================== */
  .links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
  }

  .link-card {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none; color: var(--text-primary);
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s, background 0.2s;
    position: relative; overflow: hidden;
  }

  .link-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }

  .link-card:active { transform: translateY(0); }
  .link-card:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

  .link-ico {
    width: 36px; height: 36px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; overflow: hidden;
  }

  .link-ico img {
    width: 100%; height: 100%;
    object-fit: contain;
    border-radius: 6px;
  }

  .link-ico > span {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
  }

  .link-details { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
  .link-name { font-size: 13px; font-weight: 500; color: var(--text-primary); position: relative; }
  .link-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px; padding: 0 5px;
    margin-left: 6px; font-size: 11px; font-weight: 600;
    background: var(--red); color: #fff; border-radius: 9px;
  }
  .link-badge:empty { display: none; }
  .link-url { font-size: 10px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* Drag (toujours possible, avec ou sans mode éditeur) */
  .link-card.dragging { opacity: 0.3; transition: opacity 0.2s ease; }
  .link-card.drag-over { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); transition: border-color 0.15s, box-shadow 0.15s; }
  .link-card:not(.editing) { cursor: grab; }
  .link-card:not(.editing):active { cursor: grabbing; }
  .link-card.editing { cursor: grab; user-select: none; }
  .link-card.editing:active { cursor: grabbing; }

  .del-btn {
    position: absolute; top: 6px; right: 6px;
    width: 20px; height: 20px;
    background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.2);
    border-radius: 5px; color: var(--red); font-size: 11px;
    cursor: pointer; display: none; align-items: center; justify-content: center;
    transition: all 0.2s; z-index: 5; line-height: 1;
  }

  .del-btn:hover { background: rgba(248, 113, 113, 0.2); }
  .editing .del-btn { display: flex; }

  .edit-card-btn {
    position: absolute; top: 6px; right: 30px;
    width: 20px; height: 20px;
    background: var(--accent-dim); border: 1px solid rgba(138, 122, 255, 0.3);
    border-radius: 5px; color: var(--accent); font-size: 11px;
    cursor: pointer; display: none; align-items: center; justify-content: center;
    transition: all 0.2s; z-index: 5; line-height: 1;
  }
  .edit-card-btn:hover { background: rgba(138, 122, 255, 0.25); }
  .editing .edit-card-btn { display: flex; }

  .grip {
    position: absolute; top: 6px; left: 6px;
    color: var(--text-muted); font-size: 10px;
    opacity: 0.6; pointer-events: none;
  }
  .link-card:hover .grip, .status-card:hover .grip { opacity: 0.9; }
  .link-card.editing .grip, .status-card.editing .grip { opacity: 1; }

  .add-card {
    display: none; align-items: center; justify-content: center;
    padding: 14px; background: transparent;
    border: 1.5px dashed var(--border); border-radius: 10px;
    color: var(--text-muted); cursor: pointer; transition: all 0.2s;
    font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  }

  .add-card:hover { border-color: var(--accent); color: var(--accent); }
  .add-card.visible { display: flex; }
  .links-empty-hint {
    grid-column: 1 / -1;
    font-size: 13px; color: var(--text-muted);
    padding: 8px 0;
  }
  .link-group-tag { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
  .links-group-header {
    grid-column: 1 / -1;
    font-size: 10px; font-weight: 600; letter-spacing: 1.5px;
    color: var(--text-muted); padding: 10px 0 6px;
    border-bottom: 1px solid var(--border); margin-bottom: 4px;
  }
  .links-group-header:first-child { padding-top: 0; }

  /* ==================== STATUS ==================== */
  .status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
  }

  .status-card {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    position: relative;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  }

  .status-card:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }
  .status-card:focus-within { box-shadow: 0 0 0 2px var(--accent-glow); }

  .status-left { display: flex; align-items: center; gap: 10px; }

  .status-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  }

  .status-dot.up { background: var(--green); box-shadow: 0 0 6px rgba(74, 222, 128, 0.3); }
  .status-dot.down { background: var(--red); box-shadow: 0 0 6px rgba(248, 113, 113, 0.3); }
  .status-dot.checking { background: var(--text-muted); animation: checkPulse 1.5s ease-in-out infinite; }

  @keyframes checkPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

  .status-name { font-size: 12px; font-weight: 500; color: var(--text-primary); }
  .status-ms { font-size: 11px; font-family: 'IBM Plex Mono', monospace; color: var(--text-muted); }
  .status-ms.fast { color: var(--green); }
  .status-ms.medium { color: var(--orange); }
  .status-ms.slow { color: var(--red); }

  .status-card.dragging { opacity: 0.3; transition: opacity 0.2s ease; }
  .status-card.drag-over { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); transition: border-color 0.15s, box-shadow 0.15s; }
  .status-card:not(.editing) { cursor: grab; }
  .status-card.editing { cursor: grab; user-select: none; }
  .status-card.editing:active { cursor: grabbing; }

  .status-card .del-btn { top: 4px; right: 4px; }
  .status-card.editing .del-btn { display: flex; }
  .status-card .edit-card-btn { top: 4px; right: 28px; }
  .status-card.editing .edit-card-btn { display: flex; }
  .status-card .grip { top: 4px; left: 4px; }
  .status-card.editing .grip { display: block; }

  .add-status-card {
    display: none; align-items: center; justify-content: center;
    padding: 12px; background: transparent;
    border: 1.5px dashed var(--border); border-radius: 10px;
    color: var(--text-muted); cursor: pointer; transition: all 0.2s;
    font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  }

  .add-status-card:hover { border-color: var(--accent); color: var(--accent); }
  .add-status-card.visible { display: flex; }

  /* ==================== INTEGRATIONS ==================== */
  .integrations-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .integration-widget {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }
  .integration-widget:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  }

  .integration-widget-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 100%);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
  }
  .integration-widget-header .integration-open-link {
    margin-left: auto;
    font-size: 11px;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--accent);
    transition: background 0.2s, color 0.2s;
  }
  .integration-widget-header .integration-open-link:hover {
    background: var(--accent-dim);
    color: var(--accent);
  }
  .integration-widget-header .integration-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg-deep);
    border: 1px solid var(--border);
  }
  .integration-widget-body {
    padding: 14px 16px;
    font-size: 13px;
    color: var(--text-primary);
    max-height: 300px;
    overflow-y: auto;
    line-height: 1.45;
  }
  .integration-widget-body::-webkit-scrollbar { width: 6px; }
  .integration-widget-body::-webkit-scrollbar-track { background: transparent; }
  .integration-widget-body::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }
  .integration-widget-body.loading {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .integration-widget-body.loading::before {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: integration-spin 0.7s linear infinite;
  }
  @keyframes integration-spin { to { transform: rotate(360deg); } }
  .integration-widget-body.error { color: var(--red); font-size: 12px; }
  .integration-error-hint { margin-top: 10px; font-size: 11px; color: var(--text-muted); font-weight: 400; line-height: 1.4; }
  .integration-widget .del-btn { top: 8px; right: 8px; }
  .integration-widget .integration-del-btn,
  .integration-widget .integration-edit-btn { display: none; }
  .integration-widget.editing .integration-del-btn,
  .integration-widget.editing .integration-edit-btn { display: flex; }
  .integration-widget .edit-card-btn { top: 8px; right: 34px; }
  .integration-notion-line {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 4px;
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid var(--accent);
    transition: background 0.15s;
  }
  .integration-notion-line:hover { background: var(--accent-dim); }
  .integration-notion-line.integration-notion-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
  }
  .integration-notion-line.integration-notion-link:hover .notion-text { color: var(--accent); }
  .integration-notion-line:last-child { margin-bottom: 0; }
  .integration-notion-line .notion-type {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    min-width: 48px;
  }
  .integration-notion-line .notion-text { flex: 1; min-width: 0; word-break: break-word; }
  .integration-empty {
    color: var(--text-muted);
    font-size: 12px;
    margin: 0;
    padding: 12px 0;
    text-align: center;
  }

  .integration-types {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0;
  }
  .integration-type-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
  }
  .integration-type-btn:hover { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }

  .modal-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    margin-bottom: 0;
  }
  .modal-hint-block { margin-top: 6px; }
  .modal-hint-title { font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
  .modal-hint-steps { margin: 0; padding-left: 18px; font-size: 11px; color: var(--text-muted); line-height: 1.5; }
  .modal-hint-steps li { margin-bottom: 4px; }
  .modal-hint-steps a { color: var(--accent); }
  .modal-actions-spread { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
  .modal-actions-right { display: flex; gap: 8px; margin-left: auto; }
  .modal-btn.danger { background: transparent; border-color: var(--red); color: var(--red); }
  .modal-btn.danger:hover { background: rgba(248, 113, 113, 0.15); }

  /* ==================== MODAL ==================== */
  .modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100; display: flex;
    align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s;
  }

  .modal-overlay.open { opacity: 1; visibility: visible; pointer-events: auto; }

  /* Options (2 colonnes : nav gauche, contenu droite) */
  .options-modal {
    display: flex;
    flex-direction: row;
    width: 95vw;
    max-width: 880px;
    max-height: 85vh;
    padding: 0;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.35);
  }
  .options-modal .options-nav {
    flex-shrink: 0;
    width: 180px;
    padding: 24px 12px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: rgba(0, 0, 0, 0.15);
  }
  .options-nav-title {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-bottom: 12px;
    padding: 0 10px;
    opacity: 0.85;
  }
  .options-nav-item {
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
  }
  .options-nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
  }
  .options-nav-item.active {
    background: var(--accent-dim);
    color: var(--accent);
  }
  .options-modal .options-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
  }
  .options-modal .options-content {
    flex: 1;
    overflow-y: auto;
    padding: 28px 32px 24px;
    min-width: 0;
  }
  .options-panel {
    display: none;
  }
  .options-panel.active {
    display: block;
  }
  .options-panel-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
  }
  .options-panel-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.45;
  }
  .options-modal .options-content .modal-field {
    margin-bottom: 18px;
  }
  .options-modal .options-content .modal-field label {
    font-size: 11px;
    letter-spacing: 0.5px;
  }
  /* Bloc couleur accent : picker + hex sur une ligne */
  .options-modal .options-color-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
  }
  .options-modal .options-color-row input[type="color"] {
    width: 48px;
    height: 36px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    background: var(--bg-card);
  }
  .options-modal .options-color-row input[type="text"] {
    width: 88px;
    padding: 8px 10px;
    font-family: IBM Plex Mono, monospace;
    font-size: 12px;
    border-radius: 8px;
  }
  /* Présets thème dans Options */
  .options-modal .theme-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .options-modal .theme-preset-btn {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
  }
  .options-modal .theme-preset-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
  }
  .options-modal .theme-preset-btn.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
  }
  .options-modal-footer {
    flex-shrink: 0;
    padding: 16px 28px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
  }
  .options-modal-footer .modal-btn {
    min-width: 100px;
  }
  .options-modal .options-vault-hint { margin-bottom: 10px; }
  .options-modal .options-vault-active {
    font-size: 13px;
    color: var(--green);
    margin: 0;
  }
  .options-modal .options-vault-login-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
  }

  /* Options modal : responsive mobile */
  @media (max-width: 640px) {
    #options-modal-overlay {
      padding: 12px;
      align-items: flex-start;
    }
    #options-modal-overlay .options-modal {
      flex-direction: column;
      width: 100%;
      max-width: 100%;
      max-height: calc(90vh - 24px);
      border-radius: 12px;
    }
    .options-modal .options-nav {
      flex-direction: row;
      flex-wrap: wrap;
      width: 100%;
      min-height: auto;
      padding: 12px 16px;
      border-right: none;
      border-bottom: 1px solid var(--border);
      gap: 6px;
      justify-content: center;
    }
    .options-nav-title {
      flex-basis: 100%;
      text-align: center;
      margin-bottom: 8px;
    }
    .options-modal .options-nav-item {
      flex: 1;
      min-width: 100px;
      text-align: center;
    }
    .options-modal .options-right {
      flex: 1;
      min-height: 200px;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    .options-modal .options-content {
      flex: 1;
      min-height: 0;
      padding: 20px 16px 16px;
      overflow-y: auto;
    }
    .options-panel.active {
      min-height: 180px;
    }
    .options-modal-footer {
      padding: 12px 16px 20px;
    }
  }

  /* Coffre-fort (écran déverrouillage) */
  .vault-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
  .vault-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-hover);
    border-radius: 14px;
    padding: 28px;
    width: 360px;
    max-width: 100%;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
  }
  .vault-card h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: 1px;
  }
  .vault-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.4;
  }
  .vault-card input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
  }
  .vault-card input[type="password"]:focus {
    border-color: var(--accent);
  }
  .vault-error {
    font-size: 12px;
    color: var(--red);
    margin-bottom: 10px;
  }
  .vault-card .modal-btn { width: 100%; }

  .modal {
    background: var(--bg-surface);
    border: 1px solid var(--border-hover);
    border-radius: 14px;
    padding: 28px;
    max-width: 45vw;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
    transform: scale(0.96); transition: transform 0.2s ease;
  }

  .modal-overlay.open .modal { transform: scale(1); }

  .modal h3 {
    font-size: 14px; font-weight: 600;
    color: var(--text-primary); margin-bottom: 20px;
    letter-spacing: 1px;
  }

  .modal-field { margin-bottom: 14px; }

  .modal-field label {
    display: block; font-size: 11px; color: var(--text-muted);
    margin-bottom: 5px; letter-spacing: 1px; text-transform: uppercase;
  }
  .modal-field-checkbox { margin-bottom: 12px; }
  .modal-field-checkbox .checkbox-label {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--text-secondary);
    cursor: pointer; text-transform: none; letter-spacing: 0;
  }
  .modal-field-checkbox .checkbox-label input[type="checkbox"] {
    width: 16px; height: 16px; margin: 0;
    accent-color: var(--accent);
  }

  .modal-field input {
    width: 100%; padding: 9px 12px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 7px; color: var(--text-primary);
    font-family: 'IBM Plex Mono', monospace; font-size: 12px;
    outline: none; transition: border-color 0.2s;
  }

  .modal-field input:focus { border-color: var(--accent); }
  .modal-field input::placeholder { color: var(--text-muted); }

  .modal-colors { display: flex; gap: 6px; flex-wrap: wrap; }

  .color-opt {
    width: 28px; height: 28px; border-radius: 6px;
    border: 2px solid transparent; cursor: pointer; transition: all 0.15s;
    opacity: 0.7;
  }

  .color-opt:hover { opacity: 1; transform: scale(1.1); }
  .color-opt.selected { border-color: var(--text-primary); opacity: 1; }

  .modal-actions { display: flex; gap: 8px; margin-top: 20px; }

  .modal-btn {
    flex: 1; padding: 9px; border-radius: 7px;
    font-family: 'IBM Plex Sans', sans-serif; font-size: 12px; font-weight: 500;
    cursor: pointer; transition: all 0.2s; border: none;
  }

  .modal-btn.cancel { background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border); }
  .modal-btn.cancel:hover { background: var(--bg-card-hover); }
  .modal-btn:focus-visible { outline-offset: 3px; }

  .modal-btn.confirm { background: var(--accent); color: #fff; }
  .modal-btn.confirm:hover { opacity: 0.9; transform: translateY(-0.5px); }
  .modal-btn.confirm:active { transform: translateY(0); }

  /* ==================== FOOTER ==================== */
  .footer {
    margin-top: auto;
    text-align: center; padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 10px; color: var(--text-muted); letter-spacing: 2px;
  }

  /* Hint clavier */
  .search-hint {
    font-size: 10px; color: var(--text-secondary);
    margin-top: 6px; letter-spacing: 1px;
  }
  .search-hint kbd {
    font-family: 'IBM Plex Mono', monospace;
    padding: 2px 5px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 10px;
  }

  .footer-version { font-size: 11px; color: var(--text-muted); margin-left: 4px; }
  .footer-actions {
    display: flex; justify-content: center; gap: 16px; flex-wrap: wrap;
    margin-top: 8px;
  }
  .footer-actions button, .footer-actions a {
    font-family: 'IBM Plex Mono', monospace; font-size: 11px;
    color: var(--text-muted); background: none; border: none;
    cursor: pointer; text-decoration: none;
    padding: 4px 0; border-bottom: 1px solid transparent;
  }
  .footer-actions button:hover, .footer-actions a:hover {
    color: var(--accent); border-bottom-color: var(--accent);
  }

  .sync-modal .modal-field textarea {
    width: 100%; min-height: 80px; padding: 10px 12px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 7px; color: var(--text-primary);
    font-family: 'IBM Plex Mono', monospace; font-size: 11px;
    resize: vertical; outline: none;
  }
  .sync-modal .modal-field textarea:focus { border-color: var(--accent); }
  .sync-modal .modal-field textarea::placeholder { color: var(--text-muted); }
  .theme-presets { display: flex; flex-wrap: wrap; gap: 8px; }
  .theme-preset-btn {
    padding: 6px 12px; font-size: 12px;
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text-secondary); border-radius: 6px; cursor: pointer;
  }
  .theme-preset-btn:hover { border-color: var(--accent); color: var(--accent); }

  /* Toasts */
  #toast-container {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    z-index: 10000; display: flex; flex-direction: column; gap: 8px;
    pointer-events: none;
  }
  .toast {
    padding: 10px 16px; font-size: 13px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    color: var(--text-primary);
    animation: toastIn 0.2s ease-out;
  }
  .toast.success { border-color: var(--green); }
  .toast.error { border-color: var(--red); }
  @keyframes toastIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* Offline banner */
  #offline-banner {
    position: fixed; top: 0; left: 0; right: 0;
    padding: 8px 16px; font-size: 12px; text-align: center;
    background: var(--orange); color: #000; z-index: 9999;
    display: none;
  }
  #offline-banner.show { display: block; }

  /* Bannière mise à jour PWA */
  #update-banner {
    position: fixed; bottom: 0; left: 0; right: 0;
    padding: 10px 16px; font-size: 13px; text-align: center;
    background: var(--bg-card); border-top: 1px solid var(--border);
    color: var(--text-primary); z-index: 9998;
    display: none; align-items: center; justify-content: center; gap: 12px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
  }
  #update-banner.show { display: flex; }
  #update-banner .update-btn {
    padding: 6px 14px; font-size: 12px; font-weight: 600;
    background: var(--green); color: #000; border: none; border-radius: 6px;
    cursor: pointer;
  }
  #update-banner .update-btn:hover { filter: brightness(1.1); }

  /* Sync status */
  .sync-status { font-size: 10px; color: var(--text-muted); margin-left: 4px; }
  .sync-status.saving { color: var(--orange); }
  .sync-status.saved { color: var(--green); }
  .sync-status.error { color: var(--red); }
  .footer-sync-time { display: block; font-size: 10px; color: var(--text-muted); margin-top: 6px; letter-spacing: 1px; }

  /* ==================== MATRIX PANEL ==================== */
  #matrix-panel {
    position: fixed; top: 0; right: 0; bottom: 0; width: 380px; max-width: 100%;
    background: var(--bg-surface); border-left: 1px solid var(--border);
    z-index: 9000; display: flex; flex-direction: column;
    box-shadow: -4px 0 24px rgba(0,0,0,0.2);
    transform: translateX(100%); transition: transform 0.25s ease;
  }
  #matrix-panel.open { transform: translateX(0); }
  #matrix-panel .matrix-header {
    padding: 12px 16px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0;
  }
  #matrix-panel .matrix-header h3 { font-size: 14px; font-weight: 600; color: var(--text-primary); }
  #matrix-panel .matrix-logout { background: none; border: none; color: var(--text-muted); font-size: 12px; cursor: pointer; padding: 4px 8px; }
  #matrix-panel .matrix-logout:hover { color: var(--text-primary); }
  #matrix-panel .matrix-close { background: none; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; padding: 4px; }
  #matrix-panel .matrix-close:hover { color: var(--text-primary); }
  #matrix-panel .matrix-login {
    padding: 20px; display: flex; flex-direction: column; gap: 12px;
  }
  #matrix-panel .matrix-login input { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-primary); font-size: 13px; }
  #matrix-panel .matrix-login input::placeholder { color: var(--text-muted); }
  #matrix-panel .matrix-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
  #matrix-panel .matrix-rooms {
    border-bottom: 1px solid var(--border); overflow-y: auto; max-height: 180px;
    flex-shrink: 0;
  }
  #matrix-panel .matrix-room {
    padding: 10px 16px; cursor: pointer; border-bottom: 1px solid var(--border);
    font-size: 13px; color: var(--text-primary);
    display: flex; justify-content: space-between; align-items: center;
  }
  #matrix-panel .matrix-room:hover { background: var(--bg-card-hover); }
  #matrix-panel .matrix-room.active { background: var(--accent-dim); color: var(--accent); }
  #matrix-panel .matrix-room-unread { background: var(--red); color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 10px; }
  #matrix-panel .matrix-messages {
    flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px;
  }
  #matrix-panel .matrix-msg {
    font-size: 12px; max-width: 90%;
    padding: 8px 12px; border-radius: 8px; background: var(--bg-card);
    border: 1px solid var(--border);
  }
  #matrix-panel .matrix-msg.sent { align-self: flex-end; background: var(--accent-dim); border-color: var(--accent); }
  #matrix-panel .matrix-msg .matrix-msg-sender { font-weight: 600; color: var(--text-secondary); margin-bottom: 2px; font-size: 11px; }
  #matrix-panel .matrix-send {
    padding: 12px; border-top: 1px solid var(--border);
    display: flex; gap: 8px; align-items: center;
  }
  #matrix-panel .matrix-send input {
    flex: 1; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text-primary); font-size: 13px;
  }
  #matrix-panel .matrix-send button {
    padding: 10px 16px; border-radius: 8px; border: none;
    background: var(--accent); color: #fff; font-weight: 500; cursor: pointer;
  }
  #matrix-panel .matrix-send button:disabled { opacity: 0.5; cursor: not-allowed; }
  #matrix-panel .matrix-empty { padding: 20px; text-align: center; color: var(--text-muted); font-size: 13px; }

  /* ==================== ANIMATIONS ==================== */
  .fade-in {
    opacity: 0; transform: translateY(10px);
    animation: fadeIn 0.4s ease forwards;
  }

  .fade-in:nth-child(1) { animation-delay: 0s; }
  .fade-in:nth-child(2) { animation-delay: 0.05s; }
  .fade-in:nth-child(3) { animation-delay: 0.1s; }
  .fade-in:nth-child(4) { animation-delay: 0.15s; }
  .fade-in:nth-child(5) { animation-delay: 0.2s; }
  .fade-in:nth-child(6) { animation-delay: 0.25s; }

  @keyframes fadeIn { to { opacity: 1; transform: translateY(0); } }

  @media (max-width: 768px) {
    .clock { font-size: 48px; }
    .container { padding: 24px 16px; }
    .links-grid, .status-grid { grid-template-columns: 1fr; }
    .header { flex-direction: column; gap: 12px; align-items: center; }
    .header .logo-area { flex-shrink: 0; }
    .header-info {
      flex-wrap: wrap;
      gap: 12px;
      font-size: 12px;
      justify-content: center;
      min-width: 0;
      width: 100%;
    }
    .header-sync {
      flex-wrap: wrap;
      gap: 8px;
      min-width: 0;
      justify-content: center;
    }
    .header-sync button {
      font-size: 10px;
      padding: 6px 8px;
    }
    .header-icon-btn {
      padding: 6px 8px;
      font-size: 14px;
    }
    .weather {
      gap: 4px;
      min-width: 0;
    }
    #weather-desc {
      max-width: 80px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    #date-display {
      font-size: 11px;
    }
    .sync-badge {
      font-size: 9px;
    }
    .search-row { flex-wrap: wrap; }
    .search-engine-select { max-width: none; }
    .search-hint { display: none; }
  }

  @media (max-width: 480px) {
    .header-info {
      gap: 10px;
      font-size: 11px;
    }
    .header-sync { gap: 6px; }
    .header-sync button {
      font-size: 10px;
      padding: 5px 6px;
    }
    #weather-desc { max-width: 60px; }
    #date-display { font-size: 10px; }
    .logo-text .logo-title { font-size: 16px; }
    .logo-mark { width: 32px; height: 32px; font-size: 14px; }
    .sync-status {
      max-width: 72px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }

  /* ==================== TUTORIEL ==================== */
  .tutorial-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s;
  }
  .tutorial-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .tutorial-modal {
    background: var(--bg-surface);
    border: 1px solid var(--border-hover);
    border-radius: 16px;
    padding: 0;
    width: 420px;
    max-width: 92vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.4);
    transform: scale(0.94);
    transition: transform 0.25s ease;
  }
  .tutorial-overlay.open .tutorial-modal {
    transform: scale(1);
  }
  .tutorial-header {
    padding: 16px 20px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
  }
  .tutorial-header h3 {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
  }
  .tutorial-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
  }
  .tutorial-close:hover {
    color: var(--text-primary);
  }
  .tutorial-body {
    padding: 24px 20px 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 120px;
  }
  .tutorial-step {
    display: none;
    animation: tutorialStepOut 0.2s ease forwards;
  }
  .tutorial-step.active {
    display: block;
    animation: tutorialStepIn 0.3s ease forwards;
  }
  .tutorial-step h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 10px;
    letter-spacing: 0.5px;
  }
  .tutorial-step p {
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-secondary);
  }
  .tutorial-step p + p {
    margin-top: 8px;
  }
  .tutorial-step kbd,
  .tutorial-step code {
    font-family: 'IBM Plex Mono', monospace;
    padding: 2px 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 12px;
  }
  .tutorial-step code { color: var(--accent); }
  @keyframes tutorialStepIn {
    from {
      opacity: 0;
      transform: translateX(12px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }
  @keyframes tutorialStepOut {
    from {
      opacity: 1;
      transform: translateX(0);
    }
    to {
      opacity: 0;
      transform: translateX(-8px);
    }
  }
  .tutorial-footer {
    padding: 12px 20px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
  }
  .tutorial-dots {
    display: flex;
    gap: 6px;
    align-items: center;
  }
  .tutorial-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-hover);
    transition: background 0.2s, transform 0.2s;
  }
  .tutorial-dot.active {
    background: var(--accent);
    transform: scale(1.2);
  }
  .tutorial-nav {
    display: flex;
    gap: 8px;
    align-items: center;
  }
  .tutorial-nav .modal-btn {
    min-width: 80px;
  }
