:root {
    --void: #0a0a0a;
    --amber: #E4A64A;
    --amber-glow: rgba(228, 166, 74, 0.3);
    --rust: #c1502f;
    --text-light: #e0e0e0;
    --text-muted: #888;
}
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
body {
    background-color: var(--void);
    background-size: 0 0; 
    color: var(--text-light);
    padding: 20px;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background-image: inherit; 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 0.5s ease;
    pointer-events: none;
}

.dashboard {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
@media (min-width: 768px) {
    body {
        background-position: center;
    }
    .dashboard {
        max-width: 900px;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .header {
        width: 100%;
    }
}
.header {
    background: transparent;
    padding: 10px 0 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative; /* สำคัญมาก เพื่อเป็นจุดอ้างอิงพิกัด Dropdown */
}
.app-logo {
    width: 54px;
    height: 54px;
    flex-shrink: 0;
}
.custom-dropdown {
    flex: 1;
    position: relative;
    width: 100%;
    min-width: 0;
}
.search-input-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}
#preset-search {
    width: 100%;
    padding: 15px 75px 15px 20px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    font-size: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.15);
    outline: none;
}
#preset-search::placeholder {
    color: rgba(255, 255, 255, 0.5);
}
.search-actions {
    position: absolute;
    right: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}
#sort-filter-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
#sort-filter-btn:hover {
    color: var(--amber);
}
#sort-filter-btn svg {
    width: 18px;
    height: 18px;
}
#clear-search {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    cursor: pointer;
    display: none;
    padding: 5px;
}
#clear-search:hover {
    color: rgba(255, 255, 255, 0.9);
}
.dropdown-list {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    box-sizing: border-box;
    background: rgba(26, 30, 35, 0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.18);
        border-radius: 16px;
        max-height: 65vh;
        overflow-y: auto;
        z-index: 1000;
    display: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.dropdown-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    font-size: 16px;
}
.dropdown-item:last-child {
    border-bottom: none;
    }
.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
}
.recent-capsules {
    display: flex;
    flex-wrap: wrap; 
    gap: 8px;
    margin-top: 0;
    margin-bottom: 5px;
    width: 100%; 
}
.capsule {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 6px 4px 6px 12px;
    font-size: 14px;
    color: var(--text-light);
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 2px;
    max-width: 100%;
}
.capsule span {
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.recent-del-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 10px;
    margin: -4px 0;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}
.recent-del-btn:hover {
    color: #ff3333;
}
.capsule:hover {
    background: rgba(0, 0, 0, 0.5);
}
#refresh-btn {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--text-light);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.15);
    transition: transform 0.2s ease, background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
