/* pip, the guide: the conversation (on the map's side panel, and in the home page's corner window) */
.guide-chat { display: flex; flex-direction: column; gap: 1rem; }
.guide-chat h1 { margin-bottom: 0; }
.guide-log { display: flex; flex-direction: column; gap: .75rem; }
.msg { max-width: 88%; padding: .7rem 1rem; font: 16px/1.55 var(--body); color: var(--ink); }
.msg p { margin: 0 0 .5rem; }
.msg p:last-child, .msg ul:last-child { margin-bottom: 0; }
.msg ul { margin: 0 0 .5rem; padding-left: 1.2rem; }
.msg.assistant { align-self: flex-start; background: var(--card); border: 1px solid var(--ink); }
.msg.user { align-self: flex-end; background: var(--pen); color: var(--on-pen); white-space: pre-wrap; }
.msg.thinking::after { content: "…"; display: inline-block; animation: think 1s infinite; font-weight: 800; color: var(--pen-ink); }
.msg.writing > :last-child::after { content: "▍"; color: var(--pen-ink); animation: think 1s infinite; }
@keyframes think { 50% { opacity: .2; } }
.guide-chips[hidden] { display: none; }
.guide-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.guide-chips button { font: 600 13px var(--mono); color: var(--ink); background: var(--zebra); border: 1px solid var(--rule); padding: .45rem .9rem; cursor: pointer; text-align: left; }
.guide-chips button:hover { background: var(--pen); color: var(--on-pen); border-color: var(--pen); }
.guide-ask { display: flex; gap: .5rem; align-items: flex-end; position: sticky; bottom: -2rem; background: var(--card); padding: .5rem 0 1rem; }
.guide-ask textarea { flex: 1; resize: none; font: 16px/1.4 var(--body); color: var(--ink); background: var(--card); border: 2px solid var(--ink); padding: .65rem .9rem; outline: none; }
.guide-ask textarea:focus { border-color: var(--pen); }
.guide-ask button { font: 600 .85rem var(--mono); text-transform: uppercase; color: var(--on-pen); background: var(--pen); border: 0; padding: .7rem 1.2rem; cursor: pointer; }
.guide-ask :disabled { opacity: .55; cursor: default; }

/* pip in the corner of a page */
.pip-button {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 40; display: flex; align-items: center; gap: .55rem;
  padding: .3rem .9rem .3rem .3rem; background: var(--card); color: var(--ink); border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--pen); font: 700 1rem var(--title); text-transform: uppercase; letter-spacing: .06em; cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.pip-button img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--ink); background: var(--pen); }
.pip-button:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--pen); }
.pip-button[aria-expanded="true"] { background: var(--pen); color: var(--on-pen); }
.pip-window {
  position: fixed; right: 1.25rem; bottom: 5.4rem; z-index: 40; width: min(400px, calc(100vw - 2rem)); max-height: min(600px, calc(100vh - 8rem));
  display: flex; flex-direction: column; background: var(--card); border: 2px solid var(--ink); box-shadow: 8px 8px 0 var(--pen);
  animation: pip-in .25s cubic-bezier(.3, 1.4, .5, 1);
}
.pip-window[hidden] { display: none; }
@keyframes pip-in { from { opacity: 0; transform: translateY(12px) scale(.96); } }
.pip-head { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem .5rem .7rem; background: var(--strip); color: var(--on-strip); border-bottom: 3px solid var(--pen); }
.pip-head img { width: 30px; height: 30px; border-radius: 50%; background: var(--pen); }
.pip-head b { font: 700 1.15rem var(--title); text-transform: uppercase; letter-spacing: .05em; }
.pip-head span { font: .72rem var(--mono); opacity: .7; }
.pip-close { margin-left: auto; width: 2rem; height: 2rem; font: 1.4rem/1 var(--body); color: var(--on-strip); background: none; border: 1px solid transparent; cursor: pointer; }
.pip-close:hover { color: var(--pen); border-color: var(--pen); }
.pip-window .guide-chat { overflow-y: auto; padding: 1rem 1rem 0; gap: .8rem; }
.pip-window .guide-ask { bottom: 0; }
.pip-window .msg { font-size: 15px; }
@media (max-width: 600px) {
  .pip-button span { display: none; }
  .pip-button { padding: .3rem; right: 1rem; bottom: 1rem; }
  .pip-window { right: .5rem; left: .5rem; bottom: 5rem; width: auto; max-height: calc(100vh - 7rem); }
}
@media (prefers-reduced-motion: reduce) { .pip-window { animation: none; } .pip-button { transition: none; } }
@media print { .pip-button, .pip-window { display: none; } }
