/**
 * CEFA Owly Deep Chat — Styles v1.0.12
 *
 * Brand tokens:
 *   Primary Yellow  #fed100
 *   Dark Grey       #4f545c
 *   Bot Bubble      #efefef
 *   Surface         #ffffff
 *
 * Matches Owly UI mockup: dark header with logo + subtitle,
 * yellow launcher FAB, rounded chat panel, action chips.
 */

/* ── Root container ────────────────────────────────────────────── */
#cefa-owly-root {
  --cefa-owly-bottom-offset: 0px;
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: calc(max(18px, env(safe-area-inset-bottom)) + var(--cefa-owly-bottom-offset));
  z-index: 999999;
  font-family: "Avenir Next", Montserrat, "Segoe UI", Arial, sans-serif !important;
  font-size: 14px !important;
  line-height: 1.45 !important;
  color: #4f545c;
}

/* ── Launcher FAB ──────────────────────────────────────────────── */
#cefa-owly-launcher {
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 999px;
  background: #fed100;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

#cefa-owly-launcher[aria-hidden="true"] {
  display: none !important;
}

#cefa-owly-launcher:hover {
  transform: scale(1.06);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

#cefa-owly-launcher:active {
  transform: scale(0.96);
}

#cefa-owly-launcher:focus-visible,
.cefa-owly-header-right button:focus-visible,
#cefa-owly-root .cefa-owly-quick-question:focus-visible,
#cefa-owly-root .cefa-owly-chip:focus-visible,
.cefa-owly-home-card:focus-visible,
.cefa-owly-resource-card:focus-visible,
.cefa-owly-gate-form input:focus-visible,
.cefa-owly-gate-form button:focus-visible,
.cefa-owly-gate-consent input:focus-visible,
.cefa-owly-fallback-form input:focus-visible,
.cefa-owly-fallback-form button:focus-visible,
.cefa-owly-context-form input:focus-visible,
.cefa-owly-context-form select:focus-visible,
.cefa-owly-context-form textarea:focus-visible,
.cefa-owly-context-form button:focus-visible {
  outline: 3px solid #0f62fe;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(15, 98, 254, 0.18);
}

#cefa-owly-launcher img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  background: transparent !important;
  border-radius: 0 !important;
  padding: 0 !important;
  pointer-events: none;
  display: block !important;
  opacity: 1 !important;
  filter: none !important;
  mix-blend-mode: normal !important;
}

#cefa-owly-unread {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #4f545c;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px #fed100;
  display: none;
}

#cefa-owly-unread.has-unread {
  display: inline-block;
}

/* ── Chat panel ────────────────────────────────────────────────── */
#cefa-owly-panel {
  position: absolute;
  right: 0;
  bottom: 76px;
  width: 408px;
  max-width: calc(100vw - 24px);
  height: min(660px, calc(100vh - 104px));
  max-height: calc(100vh - 104px);
  min-height: 0;
  background: #fffdf8;
  border: 1px solid rgba(79, 84, 92, 0.12);
  border-radius: 24px;
  box-shadow: 0 28px 70px rgba(20, 24, 31, 0.22);
  overflow: hidden;
  display: none;
  flex-direction: column;
  /* Animate in */
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#cefa-owly-root[data-cefa-owly-open="1"] #cefa-owly-launcher {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.94);
}

#cefa-owly-root[data-cefa-owly-open="1"] #cefa-owly-panel {
  bottom: 0;
}

#cefa-owly-panel[aria-hidden="false"] {
  display: flex;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ── Header (matches Owly mockup) ──────────────────────────────── */
#cefa-owly-header {
  min-height: 80px;
  background: linear-gradient(135deg, #505661 0%, #383d45 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cefa-owly-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.cefa-owly-header-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  flex: 0 0 auto;
}

.cefa-owly-header-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block !important;
  opacity: 1 !important;
  filter: none !important;
  mix-blend-mode: normal !important;
}

.cefa-owly-header-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.cefa-owly-header-title {
  font-weight: 700;
  font-size: 17px !important;
  line-height: 1.1;
  color: #ffffff;
  letter-spacing: 0 !important;
  text-transform: none !important;
  margin: 0;
}

.cefa-owly-header-subtitle {
  font-size: 13px !important;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
  letter-spacing: 0 !important;
  text-transform: none !important;
  margin-top: 2px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.cefa-owly-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.cefa-owly-header-right button {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 19px;
  line-height: 1;
  font-weight: 600;
  cursor: pointer;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  flex: 0 0 auto;
  align-self: center;
  padding: 0;
}

.cefa-owly-header-right button:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

#cefa-owly-reset {
  font-size: 20px;
}

