/* Color Studio — reusable dynamic component */
.tbp-color-studio,
.tbp-color-studio__modal {
  --tbp-red: #bf2020;
  --tbp-red-dark: #a01b1b;
  --tbp-ink: #1a1f1c;
  --tbp-muted: #5c665e;
  --tbp-line: #e4e7e2;
  --tbp-bg: #ffffff;
}

.tbp-color-studio {
  width: 100%;
  max-width: 560px;
  min-width: 0;
  margin: 0 auto;
  font-family: "Open Sans", Montserrat, sans-serif;
  box-sizing: border-box;
}

.tbp-color-studio *,
.tbp-color-studio *::before,
.tbp-color-studio *::after {
  box-sizing: border-box;
}

.tbp-color-studio--board {
  max-width: 640px;
}

.tbp-home-page .tbp-color-studio--board,
.tbp-home-hero .tbp-color-studio,
.tbp-city-page .tbp-color-studio {
  max-width: 100%;
}

.tbp-color-studio__card {
  background: var(--tbp-bg);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.12);
  padding: 1rem 1rem 1.1rem;
  border: 1px solid rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.tbp-color-studio__title {
  margin: 0 0 0.45rem !important;
  text-align: center;
  font-family: Georgia, "Times New Roman", serif !important;
  font-size: 1.2rem !important;
  font-weight: 700 !important;
  color: var(--tbp-ink) !important;
}

.tbp-color-studio__scenes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
  margin: 0 0 0.4rem;
}

