    * { margin: 0; padding: 0; box-sizing: border-box; }
    html, body { overflow-x: hidden; }
    
    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      background: linear-gradient(135deg, #a8c5e6 0%, #c1d9f0 100%);
      min-height: 100vh;
      padding: 20px;
      color: #333;
    }
    
    .container {
      max-width: 900px;
      margin: 0 auto;
      background: #d0a789;
      border-radius: 16px;
      box-shadow: 0 20px 60px rgba(0,0,0,0.3);
      overflow: hidden;
      border: 20px solid #1e3c72;
    }
    
    .header {
      background: #e8e8e8;
      color: white;
      padding: 40px 30px;
      text-align: center;
    }
    
    .header h1 {
      font-size: 32px;
      margin-bottom: 12px;
      color: #1e3c72;
    }
    
    .header p {
      opacity: 0.9;
      font-size: 16px;
      line-height: 1.5;
      color: #2a5298;
    }

    .header-logo {
      max-width: 500px;
      height: auto;
      margin-bottom: 20px;
      display: block;
      margin-left: auto;
      margin-right: auto;
    }
    
    .content {
      padding: 40px 30px;
      background: #e8e8e8;
    }
    
    .intro-box {
      background: white;
      border-left: 4px solid #2196F3;
      border-radius: 12px;
      padding: 24px;
      margin-bottom: 30px;
      line-height: 1.7;
      position: relative;  /* Added */
      z-index: 1;          /* Added */
    }
    
    .intro-box h2 {
      color: #2196F3;
      font-size: 20px;
      margin-bottom: 12px;
    }
    
    .section {
      background: #f9f9f9;
      border: 2px solid #e0e0e0;
      border-radius: 12px;
      padding: 24px;
      margin-bottom: 24px;
      transition: all 0.3s;
    }
    
    .section:hover {
      border-color: #2a298;
      box-shadow: 0 4px 12px rgba(42, 82, 12, 0.1);
    }
    
    .section-header {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 20px;
      padding-bottom: 16px;
      border-bottom: 2px solid #e0e0e0;
    }
    
    .section-icon {
      font-size: 28px;
    }
    
    .section-title {
      font-size: 22px;
      font-weight: 700;
      color: #333;
    }
    
    .form-group {
      margin-bottom: 24px;
    }
    
    .form-group label {
      display: block;
      font-weight: 600;
      margin-bottom: 8px;
      color: #555;
      font-size: 15px;
    }
    
    .form-group .help-text {
      font-size: 13px;
      color: #777;
      font-weight: 400;
      margin-top: 6px;
      line-height: 1.4;
    }
    
    .form-group select,
    .form-group input[type="number"],
    .form-group input[type="text"],
    .form-group input[type="url"],
    .form-group input[type="file"] {
      width: 100%;
      padding: 12px;
      border: 2px solid #e0e0e0;
      border-radius: 8px;
      font-size: 15px;
      transition: border-color 0.2s;
      font-family: inherit;
    }
    
    .form-group select:focus,
    .form-group input:focus {
      outline: none;
      border-color: #667eea;
    }
    
    .radio-group {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    
    .radio-option {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      padding: 14px;
      border: 2px solid #e0e0e0;
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.2s;
      background: white;
    }
    
    .radio-option:hover {
      border-color: #2a5298;
      background: #f8f9ff;
    }
    
    .radio-option.selected {
      border-color: #2a5298;
      background: #f8f9ff;
    }
    
    .radio-option input[type="radio"] {
      width: 20px;
      height: 20px;
      cursor: pointer;
      margin-top: 1px;
      flex-shrink: 0;
    }
    
    .radio-option-content {
      flex: 1;
    }
    
    .radio-option-label {
      font-weight: 600;
      display: inline-block;
      font-size: 15px;
      line-height: 20px;
      vertical-align: top;
    }
    
    .radio-option-desc {
      font-size: 13px;
      color: #666;
      line-height: 1.4;
      display: block;
      margin-top: 4px;
    }
    
    .conditional-input {
      margin-top: 12px;
      padding: 12px;
      background: #f5f5f5;
      border-radius: 6px;
    }
    
    .runtime-row {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 8px;
      margin-top: 6px;
    }
    
    #fixedRuntimeMinutes,
    #fixedRuntimeSeconds {
      width: 80px;
    }
    
    .info-box {
      padding: 16px;
      background: #fff9e6;
      border-left: 4px solid #FFC107;
      border-radius: 8px;
      margin-bottom: 20px;
      font-size: 14px;
      color: #886600;
      line-height: 1.5;
    }
    
    .info-box.blue {
      background: #e3f2fd;
      border-left-color: #2196F3;
      color: #1565c0;
    }
    
    /* Transition Section Layout */
    .transition-container {
      display: flex;
      gap: 20px;
      align-items: flex-start;
    }
    
    .transition-dropdown {
      flex: 0 0 280px;
    }
    
    .transition-preview {
      flex: 1;
    }
    
    /* Song Library */
    .library-section {
      background: #f0f7ff;
      border: 2px solid #2196F3;
      border-radius: 12px;
      padding: 20px;
      margin-bottom: 20px;
    }
    
    .library-header {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 15px;
      font-size: 16px;
      font-weight: 700;
      color: #2196F3;
    }
    
    .library-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
      gap: 12px;
    }
    
    .library-song-card {
      background: white;
      border: 2px solid #FFE0B2;
      border-radius: 10px;
      padding: 12px;
      transition: all 0.2s;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    
    .library-song-card:hover {
      border-color: #FF9800;
      box-shadow: 0 4px 12px rgba(255, 152, 0, 0.2);
      transform: translateY(-2px);
    }
    
    .library-song-card.added {
      border-color: #4CAF50;
      background: #f1f8f4;
    }
    
    .library-song-name {
      font-weight: 600;
      font-size: 14px;
      color: #333;
      line-height: 1.3;
    }
    
    .library-song-controls {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
    }
    
    .btn-small {
      padding: 6px 12px;
      font-size: 13px;
      border: none;
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.2s;
      font-weight: 600;
    }
    
    .btn-play {
      background: #2196F3;
      color: white;
      min-width: 110px;
      flex-shrink: 0;
    }
    
    .btn-play:hover {
      background: #0b7dda;
    }
    
    .btn-play.playing {
      background: #FF9800;
    }
    
    .btn-add-library {
      flex: 0 0 auto;
      min-width: 95px;
      padding: 8px 12px;
      background: #FF9800;
      color: white;
      border: none;
      border-radius: 6px;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      white-space: nowrap;
    }
    
    .btn-add-library:hover:not(:disabled) {
      background: #f57c00;
    }
    
    .btn-add-library:disabled {
      background: #ccc;
      cursor: not-allowed;
    }
    
    .btn-add-library.added {
      background: #4CAF50;
    }

    
    
    /* Song List */
    .song-list {
      margin-bottom: 20px;
    }
    
    .song-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 12px;
      background: white;
      border: 2px solid #e0e0e0;
      border-radius: 8px;
      margin-bottom: 10px;
      transition: all 0.2s;
    }
    
    .song-item:hover {
      border-color: #667eea;
      box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
    }
    
    .song-item.new-upload {
      border-color: #4CAF50;
      background: #f1f8f4;
    }
    
    .song-item.library-song {
      border-color: #FF9800;
      background: #fff9f0;
    }
    
    .song-info {
      display: flex;
      align-items: center;
      gap: 12px;
      flex: 1;
      min-width: 0;
    }
    
    .song-position {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      color: white;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      font-size: 16px;
      flex-shrink: 0;
    }
    
    .song-name {
      font-weight: 600;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    
    .song-badge {
      background: #4CAF50;
      color: white;
      padding: 2px 8px;
      border-radius: 4px;
      font-size: 11px;
      font-weight: 600;
    }
    
    .song-badge.library {
      background: #FF9800;
    }
    
    .song-controls {
      display: flex;
      gap: 6px;
      flex-shrink: 0;
    }
    
    .btn-move {
      background: #f5f5f5;
      color: #666;
      border: 1px solid #ddd;
    }
    
    .btn-move:hover {
      background: #e0e0e0;
    }
    
    .btn-move:disabled {
      opacity: 0.4;
      cursor: not-allowed;
    }
    
    .btn-danger {
      background: #f44336;
      color: white;
    }
    
    .btn-danger:hover {
      background: #d32f2f;
    }
    
    .upload-section {
      margin-top: 15px;
      padding: 15px;
      background: #f5f5f5;
      border-radius: 8px;
      border: 2px dashed #ccc;
    }
    
    .upload-section.max-reached {
      opacity: 0.6;
      pointer-events: none;
    }
    
    .upload-label {
      display: inline-block;
      padding: 10px 20px;
      background: #667eea;
      color: white;
      border-radius: 6px;
      cursor: pointer;
      font-weight: 600;
      font-size: 14px;
      transition: all 0.2s;
    }
    
    .upload-label:hover {
      background: #5568d3;
      transform: translateY(-1px);
    }
    
    .upload-label.disabled {
      background: #ccc;
      cursor: not-allowed;
    }
    
    /* Presentation Preview */
    .preview-section {
      margin-top: 15px;
      padding: 20px;
      background: #f0f7ff;
      border: 2px solid #2196F3;
      border-radius: 8px;
    }
    
    .preview-header {
      font-weight: 600;
      color: #1565c0;
      margin-bottom: 12px;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    
    .preview-iframe {
      width: 100%;
      height: 400px;
      border: 2px solid #90caf9;
      border-radius: 8px;
      background: white;
    }
    
    .preview-url {
      margin-top: 10px;
      padding: 10px;
      background: white;
      border-radius: 6px;
      font-size: 13px;
      color: #666;
      word-break: break-all;
    }
    
    /* Submit Button */
    .submit-section {
      margin-top: 40px;
      padding-top: 30px;
      border-top: 3px solid #e0e0e0;
      text-align: center;
    }
    
    .btn-submit {
      background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
      color: white;
      padding: 20px 50px;
      font-size: 20px;
      font-weight: 700;
      border: none;
      border-radius: 12px;
      cursor: pointer;
      transition: all 0.3s;
      box-shadow: 0 6px 20px rgba(30, 60, 114, 0.4);
    }
    
    .btn-submit:hover:not(:disabled) {
      transform: translateY(-3px);
      box-shadow: 0 8px 25px rgba(30, 60, 114, 0.5);
    }
    
    .btn-submit:disabled {
      background: #ccc;
      cursor: not-allowed;
      transform: none;
      box-shadow: none;
    }
    
    .submit-note {
      margin-top: 15px;
      color: white;
      font-size: 14px;
      line-height: 1.5;
    }
    
    /* Toast */
    .toast {
      position: fixed;
      bottom: 30px;
      right: 30px;
      padding: 16px 24px;
      background: #333;
      color: white;
      border-radius: 8px;
      box-shadow: 0 6px 20px rgba(0,0,0,0.3);
      opacity: 0;
      transform: translateY(20px);
      transition: all 0.3s;
      z-index: 1000;
      max-width: 400px;
    }
    
    .toast.show {
      opacity: 1;
      transform: translateY(0);
    }
    
    .toast.success {
      background: #4CAF50;
    }
    
    .toast.error {
      background: #f44336;
    }

    /* Calculation Modal */
    .modal-overlay {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.7);
      z-index: 10000;
      justify-content: center;
      align-items: center;
    }
    
    .modal-overlay.show {
      display: flex;
    }
    
    .modal-content {
      background: white;
      border-radius: 16px;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
      max-width: 600px;
      width: 90%;
      max-height: 90vh;
      overflow-y: auto;
      animation: modalSlideIn 0.3s ease-out;
    }
    
    @keyframes modalSlideIn {
      from {
        transform: translateY(-50px);
        opacity: 0;
      }
      to {
        transform: translateY(0);
        opacity: 1;
      }
    }
    
    .modal-header {
      background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
      color: white;
      padding: 24px 30px;
      border-radius: 16px 16px 0 0;
    }
    
    .modal-header h2 {
      margin: 0;
      font-size: 24px;
      font-weight: 700;
    }
    
    .modal-body {
      padding: 30px;
    }
    
    .calc-result-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 16px;
      background: #f8f9ff;
      border-radius: 8px;
      margin-bottom: 16px;
      border: 2px solid #e0e0e0;
    }
    
    .calc-label {
      font-weight: 600;
      color: #555;
      font-size: 16px;
    }
    
    .calc-value {
      font-weight: 700;
      color: #2a5298;
      font-size: 20px;
    }
    
    .calc-summary {
      background: #f0f7ff;
      border-left: 4px solid #667eea;
      border-radius: 8px;
      padding: 20px;
      margin-top: 20px;
      font-size: 15px;
      line-height: 1.6;
      color: #333;
    }
    
    .modal-footer {
      padding: 20px 30px 30px 30px;
      display: flex;
      gap: 12px;
      justify-content: space-between;
    }
    
    .modal-btn {
      flex: 1;
      padding: 14px 24px;
      border: none;
      border-radius: 8px;
      font-size: 16px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      font-family: inherit;
    }
    
    .modal-btn-secondary {
      background: #e0e0e0;
      color: #555;
    }
    
    .modal-btn-secondary:hover {
      background: #d0d0d0;
      transform: translateY(-2px);
    }
    
    .modal-btn-primary {
      background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
      color: white;
    }
    
    .modal-btn-primary:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    }

    /* Music Upload Terms Modal */
    .terms-modal-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0,0,0,0.85);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 3000;
    }

    .terms-modal-overlay.show {
      display: flex;
    }

    .terms-modal-content {
      background: white;
      border-radius: 16px;
      max-width: 600px;
      width: 90%;
      max-height: 80vh;
      overflow-y: auto;
      box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    }

    .terms-modal-header {
      background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
      color: white;
      padding: 24px;
      border-radius: 16px 16px 0 0;
      text-align: center;
    }

    .terms-modal-header h2 {
      font-size: 24px;
      margin: 0;
    }

    .terms-modal-body {
      padding: 30px;
      line-height: 1.8;
      color: #333;
      font-size: 15px;
    }

    .terms-modal-footer {
      padding: 20px 30px;
      display: flex;
      gap: 12px;
      border-top: 2px solid #f0f0f0;
    }

    .terms-btn {
      flex: 1;
      padding: 14px 24px;
      border: none;
      border-radius: 8px;
      font-size: 16px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      font-family: inherit;
    }

   .terms-btn-cancel {
     background: #f44336;
     color: white;
   }

   .terms-btn-cancel:hover {
     background: #d32f2f;
   }

   .terms-btn-accept {
     background: #4CAF50;
     color: white;
   }

   .terms-btn-accept:hover {
     background: #45a049;
   }
    
    /* Loading Overlay */
    .loading-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0,0,0,0.8);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 2000;
    }
    
    .loading-overlay.show {
      display: flex;
    }
    
    .loading-content {
      background: white;
      padding: 40px;
      border-radius: 16px;
      text-align: center;
      max-width: 400px;
    }
    
    .spinner {
      border: 4px solid #f3f3f3;
      border-top: 4px solid #667eea;
      border-radius: 50%;
      width: 50px;
      height: 50px;
      animation: spin 1s linear infinite;
      margin: 0 auto 20px;
    }
    
    @keyframes spin {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }
    
    .loading-text {
      font-size: 18px;
      font-weight: 600;
      color: #333;
      margin-bottom: 10px;
    }
    
    .loading-subtext {
      font-size: 14px;
      color: #666;
    }
    
    /* Song Range Sliders */
    .song-ranges-container {
      margin-top: 15px;
    }

    .song-range-item {
      background: white;
      border: 2px solid #e0e0e0;
      border-radius: 8px;
      padding: 15px;
      margin-bottom: 12px;
    }

    .song-range-header {
      font-weight: 600;
      color: #667eea;
      margin-bottom: 10px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .slide-inputs {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
    }

    .slide-input-group {
      display: flex;
      flex-direction: column;
    }

    .slide-input-group label {
      font-size: 13px;
      font-weight: 600;
      color: #555;
      margin-bottom: 6px;
    }

    .slide-input-group input {
      padding: 10px;
      border: 2px solid #e0e0e0;
      border-radius: 6px;
      font-size: 14px;
    }

    .slide-input-group input:focus {
      outline: none;
      border-color: #667eea;
    }
    
    @media (max-width: 768px) {
      body { padding: 0; }
      .container { border-width: 10px; }
      select {
        width: 100%;
        box-sizing: border-box;
      }
      .section { max-width: 100%; }
      .form-group { max-width: 100%; }
      .header h1 { font-size: 26px; }
      .section { padding: 20px; }
      .content { padding: 20px 15px; }
      .radio-option {
        flex-direction: column;
        align-items: stretch;
      }
      .radio-option-content {
        width: 100%;
      }
      .radio-option-label,
      .radio-option-desc {
        white-space: normal;
        word-break: break-word;
      }
      .conditional-input {
        width: 100%;
        box-sizing: border-box;
      }
      .runtime-row {
        flex-direction: column;
        align-items: flex-start;
      }
      #fixedRuntimeMinutes,
      #fixedRuntimeSeconds {
        width: 100%;
      }
      .header-logo {
        width: 100%;
        max-width: 100%;
        height: auto;
      }
      
      /* Force song library to single column */
      .library-grid { 
        grid-template-columns: 1fr !important; 
      }
      
      /* Stack slide inputs vertically */
      .slide-inputs { 
        grid-template-columns: 1fr !important; 
      }
      .slide-inputs,
      .total-runtime-inputs {
        display: flex;
        flex-direction: column;
        gap: 8px;
      }
      .total-runtime-inputs input,
      .slide-input-group input,
      .conditional-input input[type="number"] {
        width: 100%;
        box-sizing: border-box;
        min-width: 0;
      }
      
      /* Wrap song controls */
      .song-item {
        flex-direction: column;
        align-items: stretch;
      }
      .song-controls { 
        flex-wrap: wrap;
        gap: 8px;
      }
      
      /* Smaller buttons on mobile */
      .btn-small {
        min-width: 70px;
        padding: 6px 8px;
        font-size: 12px;
      }
      
      .btn-play {
        min-width: 90px !important;
      }
      
      .btn-add-library {
        min-width: 75px !important;
      }
      
      .song-controls .btn-small,
      .song-controls .btn-play,
      .song-controls .btn-add-library {
        min-width: unset !important;
      }

      /* Make library card controls stack */
      .library-song-card {
        padding: 12px 8px;
      }
      
      .library-song-controls {
        flex-direction: column;
        gap: 6px;
      }
      
      .library-song-controls .btn-small,
      .library-song-controls .btn-add-library {
        width: 100%;
        min-width: unset;
      }
      
      /* Stack transition section vertically */
      .transition-container {
        flex-direction: column !important;
      }
      
      .transition-dropdown,
      .transition-preview {
        flex: 1 1 100% !important;
        max-width: 100% !important;
      }
      
      /* Toast notifications */
      .toast { 
        right: 10px; 
        left: 10px; 
        max-width: none; 
      }
      
      /* Modal improvements */
      .modal-content {
        width: 95%;
        margin: 10px;
      }
      
      .modal-footer {
        flex-direction: column;
      }
      
      .modal-btn {
        width: 100%;
      }
    }
    /* Refresh Preview Button */
    .refresh-preview-btn {
      display: inline-block;
      padding: 14px 28px;
      background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
      color: white;
      text-decoration: none;
      border-radius: 8px;
      font-weight: 600;
      font-size: 16px;
      border: none;
      cursor: pointer;
      transition: all 0.3s;
      box-shadow: 0 4px 12px rgba(30, 60, 114, 0.3);
      margin-left: 12px;
    }

    .refresh-preview-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    }
    
    .validation-message {
      margin-top: 15px;
      padding: 12px 20px;
      background: #fff3cd;
      border: 2px solid #ffc107;
      border-radius: 8px;
      color: #856404;
      font-size: 15px;
      font-weight: 500;
      text-align: center;
    }
