/* Cookie banner + chat bubble, styled to match the Pure Hearts theme */
:root {
  --ph-sage: #8ca18e;
  --ph-sage-dk: #6f8571;
  --ph-blush: #e0cacb;
  --ph-plum: #723f43;
  --ph-cream: #f3efe6;
  --ph-ink: #2c3438;
  --ph-slate: #75869a;
}

/* ---------- Cookie banner ---------- */
.ph-cookie {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2147483000;
  background: #fff; color: var(--ph-ink);
  border-top: 4px solid var(--ph-blush);
  box-shadow: 0 -6px 24px rgba(44, 52, 56, .12);
  font-family: Lato, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 1.5;
  transform: translateY(110%); transition: transform .35s ease;
}
.ph-cookie.ph-show { transform: none; }
.ph-cookie-inner {
  max-width: 1100px; margin: 0 auto; padding: 16px 20px;
  display: flex; gap: 18px; align-items: center;
}
.ph-cookie-icon { flex: none; width: 34px; height: 34px; color: var(--ph-plum); }
.ph-cookie-text { flex: 1; margin: 0; }
.ph-cookie-text strong { font-family: PlayfairDisplay, Georgia, serif; font-weight: 600; font-size: 17px; display: block; margin-bottom: 2px; }
.ph-cookie-text a { color: var(--ph-plum); }
.ph-cookie-btns { display: flex; gap: 10px; flex: none; }
.ph-btn {
  font-family: Lato, Arial, sans-serif; font-size: 15px; cursor: pointer;
  border-radius: 8px; padding: 9px 18px; border: 2px solid transparent; line-height: 1.2;
}
.ph-btn-primary { background: var(--ph-sage); color: #fff; }
.ph-btn-primary:hover { background: var(--ph-sage-dk); }
.ph-btn-ghost { background: transparent; color: var(--ph-ink); border-color: var(--ph-blush); }
.ph-btn-ghost:hover { background: var(--ph-cream); }
.ph-btn:focus-visible, .ph-chat-fab:focus-visible, .ph-chat-close:focus-visible { outline: 3px solid var(--ph-plum); outline-offset: 2px; }
@media (max-width: 680px) {
  .ph-cookie-inner { flex-wrap: wrap; gap: 12px; }
  .ph-cookie-icon { display: none; }
  .ph-cookie-btns { width: 100%; }
  .ph-cookie-btns .ph-btn { flex: 1; }
}

/* ---------- Chat bubble ---------- */
.ph-chat-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 2147482000;
  width: 62px; height: 62px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--ph-sage); color: #fff;
  box-shadow: 0 8px 22px rgba(44, 52, 56, .28);
  display: grid; place-items: center; transition: transform .2s ease, background .2s ease, bottom .35s ease;
}
.ph-chat-fab:hover { background: var(--ph-sage-dk); transform: translateY(-2px); }
.ph-chat-fab svg { width: 28px; height: 28px; }
.ph-chat-fab .ph-dot {
  position: absolute; top: 6px; right: 6px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--ph-plum); border: 2px solid #fff;
}
.ph-chat-hint {
  position: fixed; right: 94px; bottom: 34px; z-index: 2147482000;
  background: #fff; color: var(--ph-ink); border-radius: 12px; padding: 9px 14px;
  font: 14px/1.3 Lato, Arial, sans-serif; box-shadow: 0 6px 18px rgba(44, 52, 56, .16);
  opacity: 0; transform: translateX(8px); transition: opacity .3s, transform .3s, bottom .35s ease; pointer-events: none;
}
.ph-chat-hint.ph-show { opacity: 1; transform: none; }