.tbp-color-studio__scene {
  appearance: none;
  border: 1px solid var(--tbp-line);
  background: #f7f8f6;
  color: var(--tbp-ink);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1.15;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tbp-color-studio__scene:hover {
  border-color: #b8c2b6;
  background: #fff;
}

.tbp-color-studio__scene.is-active {
  background: #1a3d2a;
  border-color: #1a3d2a;
  color: #fff;
}

/* Keep [hidden] working even when canvas/img set display:block */
.tbp-color-studio__canvas[hidden],
.tbp-color-studio__img[hidden],
.tbp-color-studio__board[hidden] {
  display: none !important;
}

.tbp-color-studio--board .tbp-color-studio__canvas,
.tbp-color-studio--board .tbp-color-studio__img--base {
  display: none !important;
}

.tbp-color-studio--photo .tbp-color-studio__board {
  display: none !important;
}

.tbp-color-studio--scenes.tbp-color-studio--photo .tbp-color-studio__preview {
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: 140px;
  max-height: 200px;
  width: 100%;
  max-width: 100%;
}

.tbp-color-studio--scenes.tbp-color-studio--photo .tbp-color-studio__canvas,
.tbp-color-studio--scenes.tbp-color-studio--photo .tbp-color-studio__img--base {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: cover;
}

.tbp-color-studio.is-scene-loading .tbp-color-studio__preview {
  opacity: 0.55;
  transition: opacity 0.2s ease;
}

/* Compact home / scenes layout */
.tbp-color-studio--scenes .tbp-color-studio__title {
  margin: 0 0 0.3rem !important;
  font-size: 1.05rem !important;
}

.tbp-color-studio--scenes .tbp-color-studio__card {
  padding: 0.65rem 0.75rem 0.75rem;
}

.tbp-color-studio--scenes .tbp-color-studio__preview--board {
  height: 86px;
  min-height: 86px;
  max-height: 86px;
}

.tbp-color-studio--scenes .tbp-color-studio__tabs {
  margin: 0.45rem 0 0.35rem;
  gap: 0.85rem;
}

.tbp-color-studio--scenes .tbp-color-studio__tab {
  padding: 0.28rem 0.1rem;
  font-size: 0.82rem;
}

.tbp-color-studio--scenes .tbp-color-studio__choose {
  font-size: 0.8rem;
}

.tbp-color-studio--scenes .tbp-color-studio__search {
  display: none;
}

.tbp-color-studio--scenes.is-wall-open .tbp-color-studio__search {
  display: block;
}

.tbp-color-studio--scenes .tbp-color-studio__search input {
  padding: 0.38rem 0.6rem;
  font-size: 0.8rem;
}

.tbp-color-studio--scenes.is-wall-open .tbp-color-studio__wall,
.tbp-color-studio--scenes[data-cat="all"] .tbp-color-studio__wall {
  max-height: 168px;
}

.tbp-color-studio--scenes .tbp-color-studio__selected {
  margin-top: 0.35rem;
  padding: 0.45rem 0.55rem;
}

.tbp-color-studio--scenes .tbp-color-studio__cta {
  margin-top: 0.45rem;
  padding: 0.7rem 0.85rem;
  font-size: 0.88rem;
}

.tbp-color-studio__preview {
  --compare: 50%;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #eef1ee;
  aspect-ratio: 16 / 10;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  isolation: isolate;
}

.tbp-color-studio__preview--board {
  aspect-ratio: auto;
  height: 118px;
  min-height: 118px;
  max-height: 118px;
  background: #e8ebe6;
}

.tbp-color-studio--board .tbp-color-studio__card {
  padding: 0.75rem 0.85rem 0.9rem;
}

.tbp-color-studio__board {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}

.tbp-color-studio__board-siding {
  flex: 1 1 auto;
  min-height: 0;
  background: var(--board-primary, #d9d6cf);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0.55rem 0.85rem 0.6rem;
  color: #1a1f1c;
  transition: background 0.25s ease, color 0.2s ease;
}

.tbp-color-studio__board-siding .tbp-color-studio__board-kicker,
.tbp-color-studio__board-siding .tbp-color-studio__board-name,
.tbp-color-studio__board-siding .tbp-color-studio__board-code {
  color: inherit;
}

.tbp-color-studio__board-kicker {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
}

.tbp-color-studio__board-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.15;
  margin-top: 0.05rem;
}

.tbp-color-studio__board-code {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.92;
  margin-top: 0.05rem;
  min-height: 0;
}

.tbp-color-studio__board-code:empty {
  display: none;
}

.tbp-color-studio__board-trim {
  flex: 0 0 30px;
  min-height: 30px;
  background: var(--board-trim, #f7f5f2);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.2rem 0.85rem;
  color: #1a1f1c;
  transition: background 0.25s ease, color 0.2s ease;
}

.tbp-color-studio__board-trim-label,
.tbp-color-studio__board-trim-name {
  color: inherit;
}

.tbp-color-studio__board-trim-label {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.88;
}

.tbp-color-studio__board-trim-name {
  font-size: 0.8rem;
  font-weight: 700;
}

.tbp-color-studio__img,
.tbp-color-studio__canvas,
.tbp-color-studio__svg-base,
.tbp-color-studio__svg-live {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  margin: 0 !important;
}

.tbp-color-studio__preview:not(.tbp-color-studio__preview--compare) .tbp-color-studio__svg-base,
.tbp-color-studio__preview:not(.tbp-color-studio__preview--compare) .tbp-color-studio__img--base {
  display: none;
}

.tbp-color-studio__img {
  display: block;
  object-fit: cover;
}

.tbp-color-studio__canvas {
  display: block;
  object-fit: cover;
}

.tbp-color-studio__svg {
  display: block;
  width: 100%;
  height: 100%;
}

.tbp-color-studio__preview--compare .tbp-color-studio__img--base,
.tbp-color-studio__preview--compare .tbp-color-studio__svg-base {
  clip-path: inset(0 calc(100% - var(--compare)) 0 0);
  z-index: 1;
}

.tbp-color-studio__preview--compare .tbp-color-studio__canvas,
.tbp-color-studio__preview--compare .tbp-color-studio__svg-live {
  clip-path: inset(0 0 0 var(--compare));
  z-index: 2;
}

.tbp-color-studio__compare-ui {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.tbp-color-studio__compare {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  pointer-events: auto;
  z-index: 6;
}

.tbp-color-studio__compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--compare);
  width: 3px;
  margin-left: -1.5px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  z-index: 5;
}

.tbp-color-studio__compare-handle::before {
  content: "‹ ›";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  color: #1a1f1c;
  font-size: 14px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  letter-spacing: -2px;
  padding-left: 2px;
}

.tbp-color-studio__engine-note {
  margin: 0.5rem 0 0 !important;
  font-size: 0.8rem;
  color: #8a3a2a;
}

.tbp-color-studio__modal-thumb--svg {
  width: 120px;
  height: 80px;
  border-radius: 8px;
  background: linear-gradient(160deg, #c5d8e8, #dfe6dc);
  border: 1px solid var(--tbp-line);
}

.tbp-color-studio__tabs {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  margin: 0.85rem 0 0.65rem;
  border-bottom: 1px solid var(--tbp-line);
}

.tbp-color-studio__tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0.4rem 0.15rem;
  margin-bottom: -1px;
  font-weight: 700;
  color: var(--tbp-muted);
  cursor: pointer;
}

.tbp-color-studio__tab.is-active {
  color: var(--tbp-ink);
  border-bottom-color: var(--tbp-red);
}

.tbp-color-studio__toolbar {
  margin: 0.35rem 0 0.45rem;
}

.tbp-color-studio__toolbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.tbp-color-studio__choose {
  margin: 0 !important;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--tbp-ink);
}