#refresh-btn:hover {
    background: rgba(0, 0, 0, 0.5);
}
#refresh-btn:active {
    transform: scale(0.92);
}
#refresh-btn svg {
    width: 20px;
    height: 20px;
    display: block;
}
#refresh-btn.spinning svg {
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
.hero-text-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 10px 0 20px 0; 
}
.hero-text {
    min-height: 200px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    text-align: left;
}
@media (min-width: 768px) {
    .hero-text {
        width: fit-content;
        max-width: 100%;
        align-items: center;
        padding: 20px 40px;
        border-radius: 24px;
        text-align: center;
    }
}
#hero-artist {
    font-family: 'Allison', system-ui, -apple-system, sans-serif;
    font-size: 60px;
    font-weight: 300;
    color: #ffffff;
    margin-bottom: 5px;
    letter-spacing: 2px;
    line-height: 0.9;
}
@media (min-width: 768px) {
    #hero-artist {
        font-size: 72px;
    }
}
.fallback-text {
    font-size: 0.55em;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0;
}
#hero-desc {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
    justify-content: flex-start;
}
@media (min-width: 768px) {
    #hero-desc {
        justify-content: center;
    }
}
.artist-capsule {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.25px;
    color: rgba(255, 255, 255, 1);
    white-space: nowrap;
}
.artist-text {
    font-family: 'Montserrat Subrayada', system-ui, -apple-system, sans-serif;
    font-size: 18px;
    color: rgba(255, 255, 255, 1);
    white-space: nowrap;
    letter-spacing: 1px;
}
.ft-panel {
    position: relative;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    width: 100%;
    box-sizing: border-box;
    border-radius: 16px;
    padding: 22px;
}
.ft-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 12px;
    margin-bottom: 14px;
}
.ft-guitar-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.ft-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
@media (max-width: 767px) {
    .ft-header-row {
        flex-wrap: wrap;
        gap: 15px;
    }
    .mode-toggle-wrapper {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 15px;
    }
    .real-gear-label {
        flex: 1;
        flex-basis: 0;
        text-align: right;
    }
    .mode-toggle {
        flex: 0 0 auto;
    }
    .id-floor-label {
        flex: 1;
        flex-basis: 0;
        text-align: left;
    }
    .ft-header-right {
        width: 100%;
    }
    .ft-nav-btns {
        width: 100%;
        gap: 10px;
    }
    .ft-nav-btn {
        flex: 1;
        width: auto;
        height: 36px;
    }
}
.ft-nav-btns {
    display: flex;
    gap: 10px;
}
.ft-nav-btn {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.6);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}
.ft-nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--amber);
    border-color: var(--amber);
}
.ft-nav-btn svg {
    width: 16px;
    height: 16px;
}
.ft-bank-badge {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 700;
    color: var(--amber);
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.ft-bank-led {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--amber);
    box-shadow: 0 0 6px var(--amber-glow);
}
.ft-global-strip {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 2px solid #cfcfcf;
    border-radius: 8px;
    padding: 20px 18px;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 4px;
    align-items: center;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
}
.ft-global-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    padding-right: 16px;
}
.ft-global-chip:last-child {
    border-right: none;
    padding-right: 0;
}
.ft-global-chip-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
}
.ft-global-chip-value {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
}
.ft-section-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    margin: 24px 0 12px;
    padding-left: 14px;
    position: relative;
}
.ft-section-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: var(--amber);
    border-radius: 50%;
    box-shadow: 0 0 4px var(--amber-glow);
}
.ft-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
@media (max-width: 767px) {
    .ft-grid-4 {
        grid-template-columns: 1fr;
    }
}
.amp-controls-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px 0;
    padding-top: 15px;
    width: 100%;
}
.amp-controls-grid .control-group {
    width: 50%; /* บังคับมือถือ 2 ปุ่มต่อแถว */
    display: flex;
    flex-direction: column;
    align-items: center;
}
@media (min-width: 768px) {
    .amp-controls-grid .control-group {
        width: 12.5%; /* บังคับ Desktop กระจายตัวสัดส่วน 8 ช่องเสมอ */
    }
}
.mode-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}
.mode-label {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    transition: color 0.3s;
    cursor: pointer;
}
.mode-label.active {
    color: var(--amber);
}
.mode-toggle {
    width: 44px;
    height: 24px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}
