#cdf-converter-app {
      color-scheme: dark;
      --bg: #111318;
      --panel: #171a21;
      --panel-2: #1d222b;
      --line: #303642;
      --text: #eef2f7;
      --muted: #aeb7c5;
      --accent: #2f7af8;
      --accent-2: #16a36a;
      --warn: #f5a524;
      --bad: #ff4d5e;
    }

    #cdf-converter-app, #cdf-converter-app * { box-sizing: border-box; }

    #cdf-converter-app {
      margin: 0;
      min-height: 100vh;
      background: var(--bg);
      color: var(--text);
      font-family: "Segoe UI", Arial, sans-serif;
      font-size: 15px;
    }

    #cdf-converter-app .app {
      display: grid;
      grid-template-columns: 320px 1fr;
      min-height: 100vh;
    }

    #cdf-converter-app aside {
      border-right: 1px solid var(--line);
      background: #0f1217;
      padding: 22px;
    }

    #cdf-converter-app main {
      padding: 24px;
      overflow: auto;
    }

    #cdf-converter-app h1, #cdf-converter-app h2 {
      margin: 0;
      font-weight: 650;
      letter-spacing: 0;
    }

    #cdf-converter-app h1 { font-size: 24px; }
    #cdf-converter-app h2 { font-size: 17px; margin-bottom: 12px; }

    #cdf-converter-app .sub {
      color: var(--muted);
      margin: 8px 0 20px;
      line-height: 1.45;
    }

    #cdf-converter-app .drop {
      display: grid;
      place-items: center;
      min-height: 170px;
      border: 1px dashed #596273;
      background: var(--panel);
      border-radius: 8px;
      text-align: center;
      padding: 20px;
      cursor: pointer;
      transition: border-color .15s, background .15s;
    }

    #cdf-converter-app .drop:hover, #cdf-converter-app .drop.drag {
      border-color: var(--accent);
      background: #172033;
    }

    #cdf-converter-app .drop svg {
      width: 40px;
      height: 40px;
      margin-bottom: 10px;
      color: var(--accent);
    }

    #cdf-converter-app input[type="file"] { display: none; }

    #cdf-converter-app .section {
      border-top: 1px solid var(--line);
      padding-top: 18px;
      margin-top: 18px;
    }

    #cdf-converter-app label.check {
      display: grid;
      grid-template-columns: 20px 1fr;
      gap: 10px;
      align-items: start;
      margin: 12px 0;
      color: var(--text);
      line-height: 1.35;
    }

    #cdf-converter-app label.check span {
      color: var(--muted);
      display: block;
      font-size: 13px;
      margin-top: 2px;
    }

    #cdf-converter-app input[type="checkbox"] {
      width: 18px;
      height: 18px;
      accent-color: var(--accent);
      margin-top: 1px;
    }

    #cdf-converter-app .button-row {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 18px;
    }

    #cdf-converter-app button, #cdf-converter-app .download {
      border: 1px solid transparent;
      background: var(--accent);
      color: white;
      min-height: 38px;
      padding: 8px 12px;
      border-radius: 6px;
      font: inherit;
      cursor: pointer;
      text-decoration: none;
      display: inline-flex;
      gap: 8px;
      align-items: center;
      justify-content: center;
    }

    #cdf-converter-app button.secondary, #cdf-converter-app .download.secondary {
      background: var(--panel-2);
      border-color: var(--line);
    }

    #cdf-converter-app select, #cdf-converter-app input[type="search"], #cdf-converter-app input[type="text"], #cdf-converter-app input[type="number"] {
      min-height: 38px;
      border: 1px solid var(--line);
      border-radius: 6px;
      background: var(--panel-2);
      color: var(--text);
      padding: 8px 10px;
      font: inherit;
    }

    #cdf-converter-app input[type="search"] {
      min-width: 240px;
      flex: 1 1 260px;
    }

    #cdf-converter-app .mode-tabs {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 6px;
      margin: 18px 0;
      padding: 4px;
      border: 1px solid var(--line);
      border-radius: 7px;
      background: var(--panel);
    }

    #cdf-converter-app .mode-tabs button {
      min-width: 0;
      min-height: 34px;
      background: transparent;
      color: var(--muted);
      padding: 6px 8px;
    }

    #cdf-converter-app .mode-tabs button.active {
      background: var(--accent);
      color: white;
    }

    #cdf-converter-app .field {
      display: grid;
      gap: 6px;
      margin: 12px 0;
      color: var(--muted);
      font-size: 13px;
    }

    #cdf-converter-app .field input { width: 100%; }

    #cdf-converter-app .viewer-toolbar {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      align-items: center;
      margin-bottom: 10px;
    }

    #cdf-converter-app .viewer-meta {
      color: var(--muted);
      font-size: 13px;
      margin-bottom: 10px;
    }

    #cdf-converter-app .data-table {
      width: max-content;
      min-width: 100%;
    }

    #cdf-converter-app .data-table td {
      max-width: 420px;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    #cdf-converter-app .data-table td.long-value {
      white-space: normal;
      min-width: 260px;
    }

    #cdf-converter-app button:disabled {
      opacity: .45;
      cursor: not-allowed;
    }

    #cdf-converter-app button svg, #cdf-converter-app .download svg {
      width: 17px;
      height: 17px;
      flex: 0 0 auto;
    }

    #cdf-converter-app .grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(150px, 1fr));
      gap: 12px;
      margin-bottom: 18px;
    }

    #cdf-converter-app .metric {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 14px;
      min-height: 82px;
    }

    #cdf-converter-app .metric .value {
      font-size: 26px;
      font-weight: 700;
      margin-bottom: 5px;
    }

    #cdf-converter-app .metric .label {
      color: var(--muted);
      font-size: 13px;
    }

    #cdf-converter-app .status {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      min-height: 30px;
      border-radius: 999px;
      padding: 5px 11px;
      background: var(--panel-2);
      color: var(--muted);
      margin-bottom: 14px;
    }

    #cdf-converter-app .dot {
      width: 9px;
      height: 9px;
      border-radius: 50%;
      background: var(--muted);
    }

    #cdf-converter-app .status.ok .dot { background: var(--accent-2); }
    #cdf-converter-app .status.warn .dot { background: var(--warn); }
    #cdf-converter-app .status.bad .dot { background: var(--bad); }

    #cdf-converter-app .table-wrap {
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: auto;
      background: var(--panel);
      max-height: 430px;
    }

    #cdf-converter-app table {
      width: 100%;
      border-collapse: collapse;
      min-width: 880px;
    }

    #cdf-converter-app th, #cdf-converter-app td {
      border-bottom: 1px solid var(--line);
      padding: 10px 12px;
      text-align: left;
      vertical-align: top;
      white-space: nowrap;
    }

    #cdf-converter-app th {
      color: var(--muted);
      font-weight: 600;
      background: #141820;
      position: sticky;
      top: 0;
      z-index: 1;
    }

    #cdf-converter-app td.desc {
      white-space: normal;
      min-width: 330px;
    }

    #cdf-converter-app .tag {
      display: inline-flex;
      align-items: center;
      min-height: 24px;
      padding: 2px 7px;
      border-radius: 5px;
      background: #232936;
      color: var(--text);
      font-size: 13px;
    }

    #cdf-converter-app .empty {
      color: var(--muted);
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 18px;
    }

    #cdf-converter-app .log {
      margin-top: 14px;
      background: #0b0d11;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 12px;
      max-height: 220px;
      overflow: auto;
      color: #d7dde8;
      font-family: Consolas, "Courier New", monospace;
      font-size: 12px;
      line-height: 1.45;
      white-space: pre-wrap;
    }

   #cdf-converter-app @media (max-width: 860px) {
      #cdf-converter-app .app { grid-template-columns: 1fr; }
      #cdf-converter-app aside { border-right: 0; border-bottom: 1px solid var(--line); }
      #cdf-converter-app main { padding: 18px; }
      #cdf-converter-app .grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
    }

   #cdf-converter-app @media (max-width: 520px) {
      #cdf-converter-app .grid { grid-template-columns: 1fr; }
      #cdf-converter-app .button-row { flex-direction: column; }
      #cdf-converter-app button, #cdf-converter-app .download { width: 100%; }
    }

#cdf-converter-app {
  width: 100%;
  min-height: 760px;
  text-align: left;
}

#cdf-converter-app [hidden] { display: none !important; }
