    * { box-sizing: border-box; }
    body { margin: 0; overflow: hidden; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }

    /* ── Drag ── */
    .widget-dragging {
      opacity: 0.92;
      box-shadow: 0 24px 48px rgba(0,0,0,0.22), 0 6px 16px rgba(0,0,0,0.10);
      border-color: #111 !important;
    }
    .slot-highlight {
      outline: 2px dashed #666;
      outline-offset: -2px;
      border-radius: 12px;
      background: rgba(0,0,0,0.04) !important;
    }
    .slot-source > * { opacity: 0.25; }
    .drag-active-dim {
      opacity: 0.6; transform: scale(0.988);
      transition: opacity 0.18s ease, transform 0.18s ease;
    }
    .widget-snap { animation: snap-in 0.3s cubic-bezier(0.34,1.56,0.64,1); }
    @keyframes snap-in {
      from { transform: scale(0.93); opacity: 0.4; }
      to   { transform: scale(1);    opacity: 1;   }
    }

    /* ── Restore sidebar ── */
    .restore-btn {
      width: 100%; padding: 8px 6px;
      background: var(--t-card); border: 2px solid var(--t-accent);
      border-radius: 8px; cursor: pointer;
      font-size: 11px; font-family: inherit;
      font-weight: 600; text-align: center; line-height: 1.3;
      color: var(--t-text);
      transition: background 0.12s;
    }
    .restore-btn:hover { background: var(--t-sidebar); }
    .restore-sidebar {
      overflow: hidden;
      transition: width 0.26s cubic-bezier(0.4,0,0.2,1), padding 0.26s cubic-bezier(0.4,0,0.2,1);
      border-right: 1px solid var(--t-restore-border); background: var(--t-restore-bg);
      display: flex; flex-direction: column; align-items: center; gap: 10px;
    }
    .restore-sidebar.open   { width: 88px; padding: 14px 8px; }
    .restore-sidebar.closed { width: 0; padding: 0; border-right-color: transparent; }

    /* ── Theme CSS Variables ── */
    :root {
      --t-bg: #fafafa;
      --t-sidebar: #f2f2f2;
      --t-sidebar-border: #333;
      --t-card: #fff;
      --t-card-border: #e5e5e5;
      --t-text: #111;
      --t-text-muted: #666;
      --t-restore-bg: #f7f7f7;
      --t-restore-border: #ccc;
      --t-header: #f2f2f2;
      --t-accent: #111;
    }

    /* Themes panel */
    .themes-panel-overlay {
      position: fixed; inset: 0; z-index: 900;
      background: rgba(0,0,0,0.3);
      backdrop-filter: blur(3px);
      display: flex; align-items: flex-start; justify-content: flex-start;
      padding: 12px 0 0 8px;
      animation: themesFadeIn 0.18s ease;
    }
    @keyframes themesFadeIn {
      from { opacity: 0; }
      to   { opacity: 1; }
    }
    .themes-panel {
      background: var(--t-card);
      border: 1.5px solid var(--t-card-border);
      border-radius: 18px;
      padding: 20px 18px 18px;
      width: 280px;
      box-shadow: 0 20px 60px rgba(0,0,0,0.22), 0 4px 16px rgba(0,0,0,0.10);
      animation: themesPanelIn 0.22s cubic-bezier(0.34,1.56,0.64,1);
    }
    @keyframes themesPanelIn {
      from { opacity: 0; transform: scale(0.88) translateY(-8px); }
      to   { opacity: 1; transform: scale(1) translateY(0); }
    }
    .themes-btn-icon {
      width: 54px; height: 54px;
      border-radius: 14px;
      background: var(--t-sidebar);
      border: 2px solid var(--t-sidebar-border);
      cursor: pointer;
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      gap: 3px;
      transition: transform 0.16s cubic-bezier(0.34,1.56,0.64,1), background 0.15s;
      flex-shrink: 0;
    }
    .themes-btn-icon:hover { transform: scale(1.1); }
    .themes-btn-icon:active { transform: scale(0.93); }
    .themes-btn-label {
      font-size: 10px; font-weight: 700;
      color: var(--t-text-muted);
      letter-spacing: 0.04em; text-transform: uppercase;
      margin-top: 4px;
    }

    /* ══════════════════════════════════════════
       APPS PANEL  —  transform-only so the GPU
       can composite it without layout thrashing
    ══════════════════════════════════════════ */
    .apps-panel {
      position: fixed; top: 0; right: 0; bottom: 0;
      left: 96px;
      background: var(--t-card);
      z-index: 500;
      overflow: hidden;
      pointer-events: none;
      will-change: transform, opacity, border-radius;
      /* transform-origin & --scale-from set by JS */
    }

    /* Phase classes */
    .apps-panel.is-entering {
      pointer-events: all;
      animation: appsOpen 0.48s cubic-bezier(0.32,0.72,0,1) forwards;
    }
    .apps-panel.is-open {
      transform: scale(1); opacity: 1; border-radius: 0;
      pointer-events: all;
    }
    .apps-panel.is-exiting {
      animation: appsClose 0.34s cubic-bezier(0.4,0,1,1) forwards;
    }

    @keyframes appsOpen {
      from { transform: var(--scale-from); opacity: 0.5; border-radius: 14px; }
      to   { transform: scale(1);          opacity: 1;   border-radius: 0px;  }
    }
    @keyframes appsClose {
      from { transform: scale(1);          opacity: 1;   border-radius: 0px;  }
      to   { transform: var(--scale-from); opacity: 0;   border-radius: 14px; }
    }

    /* Scrollable body inside the panel */
    .apps-inner {
      width: 100%; height: 100%;
      overflow-y: auto; overflow-x: hidden;
      padding: 28px 36px 52px;
      opacity: 0; transform: translateY(10px);
      transition: none;
    }
    /* Fade content in after panel expansion */
    .apps-panel.is-open .apps-inner {
      opacity: 1; transform: translateY(0);
      transition: opacity 0.24s ease 0.06s, transform 0.3s cubic-bezier(0.22,1,0.36,1) 0.06s;
    }
    .apps-panel.is-entering .apps-inner {
      /* content is invisible during expansion; show it near the end */
      animation: contentIn 0.22s cubic-bezier(0.22,1,0.36,1) 0.36s forwards;
    }
    @keyframes contentIn {
      from { opacity: 0; transform: translateY(10px); }
      to   { opacity: 1; transform: translateY(0);    }
    }

    /* Sticky header */
    .apps-header {
      display: flex; align-items: center; gap: 20px;
      margin-bottom: 30px;
      position: sticky; top: 0; background: var(--t-card);
      padding-bottom: 18px; z-index: 10;
      border-bottom: 1.5px solid var(--t-card-border);
    }
    .apps-logo {
      font-size: 26px; font-weight: 900;
      border: 3px solid #111; border-radius: 14px;
      padding: 4px 16px; line-height: 1.25;
      white-space: nowrap; flex-shrink: 0;
    }
    .apps-search {
      flex: 1; padding: 10px 20px;
      border: 1.5px solid #ddd; border-radius: 50px;
      font-size: 15px; font-family: inherit; outline: none;
      background: #f6f6f6;
      transition: border-color 0.15s, background 0.15s;
    }
    .apps-search:focus { border-color: #555; background: #fff; }
    .apps-close-btn {
      width: 36px; height: 36px; border-radius: 50%;
      border: 1.5px solid #ccc; background: #f3f3f3;
      cursor: pointer; font-size: 16px; color: #333;
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0;
      transition: background 0.14s, transform 0.14s;
    }
    .apps-close-btn:hover { background: #e6e6e6; transform: scale(1.1); }
    .apps-close-btn:active { transform: scale(0.92); }

    /* Category rows */
    .apps-section-title {
      font-size: 20px; font-weight: 800;
      margin: 0 0 14px 2px; letter-spacing: -0.3px;
    }
    .apps-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, 84px);
      gap: 18px; margin-bottom: 36px;
    }
    .app-tile-wrap {
      display: flex; flex-direction: column; align-items: center; gap: 6px;
    }
    .app-icon {
      width: 84px; height: 84px;
      background: #1a1a1a; border-radius: 20px; cursor: pointer;
      transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.18s ease;
      will-change: transform;
    }
    .app-icon:hover  { transform: scale(1.1) translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,0.18); }
    .app-icon:active { transform: scale(0.95); }
    .app-icon-label  { font-size: 11px; color: #666; text-align: center; width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    /* Staggered icon entrance — triggered when inner content is visible */
    .apps-panel.is-open .app-tile-wrap,
    .apps-panel.is-entering .app-tile-wrap {
      animation: iconIn 0.34s cubic-bezier(0.34,1.56,0.64,1) both;
    }
    @keyframes iconIn {
      from { opacity: 0; transform: scale(0.68) translateY(8px); }
      to   { opacity: 1; transform: scale(1)    translateY(0);   }
    }

/* ── Additional Animations ── */
  @keyframes tooltipIn {
    from { opacity: 0; transform: translateX(-50%) translateY(4px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0);   }
  }
  @keyframes menuIn {
    from { opacity: 0; transform: scale(0.88) translateY(-6px); }
    to   { opacity: 1; transform: scale(1)    translateY(0);    }
  }
  @keyframes starPop {
    0%   { opacity: 0; transform: scale(0.4); }
    40%  { opacity: 1; transform: scale(1.3); }
    70%  { opacity: 1; transform: scale(0.95); }
    100% { opacity: 0; transform: scale(1.1); }
  }
  /* Tutorials overlay animations */
  @keyframes tutFadeSlideIn {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes tutSearchIn {
    from { opacity: 0; transform: translateY(10px) scaleX(0.92); }
    to   { opacity: 1; transform: translateY(0)    scaleX(1);    }
  }
  @keyframes tutDropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes tutPageExit {
    from { opacity: 1; transform: scale(1)     translateY(0);    }
    to   { opacity: 0; transform: scale(0.96)  translateY(-12px); }
  }
  @keyframes tutPageEnter {
    from { opacity: 0; transform: scale(1.03) translateY(20px); }
    to   { opacity: 1; transform: scale(1)    translateY(0);    }
  }
  @keyframes tutPageBack {
    from { opacity: 0; transform: scale(0.97) translateY(10px); }
    to   { opacity: 1; transform: scale(1)    translateY(0);    }
  }
