/* Critical CSS - Inline in <head> for fast initial render */
[x-cloak] { display: none !important; }

/* Brand fonts (DM Sans variable + DM Mono), self-hosted from /fonts/ so
   nothing render-blocking is added: these @font-face rules ride the inlined
   critical.css, files load same-origin with font-display swap, and the
   unicode-ranges mean non-Latin locales never fetch them at all. */
/* latin-ext */
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/dmmono-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/dmmono-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/dmmono-500-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'DM Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/dmmono-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url(/fonts/dmsans-100-1000-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url(/fonts/dmsans-100-1000-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


/* Hide elements with x-cloak until Alpine is ready */
[x-cloak] {
    display: none !important;
}

/* Tailwind base resets for critical elements */
*, ::before, ::after {
  box-sizing: border-box;
  border-width: 0;
  border-style: solid;
  border-color: #e5e7eb;
}

body {
  margin: 0;
  line-height: inherit;
  font-family: 'DM Sans', system-ui, Arial, Helvetica, sans-serif;
}

h1 {
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
}

p {
  margin: 0;
}

button {
  font-family: inherit;
  font-size: 100%;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
  background-color: transparent;
  background-image: none;
  cursor: pointer;
  border: 0;
}

a {
  color: #1e3a8a; /* Default link color with good contrast */
  text-decoration: underline;
}

a:hover {
  color: #1e40af;
}