#cefa-owly-handoff {
  font-size: 16px;
}

/* ── Deep Chat element ─────────────────────────────────────────── */
#cefa-owly-chat {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  background: linear-gradient(180deg, #fffdf8 0%, #ffffff 44%);
}

#cefa-owly-quick-questions {
  display: none;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(79, 84, 92, 0.12);
  background: rgba(255, 250, 221, 0.72);
}

#cefa-owly-root .cefa-owly-quick-question {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  min-height: 44px;
  box-sizing: border-box;
  border: 1px solid rgba(254, 209, 0, 0.42) !important;
  border-left: 4px solid #fed100 !important;
  border-radius: 16px !important;
  background: linear-gradient(180deg, #ffffff 0%, #fff8d8 100%) !important;
  color: #4f545c !important;
  padding: 10px 12px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  text-align: left !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  box-shadow: 0 8px 18px rgba(43, 48, 58, 0.05) !important;
  letter-spacing: 0.01em !important;
  text-transform: none !important;
  font-family: "Avenir Next", Montserrat, "Segoe UI", Arial, sans-serif !important;
}

#cefa-owly-root .cefa-owly-quick-question:hover {
  background: linear-gradient(180deg, #fffdf2 0%, #fff2b8 100%) !important;
  border-color: rgba(254, 209, 0, 0.72) !important;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(43, 48, 58, 0.08) !important;
}

