/* We are here (app-here*.js) and parked islands (app-parked-islands.js).
   Steady, no flashing: the glow itself is drawn by cytoscape (node.here). */
:root {
  --here-pill: #17232d;
  --here-pill-ink: #ffffff;
  --here-mark: color-mix(in srgb, #abdd65 55%, transparent);
  --here-ring: #abdd65;
}
[data-theme='dark'] {
  --here-pill: #e5eeef;
  --here-pill-ink: #17232d;
  --here-mark: color-mix(in srgb, #abdd65 32%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --here-pill: #e5eeef;
    --here-pill-ink: #17232d;
    --here-mark: color-mix(in srgb, #abdd65 32%, transparent);
  }
}

/* The pill under the idea, moved on every cytoscape render. */
.here-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}
.here-pill {
  position: absolute;
  left: 0;
  top: 0;
  padding: 0.28rem 0.6rem;
  border-radius: 8px;
  background: var(--here-pill);
  color: var(--here-pill-ink);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  will-change: transform;
  box-shadow: 0 1px 3px rgba(23, 35, 45, 0.18);
}
.here-pill::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -5px;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top: 0;
  border-bottom-color: var(--here-pill);
}
.here-pill[hidden] {
  display: none;
}

/* Parked islands: bottom-left of the map, dashed pills, never graph nodes. */
.here-islands {
  position: absolute;
  left: 0.6rem;
  bottom: 0.6rem;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  max-width: calc(100% - 1.2rem);
  pointer-events: none;
}
.here-islands[hidden] {
  display: none;
}
.here-islands-head {
  flex-basis: 100%;
  padding-left: 0.2rem;
  font-size: 0.62rem;
  opacity: 0.85;
}
.here-island {
  pointer-events: auto;
  min-height: 44px;
  max-width: 13rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0 0.85rem 0 0.45rem;
  border-radius: 999px;
  border: 1.5px dashed var(--field-line);
  background: color-mix(in srgb, var(--card) 90%, transparent);
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.here-island:hover {
  border-color: var(--muted);
}
.here-island:focus-visible {
  outline: 2px solid var(--muted);
  outline-offset: 2px;
}
.here-island-p {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--cta);
  color: var(--cta-ink);
  font-size: 0.7rem;
  font-weight: 700;
}
.here-island-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.here-island-more {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0 0.3rem;
  pointer-events: auto;
}

/* The 📍 chip on a reply that matched an idea: 36 px to the eye, 44 px to the thumb. */
.msg .here-chip {
  position: relative;
  display: flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 36px;
  margin-top: 0.5rem;
  padding: 0.2rem 0.75rem;
  border: 0;
  border-radius: 999px;
  background: var(--here-mark);
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msg .here-chip::before {
  content: '';
  position: absolute;
  inset: -4px 0;
}
.msg .here-chip:focus-visible {
  outline: 2px solid var(--muted);
  outline-offset: 2px;
}
.msg.ai.is-here {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--here-ring) 70%, transparent);
}

/* Map follows the talk: a switch on the phone's map during a live call. */
.here-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0 0.8rem 0.3rem;
}
.here-bar[hidden] {
  display: none;
}
.here-live {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--hair);
  background: var(--bubble);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
}
.here-live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--as-green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--as-green) 25%, transparent);
}
.here-follow {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0 0.2rem;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.here-follow:focus-visible {
  outline: 2px solid var(--muted);
  outline-offset: 2px;
  border-radius: 8px;
}
.here-switch {
  position: relative;
  flex: none;
  width: 38px;
  height: 22px;
  border-radius: 11px;
  background: var(--field-line);
  transition: background 0.15s ease;
}
.here-switch::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.15s ease;
}
.here-follow[aria-checked='true'] .here-switch {
  background: var(--cta);
}
.here-follow[aria-checked='true'] .here-switch::after {
  transform: translateX(16px);
  background: var(--cta-ink);
}

/* The caption: what the interviewer is asking, the matching words marked. */
.here-caption {
  flex: none;
  margin: 0 0.6rem 0.5rem;
  padding: 0.65rem 0.9rem 0.7rem;
  border-radius: 16px;
  border-left: 4px solid var(--muted);
  background: var(--bubble);
  box-shadow: var(--lift);
}
.here-caption[hidden],
.here-his[hidden] {
  display: none;
}
.here-who {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.here-wave {
  width: 18px;
  height: 14px;
  fill: currentColor;
}
.here-said {
  font-size: 1rem;
  line-height: 1.4;
  font-weight: 500;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.here-said mark {
  background: var(--here-mark);
  color: inherit;
  border-radius: 4px;
  padding: 0 2px;
}
.here-his {
  margin-top: 0.45rem;
  padding-top: 0.4rem;
  border-top: 1px dashed var(--hair);
  font-size: 0.8rem;
  font-style: italic;
  color: var(--muted);
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Desktop: no caption and no map switch (Settings has it); the chat beside the map says it all. */
@media (min-width: 881px) {
  .here-caption,
  .here-bar {
    display: none;
  }
}

/* Phone, Map view, the interviewer talking: the mic stays under the caption; the map tools step aside. */
@media (max-width: 880px) {
  body.here-call #left {
    display: flex;
    order: 2;
    flex: none;
  }
  body.here-call #right {
    order: 1;
  }
  body.here-call #left > :not(#composer):not(.flip-bar) {
    display: none;
  }
  body.here-call #view-map > h2,
  body.here-call #view-map > .tools,
  body.here-call #mapMsg {
    display: none;
  }
  body.here-call #view-map {
    padding-top: 0.4rem;
  }
  body.here-call #map {
    min-height: 200px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .here-switch,
  .here-switch::after {
    transition: none;
  }
}
.here-pill.above::before {
  top: auto;
  bottom: -5px;
  border-bottom: 0;
  border-top: 5px solid var(--here-pill);
}