.mode-toggle-thumb {
    width: 18px;
    height: 18px;
    background: var(--amber);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 0 8px rgba(228, 166, 74, 0.4);
}
.mode-toggle.is-id .mode-toggle-thumb {
    transform: translateX(20px);
    background: var(--amber);
    box-shadow: 0 0 8px rgba(228, 166, 74, 0.4);
}
.mode-toggle.is-id + .id-floor-label {
    color: var(--amber);
}
.digital-readout-pad {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.digital-readout-line {
    width: 20px;
    height: 2px;
    background: rgba(255,255,255,0.1);
    border-radius: 1px;
}
.mode-toggle.disabled {
    opacity: 0.5;
    pointer-events: none;
}
.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 55px;
}
.knob {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(145deg, #222, #111);
    position: relative;
    box-shadow: inset 0 -1px 3px rgba(0, 0, 0, 0.8), inset 0 1px 2px rgba(255, 255, 255, 0.2), 0 4px 8px rgba(0, 0, 0, 0.7);
    border: 1px solid #000;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.knob-indicator {
    position: absolute;
    width: 2px;
    height: 12px;
    background: #fff;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}
.fx-controls-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px 5px;
    padding-top: 15px;
}
.fx-controls-grid .control-group {
    width: 48%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.led-toggle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(145deg, #1a1a1a, #0d0d0d);
    position: relative;
    box-shadow: inset 0 -1px 3px rgba(0, 0, 0, 0.8), inset 0 1px 2px rgba(255, 255, 255, 0.1), 0 4px 8px rgba(0, 0, 0, 0.7);
    border: 1px solid #000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.led-indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #222;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.8);
    transition: all 0.2s ease;
}
.control-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #aaa;
    text-align: center;
}
.control-value {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    padding: 4px 8px;
    min-width: 36px;
    text-align: center;
}
.ft-box {
    background: rgba(0, 0, 0, 0.4);
    padding: 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 2px solid #cfcfcf;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ft-box-accent {
    background:
        radial-gradient(circle at 2px 2px, rgba(0, 0, 0, 0.4) 1px, transparent 0) 0 0 / 6px 6px,
        radial-gradient(circle at 2px 2px, rgba(0, 0, 0, 0.4) 1px, transparent 0) 3px 3px / 6px 6px,
        rgba(15, 15, 15, 0.4);
    padding: 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 3px solid var(--amber);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ft-block-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-light);
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}
.ft-box-accent .ft-block-title {
    border: none;
    border-bottom: 1px solid;
    border-image: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.4), transparent) 1;
}
.ft-box .ft-block-title {
    justify-content: flex-start;
}
.ft-ch-tag {
    font-size: 10px;
    font-weight: 700;
    color: #0a0a0a;
    border-radius: 4px;
    padding: 3px 8px;
    letter-spacing: 1px;
}
.ft-params-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.ft-param-item {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 12px;
    gap: 6px;
    flex-wrap: nowrap;
    white-space: nowrap;
}
.ft-param-lbl {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 700;
}
.ft-param-val {
    color: #ffffff;
    font-weight: 700;
}
.ft-status-wrap {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}
.ft-status-btn {
    flex: 1;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 0;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.3);
}
.ft-status-btn.on {
    color: var(--amber);
    border-color: var(--amber);
    background: rgba(79, 195, 247, 0.1);
}
.ft-empty {
    color: rgba(255, 255, 255, 0.3);
    font-size: 13px;
    text-align: center;
    padding: 10px 0;
}
.playlist-container {
    width: 100%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 5px;
}
.playlist-toggle {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--text-light);
    padding: 8px 15px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: background 0.2s;
    align-self: center;
}
.playlist-toggle:hover {
    background: rgba(0, 0, 0, 0.5);
}
.settings-btn {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--text-light);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.15);
    transition: transform 0.2s ease, background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.settings-btn:hover {
    background: rgba(0, 0, 0, 0.5);
}
.settings-btn:active {
    transform: scale(0.92);
}
.settings-btn svg {
    width: 20px;
    height: 20px;
    display: block;
}
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    padding: 40px 20px;
}
.modal-content {
    background: rgba(26, 30, 35, 0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin: auto;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}
.modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}
.modal-input {
    width: 100%;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
}
.modal-textarea {
    width: 100%;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    min-height: 100px;
    resize: none;
}
.pseudo-disabled {
    opacity: 0.4;
    transition: opacity 0.2s;
}
.modal-btn {
    background: var(--amber);
    color: #000;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
}
.modal-btn:hover {
    opacity: 0.8;
}
.modal-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.modal-label {
    font-size: 14px;
    color: #aaa;
}
.modal-label.mt-10 {
    margin-top: 10px;
}
.modal-input-group {
    display: flex;
    gap: 10px;
}
.modal-btn.inline {
    white-space: nowrap;
    padding: 10px 15px;
}
.modal-section-title {
    padding-top: 10px;
    font-size: 15px;
    color: var(--amber);
    font-weight: bold;
}
.modal-instruction-list {
    font-size: 14px;
    color: #aaa;
    line-height: 1.5;
    margin-bottom: 12px;
    padding-left: 18px;
    margin-top: 8px;
}
.dropdown-item-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.dropdown-item-wrap:last-child {
    border-bottom: none;
}
.dropdown-item {
    flex: 1;
    padding: 12px 20px;
    cursor: pointer;
    color: var(--text-light);
    font-size: 14px;
    border-bottom: none;
}
.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
}
.del-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    padding: 4px;
    cursor: pointer;
    line-height: 0;
    transition: color 0.2s;
}
.del-btn:hover {
    color: rgba(255, 255, 255, 0.7);
}
.del-btn.confirm {
    color: #ff3333;
    filter: drop-shadow(0 0 6px rgba(255, 51, 51, 0.8));
    transform: scale(1.2);
}
#toast-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.toast {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 12px 24px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-align: center;
}
.toast.show {
    opacity: 1;
    transform: translateY(0);
}
.toast.error {
    border-color: rgba(255, 68, 68, 0.5);
    color: #ff4444;
    background: rgba(30, 0, 0, 0.85);
}
.consent-body-gtm {
    font-size: 14px;
    color: #888;
    line-height: 1.5;
    margin-bottom: 24px;
    text-align: left;
}
.consent-actions-gtm {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.consent-manage-btn-gtm {
    background: none;
    border: none;
    color: #888;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px;
    text-decoration: underline;
    -webkit-tap-highlight-color: transparent;
}
.manage-body-gtm {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
    text-align: left;
}
.preference-item-gtm {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.pref-text-gtm h4 {
    font-size: 15px;
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 4px;
}
.pref-text-gtm p {
    font-size: 13px;
    color: #888;
    line-height: 1.4;
}
.ios-checkbox-gtm {
    display: none;
}
.ios-toggle-label-gtm,
.ios-toggle-always-on-gtm {
    display: block;
    width: 48px;
    height: 28px;
    border-radius: 100px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}
.ios-toggle-label-gtm::after,
.ios-toggle-always-on-gtm::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #cccccc;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ios-checkbox-gtm:checked+.ios-toggle-label-gtm {
    background: rgba(204, 204, 204, 0.2);
    border-color: #cccccc;
}
.ios-checkbox-gtm:checked+.ios-toggle-label-gtm::after {
    transform: translateX(18px);
    background: #cccccc;
}
.ios-toggle-always-on-gtm {
    background: rgba(204, 204, 204, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
}
.ios-toggle-always-on-gtm::after {
    transform: translateX(18px);
    background: rgba(204, 204, 204, 0.5);
}
#gtm-consent-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding: 20px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
#gtm-consent-overlay.active {
    opacity: 1;
}
#gtm-manage-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
}
#gtm-manage-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.calc-modal {
    background: rgba(26, 30, 35, 0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    width: 100%;
    max-width: 450px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    display: flex;
    flex-direction: column;
}
.active .calc-modal {
    pointer-events: auto;
}
.calc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}
.calc-header h3 {
    color: #e0e0e0;
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}
.ios-prompt-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.primary-btn {
    background: var(--amber);
    color: #000;
    border: none;
    padding: 12px;
    border-radius: 999px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
    width: 100%;
    font-size: 14px;
}
.primary-btn:hover {
    opacity: 0.8;
}
@media (min-width: 600px) {
    #gtm-consent-overlay {
        align-items: center;
    }
    #gtm-consent-overlay .calc-modal {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 16px 24px;
        max-width: 900px;
    }
    #gtm-consent-overlay .calc-header {
        margin: 0;
        border: none;
        padding: 0;
        margin-right: 20px;
        flex-shrink: 0;
    }
    #gtm-consent-overlay .calc-header h3 {
        font-size: 15px;
        white-space: nowrap;
    }
    #gtm-consent-overlay .consent-body-gtm {
        margin: 0;
        flex: 1;
    }
    #gtm-consent-overlay .consent-body-gtm p {
        font-size: 13px;
        margin: 0;
    }
    #gtm-consent-overlay .consent-actions-gtm {
        flex-direction: row;
        align-items: center;
        gap: 16px;
        margin-left: 20px;
        flex-shrink: 0;
    }
    #gtm-consent-overlay .primary-btn {
        padding: 10px 24px;
        width: auto;
    }
    #gtm-consent-overlay .consent-manage-btn-gtm {
        padding: 10px;
    }
}
.hardware-tags-container {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
}
.hardware-tag {
    background: transparent;
    border: 1px solid var(--amber, #f59e0b);
    color: var(--amber, #f59e0b);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}
.hardware-tag.version-tag {
    display: none;
}
.hardware-tag.version-tag.show {
    display: inline-block;
}
.edit-btn-hero {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 4px 10px;
}
.edit-btn-hero:hover {
    color: var(--amber);
    border-color: var(--amber);
}
.edit-btn-hero.confirm-btn.save {
    color: #4CAF50;
    border-color: #4CAF50;
}
.edit-btn-hero.confirm-btn.cancel {
    color: #F44336;
    border-color: #F44336;
}
.dropdown-item-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 14px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.search-wrapper, .search-container {
    position: relative;
}

.dropdown-item-wrap {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    min-height: 50px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background-color 0.2s;
}
@media (min-width: 769px) {
    .dropdown-item-wrap:hover {
        background-color: rgba(255, 255, 255, 0.08);
    }
}
.dropdown-item-wrap:last-child {
    border-bottom: none;
}
.dropdown-item-text {
    flex: 1 1 auto;
    cursor: pointer;
    line-height: 1.5;
    font-size: 15px;
    padding-right: 12px;
}
.dropdown-item-actions {
    display: flex;
    align-items: center;
    gap: 0px;
    flex: 0 0 auto;
}
.fav-btn svg {
    stroke: rgba(255, 255, 255, 0.4);
    fill: none;
    transition: stroke 0.2s, fill 0.2s;
}
.fav-btn:hover svg {
    stroke: rgba(255, 255, 255, 0.7);
}
.fav-btn.active svg {
    stroke: var(--amber);
    fill: var(--amber);
}
#bg-thumbnails-container {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}
#bg-thumbnails-container::-webkit-scrollbar {
    display: none;
}
.bg-thumb {
    width: 75px;
    height: 50px;
    flex: 0 0 auto;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 20px;
    transition: border-color 0.2s;
    position: relative;
}
.bg-thumb.active {
    border-color: var(--amber);
}
.bg-thumb.custom-slot svg {
    transition: all 0.2s;
    pointer-events: none;
}
.bg-thumb.custom-slot.has-image svg {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 3px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(2px);
}
@media (max-width: 768px) {
    .app-logo {
        width: 44px;
        height: 44px;
    }
    .settings-btn {
        width: 44px;
        height: 44px;
    }
    .custom-dropdown {
        position: static;
        min-width: 0;
    }
    #preset-search {
        padding: 12px 35px 12px 15px;
        font-size: 16px;
    }
    #preset-list {
        top: calc(100% + 5px) !important;
        left: 0 !important;
        width: 100% !important;
        max-height: 65vh !important;
        overflow-y: auto !important;
        z-index: 9999 !important;
    }
    .dropdown-item-text {
        font-size: 14px !important;
        line-height: 1.6 !important;
    }
    .dropdown-item-actions {
        flex-direction: column !important;
        gap: 6px !important;
    }
    .recent-capsules {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
        width: calc(100% + 40px); 
        margin-left: -20px;
        padding-left: 20px;
        padding-right: 20px;
    }
    .recent-capsules::-webkit-scrollbar {
        display: none;
    }
    .capsule {
        max-width: 80vw;
        flex: 0 0 auto; 
    }
}
#thumb-custom-upload.has-image.active::after,
#thumb-custom-url.has-image.active::after {
    content: "↻";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    pointer-events: none;
}
.modal-input:focus,
#bg-url:focus {
    outline: none !important;
    border-color: #e4a64a !important;
    box-shadow: 0 0 0 1px #e4a64a !important;
}
.input-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}
.input-wrapper .modal-input {
    padding-right: 36px;
}
.input-clear-btn {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.input-clear-btn:hover {
    color: #fff;
}
.modal-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}
.modal-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 20px 0;
    width: 100%;
}
.sort-active {
    color: var(--amber) !important;
    font-weight: bold;
}
#sort-menu {
    position: absolute;
    top: calc(100% + 5px);
    right: 10px;
    left: auto;
    width: 180px;
    z-index: 10000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}
