/* ==========================================================================
   ROYAL MANSION — AI LUXURY SUITE (CONTEXTUAL Q&A + 96-PRESET & LIVE AI STUDIO)
   100% Harmonized with Royal Mansion Brand Identity (--forest, --gold, Gilroy)
   ========================================================================== */

/* ---------- 1. SECTION CONTEXTUAL AI Q&A WIDGET (.rm-ai-qa) ---------- */
.rm-ai-qa {
  margin-top: 42px;
  border-radius: 10px;
  padding: 24px 28px;
  position: relative;
  overflow: hidden;
  transition: all 0.35s var(--ease);
}

/* Light theme (for #story, #values) */
.rm-ai-qa.theme-light {
  background: linear-gradient(135deg, #ffffff 0%, #f9f4eb 100%);
  border: 1px solid rgba(191, 150, 80, 0.42);
  box-shadow: 0 18px 48px rgba(0, 42, 27, 0.08);
  color: var(--ink);
}

/* Dark emerald glass theme (for #amenities, #location, #ai-studio) */
.rm-ai-qa.theme-dark {
  background: linear-gradient(135deg, rgba(0, 38, 24, 0.92) 0%, rgba(0, 22, 14, 0.96) 100%);
  border: 1px solid rgba(211, 170, 99, 0.42);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #ffffff;
}

.rm-ai-qa-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.rm-ai-qa-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 600 11px/1.2 Gilroy, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.rm-ai-qa.theme-light .rm-ai-qa-badge {
  color: var(--forest);
}

.rm-ai-qa.theme-dark .rm-ai-qa-badge {
  color: var(--gold2);
}

.rm-ai-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: rmPulse 2s infinite;
  flex-shrink: 0;
}

@keyframes rmPulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.rm-ai-qa-sub {
  font-size: 12.5px;
  opacity: 0.78;
  margin: 0;
}

/* Smart FAQ Chips */
.rm-ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rm-ai-chip {
  appearance: none;
  border: 1px solid rgba(191, 150, 80, 0.45);
  border-radius: 999px;
  padding: 9px 16px;
  font: 600 12.5px/1.35 Myriad, Arial, sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s var(--ease);
  text-align: left;
}

.rm-ai-qa.theme-light .rm-ai-chip {
  background: #f5efe3;
  color: var(--ink);
}

.rm-ai-qa.theme-light .rm-ai-chip:hover,
.rm-ai-qa.theme-light .rm-ai-chip.is-active {
  background: var(--forest);
  color: var(--gold2);
  border-color: var(--forest);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 61, 40, 0.18);
}

.rm-ai-qa.theme-dark .rm-ai-chip {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(211, 170, 99, 0.35);
}

