/* Ask Discovery Energy: the AI assistant chat (2026-11-18; on every page from 2026-11-19).
   Used by /ask/ (build/src/ask_page.py) and by the panel assets/js/ask-launch.js opens from the header button or the
   corner bubble on every other page, so it carries its own tokens (the home page does not load site.css).
   Values follow the Discovery Energy Web UI design system: Figtree text, Outfit display, green actions, white cards. */
.ask, .askp {
  --a-ink: #141c18; --a-body: #46504b; --a-muted: #66706b; --a-line: #e1e5e9; --a-chip: #d5dbe0;
  --a-bg: #f1f3f6; --a-card: #f7f8fa; --a-soft: #e9edf1; --a-white: #fff; --a-band: #e6f2dc;
  --a-green: #2f7d3a; --a-green-2: #246630; --a-green-text: #2b6f34; --a-leaf: #72b84c; --a-error: #9b2c1f;
  --a-font: "Figtree", "Helvetica Neue", Arial, sans-serif;
  --a-display: "Outfit", "Helvetica Neue", Arial, sans-serif;
  --a-mono: "DM Mono", ui-monospace, Menlo, monospace;
  --a-shadow: 0 1px 0 rgb(255 255 255 / .9) inset, 0 18px 40px -18px rgb(20 35 28 / .22), 0 2px 6px rgb(20 35 28 / .05);
}