.tbp-color-studio__wall-toggle {
  appearance: none;
  border: 0;
  background: none;
  color: var(--tbp-ink);
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
}

.tbp-color-studio__wall-toggle-icon {
  width: 14px;
  height: 14px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  background:
    linear-gradient(currentColor, currentColor) 3px 3px / 3px 3px no-repeat,
    linear-gradient(currentColor, currentColor) 8px 3px / 3px 3px no-repeat,
    linear-gradient(currentColor, currentColor) 3px 8px / 3px 3px no-repeat,
    linear-gradient(currentColor, currentColor) 8px 8px / 3px 3px no-repeat;
}

.tbp-color-studio__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.4rem;
}

.tbp-color-studio__filter {
  appearance: none;
  border: 1px solid var(--tbp-line);
  background: #fff;
  color: var(--tbp-ink);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.tbp-color-studio__filter.is-active {
  background: var(--tbp-red);
  border-color: var(--tbp-red);
  color: #fff;
}

.tbp-color-studio__search input {
  width: 100%;
  border: 1px solid var(--tbp-line);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  font-size: 0.88rem;
}

.tbp-color-studio__wall {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-height: 168px;
  overflow: auto;
  padding: 0.15rem;
  margin-bottom: 0.55rem;
  scrollbar-width: thin;
  position: relative;
}

/* Match post-JS Popular filter on first paint so the wall does not collapse after boot. */
.tbp-color-studio[data-cat="popular"] .tbp-color-studio__swatch:not([data-popular="1"]) {
  display: none !important;
}
.tbp-color-studio[data-cat="popular"] .tbp-color-studio__wall-col:not(:has(.tbp-color-studio__swatch[data-popular="1"])) {
  display: none !important;
}
.tbp-color-studio[data-cat="neutrals"] .tbp-color-studio__swatch:not([data-cat="neutrals"]),
.tbp-color-studio[data-cat="greens"] .tbp-color-studio__swatch:not([data-cat="greens"]),
.tbp-color-studio[data-cat="blues"] .tbp-color-studio__swatch:not([data-cat="blues"]),
.tbp-color-studio[data-cat="warm"] .tbp-color-studio__swatch:not([data-cat="warm"]) {
  display: none !important;
}
.tbp-color-studio[data-cat="neutrals"] .tbp-color-studio__wall-col:not(:has(.tbp-color-studio__swatch[data-cat="neutrals"])),
.tbp-color-studio[data-cat="greens"] .tbp-color-studio__wall-col:not(:has(.tbp-color-studio__swatch[data-cat="greens"])),
.tbp-color-studio[data-cat="blues"] .tbp-color-studio__wall-col:not(:has(.tbp-color-studio__swatch[data-cat="blues"])),
.tbp-color-studio[data-cat="warm"] .tbp-color-studio__wall-col:not(:has(.tbp-color-studio__swatch[data-cat="warm"])) {
  display: none !important;
}

.tbp-color-studio--scenes:not(.is-wall-open)[data-cat="popular"] .tbp-color-studio__wall {
  min-height: 84px;
}

.tbp-color-studio.is-wall-open .tbp-color-studio__wall,
.tbp-color-studio[data-cat="all"] .tbp-color-studio__wall {
  max-height: 280px;
  flex-wrap: nowrap;
  gap: 0.45rem;
  overflow-x: auto;
  overflow-y: auto;
}

.tbp-color-studio__wall-col {
  display: grid;
  grid-template-columns: repeat(6, 14px);
  gap: 2px;
  flex: 0 0 auto;
}

.tbp-color-studio:not(.is-wall-open):not([data-cat="all"]) .tbp-color-studio__wall {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.28rem;
}

.tbp-color-studio:not(.is-wall-open):not([data-cat="all"]) .tbp-color-studio__wall-col {
  display: contents;
}

.tbp-color-studio:not(.is-wall-open):not([data-cat="all"]) .tbp-color-studio__swatch {
  width: auto;
  height: auto;
  min-height: 0;
}

.tbp-color-studio__swatch {
  appearance: none;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 2px;
  width: 14px;
  height: 14px;
  aspect-ratio: 1;
  background: var(--swatch);
  cursor: pointer;
  position: relative;
  padding: 0;
}

.tbp-color-studio:not(.is-wall-open):not([data-cat="all"]) .tbp-color-studio__swatch {
  width: 100%;
  border-radius: 3px;
  min-height: 22px;
}

.tbp-color-studio__swatch.is-selected {
  outline: 2px solid var(--tbp-red);
  outline-offset: 0;
  z-index: 1;
}

.tbp-color-studio__swatch.is-selected::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.55rem;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  background: rgba(191, 32, 32, 0.28);
  border-radius: inherit;
}

