/* Gracie chat — standalone styles (loaded by the public theme AND the admin
 * dashboard, so every var() carries its brand fallback). Mobile = native
 * full-screen sheet; desktop = right slideout. */

#rchat-launch{position:fixed;right:18px;bottom:calc(18px + env(safe-area-inset-bottom,0px));z-index:110;display:flex;align-items:center;gap:8px;background:var(--ink,#3A2F27);color:#fff;border:0;border-radius:99px;padding:12px 18px;font:600 13.5px 'Inter',sans-serif;cursor:pointer;box-shadow:0 12px 34px rgba(20,22,26,.35);transition:transform .2s,background .2s,opacity .2s}
#rchat-launch:hover{transform:translateY(-2px);background:#2B2F35}
#rchat-launch svg{width:19px;height:19px;color:var(--accent-soft,#CFD9C5)}
#rchat-launch.hide{opacity:0;pointer-events:none}

#rchat{position:fixed;top:0;right:0;bottom:0;z-index:130;width:min(400px,100vw);background:var(--paper,#F6F2EC);box-shadow:-24px 0 60px rgba(20,22,26,.25);display:flex;flex-direction:column;transform:translateX(105%);transition:transform .32s cubic-bezier(.2,.6,.2,1)}
#rchat.open{transform:none}

