        
        body,
        html {
            margin: 0;
            padding: 0;
            height: 100%;
            background-color: #1a1a1a;
            color: #ffffff;
            font-family: Arial, sans-serif;
            overflow: hidden;
            user-select: none;
            
            -webkit-user-select: none;
            touch-action: none; 
        }

        
        input,
        textarea {
            user-select: auto;
            -webkit-user-select: auto;
        }

        
        
        ::-webkit-scrollbar {
            width: 6px;
            height: 6px;
        }

        
        ::-webkit-scrollbar-track {
            background: #1a1a1a;
        }

        
        ::-webkit-scrollbar-thumb {
            background: #444;
            border-radius: 10px;
        }

        
        ::-webkit-scrollbar-thumb:hover {
            background: #007bff;
        }

        
        * {
            scrollbar-width: thin;
            scrollbar-color: #444 #1a1a1a;
        }

        .background-section {
            margin-top: 20px;
            padding-top: 20px;
            border-top: 1px solid #444;
        }

        .background-controls {
            margin-bottom: 15px;
            display: flex;
            gap: 10px;
        }

        .brightness-control {
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

        #backgroundBrightness {
            width: 100%;
        }

        #clearBackgroundBtn {
            background-color: #444;
            color: white;
            border: none;
            padding: 5px 10px;
            cursor: pointer;
        }

        #clearBackgroundBtn:hover {
            background-color: #555;
        }

        #app-container {
            display: flex;
            flex-direction: column;
            height: 100vh;
            width: 100vw;
            opacity: 0;
            transition: opacity 1s ease-in;
        }

        #app-container.fade-in {
            opacity: 1;
        }

        
        #viewport-container {
            flex: 1;
            position: relative;
            overflow: hidden;
        }

        #gridCanvas {
            width: 100%;
            height: 100%;
        }

        
        #menu-container {
            display: flex;
            height: 120px;
            max-height: 120px;
            min-height: 120px;
            background-color: #2a2a2a;
            position: relative;
            border-top: 2px solid #444;
            box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
        }

        #menu-container.show-tonic {
            height: 160px;
            max-height: 160px;
            min-height: 160px;
        }

        #left-menu,
        #center-menu,
        #right-menu {
            border-top: 1px solid #444;
        }

        #center-menu {
            position: relative;
            flex: 8;
            display: flex;
            flex-direction: column;
            align-items: stretch;
            height: 120px;
            justify-content: center;
            overflow: visible;
            grid-template-columns: repeat(12, 1fr);
            min-width: calc(var(--center-middle-width, 720px) + 500px);
            max-width: calc(var(--center-middle-width, 720px) + 500px);
            order: 2;
            border-left: 1px solid #444;
            border-right: 1px solid #444;
            transition: min-width var(--menu-transition-duration, 1s) linear, max-width var(--menu-transition-duration, 1s) linear;
        }

        #menu-container.show-tonic #center-menu {
            height: 160px;
        }

        #left-menu {
            width: 10%;
            display: flex;
            overflow: hidden;
            min-width: 0;
            flex: 1;
            min-width: 0;
            order: 1;
            
        }

        #right-menu {
            width: 10%;
            display: flex;
            overflow: hidden;
            min-width: 0;
            flex: 1;
            min-width: 0;
            order: 3;
            
        }

        
        .center-left {
            position: absolute;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            height: 120px;
            width: 250px;
            left: 0;
            padding: 0;
            align-items: flex-start;
            margin-top: 0px;
            transition: left var(--menu-transition-duration, 1s) linear;
            z-index: 10;
            background-color: #2a2a2a;
        }

        #menu-container.show-tonic .center-left {
            height: 160px;
        }

        .center-middle {
            position: absolute;
            left: calc(50% - var(--center-middle-width, 720px) / 2);
            grid-column: 1 / -1;
            height: 120px;
            width: var(--center-middle-width, 720px);
            overflow: hidden;
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 1;
            transition: left var(--menu-transition-duration, 1s) linear, width var(--menu-transition-duration, 1s) linear;
        }

        #menu-container.show-tonic .center-middle {
            height: 160px;
        }

        .center-right {
            position: absolute;
            display: flex;
            flex-direction: column;
            justify-content: space-around;
            padding: 0px;
            height: 120px;
            width: 250px;
            right: 0;
            margin-top: 0px;
            transition: right var(--menu-transition-duration, 1s) linear;
            z-index: 10;
            background-color: #2a2a2a;
        }

        #menu-container.show-tonic .center-right {
            height: 160px;
        }

        
        .control-row {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 33.33%;
            padding: 0 0;
            border-bottom: 1px solid #444;
        }

        #menu-container.show-tonic .control-row {
            height: 25%;
        }

        .control-row:last-child {
            border-bottom: none;
        }

        .control-buttons {
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 40px;
            width: 100%;
            padding: 1px 0;
            border-bottom: 1px solid #444;
            gap: 0;
        }

        .control-buttons .slide-buttons {
            margin-right: auto;
        }

        
        html.mobile #toggleViewportButtons,
        html.mobile #zoomControls,
        html.mobile #verticalControls {
            display: none !important;
        }

        .control-buttons .center-right-toggle-btn,
        .control-buttons .row-clear-btn {
            padding: 2px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .control-buttons .row-clear-btn .material-symbols-outlined {
            padding: 0;
        }

        .control-buttons:last-child {
            border-bottom: none;
        }

        
        .scale-row {
            display: flex;
            align-items: center;
            margin-bottom: 0;
            margin-top: 0px;
            height: 40px;
            width: 100%;
            border-bottom: 1px solid #444;
            box-sizing: border-box;
        }

        .scale-row:last-child {
            border-bottom: none;
        }

        .scale-name {
            width: 175px;
            font-size: 13px;
            margin-right: auto;
            margin-bottom: 5px;
            margin-top: 5px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: clip;
            height: 25px;
            box-sizing: border-box;
        }

        .scale-name:hover {
            background-color: #444;
        }

        .scale-name:not(.disabled):hover {
            background-color: #444;
            cursor: pointer;
        }

        .scale-name.disabled {
            background-color: #2a2a2a;
            cursor: not-allowed;
        }

        .scale-button-group {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-left: 3px solid #444;
            padding: 0 2px;
        }

        .scale-button-group button {
            padding: 2px;
            font-size: 12px;
            background: none;
            border: none;
            color: white;
            cursor: pointer;
        }

        
        .slide-buttons,
        .control-buttons {
            display: flex;
            align-items: center;
        }

        .slide-buttons {
            width: 55px;
            padding: 0px 0px;
            margin: 0 2px;
            padding: 2px 5px;
            margin-right: auto;
        }

        .slide-buttons button {
            background-color: #333;
            color: white;
            border: none;
            cursor: pointer;
            transition: background-color 0.3s ease;
        }

        .slide-buttons button:hover {
            background-color: #444;
        }

        .slide-buttons button:active {
            background-color: #555;
        }

        
        #MenuCanvas {
            height: 120px;
            width: 1440px;
            margin-left: -720px;
            background-color: #1a1a1a;
            border-radius: 4px;
            box-shadow: 0 0 20px rgba(0, 0, 0, 0.5), inset 0 0 1px rgba(255, 255, 255, 0.1);
            transition: margin-left var(--menu-transition-duration, 1s) linear;
        }

        #menu-container.show-tonic #MenuCanvas {
            height: 160px;
        }

        
        button {
            background-color: #333;
            color: white;
            border: none;
            padding: 5px 10px;
            cursor: pointer;
            margin: 2px;
        }

        
        .menu-tab {
            background-color: #444;
            color: white;
            border: none;
            padding: 4px 10px;
            margin: 1px 0;
            cursor: pointer;
            text-align: center;
            font-size: 12px;
            width: 30px;
            height: 40px;
            box-sizing: border-box;
            padding: 0;
            display: flex;
            
            justify-content: center;
            
            align-items: center;
            
            transition: background-color 0.3s, color 0.3s;
        }

        #left-tabs,
        #right-tabs {
            width: 30px;
            background-color: #333;
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            padding: 0;
        }

        .tab-content {
            display: none;
            padding: 0;
            margin-left: 3px;
            margin-right: 0px;
            width: 100px;
        }

        .tab-content.active {
            display: flex;
            flex-direction: row;
            margin-top: 0;
        }

        #left-content {
            flex: 1;
            background-color: #2a2a2a;
            padding: 2px;
        }

        #left-content .tab-content {
            flex-direction: column;
        }

        #right-content {
            flex: 1;
            display: flex;
            flex-direction: row-reverse;
            align-items: flex-start;
            background-color: #2a2a2a;
            margin-right: 0px;
            padding: 5px;
        }

        
        .menu-tab.active {
            background-color: #666;
        }

        .menu-tab:hover {
            background-color: #555;
        }

        
        .menu-tab[data-fb].fb-active {
            background-color: #4466aa;
        }

        .menu-tab[data-fb].fb-active:hover {
            background-color: #5577bb;
        }

        
        .menu-tab[data-fb].fb-active.active {
            background-color: #6c9bec;
        }

        .menu-tab[data-fb].fb-active.active:hover {
            background-color: #6699ee;
        }

        .menu-tab .material-symbols-outlined {
            font-size: 18px;
            line-height: 1;
        }

        
        .right-menu-toggle-btn {
            width: 30px;
            height: 30px;
            padding: 5px;
            font-size: 14px;
            border: 2px solid transparent;
            cursor: pointer;
            padding: 0;
            margin: 1px;
            border-radius: 3px;
            transition: background-color 0.3s, border-color 0.3s;
        }

        .right-menu-toggle-btn:not(.disabled) {
            border-color: #444;
        }

        .right-menu-toggle-btn.active {
            background-color: #4466aa;
        }

        .right-menu-toggle-btn.disabled {
            cursor: not-allowed;
            opacity: 0.5;
        }

        .toggle-icon-btn {
            background: none;
            border: none;
            cursor: pointer;
            padding: 0;
            margin-left: 0;
        }

        .toggle-icon-btn .material-symbols-outlined {
            font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 48;
            font-size: 24px;
            color: #888;
            transition: color 0.3s ease;
        }

        @media (hover: hover) {
            .toggle-icon-btn:hover .material-symbols-outlined {
                color: #b1b0b0;
            }
        }

        .toggle-icon-btn:active .material-symbols-outlined {
            color: #ffffff;
        }

        .toggle-icon-btn.active .material-symbols-outlined {
            color: #007bff;
        }

        @media (hover: hover) {
            .toggle-icon-btn.active:hover .material-symbols-outlined {
                color: #00aaff;
            }
        }

        .row-clear-btn .material-symbols-outlined {
            color: #888;
            font-size: 25px;
            padding: 5px;
        }

        @media (hover: hover) {
            .row-clear-btn:not(.disabled):hover .material-symbols-outlined {
                color: #ff6666;
                cursor: pointer;
            }
        }

        .row-clear-btn:not(.disabled):active .material-symbols-outlined {
            color: #ff3333;
        }

        
        .row-clear-btn.disabled {
            cursor: not-allowed !important;
        }

        .row-clear-btn.disabled .material-symbols-outlined {
            color: #444 !important;
            
            opacity: 0.6;
        }

        @media (hover: hover) {
            
            .row-clear-btn.disabled:hover .material-symbols-outlined {
                color: #444 !important;
            }
        }

        .row-clear-btn.disabled .material-symbols-outlined {
            color: #444;
            cursor: not-allowed;
        }

        
        
        .fb-row {
            display: flex;
            flex-direction: row;
            justify-content: flex-start;
            margin-bottom: 5px;
            margin-top: 0px;
        }

        .tab-content .fb-row:first-child {
            margin-top: 5px;
        }

        .fb-row .fbControl-btn {
            width: 30px;
            height: 30px;
            padding: 5px;
            font-size: 14px;
            border: 2px solid transparent;
            cursor: pointer;
            padding: 0;
            margin: 1px;
            border-radius: 3px;
            transition: background-color 0.3s, border-color 0.3s;
        }

        .fbControl-btn:not(.disabled) {
            border-color: #444;
        }

        .fbControl-btn.disabled {
            background-color: #1a1a1a;
            cursor: not-allowed;
            opacity: 0.5;
        }

        #FB1ShiftBtn,
        #FB2ShiftBtn,
        #FB3ShiftBtn {
            transform: scale(-1, 1);
        }

        #FB1ShrinkBtn,
        #FB2ShrinkBtn,
        #FB3ShrinkBtn {
            transform: rotate(-90deg);
        }

        #FB1Btn span,
        #FB2Btn span,
        #FB3Btn span {
            font-size: 20px;
        }

        .adjustLeftBtn {
            transform: rotate(-90deg);
        }

        .adjustRightBtn {
            transform: rotate(90deg);
        }

        .fbControl-btn.disabled:not(.active) {
            background-color: #1a1a1a;
            opacity: 0.5;
            cursor: not-allowed;
        }

        .fbControl-btn.active {
            background-color: #4466aa;
        }

        .fbControl-btn.active.disabled {
            background-color: #4466aa;
            opacity: 1;
        }

        .fbControl-btn .material-symbols-outlined {
            font-size: 25px;
            vertical-align: middle;
        }

        .string-count {
            width: 30px;
            height: 25px;
            background-color: #333;
            color: white;
            border: 1px solid #444;
            text-align: center;
            margin: 2px;
            padding-right: 15px;
            font-size: 16px;
        }

        .string-count::-webkit-outer-spin-button,
        .string-count::-webkit-inner-spin-button {
            height: 25px;
            position: absolute;
            right: 0;
            top: 50%;
            
            transform: translateY(-50%);
            
        }

        .string-count:disabled {
            background-color: #1a1a1a;
            cursor: not-allowed;
            opacity: 0.5;
        }

        
        .center-left-toggle-btn {
            font-size: 25px;
            vertical-align: middle;
            transition: color 0.3s ease;
            padding: 0;
            background: none;
            cursor: pointer;
            color: #888;
        }

        .center-left-toggle-btn.active {
            color: #007bff;
        }

        .center-left-toggle-btn:hover {
            color: #b1b0b0;
        }

        .center-left-toggle-btn.active:hover {
            color: #00aaff;
        }

        #highlightToggleBtn,
        #intervalToggleBtn,
        #noteToggleBtn,
        #tonicToggleBtn {
            width: 40px;
        }

        
        .center-right-toggle-btn {
            font-size: 25px;
            vertical-align: middle;
            transition: color 0.3s ease;
            padding: 5px;
            background: none;
            cursor: pointer;
            color: #888;
        }

        .center-right-toggle-btn.active {
            color: #007bff;
        }

        .center-right-toggle-btn:hover {
            color: #b1b0b0;
        }

        .center-right-toggle-btn.active:hover {
            color: #00aaff;
        }

        .center-right-toggle-btn.disabled {
            cursor: not-allowed !important;
            color: #444 !important;
            opacity: 0.6;
        }

        .center-right-toggle-btn.disabled:hover {
            color: #444 !important;
        }

        
        .zoom-btn,
        .fbControl-btn {
            display: flex;
            justify-content: center;
            align-items: center;
            transition: background-color 0.3s;
            width: 30px;
            height: 30px;
            padding: 0;
            margin: 5px;
            min-width: 30px;
            max-width: 30px;
        }

        #zoomControls,
        #verticalControls {
            display: flex;
            position: fixed;
            background-color: rgba(0, 0, 0, 0.5);
            padding: 5px;
            border-radius: 5px;
        }

        #zoomControls {
            position: absolute;
            bottom: 0px;
            right: -80px;
            transform: translateX(-50%);
            display: flex;
            align-items: center;
            z-index: 10;
        }


        #verticalControls {
            position: absolute;
            right: 0px;
            bottom: 40px;
            display: flex;
            flex-direction: column;
            z-index: 10;
        }

        #zoomControls.hidden,
        #verticalControls.hidden {
            display: none;
        }

        .zoom-btn.disabled,
        .fbControl-btn.disabled {
            background-color: #1a1a1a;
            cursor: not-allowed;
            opacity: 0.5;
        }

        
        .scale-dropdown {
            background-color: rgba(0, 0, 0, 0.2);
            border: 1px solid #444;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
            max-height: 600px;
            overflow-y: auto;
            z-index: 1000;
            padding: 10px;
            width: 1000px;
            position: relative;
        }

        .scale-dropdown div {
            padding: 5px;
            cursor: pointer;
        }

        .scale-dropdown div:hover {
            background-color: rgba(58, 58, 58, 0.2);
        }

        .scale-name-btn.linked {
            border: 2px solid #007bff;
            box-shadow: 0 0 5px #007bff;
        }

        .scale-name-btn.disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .dropdown-close-btn {
            position: absolute;
            top: 5px;
            right: 5px;
            background: none;
            border: none;
            font-size: 20px;
            cursor: pointer;
            color: #888;
            padding: 0;
            line-height: 1;
            transition: color 0.2s ease;
        }

        .dropdown-close-btn:hover {
            color: #fff;
        }

        
        .scale-dropdown.non-transparent {
            background-color: #2a2a2a;
        }

        .scale-dropdown.non-transparent .draw-item:hover {
            background-color: #3a3a3a;
        }

        
        .drawlines-dropdown,
        .drawBox-dropdown {
            background-color: rgba(42, 42, 42, 0.4);
            transition: background-color 0.3s;
            border: 1px solid #444;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
            overflow: hidden;
            z-index: 1000;
            position: absolute;
            display: flex;
            flex-direction: column-reverse;
            justify-content: flex-end;
            align-items: center;
            padding: 0;
        }

        .drawlines-dropdown.non-transparent,
        .drawBox-dropdown.non-transparent {
            background-color: rgb(42, 42, 42);

        }

        .drawlines-dropdown .draw-item,
        .drawBox-dropdown .draw-item {
            width: 100%;
            height: 25%;
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: pointer;
            transition: background-color 0.3s, color 0.3s;
            border: 1px solid #444;
            border-radius: 3px;
            margin: 2px;
            padding: 2px;
        }

        .draw-item {
            padding: 5px;
            cursor: pointer;
            transition: background-color 0.2s ease;
        }

        .draw-item:hover {
            background-color: #3a3a3a;
            color: #00cc00;
        }

        .draw-item.selected {
            color: #00aaff;
            font-weight: bold;
        }

        .drawSamenoteLine-btn,
        .drawLeftAscendingLine-btn,
        .drawRightAscendingLine-btn,
        .drawTwoOctaveLine-btn,
        .eraseLines-btn,
        .clearLines-btn,
        .palettes-btn,
        .ignoreDarkenHide-btn,
        .darkenHideLines-btn,
        .toggleAllLines-btn,
        .drawPrimaryBox-btn,
        .drawLeftAscendingBox-btn,
        .drawRightAscendingBox-btn,
        .drawExtendedRightAscendingBox-btn,
        .drawExtendedLeftAscendingBox-btn,
        .eraseForms-btn,
        .clearForms-btn,
        .toggleAllForms-btn {
            background: none;
            border: 2px solid transparent;
            cursor: pointer;
            padding: 0;
            margin: 2px;
            border-radius: 3px;
            transition: background-color 0.3s, border-color 0.3s;
            width: 30px;
            height: 30px;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .drawSamenoteLine-btn:not(.active),
        .drawLeftAscendingLine-btn:not(.active),
        .drawRightAscendingLine-btn:not(.active),
        .drawTwoOctaveLine-btn:not(.active),
        .eraseLines-btn:not(.active),
        .clearLines-btn:not(.active),
        .palettes-btn:not(.active),
        .ignoreDarkenHide-btn:not(.active),
        .darkenHideLines-btn:not(.active),
        .toggleAllLines-btn:not(.active),
        .drawPrimaryBox-btn:not(.active),
        .drawLeftAscendingBox-btn:not(.active),
        .drawRightAscendingBox-btn:not(.active),
        .drawExtendedRightAscendingBox-btn:not(.active),
        .drawExtendedLeftAscendingBox-btn:not(.active),
        .eraseForms-btn:not(.active),
        .clearForms-btn:not(.active),
        .toggleAllForms-btn:not(.active) {
            border-color: #444;
        }

        .drawSamenoteLine-btn.active,
        .drawLeftAscendingLine-btn.active,
        .drawRightAscendingLine-btn.active,
        .drawTwoOctaveLine-btn.active,
        .drawPrimaryBox-btn.active,
        .drawLeftAscendingBox-btn.active,
        .drawRightAscendingBox-btn.active,
        .drawExtendedRightAscendingBox-btn.active,
        .drawExtendedLeftAscendingBox-btn.active,
        .eraseLines-btn.active,
        .clearLines-btn.active,
        .clearForms-btn.active,
        .eraseForms-btn.avtive {
            background-color: #4466aa;
            border-color: transparent;
        }

        .eraseLines-btn .material-symbols-outlined,
        .clearLines-btn .material-symbols-outlined,
        .palettes-btn .material-symbols-outlined,
        .ignoreDarkenHide-btn .material-symbols-outlined,
        .darkenHideLines-btn .material-symbols-outlined,
        .toggleAllLines-btn .material-symbols-outlined,
        .eraseForms-btn .material-symbols-outlined,
        .clearForms-btn .material-symbols-outlined,
        .toggleAllForms-btn .material-symbols-outlined {
            color: #888;
            font-size: 25px;
            font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 18;
        }

        .clearLines-btn.flash,
        .clearForms-btn.flash {
            background-color: #4466aa;
            transition: background-color 0.1s ease;
        }

        .drawlines-dropdown .draw-item:hover {
            background-color: rgba(58, 58, 58, 0.2);
        }

        .drawlines-dropdown .material-symbols-outlined,
        .drawBox-dropdown .material-symbols-outlined {
            font-size: 25px;
            color: #888;
            transition: color 0.3s;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .drawlines-dropdown .material-symbols-outlined.active,
        .drawBox-dropdown .material-symbols-outlined.active {
            color: #007bff;
        }

        .drawlines-dropdown .draw-item:hover .material-symbols-outlined,
        .drawSamenoteLine-btn:hover .material-symbols-outlined,
        .drawLeftAscendingLine-btn:hover .material-symbols-outlined,
        .drawRightAscendingLine-btn:hover .material-symbols-outlined,
        .eraseLines-btn:hover .material-symbols-outlined,
        .clearLines-btn:hover .material-symbols-outlined,
        .eraseForms-btn:hover .material-symbols-outlined,
        .clearForms-btn:hover .material-symbols-outlined {
            color: #b1b0b0;
        }

        .drawlines-dropdown .material-symbols-outlined.active:hover {
            color: #00aaff;
            
        }

        
        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.4);
        }

        .modal-content {
            background-color: #2a2a2a;
            padding: 20px;
            border: 1px solid #888;
            width: 50%;
            max-height: 80vh;
            color: #fff;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            overflow-y: auto;
        }

        .close {
            color: #aaa;
            float: right;
            font-size: 28px;
            font-weight: bold;
            cursor: pointer;
        }

        .close:hover,
        .close:focus {
            color: #fff;
            text-decoration: none;
            cursor: pointer;
        }

        
        #doc-modal {
            z-index: 100000; 
        }

        .doc-modal-content {
            width: 80%;
            height: 85vh;
            max-width: 900px;
            padding: 0;
            overflow: hidden;
            border-radius: 12px;
            border: 1px solid rgba(255,255,255,0.2);
        }

        .doc-modal-content .close {
            position: absolute;
            right: 15px;
            top: 10px;
            z-index: 10;
            background: rgba(0,0,0,0.5);
            width: 36px;
            height: 36px;
            line-height: 36px;
            text-align: center;
            border-radius: 50%;
            color: #fff;
        }

        .doc-iframe-wrapper {
            width: 100%;
            height: 100%;
            -webkit-overflow-scrolling: touch;
            overflow-y: auto;
        }

        #doc-iframe {
            width: 100%;
            height: 100%;
            background: #1a1a1a; 
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        #doc-iframe.loaded {
            opacity: 1;
        }

        html.mobile .doc-modal-content {
            width: 95%;
            height: 90vh;
        }

        
        @keyframes spin {
            0% {
                transform: rotate(0deg);
            }

            100% {
                transform: rotate(360deg);
            }
        }

        @keyframes flash {
            0% {
                background-color: #555;
            }

            100% {
                background-color: #333;
            }
        }

        
        #loading-screen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: #1a1a1a;
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 9999;
            opacity: 1;
            transition: opacity 1s ease-out;
        }

        .loading-content {
            text-align: center;
            color: #ffffff;
        }

        .loading-spinner {
            border: 4px solid #333;
            border-top: 4px solid #007bff;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            animation: spin 1s linear infinite;
            margin: 0 auto 20px;
        }

        
        
        @media (max-width: 1200px) {
            #menu-container {
                display: flex;
                flex-wrap: nowrap;
                
            }

            #right-menu {
                flex-shrink: 1;
                
            }

            #left-menu {
                flex-shrink: 1;
                
            }
        }

        
        #auth-screen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url("../img/ss.png");
            background-size: cover;
            background-position: center;
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 9998;
            
            transition: opacity 0.5s ease-out;
        }

        .auth-content {
            background-color: #2a2a2a;
            padding: 40px;
            border-radius: 8px;
            text-align: center;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
            border: 1px solid #444;
            max-width: 400px;
            width: 90%;
            font-family: 'Inter', sans-serif;
        }

        .auth-content h1 {
            margin-top: 0;
            margin-bottom: 10px;
            font-size: 2.4rem;
            font-family: 'Outfit', sans-serif;
            font-weight: 800;
            letter-spacing: -0.02em;
            background: linear-gradient(135deg, #ffffff 0%, #a0a0a0 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            filter: drop-shadow(0 5px 15px rgba(0,0,0,0.2));
        }

        .auth-content p {
            color: #aaa;
            margin-bottom: 30px;
            font-size: 14px;
        }

        
        .mode-switch-container {
            display: flex;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 12px;
            padding: 4px;
            margin: 10px 0 25px 0;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .mode-switch-btn {
            flex: 1;
            padding: 8px 0;
            border: none;
            background: transparent;
            color: #888;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            border-radius: 8px;
            transition: all 0.2s ease;
            text-decoration: none;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }

        .mode-switch-btn:hover {
            color: #fff;
            background: rgba(255, 255, 255, 0.05);
        }

        .mode-switch-btn.active {
            background: #007bff;
            color: #fff;
            box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
        }

        
        .google-btn {
            background-color: #ffffff;
            color: #3c4043;
            border: 1px solid #dadce0;
            border-radius: 4px;
            padding: 0;
            height: 40px;
            display: inline-flex;
            align-items: center;
            font-family: "Google Sans", arial, sans-serif;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            width: 100%;
            justify-content: center;
            transition: background-color 0.2s, box-shadow 0.2s;
            margin: 0;
            
        }

        .google-btn:hover {
            background-color: #f8f9fa;
            box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
            border-color: #dadce0;
        }

        .google-btn:active {
            background-color: #f1f3f4;
            box-shadow: none;
            transform: scale(0.99);
        }

        .google-icon {
            width: 18px;
            height: 18px;
            margin-right: 20px;
        }

        
        #lockout-screen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url("../img/ss.png");
            background-size: cover;
            background-position: center;
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 9998;
            
            transition: opacity 0.5s ease-out;
        }

        .lockout-content {
            border: 1px solid #007bff;
            background-color: #222;
        }

        .upgrade-btn {
            background-color: #007bff;
            color: #ffffff;
            border: none;
            border-radius: 4px;
            padding: 15px;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            width: 100%;
            transition: background-color 0.2s, transform 0.1s;
            margin-top: 10px;
        }

        .upgrade-btn:hover {
            background-color: #0056b3;
            transform: translateY(-2px);
        }

        .upgrade-btn:active {
            transform: translateY(0);
        }

        
        #app-custom-tooltip {
            position: fixed;
            z-index: 999999;
            background: rgba(15, 15, 15, 0.92);
            color: #f0f0f0;
            padding: 10px 18px;
            border-radius: 12px;
            font-size: 14px;
            font-weight: 400;
            line-height: 1.5;
            pointer-events: none;
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.15);
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7), 0 0 1px rgba(255, 255, 255, 0.2);
            transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            opacity: 0;
            transform: scale(0.95) translateY(10px);
            white-space: pre-wrap;
            max-width: 320px;
            word-wrap: break-word;
            visibility: hidden;
            font-family: inherit;
        }

        #app-custom-tooltip.visible {
            opacity: 1;
            transform: scale(1) translateY(0);
            visibility: visible;
        }

        html.mobile #app-custom-tooltip {
            font-size: 11px;
            padding: 8px 14px;
            max-width: 250px;
            border-radius: 10px;
        }