.tbp-color-studio__tip {
  position: fixed;
  z-index: 100000;
  pointer-events: none;
  background: #fff;
  color: var(--tbp-ink);
  border: 1px solid #d8ddd6;
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
  white-space: nowrap;
  transform: translate(-50%, calc(-100% - 10px));
}

.tbp-color-studio__selected {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: #f4f5f3;
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  margin-bottom: 0.55rem;
  min-height: 92px;
  box-sizing: border-box;
}

.tbp-color-studio__trim-chip {
  appearance: none;
  border: 1px solid var(--tbp-line);
  background: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.55rem;
  margin-left: auto;
  cursor: pointer;
  flex: 0 0 auto;
  max-width: 46%;
  text-align: left;
}

.tbp-color-studio__trim-chip-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.14);
  flex: 0 0 auto;
}

.tbp-color-studio__trim-chip-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tbp-color-studio__trim-chip-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--tbp-muted);
  line-height: 1.2;
}

.tbp-color-studio__trim-chip-name {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--tbp-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.tbp-color-studio__trim-chip-chev {
  color: var(--tbp-muted);
  font-size: 1.1rem;
  line-height: 1;
  margin-left: 0.1rem;
}

.tbp-color-studio__selected-swatch {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  flex: 0 0 auto;
}

.tbp-color-studio__selected-meta {
  flex: 1 1 auto;
  min-width: 0;
}

.tbp-color-studio__selected-role,
.tbp-color-studio__selected-code {
  margin: 0 !important;
  font-size: 0.75rem;
  color: var(--tbp-muted);
}

.tbp-color-studio__selected-name {
  margin: 0.1rem 0 !important;
  font-weight: 800;
  color: var(--tbp-ink);
  font-size: 0.95rem;
}

.tbp-color-studio__change,
.tbp-color-studio__modal-change {
  appearance: none;
  border: 0;
  background: none;
  color: var(--tbp-red);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0;
}

.tbp-color-studio__cta,
.tbp-color-studio__submit,
.tbp-color-studio__modal button.tbp-color-studio__submit {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  border: 0 !important;
  border-radius: 8px !important;
  /* Hardcoded fallback: modal is moved to <body>, so parent vars may be missing */
  background: #bf2020 !important;
  background-color: #bf2020 !important;
  background-image: none !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.9rem 1rem;
  cursor: pointer;
  box-shadow: none !important;
}

.tbp-color-studio__cta:disabled {
  background: #c9cec8 !important;
  background-color: #c9cec8 !important;
  color: #ffffff !important;
  cursor: not-allowed;
}

.tbp-color-studio__cta:not(:disabled):hover,
.tbp-color-studio__submit:hover,
.tbp-color-studio__modal button.tbp-color-studio__submit:hover {
  background: #a01b1b !important;
  background-color: #a01b1b !important;
  color: #ffffff !important;
}

/* Modal — right-docked compact panel (mockup) */
.tbp-color-studio__modal[hidden] {
  display: none !important;
}

.tbp-color-studio__modal {
  --tbp-modal-header-gap: calc(var(--tbp-header-offset, 80px) + 0.55rem);
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  /* Keep panel below the fixed site menu */
  padding-top: max(var(--tbp-modal-header-gap), env(safe-area-inset-top));
  padding-right: max(0.85rem, env(safe-area-inset-right));
  padding-bottom: max(0.65rem, env(safe-area-inset-bottom));
  padding-left: max(0.85rem, env(safe-area-inset-left));
  box-sizing: border-box;
}

.tbp-color-studio__modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 16, 14, 0.52);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.tbp-color-studio__modal-dialog {
  position: relative;
  z-index: 1;
  width: min(380px, calc(100vw - 1.6rem));
  max-height: calc(100vh - var(--tbp-modal-header-gap) - 0.85rem);
  max-height: calc(100dvh - var(--tbp-modal-header-gap) - 0.85rem);
  overflow: hidden;
  background: #fff;
  border-radius: 16px;
  padding: 0.7rem 0.9rem 0.8rem;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.32);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translate3d(28px, 0, 0) scale(0.98);
  transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
  margin-top: 0;
}

