/* Main App Styling Custom Overrides */
      body {
        background-color: #f8fafc;
        color: #1e293b;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
        padding-bottom: 280px;
        transition: padding-bottom 0.3s ease;
      }

      .intro-modal-image {
        width: 50%;
        display: block;
        margin: 0 auto;
        border-radius: 10px;
        border: 1px solid #e2e8f0;
      }

      .intro-media-modal-dialog {
        max-width: 400px;
      }
      body.console-panel-collapsed {
        padding-bottom: 60px;
      }

      /* Premium Card Accents */
      .app-header {
        background: #ffffff;
        border-bottom: 1px solid #e2e8f0;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
      }
      .card-custom {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
        margin-bottom: 1.5rem;
      }
      .card-custom-header {
        font-weight: 600;
        color: #0f172a;
        border-bottom: 1px solid #f1f5f9;
        padding: 1.25rem 1.5rem;
      }

      /* Connection Status badge */
      .status-pill {
        display: inline-flex;
        align-items: center;
        background: #f1f5f9;
        padding: 0.5rem 1rem;
        border-radius: 9999px;
        border: 1px solid #e2e8f0;
        font-size: 0.875rem;
        font-weight: 500;
      }
      #USBStatus {
        width: 16px;
        height: 16px;
        margin-right: 8px;
        object-fit: contain;
      }

      /* Standard scale headers */
      h1 {
        font-size: calc(1.3rem + 1vw);
        font-weight: 700;
        color: #0f172a;
        letter-spacing: -0.025em;
        line-height: 1.25;
      }
      @media (min-width: 1200px) {
        h1 {
          font-size: 2.25rem;
        }
      }

      /* Tree Container Structure */
      .tree-container {
        font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
        padding: 15px;
        background-color: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        margin-top: 10px;
        text-align: left;
      }
      .tree-item {
        margin: 4px 0;
        padding: 2px 0;
        text-align: left;
        line-height: 1.6;
      }
      .tree-line {
        display: inline-block;
        width: 24px;
        text-align: center;
        color: #94a3b8;
        font-family: monospace;
      }
      .tree-folder {
        color: #2563eb;
        font-weight: 600;
      }
      .tree-file {
        color: #334155;
      }
      .tree-value {
        color: #64748b;
        font-size: 0.9em;
      }
      #parsedOutput {
        min-height: 200px;
        max-height: 600px;
        overflow-y: auto;
        margin-top: 10px;
        padding: 1.25rem;
        background-color: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
      }
      #ageVerificationImageContainer img {
        max-width: 100%;
        height: auto;
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
        display: block;
        margin: 0 auto;
      }

      .output-section {
        margin-top: 20px;
      }

      /* Segmented Controller View Modes */
      .view-mode-selector {
        background: #f1f5f9;
        padding: 4px;
        border-radius: 8px;
        display: flex;
        flex-wrap: wrap;
        gap: 2px;
        border: 1px solid #e2e8f0;
      }
      .view-mode-selector .form-check {
        padding-left: 0;
        margin-right: 0;
        flex: 1;
        min-width: 100px;
      }
      .view-mode-selector .form-check-input {
        display: none;
      }
      .view-mode-selector .form-check-label {
        display: block;
        text-align: center;
        padding: 8px 10px;
        border-radius: 6px;
        font-size: 0.875rem;
        font-weight: 500;
        color: #64748b;
        cursor: pointer;
        transition: all 0.2s;
      }
      .view-mode-selector .form-check-input:checked + .form-check-label {
        background: #ffffff;
        color: #0f172a;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
      }

      /* Clean Data Alignments */
      .table td, .table th {
        text-align: left;
        vertical-align: middle;
      }

      /* High-fidelity Digital mDL Card */
      #dl-card-container {
        width: 100%;
        max-width: 540px;
        min-height: 340px;
        height: auto;
        background: linear-gradient(145deg, #fefefe 0%, #f1f5f9 100%);
        border: 1px solid #cbd5e1;
        border-radius: 16px;
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        position: relative;
        overflow: hidden;
        margin: 20px auto;
        font-family: -apple-system, sans-serif;
        padding: 24px;
      }

      /* Advanced subtle holographic pattern */
      #dl-card-container::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-image: 
          radial-gradient(circle at 10% 10%, rgba(37, 99, 235, 0.03) 0%, transparent 60%),
          radial-gradient(circle at 90% 90%, rgba(220, 38, 38, 0.03) 0%, transparent 60%);
        pointer-events: none;
        z-index: 1;
      }

      .dl-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 0 12px 0;
        background: transparent;
        position: relative;
        z-index: 2;
        flex-wrap: nowrap;
      }

      .dl-header-center {
        flex: 1;
        text-align: left;
        width: 100%;
      }

      .dl-title {
        font-family: -apple-system, sans-serif;
        font-size: 18px;
        font-weight: 800;
        color: #1e293b;
        letter-spacing: 1px;
        white-space: nowrap;
      }

      .dl-green-line {
        height: 3px;
        background: linear-gradient(to right, #10b981, #34d399);
        margin: 0 0 16px 0;
        position: relative;
        z-index: 2;
        border-radius: 2px;
      }

      .dl-content {
        display: flex;
        flex-direction: column;
        position: relative;
        z-index: 2;
        height: auto;
      }

      .dl-main-content {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 24px;
        width: 100%;
      }

      .dl-portrait-section {
        flex: 0 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
      }

      .dl-license-data-section {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 6px;
        padding-top: 0;
        min-width: 0;
        overflow: visible;
      }

      .dl-age-verify-section-footer {
        width: 100%;
        margin-top: 16px;
        padding-top: 12px;
        border-top: 1px solid #e2e8f0;
        transition: background-color 0.3s ease, border-color 0.3s ease;
      }

      .dl-age-verify-section-footer.footer-success {
        background-color: #ecfdf5;
        border-color: #a7f3d0;
        border-radius: 8px;
        padding: 12px;
      }

      .dl-age-verify-section-footer.footer-success #dl-age-status-text {
        background-color: transparent;
        border-color: transparent;
        color: #065f46;
      }

      .dl-age-verify-section-footer.footer-success #dl-age-status-display {
        color: #065f46;
      }

      .dl-age-verify-section-footer.footer-failure {
        background-color: #fef2f2;
        border-color: #fca5a5;
        border-radius: 8px;
        padding: 12px;
      }

      .dl-age-verify-section-footer.footer-failure #dl-age-status-text {
        background-color: transparent;
        border-color: transparent;
        color: #991b1b;
      }

      .dl-age-verify-section-footer.footer-failure #dl-age-status-display {
        color: #991b1b;
      }

      .dl-left-section {
        width: 180px;
        margin-right: 0;
        display: flex;
        flex-direction: column;
        gap: 12px;
      }

      .dl-photo-placeholder {
        width: 140px;
        height: 175px;
        background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%);
        border: 1px dashed #94a3b8;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        overflow: hidden;
      }

      .dl-photo-text {
        font-size: 11px;
        color: #475569;
        font-weight: 700;
        text-align: center;
        position: absolute;
        z-index: 1;
        letter-spacing: 1px;
      }

      .dl-photo-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: none;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 2;
      }

      .dl-photo-image.loaded {
        display: block;
      }

      .dl-photo-image.loaded ~ .dl-photo-text {
        display: none;
      }

      .dl-right-section {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding-top: 0;
        min-width: 0;
        overflow: visible;
      }

      .dl-age-verification {
        background-color: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 12px;
        width: 100%;
        box-sizing: border-box;
      }

      .dl-age-verification-header {
        display: flex;
        align-items: center;
        gap: 8px;
        justify-content: flex-start;
      }

      .dl-age-input {
        border: 1px solid #cbd5e1;
        border-radius: 6px;
        text-align: center;
        font-size: 12px;
        padding: 4px 8px;
        width: 60px;
        font-weight: 600;
        background: #ffffff;
      }

      .dl-verify-btn {
        background-color: #2563eb;
        color: white;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        padding: 4px 12px;
        font-size: 12px;
        font-weight: 600;
        transition: background 0.15s;
      }

      .dl-verify-btn:hover {
        background-color: #1d4ed8;
      }

      .dl-verify-btn:disabled {
        background-color: #cbd5e1;
        cursor: not-allowed;
      }

      .dl-age-status {
        min-height: 20px;
        font-size: 12px;
        font-weight: 700;
        margin-top: 8px;
      }

      .dl-age-status.success {
        color: #059669;
      }

      .dl-age-status.failed {
        color: #dc2626;
      }

      .dl-field-row {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        min-height: 20px;
        overflow: visible;
        width: 100%;
      }

      .dl-label {
        font-family: -apple-system, sans-serif;
        font-size: 11px;
        font-weight: 700;
        color: #64748b;
        min-width: 40px;
        text-align: left;
        line-height: 1.6;
      }

      .dl-value {
        font-family: -apple-system, sans-serif;
        font-size: 13px;
        color: #0f172a;
        flex: 1;
        text-align: left;
        white-space: nowrap;
        overflow: visible;
        min-width: 120px;
        word-break: keep-all;
        line-height: 1.4;
      }

      #dl-lastname {
        white-space: nowrap;
        overflow: visible;
        flex-shrink: 0;
        min-width: 150px;
      }

      #dl-exp {
        white-space: nowrap;
        overflow: visible;
        min-width: 100px;
        display: inline-block;
      }

      .dl-number {
        color: #0f172a;
        font-weight: 800;
        font-size: 15px;
        letter-spacing: 0.5px;
      }

      .dl-date, .dl-text {
        color: #1e293b;
        font-weight: 600;
      }

      /* Secure Transaction Receipt visual styles */
      .receipt-card {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 16px;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.05);
        max-width: 440px;
        margin: 20px auto;
        padding: 24px;
        font-family: -apple-system, sans-serif;
        position: relative;
        background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
        background-size: 16px 16px;
      }

      .receipt-status-badge {
        background: #ecfdf5;
        color: #065f46;
        border: 1px solid #a7f3d0;
        font-size: 11px;
        font-weight: 700;
        padding: 3px 10px;
        border-radius: 9999px;
        display: inline-block;
        letter-spacing: 0.5px;
        text-transform: uppercase;
        margin-bottom: 12px;
      }

      .receipt-header {
        text-align: center;
        border-bottom: 2px dashed #cbd5e1;
        padding-bottom: 16px;
        margin-bottom: 20px;
      }

      .receipt-grid {
        display: flex;
        flex-direction: row;
        gap: 20px;
        align-items: flex-start;
      }

      .receipt-portrait {
        width: 100px;
        height: 125px;
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        object-fit: cover;
      }

      .receipt-details {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 8px;
      }

      .receipt-row {
        display: flex;
        justify-content: space-between;
        font-size: 13px;
        border-bottom: 1px solid #f1f5f9;
        padding-bottom: 4px;
      }

      .receipt-row .label {
        color: #64748b;
        font-weight: 600;
      }

      .receipt-row .val {
        color: #0f172a;
        font-weight: 600;
        text-align: right;
      }

      .receipt-footer {
        border-top: 2px dashed #cbd5e1;
        padding-top: 16px;
        margin-top: 20px;
        text-align: center;
        font-size: 11px;
        color: #64748b;
      }

      /* Technical Data Table Design */
      #technicalDataTable {
        width: 100%;
        margin: 0 auto;
        overflow-x: auto;
      }

      .technical-data-table {
        width: 100%;
        table-layout: fixed;
        border-collapse: collapse;
        border: 1px solid #e2e8f0;
        margin: 0 auto;
        font-family: -apple-system, sans-serif;
        font-size: 13px;
        border-radius: 8px;
        overflow: hidden;
      }

      .technical-data-table th:nth-child(1),
      .technical-data-table td:nth-child(1) {
        width: 10%;
      }

      .technical-data-table th:nth-child(2),
      .technical-data-table td:nth-child(2) {
        width: 8%;
      }

      .technical-data-table th:nth-child(3),
      .technical-data-table td:nth-child(3) {
        width: calc(67% * 0.9 / 1.9);
      }

      .technical-data-table th:nth-child(4),
      .technical-data-table td:nth-child(4) {
        width: calc(67% / 1.9);
      }

      .technical-data-table th:nth-child(5),
      .technical-data-table td:nth-child(5) {
        width: 15%;
        min-width: 0;
        box-sizing: border-box;
        word-break: break-word;
        overflow-wrap: anywhere;
      }

      .technical-data-table thead {
        background-color: #f8fafc;
        font-weight: 700;
        color: #0f172a;
        border-bottom: 2px solid #e2e8f0;
      }

      .technical-data-table th {
        border: 1px solid #e2e8f0;
        padding: 12px;
        text-align: center;
      }

      .technical-data-table th:nth-child(4),
      .technical-data-table th:nth-child(5) {
        text-align: left;
      }

      .technical-data-table td {
        border: 1px solid #e2e8f0;
        padding: 12px;
        color: #334155;
      }

      .technical-data-table td:nth-child(1),
      .technical-data-table td:nth-child(2) {
        text-align: center;
        font-weight: 600;
      }

      .technical-data-table td:nth-child(3),
      .technical-data-table td:nth-child(4),
      .technical-data-table td:nth-child(5) {
        text-align: left;
        font-family: SFMono-Regular, Consolas, monospace;
        font-size: 12px;
      }

      .technical-data-table td:nth-child(3) {
        word-break: break-all;
      }

      /* High-contrast OLED style Virtual Display screen - Made off-screen as we use a modal instead */
      .virtual-device-display {
        position: absolute;
        left: -9999px;
        top: -9999px;
        width: 1px;
        height: 1px;
        overflow: hidden;
      }

      /* Realistic security badge detail */
      #dl-card-container::after {
        content: "";
        position: absolute;
        top: 40px;
        right: 40px;
        width: 64px;
        height: 64px;
        background: radial-gradient(circle, rgba(245, 158, 11, 0.1) 0%, transparent 70%);
        border-radius: 50%;
        z-index: 1;
        pointer-events: none;
      }

      /* Sliding fixed drawer console at bottom */
      #deviceResponseConsolePanel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1030;
        background: #0f172a;
        color: #f1f5f9;
        padding: 12px 20px 16px;
        box-shadow: 0 -10px 25px -5px rgba(0, 0, 0, 0.3);
        border-top: 2px solid #334155;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      }

      #deviceResponseConsolePanel.console-collapsed {
        padding: 8px 20px 12px;
      }

      #deviceConsoleToggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        margin: 0 0 12px 0;
        padding: 8px 4px;
        background: transparent;
        border: none;
        border-bottom: 1px solid #334155;
        color: #f1f5f9;
        font-size: 1rem;
        font-weight: 700;
        cursor: pointer;
        text-align: left;
      }

      #deviceConsoleToggle:hover,
      #deviceConsoleToggle:focus {
        color: #cbd5e1;
        outline: none;
      }

      #deviceResponseConsolePanel.console-collapsed #deviceConsoleToggle {
        margin-bottom: 0;
        border-bottom: none;
      }

      #deviceResponseConsolePanel.console-collapsed #deviceResponseConsoleBody {
        display: none;
      }

      #deviceResponseConsolePanel #DeviceDisplay {
        color: #cbd5e1;
        margin-bottom: 8px;
        font-size: 0.9rem;
      }

      #deviceResponseConsolePanel #DeviceDisplay b {
        color: #ffffff;
      }

      #deviceResponseConsolePanel #imagedata {
        margin-bottom: 10px;
      }

      #deviceResponseConsolePanel #LogData {
        background: #020617;
        color: #38bdf8;
        border: 1px solid #334155;
        font-family: SFMono-Regular, Consolas, monospace;
        font-size: 13px;
        border-radius: 8px;
        padding: 12px;
      }

      /* Modern Accordion-style headers */
      .section-trigger-header {
        font-size: 1.1rem;
        font-weight: 600;
        color: #0f172a;
        padding: 12px 16px;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        transition: background 0.15s;
      }
      .section-trigger-header:hover {
        background: #f1f5f9;
      }