html.mobile .auth-content {
    max-width: 300px !important;
    padding: 14px 16px !important;
    border-radius: 16px !important;
}
html.mobile .auth-content img[alt="Infinity Strings Icon"] {
    width: 48px !important;
    height: 48px !important;
    margin-bottom: 6px !important;
    border-radius: 12px !important;
}
html.mobile .auth-content h1 {
    font-size: 1.2rem !important;
    margin: 4px 0 2px !important;
}
html.mobile .auth-content p {
    font-size: 0.78rem !important;
    margin-bottom: 8px !important;
}
html.mobile .auth-content > div[style*="margin-top: 15px"] {
    margin-top: 4px !important;
    margin-bottom: 8px !important;
}
html.mobile .auth-content .mode-switch-container {
    margin: 4px 0 8px 0 !important;
}
html.mobile .auth-content > div[style*="flex-direction: column"] {
    display: none !important;
}
html.mobile .auth-content .google-btn {
    margin-bottom: 8px !important;
    height: 34px !important;
}
html.mobile .auth-content .auth-links {
    margin-top: 4px !important;
    font-size: 10px !important;
}
html.mobile .auth-content > div[style*="margin-top: 20px"] {
    margin-top: 8px !important;
    padding-top: 8px !important;
}


html.mobile .tonic-row #addLeftColumnBtn,
html.mobile .tonic-row #menuExpandBtn {
    display: none !important;
}