.ph-chat {
  position: fixed; right: 22px; bottom: 96px; z-index: 2147482001;
  width: 360px; max-width: calc(100vw - 32px); height: 520px; max-height: calc(100vh - 120px);
  background: var(--ph-cream); border-radius: 18px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(44, 52, 56, .3);
  display: flex; flex-direction: column;
  font-family: Lato, Arial, Helvetica, sans-serif; color: var(--ph-ink);
  opacity: 0; transform: translateY(14px) scale(.98); pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.ph-chat.ph-open { opacity: 1; transform: none; pointer-events: auto; }
.ph-chat-head {
  background: var(--ph-blush); padding: 16px 16px 14px; display: flex; gap: 12px; align-items: center;
}
.ph-chat-avatar {
  width: 42px; height: 42px; border-radius: 50%; background: #fff; flex: none;
  display: grid; place-items: center; overflow: hidden;
}
.ph-chat-avatar img { width: 36px; height: 36px; object-fit: contain; }
.ph-chat-title { flex: 1; min-width: 0; }
.ph-chat-title b { display: block; font-family: PlayfairDisplay, Georgia, serif; font-weight: 600; font-size: 18px; color: var(--ph-plum); }
.ph-chat-title span { font-size: 13px; color: var(--ph-ink); opacity: .8; }
.ph-chat-close {
  border: 0; background: transparent; color: var(--ph-ink); cursor: pointer;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
}
.ph-chat-close:hover { background: rgba(114, 63, 67, .1); }
.ph-chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ph-msg { max-width: 84%; padding: 10px 13px; border-radius: 14px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.ph-msg-in { background: #fff; align-self: flex-start; border-bottom-left-radius: 4px; }
.ph-msg-out { background: var(--ph-sage); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.ph-msg-note { align-self: center; font-size: 12.5px; color: var(--ph-slate); text-align: center; max-width: 100%; }
.ph-msg a { color: inherit; }
.ph-chat-details { padding: 0 16px; display: grid; gap: 8px; }
.ph-chat-details[hidden] { display: none; }
.ph-chat input, .ph-chat textarea {
  width: 100%; box-sizing: border-box; border: 1.5px solid #d9d4c8; background: #fff; color: var(--ph-ink);
  border-radius: 10px; padding: 10px 12px; font: 14.5px/1.4 Lato, Arial, sans-serif;
}
.ph-chat input:focus, .ph-chat textarea:focus { outline: none; border-color: var(--ph-sage); box-shadow: 0 0 0 3px rgba(140, 161, 142, .25); }
.ph-chat input.ph-bad { border-color: #b4555b; }
.ph-chat-foot { padding: 10px 16px 14px; display: flex; gap: 8px; align-items: flex-end; }
.ph-chat-foot textarea { resize: none; height: 46px; max-height: 120px; }
.ph-send {
  flex: none; width: 46px; height: 46px; border-radius: 12px; border: 0; cursor: pointer;
  background: var(--ph-plum); color: #fff; display: grid; place-items: center;
}
.ph-send:disabled { opacity: .5; cursor: default; }
.ph-chat-call { text-align: center; font-size: 13px; padding: 0 16px 12px; color: var(--ph-slate); }
.ph-chat-call a { color: var(--ph-plum); font-weight: 700; text-decoration: none; }

@media (max-width: 520px) {
  .ph-chat { right: 0; left: 0; bottom: 0; width: 100%; max-width: 100%; height: 88vh; max-height: 88vh; border-radius: 18px 18px 0 0; }
  .ph-chat-fab { right: 16px; bottom: 16px; width: 58px; height: 58px; }
  .ph-chat-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ph-cookie, .ph-chat, .ph-chat-fab, .ph-chat-hint { transition: none; }
}

/* Beat the site theme's global button styles */
button.ph-btn, button.ph-chat-fab, button.ph-chat-close, button.ph-send {
  -webkit-appearance: none !important; appearance: none !important;
  box-sizing: border-box !important; margin: 0 !important; min-width: 0 !important; min-height: 0 !important;
  text-transform: none !important; letter-spacing: normal !important; box-shadow: none;
  font-family: Lato, Arial, Helvetica, sans-serif !important;
}
button.ph-btn { border-radius: 8px !important; padding: 9px 18px !important; font-size: 15px !important; line-height: 1.2 !important; height: auto !important; }
button.ph-btn.ph-btn-primary { background: #8ca18e !important; color: #fff !important; border: 2px solid #8ca18e !important; }
button.ph-btn.ph-btn-primary:hover { background: #6f8571 !important; border-color: #6f8571 !important; }
button.ph-btn.ph-btn-ghost { background: #fff !important; color: #2c3438 !important; border: 2px solid #e0cacb !important; }
button.ph-btn.ph-btn-ghost:hover { background: #f3efe6 !important; }
button.ph-chat-fab { border-radius: 50% !important; padding: 0 !important; border: 0 !important; background: #8ca18e !important; color: #fff !important; box-shadow: 0 8px 22px rgba(44,52,56,.28) !important; }
button.ph-chat-fab:hover { background: #6f8571 !important; }
button.ph-chat-close { border-radius: 50% !important; padding: 0 !important; border: 0 !important; background: transparent !important; color: #2c3438 !important; width: 34px !important; height: 34px !important; }
button.ph-chat-close:hover { background: rgba(114,63,67,.1) !important; }
button.ph-send { border-radius: 12px !important; padding: 0 !important; border: 0 !important; background: #723f43 !important; color: #fff !important; width: 46px !important; height: 46px !important; }

/* Cookie preferences panel */
.ph-cookie-prefs { max-width: 1100px; margin: 0 auto; padding: 0 20px 18px; display: grid; gap: 10px; max-height: 55vh; overflow-y: auto; }
.ph-cookie-prefs[hidden] { display: none; }
.ph-pref { display: flex; gap: 16px; align-items: center; background: #f3efe6; border-radius: 12px; padding: 12px 16px; }
.ph-pref-text { flex: 1; }
.ph-pref-text b { font-family: PlayfairDisplay, Georgia, serif; font-weight: 600; font-size: 16px; }
.ph-pref-text p { margin: 3px 0 0; font-size: 14px; color: #4a5458; }
.ph-pref-tag { display: inline-block; margin-left: 8px; font-size: 12px; background: #e0cacb; color: #723f43; border-radius: 20px; padding: 1px 9px; vertical-align: 2px; }
.ph-pref-info { background: transparent; border: 1.5px dashed #e0cacb; }
.ph-prefs-actions { display: flex; justify-content: flex-end; }
.ph-switch { position: relative; flex: none; width: 46px; height: 26px; cursor: pointer; }
.ph-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.ph-switch span { position: absolute; inset: 0; background: #c9c3b6; border-radius: 26px; transition: background .2s; pointer-events: none; }
.ph-switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.ph-switch input:checked + span { background: #8ca18e; }
.ph-switch input:checked + span::after { transform: translateX(20px); }
.ph-switch input:disabled + span { opacity: .6; }
.ph-switch input:focus-visible + span { outline: 3px solid #723f43; outline-offset: 2px; }
@media (max-width: 680px) {
  .ph-cookie-btns { flex-wrap: wrap; }
  .ph-cookie-btns .ph-btn[data-act="manage"] { flex-basis: 100%; }
}

/* Standard category layout */
.ph-pref { display: block; padding: 0; }
.ph-pref-row { display: flex; gap: 16px; align-items: center; padding: 12px 16px; }
.ph-pref-ctl { display: flex; align-items: center; gap: 10px; flex: none; }
.ph-pref-tag { margin-left: 0; }
.ph-tag-off { background: #e6e2d9; color: #6b7275; }
.ph-pref-off { background: transparent; border: 1.5px dashed #e0cacb; }
.ph-pref-off .ph-pref-text b { color: #6b7275; }
.ph-cdetails { padding: 0 16px 12px; }
.ph-cdetails summary { cursor: pointer; font-size: 13.5px; color: #723f43; font-weight: 700; width: max-content; }
.ph-cdetails summary:focus-visible { outline: 3px solid #723f43; outline-offset: 2px; border-radius: 4px; }
.ph-ctable { margin-top: 8px; border: 1px solid #e0cacb; border-radius: 10px; overflow: hidden; font-size: 13px; background: #fff; }
.ph-crow { display: grid; grid-template-columns: 1.1fr .9fr 2.6fr 1fr 1fr; gap: 10px; padding: 8px 12px; border-top: 1px solid #f0e8e8; }
.ph-crow:first-child { border-top: 0; }
.ph-chead { background: #f3efe6; font-weight: 700; color: #2c3438; }
.ph-cname { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; word-break: break-all; }
.ph-prefs-actions { gap: 10px; }
@media (max-width: 680px) {
  .ph-crow { grid-template-columns: 1fr 1fr; }
  .ph-chead { display: none; }
  .ph-crow span:nth-child(3) { grid-column: 1 / -1; }
}
/* cookie list on the privacy page */
#ph-cookie-list h4 { font-family: PlayfairDisplay, Georgia, serif; margin: 18px 0 4px; }
#ph-cookie-list .ph-ctable { font-family: Lato, Arial, sans-serif; color: #2c3438; }
#ph-cookie-list .ph-clist { margin: 4px 0 10px; padding-left: 20px; }
#ph-cookie-list .ph-clist li { margin: 4px 0; }
#ph-cookie-list .ph-clist span { color: #6b7275; }
