/* Arpy chat on /pricing (js/os-arpy.js), 02.10.2026, round 13.
   Mounted into <section data-arpy-mount>, between Compare plans and the FAQ, as wide as
   the FAQ column (640 px). The app's Arpy chat, calmer: the brand avatar, Arpy bubbles in
   a soft grey, the visitor in the app's blue, starter chips, image grids, light and dark.
   Answers: a lead (larger), detail lines (smaller, grey), images, a hand-off line; they
   appear whole, in a quick sequence, after a breathing "Arpy is thinking".
   Every class starts with ac- (the home page has its own .arpy-chat mock in os-live.css). */

section[data-arpy-mount] {
  position: relative; display: block; overflow: visible;
  width: 100%; max-width: calc(640px + 2 * var(--gutter, 24px)); margin: 0 auto;
  padding: 96px var(--gutter, 24px) 0;
  scroll-margin-top: var(--nav-h, 84px);
  --ac-arpy: #232323;
  --ac-user: #0b84ff;
  --ac-thumb: #1c1c1c;
  --ac-glow: rgba(150, 175, 255, 0.34);
  --ac-irid: linear-gradient(90deg, #cd93ff, #70e2ff, #9fff5b, #ffe83f, #ffa647, #ff75c3, #cd93ff);
  --ac-ease: var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
}
section[data-arpy-mount]::before, section[data-arpy-mount]::after { content: none; }
section[data-arpy-mount] [hidden] { display: none !important; }
html[data-theme="light"] section[data-arpy-mount] { --ac-arpy: #f0efea; --ac-thumb: #ecebe6; --ac-glow: rgba(170, 140, 255, 0.3); }
@media (prefers-color-scheme: light) {
  html.theme-ready:not([data-theme]) section[data-arpy-mount] { --ac-arpy: #f0efea; --ac-thumb: #ecebe6; --ac-glow: rgba(170, 140, 255, 0.3); }
}

.ac-head { margin-bottom: 24px; text-align: center; }
.ac-title { font-family: var(--os-font); font-weight: 500; font-size: 22px; line-height: 26px; letter-spacing: -0.5px; color: var(--ink); text-wrap: balance; }
.ac-sub { margin-top: 1px; font-family: var(--os-font); font-weight: 400; font-size: 22px; line-height: 26px; letter-spacing: -0.5px; color: var(--ink-3); text-wrap: balance; }

.ac-panel {
  border-radius: 24px; background: var(--card); box-shadow: var(--card-shadow);
  padding: 8px 8px 0;
}
html:not([data-theme="light"]) .ac-panel { box-shadow: 0 0 0 1px var(--line); }

/* the conversation */
.ac-log {
  display: flex; flex-direction: column; gap: 14px;
  max-height: 460px; overflow-y: auto; overscroll-behavior: contain;
  padding: 18px 12px 16px; scroll-padding-bottom: 16px;
  scrollbar-width: thin; scrollbar-color: var(--ink-4) transparent;
}
.ac-panel.is-empty .ac-log { padding-top: 26px; }
.ac-log:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; border-radius: 18px; }
.ac-row { display: flex; align-items: flex-end; gap: 8px; }
.ac-row--user { justify-content: flex-end; }
.ac-avatar {
  position: relative; overflow: hidden; isolation: isolate;
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--os-font); font-weight: 600; font-size: 13px; line-height: 1; color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}
.ac-avatar::before {
  content: ""; position: absolute; inset: -75%; z-index: -1;
  background: var(--ac-irid); background-size: 200% 100%;
}
@media (prefers-reduced-motion: no-preference) {
  .ac-avatar::before { animation: ac-flow 14s linear infinite, ac-spin 60s linear infinite; }
}
@keyframes ac-flow { from { background-position: 0% 50%; } to { background-position: 200% 50%; } }
@keyframes ac-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.ac-bubble {
  min-width: 0; max-width: 86%;
  padding: 10px 14px; border-radius: var(--r-40);
  font-family: var(--os-font); font-size: 15px; line-height: 21px; letter-spacing: -0.15px;
  overflow-wrap: anywhere; text-wrap: pretty;
}
.ac-row--arpy .ac-bubble { background: var(--ac-arpy); color: var(--ink); border-bottom-left-radius: 4px; }
.ac-row--user .ac-bubble { background: var(--ac-user); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.ac-row--arpy .ac-bubble.has-grid { flex: 1; max-width: calc(100% - 36px); }
.ac-bubble a { color: inherit; text-decoration: underline; text-decoration-color: var(--ink-4); text-underline-offset: 3px; }
.ac-bubble a:hover { text-decoration-color: currentColor; }

/* an answer: the lead, the details, the images, the hand-off */
.ac-answer { padding: 12px 16px 13px; }
.ac-lead { font-size: 16.5px; line-height: 23px; letter-spacing: -0.2px; color: var(--ink); }
.ac-details { margin-top: 7px; font-size: 14px; line-height: 20px; letter-spacing: -0.1px; color: var(--ink-2); }
ul.ac-details { display: flex; flex-direction: column; gap: 3px; padding: 0; list-style: none; }
ul.ac-details li { position: relative; padding-left: 13px; }
ul.ac-details li::before { content: ""; position: absolute; left: 1px; top: 8px; width: 4px; height: 4px; border-radius: 50%; background: var(--ink-3); }
.ac-handoff { margin-top: 10px; font-size: 13.5px; line-height: 19px; color: var(--ink-2); }
.ac-bubble.is-notice .ac-lead { font-size: 15px; line-height: 21px; color: var(--ink-2); }

/* images under an answer */
.ac-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.ac-grid.n-3, .ac-grid.n-5, .ac-grid.n-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ac-grid figure { margin: 0; min-width: 0; }
.ac-grid img {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: 10px; background: var(--ac-thumb); box-shadow: inset 0 0 0 1px var(--line);
}
.ac-cap { margin-top: 8px; font-size: 12px; line-height: 16px; color: var(--ink-3); }

/* thinking: the avatar breathes, a quiet line shimmers */
.ac-row.is-thinking { align-items: center; }
.ac-thinking { margin: 0; padding: 0 2px; font-family: var(--os-font); font-size: 14px; line-height: 20px; letter-spacing: -0.1px; color: var(--ink-3); }
.ac-thinking-t { display: inline-block; transition: opacity 180ms ease; }
.ac-thinking-t.is-out { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .ac-row.is-thinking .ac-avatar { animation: ac-breathe 1.9s ease-in-out infinite; }
  .ac-row.is-thinking .ac-avatar::before { animation-duration: 4s, 60s; }
  .ac-thinking-t {
    color: transparent;
    background: linear-gradient(90deg, var(--ink-3) 0%, var(--ink-3) 38%, var(--ink) 50%, var(--ink-3) 62%, var(--ink-3) 100%);
    background-size: 260% 100%;
    -webkit-background-clip: text; background-clip: text;
    animation: ac-shimmer 2.4s linear infinite;
  }
}
@keyframes ac-breathe {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 0 0 0 transparent; }
  50% { transform: scale(1.09); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.24), 0 0 16px 3px var(--ac-glow); }
}
@keyframes ac-shimmer { from { background-position: 100% 0; } to { background-position: 0% 0; } }