html.mobile .center-right .control-buttons {
    justify-content: flex-start !important;
}

html.mobile .slide-buttons {
    margin-right: 20px !important;
    width: 55px !important;
    flex-shrink: 0 !important;
}


html.mobile .center-right-toggle-btn,
html.mobile .row-clear-btn,
html.mobile .dummy-spacer {
    width: 27px !important;
    height: 35px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

html.mobile .center-right-toggle-btn {
    font-size: 25px !important;
}

html.mobile .row-clear-btn .material-symbols-outlined {
    font-size: 25px !important;
    padding: 0 !important;
}


.dummy-spacer {
    display: none;
}
html.mobile .dummy-spacer {
    display: inline-block;
}




html.mobile .mobile-toggle-btn {
    position: absolute;
    top: 4px;
    z-index: 1000;
    background: rgba(30, 30, 30, 0.8);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    width: 28px;
    height: 28px;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    cursor: pointer;
    transition: transform 0.3s ease;
}

html.mobile .mobile-toggle-btn span {
    transition: transform 0.3s ease;
    display: block;
}


html.mobile.show-mobile-left #mobile-left-btn span { transform: rotate(180deg); }
html.mobile.show-mobile-right #mobile-right-btn span { transform: rotate(180deg); }


.drawing-toolbar {
    position: fixed;
    right: 12px;
    top: 50%;
    transform: translateY(-50%) translateX(100px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 8px;
    background: rgba(20, 20, 20, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    z-index: 2100;
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1), opacity 0.3s ease;
    pointer-events: auto;
}

.drawing-toolbar.toolbar-grid {
    display: grid;
    grid-template-columns: repeat(2, auto);
    grid-template-rows: repeat(4, auto);
    grid-auto-flow: column;
    gap: 12px;
}

.drawing-toolbar.active {
    transform: translateY(-50%) translateX(0);
    opacity: 1;
}

.toolbar-item {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #fff;
    padding: 0;
}

.toolbar-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.toolbar-item.active {
    background: rgba(0, 123, 255, 0.3);
    border-color: rgba(0, 123, 255, 0.6);
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.4);
}

.toolbar-item span {
    font-size: 24px;
}

html.mobile .drawing-toolbar {
    gap: 4px;
    padding: 6px 4px;
    right: 8px;
    
    transform: translateY(calc(-50% - 32px));
}

html.mobile .drawing-toolbar.active {
    transform: translateY(calc(-50% - 32px)) translateX(0);
}

html.mobile .drawing-toolbar.toolbar-grid {
    gap: 4px;
}

html.mobile .toolbar-item {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

html.mobile .toolbar-item span {
    font-size: 18px;
}


.draw-mode-cursor-icon {
    font-size: 35px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    
    transform: rotate(var(--icon-rotate, 0deg)) scale(var(--icon-scale, 1));
    transform-origin: center;
}

html.mobile .draw-mode-cursor-icon {
    
    
    --icon-scale: 0.514;
}
html.mobile .mobile-toggle-btn .material-symbols-outlined,
html.mobile .mobile-tap-mode-btn .material-symbols-outlined {
    font-size: 18px;
}

html.mobile #mobile-left-btn {
    left: 10px;
    top: auto;
    bottom: 0px;
}
html.mobile #mobile-settings-btn { left: 10px; top: 4px; }
html.mobile #mobile-sub-mode-btn { right: 36px; top: 4px; }
html.mobile #mobile-sub-mode-btn.hidden { display: none !important; }
html.mobile #mobile-right-btn {
    right: 4px;
    top: auto;
    bottom: 0px;
}
.mobile-toggle-btn { display: none !important; }


