/* ============================================================
   OSpress — Responsive
   ============================================================ */

/* ── Hide phone chrome on all non-mobile screens ──────────── */
.ospress-phone-bar { display: none; }
.ospress-phone-nav  { display: none; }

/* ── Nav drawer elements — desktop/tablet hidden ─────────── */
.ospress-nav-drawer-backdrop { display: none; }
.ospress-nav-drawer-close    { display: none; }
.ospress-nav-drawer-toggle   { display: none !important; }
.ospress-nav-drawer-search   { display: none; }

/* ── Tablet (768–1023px) ─────────────────────────────────── */
@media (max-width: 1023px) {

  /* Windows open full-width, no dragging */
  .os-window {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: calc(100vh - var(--taskbar-h)) !important;
    border-radius: 0 !important;
    max-width: 100vw;
    max-height: calc(100vh - var(--taskbar-h));
  }

  .ospress-taskbar--top .os-window {
    top: var(--taskbar-h) !important;
  }

  /* Disable resize cursor hint */
  .os-window { cursor: default; }

  /* Start menu full-width-ish */
  .start-menu {
    width: calc(100vw - 32px);
    max-width: 480px;
  }

  /* Explorer: slightly fewer columns */
  .explorer__content {
    gap: 6px;
  }

  /* Desktop list view — 3 columns on tablet */
  .desktop__grid.view-list {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Window body becomes the single scroll container on tablet.
     Without this the inner flex:1 children eat all available height and
     the sidebar is invisible / clipped by overflow:hidden on the body. */
  .os-window__body {
    overflow-y: auto !important;
    overflow-x: hidden;
  }

  /* All inner containers: shrink to natural content height so the body
     scroller above can measure and scroll the full stack. */
  .explorer__layout {
    flex: 0 0 auto !important;
    overflow: visible !important;
    min-height: unset !important;
  }
  .document-explorer__body {
    flex: 0 0 auto !important;
    overflow: visible !important;
    margin-bottom: 5rem;
  }
  .explorer__main,
  .explorer__main-primary {
    flex: 0 0 auto !important;
  }
  .doc-primary {
    overflow-y: visible !important;
    flex: 0 0 auto !important;
  }
  .doc-sidebar {
    overflow-y: visible !important;
    flex: 0 0 auto !important;
  }

  /* Document body: column layout — sidebar stacks below content */
  .document-explorer__body { flex-direction: column !important; }

  /* Pane resizers hidden on tablet */
  .pane-resizer { display: none !important; }

  /* Window resize handles hidden on tablet/mobile */
  .os-window__resize-handle { display: none !important; }

  /* Doc sidebar stacks below content on tablet */
  .explorer__main,
  .explorer__main-primary { flex-direction: column; overflow: visible; margin-bottom:10rem !important}
  .doc-sidebar { width: 100%; border-left: none; border-top: 1px solid var(--win-border); }

  .document-explorer__comments {
    border-top: 1px solid var(--ospress-border);
    padding: 16px;
  }
}

/* ── Mobile (<768px) — Windows Phone / Metro UI ──────────── */
@media (max-width: 767px) {

  /* ── App-mode reset ── */
  html, body {
    /* !important beats desktop.css ’s html,body { overflow:hidden } on the cascade */
    overflow: auto !important;
    height: auto !important;
    /* 'none' blocks all overscroll including regular scroll edges on some Android devices.
       'y: contain' only prevents the rubber-band bounce, not normal scrolling. */
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  .ospress-root {
    position: static !important;
    height: auto !important;
    overflow: visible !important;
    /* Mirror the desktop wallpaper gradient using the same CSS vars */
    background: linear-gradient(135deg, var(--wallpaper-from, #0a2a6e) 0%, #1565c0 30%, #0d47a1 55%, #006494 75%, var(--wallpaper-to, #003f6b) 100%);
    background-attachment: scroll;
    min-height: 100svh;
  }

  /* ── Hide desktop OS chrome ── */
  .taskbar,
  .notif-panel,
  .wallpaper { display: none !important; }

  /* ── Mobile start menu — slide-up bottom sheet ── */
  /* Must NOT be display:none globally; [hidden] + JS handle visibility. */
  .start-menu {
    position: fixed !important;
    bottom: var(--taskbar-h, 40px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 85svh;
    border-radius: 12px 12px 0 0 !important;
    border: none !important;
    border-top: 1px solid rgba(255,255,255,0.12) !important;
    box-shadow: 0 -4px 32px rgba(0,0,0,0.5) !important;
    z-index: 9200 !important;
    overflow-y: auto;
    overscroll-behavior: contain;
    animation: start-menu-mobile-in 0.25s cubic-bezier(0.4,0,0.2,1);
  }
  .start-menu[hidden] { display: none !important; }

  @keyframes start-menu-mobile-in {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* Start menu body: allow scrolling inside the sheet */
  .start-menu__body {
    overflow-y: auto;
    max-height: 55svh;
  }

  /* ══════════════════════════════════════════════════════════
     PHONE SHELL
  ══════════════════════════════════════════════════════════ */
  .ospress-phone-bar {
    display: flex !important;
    flex-direction: column;
    position: sticky;
    top: 0;
    z-index: 9000;
    font-family: 'Segoe UI', system-ui, sans-serif;
  }

  /* Status bar — thin black system row with clock + icons */
  .ospress-phone-status {
    background: rgba(10, 10, 20, 0.95);
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    color: rgba(255,255,255,0.9);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
  }

  .ospress-phone-statusicons {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.9);
  }

  /* App bar — same glass as the desktop taskbar */
  .ospress-phone-appbar {
    background: rgba(20, 20, 35, 0.82);
    backdrop-filter: blur(24px) saturate(1.6);
    -webkit-backdrop-filter: blur(24px) saturate(1.6);
    border-top: 1px solid rgba(255,255,255,0.06);
    height: 44px;
    display: flex;
    align-items: center;
    padding: 0 4px;
    gap: 4px;
  }

  .ospress-phone-backbtn {
    width: 38px;
    height: 38px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 6px;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.1s;
  }
  .ospress-phone-backbtn:active { background: rgba(255,255,255,0.12); }

  .ospress-phone-title {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
    color: rgba(255,255,255,0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
    padding: 0 4px;
  }

  /* ══════════════════════════════════════════════════════════
     PHONE BOTTOM NAV — mirrors desktop taskbar layout
  ══════════════════════════════════════════════════════════ */
  .ospress-phone-nav {
    display: flex !important;
    align-items: center;
    padding: 0 4px;
    gap: 2px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--taskbar-h);
    background: rgba(20, 20, 35, 0.82);
    backdrop-filter: blur(24px) saturate(1.6);
    -webkit-backdrop-filter: blur(24px) saturate(1.6);
    border-top: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px 12px 0 0;
    z-index: 9001;
    color: #fff;
  }

  /* Left group — hamburger (= start) + back */
  .ospress-phone-nav__left {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
  }

  /* Spacer fills the middle (mirrors empty taskbar items area) */
  .ospress-phone-nav__spacer { flex: 1; }

  /* Right tray — home + dark mode + clock */
  .ospress-phone-nav__tray {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
  }

  /* Individual nav buttons — same styled as desktop .taskbar__tray-btn */
  .ospress-phone-nav__btn {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: rgba(255,255,255,0.80);
    cursor: pointer;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    border-radius: 6px;
    transition: background 0.12s, color 0.12s;
  }
  .ospress-phone-nav__btn:hover  { background: rgba(255,255,255,0.12); color: #fff; }
  .ospress-phone-nav__btn:active { background: rgba(255,255,255,0.18); color: #fff; }

  /* Clock — matches desktop .taskbar__clock */
  .ospress-phone-nav__clock {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    line-height: 1.2;
    min-width: 48px;
  }
  #ospress-phone-nav-clock-time { font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.90); }
  #ospress-phone-nav-clock-date { font-size: 10px; color: rgba(255,255,255,0.60); }

  /* ══════════════════════════════════════════════════════════
     MAIN CONTENT AREA
  ══════════════════════════════════════════════════════════ */
  .ospress-main {
    position: static;
    pointer-events: all;
    overflow-y: scroll !important;
    height: 100vh !important;
    margin-bottom: calc(var(--taskbar-h, 40px) + 16px);
  }

  /* ══════════════════════════════════════════════════════════
     DESKTOP → LIVE TILES GRID
  ══════════════════════════════════════════════════════════ */
  .desktop {
    position: static;
    pointer-events: all;
    overflow: visible;
    background: transparent;
  }

  .desktop__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 10px calc(var(--taskbar-h, 40px) + 16px);
    height: auto;
    overflow: visible;
    align-content: start;
    flex-direction: unset;
    flex-wrap: unset;
    width: 100%;
    box-sizing: border-box;
  }

  /* Hide desktop toolbar on mobile */
  .desktop__toolbar { display: none; }

  /* Desktop list view — 2 columns on mobile */
  .desktop__grid.view-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    height: auto;
    overflow: visible;
    padding: 8px 8px calc(var(--taskbar-h, 40px) + 16px);
  }

  .desktop__grid.view-list .desktop-icon {
    height: 44px;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    gap: 8px;
  }

  .desktop__grid.view-list .desktop-icon__label {
    font-size: 13px;
  }

  /* ── Desktop Icon — Win11 glass card style ── */
  .desktop-icon {
    aspect-ratio: unset;
    width: 100%;
    height: 96px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 2px 10px rgba(0,0,0,0.30);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px 8px 8px;
    gap: 7px;
    overflow: hidden;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.1s, opacity 0.1s;
  }
  .desktop-icon:active {
    opacity: 0.75;
    transform: scale(0.95);
  }

  /* Colored accent strip at top using the category’s tile color */
  .desktop-icon::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--tile-color, var(--ospress-accent));
    border-radius: 10px 10px 0 0;
  }

  .desktop-icon__graphic {
    position: static;
    opacity: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .desktop-icon__graphic svg { width: 36px; height: 36px; }
  .desktop-icon__folder-svg  { width: 36px; height: 30px; flex-shrink: 0; }
  .desktop-icon__file-svg    { width: 30px; height: 30px; color: rgba(255,255,255,0.80); }
  .desktop-icon__thumb       { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }

  .desktop-icon__label {
    color: var(--win-text);
    font-size: 11px;
    font-weight: 500;
    text-shadow: none;
    text-align: center;
    width: 100%;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    z-index: 1;
    line-height: 1.3;
  }

  span.desktop-icon__label.always-white {
    color: #fff !important;
  }

  .desktop-icon__count {
    position: absolute;
    top: 7px;
    right: 8px;
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.55);
    font-size: 10px;
    font-weight: 500;
    height: 18px;
    min-width: 18px;
    border-radius: 9px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Desktop widget → fixed bottom sheet (slide-up panel above phone nav) */
  .desktop-widget {
    position: fixed !important;
    bottom: var(--taskbar-h) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-height: 70vh;
    overflow-y: auto;
    z-index: 9002;
    border-radius: 12px 12px 0 0 !important;
    border: none !important;
    border-top: 1px solid rgba(255,255,255,0.12) !important;
    box-shadow: 0 -4px 32px rgba(0,0,0,0.50) !important;
    backdrop-filter: blur(24px) saturate(1.6) !important;
    -webkit-backdrop-filter: blur(24px) saturate(1.6) !important;
    /* Override desktop scale animation with slide-down */
    transform: translateY(0) !important;
    opacity: 1 !important;
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), opacity 0.3s !important;
  }
  .desktop-widget.is-hidden {
    transform: translateY(110%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  /* Widget host stays in DOM — position:fixed on the widget itself makes it viewport-relative */

  /* ══════════════════════════════════════════════════════════
     WINDOWS → FULL-SCREEN APPS
  ══════════════════════════════════════════════════════════ */
  .os-window {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    min-height: calc(100svh - 66px - var(--taskbar-h, 40px)) !important;
    max-height: none !important;
    /* Remove overflow:hidden — on mobile the PAGE scrolls, not the window */
    overflow: visible !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    top: auto !important;
    left: auto !important;
    margin: 0;
    /* Let vertical touch-pan pass through to the document scroller */
    touch-action: pan-y !important;
  }

  /* is-maximized is added by JS on load; override every property it locks */
  .os-window.is-maximized {
    position: static !important;
    height: auto !important;
    max-height: none !important;
    min-height: calc(100svh - 66px - var(--taskbar-h, 40px)) !important;
    overflow: visible !important;
  }

  .os-window__titlebar {
    position: sticky;
    top: 0;
    z-index: 100;
    cursor: default;
    -webkit-app-region: unset;
  }

  .os-window__btn--minimize,
  .os-window__btn--maximize { display: none; }

  /* Resize handles make no sense on mobile — hide them */
  .os-window__resize-handle { display: none !important; }

  .os-window__body {
    /* flex:1 (flex-basis:0%) in a height:auto flex container collapses the body to 0,
       as there's no surplus space for flex-grow to distribute.
       Fix: use flex:0 0 auto so the body takes its natural content height. */
    flex: 0 0 auto !important;
    overflow: visible !important;
    height: auto !important;
    min-height: calc(100svh - 66px - var(--taskbar-h, 40px) - 38px);
    max-height: none !important;
    /* Explicitly tell the browser: vertical pan is allowed on this element */
    touch-action: pan-y !important;
  }

  /* ══════════════════════════════════════════════════════════
     EXPLORER — left pane as off-screen slide-in drawer
  ══════════════════════════════════════════════════════════ */

  /* Layout stays flex-row; nav drawer is position:fixed (out of flow) so explorer__main fills.
     IMPORTANT: container-type must be reset — CSS containment makes position:fixed children
     relative to the container element instead of the viewport, breaking the drawer. */
  .explorer__layout {
    flex-direction: row;
    overflow: visible;
    min-height: unset;
    container-type: normal;
  }

  /* ── Drawer panel ── */
  .explorer__nav-pane {
    position: fixed !important;
    top: 66px;    /* status(22) + appbar(44) */
    bottom: var(--taskbar-h, 40px);
    left: 0;
    width: 280px;
    max-width: 85vw;
    z-index: 9050;
    transform: translateX(calc(-100% - 2px));
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid var(--win-border);
    background: var(--win-toolbar);
    display: block !important;
    white-space: normal;
    padding: 0 0 16px;
    height: auto;
    min-height: unset;
    gap: unset;
    scrollbar-width: thin;
    border-radius: 0 8px 8px 0;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.45);
  }
  .explorer__nav-pane.is-drawer-open {
    transform: translateX(0);
  }

  /* Restore desktop-style vertical list layout inside the drawer */
  .explorer__pane-group {
    display: block;
    margin-top: 4px;
  }

  .explorer__pane-group-toggle { display: flex !important; }

  .explorer__pane-list {
    display: flex !important;
    flex-direction: column;
    gap: 0;
    padding: 0;
    margin: 0;
  }

  .explorer__pane-item {
    white-space: normal;
    border-radius: 5px;
    padding: 6px 12px;
    background: transparent;
    margin: 1px 4px;
    font-size: 13px;
  }

  .explorer__pane-count { display: flex !important; }

  /* ── Drawer close button (header row inside the drawer) ── */
  .ospress-nav-drawer-close {
    display: flex !important;
    width: 100%;
    align-items: center;
    justify-content: flex-end;
    padding: 10px 14px 8px;
    background: none;
    border: none;
    border-bottom: 1px solid var(--win-border);
    color: var(--win-text);
    cursor: pointer;
    margin-bottom: 4px;
    -webkit-tap-highlight-color: transparent;
    gap: 8px;
    box-sizing: border-box;
  }
  .ospress-nav-drawer-close::before {
    content: 'Navigation';
    flex: 1;
    font-weight: 600;
    font-size: 13px;
    text-align: left;
    opacity: 0.9;
    font-family: 'Segoe UI', system-ui, sans-serif;
  }

  .explorer__content.view-list{
    grid-template-columns: repeat(1, 1fr);
  }

  /* ── Backdrop ── */
  .ospress-nav-drawer-backdrop {
    display: block !important;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9040;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s;
  }
  .ospress-nav-drawer-backdrop.is-visible {
    opacity: 1;
    pointer-events: all;
  }

  /* ── Drawer search (mobile only, inside the nav pane) ── */
  .ospress-nav-drawer-search {
    display: block;
    padding: 8px 10px;
    border-bottom: 1px solid var(--win-border);
    margin-bottom: 4px;
  }
  .ospress-nav-drawer-search form {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--win-border);
    border-radius: 6px;
    padding: 7px 10px;
  }
  .ospress-nav-drawer-search input[type="search"] {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--win-text);
    font-size: 13px;
    font-family: inherit;
    min-width: 0;
  }
  .ospress-nav-drawer-search input::placeholder { color: var(--win-text-muted); }
  .ospress-nav-drawer-search svg { color: var(--win-text-muted); flex-shrink: 0; }

  /* ── Nav drawer toggle — visible on all pages on mobile (opens start menu) ── */
  .ospress-nav-drawer-toggle {
    display: flex !important;
  }

  /* ══════════════════════════════════════════════════════════
     PHONE SHELL — search row
  ══════════════════════════════════════════════════════════ */
  /* ══════════════════════════════════════════════════════════
     EXPLORER — desktop-like tile grid on mobile
  ══════════════════════════════════════════════════════════ */
  /* Same tile-card grid as desktop; icons inherit the .desktop-icon card style */
  .explorer__content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 10px;
    overflow: visible;
    max-height: none;
  }

  /* Explorer empty state */
  .explorer__empty { padding: 32px; }

  /* Explorer toolbar: keep view btns accessible */
  .explorer__toolbar { flex-wrap: wrap; }

  /* Explorer search form goes full-width on mobile */
  .explorer__search-form {
    width: 100%;
    margin-left: 0;
    order: 10;
  }

  /* Address bar: hide back btn, just show breadcrumb */
  .explorer__addressbar .explorer__nav-btn { display: none; }

  /* ══════════════════════════════════════════════════════════
     DOCUMENT-EXPLORER (single post) on mobile
  ══════════════════════════════════════════════════════════ */
  .document-explorer__body {
    flex-direction: column !important;
    overflow: visible !important; /* windows.css sets overflow:hidden — override so content flows as page */
    min-height: unset !important;
  }

  /* Explorer main: column layout on mobile (primary + sidebar stacked) */
  .explorer__main,
  .explorer__main-primary {
    flex-direction: column !important;
    overflow: visible;
    width: 98vw !important;
    margin-bottom: 5rem;
  }

  /* Doc sidebar: full width below content on mobile */
  .doc-sidebar {
    width: 100% !important;
    border-left: none;
    border-top: 1px solid var(--win-border);
    overflow-y: visible;
    padding: 12px 0 4px;
  }

  /* Doc primary: no forced overflow on mobile */
  .doc-primary {
    overflow-y: visible;
    width: 98vw !important;
  }

  /* Hide desktop background layer on mobile */
  .desktop--bg { display: none !important; }

  /* Pane resize handles — hidden on mobile/tablet */
  .pane-resizer { display: none !important; }
  .os-window__resize-handle { display: none !important; }

  .document-explorer__hero-wrap { max-height: 200px; }
  .document-explorer__hero { max-height: 200px; }

  .document__content { padding: 16px; }

  /* ── Post navigation (prev/next) ── */
  .document__postnav .nav-links {
    flex-direction: column;
    gap: 2px;
    padding: 0;
  }

  .document__postnav .nav-links a {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
    width: 100%;
    box-sizing: border-box;
  }

  /* Next post: keep arrow on the right on mobile too */
  .document__postnav .nav-next {
    text-align: left;
    flex-direction: row;
    border-top: 1px solid var(--win-border);
  }
  .document__postnav .nav-next a {
    flex-direction: row-reverse;
    justify-content: space-between;
  }

  .document__postnav .nav-title {
    font-size: 13px;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* ══════════════════════════════════════════════════════════
     MISC
  ══════════════════════════════════════════════════════════ */
  .profile__header     { flex-direction: column; align-items: center; text-align: center; }
  .profile__avatar-wrap { margin-bottom: 8px; }
  .desktop__toasts     { display: none; }
  .explorer__addressbar { flex-wrap: wrap; }

  /* Software archive: tighter cards on tablet */
  .sw-archive-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 2px;
    padding: 6px;
  }

  /* List mode on mobile: keep 2 columns */
  .explorer__content.view-list .sw-archive-grid {
    padding: 0;
    grid-template-columns: repeat(1, 1fr) !important;
  }

  .explorer__content.view-list .sw-archive-card {
    height: 40px;
    max-height: 40px;
    padding: 0 10px 0 8px;
    gap: 8px;
  }

  .explorer__content.view-list .sw-archive-card__icon {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    max-width: 24px;
    max-height: 24px;
    border-radius: 5px;
  }

  .explorer__content.view-list .sw-archive-card__icon img {
    width: 24px !important;
    height: 24px !important;
  }
}


@media (max-width: 450px) {
  .desktop__grid.view-list {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 6px 8px calc(var(--taskbar-h, 40px) + 16px);
  }

  /* Very small screens: 2 columns still fits at 100px min */
  .sw-archive-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 2px;
    padding: 4px;
  }

  .sw-archive-card__icon {
    width: 48px;
    height: 48px;
  }

  .sw-archive-card__name {
    font-size: 0.72rem;
  }
}

/* ── Print ───────────────────────────────────────────────── */
@media print {
  .taskbar, .start-menu, .notif-panel, .os-window__titlebar,
  .os-window__controls, .desktop__toasts, .explorer__addressbar,
  .explorer__toolbar { display: none !important; }

  .os-window {
    position: static !important;
    box-shadow: none;
    border: none;
    width: 100% !important;
    height: auto !important;
  }

  body { color: #000; background: #fff; }
  .document__content { color: #000; }
}
