
    :root {
      color-scheme: light;
      --bg: #f7f8fb;
      --panel: #ffffff;
      --field: #f6f7f9;
      --line: #e6e9ef;
      --text: #20242a;
      --muted: #6f7785;
      --accent: #FFD028;
      --accent-2: #FFD028;
    }

    * {
      box-sizing: border-box;
    }

    html,
    body {
      width: 100%;
      min-height: 100%;
      margin: 0;
      background: var(--bg);
      color: var(--text);
      font-family: Arial, Helvetica, sans-serif;
      letter-spacing: 0;
    }

    body {
      min-height: 100vh;
      overflow: auto;
      padding: 28px;
    }

    .page-shell {
      display: grid;
      grid-template-columns: 330px minmax(0, 1fr);
      gap: 18px;
      align-items: start;
      max-width: 1280px;
      margin: 0 auto;
    }

    .page-header {
      grid-column: 1 / -1;
    }

    aside {
      display: flex;
      flex-direction: column;
      gap: 14px;
      padding: 16px;
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 8px;
      box-shadow: 0 12px 34px rgba(16, 24, 40, 0.08);
    }

    h1 {
      margin: 0;
      font-size: 22px;
      line-height: 1.15;
      color: var(--text);
    }

    .hint {
      margin: 5px 0 0;
      color: var(--muted);
      line-height: 1.45;
      font-size: 13px;
    }

    .section-title {
      margin: 0;
      color: var(--text);
      font-size: 14px;
      font-weight: 800;
    }

    .dimension-card {
      display: grid;
      gap: 12px;
      padding: 14px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fbfcfd;
    }

    .scheme-fields {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }

    .part-picker-button {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      width: 100%;
      min-height: 42px;
      padding: 0 12px;
      border: 1px solid var(--line);
      background: var(--field);
      color: var(--text);
      box-shadow: none;
      text-align: left;
    }

    .part-picker-arrow {
      color: var(--muted);
      font-size: 13px;
    }

    .dimension-input,
    .control-fields label {
      display: grid;
      gap: 7px;
      color: var(--muted);
      font-size: 14px;
    }

    .control-fields {
      display: grid;
      gap: 12px;
      padding: 14px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fbfcfd;
    }

    .counter-control {
      display: grid;
      grid-template-columns: 42px minmax(0, 1fr) 42px;
      gap: 8px;
      align-items: center;
    }

    .counter-button {
      min-height: 40px;
      padding: 0;
      border: 1px solid var(--line);
      background: var(--field);
      color: var(--text);
      font-size: 22px;
      line-height: 1;
    }

    .counter-value {
      display: grid;
      place-items: center;
      min-height: 40px;
      padding: 0 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--field);
      color: var(--text);
      font-weight: 700;
    }

    input {
      width: 100%;
      min-height: 38px;
      padding: 0 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--field);
      color: var(--text);
      font: inherit;
    }

    select {
      width: 100%;
      min-height: 40px;
      padding: 0 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--field);
      color: var(--text);
      font: inherit;
    }

    input:focus {
      outline: 2px solid var(--accent-2);
      outline-offset: 2px;
    }

    select:focus {
      outline: 2px solid var(--accent-2);
      outline-offset: 2px;
    }

    input:disabled,
    select:disabled,
    .counter-button:disabled {
      background: #eef0f3;
      color: #9aa3af;
      border-color: #dde1e7;
      cursor: not-allowed;
    }

    [aria-disabled="true"] {
      color: #a0a7b2;
      opacity: 0.62;
    }

    button {
      min-height: 46px;
      border: 0;
      border-radius: 8px;
      background: var(--accent);
      color: #111827;
      cursor: pointer;
      font: inherit;
      font-weight: 700;
    }

    button:disabled {
      cursor: not-allowed;
      opacity: 0.65;
    }

    #downloadButton:disabled {
      cursor: wait;
    }

    #downloadButton {
      box-shadow: 0 10px 26px rgba(255, 208, 40, 0.32);
    }

    #downloadButton:active {
      transform: translateY(1px);
    }

    .part-picker-modal {
      position: fixed;
      inset: 0;
      z-index: 20;
      display: grid;
      place-items: center;
      padding: 20px;
      background: rgba(15, 23, 42, 0.46);
    }

    .part-picker-modal[hidden] {
      display: none;
    }

    .part-picker-dialog {
      width: min(720px, 100%);
      padding: 18px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--panel);
      box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
    }

    .part-picker-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 14px;
    }

    .part-picker-title {
      margin: 0;
      font-size: 18px;
      font-weight: 800;
    }

    .part-picker-close {
      width: 38px;
      min-height: 38px;
      padding: 0;
      border: 1px solid var(--line);
      background: var(--field);
      box-shadow: none;
      font-size: 22px;
      line-height: 1;
    }

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

    .part-card {
      display: grid;
      gap: 10px;
      min-height: 0;
      padding: 10px;
      border: 1px solid var(--line);
      background: #fbfcfd;
      box-shadow: none;
      color: var(--text);
      text-align: left;
    }

    .part-card.active {
      border-color: var(--accent);
      box-shadow: 0 0 0 2px rgba(255, 208, 40, 0.35);
    }

    .part-thumb {
      display: block;
      width: 100%;
      aspect-ratio: 16 / 10;
      border-radius: 8px;
      background: #0b0e12;
    }

    .part-card-name {
      font-weight: 800;
    }

    .stats {
      display: grid;
      gap: 10px;
      margin-top: auto;
      padding-top: 16px;
      border-top: 1px solid var(--line);
      color: var(--muted);
      font-size: 14px;
    }

    .stat {
      display: flex;
      justify-content: space-between;
      gap: 12px;
    }

    .stat b {
      color: var(--text);
      text-align: right;
    }

    .viewer {
      position: relative;
      min-width: 0;
      height: calc(100vh - 128px);
      min-height: 560px;
      overflow: hidden;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #0b0e12;
      box-shadow: 0 12px 34px rgba(16, 24, 40, 0.08);
    }

    #preview {
      display: block;
      width: 100%;
      height: 100%;
      border-radius: 8px;
      cursor: grab;
    }

    #preview:active {
      cursor: grabbing;
    }

    .badge {
      position: absolute;
      left: 18px;
      bottom: 18px;
      padding: 10px 12px;
      border: 1px solid rgba(255, 255, 255, 0.14);
      border-radius: 8px;
      background: rgba(11, 14, 18, 0.78);
      color: var(--muted);
      backdrop-filter: blur(10px);
    }

    @media (max-width: 820px) {
      body {
        padding: 14px;
        overflow: auto;
      }

      .page-shell {
        grid-template-columns: 1fr;
      }

      .viewer {
        height: 68vh;
        min-height: 420px;
      }

      .scheme-fields {
        grid-template-columns: 1fr;
      }

      .part-card-grid {
        grid-template-columns: 1fr;
      }
    }
  