.mobile-tap-mode-btn { display: none !important; }

html.mobile .mobile-toggle-btn,
html.mobile .mobile-tap-mode-btn {
    display: flex !important;
}


html.mobile .mobile-tap-mode-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 1000;
    background: rgba(30, 30, 30, 0.8);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    width: 28px;
    height: 28px;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    cursor: pointer;
    transition: transform 0.3s ease;
}

html.mobile .mobile-tap-mode-btn.mode-draw {
    border-color: rgba(100, 180, 255, 0.6);
    box-shadow: 0 0 8px rgba(100, 180, 255, 0.4), 0 4px 12px rgba(0,0,0,0.5);
}


html.mobile #menu-container {
    position: relative;
    overflow: visible;
    height: calc(120px * var(--mobile-scale, 1)) !important;
    min-height: calc(120px * var(--mobile-scale, 1)) !important;
    max-height: calc(120px * var(--mobile-scale, 1)) !important;
}

html.mobile #menu-container.show-tonic {
    height: calc(160px * var(--mobile-scale, 1)) !important;
    min-height: calc(160px * var(--mobile-scale, 1)) !important;
    max-height: calc(160px * var(--mobile-scale, 1)) !important;
}

html.mobile #left-menu,
html.mobile #right-menu {
    position: absolute;
    bottom: 0;
    height: 120px;
    z-index: 999;
    background: rgba(30, 30, 30, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 210px;
    max-width: 90vw;
    display: flex;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-sizing: border-box;
    border-radius: 12px 12px 0 0;
}

