/* Highlights v6 on web (decisions.md 2026-11-19). Loaded only when the account
   has Thoughts (csrf_token.html); flag off = this file is not on the page.
   Tokens are the app's: violet #6B4FAF / #C4B5FD (Sprout, roots-chip formula),
   lightbulb #B7791F / #F2C94C, toast green #10B981 (toast-service.js).
   No italics anywhere (CEO 2026-10-30). */

/* ── the two bars: one row, text only; a long language breaks 4 + rest ── */
.ht-bar {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 4px;
  padding: 8px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  font-family: Inter, -apple-system, 'Segoe UI', sans-serif;
  font-style: normal;
  min-width: 0;
  animation: ht-bar-in 0.16s ease-out;
}
@keyframes ht-bar-in { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ht-bar { animation: none; } }
.ht-bar .ht-bar-group { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.ht-bar.ht-bar--two { flex-direction: column; align-items: stretch; }
.ht-bar.ht-bar--two .ht-bar-group--rest {
  border-top: 1px solid rgba(0, 0, 0, 0.07);
  margin-top: 4px;
  padding-top: 4px;
}
.ht-bar .ht-bar-btn {
  appearance: none;
  border: 0;
  background: none;
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 18px;
  color: #4a5568;
  white-space: nowrap;
  cursor: pointer;
}
.ht-bar .ht-bar-btn:hover,
.ht-bar .ht-bar-btn:focus-visible { background: rgba(139, 92, 246, 0.08); outline: none; }
.ht-bar .ht-bar-btn--remove { color: var(--ln-danger); }
.ht-bar .ht-bar-btn--remove:hover { background: var(--ln-danger-soft); }
.ht-bar .ht-bar-divider { width: 1px; align-self: stretch; background: rgba(0, 0, 0, 0.08); margin: 4px 2px; }
.ht-bar.ht-bar--two .ht-bar-divider { margin-left: auto; }
.ht-bar.ht-bar--confirm { flex-wrap: nowrap; gap: 8px; }
.ht-bar .ht-bar-question { padding: 0 6px 0 8px; font-size: 14px; color: #2b2722; white-space: nowrap; }

body.dark .ht-bar {
  background: rgba(42, 36, 56, 0.98);
  border-color: rgba(167, 139, 250, 0.28);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}
body.dark .ht-bar .ht-bar-btn { color: #cfc8e3; }
body.dark .ht-bar .ht-bar-btn:hover,
body.dark .ht-bar .ht-bar-btn:focus-visible { background: rgba(167, 139, 250, 0.12); }
body.dark .ht-bar .ht-bar-btn--remove { color: var(--ln-danger); }
body.dark .ht-bar .ht-bar-btn--remove:hover { background: var(--ln-danger-soft); }
body.dark .ht-bar .ht-bar-divider { background: rgba(255, 255, 255, 0.12); }
body.dark .ht-bar.ht-bar--two .ht-bar-group--rest { border-top-color: rgba(255, 255, 255, 0.1); }
body.dark .ht-bar .ht-bar-question { color: #EAE7F5; }

/* ── the Highlighted toast (variant A: text button after a hairline, 6 s) ── */
.ht-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200002;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(440px, calc(100vw - 32px));
  padding: 10px 10px 10px 16px;
  box-sizing: border-box;
  background: #10B981;
  color: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, sans-serif;
  font-size: 14px;
  font-style: normal;
  line-height: 1.4;
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.ht-toast.ht-toast--in { opacity: 1; transform: none; }
.ht-toast .ht-toast-check { font-weight: 700; }
.ht-toast .ht-toast-msg { white-space: nowrap; }
.ht-toast .ht-toast-hair { width: 1px; align-self: stretch; margin: 2px 0; background: rgba(255, 255, 255, 0.45); }
.ht-toast .ht-toast-btn,
.ht-toast .ht-toast-x {
  appearance: none;
  border: 0;
  background: none;
  color: #FFFFFF;
  font: inherit;
  cursor: pointer;
  border-radius: 6px;
}
.ht-toast .ht-toast-btn { font-weight: 700; padding: 4px 6px; min-height: 32px; }
.ht-toast .ht-toast-btn:hover,
.ht-toast .ht-toast-btn:focus-visible { background: rgba(255, 255, 255, 0.18); outline: none; }
.ht-toast .ht-toast-x { font-size: 18px; line-height: 1; padding: 4px 6px; opacity: 0.85; margin-left: auto; }
@media (hover: none) { .ht-toast .ht-toast-btn { min-height: 44px; } }
@media (max-width: 768px) {
  .ht-toast { left: 50%; right: auto; transform: translate(-50%, -8px); }
  .ht-toast.ht-toast--in { transform: translate(-50%, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .ht-toast, .ht-toast.ht-toast--in { transition: opacity 0.2s linear; transform: none; }
  @media (max-width: 768px) { .ht-toast, .ht-toast.ht-toast--in { transform: translateX(-50%); } }
}

/* ── marks: Sprout (thoughts), lightbulb (saved as a prompt) ── */
.ht-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35em;
  height: 1.35em;
  margin: 0 1px 0 3px;
  padding: 0;
  box-sizing: border-box;
  border-radius: 9999px;
  vertical-align: baseline;
  transform: translateY(-0.03em);
  font-style: normal;
  user-select: none;
  -webkit-user-select: none;
  line-height: 1;
}
.ht-mark svg { width: 0.86em; height: 0.86em; display: block; pointer-events: none; }
.ht-mark--th {
  cursor: pointer;
  color: #6B4FAF;
  background: rgba(107, 79, 175, 0.08);
  border: 1px solid rgba(107, 79, 175, 0.18);
  box-shadow: 0 0 0 1px rgba(107, 79, 175, 0.12), 0 1px 2px rgba(15, 23, 42, 0.12);
}
.ht-mark--th:focus-visible { outline: 2px solid #6B4FAF; outline-offset: 1px; }
.ht-mark--th.ht-mark--n { padding: 0 0.4em 0 0.15em; gap: 0.1em; }
/* The count is drawn, not typed: a text node would shift highlight offsets. */
.ht-mark--n::after {
  content: attr(data-n);
  font-family: 'Avenir Next', Avenir, 'Helvetica Neue', sans-serif;
  font-size: 0.72em;
  font-weight: 700;
}
.ht-mark--bulb {
  color: #B7791F;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.24), 0 1px 2px rgba(15, 23, 42, 0.18);
}
body.dark .ht-mark--th,
.ht-panel--dark-surface .ht-mark--th {
  color: #C4B5FD;
  background: rgba(167, 139, 250, 0.12);
  border-color: rgba(167, 139, 250, 0.28);
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.18), 0 1px 2px rgba(15, 23, 42, 0.12);
}
body.dark .ht-mark--bulb {
  color: #F2C94C;
  background: rgba(255, 255, 255, 0.06);
  border-color: #3a324d;
}
.text-highlight.ht-active { background-color: rgba(139, 92, 246, 0.32); }

/* ── Today: the count joins the date (wisdom card option A) ── */
/* The Sprout chip, the same roots-family chip the letter draws (.ht-mark--th), count inside. */
.ht-date-count.ht-mark { cursor: default; margin: 0 2px 0 0; font-size: 13px; vertical-align: middle; }

/* ── Chat: the quoted passage above the composer, and in the sent message ── */
.ht-quote-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 16px;
  padding: 8px 10px 8px 12px;
  border-left: 2px solid #6B4FAF;
  border-radius: 0 10px 10px 0;
  background: rgba(107, 79, 175, 0.08);
  font-family: Palatino, 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
  font-size: 14px;
  font-style: normal;
  line-height: 1.5;
  color: var(--inspiration-modal-text, #2b2722);
}
.ht-quote-card .ht-quote-card-text {
  flex: 1 1 auto;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ht-quote-card .ht-quote-card-x {
  appearance: none;
  border: 0;
  background: none;
  color: inherit;
  opacity: 0.6;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
body.dark .ht-quote-card { border-left-color: #A78BFA; background: rgba(167, 139, 250, 0.12); color: #EAE7F5; }
.ht-msg-quote {
  display: block;
  margin: 0 0 8px;
  padding: 2px 0 2px 10px;
  border-left: 2px solid currentColor;
  opacity: 0.8;
  font-style: normal;
}

/* ── the Thoughts panel: beside the letter (rhymes with Since then) ── */
.ht-row { display: flex; flex: 1 1 auto; min-height: 0; position: relative; }
.ht-row > :is(#historicalResponseContent, #responseContent) { flex: 1 1 auto; min-width: 0; }
:is(#historicalResponseModalContent, #inspirationResponseModalContent).ht-docked { max-width: 1120px !important; width: 1120px; }
@media (min-width: 1440px) {
  :is(#historicalResponseModalContent, #inspirationResponseModalContent).ht-docked { max-width: 1220px !important; width: 1220px; }
}
@media (max-width: 1279px) {
  :is(#historicalResponseModalContent, #inspirationResponseModalContent).ht-docked { width: calc(100vw - 32px); max-width: 1120px !important; }
}

.ht-panel {
  flex: 0 0 340px;
  width: 340px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-sizing: border-box;
  border-left: 1px solid var(--inspiration-modal-border, rgba(0, 0, 0, 0.08));
  color: var(--inspiration-modal-text, #2b2722);
  font-family: 'Avenir Next', Avenir, 'Helvetica Neue', sans-serif;
  font-style: normal;
  text-align: left;
  z-index: 3;
  --ht-mu: var(--inspiration-modal-muted-text, #6f6457);
  --ht-mn: #5B46A6;
  --ht-mnbg: rgba(107, 79, 175, 0.07);
  --ht-ac: #6B4FAF;
  --ht-sub: rgba(0, 0, 0, 0.12);
  --ht-bg: var(--inspiration-modal-bg, #FFFDF9);
}
@media (min-width: 1440px) { .ht-panel { flex-basis: 400px; width: 400px; } }
@media (max-width: 1279px) { .ht-panel { flex-basis: clamp(296px, 29vw, 340px); width: clamp(296px, 29vw, 340px); } }
.ht-panel.ht-panel--dark {
  color: var(--inspiration-modal-text, #EAE7F5);
  --ht-mu: var(--inspiration-modal-muted-text, #a39bb8);
  --ht-mn: #C4B5FD;
  --ht-mnbg: rgba(167, 139, 250, 0.1);
  --ht-ac: #A78BFA;
  --ht-sub: rgba(255, 255, 255, 0.14);
  --ht-bg: var(--inspiration-modal-bg, #221d2e);
}
.ht-panel.ht-panel--drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(360px, 88%);
  background: var(--ht-bg);
  box-shadow: -12px 0 32px rgba(0, 0, 0, 0.14);
  border-radius: 0 0 20px 0;
}
.ht-panel.ht-panel--fixed {
  position: fixed;
  z-index: 10002;
  width: min(360px, 92vw);
  border-radius: 0;
  background: #FFFDF9;
}
body.dark .ht-panel.ht-panel--fixed { background: #221d2e; }
body.zenGarden .ht-panel.ht-panel--fixed { background: #FBF9F2; }

.ht-panel .ht-head { padding: 14px 16px 10px; display: flex; align-items: center; gap: 6px; }
.ht-panel .ht-head-ic { display: inline-flex; color: var(--ht-mn); }
.ht-panel .ht-head-ic svg { width: 15px; height: 15px; }
.ht-panel .ht-head-t { font-family: Palatino, 'Palatino Linotype', 'Book Antiqua', Georgia, serif; font-size: 17px; }
.ht-panel .ht-head-c { font-size: 12.5px; color: var(--ht-mu); }
.ht-panel .ht-close {
  margin-left: auto;
  appearance: none;
  border: 0;
  background: none;
  color: var(--ht-mu);
  font-size: 20px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
  cursor: pointer;
}
.ht-panel .ht-close:hover { background: var(--ht-mnbg); }
.ht-panel .ht-body { padding: 4px 16px 16px; flex: 1 1 auto; overflow-y: auto; min-height: 0; }
.ht-panel .ht-pq { border-left: 2px solid var(--ht-ac); padding: 2px 0 2px 12px; margin-bottom: 12px; }
.ht-panel .ht-pq-w { font-size: 12px; color: var(--ht-mn); font-weight: 700; margin-bottom: 4px; }
.ht-panel .ht-pq-q,
.ht-panel .ht-card-x,
.ht-panel .ht-comp-in {
  font-family: Palatino, 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
  font-size: 15.5px;
  line-height: 1.55;
  font-style: normal;
}
.ht-panel .ht-card { background: var(--ht-mnbg); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.ht-panel .ht-card-m { font-size: 12px; color: var(--ht-mu); margin-bottom: 3px; }
.ht-panel .ht-card-x { white-space: pre-wrap; overflow-wrap: anywhere; }
.ht-panel .ht-card-x--muted { color: var(--ht-mu); }
.ht-panel .ht-card-a { display: flex; align-items: center; gap: 14px; margin-top: 6px; font-size: 12px; color: var(--ht-mu); }
.ht-panel .ht-card-q { color: inherit; }
.ht-panel .ht-link {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--ht-mu);
  opacity: 0.85;
  cursor: pointer;
}
.ht-panel .ht-link:hover { opacity: 1; text-decoration: underline; }
.ht-panel .ht-link--danger { color: var(--ln-danger); opacity: 1; }
.ht-panel .ht-empty { font-size: 13px; color: var(--ht-mu); margin: 2px 0 10px; }
.ht-panel .ht-empty--wait { min-height: 18px; }
.ht-panel .ht-foot { padding: 10px 16px 14px; border-top: 1px solid var(--inspiration-modal-border, rgba(0, 0, 0, 0.08)); }
.ht-panel .ht-add {
  display: block;
  width: 100%;
  text-align: left;
  appearance: none;
  background: none;
  border: 1px solid var(--ht-sub);
  border-radius: 999px;
  padding: 9px 16px;
  font: inherit;
  font-size: 14px;
  color: var(--ht-mu);
  cursor: pointer;
}
.ht-panel .ht-add:hover { border-color: var(--ht-ac); color: var(--ht-mn); }
.ht-panel .ht-comp { border: 1px solid var(--ht-sub); border-radius: 14px; padding: 10px 12px; background: var(--ht-bg); }
.ht-panel .ht-comp-in {
  display: block;
  width: 100%;
  min-height: 72px;
  box-sizing: border-box;
  resize: vertical;
  border: 0;
  outline: none;
  background: transparent;
  color: inherit;
  padding: 0;
}
.ht-panel .ht-comp-in::placeholder { color: var(--ht-mu); opacity: 0.8; font-style: normal; }
.ht-panel .ht-comp-row { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.ht-panel .ht-comp-note { margin-right: auto; font-size: 12px; color: var(--ln-danger); }
.ht-panel .ht-comp-cx,
.ht-panel .ht-comp-sv {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 6px 18px;
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}
.ht-panel .ht-comp-cx { background: none; color: var(--ht-mu); }
.ht-panel .ht-comp-sv { background: #6B4FAF; color: #FFFFFF; font-weight: 600; }
.ht-panel .ht-comp-sv:disabled { opacity: 0.45; cursor: default; }

/* ── The lightbulb's sentence, lit while the bulb is hovered, focused or open
   (CEO 2026-11-25, "Lit on touch"). Painted by highlight_thoughts_web.js with
   the CSS Custom Highlight API; gold = the bulb's ink, 16% light / 22% dark. ── */
::highlight(ht-bulb-lit) { background-color: rgba(214, 158, 46, 0.16); }
body.zenGarden ::highlight(ht-bulb-lit) { background-color: rgba(183, 121, 31, 0.15); }
body.dark ::highlight(ht-bulb-lit) { background-color: rgba(242, 201, 76, 0.22); }