/* Critical utility classes for above-the-fold content */
.font-manrope { font-family: 'DM Sans', system-ui, Arial, Helvetica, sans-serif; }
.pb-4 { padding-bottom: 1rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.my-8 { margin-top: 2rem; margin-bottom: 2rem; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.font-extrabold { font-weight: 800; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-blue-900 { color: rgb(30 58 138); }
.text-gray-900 { color: rgb(17 24 39); }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.max-w-\[640px\] { max-width: 640px; }
.block { display: block; }
/* Button geometry mirrors the paid site's CTAs (rounded-lg/xl, semibold/bold,
   roomier padding); accent stays the free blue until the branding pass. */
.btn { display: inline-block; font-weight: 600; text-align: center; vertical-align: middle; user-select: none; padding: 0.625rem 1.375rem; font-size: 0.9375rem; line-height: 1.4; border-radius: 0.625rem; transition: background-color 0.15s, color 0.15s, border-color 0.15s; }
.btn-primary { color: #fff; background-color: #1e3a8a; border-color: #1e3a8a; font-weight: 700; }
.btn-primary:hover { background-color: #1e40af; border-color: #1e40af; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.rounded-lg { border-radius: 0.5rem; }
.bg-blue-900 { background-color: rgb(30 58 138); }
.flex { display: flex; }
.flex-row { flex-direction: row; }
.my-16 { margin-top: 4rem; margin-bottom: 4rem; }
.mb-3 { margin-bottom: 0.75rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.bg-blue-50 { background-color: rgb(239 246 255); }
.border { border-width: 1px; }
.border-blue-200 { border-color: rgb(191 219 254); }
.text-blue-700 { color: rgb(29 78 216); }
.font-semibold { font-weight: 600; }
.underline { text-decoration-line: underline; }
.d-flex { display: flex; }
.justify-content-center { justify-content: center; }
.justify-content-md-end { justify-content: flex-end; }
.align-items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.mb-0 { margin-bottom: 0; }
.form-select {
  display: block;
  width: 100%;
  padding: 0.375rem 2.5rem 0.375rem 0.75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #212529;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 16px 12px;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}
.form-select-sm {
  padding: 0.25rem 2rem 0.25rem 0.5rem;
  font-size: 0.875rem;
  background-position: right 0.35rem center;
  background-size: 14px 10px;
}
.text-secondary { color: #6c757d; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.fixed { position: fixed; }
.left-0 { left: 0; }
.bottom-0 { bottom: 0; }
.p-4 { padding: 1rem; }
.bg-white { background-color: #fff; }
.text-gray-text { color: #6b7280; }
.flex-col { flex-direction: column; }
.min-h-\\[300px\\] { min-height: 300px; }
.min-h-\\[550px\\] { min-height: 550px; }
.box-border { box-sizing: border-box; }
.border-gray-border { border-color: #e5e7eb; }
.bg-gray-light { background-color: #f9fafb; }
.rounded-3xl { border-radius: 1.5rem; }
.relative { position: relative; }
.z-50 { z-index: 50; }

/* Custom styles from index.css */
video {
    width: 100%;
    height: 100%;
    object-fit: fill;
}

#loading {
    width: 100%;
}

#download-link {
    position: relative;
    margin: auto;
    width: 100%;
    display: flex;
}

/* Bootstrap button styles */
.btn-outline-primary {
    color: #1e3a8a;
    border: 1px solid rgba(30, 58, 138, 0.35);
    background-color: transparent;
    cursor: pointer;
}
/* Paid-style soft-tint hover instead of the old solid fill */
.btn-outline-primary:hover {
    color: #1e3a8a;
    background-color: #eff6ff;
    border-color: #1e3a8a;
}
.btn-check {
    position: absolute;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}
.btn-check:checked + .btn-outline-primary {
    color: #fff;
    background-color: #1e3a8a;
    border-color: #1e3a8a;
}

/* Progress bar */
.progress {
    display: flex;
    height: 1rem;
    overflow: hidden;
    font-size: 0.75rem;
    background-color: #e9ecef;
    border-radius: 0.25rem;
}
.progress-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    background-color: #1e3a8a;
    /* Removed transition for better INP performance */
}
.progress-bar-striped {
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
}
.progress-bar-animated {
    /* Removed animation for better INP performance */
}
/* Keyframes kept for backwards compatibility but not used */
@keyframes progress-bar-stripes {
    0% { background-position: 1rem 0; }
    100% { background-position: 0 0; }
}

/* Additional layout utilities */
.text-gray-600 { color: #4b5563; }
.text-yellow-900 { color: #78350f; }
.bg-yellow-50 { background-color: #fefce8; }
.border-yellow-200 { border-color: #fef08a; }
.text-primary { color: #1e3a8a; }
.no-underline { text-decoration: none; }
.text-inherit {
  color: inherit !important;
  text-decoration: inherit !important;
}
.cursor-text { cursor: text; }
.cursor-pointer { cursor: pointer; }
.hover\:text-primary:hover { color: #1e3a8a; }
.h-4 { height: 1rem; }
.w-4 { height: 1rem; }
.w-48 { width: 12rem; }
.h-48 { height: 12rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }
.transition-colors { transition-property: color, background-color, border-color; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.hover\:bg-blue-100:hover { background-color: #dbeafe; }
.hover\:text-blue-600:hover { color: #2563eb; }
.hover\:text-blue-700:hover { color: #1d4ed8; }
.hover\:underline:hover { text-decoration-line: underline; }
.text-blue-400 { color: #60a5fa; }
.text-blue-600 { color: #2563eb; }
.text-blue-900 { color: rgb(30 58 138); }
.p-1 { padding: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.my-2 { margin-top: 0.5rem; margin-bottom: 0.5rem; }
.my-3 { margin-top: 0.75rem; margin-bottom: 0.75rem; }
.my-5 { margin-top: 1.25rem; margin-bottom: 1.25rem; }
.rounded { border-radius: 0.25rem; }
.rounded-2xl { border-radius: 1rem; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.font-medium { font-weight: 500; }
.font-mono { font-family: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
.bg-gray-200 { background-color: #e5e7eb; }
.bg-black { background-color: #000; }
.bg-opacity-70 { background-color: rgba(0, 0, 0, 0.7); }
.text-white { color: #fff; }
.inline-block { display: inline-block; }
.pointer-events-none { pointer-events: none; }
.absolute { position: absolute; }
.z-10 { z-index: 10; }
.h-fit { height: fit-content; }
.w-fit { width: fit-content; }
.justify-center { justify-content: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.hidden { display: none; }

/* Image compare viewer styles */
.icv{position:relative;overflow:hidden;cursor:row-resize}.icv__icv--vertical{cursor:row-resize}.icv__icv--horizontal{cursor:col-resize}.icv__img{pointer-events:none;-o-user-select:none;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;max-width:none;width:100%;margin:0 !important;padding:0 !important;border:0 !important;border-radius:0 !important;top:0;display:block}.icv__is--fluid .icv__img{display:none}.icv__img-a{height:auto;position:static;z-index:1;left:0px}.icv__img-b{height:100%;position:absolute;z-index:2;left:auto;right:0px;width:auto}.icv__icv--vertical .icv__img-b{width:100%;height:auto}.icv__imposter{z-index:4;position:absolute;top:0px;left:0px;width:100%;height:100%}.icv__wrapper{position:absolute;width:100%;height:100%;right:0px;top:0px;overflow:hidden;background-size:cover;background-position:center center;z-index:3}.icv__is--fluid .icv__wrapper,.icv__icv--vertical .icv__wrapper{width:100% !important}.icv__is--fluid .icv__wrapper,.icv__icv--horizontal .icv__wrapper{height:100% !important}.icv__fluidwrapper{background-size:cover;background-position:center;position:absolute;top:0;left:0;width:100%;height:100%}.icv__control{position:absolute;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;height:100%;top:0px;z-index:5}.icv__icv--vertical .icv__control{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;left:0;width:100%}.icv__control-line{height:50%;width:2px;z-index:6}.icv__icv--vertical .icv__control-line{width:50%}.icv__theme-wrapper{width:100%;height:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:absolute;-webkit-transition:all 0.1s ease-out 0s;transition:all 0.1s ease-out 0s;z-index:5}.icv__icv--vertical .icv__theme-wrapper{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.icv__arrow-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-transition:all 0.1s ease-out 0s;transition:all 0.1s ease-out 0s}.icv__arrow-a{-webkit-transform:scale(1.5) rotateZ(180deg);transform:scale(1.5) rotateZ(180deg);height:20px;width:20px;-webkit-filter:drop-shadow(0px 3px 5px rgba(0,0,0,0.33));filter:drop-shadow(0px -3px 5px rgba(0,0,0,0.33))}.icv__arrow-b{-webkit-transform:scale(1.5) rotateZ(0deg);transform:scale(1.5) rotateZ(0deg);height:20px;width:20px;-webkit-filter:drop-shadow(0px 3px 5px rgba(0,0,0,0.33));filter:drop-shadow(0px 3px 5px rgba(0,0,0,0.33))}.icv__circle{width:50px;height:50px;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-negative:0;flex-shrink:0;border-radius:999px}.icv__label{position:absolute;bottom:1rem;z-index:12;background:rgba(0,0,0,0.33);color:white;border-radius:3px;padding:0.5rem 0.75rem;font-size:0.85rem;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.icv__label.vertical{bottom:auto;left:1rem}.icv__label.on-hover{-webkit-transform:scale(0);transform:scale(0);-webkit-transition:0.25s cubic-bezier(0.68, 0.26, 0.58, 1.22);transition:0.25s cubic-bezier(0.68, 0.26, 0.58, 1.22)}.icv:hover .icv__label.on-hover{-webkit-transform:scale(1);transform:scale(1)}.icv__label-before{left:1rem}.icv__label-after{right:1rem}.icv__label-before.vertical{top:1rem}.icv__label-after.vertical{bottom:1rem;right:auto}.icv__body{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}

/* Inline spinner animation */
.inline-spinner {
  animation: spin 0.8s linear infinite;
}

/* Brand knob on the comparison-slider divider (see src/brand-knob.js).
   The lib's default arrows are hidden in favor of the squircle logo mark. */
.icv__arrow-wrapper { display: none; }
.brand-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.6));
  z-index: 7;
  pointer-events: none;
}
.brand-knob svg { display: block; }
.brand-knob-blk {
  transform-box: fill-box;
  transform-origin: left bottom;
  animation: brand-knob-pop 2.8s ease-in-out infinite;
}
@keyframes brand-knob-pop {
  0% { opacity: 0; transform: scale(0.35); }
  16% { opacity: 1; }
  42% { transform: scale(1); }
  78% { opacity: 1; transform: scale(1); }
  90% { opacity: 0; transform: scale(0.35); }
  100% { opacity: 0; transform: scale(0.35); }
}
@media (prefers-reduced-motion: reduce) {
  .brand-knob-blk { animation: none; }
}

/* Standard ring spinner (replaces the old loading.svg blobs) */
.ring-spinner {
  width: 48px;
  height: 48px;
  flex: none;
  border: 4px solid rgba(30, 58, 138, 0.15);
  border-top-color: #1e3a8a;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.gap-1 { gap: 0.25rem; }

/* Disabled button state */
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.opacity-50 { opacity: 0.5; }
.opacity-60 { opacity: 0.6; }
.cursor-not-allowed { cursor: not-allowed; }

/* Survey option grids: 2 columns on mobile, more at the sm breakpoint */
@media (min-width: 640px) {
  .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sm\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* Responsive utilities for critical content */
@media (min-width: 768px) {
  .md\:text-6xl { font-size: 3.75rem; line-height: 1; }
  .md\:my-12 { margin-top: 3rem; margin-bottom: 3rem; }
  .md\:text-xl { font-size: 1.25rem; line-height: 1.75rem; }
  .md\:my-16 { margin-top: 4rem; margin-bottom: 4rem; }
  .md\:h-\\[360px\\] { height: 360px; }
  .md\:h-\\[680px\\] { height: 680px; }
  .md\:p-6 { padding: 1.5rem; }
  .md\:text-sm { font-size: 0.875rem; line-height: 1.25rem; }
  .md\:text-base { font-size: 1rem; line-height: 1.5rem; }
  .md\:text-2xl { font-size: 1.5rem; line-height: 2rem; }
  .md\:w-64 { width: 16rem; }
  .md\:h-64 { height: 16rem; }
  .md\:flex-row { flex-direction: row; }
  .md\:justify-between { justify-content: space-between; }
  .md\:items-center { align-items: center; }
  .md\:text-left { text-align: left; }
  .md\:text-right { text-align: right; }
  .md\:block { display: block; }
}

/* Help-icon tooltip — instant show, no JS. Markup: <span class="tooltip-trigger" data-tooltip="...">?</span> */
.tooltip-trigger {
    position: relative;
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 50%;
    background: #d1d5db;
    color: #374151;
    font-size: 11px;
    font-weight: 700;
    cursor: help;
    margin-left: 4px;
    vertical-align: middle;
}

.tooltip-trigger::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: normal;
    width: max-content;
    max-width: 260px;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}

.tooltip-trigger:hover::after {
    opacity: 1;
    visibility: visible;
}



    @media (min-width: 768px) {
        #start-panel.split-layout {
            max-width: 880px;
            height: auto;
            min-height: 0;
            display: grid;
            grid-template-columns: minmax(0, 1fr) 340px;
            column-gap: 24px;
            /* stretch (not start) so the controls column is as tall as the
               media column — the space-between below has nothing to
               distribute otherwise. */
            align-items: stretch;
        }
        /* Spread the CTA / settings / start button down the full height of the
           column rather than bunching them at the top. #panel-controls only
           ever holds #preview, so the distribution has to happen one level
           down, on #preview's own children. */
        #start-panel.split-layout #panel-controls {
            display: flex;
            flex-direction: column;
        }
        #start-panel.split-layout #preview {
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            /* Lifts the start button off the bottom edge. space-between lays
               items out in the content box, so padding here does the job of a
               spacer element — no empty div needed (box-sizing is border-box
               globally, so this shrinks the box rather than overflowing it). */
            padding-bottom: 16px;
        }
        /* Let the flex gaps be the only vertical spacing, so they come out
           even — the children carry their own my-2 / mb-3 otherwise.
           order:4 is the fallback, so the bare <div> spacer after the start
           button sorts to the bottom and holds a gap open under it. */
        #start-panel.split-layout #preview > * {
            margin-top: 0;
            margin-bottom: 0;
            order: 4;
        }
        /* Column order: settings, CTA, start button, spacer. Visual only —
           DOM order (and so tab order) is unchanged, so a keyboard user still
           reaches the CTA link before the settings controls. */
        #start-panel.split-layout #preview > .output-box { order: 1; }
        #start-panel.split-layout #preview > p           { order: 2; }
        #start-panel.split-layout #preview > .btn        { order: 3; }
        /* Settings read better stacked in a 340px column than in the wide
           label-left / control-right rows the full-width layout uses. */
        #start-panel.split-layout .output-box-row,
        #start-panel.split-layout .output-box-row-split {
            flex-direction: column;
            align-items: flex-start;
            gap: 6px;
        }
        #start-panel.split-layout .output-box { margin-top: 0; }
        /* Strip sits directly under the preview, so it matches its width
           (--preview-width is published by applyFrameSize in patch-preview.js)
           rather than the wider column. The chips then divide that width
           between them — 2 to 5 of them, depending on how many sampled frames
           were non-black — instead of overflowing into a scroll at a fixed
           104px each. max-width keeps 2-3 chips from ballooning. */
        #start-panel.split-layout .frame-strip {
            justify-content: flex-start;
            max-width: var(--preview-width, 400px);
            overflow-x: visible;
            /* auto centres the strip on the preview above it, which is itself
               centred in the column (#patch-preview-outer is margin: 0 auto) —
               without this the strip is pinned left and sits off-axis. */
            margin: 10px auto;
        }
        /* 4:3 rather than the stacked layout's 16:9 — at ~72px wide a 16:9 chip
           is only 42px tall and the timestamp pill covers most of it. Squarer
           chips also crop less of the frame than a full 1:1 would. */
        #start-panel.split-layout .frame-chip {
            flex: 1 1 0;
            min-width: 0;
            max-width: 80px;
            aspect-ratio: 4 / 3;
        }
        /* The start button keeps its own `mx-auto w-fit` — sized to its label
           and centred in the column. Don't stretch it to width:100%: the
           button is display:flex, so a stretched box leaves the label hard
           against the left edge. */
    }



            /* Same edge treatment as the patch preview (patch-preview.njk) —
               pale content would otherwise bleed into the near-white panel.
               box-shadow, not border: the ImageCompare slider measures this
               box, and a border would shift the handle. */
            #image-compare {
                box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.10),
                            0 2px 8px rgba(15, 23, 42, 0.07);
            }
            .fs-icon-btn {
                position: absolute;
                top: 12px;
                right: 12px;
                z-index: 20;
                width: 36px;
                height: 36px;
                padding: 0;
                border: none;
                border-radius: 10px;
                background: rgba(0, 0, 0, 0.55);
                display: flex;
                align-items: center;
                justify-content: center;
                cursor: pointer;
                transition: background-color 0.15s;
            }
            .fs-icon-btn:hover { background: rgba(0, 0, 0, 0.78); }
            .fs-icon-btn img { filter: brightness(0) invert(1); display: block; }
            /* Mobile fullscreen exit, shared by the canvas and video sliders.
               Same class-not-inline reason as .fs-icon-btn above. */
            .fs-exit-btn {
                position: absolute;
                top: 12px;
                right: 12px;
                z-index: 20;
                width: 36px;
                height: 36px;
                padding: 0;
                border: none;
                border-radius: 50%;
                background: rgba(0, 0, 0, 0.6);
                display: flex;
                align-items: center;
                justify-content: center;
                cursor: pointer;
                transition: background-color 0.15s;
            }
            .fs-exit-btn:hover { background: rgba(0, 0, 0, 0.8); }
            /* Play/pause pill: same treatment as .fs-icon-btn, mirrored to the
               left edge. `color` drives the icons, which are fill:currentColor. */
            .video-play-btn { left: 12px; right: auto; color: #fff; }
        


    #patch-preview-frame { position: relative; margin: 0 auto; }
    /* The panel background is near-white, so pale video content bleeds into it
       and the preview loses its edges. A hairline ring plus a soft drop shadow
       separates it. Deliberately box-shadow and not a border: the canvases are
       sized to outW/outH and the ImageCompare slider measures this box, so a
       border would shift both. Shadows don't affect layout at all. */
    #patch-preview-compare {
        position: relative;
        box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.10),
                    0 2px 8px rgba(15, 23, 42, 0.07);
    }
    /* Desktop layout is handled by the ImageCompare lib (same as the legacy
       preview). Mobile has no lib — size the canvases directly. */
    @media (max-width: 767px) {
        #patch-preview-compare canvas { display: block; width: 100%; height: auto; }
    }
    .patch-badge {
        position: absolute;
        top: 12px;
        padding: 4px 10px;
        border-radius: 7px;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.04em;
        z-index: 30;
        pointer-events: none;
        white-space: nowrap;
    }
    .patch-badge-src { left: 12px; background: rgba(10, 12, 14, 0.72); color: #cfd4da; }
    .patch-badge-out { right: 12px; background: #1e3a8a; color: #fff; }
    #patch-minimap-wrap {
        position: absolute;
        bottom: -6px;
        left: 0;
        z-index: 10;
        border: 2px solid #fff;
        background: #000;
        cursor: crosshair;
        line-height: 0;
    }
    #patch-viewport-box {
        position: absolute;
        left: 0;
        top: 0;
        border: 2px solid #4a9eff;
        background: rgba(74, 158, 255, 0.2);
        pointer-events: none;
    }
    #patch-spinner {
        position: absolute;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0, 0, 0, 0.55);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 20;
        border-radius: 8px;
    }
    #patch-tap-hint {
        position: absolute;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        padding: 4px 12px;
        border-radius: 100px;
        background: rgba(0, 0, 0, 0.6);
        color: #fff;
        font-size: 12px;
        font-weight: 600;
        white-space: nowrap;
        pointer-events: none;
        z-index: 15;
    }



            .frame-strip {
                display: flex;
                gap: 8px;
                justify-content: center;
                overflow-x: auto;
                padding: 4px 2px;
                margin: 0 0 14px;
            }
            .frame-chip {
                position: relative;
                flex: none;
                width: 104px;
                aspect-ratio: 16 / 9;
                border-radius: 10px;
                overflow: hidden;
                padding: 0;
                border: 1px solid #e5e7eb;
                background: #05070a;
                cursor: pointer;
                transition: border-color 0.15s;
            }
            .frame-chip:hover { border-color: #93c5fd; }
            .frame-chip.active { border: 2px solid #1e3a8a; }
            .frame-chip:disabled { opacity: 0.5; cursor: not-allowed; }
            .frame-chip img {
                position: absolute;
                inset: 0;
                width: 100%;
                height: 100%;
                object-fit: cover;
                display: block;
            }
            .frame-chip-time {
                position: absolute;
                bottom: 4px;
                left: 4px;
                padding: 2px 6px;
                background: rgba(10, 12, 14, 0.8);
                border-radius: 5px;
                font-size: 10px;
                font-weight: 700;
                font-family: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
                color: #fff;
                line-height: 1;
                pointer-events: none;
            }
            .frame-chip-check {
                position: absolute;
                top: 4px;
                right: 4px;
                width: 16px;
                height: 16px;
                border-radius: 50%;
                background: #1e3a8a;
                color: #fff;
                font-size: 9px;
                font-weight: 700;
                display: flex;
                align-items: center;
                justify-content: center;
                pointer-events: none;
            }
        


            .output-box {
                background: #eff1f4;
                border: 1px solid rgba(0, 0, 0, 0.06);
                border-radius: 14px;
                padding: 4px 16px;
                margin: 0 0 12px;
            }
            .output-box-row {
                display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
                padding: 11px 0;
            }
            .output-box-row + .output-box-row { border-top: 1px solid rgba(0, 0, 0, 0.06); }
            .output-box-row-split { justify-content: space-between; }
            @media (max-width: 767px) {
                .output-box-row, .output-box-row-split { justify-content: center; }
                .output-box-row > .output-label { width: 100%; text-align: center; }
            }
            .output-label {
                font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
                text-transform: uppercase; color: #8a909b;
            }
            .output-seg {
                display: flex; flex-wrap: wrap; gap: 2px;
                background: #f5f6f9; border: 1px solid rgba(0, 0, 0, 0.06);
                border-radius: 10px; padding: 3px;
            }
            .output-seg-btn {
                padding: 7px 14px; border: none; border-radius: 8px;
                font-family: inherit; font-weight: 700; font-size: 13px;
                line-height: 1.3; margin: 0;
                cursor: pointer; background: transparent; color: #5c626d;
                transition: background-color 0.15s, color 0.15s;
            }
            .output-seg-btn.active,
            .btn-check:checked + .output-seg-btn { background: #1e3a8a; color: #fff; }
            .output-seg-btn:disabled { opacity: 0.5; cursor: not-allowed; }
            .output-dims {
                font-size: 12.5px;
                font-family: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
                color: #5c626d;
            }
        


/* ==========================================================================
   TOOLSWIFT DARK NEON CYBERPUNK THEME OVERRIDES
   ========================================================================== */

:root {
    --bg-color: #000000;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --accent-cyan: #00f2fe;
    --accent-blue: #4facfe;
    --accent-purple: #7928ca;
    --glass-bg: rgba(13, 17, 26, 0.75);
    --glass-border: rgba(255, 255, 255, 0.12);
}

body {
    background-color: #000000 !important;
    color: #ffffff !important;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    min-height: 100vh;
}

[x-cloak] { display: none !important; }

/* Page Header & Hero */
.upscaler-hero {
    text-align: center;
    padding: calc(var(--nav-height, 70px) + 2rem) 1rem 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.upscaler-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(0, 242, 254, 0.08);
    border: 1px solid rgba(0, 242, 254, 0.3);
    border-radius: 50px;
    color: #00f2fe;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.15);
}

.upscaler-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #ffffff;
}

.gradient-text {
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 50%, #7928ca 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.upscaler-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    max-width: 680px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.hero-feature-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-feature-chip i {
    color: #00f2fe;
}

/* App Core Container & Panels */
.upscaler-app-container {
    max-width: 960px;
    margin: 0 auto 5rem;
    padding: 0 1rem;
}

.bg-gray-light,
#file-load-panel,
#loading-panel,
#file-loading-panel,
#start-panel,
#unsupported-panel,
#error-panel,
#incompatible-panel,
#hdr-unsupported-panel,
#unsupported-format-panel,
#resume-panel {
    background: rgba(13, 17, 26, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 24px !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 242, 254, 0.05) !important;
    color: #ffffff !important;
}

/* Dragging state */
#file-load-panel.is-dragging {
    border-color: #00f2fe !important;
    background: rgba(0, 242, 254, 0.08) !important;
    box-shadow: 0 0 35px rgba(0, 242, 254, 0.35) !important;
    transform: scale(1.01);
    transition: all 0.25s ease;
}

/* Text & Colors */
p, span, div, h1, h2, h3, h4, h5, h6 {
    color: #ffffff;
}

.text-gray-600, .text-gray-500, .text-gray-400 {
    color: rgba(255, 255, 255, 0.7) !important;
}

.font-mono, span.font-mono {
    background: rgba(0, 242, 254, 0.12) !important;
    color: #00f2fe !important;
    border: 1px solid rgba(0, 242, 254, 0.25) !important;
    border-radius: 6px !important;
    padding: 2px 6px !important;
    font-size: 0.9em !important;
}

/* Buttons */
.btn-primary, #input-button {
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%) !important;
    color: #000000 !important;
    font-weight: 800 !important;
    border: none !important;
    border-radius: 14px !important;
    padding: 0.85rem 2rem !important;
    box-shadow: 0 6px 20px rgba(0, 242, 254, 0.4) !important;
    transition: all 0.25s ease !important;
    cursor: pointer !important;
    letter-spacing: 0.02em;
}

.btn-primary:hover, #input-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 30px rgba(0, 242, 254, 0.65) !important;
    filter: brightness(1.08) !important;
}

.btn-primary:active, #input-button:active {
    transform: translateY(0) !important;
}

.btn-outline-primary {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    border-radius: 12px !important;
    padding: 0.6rem 1.4rem !important;
    font-weight: 700 !important;
    transition: all 0.25s ease !important;
}

.btn-outline-primary:hover {
    background: rgba(0, 242, 254, 0.15) !important;
    border-color: #00f2fe !important;
    color: #00f2fe !important;
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.3) !important;
    transform: translateY(-1px) !important;
}

/* Output Box & Model Settings */
.output-box {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 16px !important;
    padding: 12px 18px !important;
}

.output-label {
    color: rgba(255, 255, 255, 0.6) !important;
    font-weight: 700 !important;
    font-size: 0.78rem !important;
    letter-spacing: 0.05em !important;
}

.output-seg {
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    padding: 4px !important;
}

.output-seg-btn {
    color: rgba(255, 255, 255, 0.75) !important;
    border-radius: 8px !important;
    padding: 7px 14px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
}

.btn-check:checked + .output-seg-btn,
.output-seg-btn.active {
    background: #00f2fe !important;
    color: #000000 !important;
    font-weight: 800 !important;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.45) !important;
}

.output-dims {
    color: #00f2fe !important;
}

/* Tooltip Trigger */
.tooltip-trigger {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    border-radius: 50% !important;
    width: 18px !important;
    height: 18px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.7rem !important;
    margin-left: 6px !important;
}

/* Progress bar */
.progress {
    background: rgba(255, 255, 255, 0.08) !important;
    border-radius: 20px !important;
    height: 14px !important;
    overflow: hidden !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.progress-bar {
    background: linear-gradient(90deg, #00f2fe 0%, #4facfe 50%, #7928ca 100%) !important;
    box-shadow: 0 0 18px rgba(0, 242, 254, 0.7) !important;
    border-radius: 20px !important;
}

/* Spinners */
.ring-spinner {
    border: 4px solid rgba(0, 242, 254, 0.15) !important;
    border-top-color: #00f2fe !important;
}

/* Notices & Warnings */
.bg-yellow-50, .bg-blue-50 {
    background: rgba(20, 25, 40, 0.8) !important;
    border: 1px solid rgba(0, 242, 254, 0.25) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    border-radius: 12px !important;
}

.text-yellow-900, .text-blue-700 {
    color: #ffffff !important;
}

/* Frame strip */
.frame-chip {
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    background: #0a0d14 !important;
}

.frame-chip.active {
    border: 2px solid #00f2fe !important;
    box-shadow: 0 0 12px rgba(0, 242, 254, 0.4) !important;
}

.frame-chip-check {
    background: #00f2fe !important;
    color: #000000 !important;
}

/* Compare View */
#image-compare, #patch-preview-compare, #video-compare {
    border-radius: 16px !important;
    overflow: hidden !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8) !important;
}

.patch-badge-out {
    background: #00f2fe !important;
    color: #000000 !important;
}

/* FAQ & Info section */
.upscaler-info-section {
    max-width: 900px;
    margin: 4rem auto 3rem;
    padding: 0 1rem;
}

.upscaler-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.upscaler-info-card {
    background: rgba(13, 17, 26, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.upscaler-info-card h4 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.upscaler-info-card h4 i {
    color: #00f2fe;
}

.upscaler-info-card p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.92rem;
    line-height: 1.6;
}
