/* Generated by scripts/build-css.js. Edit app/styles/*.css instead. */

/* tokens.css */
/* Design tokens, density settings, theme variables, and platform color tokens. */

    :root {
      /* Dark Theme (Default) */
      --bg-primary: #0a0a0f;
      --bg-secondary: #12121a;
      --bg-tertiary: #1a1a24;
      --bg-elevated: #22222e;
      --text-primary: #f4f4f6;
      --text-secondary: #8b8b9e;
      --text-tertiary: #5c5c6e;
      --accent: #7c5cff;
      --accent-hover: #9580ff;
      --accent-muted: rgba(124, 92, 255, 0.12);
      --accent-glow: rgba(124, 92, 255, 0.25);
      --border: rgba(255, 255, 255, 0.06);
      --border-hover: rgba(255, 255, 255, 0.12);
      --success: #34d399;
      --success-muted: rgba(52, 211, 153, 0.12);
      --warning: #fbbf24;
      --warning-muted: rgba(251, 191, 36, 0.12);
      --danger: #f87171;
      --danger-muted: rgba(248, 113, 113, 0.12);
      --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
      --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
      --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
      --shadow-glow: 0 0 40px var(--accent-glow);
      --sidebar-width: 260px;
      --bottom-nav-height: 68px;
      --safe-bottom: env(safe-area-inset-bottom, 0px);
      --radius-sm: 8px;
      --radius-md: 12px;
      --radius-lg: 16px;
      --radius-xl: 20px;
      --ui-card-padding: 24px;
      --ui-card-gap: 20px;
      --ui-card-radius: 16px;
      --ui-card-min-height: 190px;
      --ui-panel-radius: 16px;
      --ui-panel-padding: 24px;
      --glass-glow-x: 50%;
      --glass-glow-y: 20%;
      --glass-glow-opacity: 0.38;
      --glass-tilt-x: 0deg;
      --glass-tilt-y: 0deg;
    }

    html[data-ui-density="compact"] {
      --ui-card-padding: 18px;
      --ui-card-gap: 14px;
      --ui-card-radius: 12px;
      --ui-card-min-height: 170px;
      --ui-panel-radius: 12px;
      --ui-panel-padding: 18px;
    }

    html[data-ui-density="balanced"] {
      --ui-card-padding: 24px;
      --ui-card-gap: 20px;
      --ui-card-radius: 16px;
      --ui-card-min-height: 190px;
      --ui-panel-radius: 16px;
      --ui-panel-padding: 24px;
    }

    html[data-ui-density="spacious"] {
      --ui-card-padding: 28px;
      --ui-card-gap: 24px;
      --ui-card-radius: 18px;
      --ui-card-min-height: 208px;
      --ui-panel-radius: 18px;
      --ui-panel-padding: 28px;
    }

    html[data-sidebar-mode="compact"] {
      --sidebar-width: 96px;
    }

    [data-theme="light"] {
      --bg-primary: #f8f9fc;
      --bg-secondary: #ffffff;
      --bg-tertiary: #f0f1f5;
      --bg-elevated: #ffffff;
      --text-primary: #0f0f12;
      --text-secondary: #5c5c6e;
      --text-tertiary: #8b8b9e;
      --accent: #6346e3;
      --accent-hover: #7c5cff;
      --accent-muted: rgba(99, 70, 227, 0.08);
      --accent-glow: rgba(99, 70, 227, 0.15);
      --border: rgba(0, 0, 0, 0.06);
      --border-hover: rgba(0, 0, 0, 0.12);
      --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
      --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
      --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    }

    html[data-platform="apple"] {
      --accent: #67a7ff;
      --accent-hover: #88b8ff;
      --accent-muted: rgba(103, 167, 255, 0.16);
      --accent-glow: rgba(103, 167, 255, 0.22);
      --success: #56d2c2;
      --success-muted: rgba(86, 210, 194, 0.14);
      --warning: #ffd36f;
      --warning-muted: rgba(255, 211, 111, 0.14);
      --danger: #ff8f9d;
      --danger-muted: rgba(255, 143, 157, 0.14);
      --border: rgba(255, 255, 255, 0.12);
      --border-hover: rgba(255, 255, 255, 0.2);
      --shadow-sm: 0 10px 28px rgba(2, 10, 26, 0.14);
      --shadow-md: 0 18px 48px rgba(2, 10, 26, 0.18);
      --shadow-lg: 0 28px 80px rgba(2, 10, 26, 0.2);
    }

    html[data-platform="apple"][data-theme="light"] {
      --bg-primary: #edf3fb;
      --bg-secondary: rgba(255, 255, 255, 0.52);
      --bg-tertiary: rgba(255, 255, 255, 0.36);
      --bg-elevated: rgba(255, 255, 255, 0.7);
      --text-primary: #102037;
      --text-secondary: #49607f;
      --text-tertiary: #7287a3;
      --border: rgba(255, 255, 255, 0.44);
      --border-hover: rgba(255, 255, 255, 0.66);
    }

    html[data-platform="apple"][data-theme="dark"] {
      --bg-primary: #09131f;
      --bg-secondary: rgba(13, 24, 38, 0.58);
      --bg-tertiary: rgba(20, 33, 50, 0.46);
      --bg-elevated: rgba(20, 33, 50, 0.72);
      --text-primary: #f3f8ff;
      --text-secondary: #bfd0ea;
      --text-tertiary: #88a0c0;
      --border: rgba(211, 230, 255, 0.16);
      --border-hover: rgba(211, 230, 255, 0.28);
    }

    html[data-platform="android"] {
      --accent: #7ce0ff;
      --accent-hover: #9be9ff;
      --accent-muted: rgba(124, 224, 255, 0.14);
      --accent-glow: rgba(124, 224, 255, 0.2);
      --shadow-sm: 0 8px 18px rgba(2, 12, 22, 0.12);
      --shadow-md: 0 16px 36px rgba(2, 12, 22, 0.16);
      --shadow-lg: 0 26px 64px rgba(2, 12, 22, 0.2);
    }

    html[data-platform="windows"] {
      --accent: #78b6ff;
      --accent-hover: #97c5ff;
      --accent-muted: rgba(120, 182, 255, 0.14);
      --accent-glow: rgba(120, 182, 255, 0.18);
      --shadow-sm: 0 6px 14px rgba(6, 18, 32, 0.12);
      --shadow-md: 0 14px 36px rgba(6, 18, 32, 0.16);
      --shadow-lg: 0 24px 70px rgba(6, 18, 32, 0.2);
    }

    html[data-platform="macos"] {
      --accent: #86b7ff;
      --accent-hover: #a0c9ff;
      --accent-muted: rgba(134, 183, 255, 0.14);
      --accent-glow: rgba(134, 183, 255, 0.18);
      --shadow-sm: 0 8px 20px rgba(6, 16, 28, 0.12);
      --shadow-md: 0 18px 42px rgba(6, 16, 28, 0.16);
      --shadow-lg: 0 28px 78px rgba(6, 16, 28, 0.2);
    }

/* reset.css */
/* Reset, document-level defaults, and global base animations. */

    *, *::before, *::after {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      -webkit-tap-highlight-color: transparent;
      letter-spacing: 0;
    }

    html {
      height: 100%;
      scroll-behavior: smooth;
      scrollbar-width: thin;
      scrollbar-color: var(--text-tertiary) transparent;
      scrollbar-gutter: stable;
    }

    html,
    body {
      max-width: 100%;
      overflow-x: hidden;
    }

    @keyframes ambientDrift {
      0% { transform: translate3d(-1.5%, -1%, 0) scale(1); }
      50% { transform: translate3d(1.25%, 1.5%, 0) scale(1.02); }
      100% { transform: translate3d(-0.8%, 0.8%, 0) scale(1.01); }
    }

    @keyframes riseIn {
      from {
        opacity: 0;
        transform: translateY(14px) scale(0.985);
        filter: blur(4px);
      }
      to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
      }
    }

    @keyframes sheenPass {
      0% { transform: translateX(-120%) skewX(-16deg); opacity: 0; }
      30% { opacity: 0.35; }
      100% { transform: translateX(120%) skewX(-16deg); opacity: 0; }
    }

    body {
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
      background-color: var(--bg-primary);
      color: var(--text-primary);
      min-height: 100%;
      line-height: 1.5;
      transition: background-color 220ms ease, color 220ms ease;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      overflow-y: auto;
      overscroll-behavior-x: none;
      overscroll-behavior-y: auto;
    }

    button,
    input,
    select,
    textarea {
      font: inherit;
      max-width: 100%;
    }

    button {
      touch-action: manipulation;
    }