.rm-ai-qa.theme-dark .rm-ai-chip:hover,
.rm-ai-qa.theme-dark .rm-ai-chip.is-active {
  background: linear-gradient(110deg, #c89a4e, #efd18d);
  color: #0e291f;
  border-color: var(--gold2);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(211, 170, 99, 0.28);
}

.rm-ai-chip i {
  font-style: normal;
  color: var(--gold);
  font-size: 11px;
}

.rm-ai-qa.theme-dark .rm-ai-chip:hover i,
.rm-ai-qa.theme-dark .rm-ai-chip.is-active i {
  color: #0e291f;
}

/* Conversation Thread inside Section */
.rm-ai-thread {
  display: none;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed rgba(191, 150, 80, 0.35);
}

.rm-ai-thread.is-open {
  display: block;
  animation: rmFadeIn 0.35s var(--ease);
}

@keyframes rmFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.rm-ai-messages {
  max-height: 340px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 6px;
  margin-bottom: 14px;
}

.rm-ai-msg {
  padding: 13px 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.58;
  max-width: 92%;
}

.rm-ai-msg.is-user {
  align-self: flex-end;
  background: linear-gradient(110deg, #c89a4e, #efd18d);
  color: #102a20;
  font-weight: 600;
  border-bottom-right-radius: 2px;
}

.rm-ai-qa.theme-light .rm-ai-msg.is-bot {
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid #e2d7c3;
  border-left: 3px solid var(--forest);
  color: var(--ink);
  border-bottom-left-radius: 2px;
}

.rm-ai-qa.theme-dark .rm-ai-msg.is-bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(211, 170, 99, 0.28);
  border-left: 3px solid var(--gold2);
  color: rgba(255, 255, 255, 0.94);
  border-bottom-left-radius: 2px;
}

.rm-ai-msg-title {
  display: block;
  font: 600 10px/1.2 Gilroy, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
  color: #af7c35;
}

.rm-ai-qa.theme-dark .rm-ai-msg-title {
  color: var(--gold2);
}

.rm-ai-msg-cta {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(191, 150, 80, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.rm-ai-msg-cta a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 4px;
  background: var(--gold);
  color: #0e291f;
  font: 600 10.5px/1.2 Gilroy, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.rm-ai-followup-label {
  font: 600 10px/1.2 Gilroy, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.72;
  margin: 8px 0 8px;
  display: block;
}

.rm-ai-followups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.rm-ai-followup-btn {
  border: 1px dashed rgba(191, 150, 80, 0.55);
  background: transparent;
  color: inherit;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.rm-ai-followup-btn:hover {
  background: rgba(211, 170, 99, 0.2);
  border-style: solid;
}

.rm-ai-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.rm-ai-input {
  flex: 1 1 auto;
  height: 44px;
  padding: 0 16px;
  border-radius: 6px;
  border: 1px solid rgba(191, 150, 80, 0.48);
  font-size: 13.5px;
  outline: none;
}

.rm-ai-qa.theme-light .rm-ai-input {
  background: #ffffff;
  color: var(--ink);
}

.rm-ai-qa.theme-dark .rm-ai-input {
  background: rgba(0, 18, 11, 0.78);
  color: #ffffff;
}

.rm-ai-send {
  height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(110deg, #c89a4e, #efd18d);
  color: #102a20;
  font: 600 11px Gilroy, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s, box-shadow 0.2s;
}

.rm-ai-send:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(211, 170, 99, 0.35);
}


/* ---------- 2. AI INTERIOR & LAYOUT STUDIO SECTION (#ai-studio) ---------- */
.ai-studio-sec {
  padding: 92px 0 96px;
  background:
    radial-gradient(circle at 15% 10%, rgba(211, 170, 99, 0.14), transparent 32%),
    radial-gradient(circle at 88% 85%, rgba(11, 90, 54, 0.45), transparent 38%),
    linear-gradient(180deg, #001f14 0%, #00150d 100%);
  color: #ffffff;
  border-top: 1px solid rgba(211, 170, 99, 0.3);
  border-bottom: 1px solid rgba(211, 170, 99, 0.3);
  position: relative;
}

.ai-studio-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.ai-studio-title-wrap h2 {
  font: 600 clamp(28px, 3vw, 46px)/1.16 Gilroy, sans-serif;
  text-transform: uppercase;
  margin: 0 0 8px;
  color: #ffffff;
}

.ai-studio-title-wrap p.ai-studio-desc {
  margin: 0;
  max-width: 680px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 15px;
}

.ai-quota-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border-radius: 999px;
  background: rgba(211, 170, 99, 0.14);
  border: 1px solid rgba(242, 209, 139, 0.55);
  color: var(--gold2);
  font: 600 11.5px/1.2 Gilroy, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ai-quota-badge.is-used {
  background: rgba(220, 38, 38, 0.18);
  border-color: rgba(248, 113, 113, 0.6);
  color: #fca5a5;
}

.ai-quota-badge.is-unlocked {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(74, 222, 128, 0.65);
  color: #86efac;
}

/* Studio Mode Tabs (AI Generator vs 96 Presets Catalog) */
.ai-mode-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 26px;
  border-bottom: 1px solid rgba(211, 170, 99, 0.25);
  padding-bottom: 16px;
  flex-wrap: wrap;
}

.ai-mode-tab {
  padding: 12px 22px;
  border-radius: 6px;
  border: 1px solid rgba(211, 170, 99, 0.35);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.82);
  font: 600 12px/1.2 Gilroy, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.ai-mode-tab.is-active {
  background: linear-gradient(110deg, #c89a4e, #efd18d);
  color: #0e291f;
  border-color: var(--gold2);
  box-shadow: 0 10px 28px rgba(211, 170, 99, 0.28);
}

.ai-mode-tab span.count-pill {
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 10px;
  background: rgba(0, 29, 19, 0.22);
  color: inherit;
}

/* Main Studio Workspace Layout */
.ai-workspace {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 28px;
  align-items: start;
}

/* Control Panel (Left) */
.ai-controls-card {
  background: linear-gradient(180deg, rgba(0, 42, 27, 0.9) 0%, rgba(0, 24, 15, 0.95) 100%);
  border: 1px solid rgba(211, 170, 99, 0.38);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
}

.ai-ctrl-group {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-ctrl-group:last-of-type {
  border-bottom: 0;
  margin-bottom: 14px;
  padding-bottom: 0;
}

.ai-ctrl-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: 600 11px/1.2 Gilroy, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold2);
  margin-bottom: 10px;
}

.ai-ctrl-label small {
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
  text-transform: none;
  letter-spacing: 0;
}

.ai-opt-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.ai-opt-grid.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.ai-opt-btn {
  padding: 10px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.86);
  font: 600 11.5px/1.25 Gilroy, sans-serif;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-opt-btn small {
  font: 400 10.5px/1.2 Myriad, sans-serif;
  color: rgba(255, 255, 255, 0.58);
}

.ai-opt-btn:hover {
  border-color: rgba(211, 170, 99, 0.65);
  background: rgba(211, 170, 99, 0.1);
}

.ai-opt-btn.is-selected {
  background: linear-gradient(135deg, rgba(211, 170, 99, 0.26), rgba(242, 209, 139, 0.12));
  border: 1.5px solid var(--gold2);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(211, 170, 99, 0.2);
}

.ai-opt-btn.is-selected small {
  color: var(--gold2);
}

/* Color Swatch Dots */
.ai-swatch-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ai-swatch-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  display: inline-block;
}

/* Structure-Locked Prompt Box */
.ai-prompt-box {
  width: 100%;
  min-height: 68px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid rgba(211, 170, 99, 0.4);
  background: rgba(0, 14, 9, 0.85);
  color: #f3dba1;
  font: 12.5px/1.45 Myriad, sans-serif;
  resize: vertical;
  outline: none;
}

.ai-prompt-lock-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #86efac;
  margin-top: 6px;
}

/* Generate CTA Button */
.btn-ai-generate {
  width: 100%;
  min-height: 54px;
  margin-top: 12px;
  padding: 12px 18px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(105deg, #c89a4e 0%, #f3dba1 52%, #c89a4e 100%);
  background-size: 200% auto;
  color: #0b241a;
  font: 600 12px/1.25 Gilroy, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 14px 34px rgba(211, 170, 99, 0.35);
  transition: all 0.3s var(--ease);
}

.btn-ai-generate:hover {
  background-position: right center;
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(211, 170, 99, 0.5);
}

/* ---------- 3. RIGHT PANEL: 5-IMAGE RESULT STAGE & OVERLAYS ---------- */
.ai-stage-wrap {
  position: relative;
  background: rgba(0, 24, 15, 0.75);
  border: 1px solid rgba(211, 170, 99, 0.35);
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.45);
}

.ai-stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(211, 170, 99, 0.22);
}

.ai-stage-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ai-tag-pill {
  padding: 5px 11px;
  border-radius: 4px;
  background: rgba(211, 170, 99, 0.16);
  border: 1px solid rgba(211, 170, 99, 0.4);
  color: var(--gold2);
  font: 600 10.5px/1.1 Gilroy, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ai-compare-toggle {
  padding: 7px 14px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
  font: 600 10.5px/1.1 Gilroy, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-compare-toggle:hover,
.ai-compare-toggle.is-active {
  background: var(--gold);
  color: #0e291f;
  border-color: var(--gold2);
}

/* 5-Image Grid: Top row = Floorplan (Left) + Living Room Hero (Right), Bottom row = 3 Angles */
.ai-five-grid {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 16px;
}

.ai-bottom-three {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.ai-card-slot {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #041d13;
  border: 1px solid rgba(211, 170, 99, 0.32);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
}

.ai-card-slot:hover,
.ai-card-slot.is-highlighted {
  transform: translateY(-3px);
  border-color: var(--gold2);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.5);
}

.ai-card-slot.is-floorplan .ai-slot-media {
  background: #fbf8f1;
  padding: 14px;
}

.ai-card-slot.is-floorplan .ai-slot-media img {
  object-fit: contain;
}

.ai-slot-media {
  position: relative;
  height: 270px;
  overflow: hidden;
  background: #02130c;
}

.ai-bottom-three .ai-slot-media {
  height: 215px;
}

.ai-slot-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease), filter 0.45s ease;
}

.ai-card-slot:hover .ai-slot-media img {
  transform: scale(1.03);
}

.ai-slot-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  max-width: calc(100% - 54px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 3;
  padding: 5px 9px;
  border-radius: 4px;
  background: rgba(0, 26, 17, 0.88);
  border: 1px solid rgba(211, 170, 99, 0.55);
  color: var(--gold2);
  font: 600 9.5px/1.1 Gilroy, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  backdrop-filter: blur(6px);
}

.ai-slot-zoom {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 3;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 24, 15, 0.78);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
}