.tbp-color-studio__modal.is-open .tbp-color-studio__modal-backdrop {
  opacity: 1;
}

.tbp-color-studio__modal.is-open .tbp-color-studio__modal-dialog {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .tbp-color-studio__modal-backdrop,
  .tbp-color-studio__modal-dialog {
    transition: none;
  }
}

.tbp-color-studio__modal-close {
  position: absolute;
  top: 0.4rem;
  right: 0.55rem;
  border: 0;
  background: none;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
  color: #6a726c;
  z-index: 2;
}

.tbp-color-studio__modal-logo {
  display: block;
  width: 104px;
  height: auto;
  margin: 0 auto 0.15rem !important;
}

.tbp-color-studio__modal-title {
  margin: 0 0 0.1rem !important;
  text-align: center;
  font-family: Georgia, "Times New Roman", serif !important;
  font-size: 1.08rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  color: var(--tbp-ink) !important;
}

.tbp-color-studio__modal-lead {
  margin: 0 0 0.4rem !important;
  text-align: center;
  color: var(--tbp-muted);
  font-size: 0.74rem;
  line-height: 1.25;
}

.tbp-color-studio__modal-summary {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
  background: #f3f4f2;
  border-radius: 10px;
  padding: 0.5rem 0.55rem;
  margin-bottom: 0.4rem;
  flex: 0 0 auto;
}

