/**
 * Copyright (c) 2026 Hexful.com
 * All rights reserved.
 * 
 * Unauthorized use, distribution, or modification of this code
 * is strictly prohibited.
 */
 :root {
  --primary-color: #10a37f;
  --background: #ffffff;
  --card-bg: #ffffff;
  --contrast-bg: #f7f7f8;
  --border-color: #e5e5e5;
  --text-color: #121212;
  --text-secondary: #6e6e80;
  --success-color: #10a37f;
  --warning-color: #f9a03f;
  --danger-color: #ef4146;
  --border-radius: 8px;
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
}

/* This container now matches the .nav-container and main .container from style.css */
.cc-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
  box-sizing: border-box;
  padding-bottom: calc(40px + env(safe-area-inset-bottom));
}

  .cc-app-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-color);
    text-align: center;
  }


  .cc-contrast-checker {
      display: grid;
      /* Narrower controls / wider preview — prevents left content spilling under the preview */
      grid-template-columns: minmax(0, 0.68fr) minmax(0, 1.32fr);
      gap: 32px;
      align-items: stretch;
      width: 100%;
      min-width: 0;
    }

    .cc-page-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
      min-height: 50px;
      margin-bottom: 1.75rem;
      flex-wrap: wrap;
      box-sizing: border-box;
    }

    .cc-page-header .cc-header {
      margin: 0;
    }

    .cc-controls-column {
      background: var(--card-bg);
      border-radius: var(--border-radius);
      display: flex;
      flex-direction: column;
      gap: 1.75rem;
      min-width: 0;
      max-width: 100%;
      min-height: 100%;
      height: 100%;
      overflow: visible;
      padding: 0;
      border: none;
      box-sizing: border-box;
    }

    .cc-preview-column {
      background: transparent;
      border-radius: 0;
      min-width: 0;
      max-width: 100%;
      min-height: 100%;
      height: 100%;
      overflow: hidden;
      display: flex;
      padding: 0;
      flex-direction: column;
      border: none;
      gap: 0;
      box-sizing: border-box;
    }

  .cc-section-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    padding-left: 0px;
    letter-spacing: -0.5px;
  }

  .cc-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
  }
  .cc-header {
      margin: 0;
      padding-left: 0;
      letter-spacing: -0.5px;
      font-size: 1.5rem;
      font-weight: 600;
      color: #121212;
      font-family: var(--font-sans);
      line-height: 1.2;
    }

  .cc-refresh-button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
    transition: background-color 0.2s, transform 0.2s;
  }

  .cc-refresh-button:hover {
    background: #fff;
    border-color: #999;
    color: #121212;
  }

  .cc-refresh-button svg {
    width: 18px;
    height: 18px;
  }

  .cc-input-section {
    display: flex;
    gap: 20px;
    min-width: 0;
  }

  .cc-color-input {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
  }

  .cc-color-input label {
    margin: 0 0 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #121212;
    opacity: 0.78;
    font-family: var(--font-sans);
  }
  input[type="color"] {
    -webkit-appearance: none;
    border: none;
    padding: 0;
    width: 36px;
    height: 36px;
    cursor: pointer;
  }

  input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
  }

  input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
  }

  .cc-color-picker {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 10px 14px;
    background-color: #fff;
    min-width: 0;
    box-sizing: border-box;
  }

  .cc-color-picker input[type="text"] {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.2;
    background: none;
    color: #121212;
  }

  .cc-color-picker input[type="text"]::placeholder {
    color: var(--text-secondary);
  }

  .cc-color-picker input[type="text"]:focus {
    outline: none;
  }

  .cc-color-picker input[type="color"] {
    width: 36px;
    height: 36px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 12px;
    padding: 0;
  }

  .cc-results-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 0;
    background: transparent;
    border-radius: 0;
  }

  .cc-ratio-container {
    margin-bottom: 0;
  }

  .cc-ratio-label {
    margin: 0 0 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #121212;
    opacity: 0.78;
    font-family: var(--font-sans);
  }

  .cc-ratio-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
  }

  .cc-ratio {
    font-size: clamp(2rem, 3.5vw, 2.75rem);
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.03em;
    line-height: 1;
  }

  .cc-ratio-summary {
    display: inline-flex;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: var(--font-sans);
    line-height: 1.2;
  }

  .cc-ratio-summary.is-pass {
    color: var(--success-color);
  }

  .cc-ratio-summary.is-fail {
    color: var(--danger-color);
  }

  .cc-wcag-results {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid #e6e6e6;
  }

  .cc-graphics-result {
    grid-column: auto;
  }

  .cc-result-item {
    background: transparent;
    padding: 0.85rem 0;
    border-radius: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    box-shadow: none;
    border-bottom: 1px solid #e6e6e6;
  }

  .cc-result-label {
    font-weight: 500;
    font-size: 0.9rem;
    color: #222;
  }

  .cc-result-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: auto;
    min-height: 0;
    padding: 0;
    border-radius: 0;
    border: none;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    line-height: 1;
    white-space: nowrap;
    box-sizing: border-box;
    background: transparent;
  }

  .cc-pass {
    background-color: transparent;
    color: var(--success-color);
  }

  .cc-fail {
    background-color: transparent;
    color: var(--danger-color);
  }

  .cc-color-preview {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    min-height: 420px;
    padding: 2rem 2rem 1.75rem;
    text-align: left;
    border-radius: 12px;
    border: 1px solid #e6e6e6;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
  }

  .cc-color-preview.is-dark-bg {
    border-color: rgba(255, 255, 255, 0.12);
  }

  .cc-preview-stage {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: stretch;
    column-gap: clamp(1.5rem, 4vw, 3.5rem);
    row-gap: 1.5rem;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    padding: 0;
  }

  .cc-preview-hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    min-width: 0;
    min-height: 100%;
    padding: 0.15rem 0;
  }

  .cc-preview-heading {
    margin: 0;
    font-size: clamp(1.35rem, 2.4vw, 1.85rem);
    font-weight: 600;
    font-family: var(--font-sans);
    letter-spacing: -0.03em;
    line-height: 1.15;
    max-width: 12em;
  }

  .cc-preview-aa {
    font-size: clamp(7rem, 16vw, 11.5rem);
    font-weight: 600;
    font-family: var(--font-sans);
    letter-spacing: -0.08em;
    line-height: 0.8;
    user-select: none;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
  }

  .cc-preview-caption {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 400;
    font-family: var(--font-sans);
    letter-spacing: 0.01em;
    line-height: 1.4;
    opacity: 0.88;
    max-width: 16em;
  }

  .cc-preview-copy {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    gap: 1.5rem;
    min-width: 0;
    max-width: 28rem;
    align-self: stretch;
    min-height: 100%;
  }

  /* Postcard postage stamp — scalloped edge, slight tilt */
  .cc-preview-stamp {
    align-self: flex-end;
    flex: 0 0 auto;
    position: relative;
    width: 5.85rem;
    height: 6.9rem;
    box-sizing: border-box;
    transform: rotate(7deg);
    transform-origin: center center;
    color: inherit;
  }

  .cc-preview-stamp-edge {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
    overflow: visible;
  }

  .cc-preview-stamp-face {
    position: absolute;
    inset: 12%;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    box-sizing: border-box;
    border: 1.25px solid currentColor;
    background: transparent;
  }

  .cc-preview-stamp-value {
    font-size: 1.35rem;
    font-weight: 600;
    font-family: var(--font-sans);
    letter-spacing: -0.04em;
    line-height: 1;
  }

  .cc-preview-stamp-label {
    font-size: 0.625rem;
    font-weight: 500;
    font-family: var(--font-sans);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    line-height: 1;
    opacity: 0.8;
  }

  .cc-preview-copy-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1.15rem;
    flex: 1 1 auto;
  }

  .cc-preview-sentence {
    max-width: none;
    margin: 0;
    font-size: clamp(1.05rem, 1.7vw, 1.35rem);
    font-weight: 400;
    font-family: var(--font-sans);
    line-height: 1.5;
    letter-spacing: -0.015em;
    opacity: 0.95;
  }

  .cc-sample-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    height: 42px;
    padding: 0 1.25rem;
    border-radius: 999px;
    border: none;
    font-weight: 500;
    font-size: 0.95rem;
    font-family: var(--font-sans);
    margin-top: 0.35rem;
    cursor: default;
    pointer-events: none;
  }

  /* Legacy content helpers (kept for safety) */
  .cc-preview-content {
    max-width: 85%;
  }

  .cc-sample-heading {
    font-size: 32px;
    margin-bottom: 24px;
    font-weight: 700;
    line-height: 1.2;
  }

  .cc-sample-text {
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.7;
  }
  .cc-similar-combos {
    margin-top: 3rem;
    width: 100%;
    overflow: visible;
  }

  .cc-combo-carousel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
  }

  .cc-combo-heading {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
  }

  .cc-combo-carousel-header .cc-header {
    margin: 0;
  }

  .cc-section-desc {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.45;
    color: #666;
    font-family: var(--font-sans);
  }

  .cc-combo-carousel-header .complementary-color-title {
    margin: 0;
  }

  .cc-combo-carousel-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
  }

  .cc-similar-combos .cc-refresh-button {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #121212;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.3s ease;
  }

  .cc-similar-combos .cc-refresh-button:hover {
    background: #fff;
    border-color: #999;
    color: #121212;
    transform: none;
  }

  .cc-similar-combos .cc-refresh-button svg {
    width: 16px;
    height: 16px;
  }

  .cc-similar-combos .color-mode-carousel-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
  }

  .cc-similar-combos .color-mode-carousel-btn {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border-radius: 999px;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #121212;
    cursor: pointer;
    transition: border-color 0.15s ease, opacity 0.15s ease;
  }

  .cc-similar-combos .color-mode-carousel-btn:hover:not(:disabled) {
    background: #fff;
    border-color: #999;
    color: #121212;
  }

  .cc-similar-combos .color-mode-carousel-btn:disabled {
    opacity: 0.35;
    cursor: default;
  }

  .cc-combo-carousel,
  #similar-combos-carousel.color-mode-carousel {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: none;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: none;
    scrollbar-width: none;
    /* Room for hover lift; horizontal padding stays 0 for Safari end-scroll */
    margin: -10px 0;
    padding: 10px 0;
  }

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

  .cc-combo-carousel .color-mode-carousel-track {
    display: flex;
    gap: 0.75rem;
    width: max-content;
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
  }

  .cc-combo-item {
    position: relative;
    flex: 0 0 clamp(242px, 28.75vw, 316px);
    min-width: 0;
    max-width: clamp(242px, 28.75vw, 316px);
    transition: transform 0.12s ease;
  }

  .cc-combo-item.cc-combo-item--enter {
    animation: palette-enter 0.72s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: var(--cc-combo-enter-delay, 0ms);
    will-change: transform, opacity, filter;
    backface-visibility: hidden;
  }

  @media (prefers-reduced-motion: reduce) {
    .cc-combo-item.cc-combo-item--enter {
      animation: none;
      will-change: auto;
      filter: none;
    }
  }

  .cc-combo-item:hover {
    transform: translateY(-5px);
  }

  .cc-combo-swatch {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 374px;
    aspect-ratio: 4 / 5;
    margin: 0;
    padding: 18px;
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    cursor: pointer;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
    transform: none;
  }

  .cc-combo-item .complementary-color-icons {
    position: absolute;
    top: 18px;
    right: 18px;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    z-index: 3;
  }

  .cc-combo-item .mixer-icon-circle,
  .cc-combo-item .save-icon {
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.2s;
  }

  .cc-combo-item .mixer-icon-circle {
    box-shadow: none;
  }

  .cc-combo-item:hover .mixer-icon-circle,
  .cc-combo-item:hover .save-icon,
  .cc-combo-item:focus-within .mixer-icon-circle,
  .cc-combo-item:focus-within .save-icon {
    opacity: 1;
  }

  .cc-combo-item .save-icon:hover,
  .cc-combo-item .mixer-icon-circle:hover,
  .cc-combo-item .mixer-icon-circle:focus-visible {
    transform: scale(1.1);
  }

  .cc-combo-item .save-icon {
    position: static;
    top: auto;
    right: auto;
    flex-shrink: 0;
  }

  .cc-combo-item .mixer-icon-circle img {
    width: 20px;
    height: 20px;
    display: block;
  }

  .cc-combo-aa {
    font-size: clamp(6.325rem, 11.5vw, 8.625rem);
    font-weight: 600;
    font-family: var(--font-sans);
    letter-spacing: -0.06em;
    line-height: 0.9;
    user-select: none;
  }

  .cc-combo-meta {
    position: static;
    margin: 0.5rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    opacity: 1;
    pointer-events: auto;
  }

  .cc-combo-meta .tag {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    gap: 4px;
    height: 35px;
    box-sizing: border-box;
    padding: 0 0.6rem;
    max-width: 100%;
    pointer-events: auto;
    box-shadow: none;
    color: #767676;
  }

  .cc-combo-item.is-active .cc-combo-swatch {
    box-shadow: inset 0 0 0 2px #121212;
  }

  .cc-combo-swatch:focus-visible {
    outline: 2px solid rgba(0, 0, 0, 0.35);
    outline-offset: 2px;
  }

  @media (hover: none), (pointer: coarse) {
    .cc-combo-item .mixer-icon-circle,
    .cc-combo-item .save-icon {
      opacity: 1;
    }
  }

  @media (max-width: 1024px) {
    .cc-combo-item {
      flex-basis: 230px;
      max-width: 230px;
    }

    .cc-combo-swatch {
      min-height: 316px;
    }
  }

  .cc-buttons-container {
      display: flex;
      gap: 10px;
      margin-top: 0;
      align-items: center;
    }

    .cc-buttons-container .image-export-menu {
      position: relative;
      display: flex;
    }

    .cc-buttons-container .image-export-menu > .cc-button {
      gap: 6px;
    }

    .cc-buttons-container .img-dropdown-chevron {
      display: inline-block;
      width: 13px;
      height: 11px;
      flex-shrink: 0;
      margin-left: 2px;
      background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='13'%20height='11'%20viewBox='0%200%2013%2011'%3E%3Cpath%20d='M2.5%203.25l4%204%204-4'%20fill='none'%20stroke='%23000'%20stroke-width='1.75'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: center;
      background-size: 13px 11px;
    }

    .cc-buttons-container .image-export-menu-panel {
      position: absolute;
      top: calc(100% + 8px);
      right: 0;
      left: auto;
      z-index: 50;
      min-width: 160px;
      background: #ffffff;
      border: 1px solid #e5e5e5;
      border-radius: 8px;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
      padding: 6px;
      display: flex;
      flex-direction: column;
      gap: 4px;
      box-sizing: border-box;
    }

    .cc-buttons-container .image-export-menu-panel[hidden] {
      display: none;
    }

    .cc-buttons-container .image-export-menu-panel button {
      width: 100%;
      appearance: none;
      -webkit-appearance: none;
      margin: 0;
      border: 1px solid transparent;
      background: transparent;
      text-align: left;
      justify-content: flex-start;
      height: auto;
      min-height: 0;
      padding: 8px 12px;
      border-radius: 8px;
      font: inherit;
      font-size: 14px;
      font-weight: 400;
      line-height: 1.2;
      color: #121212;
      text-transform: uppercase;
      cursor: pointer;
      display: flex;
      align-items: center;
      box-sizing: border-box;
      white-space: nowrap;
      transition: background-color 0.15s ease;
    }

    .cc-buttons-container .image-export-menu-panel button:hover {
      background: #F2F2F2;
      background-color: #F2F2F2;
      border-color: transparent;
      transform: none;
    }
    
    .cc-button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      height: 34px;
      min-height: 34px;
      padding: 0 14px;
      border-radius: 999px;
      background: #ffffff;
      background-color: #ffffff;
      border: 1px solid #e0e0e0;
      color: #121212;
      font-weight: 400;
      font-size: 14px;
      line-height: 1;
      cursor: pointer;
      box-sizing: border-box;
      transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    }
    
    .cc-button:hover {
      background: #ffffff;
      background-color: #ffffff;
      border-color: #999;
      color: #121212;
    }
    
    .cc-button:active {
      transform: none;
    }
    
    .cc-button-icon {
      width: 16px;
      height: 16px;
    }
    
    /* Ensure save button matches Recent / Saved pill styling */
    .cc-buttons-container .searched-color-button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      height: 34px;
      min-height: 34px;
      padding: 0 14px;
      border-radius: 999px;
      background: #ffffff;
      background-color: #ffffff;
      border: 1px solid #e0e0e0;
      color: #121212;
      font-weight: 400;
      font-size: 14px;
      line-height: 1;
      box-sizing: border-box;
      transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    }
    
    .cc-buttons-container .searched-color-button:hover {
      background: #ffffff;
      background-color: #ffffff;
      border-color: #999;
      color: #121212;
      transform: none;
    }
    
    /* General stacking rule - seems to be causing the issue */
    /* .cc-section-header {
      flex-direction: column;
      align-items: flex-start;
    } */

    /* Ensure the Accessible Combinations header stays as a row */
    .cc-combo-carousel-header {
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
    }
  .cc-intro {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #666;
    margin-bottom: 6px;
  }
  
  .cc-intro .read-more-btn {
    background: none;
    border: none;
    color: #121212;
    cursor: pointer;
    padding: 0;
    margin-left: 4px;
    font-size: 0.95rem;
    text-decoration: underline;
    font-family: inherit;
  }
  
  .cc-intro .read-more-btn:hover {
    color: #121212;
  }
  
  .cc-intro .read-more-btn:focus {
    outline: 2px solid #121212;
    outline-offset: 2px;
  }
    
    @media (min-width: 768px) {
      .cc-section-header {
        margin-bottom: 24px;
      }
      .cc-buttons-container {
        gap: 12px;
      }
    }

    /* Adjust header layout for smaller screens (Tablet and below) */
    @media (max-width: 768px) {
      .cc-page-header {
        align-items: flex-start;
        height: auto;
        flex-direction: column;
      }

      .cc-buttons-container {
        gap: 8px;
        width: 100%;
      }

      .cc-buttons-container .cc-button,
      .cc-buttons-container .searched-color-button,
      .cc-buttons-container .image-export-menu {
        flex: 1 1 auto;
        height: 34px;
        min-height: 34px;
        padding: 0 14px;
        min-width: fit-content;
        border-radius: 999px;
        font-size: 14px;
        font-weight: 400;
      }

      .cc-buttons-container .image-export-menu {
        padding: 0;
        height: auto;
        min-height: 0;
      }

      .cc-buttons-container .image-export-menu > .cc-button {
        width: 100%;
        height: 34px;
        min-height: 34px;
      }

      .cc-combo-carousel-header {
        flex-direction: column;
        align-items: stretch;
      }

      .cc-combo-carousel-actions {
        align-self: flex-end;
      }
    }

    /* Specific adjustments for very small screens */
    @media (max-width: 480px) {
      .cc-buttons-container {
        flex-direction: column;
        width: 100%;
      }
      
      .cc-buttons-container .cc-button,
      .cc-buttons-container .searched-color-button,
      .cc-buttons-container .image-export-menu {
        width: 100%;
        height: 34px;
        min-height: 34px;
        padding: 0 14px;
        font-size: 14px;
        font-weight: 400;
        border-radius: 999px;
      }

      .cc-buttons-container .image-export-menu {
        padding: 0;
        height: auto;
        min-height: 0;
      }

      .cc-buttons-container .image-export-menu > .cc-button {
        width: 100%;
      }
    }

  @media (max-width: 1400px) {
    /* Keep pair side-by-side a bit longer, but stack FG/BG so the narrow left column doesn't overflow */
    .cc-input-section {
      flex-direction: column;
    }
  }

  @media (max-width: 1200px) {
    .cc-contrast-checker {
      grid-template-columns: 1fr;
    }
    
    .cc-preview-column {
      min-height: 0;
    }

    .cc-color-preview {
      min-height: 380px;
      padding: 1.5rem;
    }

    .cc-preview-stage {
      grid-template-columns: 1fr;
      justify-items: stretch;
      gap: 1.5rem;
    }

    .cc-preview-hero {
      justify-content: flex-start;
      gap: 1rem;
      min-height: 0;
    }

    .cc-preview-aa {
      font-size: clamp(5.5rem, 22vw, 8rem);
      flex: 0 0 auto;
    }

    .cc-preview-copy {
      max-width: none;
      align-self: stretch;
      min-height: 0;
    }

    .cc-preview-stamp {
      width: 5rem;
      height: 5.9rem;
      transform: rotate(5deg);
    }

    .cc-preview-stamp-value {
      font-size: 1.2rem;
    }

    .cc-input-section {
      flex-direction: column;
    }
  }