.cefa-owly-inline-quick-questions {
  align-self: flex-start;
  width: min(100%, 332px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border-radius: 20px;
  border: 1px solid rgba(254, 209, 0, 0.32);
  background:
    linear-gradient(180deg, rgba(255, 250, 228, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
  box-shadow: 0 12px 24px rgba(43, 48, 58, 0.08);
}

.cefa-owly-inline-quick-questions.is-starter {
  width: min(100%, 310px);
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.cefa-owly-inline-quick-questions .cefa-owly-assist-title {
  grid-column: 1 / -1;
}

.cefa-owly-inline-quick-questions .cefa-owly-quick-question {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  min-height: 44px;
}

.cefa-owly-inline-quick-questions .cefa-owly-quick-question:last-child:nth-child(4) {
  grid-column: 1 / -1;
}

.cefa-owly-inline-quick-questions.is-starter .cefa-owly-quick-question {
  min-height: 40px;
  border-left: 0 !important;
  border: 1px solid rgba(79, 84, 92, 0.12) !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  padding: 10px 12px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

.cefa-owly-inline-quick-questions.is-starter .cefa-owly-quick-question:hover {
  background: #fffdf4 !important;
  border-color: rgba(254, 209, 0, 0.48) !important;
  box-shadow: none !important;
}

#cefa-owly-gate {
  display: none;
  padding: 12px;
  border-bottom: 1px solid rgba(79, 84, 92, 0.12);
  background: #fff;
}

.cefa-owly-gate-form {
  display: grid;
  gap: 8px;
}

.cefa-owly-gate-copy {
  font-size: 13px;
  color: #4f545c;
}

.cefa-owly-gate-form input {
  min-height: 38px;
  border: 1px solid rgba(79, 84, 92, 0.24);
  border-radius: 8px;
  padding: 0 10px;
}

.cefa-owly-gate-consent {
  font-size: 12px;
  color: #4f545c;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cefa-owly-gate-form button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: #fed100;
  color: #000;
  font-weight: 600;
  cursor: pointer;
}

/* ── Fallback mode (when Deep Chat script cannot load) ─────────── */
.cefa-owly-fallback {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  background: transparent;
}

.cefa-owly-fallback-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  overscroll-behavior: contain;
}

.cefa-owly-fallback-msg {
  max-width: min(86%, 310px);
  border-radius: 18px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.45;
  min-width: 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
  word-break: break-word;
  letter-spacing: 0 !important;
  text-transform: none !important;
  box-shadow: 0 10px 24px rgba(43, 48, 58, 0.08);
  border: 1px solid rgba(79, 84, 92, 0.08);
}

.cefa-owly-fallback-msg.bot {
  background: #ffffff;
  color: #4f545c;
  align-self: flex-start;
  border-bottom-left-radius: 6px;
}

.cefa-owly-fallback-msg.user {
  background: linear-gradient(180deg, #ffe998 0%, #fed100 100%);
  color: #272310;
  align-self: flex-end;
  border-bottom-right-radius: 6px;
}

.cefa-owly-fallback-msg-structured {
  display: grid;
  gap: 10px;
  white-space: normal;
}

.cefa-owly-bubble-paragraph,
.cefa-owly-bubble-status {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.cefa-owly-bubble-bullets {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.cefa-owly-bubble-bullets li {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.cefa-owly-resource-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(254, 209, 0, 0.45);
  background: linear-gradient(180deg, #fff9dd 0%, #ffffff 100%);
  color: #4f545c;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.cefa-owly-resource-card:hover {
  border-color: rgba(254, 209, 0, 0.78);
  background: linear-gradient(180deg, #fff4bf 0%, #ffffff 100%);
}

.cefa-owly-resource-card-title {
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.cefa-owly-resource-card-summary,
.cefa-owly-resource-card-link {
  font-size: 12px;
  line-height: 1.35;
  color: rgba(79, 84, 92, 0.78);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.cefa-owly-resource-card-link {
  color: #6d7682;
  -webkit-line-clamp: 1;
}

.cefa-owly-pending-msg {
  background: linear-gradient(180deg, #fffef5 0%, #ffffff 100%);
  color: #6d7682;
  border-style: dashed;
}

.cefa-owly-fallback-form {
  border-top: 1px solid rgba(79, 84, 92, 0.08);
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.98);
}

.cefa-owly-fallback-form input {
  min-height: 46px;
  width: 100%;
  min-width: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(79, 84, 92, 0.16);
  border-radius: 14px;
  padding: 0 14px;
  font-size: 14px;
  box-sizing: border-box;
  font-family: "Avenir Next", Montserrat, "Segoe UI", Arial, sans-serif;
  color: #2f3339;
  background: #ffffff;
  box-shadow: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.cefa-owly-fallback-form input::placeholder {
  color: #7a828d;
  opacity: 1;
}

.cefa-owly-fallback-form input:focus,
.cefa-owly-fallback-form input:focus-visible {
  outline: none;
  border-color: rgba(79, 84, 92, 0.28);
  box-shadow: 0 0 0 3px rgba(254, 209, 0, 0.18);
  background: #fffef9;
}

.cefa-owly-fallback-form button {
  min-height: 46px;
  min-width: 86px;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(248, 203, 0, 0.4);
  border-radius: 14px;
  background: #fed100;
  color: #272310;
  font-weight: 700;
  padding: 0 16px;
  cursor: pointer;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 14px !important;
  font-family: "Avenir Next", Montserrat, "Segoe UI", Arial, sans-serif !important;
  box-shadow: none !important;
  box-sizing: border-box;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.cefa-owly-fallback-form button:hover {
  background: #f8cb00;
  border-color: rgba(248, 203, 0, 0.72);
}

.cefa-owly-fallback-form button:focus,
.cefa-owly-fallback-form button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(254, 209, 0, 0.2);
}

.cefa-owly-fallback-form button:disabled,
.cefa-owly-fallback-form input:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

#cefa-owly-quick-questions,
#cefa-owly-actions,
#cefa-owly-forms {
  display: none !important;
}

.cefa-owly-assist-title {
  font-size: 11px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(79, 84, 92, 0.62);
}

.cefa-owly-inline-actions,
.cefa-owly-inline-forms,
.cefa-owly-inline-status {
  align-self: flex-start;
  width: min(100%, 332px);
  max-width: min(100%, 332px);
}

.cefa-owly-inline-actions,
.cefa-owly-inline-forms {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid rgba(254, 209, 0, 0.38);
  background:
    linear-gradient(180deg, rgba(255, 248, 210, 0.98) 0%, rgba(255, 255, 255, 0.98) 100%);
  box-shadow: 0 12px 24px rgba(43, 48, 58, 0.08);
}

.cefa-owly-inline-status {
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.35;
}

.cefa-owly-inline-status.ok {
  background: #ecfdf3;
  color: #067647;
  border: 1px solid #abefc6;
}

.cefa-owly-inline-status.error {
  background: #fef3f2;
  color: #b42318;
  border: 1px solid #fecdca;
}

.cefa-owly-home {
  display: grid;
  gap: 12px;
  padding: 4px 0 2px;
  min-width: 0;
}

.cefa-owly-home.is-compact {
  gap: 8px;
  padding-top: 2px;
}

.cefa-owly-home-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.15;
  color: #2f3339;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.cefa-owly-home-copy {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #5e6670;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.cefa-owly-home-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cefa-owly-home-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none !important;
}

.cefa-owly-home-badge.is-ai {
  background: #fff4c2;
  color: #7a5d00;
}

.cefa-owly-home-badge.is-human {
  background: #eef2ff;
  color: #3741a0;
}

.cefa-owly-home-note {
  font-size: 11px;
  line-height: 1.35;
  color: #7a828d;
}

.cefa-owly-home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.cefa-owly-home-grid.is-compact {
  gap: 6px;
}

.cefa-owly-home-grid .cefa-owly-home-card:last-child:nth-child(3) {
  grid-column: 1 / -1;
}

.cefa-owly-home-card {
  display: grid !important;
  gap: 3px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid rgba(79, 84, 92, 0.12) !important;
  background: #ffffff !important;
  text-align: left;
  color: #2f3339 !important;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(43, 48, 58, 0.05) !important;
  font-family: "Avenir Next", Montserrat, "Segoe UI", Arial, sans-serif !important;
  font-size: 14px !important;
  line-height: 1.35 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.cefa-owly-home.is-compact .cefa-owly-home-copy {
  font-size: 12px;
  line-height: 1.35;
}

.cefa-owly-home.is-compact .cefa-owly-home-card {
  gap: 2px;
  padding: 10px 11px;
  border-radius: 14px;
}

.cefa-owly-home-card:hover {
  border-color: rgba(254, 209, 0, 0.72) !important;
  background: #fffdf4 !important;
  transform: translateY(-1px);
}

.cefa-owly-home-card-title {
  display: block !important;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  color: #2f3339;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.cefa-owly-home.is-compact .cefa-owly-home-card-title {
  font-size: 14px;
  line-height: 1.15;
}

.cefa-owly-home-card-copy,
.cefa-owly-home-quick-title {
  display: block !important;
  font-size: 12px;
  line-height: 1.35;
  color: #69717c;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.cefa-owly-home.is-compact .cefa-owly-home-card-copy {
  font-size: 11px;
  line-height: 1.25;
}

.cefa-owly-home-quick-list {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.cefa-owly-home-resource-grid {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.cefa-owly-home-resource {
  min-width: 0;
}

.cefa-owly-response-quick-replies {
  margin-top: -2px;
}

.cefa-owly-inline-handoff {
  margin-top: -2px;
}

.cefa-owly-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Action chip buttons ───────────────────────────────────────── */
#cefa-owly-root .cefa-owly-chip {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex: 0 1 auto !important;
  width: 100% !important;
  min-height: 44px;
  border: 1px solid rgba(79, 84, 92, 0.12);
  border-radius: 14px;
  padding: 11px 14px;
  background: #ffffff;
  color: #4f545c;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  line-height: 1.3;
  text-transform: none !important;
  letter-spacing: 0 !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: none;
  text-align: left;
  box-shadow: 0 6px 14px rgba(43, 48, 58, 0.05) !important;
  font-family: "Avenir Next", Montserrat, "Segoe UI", Arial, sans-serif !important;
}

#cefa-owly-root .cefa-owly-chip:hover {
  background: #fff3b0;
  border-color: rgba(254, 209, 0, 0.9);
  transform: translateY(-1px);
}

#cefa-owly-root .cefa-owly-chip:active {
  background: #ffe171;
}

.cefa-owly-form-card {
  border: 1px solid rgba(79, 84, 92, 0.12);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.cefa-owly-form-card h4 {
  margin: 0 0 8px;
  color: #4f545c;
  font-size: 14px;
}

.cefa-owly-context-form {
  display: grid;
  gap: 8px;
}

.cefa-owly-context-form label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: #4f545c;
}

.cefa-owly-form-description {
  margin: 0 0 8px;
  font-size: 12px;
  color: rgba(79, 84, 92, 0.78);
}

.cefa-owly-form-fieldset {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
}

.cefa-owly-form-fieldset legend {
  margin: 0;
  padding: 0;
  font-size: 12px;
  color: #4f545c;
}

.cefa-owly-context-form .cefa-owly-choice {
  display: flex;
  align-items: flex-start;
  grid-template-columns: none;
  gap: 7px;
  line-height: 1.35;
}

.cefa-owly-context-form .cefa-owly-choice input {
  border: 0;
  min-height: auto;
  padding: 0;
  width: auto;
  margin-top: 2px;
}

.cefa-owly-context-form input,
.cefa-owly-context-form select,
.cefa-owly-context-form textarea {
  border: 1px solid rgba(79, 84, 92, 0.24);
  border-radius: 8px;
  min-height: 36px;
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
}

.cefa-owly-context-form textarea {
  min-height: 82px;
  resize: vertical;
}

.cefa-owly-context-form button {
  border: 0;
  border-radius: 8px;
  min-height: 36px;
  background: #fed100;
  color: #000;
  font-weight: 600;
  cursor: pointer;
}

.cefa-owly-context-form button:disabled {
  cursor: progress;
  opacity: 0.68;
}

.cefa-owly-form-loading,
.cefa-owly-form-error,
.cefa-owly-form-response {
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 12px;
}

.cefa-owly-form-loading {
  background: rgba(79, 84, 92, 0.06);
  color: rgba(79, 84, 92, 0.75);
}

.cefa-owly-form-error,
.cefa-owly-form-response.error {
  background: #fff4ed;
  color: #b42318;
  border: 1px solid #fecdca;
}

.cefa-owly-form-link {
  display: inline-flex;
  margin-top: 9px;
  color: #4f545c;
  font-weight: 600;
  font-size: 12px;
}

.cefa-owly-form-success {
  border-radius: 8px;
  padding: 10px;
  background: #ecfdf3;
  color: #067647;
  font-size: 12px;
  border: 1px solid #abefc6;
}

/* ── Footer ────────────────────────────────────────────────────── */
#cefa-owly-footer {
  text-align: center;
  padding: 8px 12px 10px;
  font-size: 11px;
  color: rgba(79, 84, 92, 0.45);
  background: rgba(255, 255, 255, 0.92);
  letter-spacing: 0 !important;
  text-transform: none !important;
  border-top: 1px solid rgba(79, 84, 92, 0.06);
}

#cefa-owly-privacy {
  padding: 8px 12px 0;
  font-size: 12px;
  color: rgba(79, 84, 92, 0.8);
}

.cefa-owly-privacy-notice a {
  color: #4f545c;
}

/* ── Mobile responsive ─────────────────────────────────────────── */
@media (max-width: 640px) {
  #cefa-owly-root {
    right: max(10px, env(safe-area-inset-right));
    bottom: calc(max(10px, env(safe-area-inset-bottom)) + var(--cefa-owly-bottom-offset));
  }

  #cefa-owly-launcher {
    width: 58px;
    height: 58px;
  }

  #cefa-owly-launcher img {
    width: 40px;
    height: 40px;
  }

  #cefa-owly-panel {
    width: min(calc(100vw - 12px), 420px);
    bottom: 68px;
    height: min(88vh, calc(100vh - 24px - env(safe-area-inset-bottom)));
    max-height: calc(100vh - 24px - env(safe-area-inset-bottom));
    /* On very small screens, stretch to near full width */
    right: 0;
    border-radius: 24px 24px 18px 18px;
  }

  #cefa-owly-root .cefa-owly-chip {
    width: auto !important;
    max-width: 100%;
    text-align: left;
    padding: 10px 14px;
  }

  #cefa-owly-header {
    min-height: 68px;
    padding: 8px 12px;
  }

  .cefa-owly-header-logo-wrap {
    width: 38px;
    height: 38px;
  }

  .cefa-owly-header-logo {
    width: 30px;
    height: 30px;
  }

  .cefa-owly-header-title {
    font-size: 16px !important;
  }

  .cefa-owly-header-subtitle {
    font-size: 12px !important;
  }

  .cefa-owly-header-right button {
    width: 46px;
    height: 46px;
  }

  .cefa-owly-home-grid {
    grid-template-columns: 1fr;
  }

  .cefa-owly-home-grid .cefa-owly-home-card:last-child:nth-child(3) {
    grid-column: auto;
  }
}

/* ── Very small screens (iPhone SE etc.) ───────────────────────── */
@media (max-width: 375px) {
  #cefa-owly-panel {
    width: calc(100vw - 10px);
    right: -2px;
    bottom: 64px;
    height: min(90vh, calc(100vh - 18px - env(safe-area-inset-bottom)));
    max-height: calc(100vh - 18px - env(safe-area-inset-bottom));
    border-radius: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #cefa-owly-launcher,
  #cefa-owly-panel,
  #cefa-owly-root[data-cefa-owly-open="1"] #cefa-owly-launcher,
  .cefa-owly-header-right button,
  #cefa-owly-root .cefa-owly-quick-question,
  #cefa-owly-root .cefa-owly-chip,
  .cefa-owly-gate-form button,
  .cefa-owly-fallback-form button {
    transition: none !important;
    animation: none !important;
  }

  #cefa-owly-launcher:hover,
  #cefa-owly-launcher:active,
  .cefa-owly-header-right button:hover,
  #cefa-owly-root .cefa-owly-quick-question:hover,
  #cefa-owly-root .cefa-owly-chip:hover,
  #cefa-owly-root .cefa-owly-chip:active,
  #cefa-owly-root[data-cefa-owly-open="1"] #cefa-owly-launcher,
  #cefa-owly-panel,
  #cefa-owly-panel[aria-hidden="false"] {
    transform: none !important;
  }
}