.tbp-color-studio__modal-swatches {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.tbp-color-studio__modal-swatch {
  flex: 1 1 0;
  min-height: 18px;
  display: block;
}

.tbp-color-studio__modal-board {
  display: flex;
  flex-direction: column;
  min-height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.tbp-color-studio__modal-board-siding {
  flex: 1 1 auto;
  min-height: 48px;
  background: #d9d6cf;
}

.tbp-color-studio__modal-board-trim {
  flex: 0 0 22%;
  min-height: 16px;
  background: #f7f5f2;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.tbp-color-studio__modal-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.tbp-color-studio__modal-picks {
  list-style: none;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.tbp-color-studio__modal-pick {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 !important;
  font-size: 0.82rem;
  line-height: 1.25;
  color: var(--tbp-ink);
}

.tbp-color-studio__modal-pick-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex: 0 0 auto;
}

.tbp-color-studio__modal-pick-role {
  color: var(--tbp-muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tbp-color-studio__modal-pick-code {
  color: var(--tbp-muted);
  font-size: 0.78rem;
}

.tbp-color-studio__modal-pick-copy strong {
  font-weight: 700;
}

.tbp-color-studio__modal-role {
  margin: 0 !important;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--tbp-muted);
  letter-spacing: 0.01em;
}

.tbp-color-studio__modal-name {
  margin: 0.05rem 0 0 !important;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--tbp-ink);
  line-height: 1.15;
}

.tbp-color-studio__modal-code {
  margin: 0.05rem 0 0.2rem !important;
  font-size: 0.78rem;
  font-weight: 700;
  color: #3a423c;
}

.tbp-color-studio__modal-trim-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.28rem;
  margin: 0 0 0.2rem !important;
  font-size: 0.74rem;
  font-weight: 600;
  color: #3a423c;
  line-height: 1.2;
}

.tbp-color-studio__modal-trim-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex: 0 0 14px;
}

.tbp-color-studio__modal-change {
  display: inline-block;
  margin-top: 0;
  font-size: 0.78rem !important;
  align-self: flex-start;
}

.tbp-color-studio__form {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}

.tbp-color-studio__form-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-right: 0.1rem;
}

.tbp-color-studio__form-footer {
  flex: 0 0 auto;
  padding-top: 0.35rem;
  background: #fff;
  border-top: 1px solid #e8ebe6;
  margin-top: 0.2rem;
}

.tbp-color-studio__form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.tbp-color-studio__form label {
  display: block;
  margin: 0 0 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--tbp-ink);
}

/* Guard: wpautop can inject <br> into labels when shortcode HTML hits the_content */
.tbp-color-studio__form br,
.tbp-color-studio__modal-dialog > br {
  display: none !important;
}

.tbp-color-studio__field-label {
  display: block;
  margin-bottom: 0.1rem;
  font-weight: 700;
  font-size: 0.74rem;
  color: var(--tbp-ink);
}

.tbp-color-studio__field-label em {
  color: var(--tbp-red);
  font-style: normal;
  font-weight: 600;
}

.tbp-color-studio__form input,
.tbp-color-studio__form select,
.tbp-color-studio__form textarea {
  display: block;
  width: 100%;
  margin-top: 0;
  border: 1px solid #c9d0c8;
  border-radius: 6px;
  padding: 0.34rem 0.5rem;
  font-weight: 500;
  font-size: 0.82rem;
  line-height: 1.2;
  background: #fff;
  color: var(--tbp-ink);
}

.tbp-color-studio__form textarea {
  min-height: 1.9rem;
  max-height: 2.4rem;
  resize: none;
}

.tbp-color-studio__form input:focus,
.tbp-color-studio__form select:focus,
.tbp-color-studio__form textarea:focus {
  outline: 2px solid rgba(191, 32, 32, 0.25);
  border-color: #bf2020;
}

.tbp-color-studio__form-lock {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.05rem 0 0.4rem;
  padding: 0.38rem 0.5rem;
  border: 1px solid #d5dbd4;
  border-radius: 6px;
  background: #f4f5f3;
  color: #3a423c;
  font-size: 0.74rem;
  font-weight: 600;
}

