
    /* ════════════════════════════════════════════════════════════════
       DESIGN TOKENS — every color lives here or in [data-theme="dark"]
       ════════════════════════════════════════════════════════════════ */
    :root {
      /* spec tokens — light (default) */
      --bg-body:      transparent;
      --panel-bg:     rgba(255,255,255,0.82);
      --panel-border: rgba(180,160,255,0.35);
      --nav-bg:       rgba(240,238,255,0.5);
      --ink:          #0d0a2e;
      --ink-soft:     #3a3060;
      --violet:       #534AB7;
      --mauve:        #7c6fd4;
      --lavender:     #EEEDFE;

      /* extended palette */
      --ink-faint:    #8880c0;
      --violet-deep:  #3C3489;
      --violet-light: #a098e0;
      --paper:        #ffffff;
      --bar-color:    #ffffff;

      /* surfaces */
      --scrim:        transparent;
      --glass-edge:   rgba(255,255,255,0.5);
      --glass-top:    rgba(255,255,255,0.7);
      --panel-tint:   rgba(238,237,254,0.55);
      --chip:         rgba(238,235,251,0.85);
      --chip-hover:   rgba(221,216,247,0.95);
      --field-bg:     rgba(238,237,254,0.35);
      --field-bg-focus: rgba(245,243,255,0.6);
      --modal-bg:     rgba(250,249,255,0.97);
      --hairline:     rgba(140,120,220,0.20);
      --hairline-strong: rgba(124,111,212,0.40);
      --pill:         rgba(124,111,212,0.18);
      --soft-fill:    rgba(124,111,212,0.07);
      --soft-fill-strong: rgba(124,111,212,0.10);
      --deco:         rgba(124,111,212,0.12);

      /* status */
      --danger:       #8b2020;
      --danger-bg:    #fdf0f0;
      --danger-bd:    #c47070;
      --danger-soft:  #b06060;
      --danger-deep:  #802020;
      --error-ink:    rgba(160,40,40,0.9);
      --error-bg:     rgba(255,100,100,0.07);
      --error-bd:     rgba(200,100,100,0.2);
      --ok-ink:       rgba(30,120,70,0.9);
      --ok-bg:        rgba(100,200,100,0.07);
      --ok-bd:        rgba(100,180,100,0.2);

      /* overlays */
      --overlay:      rgba(20,15,50,0.45);
      --oc-overlay:   rgba(0,0,0,0.3);
      --avatar-veil:  rgba(83,74,183,0.45);
      --toast-bg:     #3C3489;
      --toast-ink:    #eeedf8;

      /* glows + shadows (color baked into tokens) */
      --star-a:       rgba(100,80,200,0.4);
      --star-b:       rgba(140,120,220,0.3);
      --star-c:       rgba(100,80,200,0.35);
      --star-d:       rgba(140,120,220,0.25);
      --star-e:       rgba(100,80,200,0.3);
      --star-f:       rgba(100,80,200,0.2);
      --logo-glow:    rgba(255,255,255,0.2);
      --logo-glow-hover: rgba(124,111,212,0.7);
      --title-glow:   rgba(124,111,212,0.25);
      --selection:    rgba(124,111,212,0.28);
      --scrollbar:    rgba(124,111,212,0.30);
      --scrollbar-hover: rgba(124,111,212,0.5);
      --ring:         rgba(124,111,212,0.16);
      --avatar-ring:  rgba(124,111,212,0.35);
      --avatar-halo:  rgba(124,111,212,0.08);
      --avatar-halo-hover: rgba(124,111,212,0.14);
      --msg-glow:     rgba(124,111,212,0.6);

      --shadow-panel: 0 2px 4px rgba(0,0,0,0.04), 0 12px 40px rgba(60,52,137,0.10),
                      inset 0 1px 0 rgba(255,255,255,0.7), inset 1px 1px 0 rgba(255,255,255,0.5);
      --shadow-hover: 0 4px 8px rgba(0,0,0,0.05), 0 18px 52px rgba(60,52,137,0.16),
                      inset 0 1px 0 rgba(255,255,255,0.7), inset 1px 1px 0 rgba(255,255,255,0.5);
      --shadow-soft:  0 2px 10px rgba(83,74,183,0.10);
      --shadow-btn:   0 4px 16px rgba(60,52,137,0.30);
      --shadow-item:  0 4px 14px rgba(83,74,183,0.10);
      --shadow-cover: 0 10px 26px rgba(83,74,183,0.22);
      --shadow-avatar:0 6px 18px rgba(60,52,137,0.14);
      --shadow-avatar-hover: 0 10px 26px rgba(60,52,137,0.20);
      --shadow-modal: 0 8px 16px rgba(20,15,50,0.10), 0 32px 80px rgba(20,15,50,0.28);
      --shadow-toast: 0 8px 28px rgba(20,15,50,0.35);
      --shadow-navbtn:0 2px 8px rgba(83,74,183,0.16);

      /* geometry */
      --rail-w: clamp(200px, 20vw, 240px);
      /* hauteur des panneaux en focus — « niveau de la lune ».
         Ajuster cette seule valeur pour aligner le bas du panneau sur la lune
         du background ; les panneaux suivants dépassent en dessous. */
      --focus-h: 74vh;
      --focus-h: 74dvh;
      --radius-lg: 20px;
      --radius-md: 12px;
      --radius-sm: 8px;

      /* spacing scale (8px base) */
      --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
      --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 40px; --s-9: 56px;

      /* type scale */
      --text-2xs: 10px;
      --text-xs:  11px;
      --text-sm:  12px;
      --text-md:  13px;
      --text-lg:  16px;
      --text-h1:  clamp(36px, 5.5vw, 56px);

      /* motion */
      --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
      --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
      --dur-fast: 200ms;
      --dur-med:  280ms;
      --dur-slow: 380ms;

      --font-mono: 'Courier Prime', 'Courier New', monospace;
      --font-ui:   'Inter', system-ui, sans-serif;
    }

    [data-theme="dark"] {
      --panel-bg:     rgba(8,5,28,0.88);
      --panel-border: rgba(255,255,255,0.10);
      --nav-bg:       rgba(4,2,18,0.92);
      --ink:          #f0ecff;
      --ink-soft:     #b8b0e0;
      --violet:       #8b82e0;
      --mauve:        #a098e0;
      --lavender:     rgba(124,111,212,0.18);

      --ink-faint:    #6f68a8;
      --violet-deep:  #a89fe8;
      --violet-light: #b8b0ec;
      --paper:        #14103a;
      --bar-color:    #ffffff;

      --scrim:        rgba(8,5,28,0.62);
      --glass-edge:   rgba(255,255,255,0.10);
      --glass-top:    rgba(255,255,255,0.12);
      --panel-tint:   rgba(124,111,212,0.10);
      --chip:         rgba(124,111,212,0.14);
      --chip-hover:   rgba(124,111,212,0.24);
      --field-bg:     rgba(124,111,212,0.10);
      --field-bg-focus: rgba(124,111,212,0.16);
      --modal-bg:     rgba(24,18,58,0.97);
      --hairline:     rgba(160,150,228,0.18);
      --hairline-strong: rgba(160,150,228,0.40);
      --pill:         rgba(124,111,212,0.18);
      --soft-fill:    rgba(139,130,224,0.10);
      --soft-fill-strong: rgba(139,130,224,0.16);
      --deco:         rgba(124,111,212,0.12);

      --danger:       #e6a3a3;
      --danger-bg:    rgba(180,70,70,0.14);
      --danger-bd:    rgba(196,112,112,0.5);
      --danger-soft:  #cf8a8a;
      --danger-deep:  #f0b8b8;
      --error-ink:    rgba(235,150,150,0.95);
      --error-bg:     rgba(255,100,100,0.10);
      --error-bd:     rgba(200,100,100,0.32);
      --ok-ink:       rgba(130,220,170,0.95);
      --ok-bg:        rgba(100,200,100,0.10);
      --ok-bd:        rgba(100,180,100,0.30);

      --overlay:      rgba(5,3,18,0.62);
      --oc-overlay:   rgba(0,0,0,0.3);
      --avatar-veil:  rgba(83,74,183,0.55);
      --toast-bg:     #EEEDFE;
      --toast-ink:    #1e1740;

      --star-a:       rgba(160,140,255,0.5);
      --star-b:       rgba(190,175,255,0.38);
      --star-c:       rgba(160,140,255,0.42);
      --star-d:       rgba(190,175,255,0.3);
      --star-e:       rgba(160,140,255,0.36);
      --star-f:       rgba(160,140,255,0.26);
      --logo-glow:    rgba(124,111,212,0.25);
      --logo-glow-hover: rgba(160,150,228,0.8);
      --title-glow:   rgba(139,130,224,0.30);
      --selection:    rgba(139,130,224,0.35);
      --scrollbar:    rgba(139,130,224,0.30);
      --scrollbar-hover: rgba(139,130,224,0.5);
      --ring:         rgba(139,130,224,0.22);
      --avatar-ring:  rgba(139,130,224,0.45);
      --avatar-halo:  rgba(139,130,224,0.12);
      --avatar-halo-hover: rgba(139,130,224,0.2);
      --msg-glow:     rgba(139,130,224,0.7);

      --shadow-panel: 0 2px 4px rgba(0,0,0,0.20), 0 12px 40px rgba(0,0,0,0.35),
                      inset 0 1px 0 rgba(255,255,255,0.07), inset 1px 1px 0 rgba(255,255,255,0.05);
      --shadow-hover: 0 4px 8px rgba(0,0,0,0.25), 0 18px 52px rgba(0,0,0,0.45),
                      inset 0 1px 0 rgba(255,255,255,0.07), inset 1px 1px 0 rgba(255,255,255,0.05);
      --shadow-soft:  0 2px 10px rgba(0,0,0,0.25);
      --shadow-btn:   0 4px 16px rgba(0,0,0,0.40);
      --shadow-item:  0 4px 14px rgba(0,0,0,0.28);
      --shadow-cover: 0 10px 26px rgba(0,0,0,0.45);
      --shadow-avatar:0 6px 18px rgba(0,0,0,0.35);
      --shadow-avatar-hover: 0 10px 26px rgba(0,0,0,0.45);
      --shadow-modal: 0 8px 16px rgba(0,0,0,0.35), 0 32px 80px rgba(0,0,0,0.55);
      --shadow-toast: 0 8px 28px rgba(0,0,0,0.5);
      --shadow-navbtn:0 2px 8px rgba(0,0,0,0.30);
    }

    /* ════════════════════════════════════════════════════════════════
       BASE
       ════════════════════════════════════════════════════════════════ */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html { -webkit-text-size-adjust: 100%; }
    html, body {
      width: 100%; min-height: 100%;
      background: url('https://ajamonet.com/background.png') center center / cover no-repeat fixed;
      color: var(--ink);
      font-family: var(--font-mono);
      font-size: var(--text-md);
      line-height: 1.6;
    }
    body {
      background-color: var(--bg-body);
      overflow-x: hidden;
      transition: background 400ms ease, color 400ms ease;
    }
    /* dark scrim over the background image so glass reads in dark mode */
    body::before {
      content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
      background: var(--scrim);
      transition: background 400ms ease;
    }
    ::selection { background: var(--selection); color: var(--ink); }
    :focus-visible { outline: 2px solid var(--mauve); outline-offset: 2px; border-radius: 2px; }
    button, input, textarea { font-family: inherit; }
    img { display: block; }

    ::-webkit-scrollbar { width: 10px; height: 10px; }
    ::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
    ::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-hover); background-clip: content-box; }
    ::-webkit-scrollbar-track { background: transparent; }

    /* ════════════════════════════════════════════════════════════════
       AMBIENT — starfield
       ════════════════════════════════════════════════════════════════ */
    #starfield {
      position: fixed; inset: 0; z-index: 0; pointer-events: none;
      background:
        radial-gradient(2px 2px at 5%  10%, var(--star-a), transparent),
        radial-gradient(1px 1px at 15% 65%, var(--star-b), transparent),
        radial-gradient(2px 2px at 25% 30%, var(--star-c), transparent),
        radial-gradient(1px 1px at 40% 80%, var(--star-d), transparent),
        radial-gradient(2px 2px at 55% 15%, var(--star-e), transparent),
        radial-gradient(1px 1px at 68% 55%, var(--star-d), transparent),
        radial-gradient(2px 2px at 78% 72%, var(--star-e), transparent),
        radial-gradient(1px 1px at 90% 20%, var(--star-b), transparent),
        radial-gradient(1px 1px at 95% 88%, var(--star-f), transparent);
      background-size: 600px 600px;
      animation: starsDrift 220s linear infinite;
    }
    @keyframes starsDrift { from { background-position: 0 0; } to { background-position: 600px 1200px; } }

    /* ════════════════════════════════════════════════════════════════
       APP SHELL — left rail + right column
       ════════════════════════════════════════════════════════════════ */
    .app { position: relative; z-index: 1; display: flex; align-items: flex-start; width: 100%; }

    #side-rail {
      position: sticky; top: 0; flex: 0 0 var(--rail-w);
      width: var(--rail-w); height: 100vh; height: 100dvh;
      display: flex; flex-direction: column; align-items: stretch;
      padding: 0 0 var(--s-4);
      background: var(--nav-bg);
      -webkit-backdrop-filter: blur(24px) saturate(1.8);
      backdrop-filter: blur(24px) saturate(1.8);
      border-right: 0.5px solid var(--panel-border);
      box-shadow: var(--shadow-panel);
      z-index: 60;
      overflow: visible;
      transition: background 400ms ease;
    }
    .rail-logo {
      display: flex; align-items: center; justify-content: flex-start;
      width: 100%; padding: 24px 20px; margin-bottom: var(--s-3);
      filter: drop-shadow(0 0 6px var(--logo-glow));
      transition: filter var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-spring);
    }
    .rail-logo:hover { filter: drop-shadow(0 0 14px var(--logo-glow-hover)); transform: scale(1.06); }
    .rail-logo:active { transform: scale(0.96); }
    .rail-logo img { width: 80%; height: auto; object-fit: contain; }

    .rail-nav { display: flex; flex-direction: column; gap: var(--s-2); width: 100%; align-items: stretch; }
    .rail-item {
      position: relative;
      width: 100%;
      display: flex; align-items: center; gap: var(--s-3);
      padding: 12px 20px;
      background: none; border: none; cursor: pointer; text-align: left;
      color: var(--ink);
      border-radius: var(--radius-md);
      transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
    }
    .rail-ico {
      font-size: 24px; width: 24px; line-height: 1; color: var(--violet);
      text-align: center; flex-shrink: 0;
    }
    .rail-label {
      font-family: var(--font-ui); font-weight: 500; font-size: 13px;
      letter-spacing: 0.08em; text-transform: lowercase;
    }
    .rail-item:hover { background: var(--soft-fill-strong); transform: translateY(-1px); }
    .rail-item.active { background: var(--pill); }
    .rail-item.active::before {
      content: ''; position: absolute; left: 6px; top: 10px; bottom: 10px;
      width: 2px; border-radius: 2px; background: var(--violet);
    }
    .rail-item.is-hidden { opacity: 0.38; }
    .rail-item.is-hidden::after {
      content: ''; position: absolute; right: 7px; top: 7px;
      width: 5px; height: 5px; border-radius: 50%; background: var(--mauve);
    }
    .rail-spacer { flex: 1; }

    .theme-toggle {
      width: 48px; height: 44px; align-self: center;
      display: flex; align-items: center; justify-content: center;
      background: none; border: none; cursor: pointer;
      font-size: 22px; line-height: 1; color: var(--violet);
      border-radius: var(--radius-md);
      transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
    }
    .theme-toggle:hover { background: var(--soft-fill-strong); transform: rotate(12deg); }
    .ico-sun, .ico-moon { display: none; }
    [data-theme="light"] .ico-sun { display: inline; }
    [data-theme="dark"]  .ico-moon { display: inline; }

    /* ── right column ── */
    #stage {
      position: relative; z-index: 1;
      flex: 1 1 auto; min-width: 0;
      padding: clamp(1.5rem, 4vmin, 2.75rem) clamp(1rem, 3vw, 2rem) var(--s-9);
    }

    .page-head { position: relative; z-index: 1; margin-bottom: var(--s-6); }
    .page-title {
      font-size: var(--text-h1);
      font-weight: 700;
      line-height: 1.05;
      letter-spacing: -0.015em;
      text-transform: lowercase;
      background: linear-gradient(118deg, var(--violet-deep) 0%, var(--violet) 38%, var(--mauve) 68%, var(--violet-light) 100%);
      -webkit-background-clip: text; background-clip: text;
      -webkit-text-fill-color: transparent; color: transparent;
      text-shadow: 0 0 32px var(--title-glow);
      width: fit-content;
    }
    .page-sub {
      margin-top: var(--s-2);
      font-size: var(--text-sm);
      color: var(--ink-faint);
      letter-spacing: 0.22em;
      text-transform: lowercase;
    }

    /* ════════════════════════════════════════════════════════════════
       WIDGET GRID
       ════════════════════════════════════════════════════════════════ */
    #panel-grid {
      display: grid;
      grid-template-columns: repeat(6, 1fr);
      grid-auto-rows: auto;
      grid-auto-flow: dense;
      gap: var(--s-5);
      align-items: stretch;
      min-width: 0;
    }
    #panel-grid > * { min-width: 0; }

    .cspan-1 { grid-column: span 1; }
    .cspan-2 { grid-column: span 2; }
    .cspan-3 { grid-column: span 3; }
    .cspan-4 { grid-column: span 4; }
    .cspan-5 { grid-column: span 5; }
    .cspan-6 { grid-column: span 6; }

    /* ════════════════════════════════════════════════════════════════
       PANELS — liquid glass
       ════════════════════════════════════════════════════════════════ */
    .panel {
      position: relative; overflow: hidden; min-width: 0; min-height: 160px;
      background: var(--panel-bg);
      -webkit-backdrop-filter: blur(24px) saturate(1.8);
      backdrop-filter: blur(24px) saturate(1.8);
      border: 0.5px solid var(--panel-border);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-panel);
      padding: 44px var(--s-6) var(--s-6);
      transition:
        background 400ms ease, color 400ms ease,
        box-shadow var(--dur-slow) var(--ease-out),
        border-color var(--dur-slow) var(--ease-out),
        opacity var(--dur-fast) var(--ease-out);
    }
    .panel:hover { box-shadow: var(--shadow-hover); border-color: var(--hairline-strong); }
    .panel > * { position: relative; z-index: 1; }
    .panel.dragging { opacity: 0.45; }
    .panel.panel-hidden { display: none; }

    /* chrome bar — traffic lights + drag handle */
    .panel-chrome {
      position: absolute; top: 0; left: 0; right: 0; height: 30px; z-index: 3;
      display: flex; align-items: center; gap: var(--s-2);
      padding: 0 var(--s-3);
      cursor: grab;
      border-bottom: 0.5px solid var(--hairline);
      background: var(--soft-fill);
      user-select: none; -webkit-user-select: none;
      transition: background var(--dur-fast) var(--ease-out);
    }
    .panel-chrome:hover { background: var(--soft-fill-strong); }
    .panel-chrome:active { cursor: grabbing; }
    .grip-dots { font-size: 11px; letter-spacing: 2px; color: var(--ink-faint); pointer-events: none; }
    .chrome-spacer { flex: 1; }
    /* macOS traffic lights — close (rouge, toujours), réduire (jaune, focus
       uniquement), agrandir (vert, hors focus) ; symboles au survol du chrome */
    .traffic { display: flex; align-items: center; gap: 8px; }
    .tl {
      width: 13px; height: 13px; border-radius: 50%; padding: 0;
      cursor: pointer; flex-shrink: 0;
      display: flex; align-items: center; justify-content: center;
      font-size: 9px; font-weight: 700; line-height: 1; font-family: var(--font-ui);
      color: transparent;
      transition: color var(--dur-fast) ease, filter var(--dur-fast) ease, transform var(--dur-fast) var(--ease-spring);
    }
    .tl:hover { filter: brightness(1.1); }
    .tl:active { transform: scale(0.88); filter: brightness(0.92); }
    .panel-chrome:hover .tl, .tl:focus-visible { color: rgba(0,0,0,0.62); }
    .tl-close { background: #ff5f57; border: 0.5px solid #e0443e; }
    .tl-min   { background: #febc2e; border: 0.5px solid #d89e20; display: none; }
    .tl-max   { background: #28c840; border: 0.5px solid #19a629; }
    .panel.focused .tl-min  { display: flex; }
    .panel.focused .tl-max  { display: none; }

    /* resize grip — bottom-right corner */
    .resize-grip {
      position: absolute; right: 4px; bottom: 4px; z-index: 3;
      width: 18px; height: 18px; cursor: nwse-resize;
      background:
        linear-gradient(135deg, transparent 0 46%, var(--violet) 46% 54%, transparent 54% 64%, var(--violet) 64% 72%, transparent 72% 82%, var(--violet) 82% 90%, transparent 90%);
      border-bottom-right-radius: var(--radius-md);
      opacity: 0.9; touch-action: none;
      transition: opacity var(--dur-fast) var(--ease-out);
    }
    .resize-grip:hover { opacity: 1; }

    /* resize grip — bottom-center, vertical */
    .resize-grip-v {
      position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 3;
      width: 64px; height: 14px; cursor: ns-resize;
      opacity: 0.95; touch-action: none;
      transition: opacity var(--dur-fast) var(--ease-out);
    }
    .resize-grip-v::before {
      content: ''; position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%);
      width: 44px; height: 5px; border-radius: 3px;
      background: var(--violet);
      box-shadow: 0 0 0 1.5px var(--panel-bg), 0 1px 4px rgba(0,0,0,0.25);
    }
    .resize-grip-v:hover::before { background: var(--violet-deep); }
    .resize-grip-v:hover { opacity: 1; }

    /* focus mode */
    /* EXPAND — full width + focus-h, reste dans le flux (pas d'order ni z-index élevé) */
    .panel.expanded {
      grid-column: 1 / -1 !important;
      height: var(--focus-h);
      min-height: 0;
    }
    .panel.expanded .tl-max { display: none; }
    .panel.expanded .tl-min { display: flex; }

    /* FOCUS — move above all, full width, height = var(--focus-h) (nav click) */
    .panel.focused {
      grid-column: 1 / -1 !important;
      order: -1;
      height: var(--focus-h);
      min-height: 0;
      z-index: 5;
    }

    /* (3) profil en focus : pas full screen — double largeur / double hauteur */
    .panel.focused[data-panel="user"] {
      grid-column: span 4 !important;
      height: auto;
      min-height: 520px;
      justify-content: flex-start;
      padding-top: 52px;
    }
    .panel.focused[data-panel="user"] .user-gear { display: none; }

    /* (2) options du compte intégrées au panneau profil en focus */
    .account-host { display: none; width: 100%; }
    .panel.focused[data-panel="user"] .account-host { display: block; margin-top: var(--s-4); }
    .account-host .modal-box {
      position: static; width: 100%; max-width: 560px; margin: 0 auto;
      background: transparent; border: none; box-shadow: none; padding: 0;
      animation: none; text-align: left;
    }
    .account-host .modal-close { display: none; }

    /* (5) calendrier en focus : liste verticale qui défile */
    .panel.focused[data-panel="calendar"] { display: flex; flex-direction: column; }
    .panel.focused[data-panel="calendar"] .cal-list { min-height: 0; }
    .cal-month {
      font-size: var(--text-2xs); color: var(--ink-faint);
      letter-spacing: 0.08em; text-transform: lowercase; margin-top: 2px;
    }

    /* (9) archive en focus : la liste de fichiers défile, les contrôles restent visibles */
    .panel.focused[data-panel="archive"] .files-list { overflow-y: auto; min-height: 0; }

    /* (10) library en focus : la grille remplit la hauteur disponible */
    .panel.focused[data-panel="library"] { display: flex; flex-direction: column; }
    .panel.focused[data-panel="library"] .library-grid { flex: 1; min-height: 0; overflow: hidden; align-content: start; }

    /* (13) état réduit — atteint en glissant la poignée sous la hauteur minimale */
    .panel.collapsed {
      height: 34px !important;
      min-height: 34px;
      padding-bottom: 0;
    }
    .panel.collapsed > :not(.panel-chrome):not(.resize-grip-v) { display: none !important; }
    .panel.focused .resize-grip { display: none; }
    .panel.focused .resize-grip-v { display: none; }
    .panel.focused .panel-chrome { cursor: default; }

    .panel-title {
      display: flex; align-items: center; gap: var(--s-3);
      font-family: var(--font-ui); font-size: var(--text-xs); font-weight: 500;
      letter-spacing: 0.15em; text-transform: uppercase;
      color: var(--violet);
      margin-bottom: var(--s-4);
    }
    .panel-title::before { content: '\2726'; font-size: 9px; color: var(--mauve); }
    .panel-title::after  { content: ''; flex: 1; height: 0.5px; background: var(--hairline); }

    /* ── user panel ───────────────────────────────────────────────── */
    .user-panel {
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      gap: var(--s-3); text-align: center;
    }
    .user-avatar {
      width: 92px; height: 92px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
      border: 1.5px solid var(--avatar-ring);
      box-shadow: 0 0 0 5px var(--avatar-halo), var(--shadow-avatar);
      transition: box-shadow var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-spring);
    }
    .user-panel:hover .user-avatar {
      box-shadow: 0 0 0 7px var(--avatar-halo-hover), var(--shadow-avatar-hover);
      transform: scale(1.03);
    }
    .user-avatar img { width: 100%; height: 100%; object-fit: cover; }
    .user-info { display: flex; flex-direction: column; align-items: center; gap: var(--s-1); }
    .user-name  { font-size: var(--text-lg); font-weight: 700; color: var(--ink); text-transform: lowercase; letter-spacing: 0.02em; }
    .user-email { font-size: var(--text-xs); color: var(--ink-soft); }
    .user-badge {
      background: var(--lavender); color: var(--violet);
      font-size: var(--text-2xs); padding: 3px 11px; border-radius: 20px;
      letter-spacing: 0.1em; text-transform: lowercase;
      width: fit-content; margin-top: var(--s-1);
      border: 0.5px solid var(--hairline-strong);
    }
    .user-gear {
      font-size: 16px; color: var(--violet); background: none; border: none; cursor: pointer;
      padding: 6px; line-height: 1;
      position: absolute; top: 38px; right: 12px; border-radius: 50%; z-index: 2;
      transition: color var(--dur-fast) ease, background var(--dur-fast) ease, transform var(--dur-slow) var(--ease-spring);
    }
    .user-gear:hover { color: var(--violet-deep); background: var(--soft-fill-strong); transform: rotate(40deg); }
    .user-gear:active { transform: rotate(40deg) scale(0.9); }

    /* ── messages panel ───────────────────────────────────────────── */
    .msg-item {
      display: flex; align-items: flex-start; gap: var(--s-3);
      padding: var(--s-2) var(--s-2);
      border-bottom: 0.5px solid var(--hairline);
      cursor: pointer; border-radius: var(--radius-sm);
      transition: background var(--dur-fast) ease, padding-left var(--dur-fast) var(--ease-out);
    }
    .msg-item:last-child { border-bottom: none; }
    .msg-item:hover { background: var(--soft-fill); padding-left: var(--s-3); }
    .msg-av { width: 28px; height: 28px; border-radius: 50%; overflow: hidden; flex-shrink: 0; border: 0.5px solid var(--hairline); }
    .msg-av img { width: 100%; height: 100%; object-fit: cover; }
    .msg-from { font-size: var(--text-sm); font-weight: 700; color: var(--ink); text-transform: lowercase; }
    .msg-pre  { font-size: var(--text-xs); color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 500px; }
    .msg-time { font-size: var(--text-2xs); color: var(--ink-faint); margin-bottom: var(--s-1); text-align: right; flex-shrink: 0; }
    .msg-dot  { width: 7px; height: 7px; border-radius: 50%; background: var(--mauve); margin-left: auto; box-shadow: 0 0 6px var(--msg-glow); }
    .empty-note {
      font-size: var(--text-sm); color: var(--ink-faint); text-align: center;
      padding: var(--s-5) 0; letter-spacing: 0.08em; text-transform: lowercase;
    }

    /* ── calendar panel ───────────────────────────────────────────── */
    .cal-panel { display: flex; flex-direction: column; }
    .cal-nav { display: flex; align-items: center; justify-content: space-between; gap: var(--s-1); margin-bottom: var(--s-4); }
    .cal-nav .panel-title { margin-bottom: 0; flex: 1; }
    .cal-nav-btn {
      background: var(--lavender); border: 0.5px solid var(--hairline-strong); color: var(--violet);
      font-size: 14px; padding: 4px 10px; border-radius: var(--radius-sm);
      cursor: pointer; line-height: 1;
      transition: background var(--dur-fast) ease, transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-fast) ease;
    }
    .cal-nav-btn:hover:not(:disabled) { background: var(--chip-hover); box-shadow: var(--shadow-navbtn); }
    .cal-nav-btn:active:not(:disabled) { transform: scale(0.92); }
    .cal-nav-btn:disabled { opacity: 0.35; cursor: default; }
    .cal-list { flex: 1; overflow-y: auto; }
    .cal-empty { font-size: var(--text-sm); color: var(--ink-faint); text-align: center; padding: var(--s-4) 0; letter-spacing: 0.06em; text-transform: lowercase; }
    .cal-item {
      display: flex; align-items: flex-start; gap: var(--s-3);
      padding: var(--s-3) var(--s-4);
      background: var(--panel-tint);
      border-radius: var(--radius-md);
      border: 0.5px solid var(--hairline);
      margin-bottom: var(--s-2);
      transition: transform var(--dur-med) var(--ease-spring), box-shadow var(--dur-med) ease, border-color var(--dur-med) ease;
    }
    .cal-item:hover { transform: translateX(3px); border-color: var(--hairline-strong); box-shadow: var(--shadow-item); }
    .cal-dd   { font-size: 19px; font-weight: 700; color: var(--violet); line-height: 1; }
    .cal-day  { font-size: var(--text-2xs); color: var(--ink-faint); letter-spacing: 0.08em; text-transform: lowercase; }
    .cal-name { font-size: var(--text-sm); font-weight: 700; color: var(--ink); margin-bottom: 2px; text-transform: lowercase; }
    .cal-time { font-size: var(--text-xs); color: var(--ink-soft); letter-spacing: 0.04em; }
    .cal-tag  {
      font-size: var(--text-2xs); padding: 2px 9px; border-radius: 10px;
      background: var(--lavender); color: var(--violet);
      letter-spacing: 0.06em; text-transform: lowercase;
      align-self: center; flex-shrink: 0;
      border: 0.5px solid var(--hairline-strong);
    }
    .cal-sub { font-weight: 400; color: var(--ink-soft); }
    .ws-m-date  { font-size: var(--text-sm); color: var(--ink-soft); letter-spacing: 0.04em; text-transform: lowercase; margin-bottom: var(--s-2); }
    .ws-m-price { font-size: var(--text-lg); font-weight: 700; color: var(--violet); margin-bottom: var(--s-3); }
    .ws-m-desc  { font-size: var(--text-md); color: var(--ink); line-height: 1.8; margin-bottom: var(--s-4); }
    .ws-m-desc p { margin-bottom: var(--s-2); }
    .ws-m-nourl { font-size: var(--text-xs); color: var(--ink-faint); font-style: italic; }
    .cal-item-x { cursor: default; }
    .cal-item-x:hover { transform: none; }
    .cal-name-x { font-size: var(--text-lg); margin-bottom: var(--s-2); }
    .cal-item-x .cal-time { margin-bottom: var(--s-2); }
    .cal-others-label { font-size: var(--text-2xs); color: var(--ink-faint); letter-spacing: 0.12em; text-transform: lowercase; margin: var(--s-4) 0 var(--s-2); }
    .msg-list { display: flex; flex-direction: column; gap: var(--s-2); overflow-y: auto; }
    .msg-item { border: 0.5px solid var(--hairline-strong); border-radius: 10px; padding: var(--s-3); }
    .msg-date { font-size: var(--text-2xs); color: var(--ink-faint); letter-spacing: 0.06em; }
    .msg-title { font-size: var(--text-sm); font-weight: 700; color: var(--ink); text-transform: lowercase; margin: 2px 0; }
    .msg-body { font-size: var(--text-xs); color: var(--ink-soft); line-height: 1.6; }
    .msg-body p { margin: 0 0 var(--s-1); }

    /* ── quote panel ──────────────────────────────────────────────── */
    .quote-panel { display: flex; flex-direction: column; justify-content: center; }
    .quote-panel blockquote { font-size: var(--text-md); line-height: 1.9; color: var(--ink); font-style: italic; }
    .quote-panel blockquote::before { content: '\201C'; display: block; font-size: 30px; line-height: 0.6; color: var(--violet-light); font-style: normal; margin-bottom: var(--s-3); }
    .quote-panel footer { margin-top: var(--s-3); font-size: var(--text-xs); color: var(--mauve); letter-spacing: 0.1em; text-transform: lowercase; font-style: normal; }
    .quote-panel footer cite { font-style: normal; }

    /* ── notebook + archive ───────────────────────────────────────── */
    .notebook-panel, .archive-panel { display: flex; flex-direction: column; }
    .notes-area {
      flex: 1; width: 100%; resize: none;
      background: var(--field-bg);
      border: 1px solid var(--hairline-strong);
      border-radius: var(--radius-md);
      padding: var(--s-4);
      font-family: var(--font-mono); font-size: var(--text-md); color: var(--ink); line-height: 1.7;
      outline: none; min-height: 170px;
      transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease, background var(--dur-fast) ease;
    }
    .notes-area:focus {
      border-color: var(--violet);
      background: var(--field-bg-focus);
      box-shadow: 0 0 0 3px var(--ring);
    }
    .notes-area::placeholder { color: var(--ink-faint); }
    .notes-actions { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-3); }
    .btn-row { display: flex; gap: var(--s-2); }
    .btn-row .ws-btn { flex: 1; }

    .ws-btn {
      display: block; width: 100%;
      padding: 10px 14px; border-radius: var(--radius-sm);
      font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 700;
      letter-spacing: 0.12em; text-transform: lowercase; text-align: center;
      cursor: pointer; text-decoration: none;
      transition: background var(--dur-fast) ease, transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-fast) ease;
    }
    .ws-btn:active { transform: scale(0.98); }
    .ws-btn-ghost { background: var(--chip); border: 1px solid var(--hairline-strong); color: var(--violet); }
    .ws-btn-ghost:hover { background: var(--chip-hover); box-shadow: var(--shadow-soft); }
    .ws-btn-solid { background: var(--violet); border: 1px solid var(--violet-deep); color: var(--paper); }
    .ws-btn-solid:hover { background: var(--violet-deep); box-shadow: var(--shadow-btn); }
    [data-theme="dark"] .ws-btn-solid { color: var(--paper); }
    .ws-btn-see { background: var(--lavender); border: 1px solid var(--hairline-strong); color: var(--violet); }
    .ws-btn-see:hover { background: var(--chip-hover); }

    .upload-zone {
      border: 1px dashed var(--mauve); border-radius: var(--radius-md);
      padding: var(--s-4) var(--s-3); text-align: center; cursor: pointer;
      transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease, transform var(--dur-med) var(--ease-spring);
    }
    .upload-zone:hover { background: var(--soft-fill); border-color: var(--violet); transform: translateY(-1px); }
    .upload-icon  { font-size: 20px; color: var(--violet); margin-bottom: var(--s-1); transition: transform var(--dur-med) var(--ease-spring); }
    .upload-zone:hover .upload-icon { transform: translateY(-2px); }
    .upload-label { font-size: var(--text-xs); color: var(--violet); letter-spacing: 0.06em; text-transform: lowercase; font-weight: 700; }
    .upload-types { font-size: var(--text-2xs); color: var(--ink-faint); margin-top: 2px; }
    .files-list   { flex: 1; margin-top: var(--s-3); display: flex; flex-direction: column; gap: var(--s-2); }
    .file-item    {
      display: flex; align-items: center; gap: var(--s-2);
      padding: 8px 12px; background: var(--chip); border-radius: var(--radius-sm);
      border: 0.5px solid var(--hairline);
      transition: border-color var(--dur-fast) ease, transform var(--dur-med) var(--ease-spring);
    }
    .file-item:hover { border-color: var(--hairline-strong); transform: translateX(2px); }
    .file-icon    { font-size: 13px; color: var(--violet); flex-shrink: 0; }
    .file-name    { font-size: var(--text-xs); color: var(--ink); flex: 1; text-transform: lowercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .file-size    { font-size: var(--text-2xs); color: var(--ink-faint); flex-shrink: 0; }
    .file-dl      { font-size: 14px; color: var(--violet); background: none; border: none; cursor: pointer; padding: 0; flex-shrink: 0; transition: color var(--dur-fast) ease, transform var(--dur-fast) var(--ease-spring); }
    .file-dl:hover { color: var(--violet-deep); transform: translateY(1px); }

    /* ── library ──────────────────────────────────────────────────── */
    .library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(110px, 11vw, 160px), 1fr)); gap: var(--s-4); min-width: 0; }
    .library-grid > * { min-width: 0; }
    .library-item { display: flex; flex-direction: column; gap: var(--s-2); text-decoration: none; border-radius: var(--radius-sm); }
    .library-cover {
      width: 100%; aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden;
      background: var(--chip); border: 0.5px solid var(--hairline);
      display: flex; align-items: center; justify-content: center;
      transition: background var(--dur-med) ease, box-shadow var(--dur-med) ease, transform var(--dur-med) var(--ease-spring);
    }
    .library-item:hover .library-cover {
      background: var(--chip-hover);
      box-shadow: var(--shadow-cover);
      transform: translateY(-3px) scale(1.02);
    }
    .library-item:active .library-cover { transform: translateY(-1px) scale(1.0); }
    .library-cover img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.45s ease; }
    .library-cover img.loaded { opacity: 1; }
    .library-cover .library-icon { font-size: 28px; color: var(--violet); }
    .library-meta { font-size: var(--text-2xs); line-height: 1.5; margin-top: var(--s-1); }
    .library-author { font-weight: 700; color: var(--ink); text-transform: lowercase; }
    .library-title  { color: var(--mauve); text-transform: lowercase; }
    .lib-nav-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-4); flex-wrap: wrap; gap: var(--s-2); }
    .lib-nav-bar .panel-title { margin-bottom: 0; }
    .lib-info { font-size: var(--text-xs); color: var(--ink-faint); letter-spacing: 0.1em; text-transform: lowercase; margin-left: var(--s-3); }
    .lib-nav-btns { display: flex; gap: var(--s-2); }
    .lib-head-left { display: flex; align-items: baseline; flex: 1; min-width: 0; }
    .lib-head-left .panel-title { flex: 0 0 auto; }
    .lib-head-left .panel-title::after { display: none; }

    /* ════════════════════════════════════════════════════════════════
       MODALS
       ════════════════════════════════════════════════════════════════ */
    .modal-overlay {
      position: fixed; inset: 0; background: var(--overlay);
      -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
      z-index: 300; display: none; align-items: center; justify-content: center;
    }
    .modal-overlay.open { display: flex; animation: overlayIn var(--dur-med) ease both; }
    @keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
    .modal-box {
      background: var(--modal-bg);
      border: 0.5px solid var(--hairline-strong);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-modal);
      padding: var(--s-6);
      width: 360px; max-width: calc(100vw - 2rem);
      position: relative;
      animation: fadeUp 0.32s var(--ease-spring) both;
      transition: background 400ms ease, color 400ms ease;
    }
    @keyframes fadeUp { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
    .modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-5); }
    .modal-title  { font-size: var(--text-md); font-weight: 700; color: var(--ink); letter-spacing: 0.06em; text-transform: lowercase; }
    .modal-header-actions { display: flex; align-items: center; gap: var(--s-3); }
    .modal-logout {
      font-size: var(--text-xs); font-family: var(--font-mono); letter-spacing: 0.1em; font-weight: 700; text-transform: lowercase;
      background: var(--danger-bg); border: 1px solid var(--danger-bd); color: var(--danger);
      padding: 5px 10px; border-radius: var(--radius-sm); cursor: pointer; text-decoration: none;
      transition: background var(--dur-fast) ease, transform var(--dur-fast) var(--ease-spring);
    }
    .modal-logout:hover { background: var(--error-bg); }
    .modal-logout:active { transform: scale(0.97); }
    .modal-close  {
      font-size: 18px; color: var(--violet); background: none; border: none; cursor: pointer;
      padding: 4px; line-height: 1; border-radius: 50%;
      transition: color var(--dur-fast) ease, background var(--dur-fast) ease, transform var(--dur-med) var(--ease-spring);
    }
    .modal-close:hover { color: var(--violet-deep); background: var(--soft-fill-strong); transform: rotate(90deg); }
    .modal-tabs { display: flex; gap: 1.1rem; border-bottom: 0.5px solid var(--hairline); margin-bottom: var(--s-5); padding-bottom: var(--s-3); }
    .mtab {
      background: none; border: none; font-family: var(--font-mono);
      font-size: var(--text-xs); letter-spacing: 0.2em; text-transform: lowercase;
      color: var(--ink-faint); cursor: pointer; padding: 0; position: relative;
      transition: color var(--dur-fast) ease;
    }
    .mtab:hover { color: var(--mauve); }
    .mtab.active { color: var(--violet); }
    .mtab.active::after { content: ''; position: absolute; bottom: calc(-1 * var(--s-3)); left: 0; right: 0; height: 1.5px; background: var(--mauve); border-radius: 1px; }
    .mpanel { display: none; }
    .mpanel.active { display: block; animation: panelIn var(--dur-med) var(--ease-out) both; }
    @keyframes panelIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
    .mfield { margin-bottom: var(--s-3); }
    .mfield label { display: block; font-size: var(--text-2xs); letter-spacing: 0.25em; text-transform: lowercase; color: var(--mauve); margin-bottom: 5px; }
    .mfield input[type="email"], .mfield input[type="password"], .mfield input[type="text"] {
      width: 100%; background: var(--field-bg);
      border: 1px solid var(--hairline-strong); border-radius: var(--radius-sm);
      padding: 9px 11px;
      font-family: var(--font-mono); font-size: var(--text-sm); color: var(--ink);
      outline: none;
      transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
    }
    .mfield input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px var(--ring); }
    .mfield input[readonly] { color: var(--ink-faint); cursor: default; }
    .hint { font-size: var(--text-2xs); color: var(--ink-faint); margin-top: 3px; letter-spacing: 0.06em; }
    .msubmit {
      display: block; width: 100%; padding: 10px;
      background: var(--violet); border: 1px solid var(--violet-deep); border-radius: var(--radius-sm);
      font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 700;
      letter-spacing: 0.15em; text-transform: lowercase; color: var(--paper); cursor: pointer;
      margin-top: var(--s-1);
      transition: background var(--dur-fast) ease, transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-fast) ease;
    }
    .msubmit:hover { background: var(--violet-deep); box-shadow: var(--shadow-btn); }
    .msubmit:active { transform: scale(0.98); }
    .pwd-bar-wrap { height: 3px; background: var(--hairline); border-radius: 2px; margin-top: 5px; overflow: hidden; }
    .pwd-bar      { height: 100%; width: 0; transition: width 0.35s var(--ease-out), background 0.35s ease; border-radius: 2px; }
    .avatar-preview { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; margin: 0 auto var(--s-3); border: 1.5px solid var(--avatar-ring); cursor: pointer; position: relative; }
    .avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
    .avatar-overlay { position: absolute; inset: 0; background: var(--avatar-veil); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity var(--dur-fast) ease; border-radius: 50%; font-size: 18px; color: var(--paper); }
    .avatar-preview:hover .avatar-overlay { opacity: 1; }
    .avatar-hint { font-size: var(--text-2xs); color: var(--mauve); text-align: center; margin-bottom: var(--s-4); letter-spacing: 0.06em; }
    .draft-item  { display: flex; align-items: center; gap: var(--s-2); padding: 9px 11px; background: var(--chip); border-radius: var(--radius-sm); border: 0.5px solid var(--hairline); margin-bottom: var(--s-2); transition: border-color var(--dur-fast) ease; }
    .draft-item:hover { border-color: var(--hairline-strong); }
    .draft-label { flex: 1; font-size: var(--text-xs); color: var(--ink); text-transform: lowercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .draft-date  { font-size: var(--text-2xs); color: var(--ink-faint); flex-shrink: 0; }
    .draft-load  { background: var(--lavender); border: 1px solid var(--hairline-strong); color: var(--violet); border-radius: 4px; padding: 3px 9px; font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: lowercase; cursor: pointer; transition: background var(--dur-fast) ease; }
    .draft-load:hover { background: var(--chip-hover); }
    .draft-del   { font-size: 15px; color: var(--danger-soft); background: none; border: none; cursor: pointer; padding: 0; flex-shrink: 0; transition: color var(--dur-fast) ease; }
    .draft-del:hover { color: var(--danger-deep); }
    .draft-empty { font-size: var(--text-sm); color: var(--ink-faint); text-align: center; padding: var(--s-4) 0; letter-spacing: 0.08em; text-transform: lowercase; }
    .ws-error   { font-size: var(--text-xs); letter-spacing: 0.08em; padding: 7px 11px; border-radius: 6px; margin-bottom: var(--s-3); color: var(--error-ink); background: var(--error-bg); border: 1px solid var(--error-bd); text-transform: lowercase; }
    .ws-success { font-size: var(--text-xs); letter-spacing: 0.08em; padding: 7px 11px; border-radius: 6px; margin-bottom: var(--s-3); color: var(--ok-ink); background: var(--ok-bg); border: 1px solid var(--ok-bd); text-transform: lowercase; }
    .toast {
      position: fixed; bottom: 28px; left: 50%;
      transform: translateX(-50%) translateY(12px);
      background: var(--toast-bg); color: var(--toast-ink);
      font-family: var(--font-mono); font-size: var(--text-xs);
      letter-spacing: 0.12em; text-transform: lowercase;
      padding: 9px 20px; border-radius: 22px;
      box-shadow: var(--shadow-toast);
      opacity: 0; pointer-events: none; z-index: 400; white-space: nowrap;
      transition: opacity var(--dur-med) ease, transform var(--dur-med) var(--ease-spring);
    }
    .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

    /* ════════════════════════════════════════════════════════════════
       MOBILE — hamburger + off-canvas
       ════════════════════════════════════════════════════════════════ */
    #hamburger {
      position: fixed; top: 16px; right: 16px; left: auto; z-index: 300;
      width: 44px; height: 44px;
      display: none; flex-direction: column; align-items: center; justify-content: center;
      gap: 5px;
      background: var(--nav-bg);
      -webkit-backdrop-filter: blur(24px) saturate(1.8);
      backdrop-filter: blur(24px) saturate(1.8);
      border: 0.5px solid var(--panel-border);
      border-radius: var(--radius-md);
      box-shadow: var(--shadow-soft);
      cursor: pointer;
    }
    #hamburger span {
      display: block; width: 22px; height: 2px;
      background: var(--bar-color); border-radius: 1px;
      transition: transform 240ms var(--ease-out), opacity 240ms var(--ease-out);
    }
    [data-theme="light"] #hamburger span { background: var(--violet); }
    #hamburger.open span:nth-child(1) { opacity: 0; }
    #hamburger.open span:nth-child(2) { transform: translateY(3.5px) rotate(45deg); }
    #hamburger.open span:nth-child(3) { transform: translateY(-3.5px) rotate(-45deg); }
    #hamburger.open span:nth-child(4) { opacity: 0; }

    #oc-backdrop {
      position: fixed; inset: 0; z-index: 125;
      background: var(--oc-overlay);
      -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
      opacity: 0; pointer-events: none;
      transition: opacity 340ms var(--ease-spring);
    }
    #oc-backdrop.open { opacity: 1; pointer-events: auto; }

    #offcanvas {
      position: fixed; top: 0; left: 0; z-index: 130;
      width: 260px; height: 100vh; height: 100dvh;
      display: flex; flex-direction: column;
      padding: var(--s-5) var(--s-4);
      background: var(--nav-bg);
      -webkit-backdrop-filter: blur(24px) saturate(1.8);
      backdrop-filter: blur(24px) saturate(1.8);
      border-right: 0.5px solid var(--panel-border);
      box-shadow: var(--shadow-panel);
      transform: translateX(-100%);
      transition: transform 340ms var(--ease-spring);
      overflow-y: auto;
    }
    #offcanvas.open { transform: translateX(0); }
    .oc-logo { width: 120px; margin: var(--s-7) 0 var(--s-6); }
    .oc-logo img { max-width: 100%; height: auto; object-fit: contain; }
    .oc-nav { display: flex; flex-direction: column; gap: var(--s-1); }
    .oc-item {
      display: flex; align-items: center; gap: var(--s-3);
      padding: 10px 12px;
      background: none; border: none; cursor: pointer; text-align: left;
      border-radius: var(--radius-md);
      color: var(--ink);
      transition: background var(--dur-fast) var(--ease-out);
    }
    .oc-item:hover { background: var(--soft-fill-strong); }
    .oc-item.active { background: var(--pill); }
    .oc-item.is-hidden { opacity: 0.45; }
    .oc-ico { font-size: 22px; line-height: 1; color: var(--violet); width: 26px; text-align: center; flex-shrink: 0; }
    .oc-label { font-family: var(--font-ui); font-weight: 500; font-size: var(--text-sm); letter-spacing: 0.08em; text-transform: lowercase; }
    .oc-spacer { flex: 1; }
    .oc-theme { margin-top: var(--s-4); display: flex; align-items: center; gap: var(--s-3); width: 100%; }

    /* ════════════════════════════════════════════════════════════════
       RESPONSIVE + MOTION PREFERENCES
       ════════════════════════════════════════════════════════════════ */
    @media (max-width: 900px) {
      #panel-grid { grid-template-columns: repeat(4, 1fr); }
      #panel-grid > .panel { grid-column: span 4; }
      #panel-grid > .panel.cspan-1,
      #panel-grid > .panel.cspan-2 { grid-column: span 2; }
      #panel-grid > .panel.focused { grid-column: 1 / -1 !important; }
    }
    @media (max-width: 768px) {
      #side-rail { display: none; }
      #hamburger { display: flex; }
      #stage { padding-top: 68px; }
    }
    @media (min-width: 769px) {
      #hamburger, #offcanvas, #oc-backdrop { display: none; }
    }
    @media (max-width: 700px) {
      #panel-grid { grid-template-columns: 1fr; gap: var(--s-4); }
      #panel-grid > .panel,
      #panel-grid > .panel.cspan-1,
      #panel-grid > .panel.cspan-2 { grid-column: auto; }
      #panel-grid > .panel.focused { grid-column: auto !important; }
      .panel { padding: 42px var(--s-5) var(--s-5); }
      .resize-grip { display: none; }
      .resize-grip-v { display: none; }
    }
    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
      .cal-item:hover, .library-item:hover .library-cover { transform: none; }
      #starfield { animation: none; }
    }
  