 :root {
     --bg: #e0e5ec;
     --text-main: #31344b;
     --text-dim: #44476a;
     --accent: #1d4ed8;
     /* Updated for WCAG AA Contrast */
     --accent-light: #dbeafe;
     --accent-grad: linear-gradient(135deg, var(--accent), var(--accent));
     --nm-out: 9px 9px 16px #babecc, -9px -9px 16px #ffffff;
     --nm-in: inset 6px 6px 12px #babecc, inset -6px -6px 12px #ffffff;
     --nm-btn: 6px 6px 12px #babecc, -6px -6px 12px #ffffff;
     --border-radius: 18px;
     /* Base squircle radius */
 }

 * {
     box-sizing: border-box;
 }

 body {
     font-family: 'Inter', sans-serif;
     background-color: var(--bg);
     color: var(--text-main);
     min-height: 100vh;
     margin: 0;
     padding: 30px 20px;
     /* Increased padding for mobile shadows */
     overflow-y: auto;
     overflow-x: hidden;
     /* Prevent body horizontal scroll */
 }

 @media (min-width: 768px) {
     body {
         padding: 60px 40px;
     }

     /* More breathing room for desktop */
 }

 .centered-app {
     width: 100%;
     max-width: 700px;
     margin: 0 auto;
     display: flex;
     flex-direction: column;
     gap: 32px;
     /* Slight increase for shadow overlap */
     transition: max-width 0.4s ease;
     position: relative;
     /* Ensure stacking context */
 }

 .app-main-grid {
     width: 100%;
     display: flex;
     flex-direction: column;
     gap: 24px;
 }

 @media (min-width: 1100px) {
     .centered-app {
         max-width: 1100px;
     }

     .app-main-grid {
         flex-direction: row-reverse;
         align-items: flex-start;
     }

     .qr-display {
         flex: 1;
         position: sticky;
         top: 40px;
     }

     .card {
         flex: 1.5;
     }
 }

 .header {
     text-align: center;
     background: var(--bg);
     padding: 40px;
     border-radius: var(--border-radius);
     box-shadow: var(--nm-out);
     position: relative;
 }

 .header h1 {
     font-family: 'Outfit', sans-serif;
     font-size: 2.2rem;
     font-weight: 800;
     text-transform: uppercase;
     margin: 0;
     letter-spacing: -1px;
     color: var(--text-main);
 }

 @media (max-width: 600px) {
     .header {
         padding: 20px 15px;
     }

     .header h1 {
         font-size: 1.8rem;
         letter-spacing: -1px;
     }

     .card {
         padding: 20px 15px;
     }
 }

 .header p {
     font-family: 'Outfit', sans-serif;
     font-size: 0.85rem;
     font-weight: 600;
     text-transform: uppercase;
     color: var(--accent);
     margin-top: 12px;
     letter-spacing: 2px;
 }

 .card {
     background: var(--bg);
     border-radius: var(--border-radius);
     padding: 30px 30px 40px 30px;
     box-shadow: var(--nm-out);
     display: flex;
     flex-direction: column;
     gap: 24px;
 }

 .qr-display {
     background: var(--accent-light);
     padding: 20px;
     display: flex;
     flex-direction: column;
     align-items: center;
     gap: 24px;
     border-radius: var(--border-radius);
     box-shadow: var(--nm-out);
     width: 100%;
     box-sizing: border-box;
 }

 @media (max-width: 600px) {
     .qr-display {
         padding: 15px;
         gap: 20px;
     }
 }

 @media (min-width: 1100px) {
     .qr-display {
         position: sticky;
         top: 40px;
     }
 }

 .qr-shadow-box {
     background: #fff;
     padding: 10px;
     border-radius: 12px;
     box-shadow: 6px 6px 12px #babecc, -6px -6px 12px #ffffff;
     display: flex;
     align-items: center;
     justify-content: center;
     width: fit-content;
     max-width: 100%;
     box-sizing: border-box;
 }

 @media (min-width: 768px) {
     .qr-shadow-box {
         padding: 24px;
         box-shadow: 12px 12px 24px #babecc, -12px -12px 24px #ffffff;
     }
 }

 #qrcode canvas,
 #qrcode img {
     max-width: 100% !important;
     height: auto !important;
 }

 .input-group {
     display: flex;
     flex-direction: column;
     gap: 10px;
 }

 label {
     font-family: 'Outfit', sans-serif;
     font-size: 0.75rem;
     font-weight: 800;
     text-transform: uppercase;
     letter-spacing: 0.5px;
     color: var(--text-dim);
     margin-bottom: 4px;
     display: flex;
     justify-content: space-between;
 }

 label span {
     color: var(--accent);
     font-family: monospace;
     font-size: 0.8rem;
 }

 .footer {
     position: fixed;
     bottom: 20px;
     right: 20px;
     background: var(--bg);
     border-radius: 16px;
     box-shadow: var(--nm-btn);
     padding: 12px 18px;
     display: flex;
     align-items: center;
     gap: 12px;
     z-index: 1000;
     color: var(--text-dim);
     font-size: 0.65rem;
     font-weight: 950;
     text-transform: uppercase;
     letter-spacing: 0.05em;
     text-decoration: none;
     transition: all 0.2s ease;
     border: none;
     cursor: pointer;
 }

 .footer:hover {
     box-shadow: 2px 2px 5px #babecc, -2px -2px 5px #ffffff;
     transform: translateY(-1px);
 }

 .footer:active {
     box-shadow: var(--nm-in);
     transform: translateY(1px);
 }

 .footer img {
     height: 24px;
     object-fit: contain;
 }

 @media (max-width: 600px) {
     .footer {
         position: relative;
         bottom: auto;
         right: auto;
         margin: 40px auto 20px;
         width: fit-content;
     }
 }

 input[type="text"],
 input[type="number"] {
     background: var(--bg);
     border: none;
     padding: 16px 20px;
     border-radius: 16px;
     font-family: inherit;
     font-size: 1rem;
     color: var(--text-main);
     box-shadow: var(--nm-in);
     width: 100%;
     outline: none;
     transition: all 0.3s ease;
 }

 input[type="text"]:focus {
     box-shadow: inset 2px 2px 5px #babecc, inset -5px -5px 10px #ffffff;
 }

 .settings-grid {
     display: grid;
     grid-template-columns: 1fr 1fr;
     gap: 20px;
 }

 @media (max-width: 600px) {
     .settings-grid {
         grid-template-columns: 1fr;
     }
 }

 .controls-row {
     display: flex;
     gap: 15px;
     align-items: center;
 }

 .controls-row.grid-half>* {
     flex: 1;
 }

 .controls-row.grid-large-small> :first-child {
     flex: 2;
 }

 .controls-row.grid-large-small> :last-child {
     flex: 1;
 }

 .color-swatch-box {
     position: relative;
     height: 52px;
     border-radius: 16px;
     /* Squircle shape */
     display: flex;
     align-items: center;
     justify-content: center;
     box-shadow: var(--nm-btn);
     cursor: pointer;
     transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
     overflow: hidden;
 }

 .color-swatch-box,
 .check-box-wall {
     height: 52px !important;
     box-sizing: border-box !important;
     border: 4px solid var(--bg) !important;
     margin: 0 !important;
     display: flex !important;
     align-items: center !important;
 }

 .color-swatch-box:hover {
     transform: translateY(-2px);
     box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
 }

 .color-swatch-box:active {
     box-shadow: var(--nm-in);
     transform: translateY(1px);
 }

 .color-swatch-box input[type="color"] {
     position: absolute;
     inset: 0;
     width: 100%;
     height: 100%;
     border: none;
     padding: 0;
     cursor: pointer;
     opacity: 0;
     z-index: 1;
 }

 .color-swatch-box span {
     position: relative;
     z-index: 2;
     font-size: 0.85rem;
     font-weight: 950;
     font-family: monospace;
     pointer-events: none;
     mix-blend-mode: difference;
     color: #fff;
     letter-spacing: 1px;
 }

 .carousel {
     display: flex;
     gap: 24px;
     /* Increased gap for shadow breathing room */
     overflow-x: auto;
     padding: 24px;
     /* Increased padding to prevent clipping */
     margin: -24px;
     /* Offset padding to maintain visual alignment */
     scrollbar-width: none;
 }

 .carousel::-webkit-scrollbar {
     display: none;
 }

 .option-box {
     flex-shrink: 0;
     width: 64px;
     height: 64px;
     background: var(--bg);
     border: none;
     border-radius: 20px;
     /* Squircle shape */
     display: flex;
     align-items: center;
     justify-content: center;
     cursor: pointer;
     box-shadow: var(--nm-btn);
     transition: all 0.2s ease;
     color: var(--text-main);
 }

 .option-box:hover {
     box-shadow: 2px 2px 5px #babecc, -2px -2px 5px #ffffff;
     transform: translateY(-1px);
 }

 .option-box.active {
     background: var(--accent);
     color: #fff;
     box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.2);
     transform: translateY(1px);
 }

 .option-box svg {
     width: 32px;
     height: 32px;
     stroke-width: 3;
 }

 .file-drop {
     background: var(--bg);
     border: none;
     border-radius: 16px;
     /* Squircle shape */
     height: 52px;
     /* Standardize height */
     display: flex;
     align-items: center;
     justify-content: center;
     cursor: pointer;
     box-shadow: var(--nm-btn);
     font-weight: 950;
     text-transform: uppercase;
     font-size: 0.8rem;
     transition: all 0.2s ease;
     color: var(--text-main);
 }

 .file-drop:hover {
     box-shadow: 2px 2px 5px #babecc, -2px -2px 5px #ffffff;
     transform: translateY(-1px);
 }

 .file-drop:active {
     box-shadow: var(--nm-in);
     transform: translateY(1px);
 }

 .btn {
     border: none;
     padding: 20px 30px;
     font-size: 1rem;
     font-weight: 700;
     text-transform: uppercase;
     cursor: pointer;
     border-radius: 20px;
     /* Squircle shape */
     transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
     display: flex;
     align-items: center;
     justify-content: center;
     gap: 12px;
     box-shadow: var(--nm-btn);
     outline: none;
     position: relative;
     overflow: hidden;
 }

 .btn:hover {
     box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08), 5px 5px 10px #babecc, -5px -5px 10px #ffffff;
     transform: translateY(-2px);
 }

 .btn:active {
     background: var(--accent);
     color: #fff;
     box-shadow: var(--nm-in);
     transform: translateY(1px);
 }

 .btn-primary {
     background: var(--accent-grad);
     color: #fff;
     font-weight: 800;
     border-radius: 16px;
     /* Keep download button at original border-radius */
     box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1), 5px 5px 10px #babecc, -5px -5px 10px #ffffff;
 }

 .btn-primary:hover {
     box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15), 5px 5px 10px #babecc, -5px -5px 10px #ffffff;
 }

 .btn-primary:active {
     background: var(--accent);
     box-shadow: var(--nm-in);
 }

 .check-box-wall {
     display: flex !important;
     align-items: center;
     justify-content: flex-start;
     flex-direction: row !important;
     background: var(--bg);
     border-radius: 16px;
     /* Squircle shape */
     height: 52px;
     box-shadow: var(--nm-btn);
     box-sizing: border-box;
     border: 4px solid var(--bg);
     /* Match color-swatch frame */
     padding: 0 16px;
     margin: 0;
     cursor: pointer;
     transition: all 0.2s ease;
     gap: 12px;
     user-select: none;
 }

 .check-box-wall:hover {
     transform: translateY(-1px);
     box-shadow: 2px 2px 5px #babecc, -2px -2px 5px #ffffff;
 }

 .check-box-wall:active {
     box-shadow: var(--nm-in);
     transform: translateY(1px);
 }

 .check-box-wall input[type="checkbox"] {
     width: 22px;
     height: 22px;
     cursor: pointer;
     accent-color: var(--accent);
     margin: 0;
     flex-shrink: 0;
 }

 input[type="range"] {
     -webkit-appearance: none;
     appearance: none;
     width: 100%;
     height: 12px;
     background: var(--bg);
     border-radius: 6px;
     box-shadow: var(--nm-in);
     outline: none;
     cursor: pointer;
 }

 input[type="range"]::-webkit-slider-thumb {
     -webkit-appearance: none;
     width: 28px;
     height: 28px;
     background: var(--bg);
     border-radius: 50%;
     cursor: pointer;
     box-shadow: 4px 4px 8px #babecc, -4px -4px 8px #ffffff;
     border: 2px solid var(--accent);
     transition: all 0.2s ease;
 }

 input[type="range"]::-webkit-slider-thumb:hover {
     box-shadow: 2px 2px 4px #babecc, -2px -2px 4px #ffffff;
     transform: scale(1.05);
 }

 .qr-wrapper.generating {
     animation: pulse 1.5s infinite ease-in-out;
 }

 @keyframes pulse {
     0% {
         transform: scale(1);
         box-shadow: var(--nm-out);
     }

     50% {
         transform: scale(1.02);
         box-shadow: 12px 12px 24px #babecc, -12px -12px 24px #ffffff;
     }

     100% {
         transform: scale(1);
         box-shadow: var(--nm-out);
     }
 }

 @media (max-width: 1000px) {
     body {
         overflow-y: auto;
     }

     .preview-area {
         height: auto;
         min-height: 600px;
         padding: 40px 20px;
         gap: 30px;
     }

     .qr-wrapper {
         width: 320px;
         height: 320px;
         box-shadow: var(--nm-out);
         border-radius: var(--border-radius);
     }
 }

 .custom-eye-settings {
     border-top: 1px solid var(--glass-border);
     padding-top: 20px;
     display: grid;
     grid-template-columns: 1fr 1fr;
     gap: 15px;
 }

 /* Utility Classes */
 .w-full {
     width: 100%;
 }

 .grid-half {
     grid-template-columns: 1fr 1fr;
 }

 .grid-large-small {
     grid-template-columns: 2fr 1fr;
 }

 .hidden-v {
     visibility: hidden;
 }

 .divider-nm {
     border: none;
     height: 2px;
     margin: 24px 0;
     background: var(--bg);
     box-shadow: inset 1px 1px 2px #babecc, inset -1px -1px 2px #ffffff;
 }

 .btn-reset {
     position: absolute;
     top: 20px;
     right: 20px;
     width: 40px;
     height: 40px;
     border: none;
     background: var(--bg);
     border-radius: 50%;
     display: flex;
     align-items: center;
     justify-content: center;
     cursor: pointer;
     box-shadow: var(--nm-btn);
     color: var(--text-dim);
     transition: all 0.2s ease;
 }

 .btn-reset:hover {
     color: var(--accent);
     transform: rotate(-45deg);
 }

 .btn-reset svg {
     width: 20px;
     height: 20px;
 }

 :focus-visible {
     outline: 2px solid var(--accent);
     outline-offset: 4px;
 }

 #logo-settings-details {
     transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
     overflow: hidden;
     padding-bottom: 24px;
 }

 /* Add a quick fade for the preview when generating */
 @keyframes pulse {
     0% {
         transform: scale(1);
         box-shadow: 0 60px 120px -20px rgba(0, 0, 0, 0.6);
     }

     50% {
         transform: scale(1.02);
         box-shadow: 0 80px 140px -10px rgba(99, 102, 241, 0.2);
     }

     100% {
         transform: scale(1);
         box-shadow: 0 60px 120px -20px rgba(0, 0, 0, 0.6);
     }
 }

 .qr-wrapper.generating {
     animation: pulse 2s infinite ease-in-out;
     opacity: 0.8 !important;
 }

 .input-group label {
     display: flex;
     align-items: center;
     gap: 8px;
     margin-bottom: 8px;
     color: var(--text-dim);
     font-size: 0.75rem;
     font-weight: 700;
 }

 .input-group label span {
     color: var(--accent);
     font-family: monospace;
 }