.tbp-color-studio__form-lock-icon {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Crect x='5' y='11' width='14' height='10' rx='2' fill='%235c665e'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3' stroke='%235c665e' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

.tbp-color-studio__form-lock-text strong {
  font-weight: 800;
  color: var(--tbp-ink);
}

.tbp-color-studio__submit,
.tbp-color-studio__modal button.tbp-color-studio__submit {
  margin-top: 0;
  letter-spacing: 0.04em;
  padding: 0.75rem 1rem !important;
  font-size: 0.85rem !important;
  border-radius: 8px !important;
  flex: 0 0 auto;
  min-height: 44px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  visibility: visible !important;
  opacity: 1 !important;
}

.tbp-color-studio__form-status {
  margin: 0.4rem 0 0 !important;
  font-size: 0.8rem;
  color: var(--tbp-ink);
}

html.tbp-color-studio-lock,
html.tbp-color-studio-lock body {
  overflow: hidden;
}

html.tbp-color-studio-lock .tbp-home-process,
html.tbp-color-studio-lock .tbp-home-process__num,
html.tbp-color-studio-lock .et_pb_section,
html.tbp-color-studio-lock .et_pb_row {
  z-index: auto !important;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 980px) {
  .tbp-color-studio,
  .tbp-color-studio__card,
  .tbp-color-studio__preview {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .tbp-color-studio__card,
  .tbp-color-studio__preview {
    overflow: hidden !important;
  }

  .tbp-color-studio--scenes.tbp-color-studio--photo .tbp-color-studio__preview {
    max-height: min(200px, 42vw);
  }

  .tbp-color-studio__canvas,
  .tbp-color-studio__img,
  .tbp-color-studio__img--base {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    left: 0 !important;
    right: 0 !important;
  }
}

@media (max-width: 720px) {
  .tbp-color-studio:not(.is-wall-open):not([data-cat="all"]) .tbp-color-studio__wall {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
  .tbp-color-studio__preview--board {
    height: 108px;
    min-height: 108px;
    max-height: 108px;
  }
}

@media (max-width: 520px) {
  .tbp-color-studio:not(.is-wall-open):not([data-cat="all"]) .tbp-color-studio__wall {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .tbp-color-studio__selected {
    flex-wrap: wrap;
  }
  .tbp-color-studio__trim-chip {
    max-width: 100%;
    width: 100%;
    margin-left: 0;
  }
  .tbp-color-studio__modal {
    --tbp-modal-header-gap: calc(var(--tbp-header-offset, 64px) + 0.4rem);
    justify-content: center;
    align-items: flex-start;
    padding-top: max(var(--tbp-modal-header-gap), env(safe-area-inset-top));
    padding-right: 0.4rem;
    padding-bottom: 0.4rem;
    padding-left: 0.4rem;
  }
  .tbp-color-studio__modal-dialog {
    width: 100%;
    max-width: 100%;
    max-height: calc(100vh - var(--tbp-modal-header-gap) - 0.55rem);
    max-height: calc(100dvh - var(--tbp-modal-header-gap) - 0.55rem);
    border-radius: 14px;
    padding: 0.65rem 0.75rem 0.75rem;
    transform: translate3d(0, 18px, 0) scale(1);
  }
  .tbp-color-studio__modal.is-open .tbp-color-studio__modal-dialog {
    transform: translate3d(0, 0, 0) scale(1);
  }
  .tbp-color-studio__form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .tbp-color-studio__modal-summary {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 0.45rem;
  }
  .tbp-color-studio__modal-board {
    min-height: 64px;
  }
  .tbp-color-studio__toolbar-top {
    flex-wrap: wrap;
  }
}

@media (max-height: 720px) {
  .tbp-color-studio__modal-logo {
    width: 88px;
  }
  .tbp-color-studio__modal-title {
    font-size: 1rem !important;
  }
  .tbp-color-studio__modal-lead {
    display: none;
  }
  .tbp-color-studio__form label {
    margin-bottom: 0.22rem;
  }
  .tbp-color-studio__form input,
  .tbp-color-studio__form select,
  .tbp-color-studio__form textarea {
    padding: 0.3rem 0.45rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 900px) and (min-width: 521px) {
  .tbp-color-studio__modal {
    justify-content: center;
  }
  .tbp-color-studio__modal-dialog {
    width: min(400px, calc(100vw - 2rem));
  }
}
