    body {
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      background: #e5e7eb;
      color: #111827;
      margin: 0;
      padding: 0;
      min-height: 100vh;
      display: flex;
      justify-content: center;
      align-items: flex-start;
    }

    .page {
      max-width: 1200px;
      width: 100%;
      padding: 24px;
    }

    .card {
      background: #ffffff;
      border-radius: 16px;
      padding: 20px 24px;
      box-shadow: 0 20px 40px rgba(0,0,0,0.5);
      border: 1px solid rgba(255,255,255,0.05);
    }

    h1 {
      margin-top: 0;
      margin-bottom: 8px;
      font-size: 28px;
    }

    .subtitle {
      color: #4b5563;
      margin-bottom: 20px;
      font-size: 14px;
    }

    .layout {
      display: grid;
      grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
      gap: 24px;
    }

    .section-title {
      font-weight: 600;
      margin-bottom: 12px;
      font-size: 16px;
    }

    label {
      font-size: 13px;
      display: block;
      margin-bottom: 4px;
      color: #374151;
    }

    input[type="text"],
    input[type="number"] {
      width: 100%;
      padding: 8px 10px;
      border-radius: 8px;
      border: 1px solid #d1d5db;
      background: #ffffff;
      color: #111827;
      font-size: 14px;
      box-sizing: border-box;
    }

    input[type="file"] {
      width: 100%;
      font-size: 13px;
      color: #c5c9de;
    }

    input:focus {
      outline: none;
      border-color: #4f46e5;
      box-shadow: 0 0 0 1px #4f46e5;
    }

    .field-row {
      display: grid;
      grid-template-columns: 2fr 1fr 1fr;
      gap: 12px;
      margin-top: 8px;
    }

    .btn {
      border-radius: 999px;
      padding: 10px 16px;
      font-size: 14px;
      border: none;
      cursor: pointer;
      font-weight: 500;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.1s ease;
    }

    .btn-primary {
      background: linear-gradient(135deg, #4f46e5, #6366f1);
      color: #fff;
      box-shadow: 0 10px 25px rgba(79,70,229,0.5);
    }

    .btn-primary:hover {
      transform: translateY(-1px);
      box-shadow: 0 14px 30px rgba(79,70,229,0.6);
    }

    .btn-ghost {
      background: transparent;
      color: #e5e7eb;
      border: 1px solid #374151;
    }

    .btn-ghost:hover {
      background: #111827;
    }

    .buttons-row {
      margin-top: 16px;
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .hint {
      font-size: 12px;
      color: #9ca3af;
      margin-top: 4px;
    }

    .crop-container {
      background: #f9fafb;
      border-radius: 12px;
      border: 1px solid #e5e7eb;
      padding: 8px;
      margin-top: 8px;
      max-height: 340px;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
    }

    #imagePreview {
      max-width: 100%;
      max-height: 320px;
      display: block;
    }

    .cards-list {
      margin-top: 16px;
      max-height: 320px;
      overflow-y: auto;
      border-top: 1px solid #e5e7eb;
      padding-top: 8px;
    }

    .cards-list-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 6px 0;
      border-bottom: 1px dashed #e5e7eb;
      font-size: 13px;
    }

    .cards-list-item span {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 260px;
    }

    .mini-badge {
      font-size: 10px;
      padding: 2px 6px;
      border-radius: 999px;
      border: 1px solid #9ca3af;
      margin-left: 6px;
      color: #6b7280;
    }

    .easter-egg {
      margin-top: 8px;
      font-size: 13px;
      color: #ca8a04;
      display: none;
    }

    .preview-wrapper {
      margin-top: 8px;
      border-radius: 12px;
      border: 1px solid #e5e7eb;
      padding: 10px;
      background: #f9fafb;
    }

    .card-preview {
      width: 35mm;
      height: 120mm;
      position: relative;
      margin: 0 auto;
      background: #ffffff;
      border: 1px solid #111827;
      border-radius: 0;
      overflow: hidden;
    }

    .card-preview-export {
      margin: 0;
    }

    .card-cut-line {
      position: absolute;
      left: 0;
      top: 60mm;
      width: 100%;
      border-top: 1px dashed rgba(0, 0, 0, 0.3);
      z-index: 1;
      pointer-events: none;
    }

    .card-half {
      position: absolute;
      left: 0;
      width: 100%;
      height: 50%; /* каждая половина = 60мм при общей высоте 120мм */
      padding: 0;
      box-sizing: border-box;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-start;
      gap: 2px;
    }

    .card-half.top {
      top: 0;
      transform: rotate(180deg);
      transform-origin: center;
    }

    .card-half.bottom {
      bottom: 0;
    }

    /* Фото: 40мм высоты внутри половины (60мм) => 40/60 = 66.6667% */
    .card-photo {
      width: 100%;
      height: 66.6667%;
      background: none;
      border: none;
      display: flex;
      align-items: stretch;
      justify-content: center;
      font-size: 10px;
      text-align: center;
      overflow: hidden;
    }

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

    .card-photo-placeholder {
      display: flex;
      width: 100%;
      height: 100%;
      align-items: center;
      justify-content: center;
      padding: 8px;
      box-sizing: border-box;
      color: #6b7280;
    }

    .card-name {
      width: 100%;
      min-height: 14px;
      border-radius: 0;
      background: transparent;
      font-size: 14px;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #111827;
      padding: 2px 6px 1px; 
      box-sizing: border-box;
    }

    .card-name.empty {
      justify-content: flex-start;
      padding-left: 8px;
      color: #9ca3af;
    }

    .card-stats {
      display: flex;
      width: 100%;
      gap: 10px;
      margin-top: 0;
      padding: 0 8px 6px;
      box-sizing: border-box;
      justify-content: center;
    }

    :root { --stat-size: 12mm; }
    .shield {
      flex: 0 0 auto;
      display: flex;
      align-items: center;
      justify-content: center;
      line-height: var(--stat-size);
      font-size: calc(var(--stat-size) * 0.35);
      font-weight: 600;
      width: var(--stat-size);
      height: var(--stat-size);
      border-radius: 50%;
      background: #ffffff;
      color: #000000; 
      position: relative;  /* Чтобы элементы (текст и картинка) не перекрывали друг друга */
    }

    .shield img,
    .shield svg {
      max-width: 100%;    
      max-height: 100%;
      object-fit: contain;
      position: absolute; 
      inset: 0;
      width: 100%;
      height: 100%;
    }

    .shield span {
      position: relative;
      z-index: 1;
      transform: translateY(-0.5mm);
    }

    .speed {
      flex: 0 0 auto;
      display: flex;
      align-items: center;
      justify-content: center;
      line-height: var(--stat-size);
      font-size: calc(var(--stat-size) * 0.35);
      font-weight: 600;
      width: var(--stat-size);
      height: var(--stat-size);
      border-radius: 0;
      background: #ffffff;
      color: #000000; 
      position: relative;  /* Чтобы элементы (текст и картинка) не перекрывали друг друга */
    }
    .speed img,
    .speed svg {
      max-width: 100%;    
      max-height: 100%;
      object-fit: contain;
      position: absolute; 
      inset: 0;
      width: 100%;
      height: 100%;
    }

    .speed span {
      position: relative;
      z-index: 1;
      transform: translateY(-0.5mm);
    }

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