 
    /* ----------------------------------------------------
       RESET & BASE DESIGN SYSTEM (Neon Retro Dark Mode)
       ---------------------------------------------------- */
    :root {
      --bg-gradient: radial-gradient(circle at center, #161224 0%, #090710 100%);
      --bg-card: rgba(22, 16, 36, 0.65);
      --border-neon: rgba(255, 46, 147, 0.25);
      --border-neon-hover: rgba(255, 46, 147, 0.5);
      --neon-pink: #ff2e93;
      --neon-purple: #9d4edd;
      --neon-cyan: #00f0ff;
      --text-main: #f3f0f7;
      --text-muted: #a59fb1;
      --glass-blur: blur(14px);
      --shadow-neon: 0 0 15px rgba(255, 46, 147, 0.2), 0 0 30px rgba(157, 78, 221, 0.1);
      --font-ui: 'Plus Jakarta Sans', sans-serif;
      --font-novel: 'Playfair Display', serif;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      scrollbar-width: thin;
      scrollbar-color: var(--neon-pink) rgba(25, 18, 41, 0.5);
    }

    /* Scrollbar styling */
    ::-webkit-scrollbar {
      width: 6px;
    }
    ::-webkit-scrollbar-track {
      background: rgba(25, 18, 41, 0.5);
    }
    ::-webkit-scrollbar-thumb {
      background-color: var(--neon-pink);
      border-radius: 10px;
    }

    body {
      background: var(--bg-gradient);
      color: var(--text-main);
      font-family: var(--font-ui);
      min-height: 100vh;
      overflow-x: hidden;
      display: flex;
      flex-direction: column;
      position: relative;
    }

    /* Ambient Background Glows */
    body::before, body::after {
      content: '';
      position: absolute;
      width: 400px;
      height: 400px;
      border-radius: 50%;
      z-index: -1;
      filter: blur(150px);
      pointer-events: none;
      opacity: 0.25;
    }
    body::before {
      background: var(--neon-pink);
      top: 10%;
      left: 10%;
    }
    body::after {
      background: var(--neon-purple);
      bottom: 15%;
      right: 10%;
    }

    /* ----------------------------------------------------
       LAYOUT CONTAINER & GLASS CARDS
       ---------------------------------------------------- */
    .app-container {
      max-width: 1100px;
      width: 100%;
      margin: 0 auto;
      padding: 2rem 1rem 14rem 1rem; /* dari 8rem menjadi 14rem */
      display: flex;
      flex-direction: column;
      gap: 2rem;
      flex: 1;
    }

    header {
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      margin-bottom: 1rem;
      position: relative;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      margin-bottom: 0.5rem;
    }

    .brand svg {
      width: 40px;
      height: 40px;
      fill: var(--neon-pink);
      filter: drop-shadow(0 0 8px var(--neon-pink));
    }

    .logo-text {
      font-family: var(--font-novel);
      font-size: 2.25rem;
      font-weight: 900;
      letter-spacing: 2px;
      background: linear-gradient(135deg, var(--neon-pink) 0%, var(--neon-cyan) 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      filter: drop-shadow(0 2px 10px rgba(255, 46, 147, 0.4));
      text-transform: uppercase;
    }

    .tagline {
      color: var(--text-muted);
      font-size: 0.9rem;
      letter-spacing: 3px;
      text-transform: uppercase;
      font-weight: 600;
    }

    .glass-card {
      background: var(--bg-card);
      backdrop-filter: var(--glass-blur);
      -webkit-backdrop-filter: var(--glass-blur);
      border: 1px solid var(--border-neon);
      border-radius: 20px;
      padding: 2rem;
      box-shadow: var(--shadow-neon);
      transition: border-color 0.4s ease, box-shadow 0.4s ease;
    }

    .glass-card:hover {
      border-color: var(--border-neon-hover);
      box-shadow: 0 0 25px rgba(255, 46, 147, 0.35), 0 0 45px rgba(157, 78, 221, 0.15);
    }

    /* ----------------------------------------------------
       INPUT SECTION & PRESETS
       ---------------------------------------------------- */
    .input-section {
      display: flex;
      flex-direction: column;
      gap: 1.25rem;
    }

    .section-title {
      font-family: var(--font-novel);
      font-size: 1.6rem;
      font-weight: 700;
      color: var(--text-main);
      border-left: 4px solid var(--neon-pink);
      padding-left: 0.75rem;
      line-height: 1.2;
    }

    .input-wrapper {
      position: relative;
      display: flex;
      gap: 0.75rem;
      width: 100%;
    }

    .story-input {
      flex: 1;
      background: rgba(10, 8, 18, 0.6);
      border: 1.5px solid var(--border-neon);
      border-radius: 12px;
      padding: 1rem 1.25rem;
      color: var(--text-main);
      font-family: var(--font-ui);
      font-size: 1.05rem;
      outline: none;
      transition: all 0.3s ease;
    }

    .story-input:focus {
      border-color: var(--neon-cyan);
      box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
    }

    .story-input::placeholder {
      color: rgba(243, 240, 257, 0.4);
    }

    /* Library Judul */
    .library-wrapper {
      background: rgba(0,0,0,0.2);
      border: 1px solid rgba(255,255,255,0.05);
      border-radius: 12px;
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }
    .library-header {
      width: 100%;
      padding: 0.75rem 1rem;
      background: rgba(255,255,255,0.05);
      font-weight: 700;
      color: var(--neon-cyan);
      display: flex;
      align-items: center;
      justify-content: space-between;
      border: none;
      border-bottom: 1px solid rgba(255,255,255,0.05);
      font-size: 0.95rem;
      cursor: pointer;
      font-family: var(--font-ui);
      transition: background 0.2s;
    }
    .library-header:hover {
      background: rgba(255,255,255,0.08);
    }
    
    .library-search-wrapper {
      padding: 0.75rem 1rem;
      border-bottom: 1px solid rgba(255,255,255,0.05);
      position: relative;
    }
    .library-search {
      width: 100%;
      background: rgba(10, 8, 18, 0.6);
      border: 1px solid var(--border-neon);
      border-radius: 8px;
      padding: 0.6rem 1rem 0.6rem 2.2rem;
      color: var(--text-main);
      font-family: var(--font-ui);
      font-size: 0.9rem;
      outline: none;
      transition: all 0.3s ease;
    }
    .library-search:focus {
      border-color: var(--neon-pink);
      box-shadow: 0 0 8px rgba(255, 46, 147, 0.3);
    }
    .search-icon-lib {
      position: absolute;
      left: 1.6rem;
      top: 50%;
      transform: translateY(-50%);
      color: var(--text-muted);
      font-size: 0.85rem;
    }
    .accordion-btn {
      width: 100%;
      text-align: left;
      background: transparent;
      border: none;
      padding: 0.75rem 1rem;
      color: var(--text-main);
      font-family: var(--font-ui);
      font-size: 0.9rem;
      font-weight: 600;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      border-bottom: 1px solid rgba(255,255,255,0.02);
      transition: background 0.2s;
    }
    .accordion-btn:hover {
      background: rgba(255,255,255,0.03);
    }
    .accordion-content {
      display: none;
      background: rgba(0,0,0,0.1);
    }
    .accordion-content.active {
      display: block;
    }
    .library-list {
      list-style: none;
      padding: 0;
      margin: 0;
    }
    .library-item {
      padding: 0.6rem 1rem 0.6rem 2.2rem;
      cursor: pointer;
      font-family: var(--font-ui);
      font-size: 0.85rem;
      color: var(--text-muted);
      border-bottom: 1px dashed rgba(255,255,255,0.02);
      transition: all 0.2s;
      position: relative;
    }
    .library-item:hover {
      color: var(--neon-pink);
      background: rgba(255, 46, 147, 0.05);
      padding-left: 2.5rem;
    }
    .library-item::before {
      content: '•';
      position: absolute;
      left: 1rem;
      color: var(--neon-purple);
      transition: left 0.2s;
    }
    .library-item:hover::before {
      left: 1.3rem;
    }

    .char-name-input {
      background: rgba(10, 8, 18, 0.6);
      border: 1px solid var(--border-neon);
      border-radius: 6px;
      padding: 0.4rem 0.6rem;
      color: var(--text-main);
      font-family: var(--font-ui);
      font-size: 0.95rem;
      width: 100%;
      outline: none;
      transition: all 0.3s ease;
    }

    .char-name-input:focus {
      border-color: var(--neon-cyan);
      box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
    }

    /* Buttons Style */
    .btn-neon {
      background: linear-gradient(135deg, var(--neon-pink) 0%, var(--neon-purple) 100%);
      color: #fff;
      font-family: var(--font-ui);
      font-weight: 700;
      font-size: 1rem;
      letter-spacing: 1px;
      border: none;
      border-radius: 12px;
      padding: 1rem 2rem;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.75rem;
      box-shadow: 0 4px 15px rgba(255, 46, 147, 0.4);
      transition: all 0.3s ease;
      position: relative;
      overflow: hidden;
      text-decoration: none;
    }

    .btn-neon::after {
      content: '';
      position: absolute;
      top: 0; left: -100%; width: 100%; height: 100%;
      background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
      transition: all 0.6s ease;
    }

    .btn-neon:hover::after {
      left: 100%;
    }

    .btn-neon:hover {
      transform: translateY(-3px);
      box-shadow: 0 6px 20px rgba(255, 46, 147, 0.6), 0 0 10px rgba(157, 78, 221, 0.4);
    }

    .btn-neon:disabled {
      background: rgba(50, 40, 70, 0.6);
      box-shadow: none;
      color: rgba(255,255,255,0.3);
      cursor: not-allowed;
      transform: none;
    }

    /* ----------------------------------------------------
       PROGRESS & SYSTEM STATUS
       ---------------------------------------------------- */
    .status-panel {
      display: none; 
      background: rgba(10, 8, 18, 0.8);
      border: 1px solid var(--border-neon);
      border-radius: 16px;
      padding: 1.5rem;
      flex-direction: column;
      gap: 1rem;
      position: relative;
    }

    .status-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .status-label {
      font-size: 0.95rem;
      font-weight: 600;
      color: var(--neon-cyan);
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .status-percentage {
      font-family: var(--font-novel);
      font-size: 1.4rem;
      font-weight: 800;
      color: var(--neon-pink);
    }

    .progress-track {
      width: 100%;
      height: 8px;
      background: rgba(255, 255, 255, 0.05);
      border-radius: 10px;
      overflow: hidden;
      position: relative;
    }

    .progress-bar-fill {
      width: 0%;
      height: 100%;
      background: linear-gradient(90deg, var(--neon-pink), var(--neon-cyan));
      border-radius: 10px;
      transition: width 0.4s cubic-bezier(0.1, 0.8, 0.3, 1);
      box-shadow: 0 0 8px var(--neon-pink);
    }

    /* Spinner */
    .loader-pulse {
      width: 18px;
      height: 18px;
      border: 2px solid var(--neon-pink);
      border-top-color: transparent;
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
      display: inline-block;
    }

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

    /* ----------------------------------------------------
       STORY DISPLAY (Classic Novel Reading Style)
       ---------------------------------------------------- */
    .story-card {
      display: none;
      flex-direction: column;
      gap: 1.5rem;
    }

    .story-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: 1px solid rgba(255,255,255,0.1);
      padding-bottom: 1rem;
    }

    .story-tools {
      display: flex;
      gap: 0.5rem;
    }

    .tool-btn {
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid rgba(255, 255, 255, 0.1);
      color: var(--text-main);
      padding: 0.4rem 0.8rem;
      border-radius: 6px;
      font-size: 0.8rem;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 0.4rem;
      transition: all 0.2s ease;
    }
    #masterActionButton{
    width:100%;
    max-width:700px;
    font-size:1.15rem;
    padding:1.2rem;
}
@media (max-width:768px){

    #masterActionButton{
        width:100%;
        font-size:0.9rem;
        padding:14px 18px;
        min-height:52px;
        border-radius:12px;
        font-weight:600;
    }

    #masterActionButton svg{
        width:18px;
        height:18px;
        margin-right:6px;
    }

    #masterActionButton span{
        line-height:1.25;
    }

}
    .tool-btn:hover {
      background: rgba(255, 46, 147, 0.15);
      border-color: var(--neon-pink);
    }

    .novel-body {
      background: rgba(14, 10, 24, 0.5);
      border-radius: 14px;
      padding: 2.5rem 2rem;
      border: 1px solid rgba(255, 255, 255, 0.04);
      max-height: 600px;
      overflow-y: auto;
      line-height: 1.8;
      font-size: 1.15rem;
      color: #e5e0ee;
      font-family: var(--font-novel);
      letter-spacing: 0.3px;
      box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
    }

    .novel-body p {
      margin-bottom: 1.5rem;
      text-indent: 2rem;
    }

    .novel-body h3 {
      font-family: var(--font-novel);
      color: var(--neon-pink);
      text-align: center;
      margin: 2rem 0 1rem 0;
      font-size: 1.5rem;
      font-weight: 700;
      letter-spacing: 1px;
      text-indent: 0;
    }

    .novel-body h3:first-child {
      margin-top: 0;
    }

    .novel-dialogue {
      color: var(--neon-cyan);
      font-style: italic;
    }

    /* ----------------------------------------------------
       CHARACTER VOICE CONFIGURATION
       ---------------------------------------------------- */
    .characters-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
      gap: 1.25rem;
      margin-top: 0.5rem;
    }

    .character-voice-row {
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid rgba(255, 255, 255, 0.06);
      border-radius: 12px;
      padding: 1.25rem;
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
      transition: all 0.3s ease;
    }

    .character-voice-row:hover {
      background: rgba(157, 78, 221, 0.08);
      border-color: rgba(157, 78, 221, 0.3);
    }

    .char-info {
      display: flex;
      align-items: center;
      gap: 0.75rem;
    }

    .char-avatar {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      color: #fff;
      font-size: 1rem;
      text-transform: uppercase;
      box-shadow: 0 0 10px rgba(157, 78, 221, 0.4);
    }

    .char-details {
      display: flex;
      flex-direction: column;
    }

    .char-name {
      font-weight: 600;
      font-size: 1rem;
      color: var(--text-main);
    }

    .char-role {
      font-size: 0.75rem;
      color: var(--text-muted);
      text-transform: uppercase;
    }

    .voice-select-wrapper {
      position: relative;
      display: flex;
      align-items: center;
    }

    .voice-select {
      width: 100%;
      background: rgba(10, 8, 18, 0.8);
      border: 1px solid var(--border-neon);
      border-radius: 8px;
      padding: 0.6rem 2.5rem 0.6rem 1rem;
      color: var(--text-main);
      font-family: var(--font-ui);
      font-size: 0.9rem;
      outline: none;
      cursor: pointer;
      appearance: none;
      -webkit-appearance: none;
      transition: all 0.2s ease;
    }

    .voice-select:focus {
      border-color: var(--neon-cyan);
    }

    .select-arrow {
      position: absolute;
      right: 12px;
      pointer-events: none;
      fill: var(--text-muted);
      width: 12px;
      height: 12px;
    }

    /* ----------------------------------------------------
       AUDIO PLAYER SUITE (Retro Synthwave Style)
       ---------------------------------------------------- */
    .audio-suite-card {
      display: none;
      flex-direction: column;
      gap: 1.5rem;
      background: linear-gradient(145deg, rgba(30, 15, 50, 0.8) 0%, rgba(15, 10, 25, 0.9) 100%);
      border: 1.5px solid var(--neon-pink);
    }

    .player-visual-track {
      background: rgba(10, 5, 20, 0.7);
      border-radius: 12px;
      padding: 1.5rem;
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
      border: 1px solid rgba(255,255,255,0.05);
    }

    .now-playing-title {
      font-family: var(--font-novel);
      font-size: 1.25rem;
      color: var(--neon-pink);
      text-shadow: 0 0 10px rgba(255, 46, 147, 0.3);
      text-align: center;
    }

    .now-playing-desc {
      font-size: 0.8rem;
      color: var(--text-muted);
      text-align: center;
      text-transform: uppercase;
      letter-spacing: 1px;
    }

    /* Wave visualizer simulator */
    .wave-container {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 4px;
      height: 40px;
      margin: 1rem 0;
    }

    .wave-bar {
      width: 3px;
      height: 5px;
      background: linear-gradient(to top, var(--neon-purple), var(--neon-pink));
      border-radius: 3px;
      transition: height 0.15s ease;
    }

    /* Video Preview Container inside Studio */
    .video-preview-wrapper {
      width: 100%;
      max-width: 240px;
      aspect-ratio: 9/16;
      margin: 1rem auto;
      border: 2px solid var(--neon-pink);
      border-radius: 12px;
      overflow: hidden;
      position: relative;
      background: #000;
      box-shadow: 0 0 15px rgba(255, 46, 147, 0.3);
    }

    #previewCanvas {
      width: 100%;
      height: 100%;
      display: block;
    }

    /* Audio Progress Bar */
    .audio-progress-container {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
    }

    .audio-time-row {
      display: flex;
      justify-content: space-between;
      font-size: 0.8rem;
      font-family: monospace;
      color: var(--text-muted);
    }

    .audio-scrubber-track {
      width: 100%;
      height: 6px;
      background: rgba(255,255,255,0.08);
      border-radius: 10px;
      cursor: pointer;
      position: relative;
    }

    .audio-scrubber-fill {
      width: 0%;
      height: 100%;
      background: var(--neon-cyan);
      box-shadow: 0 0 6px var(--neon-cyan);
      border-radius: 10px;
      position: relative;
    }

    .audio-scrubber-handle {
      position: absolute;
      right: -6px;
      top: -4px;
      width: 14px;
      height: 14px;
      border-radius: 50%;
      background: #fff;
      box-shadow: 0 0 8px var(--neon-cyan);
      transition: transform 0.1s ease;
    }

    .audio-scrubber-track:hover .audio-scrubber-handle {
      transform: scale(1.2);
    }

    /* Player Controls */
    .player-controls-row {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 1.5rem;
      margin-top: 0.5rem;
    }

    .btn-circle {
      width: 50px;
      height: 50px;
      border-radius: 50%;
      border: 1px solid rgba(255, 255, 255, 0.1);
      background: rgba(255, 255, 255, 0.04);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .btn-circle svg {
      width: 22px;
      height: 22px;
      fill: var(--text-main);
      transition: fill 0.2s ease;
    }

    .btn-circle:hover {
      background: rgba(255, 46, 147, 0.15);
      border-color: var(--neon-pink);
      transform: scale(1.08);
    }

    .btn-circle:hover svg {
      fill: var(--neon-pink);
    }

    .btn-circle.active-play {
      background: var(--neon-pink);
      box-shadow: 0 0 15px var(--neon-pink);
      border: none;
    }

    .btn-circle.active-play svg {
      fill: #fff;
    }

    .audio-meta-info {
      display: flex;
      justify-content: space-around;
      border-top: 1px solid rgba(255,255,255,0.06);
      padding-top: 1rem;
      margin-top: 0.5rem;
    }

    .meta-box {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.25rem;
    }

    .meta-label {
      font-size: 0.7rem;
      color: var(--text-muted);
      text-transform: uppercase;
    }

    .meta-value {
      font-size: 0.95rem;
      font-weight: 700;
      color: var(--neon-cyan);
    }

    .action-row {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 1rem;
      margin-top: 0.5rem;
    }

    /* ----------------------------------------------------
       RESPONSIVE & MOBILE DESIGN STYLING
       ---------------------------------------------------- */
    @media (max-width: 768px) {
      .app-container {
        padding: 1rem 1rem 10rem 1rem;
        gap: 1.5rem;
      }
      .logo-text {
        font-size: 1.75rem;
      }
      .tagline {
        font-size: 0.75rem;
      }
      .glass-card {
        padding: 1.25rem;
      }
      .input-wrapper {
        flex-direction: column;
      }
      .novel-body {
        padding: 1.5rem 1rem;
        font-size: 1.05rem;
      }
      .player-controls-row {
        gap: 1rem;
      }
      .btn-circle {
        width: 44px;
        height: 44px;
      }
    }

    /* Status Notifications Inline Error Panel */
    .error-inline {
      background: rgba(220, 53, 69, 0.15);
      border: 1px solid #dc3545;
      color: #ff6b6b;
      padding: 1rem;
      border-radius: 12px;
      font-size: 0.9rem;
      margin-top: 1rem;
      display: none;
      align-items: center;
      gap: 0.75rem;
      transition: all 0.3s ease;
    }

    /* ----------------------------------------------------
       TAILWIND UTILITY CLASSES UNTUK BACKSOUND UI
       ---------------------------------------------------- */
    .flex { display: flex; }
    .items-center { align-items: center; }
    .justify-between { justify-content: space-between; }
    .p-2 { padding: 0.5rem; }
    .rounded { border-radius: 0.25rem; }
    .border { border-width: 1px; border-style: solid; }
    .border-emerald-500 { border-color: #10b981; }
    .bg-emerald-900\/20 { background-color: rgba(6, 78, 59, 0.2); }
    .border-slate-800 { border-color: #1e293b; }
    .bg-black\/40 { background-color: rgba(0, 0, 0, 0.4); }
    .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .text-xs { font-size: 0.75rem; }
    .text-slate-200 { color: #e2e8f0; }
    .mr-2 { margin-right: 0.5rem; }
    .gap-2 { gap: 0.5rem; }
    .shrink-0 { flex-shrink: 0; }
    .gap-1 { gap: 0.25rem; }
    .w-6 { width: 1.5rem; }
    .h-6 { height: 1.5rem; }
    .bg-yellow-500\/20 { background-color: rgba(234, 179, 8, 0.2); }
    .text-yellow-400 { color: #facc15; }
    .border-yellow-500\/30 { border-color: rgba(234, 179, 8, 0.3); }
    .bg-blue-500\/20 { background-color: rgba(59, 130, 246, 0.2); }
    .text-blue-400 { color: #60a5fa; }
    .border-blue-500\/30 { border-color: rgba(59, 130, 246, 0.3); }
    .bg-rose-500\/20 { background-color: rgba(244, 63, 94, 0.2); }
    .text-rose-400 { color: #fb7185; }
    .border-rose-500\/30 { border-color: rgba(244, 63, 94, 0.3); }
    .px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
    .py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
    .bg-emerald-500 { background-color: #10b981; }
    .text-black { color: #000; }
    .font-bold { font-weight: 700; }
    .bg-slate-800 { background-color: #1e293b; }
    .text-slate-300 { color: #cbd5e1; }
    .hidden { display: none !important; }
    .text-amber-400 { color: #fbbf24; }
    .font-medium { font-weight: 500; }
    .uppercase { text-transform: uppercase; }
    .text-emerald-400 { color: #34d399; }
    .text-sm { font-size: 0.875rem; }
    .text-white { color: #ffffff; }
    .flex-1 { flex: 1 1 0%; }
    .mt-2 { margin-top: 0.5rem; }
    .hover\:bg-rose-500:hover { background-color: #f43f5e; }
    .hover\:text-white:hover { color: #ffffff; }
    .transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
    .cursor-pointer { cursor: pointer; }

    /* --- ADDED FOR TONE CONTROL --- */
    .eq-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.4rem; }
    .eq-label { width: 55px; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; font-weight:600;}
    .eq-slider { flex: 1; accent-color: var(--neon-pink); height: 4px; }
    .eq-val { width: 35px; font-size: 0.75rem; color: var(--neon-cyan); text-align: right; font-family: monospace; }
    .eq-box { background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.05); padding: 1rem; border-radius: 8px; }
    .eq-title { font-size: 0.9rem; font-weight: 700; color: var(--text-main); margin-bottom: 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 0.25rem;}

    /* --- STICKY FOOTER & PROGRESS BAR --- */
    .sticky-footer {
      position: fixed;
      bottom: 0;
      left: 0;
      width: 100%;
      background: rgba(10, 8, 18, 0.95);
      backdrop-filter: blur(14px);
      border-top: 1px solid var(--border-neon);
      z-index: 1000;
      padding: 1.5rem 1rem;
      display: flex;
      justify-content: center;
      align-items: center;
      box-shadow: 0 -10px 30px rgba(0,0,0,0.6);
      transition: all 0.3s ease;
    }
    .progress-container-sticky {
      position: absolute;
      top: -6px;
      left: 0;
      width: 100%;
      height: 6px;
      background: rgba(255, 255, 255, 0.05);
      display: none;
    }
    .progress-bar-sticky {
      width: 0%;
      height: 100%;
      background: linear-gradient(90deg, var(--neon-pink), var(--neon-cyan));
      transition: width 0.4s cubic-bezier(0.1, 0.8, 0.3, 1);
      box-shadow: 0 0 10px var(--neon-pink);
    }
    .progress-text-sticky {
      position: absolute;
      top: -30px;
      right: 15px;
      font-family: var(--font-novel);
      font-size: 1.15rem;
      font-weight: 800;
      color: var(--neon-cyan);
      text-shadow: 0 0 5px rgba(0,0,0,1);
    }
  
    /* --- KARAKTER MODAL GRID STYLES --- */
    .karakter-card {
      background: rgba(0,0,0,0.4);
      border: 1px solid rgba(255,255,255,0.08);
      border-radius: 14px;
      overflow: hidden;
      cursor: pointer;
      display: flex;
      flex-direction: column;
      transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
    .karakter-card:hover {
      border-color: rgba(255, 46, 147, 0.5);
      transform: translateY(-4px);
      box-shadow: 0 8px 25px rgba(255, 46, 147, 0.15);
    }
    .karakter-card-selected {
      border-color: var(--neon-pink) !important;
      box-shadow: 0 0 20px rgba(255, 46, 147, 0.3), 0 0 40px rgba(157, 78, 221, 0.1) !important;
      transform: translateY(-4px) !important;
    }
    .karakter-img-wrap {
      position: relative;
      width: 100%;
      aspect-ratio: 3/4;
      background: #0d0a15;
      overflow: hidden;
    }
    .karakter-img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      transition: transform 0.4s ease;
    }
    .karakter-card:hover .karakter-img {
      transform: scale(1.08);
    }
    .karakter-label {
      padding: 0.6rem 0.5rem;
      text-align: center;
      background: rgba(0,0,0,0.3);
      font-size: 0.75rem;
      font-weight: 600;
      color: var(--text-main);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .karakter-card-selected .karakter-label {
      color: var(--neon-pink);
    }
    @media (max-width: 640px) {
      #karakter-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 0.625rem !important; }
    }
    @media (max-width: 400px) {
      #karakter-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 0.5rem !important; }
    }
    
    /* ============================================
   KARAKTER AVATAR MODAL - CSS
   ============================================ */

/* ---- Modal Overlay ---- */
#karakter-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#karakter-modal:not(.hidden) {
  display: flex;
}

/* ---- Modal Container ---- */
.karakter-modal__container {
  background: rgba(22, 16, 36, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 46, 147, 0.3);
  border-radius: 24px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(255, 46, 147, 0.15),
              0 0 80px rgba(157, 78, 221, 0.08);
}

/* ---- Modal Header ---- */
.karakter-modal__header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.karakter-modal__title {
  font-family: var(--font-novel);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--neon-pink);
  margin: 0;
  letter-spacing: 1px;
}

.karakter-modal__close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
}

.karakter-modal__close:hover {
  background: rgba(255, 46, 147, 0.15);
  border-color: rgba(255, 46, 147, 0.4);
  color: var(--neon-pink);
}

/* ---- Tab Navigation ---- */
.karakter-modal__tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  padding: 0 1.5rem;
}

.karakter-modal__tab {
  flex: 1;
  padding: 0.9rem 0.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.karakter-modal__tab--active {
  color: var(--neon-pink);
  border-bottom-color: var(--neon-pink);
}

.karakter-modal__tab-icon {
  font-size: 0.8rem;
}

/* ---- Modal Body ---- */
.karakter-modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  min-height: 0;
}

/* ---- Upload Section ---- */
.karakter-upload {
  display: none;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
}

.karakter-upload--visible {
  display: flex;
}

.karakter-upload__dropzone {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1;
  border: 2px dashed var(--border-neon);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.3s;
  background: rgba(10, 8, 18, 0.6);
}

.karakter-upload__dropzone:hover {
  border-color: var(--neon-pink);
  background: rgba(255, 46, 147, 0.06);
  transform: scale(1.02);
}

.karakter-upload__icon {
  font-size: 2.5rem;
  color: var(--neon-pink);
}

.karakter-upload__text {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

.karakter-upload__hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.5;
}

.karakter-upload__preview {
  display: none;
  max-width: 200px;
  max-height: 200px;
  border-radius: 12px;
  border: 2px solid var(--neon-pink);
  object-fit: cover;
}

.karakter-upload__preview--visible {
  display: block;
}

/* ---- Library Section ---- */
.karakter-library {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.karakter-library--visible {
  display: flex;
}

.karakter-library__loading {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 3rem 0;
}

.karakter-library__loading--visible {
  display: flex;
}

.karakter-library__spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--neon-pink);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.karakter-library__loading-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.karakter-library__error {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(220, 53, 69, 0.15);
  border-radius: 8px;
  color: #ff6b6b;
  font-size: 0.85rem;
}

.karakter-library__error--visible {
  display: flex;
}

.karakter-library__grid-container {
  display: none;
}

.karakter-library__grid-container--visible {
  display: block;
}

.karakter-library__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.875rem;
}

/* ---- Modal Footer ---- */
.karakter-modal__footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.2);
}

.karakter-modal__status {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---- Utility Classes ---- */
.hidden {
  display: none !important;
}


.sticky-footer {
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.sticky-footer.footer-visible {
  opacity: 1;
}


.sticky-footer {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem;
  background: rgba(10, 10, 20, 0.95);
  border-top: 1px solid rgba(138, 43, 226, 0.3);
  
  /* Center semua konten */
  display: none; /* default hidden */
  flex-direction: column;
  align-items: center;
}

/* Saat aktif, override display */
.sticky-footer.active {
  display: flex !important;
}

/* Progress container juga center */