/* the reveal: quick, in sequence (delays set per element in --d) */
@media (prefers-reduced-motion: no-preference) {
  .ac-row.is-new { animation: ac-in 0.28s ease both; }
  .ac-anim { animation: ac-bubble 0.26s var(--ac-ease) both; }
  .ac-anim .ac-w { display: inline-block; animation: ac-word 0.38s var(--ac-ease) both; animation-delay: var(--d, 0ms); }
  .ac-anim .ac-l { animation: ac-line 0.36s var(--ac-ease) both; animation-delay: var(--d, 0ms); }
  .ac-anim .ac-f { animation: ac-img 0.46s var(--ac-ease) both; animation-delay: var(--d, 0ms); }
}
@keyframes ac-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes ac-bubble { from { opacity: 0; transform: translateY(4px) scale(0.99); } }
@keyframes ac-word { from { opacity: 0; transform: translateY(5px); filter: blur(1.5px); } }
@keyframes ac-line { from { opacity: 0; transform: translateY(5px); } }
@keyframes ac-img { from { opacity: 0; transform: translateY(8px) scale(0.97); } }

/* starter chips: room around them while the chat is empty */
.ac-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 12px 14px 48px; }
.ac-panel.is-empty .ac-chips { padding-bottom: 52px; }
.ac-chip {
  display: inline-flex; align-items: center; min-height: 32px; padding: 6px 12px; border-radius: var(--r-32);
  font-family: var(--os-font); font-size: 13px; line-height: 18px; letter-spacing: -0.1px; text-align: left;
  color: var(--ink-2); background: transparent; box-shadow: inset 0 0 0 1px var(--line-2);
  cursor: pointer; transition: color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
.ac-chip:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink-3); }
.ac-chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.ac-chip:disabled { opacity: 0.5; cursor: default; }