html.mobile #menu-container.show-tonic #left-menu,
html.mobile #menu-container.show-tonic #right-menu {
    height: 160px;
}

html.mobile #left-menu {
    left: 15px;
    bottom: 0;
    transform: translateX(-110%) scale(var(--mobile-scale, 1));
    transform-origin: bottom left;
    flex-direction: row;
}
html.mobile #right-menu {
    right: 15px;
    bottom: 0;
    transform: translateX(110%) scale(var(--mobile-scale, 1));
    transform-origin: bottom right;
    flex-direction: row;
}

html.mobile.show-mobile-left #left-menu { transform: translateX(0) scale(var(--mobile-scale, 1)); }
html.mobile.show-mobile-right #right-menu { transform: translateX(0) scale(var(--mobile-scale, 1)); }

html.mobile #left-content,
html.mobile #right-content {
    overflow-y: auto;
    background: transparent !important;
    box-sizing: border-box;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

html.mobile #left-content::-webkit-scrollbar,
html.mobile #right-content::-webkit-scrollbar {
    display: none;
}

html.mobile #left-tabs,
html.mobile #right-tabs {
    overflow-y: hidden;
    background: transparent !important;
    box-sizing: border-box;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

html.mobile #left-tabs::-webkit-scrollbar,
html.mobile #right-tabs::-webkit-scrollbar {
    display: none;
}