.modal-btn.outline-amber {
    background: transparent;
    color: var(--amber);
    border: 1px solid var(--amber);
}
.modal-btn.outline-amber:hover {
    background: rgba(228, 166, 74, 0.1);
}
.modal-btn.ghost {
    background: transparent;
    color: rgba(255, 255, 255, 0.4);
    border: 1px solid transparent;
}
.modal-btn.ghost:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.05);
}
.tab-switcher {
    display: flex;
    gap: 10px;
    background: rgba(26, 30, 35, 0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px;
    position: sticky;
    top: 0;
    z-index: 10;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}
.tab {
    flex: 1;
    text-align: center;
    padding: 8px 15px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.2s ease;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.tab.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--amber);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
.inline-edit-input {
    background: transparent;
    border: none;
    color: var(--amber);
    font-size: 15px;
    font-family: inherit;
    width: 100%;
    outline: none;
    padding: 0;
    margin: 0;
    border-bottom: 1px dashed rgba(228, 166, 74, 0.5);
}
.inline-edit-input:focus {
    border-bottom: 1px solid var(--amber);
}
.edit-btn, .save-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    padding: 12px 10px;
    cursor: pointer;
    font-size: 16px;
    transition: color 0.2s;
}
.edit-btn:hover, .save-btn:hover {
    color: var(--amber);
}
#url-input-container {
    display: flex;
    gap: 8px;
    align-items: center;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-top: 0;
    margin-bottom: 0;
}
#url-input-container.expanded {
    max-height: 50px;
    margin-top: 8px;
    margin-bottom: 15px;
}
#hero-artist {
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.footer-container {
    padding: 20px 20px 10px 20px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.5px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
}

.footer-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-copyright {
    display: flex;
    align-items: center;
    justify-content: center;
}

.support-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    font-weight: 700;
    color: var(--amber);
}

@media (min-width: 768px) {
    .footer-container {
        flex-direction: row;
        justify-content: space-between;
        padding: 20px 40px 10px 40px;
    }
    .footer-social {
        order: 1;
    }
    .footer-copyright {
        order: 2;
    }
}