/* layout.css */
/* Layout, shell, landing, platform skins, plan skins, and early cascade overrides. */



    html[data-safe-mode="1"] {
      scroll-behavior: auto;
      scrollbar-color: rgba(139, 139, 158, 0.56) transparent;
    }

    html[data-safe-mode="1"] *,
    html[data-safe-mode="1"] *::before,
    html[data-safe-mode="1"] *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.08s !important;
      scroll-behavior: auto !important;
      backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important;
      filter: none !important;
    }

    html[data-safe-mode="1"] .app::before,
    html[data-safe-mode="1"] .app::after {
      display: none;
      opacity: 0;
      filter: none;
      animation: none;
    }

    html[data-safe-mode="1"] .page {
      animation: none !important;
    }

    html.is-navigating .page {
      animation: none !important;
      transition: none !important;
    }

    html[data-safe-mode="1"] .card,
    html[data-safe-mode="1"] .preview-panel,
    html[data-safe-mode="1"] .file-manager,
    html[data-safe-mode="1"] .status-card,
    html[data-safe-mode="1"] .modal,
    html[data-safe-mode="1"] .topbar,
    html[data-safe-mode="1"] .sidebar {
      box-shadow: none !important;
    }

    html[data-safe-mode="1"] .zy-image-viewer,
    html[data-safe-mode="1"] .zy-video-player,
    html[data-safe-mode="1"] .pdf-viewer {
      box-shadow: none !important;
    }

    html[data-safe-mode="1"] .sidebar,
    html[data-safe-mode="1"] .topbar,
    html[data-safe-mode="1"] .card,
    html[data-safe-mode="1"] .form-section,
    html[data-safe-mode="1"] .preview-panel,
    html[data-safe-mode="1"] .status-card,
    html[data-safe-mode="1"] .settings-overview,
    html[data-safe-mode="1"] .doc-card,
    html[data-safe-mode="1"] .circle-card,
    html[data-safe-mode="1"] .modal {
      box-shadow: none;
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
    }

    *::-webkit-scrollbar {
      width: 10px;
      height: 10px;
    }

    *::-webkit-scrollbar-track {
      background: transparent;
    }

    *::-webkit-scrollbar-thumb {
      background: rgba(139, 139, 158, 0.42);
      border: 2px solid transparent;
      border-radius: 999px;
      background-clip: content-box;
    }

    *::-webkit-scrollbar-thumb:hover {
      background: rgba(157, 157, 178, 0.64);
      border: 2px solid transparent;
      border-radius: 999px;
      background-clip: content-box;
    }

    html[data-platform="apple"] body {
      font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', sans-serif;
      background:
        radial-gradient(circle at 14% 12%, rgba(120, 180, 255, 0.22), transparent 24%),
        radial-gradient(circle at 84% 14%, rgba(86, 210, 194, 0.18), transparent 22%),
        linear-gradient(180deg, rgba(255,255,255,0.08), transparent 32%),
        var(--bg-primary);
      background-attachment: fixed;
    }

    html[data-platform="android"] body {
      background:
        radial-gradient(circle at 20% 12%, rgba(124, 224, 255, 0.14), transparent 22%),
        radial-gradient(circle at 80% 18%, rgba(124, 92, 255, 0.12), transparent 20%),
        linear-gradient(180deg, rgba(255,255,255,0.03), transparent 26%),
        var(--bg-primary);
      background-attachment: fixed;
    }

    html[data-platform="windows"] body {
      background:
        radial-gradient(circle at 16% 12%, rgba(120, 182, 255, 0.12), transparent 24%),
        radial-gradient(circle at 82% 16%, rgba(124, 224, 255, 0.1), transparent 22%),
        linear-gradient(180deg, rgba(255,255,255,0.02), transparent 28%),
        var(--bg-primary);
      background-attachment: fixed;
    }

    html[data-platform="macos"] body {
      background:
        radial-gradient(circle at 18% 14%, rgba(134, 183, 255, 0.16), transparent 24%),
        radial-gradient(circle at 84% 16%, rgba(86, 210, 194, 0.1), transparent 22%),
        linear-gradient(180deg, rgba(255,255,255,0.04), transparent 28%),
        var(--bg-primary);
      background-attachment: fixed;
    }

    .app {
      display: flex;
      min-height: 100vh;
      position: relative;
      isolation: isolate;
      overflow: visible;
    }

    .page,
    .card,
    .form-section,
    .preview-panel,
    .status-card,
    .file-manager,
    .mobile-storage-panel,
    .offline-banner,
    .vault-command-strip {
      content-visibility: auto;
      contain-intrinsic-size: 1px 420px;
    }

    .page.active,
    #preview-panel,
    .file-manager,
    .modal.active,
    .toast-container {
      content-visibility: visible;
    }

    .app::before,
    .app::after {
      content: '';
      position: fixed;
      inset: -8%;
      pointer-events: none;
      z-index: 0;
      opacity: 0.55;
      will-change: transform;
    }

    .app::before {
      background:
        radial-gradient(circle 28rem at var(--glass-glow-x) var(--glass-glow-y), rgba(124, 224, 255, 0.18), transparent 56%),
        radial-gradient(circle 24rem at 78% 16%, rgba(124, 92, 255, 0.11), transparent 52%),
        radial-gradient(circle at 50% 82%, rgba(86, 210, 194, 0.08), transparent 28%);
      filter: blur(18px) saturate(120%);
      opacity: var(--glass-glow-opacity);
      animation: ambientDrift 24s ease-in-out infinite alternate;
    }

    .app::after {
      background:
        linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.04) 50%, transparent 100%);
      opacity: 0.18;
      mix-blend-mode: screen;
      animation: sheenPass 18s ease-in-out infinite;
    }

    .sidebar,
    .topbar,
    .main,
    .bottom-nav,
    .landing-screen,
    .loading-overlay,
    .modal-overlay,
    .command-palette-overlay,
    .toast-container {
      position: relative;
      z-index: 1;
    }

    html[data-platform="apple"] .sidebar,
    html[data-platform="apple"] .topbar,
    html[data-platform="apple"] .page-header,
    html[data-platform="apple"] .card,
    html[data-platform="apple"] .status-card,
    html[data-platform="apple"] .form-section,
    html[data-platform="apple"] .preview-panel,
    html[data-platform="apple"] .file-manager,
    html[data-platform="apple"] .store-item,
    html[data-platform="apple"] .profile-header,
    html[data-platform="apple"] .modal,
    html[data-platform="apple"] .offline-banner,
    html[data-platform="apple"] .offline-banner-panel,
    html[data-platform="apple"] .doc-card,
    html[data-platform="apple"] .consent-panel,
    html[data-platform="apple"] .theme-switcher,
    html[data-platform="apple"] .bottom-nav,
    html[data-platform="apple"] .vault-command-strip {
      background: linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.08));
      border: 1px solid var(--border);
      backdrop-filter: blur(24px) saturate(160%);
      -webkit-backdrop-filter: blur(24px) saturate(160%);
      box-shadow: var(--shadow-md);
    }

    html[data-platform="apple"][data-theme="dark"] .sidebar,
    html[data-platform="apple"][data-theme="dark"] .topbar,
    html[data-platform="apple"][data-theme="dark"] .page-header,
    html[data-platform="apple"][data-theme="dark"] .card,
    html[data-platform="apple"][data-theme="dark"] .status-card,
    html[data-platform="apple"][data-theme="dark"] .form-section,
    html[data-platform="apple"][data-theme="dark"] .preview-panel,
    html[data-platform="apple"][data-theme="dark"] .file-manager,
    html[data-platform="apple"][data-theme="dark"] .store-item,
    html[data-platform="apple"][data-theme="dark"] .profile-header,
    html[data-platform="apple"][data-theme="dark"] .modal,
    html[data-platform="apple"][data-theme="dark"] .offline-banner,
    html[data-platform="apple"][data-theme="dark"] .offline-banner-panel,
    html[data-platform="apple"][data-theme="dark"] .doc-card,
    html[data-platform="apple"][data-theme="dark"] .consent-panel,
    html[data-platform="apple"][data-theme="dark"] .theme-switcher,
    html[data-platform="apple"][data-theme="dark"] .bottom-nav,
    html[data-platform="apple"][data-theme="dark"] .vault-command-strip {
      background: linear-gradient(180deg, rgba(26, 40, 59, 0.56), rgba(13, 24, 38, 0.44));
    }

    html[data-platform="apple"] .sidebar {
      background:
        linear-gradient(180deg, rgba(255,255,255,0.24), rgba(255,255,255,0.08)),
        transparent;
      border-right: 1px solid var(--border);
    }

    html[data-platform="apple"] .brand-icon {
      width: 56px;
      height: 56px;
      border-radius: 16px;
      background: linear-gradient(180deg, rgba(255,255,255,0.38), rgba(255,255,255,0.16));
      color: #11304a;
      border: 1px solid rgba(255,255,255,0.34);
      box-shadow: 0 14px 32px rgba(93, 138, 214, 0.22);
    }

    html[data-platform="apple"][data-theme="dark"] .brand-icon {
      color: #eaf4ff;
      background: linear-gradient(180deg, rgba(146, 194, 255, 0.36), rgba(103, 167, 255, 0.18));
      border-color: rgba(196, 221, 255, 0.28);
    }

    html[data-platform="apple"] .nav-item,
    html[data-platform="apple"] .bottom-nav-item,
    html[data-platform="apple"] .topbar-btn,
    html[data-platform="apple"] .theme-btn,
    html[data-platform="apple"] .profile-btn,
    html[data-platform="apple"] .preview-btn,
    html[data-platform="apple"] .fm-btn,
    html[data-platform="apple"] .modal-btn,
    html[data-platform="apple"] .link-btn,
    html[data-platform="apple"] .btn {
      border-radius: 14px;
    }

    html[data-platform="apple"] .nav-item.active,
    html[data-platform="apple"] .bottom-nav-item.active,
    html[data-platform="apple"] .theme-btn.active {
      background: linear-gradient(180deg, rgba(255,255,255,0.34), rgba(255,255,255,0.14));
      border-color: var(--border);
      color: var(--text-primary);
      box-shadow: 0 10px 28px rgba(90, 131, 199, 0.16);
    }

    html[data-platform="apple"] .btn-primary,
    html[data-platform="apple"] .fm-btn-primary,
    html[data-platform="apple"] .modal-btn-primary,
    html[data-platform="apple"] .preview-btn.primary,
    html[data-platform="apple"] .landing-primary {
      background: linear-gradient(180deg, rgba(132, 184, 255, 0.96), rgba(98, 149, 233, 0.92));
      color: #07203a;
      border: 1px solid rgba(255,255,255,0.42);
      box-shadow: 0 18px 38px rgba(95, 148, 226, 0.24);
    }

    html[data-platform="apple"] .btn-secondary,
    html[data-platform="apple"] .modal-btn-secondary,
    html[data-platform="apple"] .landing-secondary {
      background: linear-gradient(180deg, rgba(255,255,255,0.26), rgba(255,255,255,0.12));
      border: 1px solid var(--border);
      color: var(--text-primary);
    }

    html[data-platform="apple"] .form-input,
    html[data-platform="apple"] .fm-input,
    html[data-platform="apple"] .fm-select,
    html[data-platform="apple"] select,
    html[data-platform="apple"] input[type="text"],
    html[data-platform="apple"] input[type="email"],
    html[data-platform="apple"] input[type="password"],
    html[data-platform="apple"] input[type="tel"],
    html[data-platform="apple"] input[type="url"] {
      background: rgba(255,255,255,0.18);
      border: 1px solid var(--border);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
      border-radius: 14px;
    }

    html[data-platform="apple"] .page-header {
      padding: 28px 30px;
      border-radius: 28px;
    }

    html[data-platform="apple"] .card,
    html[data-platform="apple"] .status-card,
    html[data-platform="apple"] .store-item,
    html[data-platform="apple"] .doc-card {
      border-radius: 24px;
    }

    html[data-platform="apple"] .sidebar,
    html[data-platform="apple"] .topbar,
    html[data-platform="apple"] .page-header,
    html[data-platform="apple"] .card,
    html[data-platform="apple"] .status-card,
    html[data-platform="apple"] .form-section,
    html[data-platform="apple"] .preview-panel,
    html[data-platform="apple"] .file-manager,
    html[data-platform="apple"] .store-item,
    html[data-platform="apple"] .profile-header,
    html[data-platform="apple"] .modal,
    html[data-platform="apple"] .offline-banner,
    html[data-platform="apple"] .offline-banner-panel,
    html[data-platform="apple"] .doc-card,
    html[data-platform="apple"] .consent-panel,
    html[data-platform="apple"] .theme-switcher,
    html[data-platform="apple"] .bottom-nav,
    html[data-platform="apple"] .vault-command-strip {
      animation: riseIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
    }

    html[data-platform="apple"] .landing-screen::before {
      background:
        linear-gradient(90deg, rgba(7, 16, 25, 0.72) 0%, rgba(7, 16, 25, 0.38) 52%, rgba(7, 16, 25, 0.12) 100%),
        linear-gradient(180deg, rgba(255,255,255,0.06), rgba(7,16,25,0.68) 100%);
    }

    html[data-platform="apple"] .landing-shell {
      padding: 42px;
    }

    html[data-platform="apple"] .theme-switcher,
    html[data-platform="apple"] .preview-settings,
    html[data-platform="apple"] .pdf-toolbar,
    html[data-platform="apple"] .fm-controls,
    html[data-platform="apple"] .fm-actions,
    html[data-platform="apple"] .modal-actions,
    html[data-platform="apple"] .workspace-actions,
    html[data-platform="apple"] .landing-actions {
      gap: 10px;
    }

    html[data-platform="apple"] .theme-switcher {
      padding: 6px;
      border-radius: 16px;
      background: linear-gradient(180deg, rgba(255,255,255,0.28), rgba(255,255,255,0.14));
      border: 1px solid var(--border);
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
    }

    html[data-platform="apple"][data-theme="dark"] .theme-switcher {
      background: linear-gradient(180deg, rgba(34, 52, 75, 0.74), rgba(18, 30, 47, 0.52));
    }

    html[data-platform="apple"] .theme-btn {
      min-height: 38px;
      border-radius: 12px;
      font-weight: 700;
    }

    html[data-platform="apple"] .theme-btn.active {
      background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(255,255,255,0.3));
      box-shadow: 0 6px 18px rgba(86, 122, 183, 0.16);
    }

    html[data-platform="apple"][data-theme="dark"] .theme-btn.active {
      background: linear-gradient(180deg, rgba(214, 232, 255, 0.22), rgba(110, 146, 199, 0.12));
    }

    html[data-platform="apple"] .toggle-slider {
      background: rgba(150, 170, 198, 0.36);
      box-shadow: inset 0 1px 3px rgba(4, 16, 32, 0.12);
    }

    html[data-platform="apple"] .toggle-slider::before {
      background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(240,245,255,0.92));
      box-shadow: 0 3px 12px rgba(15, 33, 58, 0.18);
    }

    html[data-platform="apple"] input:checked + .toggle-slider {
      background: linear-gradient(90deg, rgba(103, 167, 255, 0.95), rgba(86, 210, 194, 0.92));
    }

    html[data-platform="apple"] .modal {
      border-radius: 28px;
      padding: 28px;
      box-shadow: 0 36px 90px rgba(11, 24, 42, 0.28);
    }

    html[data-platform="apple"] .modal-title {
      font-size: 1.35rem;
      letter-spacing: 0;
    }

    html[data-platform="apple"] .modal-content {
      line-height: 1.7;
    }

    html[data-platform="apple"] .page-header {
      margin-bottom: 30px;
    }

    html[data-platform="apple"] .page-title {
      font-size: clamp(2.2rem, 4vw, 3.2rem);
      letter-spacing: 0;
      font-weight: 760;
    }

    html[data-platform="apple"] .page-description {
      font-size: 1rem;
      max-width: 62ch;
      color: var(--text-secondary);
    }

    html[data-platform="apple"] .landing-kicker {
      background: rgba(255,255,255,0.14);
      border-color: rgba(255,255,255,0.16);
      color: rgba(243, 248, 255, 0.86);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
    }

    html[data-platform="apple"] .landing-title {
      font-size: clamp(4.4rem, 9vw, 6.8rem);
      max-width: 8ch;
      letter-spacing: 0;
      font-weight: 780;
      line-height: 0.92;
      text-wrap: balance;
    }

    html[data-platform="apple"] .landing-copy {
      max-width: 52ch;
      font-size: 1.08rem;
      color: rgba(232, 241, 255, 0.84);
      line-height: 1.8;
    }

    html[data-platform="apple"] .landing-primary,
    html[data-platform="apple"] .landing-secondary {
      min-height: 56px;
      padding: 0 24px;
      border-radius: 18px;
      font-size: 0.96rem;
      font-weight: 760;
    }

    html[data-platform="apple"] .landing-metrics {
      gap: 12px;
    }

    html[data-platform="apple"] .landing-metric {
      padding: 11px 14px;
      border-radius: 18px;
      background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.08));
      border: 1px solid rgba(255,255,255,0.16);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
      box-shadow: 0 10px 24px rgba(8, 24, 41, 0.14);
    }

    html[data-platform="apple"] .landing-status-strip {
      padding: 18px 0 10px;
      color: rgba(226, 238, 255, 0.76);
    }

    html[data-platform="apple"] .landing-status {
      padding: 10px 14px;
      border-radius: 16px;
      background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.06));
      border: 1px solid rgba(255,255,255,0.12);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
    }

    html[data-platform="apple"] .consent-panel {
      border-radius: 24px;
      background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.08));
      border: 1px solid rgba(255,255,255,0.14);
      backdrop-filter: blur(20px) saturate(150%);
      -webkit-backdrop-filter: blur(20px) saturate(150%);
      box-shadow: 0 18px 40px rgba(9, 24, 43, 0.14);
    }

    html[data-platform="apple"] .card {
      padding: 26px;
    }

    html[data-platform="apple"] .topbar,
    html[data-platform="apple"] .page-header,
    html[data-platform="apple"] .card,
    html[data-platform="apple"] .status-card,
    html[data-platform="apple"] .preview-panel,
    html[data-platform="apple"] .file-manager,
    html[data-platform="apple"] .store-item,
    html[data-platform="apple"] .profile-header {
      transform: translate3d(0, 0, 0) rotateX(var(--glass-tilt-y)) rotateY(var(--glass-tilt-x));
      transform-style: preserve-3d;
      transition: transform 260ms ease, box-shadow 260ms ease, border-color 260ms ease;
      will-change: transform;
    }

    html[data-platform="apple"] .card-value {
      font-size: 2.25rem;
      letter-spacing: 0;
      font-weight: 760;
    }

    html[data-platform="apple"] .card-label {
      letter-spacing: 0.08em;
    }

    html[data-platform="apple"] .store-item-price {
      font-size: 1.06rem;
      font-weight: 760;
      letter-spacing: 0;
    }

    html[data-platform="apple"] .topbar {
      padding-left: 20px;
      padding-right: 20px;
      padding-bottom: 14px;
    }

    html[data-platform="apple"] .topbar-btn {
      background: linear-gradient(180deg, rgba(255,255,255,0.24), rgba(255,255,255,0.11));
      border: 1px solid var(--border);
      box-shadow: 0 8px 18px rgba(31, 65, 108, 0.12);
    }

    html[data-platform="apple"] .bottom-nav {
      padding-top: 8px;
      padding-bottom: calc(10px + var(--safe-bottom));
      border-top: 1px solid var(--border);
    }

    html[data-platform="apple"] .bottom-nav-items {
      gap: 8px;
    }

    html[data-platform="apple"] .bottom-nav-item {
      min-height: 58px;
      border-radius: 18px;
    }

    html[data-platform="apple"] .topbar {
      border-bottom: 1px solid var(--border);
      background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.08));
      backdrop-filter: blur(24px) saturate(165%);
      -webkit-backdrop-filter: blur(24px) saturate(165%);
    }

    html[data-platform="apple"] .main {
      padding-top: 26px;
    }

    html[data-platform="apple"] .page-header {
      box-shadow: 0 18px 36px rgba(11, 24, 42, 0.08);
    }

    html[data-platform="apple"] .page-title {
      text-wrap: balance;
    }

    html[data-platform="apple"] .card:hover,
    html[data-platform="apple"] .preview-panel:hover,
    html[data-platform="apple"] .store-item:hover,
    html[data-platform="apple"] .status-card:hover,
    html[data-platform="apple"] .profile-header:hover {
      transform: translate3d(0, -2px, 0) rotateX(var(--glass-tilt-y)) rotateY(var(--glass-tilt-x));
      box-shadow: 0 24px 68px rgba(2, 10, 26, 0.18);
    }

    html[data-platform="macos"] .sidebar {
      width: 280px;
      padding: 22px 18px;
      border-right: 1px solid var(--border);
      background:
        linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.08)),
        transparent;
      backdrop-filter: blur(24px) saturate(160%);
      -webkit-backdrop-filter: blur(24px) saturate(160%);
    }

    html[data-platform="macos"] .sidebar-brand {
      padding-bottom: 22px;
    }

    html[data-platform="macos"] .sidebar-tip {
      border-radius: 18px;
      background: linear-gradient(180deg, rgba(134, 183, 255, 0.1), rgba(255,255,255,0.04));
    }

    html[data-platform="macos"] .sidebar-section .nav-item {
      border-radius: 16px;
    }

    html[data-platform="macos"] .topbar {
      padding: 14px 18px;
      background: linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.06));
      backdrop-filter: blur(22px) saturate(145%);
      -webkit-backdrop-filter: blur(22px) saturate(145%);
      border-bottom: 1px solid var(--border);
    }

    html[data-platform="macos"] .topbar-title {
      font-size: 0.92rem;
      font-weight: 760;
      letter-spacing: 0.02em;
    }

    html[data-platform="macos"] .main {
      padding-top: 26px;
    }

    html[data-platform="macos"] .page-header {
      padding: 24px 26px;
      border-radius: 26px;
      box-shadow: 0 18px 42px rgba(6, 16, 28, 0.08);
    }

    html[data-platform="macos"] .page-title {
      font-size: clamp(1.9rem, 2.8vw, 3rem);
      letter-spacing: 0;
    }

    html[data-platform="macos"] .card,
    html[data-platform="macos"] .status-card,
    html[data-platform="macos"] .form-section,
    html[data-platform="macos"] .preview-panel,
    html[data-platform="macos"] .store-item,
    html[data-platform="macos"] .profile-header {
      border-radius: 22px;
    }

    html[data-platform="macos"] .card:hover,
    html[data-platform="macos"] .preview-panel:hover,
    html[data-platform="macos"] .store-item:hover,
    html[data-platform="macos"] .status-card:hover,
    html[data-platform="macos"] .profile-header:hover {
      transform: translateY(-2px);
      box-shadow: 0 24px 68px rgba(6, 16, 28, 0.15);
    }

    @media (prefers-reduced-motion: reduce) {
      *,
      *::before,
      *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
      }

      .app::before,
      .app::after {
        animation: none !important;
      }
    }

    .loading-overlay {
      position: fixed;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      background: radial-gradient(circle at top, rgba(124, 92, 255, 0.16), transparent 45%),
        rgba(10, 10, 15, 0.92);
      backdrop-filter: blur(16px);
      z-index: 9999;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.35s ease;
    }

    .loading-overlay.active {
      opacity: 1;
      pointer-events: auto;
    }

    body.landing-active {
      overflow: hidden;
    }

    body.landing-active .app {
      display: none;
    }

    .landing-screen {
      position: fixed;
      inset: 0;
      z-index: 10010;
      display: none;
      align-items: stretch;
      justify-content: flex-start;
      overflow: auto;
      background: #091015 url('assets/zycloud-landing-hero.png') center / cover no-repeat;
      color: #f4f4f6;
    }

    .landing-screen::before {
      content: '';
      position: fixed;
      inset: 0;
      background:
        linear-gradient(90deg, rgba(5, 8, 10, 0.94) 0%, rgba(5, 8, 10, 0.78) 44%, rgba(5, 8, 10, 0.16) 78%),
        linear-gradient(180deg, rgba(5, 8, 10, 0.2) 0%, rgba(5, 8, 10, 0.9) 100%);
      pointer-events: none;
    }

    .landing-screen::after {
      content: '';
      position: fixed;
      inset: auto 0 0 0;
      height: 34%;
      background: linear-gradient(180deg, transparent, rgba(47, 209, 168, 0.14));
      pointer-events: none;
    }

    body.landing-active .landing-screen {
      display: flex;
    }

    .landing-shell {
      position: relative;
      z-index: 1;
      width: min(1120px, 100%);
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      padding: 42px;
    }

    .landing-hero {
      max-width: 760px;
      padding-top: 10vh;
    }

    .landing-kicker {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.08);
      color: rgba(244, 244, 246, 0.8);
      font-size: 0.78rem;
      font-weight: 700;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      margin-bottom: 18px;
    }

    .landing-title {
      font-size: 5rem;
      line-height: 0.96;
      font-weight: 900;
      letter-spacing: 0;
      max-width: 9ch;
      margin-bottom: 18px;
    }

    .landing-copy {
      font-size: 1.08rem;
      line-height: 1.7;
      max-width: 54ch;
      color: rgba(244, 244, 246, 0.8);
      margin-bottom: 24px;
    }

    .landing-actions {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      margin-bottom: 22px;
    }

    .landing-primary,
    .landing-secondary {
      min-height: 52px;
      padding: 0 22px;
      border-radius: 999px;
      font-size: 0.95rem;
      font-weight: 800;
      border: none;
      cursor: pointer;
      transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    }

    .landing-primary:hover,
    .landing-secondary:hover {
      transform: translateY(-2px);
    }

    .landing-primary {
      background: #2fd1a8;
      color: #06110f;
      box-shadow: 0 18px 38px rgba(47, 209, 168, 0.28);
    }

    .landing-secondary {
      background: rgba(255, 255, 255, 0.1);
      color: #f4f4f6;
      border: 1px solid rgba(255, 255, 255, 0.16);
    }

    .landing-metrics {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      max-width: 760px;
    }

    .landing-metric {
      padding: 10px 12px;
      border-radius: 999px;
      background: rgba(6, 12, 14, 0.52);
      border: 1px solid rgba(255, 255, 255, 0.08);
      backdrop-filter: blur(12px);
    }

    .landing-metric-value {
      font-size: 0.86rem;
      font-weight: 800;
    }

    .landing-status-strip {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      width: min(920px, 100%);
      padding: 14px 0;
      color: rgba(244, 244, 246, 0.74);
      font-size: 0.9rem;
    }

    .landing-status {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 180px;
    }

    .landing-dot {
      width: 9px;
      height: 9px;
      border-radius: 999px;
      background: var(--success);
      box-shadow: 0 0 16px rgba(52, 211, 153, 0.4);
      flex-shrink: 0;
    }

    .workspace-kicker {
      display: inline-flex;
      width: fit-content;
      align-items: center;
      gap: 8px;
      padding: 7px 11px;
      margin-bottom: 18px;
      border: 1px solid var(--border);
      border-radius: 999px;
      background: var(--bg-primary);
      color: var(--success);
      font-size: 0.72rem;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    .vault-home .page-header,
    .vault-storage-header {
      padding: 32px;
      border: 1px solid var(--border);
      border-radius: 30px;
      background:
        linear-gradient(135deg, rgba(52, 211, 153, 0.12), transparent 44%),
        radial-gradient(circle at 88% 0%, rgba(52, 211, 153, 0.14), transparent 38%),
        var(--bg-secondary);
      box-shadow: var(--shadow-lg);
    }

    .vault-home .page-title {
      max-width: 11ch;
      font-size: 4rem;
      font-weight: 900;
      line-height: 0.96;
      letter-spacing: 0;
    }

    .vault-home .page-description,
    .vault-storage-header .page-description {
      max-width: 58ch;
      font-size: 1rem;
      line-height: 1.7;
    }

    .workspace-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      margin-top: 24px;
    }

    .vault-home .cards-grid {
      grid-template-columns: repeat(4, minmax(0, 1fr));
      margin-bottom: 24px;
    }

    .vault-home .card {
      min-height: var(--ui-card-min-height);
      border-radius: calc(var(--ui-card-radius) + 8px);
      background:
        linear-gradient(180deg, rgba(255,255,255,0.045), transparent),
        var(--bg-secondary);
    }

    @media (min-width: 1180px) {
      .vault-home .home-moat-card {
        grid-column: span 2;
        min-height: calc(var(--ui-card-min-height) * 1.08);
      }

      .vault-home .home-moat-card .moat-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }

    .layout-editor-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 12px;
    }

    .layout-editor-option {
      display: flex;
      flex-direction: column;
      gap: 6px;
      padding: 14px;
      border-radius: 14px;
      border: 1px solid var(--border);
      background: var(--bg-primary);
      cursor: pointer;
    }

    .layout-editor-option input {
      margin: 0;
    }

    .layout-editor-option strong {
      color: var(--text-primary);
      font-size: 0.92rem;
    }

    .layout-editor-option span {
      color: var(--text-secondary);
      font-size: 0.82rem;
      line-height: 1.4;
    }

    .layout-slider-row {
      display: grid;
      gap: 8px;
      padding: 14px;
      border-radius: 14px;
      border: 1px solid var(--border);
      background: var(--bg-primary);
    }

    .layout-slider-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      color: var(--text-secondary);
      font-size: 0.82rem;
    }

    .layout-slider-head strong {
      color: var(--text-primary);
      font-size: 0.88rem;
    }

    .layout-slider-row input[type="range"] {
      width: 100%;
      accent-color: var(--accent);
    }

    .layout-preview {
      display: grid;
      gap: 10px;
      padding: 14px;
      border-radius: 14px;
      border: 1px solid var(--border);
      background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent), var(--bg-primary);
      color: var(--text-secondary);
      font-size: 0.84rem;
      line-height: 1.5;
    }

    .form-section,
    .settings-overview,
    .preview-panel,
    .settings-billing-row,
    .status-card,
    .doc-card,
    .snapshot-overview-card,
    .circle-card,
    .sync-summary,
    .feedback-panel,
    .permission-panel {
      border-radius: var(--ui-panel-radius);
      padding: var(--ui-panel-padding);
    }

    .vault-home .card-value {
      font-size: 2.35rem;
      font-weight: 900;
    }

    .vault-command-strip {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 16px;
      margin: 18px 0;
      padding: 16px 18px;
      border: 1px solid rgba(52, 211, 153, 0.18);
      border-radius: 20px;
      background: linear-gradient(90deg, rgba(52, 211, 153, 0.12), transparent);
      color: var(--text-secondary);
    }

    .vault-command-strip strong {
      display: block;
      margin-bottom: 2px;
      color: var(--text-primary);
    }

    .offline-banner {
      display: grid;
      grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.95fr);
      gap: 18px;
      margin: 0 0 20px;
      padding: 22px 24px;
      border-radius: 24px;
      border: 1px solid rgba(99, 70, 227, 0.16);
      background:
        radial-gradient(circle at top right, rgba(99, 70, 227, 0.16), transparent 36%),
        linear-gradient(135deg, rgba(47, 209, 168, 0.12), rgba(99, 70, 227, 0.08)),
        var(--bg-secondary);
      box-shadow: var(--shadow-md);
    }

    .offline-banner-copy strong {
      display: block;
      margin-bottom: 8px;
      font-size: 1.02rem;
      color: var(--text-primary);
    }

    .offline-banner-copy p {
      color: var(--text-secondary);
      max-width: 60ch;
    }

    .offline-banner-actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      margin-top: 14px;
    }

    .offline-banner-panel {
      padding: 16px 18px;
      border-radius: 20px;
      background: rgba(10, 10, 15, 0.24);
      border: 1px solid var(--border);
      align-self: stretch;
    }

    .offline-banner-panel-title {
      font-size: 0.82rem;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--text-tertiary);
      margin-bottom: 10px;
    }

    .offline-banner-state {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      margin-bottom: 8px;
      font-weight: 700;
      color: var(--text-primary);
    }

    .offline-banner-hint {
      font-size: 0.92rem;
      color: var(--text-secondary);
      line-height: 1.6;
    }

    .mobile-storage-panel {
      display: none;
      margin: 0 0 16px;
      padding: 16px 18px;
      border-radius: 20px;
      border: 1px solid var(--border);
      background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent), var(--bg-secondary);
      box-shadow: var(--shadow-sm);
    }

    .mobile-storage-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 12px;
    }

    .mobile-storage-title {
      font-size: 0.94rem;
      font-weight: 800;
      color: var(--text-primary);
    }

    .mobile-storage-subtitle {
      margin-top: 2px;
      font-size: 0.84rem;
      color: var(--text-tertiary);
    }

    .mobile-storage-stats {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
      margin-bottom: 12px;
    }

    .mobile-storage-stat {
      min-width: 0;
      padding: 10px 12px;
      border-radius: 16px;
      background: rgba(255,255,255,0.03);
      border: 1px solid rgba(255,255,255,0.05);
    }

    .mobile-storage-stat span {
      display: block;
      font-size: 0.74rem;
      color: var(--text-tertiary);
      margin-bottom: 4px;
    }

    .mobile-storage-stat strong {
      display: block;
      font-size: 0.86rem;
      color: var(--text-primary);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .mobile-storage-list {
      display: grid;
      gap: 8px;
      max-height: min(62dvh, 560px);
      overflow-y: auto;
      overscroll-behavior: contain;
      -webkit-overflow-scrolling: touch;
    }

    .mobile-storage-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 10px 12px;
      border-radius: 14px;
      background: rgba(255,255,255,0.025);
      border: 1px solid rgba(255,255,255,0.05);
    }

    .mobile-storage-item-main {
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .mobile-storage-item-name {
      font-size: 0.88rem;
      font-weight: 700;
      color: var(--text-primary);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .mobile-storage-item-meta {
      font-size: 0.78rem;
      color: var(--text-tertiary);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .mobile-storage-item button {
      flex: 0 0 auto;
      min-height: 34px;
      padding: 0 12px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: var(--bg-tertiary);
      color: var(--text-primary);
      font: inherit;
      font-size: 0.8rem;
      font-weight: 700;
    }

    .mobile-storage-item.pending {
      border-color: rgba(245, 158, 11, 0.32);
    }

    .mobile-storage-item.pending .mobile-storage-item-name {
      color: #f7d28a;
    }

    .vault-status-grid .status-card {
      border-radius: 18px;
      background:
        linear-gradient(180deg, rgba(255,255,255,0.035), transparent),
        var(--bg-secondary);
    }

    .loading-card {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 16px;
      padding: 28px 32px;
      background: rgba(18, 18, 26, 0.9);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-lg);
      min-width: 260px;
    }

    .loading-spinner {
      width: 56px;
      height: 56px;
      border-radius: 50%;
      border: 4px solid rgba(124, 92, 255, 0.2);
      border-top-color: var(--accent);
      animation: spin 1s linear infinite;
      box-shadow: 0 0 20px rgba(124, 92, 255, 0.25);
    }

    .loading-title {
      font-size: 1rem;
      font-weight: 600;
      letter-spacing: 0.02em;
    }

    .consent-panel,
    .doc-card {
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      background: var(--bg-secondary);
      box-shadow: var(--shadow-md);
    }

    .consent-panel {
      margin-top: 22px;
      padding: 18px 20px;
      background:
        linear-gradient(135deg, rgba(99, 70, 227, 0.12), transparent 45%),
        linear-gradient(180deg, rgba(255,255,255,0.03), transparent),
        var(--bg-secondary);
    }

    .consent-title {
      font-size: 0.85rem;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--text-tertiary);
      margin-bottom: 10px;
    }

    .consent-copy,
    .page-prose p,
    .page-prose li,
    .doc-card p {
      color: var(--text-secondary);
      line-height: 1.7;
    }

    .consent-check {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      margin-top: 14px;
      color: var(--text-primary);
    }

    .consent-check span {
      color: #a78bfa;
    }

    .consent-check input {
      margin-top: 4px;
      width: 18px;
      height: 18px;
      accent-color: var(--accent);
      flex-shrink: 0;
    }

    .consent-links,
    .doc-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 14px;
    }

    .link-btn {
      border: 1px solid var(--border);
      background: var(--bg-tertiary);
      color: var(--text-primary);
      border-radius: 999px;
      padding: 8px 12px;
      font-size: 0.82rem;
      font-weight: 700;
      cursor: pointer;
      transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    }

    .link-btn:hover {
      transform: translateY(-1px);
      border-color: var(--border-hover);
      background: var(--bg-elevated);
    }

    .page-prose {
      display: flex;
      flex-direction: column;
      gap: 18px;
    }

    .page-prose h2,
    .page-prose h3 {
      color: var(--text-primary);
      letter-spacing: 0;
    }

    .page-prose h2 {
      font-size: 1.2rem;
    }

    .page-prose h3 {
      font-size: 1rem;
    }

    .page-prose ul {
      padding-left: 20px;
    }

    .doc-grid,
    .support-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
      gap: 18px;
    }

    .doc-card {
      padding: 22px;
    }

    .doc-card strong {
      display: block;
      margin-bottom: 8px;
      color: var(--text-primary);
      font-size: 1rem;
    }

    .page-note {
      padding: 16px 18px;
      border: 1px solid rgba(251, 191, 36, 0.18);
      border-radius: 16px;
      background: var(--warning-muted);
      color: var(--text-primary);
    }

    .page-note strong {
      display: block;
      margin-bottom: 6px;
    }

    .policy-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 12px;
    }

    .brand-tm {
      font-size: 0.46em;
      vertical-align: super;
      margin-left: 2px;
      letter-spacing: 0.02em;
      opacity: 0.82;
    }

    .settings-footer-about {
      display: flex;
      align-items: flex-start;
      gap: 16px;
    }

    .settings-footer-mark {
      width: 72px;
      height: 72px;
      flex-shrink: 0;
      border-radius: 20px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.08));
      border: 1px solid var(--border);
      box-shadow: var(--shadow-md);
      color: var(--text-primary);
      overflow: hidden;
      padding: 8px;
    }

    .settings-footer-mark img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      display: block;
    }

    .settings-footer-copy {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .settings-footer-name {
      font-size: 1.08rem;
      font-weight: 760;
      color: var(--text-primary);
      letter-spacing: 0;
    }

    .settings-footer-meta {
      color: var(--text-secondary);
      line-height: 1.7;
      font-size: 0.92rem;
    }

    .settings-footer-links {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 10px;
    }

    .loading-subtitle {
      font-size: 0.85rem;
      color: var(--text-secondary);
      text-align: center;
    }

    @keyframes spin {
      from { transform: rotate(0deg); }
      to { transform: rotate(360deg); }
    }

    /* ----------------------------------------------
       LAYOUT
    ---------------------------------------------- */
    .app {
      display: flex;
      min-height: 100vh;
    }

    /* ----------------------------------------------
       SIDEBAR
    ---------------------------------------------- */
    .sidebar {
      width: var(--sidebar-width);
      background:
        radial-gradient(circle at top, rgba(124, 224, 255, 0.08), transparent 26%),
        linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
      border-right: 1px solid var(--border);
      padding: 24px 16px;
      display: flex;
      flex-direction: column;
      position: fixed;
      height: 100vh;
      left: 0;
      top: 0;
      z-index: 100;
      overflow-y: auto;
      overflow-x: clip;
      overscroll-behavior: contain;
      contain: layout paint;
      box-shadow: 8px 0 36px rgba(0, 0, 0, 0.12);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
      transition: width 0.28s ease, padding 0.28s ease, background 0.28s ease, border-color 0.28s ease;
      scrollbar-width: thin;
      scrollbar-color: var(--text-tertiary) transparent;
    }

    .sidebar::-webkit-scrollbar {
      width: 12px;
    }

    .sidebar::-webkit-scrollbar-track {
      background: transparent;
    }

    .sidebar::-webkit-scrollbar-thumb {
      background: rgba(139, 139, 158, 0.48);
      border: 3px solid transparent;
      border-radius: 999px;
      background-clip: content-box;
    }

    .sidebar::-webkit-scrollbar-thumb:hover {
      background: rgba(157, 157, 178, 0.72);
      border: 3px solid transparent;
      border-radius: 999px;
      background-clip: content-box;
    }

    .sidebar-brand {
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 0 12px 22px;
      border-bottom: 1px solid var(--border);
      margin-bottom: 18px;
      position: relative;
      isolation: isolate;
    }

    .sidebar-brand::after {
      content: "";
      position: absolute;
      inset: -4px -10px auto -10px;
      height: 54px;
      border-radius: 18px;
      background:
        radial-gradient(circle at 20% 50%, rgba(124, 224, 255, 0.18), transparent 36%),
        radial-gradient(circle at 78% 50%, rgba(141, 102, 255, 0.12), transparent 32%);
      filter: blur(3px);
      pointer-events: none;
      z-index: -1;
    }

    .sidebar-tip {
      margin: 0 0 18px;
      padding: 14px 14px 12px;
      border-radius: var(--radius-lg);
      background:
        linear-gradient(180deg, rgba(124, 224, 255, 0.11), rgba(255, 255, 255, 0.03)),
        var(--bg-tertiary);
      border: 1px solid rgba(124, 224, 255, 0.16);
      box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    }

    .sidebar-tip-title {
      margin: 0 0 6px;
      font-size: 0.78rem;
      font-weight: 800;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--accent);
    }

    .sidebar-tip-copy {
      margin: 0;
      color: var(--text-secondary);
      font-size: 0.85rem;
      line-height: 1.6;
    }

    .sidebar-brand-tag {
      display: inline-flex;
      align-items: center;
      margin-top: 7px;
      padding: 4px 8px;
      border-radius: 999px;
      font-size: 0.62rem;
      font-weight: 800;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--accent);
      background: rgba(124, 224, 255, 0.08);
      border: 1px solid rgba(124, 224, 255, 0.12);
      position: relative;
      z-index: 1;
    }

    .sidebar-quick-actions {
      display: grid;
      gap: 8px;
      margin: 0 0 20px;
    }

    .sidebar-quick-actions .btn {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      width: 100%;
      justify-content: center;
      min-height: 42px;
      border-radius: 12px;
    }

    .sidebar-action-icon,
    .sidebar-compact-icon {
      width: 16px;
      height: 16px;
      flex: 0 0 auto;
    }

    .sidebar-action-label,
    .sidebar-compact-label {
      min-width: 0;
    }

    .brand-icon {
      width: 48px;
      height: 48px;
      background: transparent;
      border-radius: 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: var(--shadow-glow);
      overflow: hidden;
      padding: 4px;
    }

    .sidebar-brand-icon {
      width: 58px;
      height: 58px;
      border-radius: 16px;
      padding: 2px;
    }

    .brand-icon img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      display: block;
    }

    .brand-text {
      font-size: 1.36rem;
      font-weight: 800;
      letter-spacing: 0;
      background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    .brand-subtext {
      display: block;
      font-size: 0.68rem;
      letter-spacing: 0.11em;
      text-transform: uppercase;
      color: var(--text-tertiary);
      margin-top: 4px;
      font-weight: 700;
      line-height: 1.3;
    }

    html[data-platform="apple"] .brand-text,
    html[data-platform="macos"] .brand-text {
      font-size: 1.42rem;
      letter-spacing: 0;
    }

    html[data-platform="apple"] .brand-subtext,
    html[data-platform="macos"] .brand-subtext {
      font-size: 0.66rem;
      letter-spacing: 0.14em;
      color: color-mix(in srgb, var(--text-secondary) 78%, var(--accent) 22%);
    }

    .sidebar-section {
      margin-bottom: 22px;
    }

    .sidebar-section.tight {
      margin-bottom: 18px;
    }

    .sidebar-label-wrap {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 0 12px;
      margin-bottom: 8px;
      transition: opacity 0.2s ease, transform 0.2s ease, padding 0.2s ease;
    }

    .sidebar-label {
      font-size: 0.65rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.1em;
      color: var(--text-tertiary);
      padding: 0;
      margin-bottom: 0;
    }

    .sidebar-label-icon {
      width: 14px;
      height: 14px;
      flex-shrink: 0;
      color: var(--accent);
      opacity: 0.85;
    }

    .sidebar-label-icon svg {
      width: 14px;
      height: 14px;
    }

    .sidebar-section-toggle {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 10px 12px;
      border: 1px solid var(--border);
      background:
        linear-gradient(180deg, rgba(255,255,255,0.03), transparent),
        var(--bg-tertiary);
      border-radius: 14px;
      cursor: pointer;
      color: inherit;
      text-align: left;
      transition: transform 0.2s ease, opacity 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    }

    .sidebar-section-toggle:hover {
      border-color: var(--border-hover);
      background:
        linear-gradient(180deg, rgba(255,255,255,0.05), transparent),
        var(--bg-elevated);
      transform: translateY(-1px);
    }

    .sidebar-chevron {
      width: 14px;
      height: 14px;
      flex-shrink: 0;
      color: var(--text-tertiary);
      transition: transform 0.2s ease, color 0.2s ease;
    }

    .sidebar-section-toggle[aria-expanded="false"] .sidebar-chevron {
      transform: rotate(-90deg);
    }

    .sidebar-nav.collapsed {
      max-height: 0;
      opacity: 0;
      transform: translateY(-4px);
      pointer-events: none;
      margin-top: 0;
    }

    .sidebar-nav {
      display: flex;
      flex-direction: column;
      gap: 4px;
      max-height: 560px;
      overflow: hidden;
      opacity: 1;
      transform: translateY(0);
      margin-top: 8px;
      transition: max-height 0.32s ease, opacity 0.22s ease, transform 0.22s ease, margin-top 0.22s ease;
      will-change: max-height, opacity, transform;
    }

    .nav-item {
      display: flex;
      align-items: center;
      gap: 12px;
      min-height: 46px;
      padding: 12px 14px;
      border-radius: 14px;
      color: var(--text-secondary);
      cursor: pointer;
      transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
      border: 1px solid transparent;
      background: transparent;
      width: 100%;
      text-align: left;
      font-size: 0.9rem;
      font-weight: 600;
      position: relative;
      overflow: hidden;
    }

    .nav-item::before {
      content: '';
      position: absolute;
      left: 0;
      top: 50%;
      transform: translateY(-50%);
      width: 3px;
      height: 0;
      background: var(--accent);
      border-radius: 0 2px 2px 0;
      transition: height 0.2s ease;
    }

    .nav-item:hover {
      background:
        linear-gradient(180deg, rgba(255,255,255,0.04), transparent),
        var(--bg-tertiary);
      color: var(--text-primary);
      transform: translateX(2px);
      border-color: var(--border-hover);
    }

    .nav-item.active {
      background:
        linear-gradient(135deg, rgba(124, 92, 255, 0.22), rgba(124, 92, 255, 0.08)),
        var(--accent-muted);
      color: var(--accent-hover);
      border-color: rgba(124, 92, 255, 0.28);
      box-shadow:
        0 10px 30px rgba(124, 92, 255, 0.12),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
      transform: translateX(2px);
    }

    .nav-item.active::before {
      height: 28px;
      box-shadow: 0 0 14px var(--accent-glow);
    }

    .nav-item svg {
      width: 20px;
      height: 20px;
      flex-shrink: 0;
      transition: color 0.2s ease;
      opacity: 0.9;
    }

    .nav-item.active svg {
      color: var(--accent);
    }

    .nav-item:focus-visible,
    .sidebar-section-toggle:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }

    html[data-sidebar-mode="compact"] .sidebar {
      padding: 20px 10px;
    }

    html[data-sidebar-mode="compact"] .sidebar-brand,
    html[data-sidebar-mode="compact"] .sidebar-tip,
    html[data-sidebar-mode="compact"] .sidebar-quick-actions,
    html[data-sidebar-mode="compact"] .sidebar-label-wrap,
    html[data-sidebar-mode="compact"] .sidebar-footer-copy,
    html[data-sidebar-mode="compact"] .theme-switcher {
      padding-left: 0;
      padding-right: 0;
    }

    html[data-sidebar-mode="compact"] .sidebar-brand {
      justify-content: center;
      padding-bottom: 18px;
    }

    html[data-sidebar-mode="compact"] .sidebar-brand > div:last-child,
    html[data-sidebar-mode="compact"] .sidebar-tip,
    html[data-sidebar-mode="compact"] .sidebar-quick-actions,
    html[data-sidebar-mode="compact"] .sidebar-label,
    html[data-sidebar-mode="compact"] .sidebar-footer-copy,
    html[data-sidebar-mode="compact"] .sidebar-label-wrap .sidebar-label {
      display: none;
    }

    html[data-sidebar-mode="compact"] .sidebar-label-wrap {
      justify-content: center;
      margin-bottom: 12px;
    }

    html[data-sidebar-mode="compact"] .sidebar-section-toggle {
      justify-content: center;
      gap: 0;
      padding: 10px 8px;
      min-height: 44px;
    }

    html[data-sidebar-mode="compact"] .sidebar-section-toggle .sidebar-label-wrap {
      display: flex;
      width: auto;
      align-items: center;
      justify-content: center;
      gap: 0;
      padding: 0;
      margin: 0;
    }

    html[data-sidebar-mode="compact"] .sidebar-section-toggle .sidebar-label-icon {
      width: 16px;
      height: 16px;
    }

    html[data-sidebar-mode="compact"] .sidebar-section-toggle,
    html[data-sidebar-mode="compact"] .nav-item,
    html[data-sidebar-mode="compact"] .sidebar-refresh-btn,
    html[data-sidebar-mode="compact"] .sidebar-quick-actions .btn {
      position: relative;
    }

    html[data-sidebar-mode="compact"] .sidebar-section-toggle::after,
    html[data-sidebar-mode="compact"] .nav-item::after,
    html[data-sidebar-mode="compact"] .sidebar-refresh-btn::after,
    html[data-sidebar-mode="compact"] .sidebar-quick-actions .btn::after {
      content: attr(data-sidebar-label);
      position: absolute;
      left: calc(100% + 10px);
      top: 50%;
      transform: translateY(-50%);
      white-space: nowrap;
      padding: 7px 10px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: var(--bg-elevated);
      color: var(--text-primary);
      font-size: 0.78rem;
      font-weight: 700;
      letter-spacing: 0;
      box-shadow: var(--shadow-md);
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.16s ease, transform 0.16s ease;
      z-index: 20;
    }

    html[data-sidebar-mode="compact"] .sidebar-section-toggle:hover::after,
    html[data-sidebar-mode="compact"] .nav-item:hover::after,
    html[data-sidebar-mode="compact"] .sidebar-refresh-btn:hover::after,
    html[data-sidebar-mode="compact"] .sidebar-quick-actions .btn:hover::after,
    html[data-sidebar-mode="compact"] .sidebar-section-toggle:focus-visible::after,
    html[data-sidebar-mode="compact"] .nav-item:focus-visible::after,
    html[data-sidebar-mode="compact"] .sidebar-refresh-btn:focus-visible::after,
    html[data-sidebar-mode="compact"] .sidebar-quick-actions .btn:focus-visible::after {
      opacity: 1;
      transform: translateY(-50%) translateX(2px);
    }

    html[data-sidebar-mode="compact"] .sidebar-section-toggle .sidebar-chevron {
      display: none;
    }

    html[data-sidebar-mode="compact"] .sidebar-nav {
      gap: 6px;
    }

    html[data-sidebar-mode="compact"] .sidebar-live-panel {
      padding: 10px;
      gap: 8px;
    }

    html[data-sidebar-mode="compact"] .sidebar-live-row {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 6px;
      padding: 8px 10px;
      border-radius: 12px;
      border: 1px solid var(--border);
      background:
        linear-gradient(180deg, rgba(255,255,255,0.04), transparent),
        var(--bg-tertiary);
    }

    html[data-sidebar-mode="compact"] .sidebar-live-row > div {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      min-width: 0;
    }

    html[data-sidebar-mode="compact"] .sidebar-refresh-btn {
      width: 100%;
      justify-content: center;
      padding-inline: 10px;
      min-height: 36px;
      white-space: nowrap;
    }

    html[data-sidebar-mode="compact"] .sidebar-refresh-btn span {
      display: inline;
    }

    html[data-sidebar-mode="compact"] .sidebar-refresh-btn svg {
      width: 15px;
      height: 15px;
    }

    html[data-sidebar-mode="compact"] #sidebar-compact-btn {
      width: 100%;
      justify-content: center;
      gap: 0;
      min-height: 42px;
      padding-inline: 0;
    }

    html[data-sidebar-mode="compact"] #sidebar-compact-btn .sidebar-compact-label {
      display: none;
    }

    html[data-sidebar-mode="compact"] .nav-item {
      justify-content: center;
      padding: 11px;
      gap: 0;
      min-height: 44px;
      border-radius: 16px;
    }

    html[data-sidebar-mode="compact"] .nav-item span {
      position: absolute;
      opacity: 0;
      pointer-events: none;
      width: 1px;
      height: 1px;
      overflow: hidden;
    }

    html[data-sidebar-mode="compact"] .nav-item::before {
      left: 50%;
      top: 8px;
      transform: translateX(-50%);
      width: 20px;
      height: 3px;
      border-radius: 2px;
    }

    html[data-sidebar-mode="compact"] .nav-item.active {
      transform: translateX(0) scale(1.01);
    }

    html[data-sidebar-mode="compact"] .sidebar-footer {
      text-align: left;
      padding-top: 14px;
    }

    html[data-sidebar-mode="compact"] .theme-switcher {
      justify-content: center;
    }

    html[data-sidebar-mode="compact"] .theme-btn {
      flex: none;
      width: 34px;
    }

    html[data-sidebar-mode="compact"] .sidebar-live-label {
      margin-bottom: 0;
      font-size: 0.6rem;
    }

    html[data-sidebar-mode="compact"] .sidebar-live-value {
      font-size: 0.8rem;
      line-height: 1.2;
      text-align: right;
      min-width: 0;
    }

    html[data-sidebar-mode="compact"] .sidebar-live-pill {
      width: 100%;
      justify-content: center;
    }

    .sidebar-footer {
      margin-top: auto;
      padding-top: 18px;
      border-top: 1px solid var(--border);
      background: linear-gradient(180deg, transparent, rgba(255,255,255,0.02));
    }

    .sidebar-footer-copy {
      margin: 0 0 12px;
      color: var(--text-tertiary);
      font-size: 0.82rem;
      line-height: 1.55;
      padding: 0 12px;
    }

    .sidebar-live-panel {
      display: grid;
      gap: 10px;
      padding: 12px;
      margin: 0 0 12px;
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      background:
        linear-gradient(180deg, rgba(255,255,255,0.04), transparent),
        var(--bg-secondary);
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 8px 24px rgba(0,0,0,0.08);
    }

    .sidebar-live-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }

    .sidebar-live-label {
      color: var(--text-tertiary);
      font-size: 0.68rem;
      text-transform: uppercase;
      letter-spacing: 0.12em;
      margin-bottom: 4px;
    }

    .sidebar-live-value {
      color: var(--text-primary);
      font-size: 0.9rem;
      font-weight: 700;
    }

    .sidebar-live-pill {
      white-space: nowrap;
    }

    .sidebar-refresh-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 8px 11px;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: var(--bg-tertiary);
      color: var(--text-primary);
      font-size: 0.82rem;
      font-weight: 700;
      cursor: pointer;
      transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    }

    .sidebar-refresh-btn:hover {
      background: var(--bg-elevated);
      border-color: var(--border-hover);
      transform: translateY(-1px);
    }

    .sidebar-refresh-btn.has-update {
      border-color: var(--accent);
      box-shadow: 0 0 0 1px var(--accent-muted) inset;
    }

    .sidebar-refresh-btn svg {
      width: 15px;
      height: 15px;
    }

    .sidebar-refresh-btn:focus-visible,
    .sidebar-quick-actions .btn:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }

    .install-btn {
      width: 100%;
      margin-top: 12px;
    }

    /* Theme Switcher */
    .theme-switcher {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px;
      background: var(--bg-tertiary);
      border-radius: var(--radius-md);
      margin-bottom: 12px;
    }

    .theme-btn {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 8px;
      border: none;
      background: transparent;
      border-radius: var(--radius-sm);
      color: var(--text-tertiary);
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .theme-btn:hover {
      color: var(--text-secondary);
    }

    .theme-btn.active {
      background: var(--bg-secondary);
      color: var(--accent);
      box-shadow: var(--shadow-sm);
    }

    .theme-btn svg {
      width: 18px;
      height: 18px;
    }

    /* Focused sidebar navigation */
    .sidebar {
      padding: 22px 16px 18px;
      background:
        radial-gradient(circle at 50% 0%, rgba(124, 92, 255, 0.09), transparent 220px),
        var(--bg-secondary);
    }

    .sidebar-brand {
      gap: 12px;
      padding: 0 8px 22px;
      margin-bottom: 14px;
      border-bottom: 1px solid var(--border);
    }

    .sidebar-brand::after,
    .sidebar-tip,
    .sidebar-quick-actions,
    .sidebar-section-toggle,
    .sidebar-help-section,
    .sidebar-account-section .nav-item[data-page="usage"],
    .sidebar-footer-copy,
    .sidebar-footer > .sidebar-label-wrap,
    .sidebar-footer > .theme-switcher,
    .sidebar-live-row:nth-child(n + 2) {
      display: none;
    }

    .sidebar-brand-icon {
      width: 46px;
      height: 46px;
      border-radius: 14px;
    }

    .sidebar .brand-text {
      font-size: 1.18rem;
    }

    .sidebar .brand-subtext {
      margin-top: 2px;
      font-size: 0.62rem;
      letter-spacing: 0.08em;
    }

    .sidebar-main-section,
    .sidebar-account-section {
      margin: 0;
    }

    .sidebar-account-section {
      margin-top: 14px;
      padding-top: 14px;
      border-top: 1px solid var(--border);
    }

    .sidebar-main-section::before,
    .sidebar-account-section::before {
      display: block;
      margin: 0 12px 8px;
      color: var(--text-tertiary);
      font-size: 0.62rem;
      font-weight: 800;
      letter-spacing: 0.13em;
      text-transform: uppercase;
    }

    .sidebar-main-section::before { content: "Workspace"; }
    .sidebar-account-section::before { content: "Account"; }

    .sidebar .sidebar-nav,
    .sidebar .sidebar-nav.collapsed {
      display: flex;
      max-height: none;
      margin-top: 0;
      gap: 5px;
      overflow: visible;
      opacity: 1;
      transform: none;
      pointer-events: auto;
    }

    .sidebar .nav-item {
      min-height: 48px;
      padding: 12px 13px;
      border-radius: 13px;
      font-size: 0.91rem;
      font-weight: 650;
    }

    .sidebar .nav-item:hover {
      transform: none;
    }

    .sidebar .nav-item.active {
      transform: none;
      color: var(--text-primary);
      background: linear-gradient(135deg, rgba(124, 92, 255, 0.2), rgba(124, 92, 255, 0.08));
      border-color: rgba(124, 92, 255, 0.24);
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 10px 28px rgba(0,0,0,0.14);
    }

    .sidebar .nav-item.active::before {
      left: 5px;
      height: 22px;
      border-radius: 999px;
    }

    .sidebar-footer {
      padding-top: 14px;
      background: none;
    }

    .sidebar-plan-card {
      display: grid;
      grid-template-columns: 38px 1fr auto;
      align-items: center;
      gap: 10px;
      width: 100%;
      padding: 11px;
      border: 1px solid var(--border);
      border-radius: 14px;
      background: var(--bg-tertiary);
      color: var(--text-primary);
      text-align: left;
      cursor: pointer;
      transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
    }

    .sidebar-plan-card:hover {
      border-color: var(--border-hover);
      background: var(--bg-elevated);
      transform: translateY(-1px);
    }

    .sidebar-plan-mark {
      width: 38px;
      height: 38px;
      display: grid;
      place-items: center;
      border-radius: 11px;
      background: var(--accent-muted);
      color: var(--accent-hover);
      font-weight: 900;
    }

    .sidebar-plan-copy { min-width: 0; }
    .sidebar-plan-copy small,
    .sidebar-plan-copy strong { display: block; }
    .sidebar-plan-copy small { color: var(--text-tertiary); font-size: 0.66rem; }
    .sidebar-plan-copy strong { margin-top: 1px; font-size: 0.84rem; }
    .sidebar-plan-arrow { color: var(--text-tertiary); font-size: 1.25rem; }

    .sidebar-live-panel {
      margin: 9px 0 0;
      padding: 9px 11px;
      border-radius: 13px;
      box-shadow: none;
    }

    .sidebar-live-row:first-child {
      min-height: 34px;
    }

    .sidebar-live-row:first-child > div {
      display: flex;
      align-items: center;
      gap: 7px;
    }

    .sidebar-live-row:first-child .sidebar-live-label {
      margin: 0;
      font-size: 0.62rem;
    }

    .sidebar-live-row:first-child .sidebar-live-value {
      font-size: 0.78rem;
    }

    html[data-sidebar-mode="compact"] .sidebar-plan-card,
    html[data-sidebar-mode="compact"] .sidebar-main-section::before,
    html[data-sidebar-mode="compact"] .sidebar-account-section::before,
    html[data-sidebar-mode="compact"] .sidebar-live-label,
    html[data-sidebar-mode="compact"] .sidebar-live-value {
      display: none;
    }

    html[data-sidebar-mode="compact"] .sidebar-account-section {
      margin-top: 10px;
      padding-top: 10px;
    }

    html[data-sidebar-mode="compact"] .sidebar-live-panel {
      padding: 6px;
    }

    html[data-sidebar-mode="compact"] .sidebar-live-row:first-child {
      justify-content: center;
      padding: 0;
      border: 0;
      background: none;
    }

    .theme-pack-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 12px;
      margin-top: 12px;
    }

    .premium-theme-card {
      display: flex;
      flex-direction: column;
      gap: 8px;
      padding: 14px;
      border-radius: var(--radius-md);
      border: 1px solid var(--border);
      background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent), var(--bg-tertiary);
      color: var(--text-primary);
      text-align: left;
      transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
      cursor: pointer;
    }

    .premium-theme-card:hover {
      transform: translateY(-1px);
      border-color: var(--border-hover);
      box-shadow: var(--shadow-sm);
    }

    .premium-theme-card.active {
      border-color: var(--accent);
      box-shadow: var(--shadow-glow);
    }

    .premium-theme-card.locked {
      opacity: 0.58;
      cursor: not-allowed;
    }

    .premium-theme-title {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      font-size: 0.92rem;
      font-weight: 700;
    }

    .premium-theme-subtitle {
      font-size: 0.78rem;
      color: var(--text-secondary);
    }

    .premium-theme-chip,
    .plan-chip {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 4px 8px;
      border-radius: 999px;
      font-size: 0.67rem;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      width: fit-content;
    }

    .premium-theme-chip {
      background: var(--accent-muted);
      color: var(--accent);
    }

    .plan-chip.plus,
    .plan-chip.pro,
    .plan-chip.max {
      background: var(--bg-secondary);
      color: var(--text-primary);
      border: 1px solid var(--border);
    }

    .plan-chip.plus {
      box-shadow: inset 0 0 0 1px rgba(88, 153, 255, 0.18);
    }

    .plan-chip.pro {
      box-shadow: inset 0 0 0 1px rgba(157, 120, 255, 0.18);
    }

    .plan-chip.max {
      box-shadow: inset 0 0 0 1px rgba(255, 184, 77, 0.18);
    }

    .feature-chip-row {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 10px;
    }

    .feature-chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 10px;
      border-radius: 999px;
      background: var(--bg-tertiary);
      color: var(--text-secondary);
      font-size: 0.72rem;
      border: 1px solid var(--border);
    }

    .feature-chip strong {
      color: var(--text-primary);
    }

    html[data-accent="plus"] {
      --accent: #4f8cff;
      --accent-hover: #6a9dff;
      --accent-muted: rgba(79, 140, 255, 0.14);
      --accent-glow: rgba(79, 140, 255, 0.24);
    }

    html[data-accent="pro"] {
      --accent: #a26dff;
      --accent-hover: #b88aff;
      --accent-muted: rgba(162, 109, 255, 0.14);
      --accent-glow: rgba(162, 109, 255, 0.25);
    }

    html[data-accent="max"] {
      --accent: #f7b14d;
      --accent-hover: #ffc76f;
      --accent-muted: rgba(247, 177, 77, 0.16);
      --accent-glow: rgba(247, 177, 77, 0.24);
    }

    html[data-plan-ui="plus"] {
      --glass-glow-opacity: 0.32;
    }

    html[data-plan-ui="pro"] {
      --glass-glow-opacity: 0.38;
    }

    html[data-plan-ui="max"] {
      --glass-glow-opacity: 0.44;
    }

    html[data-plan-ui="plus"] .sidebar,
    html[data-plan-ui="plus"] .topbar,
    html[data-plan-ui="plus"] .page-header,
    html[data-plan-ui="plus"] .card,
    html[data-plan-ui="plus"] .status-card,
    html[data-plan-ui="plus"] .form-section,
    html[data-plan-ui="plus"] .preview-panel,
    html[data-plan-ui="plus"] .file-manager,
    html[data-plan-ui="plus"] .store-item,
    html[data-plan-ui="plus"] .profile-header,
    html[data-plan-ui="plus"] .modal,
    html[data-plan-ui="plus"] .offline-banner,
    html[data-plan-ui="plus"] .offline-banner-panel,
    html[data-plan-ui="plus"] .doc-card,
    html[data-plan-ui="plus"] .consent-panel,
    html[data-plan-ui="plus"] .theme-switcher,
    html[data-plan-ui="plus"] .bottom-nav,
    html[data-plan-ui="plus"] .vault-command-strip {
      border-color: rgba(79, 140, 255, 0.18);
      box-shadow: 0 16px 36px rgba(35, 77, 163, 0.14);
    }

    html[data-plan-ui="plus"] .card::before,
    html[data-plan-ui="plus"] .status-card::before {
      background: linear-gradient(180deg, rgba(79, 140, 255, 0.16), transparent);
    }

    html[data-plan-ui="plus"] .btn-primary,
    html[data-plan-ui="plus"] .fm-btn-primary,
    html[data-plan-ui="plus"] .modal-btn-primary,
    html[data-plan-ui="plus"] .preview-btn.primary,
    html[data-plan-ui="plus"] .landing-primary {
      background: linear-gradient(180deg, rgba(86, 149, 255, 0.96), rgba(67, 122, 224, 0.92));
      color: #f7fbff;
      box-shadow: 0 16px 30px rgba(79, 140, 255, 0.2);
    }

    html[data-plan-ui="plus"] .status-pill.plan-chip.plus,
    html[data-plan-ui="plus"] .premium-theme-chip,
    html[data-plan-ui="plus"] .plan-chip.plus {
      background: rgba(79, 140, 255, 0.14);
      color: #87b0ff;
      border-color: rgba(79, 140, 255, 0.24);
    }

    html[data-plan-ui="pro"] .sidebar,
    html[data-plan-ui="pro"] .topbar,
    html[data-plan-ui="pro"] .page-header,
    html[data-plan-ui="pro"] .card,
    html[data-plan-ui="pro"] .status-card,
    html[data-plan-ui="pro"] .form-section,
    html[data-plan-ui="pro"] .preview-panel,
    html[data-plan-ui="pro"] .file-manager,
    html[data-plan-ui="pro"] .store-item,
    html[data-plan-ui="pro"] .profile-header,
    html[data-plan-ui="pro"] .modal,
    html[data-plan-ui="pro"] .offline-banner,
    html[data-plan-ui="pro"] .offline-banner-panel,
    html[data-plan-ui="pro"] .doc-card,
    html[data-plan-ui="pro"] .consent-panel,
    html[data-plan-ui="pro"] .theme-switcher,
    html[data-plan-ui="pro"] .bottom-nav,
    html[data-plan-ui="pro"] .vault-command-strip {
      border-color: rgba(162, 109, 255, 0.2);
      box-shadow: 0 18px 42px rgba(86, 52, 164, 0.16);
    }

    html[data-plan-ui="pro"] .card::before,
    html[data-plan-ui="pro"] .status-card::before {
      background: linear-gradient(180deg, rgba(162, 109, 255, 0.18), transparent);
    }

    html[data-plan-ui="pro"] .btn-primary,
    html[data-plan-ui="pro"] .fm-btn-primary,
    html[data-plan-ui="pro"] .modal-btn-primary,
    html[data-plan-ui="pro"] .preview-btn.primary,
    html[data-plan-ui="pro"] .landing-primary {
      background: linear-gradient(180deg, rgba(180, 129, 255, 0.98), rgba(130, 86, 232, 0.94));
      color: #fbf8ff;
      box-shadow: 0 18px 34px rgba(162, 109, 255, 0.24);
    }

    html[data-plan-ui="pro"] .status-pill.plan-chip.pro,
    html[data-plan-ui="pro"] .premium-theme-chip,
    html[data-plan-ui="pro"] .plan-chip.pro {
      background: rgba(162, 109, 255, 0.16);
      color: #c7a6ff;
      border-color: rgba(162, 109, 255, 0.26);
    }

    html[data-plan-ui="max"] .sidebar,
    html[data-plan-ui="max"] .topbar,
    html[data-plan-ui="max"] .page-header,
    html[data-plan-ui="max"] .card,
    html[data-plan-ui="max"] .status-card,
    html[data-plan-ui="max"] .form-section,
    html[data-plan-ui="max"] .preview-panel,
    html[data-plan-ui="max"] .file-manager,
    html[data-plan-ui="max"] .store-item,
    html[data-plan-ui="max"] .profile-header,
    html[data-plan-ui="max"] .modal,
    html[data-plan-ui="max"] .offline-banner,
    html[data-plan-ui="max"] .offline-banner-panel,
    html[data-plan-ui="max"] .doc-card,
    html[data-plan-ui="max"] .consent-panel,
    html[data-plan-ui="max"] .theme-switcher,
    html[data-plan-ui="max"] .bottom-nav,
    html[data-plan-ui="max"] .vault-command-strip {
      border-color: rgba(247, 177, 77, 0.22);
      box-shadow: 0 20px 48px rgba(144, 94, 26, 0.18);
    }

    html[data-plan-ui="max"] .card::before,
    html[data-plan-ui="max"] .status-card::before {
      background: linear-gradient(180deg, rgba(247, 177, 77, 0.2), transparent);
    }

    html[data-plan-ui="max"] .btn-primary,
    html[data-plan-ui="max"] .fm-btn-primary,
    html[data-plan-ui="max"] .modal-btn-primary,
    html[data-plan-ui="max"] .preview-btn.primary,
    html[data-plan-ui="max"] .landing-primary {
      background: linear-gradient(180deg, rgba(255, 202, 119, 0.98), rgba(234, 156, 53, 0.95));
      color: #251600;
      box-shadow: 0 20px 38px rgba(247, 177, 77, 0.26);
    }

    html[data-plan-ui="max"] .status-pill.plan-chip.max,
    html[data-plan-ui="max"] .premium-theme-chip,
    html[data-plan-ui="max"] .plan-chip.max {
      background: rgba(247, 177, 77, 0.18);
      color: #ffd58e;
      border-color: rgba(247, 177, 77, 0.28);
    }

    /* ----------------------------------------------
       TOP BAR (MOBILE)
    ---------------------------------------------- */
    .topbar {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 100;
      background: var(--bg-secondary);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border-bottom: 1px solid var(--border);
      padding: 0 16px;
      padding-top: env(safe-area-inset-top, 0px);
      height: calc(56px + env(safe-area-inset-top, 0px));
      align-items: flex-end;
      justify-content: space-between;
      padding-bottom: 12px;
      gap: 12px;
    }

    .topbar-brand {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
    }

    .topbar-brand .brand-icon {
      width: 32px;
      height: 32px;
    }

    .topbar-brand .brand-text {
      font-size: 1.1rem;
      white-space: nowrap;
    }

    .topbar-brand .brand-subtext {
      font-size: 0.6rem;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--text-tertiary);
      margin-top: 2px;
      display: block;
      max-width: 42vw;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .topbar-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-shrink: 0;
    }

    .topbar-status {
      padding: 4px 8px;
      min-height: 28px;
      display: inline-flex;
      align-items: center;
    }

    .topbar-btn {
      width: 36px;
      height: 36px;
      display: flex;
      align-items: center;
      justify-content: center;
      border: none;
      background: var(--bg-tertiary);
      border-radius: var(--radius-sm);
      color: var(--text-secondary);
      cursor: pointer;
    }

    .topbar-btn.has-update {
      color: var(--accent);
      background: rgba(52, 211, 153, 0.14);
      box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.18);
    }

    .topbar-btn svg {
      width: 18px;
      height: 18px;
    }

    /* Keep keyboard navigation visible across every surface, including icon-only controls. */
    button:focus-visible,
    a:focus-visible,
    input:focus-visible,
    select:focus-visible,
    textarea:focus-visible,
    [role="button"]:focus-visible {
      outline: 3px solid color-mix(in srgb, var(--accent) 72%, white 28%);
      outline-offset: 3px;
    }

    button,
    a,
    [role="button"] {
      -webkit-tap-highlight-color: transparent;
      touch-action: manipulation;
    }

    /* ----------------------------------------------
       MAIN CONTENT
    ---------------------------------------------- */
    .main {
      flex: 1;
      margin-left: var(--sidebar-width);
      padding: 32px;
      min-width: 0;
      min-height: 100vh;
      overflow-x: hidden;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }

    .page {
      display: none;
      animation: pageIn 0.42s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .page.active {
      display: block;
      animation-fill-mode: both;
    }

    @keyframes pageIn {
      from { 
        opacity: 0; 
        transform: translateY(12px); 
      }
      to { 
        opacity: 1; 
        transform: translateY(0); 
      }
    }

    /* ----------------------------------------------
       PAGE HEADER
    ---------------------------------------------- */
    .page-header {
      margin-bottom: 32px;
    }

    .page-title {
      font-size: 2rem;
      font-weight: 700;
      letter-spacing: 0;
      line-height: 1.2;
      margin-bottom: 6px;
    }

    .page-description {
      color: var(--text-secondary);
      font-size: 0.95rem;
    }

    /* ----------------------------------------------
       CARDS
    ---------------------------------------------- */
    .cards-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: var(--ui-card-gap);
    }

    .card {
      background: var(--bg-secondary);
      border: 1px solid var(--border);
      border-radius: var(--ui-card-radius);
      padding: var(--ui-card-padding);
      min-height: var(--ui-card-min-height);
      transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background 0.22s ease;
      position: relative;
      overflow: hidden;
    }

    .card::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 3px;
      background: linear-gradient(90deg, var(--accent), var(--accent-hover));
      opacity: 0;
      transition: opacity 0.2s ease;
    }

    .card:hover {
      border-color: var(--border-hover);
      box-shadow: var(--shadow-md);
      transform: translateY(-2px);
    }

    .card:hover::before {
      opacity: 1;
    }

    .card-icon {
      width: 44px;
      height: 44px;
      border-radius: var(--radius-md);
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 16px;
    }

    .card-icon svg {
      width: 22px;
      height: 22px;
    }

    .card-icon.purple {
      background: var(--accent-muted);
      color: var(--accent);
    }

    .card-icon.green {
      background: var(--success-muted);
      color: var(--success);
    }

    .card-icon.yellow {
      background: var(--warning-muted);
      color: var(--warning);
    }

    .card-icon.red {
      background: var(--danger-muted);
      color: var(--danger);
    }

    .card-label {
      font-size: 0.75rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--text-tertiary);
      margin-bottom: 8px;
    }

    .card-value {
      font-size: 2rem;
      font-weight: 700;
      letter-spacing: 0;
      line-height: 1;
      margin-bottom: 4px;
    }

    .card-subtitle {
      font-size: 0.85rem;
      color: var(--text-secondary);
    }

    .card-badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      font-size: 0.7rem;
      font-weight: 600;
      padding: 4px 10px;
      border-radius: 100px;
      margin-top: 12px;
    }

    .badge-green {
      background: var(--success-muted);
      color: var(--success);
    }

    .badge-yellow {
      background: var(--warning-muted);
      color: var(--warning);
    }

    .badge-red {
      background: var(--danger-muted);
      color: var(--danger);
    }

    .card-body {
      display: flex;
      flex-direction: column;
      gap: 10px;
      min-height: 100px;
    }

    .home-activity-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
      min-height: 88px;
    }

    .home-activity-item {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      padding: 10px 12px;
      border-radius: var(--radius-md);
      background: var(--bg-tertiary);
      border: 1px solid var(--border);
    }

    .home-activity-main {
      min-width: 0;
    }

    .home-activity-name {
      font-size: 0.9rem;
      font-weight: 600;
      color: var(--text-primary);
      margin-bottom: 2px;
      word-break: break-word;
    }

    .home-activity-meta {
      font-size: 0.75rem;
      color: var(--text-tertiary);
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
    }

    .home-activity-time {
      font-size: 0.72rem;
      color: var(--text-tertiary);
      white-space: nowrap;
    }

    .home-activity-empty {
      color: var(--text-tertiary);
      font-size: 0.85rem;
      line-height: 1.6;
      padding: 8px 2px;
    }

    .card-subgrid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }

    .card-chip {
      padding: 8px 10px;
      border-radius: 999px;
      background: var(--bg-tertiary);
      border: 1px solid var(--border);
      color: var(--text-secondary);
      font-size: 0.72rem;
      font-weight: 600;
    }

    .card-chip.has-update {
      background: rgba(245, 158, 11, 0.12);
      border-color: rgba(245, 158, 11, 0.34);
      color: #f59e0b;
    }

    .release-log {
      display: grid;
      gap: 10px;
      margin-top: 14px;
    }

    .release-log-item {
      display: grid;
      gap: 8px;
      padding: 14px;
      border-radius: 18px;
      border: 1px solid var(--border);
      background: var(--bg-secondary);
    }

    .release-log-top {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      gap: 10px;
      align-items: center;
    }

    .release-log-title {
      font-size: 0.96rem;
      font-weight: 800;
      color: var(--text-primary);
    }

    .release-log-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .release-log-notes {
      margin: 0;
      padding-left: 18px;
      color: var(--text-secondary);
      font-size: 0.88rem;
      line-height: 1.6;
    }

    .command-palette-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(2, 8, 16, 0.56);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      z-index: 320;
      align-items: flex-start;
      justify-content: center;
      padding: 10vh 18px 18px;
    }

    .command-palette-overlay.active {
      display: flex;
    }

    .command-palette {
      width: min(100%, 720px);
      background: var(--bg-secondary);
      border: 1px solid var(--border);
      border-radius: 28px;
      box-shadow: var(--shadow-lg);
      overflow: hidden;
    }

    .command-palette-header {
      padding: 18px 18px 14px;
      border-bottom: 1px solid var(--border);
    }

    .command-palette-title {
      font-size: 0.72rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      font-weight: 700;
      color: var(--text-tertiary);
      margin-bottom: 10px;
    }

    .command-palette-input {
      width: 100%;
      border: 1px solid var(--border);
      background: var(--bg-primary);
      border-radius: 16px;
      color: var(--text-primary);
      padding: 14px 16px;
      font-size: 1rem;
      outline: none;
    }

    .command-palette-input:focus {
      border-color: rgba(79, 192, 255, 0.45);
      box-shadow: 0 0 0 4px rgba(79, 192, 255, 0.12);
    }

    .command-palette-list {
      max-height: min(52vh, 520px);
      overflow-y: auto;
      padding: 10px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .command-palette-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      width: 100%;
      border: 1px solid transparent;
      background: transparent;
      color: var(--text-primary);
      border-radius: 18px;
      padding: 12px 14px;
      cursor: pointer;
      text-align: left;
      transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
    }

    .command-palette-item:hover,
    .command-palette-item:focus-visible {
      background: var(--bg-tertiary);
      border-color: var(--border);
      transform: translateY(-1px);
    }

    .command-palette-item-main {
      min-width: 0;
    }

    .command-palette-item-title {
      display: flex;
      align-items: center;
      gap: 10px;
      font-weight: 600;
      margin-bottom: 3px;
    }

    .command-palette-item-desc {
      color: var(--text-tertiary);
      font-size: 0.84rem;
      line-height: 1.5;
    }

    .command-palette-shortcut {
      flex-shrink: 0;
      font-size: 0.72rem;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--accent);
      background: var(--accent-muted);
      border-radius: 999px;
      padding: 6px 10px;
    }

    .command-palette-empty {
      color: var(--text-tertiary);
      font-size: 0.9rem;
      padding: 12px 14px 16px;
    }

    html[data-platform="apple"] .command-palette {
      background: linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.1));
      border-radius: 30px;
      backdrop-filter: blur(22px) saturate(150%);
      -webkit-backdrop-filter: blur(22px) saturate(150%);
    }

    html[data-platform="apple"] .command-palette-input {
      background: rgba(255,255,255,0.18);
      border-radius: 18px;
    }

    html[data-platform="apple"] .command-palette-item {
      background: rgba(255,255,255,0.08);
    }

    html[data-platform="apple"] .command-palette-item:hover,
    html[data-platform="apple"] .command-palette-item:focus-visible {
      background: rgba(255,255,255,0.16);
    }

    .progress-wrap {
      margin-top: 12px;
    }

    .progress-label {
      display: flex;
      justify-content: space-between;
      font-size: 0.75rem;
      color: var(--text-secondary);
      margin-bottom: 6px;
    }

    .progress-bar {
      width: 100%;
      height: 6px;
      background: var(--bg-tertiary);
      border-radius: 3px;
      overflow: hidden;
    }

    .progress-fill {
      height: 100%;
      background: linear-gradient(90deg, var(--accent), var(--accent-hover));
      transition: width 0.3s ease;
    }

    .progress-fill.danger {
      background: linear-gradient(90deg, var(--danger), #ff6b6b);
    }

    .progress-fill.warn {
      background: linear-gradient(90deg, var(--warning), #fcd34d);
    }

    /* ----------------------------------------------

/* components.css */
/* Shared component rules have been distributed by original cascade order to avoid visual regressions. */

/* storage.css */
/* Storage, file manager, preview panel, and storage-grid rules. */

    /* File manager */
    .file-manager {
      background: var(--bg-secondary);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      overflow: hidden;
      min-width: 0;
      display: flex;
      flex-direction: column;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: thin;
    }

    .fm-toolbar {
      display: grid;
      grid-template-columns: 1fr;
      align-items: start;
      padding: 16px 20px;
      border-bottom: 1px solid var(--border);
      gap: 12px;
      min-width: 0;
    }

    .fm-controls {
      display: grid;
      grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(118px, 0.45fr));
      align-items: center;
      gap: 10px;
      min-width: 0;
    }

    .fm-bulk {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: flex-start;
      min-width: 0;
      padding: 10px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: var(--bg-tertiary);
    }

    .fm-bulk .fm-btn {
      display: none;
    }

    .fm-bulk.has-selection .fm-btn {
      display: inline-flex;
    }

    .fm-checkbox {
      width: 16px;
      height: 16px;
      accent-color: var(--accent);
    }

    .fm-bulk-count {
      font-size: 0.8rem;
      color: var(--text-secondary);
      min-width: 80px;
      font-weight: 700;
    }

    .fm-input,
    .fm-select {
      background: var(--bg-primary);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      color: var(--text-primary);
      padding: 8px 10px;
      font-size: 0.85rem;
      min-width: 140px;
      width: 100%;
    }

    .fm-input:focus,
    .fm-select:focus {
      outline: none;
      border-color: var(--accent);
      box-shadow: 0 0 0 3px var(--accent-muted);
    }

    .fm-breadcrumb {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 0.9rem;
      color: var(--text-secondary);
      flex-wrap: wrap;
      min-width: 0;
      padding-top: 8px;
    }

    .fm-breadcrumb-item {
      cursor: pointer;
      transition: color 0.2s ease;
    }

    .fm-breadcrumb-item:hover {
      color: var(--accent);
    }

    .fm-breadcrumb-sep {
      color: var(--text-tertiary);
    }

    .fm-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: flex-end;
      width: 100%;
    }

    .fm-toolbar > .fm-filter-chips,
    .fm-toolbar > .fm-bulk,
    .fm-toolbar > .fm-selection-bar,
    .fm-toolbar > .fm-pinned,
    .fm-toolbar > .fm-actions {
      grid-column: 1 / -1;
    }

    .fm-recent {
      display: flex;
      flex-direction: column;
      gap: 10px;
      padding: 14px 16px;
      border-bottom: 1px solid var(--border);
      background: var(--bg-primary);
    }

    .fm-recent-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
    }

    .fm-recent-title {
      font-size: 0.9rem;
      font-weight: 700;
      color: var(--text-primary);
    }

    .fm-recent-subtitle {
      font-size: 0.78rem;
      color: var(--text-tertiary);
    }

    .fm-recent-list {
      display: grid;
      gap: 8px;
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fm-recent-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 10px 12px;
      border-radius: var(--radius-md);
      border: 1px solid var(--border);
      background: var(--bg-secondary);
      min-width: 0;
    }

    .fm-recent-main {
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 3px;
      flex: 1 1 auto;
    }

    .fm-recent-name {
      font-size: 0.84rem;
      font-weight: 600;
      color: var(--text-primary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .fm-recent-meta {
      font-size: 0.72rem;
      color: var(--text-tertiary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .fm-recent-item button {
      border: none;
      background: var(--accent);
      color: white;
      border-radius: 999px;
      padding: 6px 10px;
      font-size: 0.76rem;
      cursor: pointer;
      flex: 0 0 auto;
    }

    .fm-recent-item button:hover {
      background: var(--accent-hover);
    }

    .fm-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 8px 16px;
      border: none;
      background: var(--bg-tertiary);
      color: var(--text-primary);
      border-radius: var(--radius-md);
      cursor: pointer;
      font-size: 0.85rem;
      font-weight: 500;
      transition: all 0.2s ease;
      min-height: 40px;
      min-width: 0;
      white-space: nowrap;
    }

    .fm-btn:hover {
      background: var(--bg-elevated);
      box-shadow: var(--shadow-sm);
    }

    .fm-btn-primary {
      background: var(--accent);
      color: white;
    }

    .fm-btn-primary:hover {
      background: var(--accent-hover);
    }

    .fm-btn svg {
      width: 16px;
      height: 16px;
    }

    .fm-list {
      max-height: 600px;
      overflow-y: auto;
      overflow-x: auto;
      position: relative;
      min-height: 360px;
      background: var(--bg-secondary);
      min-width: 720px;
      -webkit-overflow-scrolling: touch;
    }

    .fm-skeleton {
      display: grid;
      gap: 10px;
      padding: 16px;
    }

    .fm-skeleton-item {
      height: 56px;
      border-radius: var(--radius-md);
      background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.08), rgba(255,255,255,0.04));
      background-size: 200% 100%;
      animation: skeletonMove 1.4s ease infinite;
      border: 1px solid var(--border);
    }

    @keyframes skeletonMove {
      0% { background-position: 0% 50%; }
      100% { background-position: 100% 50%; }
    }

    .fm-virtual-spacer {
      width: 100%;
    }

    .fm-virtual-list {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
    }

    .fm-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px 20px;
      border-bottom: 1px solid var(--border);
      transition: background 0.2s ease;
      cursor: pointer;
      min-width: 680px;
      contain: layout paint;
    }

    .fm-item:hover {
      background: var(--bg-tertiary);
    }

    .fm-item:last-child {
      border-bottom: none;
    }

    .fm-item-icon {
      width: 32px;
      height: 32px;
      border-radius: var(--radius-sm);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      font-size: 0.85rem;
      font-weight: 600;
    }

    .fm-item-icon.folder {
      background: var(--accent-muted);
      color: var(--accent);
    }

    .fm-item-icon.doc {
      background: rgba(100, 150, 200, 0.12);
      color: #6496c8;
    }

    .fm-item-icon.image {
      background: rgba(236, 126, 105, 0.12);
      color: #ec7e69;
    }

    .fm-item-icon.video {
      background: rgba(245, 115, 80, 0.12);
      color: #f57350;
    }

    .fm-item-icon.audio {
      background: rgba(168, 102, 224, 0.12);
      color: #a866e0;
    }

    .fm-item-icon.archive {
      background: rgba(100, 180, 100, 0.12);
      color: #64b464;
    }

    .fm-item-icon.code {
      background: rgba(200, 150, 100, 0.12);
      color: #c89664;
    }

    .fm-item-info {
      flex: 1;
      min-width: 0;
    }

    .fm-item-name {
      font-weight: 500;
      font-size: 0.9rem;
      color: var(--text-primary);
      margin-bottom: 4px;
      word-break: break-word;
    }

    .fm-item-meta {
      display: flex;
      gap: 12px;
      font-size: 0.75rem;
      color: var(--text-tertiary);
      flex-wrap: wrap;
      min-width: 0;
    }

    .fm-badge {
      font-size: 0.7rem;
      font-weight: 600;
      padding: 4px 8px;
      border-radius: 999px;
      background: var(--bg-tertiary);
      color: var(--text-secondary);
      border: 1px solid var(--border);
    }

    .fm-badge.clean {
      background: var(--success-muted);
      color: var(--success);
      border-color: transparent;
    }

    .fm-badge.infected {
      background: var(--danger-muted);
      color: var(--danger);
      border-color: transparent;
    }

    .fm-badge.unknown {
      background: var(--warning-muted);
      color: var(--warning);
      border-color: transparent;
    }

    .fm-badge.suspicious {
      background: rgba(251, 191, 36, 0.18);
      color: var(--warning);
      border-color: transparent;
    }

    .fm-badge.quarantined {
      background: rgba(248, 113, 113, 0.18);
      color: var(--danger);
      border-color: transparent;
    }

    .fm-item-actions {
      display: flex;
      gap: 4px;
      opacity: 0;
      transition: opacity 0.2s ease;
      flex: 0 0 auto;
    }

    .fm-item:hover .fm-item-actions {
      opacity: 1;
    }

    .fm-action-btn {
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      border: none;
      background: var(--bg-secondary);
      color: var(--text-secondary);
      border-radius: var(--radius-sm);
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .fm-action-btn:hover {
      background: var(--bg-elevated);
      color: var(--text-primary);
    }

    .fm-action-btn.repair {
      border: 1px solid rgba(245, 158, 11, 0.3);
      background: rgba(245, 158, 11, 0.1);
      color: #fbbf24;
    }

    .fm-action-btn.repair:hover {
      background: #f59e0b;
      border-color: #f59e0b;
      color: #111827;
    }

    .fm-action-btn.danger:hover {
      background: var(--danger-muted);
      color: var(--danger);
    }

    .fm-action-btn svg {
      width: 16px;
      height: 16px;
    }

    .storage-status {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: 16px;
      margin-bottom: 20px;
    }

    .status-card {
      background: var(--bg-secondary);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 16px;
      display: flex;
      flex-direction: column;
      gap: 6px;
      min-width: 0;
    }

    .status-label {
      font-size: 0.7rem;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--text-tertiary);
      font-weight: 600;
    }

    .status-value {
      font-size: 1rem;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 10px;
      color: var(--text-primary);
      min-width: 0;
      flex-wrap: wrap;
    }

    .status-select {
      width: 100%;
      background: var(--bg-tertiary);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      color: var(--text-primary);
      padding: 6px 10px;
      font-size: 0.85rem;
    }

    .status-usage {
      margin-top: 10px;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .status-usage-bar {
      height: 6px;
      background: var(--bg-tertiary);
      border-radius: 999px;
      overflow: hidden;
    }

    .status-usage-fill {
      height: 100%;
      width: 0%;
      background: linear-gradient(90deg, var(--accent), var(--accent-hover));
      transition: width 0.3s ease;
    }

    .status-usage-text {
      font-size: 0.75rem;
      color: var(--text-secondary);
    }

    .status-pill {
      font-size: 0.7rem;
      font-weight: 600;
      padding: 4px 8px;
      border-radius: 999px;
      background: var(--bg-tertiary);
      color: var(--text-secondary);
      border: 1px solid var(--border);
    }

    .status-pill.online {
      background: var(--success-muted);
      color: var(--success);
      border-color: transparent;
    }

    .status-pill.offline {
      background: var(--danger-muted);
      color: var(--danger);
      border-color: transparent;
    }

    .status-pill.warn {
      background: var(--warning-muted);
      color: var(--warning);
      border-color: transparent;
    }

    .storage-grid {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 18px;
      align-items: start;
      min-width: 0;
      overflow: visible;
      padding-bottom: 10px;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: thin;
    }

    .storage-grid.drop-active {
      outline: 2px dashed rgba(124, 92, 255, 0.6);
      outline-offset: 10px;
      border-radius: var(--radius-lg);
    }

    .preview-panel {
      background:
        linear-gradient(180deg, rgba(255,255,255,0.03), transparent 34%),
        var(--bg-secondary);
      border: 1px solid var(--border);
      border-radius: 16px;
      padding: 16px;
      display: flex;
      flex-direction: column;
      gap: 14px;
      min-height: 380px;
      min-width: 0;
      box-shadow: 0 18px 42px rgba(0,0,0,0.16);
    }

    #preview-panel {
      position: relative;
      top: auto;
      max-height: none;
      overflow: visible;
      align-self: start;
      z-index: 1;
      -webkit-overflow-scrolling: touch;
    }

    #preview-panel .preview-surface {
      flex: 0 0 auto;
      min-height: clamp(260px, 42dvh, 560px);
    }

    #preview-panel .zy-image-viewer,
    #preview-panel .zy-video-player,
    #preview-panel .pdf-viewer {
      min-height: 0;
      max-height: min(76dvh, 780px);
    }

    #preview-panel.is-active-preview {
      border-color: rgba(124, 92, 255, 0.44);
      box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(124, 92, 255, 0.16);
    }

    .transfer-log-panel {
      min-height: auto;
      margin-bottom: 20px;
    }

    .import-progress-panel {
      min-height: auto;
      margin: 0 20px 16px;
    }

    .transfer-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      padding: 12px 14px;
      background: var(--bg-tertiary);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      min-width: 0;
    }

    .transfer-left {
      display: flex;
      align-items: center;
      gap: 12px;
      min-width: 0;
    }

    .transfer-badge {
      font-size: 0.65rem;
      font-weight: 700;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      padding: 4px 10px;
      border-radius: 999px;
      white-space: nowrap;
    }

    .transfer-import {
      background: var(--accent-muted);
      color: var(--accent);
    }

    .transfer-export {
      background: var(--success-muted);
      color: var(--success);
    }

    .transfer-name {
      font-size: 0.9rem;
      font-weight: 600;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 260px;
    }

    .transfer-meta {
      font-size: 0.78rem;
      color: var(--text-secondary);
    }

    .transfer-right {
      font-size: 0.78rem;
      color: var(--text-tertiary);
      text-align: right;
      white-space: nowrap;
    }

    .preview-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 12px;
      min-width: 0;
    }

    .preview-header > div:first-child {
      min-width: 0;
    }

    .preview-title {
      font-size: 1rem;
      font-weight: 600;
      line-height: 1.25;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .preview-subtitle {
      color: var(--text-secondary);
      font-size: 0.85rem;
      line-height: 1.45;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .preview-header-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 6px;
      flex: 0 0 auto;
      flex-wrap: wrap;
      max-width: 44%;
    }

    .preview-chip {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 26px;
      max-width: 128px;
      border: 1px solid rgba(124, 92, 255, 0.26);
      border-radius: 999px;
      padding: 4px 9px;
      background: rgba(124, 92, 255, 0.12);
      color: var(--text-primary);
      font-size: 0.68rem;
      font-weight: 800;
      text-transform: uppercase;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      box-shadow: 0 6px 18px rgba(124, 92, 255, 0.12);
    }

    .preview-chip-soft {
      border-color: var(--border);
      background: var(--bg-tertiary);
      color: var(--text-secondary);
    }

    .preview-chip-soft[data-state="loading"],
    .preview-chip-soft[data-state="restoring"] {
      border-color: rgba(124, 92, 255, 0.38);
      color: var(--accent);
    }

    .preview-chip-soft[data-state="ready"] {
      border-color: rgba(34, 197, 94, 0.3);
      color: var(--success);
    }

    .preview-chip-soft[data-state="fallback"],
    .preview-chip-soft[data-state="download-only"] {
      border-color: rgba(245, 158, 11, 0.34);
      color: var(--warning);
    }

    .preview-surface {
      flex: 1;
      border-radius: 14px;
      background:
        linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015)),
        var(--bg-tertiary);
      border: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 12px;
      overflow: hidden;
      position: relative;
      min-height: 220px;
      min-width: 0;
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
    }

    .preview-surface img,
    .preview-surface video,
    .preview-surface iframe {
      width: 100%;
      height: 100%;
      object-fit: contain;
      border: none;
      border-radius: 12px;
      background: var(--bg-primary);
    }

    .zy-image-viewer {
      width: 100%;
      min-height: min(64vh, 680px);
      border: 1px solid rgba(255,255,255,0.1);
      border-radius: 14px;
      background:
        radial-gradient(circle at 50% 8%, rgba(124, 224, 255, 0.1), transparent 34%),
        #05070a;
      box-shadow: var(--shadow-md);
      overflow: hidden;
      display: flex;
      flex-direction: column;
      position: relative;
      isolation: isolate;
      contain: layout paint;
    }

    .zy-image-stage {
      flex: 1;
      min-height: min(56vh, 610px);
      display: grid;
      place-items: center;
      overflow: auto;
      overscroll-behavior: contain;
      padding: 12px;
      background:
        linear-gradient(45deg, rgba(255,255,255,0.035) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255,255,255,0.035) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.035) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.035) 75%),
        #05070a;
      background-size: 22px 22px;
      background-position: 0 0, 0 11px, 11px -11px, -11px 0;
    }

    .preview-surface .zy-image-viewer img,
    .zy-image-viewer img {
      width: auto;
      height: auto;
      max-width: 100%;
      max-height: min(54vh, 590px);
      object-fit: contain;
      border-radius: 8px;
      background: transparent;
      box-shadow: 0 12px 34px rgba(0,0,0,0.32);
      transform-origin: center center;
      transition: transform 0.18s ease, max-width 0.18s ease, max-height 0.18s ease;
      user-select: none;
      -webkit-user-drag: none;
    }

    .zy-image-viewer.is-pannable .zy-image-stage {
      cursor: grab;
    }

    .zy-image-viewer.is-dragging .zy-image-stage {
      cursor: grabbing;
    }

    .zy-image-viewer.is-dragging img {
      transition: none;
    }

    .zy-image-viewer[data-fit="fill"] img {
      width: 100%;
      height: 100%;
      max-height: none;
      object-fit: cover;
    }

    .zy-image-viewer[data-fit="actual"] img {
      max-width: none;
      max-height: none;
      object-fit: contain;
    }

    .zy-image-viewer:fullscreen,
    .zy-image-viewer.is-fullscreen {
      width: 100dvw !important;
      height: 100dvh !important;
      max-width: none !important;
      max-height: none !important;
      min-height: 100dvh !important;
      border: 0 !important;
      border-radius: 0 !important;
      background: #05070a;
      box-shadow: none !important;
    }

    .zy-image-viewer:fullscreen .zy-image-stage,
    .zy-image-viewer.is-fullscreen .zy-image-stage {
      min-height: 0 !important;
      height: 100%;
      max-height: none !important;
    }

    .zy-image-viewer:fullscreen img,
    .zy-image-viewer.is-fullscreen img {
      max-width: 100%;
      max-height: calc(100dvh - 86px) !important;
    }

    .zy-image-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 12px;
      border-bottom: 1px solid rgba(255,255,255,0.1);
      background: rgba(8, 10, 16, 0.86);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
    }

    .zy-image-info {
      min-width: 0;
    }

    .zy-image-title {
      color: #fff;
      font-size: 0.9rem;
      font-weight: 900;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      max-width: 320px;
    }

    .zy-image-meta {
      margin-top: 2px;
      color: rgba(255,255,255,0.64);
      font-size: 0.74rem;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      max-width: 320px;
    }

    .zy-media-badges {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
      margin-top: 7px;
      min-width: 0;
    }

    .zy-media-badge {
      max-width: 150px;
      padding: 4px 7px;
      border-radius: 999px;
      border: 1px solid rgba(255,255,255,0.13);
      background: rgba(255,255,255,0.08);
      color: rgba(255,255,255,0.78);
      font-size: 0.68rem;
      font-weight: 800;
      line-height: 1;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
    }

    .zy-media-badge-live {
      color: #fff;
      border-color: rgba(124, 224, 255, 0.28);
      background: rgba(124, 224, 255, 0.12);
    }

    .zy-image-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 6px;
      flex-wrap: wrap;
    }

    .zy-image-btn {
      min-width: 38px;
      min-height: 36px;
      border: 1px solid rgba(255,255,255,0.14);
      background: rgba(255,255,255,0.1);
      color: #fff;
      border-radius: 8px;
      padding: 7px 10px;
      font-size: 0.78rem;
      font-weight: 800;
      cursor: pointer;
      backdrop-filter: blur(16px);
      transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
    }

    .zy-image-btn.icon-only {
      width: 38px;
      padding-inline: 0;
    }

    .zy-image-btn:hover {
      transform: translateY(-1px);
      border-color: rgba(255,255,255,0.32);
      background: rgba(255,255,255,0.16);
    }

    .zy-image-zoom {
      min-width: 56px;
      color: rgba(255,255,255,0.78);
      font-size: 0.78rem;
      font-weight: 800;
      text-align: center;
      font-variant-numeric: tabular-nums;
    }

    .zy-video-player {
      width: 100%;
      min-height: min(62vh, 620px);
      background: #05070a;
      border: 1px solid rgba(255,255,255,0.1);
      border-radius: 14px;
      overflow: hidden;
      box-shadow: var(--shadow-md);
      display: flex;
      flex-direction: column;
      position: relative;
      isolation: isolate;
      contain: layout paint;
    }

    .zy-video-stage {
      position: relative;
      display: grid;
      place-items: center;
      min-height: min(54vh, 560px);
      background:
        linear-gradient(180deg, rgba(255,255,255,0.04), transparent 18%),
        radial-gradient(circle at 50% 20%, rgba(124, 224, 255, 0.13), transparent 34%),
        #05070a;
    }

    .zy-video-player video {
      width: 100%;
      height: 100%;
      max-height: min(54vh, 560px);
      aspect-ratio: 16 / 9;
      display: block;
      object-fit: contain;
      background: #05070a;
      border-radius: 0;
    }

    .zy-video-player[data-fit="cover"] video {
      object-fit: cover;
    }

    .zy-video-player:fullscreen,
    .zy-video-player.is-fullscreen {
      width: 100dvw !important;
      height: 100dvh !important;
      max-width: none !important;
      max-height: none !important;
      min-height: 100dvh !important;
      border: 0 !important;
      border-radius: 0 !important;
      background: #000;
      box-shadow: none !important;
      contain: none !important;
      overflow: hidden !important;
      z-index: 2147483000;
    }

    .zy-video-player:fullscreen .zy-video-stage,
    .zy-video-player.is-fullscreen .zy-video-stage {
      width: 100%;
      height: 100%;
      min-height: 100dvh !important;
      max-height: none !important;
      aspect-ratio: auto !important;
      background: #000;
    }

    .zy-video-player:fullscreen video,
    .zy-video-player.is-fullscreen video {
      width: 100%;
      height: 100%;
      max-height: none !important;
      aspect-ratio: auto !important;
      object-fit: contain;
      background: #000;
    }

    .zy-video-topbar,
    .zy-video-controls {
      position: absolute;
      left: 0;
      right: 0;
      z-index: 3;
      opacity: 1;
      transition: opacity 0.22s ease, transform 0.22s ease;
    }

    .zy-video-topbar {
      top: 0;
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 14px;
      padding: 16px;
      background: linear-gradient(180deg, rgba(0,0,0,0.72), transparent);
      pointer-events: none;
    }

    .zy-video-title {
      min-width: 0;
      color: #fff;
      font-size: 0.94rem;
      font-weight: 800;
      text-shadow: 0 2px 12px rgba(0,0,0,0.6);
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .zy-video-subtitle {
      margin-top: 3px;
      color: rgba(255,255,255,0.68);
      font-size: 0.78rem;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .zy-video-topbar .zy-media-badges {
      max-width: min(54vw, 520px);
    }

    .zy-video-status {
      flex: 0 0 auto;
      padding: 6px 10px;
      border-radius: 999px;
      background: rgba(255,255,255,0.12);
      border: 1px solid rgba(255,255,255,0.14);
      color: rgba(255,255,255,0.8);
      font-size: 0.72rem;
      font-weight: 800;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      backdrop-filter: blur(16px);
    }

    .zy-video-center {
      position: absolute;
      z-index: 4;
      width: 74px;
      height: 74px;
      border-radius: 50%;
      border: 1px solid rgba(255,255,255,0.28);
      background: rgba(9, 12, 18, 0.66);
      color: #fff;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 0.8rem;
      font-weight: 900;
      cursor: pointer;
      box-shadow: 0 22px 60px rgba(0,0,0,0.34);
      backdrop-filter: blur(18px);
      transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
    }

    .zy-video-center:hover {
      transform: scale(1.04);
      background: rgba(18, 22, 32, 0.82);
    }

    .zy-video-player.is-playing .zy-video-center {
      opacity: 0;
      pointer-events: none;
      transform: scale(0.92);
    }

    .zy-video-controls {
      bottom: 0;
      display: flex;
      flex-direction: column;
      gap: 10px;
      padding: 54px 16px 14px;
      background: linear-gradient(180deg, transparent, rgba(0,0,0,0.74) 46%, rgba(0,0,0,0.9));
    }

    .zy-video-player.controls-hidden.is-playing .zy-video-topbar,
    .zy-video-player.controls-hidden.is-playing .zy-video-controls {
      opacity: 0;
      pointer-events: none;
    }

    .zy-video-progress {
      display: flex;
      align-items: center;
      gap: 10px;
      position: relative;
    }

    .zy-video-progress input[type="range"] {
      --played: 0%;
      --buffered: 0%;
      width: 100%;
      height: 8px;
      appearance: none;
      background:
        linear-gradient(90deg, var(--accent) 0 var(--played), transparent var(--played)),
        linear-gradient(90deg, rgba(255,255,255,0.34) 0 var(--buffered), rgba(255,255,255,0.14) var(--buffered));
      border-radius: 999px;
      outline: none;
      cursor: pointer;
    }

    .zy-video-progress input[type="range"]::-webkit-slider-thumb {
      appearance: none;
      width: 16px;
      height: 16px;
      border-radius: 50%;
      background: #fff;
      border: 3px solid var(--accent);
      box-shadow: 0 0 18px rgba(124, 92, 255, 0.56);
      cursor: pointer;
    }

    .zy-video-progress input[type="range"]::-moz-range-thumb {
      width: 16px;
      height: 16px;
      border-radius: 50%;
      background: #fff;
      border: 3px solid var(--accent);
      cursor: pointer;
    }

    .zy-video-scrub-tip {
      position: absolute;
      bottom: 16px;
      left: 0;
      transform: translateX(-50%) translateY(6px);
      min-width: 44px;
      padding: 5px 7px;
      border-radius: 8px;
      background: rgba(5, 7, 10, 0.88);
      border: 1px solid rgba(255,255,255,0.16);
      color: #fff;
      font-size: 0.68rem;
      font-weight: 900;
      text-align: center;
      font-variant-numeric: tabular-nums;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.14s ease, transform 0.14s ease;
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
    }

    .zy-video-progress.is-scrubbing .zy-video-scrub-tip {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }

    .zy-video-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
    }

    .zy-video-left,
    .zy-video-right {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .zy-video-btn {
      min-width: 42px;
      min-height: 38px;
      border: 1px solid rgba(255,255,255,0.14);
      background: rgba(255,255,255,0.1);
      color: #fff;
      border-radius: 8px;
      padding: 8px 12px;
      font-size: 0.82rem;
      font-weight: 800;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      cursor: pointer;
      backdrop-filter: blur(16px);
      transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
    }

    .zy-video-btn.primary {
      background: #fff;
      color: #080a10;
      border-color: transparent;
      box-shadow: 0 12px 26px rgba(0,0,0,0.24);
    }

    .zy-video-btn:hover {
      transform: translateY(-1px);
      border-color: rgba(255,255,255,0.32);
      background: rgba(255,255,255,0.16);
    }

    .zy-video-btn.primary:hover {
      background: rgba(255,255,255,0.92);
    }

    .zy-video-btn:disabled {
      opacity: 0.45;
      cursor: not-allowed;
      transform: none;
    }

    .zy-video-skip {
      min-width: 46px;
      padding-inline: 10px;
      font-variant-numeric: tabular-nums;
    }

    .zy-video-time {
      font-size: 0.8rem;
      color: rgba(255,255,255,0.78);
      min-width: 98px;
      font-variant-numeric: tabular-nums;
    }

    .zy-video-volume {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 0 8px;
      border-radius: 8px;
      background: rgba(255,255,255,0.08);
      border: 1px solid rgba(255,255,255,0.1);
    }

    .fm-toolbar-top {
      display: flex;
      flex-direction: column;
      gap: 12px;
      padding-bottom: 14px;
      border-bottom: 1px solid var(--border);
      background: var(--bg-primary);
    }

    .fm-filter-chips {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      min-width: 0;
    }

    .fm-filter-chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      border: 1px solid var(--border);
      background: var(--bg-tertiary);
      color: var(--text-secondary);
      padding: 8px 12px;
      border-radius: 999px;
      font-size: 0.8rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.18s ease;
    }

    .fm-filter-chip:hover {
      background: var(--bg-elevated);
      color: var(--text-primary);
    }

    .fm-filter-chip.active {
      background: var(--accent);
      border-color: var(--accent);
      color: white;
    }

    .fm-selection-bar {
      display: none;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      padding: 12px 16px;
      border-bottom: 1px solid var(--border);
      background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent), var(--bg-primary);
    }

    .fm-selection-bar.active {
      display: flex;
    }

    .fm-selection-copy {
      min-width: 0;
    }

    .fm-selection-title {
      font-size: 0.9rem;
      font-weight: 700;
      color: var(--text-primary);
    }

    .fm-selection-subtitle {
      font-size: 0.78rem;
      color: var(--text-tertiary);
    }

    .fm-selection-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    .fm-selection-actions .fm-btn {
      padding: 7px 12px;
      font-size: 0.8rem;
    }

    .fm-pinned {
      display: flex;
      flex-direction: column;
      gap: 10px;
      padding: 14px 16px;
      border-bottom: 1px solid var(--border);
      background: var(--bg-primary);
    }

    .fm-pinned-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
    }

    .fm-pinned-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }

    .fm-pinned-item {
      display: flex;
      flex-direction: column;
      gap: 8px;
      padding: 12px;
      border-radius: var(--radius-md);
      border: 1px solid var(--border);
      background: var(--bg-secondary);
      min-width: 0;
    }

    .fm-pinned-name {
      font-size: 0.84rem;
      font-weight: 700;
      color: var(--text-primary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .fm-pinned-meta {
      font-size: 0.72rem;
      color: var(--text-tertiary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .fm-pinned-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .fm-pinned-actions button {
      border: none;
      border-radius: 999px;
      padding: 6px 10px;
      font-size: 0.76rem;
      cursor: pointer;
      background: var(--accent);
      color: white;
    }

    .fm-pinned-actions button.secondary {
      background: var(--bg-tertiary);
      color: var(--text-primary);
    }

    .zy-video-volume input[type="range"] {
      width: 90px;
      height: 4px;
      appearance: none;
      background: rgba(255, 255, 255, 0.24);
      border-radius: 999px;
    }

    .zy-video-volume input[type="range"]::-webkit-slider-thumb {
      appearance: none;
      width: 12px;
      height: 12px;
      border-radius: 50%;
      background: var(--accent);
      cursor: pointer;
    }

    .zy-video-volume input[type="range"]::-moz-range-thumb {
      width: 12px;
      height: 12px;
      border-radius: 50%;
      background: var(--accent);
      border: none;
      cursor: pointer;
    }

    .zy-video-select {
      min-height: 38px;
      background: rgba(255,255,255,0.1);
      color: #fff;
      border: 1px solid rgba(255,255,255,0.14);
      border-radius: 999px;
      padding: 6px 12px;
      font-size: 0.8rem;
      font-weight: 800;
      outline: none;
    }

    .zy-video-select option {
      color: #111827;
    }

    .zy-video-player.is-loading .zy-video-stage::after {
      content: '';
      position: absolute;
      width: 42px;
      height: 42px;
      border-radius: 50%;
      border: 3px solid rgba(255,255,255,0.18);
      border-top-color: #fff;
      animation: spin 0.8s linear infinite;
      z-index: 5;
    }

    .zy-video-player.has-error .zy-video-status {
      background: rgba(239, 68, 68, 0.2);
      border-color: rgba(239, 68, 68, 0.36);
      color: #fecaca;
    }

    .preview-empty {
      text-align: center;
      color: var(--text-secondary);
      font-size: 0.9rem;
      line-height: 1.5;
      width: min(100%, 360px);
      max-width: 360px;
      padding: 10px;
      border-radius: 8px;
      background:
        linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.018)),
        var(--bg-secondary);
      border: 1px solid var(--border);
      display: grid;
      justify-items: center;
      gap: 12px;
    }

    .preview-empty-rich {
      width: min(100%, 460px);
      max-width: 460px;
    }

    .preview-empty-icon {
      display: inline-grid;
      place-items: center;
      width: 38px;
      height: 38px;
      border-radius: 50%;
      background: var(--accent-muted);
      color: var(--accent);
      font-size: 0.86rem;
      font-weight: 900;
      box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.22);
    }

    .preview-empty-stack {
      display: grid;
      justify-items: center;
      gap: 10px;
      min-width: 0;
    }

    .preview-empty-meta {
      max-width: 100%;
      color: var(--text-tertiary);
      font-size: 0.78rem;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .preview-empty-actions {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      flex-wrap: wrap;
      width: 100%;
    }

    .preview-loader {
      width: min(420px, 100%);
      display: grid;
      gap: 12px;
      text-align: center;
      color: var(--text-secondary);
      justify-items: center;
      padding: 20px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background:
        linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.018)),
        var(--bg-secondary);
    }

    .preview-loader-ring {
      width: 62px;
      height: 62px;
      border-radius: 50%;
      display: grid;
      place-items: center;
      color: var(--text-primary);
      font-size: 0.76rem;
      font-weight: 900;
      background:
        radial-gradient(circle, var(--bg-secondary) 57%, transparent 58%),
        conic-gradient(var(--accent), var(--success), var(--accent));
      box-shadow: 0 10px 26px rgba(0,0,0,0.16);
      animation: spin 1.2s linear infinite;
    }

    .preview-loader-ring span {
      animation: spin 1.2s linear infinite reverse;
    }

    .preview-inline-status {
      align-self: center;
      justify-self: center;
      margin: auto;
    }

    .preview-loader-title {
      color: var(--text-primary);
      font-weight: 700;
      font-size: 0.95rem;
    }

    .preview-loader-copy {
      font-size: 0.82rem;
      line-height: 1.55;
    }

    .preview-progress {
      height: 7px;
      border-radius: 999px;
      background: var(--bg-primary);
      border: 1px solid var(--border);
      overflow: hidden;
    }

    .preview-progress-fill {
      width: 0%;
      height: 100%;
      background: linear-gradient(90deg, var(--accent), var(--success));
      transition: width 0.18s ease;
    }

    .zy-canvas-controls {
      display: flex;
      justify-content: center;
      gap: 8px;
      margin-top: 8px;
      width: 100%;
      flex-wrap: wrap;
    }

    .preview-meta {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
      gap: 10px;
    }

    .preview-meta-item {
      background: var(--bg-tertiary);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 11px 12px;
      font-size: 0.72rem;
      color: var(--text-secondary);
      min-width: 0;
    }

    .preview-meta-item strong {
      display: block;
      color: var(--text-primary);
      font-size: 0.8rem;
      margin-top: 4px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .preview-actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }

    .preview-settings {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
      margin-top: 8px;
    }

    .preview-setting {
      background: var(--bg-tertiary);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 10px 12px;
      display: flex;
      flex-direction: column;
      gap: 6px;
      font-size: 0.8rem;
    }

    .preview-setting label {
      color: var(--text-tertiary);
      font-weight: 600;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      font-size: 0.65rem;
    }

    .preview-setting select {
      background: var(--bg-secondary);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      color: var(--text-primary);
      padding: 6px 8px;
      font-size: 0.8rem;
      outline: none;
    }

    .zyplayer {
      background: var(--bg-tertiary);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 16px;
      display: flex;
      flex-direction: column;
      gap: 12px;
      width: 100%;
      max-width: 680px;
    }

    .zyplayer-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .zyplayer-title {
      font-weight: 600;
      font-size: 0.9rem;
      color: var(--text-primary);
      max-width: 60%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .zyplayer-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 42px;
      height: 42px;
      border-radius: 50%;
      border: 1px solid var(--border);
      background: var(--bg-secondary);
      color: var(--text-primary);
      cursor: pointer;
      font-size: 0.9rem;
    }

    .zyplayer-progress {
      display: flex;
      align-items: center;
      gap: 10px;
      font-size: 0.75rem;
      color: var(--text-secondary);
    }

    .zyplayer-progress input[type="range"] {
      flex: 1;
      accent-color: var(--accent);
    }

    .zyplayer-bottom {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      font-size: 0.75rem;
      color: var(--text-secondary);
    }

    .zyplayer-volume {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .zyplayer-volume input[type="range"] {
      width: 120px;
      accent-color: var(--accent);
    }

    .zyplayer-native {
      width: 100%;
      min-height: 40px;
      display: block;
      border-radius: 8px;
      color-scheme: dark;
    }

    #preview-panel[data-preview-kind="audio"] .preview-surface {
      align-items: center;
      justify-content: center;
      padding-block: 18px;
    }

    .pdf-viewer {
      display: flex;
      flex-direction: column;
      gap: 12px;
      width: 100%;
      min-height: min(68vh, 720px);
      border: 1px solid var(--border);
      border-radius: 14px;
      background:
        linear-gradient(180deg, rgba(255,255,255,0.035), transparent 34%),
        var(--bg-secondary);
      overflow: hidden;
      box-shadow: 0 12px 34px rgba(0,0,0,0.14);
    }

    .pdf-viewer.fullscreen {
      position: fixed;
      inset: 0;
      z-index: 300;
      background: var(--bg-primary);
      padding: 12px;
      border-radius: 0;
      overflow: hidden;
    }

    .pdf-viewer.fullscreen .pdf-canvas-wrap {
      max-height: calc(100dvh - 210px);
    }

    .pdf-controls {
      position: sticky;
      top: 0;
      z-index: 5;
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      align-items: center;
      justify-content: space-between;
      background:
        linear-gradient(180deg, rgba(255,255,255,0.055), transparent),
        rgba(18, 18, 26, 0.92);
      border-bottom: 1px solid var(--border);
      padding: 12px;
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
    }

    .pdf-controls-group {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      min-width: 0;
    }

    .pdf-doc-group {
      flex-direction: column;
      align-items: flex-start;
      gap: 2px;
      flex: 1 1 220px;
    }

    .pdf-doc-title {
      max-width: 280px;
      color: var(--text-primary);
      font-size: 0.9rem;
      font-weight: 900;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .pdf-doc-meta {
      max-width: 280px;
      color: var(--text-tertiary);
      font-size: 0.74rem;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .pdf-page-count {
      color: var(--text-tertiary);
      font-size: 0.78rem;
      font-weight: 700;
      white-space: nowrap;
    }

    .pdf-controls button {
      min-height: 36px;
      border: 1px solid var(--border);
      background: var(--bg-tertiary);
      color: var(--text-primary);
      border-radius: 10px;
      padding: 7px 10px;
      cursor: pointer;
      font-size: 0.8rem;
      font-weight: 800;
      transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
    }

    .pdf-controls button:hover {
      transform: translateY(-1px);
      border-color: var(--border-hover);
      background: var(--bg-elevated);
    }

    .pdf-controls input[type="number"],
    .pdf-controls select {
      min-height: 36px;
      background: var(--bg-tertiary);
      border: 1px solid var(--border);
      border-radius: 10px;
      color: var(--text-primary);
      padding: 7px 10px;
      font-size: 0.8rem;
      font-weight: 700;
      width: 92px;
      outline: none;
    }

    .pdf-canvas-wrap {
      background:
        radial-gradient(circle at 50% 0%, rgba(124, 224, 255, 0.08), transparent 32%),
        var(--bg-primary);
      border: none;
      border-radius: 0;
      padding: 14px;
      display: flex;
      justify-content: center;
      align-items: flex-start;
      overflow: auto;
      max-height: 560px;
      overscroll-behavior: contain;
      scrollbar-gutter: stable;
    }

    .pdf-scroll {
      display: flex;
      flex-direction: column;
      gap: 18px;
      width: 100%;
      align-items: center;
    }

    .pdf-page {
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 12px;
      border-radius: 8px;
      border: 1px solid rgba(255,255,255,0.08);
      background: rgba(255,255,255,0.04);
      box-shadow: 0 14px 42px rgba(0,0,0,0.18);
    }

    .pdf-page canvas {
      max-width: 100%;
      height: auto;
      border-radius: 6px;
      box-shadow: 0 8px 26px rgba(0,0,0,0.18);
      background: #fff;
    }

    .pdf-page.highlight {
      border-color: var(--accent);
      box-shadow: var(--shadow-glow);
    }

    .pdf-thumbs {
      display: flex;
      gap: 10px;
      overflow-x: auto;
      padding: 10px 12px 12px;
      background: rgba(255,255,255,0.025);
      border-top: 1px solid var(--border);
      -webkit-overflow-scrolling: touch;
      scrollbar-width: thin;
    }

    .pdf-thumbs.is-hidden {
      display: none;
    }

    @media (max-width: 1240px) {
      .storage-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        overflow-x: visible;
      }

      .fm-toolbar {
        grid-template-columns: 1fr;
      }

      .fm-controls {
        grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(130px, 0.5fr));
      }

      .fm-bulk,
      .fm-actions {
        justify-content: flex-start;
      }

      #preview-panel {
        min-height: 320px;
        position: relative;
        top: auto;
        max-height: none;
      }
    }

    .pdf-thumb {
      width: 78px;
      flex: 0 0 auto;
      border-radius: 12px;
      border: 1px solid var(--border);
      background: var(--bg-secondary);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      min-height: 98px;
      transition: transform 0.18s ease, border-color 0.18s ease;
    }

    .pdf-thumb:hover {
      transform: translateY(-2px);
      border-color: var(--border-hover);
    }

    .pdf-thumb canvas {
      width: 100%;
      height: auto;
      display: block;
    }

    .pdf-search {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      padding: 0 12px 12px;
    }

    .pdf-search input {
      flex: 1;
      min-width: 160px;
      min-height: 38px;
      background: var(--bg-tertiary);
      border: 1px solid var(--border);
      border-radius: 999px;
      color: var(--text-primary);
      padding: 8px 13px;
      font-size: 0.82rem;
      outline: none;
    }

    .pdf-search button {
      min-height: 38px;
      border: 1px solid var(--border);
      background: var(--bg-tertiary);
      color: var(--text-primary);
      border-radius: 999px;
      padding: 8px 12px;
      cursor: pointer;
      font-size: 0.78rem;
      font-weight: 800;
    }

    .pdf-search-status {
      font-size: 0.75rem;
      color: var(--text-tertiary);
      min-width: 92px;
      text-align: right;
    }

    .preview-btn {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 8px 14px;
      border-radius: var(--radius-md);
      border: 1px solid var(--border);
      background: var(--bg-tertiary);
      color: var(--text-primary);
      font-size: 0.85rem;
      cursor: pointer;
    }

    .preview-btn.primary {
      background: var(--accent);
      border-color: transparent;
      color: white;
    }

    .preview-btn svg {
      width: 16px;
      height: 16px;
    }

    .compression-badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      background: var(--success-muted);
      color: var(--success);
      padding: 2px 8px;
      border-radius: 4px;
      font-size: 0.7rem;
      font-weight: 600;
    }

    /* ----------------------------------------------
       FORMS & BUTTONS
    ---------------------------------------------- */
    .form-section {
      background: var(--bg-secondary);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 24px;
      margin-bottom: 20px;
    }