/* the field */
.ac-form {
  display: flex; align-items: flex-end; gap: 8px;
  margin: 0 4px; padding: 6px 6px 6px 16px; border-radius: var(--r-48);
  background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 160ms ease;
}
html[data-theme="light"] .ac-form { background: #f6f5f2; }
.ac-form:focus-within { box-shadow: inset 0 0 0 1px var(--ink-3); }
.ac-input {
  flex: 1; min-width: 0; resize: none; max-height: 132px; padding: 7px 0; margin: 0;
  font-family: var(--os-font); font-size: 15px; line-height: 22px; letter-spacing: -0.15px; color: var(--ink);
  background: transparent; border: 0; outline: none;
}
.ac-input::placeholder { color: var(--ink-3); }
.ac-send {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--irid, var(--ac-irid)); color: #0b0b0a; cursor: pointer;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: opacity 160ms ease, transform 160ms ease;
}
html[data-theme="light"] .ac-send { box-shadow: inset 0 0 0 1px rgba(27, 26, 24, 0.1); }
.ac-send svg { width: 18px; height: 18px; }
.ac-send:active { transform: scale(0.94); }
.ac-send:disabled { opacity: 0.4; cursor: default; transform: none; }
.ac-send:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.ac-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 16px 14px; }
.ac-fine { font-size: 12px; line-height: 17px; color: var(--ink-3); text-wrap: pretty; }
.ac-fine a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--ink-4); text-underline-offset: 2px; }
.ac-fine a:hover { color: var(--ink); }
.ac-meta { flex: none; display: flex; align-items: baseline; gap: 12px; }
.ac-count { font-size: 12px; line-height: 17px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ac-count.is-over { color: #e5484d; }
.ac-count:empty { display: none; }
.ac-new {
  font-family: var(--os-font); font-size: 12px; line-height: 17px; color: var(--ink-2);
  background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--ink-4); text-underline-offset: 2px;
}
.ac-new:hover { color: var(--ink); }
.ac-new:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }

@media (max-width: 809.98px) {
  section[data-arpy-mount] { padding: 64px 16px 0; }
  .ac-head { margin-bottom: 18px; text-align: left; }
  .ac-title, .ac-sub { font-size: 19px; line-height: 22px; letter-spacing: -0.4px; }
  .ac-panel { border-radius: 20px; padding: 4px 4px 0; }
  .ac-log { max-height: min(62vh, 500px); padding: 16px 8px 14px; }
  .ac-panel.is-empty .ac-log { padding-top: 22px; }
  .ac-bubble { max-width: 88%; }
  .ac-lead { font-size: 16px; line-height: 22px; }
  .ac-chips { padding: 2px 8px 12px 44px; }
  .ac-panel.is-empty .ac-chips { padding-bottom: 40px; }
  .ac-form { margin: 0 2px; }
  .ac-input { font-size: 16px; }
  .ac-foot { flex-wrap: wrap; padding: 10px 12px 12px; }
  .ac-grid.n-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .ac-chip, .ac-send, .ac-form, .ac-thinking-t { transition: none; }
}
