/* ============================================================
   INVESTRA - DRISHTI styles  (drishti.css)
   Moved verbatim out of app.css in Round 16 (WP-01), in the original order:
   panel rules, the phone fragments, DRISHTI v4, the small-phone launcher rule.
   Loaded right after app.css on every page.
   ============================================================ */
/* ============================================================
   DRISHTI PANEL  (preset chips + input → DRISHTI.ask)
   Replaces the legacy Gemini box. Uses .glass on the wrapper.
   ============================================================ */
.drishti { padding: 22px; margin-top: 20px; }
.drishti-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.drishti-icon {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: none; overflow: hidden;
  color: var(--gold);
}
/* DRISHTI emblem image fills its round slot (own dark disc + gold eye) */
.dr-mark { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 50%; }
.dr-msg.ai .dr-av { overflow: hidden; }
.drishti-headtext { min-width: 0; flex: 1; }
.drishti-title { font-size: 13px; font-weight: 700; color: var(--gold); letter-spacing: 1px; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.drishti-tag { font-size: 9px; font-weight: 700; letter-spacing: .6px; color: var(--gold); background: var(--gold-dim, rgba(201,168,76,0.14)); border: 1px solid var(--gold); border-radius: 999px; padding: 2px 8px; text-transform: uppercase; }
.drishti-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; line-height: 1.5; }
.drishti-status {
  margin-left: auto; align-self: flex-start; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono, monospace); font-size: 9.5px; letter-spacing: .4px; color: var(--teal, #3ecfb2);
  background: var(--teal-dim, rgba(62,207,178,0.12)); padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--teal, #3ecfb2);
}
.drishti-status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal, #3ecfb2); box-shadow: 0 0 7px var(--teal, #3ecfb2); animation: drishtiPulse 2s ease-in-out infinite; }
@keyframes drishtiPulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .drishti-status-dot { animation: none; } }

/* ---- DRISHTI chat transcript ---- */
.drishti-chat { display: flex; flex-direction: column; gap: 12px; max-height: 430px; overflow-y: auto;
  padding: 4px 2px 12px; margin-bottom: 12px; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.dr-msg { display: flex; align-items: flex-start; gap: 9px; max-width: 92%; }
.dr-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.dr-av { width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-top: 2px; }
.dr-msg.ai .dr-av { background: linear-gradient(135deg, var(--gold-dim), var(--blue-dim, rgba(91,156,246,0.12))); color: var(--gold); border: 1px solid var(--border-gold, var(--gold)); }
.dr-msg.user .dr-av { background: var(--bg-input); color: var(--text-muted); border: 1px solid var(--border); }
.dr-bubble { border-radius: 14px; padding: 11px 14px; font-size: 13px; line-height: 1.7; min-width: 0; }
.dr-msg.ai .dr-bubble { background: var(--bg-card); border: 1px solid var(--border); border-top-left-radius: 5px; color: var(--text-sub); }
.dr-msg.user .dr-bubble { background: var(--gold-dim, rgba(201,168,76,0.13)); border: 1px solid var(--border-gold, var(--gold)); border-top-right-radius: 5px; color: var(--text); font-weight: 500; }
.dr-bubble p { margin: 0 0 9px; } .dr-bubble p:last-child { margin-bottom: 0; }
/* typing indicator - three breathing dots while DRISHTI thinks */
.dr-typing { display: inline-flex; gap: 5px; padding: 3px 2px; }
.dr-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); animation: drTyping 1.2s ease-in-out infinite; }
.dr-typing i:nth-child(2) { animation-delay: .18s; } .dr-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes drTyping { 0%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.drishti-status.thinking { color: var(--gold); border-color: var(--gold); background: var(--gold-dim, rgba(201,168,76,0.12)); }
.drishti-status.thinking .drishti-status-dot { background: var(--gold); box-shadow: 0 0 7px var(--gold); }
@media (prefers-reduced-motion: reduce) { .dr-typing i { animation: none; opacity: .7; } .drishti-chat { scroll-behavior: auto; } }

.drishti-bubbles { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.drishti-chip {
  font-size: 12px;
  color: var(--text-sub);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 13px;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease, transform 120ms var(--ease-out, ease);
  line-height: 1.3;
  text-align: left;
}
@media (hover: hover) and (pointer: fine) {
  .drishti-chip:hover { border-color: var(--gold); color: var(--text); background: var(--gold-dim); }
}
.drishti-chip:active { transform: scale(0.97); }

.drishti-input-row { display: flex; gap: 8px; margin-bottom: 12px; align-items: flex-end; }
.drishti-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius-sm, 6px);
  font-size: 13px;
  font-family: var(--font-sans, sans-serif);
  resize: none;
  min-height: 44px;
  line-height: 1.4;
  transition: border-color 160ms ease;
}
.drishti-input:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px var(--gold-dim); }
.drishti-send {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0 18px;
  height: 44px;
  background: linear-gradient(135deg, #f4d98a, var(--gold), #b8862f);
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm, 6px);
  color: #1a1305;
  font-weight: 700; font-size: 13px; letter-spacing: .3px;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 3px 12px var(--gold-glow), inset 0 1px 0 rgba(255,255,255,.4);
  transition: transform 120ms var(--ease-out, ease), box-shadow 160ms ease, filter 160ms ease;
}
.drishti-send svg { width: 14px; height: 14px; }
@media (hover: hover) and (pointer: fine) { .drishti-send:hover { transform: translateY(-1px); box-shadow: 0 6px 18px var(--gold-glow); filter: brightness(1.05); } }
.drishti-send:active { transform: scale(0.97); }
.drishti-send:disabled { opacity: 0.5; cursor: default; filter: grayscale(.3); }

