﻿body {
            background: #FFFFFF;
            color: #222222;
            font-family: system-ui, sans-serif;
            margin: 0;
            padding: 2em 0;
        }

        *,
        *::before,
        *::after {
            box-sizing: border-box;
        }

        .hidden,
        [hidden] {
            display: none !important;
        }

        button,
        input,
        select {
            font: inherit;
        }

        .button {
            background: #454b52;
            border: 0;
            border-radius: 4px;
            color: #ffffff;
            cursor: pointer;
            padding: 0.75em 1em;
        }

        .button.special {
            background: #167987;
        }

        .button:disabled {
            cursor: not-allowed;
            opacity: 0.45;
        }

        .page-container {
            max-width: 900px;
            margin: 0 auto;
            padding: 0 2em;
        }

        header {
            margin-bottom: 2em;
            padding-bottom: 1.5em;
            border-bottom: solid 2px rgba(144, 144, 144, 0.25);
        }

        h1 {
            color: #222222;
            font-size: 2.5em;
            font-weight: 300;
            margin-bottom: 0.5em;
        }

        .description {
            color: #444444;
            font-size: 1em;
            line-height: 1.65em;
        }

        .section {
            margin-bottom: 2.5em;
        }

        .section h2 {
            color: #222222;
            font-size: 1.5em;
            font-weight: 700;
            margin-bottom: 1em;
            border-bottom: solid 1px rgba(144, 144, 144, 0.25);
            padding-bottom: 0.5em;
        }

        .input-group {
            margin-bottom: 1.5em;
        }

        .input-group label {
            display: block;
            margin-bottom: 0.5em;
            font-weight: 700;
            color: #222222;
        }

        input[type="text"],
        input[type="file"],
        select {
            border: solid 1px rgba(50, 55, 60, 0.35);
            border-radius: 4px;
            padding: 0.65em;
            width: 100%;
        }

        .button-group {
            display: flex;
            gap: 0.75em;
            flex-wrap: wrap;
        }

        .button-group .button {
            flex: 0 0 auto;
        }

        .device-info {
            padding: 1em;
            background: rgba(71, 205, 217, 0.1);
            border-radius: 0.5em;
            border: solid 1px rgba(71, 205, 217, 0.25);
            margin-top: 1em;
            font-family: monospace;
            font-size: 0.9em;
        }

        .device-info.hidden {
            display: none;
        }

        .device-info div {
            margin-bottom: 0.25em;
        }

        .device-info div:last-child {
            margin-bottom: 0;
        }

        .device-info strong {
            color: #222222;
        }

        .progress-container {
            margin-top: 1.5em;
        }

        .progress-container.hidden {
            display: none;
        }

        .progress-bar {
            width: 100%;
            height: 2.5em;
            background: rgba(144, 144, 144, 0.075);
            border-radius: 0.5em;
            overflow: hidden;
            position: relative;
            border: solid 1px rgba(144, 144, 144, 0.25);
        }

        .progress-fill {
            height: 100%;
            background: linear-gradient(90deg, #47cdd9, #5cd3dd);
            width: 100%;
            transform: scaleX(0);
            transform-origin: left;
            transition: transform 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 0.85em;
            font-weight: 700;
            text-shadow: 0 1px 2px rgba(0,0,0,0.2);
        }

        .console {
            margin-top: 1.5em;
            background: #2c3e50;
            color: #ecf0f1;
            padding: 1em;
            border-radius: 0.5em;
            max-height: min(400px, 50vh);
            overflow-y: auto;
            font-family: 'Courier New', monospace;
            font-size: 0.8em;
            line-height: 1.5;
            border: solid 1px rgba(144, 144, 144, 0.25);
        }

        .console.hidden {
            display: none;
        }

        .console-line {
            margin-bottom: 0.25em;
        }

        .console-line.error {
            color: #ff6b6b;
        }

        .console-line.success {
            color: #51cf66;
        }

        .console-line.warning {
            color: #ffd43b;
        }

        /* Button overrides for our use case */
        .button {
            text-transform: uppercase;
            font-size: 0.9em;
            letter-spacing: 0.05em;
        }

        .button.secondary {
            background-color: rgba(144, 144, 144, 0.2);
        }

        .button.secondary:hover {
            background-color: rgba(144, 144, 144, 0.3);
        }

        /* Advanced offset editor styles */
        .advanced-checkbox-container {
            margin-top: 1em;
            display: flex;
            align-items: center;
        }

        .advanced-checkbox-container input[type="checkbox"] {
            width: auto;
            margin-right: 0.5em;
        }

        .advanced-checkbox-container label {
            margin: 0;
            font-weight: 400;
            color: #444;
            cursor: pointer;
        }

        .offset-editor {
            margin-top: 1em;
            display: grid;
            grid-template-rows: 0fr;
            opacity: 0;
            transition: grid-template-rows 0.3s ease, opacity 0.3s ease;
        }

        .offset-editor > * {
            overflow: hidden;
        }

        .offset-editor.visible {
            grid-template-rows: 1fr;
            opacity: 1;
        }

        .offset-editor-inner {
            padding: 1.5em;
            background: rgba(144, 144, 144, 0.05);
            border-radius: 0.5em;
            border: solid 1px rgba(144, 144, 144, 0.25);
        }

        .offset-editor-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1em;
            padding-bottom: 0.5em;
            border-bottom: solid 1px rgba(144, 144, 144, 0.25);
        }

        .offset-editor-header h3 {
            margin: 0;
            font-size: 1.1em;
            color: #222;
        }

        .offset-editor-header .button {
            font-size: 0.8em;
            padding: 0.5em 1em;
        }

        .offset-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 1em;
        }

        .offset-table th,
        .offset-table td {
            padding: 0.75em;
            text-align: left;
            border-bottom: solid 1px rgba(144, 144, 144, 0.15);
        }

        .offset-table th {
            background: rgba(144, 144, 144, 0.1);
            font-weight: 700;
            color: #222;
            font-size: 0.9em;
        }

        .offset-table td {
            font-family: monospace;
            font-size: 0.85em;
        }

        .offset-table tr:last-child td {
            border-bottom: none;
        }

        .offset-table input[type="text"] {
            width: 100%;
            padding: 0.5em;
            border: solid 1px rgba(144, 144, 144, 0.25);
            border-radius: 0.25em;
            font-family: monospace;
            transition: border-color 0.2s ease, background-color 0.2s ease;
        }

        .offset-table input[type="text"]:focus {
            outline: 2px solid #47cdd9;
            outline-offset: 2px;
            border-color: #47cdd9;
        }

        .offset-table input[type="text"].valid {
            border-color: #51cf66;
            background-color: rgba(81, 207, 102, 0.05);
        }

        .offset-table input[type="text"].error {
            border-color: #ff6b6b;
            background-color: rgba(255, 107, 107, 0.05);
        }

        .offset-table input[type="text"].warning {
            border-color: #ffd43b;
            background-color: rgba(255, 212, 59, 0.05);
        }

        .offset-table .reset-btn {
            padding: 0.4em 0.8em;
            font-size: 0.75em;
            white-space: nowrap;
        }

        .validation-message {
            font-size: 0.75em;
            margin-top: 0.25em;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
        }

        .validation-message.error {
            color: #ff6b6b;
        }

        .validation-message.warning {
            color: #ffd43b;
        }

        .no-files-message {
            text-align: center;
            padding: 2em;
            color: #555;
            font-style: italic;
        }

        select {
            padding: 0.6em;
            border: solid 1px rgba(144, 144, 144, 0.25);
            border-radius: 0.25em;
            font-size: 0.95em;
            background: #fff;
        }

        select:focus {
            outline: 2px solid #47cdd9;
            outline-offset: 2px;
        }

        select:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .download-row {
            display: flex;
            gap: 0.75em;
            align-items: flex-end;
            flex-wrap: wrap;
        }

        .download-row .input-group {
            flex: 1;
            min-width: 200px;
            margin-bottom: 0;
        }

        .download-row .button {
            margin-bottom: 0;
            white-space: nowrap;
            height: fit-content;
        }

        #zip-upload-group {
            margin-top: 1em;
        }

        .download-status {
            margin-top: 0.75em;
            font-size: 0.9em;
            color: #555;
        }

        .download-status.error {
            color: #ff6b6b;
        }

        .download-status.success {
            color: #51cf66;
        }

        .browser-warning {
            padding: 1.5em;
            background: rgba(255, 107, 107, 0.1);
            border: solid 2px rgba(255, 107, 107, 0.4);
            border-radius: 0.5em;
            margin-bottom: 2em;
            color: #cc3333;
            line-height: 1.65em;
        }

        .browser-warning strong {
            display: block;
            font-size: 1.1em;
            margin-bottom: 0.5em;
        }

        .driver-notice {
            padding: 1.5em;
            background: rgba(74, 144, 226, 0.1);
            border: solid 2px rgba(74, 144, 226, 0.4);
            border-radius: 0.5em;
            margin-bottom: 2em;
            color: #2a5d9c;
            line-height: 1.65em;
        }

        .driver-notice strong {
            display: block;
            font-size: 1.1em;
            margin-bottom: 0.5em;
        }

        .driver-notice a {
            color: #2a5d9c;
            font-weight: bold;
        }
