﻿:root {
      color-scheme: light;
      --bg: #eeeeed;
      --panel: #f4f4f3;
      --panel-soft: #eceff2;
      --ink: #111827;
      --muted: #677282;
      --line: #c7cdd5;
      --line-soft: #dde2e8;
      --blue: #2463e8;
      --blue-strong: #1748bd;
      --green: #0b806a;
      --green-soft: #dff2ed;
      --orange: #a85a00;
      --orange-soft: #fff0dc;
      --red: #b83232;
      --red-soft: #ffe4e4;
      --shadow: 0 18px 50px rgba(17, 24, 39, 0.08);
      --radius: 8px;
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    * {
      box-sizing: border-box;
    }

    body {
      min-width: 320px;
      margin: 0;
      background: var(--bg);
      color: var(--ink);
    }

    button,
    input,
    select {
      font: inherit;
    }

    button {
      border: 0;
      cursor: pointer;
    }

    button:disabled,
    input:disabled,
    select:disabled {
      cursor: not-allowed;
      opacity: 0.48;
    }

    .app {
      width: min(1320px, calc(100% - 36px));
      min-height: 90vh;
      margin: 0 auto;
      padding: 26px 0 34px;
    }

    .topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 22px;
    }

    .brand {
      display: flex;
      align-items: center;
      min-width: 0;
      gap: 12px;
    }

    .brand-mark {
      display: grid;
      width: 56px;
      height: 42px;
      place-items: center;
      color: #ffffff;
    }

    .brand-mark img {
      display: block;
      width: 56px;
      height: 42px;
      object-fit: contain;
    }

    .brand h1 {
      margin: 0;
      font-size: clamp(1.55rem, 2.5vw, 2rem);
      line-height: 1;
      letter-spacing: 0;
    }

    .brand small {
      display: block;
      margin-top: 5px;
      color: var(--muted);
      font-weight: 700;
    }

    .totals {
      display: grid;
      grid-template-columns: repeat(3, minmax(88px, 1fr));
      gap: 8px;
      min-width: min(430px, 48vw);
    }

    .metric {
      min-width: 0;
      padding: 9px 11px;
      border: 1px solid var(--line-soft);
      border-radius: var(--radius);
      background: rgba(255, 255, 255, 0.62);
    }

    .metric span {
      display: block;
      color: var(--muted);
      font-size: 0.68rem;
      font-weight: 900;
      text-transform: uppercase;
    }

    .metric strong {
      display: block;
      margin-top: 3px;
      overflow-wrap: anywhere;
      font-size: 1rem;
    }

    .split {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: clamp(24px, 7vw, 110px);
      align-items: start;
    }

    .half {
      min-width: 0;
    }

    .half-title {
      margin: 0 0 14px;
      font-size: clamp(1.25rem, 2.2vw, 1.85rem);
      font-weight: 700;
      letter-spacing: 0;
    }

    .panel {
      display: flex;
      min-height: min(720px, calc(100vh - 138px));
      max-height: 860px;
      flex-direction: column;
      overflow: hidden;
      border: 1px solid #9fa6b0;
      border-radius: 24px;
      background: rgba(244, 244, 243, 0.96);
      box-shadow: var(--shadow);
    }

    .panel-inner {
      display: flex;
      min-height: 0;
      flex: 1;
      flex-direction: column;
      padding: 18px;
    }

    .dropzone {
      display: grid;
      min-height: 228px;
      place-items: center;
      padding: 20px;
      border: 2px dashed #9ea5ad;
      border-radius: 20px;
      background: rgba(255, 255, 255, 0.15);
      color: var(--ink);
      text-align: center;
      transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
    }

    .dropzone.dragover {
      border-color: var(--blue);
      background: #eef4ff;
      transform: translateY(-1px);
    }

    .dropzone strong {
      display: block;
      margin-top: 12px;
      color: var(--ink);
      font-size: clamp(1.15rem, 2.1vw, 1.8rem);
      font-weight: 500;
    }

    .dropzone span {
      display: block;
      margin-top: 5px;
      color: var(--muted);
      font-weight: 700;
    }

    .drop-icon {
      width: 58px;
      height: 58px;
    }

    .file-input {
      display: none;
    }

    .options {
      display: grid;
      grid-template-columns: minmax(170px, 0.85fr) minmax(210px, 1.15fr);
      gap: 18px;
      margin: 12px 6px 16px;
      align-items: start;
    }

    .field {
      min-width: 0;
    }

    .field label,
    .option-title {
      display: block;
      margin-bottom: 7px;
      color: #596575;
      font-size: 0.72rem;
      font-weight: 900;
      text-transform: uppercase;
    }

    .target-inputs {
      display: grid;
      grid-template-columns: minmax(72px, 1fr) 82px;
      gap: 6px;
    }

    .field input,
    .field select {
      width: 100%;
      min-height: 40px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #f8f8f8;
      color: var(--ink);
      padding: 0 11px;
      font-weight: 850;
      outline: none;
    }

    .field input:focus,
    .field select:focus {
      border-color: var(--blue);
      box-shadow: 0 0 0 3px rgba(36, 99, 232, 0.15);
    }

    .format-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }

    .format-choice {
      position: relative;
      min-width: 0;
    }

    .format-choice input {
      position: absolute;
      inset: 0;
      opacity: 0;
    }

    .format-choice span {
      display: flex;
      min-height: 40px;
      align-items: center;
      justify-content: center;
      border: 1px solid var(--line-soft);
      border-radius: var(--radius);
      background: #f8f8f8;
      color: var(--ink);
      font-size: 0.82rem;
      font-weight: 900;
    }

    .format-choice input:checked + span {
      border-color: var(--blue);
      background: #eaf1ff;
      color: var(--blue-strong);
      box-shadow: inset 0 0 0 1px rgba(36, 99, 232, 0.2);
    }

    .format-choice input:disabled + span {
      background: #e2e5e8;
      color: #8c95a1;
    }

    .list {
      display: grid;
      min-height: 0;
      align-content: start;
      gap: 10px;
      overflow-y: auto;
      padding: 4px 0 12px;
      scrollbar-width: thin;
    }

    .input-list {
      flex: 1;
    }

    .output-stage {
      position: relative;
      display: flex;
      min-height: 0;
      flex: 1;
      flex-direction: column;
    }

    .output-list {
      flex: 1;
      padding-top: 4px;
    }

    .empty-output {
      display: grid;
      min-height: 300px;
      flex: 1;
      place-items: center;
      color: #8a929e;
      text-align: center;
    }

    .empty-output svg {
      width: 92px;
      height: 92px;
      margin-bottom: 12px;
      opacity: 0.72;
    }

    .empty-output strong {
      display: block;
      color: #677282;
      font-size: 1.04rem;
    }

    .file-row {
      display: grid;
      min-height: 70px;
      align-items: center;
      gap: 10px;
      border-radius: var(--radius);
      background: rgba(255, 255, 255, 0.2);
      transition: opacity 150ms ease, transform 150ms ease, background 150ms ease;
    }

    .file-row.input-row {
      grid-template-columns: 58px minmax(0, 1fr) 54px 86px;
      padding: 7px 10px;
    }

    .file-row.output-row {
      grid-template-columns: 48px minmax(86px, 1fr) 44px repeat(3, minmax(58px, 68px)) 62px 40px;
      padding: 6px 8px;
    }

    .file-row.is-processing {
      background: #eef4ff;
    }

    .file-row.is-moving-source {
      opacity: 0.25;
      transform: scale(0.98);
    }

    .thumb {
      display: grid;
      width: 48px;
      height: 48px;
      overflow: hidden;
      place-items: center;
      border: 1px solid var(--line-soft);
      border-radius: var(--radius);
      background: #e7ebef;
      color: var(--muted);
      font-size: 0.72rem;
      font-weight: 900;
    }

    .input-row .thumb {
      width: 58px;
      height: 58px;
    }

    .thumb img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .file-name {
      min-width: 0;
    }

    .file-name strong {
      display: block;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-size: 0.88rem;
      font-weight: 900;
    }

    .file-name span {
      display: block;
      margin-top: 3px;
      color: var(--muted);
      font-size: 0.76rem;
      font-weight: 750;
    }

    .pill-value {
      min-width: 0;
      overflow-wrap: anywhere;
      font-size: 0.88rem;
      font-weight: 900;
    }

    .metric-box {
      min-width: 0;
      padding: 7px 8px;
      border: 1px solid var(--line-soft);
      border-radius: 6px;
      background: #e9edf2;
    }

    .metric-box span {
      display: block;
      color: #657181;
      font-size: 0.58rem;
      font-weight: 900;
      line-height: 1;
      text-transform: uppercase;
    }

    .metric-box strong {
      display: block;
      margin-top: 4px;
      overflow-wrap: anywhere;
      font-size: 0.74rem;
      font-weight: 950;
      line-height: 1.05;
    }

    .status {
      display: inline-flex;
      min-height: 25px;
      max-width: 100%;
      align-items: center;
      justify-content: center;
      border-radius: 999px;
      padding: 0 9px;
      background: #e5e8ec;
      color: var(--muted);
      font-size: 0.68rem;
      font-weight: 900;
      white-space: nowrap;
    }

    .status.done {
      background: var(--green-soft);
      color: var(--green);
    }

    .status.warn {
      background: var(--orange-soft);
      color: var(--orange);
    }

    .status.error {
      background: var(--red-soft);
      color: var(--red);
    }

    .status.working {
      background: #e2ebff;
      color: var(--blue-strong);
    }

    .icon-button,
    .button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 9px;
      border-radius: var(--radius);
      font-weight: 900;
      white-space: nowrap;
    }

    .button {
      min-height: 58px;
      padding: 0 24px;
      background: #f0f0ef;
      color: #607083;
      box-shadow: 0 0 0 1px var(--line-soft);
    }

    .button.primary {
      background: var(--blue);
      color: #ffffff;
      box-shadow: none;
    }

    .button.primary:not(:disabled):hover {
      background: var(--blue-strong);
    }

    .button.success {
      background: var(--green);
      color: #ffffff;
      box-shadow: none;
    }

    .button.success:not(:disabled):hover {
      background: #086b59;
    }

    .button svg,
    .icon-button svg {
      width: 20px;
      height: 20px;
      flex: 0 0 auto;
    }

    .icon-button {
      width: 38px;
      height: 38px;
      background: #edf2ff;
      color: var(--blue-strong);
    }

    .actions {
      display: flex;
      justify-content: center;
      gap: 14px;
      margin-top: auto;
      padding: 14px 0 10px;
      background: linear-gradient(180deg, rgba(244, 244, 243, 0), rgba(244, 244, 243, 0.96) 25%);
    }

    .output-actions {
      background: linear-gradient(180deg, rgba(244, 244, 243, 0), rgba(235, 238, 232, 0.96) 25%);
    }

    .support-note {
      min-height: 18px;
      margin: 0 6px 10px;
      color: var(--muted);
      font-size: 0.74rem;
      font-weight: 700;
      line-height: 1.35;
    }

    .flight-card {
      position: fixed;
      z-index: 50;
      pointer-events: none;
      box-shadow: 0 20px 48px rgba(17, 24, 39, 0.18);
      background: #ffffff;
    }

    @media (prefers-reduced-motion: reduce) {
      *,
      *::before,
      *::after {
        animation-duration: 1ms !important;
        scroll-behavior: auto !important;
        transition-duration: 1ms !important;
      }
    }

    @media (max-width: 1120px) {
      .split {
        gap: 24px;
      }

      .output-row.file-row {
        grid-template-columns: 48px minmax(110px, 1fr) 44px repeat(2, minmax(64px, 1fr)) 62px 40px;
      }

      .output-row .metric-box.saved-box,
      .output-row .output-stat.saved-stat {
        grid-column: 4 / 6;
      }
    }

    @media (max-width: 900px) {
      .topbar {
        align-items: flex-start;
        flex-direction: column;
      }

      .totals {
        width: 100%;
        min-width: 0;
      }

      .split {
        grid-template-columns: 1fr;
      }

      .panel {
        min-height: 620px;
        max-height: none;
      }
    }

    @media (max-width: 620px) {
      .app {
        width: min(100% - 20px, 1320px);
        padding-top: 18px;
      }

      .totals,
      .options {
        grid-template-columns: 1fr;
      }

      .panel-inner {
        padding: 12px;
      }

      .dropzone {
        min-height: 190px;
      }

      .file-row.input-row,
      .file-row.output-row {
        grid-template-columns: 48px minmax(0, 1fr) 42px;
      }

      .input-row .thumb {
        width: 48px;
        height: 48px;
      }

      .input-row .size-cell,
      .output-row .metric-box,
      .output-row .output-stat,
      .output-row .status-cell {
        grid-column: 2 / -1;
      }

      .output-row .format-cell {
        grid-column: 3;
        grid-row: 1;
      }

      .actions {
        align-items: stretch;
        flex-direction: column;
      }

      .button {
        width: 100%;
      }
    }

    :root {
      color-scheme: dark;
      --bg: #09090b;
      --panel: #0f0f10;
      --panel-soft: #18181b;
      --ink: #fafafa;
      --muted: #a1a1aa;
      --line: #27272a;
      --line-soft: #3f3f46;
      --blue: #60a5fa;
      --blue-strong: #93c5fd;
      --green: #10b981;
      --green-soft: rgba(16, 185, 129, 0.14);
      --orange: #f59e0b;
      --orange-soft: rgba(245, 158, 11, 0.14);
      --red: #f87171;
      --red-soft: rgba(248, 113, 113, 0.14);
      --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
      --radius: 10px;
    }

    [hidden] {
      display: none !important;
    }

    body {
      background: #09090b;
      color: var(--ink);
    }

    button:disabled,
    input:disabled,
    select:disabled {
      opacity: 0.45;
    }

    .app {
      width: min(1440px, calc(100% - 40px));
      padding: 24px 0 32px;
    }

    .topbar {
      margin-bottom: 18px;
    }

    .brand-mark {
      color: #f4f4f5;
    }

    .brand h1 {
      font-size: clamp(1.35rem, 2vw, 1.75rem);
      font-weight: 750;
    }

    .brand small {
      color: var(--muted);
      font-size: 0.9rem;
      font-weight: 500;
    }

    .totals {
      min-width: min(420px, 48vw);
    }

    .metric {
      border-color: var(--line);
      background: rgba(24, 24, 27, 0.72);
    }

    .metric span,
    .field label,
    .option-title {
      color: var(--muted);
      font-size: 0.72rem;
      letter-spacing: 0;
    }

    .metric strong {
      color: #f4f4f5;
      font-size: 0.95rem;
      font-weight: 700;
    }

    .split {
      gap: 20px;
    }

    .half-title {
      margin: 0 0 10px;
      color: #f4f4f5;
      font-size: 0.86rem;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    .panel {
      min-height: min(760px, calc(100vh - 152px));
      border-color: var(--line);
      border-radius: 14px;
      background: rgba(15, 15, 16, 0.98);
      box-shadow: var(--shadow);
    }

    .panel-inner {
      padding: 16px;
    }

    .dropzone {
      min-height: 210px;
      border-color: #3f3f46;
      border-radius: 12px;
      background: #09090b;
      color: #f4f4f5;
    }

    .dropzone.dragover {
      border-color: var(--blue);
      background: rgba(96, 165, 250, 0.08);
    }

    .dropzone strong {
      color: #fafafa;
      font-size: clamp(1.05rem, 1.7vw, 1.35rem);
      font-weight: 650;
    }

    .dropzone span {
      color: var(--muted);
      font-weight: 500;
    }

    .drop-icon {
      width: 42px;
      height: 42px;
      color: #d4d4d8;
    }

    .options {
      grid-template-columns: minmax(260px, 0.95fr) minmax(260px, 1.05fr);
      gap: 12px;
      margin: 14px 0 12px;
      align-items: stretch;
    }

    .field {
      border: 1px solid var(--line);
      border-radius: 12px;
      background: #09090b;
      padding: 12px;
    }

    .field-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 10px;
    }

    .field-top .option-title {
      margin-bottom: 0;
    }

    .segmented {
      display: inline-grid;
      grid-template-columns: repeat(2, 1fr);
      min-width: 174px;
      padding: 3px;
      border: 1px solid var(--line);
      border-radius: 9px;
      background: #18181b;
    }

    .segment {
      min-height: 30px;
      border-radius: 7px;
      background: transparent;
      color: var(--muted);
      font-size: 0.78rem;
      font-weight: 700;
    }

    .segment.is-active {
      background: #f4f4f5;
      color: #09090b;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
    }

    .goal-panel {
      min-width: 0;
    }

    .target-inputs {
      grid-template-columns: minmax(90px, 1fr) 92px;
    }

    .percent-inputs {
      display: grid;
      grid-template-columns: minmax(90px, 1fr) 52px;
      gap: 6px;
    }

    .percent-suffix {
      display: grid;
      min-height: 40px;
      place-items: center;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #18181b;
      color: var(--muted);
      font-weight: 800;
    }

    .field input,
    .field select {
      border-color: var(--line);
      background: #18181b;
      color: #fafafa;
      font-weight: 700;
    }

    .field input:focus,
    .field select:focus {
      border-color: var(--blue);
      box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.22);
    }

    .format-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }

    .format-choice span {
      min-height: 38px;
      border-color: var(--line);
      background: #18181b;
      color: #e4e4e7;
      font-size: 0.78rem;
      font-weight: 750;
    }

    .format-choice input:checked + span {
      border-color: #f4f4f5;
      background: #f4f4f5;
      color: #09090b;
      box-shadow: none;
    }

    .format-choice input {
      opacity: 0 !important;
      appearance: none;
      pointer-events: none;
    }

    .format-choice input:disabled + span {
      background: #18181b;
      color: #52525b;
    }

    .support-note {
      min-height: 0;
      margin: 0 2px 10px;
      color: var(--muted);
      font-size: 0.78rem;
      font-weight: 500;
    }

    .list {
      gap: 8px;
      padding: 0 0 12px;
    }

    .output-stage {
      position: relative;
      display: block;
      min-height: 0;
      flex: 1;
    }

    .output-list {
      height: 100%;
      align-content: start;
      padding-top: 0;
    }

    .empty-output {
      position: absolute;
      inset: 0;
      min-height: 0;
      pointer-events: none;
    }

    .empty-output svg {
      color: #52525b;
    }

    .empty-output strong {
      color: #a1a1aa;
      font-weight: 600;
    }

    .file-row {
      border: 1px solid var(--line);
      border-radius: 10px;
      background: #18181b;
    }

    .file-row.input-row {
      grid-template-columns: 52px minmax(0, 1fr) 52px 86px 38px;
      min-height: 66px;
      padding: 7px 9px;
    }

    .file-row.output-row {
      grid-template-columns: 46px minmax(92px, 1fr) 42px repeat(3, minmax(62px, 74px)) 62px 38px;
      min-height: 64px;
      padding: 7px 8px;
    }

    .file-row.is-processing {
      border-color: rgba(96, 165, 250, 0.5);
      background: rgba(96, 165, 250, 0.1);
    }

    .thumb {
      width: 46px;
      height: 46px;
      border-color: var(--line);
      background: #09090b;
      color: var(--muted);
    }

    .input-row .thumb {
      width: 52px;
      height: 52px;
    }

    .file-name strong {
      color: #fafafa;
      font-size: 0.86rem;
      font-weight: 750;
    }

    .file-name span {
      color: var(--muted);
      font-weight: 500;
    }

    .pill-value {
      color: #e4e4e7;
      font-size: 0.82rem;
      font-weight: 750;
    }

    .metric-box {
      border-color: var(--line);
      background: transparent;
    }

    .metric-box span {
      color: #a1a1aa;
      font-size: 0.56rem;
      letter-spacing: 0.03em;
    }

    .metric-box strong {
      color: #fafafa;
      font-weight: 750;
    }

    .output-stat {
      min-width: 0;
      color: #fafafa;
      line-height: 1.05;
    }

    .output-stat span {
      display: block;
      color: var(--muted);
      font-size: 0.58rem;
      font-weight: 750;
      letter-spacing: 0.03em;
      text-transform: uppercase;
    }

    .output-stat strong {
      display: block;
      margin-top: 4px;
      overflow-wrap: anywhere;
      font-size: 0.76rem;
      font-weight: 750;
    }

    .status {
      background: #27272a;
      color: #d4d4d8;
    }

    .status.done {
      background: var(--green-soft);
      color: #34d399;
    }

    .status.warn {
      background: var(--orange-soft);
      color: #fbbf24;
    }

    .status.error {
      background: var(--red-soft);
      color: #fca5a5;
    }

    .status.working {
      background: rgba(96, 165, 250, 0.14);
      color: #93c5fd;
    }

    .button {
      min-height: 44px;
      padding: 0 18px;
      border: 1px solid var(--line);
      background: #18181b;
      color: #e4e4e7;
      box-shadow: none;
    }

    .button.primary {
      background: #f4f4f5;
      color: #09090b;
    }

    .button.primary:not(:disabled):hover {
      background: #e4e4e7;
    }

    .button.success {
      background: #10b981;
      color: #04130f;
    }

    .button.success:not(:disabled):hover {
      background: #34d399;
    }

    .icon-button {
      width: 36px;
      height: 36px;
      border: 1px solid var(--line);
      background: #09090b;
      color: #d4d4d8;
    }

    .icon-button:hover {
      border-color: #52525b;
      color: #fafafa;
    }

    .actions {
      justify-content: flex-end;
      gap: 10px;
      padding: 14px 0 0;
      background: linear-gradient(180deg, rgba(15, 15, 16, 0), #0f0f10 36%);
    }

    .output-actions {
      background: linear-gradient(180deg, rgba(15, 15, 16, 0), #0f0f10 36%);
    }

    .flight-card {
      border-color: #52525b;
      background: #18181b;
      box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
    }

    @media (max-width: 1120px) {
      .format-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }
    }

    @media (max-width: 1180px) {
      .options {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 620px) {
      .field-top {
        align-items: stretch;
        flex-direction: column;
      }

      .segmented {
        width: 100%;
      }

      .format-grid {
        grid-template-columns: 1fr;
      }

      .file-row.input-row {
        grid-template-columns: 48px minmax(0, 1fr) 42px 38px;
      }

      .input-row .size-cell {
        grid-column: 2 / 4;
      }
    }

    .output-row {
      cursor: pointer;
    }

    .output-row.is-selected {
      border-color: #fafafa;
      box-shadow: 0 0 0 1px #fafafa, 0 18px 46px rgba(0, 0, 0, 0.32);
    }

    .output-row .icon-button {
      cursor: pointer;
    }

    .download-dialog {
      width: min(440px, calc(100% - 32px));
      border: 1px solid var(--line);
      border-radius: 14px;
      padding: 0;
      background: #0f0f10;
      color: var(--ink);
      box-shadow: 0 28px 90px rgba(0, 0, 0, 0.62);
    }

    .download-dialog::backdrop {
      background: rgba(0, 0, 0, 0.68);
      backdrop-filter: blur(5px);
    }

    .download-card {
      display: grid;
      gap: 14px;
      padding: 18px;
    }

    .dialog-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
    }

    .dialog-head h2 {
      margin: 0;
      color: #fafafa;
      font-size: 1.05rem;
      font-weight: 750;
      letter-spacing: 0;
    }

    .dialog-head p {
      margin: 5px 0 0;
      color: var(--muted);
      font-size: 0.86rem;
      line-height: 1.4;
    }

    .dialog-close {
      display: inline-grid;
      width: 34px;
      height: 34px;
      flex: 0 0 auto;
      place-items: center;
      border: 1px solid var(--line);
      border-radius: 9px;
      background: #18181b;
      color: #d4d4d8;
    }

    .dialog-close svg {
      width: 18px;
      height: 18px;
    }

    .download-options {
      display: grid;
      gap: 8px;
    }

    .download-option {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 12px;
      align-items: center;
      width: 100%;
      min-height: 58px;
      border: 1px solid var(--line);
      border-radius: 10px;
      background: #18181b;
      color: #fafafa;
      padding: 10px 12px;
      text-align: left;
    }

    .download-option:not(:disabled):hover {
      border-color: #71717a;
      background: #202024;
    }

    .download-option:disabled {
      color: #71717a;
      opacity: 0.58;
    }

    .download-option strong {
      display: block;
      font-size: 0.92rem;
      font-weight: 750;
    }

    .download-option span {
      display: block;
      margin-top: 3px;
      color: var(--muted);
      font-size: 0.78rem;
      font-weight: 500;
    }

    .download-option em {
      color: #a1a1aa;
      font-size: 0.75rem;
      font-style: normal;
      font-weight: 700;
    }

    .input-setup {
      display: grid;
      grid-template-columns: minmax(280px, 1fr) minmax(230px, 285px);
      gap: 12px;
      align-items: stretch;
      margin-bottom: 12px;
    }

    .input-setup .dropzone {
      min-height: 178px;
    }

    .input-setup .options {
      display: grid;
      grid-template-columns: 1fr;
      gap: 10px;
      align-content: stretch;
      margin: 0;
    }

    .input-setup .field {
      padding: 11px;
    }

    .input-setup .goal-field label,
    .input-setup .option-title {
      margin-bottom: 8px;
    }

    .input-setup .target-inputs {
      grid-template-columns: minmax(80px, 1fr) 82px;
    }

    .input-setup .format-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    @media (max-width: 920px) {
      .input-setup {
        grid-template-columns: 1fr;
      }

      .input-setup .dropzone {
        min-height: 180px;
      }
    }

    @media (max-width: 620px) {
      .input-setup .format-grid {
        grid-template-columns: 1fr;
      }
    }

    button:not(:disabled),
    .button:not(:disabled),
    .icon-button:not(:disabled),
    .download-option:not(:disabled),
    .dropzone,
    .format-choice,
    .format-choice span,
    .field input:not(:disabled),
    .field select:not(:disabled) {
      cursor: pointer;
    }

    .split {
      align-items: stretch;
    }

    .half {
      display: flex;
      min-height: 0;
      flex-direction: column;
    }

    .panel {
      height: max(640px, calc(100vh - 160px));
      min-height: 0;
      max-height: none;
      flex: 1 1 auto;
    }

    .panel-inner {
      min-height: 0;
      overflow: hidden;
      padding: 0;
    }

    .panel-body {
      display: flex;
      min-height: 0;
      flex: 1 1 auto;
      flex-direction: column;
      overflow: hidden;
      padding: 16px 16px 0;
    }

    .panel-footer {
      flex: 0 0 auto;
      flex-wrap: wrap;
      margin-top: 0;
      padding: 12px 16px 16px;
      border-top: 1px solid var(--line);
      background: #0f0f10;
      box-shadow: 0 -18px 36px rgba(0, 0, 0, 0.18);
    }

    .actions,
    .output-actions {
      background: #0f0f10;
    }

    .input-list {
      min-height: 0;
      flex: 1 1 auto;
      overflow-y: auto;
      padding-bottom: 16px;
    }

    .output-stage {
      position: relative;
      display: flex;
      min-height: 0;
      flex: 1 1 auto;
      flex-direction: column;
      overflow: hidden;
    }

    .output-list {
      height: auto;
      min-height: 0;
      flex: 1 1 auto;
      overflow-y: auto;
      padding-bottom: 16px;
    }

    @media (max-width: 1180px) {
      .split {
        grid-template-columns: 1fr;
        gap: 24px;
      }

      .panel {
        height: max(580px, calc(100vh - 148px));
      }
    }

    @media (max-width: 700px) {
      .file-row.input-row,
      .file-row.output-row {
        grid-template-columns: 48px minmax(0, 1fr) 42px;
        align-items: center;
      }

      .input-row .thumb {
        width: 48px;
        height: 48px;
      }

      .input-row .file-name,
      .output-row .file-name {
        grid-column: 2;
        grid-row: 1;
      }

      .input-row .format-cell,
      .output-row .format-cell {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
      }

      .input-row .size-cell {
        grid-column: 2;
        grid-row: 2;
      }

      .input-row .row-compress {
        grid-column: 3;
        grid-row: 2;
      }

      .output-row .output-stat {
        display: grid;
        grid-column: 2 / 4;
        grid-template-columns: 74px minmax(0, 1fr);
        align-items: baseline;
        gap: 8px;
      }

      .output-row .output-stat span,
      .output-row .output-stat strong {
        margin-top: 0;
      }

      .output-row .status-cell {
        grid-column: 2;
      }

      .output-row .icon-button {
        grid-column: 3;
        justify-self: end;
      }
    }

    @media (max-width: 520px) {
      .app {
        width: min(100% - 20px, 1440px);
      }

      .panel {
        height: max(560px, calc(100vh - 134px));
      }

      .panel-body {
        padding: 12px 12px 0;
      }

      .panel-footer {
        align-items: stretch;
        flex-direction: column;
        padding: 12px;
      }

      .panel-footer .button {
        width: 100%;
      }
    }

    @media (min-width: 1181px) {
      html,
      body {
        height: 100%;
        overflow: hidden;
      }

      .app {
        display: grid;
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        grid-template-rows: auto minmax(0, 1fr);
        padding: 20px 0;
      }

      .topbar {
        margin-bottom: 16px;
      }

      .split {
        min-height: 0;
        overflow: hidden;
      }

      .half {
        display: grid;
        min-height: 0;
        grid-template-rows: auto minmax(0, 1fr);
      }

      .panel {
        height: auto;
        min-height: 0;
      }
    }