/* preview.css */
/* Preview rules currently live with storage where the original cascade placed them. */

/* settings.css */
/* Settings, store, billing, circles, profile, modal, and account rules. */

    .settings-overview {
      padding: 24px;
      border-radius: var(--radius-lg);
      border: 1px solid var(--border);
      background:
        radial-gradient(circle at top right, rgba(139, 92, 246, 0.14), transparent 34%),
        linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)),
        var(--bg-secondary);
      margin-bottom: 20px;
    }

    .settings-overview-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
      flex-wrap: wrap;
      margin-bottom: 18px;
    }

    .settings-overview-title {
      font-size: 1.08rem;
      font-weight: 720;
      color: var(--text-primary);
      letter-spacing: 0;
      margin-bottom: 6px;
    }

    .settings-overview-copy {
      color: var(--text-secondary);
      line-height: 1.6;
      max-width: 66ch;
    }

    .settings-overview-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 12px;
      margin-top: 18px;
    }

    .settings-overview-card {
      padding: 16px;
      border-radius: 18px;
      border: 1px solid var(--border);
      background: var(--bg-primary);
    }

    .settings-overview-label {
      font-size: 0.78rem;
      text-transform: uppercase;
      letter-spacing: 0.14em;
      color: var(--text-tertiary);
      margin-bottom: 8px;
    }

    .settings-overview-value {
      font-size: 1rem;
      font-weight: 700;
      color: var(--text-primary);
      margin-bottom: 6px;
    }

    .settings-overview-subtitle {
      color: var(--text-secondary);
      font-size: 0.88rem;
      line-height: 1.5;
    }

    .settings-field-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
      gap: 16px;
      margin-bottom: 4px;
    }

    .settings-billing-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
      padding: 16px 18px;
      border-radius: 18px;
      border: 1px solid var(--border);
      background: var(--bg-primary);
      margin-bottom: 16px;
    }

    .settings-billing-copy {
      color: var(--text-secondary);
      line-height: 1.55;
      max-width: 58ch;
    }

    .settings-billing-actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }

    .settings-rail {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
      margin-bottom: 20px;
      position: sticky;
      top: 14px;
      z-index: 8;
      padding: 10px;
      border-radius: 22px;
      border: 1px solid var(--border);
      background: rgba(15, 23, 42, 0.82);
      background: color-mix(in srgb, var(--bg-secondary) 88%, transparent);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
      box-shadow: var(--shadow-sm);
    }

    .settings-rail-btn {
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 4px;
      width: 100%;
      min-height: 76px;
      padding: 14px 15px;
      border-radius: 18px;
      border: 1px solid var(--border);
      background: var(--bg-secondary);
      color: var(--text-primary);
      text-align: left;
      cursor: pointer;
      transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
    }

    .settings-rail-btn::after {
      content: '';
      position: absolute;
      left: 14px;
      right: 14px;
      bottom: 10px;
      height: 3px;
      border-radius: 999px;
      background: linear-gradient(90deg, rgba(99, 102, 241, 0.0), rgba(99, 102, 241, 0.95), rgba(34, 197, 94, 0.7), rgba(99, 102, 241, 0.0));
      transform: scaleX(0);
      transform-origin: center;
      opacity: 0;
      transition: transform 0.22s ease, opacity 0.22s ease;
    }

    .settings-rail-btn:hover {
      transform: translateY(-1px);
      border-color: var(--border-hover);
      background: var(--bg-primary);
      box-shadow: var(--shadow-sm);
    }

    .settings-rail-btn.active {
      border-color: rgba(99, 102, 241, 0.34);
      background:
        linear-gradient(180deg, rgba(99, 102, 241, 0.14), rgba(99, 102, 241, 0.04)),
        var(--bg-primary);
      box-shadow: 0 10px 26px rgba(99, 102, 241, 0.16);
    }

    .settings-rail-btn.active::after {
      transform: scaleX(1);
      opacity: 1;
    }

    .settings-rail-label {
      font-size: 0.78rem;
      text-transform: uppercase;
      letter-spacing: 0.14em;
      color: var(--text-tertiary);
    }

    .settings-rail-title {
      font-size: 0.95rem;
      font-weight: 700;
      letter-spacing: 0;
    }

    .settings-rail-copy {
      font-size: 0.84rem;
      color: var(--text-secondary);
      line-height: 1.45;
    }

    .readiness-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: 14px;
      margin-top: 14px;
    }

    .readiness-item {
      padding: 16px 16px 14px;
      border-radius: 18px;
      background:
        linear-gradient(180deg, rgba(255,255,255,0.03), transparent),
        var(--bg-primary);
      border: 1px solid var(--border);
    }

    .readiness-item-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 10px;
    }

    .readiness-item strong {
      font-size: 0.95rem;
      color: var(--text-primary);
    }

    .readiness-item p {
      font-size: 0.88rem;
      color: var(--text-secondary);
      line-height: 1.55;
    }

    .sync-center {
      display: grid;
      grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
      gap: 16px;
      align-items: start;
    }

    .sync-summary {
      padding: 18px;
      border-radius: 18px;
      background:
        radial-gradient(circle at top left, rgba(96, 165, 250, 0.10), transparent 48%),
        linear-gradient(180deg, rgba(255,255,255,0.03), transparent),
        var(--bg-primary);
      border: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .sync-summary-title {
      font-size: 0.95rem;
      font-weight: 700;
      color: var(--text-primary);
    }

    .sync-summary-copy {
      font-size: 0.86rem;
      color: var(--text-secondary);
      line-height: 1.55;
    }

    .sync-channel-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }

    .sync-channel {
      padding: 12px 14px;
      border-radius: 16px;
      border: 1px solid var(--border);
      background: var(--bg-secondary);
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .sync-channel-label {
      font-size: 0.78rem;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--text-tertiary);
    }

    .sync-channel-value {
      font-size: 0.9rem;
      font-weight: 600;
      color: var(--text-primary);
      line-height: 1.4;
    }

    .sync-action-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }

    .sync-action-grid .btn {
      justify-content: center;
      width: 100%;
      min-height: 42px;
    }

    .sync-help-row {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .sync-help-chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 10px;
      border-radius: 999px;
      border: 1px solid var(--border);
      background: rgba(255,255,255,0.03);
      color: var(--text-secondary);
      font-size: 0.78rem;
    }

    .sync-help-chip.active {
      background: var(--accent-muted);
      color: var(--accent);
      border-color: transparent;
      font-weight: 700;
    }

    .sync-info-bar {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 8px;
    }

    .sync-info-pill {
      padding: 6px 10px;
      border-radius: 999px;
      border: 1px solid var(--border);
      background: var(--bg-tertiary);
      color: var(--text-secondary);
      font-size: 0.78rem;
      font-weight: 600;
    }

    .sync-info-pill.active {
      background: var(--accent-muted);
      color: var(--accent);
      border-color: transparent;
    }

    .sync-transfer-modal {
      max-width: 760px;
    }

    .sync-transfer-layout {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(220px, 0.92fr);
      gap: 18px;
      align-items: start;
    }

    .sync-transfer-code {
      font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
      font-size: 0.82rem;
      line-height: 1.5;
      word-break: break-all;
      padding: 14px;
      border-radius: 16px;
      background: var(--bg-primary);
      border: 1px solid var(--border);
      color: var(--text-primary);
      min-height: 112px;
    }

    .sync-transfer-code-compact {
      padding: 12px 14px;
      border-radius: 14px;
      border: 1px solid rgba(52, 211, 153, 0.18);
      background: rgba(52, 211, 153, 0.08);
      color: var(--text-primary);
      font-size: 0.9rem;
      font-weight: 700;
      line-height: 1.45;
      word-break: break-word;
    }

    .sync-transfer-details {
      border-radius: 14px;
      border: 1px solid var(--border);
      background: rgba(255,255,255,0.02);
      padding: 0;
    }

    .sync-transfer-details summary {
      cursor: pointer;
      list-style: none;
      padding: 10px 14px;
      font-size: 0.84rem;
      font-weight: 700;
      color: var(--text-secondary);
    }

    .sync-transfer-details summary::-webkit-details-marker {
      display: none;
    }

    .sync-transfer-details[open] summary {
      border-bottom: 1px solid var(--border);
    }

    .sync-transfer-qr {
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 280px;
      padding: 16px;
      border-radius: 18px;
      background:
        radial-gradient(circle at center, rgba(255,255,255,0.06), transparent 62%),
        var(--bg-primary);
      border: 1px solid var(--border);
    }

    .sync-transfer-qr img {
      width: 100%;
      max-width: 280px;
      height: auto;
      display: block;
      border-radius: 18px;
      background: white;
      padding: 10px;
    }

    .sync-transfer-fallback {
      display: grid;
      gap: 10px;
    }

    .sync-transfer-meta {
      display: grid;
      gap: 8px;
      font-size: 0.88rem;
      color: var(--text-secondary);
      line-height: 1.55;
    }

    .export-modal {
      max-width: 760px;
    }

    .export-modal-grid {
      display: grid;
      grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
      gap: 18px;
      align-items: start;
    }

    .export-modal-panel {
      display: grid;
      gap: 12px;
      padding: 18px;
      border-radius: 18px;
      border: 1px solid var(--border);
      background: rgba(255,255,255,0.03);
    }

    .export-modal-stats {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
    }

    .export-modal-stat {
      padding: 10px 12px;
      border-radius: 14px;
      border: 1px solid rgba(255,255,255,0.06);
      background: rgba(255,255,255,0.03);
    }

    .export-modal-stat span {
      display: block;
      margin-bottom: 4px;
      font-size: 0.74rem;
      color: var(--text-tertiary);
    }

    .export-modal-stat strong {
      display: block;
      color: var(--text-primary);
      font-size: 0.92rem;
      word-break: break-word;
    }

    .export-modal-list {
      display: grid;
      gap: 8px;
      max-height: 220px;
      overflow: auto;
      padding-right: 2px;
    }

    .export-modal-item {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      padding: 10px 12px;
      border-radius: 12px;
      border: 1px solid rgba(255,255,255,0.05);
      background: rgba(255,255,255,0.025);
    }

    .export-modal-item-main {
      min-width: 0;
      display: grid;
      gap: 2px;
    }

    .export-modal-item-name {
      font-size: 0.86rem;
      font-weight: 700;
      color: var(--text-primary);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .export-modal-item-meta,
    .export-modal-note {
      font-size: 0.78rem;
      color: var(--text-tertiary);
      line-height: 1.45;
    }

    .sync-transfer-meta strong {
      color: var(--text-primary);
    }

    .lan-transfer-modal {
      max-width: 1020px;
      width: min(1020px, 96vw);
      max-height: 88vh;
      display: flex;
      flex-direction: column;
    }

    .lan-transfer-modal .modal-content {
      overflow: auto;
      margin-bottom: 18px;
      padding-right: 4px;
    }

    .lan-transfer-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 16px;
    }

    .lan-transfer-header .modal-title {
      margin-bottom: 0;
    }

    .lan-transfer-close {
      flex: 0 0 auto;
      min-width: 42px;
      padding-inline: 12px;
    }

    .lan-transfer-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 16px;
    }

    .lan-panel {
      display: grid;
      gap: 12px;
      padding: 16px;
      border-radius: 18px;
      border: 1px solid var(--border);
      background: var(--bg-primary);
    }

    .lan-panel-title {
      font-size: 0.95rem;
      font-weight: 700;
      color: var(--text-primary);
    }

    .lan-panel-copy {
      font-size: 0.85rem;
      color: var(--text-secondary);
      line-height: 1.55;
    }

    .lan-code-box {
      width: 100%;
      min-height: 150px;
      resize: vertical;
      padding: 14px;
      border-radius: 16px;
      border: 1px solid var(--border);
      background: var(--bg-secondary);
      color: var(--text-primary);
      font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
      font-size: 0.82rem;
      line-height: 1.5;
    }

    .lan-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
    }

    .lan-status {
      display: grid;
      gap: 6px;
      padding: 12px 14px;
      border-radius: 16px;
      border: 1px solid var(--border);
      background: var(--bg-secondary);
    }

    .lan-status strong {
      color: var(--text-primary);
      font-size: 0.92rem;
    }

    .lan-status span {
      color: var(--text-secondary);
      font-size: 0.82rem;
      line-height: 1.45;
    }

    .lan-status-row {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
    }

    .lan-transfer-meta {
      display: grid;
      gap: 8px;
      padding: 12px 14px;
      border-radius: 16px;
      background: var(--bg-secondary);
      border: 1px solid var(--border);
      color: var(--text-secondary);
      font-size: 0.84rem;
      line-height: 1.5;
    }

    .moat-card {
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    .moat-list {
      display: grid;
      gap: 10px;
    }

    .moat-list-item {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      padding: 10px 12px;
      border-radius: 14px;
      background: var(--bg-primary);
      border: 1px solid var(--border);
      color: var(--text-secondary);
      font-size: 0.86rem;
      line-height: 1.5;
    }

    .moat-list-item strong {
      display: block;
      color: var(--text-primary);
      font-size: 0.9rem;
      margin-bottom: 2px;
    }

    .moat-list-icon {
      width: 28px;
      height: 28px;
      flex: 0 0 28px;
      border-radius: 10px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: var(--accent-muted);
      color: var(--accent);
    }

    .recovery-journal {
      display: grid;
      gap: 10px;
    }

    .recovery-entry {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      padding: 12px 14px;
      border-radius: 14px;
      background: var(--bg-primary);
      border: 1px solid var(--border);
    }

    .recovery-entry-main {
      display: grid;
      gap: 4px;
      min-width: 0;
    }

    .recovery-entry-title {
      font-size: 0.9rem;
      font-weight: 700;
      color: var(--text-primary);
    }

    .recovery-entry-meta {
      font-size: 0.8rem;
      color: var(--text-secondary);
      line-height: 1.45;
    }

    .recovery-entry-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    .snapshot-overview-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 12px;
      margin-bottom: 16px;
    }

    .snapshot-overview-card {
      padding: 16px;
      border-radius: 18px;
      border: 1px solid var(--border);
      background: var(--bg-secondary);
      display: grid;
      gap: 8px;
      box-shadow: var(--shadow-sm);
    }

    .snapshot-overview-label {
      font-size: 0.76rem;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--text-tertiary);
      font-weight: 700;
    }

    .snapshot-overview-value {
      font-size: 1.55rem;
      font-weight: 780;
      letter-spacing: 0;
      color: var(--text-primary);
      line-height: 1;
    }

    .snapshot-overview-subtitle {
      font-size: 0.86rem;
      color: var(--text-secondary);
      line-height: 1.5;
    }

    .snapshot-toolbar {
      display: grid;
      gap: 14px;
      margin-bottom: 14px;
    }

    .snapshot-search-group {
      margin-bottom: 0;
    }

    .snapshot-tag-row {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .snapshot-tag-button {
      border: 1px solid var(--border);
      background: var(--bg-tertiary);
      color: var(--text-secondary);
      border-radius: 999px;
      padding: 8px 12px;
      font-size: 0.78rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.18s ease;
    }

    .snapshot-tag-button:hover {
      transform: translateY(-1px);
      border-color: var(--border-strong);
      color: var(--text-primary);
    }

    .snapshot-tag-button.active {
      background: var(--accent-muted);
      border-color: rgba(99, 102, 241, 0.18);
      color: var(--accent);
    }

    .snapshot-meta-row {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 12px;
    }

    .snapshot-history-list {
      display: grid;
      gap: 12px;
    }

    .snapshot-history-item {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 14px;
      padding: 14px;
      border-radius: 18px;
      background: var(--bg-primary);
      border: 1px solid var(--border);
    }

    .snapshot-history-main {
      min-width: 0;
      display: grid;
      gap: 8px;
      flex: 1;
    }

    .snapshot-history-top {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 12px;
      flex-wrap: wrap;
    }

    .snapshot-history-title {
      font-size: 0.98rem;
      font-weight: 760;
      color: var(--text-primary);
      margin-bottom: 4px;
    }

    .snapshot-history-meta {
      font-size: 0.8rem;
      color: var(--text-secondary);
      line-height: 1.5;
    }

    .snapshot-history-desc {
      font-size: 0.86rem;
      color: var(--text-secondary);
      line-height: 1.55;
    }

    .snapshot-history-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }

    .snapshot-tag-pill {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 4px 8px;
      border-radius: 999px;
      background: var(--bg-tertiary);
      border: 1px solid var(--border);
      color: var(--text-secondary);
      font-size: 0.7rem;
      font-weight: 600;
    }

    .snapshot-history-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      justify-content: flex-end;
    }

    .snapshot-state-empty {
      padding: 18px;
      border-radius: 18px;
      border: 1px dashed var(--border);
      background: var(--bg-tertiary);
      color: var(--text-secondary);
      line-height: 1.6;
    }

    .desktop-accent-frame {
      position: relative;
      overflow: hidden;
      isolation: isolate;
    }

    .desktop-accent-frame::before {
      content: '';
      position: absolute;
      inset: 0;
      background: linear-gradient(135deg, rgba(99, 70, 227, 0.06), transparent 42%, rgba(47, 209, 168, 0.05));
      pointer-events: none;
      z-index: 0;
    }

    .desktop-accent-frame > * {
      position: relative;
      z-index: 1;
    }

    .page-header-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      flex-wrap: wrap;
    }

    .coming-soon {
      padding: 16px;
      border-radius: var(--radius-md);
      border: 1px dashed var(--border);
      color: var(--text-tertiary);
      background: var(--bg-tertiary);
      font-size: 0.9rem;
    }

    .form-section-title {
      font-size: 1rem;
      font-weight: 600;
      margin-bottom: 20px;
      padding-bottom: 12px;
      border-bottom: 1px solid var(--border);
    }

    .form-group {
      margin-bottom: 20px;
    }

    .form-label {
      display: block;
      font-size: 0.9rem;
      font-weight: 500;
      margin-bottom: 8px;
      color: var(--text-primary);
    }

    .form-input {
      width: 100%;
      padding: 10px 14px;
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      background: var(--bg-primary);
      color: var(--text-primary);
      font-size: 0.9rem;
      font-family: 'Inter', sans-serif;
      transition: all 0.2s ease;
    }

    .form-input:focus {
      outline: none;
      border-color: var(--accent);
      box-shadow: 0 0 0 3px var(--accent-muted);
    }

    .toggle-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 16px 0;
      border-bottom: 1px solid var(--border);
    }

    .toggle-row:last-child {
      border-bottom: none;
    }

    .toggle-info {
      flex: 1;
    }

    .toggle-info p {
      font-weight: 500;
      margin-bottom: 4px;
    }

    .toggle-info span {
      font-size: 0.85rem;
      color: var(--text-secondary);
    }

    .toggle {
      position: relative;
      display: inline-block;
      width: 48px;
      height: 28px;
    }

    .toggle input {
      opacity: 0;
      width: 0;
      height: 0;
    }

    .toggle-slider {
      position: absolute;
      cursor: pointer;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: var(--bg-tertiary);
      transition: 0.3s;
      border-radius: 34px;
    }

    .toggle-slider::before {
      position: absolute;
      content: "";
      height: 20px;
      width: 20px;
      left: 4px;
      bottom: 4px;
      background-color: white;
      transition: 0.3s;
      border-radius: 50%;
    }

    input:checked + .toggle-slider {
      background-color: var(--accent);
    }

    input:checked + .toggle-slider::before {
      transform: translateX(20px);
    }

    .form-actions {
      display: flex;
      gap: 12px;
      margin-top: 24px;
      padding-top: 24px;
      border-top: 1px solid var(--border);
    }

    .btn {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 10px 24px;
      border: none;
      border-radius: var(--radius-md);
      font-size: 0.9rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s ease;
      font-family: 'Inter', sans-serif;
    }

    .btn-primary {
      background: var(--accent);
      color: white;
    }

    .btn-primary:hover {
      background: var(--accent-hover);
      box-shadow: var(--shadow-md);
    }

    .btn-secondary {
      background: var(--bg-tertiary);
      color: var(--text-primary);
    }

    .btn-secondary:hover {
      background: var(--bg-elevated);
    }

    .btn-sm {
      padding: 6px 16px;
      font-size: 0.8rem;
    }

    /* ----------------------------------------------
       STORE
    ---------------------------------------------- */
    .store-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
      gap: 20px;
    }

    .store-layout {
      display: grid;
      gap: 20px;
      margin-bottom: 20px;
    }

    .store-hero {
      display: grid;
      grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
      gap: 18px;
      padding: 24px;
      border-radius: var(--radius-lg);
      border: 1px solid var(--border);
      background: linear-gradient(135deg, rgba(28, 82, 122, 0.24), rgba(14, 25, 40, 0.92));
      box-shadow: var(--shadow-md);
      position: relative;
      overflow: hidden;
    }

    .store-hero::before {
      content: "";
      position: absolute;
      inset: -30% auto auto -8%;
      width: 240px;
      height: 240px;
      background: radial-gradient(circle, rgba(79, 192, 255, 0.2), transparent 68%);
      pointer-events: none;
    }

    .store-hero::after {
      content: "";
      position: absolute;
      inset: auto -10% -22% auto;
      width: 280px;
      height: 280px;
      background: radial-gradient(circle, rgba(145, 240, 203, 0.12), transparent 66%);
      pointer-events: none;
    }

    .store-hero-copy h2 {
      margin: 0 0 10px;
      font-size: clamp(1.7rem, 3vw, 2.6rem);
      line-height: 1.05;
      letter-spacing: 0;
    }

    .store-hero-copy p {
      margin: 0;
      color: var(--text-secondary);
      line-height: 1.7;
      max-width: 62ch;
    }

    .store-hero-actions {
      margin-top: 18px;
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
    }

    .store-hero-badge {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      border-radius: 999px;
      background: rgba(79, 192, 255, 0.12);
      color: var(--accent);
      border: 1px solid rgba(79, 192, 255, 0.2);
      font-size: 0.75rem;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      width: fit-content;
      margin-bottom: 12px;
    }

    .plan-comparison {
      display: grid;
      gap: 12px;
      padding: 20px;
      border-radius: var(--radius-lg);
      background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
      border: 1px solid var(--border);
    }

    .plan-comparison h3 {
      margin: 0 0 2px;
      font-size: 1rem;
    }

    .plan-comparison p {
      margin: 0 0 10px;
      color: var(--text-secondary);
      font-size: 0.85rem;
      line-height: 1.6;
    }

    .plan-comparison-item {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 14px;
      padding: 12px 0;
      border-top: 1px solid var(--border);
    }

    .plan-comparison-item:first-of-type {
      border-top: 0;
      padding-top: 0;
    }

    .plan-comparison-label {
      font-size: 0.84rem;
      color: var(--text-secondary);
      max-width: 18ch;
    }

    .plan-comparison-value {
      text-align: right;
      font-size: 0.84rem;
      color: var(--text-primary);
      font-weight: 600;
      max-width: 24ch;
    }

    .store-divider {
      grid-column: 1 / -1;
      display: flex;
      align-items: center;
      gap: 14px;
      margin: 2px 0;
      color: var(--text-dim);
      font-size: 0.72rem;
      font-weight: 800;
      letter-spacing: 0.16em;
      text-transform: uppercase;
    }

    .store-divider::before,
    .store-divider::after {
      content: "";
      flex: 1;
      height: 1px;
      background: linear-gradient(90deg, transparent, rgba(160, 218, 255, 0.32), transparent);
    }

    .store-divider span {
      padding: 6px 12px;
      border-radius: 999px;
      background: rgba(124, 224, 255, 0.08);
      border: 1px solid rgba(124, 224, 255, 0.12);
    }

    .store-item {
      background: var(--bg-secondary);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 24px;
      display: flex;
      flex-direction: column;
      transition: all 0.2s ease;
    }

    .store-item:hover {
      border-color: var(--border-hover);
      box-shadow: var(--shadow-md);
    }

    .store-item.featured {
      border-color: rgba(79, 192, 255, 0.5);
      background: linear-gradient(180deg, rgba(22, 51, 76, 0.96), rgba(10, 18, 28, 0.96));
      transform: translateY(-2px);
      box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
      position: relative;
      overflow: hidden;
    }

    .store-item.featured::before {
      content: 'Best value';
      position: absolute;
      top: 14px;
      right: 14px;
      padding: 5px 10px;
      border-radius: 999px;
      background: linear-gradient(135deg, rgba(79, 192, 255, 0.2), rgba(79, 192, 255, 0.08));
      color: var(--accent);
      font-size: 0.68rem;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    .store-item.featured::after {
      content: "";
      position: absolute;
      inset: 0;
      background: linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.08) 44%, rgba(255, 255, 255, 0.18) 50%, rgba(255, 255, 255, 0.06) 56%, transparent 100%);
      transform: translateX(-130%) skewX(-18deg);
      transition: transform 900ms ease, opacity 900ms ease;
      opacity: 0;
      pointer-events: none;
    }

    .store-item.featured:hover::after,
    .store-item.featured:focus-within::after {
      transform: translateX(130%) skewX(-18deg);
      opacity: 1;
    }

    .store-item.local {
      border-color: rgba(145, 240, 203, 0.16);
    }

    .store-item.cloud {
      border-color: rgba(124, 224, 255, 0.16);
    }

    .store-item-kicker {
      margin: -4px 0 10px;
      color: var(--accent);
      font-size: 0.72rem;
      font-weight: 800;
      letter-spacing: 0.14em;
      text-transform: uppercase;
    }

    .store-item-icon {
      width: 56px;
      height: 56px;
      border-radius: var(--radius-md);
      background: var(--accent-muted);
      color: var(--accent);
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 16px;
    }

    .store-item-icon svg {
      width: 28px;
      height: 28px;
    }

    .store-item-title {
      font-size: 1.1rem;
      font-weight: 600;
      margin-bottom: 8px;
    }

    .store-item-desc {
      font-size: 0.85rem;
      color: var(--text-secondary);
      margin-bottom: 16px;
      flex: 1;
    }

    .store-item-meta {
      font-size: 0.78rem;
      color: var(--text-dim);
      margin: -6px 0 16px;
      line-height: 1.6;
    }

    .store-item-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .store-item-price {
      font-size: 1rem;
      font-weight: 700;
      color: var(--accent);
    }

    .payment-methods {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 14px;
    }

    .payment-pill {
      padding: 7px 10px;
      border-radius: 999px;
      background: var(--bg-tertiary);
      color: var(--text-secondary);
      border: 1px solid var(--border);
      font-size: 0.72rem;
      font-weight: 700;
      letter-spacing: 0.06em;
      text-transform: uppercase;
    }

    .billing-trust {
      margin-top: 14px;
      padding: 14px 16px;
      border-radius: var(--radius-md);
      background: rgba(79, 192, 255, 0.08);
      border: 1px solid rgba(79, 192, 255, 0.18);
      color: var(--text-secondary);
      font-size: 0.85rem;
      line-height: 1.7;
    }

    html[data-platform="apple"] .store-hero {
      background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08)),
        rgba(14, 25, 40, 0.48);
      border-radius: 32px;
      box-shadow: 0 34px 96px rgba(7, 14, 22, 0.18);
    }

    html[data-platform="apple"] .plan-comparison {
      background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.08));
      border-radius: 28px;
      border-color: rgba(255,255,255,0.14);
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.16);
    }

    html[data-platform="apple"] .store-divider span {
      background: rgba(255, 255, 255, 0.18);
      border-color: rgba(255, 255, 255, 0.14);
      color: var(--text-primary);
    }

    html[data-platform="apple"] .store-item.featured {
      background:
        radial-gradient(circle at top right, rgba(160, 204, 255, 0.18), transparent 38%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(18, 31, 48, 0.26));
      border-color: rgba(139, 187, 255, 0.34);
      box-shadow: 0 26px 72px rgba(12, 24, 38, 0.16);
    }

    html[data-platform="apple"] .store-item.featured:hover,
    html[data-platform="apple"] .store-item.featured:focus-within {
      transform: translateY(-4px);
      box-shadow: 0 32px 84px rgba(12, 24, 38, 0.2);
    }

    html[data-platform="apple"] .store-item.featured::before {
      background: linear-gradient(180deg, rgba(181, 220, 255, 0.52), rgba(181, 220, 255, 0.2));
      border: 1px solid rgba(255, 255, 255, 0.22);
      color: #09203a;
    }

    html[data-platform="apple"] .store-item.featured::after {
      background: linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.04) 42%, rgba(255, 255, 255, 0.24) 50%, rgba(255, 255, 255, 0.06) 58%, transparent 100%);
      opacity: 0;
    }

    html[data-platform="apple"] .store-item.featured:hover::after,
    html[data-platform="apple"] .store-item.featured:focus-within::after {
      opacity: 1;
    }

    html[data-platform="apple"] .store-item.local,
    html[data-platform="apple"] .store-item.cloud {
      background: linear-gradient(180deg, rgba(255,255,255,0.2), rgba(255,255,255,0.08));
    }

    html[data-platform="apple"] .billing-trust {
      background: rgba(127, 177, 255, 0.12);
      border-color: rgba(255, 255, 255, 0.16);
      color: var(--text-primary);
    }

    html[data-platform="apple"] .payment-pill {
      background: rgba(255, 255, 255, 0.18);
      border-color: rgba(255, 255, 255, 0.16);
      color: var(--text-primary);
    }

    html[data-platform="apple"] #billing-modal .modal {
      background:
        radial-gradient(circle at top right, rgba(160, 204, 255, 0.16), transparent 32%),
        linear-gradient(180deg, rgba(255,255,255,0.24), rgba(255,255,255,0.12)),
        rgba(18, 28, 42, 0.62);
      border-radius: 36px;
      border: 1px solid rgba(255, 255, 255, 0.22);
      box-shadow: 0 44px 120px rgba(7, 14, 22, 0.26);
    }

    html[data-platform="apple"] #billing-modal .preview-panel {
      background: rgba(255, 255, 255, 0.12);
      border: 1px solid rgba(255, 255, 255, 0.14);
    }

    /* ----------------------------------------------
       CIRCLES
    ---------------------------------------------- */
    .circles-layout {
      display: grid;
      gap: 20px;
      margin-bottom: 20px;
    }

    .circles-hero {
      display: grid;
      grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
      gap: 18px;
      padding: 24px;
      border-radius: var(--radius-lg);
      border: 1px solid var(--border);
      background: linear-gradient(135deg, rgba(34, 72, 124, 0.24), rgba(12, 22, 36, 0.94));
      box-shadow: var(--shadow-md);
      position: relative;
      overflow: hidden;
    }

    .circles-hero::before {
      content: "";
      position: absolute;
      inset: -18% auto auto -6%;
      width: 240px;
      height: 240px;
      background: radial-gradient(circle, rgba(115, 196, 255, 0.2), transparent 68%);
      pointer-events: none;
    }

    .circles-hero::after {
      content: "";
      position: absolute;
      inset: auto -12% -18% auto;
      width: 280px;
      height: 280px;
      background: radial-gradient(circle, rgba(124, 255, 214, 0.12), transparent 66%);
      pointer-events: none;
    }

    .circles-hero-copy h2 {
      margin: 0 0 10px;
      font-size: clamp(1.7rem, 3vw, 2.6rem);
      line-height: 1.05;
      letter-spacing: 0;
    }

    .circles-hero-copy p {
      margin: 0;
      color: var(--text-secondary);
      line-height: 1.7;
      max-width: 62ch;
    }

    .circles-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
      gap: 20px;
    }

    .circle-section {
      display: grid;
      gap: 14px;
    }

    .circle-stat-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
    }

    .circle-stat {
      padding: 14px;
      border-radius: 18px;
      background: rgba(255,255,255,0.04);
      border: 1px solid var(--border);
    }

    .circle-stat strong {
      display: block;
      font-size: 1rem;
      margin-bottom: 4px;
    }

    .circle-stat span {
      color: var(--text-secondary);
      font-size: 0.88rem;
      line-height: 1.45;
    }

    .circle-list {
      display: grid;
      gap: 12px;
    }

    .circle-card {
      padding: 16px;
      border-radius: 20px;
      border: 1px solid var(--border);
      background: rgba(255,255,255,0.04);
      display: grid;
      gap: 12px;
    }

    .circle-card.active {
      border-color: rgba(79, 192, 255, 0.35);
      background: linear-gradient(180deg, rgba(79, 192, 255, 0.12), rgba(255,255,255,0.04));
    }

    .circle-card-top {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: flex-start;
    }

    .circle-card-title {
      font-size: 1.05rem;
      font-weight: 700;
      margin-bottom: 4px;
    }

    .circle-card-desc {
      font-size: 0.86rem;
      color: var(--text-secondary);
      line-height: 1.55;
    }

    .circle-chip-row,
    .circle-action-row {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .circle-chip {
      padding: 6px 10px;
      border-radius: 999px;
      background: rgba(255,255,255,0.06);
      border: 1px solid var(--border);
      color: var(--text-secondary);
      font-size: 0.72rem;
      font-weight: 700;
      letter-spacing: 0.04em;
      text-transform: uppercase;
    }

    .circle-chip-remove {
      appearance: none;
      border: none;
      background: transparent;
      color: inherit;
      font: inherit;
      cursor: pointer;
      padding: 0 0 0 6px;
      line-height: 1;
    }

    .circle-chip.primary {
      background: rgba(79, 192, 255, 0.12);
      color: var(--accent);
      border-color: rgba(79, 192, 255, 0.2);
    }

    .circle-policy-grid,
    .circle-member-editor {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
      align-items: end;
    }

    .circle-toggle-row {
      margin: 0;
      border-radius: 8px;
      background: rgba(255,255,255,0.035);
    }

    .circle-member-editor {
      grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(120px, 0.5fr) auto;
    }

    .circle-health-strip {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .circle-health-pill {
      display: inline-flex;
      align-items: center;
      min-height: 28px;
      border: 1px solid var(--border);
      border-radius: 999px;
      padding: 5px 10px;
      background: rgba(255,255,255,0.045);
      color: var(--text-secondary);
      font-size: 0.74rem;
      font-weight: 800;
    }

    .circle-health-pill.ok {
      border-color: rgba(52, 211, 153, 0.26);
      color: var(--success);
    }

    .circle-health-pill.warn {
      border-color: rgba(251, 191, 36, 0.3);
      color: var(--warning);
    }

    .circle-health-pill.info {
      border-color: rgba(79, 192, 255, 0.28);
      color: var(--accent);
    }

    .circle-empty {
      padding: 16px;
      border-radius: 18px;
      border: 1px dashed var(--border);
      background: rgba(255,255,255,0.03);
      color: var(--text-secondary);
      line-height: 1.6;
      font-size: 0.9rem;
    }

    .circle-codebox {
      padding: 14px;
      border-radius: 18px;
      border: 1px solid var(--border);
      background: rgba(0,0,0,0.16);
      color: var(--text-primary);
      font-size: 0.82rem;
      line-height: 1.7;
      word-break: break-word;
      white-space: pre-wrap;
      min-height: 110px;
      user-select: text;
    }

    .circle-roster {
      display: grid;
      gap: 10px;
    }

    .circle-member {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: center;
      padding: 12px 14px;
      border-radius: 16px;
      border: 1px solid var(--border);
      background: rgba(255,255,255,0.04);
    }

    .circle-member > div:first-child {
      min-width: 0;
    }

    .circle-member strong {
      display: block;
      font-size: 0.95rem;
      margin-bottom: 2px;
    }

    .circle-member span {
      color: var(--text-secondary);
      font-size: 0.82rem;
    }

    .circle-member-actions {
      display: flex;
      gap: 8px;
      align-items: center;
      flex: 0 0 auto;
    }

    .circle-member-actions .form-input {
      min-width: 118px;
      min-height: 36px;
      padding: 7px 10px;
      font-size: 0.8rem;
    }

    .circle-collection-list {
      display: grid;
      gap: 12px;
    }

    .circle-collection {
      display: grid;
      gap: 10px;
      padding: 14px;
      border-radius: 18px;
      border: 1px solid var(--border);
      background: rgba(255,255,255,0.04);
    }

    .circle-collection-top {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: flex-start;
    }

    .circle-collection-title {
      font-size: 0.98rem;
      font-weight: 700;
      margin-bottom: 2px;
    }

    .circle-collection-meta {
      color: var(--text-secondary);
      font-size: 0.82rem;
      line-height: 1.5;
    }

    .circle-activity {
      display: grid;
      gap: 10px;
    }

    .circle-activity-item {
      padding: 12px 14px;
      border-radius: 16px;
      border: 1px solid var(--border);
      background: rgba(255,255,255,0.03);
      color: var(--text-secondary);
      font-size: 0.84rem;
      line-height: 1.55;
    }

    .circle-input-row {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }

    .circle-input-row .form-group {
      margin: 0;
    }

    .circle-presets {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 14px;
    }

    .circle-preset {
      appearance: none;
      border: 1px solid var(--border);
      background: rgba(255,255,255,0.05);
      color: var(--text-primary);
      border-radius: 999px;
      padding: 8px 12px;
      font-size: 0.78rem;
      font-weight: 700;
      letter-spacing: 0.03em;
      cursor: pointer;
      transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
    }

    .circle-preset:hover {
      transform: translateY(-1px);
      border-color: rgba(79, 192, 255, 0.3);
      background: rgba(79, 192, 255, 0.08);
    }

    .circle-preset.active {
      border-color: rgba(79, 192, 255, 0.35);
      background: rgba(79, 192, 255, 0.12);
      color: var(--accent);
    }

    .circle-active-cta {
      display: grid;
      gap: 8px;
    }

    .circle-invite-summary {
      display: grid;
      gap: 14px;
    }

    .circle-invite-layout {
      display: grid;
      grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.85fr);
      gap: 18px;
      align-items: start;
      flex: 1 1 auto;
      min-height: 0;
      overflow: auto;
      -webkit-overflow-scrolling: touch;
    }

    .circle-invite-panel {
      padding: 16px;
      border-radius: 20px;
      border: 1px solid var(--border);
      background: rgba(255,255,255,0.04);
      display: grid;
      gap: 12px;
    }

    .circle-invite-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .circle-invite-meta .feature-chip {
      padding: 7px 10px;
      font-size: 0.76rem;
    }

    .circle-invite-code {
      font-size: 0.8rem;
      line-height: 1.65;
      word-break: break-word;
      white-space: pre-wrap;
      color: var(--text-primary);
      padding: 14px;
      border-radius: 16px;
      border: 1px solid var(--border);
      background: rgba(0,0,0,0.16);
      min-height: 108px;
      user-select: text;
    }

    .circle-invite-qr {
      min-height: 260px;
    }

    .circle-collection-toolbar {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
      justify-content: space-between;
    }

    html[data-platform="apple"] .circles-hero {
      background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08)),
        rgba(12, 22, 36, 0.56);
      border-radius: 32px;
      box-shadow: 0 34px 96px rgba(7, 14, 22, 0.18);
    }

    html[data-platform="apple"] .circle-card,
    html[data-platform="apple"] .circle-stat,
    html[data-platform="apple"] .circle-member,
    html[data-platform="apple"] .circle-collection,
    html[data-platform="apple"] .circle-activity-item,
    html[data-platform="apple"] .circle-codebox {
      background: rgba(255,255,255,0.12);
      border-color: rgba(255,255,255,0.14);
    }

    html[data-platform="apple"] .circle-card.active {
      background: linear-gradient(180deg, rgba(79, 192, 255, 0.18), rgba(255,255,255,0.1));
      border-color: rgba(79, 192, 255, 0.3);
    }

    html[data-platform="android"] .sidebar,
    html[data-platform="android"] .topbar,
    html[data-platform="android"] .page-header,
    html[data-platform="android"] .card,
    html[data-platform="android"] .status-card,
    html[data-platform="android"] .form-section,
    html[data-platform="android"] .preview-panel,
    html[data-platform="android"] .file-manager,
    html[data-platform="android"] .store-item,
    html[data-platform="android"] .profile-header,
    html[data-platform="android"] .modal,
    html[data-platform="android"] .offline-banner,
    html[data-platform="android"] .offline-banner-panel,
    html[data-platform="android"] .doc-card,
    html[data-platform="android"] .consent-panel,
    html[data-platform="android"] .theme-switcher,
    html[data-platform="android"] .bottom-nav,
    html[data-platform="android"] .vault-command-strip {
      background: linear-gradient(180deg, rgba(12, 24, 38, 0.72), rgba(12, 24, 38, 0.52));
      border: 1px solid rgba(124, 224, 255, 0.12);
      backdrop-filter: blur(20px) saturate(140%);
      -webkit-backdrop-filter: blur(20px) saturate(140%);
      box-shadow: 0 16px 42px rgba(2, 10, 18, 0.14);
    }

    html[data-platform="windows"] .sidebar,
    html[data-platform="windows"] .topbar,
    html[data-platform="windows"] .page-header,
    html[data-platform="windows"] .card,
    html[data-platform="windows"] .status-card,
    html[data-platform="windows"] .form-section,
    html[data-platform="windows"] .preview-panel,
    html[data-platform="windows"] .file-manager,
    html[data-platform="windows"] .store-item,
    html[data-platform="windows"] .profile-header,
    html[data-platform="windows"] .modal,
    html[data-platform="windows"] .offline-banner,
    html[data-platform="windows"] .offline-banner-panel,
    html[data-platform="windows"] .doc-card,
    html[data-platform="windows"] .consent-panel,
    html[data-platform="windows"] .theme-switcher,
    html[data-platform="windows"] .bottom-nav,
    html[data-platform="windows"] .vault-command-strip {
      background: linear-gradient(180deg, rgba(255,255,255,0.11), rgba(255,255,255,0.06));
      border: 1px solid rgba(120, 182, 255, 0.14);
      backdrop-filter: blur(18px) saturate(130%);
      -webkit-backdrop-filter: blur(18px) saturate(130%);
      box-shadow: 0 16px 38px rgba(6, 18, 32, 0.12);
    }

    html[data-platform="macos"] .sidebar,
    html[data-platform="macos"] .topbar,
    html[data-platform="macos"] .page-header,
    html[data-platform="macos"] .card,
    html[data-platform="macos"] .status-card,
    html[data-platform="macos"] .form-section,
    html[data-platform="macos"] .preview-panel,
    html[data-platform="macos"] .file-manager,
    html[data-platform="macos"] .store-item,
    html[data-platform="macos"] .profile-header,
    html[data-platform="macos"] .modal,
    html[data-platform="macos"] .offline-banner,
    html[data-platform="macos"] .offline-banner-panel,
    html[data-platform="macos"] .doc-card,
    html[data-platform="macos"] .consent-panel,
    html[data-platform="macos"] .theme-switcher,
    html[data-platform="macos"] .bottom-nav,
    html[data-platform="macos"] .vault-command-strip {
      background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.07));
      border: 1px solid rgba(134, 183, 255, 0.14);
      backdrop-filter: blur(22px) saturate(145%);
      -webkit-backdrop-filter: blur(22px) saturate(145%);
      box-shadow: 0 18px 48px rgba(6, 16, 28, 0.14);
    }

    html[data-platform="macos"] {
      font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', sans-serif;
    }

    html[data-platform="macos"] .sidebar {
      background:
        linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.08)),
        transparent;
      border-right: 1px solid var(--border);
    }

    html[data-platform="macos"] .brand-icon {
      border-radius: 13px;
      background: linear-gradient(180deg, rgba(255,255,255,0.34), rgba(255,255,255,0.14));
      border: 1px solid rgba(255,255,255,0.24);
      box-shadow: 0 14px 32px rgba(93, 138, 214, 0.18);
    }

    html[data-platform="macos"] .nav-item,
    html[data-platform="macos"] .bottom-nav-item,
    html[data-platform="macos"] .topbar-btn,
    html[data-platform="macos"] .theme-btn,
    html[data-platform="macos"] .profile-btn,
    html[data-platform="macos"] .preview-btn,
    html[data-platform="macos"] .fm-btn,
    html[data-platform="macos"] .modal-btn,
    html[data-platform="macos"] .link-btn,
    html[data-platform="macos"] .btn {
      border-radius: 14px;
    }

    html[data-platform="macos"] .btn-primary,
    html[data-platform="macos"] .fm-btn-primary,
    html[data-platform="macos"] .modal-btn-primary,
    html[data-platform="macos"] .preview-btn.primary,
    html[data-platform="macos"] .landing-primary {
      background: linear-gradient(180deg, rgba(141, 188, 255, 0.96), rgba(102, 157, 236, 0.92));
      color: #071c34;
      border: 1px solid rgba(255,255,255,0.34);
      box-shadow: 0 18px 38px rgba(95, 148, 226, 0.18);
    }

    html[data-platform="macos"] .btn-secondary,
    html[data-platform="macos"] .modal-btn-secondary,
    html[data-platform="macos"] .landing-secondary {
      background: linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.1));
      border: 1px solid var(--border);
      color: var(--text-primary);
    }

    html[data-platform="macos"] .form-input,
    html[data-platform="macos"] .fm-input,
    html[data-platform="macos"] .fm-select,
    html[data-platform="macos"] select,
    html[data-platform="macos"] input[type="text"],
    html[data-platform="macos"] input[type="email"],
    html[data-platform="macos"] input[type="password"],
    html[data-platform="macos"] input[type="tel"],
    html[data-platform="macos"] input[type="url"] {
      background: rgba(255,255,255,0.16);
      border: 1px solid var(--border);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border-radius: 14px;
    }

    html[data-platform="macos"] .page-header,
    html[data-platform="macos"] .modal {
      border-radius: 28px;
    }

    .circle-collection {
      overflow: hidden;
    }

    .circle-collection.active {
      border-color: rgba(79, 192, 255, 0.3);
      background: linear-gradient(180deg, rgba(79, 192, 255, 0.1), rgba(255,255,255,0.04));
      box-shadow: 0 20px 40px rgba(79, 192, 255, 0.06);
    }

    .circle-collection-cover {
      position: relative;
      min-height: 120px;
      border-radius: 16px;
      padding: 14px;
      border: 1px solid rgba(255,255,255,0.08);
      background:
        radial-gradient(circle at top right, rgba(79, 192, 255, 0.2), transparent 42%),
        linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
      display: grid;
      align-content: space-between;
      gap: 10px;
    }

    .circle-collection-cover strong {
      display: block;
      font-size: 1rem;
      color: var(--text-primary);
    }

    .circle-collection-cover span {
      color: var(--text-secondary);
      font-size: 0.82rem;
      line-height: 1.45;
    }

    .circle-collection-badge {
      justify-self: start;
    }

    .circle-collection-preview {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }

    .circle-collection-preview-item {
      min-height: 58px;
      border-radius: 14px;
      border: 1px solid rgba(255,255,255,0.08);
      background: rgba(0,0,0,0.18);
      padding: 10px;
      display: grid;
      align-content: center;
      gap: 2px;
      overflow: hidden;
    }

    .circle-collection-preview-item strong {
      font-size: 0.76rem;
      line-height: 1.3;
      color: var(--text-primary);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .circle-collection-preview-item span {
      font-size: 0.68rem;
      color: var(--text-secondary);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .circle-collection-preview-empty {
      min-height: 58px;
      border-radius: 14px;
      border: 1px dashed rgba(255,255,255,0.12);
      background: rgba(255,255,255,0.03);
      color: var(--text-secondary);
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      padding: 10px;
      font-size: 0.76rem;
      line-height: 1.45;
    }

    .circle-invite-modal .modal {
      max-width: 920px;
      width: min(92vw, 920px);
    }

    .circle-invite-modal .modal-content {
      margin-bottom: 20px;
    }

    /* ----------------------------------------------
       PROFILE
    ---------------------------------------------- */
    .profile-header {
      display: flex;
      align-items: center;
      gap: 24px;
      margin-bottom: 20px;
      padding: clamp(20px, 3vw, 32px);
      border: 1px solid var(--border);
      border-radius: 26px;
      background:
        radial-gradient(circle at 12% 0%, rgba(99, 102, 241, 0.19), transparent 34%),
        radial-gradient(circle at 100% 100%, rgba(34, 197, 94, 0.08), transparent 30%),
        linear-gradient(145deg, var(--bg-secondary), var(--bg-primary));
      box-shadow: var(--shadow-md);
    }

    .profile-avatar-column {
      display: grid;
      justify-items: center;
      gap: 10px;
      flex-shrink: 0;
    }

    .profile-avatar {
      width: 104px;
      height: 104px;
      border-radius: 50%;
      border: 4px solid color-mix(in srgb, var(--bg-secondary) 82%, transparent);
      background:
        radial-gradient(circle at 28% 20%, rgba(255,255,255,0.38), transparent 38%),
        linear-gradient(145deg, var(--accent), var(--accent-hover));
      display: grid;
      place-items: center;
      font-size: 2rem;
      font-weight: 800;
      letter-spacing: 0.04em;
      color: white;
      box-shadow: 0 14px 32px rgba(0,0,0,0.24), inset 0 1px 0 rgba(255,255,255,0.28);
      text-transform: uppercase;
    }

    .profile-avatar-caption,
    .profile-eyebrow,
    .profile-detail-label,
    .profile-local-tag {
      color: var(--text-tertiary);
      font-size: 0.7rem;
      font-weight: 800;
      letter-spacing: 0.11em;
      text-transform: uppercase;
    }

    .profile-avatar-caption {
      text-align: center;
      letter-spacing: 0.04em;
      text-transform: none;
      font-size: 0.72rem;
    }

    .profile-info {
      flex: 1;
      min-width: 0;
    }

    .profile-eyebrow {
      margin-bottom: 8px;
      color: var(--accent);
    }

    .profile-name {
      margin: 0;
      font-size: clamp(1.45rem, 3vw, 2rem);
      font-weight: 780;
      letter-spacing: 0;
      line-height: 1.15;
      overflow-wrap: anywhere;
    }

    .profile-username {
      margin: 5px 0 0;
      color: var(--accent);
      font-weight: 650;
      font-size: 0.96rem;
      overflow-wrap: anywhere;
    }

    .profile-email {
      margin-top: 4px;
      font-size: 0.9rem;
      color: var(--text-secondary);
      margin-bottom: 14px;
      overflow-wrap: anywhere;
    }

    .profile-badges {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .profile-badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      font-size: 0.75rem;
      font-weight: 600;
      padding: 6px 12px;
      border-radius: 100px;
      background: var(--accent-muted);
      color: var(--accent);
    }

    .profile-actions {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 12px;
      margin-top: 18px;
    }

    .profile-btn {
      padding: 8px 20px;
      border: 1px solid var(--border);
      background: transparent;
      color: var(--text-primary);
      border-radius: var(--radius-md);
      font-size: 0.85rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .profile-btn-primary {
      border-color: transparent;
      color: var(--button-primary-text, #fff);
      background: linear-gradient(135deg, var(--accent), var(--accent-hover));
      box-shadow: 0 8px 20px rgba(0,0,0,0.16);
    }

    .profile-btn-primary:hover {
      color: #fff;
      filter: brightness(1.08);
    }

    .profile-btn:hover {
      border-color: var(--accent);
      color: var(--accent);
    }

    .profile-detail-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 12px;
      margin-bottom: 10px;
    }

    .profile-detail-card {
      display: grid;
      align-content: start;
      gap: 7px;
      min-width: 0;
      min-height: 104px;
      padding: 16px;
      border: 1px solid var(--border);
      border-radius: 18px;
      background: linear-gradient(155deg, rgba(255,255,255,0.035), transparent 70%), var(--bg-secondary);
    }

    .profile-identity-card {
      background:
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.09), transparent 55%),
        var(--bg-secondary);
    }

    .profile-detail-card strong,
    .profile-detail-link {
      color: var(--text-primary);
      font-size: 0.94rem;
      font-weight: 700;
      overflow-wrap: anywhere;
    }

    .profile-detail-note {
      color: var(--text-tertiary);
      font-size: 0.76rem;
      line-height: 1.4;
    }

    .profile-detail-link {
      color: var(--accent);
      text-decoration: none;
    }

    .profile-detail-link:hover {
      text-decoration: underline;
    }

    .profile-storage-note,
    .profile-edit-copy {
      color: var(--text-tertiary);
      font-size: 0.82rem;
      line-height: 1.5;
    }

    .profile-storage-note {
      margin: 0 2px 26px;
    }

    .profile-edit-section[hidden],
    #profile-overview[hidden] {
      display: none !important;
    }

    .profile-edit-card {
      max-width: 780px;
      border: 1px solid var(--border);
      border-radius: 22px;
      background:
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.08), transparent 45%),
        var(--bg-secondary);
    }

    .profile-edit-heading {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 10px;
    }

    .profile-edit-heading .form-section-title {
      margin-bottom: 5px;
    }

    .profile-edit-copy {
      margin: 0;
    }

    .profile-local-tag {
      flex-shrink: 0;
      padding: 7px 9px;
      border: 1px solid var(--border);
      border-radius: 999px;
      background: rgba(255,255,255,0.035);
      font-size: 0.62rem;
    }

    .profile-bio-input {
      min-height: 92px;
      resize: vertical;
    }

    /* ----------------------------------------------
       MODALS
    ---------------------------------------------- */
    .modal-overlay {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.6);
      backdrop-filter: blur(4px);
      z-index: 200;
      align-items: center;
      justify-content: center;
      padding: 24px;
      overflow-y: auto;
      overscroll-behavior: contain;
      -webkit-overflow-scrolling: touch;
      animation: fadeIn 0.2s ease;
    }

    .modal-overlay.active {
      display: flex;
    }

    @keyframes fadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }

    .modal {
      background: var(--bg-secondary);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 28px;
      max-width: 500px;
      width: 90%;
      max-height: min(88vh, calc(100dvh - 48px));
      overflow: hidden;
      display: flex;
      flex-direction: column;
      animation: slideUp 0.3s ease;
      box-sizing: border-box;
    }

    #billing-modal .modal {
      background: #11151f;
      color: #f7f9ff;
    }

    #billing-modal .modal-content {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    #billing-modal .preview-panel {
      background: #1a2030;
    }

    #billing-modal #billing-status:empty {
      display: none;
    }

    @keyframes slideUp {
      from {
        opacity: 0;
        transform: translateY(20px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .modal-title {
      font-size: 1.25rem;
      font-weight: 700;
      margin-bottom: 16px;
    }

    .modal-content {
      margin-bottom: 24px;
      color: var(--text-secondary);
      font-size: 0.95rem;
      min-height: 0;
      overflow: auto;
      -webkit-overflow-scrolling: touch;
    }

    .auth-modal-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 12px;
      align-items: start;
    }

    .auth-modal-main,
    .auth-modal-aside {
      border-radius: 22px;
      border: 1px solid var(--border);
      background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent), var(--bg-secondary);
      padding: 18px;
    }

    .auth-modal-main {
      display: grid;
      gap: 12px;
      max-width: 100%;
      border: 0;
      padding: 0;
      background: transparent;
    }

    .auth-modal-aside {
      display: grid;
      gap: 12px;
      align-content: start;
      background:
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.18), transparent 34%),
        radial-gradient(circle at bottom left, rgba(34, 197, 94, 0.09), transparent 28%),
        linear-gradient(180deg, rgba(255,255,255,0.04), transparent),
        var(--bg-primary);
    }

    .auth-modal-kicker {
      font-size: 0.76rem;
      text-transform: uppercase;
      letter-spacing: 0.14em;
      color: var(--text-tertiary);
      font-weight: 800;
    }

    .auth-modal-title {
      font-size: 1.05rem;
      font-weight: 760;
      color: var(--text-primary);
      letter-spacing: 0;
      line-height: 1.15;
    }

    .auth-modal-copy {
      color: var(--text-secondary);
      line-height: 1.6;
      font-size: 0.92rem;
    }

    .auth-identity-card {
      display: grid;
      grid-template-columns: auto 1fr;
      gap: 12px;
      align-items: center;
      margin: 14px 0;
      padding: 14px;
      border: 1px solid var(--border);
      border-radius: 14px;
      background: rgba(255,255,255,0.04);
    }

    .auth-identity-mark {
      width: 42px;
      height: 42px;
      border-radius: 12px;
      display: grid;
      place-items: center;
      font-weight: 900;
      color: #08111f;
      background: linear-gradient(135deg, var(--accent), var(--accent-hover));
      box-shadow: 0 12px 24px rgba(0,0,0,0.24);
    }

    .auth-identity-card strong,
    .auth-identity-card span {
      display: block;
    }

    .auth-identity-card strong {
      margin-bottom: 3px;
      color: var(--text-primary);
      font-size: 0.96rem;
    }

    .auth-identity-card span {
      color: var(--text-secondary);
      font-size: 0.86rem;
      line-height: 1.45;
    }

    .auth-consent-check {
      margin-top: 8px;
    }

    .auth-modal-pills {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .auth-modal-pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 8px 10px;
      border-radius: 999px;
      border: 1px solid var(--border);
      background: rgba(255,255,255,0.04);
      color: var(--text-secondary);
      font-size: 0.8rem;
      font-weight: 700;
    }

    .auth-modal-steps {
      display: grid;
      gap: 10px;
    }

    .auth-modal-step {
      padding: 12px 13px;
      border-radius: 16px;
      border: 1px solid var(--border);
      background: rgba(255,255,255,0.03);
      color: var(--text-secondary);
      line-height: 1.5;
      font-size: 0.88rem;
    }

    .auth-modal-step strong {
      display: block;
      color: var(--text-primary);
      margin-bottom: 3px;
      font-size: 0.92rem;
    }

    .modal-actions {
      display: flex;
      gap: 12px;
      justify-content: flex-end;
      flex-wrap: wrap;
    }

    .modal-actions .modal-btn {
      flex: 0 1 auto;
    }

    .modal-btn {
      padding: 8px 20px;
      border: none;
      border-radius: var(--radius-md);
      font-size: 0.9rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .modal-btn[aria-disabled="true"],
    .modal-btn:disabled {
      opacity: 0.55;
      cursor: not-allowed;
      transform: none;
    }

    .modal-btn[data-loading="true"]::before {
      content: "";
      width: 14px;
      height: 14px;
      border-radius: 50%;
      border: 2px solid currentColor;
      border-right-color: transparent;
      display: inline-block;
      margin-right: 8px;
      vertical-align: -2px;
      animation: spin 0.8s linear infinite;
    }

    .modal-btn-primary {
      background: var(--accent);
      color: white;
    }

    .modal-btn-primary:hover {
      background: var(--accent-hover);
    }

    .modal-btn-secondary {
      background: var(--bg-tertiary);
      color: var(--text-primary);
    }

    .modal-btn-secondary:hover {
      background: var(--bg-elevated);
    }

    .permission-modal .modal {
      max-width: 760px;
      width: min(92vw, 760px);
    }

    .permission-layout {
      display: grid;
      grid-template-columns: minmax(0, 1.05fr) minmax(240px, 0.85fr);
      gap: 18px;
      align-items: start;
      flex: 1 1 auto;
      min-height: 0;
      overflow: auto;
      -webkit-overflow-scrolling: touch;
    }

    .permission-visual,
    .permission-panel {
      display: grid;
      gap: 12px;
    }

    .permission-visual {
      padding: 18px;
      border-radius: 20px;
      border: 1px solid var(--border);
      background:
        radial-gradient(circle at top right, rgba(79, 192, 255, 0.18), transparent 34%),
        rgba(255,255,255,0.04);
    }

    .permission-lead {
      color: var(--text-secondary);
      font-size: 0.96rem;
      line-height: 1.6;
      margin: 0;
    }

    .permission-list {
      display: grid;
      gap: 8px;
      margin: 0;
      padding: 0;
      list-style: none;
    }

    .permission-list li {
      display: flex;
      gap: 10px;
      align-items: flex-start;
      color: var(--text-secondary);
      font-size: 0.86rem;
      line-height: 1.55;
    }

    .permission-list li::before {
      content: '';
      width: 8px;
      height: 8px;
      margin-top: 7px;
      border-radius: 999px;
      background: var(--accent);
      flex: 0 0 auto;
    }

    .permission-badge-row {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .permission-badge {
      padding: 7px 10px;
      border-radius: 999px;
      border: 1px solid var(--border);
      background: rgba(255,255,255,0.05);
      color: var(--text-secondary);
      font-size: 0.74rem;
      font-weight: 700;
      letter-spacing: 0.03em;
      text-transform: uppercase;
    }

    .permission-copy-box {
      padding: 14px;
      border-radius: 16px;
      border: 1px solid var(--border);
      background: rgba(0,0,0,0.16);
      color: var(--text-primary);
      font-size: 0.88rem;
      line-height: 1.6;
    }

    .app-dialog-modal .modal {
      max-width: 680px;
      width: min(92vw, 680px);
      background: var(--bg-primary);
    }

    .backup-drop-overlay {
      display: none;
      position: fixed;
      inset: 14px;
      z-index: 10000;
      place-items: center;
      border: 2px dashed rgba(79, 192, 255, 0.82);
      border-radius: 28px;
      background: rgba(6, 14, 24, 0.86);
      backdrop-filter: blur(12px);
      pointer-events: none;
    }

    .backup-drop-overlay.active {
      display: grid;
    }

    .backup-drop-card {
      display: grid;
      justify-items: center;
      gap: 12px;
      max-width: 460px;
      padding: 30px;
      text-align: center;
      color: #fff;
    }

    .backup-drop-card strong {
      font-size: clamp(1.2rem, 3vw, 1.7rem);
    }

    .backup-drop-card > span:last-child {
      color: rgba(255, 255, 255, 0.78);
      line-height: 1.55;
    }

    .backup-drop-icon {
      display: grid;
      width: 56px;
      height: 56px;
      place-items: center;
      border-radius: 18px;
      background: rgba(79, 192, 255, 0.18);
      color: #78d5ff;
      font-size: 2rem;
    }

    .app-dialog-input-wrap[hidden] {
      display: none !important;
    }

    .app-dialog-layout {
      display: grid;
      gap: 14px;
      flex: 1 1 auto;
      min-height: 0;
      overflow: auto;
      -webkit-overflow-scrolling: touch;
    }

    .app-dialog-message {
      color: var(--text-secondary);
      font-size: 0.95rem;
      line-height: 1.65;
      white-space: pre-wrap;
    }

    .app-dialog-input-wrap {
      display: grid;
      gap: 8px;
    }

    .app-dialog-input {
      width: 100%;
      border-radius: 14px;
      border: 1px solid var(--border);
      background: rgba(255,255,255,0.05);
      color: var(--text-primary);
      padding: 12px 14px;
      font-size: 0.95rem;
      outline: none;
    }

    .app-dialog-input:focus {
      border-color: rgba(79, 192, 255, 0.35);
      box-shadow: 0 0 0 4px rgba(79, 192, 255, 0.12);
    }

    .app-dialog-note {
      color: var(--text-tertiary);
      font-size: 0.8rem;
      line-height: 1.5;
    }

    .feedback-modal .modal {
      max-width: 760px;
      width: min(94vw, 760px);
    }

    .feedback-layout {
      display: grid;
      grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1.15fr);
      gap: 16px;
      align-items: start;
      flex: 1 1 auto;
      min-height: 0;
      overflow: auto;
      -webkit-overflow-scrolling: touch;
    }

    .feedback-panel {
      display: grid;
      gap: 12px;
    }

    .feedback-field {
      display: grid;
      gap: 8px;
    }

    .feedback-rating {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 8px;
    }

    .feedback-rating-btn {
      border: 1px solid var(--border);
      background: rgba(255,255,255,0.05);
      color: var(--text-primary);
      border-radius: 14px;
      min-height: 44px;
      font-weight: 700;
      cursor: pointer;
      transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
    }

    .feedback-rating-btn.active {
      border-color: rgba(124, 140, 255, 0.5);
      background: rgba(124, 140, 255, 0.16);
    }

    .feedback-rating-btn:hover {
      transform: translateY(-1px);
    }

    .feedback-note-box {
      padding: 14px;
      border-radius: 16px;
      border: 1px solid var(--border);
      background: rgba(0,0,0,0.14);
      color: var(--text-secondary);
      font-size: 0.88rem;
      line-height: 1.6;
    }

    /* ----------------------------------------------
       TOAST NOTIFICATIONS
    ---------------------------------------------- */
    .toast-container {
      position: fixed;
      bottom: calc(var(--bottom-nav-height) + 12px);
      right: 12px;
      z-index: 300;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .toast {
      background: var(--bg-elevated);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      padding: 12px 16px;
      display: flex;
      align-items: center;
      gap: 12px;
      animation: slideIn 0.3s ease;
      min-width: 280px;
    }

    @keyframes slideIn {
      from {
        opacity: 0;
        transform: translateX(100%);
      }
      to {
        opacity: 1;
        transform: translateX(0);
      }
    }

    .toast.success {
      border-color: var(--success);
      background: linear-gradient(135deg, rgba(52, 211, 153, 0.05), rgba(52, 211, 153, 0.02));
    }

    .toast.success .toast-icon {
      color: var(--success);
    }

    .toast.error {
      border-color: var(--danger);
      background: linear-gradient(135deg, rgba(248, 113, 113, 0.05), rgba(248, 113, 113, 0.02));
    }

    .toast.error .toast-icon {
      color: var(--danger);
    }

    .toast-icon {
      flex-shrink: 0;
    }

    .toast-icon svg {
      width: 20px;
      height: 20px;
    }

    .toast-message {
      flex: 1;
      font-size: 0.9rem;
    }

    .hidden-input {
      display: none;
    }

    /* ----------------------------------------------
       BOTTOM NAV (MOBILE)
    ---------------------------------------------- */
    .bottom-nav {
      display: none;
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      z-index: 100;
      background: var(--bg-secondary);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border-top: 1px solid var(--border);
      padding-bottom: env(safe-area-inset-bottom, 0px);
      height: calc(68px + env(safe-area-inset-bottom, 0px));
      overflow: hidden;
    }

    .bottom-nav-items {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      height: 68px;
      gap: 4px;
      overflow-x: auto;
      overflow-y: hidden;
      overscroll-behavior-x: contain;
      scroll-snap-type: x proximity;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
      padding: 0 8px;
    }

    .bottom-nav-items::-webkit-scrollbar {
      display: none;
    }

    .bottom-nav-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 4px;
      padding: 6px;
      border: none;
      background: transparent;
      color: var(--text-secondary);
      font-size: 0.65rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s ease;
      flex: 0 0 72px;
      height: 100%;
      min-width: 72px;
      scroll-snap-align: center;
      white-space: nowrap;
    }

    .bottom-nav-item:hover,
    .bottom-nav-item.active {
      color: var(--accent);
    }

    .bottom-nav-item svg {
      width: 24px;
      height: 24px;
    }

    /* ----------------------------------------------
       RESPONSIVE
    ---------------------------------------------- */

/* mobile.css */
/* Mobile, responsive, touch, and final viewport overrides. */

    @media (max-width: 768px) {
      :root {
        --bottom-nav-height: 78px;
      }

      body {
        min-height: 100dvh;
      }

      .app {
        min-height: 100dvh;
      }

      html[data-platform="apple"] .topbar {
        top: 10px;
        left: 10px;
        right: 10px;
        width: calc(100% - 20px);
        border-radius: 22px;
        background: linear-gradient(180deg, rgba(255,255,255,0.2), rgba(255,255,255,0.08));
        border: 1px solid var(--border);
        box-shadow: 0 14px 34px rgba(11, 24, 42, 0.12);
      }

      html[data-platform="apple"] .main {
        margin-top: calc(74px + env(safe-area-inset-top, 0px));
        padding: 12px 12px 96px;
      }

      html[data-platform="apple"] .bottom-nav {
        display: flex;
        flex-direction: column;
        left: 10px;
        right: 10px;
        bottom: 10px;
        width: calc(100% - 20px);
        height: calc(72px + env(safe-area-inset-bottom, 0px));
        border-radius: 24px;
        border: 1px solid var(--border);
        background: linear-gradient(180deg, rgba(255,255,255,0.2), rgba(255,255,255,0.08));
        box-shadow: 0 18px 42px rgba(11, 24, 42, 0.14);
      }

      html[data-platform="apple"] .bottom-nav-items {
        height: 72px;
        gap: 6px;
        padding: 0 8px;
      }

      html[data-platform="apple"] .bottom-nav-item {
        min-height: 56px;
        border-radius: 18px;
        font-size: 0.62rem;
      }

      html[data-platform="apple"] .page-header {
        padding: 16px 18px;
        border-radius: 22px;
      }

      html[data-platform="apple"] .page-title {
        font-size: 1.5rem;
        line-height: 1.06;
      }

      html[data-platform="apple"] .page-description {
        font-size: 0.92rem;
        line-height: 1.55;
      }

      .topbar {
        display: flex;
        min-width: 0;
      }

      .sidebar {
        display: none;
      }

      .main {
        margin-left: 0;
        margin-top: calc(56px + env(safe-area-inset-top, 0px));
        padding: 12px;
        padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px) + 18px);
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: calc(100dvh - 56px - env(safe-area-inset-top, 0px));
        overflow-y: auto;
      }

      .bottom-nav {
        display: flex;
        flex-direction: column;
        height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
      }

      .modal-overlay {
        padding: calc(12px + env(safe-area-inset-top, 0px)) 12px calc(12px + env(safe-area-inset-bottom, 0px));
        align-items: flex-start;
        justify-content: flex-start;
        overflow-x: hidden;
      }

      .modal {
        width: min(100%, 560px);
        max-width: none;
        padding: 18px;
        max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
        border-radius: 20px;
      }

      .modal-title {
        font-size: 1.08rem;
        line-height: 1.2;
      }

      .modal-content {
        margin-bottom: 18px;
        overflow-x: hidden;
      }

      .modal-actions {
        flex-direction: column;
        align-items: stretch;
      }

      .modal-actions .modal-btn {
        width: 100%;
      }

      #billing-modal .preview-panel,
      #billing-modal .payment-methods {
        width: 100%;
      }

      #billing-modal .preview-panel {
        min-height: auto;
      }

      .payment-methods {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
      }

      .permission-layout,
      .app-dialog-layout,
      .feedback-layout,
      .circle-invite-layout {
        grid-template-columns: 1fr;
        gap: 12px;
      }

      .permission-modal .modal,
      .app-dialog-modal .modal,
      .feedback-modal .modal,
      .circle-invite-modal .modal,
      .sync-transfer-modal .modal,
      .lan-transfer-modal .modal,
      #billing-modal .modal,
      #auth-modal .modal {
        width: min(100%, 560px);
        max-width: none;
      }

      .billing-modal .modal-content {
        margin-bottom: 16px;
      }

      .circle-action-row {
        flex-direction: column;
      }

      .circle-action-row .btn {
        width: 100%;
      }

      .circle-policy-grid,
      .circle-member-editor {
        grid-template-columns: 1fr;
      }

      .circle-member {
        display: grid;
        grid-template-columns: 1fr;
      }

      .circle-member-actions {
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
      }

      .circle-member-actions .form-input {
        width: 100%;
      }

    .page-title {
      font-size: 1.38rem;
      line-height: 1.12;
      max-width: none;
      letter-spacing: 0;
      }

      .page-description {
        font-size: 0.92rem;
        line-height: 1.55;
        max-width: none;
      }

      .page-title,
      .page-description,
      .landing-title,
      .landing-copy,
      .preview-title,
      .preview-subtitle,
      .settings-overview-title,
      .settings-overview-copy,
      .store-hero-copy h2,
      .store-hero-copy p,
      .circles-hero-copy h2,
      .circles-hero-copy p,
      .circle-card-title,
      .circle-card-desc,
      .plan-comparison h3,
      .plan-comparison p,
      .plan-comparison-label,
      .plan-comparison-value,
      .sidebar-tip-title,
      .sidebar-tip-copy {
        overflow-wrap: anywhere;
        word-break: normal;
        text-wrap: balance;
      }

      .cards-grid {
        grid-template-columns: 1fr;
        gap: 12px;
      }

      .card,
      .form-section,
      .preview-panel,
      .status-card,
      .file-manager,
      .store-item,
      .settings-overview,
      .doc-card,
      .circle-card,
      .consent-panel {
        min-width: 0;
      }

      .landing-screen {
        padding: 0 18px;
      }

      .landing-shell {
        min-height: calc(100vh - 32px);
        padding: 18px 0;
      }

      .landing-hero {
        padding-top: 4vh;
      }

      .landing-title {
        font-size: 2.35rem;
        max-width: none;
        line-height: 1.02;
      }

    .landing-copy {
      font-size: 0.94rem;
      line-height: 1.6;
    }

      .auth-modal-grid {
        grid-template-columns: 1fr;
      }

      .auth-modal-main,
      .auth-modal-aside {
        padding: 16px;
      }

      .auth-modal-aside {
        order: -1;
      }

      .auth-modal-step {
        font-size: 0.86rem;
      }

      .landing-actions {
        flex-direction: column;
        align-items: stretch;
      }

      .landing-actions > * {
        width: 100%;
      }

      .landing-metrics {
        gap: 8px;
      }

      .landing-metric {
        flex: 1 1 calc(50% - 8px);
      }

      .landing-status-strip,
      .vault-command-strip,
      .vault-storage-header,
      .offline-banner {
        flex-direction: column;
        align-items: stretch;
      }

      .workspace-actions {
        width: 100%;
        flex-direction: column;
      }

      .workspace-actions .btn {
        width: 100%;
      }

      .vault-home .page-header,
      .vault-storage-header {
        padding: 18px;
        border-radius: 22px;
      }

      .vault-storage-header {
        gap: 14px;
      }

      .vault-home .page-title {
        font-size: 2rem;
        line-height: 1.02;
      }

      .vault-home .cards-grid {
        grid-template-columns: 1fr;
      }

      .vault-home .card {
        min-height: 0;
        padding: 18px;
      }

      .mobile-storage-panel {
        display: block;
      }

      .vault-home .card-value {
        font-size: 1.9rem;
      }

      .vault-home .card-label,
      .card-subtitle,
      .card-chip {
        font-size: 0.8rem;
      }

      .offline-banner {
        padding: 18px;
        gap: 14px;
      }

      .offline-banner-copy strong {
        font-size: 0.95rem;
      }

      .offline-banner-copy p,
      .offline-banner-hint {
        font-size: 0.88rem;
        line-height: 1.55;
      }

      .offline-banner-actions {
        flex-direction: column;
      }

      .offline-banner-actions .btn {
        width: 100%;
      }

      .consent-panel,
      .doc-card,
      .form-section,
      .preview-panel,
      .status-card,
      .store-item,
      .card,
      .profile-header {
        border-radius: 20px;
      }

      .consent-panel {
        padding: 16px;
      }

      .consent-check {
        flex-direction: column;
        gap: 8px;
      }

      .consent-links,
      .doc-actions,
      .settings-footer-links,
      .profile-actions,
      .feature-chip-row,
      .theme-pack-grid {
        flex-direction: column;
      }

      .circle-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .circle-input-row,
      .circle-invite-layout {
        grid-template-columns: 1fr;
      }

      .circle-collection-preview {
        grid-template-columns: 1fr;
      }

      .circle-presets {
        gap: 6px;
      }

      .consent-links .link-btn,
      .doc-actions .link-btn,
      .settings-footer-links .link-btn,
      .profile-actions .profile-btn,
      .feature-chip,
      .plan-chip,
      .premium-theme-card,
      .theme-pack-grid > * {
        width: 100%;
      }

      .settings-overview,
      .form-section {
        padding: 18px;
      }

      .preview-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
      }

      .preview-header > * {
        max-width: none;
      }

      .preview-header .form-input,
      .preview-header select {
        width: 100%;
        max-width: none;
      }

      .settings-overview-header {
        flex-direction: column;
        align-items: stretch;
      }

      .settings-overview-grid {
        grid-template-columns: 1fr;
      }

      .settings-rail {
        grid-template-columns: repeat(4, minmax(160px, 1fr));
        overflow-x: auto;
        padding: 8px;
        gap: 8px;
        top: 10px;
        scrollbar-width: none;
      }

      .settings-rail::-webkit-scrollbar {
        display: none;
      }

      .settings-rail-btn {
        min-height: 66px;
        min-width: 160px;
      }

      .settings-field-grid {
        grid-template-columns: 1fr;
      }

      .settings-billing-row {
        align-items: stretch;
        flex-direction: column;
      }

      .settings-billing-actions {
        flex-direction: column;
      }

      .settings-billing-actions .btn {
        width: 100%;
      }

      .theme-pack-grid {
        grid-template-columns: 1fr;
      }

      .premium-theme-card {
        padding: 12px 14px;
      }

      .doc-grid,
      .support-grid {
        grid-template-columns: 1fr;
      }

      .settings-footer-about {
        flex-direction: column;
        align-items: stretch;
      }

      .settings-footer-mark {
        width: 48px;
        height: 48px;
      }

      .settings-footer-mark svg {
        width: 24px;
        height: 24px;
      }

      .profile-header {
        padding: 18px;
      }

      .profile-avatar {
        width: 64px;
        height: 64px;
        font-size: 1.1rem;
      }

      .profile-name {
        font-size: 1.15rem;
      }

      .profile-email {
        font-size: 0.88rem;
      }

      .fm-toolbar,
      .fm-actions,
      .preview-actions,
      .preview-settings,
      .preview-meta,
      .store-hero-actions {
        gap: 10px;
      }

      .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
      }

      .profile-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .profile-actions {
        justify-content: center;
      }

      .profile-info {
        width: 100%;
      }

      .fm-toolbar {
        flex-direction: column;
        align-items: stretch;
      }

      .fm-controls,
      .fm-bulk {
        flex-direction: column;
        align-items: stretch;
      }

      .fm-input,
      .fm-select,
      .fm-btn,
      .preview-btn,
      .store-item-footer .btn,
      .store-hero-actions .btn {
        width: 100%;
      }

      .fm-input,
      .fm-select,
      .form-input,
      textarea,
      select {
        font-size: 16px;
      }

      .fm-breadcrumb {
        font-size: 0.8rem;
        line-height: 1.4;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
      }

      .fm-actions {
        width: 100%;
        flex-wrap: wrap;
      }

      .fm-btn {
        flex: 1 1 auto;
        min-height: 44px;
        justify-content: center;
      }

      .toast-container {
        left: 12px;
        right: 12px;
      }

      .toast {
        min-width: auto;
      }

      .form-actions {
        flex-direction: column;
      }

      .form-actions .btn {
        width: 100%;
      }

      .store-grid {
        grid-template-columns: 1fr;
      }

      .store-layout {
        gap: 14px;
      }

      .store-hero {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 18px;
        border-radius: 22px;
      }

      .store-hero-copy h2 {
        font-size: 1.45rem;
        line-height: 1.12;
      }

      .store-hero-copy p {
        font-size: 0.92rem;
        line-height: 1.6;
      }

      .store-hero-badge {
        margin-bottom: 10px;
        font-size: 0.68rem;
      }

      .plan-comparison {
        padding: 14px;
        gap: 8px;
      }

      .plan-comparison-item {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
      }

      .plan-comparison-label,
      .plan-comparison-value {
        max-width: none;
        text-align: left;
        line-height: 1.45;
      }

      .store-item {
        padding: 18px;
        gap: 12px;
      }

      .store-item.featured::before {
        top: 12px;
        right: 12px;
        font-size: 0.62rem;
      }

      .store-item-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 10px;
      }

      .store-item-icon svg {
        width: 24px;
        height: 24px;
      }

      .store-item-title {
        font-size: 1rem;
        margin-bottom: 6px;
      }

      .store-item-kicker {
        margin-bottom: 8px;
        font-size: 0.68rem;
      }

      .store-item-desc,
      .store-item-meta {
        font-size: 0.82rem;
        line-height: 1.55;
      }

      .store-item-footer {
        flex-direction: column;
        align-items: stretch;
      }

      .store-item-price {
        font-size: 0.95rem;
      }

      .store-item-price small {
        font-size: 0.8rem;
      }

      .store-hero-points {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 8px !important;
      }

      .store-hero-actions {
        flex-direction: column;
      }

      .store-hero-actions .btn {
        width: 100%;
      }

      .store-divider {
        margin: 8px 0 0;
        gap: 10px;
        font-size: 0.64rem;
      }

      .storage-grid {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
        gap: 14px;
        overflow-x: visible;
      }

      #storage.page.active {
        display: flex;
        flex-direction: column;
      }

      #storage > .page-header {
        order: 0;
      }

      #storage > .vault-command-strip {
        order: 1;
      }

      #storage > .mobile-storage-panel {
        order: 2;
      }

      #storage > .storage-status {
        order: 3;
      }

      #storage > .storage-grid {
        order: 4;
      }

      #storage > .transfer-log-panel {
        order: 5;
      }

      #storage > #preview-panel {
        order: 6;
      }

      #storage > .offline-banner {
        order: 7;
      }

      #storage > .hidden-input {
        order: 8;
      }

      #storage > .preview-panel:not(.transfer-log-panel):not(#preview-panel) {
        display: none;
      }

      #storage > .transfer-log-panel {
        display: flex;
      }

      #storage .storage-grid > .file-manager {
        order: 1;
        width: 100%;
        display: flex;
        flex-direction: column;
        min-height: auto;
        min-width: 0;
        overflow-x: hidden;
      }

      #storage .storage-status {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
      }

      #storage .status-card {
        padding: 12px;
        border-radius: 16px;
      }

      #storage .status-label {
        font-size: 0.62rem;
      }

      #storage .status-value {
        font-size: 0.86rem;
        line-height: 1.25;
      }

      #storage .storage-status .status-card:nth-child(7) {
        grid-column: 1 / -1;
      }

      #storage .storage-grid > .file-manager .fm-recent-list {
        grid-template-columns: 1fr;
      }

      #storage .storage-grid > .file-manager .fm-pinned-grid {
        grid-template-columns: 1fr;
      }

      #storage .storage-grid > .file-manager .fm-filter-chips {
        overflow-x: auto;
        padding-bottom: 2px;
        flex-wrap: nowrap;
        scrollbar-width: none;
      }

      #storage .storage-grid > .file-manager .fm-filter-chips::-webkit-scrollbar {
        display: none;
      }

      #storage .storage-grid > .file-manager .fm-filter-chip {
        flex: 0 0 auto;
      }

      #storage .storage-grid > .file-manager .fm-selection-bar {
        flex-direction: column;
        align-items: stretch;
      }

      #storage .storage-grid > .file-manager .fm-selection-actions {
        justify-content: stretch;
      }

      #storage .storage-grid > .file-manager .fm-selection-actions .fm-btn {
        width: 100%;
      }

      #storage .storage-grid > #import-progress-panel {
        order: 2;
        margin-left: 0 !important;
        margin-right: 0 !important;
      }

      #storage .storage-grid .fm-list {
        flex: 1 1 auto;
        min-height: min(48vh, 420px);
        max-height: none;
      }

      #storage > #preview-panel {
        display: flex;
        position: relative;
        top: auto;
        min-height: 0;
        max-height: none;
        overflow: visible;
        z-index: 1;
        padding: 12px;
        gap: 10px;
      }

      #storage > #preview-panel .preview-surface {
        min-height: 180px;
        max-height: none;
        padding: 8px;
      }

      #storage > #preview-panel .preview-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
      }

      #storage > #preview-panel .preview-meta-item {
        padding: 8px 10px;
      }

      #storage > #preview-panel .preview-settings,
      #storage > #preview-panel .preview-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
      }

      #storage > #preview-panel .preview-actions .preview-btn {
        width: 100%;
      }

      .import-progress-panel {
        margin: 0 12px 12px;
      }

      .transfer-log-panel {
        margin-bottom: 14px;
      }

      .fm-toolbar {
        padding: 12px;
        gap: 12px;
        min-width: 0;
        width: 100%;
      }

      .fm-controls {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
      }

      .fm-bulk {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        align-items: center;
        overflow-x: hidden;
        padding-bottom: 2px;
        scrollbar-width: none;
      }

      .fm-bulk::-webkit-scrollbar {
        display: none;
      }

      .fm-bulk .fm-btn {
        width: 100%;
        min-width: 0;
        padding-inline: 10px;
      }

      .fm-bulk-count {
        grid-column: 1 / -1;
        min-width: 0;
        white-space: nowrap;
      }

      .fm-pinned,
      .fm-recent {
        padding: 12px;
      }

      .fm-list {
        border-top: 1px solid var(--border);
        min-width: 0;
        width: 100%;
        overflow-x: hidden;
      }

      .fm-item {
        min-width: 0;
        width: 100%;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
        gap: 10px;
      }

      .fm-item-actions {
        grid-column: 1 / -1;
        width: 100%;
        justify-content: stretch;
      }

      .fm-item-actions .fm-action-btn {
        flex: 1 1 40px;
      }

      .preview-empty-actions .fm-btn {
        flex: 1 1 140px;
        justify-content: center;
      }

      .preview-meta,
      .preview-settings {
        grid-template-columns: 1fr;
      }

      .sync-center,
      .sync-transfer-layout {
        grid-template-columns: 1fr;
      }

      .security-management-grid {
        grid-template-columns: 1fr !important;
      }

      .lan-transfer-grid {
        grid-template-columns: 1fr;
      }

      .sync-channel-grid,
      .sync-action-grid {
        grid-template-columns: 1fr;
      }

      .export-modal-grid {
        grid-template-columns: 1fr;
      }

      .export-modal-stats {
        grid-template-columns: 1fr;
      }

      .sync-transfer-qr {
        min-height: 240px;
      }

      .recovery-entry,
      .moat-list-item {
        flex-direction: column;
      }

      .recovery-entry-actions {
        justify-content: flex-start;
      }

      .preview-panel {
        min-height: 280px;
      }

      .preview-title {
        font-size: 0.98rem;
        line-height: 1.18;
      }

      .preview-subtitle,
      .preview-meta-item,
      .transfer-meta {
        font-size: 0.84rem;
        line-height: 1.55;
      }

      .preview-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
      }

      .preview-header-actions {
        max-width: none;
        justify-content: flex-start;
      }

      .preview-chip {
        max-width: 48%;
      }

      .preview-surface {
        min-height: 180px;
        padding: 8px;
      }

      .zy-image-viewer {
        min-height: 0;
        border-radius: 8px;
        max-height: calc(100dvh - 178px);
      }

      .zy-image-bar {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px;
      }

      .zy-image-title,
      .zy-image-meta {
        max-width: 100%;
      }

      .zy-media-badges {
        gap: 5px;
        margin-top: 6px;
      }

      .zy-media-badge {
        max-width: 42vw;
        padding: 4px 6px;
        font-size: 0.64rem;
      }

      .zy-image-actions {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
      }

      .zy-image-btn {
        min-height: 42px;
        padding: 8px 10px;
        font-size: 0.76rem;
      }

      .zy-image-zoom {
        align-self: center;
        min-width: 0;
        font-size: 0.74rem;
      }

      .zy-image-stage {
        min-height: min(46dvh, 380px);
        max-height: min(54dvh, 450px);
        padding: 12px;
      }

      .preview-surface .zy-image-viewer img,
      .zy-image-viewer img {
        max-height: min(48dvh, 410px);
      }

      .pdf-viewer {
        min-height: 0;
        border-radius: 8px;
        max-height: calc(100dvh - 178px);
      }

      .pdf-viewer.fullscreen {
        padding: calc(8px + env(safe-area-inset-top, 0px)) 8px calc(8px + env(safe-area-inset-bottom, 0px));
      }

      .pdf-viewer.fullscreen .pdf-canvas-wrap {
        max-height: calc(100dvh - 214px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
      }

      .pdf-controls {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 10px;
      }

      .pdf-controls-group {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
      }

      .pdf-doc-group {
        display: flex;
        width: 100%;
      }

      .pdf-doc-title,
      .pdf-doc-meta {
        max-width: 100%;
      }

      .pdf-controls-group:nth-child(3) {
        grid-template-columns: minmax(0, 1fr) auto auto;
      }

      .pdf-controls button,
      .pdf-controls input[type="number"],
      .pdf-controls select {
        min-height: 42px;
        width: 100%;
        padding: 8px 10px;
        font-size: 0.8rem;
        text-align: center;
      }

      .pdf-controls input[type="number"] {
        min-width: 0;
      }

      .pdf-canvas-wrap {
        max-height: min(58dvh, 460px);
        padding: 10px;
      }

      .pdf-scroll {
        gap: 12px;
      }

      .pdf-page {
        padding: 8px;
        border-radius: 12px;
        width: 100%;
      }

      .pdf-page canvas {
        width: 100% !important;
        height: auto !important;
      }

      .pdf-search {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 0 10px 10px;
        gap: 8px;
      }

      .pdf-search input {
        min-width: 0;
        min-height: 42px;
        font-size: 0.86rem;
      }

      .pdf-search button {
        min-height: 42px;
      }

      .pdf-search-status {
        min-width: 74px;
        align-self: center;
        font-size: 0.7rem;
      }

      .pdf-thumbs {
        gap: 8px;
        padding: 8px 10px 10px;
      }

      .pdf-thumb {
        width: 66px;
        min-height: 86px;
        border-radius: 10px;
      }

      .zy-video-player {
        min-height: 0;
        border-radius: 8px;
        max-height: calc(100dvh - 190px);
      }

      .zy-video-stage {
        min-height: 0;
        aspect-ratio: 16 / 10;
        max-height: min(58dvh, 430px);
      }

      .zy-video-player video {
        height: 100%;
        max-height: min(58dvh, 430px);
        aspect-ratio: auto;
      }

      .zy-video-player:fullscreen,
      .zy-video-player.is-fullscreen {
        width: 100dvw !important;
        height: 100dvh !important;
        max-height: none !important;
        min-height: 100dvh !important;
        border: 0 !important;
        border-radius: 0 !important;
      }

      .zy-video-player:fullscreen .zy-video-stage,
      .zy-video-player.is-fullscreen .zy-video-stage {
        width: 100%;
        height: 100%;
        min-height: 100dvh !important;
        max-height: none !important;
        aspect-ratio: auto !important;
      }

      .zy-video-player:fullscreen video,
      .zy-video-player.is-fullscreen video {
        width: 100%;
        height: 100%;
        max-height: none !important;
        aspect-ratio: auto !important;
      }

      .zy-video-topbar {
        padding: 12px 12px 46px;
      }

      .zy-video-title {
        font-size: 0.86rem;
        max-width: 72vw;
      }

      .zy-video-subtitle {
        font-size: 0.72rem;
        max-width: 72vw;
      }

      .zy-video-topbar .zy-media-badges {
        max-width: 70vw;
      }

      .zy-video-status {
        padding: 5px 8px;
        font-size: 0.64rem;
      }

      .zy-video-center {
        width: 62px;
        height: 62px;
        font-size: 0.74rem;
      }

      .zy-video-controls {
        gap: 8px;
        padding: 42px 10px calc(10px + env(safe-area-inset-bottom, 0px));
      }

      .zy-video-progress input[type="range"] {
        height: 10px;
      }

      .zy-video-progress input[type="range"]::-webkit-slider-thumb {
        width: 20px;
        height: 20px;
      }

      .zy-video-progress input[type="range"]::-moz-range-thumb {
        width: 20px;
        height: 20px;
      }

      .zy-video-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
      }

      .zy-video-left,
      .zy-video-right {
        width: 100%;
        display: grid;
        grid-template-columns: auto auto auto auto minmax(0, 1fr);
        gap: 8px;
      }

      .zy-video-right {
        grid-template-columns: minmax(0, 1fr) auto auto auto auto auto;
      }

      .zy-video-btn,
      .zy-video-select {
        min-height: 42px;
        border-radius: 8px;
        padding: 8px 11px;
        font-size: 0.76rem;
      }

      .zy-video-skip {
        min-width: 42px;
        padding-inline: 8px;
      }

      .zy-video-scrub-tip {
        bottom: 18px;
        font-size: 0.64rem;
      }

      .zy-video-time {
        min-width: 0;
        justify-self: end;
        align-self: center;
        font-size: 0.76rem;
        white-space: nowrap;
      }

      .zy-video-volume {
        min-width: 0;
        padding: 0 10px;
      }

      .zy-video-volume input[type="range"] {
        width: 100%;
        min-width: 72px;
      }

      .zy-video-player.controls-hidden.is-playing .zy-video-topbar,
      .zy-video-player.controls-hidden.is-playing .zy-video-controls {
        opacity: 0.18;
      }

      .offline-banner-actions .btn {
        width: 100%;
      }

      .sync-transfer-modal .modal-actions {
        flex-direction: column;
      }

      .sync-transfer-modal .modal-btn {
        width: 100%;
      }

      .lan-transfer-modal .modal-actions {
        flex-direction: column;
      }

      .lan-transfer-modal .modal-btn {
        width: 100%;
      }

      .lan-transfer-header {
        align-items: flex-start;
      }

      .permission-layout {
        grid-template-columns: 1fr;
      }

      .circles-hero {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 18px;
      }

      .circles-hero::before {
        width: 180px;
        height: 180px;
      }

      .circles-hero::after {
        width: 200px;
        height: 200px;
      }

      .circles-hero-copy h2 {
        font-size: 1.48rem;
        line-height: 1.08;
        letter-spacing: 0;
        max-width: none;
      }

      .circles-hero-copy p {
        font-size: 0.94rem;
        line-height: 1.62;
        max-width: none;
      }

      .circle-stat-grid {
        grid-template-columns: 1fr;
      }

      .circle-stat {
        padding: 12px;
      }

      .circle-stat strong {
        font-size: 0.95rem;
      }

      .circle-stat span {
        font-size: 0.84rem;
        line-height: 1.5;
      }

      .circle-card-top {
        flex-direction: column;
        gap: 8px;
      }

      .circle-card-title {
        font-size: 1rem;
        line-height: 1.25;
      }

      .circle-card-desc {
        font-size: 0.9rem;
        line-height: 1.58;
      }

      .circle-chip {
        font-size: 0.68rem;
      }

      .sidebar-tip {
        padding: 12px;
      }

      .sidebar-tip-title {
        font-size: 0.72rem;
        line-height: 1.2;
      }

      .sidebar-tip-copy {
        font-size: 0.82rem;
        line-height: 1.55;
      }

      .settings-overview-title {
        font-size: 1rem;
        line-height: 1.18;
      }

      .settings-overview-copy {
        font-size: 0.92rem;
        line-height: 1.6;
      }

      .store-hero-copy h2 {
        font-size: 1.42rem;
        line-height: 1.1;
      }

      .store-hero-copy p {
        font-size: 0.92rem;
        line-height: 1.6;
      }
    }

    @media (max-width: 500px) {
      :root {
        --bottom-nav-height: 74px;
      }

      .topbar {
        padding-left: 10px;
        padding-right: 10px;
        gap: 8px;
      }

      .topbar-brand {
        gap: 8px;
      }

      .topbar-brand .brand-icon {
        width: 30px;
        height: 30px;
      }

      .topbar-brand .brand-text {
        font-size: 1rem;
      }

      .topbar-brand .brand-subtext,
      .topbar-status {
        display: none;
      }

      .topbar-actions {
        gap: 6px;
      }

      .topbar-btn {
        width: 34px;
        height: 34px;
      }

      .landing-title {
        font-size: 2.05rem;
      }

      .cards-grid {
        grid-template-columns: 1fr;
      }

      .page-title {
        font-size: 1.18rem;
        line-height: 1.08;
      }

      .page-description {
        font-size: 0.88rem;
        line-height: 1.52;
      }

      .fm-item-actions {
        opacity: 1;
        flex-wrap: wrap;
        justify-content: flex-end;
      }

      .fm-item-meta {
        flex-direction: column;
        gap: 4px;
      }

      .fm-item {
        align-items: flex-start;
        padding: 12px;
      }

      .fm-action-btn {
        width: 36px;
        height: 36px;
      }

      .fm-list {
        max-height: min(72vh, 560px);
      }

      #storage > #preview-panel {
        padding: 10px;
      }

      #storage > #preview-panel .preview-surface {
        min-height: 170px;
      }

      .zyplayer-top,
      .zyplayer-progress,
      .zyplayer-bottom {
        align-items: stretch;
        flex-direction: column;
      }

      .zyplayer-title {
        max-width: 100%;
        white-space: normal;
      }

      .zyplayer-volume,
      .zyplayer-volume input[type="range"] {
        width: 100%;
      }

      #storage > #preview-panel .preview-meta,
      #storage > #preview-panel .preview-settings,
      #storage > #preview-panel .preview-actions {
        grid-template-columns: 1fr;
      }

      .zy-image-viewer {
        max-height: calc(100dvh - 160px);
        border-radius: 14px;
      }

      .zy-image-bar {
        padding: 8px;
      }

      .zy-image-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }

      .zy-image-btn {
        min-height: 40px;
        padding: 8px;
        font-size: 0.74rem;
      }

      .zy-image-zoom {
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
      }

      .zy-image-stage {
        min-height: min(42dvh, 320px);
        max-height: min(50dvh, 360px);
        padding: 8px;
      }

      .preview-surface .zy-image-viewer img,
      .zy-image-viewer img {
        max-height: min(44dvh, 330px);
      }

      .pdf-viewer {
        max-height: calc(100dvh - 160px);
        border-radius: 14px;
      }

      .pdf-controls {
        padding: 8px;
      }

      .pdf-controls-group {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .pdf-doc-group {
        display: flex;
      }

      .pdf-controls-group:nth-child(3) {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      }

      .pdf-controls button,
      .pdf-controls input[type="number"],
      .pdf-controls select {
        min-height: 40px;
        padding: 8px;
        font-size: 0.76rem;
      }

      .pdf-canvas-wrap {
        max-height: min(52dvh, 380px);
        padding: 8px;
      }

      .pdf-search {
        grid-template-columns: 1fr;
      }

      .pdf-search button {
        width: 100%;
      }

      .pdf-search-status {
        min-width: 0;
        text-align: left;
      }

      .pdf-thumb {
        width: 58px;
        min-height: 76px;
      }

      .zy-video-player {
        border-radius: 8px;
        max-height: calc(100dvh - 172px);
      }

      .zy-video-stage {
        aspect-ratio: 4 / 3;
        max-height: min(52dvh, 360px);
      }

      .zy-video-player video {
        max-height: min(52dvh, 360px);
      }

      .zy-video-topbar {
        padding: 10px 10px 38px;
        gap: 8px;
      }

      .zy-video-title,
      .zy-video-subtitle {
        max-width: 64vw;
      }

      .zy-video-topbar .zy-media-badges {
        max-width: 64vw;
      }

      .zy-video-status {
        max-width: 74px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .zy-video-center {
        width: 56px;
        height: 56px;
      }

      .zy-video-controls {
        padding: 36px 8px calc(8px + env(safe-area-inset-bottom, 0px));
      }

      .zy-video-left {
        grid-template-columns: auto auto auto auto minmax(74px, 1fr);
      }

      .zy-video-right {
        grid-template-columns: minmax(82px, 1fr) auto auto auto auto;
      }

      .zy-video-right .zy-video-btn:nth-of-type(1) {
        display: none;
      }

      .zy-video-btn,
      .zy-video-select {
        min-height: 40px;
        padding-inline: 10px;
      }

      .bottom-nav-items {
        padding: 0 8px;
      }

      .bottom-nav-item {
        flex-basis: 66px;
        min-width: 66px;
        font-size: 0.58rem;
      }

      .bottom-nav-item svg {
        width: 22px;
        height: 22px;
      }

      /* Prevent the video toolbar from becoming a horizontal scroll strip on phones. */
      .zy-video-row {
        flex-wrap: wrap;
        row-gap: 8px;
      }

      .zy-video-left,
      .zy-video-right {
        min-width: 0;
      }

      .zy-video-time {
        white-space: nowrap;
      }

      .toast {
        padding: 10px 12px;
        gap: 10px;
      }

      .toast-message {
        font-size: 0.82rem;
      }

      .sync-summary {
        padding: 16px;
      }

      .landing-metric {
        flex: 1 1 100%;
      }

      .settings-overview-title {
        font-size: 1rem;
      }

      .settings-overview-copy,
      .settings-billing-copy {
        font-size: 0.9rem;
        line-height: 1.55;
      }

      .page-title {
        font-size: 1.24rem;
        line-height: 1.1;
      }

      .page-description {
        font-size: 0.9rem;
        line-height: 1.5;
      }

      .landing-title {
        font-size: 2.2rem;
        line-height: 1.02;
      }

      .landing-copy {
        font-size: 0.9rem;
        line-height: 1.58;
      }
    }

    @media (max-width: 420px) {
      .topbar {
        gap: 6px;
        padding-inline: 8px;
      }

      .topbar-brand {
        min-width: 0;
        flex: 1 1 auto;
      }

      .topbar-brand > div:last-child {
        min-width: 0;
      }

      .topbar-brand .brand-text {
        max-width: 32vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      .topbar-actions {
        gap: 4px;
      }

      .topbar-btn {
        width: 32px;
        height: 32px;
      }

      .topbar-btn svg {
        width: 16px;
        height: 16px;
      }

      .bottom-nav-items {
        gap: 2px;
        padding-inline: 4px;
      }

      .bottom-nav-item {
        min-width: 0;
        flex: 1 1 0;
        padding-inline: 3px;
      }

      .modal {
        padding: 16px;
        border-radius: 18px;
      }
    }

    @media (min-width: 1280px) {
      .main {
        max-width: calc(100vw - var(--sidebar-width));
        padding: 30px 34px 38px;
      }

      .page {
        max-width: 1540px;
        margin: 0 auto;
      }

      .storage-grid {
        grid-template-columns: minmax(780px, 1.55fr) minmax(360px, 0.78fr);
        gap: 22px;
      }

      .file-manager,
      .preview-panel,
      .form-section,
      .card,
      .status-card {
        box-shadow: var(--shadow-md);
      }

      .sidebar {
        background:
          linear-gradient(180deg, rgba(255,255,255,0.03), transparent),
          var(--bg-secondary);
        border-right: 1px solid rgba(255,255,255,0.04);
      }

      .page-header {
        margin-bottom: 28px;
      }

      .form-section {
        padding: 26px;
      }
    }

    html[data-platform="android"][data-orientation="landscape"] {
      --sidebar-width: 236px;
      --bottom-nav-height: 0px;
    }

    html[data-platform="android"][data-orientation="landscape"] .topbar {
      display: none;
    }

    html[data-platform="android"][data-orientation="landscape"] .sidebar {
      display: flex;
      width: var(--sidebar-width);
      padding: 20px 14px 20px;
      gap: 10px;
      box-shadow: 8px 0 32px rgba(0, 0, 0, 0.14);
    }

    html[data-platform="android"][data-orientation="landscape"] .main {
      margin-left: var(--sidebar-width);
      margin-top: 0;
      padding: 22px 24px 24px;
      padding-bottom: 24px;
      min-height: 100vh;
    }

    html[data-platform="android"][data-orientation="landscape"] .sidebar-brand {
      margin-bottom: 16px;
    }

    html[data-platform="android"][data-orientation="landscape"] .sidebar-tip {
      margin-bottom: 14px;
    }

    html[data-platform="android"][data-orientation="landscape"] .sidebar-section {
      margin-bottom: 18px;
    }

    html[data-platform="android"][data-orientation="landscape"] .bottom-nav {
      display: none;
    }

    html[data-platform="android"][data-orientation="landscape"] .page {
      max-width: none;
    }

    html[data-platform="android"][data-orientation="landscape"] .page-header {
      padding: 18px 20px;
      border-radius: 22px;
      margin-bottom: 18px;
    }

    html[data-platform="android"][data-orientation="landscape"] .storage-grid,
    html[data-platform="android"][data-orientation="landscape"] .store-grid {
      grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
      gap: 16px;
    }

    html[data-platform="android"][data-orientation="landscape"] .cards-grid,
    html[data-platform="android"][data-orientation="landscape"] .support-grid {
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: 16px;
    }

    html[data-platform="android"][data-orientation="landscape"] .page-title {
      font-size: 1.64rem;
      line-height: 1.06;
    }

    html[data-platform="android"][data-orientation="landscape"] .page-description {
      font-size: 0.96rem;
    }

    @media (min-width: 900px) and (orientation: landscape) {
      html[data-platform="android"][data-orientation="landscape"] {
        --sidebar-width: 268px;
      }

      html[data-platform="android"][data-orientation="landscape"] .main {
        padding: 24px 28px 28px;
      }

      html[data-platform="android"][data-orientation="landscape"] .storage-grid {
        grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.95fr);
      }

      html[data-platform="android"][data-orientation="landscape"] .cards-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }

      html[data-platform="android"][data-orientation="landscape"] .support-grid {
        grid-template-columns: repeat(2, minmax(260px, 1fr));
      }

      html[data-platform="android"][data-orientation="landscape"] .page-header {
        padding: 20px 22px;
      }

      html[data-platform="android"][data-orientation="landscape"] .page-title {
        font-size: 1.72rem;
      }
    }

    /* Image previews use the available preview panel instead of older viewport caps. */
    #preview-panel[data-preview-kind="image"] {
      max-height: none;
      overflow: visible;
    }

    #preview-panel[data-preview-kind="image"] .preview-surface {
      min-height: clamp(280px, 58dvh, 760px);
      max-height: none;
      overflow: hidden;
      align-items: stretch;
    }

    #preview-panel[data-preview-kind="image"] .zy-image-viewer {
      min-height: clamp(260px, 56dvh, 740px);
      max-height: none;
      height: auto;
    }

    #preview-panel[data-preview-kind="image"] .zy-image-stage {
      min-height: clamp(220px, 48dvh, 680px);
      max-height: none;
      align-items: center;
    }

    #preview-panel[data-preview-kind="image"] .preview-surface .zy-image-viewer img,
    #preview-panel[data-preview-kind="image"] .zy-image-viewer img {
      max-height: none;
      max-width: 100%;
      width: auto;
      height: auto;
    }

    #preview-panel[data-preview-kind="image"] .zy-image-viewer[data-fit="contain"] img {
      max-height: calc(100dvh - 260px);
    }

    #preview-panel[data-preview-kind="image"] .zy-image-viewer[data-zoomed="true"] img {
      max-width: none;
      max-height: none;
    }

    #preview-panel[data-preview-kind="image"] .zy-image-viewer:fullscreen,
    #preview-panel[data-preview-kind="image"] .zy-image-viewer.is-fullscreen,
    #preview-panel[data-preview-kind="image"] .zy-image-viewer:fullscreen .zy-image-stage,
    #preview-panel[data-preview-kind="image"] .zy-image-viewer.is-fullscreen .zy-image-stage {
      width: 100vw;
      height: 100vh;
      max-height: none;
    }

    #preview-panel[data-preview-kind="image"] .zy-image-viewer:fullscreen img,
    #preview-panel[data-preview-kind="image"] .zy-image-viewer.is-fullscreen img {
      max-width: 100vw;
      max-height: calc(100vh - 72px);
    }

    @media (max-width: 768px) {
      #preview-panel[data-preview-kind="image"] .preview-surface {
        min-height: min(64dvh, 620px);
      }

      #preview-panel[data-preview-kind="image"] .zy-image-viewer {
        min-height: min(62dvh, 600px);
      }

      #preview-panel[data-preview-kind="image"] .zy-image-stage {
        min-height: min(50dvh, 500px);
      }

      #preview-panel[data-preview-kind="image"] .zy-image-viewer[data-fit="contain"] img {
        max-height: min(50dvh, 500px);
      }

      #preview-panel[data-preview-kind="image"] .zy-image-viewer[data-zoomed="true"] img {
        max-width: none;
        max-height: none;
      }
    }

/* themes.css */
/* Theme and platform overrides remain in original-order layers to preserve cascade behavior. */

/* legacy.css */
/* Legacy CSS fully partitioned into ordered style layers. Keep this file empty. */
