
        html, body {
            height: 100%;
            margin: 0;
            font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
            overflow: hidden; 
            display: flex;
            flex-direction: column;
            background-color: #f0f0f0;
        }

        #top-bar {
            display: flex;
            align-items: center;
            padding: 10px 15px;
            background-color: #333;
            color: white;
            flex-shrink: 0;
            gap: 10px; 
            flex-wrap: wrap; 
        }

        #top-bar label {
            margin-right: 5px;
        }

        #top-bar select, #top-bar button {
            padding: 5px 8px;
            border: 1px solid #555;
            background-color: #444;
            color: white;
            border-radius: 4px;
            cursor: pointer;
            font-size: 1em; 
            transition: background-color 0.2s, color 0.2s; /* Smooth transition for active state */
        }
        #top-bar button:hover {
            background-color: #555;
        }
        #top-bar select:focus, #top-bar button:focus {
            outline: 2px solid dodgerblue;
        }
        #current-zoom-display {
            min-width: 55px; /* Accommodate 4 digits + px */
            text-align: right;
            margin-left: 0px; 
            font-variant-numeric: tabular-nums; 
        }
        .style-toggle-btn {
            padding: 5px 8px; /* Consistent with other buttons */
            min-width: 30px; 
        }
        #top-bar .style-toggle-btn.active { /* More specific selector for active state */
            background-color: white;
            color: black;
        }


        #category-header {
            text-align: center;
            padding: 10px;
            margin: 0;
            font-size: 1.2em;
            background-color: #e0e0e0;
            flex-shrink: 0;
            border-bottom: 1px solid #ccc;
        }

        #character-grid-container {
            flex-grow: 1;
            overflow-y: auto; 
            padding: 10px;
            background-color: #fff;
        }
        
        #character-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(var(--cell-size, 30px), 1fr));
            gap: 2px;
            width: 100%;
        }

        .char-cell {
            display: flex;
            justify-content: center;
            align-items: center;
            aspect-ratio: 1 / 1; 
            border: 1px solid #ddd;
            background-color: #f9f9f9;
            cursor: pointer;
            font-size: var(--char-font-size, 16px);
            transition: background-color 0.2s;
            user-select: none;
            overflow: hidden; 
            line-height: 1; 
        }

        .char-cell:hover {
            background-color: #e0e0e0;
            border-color: #bbb;
        }

        .grid-subheader {
            grid-column: 1 / -1; 
            text-align: left;
            margin-top: 20px;
            margin-bottom: 10px;
            font-size: 1.1em;
            font-weight: bold;
            color: #333;
            border-bottom: 1px solid #ccc;
            padding-bottom: 5px;
            background-color: #fff; 
        }

        #tooltip {
            position: fixed; 
            background-color: rgba(0, 0, 0, 0.85);
            color: white;
            padding: 15px;
            border-radius: 8px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.3);
            z-index: 1000;
            pointer-events: none; 
            display: none; 
            max-width: 300px;
            text-align: left;
        }

        #tooltip-char {
            font-size: 5em;
            display: block;
            text-align: center;
            margin-bottom: 10px;
            line-height: 1;
            word-break: break-all; 
        }

        #tooltip-info p {
            margin: 5px 0;
            font-size: 0.9em;
        }
         #copy-feedback {
            position: fixed;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            background-color: #28a745;
            color: white;
            padding: 8px 15px;
            border-radius: 5px;
            z-index: 1001;
            opacity: 0;
            transition: opacity 0.3s ease-in-out;
            pointer-events: none;
        }

        #copy-feedback.show {
            opacity: 1;
        }

        #loading-sentinel {
            grid-column: 1 / -1;
            text-align: center;
            padding: 20px;
            font-style: italic;
            color: #888;
        }
