:root {
      --bg: #09101f;
      --panel: #11172a;
      --panel-2: #151d34;
      --panel-3: #0d1427;
      --text: #edf2ff;
      --muted: #9fb0d3;
      --line: #253252;
      --accent: #4d95ff;
      --accent-2: #7ec2ff;
      --ok: #5ee1a6;
      --warn: #ffd06a;
      --danger: #ff8a8a;
      --shadow: 0 18px 40px rgba(0,0,0,.28);
      --radius: 18px;
      --nav-h: 76px;
      --app-height: 100vh;
    }
    * { box-sizing: border-box; }
    html, body {
      margin: 0;
      min-height: 100%;
      background: linear-gradient(180deg, #09101f 0%, #0b1120 100%);
      color: var(--text);
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
      overflow-x: hidden;
      -webkit-text-size-adjust: 100%;
      overscroll-behavior-y: auto;
    }
    body {
      padding: 0;
      background-color: #09101f;
      min-height: var(--app-height);
      padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 12px);
    }
    button, input, select, textarea { font: inherit; }
    .app {
      max-width: 860px;
      margin: 0 auto;
      padding: 12px 12px calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 12px);
    }
    .screen {
      display: none;
      padding-bottom: 18px;
    }
    .screen.active { display: block; }
    #screen-home.active {
      display: block;
    }

    .card {
      background: rgba(17,23,42,.94);
      border: 1px solid var(--line);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      overflow: hidden;
    }
    .hero {
      width: 100%;
      max-width: 820px;
      margin: 0 auto;
      padding: 12px 12px 16px;
      background: linear-gradient(180deg, rgba(91,167,255,.10), rgba(91,167,255,0));
    }
    .hero h1, .screen-title {
      margin: 0;
      line-height: 1.15;
      letter-spacing: -.02em;
    }
    .hero h1 { font-size: 26px; }
    .sub {
      color: var(--muted);
      font-size: 14px;
      line-height: 1.5;
      margin-top: 8px;
    }
    .version {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 4px 8px;
      border-radius: 999px;
      border: 1px solid rgba(126,194,255,.22);
      background: rgba(91,167,255,.08);
      font-size: 10px;
      font-weight: 700;
      white-space: nowrap;
      color: var(--muted);
    }
    .dropzone {
      position: relative;
      margin-top: 0;
      border: 1.5px dashed rgba(126,194,255,.42);
      background: rgba(91,167,255,.05);
      border-radius: 18px;
      min-height: 112px;
      display: grid;
      place-items: center;
      text-align: center;
      padding: 18px;
      cursor: pointer;
      transition: .18s ease;
    }
    .dropzone.dragover {
      border-color: rgba(126,194,255,.9);
      background: rgba(91,167,255,.13);
      transform: translateY(-1px);
    }
    .dropzone-label {
      display: inline-flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
    }
    .dropzone .cta {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 148px;
      min-height: 44px;
      padding: 10px 16px;
      border-radius: 15px;
      background: linear-gradient(180deg, #4d95ff, #3b77ff);
      color: #fff;
      font-weight: 900;
      letter-spacing: .02em;
      box-shadow: 0 8px 24px rgba(61,117,255,.24);
    }
    .dropzone small {
      display: none;
    }
    input[type="file"] { display: none; }
    .home-actions {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 16px;
      margin-top: 16px;
      padding: 4px 0 2px;
    }
    .home-action-btn {
      min-height: auto;
      padding: 0;
      border: 0;
      background: transparent;
      color: var(--text);
      font-size: 15px;
      font-weight: 800;
      letter-spacing: .01em;
    }
    .home-action-btn.danger {
      color: #f4b5a8;
    }
    .home-sep {
      width: 1px;
      height: 18px;
      background: rgba(126,194,255,.24);
      flex: 0 0 1px;
    }
    #screen-home .hero {
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      max-height: none;
      overflow: visible;
    }
    #screen-home .status-line {
      display: none !important;
    }
    .panel, .section {
      margin-top: 12px;
      background: rgba(17,23,42,.94);
      border: 1px solid var(--line);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      overflow: hidden;
    }
    .section-head {
      padding: 14px 16px;
      border-bottom: 1px solid var(--line);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
    }
    .section-head h2, .section-head h3 {
      margin: 0;
      font-size: 18px;
      letter-spacing: -.01em;
    }
    .section-head small, .helper {
      color: var(--muted);
      line-height: 1.45;
      font-size: 13px;
    }
    .section-body {
      padding: 14px;
      display: grid;
      gap: 12px;
    }
    .btn, button, select, input[type="search"] {
      appearance: none;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--panel-2);
      color: var(--text);
      min-height: 44px;
    }
    .btn, button {
      cursor: pointer;
      padding: 10px 14px;
      font-weight: 800;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      text-decoration: none;
    }
    .primary {
      background: linear-gradient(180deg, #4d95ff, #3b77ff);
      border-color: #3b77ff;
      color: #fff;
    }
    .ghost {
      background: rgba(91,167,255,.08);
    }
    .danger {
      color: #ffdcdc;
      border-color: rgba(255,138,138,.38);
      background: rgba(255,138,138,.08);
    }
    .home-action-btn {
      min-height: auto !important;
      padding: 0 !important;
      border: 0 !important;
      background: transparent !important;
      color: var(--text) !important;
      font-size: 15px;
      font-weight: 800;
      letter-spacing: .01em;
      box-shadow: none !important;
    }
    .home-danger-link {
      color: #f4b5a8 !important;
    }

    button:disabled {
      opacity: .45;
      cursor: not-allowed;
    }
    .field, select, input[type="search"] {
      width: 100%;
      padding: 11px 12px;
      background: var(--panel-3);
      color: var(--text);
    }
    .screen-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 12px;
    }
    .screen-title {
      font-size: 22px;
    }
    .screen-sub {
      color: var(--muted);
      font-size: 13px;
      line-height: 1.5;
      margin-top: 6px;
    }
    .chips {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }
    .crumb {
      border: 1px solid var(--line);
      background: var(--panel-3);
      color: var(--text);
      border-radius: 999px;
      padding: 8px 12px;
      cursor: pointer;
      font-weight: 700;
      min-height: 38px;
    }
    .crumb.active {
      background: rgba(91,167,255,.18);
      border-color: rgba(126,194,255,.45);
    }
    .folder-grid {
      display: grid;
      gap: 10px;
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .folder-card {
      border: 1px solid var(--line);
      border-radius: 18px;
      padding: 12px;
      background: linear-gradient(180deg, rgba(91,167,255,.08), rgba(255,255,255,.02));
      display: grid;
      gap: 9px;
    }
    .folder-head {
      display: flex;
      gap: 10px;
      align-items: flex-start;
    }
    .folder-icon {
      width: 34px;
      height: 34px;
      border-radius: 12px;
      display: grid;
      place-items: center;
      background: rgba(126,194,255,.12);
      border: 1px solid rgba(126,194,255,.22);
      font-size: 18px;
      flex: 0 0 auto;
    }
    .folder-name {
      font-weight: 900;
      line-height: 1.25;
      word-break: break-word;
      letter-spacing: -.01em;
    }
    .folder-meta {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.4;
      margin-top: 4px;
    }
    .folder-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }
    .browser-controls {
      display: grid;
      grid-template-columns: 1fr 132px;
      gap: 10px;
    }
    .toggle-row {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      align-items: center;
      color: var(--muted);
      font-size: 13px;
    }
    .toggle-row label {
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }
    .toggle-row input {
      width: 18px;
      height: 18px;
      accent-color: var(--accent);
    }
    .file-list, .selected-list {
      display: grid;
      gap: 10px;
    }
    .file-item, .selected-item {
      border: 1px solid var(--line);
      border-radius: 18px;
      padding: 12px;
      background: rgba(255,255,255,.02);
      display: grid;
      gap: 10px;
    }
    .file-top, .selected-top {
      display: grid;
      grid-template-columns: auto 1fr auto;
      gap: 12px;
      align-items: start;
    }
    .file-item input[type="checkbox"] {
      width: 22px;
      height: 22px;
      margin-top: 3px;
      accent-color: var(--accent);
    }
    .file-name {
      font-size: 17px;
      font-weight: 900;
      line-height: 1.25;
      word-break: break-word;
      letter-spacing: -.01em;
    }
    .file-path {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.45;
      word-break: break-word;
      margin-top: 4px;
    }
    .meta-line {
      display: flex;
      flex-wrap: wrap;
      gap: 8px 12px;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.4;
      margin-top: 6px;
    }
    .pill {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 54px;
      padding: 7px 10px;
      border-radius: 999px;
      border: 1px solid rgba(126,194,255,.35);
      color: #d8eeff;
      background: rgba(91,167,255,.08);
      font-weight: 800;
      font-size: 12px;
      line-height: 1;
    }
    .pill.warn {
      border-color: rgba(255,208,106,.35);
      color: #ffe7af;
      background: rgba(255,208,106,.08);
    }
    .empty {
      border: 1px dashed rgba(126,194,255,.28);
      color: var(--muted);
      border-radius: 18px;
      padding: 18px;
      text-align: center;
      line-height: 1.55;
      background: rgba(255,255,255,.01);
    }
    .browser-footer {
      position: sticky;
      bottom: 0;
      z-index: 15;
      margin-top: 12px;
      border: 1px solid rgba(126,194,255,.26);
      background: rgba(13,20,39,.92);
      backdrop-filter: blur(10px);
      border-radius: 18px;
      padding: 12px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      box-shadow: var(--shadow);
    }
    .browser-footer strong {
      display: block;
      font-size: 15px;
    }
    .browser-footer small {
      display: block;
      color: var(--muted);
      line-height: 1.4;
      margin-top: 3px;
    }
    .selected-controls {
      display: grid;
      grid-template-columns: 1fr 130px 130px;
      gap: 10px;
    }
    .order-badge {
      width: 32px;
      height: 32px;
      border-radius: 11px;
      display: grid;
      place-items: center;
      background: rgba(91,167,255,.12);
      border: 1px solid rgba(126,194,255,.28);
      font-weight: 900;
      flex: 0 0 auto;
    }
    .mini-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }
    .mini-actions button {
      min-height: 38px;
      padding: 8px 10px;
      font-size: 13px;
    }
    .summary-card {
      border: 1px solid rgba(126,194,255,.26);
      border-radius: 18px;
      padding: 14px;
      background: linear-gradient(180deg, rgba(91,167,255,.08), rgba(255,255,255,.02));
      display: grid;
      gap: 10px;
    }
    .summary-grid, .output-stats {
      display: grid;
      gap: 10px;
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .summary-stat, .output-stat {
      border: 1px solid var(--line);
      border-radius: 16px;
      padding: 12px;
      background: rgba(255,255,255,.02);
    }
    .summary-stat .label, .output-stat .label {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.35;
    }
    .summary-stat .value, .output-stat .value {
      margin-top: 4px;
      font-size: 20px;
      font-weight: 900;
      letter-spacing: -.02em;
    }
    .settings-grid {
      display: grid;
      gap: 10px;
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .setting-chip {
      border: 1px solid var(--line);
      border-radius: 16px;
      padding: 10px 12px;
      background: rgba(255,255,255,.02);
      color: var(--muted);
      font-size: 13px;
      line-height: 1.4;
    }
    .setting-chip label {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      color: var(--text);
      font-weight: 700;
      margin-bottom: 6px;
    }
    .setting-chip input {
      width: 18px;
      height: 18px;
      accent-color: var(--accent);
    }
    .success-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: fit-content;
      padding: 8px 12px;
      border-radius: 999px;
      background: rgba(94,225,166,.12);
      border: 1px solid rgba(94,225,166,.28);
      color: #dffff0;
      font-weight: 900;
      font-size: 12px;
      letter-spacing: .06em;
    }
    .preview {
      border: 1px solid var(--line);
      border-radius: 18px;
      background: #09111f;
      overflow: hidden;
    }
    .preview-head {
      padding: 12px 14px;
      border-bottom: 1px solid var(--line);
      display: flex;
      justify-content: space-between;
      gap: 10px;
      align-items: center;
      flex-wrap: wrap;
    }
    .preview-head strong {
      font-size: 15px;
    }
    .preview-head small {
      color: var(--muted);
      line-height: 1.4;
    }
    pre.preview-body, textarea.hidden-output {
      margin: 0;
      padding: 14px;
      min-height: 260px;
      max-height: 480px;
      overflow: auto;
      white-space: pre-wrap;
      word-break: break-word;
      font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
      color: var(--text);
    }
    textarea.hidden-output {
      width: 100%;
      resize: vertical;
      background: transparent;
      border: 0;
      display: none;
    }
    .output-actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
    }
    .status-line {
      margin-top: 10px;
      color: var(--muted);
      font-size: 13px;
      line-height: 1.45;
    }
    .bottom-nav {
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 30;
      min-height: var(--nav-h);
      padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
      background: rgba(9,16,31,.96);
      backdrop-filter: blur(14px);
      border-top: 1px solid var(--line);
      display: grid;
      align-items: center;
      grid-template-columns: repeat(4, 1fr);
      gap: 8px;
    }
    body.home-screen {
      min-height: var(--app-height);
      overflow-x: hidden;
      overflow-y: hidden;
    }
    body.home-screen .app {
      min-height: calc(var(--app-height) - var(--nav-h) - env(safe-area-inset-bottom, 0px));
      padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 12px);
    }
    body.home-screen #screen-home,
    body.home-screen #screen-home.active {
      display: block;
      min-height: 0 !important;
      padding-bottom: 0 !important;
      margin-bottom: 0 !important;
    }
    body.home-screen #screen-home .hero {
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      min-height: clamp(340px, calc(var(--app-height) - var(--nav-h) - env(safe-area-inset-bottom, 0px) - 36px), 640px);
      margin-bottom: 0;
    }
    body.home-screen #screen-home .dropzone {
      flex: 1 1 auto;
      min-height: 0;
    }
    body.home-screen .bottom-nav {
      position: fixed !important;
      left: 0;
      right: 0;
      bottom: 0;
      margin: 0;
      padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
      border-top: 1px solid var(--line);
    }
    .nav-btn {
      border: 1px solid transparent;
      border-radius: 18px;
      background: transparent;
      color: var(--muted);
      display: grid;
      place-items: center;
      gap: 3px;
      padding: 6px 8px;
      min-height: 56px;
    }
    .nav-btn strong {
      font-size: 12px;
      line-height: 1.1;
    }
    .nav-btn span {
      font-size: 11px;
      line-height: 1;
      opacity: .9;
    }
    .nav-btn.active {
      color: var(--text);
      background: rgba(91,167,255,.10);
      border-color: rgba(126,194,255,.22);
    }
    .inline-count {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 20px;
      height: 20px;
      padding: 0 6px;
      border-radius: 999px;
      background: rgba(91,167,255,.16);
      border: 1px solid rgba(126,194,255,.30);
      color: #eaf5ff;
      font-size: 11px;
      font-weight: 900;
      margin-left: 6px;
    }
    .desktop-row {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      align-items: center;
    }

    body.home-screen,
    html.home-screen {
      height: 100%;
    }
    body.home-screen {
      min-height: 100svh !important;
      height: 100svh !important;
      padding-bottom: 0 !important;
      overflow: hidden !important;
      overscroll-behavior: none;
      touch-action: manipulation;
    }
    body.home-screen .app {
      position: relative;
      height: 100svh;
      min-height: 100svh;
      padding: 12px 12px 0 !important;
      overflow: hidden;
    }
    body.home-screen #screen-home,
    body.home-screen #screen-home.active {
      position: fixed;
      left: 50%;
      transform: translateX(-50%);
      width: min(860px, calc(100vw - 24px));
      top: 12px;
      bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 12px);
      display: block;
      padding: 0 !important;
      margin: 0 !important;
      overflow: hidden !important;
    }
    body.home-screen #screen-home .hero {
      height: 100%;
      min-height: 0 !important;
      margin: 0;
      padding: 12px 12px 16px;
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      overflow: hidden;
    }
    body.home-screen #screen-home .dropzone {
      flex: 1 1 auto;
      min-height: 0 !important;
      height: auto;
    }
    body.home-screen .bottom-nav {
      position: fixed !important;
      left: 0;
      right: 0;
      bottom: 0;
      margin: 0;
    }
    @media (max-width: 700px) {
      .folder-grid { grid-template-columns: 1fr; }
      .browser-controls { grid-template-columns: 1fr; }
      .selected-controls { grid-template-columns: 1fr; }
      .summary-grid, .output-stats, .settings-grid { grid-template-columns: 1fr; }
      .screen-top, .section-head, .browser-footer { align-items: stretch; }
      .home-actions { gap: 12px; }
      .home-action-btn { font-size: 14px; }
      .file-top, .selected-top { grid-template-columns: auto 1fr; }
      .file-top > :last-child, .selected-top > :last-child {
        grid-column: 2;
        justify-self: start;
      }
      .app { padding-left: 10px; padding-right: 10px; }
      .screen-title { font-size: 21px; }
    }

    /* v1.5.2 home lock fix */
    html.home-screen,
    body.home-screen {
      height: 100%;
      overflow: hidden !important;
      overscroll-behavior: none !important;
    }
    body.home-screen {
      padding-bottom: 0 !important;
    }
    body.home-screen .app {
      min-height: 100svh !important;
      height: 100svh !important;
      overflow: hidden !important;
      padding: 12px 12px 0 !important;
    }
    body.home-screen #screen-home,
    body.home-screen #screen-home.active {
      position: fixed !important;
      left: 50%;
      transform: translateX(-50%);
      top: 12px;
      bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 8px);
      width: min(860px, calc(100vw - 24px));
      display: block !important;
      overflow: hidden !important;
      padding: 0 !important;
      margin: 0 !important;
      min-height: 0 !important;
    }
    body.home-screen #screen-home .hero {
      height: auto !important;
      min-height: 0 !important;
      max-height: none !important;
      overflow: hidden !important;
      justify-content: flex-start !important;
    }
    body.home-screen #screen-home .dropzone {
      min-height: 112px !important;
      height: 112px !important;
      flex: 0 0 auto !important;
    }
    body.home-screen .bottom-nav {
      position: fixed !important;
      left: 0;
      right: 0;
      bottom: 0;
      margin: 0 !important;
    }
    body:not(.home-screen),
    html:not(.home-screen) {
      overflow-y: auto;
    }

    /* v1.5.4 compact home fix */
    html.home-screen,
    body.home-screen {
      height: 100%;
      overflow: hidden !important;
    }
    body.home-screen {
      padding-bottom: 0 !important;
    }
    body.home-screen .app {
      min-height: 100svh !important;
      height: 100svh !important;
      overflow: hidden !important;
      padding: 12px 12px 0 !important;
    }
    body.home-screen #screen-home,
    body.home-screen #screen-home.active {
      position: fixed !important;
      left: 50% !important;
      transform: translateX(-50%) !important;
      top: 12px !important;
      bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 10px) !important;
      width: min(860px, calc(100vw - 24px)) !important;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      overflow: hidden !important;
      padding: 0 !important;
      margin: 0 !important;
      min-height: 0 !important;
    }
    body.home-screen #screen-home .hero {
      width: 100% !important;
      max-width: none !important;
      margin: 0 !important;
      padding: 12px !important;
      display: block !important;
      height: auto !important;
      min-height: auto !important;
      max-height: none !important;
    }
    body.home-screen #screen-home .dropzone {
      min-height: 92px !important;
      height: 92px !important;
      padding: 12px !important;
      flex: 0 0 auto !important;
    }
    body.home-screen #screen-home .dropzone .cta {
      min-width: 132px !important;
      min-height: 40px !important;
      padding: 8px 14px !important;
      border-radius: 14px !important;
      font-size: 16px !important;
    }
    body.home-screen #screen-home .home-actions {
      margin-top: 14px !important;
      padding-bottom: 2px !important;
    }


    /* v1.5.4 home gap tighten */
    body.home-screen .bottom-nav {
      left: 50% !important;
      right: auto !important;
      width: min(860px, calc(100vw - 24px)) !important;
      transform: translateX(-50%) !important;
      border: 1px solid var(--line) !important;
      border-radius: 24px 24px 0 0 !important;
      padding-top: 8px !important;
      padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
      background: rgba(9,16,31,.97) !important;
    }
    body.home-screen #screen-home,
    body.home-screen #screen-home.active {
      top: 12px !important;
      bottom: auto !important;
    }
    body.home-screen #screen-home .hero {
      margin-bottom: 0 !important;
    }

  

    /* v1.5.6 definitive home layout fix */
    html.home-screen,
    body.home-screen {
      height: 100% !important;
      overflow: hidden !important;
      overscroll-behavior: none !important;
    }
    body.home-screen {
      padding-bottom: 0 !important;
      min-height: 100svh !important;
      height: 100svh !important;
    }
    body.home-screen .app {
      position: relative !important;
      max-width: 860px !important;
      margin: 0 auto !important;
      height: 100svh !important;
      min-height: 100svh !important;
      overflow: hidden !important;
      padding: 12px 12px 0 !important;
    }
    body.home-screen #screen-home,
    body.home-screen #screen-home.active {
      position: fixed !important;
      left: 50% !important;
      transform: translateX(-50%) !important;
      width: min(860px, calc(100vw - 24px)) !important;
      top: 12px !important;
      bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 8px) !important;
      display: block !important;
      overflow: hidden !important;
      padding: 0 !important;
      margin: 0 !important;
      min-height: 0 !important;
    }
    body.home-screen #screen-home .hero {
      width: 100% !important;
      height: 100% !important;
      min-height: 0 !important;
      max-height: none !important;
      margin: 0 !important;
      padding: 12px !important;
      display: flex !important;
      flex-direction: column !important;
      justify-content: flex-start !important;
      overflow: hidden !important;
      box-shadow: var(--shadow) !important;
    }
    body.home-screen #screen-home .version {
      align-self: flex-end !important;
      margin-bottom: 10px !important;
    }
    body.home-screen #screen-home .dropzone {
      flex: 1 1 auto !important;
      min-height: 140px !important;
      height: auto !important;
      max-height: none !important;
      margin-top: 0 !important;
      padding: 12px !important;
      display: grid !important;
      place-items: center !important;
    }
    body.home-screen #screen-home .dropzone .cta {
      min-width: 132px !important;
      min-height: 40px !important;
      padding: 8px 14px !important;
      border-radius: 14px !important;
      font-size: 16px !important;
    }
    body.home-screen #screen-home .home-actions {
      flex: 0 0 auto !important;
      margin-top: 14px !important;
      padding: 4px 0 0 !important;
    }
    body.home-screen .bottom-nav {
      position: fixed !important;
      left: 50% !important;
      right: auto !important;
      transform: translateX(-50%) !important;
      width: min(860px, calc(100vw - 24px)) !important;
      bottom: 0 !important;
      margin: 0 !important;
      border: 1px solid var(--line) !important;
      border-bottom: 0 !important;
      border-radius: 24px 24px 0 0 !important;
      padding-top: 8px !important;
      padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
      background: rgba(9,16,31,.97) !important;
      z-index: 40 !important;
    }
    

    /* v1.5.6 home compact final override */
    html.home-screen,
    body.home-screen {
      height: 100% !important;
      min-height: 100svh !important;
      overflow: hidden !important;
      overscroll-behavior: none !important;
    }
    body.home-screen {
      padding-bottom: 0 !important;
    }
    body.home-screen .app {
      position: relative !important;
      max-width: 860px !important;
      margin: 0 auto !important;
      height: 100svh !important;
      min-height: 100svh !important;
      overflow: hidden !important;
      padding: 12px 12px 0 !important;
    }
    body.home-screen #screen-home,
    body.home-screen #screen-home.active {
      position: fixed !important;
      left: 50% !important;
      transform: translateX(-50%) !important;
      width: min(860px, calc(100vw - 24px)) !important;
      top: 12px !important;
      bottom: auto !important;
      display: block !important;
      overflow: visible !important;
      padding: 0 !important;
      margin: 0 !important;
      min-height: 0 !important;
    }
    body.home-screen #screen-home .hero {
      width: 100% !important;
      height: auto !important;
      min-height: auto !important;
      max-height: none !important;
      margin: 0 !important;
      padding: 12px !important;
      display: block !important;
      overflow: hidden !important;
    }
    body.home-screen #screen-home .version {
      align-self: auto !important;
      float: right !important;
      margin-bottom: 10px !important;
    }
    body.home-screen #screen-home .dropzone {
      min-height: 92px !important;
      height: 92px !important;
      margin-top: 0 !important;
      padding: 12px !important;
      display: grid !important;
      place-items: center !important;
      flex: none !important;
    }
    body.home-screen #screen-home .dropzone .cta {
      min-width: 132px !important;
      min-height: 40px !important;
      padding: 8px 14px !important;
      border-radius: 14px !important;
      font-size: 16px !important;
    }
    body.home-screen #screen-home .home-actions {
      margin-top: 14px !important;
      padding: 4px 0 0 !important;
    }
    body.home-screen .bottom-nav {
      position: fixed !important;
      left: 50% !important;
      right: auto !important;
      transform: translateX(-50%) !important;
      width: min(860px, calc(100vw - 24px)) !important;
      bottom: 0 !important;
      margin: 0 !important;
      border: 1px solid var(--line) !important;
      border-bottom: 0 !important;
      border-radius: 24px 24px 0 0 !important;
      padding-top: 8px !important;
      padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
      background: rgba(9,16,31,.97) !important;
      z-index: 40 !important;
    }
