#chatModal.ai-modal {
  padding: 28px;
  background: rgba(2, 3, 4, .84);
  backdrop-filter: blur(18px);
}

#chatModal .ai-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1020px, 100%);
  height: min(820px, 92dvh);
  min-height: 0;
  overflow: hidden;
  border: 1px solid #424748;
  border-radius: 16px;
  background: #0a0c0d;
  box-shadow: 0 36px 110px #000c, 0 1px 0 #ffffff0d inset;
}

.ai-header {
  position: relative;
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: center;
  padding: 12px 68px;
  border-bottom: 1px solid #292e2f;
  background: #0c0e0f;
}
.ai-brand { display: flex; min-width: 0; align-items: center; gap: 12px; }
.ai-mark {
  display: block;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  overflow: hidden;
  border: 1px solid #555b5b;
  border-radius: 50%;
  background-color: #101314;
  box-shadow: 0 0 0 4px #ffffff08;
}
.rf-logo, .rf-avatar-logo {
  background-image: url('rf-site-reference.png');
  background-repeat: no-repeat;
  background-size: 660px auto;
  background-position: -17px 8px;
}
.ai-brand-copy { display: grid; gap: 4px; }
.ai-brand-copy strong { color: #f2f3f1; font: 600 12px var(--d); letter-spacing: .23em; }
.ai-brand-copy span { color: #969c9d; font-size: 10px; letter-spacing: .08em; }
#chatModal .ai-close {
  position: absolute;
  top: 50%;
  right: 20px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid #343a3b;
  border-radius: 50%;
  color: #dfe1df;
  font-size: 21px;
  transition: border-color .2s, background .2s;
}
#chatModal .ai-close:hover { border-color: #a9aeae; background: #1b1f20; }

.ai-body { min-height: 0; flex: 1; overflow: hidden; background: radial-gradient(ellipse at 50% -18%, #1b2021 0, #0d1011 45%, #090b0c 100%); }
#chatModal .chatLog {
  display: flex;
  width: min(820px, 100%);
  height: 100%;
  flex-direction: column;
  gap: 26px;
  overflow: auto;
  margin: 0 auto;
  padding: 36px 28px 40px;
  scroll-behavior: smooth;
  scrollbar-color: #454b4c transparent;
}
.ai-welcome {
  position: relative;
  max-width: 760px;
  padding: 8px 0 24px;
  border-bottom: 1px solid #343a3b;
}
.ai-welcome::after { position: absolute; right: 0; bottom: -1px; width: 74px; height: 2px; background: #c8d1cd; content: ''; }
.ai-eyebrow { margin: 0 0 11px; color: #abb3b1; font-size: 10px; font-weight: 600; letter-spacing: .17em; text-transform: uppercase; }
.ai-welcome h1 { margin: 0 0 12px; color: #f4f5f2; font: 500 clamp(25px, 3vw, 34px)/1.2 var(--d); letter-spacing: -.035em; }
.ai-welcome p { max-width: 690px; margin: 0; color: #b8bfbd; font-size: 14px; line-height: 1.75; }
.ai-message { display: flex; width: fit-content; max-width: 88%; align-items: flex-start; gap: 12px; }
.ai-message.user { margin-left: auto; flex-direction: row-reverse; }
.ai-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid #4d5455;
  border-radius: 50%;
  color: #e9ebe8;
  background-color: #141819;
  font: 600 10px var(--d);
  letter-spacing: .04em;
}
.ai-message.assistant .ai-avatar {
  border-color: #59605f;
  background-color: #101314;
  background-size: 555px auto;
  background-position: -14px 7px;
}
.ai-message.user .ai-avatar { border-color: #aeb4b1; color: #202625; background: #cdd2ce; }
.ai-message-body { min-width: 0; }
.ai-message-label { display: block; margin: 2px 0 7px 2px; color: #9da5a4; font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
#chatModal .bubble {
  max-width: 100%;
  margin: 0;
  padding: 14px 17px;
  border: 1px solid #333a3a;
  border-radius: 4px 14px 14px 14px;
  color: #e7eae7;
  background: #171b1c;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#chatModal .ai-message.user .bubble { border-color: #d7dbd7; border-radius: 14px 4px 14px 14px; color: #151918; background: #d7dbd7; }
#chatModal .bubble small { display: none; }

.ai-composer { max-height: 66dvh; overflow-y: auto; border-top: 1px solid #292e2f; padding: 16px 28px 20px; background: #0b0d0e; scrollbar-color: #454b4c transparent; }
.ai-compose-box { max-width: 820px; margin: 0 auto; border: 1px solid #42494a; border-radius: 12px; background: #111516; transition: border-color .2s, box-shadow .2s; }
.ai-compose-box:focus-within { border-color: #8c9694; box-shadow: 0 0 0 3px #ffffff0a; }
#chatModal #messageInput { display: block; width: 100%; min-height: 70px; max-height: 180px; resize: vertical; border: 0; outline: 0; padding: 15px 17px 8px; color: #f0f2ef; background: transparent; font: 400 14px/1.6 var(--m); }
#chatModal #messageInput::placeholder { color: #828989; }
.ai-compose-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 12px 11px; }
.ai-upload { position: relative; display: inline-flex; min-height: 36px; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid #394041; border-radius: 7px; color: #c5cbc8; cursor: pointer; font-size: 12px; transition: border-color .2s, color .2s, background .2s; }
.ai-upload:hover { border-color: #87908e; color: #f2f4f1; background: #1b2021; }
.ai-upload > span:first-child { color: #d5dad6; font-size: 16px; }
.ai-upload input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ai-contact-card { max-width: 820px; margin: 12px auto; padding: 16px; border: 1px solid #3c4444; border-radius: 10px; background: #121617; }
.ai-contact-card[hidden] { display: none !important; }
.ai-contact-heading { color: #f0f2ef; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.ai-contact-card > p { margin: 7px 0 13px; color: #b1b8b5; font-size: 12px; line-height: 1.6; }
.ai-contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.ai-contact-grid label { display: grid; gap: 6px; color: #b9c0bd; font-size: 11px; }
.ai-contact-grid input { width: 100%; min-width: 0; border: 1px solid #3c4444; border-radius: 6px; outline: 0; padding: 10px 11px; color: #f0f2ef; background: #0c0f10; font: 400 13px/1.4 var(--m); }
.ai-contact-grid input:focus { border-color: #abb5b1; box-shadow: 0 0 0 2px #fff1; }
.ai-contact-grid input::placeholder { color: #777f7d; }
.ai-consent { display: flex; max-width: 820px; align-items: flex-start; gap: 9px; margin: 11px auto; color: #a3aaa8; font-size: 12px; line-height: 1.55; }
.ai-consent input { flex: 0 0 auto; width: 15px; height: 15px; margin-top: 2px; accent-color: #c8d1cd; }
.ai-compose-actions { display: flex; max-width: 820px; align-items: center; justify-content: space-between; gap: 12px; margin: 0 auto; }
.ai-photo-state { color: #9da5a3; font-size: 12px; }
.ai-action-group { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
#chatModal .ai-send, #chatModal .ai-submit { min-height: 42px; border-radius: 7px; font-size: 11px; font-weight: 600; letter-spacing: .06em; }
#chatModal .ai-send { border-color: #505858; color: #e1e5e2; background: #151a1b; }
#chatModal .ai-send:hover { border-color: #a6aeab; background: #202626; }
#chatModal .ai-submit { border-color: #d5dbd6; color: #101514; background: #d5dbd6; }
#chatModal .ai-submit:hover { border-color: #f1f3f0; background: #f1f3f0; }
#chatModal .ai-action-group button:disabled { cursor: wait; opacity: .55; }

#products .catalog-chat-btn {
  position: absolute;
  z-index: 3;
  right: 11px;
  bottom: 11px;
  max-width: 56%;
  border: 1px solid #aeb5b1;
  border-radius: 5px;
  padding: 8px 9px;
  color: #f0f2ef;
  background: #090c0dcc;
  font: 600 9px/1.2 var(--d);
  letter-spacing: .04em;
  transition: color .18s, background .18s, border-color .18s;
}
#products .catalog-chat-btn:hover { border-color: #e2e7e2; color: #101514; background: #e2e7e2; }

@media (max-width: 760px) {
  #chatModal.ai-modal { padding: 0; }
  #chatModal .ai-dialog { width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
  .ai-header { min-height: 68px; padding: 9px 58px; }
  .ai-mark { width: 42px; height: 42px; flex-basis: 42px; }
  .rf-logo { background-size: 600px auto; background-position: -15px 7px; }
  .ai-brand-copy strong { font-size: 11px; letter-spacing: .18em; }
  .ai-brand-copy span { font-size: 10px; }
  #chatModal .ai-close { right: 12px; width: 36px; height: 36px; }
  #chatModal .chatLog { gap: 21px; padding: 25px 17px 24px; }
  .ai-welcome { padding: 3px 0 20px; }
  .ai-welcome h1 { font-size: 27px; }
  .ai-welcome p { font-size: 14px; line-height: 1.65; }
  .ai-message { max-width: 100%; gap: 9px; }
  .ai-avatar { width: 34px; height: 34px; flex-basis: 34px; }
  .ai-message.assistant .ai-avatar { background-size: 510px auto; background-position: -13px 6px; }
  #chatModal .bubble { padding: 12px 14px; font-size: 14px; }
  .ai-composer { max-height: 50dvh; padding: 10px 13px max(13px, env(safe-area-inset-bottom)); }
  #chatModal #messageInput { min-height: 60px; padding: 12px 13px 8px; font-size: 16px; }
  .ai-compose-tools { gap: 6px; padding: 0 8px 9px; }
  .ai-upload { min-height: 34px; padding: 6px 9px; font-size: 11px; }
  .ai-contact-card { margin: 9px auto; padding: 12px; }
  .ai-contact-grid { grid-template-columns: 1fr; gap: 9px; }
  .ai-contact-grid input { padding: 10px; font-size: 16px; }
  .ai-consent { margin: 9px auto; font-size: 11px; }
  .ai-compose-actions { align-items: stretch; flex-direction: column; gap: 9px; }
  .ai-photo-state { width: 100%; }
  .ai-action-group { width: 100%; }
  #chatModal .ai-action-group button { flex: 1; padding: 10px 8px; font-size: 10px; }
  #products .catalog-chat-btn { right: 8px; bottom: 9px; max-width: 58%; padding: 7px 8px; font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  #chatModal *, #chatModal *::before, #chatModal *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Premium studio treatment for the RIM FORGED design assistant. */
#chatModal.ai-modal {
  padding: clamp(12px, 3vw, 36px);
  background: rgba(3, 5, 6, .78);
  backdrop-filter: blur(24px) saturate(115%);
}
#chatModal .ai-dialog {
  width: min(940px, 100%);
  height: min(790px, 92dvh);
  border: 1px solid #555c5a;
  border-radius: 20px;
  background: #0b0e0e;
  box-shadow: 0 44px 140px #000e, 0 1px 0 #fff1 inset, 0 0 0 1px #000;
}
.ai-header {
  min-height: 88px;
  padding: 12px 72px;
  border-bottom-color: #252a29;
  background: linear-gradient(180deg, #141817 0%, #0d1010 100%);
}
.ai-brand {
  flex-direction: column;
  gap: 5px;
  text-align: center;
}
.ai-mark {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  border-color: #727a76;
  box-shadow: 0 0 0 4px #ffffff08, 0 0 22px #cfd6d21a;
}
.rf-logo { background-size: 600px auto; background-position: -16px 7px; }
.ai-brand-copy { justify-items: center; gap: 2px; }
.ai-brand-copy strong { font-size: 11px; letter-spacing: .28em; }
.ai-brand-copy span { font-size: 10px; letter-spacing: .1em; }
#chatModal .ai-close {
  right: 22px;
  width: 40px;
  height: 40px;
  border-color: #3e4542;
  background: #ffffff05;
}
#chatModal .ai-close:hover { border-color: #aeb7b1; background: #ffffff10; }
.ai-body {
  background:
    radial-gradient(ellipse at 50% -20%, #29302d66 0, transparent 48%),
    linear-gradient(160deg, #0e1211 0%, #090b0b 72%);
}
#chatModal .chatLog { width: min(760px, 100%); gap: 24px; padding: 34px 28px 42px; }
.ai-welcome {
  max-width: 100%;
  padding: 22px 25px 24px;
  border: 1px solid #343b38;
  border-radius: 14px;
  background: linear-gradient(135deg, #171c1a 0%, #101413 75%);
  box-shadow: 0 14px 36px #0003, 0 1px 0 #fff08 inset;
}
.ai-welcome::after { left: 25px; right: auto; width: 54px; height: 2px; background: #c7cfca; }
.ai-eyebrow { color: #aeb8b2; font-size: 10px; letter-spacing: .2em; }
.ai-welcome h1 { font-size: clamp(28px, 4vw, 38px); letter-spacing: -.045em; }
.ai-welcome p { color: #c0c7c2; font-size: 14px; line-height: 1.75; }
.ai-message { max-width: 84%; gap: 10px; }
.ai-avatar {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-color: #4c5550;
  background-color: #171c1a;
}
.ai-message.assistant .ai-avatar { background-size: 510px auto; background-position: -13px 6px; }
.ai-message-label { color: #a9b2ac; font-size: 10px; letter-spacing: .13em; }
#chatModal .bubble {
  border-color: #353d39;
  border-radius: 5px 15px 15px 15px;
  padding: 14px 17px;
  color: #e9ede9;
  background: linear-gradient(145deg, #1a201d, #141917);
  line-height: 1.7;
  box-shadow: 0 8px 22px #0002;
}
#chatModal .ai-message.user .bubble {
  border-color: #c6cec8;
  border-radius: 15px 5px 15px 15px;
  color: #171b19;
  background: linear-gradient(145deg, #e1e5e1, #c7cec9);
}
.ai-composer {
  border-top-color: #292f2c;
  padding: 17px 28px 20px;
  background: linear-gradient(180deg, #101413, #0b0e0d);
}
.ai-compose-box {
  border-color: #414a45;
  border-radius: 14px;
  background: #151a18;
  box-shadow: 0 10px 28px #0003;
}
.ai-compose-box:focus-within { border-color: #aab4ad; box-shadow: 0 0 0 3px #d8e0da12, 0 10px 28px #0004; }
#chatModal #messageInput { min-height: 66px; font-family: var(--d); }
.ai-upload { border-radius: 9px; }
.ai-contact-card { border-color: #404944; border-radius: 14px; background: linear-gradient(145deg, #171c1a, #101413); }
.ai-contact-grid input { border-radius: 8px; }
#chatModal .ai-send, #chatModal .ai-submit { min-height: 44px; border-radius: 9px; letter-spacing: .08em; }
#chatModal .ai-submit { border-color: #dce2dd; background: linear-gradient(135deg, #e1e6e1, #c3cbc5); }
#chatModal .ai-submit:hover { background: #f0f3ef; }

@media (max-width: 760px) {
  #chatModal.ai-modal { padding: 0; }
  #chatModal .ai-dialog { height: 100dvh; border: 0; border-radius: 0; }
  .ai-header { min-height: 82px; padding: 9px 58px; }
  .ai-mark { width: 38px; height: 38px; flex-basis: 38px; }
  .rf-logo { background-size: 560px auto; background-position: -15px 7px; }
  #chatModal .chatLog { gap: 19px; padding: 22px 16px 24px; }
  .ai-welcome { padding: 19px 18px 21px; border-radius: 13px; }
  .ai-welcome::after { left: 18px; }
  .ai-welcome h1 { font-size: 28px; }
  .ai-message { max-width: 100%; }
  .ai-composer { padding: 10px 13px max(13px, env(safe-area-inset-bottom)); }
}

/* Full wheel catalogue imported from the supplied PDF. */
.catalog-controls { display: grid; gap: 12px; margin: 0 16px 10px; }
#wheelFilters.filters { display: flex; gap: 8px; overflow-x: auto; margin: 0; padding: 0 0 5px; scrollbar-color: #424846 transparent; }
#wheelFilters .filter { min-width: 0; height: 36px; flex: 0 0 auto; padding: 0 13px; border-color: #343b37; border-radius: 20px; font: 600 10px/1 var(--d); letter-spacing: .06em; }
#wheelFilters .filter.active, #wheelFilters .filter:hover { border-color: #d8dfd9; color: #111513; background: #d8dfd9; }
.catalog-search { display: flex; min-height: 42px; align-items: center; gap: 10px; border: 1px solid #343b37; border-radius: 9px; padding: 0 13px; background: #101413; color: #aeb6b1; }
.catalog-search:focus-within { border-color: #aeb8b1; box-shadow: 0 0 0 3px #d8e0da12; }
.catalog-search > span { color: #d0d7d2; font-size: 22px; line-height: 1; }
.catalog-search input { width: 100%; border: 0; outline: 0; color: #f0f2ef; background: transparent; font: 400 13px var(--d); }
.catalog-search input::placeholder { color: #858d88; }
.catalog-results-count { margin: 0 16px 12px; color: #959e98; font-size: 11px; letter-spacing: .04em; }
#catalog .products { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
#catalog .product { height: 300px; border-color: #303633; border-radius: 9px; background: #f4f5f2; }
#catalog .productPhoto { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; padding: 7px; background: #f4f5f2; filter: none; transition: transform .35s; }
#catalog .product:hover .productPhoto { transform: scale(1.035); filter: none; }
  #catalog .product:after { inset: 62% 0 0; background: linear-gradient(transparent, #050607f2); pointer-events: none; }
#catalog .fav { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid #1113; border-radius: 50%; color: #171b19; background: #ffffffd9; font-size: 18px; }
#catalog .fav.selected { color: #8d302c; }
#catalog .prodText strong { font-family: var(--d); font-weight: 600; }
#catalog .prodText small { color: #c0c7c2; font-size: 10px; }
#catalog .catalog-chat-btn { max-width: 62%; border-color: #bfc6c1; border-radius: 7px; font-size: 9px; }
#catalog .product[hidden] { display: none !important; }
@media (max-width: 1100px) {
  #catalog .products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #catalog .product { height: 285px; }
}
@media (max-width: 760px) {
  .catalog-controls { margin: 0 0 10px; }
  #wheelFilters .filter { height: 34px; padding: 0 11px; }
  .catalog-results-count { margin-left: 0; margin-right: 0; }
  #catalog .products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  #catalog .product { height: clamp(210px, 64vw, 270px); }
  #catalog .product:after { inset: 58% 0 0; }
  #catalog .prodText { left: 10px; bottom: 58px; }
  #catalog .prodText strong { font-size: 13px; }
  #catalog .prodText small { font-size: 9px; }
  #catalog .catalog-chat-btn { left: 7px; right: 7px; bottom: 8px; max-width: none; padding: 7px; font-size: 8px; text-align: center; }
}