.rchat-head{display:flex;align-items:center;gap:12px;padding:16px 18px 12px;background:var(--paper,#F6F2EC);color:var(--ink,#3A2F27);flex:none}
.rchat-head b{font-family:'Fraunces',serif;font-size:17px;display:block}
.rchat-head small{font-size:11px;color:var(--slate,#5F6B7A);display:block;margin-top:1px}
/* small circle avatar for Gracie: white disc, rose mark, presence dot on the rim */
.rchat-ava{position:relative;width:36px;height:36px;border-radius:50%;background:#fff;box-shadow:0 2px 10px rgba(34,37,42,.10);display:flex;align-items:center;justify-content:center;flex:none}
.rchat-ava svg{width:19px;height:19px;color:var(--accent,#4A6741)}
.rchat-dot{position:absolute;right:-1px;bottom:-1px;width:10px;height:10px;border-radius:50%;background:#7BC896;border:2px solid var(--paper,#F6F2EC);flex:none}
.rchat-staff{margin-left:6px;flex:none;font:700 9px 'Inter',sans-serif;letter-spacing:.08em;background:var(--accent,#4A6741);color:#fff;border-radius:5px;padding:3px 6px}
.rchat-x{margin-left:auto;width:38px;height:38px;border-radius:50%;border:0;background:none;color:var(--ink,#3A2F27);font-size:15px;cursor:pointer;flex:none;transition:background .15s}
.rchat-x:hover{background:var(--blush,#EEF0E9)}

.rchat-log{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:18px 16px;display:flex;flex-direction:column;gap:10px}
.rchat-b{max-width:88%;padding:11px 15px;border-radius:16px;font-size:14.5px;line-height:1.55;overflow-wrap:break-word;animation:rchatIn .26s ease both}
@keyframes rchatIn{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}
/* blinking caret while Gracie is typing a reply */
.rchat-b.typing::after{content:"";display:inline-block;width:2px;height:1.05em;margin-left:2px;vertical-align:-3px;border-radius:1px;background:var(--accent,#4A6741);animation:rchatCaret .7s steps(1,end) infinite}
@keyframes rchatCaret{50%{opacity:0}}
@media(prefers-reduced-motion:reduce){.rchat-b{animation-duration:.01ms}.rchat-b.typing::after{display:none}}
.rchat-b.bot{background:#fff;border:1px solid var(--line,#E5DDD6);border-bottom-left-radius:6px;align-self:flex-start;color:var(--ink,#3A2F27)}
.rchat-b.me{background:var(--accent,#4A6741);color:#fff;border-bottom-right-radius:6px;align-self:flex-end}
.rchat-b.bot a{color:var(--accent-deep,#3A5233);font-weight:600;text-decoration:underline;text-underline-offset:2px}
.rchat-b .rchat-btn{display:inline-block;margin-top:9px;background:var(--accent,#4A6741);color:#fff !important;border-radius:99px;padding:9px 15px;font:600 13px 'Inter',sans-serif;text-decoration:none !important;transition:background .15s}
.rchat-b .rchat-btn:hover{background:var(--accent-deep,#3A5233)}

.rchat-chips{display:flex;flex-wrap:wrap;gap:7px;align-self:flex-start;max-width:94%}
.rchat-chip{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--accent,#4A6741);color:var(--accent-deep,#3A5233);background:#fff;border-radius:99px;padding:8px 13px;font:600 12.5px 'Inter',sans-serif;cursor:pointer;transition:background .15s,color .15s}
.rchat-chip svg{width:14px;height:14px;flex:none}
.rchat-chip:hover{background:var(--accent,#4A6741);color:#fff}

.rchat-t{display:inline-flex;gap:4px;padding:3px 2px}
.rchat-t i{width:6px;height:6px;border-radius:50%;background:var(--accent-soft,#CFD9C5);animation:rchatT 1s infinite}
.rchat-t i:nth-child(2){animation-delay:.15s}.rchat-t i:nth-child(3){animation-delay:.3s}
@keyframes rchatT{0%,100%{opacity:.35;transform:translateY(0)}50%{opacity:1;transform:translateY(-3px)}}

.rchat-ctabar{flex:none;padding:9px 14px 0;background:var(--paper,#F6F2EC)}
.rchat-ctabar a{display:flex;align-items:center;justify-content:center;gap:7px;text-align:center;background:var(--blush,#EEF0E9);color:var(--accent-deep,#3A5233);border:1px solid var(--accent-soft,#CFD9C5);border-radius:99px;padding:9px 14px;font:600 12.5px 'Inter',sans-serif;text-decoration:none;transition:background .15s,color .15s}
.rchat-ctabar a:hover{background:var(--accent,#4A6741);color:#fff}

.rchat-bar{display:flex;gap:8px;padding:12px 14px;border-top:0;background:var(--paper,#F6F2EC);flex:none}
.rchat-ctabar + .rchat-bar{padding-top:10px}
.rchat-bar input{flex:1;border:1px solid var(--line,#E5DDD6);border-radius:99px;padding:11px 16px;font:15px 'Inter',sans-serif;background:#fff;min-width:0}
.rchat-bar input:focus{outline:2px solid var(--accent,#4A6741);outline-offset:-1px}
.rchat-send{width:44px;height:44px;border-radius:50%;border:0;background:var(--accent,#4A6741);color:#fff;cursor:pointer;flex:none;display:flex;align-items:center;justify-content:center;transition:background .15s}
.rchat-send svg{width:19px;height:19px}
.rchat-send:hover{background:var(--accent-deep,#3A5233)}
.rchat-fine{padding:8px 16px calc(10px + env(safe-area-inset-bottom,0px));font-size:10.5px;color:var(--clay,#8A7268);text-align:center;background:var(--paper,#F6F2EC);flex:none}

/* ---- dimmed backdrop behind the mobile sheet ---- */
#rchat-veil{position:fixed;inset:0;z-index:125;background:rgba(20,22,26,.44);opacity:0;pointer-events:none;transition:opacity .28s;-webkit-tap-highlight-color:transparent}
#rchat-veil.show{opacity:1;pointer-events:auto}
@media(min-width:641px){#rchat-veil{display:none}}

/* ---- mobile: native bottom sheet — space at top, grab handle, keyboard-glued (JS
       pins the sheet to the VISUAL viewport so the input never hides behind the keyboard) ---- */
@media(max-width:640px){
  #rchat-launch span{display:none}
  #rchat-launch{padding:13px}
  /* the sheet runs all the way to the LAYOUT-viewport bottom — i.e. UNDER the
     keyboard — and JS lifts its content with --rkb (keyboard overlap + cushion),
     so there is never a gap between the chat and the keyboard */
  #rchat:not(.page){top:auto;left:0;right:0;bottom:0;width:100%;height:calc(100dvh - 58px - env(safe-area-inset-top,0px));max-height:calc(100dvh - 58px);overflow:hidden;padding-bottom:var(--rkb,0px);border-left:0;border-radius:22px 22px 0 0;box-shadow:0 -18px 60px rgba(20,22,26,.35);transform:translateY(104%);transition:transform .32s cubic-bezier(.2,.7,.2,1);will-change:transform}
  #rchat:not(.page).open{transform:none}
  #rchat:not(.page) .rchat-head{position:relative;border-radius:22px 22px 0 0;padding-top:19px}
  #rchat:not(.page) .rchat-head::before{content:'';position:absolute;top:7px;left:50%;transform:translateX(-50%);width:44px;height:4.5px;border-radius:3px;background:rgba(34,37,42,.16)}
  /* keyboard open (.kb, set by the glue loop): drop the fine print so the
     answers, starter chips, and the valuation pill all stay on screen */
  #rchat:not(.page).kb .rchat-fine{display:none}
  #rchat:not(.page).kb .rchat-head small{display:none}
  .rchat-x{width:44px;height:44px;font-size:16px}
  .rchat-b{font-size:15px}
  .rchat-bar input{font-size:16px}   /* 16px stops iOS zoom-on-focus */
  .rchat-fine{padding-bottom:calc(8px + env(safe-area-inset-bottom,0px))}
}
.rchat-log{overscroll-behavior:contain}
/* iOS-proof background lock: overflow:hidden alone still rubber-bands — fix the body
   (JS sets body.style.top to -scrollY so the page doesn't visibly jump) */
html.rchat-lock{overflow:hidden}
html.rchat-lock body{position:fixed;left:0;right:0;width:100%;overflow:hidden;overscroll-behavior:none}

/* ---- page mode: the /gracie page renders the chat inline, full-bleed ---- */
.phead-tight{padding-bottom:22px}
/* ── /gracie page: clean, claude.ai-style chat (no boxy wrapper) ───────────
   Assistant replies read like prose; your messages sit in a soft pill; a big
   rounded input rides at the bottom of the column. The site header/footer stay. */
.gracie-page{padding:0 0 48px}
#rchat.page{position:relative;z-index:auto;inset:auto;width:100%;max-width:720px;margin:0 auto;height:auto;min-height:auto;
  transform:none;transition:none;border:0;border-radius:0;box-shadow:none;background:transparent;overflow:visible;display:block}
/* page mode is inline content: drop the slideout's z-index:130 so the sticky site
   nav (z-index:90) stays ABOVE the conversation instead of the messages painting over it */
#rchat.page .rchat-head{display:none}                 /* the page already carries its own “Ask Gracie” header */
#rchat.page .rchat-log{flex:none;overflow:visible;padding:6px 0 4px;gap:26px}
#rchat.page .rchat-b{max-width:100%;font-size:16.5px;line-height:1.72}
#rchat.page .rchat-b.bot{background:transparent;border:0;border-radius:0;padding:0;align-self:stretch;color:var(--ink,#3A2F27)}
#rchat.page .rchat-b.bot::before{content:'Gracie';display:block;font:700 11px 'Inter',sans-serif;letter-spacing:.14em;text-transform:uppercase;color:var(--accent,#4A6741);margin-bottom:6px}
#rchat.page .rchat-b.me{background:#F1E7E3;color:var(--ink,#3A2F27);border:0;border-radius:18px;padding:12px 17px;align-self:flex-end;max-width:82%}
#rchat.page .rchat-chips{margin-top:2px}
#rchat.page .rchat-ctabar{border:0;background:transparent;padding:14px 0 0}
#rchat.page .rchat-ctabar a{max-width:340px;margin:0 auto}
#rchat.page .rchat-bar{position:sticky;bottom:16px;z-index:5;background:transparent;padding:14px 0 0;margin-top:8px;gap:10px}
#rchat.page .rchat-bar input{border:1px solid var(--line,#E5DDD6);border-radius:28px;padding:17px 20px;font-size:16.5px;background:#fff;box-shadow:0 8px 30px rgba(34,37,42,.10)}
#rchat.page .rchat-bar input:focus{outline:none;border-color:var(--accent,#4A6741);box-shadow:0 8px 30px rgba(183,110,121,.18)}
#rchat.page .rchat-send{width:52px;height:52px;font-size:17px;box-shadow:0 8px 24px rgba(183,110,121,.28)}
#rchat.page .rchat-fine{background:transparent;text-align:center;padding:12px 0 0;color:var(--clay,#8A7268)}
@media(max-width:640px){
  .gracie-page{padding-bottom:30px}
  #rchat.page .rchat-b{font-size:16px}
  #rchat.page .rchat-bar{bottom:calc(10px + env(safe-area-inset-bottom,0px))}
}

.rchat-ctabar a svg{width:15px;height:15px;flex:none}
/* ── claude.ai-style composer on /gracie: one 768px column; a SQUARE-ish box with
   the send button inside; starter pills with icons sit UNDER the box ── */
#rchat.page{max-width:768px;display:flex;flex-direction:column}
#rchat.page .rchat-log{order:1}
#rchat.page .rchat-bar{order:2}
#rchat.page .rchat-starters{order:3}
#rchat.page .rchat-ctabar{order:4}
#rchat.page .rchat-fine{order:5}
#rchat.page .rchat-bar{display:flex;align-items:center;gap:8px;background:#fff;border:1px solid var(--line,#E5DDD6);
  border-radius:18px;padding:9px 9px 9px 20px;box-shadow:0 10px 34px rgba(34,37,42,.10);transition:border-color .15s,box-shadow .15s}
#rchat.page .rchat-bar:focus-within{border-color:var(--accent,#4A6741);box-shadow:0 10px 34px rgba(183,110,121,.16)}
#rchat.page .rchat-bar input{border:0;background:transparent;box-shadow:none;border-radius:0;padding:13px 0;font-size:17px}
#rchat.page .rchat-bar input:focus{outline:none;border:0;box-shadow:none}
#rchat.page .rchat-send{width:44px;height:44px;border-radius:13px}
#rchat.page .rchat-send svg{width:19px;height:19px}
#rchat.page .rchat-starters{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;align-self:center;max-width:100%;margin-top:14px}
#rchat.page .rchat-starters .rchat-chip{border-color:var(--line,#E5DDD6);color:var(--ink,#3A2F27);border-radius:12px;padding:9px 14px;font-weight:600;background:#fff}
#rchat.page .rchat-starters .rchat-chip svg{color:var(--accent-deep,#3A5233)}
#rchat.page .rchat-starters .rchat-chip:hover{border-color:var(--accent,#4A6741);background:#FBF6F3;color:var(--ink,#3A2F27)}
#rchat.page .rchat-ctabar{margin-top:16px}
@media(max-width:640px){
  #rchat.page .rchat-bar input{font-size:16px}
  #rchat.page .rchat-starters .rchat-chip{padding:8px 12px}
}

/* ── /gracie conversation mode: after the first message the composer docks to the
   bottom of the screen as a STICKY bar — SAME on mobile and desktop. Answers
   stream in above it and JS follows the newest line down to the input; the bar
   comes to rest just above the footer (a sliver of footer shows), and long
   answers can be scrolled up to read. claude.ai-style. ── */
#rchat.page.live{padding-bottom:28px}
#rchat.page.live .rchat-bar{position:sticky;left:auto;right:auto;transform:none;bottom:20px;z-index:40;
  width:auto;margin:22px 0 0;background:#fff;
  /* soft drop shadow + a subtle paper-white halo hugging the bar's rounded shape */
  box-shadow:0 12px 36px rgba(34,37,42,.15),0 0 22px 10px rgba(250,247,244,.65);animation:none}
#rchat.page.live .rchat-starters,#rchat.page.live .rchat-ctabar{display:none}
#rchat.page.live .rchat-fine{display:none}   /* disclaimer already shown pre-conversation; keeps the footer clear */
@media(max-width:640px){
  #rchat.page.live{padding-bottom:24px}
  #rchat.page.live .rchat-bar{bottom:calc(12px + env(safe-area-inset-bottom,0px))}
  /* opaque header on the Gracie page so answers scroll cleanly UNDER it instead
     of bleeding through the translucent, blurred site nav */
  body:has(.gracie-page) .nav{background:var(--paper);backdrop-filter:none;-webkit-backdrop-filter:none}
  /* soft paper fade hanging below the header: bubbles dissolve into it as they
     scroll up, instead of hitting a hard edge under the bar */
  body:has(.gracie-page) .nav::after{content:'';position:absolute;top:100%;left:0;right:0;height:56px;
    background:linear-gradient(var(--paper),rgba(250,247,244,0));pointer-events:none}
  /* breathing room above the conversation, and keep the newest message clear of the header */
  #rchat.page .rchat-log{padding-top:22px;padding-bottom:6px;scroll-margin-top:88px}
}

/* ── /gracie hero: same 768px column as the chat, soft card, no section border ── */
.gracie-hero{max-width:768px;margin:0 auto;padding:clamp(26px,4vw,44px) 16px 6px}
.gracie-hero-card{background:#fff;border:1px solid var(--line,#E5DDD6);border-radius:22px;
  padding:clamp(26px,4vw,40px) clamp(20px,4vw,44px);text-align:center;
  box-shadow:0 14px 44px rgba(34,37,42,.07)}
.gracie-hero-card .eyebrow{margin-bottom:10px}
.gracie-hero-card h1{font-family:'Fraunces',Georgia,serif;font-weight:600;font-size:clamp(28px,4.2vw,42px);line-height:1.12;color:var(--ink,#3A2F27)}
.gracie-hero-card h1 em{font-style:italic;color:var(--accent,#4A6741)}
.gracie-hero-card p:not(.eyebrow){margin:14px auto 0;max-width:56ch;font-size:15px;line-height:1.65;color:var(--slate,#5F6B7A)}
.gracie-page{padding-top:18px}
.gracie-page .wrap{max-width:800px}
@media(max-width:640px){.gracie-hero{padding-left:12px;padding-right:12px}}

/* teased state: the real chat sits blurred behind a small card */
#rchat.locked .rchat-msgs,#rchat.locked .rchat-bar,#rchat.locked .rchat-chips{filter:blur(5px);pointer-events:none;user-select:none}
.rchat-lockcard{position:absolute;left:50%;top:46%;transform:translate(-50%,-50%);width:min(320px,84%);background:#FFFDF8;border:1px solid var(--line,#DDD5C9);border-radius:16px;padding:22px 24px;box-shadow:0 18px 60px rgba(43,36,27,.18);text-align:center;z-index:5}
.rchat-lockcard .lc-eb{font:600 10.5px/1 'Inter',sans-serif;letter-spacing:.16em;text-transform:uppercase;color:var(--accent,#4A6741);margin:0 0 8px}
.rchat-lockcard h3{font-family:'Besley',Georgia,serif;font-weight:500;font-size:19px;margin:0 0 8px;color:#3A2F27}
.rchat-lockcard p{font-size:13.5px;line-height:1.55;color:#6B5E54;margin:0 0 12px}
.rchat-lockcard a{display:inline-block;background:var(--pop,#3A2F27);color:#fff;border-radius:99px;padding:9px 16px;font:600 13px 'Inter',sans-serif;text-decoration:none}

/* RCROP overlay (loaded on admin pages via _uploader) */
.rcrop-ov{position:fixed;inset:0;z-index:220;background:rgba(24,22,18,.72);display:flex;align-items:center;justify-content:center;padding:20px}
.rcrop-card{background:#FFFDF8;border-radius:16px;max-width:900px;width:100%;box-shadow:0 30px 90px rgba(0,0,0,.4);overflow:hidden}
.rcrop-head{display:flex;align-items:center;gap:12px;padding:14px 18px;border-bottom:1px solid #DDD5C9}
.rcrop-head b{font:500 17px 'Besley',Georgia,serif;color:#3A2F27}
.rcrop-hint{font-size:12px;color:#6B5E54}
.rcrop-x{margin-left:auto;border:0;background:none;font-size:15px;cursor:pointer;color:#3A2F27;width:34px;height:34px;border-radius:50%}
.rcrop-x:hover{background:#E8E2D9}
.rcrop-stage{position:relative;background:#181510;display:flex;align-items:center;justify-content:center;min-height:320px;max-height:64vh;padding:14px}
.rcrop-stage img{max-width:100%;max-height:60vh;display:block;user-select:none;pointer-events:none}
.rcrop-box{position:absolute;border:2px solid #fff;box-shadow:0 0 0 9999px rgba(10,8,5,.55);cursor:move;touch-action:none}
.rcrop-box .h{position:absolute;width:16px;height:16px;background:#fff;border-radius:50%;box-shadow:0 1px 5px rgba(0,0,0,.4)}
.rcrop-box .nw{left:-8px;top:-8px;cursor:nwse-resize}.rcrop-box .ne{right:-8px;top:-8px;cursor:nesw-resize}
.rcrop-box .sw{left:-8px;bottom:-8px;cursor:nesw-resize}.rcrop-box .se{right:-8px;bottom:-8px;cursor:nwse-resize}
.rcrop-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 18px;border-top:1px solid #DDD5C9;flex-wrap:wrap}
.rcrop-chips button{border:1px solid #DDD5C9;background:#fff;border-radius:99px;padding:7px 13px;font:600 12px 'Inter',sans-serif;color:#4A4234;cursor:pointer;margin-right:6px}
.rcrop-chips button.on{background:#3A2F27;border-color:#3A2F27;color:#fff}
.rcrop-actions{display:flex;gap:8px}