html.mobile #left-tabs .menu-tab:nth-child(4),
html.mobile #left-tabs .menu-tab:nth-child(5) {
    display: none;
}


html.mobile.show-mobile-left .center-left,
html.mobile.show-mobile-right .center-right {
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

html.mobile.show-mobile-left .center-left > *,
html.mobile.show-mobile-right .center-right > * {
    opacity: 0;
    pointer-events: none;
}


html.mobile #center-menu {
    min-width: unset;
    width: 1220px;
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%) scale(var(--mobile-scale, 1));
    transform-origin: bottom center;
}


html.mobile .scale-dropdown {
    padding: 10px !important;
}

html.mobile .scale-dropdown-column {
    min-width: 85px !important;
    margin-right: 5px !important;
    margin-bottom: 10px !important;
}

html.mobile .scale-dropdown-title {
    font-size: 11px !important;
    margin-bottom: 3px !important;
}

html.mobile .scale-dropdown .draw-item {
    font-size: 10px !important;
    padding: 3px !important;
    margin: 1px 0 !important;
}


#app-error-message-container {
    position: fixed;
    left: 50%;
    bottom: 130px;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 18px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease, bottom 0.3s ease;
    white-space: pre-wrap;
    text-align: center;
}

html.mobile #app-error-message-container {
    bottom: calc(130px * var(--mobile-scale, 1));
    transform: translateX(-50%);
    font-size: calc(18px * var(--mobile-scale, 0.7));
    padding: calc(10px * var(--mobile-scale, 0.7)) calc(20px * var(--mobile-scale, 0.7));
    width: max-content;
    max-width: 95vw;
}


@keyframes loading-dot-blink {
    0%, 80%, 100% { opacity: 0; }
    40% { opacity: 1; }
}
.loading-dots span {
    animation: loading-dot-blink 1.4s infinite both;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }


#app-mode-badge-container {
    position: absolute;
    left: 10px;
    bottom: 5px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 1000;
    pointer-events: none;
    font-weight: bold;
    display: none;
    white-space: nowrap;
}

html.mobile #app-mode-badge-container {
    
    transform: scale(var(--mobile-scale, 0.7));
    transform-origin: bottom left;
    left: calc(10px * var(--mobile-scale, 1));
    bottom: calc(5px * var(--mobile-scale, 1));
}