/* ---------- the /ask/ page ---------- */
.ask-page { padding-bottom: 72px; }
.ask-page .page-head { padding-bottom: 8px; }
.ask-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
@media (max-width: 960px) { .ask-layout { grid-template-columns: 1fr; } }
.ask-side { background: var(--dark, #12231c); color: #dfe7e2; border-radius: 24px; padding: 26px; }
.ask-side h2 { font: 700 21px/1.25 var(--display, "Outfit", sans-serif); color: #fff; margin: 0 0 10px; }
.ask-side p { margin: 0 0 14px; font-size: 15px; line-height: 1.55; }
.ask-side ul { margin: 0 0 18px; padding-left: 1.1em; font-size: 15px; }
.ask-side a:not(.btn) { color: var(--lime, #bdd73c); }
.ask-side .btn { width: 100%; justify-content: space-between; margin-bottom: 18px; }

/* ---------- the chat ---------- */
.ask {
  display: flex; flex-direction: column; min-height: 480px; overflow: hidden; background: var(--a-white); border-radius: 28px;
  box-shadow: var(--a-shadow); color: var(--a-ink); font-family: var(--a-font); -webkit-font-smoothing: antialiased;
}
.ask__log { flex: 1; padding: 24px 24px 8px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; max-height: 68vh; overscroll-behavior: contain; }
.ask__msg { max-width: 92%; font-size: 16px; line-height: 1.6; }
.ask__msg p { margin: 0 0 .7em; }
.ask__msg p:last-child, .ask__msg ul:last-child, .ask__msg ol:last-child { margin-bottom: 0; }
.ask__msg ul, .ask__msg ol { margin: 0 0 .7em; padding-left: 1.2em; }
.ask__msg li { margin: .2em 0; }
.ask__msg--user { align-self: flex-end; background: var(--a-green); color: #fff; padding: 12px 16px; border-radius: 18px 18px 4px 18px; white-space: pre-wrap; }
.ask__msg--bot { align-self: flex-start; background: var(--a-card); color: var(--a-ink); padding: 14px 18px; border-radius: 18px 18px 18px 4px; }
.ask__msg--bot a { color: var(--a-green-text); text-decoration: underline; text-underline-offset: 2px; }
.ask__msg--intro { background: var(--a-soft); padding: 16px 20px; border-radius: 18px; line-height: 1.7; }
.ask__msg--intro strong { color: var(--a-ink); }
.ask__cite {
  display: inline-block; min-width: 1.5em; margin-left: 2px; padding: 0 4px; border-radius: 6px; background: var(--a-white); color: var(--a-green-text);
  font: 600 11px/1.6 var(--a-mono); text-align: center; text-decoration: none !important; vertical-align: 2px;
}
.ask__cite:hover { background: var(--a-green); color: #fff; }
.ask__status { display: flex; align-items: center; gap: 10px; color: var(--a-muted); font-size: 14px; }
.ask__status::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--a-line); border-top-color: var(--a-green);
  animation: ask-spin .8s linear infinite; flex: none;
}
@keyframes ask-spin { to { transform: rotate(360deg); } }
.ask__sources { margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid var(--a-line); list-style: none; font-size: 13.5px; line-height: 1.45; }
.ask__sources li { display: flex; gap: 8px; margin: 4px 0; }
.ask__sources li span { flex: none; font: 600 11px/1.8 var(--a-mono); color: var(--a-muted); min-width: 1.6em; }
.ask__sources a { color: var(--a-ink); text-decoration: none; }
.ask__sources a:hover { color: var(--a-green-text); text-decoration: underline; }
.ask__note { margin-top: 10px; font-size: 13.5px; color: var(--a-green-text); font-weight: 600; }
.ask__msg--bot a.ask__book {
  display: inline-flex; align-items: center; min-height: 44px; margin-top: 12px; padding: 0 20px; border-radius: 999px; background: var(--a-green);
  color: #fff; font: 600 15px/1.2 var(--a-font); text-decoration: none; white-space: normal;
}
.ask__msg--bot a.ask__book:hover { background: var(--a-green-2); }
.ask__error { color: var(--a-error); }

.ask__chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 24px 18px; }
.ask__chip {
  min-height: 44px; padding: 9px 16px; border: 1px solid var(--a-chip); border-radius: 999px; background: var(--a-white); color: var(--a-ink);
  font: 400 15px/1.3 var(--a-font); text-align: left; cursor: pointer; transition: border-color .25s, color .25s;
}
.ask__chip:hover { border-color: var(--a-green); color: var(--a-green-text); }
.ask__form { display: flex; gap: 12px; align-items: flex-end; padding: 16px 20px 12px; border-top: 1px solid var(--a-line); background: var(--a-white); }
.ask__input {
  flex: 1; resize: none; min-height: 52px; max-height: 160px; padding: 14px 16px; border: 1px solid var(--a-line); border-radius: 14px;
  font: 400 16px/1.45 var(--a-font); color: var(--a-ink); background: var(--a-bg);
}
.ask__input::placeholder { color: var(--a-muted); }
.ask__input:focus { outline: 2px solid var(--a-green); outline-offset: 1px; background: var(--a-white); }
.ask__send {
  min-height: 52px; padding: 0 26px; border: 0; border-radius: 999px; background: var(--a-green); color: #fff; font: 600 16px/1 var(--a-font); cursor: pointer;
}
.ask__send:hover { background: var(--a-green-2); }
.ask__send:disabled { opacity: .55; cursor: wait; }
.ask__send:focus-visible, .ask__chip:focus-visible, .ask__reset:focus-visible { outline: 3px solid var(--a-leaf); outline-offset: 2px; }
.ask__ts { padding: 0 20px; }
.ask__ts:empty { display: none; }
.ask__foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 4px 20px 16px; font-size: 13px; line-height: 1.5; color: var(--a-muted); }
.ask__foot p { flex: 1 1 260px; margin: 0; max-width: 60ch; }
.ask__foot a { color: var(--a-muted); text-decoration: underline; }
.ask__reset { margin-left: auto; border: 0; background: none; color: var(--a-green-text); font: 600 14px/1.45 var(--a-font); cursor: pointer; padding: 0; white-space: nowrap; }
.ask__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- the panel on every page (assets/js/ask-launch.js) ---------- */
.askp {
  position: fixed; z-index: 54; display: flex; flex-direction: column; overflow: hidden; background: var(--a-white); border-radius: 28px;
  color: var(--a-ink); font-family: var(--a-font);
  box-shadow: 0 1px 0 rgb(255 255 255 / .9) inset, 0 30px 60px -20px rgb(20 35 28 / .35), 0 2px 6px rgb(20 35 28 / .08), 0 0 0 1px var(--a-line);
}
.askp[hidden] { display: none; }
/* Drop-down under the header, right edge lined up with it (ask-launch.js sets top, right and max-height exactly). */
.askp--drop {
  top: 90px; right: max(16px, calc((100% - 1240px) / 2)); width: min(640px, calc(100% - 32px)); height: 680px; max-height: calc(100vh - 110px);
  animation: askp-drop .35s cubic-bezier(.22, 1, .36, 1) both;
}
/* Corner chat above the bubble. */
.askp--corner { right: 24px; bottom: 100px; width: min(420px, calc(100% - 48px)); height: min(640px, calc(100vh - 124px)); animation: askp-up .35s cubic-bezier(.22, 1, .36, 1) both; }
.askp__head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 22px; border-bottom: 1px solid var(--a-line); }
.askp--drop .askp__head { display: none; }   /* the header button closes the drop-down */
.askp__title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.askp__title strong { font: 700 17px/1.2 var(--a-display); letter-spacing: -.01em; color: var(--a-ink); }
.askp__title span { font-size: 13px; line-height: 1.3; color: var(--a-muted); }
.askp__close { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--a-bg); color: var(--a-body); cursor: pointer; }
.askp__close:hover { background: var(--a-soft); color: var(--a-ink); }
.askp__close:focus-visible { outline: 3px solid var(--a-leaf); outline-offset: 2px; }
.askp__close svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.askp__body { flex: 1; min-height: 0; display: flex; }
.askp .ask { flex: 1; min-width: 0; min-height: 0; border-radius: 0; box-shadow: none; }
.askp .ask__log { max-height: none; min-height: 0; padding-top: 22px; }
.askp--corner .ask__msg { font-size: 15px; }
.askp--corner .ask__chip { font-size: 14px; }
.askp--corner .ask__chips { padding: 4px 18px 14px; }
.askp--corner .ask__log { padding: 18px 18px 8px; }
.askp--corner .ask__form { padding: 14px 16px 10px; }
.askp--corner .ask__foot { padding: 4px 16px 14px; font-size: 12.5px; }
.askp--corner .ask__send { padding: 0 20px; }
@keyframes askp-drop { from { opacity: 0; transform: translateY(-8px); } }
@keyframes askp-up { from { opacity: 0; transform: translateY(10px); } }

/* Phones: one full-screen sheet with a close button, whichever button opened it. */
@media (max-width: 640px) {
  .askp, .askp--drop, .askp--corner { top: 8px; right: 8px; bottom: 8px; left: 8px; width: auto; height: auto; max-height: none; border-radius: 22px; }
  .askp--drop .askp__head { display: flex; }
  .askp .ask__log { padding: 16px 16px 6px; }
  .askp .ask__chips { padding: 4px 16px 12px; }
  .askp .ask__chip { font-size: 14px; }
  .askp .ask__form { padding: 12px; }
  .askp .ask__send { padding: 0 18px; }
  .askp .ask__foot { padding: 2px 14px 12px; font-size: 12.5px; }
  html.ask-open, html.ask-open body { overflow: hidden; }
}
@media (max-width: 600px) {
  .ask__log { padding: 18px 16px 6px; max-height: 62vh; }
  .ask__chips { padding: 4px 16px 12px; }
  .ask__msg { max-width: 100%; }
  .ask__input::placeholder { font-size: 15px; }
  .ask__form { padding: 12px; }
  .ask__send { padding: 0 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .ask__status::before { animation: none; border-color: var(--a-green); }
  .askp--drop, .askp--corner { animation: none; }
}
@media print { .askp { display: none; } }