.ai-slot-zoom:hover {
  background: var(--gold);
  color: #0b241a;
}

/* Interactive Camera Pins on Floorplan */
.ai-cam-pin {
  position: absolute;
  z-index: 4;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #003d28, #0b5a36);
  border: 2px solid var(--gold2);
  color: var(--gold2);
  font: 700 10px/1 Gilroy, sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s, background 0.2s;
}

.ai-cam-pin:hover,
.ai-cam-pin.is-active {
  background: var(--gold2);
  color: #002416;
  transform: scale(1.22);
}

.ai-slot-caption {
  padding: 12px 14px;
  background: linear-gradient(180deg, #042217 0%, #02160e 100%);
  border-top: 1px solid rgba(211, 170, 99, 0.22);
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.ai-slot-caption h4 {
  font: 600 13.5px/1.25 Gilroy, sans-serif;
  text-transform: uppercase;
  color: #ffffff;
  margin: 0 0 4px;
}

.ai-slot-caption p {
  font-size: 12px;
  line-height: 1.42;
  color: rgba(255, 255, 255, 0.68);
  margin: 0;
}

/* AI Scanning / Rendering Overlay */
.ai-render-loader {
  position: absolute;
  inset: 0;
  z-index: 25;
  background: rgba(0, 18, 11, 0.92);
  backdrop-filter: blur(10px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
  border-radius: 12px;
}

.ai-render-loader.is-active {
  display: flex;
}

.ai-scanner-ring {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 3px solid rgba(211, 170, 99, 0.22);
  border-top-color: var(--gold2);
  animation: rmSpin 0.9s linear infinite;
  margin-bottom: 18px;
}

@keyframes rmSpin {
  to { transform: rotate(360deg); }
}

.ai-render-step {
  font: 600 14px/1.4 Gilroy, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold2);
  margin: 0 0 8px;
}

.ai-render-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  max-width: 440px;
  margin: 0;
}

/* ---------- 4. 1-CLICK QUOTA LEAD GATE OVERLAY (CHẶN LẦN BẤM THỨ 2) ---------- */
.ai-gate-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: linear-gradient(160deg, rgba(0, 22, 14, 0.96) 0%, rgba(0, 38, 24, 0.95) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 12px;
  border: 1.5px solid var(--gold);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.ai-gate-overlay.is-open {
  display: flex;
  animation: rmFadeIn 0.3s var(--ease);
}

.ai-gate-card {
  max-width: 540px;
  width: 100%;
  background: #f7f2e8;
  color: var(--ink);
  border-radius: 10px;
  padding: 30px 28px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
  border-top: 4px solid var(--gold);
  position: relative;
}

.ai-gate-close {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(0, 61, 40, 0.2);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.ai-gate-badge {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 4px;
  background: var(--forest);
  color: var(--gold2);
  font: 600 10px/1.2 Gilroy, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.ai-gate-card h3 {
  font: 600 22px/1.22 Gilroy, sans-serif;
  text-transform: uppercase;
  margin: 0 0 10px;
  color: var(--forest);
}

.ai-gate-card p {
  font-size: 13.5px;
  line-height: 1.55;
  color: #4a5751;
  margin: 0 0 16px;
}

.ai-gate-summary-box {
  background: #ebe2d1;
  border-left: 3px solid var(--gold);
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 12.5px;
  margin-bottom: 16px;
  color: #20382f;
}

.ai-gate-form {
  display: grid;
  gap: 12px;
}

.ai-gate-form input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid #c9beab;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-size: 14px;
}

.ai-gate-submit {
  height: 48px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(105deg, #003d28, #0b5a36);
  color: var(--gold2);
  font: 600 11.5px Gilroy, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.ai-gate-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 61, 40, 0.28);
}

/* ---------- 5. 96-PRESET LIBRARY DRAWER / PANEL ---------- */
.ai-library-panel {
  display: none;
}

.ai-library-panel.is-active {
  display: block;
  animation: rmFadeIn 0.35s var(--ease);
}

.ai-lib-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.ai-lib-filter-btn {
  padding: 8px 16px;
  border-radius: 99px;
  border: 1px solid rgba(211, 170, 99, 0.38);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.85);
  font: 600 11px Gilroy, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.ai-lib-filter-btn.is-active {
  background: var(--gold);
  color: #0b241a;
  border-color: var(--gold2);
}

.ai-lib-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-height: 620px;
  overflow-y: auto;
  padding-right: 6px;
}

.ai-lib-item {
  background: rgba(0, 32, 20, 0.85);
  border: 1px solid rgba(211, 170, 99, 0.3);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}

.ai-lib-item:hover {
  transform: translateY(-4px);
  border-color: var(--gold2);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
}

.ai-lib-thumb {
  position: relative;
  height: 150px;
  overflow: hidden;
}

.ai-lib-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ai-lib-code {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(0, 22, 14, 0.88);
  color: var(--gold2);
  font: 600 9.5px Gilroy, sans-serif;
  border: 1px solid rgba(211, 170, 99, 0.45);
}

.ai-lib-meta {
  padding: 12px;
}

.ai-lib-meta h5 {
  font: 600 12.5px/1.3 Gilroy, sans-serif;
  color: #ffffff;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.ai-lib-meta p {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
}

/* Responsive adjustments */
@media (max-width: 1120px) {
  .ai-workspace {
    grid-template-columns: 1fr;
  }
  .ai-lib-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .ai-five-grid {
    grid-template-columns: 1fr;
  }
  .ai-bottom-three {
    grid-template-columns: 1fr;
  }
  .ai-opt-grid {
    grid-template-columns: 1fr 1fr;
  }
  .ai-lib-grid {
    grid-template-columns: 1fr 1fr;
  }
  .rm-ai-qa {
    padding: 18px 16px;
  }
  .rm-ai-input-row {
    flex-direction: column;
    align-items: stretch;
  }
  .rm-ai-send {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .ai-lib-grid {
    grid-template-columns: 1fr;
  }
}