.drishti-response {
  min-height: 24px;
  font-size: 13px; line-height: 1.7;
  color: var(--text-sub);
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.drishti-response p { margin: 0 0 10px; }
.drishti-response p:last-child { margin-bottom: 0; }
.drishti-response.empty { color: var(--text-muted); font-style: italic; }
.drishti-response.loading { color: var(--text-muted); font-style: italic; }
/* inside a chat bubble the response loses its standalone divider/spacing */
.dr-bubble.drishti-response, .dr-msg .drishti-response { border-top: none; padding-top: 11px; min-height: 0; }
.drishti-source {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 12px;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  letter-spacing: 0.3px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.drishti-source::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }
.drishti-source.live::before { background: var(--blue); }
.drishti-cursor::after { content: '▊'; animation: drishti-blink 0.9s step-start infinite; color: var(--gold); }
@keyframes drishti-blink { 50% { opacity: 0; } }
/* Deep-link action chips under a DRISHTI answer */
.dr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.dr-action {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; line-height: 1;
  padding: 8px 13px; border-radius: 999px;
  color: var(--gold); text-decoration: none;
  background: var(--gold-dim, rgba(201,168,76,0.13));
  border: 1px solid var(--border-gold, var(--gold));
  transition: background .18s ease, transform .12s ease, box-shadow .18s ease;
}
.dr-action svg { opacity: .8; transition: transform .18s ease; }
.dr-action:hover { background: var(--gold); color: #1a1206; box-shadow: 0 4px 14px rgba(201,168,76,0.25); }
.dr-action:hover svg { transform: translateX(2px); opacity: 1; }
.dr-action:active { transform: scale(0.97); }
@media (prefers-reduced-motion: reduce) { .dr-action, .dr-action svg { transition: none; } }

@media (max-width: 768px) {
  /* DRISHTI chips scroll instead of stacking tall */
  .drishti-bubbles { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
  .drishti-bubbles::-webkit-scrollbar { display: none; }
  .drishti-chip { flex: 0 0 auto; }
}

@media (max-width: 480px) {
  .drishti { padding: 16px; }
}

/* ============================================================
   DRISHTI v4 (Round 13) - tools, suggestion tabs, rich cards, follow-ups,
   side panel + floating launcher. Tokens only, so both themes follow.
   ============================================================ */
.drishti { position: relative; }
.drishti::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 60% at 0% 0%, color-mix(in srgb, var(--gold) 9%, transparent), transparent 60%); }
.drishti > * { position: relative; }
.drishti-head { align-items: flex-start; }
.dr-tools { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.dr-tool { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg-input); color: var(--text-sub);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: border-color .15s ease, color .15s ease, background .15s ease; }
.dr-tool:hover { border-color: var(--gold); color: var(--gold); }
.dr-tool.dr-close { display: none; }
.drishti-chat { max-height: 470px; overscroll-behavior: contain; scroll-behavior: smooth; padding: 4px 2px 6px; }
.dr-msg { max-width: 96%; }
.dr-msg.ai { width: 100%; }
.dr-msg.ai .dr-bubble { flex: 1; }
.dr-bubble ul, .dr-bubble ol { margin: 4px 0 10px; padding-left: 18px; }
.dr-bubble li { margin: 3px 0; }
.dr-bubble li::marker { color: var(--gold); }
.dr-bubble strong { color: var(--text); font-weight: 650; }
.dr-settled > .dr-card, .dr-settled > .dr-actions, .dr-settled > .dr-meta { animation: drIn .35s var(--ease-out, ease) both; }
.dr-settled > .dr-actions { animation-delay: .06s; } .dr-settled > .dr-meta { animation-delay: .1s; }
@keyframes drIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.dr-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.dr-meta .drishti-source { margin-top: 0; }
.dr-resolved { font-size: 10.5px; color: var(--text-muted); border: 1px dashed var(--border); border-radius: 999px; padding: 2px 8px; font-family: var(--font-mono); }
.dr-mini { margin-left: auto; font-size: 10.5px; font-family: var(--font-mono); letter-spacing: .04em; color: var(--text-muted); background: transparent;
  border: 1px solid var(--border); border-radius: 7px; padding: 3px 8px; cursor: pointer; }
.dr-mini:hover { color: var(--gold); border-color: var(--gold); }
.dr-follow { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: -2px 0 2px 35px; animation: drIn .35s var(--ease-out, ease) both; }
.dr-follow > span { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); margin-right: 2px; }
.dr-follow .drishti-chip { font-size: 11.5px; padding: 6px 11px; border-style: dashed; }
.dr-suggest { margin-bottom: 12px; }
.dr-tabs { display: flex; gap: 4px; margin-bottom: 9px; overflow-x: auto; scrollbar-width: none; }
.dr-tabs::-webkit-scrollbar { display: none; }
.dr-tab { flex: 0 0 auto; font-size: 11px; letter-spacing: .04em; padding: 5px 11px; border-radius: 999px; border: 1px solid transparent; background: transparent;
  color: var(--text-muted); cursor: pointer; transition: color .15s ease, background .15s ease, border-color .15s ease; }