html:not(.home-screen),
    body:not(.home-screen) {
      overflow-y: auto !important;
      height: auto !important;
      min-height: 100% !important;
    }


    /* v1.6.0 rebuilt home screen */
    body.home-screen,
    html.home-screen {
      overflow: hidden !important;
      overscroll-behavior: none !important;
      height: 100% !important;
      min-height: 100svh !important;
      background: linear-gradient(180deg, #09101f 0%, #0b1120 100%) !important;
    }
    body.home-screen {
      padding-bottom: 0 !important;
    }
    body.home-screen .app {
      max-width: 860px !important;
      margin: 0 auto !important;
      padding: 0 16px calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 12px) !important;
      min-height: auto !important;
      height: auto !important;
      overflow: visible !important;
    }
    body.home-screen #screen-home,
    body.home-screen #screen-home.active {
      position: fixed !important;
      left: 50% !important;
      transform: translateX(-50%) !important;
      top: 0 !important;
      bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 10px) !important;
      width: min(860px, 100vw) !important;
      display: block !important;
      padding: 0 16px 12px !important;
      margin: 0 !important;
      overflow: hidden !important;
      min-height: 0 !important;
      max-height: none !important;
      background: linear-gradient(180deg, #09101f 0%, #0b1120 100%) !important;
      z-index: 10;
    }
    body.home-screen #screen-home .home-shell {
      height: 100%;
      display: grid;
      grid-template-rows: auto auto auto auto 1fr auto;
      gap: 16px;
      padding-top: 14px;
    }
    body.home-screen #screen-home .home-topbar {
      display: grid;
      grid-template-columns: 44px 1fr 62px;
      align-items: center;
      gap: 12px;
      min-height: 48px;
    }
    .home-menu-btn {
      width: 44px;
      height: 44px;
      padding: 0;
      border: 0;
      background: transparent;
      display: grid;
      gap: 5px;
      align-content: center;
      justify-items: start;
      box-shadow: none;
    }
    .home-menu-btn span {
      display: block;
      width: 28px;
      height: 3px;
      border-radius: 999px;
      background: #cfdcff;
      opacity: .92;
    }
    .home-brand {
      color: #cfdcff;
      font-weight: 900;
      letter-spacing: .08em;
      font-size: 16px;
      text-transform: uppercase;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .home-badge {
      width: 56px;
      height: 56px;
      border-radius: 18px;
      background: linear-gradient(180deg, #2e86ff, #1f63df);
      display: grid;
      place-items: center;
      color: #fff;
      font-weight: 900;
      box-shadow: 0 12px 30px rgba(37,108,255,.28);
      justify-self: end;
      position: relative;
      overflow: hidden;
    }
    .home-badge span {
      font-size: 24px;
      line-height: 1;
      letter-spacing: -.03em;
    }
    .home-badge small {
      position: absolute;
      bottom: 4px;
      right: 6px;
      font-size: 8px;
      font-weight: 800;
      letter-spacing: .02em;
      opacity: .85;
    }
    body.home-screen #screen-home .home-heading {
      display: grid;
      gap: 10px;
      padding-top: 8px;
    }
    body.home-screen #screen-home .home-heading h1 {
      margin: 0;
      font-size: clamp(38px, 8vw, 64px);
      line-height: .98;
      letter-spacing: -.045em;
      color: #eef3ff;
      font-weight: 900;
    }
    body.home-screen #screen-home .home-heading p {
      margin: 0;
      color: #d9e4ff;
      font-size: 17px;
      line-height: 1.5;
      opacity: .95;
    }
    body.home-screen #screen-home .home-upload-card {
      padding: 28px 24px 26px;
      display: grid;
      place-items: center;
      gap: 22px;
      background: rgba(17,23,42,.9);
    }
    .home-upload-icon {
      width: 112px;
      height: 112px;
      border-radius: 24px;
      background: rgba(7,14,30,.75);
      display: grid;
      place-items: center;
      position: relative;
      box-shadow: inset 0 0 0 1px rgba(126,194,255,.08);
    }
    .home-upload-icon-inner {
      width: 54px;
      height: 42px;
      border-radius: 10px;
      background: #a8bbef;
      position: relative;
    }
    .home-upload-icon-inner::before {
      content: '';
      position: absolute;
      top: -8px;
      left: 6px;
      width: 24px;
      height: 12px;
      border-radius: 8px 8px 0 0;
      background: #a8bbef;
    }
    .home-upload-icon-inner::after {
      content: '';
      position: absolute;
      right: 10px;
      top: 8px;
      width: 6px;
      height: 26px;
      background: repeating-linear-gradient(to bottom, #09101f 0 4px, transparent 4px 8px);
    }
    .home-upload-icon-plus {
      position: absolute;
      right: 12px;
      bottom: 12px;
      width: 34px;
      height: 34px;
      border-radius: 10px;
      background: #a8bbef;
      color: #10234a;
      display: grid;
      place-items: center;
      font-weight: 900;
      font-size: 24px;
      line-height: 1;
      box-shadow: 0 10px 24px rgba(61,117,255,.18);
    }
    body.home-screen #screen-home .home-dropzone {
      width: 100%;
      max-width: none;
      min-height: 0 !important;
      height: auto !important;
      margin: 0 !important;
      padding: 0 !important;
      border: 0 !important;
      background: transparent !important;
      box-shadow: none !important;
    }
    body.home-screen #screen-home .home-dropzone .dropzone-label {
      gap: 14px;
    }
    body.home-screen #screen-home .home-dropzone .cta {
      min-width: 304px;
      min-height: 88px;
      padding: 18px 28px;
      border-radius: 18px;
      font-size: 24px;
      font-weight: 900;
      letter-spacing: .03em;
      box-shadow: 0 18px 42px rgba(61,117,255,.26);
    }
    body.home-screen #screen-home .home-dropzone small {
      display: block !important;
      color: rgba(237,242,255,.82);
      font-size: 15px;
      font-weight: 800;
      letter-spacing: .12em;
      text-align: center;
    }
    body.home-screen #screen-home .home-session-bar {
      display: grid;
      grid-template-columns: 1fr auto;
      align-items: center;
      gap: 18px;
      padding: 18px 22px;
      background: rgba(9,16,31,.72);
    }
    .home-session-btn {
      min-height: auto;
      padding: 0;
      border: 0;
      background: transparent;
      color: #eef3ff;
      font-weight: 900;
      font-size: 20px;
      letter-spacing: -.02em;
      justify-content: flex-start;
      box-shadow: none;
    }
    .home-session-btn .home-session-icon {
      display: inline-grid;
      place-items: center;
      margin-right: 12px;
      font-size: 28px;
      line-height: 1;
      color: #d5e2ff;
    }
    .home-session-btn.danger-text {
      color: #f4b5a8;
      justify-content: flex-end;
      text-transform: uppercase;
      font-size: 17px;
      letter-spacing: .05em;
    }
    .home-spacer {
      min-height: 0;
    }
    .home-footnote {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      color: rgba(159,176,211,.52);
      font-size: 12px;
      letter-spacing: .18em;
      font-weight: 800;
      text-align: center;
      padding-bottom: 4px;
      text-transform: uppercase;
    }
    .home-footnote-icon {
      font-size: 12px;
      opacity: .8;
    }
    body.home-screen .bottom-nav {
      position: fixed !important;
      left: 0 !important;
      right: 0 !important;
      bottom: 0 !important;
      top: auto !important;
      width: auto !important;
      transform: none !important;
      margin: 0 !important;
      z-index: 40 !important;
      border-top: 1px solid var(--line) !important;
      border-right: 0 !important;
      border-left: 0 !important;
      border-bottom: 0 !important;
      border-radius: 0 !important;
      background: rgba(9,16,31,.96) !important;
    }
    body.home-screen .nav-btn {
      min-height: 60px;
      border-radius: 18px;
    }
    @media (max-width: 700px) {
      body.home-screen #screen-home,
      body.home-screen #screen-home.active {
        padding: 0 16px 10px !important;
      }
      body.home-screen #screen-home .home-shell {
        gap: 14px;
        grid-template-rows: auto auto auto auto 1fr auto;
      }
      .home-brand {
        font-size: 14px;
      }
      .home-badge {
        width: 48px;
        height: 48px;
        border-radius: 16px;
      }
      .home-badge span {
        font-size: 21px;
      }
      body.home-screen #screen-home .home-heading h1 {
        font-size: 34px;
      }
      body.home-screen #screen-home .home-heading p {
        font-size: 14px;
      }
      body.home-screen #screen-home .home-upload-card {
        padding: 22px 18px 20px;
        gap: 16px;
      }
      .home-upload-icon {
        width: 88px;
        height: 88px;
        border-radius: 22px;
      }
      .home-upload-icon-inner {
        width: 46px;
        height: 34px;
      }
      .home-upload-icon-plus {
        width: 30px;
        height: 30px;
        border-radius: 9px;
        font-size: 22px;
      }
      body.home-screen #screen-home .home-dropzone .cta {
        min-width: 0;
        width: min(100%, 304px);
        min-height: 64px;
        font-size: 18px;
        padding: 14px 20px;
        border-radius: 16px;
      }
      body.home-screen #screen-home .home-dropzone small {
        font-size: 11px;
        letter-spacing: .12em;
      }
      body.home-screen #screen-home .home-session-bar {
        grid-template-columns: 1fr auto;
        gap: 14px;
        padding: 16px 18px;
      }
      .home-session-btn {
        font-size: 16px;
      }
      .home-session-btn .home-session-icon {
        margin-right: 10px;
        font-size: 22px;
      }
      .home-session-btn.danger-text {
        font-size: 15px;
      }
      .home-footnote {
        font-size: 10px;
        letter-spacing: .12em;
      }
    }

  
    /* v1.7.0 home rebuild override */
    html.home-screen,
    body.home-screen {
      height: 100% !important;
      overflow: hidden !important;
    }
    body.home-screen {
      margin: 0 !important;
      background: linear-gradient(180deg, #09101f 0%, #0b1120 100%) !important;
      padding: 0 !important;
    }
    body.home-screen .app {
      max-width: 860px !important;
      height: 100% !important;
      margin: 0 auto !important;
      padding: 0 12px calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 12px) !important;
      overflow: hidden !important;
    }
    body.home-screen #screen-home,
    body.home-screen #screen-home.active {
      position: fixed !important;
      inset: 0 0 calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 12px) 0 !important;
      display: block !important;
      padding: 12px !important;
      overflow: hidden !important;
      background: linear-gradient(180deg, #09101f 0%, #0b1120 100%) !important;
      z-index: 20 !important;
    }
    body.home-screen #screen-home .home-shell {
      max-width: 836px !important;
      height: 100% !important;
      margin: 0 auto !important;
      display: flex !important;
      flex-direction: column !important;
      gap: 14px !important;
      overflow: hidden !important;
      justify-content: flex-start !important;
    }
    body.home-screen #screen-home .home-topbar,
    body.home-screen #screen-home .home-heading,
    body.home-screen #screen-home .home-spacer,
    body.home-screen #screen-home .home-footnote {
      display: none !important;
    }
    body.home-screen #screen-home .home-upload-card {
      margin: 0 !important;
      padding: 18px 16px 16px !important;
      gap: 14px !important;
      min-height: 0 !important;
      background: rgba(17,23,42,.94) !important;
      align-content: initial !important;
      justify-items: initial !important;
    }
    body.home-screen #screen-home .home-upload-icon {
      width: 76px !important;
      height: 76px !important;
      border-radius: 20px !important;
      margin: 0 auto 2px !important;
    }
    body.home-screen #screen-home .home-upload-icon-inner {
      transform: scale(.9) !important;
    }
    body.home-screen #screen-home .home-dropzone {
      margin-top: 0 !important;
      min-height: 118px !important;
      padding: 14px !important;
      border-radius: 18px !important;
    }
    body.home-screen #screen-home .home-dropzone .dropzone-label {
      gap: 10px !important;
    }
    body.home-screen #screen-home .home-dropzone .cta {
      min-width: 180px !important;
      min-height: 56px !important;
      padding: 12px 22px !important;
      border-radius: 16px !important;
      font-size: 18px !important;
      line-height: 1 !important;
    }
    body.home-screen #screen-home .home-dropzone small {
      display: block !important;
      font-size: 12px !important;
      letter-spacing: .12em !important;
      text-align: center !important;
      line-height: 1.35 !important;
    }
    body.home-screen #screen-home .home-session-bar {
      margin: 0 !important;
      padding: 14px 16px !important;
      min-height: 0 !important;
      box-shadow: var(--shadow) !important;
    }
    body.home-screen #screen-home .home-session-btn {
      min-height: 0 !important;
      font-size: 15px !important;
    }
    body.home-screen #screen-home .home-session-btn.danger-text {
      font-size: 15px !important;
    }
    body.home-screen .bottom-nav {
      position: fixed !important;
      left: 0 !important;
      right: 0 !important;
      bottom: 0 !important;
      margin: 0 !important;
      z-index: 40 !important;
    }
    html:not(.home-screen),
    body:not(.home-screen) {
      overflow-y: auto !important;
    }

    /* v1.7.0 clean home rebuild */
    html.home-screen,
    body.home-screen {
      width: 100% !important;
      height: 100% !important;
      overflow: hidden !important;
      overscroll-behavior: none !important;
    }
    body.home-screen {
      padding: 0 !important;
      min-height: 100% !important;
      background: linear-gradient(180deg, #09101f 0%, #0b1120 100%) !important;
    }
    body.home-screen .app {
      width: 100% !important;
      max-width: none !important;
      margin: 0 !important;
      padding: 0 !important;
    }
    body.home-screen #screen-home,
    body.home-screen #screen-home.active {
      position: fixed !important;
      top: 0 !important;
      left: 0 !important;
      right: 0 !important;
      bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)) !important;
      width: 100% !important;
      max-width: none !important;
      display: block !important;
      padding: 12px 14px 10px !important;
      overflow: hidden !important;
      z-index: 10 !important;
    }
    body.home-screen #screen-home .home-shell {
      width: 100% !important;
      height: 100% !important;
      max-width: 820px !important;
      margin: 0 auto !important;
      display: flex !important;
      flex-direction: column !important;
      justify-content: flex-start !important;
      gap: 14px !important;
      overflow: hidden !important;
    }
    body.home-screen #screen-home .home-topbar,
    body.home-screen #screen-home .home-heading,
    body.home-screen #screen-home .home-spacer,
    body.home-screen #screen-home .home-footnote,
    body.home-screen #screen-home .home-upload-icon {
      display: none !important;
    }
    body.home-screen #screen-home .home-upload-card {
      margin: 0 !important;
      padding: 14px !important;
      min-height: 0 !important;
      display: block !important;
      box-shadow: var(--shadow) !important;
    }
    body.home-screen #screen-home .home-dropzone {
      margin: 0 !important;
      min-height: 168px !important;
      padding: 18px 16px !important;
      border-radius: 18px !important;
      display: grid !important;
      place-items: center !important;
    }
    body.home-screen #screen-home .home-dropzone .dropzone-label {
      gap: 12px !important;
      align-items: center !important;
    }
    body.home-screen #screen-home .home-dropzone .cta {
      min-width: 176px !important;
      min-height: 52px !important;
      padding: 12px 20px !important;
      border-radius: 16px !important;
      font-size: 18px !important;
      letter-spacing: .01em !important;
    }
    body.home-screen #screen-home .home-dropzone small {
      display: block !important;
      font-size: 12px !important;
      letter-spacing: .12em !important;
      line-height: 1.35 !important;
      color: #d9e4ff !important;
      text-align: center !important;
    }
    body.home-screen #screen-home .home-session-bar {
      margin: 0 !important;
      padding: 14px 16px !important;
      min-height: 0 !important;
      display: grid !important;
      grid-template-columns: 1fr auto !important;
      gap: 16px !important;
      align-items: center !important;
      box-shadow: var(--shadow) !important;
    }
    body.home-screen #screen-home .home-session-btn {
      min-height: 0 !important;
      padding: 0 !important;
      border: 0 !important;
      background: transparent !important;
      font-size: 15px !important;
      font-weight: 800 !important;
      color: var(--text) !important;
      justify-content: flex-start !important;
      box-shadow: none !important;
    }
    body.home-screen #screen-home .home-session-btn.danger-text {
      color: #f4b5a8 !important;
      justify-content: flex-end !important;
    }
    body.home-screen .bottom-nav {
      position: fixed !important;
      left: 0 !important;
      right: 0 !important;
      bottom: 0 !important;
      margin: 0 !important;
      z-index: 40 !important;
    }

    .ui-version-badge {
      position: fixed;
      top: max(10px, env(safe-area-inset-top, 0px));
      right: 12px;
      z-index: 60;
      border-radius: 999px;
      border: 1px solid rgba(126,194,255,.24);
      background: rgba(13,20,39,.88);
      color: var(--muted);
      font-size: 11px;
      font-weight: 800;
      letter-spacing: .08em;
      padding: 6px 10px;
      backdrop-filter: blur(10px);
      pointer-events: none;
    }
    body[data-screen="home"] .app {
      min-height: calc(var(--app-height) - var(--nav-h) - env(safe-area-inset-bottom, 0px));
    }
    body[data-screen="browser"],
    body[data-screen="selected"],
    body[data-screen="output"] {
      overflow-y: auto;
    }
