  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }

  body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f0f0;
    min-height: 100vh;
  }

  .hidden {
    display: none !important;
  }

  .modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
  }

  .modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    max-width: 90%;
    width: 320px;
  }

  .modal-content h2 {
    margin-bottom: 15px;
  }

  .modal-content p {
    margin-bottom: 15px;
    color: #666;
  }

  .modal-content input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 15px;
  }

  header {
    background: #2196F3;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  header h1 {
    font-size: 20px;
  }

  .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  main {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
  }

  .btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: opacity 0.2s;
  }

  .btn:hover {
    opacity: 0.9;
  }

  .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  .btn.primary {
    background: #2196F3;
    color: white;
  }

  .btn.secondary {
    background: #e0e0e0;
    color: #333;
  }

  .btn.small {
    padding: 8px 16px;
    font-size: 14px;
  }

  .upload-area {
    background: white;
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
  }

  .upload-area.dragover {
    border-color: #2196F3;
    background: #e3f2fd;
  }

  .upload-area p {
    margin-bottom: 15px;
    color: #666;
  }

  .upload-area input[type="file"] {
    display: none;
  }

  .upload-area .btn {
    display: inline-block;
    margin: 5px;
  }

  #cameraContainer {
    text-align: center;
  }

  #video {
    width: 100%;
    max-width: 400px;
    border-radius: 12px;
    margin-bottom: 15px;
  }

  #cameraContainer .btn {
    margin: 5px;
  }

  #previewContainer {
    text-align: center;
  }

  #preview {
    width: 100%;
    max-width: 400px;
    border-radius: 12px;
    margin-bottom: 15px;
  }

  .preview-actions .btn {
    margin: 5px;
  }

  #resultsSection {
    background: white;
    border-radius: 12px;
    padding: 20px;
  }

  #resultsSection h2 {
    margin-bottom: 20px;
  }

  .form-group {
    margin-bottom: 15px;
  }

  .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
  }

  .form-group input,
  .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
  }

  .form-group textarea {
    resize: vertical;
    font-family: inherit;
  }

  .discount-group {
    background: #e8f5e9;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #4caf50;
  }

  .discount-group label {
    color: #2e7d32;
    font-weight: bold;
  }

  .discount-group input {
    background: #fff;
    font-weight: bold;
    color: #2e7d32;
  }

  .item-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    align-items: center;
    padding: 8px;
    border-radius: 6px;
    background: #fafafa;
  }

  .item-row:has(.free-checkbox:checked) {
    background: #e8f5e9;
  }

  .item-row .name {
    flex: 2;
    min-width: 0;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
  }

  .item-row .price {
    width: 80px;
    flex-shrink: 0;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
  }

  .free-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
  }

  .free-text {
    font-size: 9px;
    color: #666;
    text-transform: uppercase;
  }

  .free-checkbox {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: #4caf50;
  }

  .remove-btn {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    flex-shrink: 0;
    font-weight: bold;
  }

  .remove-btn:hover {
    background: #d32f2f;
  }

  .result-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }

  #loading {
    text-align: center;
    padding: 40px;
  }

  .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #2196F3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
  }

  @keyframes spin {
    to { transform: rotate(360deg); }
  }

  #message {
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    text-align: center;
  }

  #message.success {
    background: #e8f5e9;
    color: #2e7d32;
  }

  #message.error {
    background: #ffebee;
    color: #c62828;
  }

  #duplicateWarning {
    background: #fff3e0;
    color: #e65100;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
  }
