    *, *::before, *::after { box-sizing: border-box; }
    html, body {
      margin: 0;
      min-height: 100%;
      background: var(--bg);
      color: var(--text);
      font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
      font-size: 13px;
    }


    .folder-bar {
      position: sticky;
      top: 0;
      z-index: 10;
      background: var(--surf);
      border-bottom: 1px solid var(--border);
      overflow-x: auto;
      scrollbar-width: none;
    }
    .folder-bar::-webkit-scrollbar { display: none; }
    .folder-tabs {
      padding: 0 12px;
      display: flex;
      align-items: center;
    }
    .ftab {
      border: none;
      border-bottom: 2px solid transparent;
      background: transparent;
      color: var(--muted);
      font-size: 12px;
      font-weight: 600;
      font-family: inherit;
      padding: 9px 10px 7px;
      cursor: pointer;
      white-space: nowrap;
      display: inline-flex;
      align-items: center;
      gap: 5px;
    }
    .ftab:hover { color: var(--text); }
    .ftab.active { color: var(--blue); border-bottom-color: var(--blue); }
    .ftab-del {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 14px;
      height: 14px;
      border-radius: 2px;
      font-size: 11px;
      opacity: 0;
      transition: opacity .1s, background .1s, color .1s;
    }
    .ftab:hover .ftab-del, .ftab.active .ftab-del { opacity: 1; }
    .ftab-del:hover { background: rgba(244,71,71,.2); color: var(--red); }
    .ftab-add { color: var(--blue-l); margin-left: 4px; padding-left: 10px; border-left: 1px solid var(--border); }
    .folder-tabs .folder-bulk-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding-left: 10px; }
    .page-topbar .folder-bulk-host { display: inline-flex; align-items: center; }
    .page-topbar .folder-bulk-actions { margin-left: 0; display: inline-flex; align-items: center; gap: 6px; padding-left: 0; }
    .folder-bulk-btn { border: 1px solid var(--border); border-bottom-width: 1px; border-radius: 6px; padding: 6px 10px; }
    .folder-bulk-btn:disabled { opacity: .45; cursor: default; pointer-events: none; }
    .folder-bulk-danger { border-color: rgba(244,71,71,.45); color: var(--red); }

    main { padding: 16px 16px 40px; }

    /* .page-topbar, .page-h1, .count-card → nav.css */

    .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
    .search-wrap { flex: 1; min-width: 180px; position: relative; }
    .search-wrap svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); }
    #slide-search {
      width: 100%;
      background: var(--surf);
      border: 1px solid var(--border);
      border-radius: 6px;
      color: var(--text);
      font-size: 12px;
      font-family: inherit;
      padding: 7px 10px 7px 30px;
      outline: none;
      transition: border-color .15s;
    }
    #slide-search:focus { border-color: var(--blue); }
    #slide-search::placeholder { color: var(--muted); }
    .btn-create,
    .btn-import,
    .btn-cancel {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      border-radius: 6px;
      padding: 8px 14px;
      font-size: 12px;
      font-weight: 700;
      font-family: inherit;
      cursor: pointer;
      border: 1px solid transparent;
      transition: background .15s, border-color .15s, color .15s;
    }
    .btn-create { background: var(--blue); border-color: var(--blue); color: #fff; }
    .btn-create:hover { background: #0068b0; border-color: #0068b0; }
    .btn-import { background: var(--surf); border-color: var(--border); color: var(--text); }
    .btn-import:hover { background: var(--surf2); border-color: var(--blue); }
    .btn-cancel { background: transparent; border-color: var(--border); color: var(--muted); }
    .btn-cancel:hover { background: var(--surf2); color: var(--text); }

    /* ── Import modal ── */
    .modal-backdrop {
      display: none; position: fixed; inset: 0; z-index: 200;
      background: rgba(0,0,0,.65); align-items: center; justify-content: center; padding: 16px;
    }
    .modal-backdrop.open { display: flex; }
    .modal {
      width: min(540px, 96vw);
      background: var(--surf); border: 1px solid var(--border); border-radius: 10px;
      box-shadow: 0 20px 60px rgba(0,0,0,.6); overflow: hidden;
      display: flex; flex-direction: column;
    }
    .modal-head {
      display: flex; align-items: center; justify-content: space-between;
      padding: 14px 16px; border-bottom: 1px solid var(--border);
      background: var(--surf2);
    }
    .modal-title { font-size: 13px; font-weight: 700; color: var(--text); }
    .modal-close {
      display: inline-flex; align-items: center; justify-content: center;
      width: 26px; height: 26px; border-radius: 4px;
      border: none; background: transparent; color: var(--muted);
      font-size: 16px; cursor: pointer; transition: background .1s, color .1s;
    }
    .modal-close:hover { background: var(--surf3); color: var(--text); }
    .modal-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
    .modal-foot { padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surf2); display: flex; justify-content: flex-end; gap: 8px; }

    .import-note {
      font-size: 12px; color: var(--muted); line-height: 1.65;
      background: var(--surf2); border: 1px solid var(--border);
      border-radius: 8px; padding: 10px 12px;
    }
    .import-note code {
      background: rgba(127,127,127,.2); border-radius: 4px; padding: 1px 5px; font-size: 11px;
    }
    .drop-zone {
      border: 2px dashed var(--border); border-radius: 10px; padding: 26px;
      text-align: center; cursor: pointer;
      display: flex; flex-direction: column; align-items: center; gap: 8px;
      transition: border-color .15s, background .15s;
    }
    .drop-zone:hover,
    .drop-zone.over { border-color: var(--blue); background: rgba(0,122,204,.06); }
    .drop-zone-icon { display: flex; align-items: center; justify-content: center; opacity: .7; }
    .drop-zone-label { font-size: 13px; font-weight: 700; }
    .drop-zone-sub { font-size: 11px; color: var(--muted); }
    .import-progress-wrap {
      height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; display: none;
    }
    .import-progress-wrap.visible { display: block; }
    .import-progress { height: 100%; width: 0%; background: var(--blue); transition: width .2s; }
    .import-status { min-height: 18px; font-size: 12px; color: var(--muted); }

    .slide-folder-select {
      width: 100%;
      background: var(--surf2);
      border: 1px solid var(--border);
      border-radius: 6px;
      color: var(--text);
      font-size: 12px;
      font-family: inherit;
      padding: 6px 8px;
      outline: none;
      margin-top: 7px;
    }
    .slide-folder-select:focus { border-color: var(--blue); }

    #diapo-state {
      font-size: 13px;
      color: var(--muted);
      background: var(--surf);
      border: 1px dashed var(--border);
      border-radius: 8px;
      padding: 16px;
      text-align: center;
    }
    .list {
      display: none;
      grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
      gap: 12px;
      align-items: stretch;
    }
    .list > .folder-browser,
    .list > .empty-state {
      grid-column: 1 / -1;
    }
    .folder-browser {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
      gap: 12px;
    }
    .folder-tile {
      border: 1px solid var(--border);
      border-radius: 12px;
      background: var(--surf);
      color: var(--text);
      padding: 16px 10px 14px;
      min-height: 132px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 8px;
      cursor: pointer;
      transition: border-color .12s, background .12s, transform .12s;
    }
    .folder-tile:hover {
      border-color: var(--blue);
      background: var(--surf2);
      transform: translateY(-1px);
    }
    .folder-tile-selected {
      border-color: var(--blue);
      box-shadow: 0 0 0 2px rgba(0,122,204,.22);
      background: color-mix(in oklab, var(--blue) 10%, var(--surf));
    }
    .folder-tile-icon {
      color: var(--blue-l);
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    .folder-tile-name {
      font-size: 11px;
      font-weight: 700;
      color: var(--text);
      max-width: 100%;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .folder-tile-count {
      font-size: 11px;
      color: var(--muted);
      font-weight: 600;
    }
    .folder-tile-actions {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 4px;
      width: 100%;
      margin-top: 2px;
    }
    .folder-tile-action {
      border: 1px solid var(--border);
      border-radius: 5px;
      background: var(--surf2);
      color: var(--muted);
      font-size: 9px;
      font-weight: 700;
      padding: 5px 4px;
      cursor: pointer;
      font-family: inherit;
      transition: background .12s, color .12s, border-color .12s;
    }

    .folder-tile.dnd-over {
      outline: 2px solid #2f6bff;
      outline-offset: -2px;
    }

    .dnd-root-drop.dnd-over {
      box-shadow: inset 0 0 0 2px rgba(47, 107, 255, 0.35);
      border-radius: 16px;
    }

    .item.dragging {
      opacity: 0.45;
    }
    .folder-tile-action:hover { background: var(--surf3); color: var(--text); border-color: var(--blue); }
    .folder-tile-action.danger { color: var(--red); border-color: rgba(244,71,71,.35); }
    .folder-tile-action.danger:hover { background: rgba(244,71,71,.14); border-color: var(--red); }
    .folder-tile-create {
      border-style: dashed;
      border-color: var(--blue);
      background: color-mix(in oklab, var(--blue) 10%, transparent);
    }
    .folder-tile-create .folder-tile-icon { color: var(--blue); }
    .folder-tile-create .folder-tile-name { color: var(--blue-l); }
    .folder-tile-create:disabled { opacity: .45; cursor: default; transform: none; }
    .item {
      background: var(--surf);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 10px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      align-items: stretch;
      transition: border-color .12s, box-shadow .12s, transform .12s;
    }
    .item:hover {
      border-color: var(--border2);
      box-shadow: 0 4px 14px rgba(0,0,0,.16);
      transform: translateY(-1px);
    }

    /* Thumbnail */
    .item-thumb {
      width: 100%;
      aspect-ratio: 1 / 1;
      border-radius: 5px;
      flex-shrink: 0;
      overflow: hidden;
      position: relative;
      border: 1px solid rgba(0,0,0,.18);
      box-shadow: 0 1px 4px rgba(0,0,0,.25);
      background: var(--surf2);
    }
    .thumb-overlay {
      position: absolute; inset: 0;
      background: rgba(0,0,0,.48);
      display: flex; align-items: center; justify-content: center; gap: 8px;
      opacity: 0; transition: opacity .15s;
    }
    .item:hover .thumb-overlay { opacity: 1; }
    .overlay-btn {
      display: inline-flex; align-items: center; justify-content: center;
      width: 34px; height: 34px; border-radius: 6px;
      border: 1px solid rgba(255,255,255,.25);
      background: rgba(255,255,255,.12);
      color: #fff; cursor: pointer;
      transition: background .15s, border-color .15s;
      backdrop-filter: blur(4px);
      text-decoration: none;
    }
    .overlay-btn:hover { background: rgba(255,255,255,.28); border-color: rgba(255,255,255,.55); }
    .overlay-btn.danger:hover { background: rgba(244,71,71,.4); border-color: rgba(244,71,71,.7); }

    .item-thumb-mini {
      position: absolute;
      border-radius: 1px;
      overflow: hidden;
    }
    .item-thumb-badge {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 9px;
      font-weight: 800;
      color: rgba(255,255,255,.7);
      text-shadow: 0 1px 3px rgba(0,0,0,.5);
      letter-spacing: .04em;
      pointer-events: none;
    }

    .item-main { min-width: 0; }
    .item-title { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .item-sub { font-size: 11px; color: var(--muted); margin-top: 3px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
    .item-sub-tag {
      display: inline-flex; align-items: center; gap: 3px;
      background: var(--surf2); border: 1px solid var(--border2);
      border-radius: 4px; padding: 1px 6px; font-size: 10px; font-weight: 600; color: var(--muted);
    }
    .item-actions {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 6px;
      margin-top: auto;
    }
    .item-edit,
    .item-open,
    .item-move,
    .item-delete {
      height: 28px;
      border: 1px solid var(--border);
      border-radius: 6px;
      background: var(--surf2);
      color: var(--muted);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      text-decoration: none;
      font-family: inherit;
      transition: background .12s, border-color .12s, color .12s;
    }
    .item-edit:hover,
    .item-open:hover,
    .item-move:hover { background: var(--surf3); border-color: var(--border2); color: var(--text); }
    .item-delete { border-color: rgba(244,71,71,.5); color: var(--red); }
    .item-delete:hover { background: rgba(244,71,71,.14); border-color: var(--red); }

    .move-modal {
      width: min(380px, 94vw);
      background: var(--surf);
      border: 1px solid var(--border);
      border-radius: 8px;
      box-shadow: 0 12px 40px rgba(0,0,0,.5);
      overflow: hidden;
    }
    .move-modal-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
    .move-modal-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
    .move-modal-select { width: 100%; background: var(--surf2); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 13px; font-family: inherit; padding: 8px 10px; outline: none; }
    .move-modal-select:focus { border-color: var(--blue); }
    .move-modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); background: var(--surf2); }
    #move-slide-title { justify-content: center; text-align: center; padding-top: 18px; }

    /* Empty state */
    .empty-state {
      text-align: center;
      padding: 48px 20px;
      color: var(--muted);
    }
    .empty-state-icon { display: flex; align-items: center; justify-content: center; margin-bottom: 12px; opacity: .5; }
    .empty-state-title { font-size: 15px; font-weight: 700; color: var(--text2); margin-bottom: 6px; }
    .empty-state-sub { font-size: 12px; margin-bottom: 18px; }
    .empty-state-cta {
      display: inline-flex; align-items: center; gap: 6px;
      background: var(--accent); color: #fff;
      border-radius: 6px; padding: 9px 18px;
      font-size: 12px; font-weight: 700;
      text-decoration: none;
      transition: opacity .15s;
    }
    .empty-state-cta:hover { opacity: .85; }

    .confirm-backdrop {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,.6);
      z-index: 250;
      align-items: center;
      justify-content: center;
      padding: 16px;
    }
    .confirm-backdrop.open { display: flex; }
    .folder-create-modal {
      width: min(380px, 94vw);
      background: var(--surf);
      border: 1px solid var(--border);
      border-radius: 8px;
      box-shadow: 0 12px 40px rgba(0,0,0,.5);
      overflow: hidden;
    }
    .folder-create-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
    .folder-create-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
    .folder-create-input { width: 100%; background: var(--surf2); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 13px; font-family: inherit; padding: 8px 10px; outline: none; transition: border-color .15s; }
    .folder-create-input:focus { border-color: var(--blue); }
    .folder-create-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); background: var(--surf2); }


    /* ── Bottom nav (mobile) ── */
    .bottom-nav {
      display: none;
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      z-index: 200;
      background: var(--surf);
      border-top: 1px solid var(--border);
      padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .bottom-nav-inner { display: flex; align-items: stretch; height: 56px; }
    .bnav-item {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 3px;
      color: var(--muted);
      font-size: 10px;
      font-weight: 600;
      text-decoration: none;
      border: none;
      background: transparent;
      font-family: inherit;
      cursor: pointer;
      transition: color .15s;
      -webkit-tap-highlight-color: transparent;
    }
    .bnav-item:active { opacity: .7; }
    .bnav-item.active { color: var(--accent2); }
    .bnav-item svg { flex-shrink: 0; }
    .bnav-center { flex: 1; padding: 0; }
    .bnav-launch-btn {
      width: 46px;
      height: 46px;
      border-radius: 14px;
      background: var(--accent);
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 4px 14px rgba(99,102,241,.4);
      border: none;
      cursor: pointer;
      font-family: inherit;
      transition: background .15s, transform .1s;
      -webkit-tap-highlight-color: transparent;
    }
    .bnav-launch-btn:active { transform: scale(.93); }

    @media (max-width: 900px) {
      .bottom-nav { display: block; }
      .bnav-item.bnav-mobile-hide { display: none; }
      main { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
    }

    @media (max-width: 900px) {
      .list { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
    }

    @media (max-width: 760px) {
      .folder-tabs { padding: 0 8px; }
      .ftab { padding: 10px 8px 8px; font-size: 11px; }

      main { padding: 12px; }
      .actions { flex-direction: column; }
      .actions .btn-create,
      .actions .btn-import { width: 100%; justify-content: center; }
      .search-wrap { width: 100%; }

      .import-note { font-size: 11px; line-height: 1.55; }
      .drop-zone { padding: 18px 12px; }
      .drop-zone-label { font-size: 12px; }

      .item-actions { grid-template-columns: 1fr; }

      .import-footer { justify-content: stretch; }
      .import-footer .btn-cancel { flex: 1; justify-content: center; }
    }

    @media (max-width: 440px) {
      .item-actions { grid-template-columns: 1fr; }
      .slide-folder-select { font-size: 16px; }
    }