.dr-tab:hover { color: var(--text); }
.dr-tab.on { color: var(--gold); border-color: var(--border-gold, var(--gold)); background: var(--gold-dim); }
.drishti-bubbles { margin-bottom: 0; }
.drishti-input { resize: none; overflow-y: auto; }
.dr-foot { font-size: 10.5px; color: var(--text-muted); text-align: right; margin-top: -4px; }
.dr-foot kbd { font-family: var(--font-mono); font-size: 9.5px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--bg-input); }

/* cards */
.dr-card { margin-top: 12px; border: 1px solid var(--border); border-radius: 13px; background: var(--bg-input); overflow: hidden; }
.dr-co-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-decoration: none; color: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 10%, transparent), transparent 70%); border-bottom: 1px solid var(--border); }
.dr-co-head:hover .dr-co-id b { color: var(--gold); }
.dr-co-id { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dr-co-id b { font-family: var(--font-mono); font-size: 14px; color: var(--text); letter-spacing: .02em; transition: color .15s ease; }
.dr-co-id small { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-grade { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 20px; padding: 0 6px; border-radius: 6px; color: #fff; font-size: 11px; font-weight: 700; font-family: var(--font-mono); }
.dr-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dr-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.dr-ring circle { fill: none; stroke-width: 3.2; }
.dr-ring circle.bg { stroke: var(--border); }
.dr-ring circle.fg { stroke-linecap: round; transition: stroke-dasharray .9s var(--ease-out, ease); }
.dr-ring b { font-family: var(--font-mono); font-size: 12.5px; color: var(--text); }
.dr-co-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.dr-tile { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--border); min-width: 0; }
.dr-tile:last-child { border-right: 0; }
.dr-tile span { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.dr-tile b { font-family: var(--font-mono); font-size: 14px; color: var(--text); white-space: nowrap; }
.dr-tile small { font-size: 10px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-co-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 14px; border-top: 1px solid var(--border); font-size: 11.5px; }
.dr-co-foot .sig { font-size: 10.5px; }
.dr-flag { font-size: 10.5px; color: var(--coral); background: var(--coral-dim, color-mix(in srgb, var(--coral) 12%, transparent)); border: 1px solid color-mix(in srgb, var(--coral) 40%, transparent); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.dr-ok { font-size: 10.5px; color: var(--teal); border: 1px solid color-mix(in srgb, var(--teal) 40%, transparent); border-radius: 999px; padding: 2px 9px; }
.dr-note { font-size: 10.5px; color: var(--text-muted); }
.dr-co-link { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; color: var(--gold); text-decoration: none; font-weight: 600; font-size: 11.5px; }
.dr-co-link:hover { text-decoration: underline; }
.dr-cmp table, .dr-tbl table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dr-cmp thead th { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; font-weight: 500; }
.dr-cmp thead th a { display: flex; align-items: center; gap: 9px; text-decoration: none; color: inherit; }
.dr-cmp thead th span { display: flex; flex-direction: column; }
.dr-cmp thead b { font-family: var(--font-mono); font-size: 13px; color: var(--text); }
.dr-cmp thead small { font-size: 10px; color: var(--text-muted); }
.dr-cmp tbody th { text-align: left; font-weight: 500; color: var(--text-muted); font-size: 11px; padding: 6px 12px; width: 32%; }
.dr-cmp td { font-family: var(--font-mono); padding: 6px 12px; color: var(--text-sub); }
.dr-cmp tbody tr:nth-child(odd) { background: color-mix(in srgb, var(--text) 2.5%, transparent); }
.dr-cmp td.win { color: var(--gold); font-weight: 700; }
.dr-cmp td.win::after { content: " ●"; font-size: 7px; vertical-align: 2px; }
.dr-tbl-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--border);
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.dr-tbl-head .dr-mini { margin-left: 0; }
.dr-tbl-wrap { overflow-x: auto; max-height: 340px; overflow-y: auto; overscroll-behavior: contain; }
.dr-tbl th { position: sticky; top: 0; background: var(--bg-input); text-align: right; font-weight: 500; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); padding: 7px 10px; white-space: nowrap; z-index: 1; }
.dr-tbl th:nth-child(-n+2) { text-align: left; }
.dr-tbl td { padding: 6px 10px; border-top: 1px solid var(--border); text-align: right; font-family: var(--font-mono); color: var(--text-sub); white-space: nowrap; }
.dr-tbl td:nth-child(2) { text-align: left; font-family: var(--font-sans); }
.dr-tbl td a { display: flex; flex-direction: column; text-decoration: none; color: inherit; min-width: 120px; }
.dr-tbl td a b { font-family: var(--font-mono); color: var(--text); font-size: 12px; }
.dr-tbl td a small { font-size: 10px; color: var(--text-muted); max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.dr-tbl td a:hover b { color: var(--gold); }
.dr-tbl td.rk { color: var(--text-muted); text-align: left; width: 22px; }
.dr-tbl td small { font-size: 9.5px; color: var(--text-muted); }
.dr-tbl tr.hl td { background: var(--gold-dim); }
.dr-tbl .dr-astra { color: var(--text); margin-right: 6px; }
.dr-tbl .dr-grade { height: 17px; min-width: 22px; font-size: 10px; }
.dr-up { color: var(--teal); } .dr-down { color: var(--coral); }
.dr-tbl .dr-flag { font-family: var(--font-sans); }

/* side panel */
.dr-drawer { position: fixed; inset: 0; z-index: 1200; pointer-events: none; }
.dr-scrim { position: absolute; inset: 0; background: rgba(6, 6, 10, .38); opacity: 0; transition: opacity .24s ease; backdrop-filter: blur(1.5px); -webkit-backdrop-filter: blur(1.5px); }
.dr-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(500px, 100vw); transform: translateX(104%); transition: transform .3s var(--ease-out, ease);
  background: var(--bg-base); border-left: 1px solid var(--border-gold, var(--border)); box-shadow: -18px 0 50px rgba(0,0,0,.28); display: flex; overflow: hidden; }
.dr-drawer.on { pointer-events: auto; }
.dr-drawer.on .dr-scrim { opacity: 1; }
.dr-drawer.on .dr-panel { transform: none; }
.drishti.dr-in-drawer { margin: 0; border-radius: 0; width: 100%; display: flex; flex-direction: column; padding: 18px 18px 12px; border: 0; box-shadow: none; }
.drishti.dr-in-drawer .drishti-chat { flex: 1 1 auto; max-height: none; min-height: 0; }
.drishti.dr-in-drawer .dr-tool.dr-pop { display: none; }
.drishti.dr-in-drawer .dr-tool.dr-close { display: inline-flex; }
.drishti.dr-in-drawer .drishti-sub { display: none; }
.drishti.dr-in-drawer .dr-co-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.drishti.dr-in-drawer .dr-co-grid .dr-tile:nth-child(3) { border-right: 0; }
.drishti.dr-in-drawer .dr-co-grid .dr-tile:nth-child(-n+3) { border-bottom: 1px solid var(--border); }
html.dr-open .astra-fab, html.dr-open .guide-fab { opacity: 0; pointer-events: none; }
.dr-placeholder { display: flex; align-items: center; gap: 10px; padding: 14px 18px; margin-top: 20px; font-size: 12.5px; color: var(--text-sub); }
.dr-placeholder .dr-mark { width: 22px; height: 22px; }
.dr-placeholder .dr-action { margin-left: auto; cursor: pointer; }

/* floating launcher - sits left of the ASTRA button */
.dr-launch { position: fixed; z-index: 295; right: calc(128px + env(safe-area-inset-right, 0px)); bottom: calc(48px + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 9px; height: 44px; padding: 0 16px 0 6px; border-radius: 999px; cursor: pointer;
  background: var(--bg-card); color: var(--text); border: 1px solid var(--border-gold, var(--gold));
  box-shadow: 0 8px 26px var(--glass-shadow, rgba(0,0,0,.3)), 0 0 0 4px color-mix(in srgb, var(--gold) 8%, transparent);
  opacity: 0; transform: translateY(14px) scale(.96); pointer-events: none; transition: opacity .25s ease, transform .3s var(--ease-out, ease), border-color .15s ease; }
.dr-launch.on { opacity: 1; transform: none; pointer-events: auto; }
.dr-launch:hover { border-color: var(--gold); transform: translateY(-2px); }
.dr-launch-eye { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; display: inline-flex; box-shadow: 0 0 14px color-mix(in srgb, var(--gold) 45%, transparent); }
.dr-launch-eye .dr-mark { width: 100%; height: 100%; }
.dr-launch-txt { font-size: 12.5px; font-weight: 650; letter-spacing: .03em; }
@media (max-width: 1100px) { .dr-co-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .dr-co-grid .dr-tile:nth-child(3) { border-right: 0; } .dr-co-grid .dr-tile:nth-child(-n+3) { border-bottom: 1px solid var(--border); } }
@media (max-width: 768px) {
  .dr-launch { right: calc(92px + env(safe-area-inset-right, 0px)); bottom: calc(27px + env(safe-area-inset-bottom, 0px)); padding: 0 6px; }
  .dr-launch-txt { display: none; }
  .dr-follow { margin-left: 0; }
  .dr-foot { display: none; }
  .drishti-head { flex-wrap: wrap; }
}
@media (max-width: 480px) { .dr-co-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dr-co-grid .dr-tile { border-bottom: 1px solid var(--border); } .dr-co-grid .dr-tile:nth-child(odd) { border-right: 1px solid var(--border); } .dr-co-grid .dr-tile:nth-child(even) { border-right: 0; } }
@media (prefers-reduced-motion: reduce) { .dr-settled > *, .dr-follow, .dr-panel, .dr-scrim, .dr-launch { animation: none !important; transition: none !important; } }

/* DRISHTI v4: once a conversation is going, suggestions collapse to one scrollable row; the
   ASTRA button steps aside while you type so it never covers the Ask button */
.drishti.dr-has-hist .drishti-bubbles { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
.drishti.dr-has-hist .drishti-bubbles::-webkit-scrollbar { display: none; }
.drishti.dr-has-hist .drishti-chip { flex: 0 0 auto; }
html:has(.drishti-input:focus) .astra-fab, html:has(.drishti-input:focus) .dr-launch { opacity: 0; pointer-events: none; }

@media (max-width:480px){
  .dr-launch{right:calc(80px + env(safe-area-inset-right,0px));bottom:calc(22px + env(safe-area-inset-bottom,0px))}
}

/* ---- Round 16 (WP-09): drawer per tier, phone sheet, jump-to-chart, table scrollers ---- */
@media (min-width:1600px) { .dr-panel { width: 520px; } }
@media (min-width:744px) and (max-width:1023.98px) { .dr-panel { width: min(440px, 62vw); } }
/* phones: a full-screen sheet that follows the visual viewport (the keyboard never covers the input) */
@media (max-width:743.98px) {
  .dr-panel { top: var(--dr-vvt, 0px); bottom: auto; left: 0; right: 0; width: 100vw; height: var(--dr-vvh, 100dvh); border: 0; border-radius: 0; transform: translateY(104%); box-shadow: none; }
  .drishti.dr-in-drawer { padding: max(10px, env(safe-area-inset-top, 0px)) 14px max(10px, env(safe-area-inset-bottom, 0px)); }
  .drishti.dr-in-drawer .drishti-head { flex-wrap: nowrap; }
  .drishti.dr-in-drawer .drishti-tag { display: none; }
}
html.dr-modal, html.dr-modal body { overflow: hidden; overscroll-behavior: none; }
html.dr-peek .dr-drawer.on { pointer-events: none; }
html.dr-peek .dr-drawer.on .dr-panel { pointer-events: auto; }
html.dr-peek .dr-scrim { opacity: 0 !important; }
/* the chart a jump lands on */
@keyframes drSpot {
  0% { box-shadow: 0 0 0 0 transparent; }
  18% { box-shadow: 0 0 0 3px var(--gold), 0 0 0 10px color-mix(in srgb, var(--gold) 28%, transparent); }
  70% { box-shadow: 0 0 0 2px var(--gold), 0 0 0 6px color-mix(in srgb, var(--gold) 14%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.dr-spot { animation: drSpot 2.6s ease-out 1; }
@media (prefers-reduced-motion: reduce) { .dr-spot { animation: none; outline: 2px solid var(--gold); outline-offset: 3px; } }
/* jump chip: gold outline + crosshair, ahead of the action chips */
.dr-jumps { margin-bottom: 6px; }
.dr-jump { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--gold); color: var(--gold); background: var(--gold-dim); font-size: 12px; font-weight: 650; text-decoration: none; cursor: pointer; }
.dr-jump:hover { background: var(--gold); color: #1a1206; }
.dr-jump:focus-visible, .dr-action:focus-visible, .dr-tool:focus-visible, .drishti-chip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
/* wide compare / ranked tables scroll inside the card instead of being cut off */
.dr-tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.dr-tscroll table { width: max-content; min-width: 100%; }
.dr-cmp .dr-tscroll th:first-child, .dr-cmp .dr-tscroll td:first-child { position: sticky; left: 0; z-index: 1; background: var(--bg-input); }
/* iOS zooms into any input under 16px: keep the composer at 16px on phones, tablets and touch screens */
@media (max-width:1023.98px), (pointer:coarse) { .drishti .drishti-input { font-size: 16px; } }
/* R18: the launcher meets the 44px touch target on phones and tablets */
@media (max-width: 1023.98px) { .dr-launch { min-height: 46px; min-width: 46px; } }   /* stays 44px+ through its 0.96 breathing scale */

/* ============================================================
   R21: DRISHTI on phones + a live emblem
   ============================================================ */
.drishti-tag { white-space: nowrap; }
/* the emblem is alive: a gold light circles it and its glow breathes (transform and opacity only) */
.drishti-icon, .dr-launch-eye { position: relative; overflow: visible; isolation: isolate; }
.drishti-icon .dr-mark, .dr-launch-eye .dr-mark { position: relative; z-index: 1; }
.drishti-icon::before, .dr-launch-eye::before { content: ""; position: absolute; inset: -3px; z-index: 0; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, transparent 0 58%, color-mix(in srgb, var(--gold) 25%, transparent) 70%, #f6dc8e 86%, transparent 93%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
  animation: drOrbit 3.8s linear infinite; }
.drishti-icon::after, .dr-launch-eye::after { content: ""; position: absolute; inset: -7px; z-index: -1; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--gold) 42%, transparent) 0, transparent 68%); animation: drBreath 3.4s ease-in-out infinite; }
@keyframes drOrbit { to { transform: rotate(360deg); } }
@keyframes drBreath { 0%, 100% { opacity: .3; transform: scale(.9); } 50% { opacity: .85; transform: scale(1.06); } }
.drishti:not(.dr-in-drawer) { background-image: radial-gradient(120% 70% at 0% 0%, color-mix(in srgb, var(--gold) 8%, transparent), transparent 62%); }
@media (max-width: 640px) {
  /* one tidy header row (emblem, name and badge, tools); the description runs underneath, full width */
  .drishti:not(.dr-in-drawer) .drishti-head { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: "icon title tools" "sub sub sub"; align-items: center; column-gap: 10px; row-gap: 8px; }
  .drishti:not(.dr-in-drawer) .drishti-headtext { display: contents; }
  .drishti:not(.dr-in-drawer) .drishti-icon { grid-area: icon; }
  .drishti:not(.dr-in-drawer) .drishti-title { grid-area: title; min-width: 0; flex-wrap: nowrap; }
  .drishti:not(.dr-in-drawer) .dr-tools { grid-area: tools; align-items: center; }
  .drishti:not(.dr-in-drawer) .drishti-sub { grid-area: sub; margin-top: 0; }
  .drishti:not(.dr-in-drawer) .drishti-status { padding: 0; width: 22px; height: 22px; justify-content: center; }
  .drishti:not(.dr-in-drawer) .drishti-status-txt { display: none; }
}
@media (prefers-reduced-motion: reduce) { .drishti-icon::before, .dr-launch-eye::before, .drishti-icon::after, .dr-launch-eye::after { animation: none; } }

/* ============================================================
   R23: DRISHTI redesign - welcome hero, clean answers with fact rows, gold user pills, an iMessage-style composer,
   a thinking indicator, and a proper phone sheet. Colours come from the theme tokens, so light and dark both work.
   ============================================================ */
.drishti-chat { gap: 16px; scroll-behavior: smooth; }
.dr-msg { max-width: 100%; }
.dr-msg.ai .dr-bubble { background: none; border: 0; padding: 2px 0 0; font-size: 14px; line-height: 1.65; color: var(--text-sub); }
.dr-msg.ai .dr-bubble > p:first-child strong:first-child { color: var(--text); }
.dr-msg.ai .dr-bubble > p:first-child { font-size: 14.5px; color: var(--text); }
.dr-msg.user { max-width: 86%; }
.dr-msg.user .dr-av { display: none; }
.dr-msg.user .dr-bubble { padding: 10px 15px; border-radius: 20px 20px 6px 20px; border: 0; font-size: 14px; color: var(--text); background: color-mix(in srgb, var(--gold) 22%, var(--bg-card)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 30%, transparent) inset; }
.dr-msg.ai .dr-av { width: 28px; height: 28px; border: 0; background: none; }
.dr-msg.ai .dr-av .dr-mark { width: 28px; height: 28px; }
.dr-bubble:empty::before { content: ""; display: inline-block; width: 40px; height: 10px; margin-top: 8px;
  background: radial-gradient(circle, var(--gold) 0 3px, transparent 3.5px) 0 50% / 13px 10px repeat-x; opacity: .7; animation: drDots 1s steps(3, end) infinite; }
@keyframes drDots { 0% { width: 14px; } 100% { width: 40px; } }
/* fact rows */
.dr-bubble ul.dr-facts { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dr-fact { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 9px 12px; border-radius: 12px; background: var(--bg-input); border: 1px solid var(--border); }
.dr-fact-k { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.dr-fact-v { font-size: 13.5px; color: var(--text); line-height: 1.5; }
.dr-bubble ul:not(.dr-facts) { padding-left: 18px; }
/* welcome */
.dr-hello-row { max-width: 100% !important; }
.dr-hello-row .dr-av { display: none; }
.dr-hello { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 10px 2px 4px; }
.dr-hello-mark { position: relative; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 45%, transparent), 0 0 34px color-mix(in srgb, var(--gold) 35%, transparent); }
.dr-hello-mark .dr-mark { width: 56px; height: 56px; }
.dr-hello-mark::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0 60%, #f6dc8e 85%, transparent 92%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px)); animation: drOrbit 4s linear infinite; }
.dr-hello-t { margin-top: 12px; font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--text); }
.dr-hello-s { max-width: 34ch; margin-top: 4px; font-size: 12.5px; line-height: 1.5; color: var(--text-muted); }
.dr-starts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; margin-top: 14px; }
.drishti-chip.dr-start { display: grid; grid-template-columns: 30px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 9px; row-gap: 1px; align-items: center; width: 100%; min-height: 64px; padding: 10px 11px; text-align: left; border-radius: 14px; white-space: normal;
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text); transition: border-color .25s, background-color .25s, transform .2s; }
.drishti-chip.dr-start:hover { border-color: color-mix(in srgb, var(--gold) 60%, var(--border)); background: color-mix(in srgb, var(--gold) 8%, var(--bg-input)); }
.dr-start-ic { grid-row: 1 / span 2; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, transparent); }
.dr-start-ic svg { width: 16px; height: 16px; }
.dr-start b { font-size: 12.5px; font-weight: 700; }
.dr-start small { font-size: 11px; line-height: 1.35; color: var(--text-muted); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: clip; }   /* R23: two lines on phones instead of an ellipsis */
.dr-hello-note { margin-top: 12px; font-size: 11px; color: var(--text-muted); }
/* follow-ups and actions */
.dr-follow { margin-left: 37px; }
.dr-action { border-radius: 999px; }
/* composer: one rounded field with the send button inside */
.drishti-input-row { position: relative; gap: 0; }
.drishti-input { padding-right: 56px !important; border-radius: 22px !important; min-height: 48px; }
.drishti-send { position: absolute; right: 6px; bottom: 6px; width: 38px; min-width: 38px; height: 38px; padding: 0 !important; border-radius: 50% !important; justify-content: center; gap: 0 !important; }
.drishti-send::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; }   /* a 44 px finger target */
.drishti-send span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.drishti-send svg { width: 17px; height: 17px; }
/* header */
.drishti.dr-in-drawer .drishti-head { padding-bottom: 12px; margin-bottom: 10px; border-bottom: 1px solid transparent; border-image: linear-gradient(90deg, transparent, color-mix(in srgb, var(--gold) 45%, transparent), transparent) 1; }
/* phone: a sheet with a grabber, roomy targets, a pinned composer */
@media (max-width: 743.98px) {
  .drishti.dr-in-drawer { display: flex; flex-direction: column; height: 100%; }
  .drishti.dr-in-drawer::after { content: ""; position: absolute; left: 50%; top: max(6px, env(safe-area-inset-top, 0px)); width: 38px; height: 5px; margin-left: -19px; border-radius: 3px; background: color-mix(in srgb, var(--text-muted) 45%, transparent); }
  .drishti.dr-in-drawer .drishti-head { padding-top: 12px; }
  .drishti.dr-in-drawer .drishti-chat { flex: 1; max-height: none; padding: 0 2px; }
  .drishti.dr-in-drawer .dr-suggest { margin-top: 6px; }
  .drishti.dr-in-drawer .drishti-input-row { margin-bottom: 4px; }
  .drishti.dr-in-drawer .drishti-input { font-size: 16px; }
  .dr-fact { grid-template-columns: 96px minmax(0, 1fr); }
  .dr-starts { gap: 7px; }
}
@media (prefers-reduced-motion: reduce) { .dr-bubble:empty::before, .dr-hello-mark::after { animation: none; } }
