/* Pixeldust chat: the widget's frame and the public link's page.
 *
 * The visitor chat design ("Final · desktop / phone"): one column on a phone
 * and in the widget (the base rules below); on a page 1024 px and wider,
 * "This conversation", the chat and "Sources for this answer" side by side.
 * The account's colour is the one accent (--pd-primary); text on it is
 * white or near-black (--pd-on-primary, set by widget.js).
 */

/* Geist, from this service's own origin (static/geist-OFL.txt). */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("geist-1.woff2") format("woff2");
}

:root {
  --pd-primary: #2f6b4f;
  --pd-on-primary: #ffffff;
  --pd-ground: #f6f7f6;
  --pd-panel: #ffffff;
  --pd-line: #e6e9e7;
  --pd-row-line: #e8ebe9;
  --pd-field-line: #dfe3e1;
  --pd-button-line: #dbe6e0;
  --pd-text: #17201b;
  --pd-text-2: #3d4741;
  --pd-body: #26302a;
  --pd-passage: #2b352f;
  --pd-muted: #646f69;
  --pd-icon: #5d6b64;
  --pd-quiet: #f1f3f2;
  --pd-handle: #d7dcd9;
  --pd-typing-line: #eceeed;
  --pd-dot-1: #a7b0ab;
  --pd-dot-2: #c3cac6;
  --pd-dot-3: #dde1df;
  --pd-danger: #b42318;
  --pd-scrim: rgba(14, 19, 17, 0.36);
  /* The account's colour as text and as a focus ring on white: widget.js
   * darkens a light colour until it reads (--pd-primary-ink, 4.5:1;
   * --pd-focus-ink, 3:1). */
  --pd-primary-text: var(--pd-primary-ink, color-mix(in srgb, var(--pd-primary) 85%, var(--pd-text)));
  --pd-focus: var(--pd-focus-ink, var(--pd-primary));
  --pd-card-line: color-mix(in srgb, var(--pd-primary) 34%, var(--pd-panel));
  --pd-foot-line: color-mix(in srgb, var(--pd-primary) 16%, var(--pd-panel));
  --pd-foot-ground: color-mix(in srgb, var(--pd-primary) 4%, var(--pd-panel));
  --pd-card-shadow: 0 1px 2px rgba(23, 32, 27, 0.04), 0 10px 28px -20px rgba(23, 32, 27, 0.22);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --pd-ground: #0f1412;
    --pd-panel: #171d1a;
    --pd-line: #28312c;
    --pd-row-line: #2a332e;
    --pd-field-line: #333d37;
    --pd-button-line: #34403a;
    --pd-text: #e8ede9;
    --pd-text-2: #c3ccc7;
    --pd-body: #dfe6e2;
    --pd-passage: #d3dbd6;
    --pd-muted: #9aa6a0;
    --pd-icon: #a9b4ae;
    --pd-quiet: #222a26;
    --pd-handle: #3a4540;
    --pd-typing-line: #2a332e;
    --pd-dot-1: #7d8882;
    --pd-dot-2: #5d6862;
    --pd-dot-3: #45504a;
    --pd-danger: #f97066;
    --pd-scrim: rgba(0, 0, 0, 0.55);
    --pd-primary-text: color-mix(in srgb, var(--pd-primary) 60%, #ffffff);
    --pd-focus: color-mix(in srgb, var(--pd-primary) 60%, #ffffff);
    --pd-card-line: color-mix(in srgb, var(--pd-primary) 45%, var(--pd-panel));
    --pd-foot-line: color-mix(in srgb, var(--pd-primary) 25%, var(--pd-panel));
    --pd-foot-ground: color-mix(in srgb, var(--pd-primary) 8%, var(--pd-panel));
    --pd-card-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  /* Normal line height, as the design; text blocks set their own. */
  font: 15px/normal Geist, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--pd-text);
}

body.pd-frame { background: transparent; overflow: hidden; }
body.pd-page { background: var(--pd-ground); }

#pd-app { height: 100%; }

[hidden] { display: none !important; }

button { font: inherit; cursor: pointer; color: inherit; }
button:disabled { cursor: default; opacity: 0.5; }
:focus-visible { outline: 2px solid var(--pd-focus); outline-offset: 2px; }

/* ------------------------------------------------------------- launcher */
.pd-launcher {
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: var(--pd-primary);
  color: var(--pd-on-primary);
  /* Small enough to stay inside the closed frame (88 px). */
  box-shadow: 0 6px 16px -4px color-mix(in srgb, var(--pd-primary) 55%, transparent);
  display: grid;
  place-items: center;
}
.pd-left .pd-launcher { right: auto; left: 14px; }

.pd-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--pd-danger);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
}

/* ---------------------------------------------------- frame and page shell */
.pd-panel, .pd-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--pd-ground);
}
.pd-panel {
  border-radius: 20px;
  border: 1px solid var(--pd-line);
  box-shadow: 0 16px 44px -12px rgba(14, 19, 17, 0.28);
}

.pd-header {
  flex: none;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px 0 16px;
  background: var(--pd-panel);
  border-bottom: 1px solid var(--pd-line);
}
.pd-mark {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--pd-primary);
  color: var(--pd-on-primary);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
}
.pd-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pd-icon {
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--pd-icon);
  display: grid;
  place-items: center;
}
.pd-header .pd-icon { color: var(--pd-text-2); }
.pd-header .pd-icon:hover { background: var(--pd-ground); }

.pd-call {
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--pd-text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.pd-call:hover { background: var(--pd-ground); }
.pd-call-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.pd-call.pd-oncall { background: var(--pd-danger); color: #fff; }

.pd-body { flex: 1; min-height: 0; display: flex; }
.pd-rail, .pd-aside { display: none; }

/* ------------------------------------------------------------------ chat */
.pd-chat {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.pd-callbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 16px;
  background: color-mix(in srgb, var(--pd-primary) 6%, var(--pd-panel));
  border-bottom: 1px solid var(--pd-line);
  font-size: 13px;
}
.pd-hangup {
  min-height: 32px;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--pd-danger);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
}

.pd-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pd-welcome {
  margin: 0;
  max-width: 560px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--pd-text-2);
}

/* The first screen: the agent, its welcome and its opening question. */
.pd-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 18px 4px 6px;
  min-width: 0;
}
.pd-hero-avatar {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--pd-primary);
  color: var(--pd-on-primary);
  font-size: 24px;
  font-weight: 600;
}
.pd-hero-avatar.pd-hero-orb { background: none; border-radius: 0; }
.pd-hero-title {
  margin: 4px 0 0;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--pd-text);
  text-wrap: balance;
}
.pd-hero .pd-welcome { margin: 0 auto; }
.pd-hero .pd-opening { width: 100%; max-width: 560px; align-items: stretch; margin-top: 8px; }
.pd-hero .pd-opening-prompt { text-align: center; }

/* The opening question's choices as cards, each with an icon. */
.pd-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.pd-choice.pd-section {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--pd-line);
  border-radius: 14px;
  background: var(--pd-panel);
  color: var(--pd-text);
  text-align: left;
  transition: border-color 120ms ease, background-color 120ms ease, transform 120ms ease;
}
.pd-choice.pd-section:hover:not(:disabled) { border-color: var(--pd-primary); background: var(--pd-panel); transform: translateY(-1px); }
.pd-choice.pd-section.pd-chosen { border-color: var(--pd-primary); background: var(--pd-quiet); color: var(--pd-text); }
.pd-section-icon {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--pd-quiet);
  color: var(--pd-primary-text);
}
.pd-section-title { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; line-height: 1.35; }
.pd-section-go { flex: none; color: var(--pd-muted); }
@media (prefers-reduced-motion: reduce) {
  .pd-choice.pd-section { transition: none; }
  .pd-choice.pd-section:hover:not(:disabled) { transform: none; }
}

/* The agent's opening question and its buttons, under the welcome text. */
.pd-opening { display: flex; flex-direction: column; min-width: 0; }
.pd-opening-prompt {
  margin: 0;
  max-width: 560px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--pd-text);
}
.pd-opening .pd-choice.pd-chosen { opacity: 1; }

.pd-row { display: flex; flex-direction: column; min-width: 0; }
.pd-row:focus { outline: none; }
.pd-visitor { align-items: flex-end; }
.pd-agent { align-items: stretch; }

.pd-bubble {
  max-width: min(280px, 82%);
  padding: 10px 14px;
  border-radius: 16px 16px 6px 16px;
  background: var(--pd-primary);
  color: var(--pd-on-primary);
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.pd-bubble a { color: inherit; }
.pd-failed .pd-bubble { outline: 2px solid var(--pd-danger); outline-offset: 2px; }
.pd-voice-label { display: block; font-size: 12px; opacity: 0.9; margin-bottom: 4px; }
.pd-bubble audio { display: block; max-width: 240px; height: 36px; }

.pd-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: min(600px, 100%);
  border-radius: 16px;
  background: var(--pd-panel);
  border: 1px solid var(--pd-card-line);
  box-shadow: var(--pd-card-shadow);
  overflow: hidden;
}
.pd-card-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--pd-body);
  overflow-wrap: anywhere;
}
.pd-text { display: flex; flex-direction: column; gap: 10px; }
.pd-text p { margin: 0; }
.pd-text ul, .pd-text ol {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.pd-text code {
  font: 13px ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--pd-quiet);
  padding: 1px 4px;
  border-radius: 4px;
}
.pd-card a, .pd-link, .pd-file { color: var(--pd-primary-text); }
.pd-link, .pd-file { font-weight: 500; }
.pd-caption { color: var(--pd-muted); font-size: 13px; }
.pd-card audio { display: block; max-width: 100%; height: 36px; }

.pd-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 8px 8px 16px;
  border-top: 1px solid var(--pd-foot-line);
  background: var(--pd-foot-ground);
}
.pd-card-from {
  min-width: 0;
  font-size: 12px;
  color: var(--pd-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pd-sources-button {
  flex: none;
  height: 36px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--pd-button-line);
  background: var(--pd-panel);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--pd-primary-text);
}
.pd-sources-button:hover { border-color: var(--pd-card-line); }

/* Charts under an answer (widget.js draws them). Six series colours in a
   fixed order, checked for colour-blind separation on each surface; text is
   never set in a series colour. */
:root {
  --pd-series-1: #2a78d6;
  --pd-series-2: #eb6834;
  --pd-series-3: #1baf7a;
  --pd-series-4: #eda100;
  --pd-series-5: #e87ba4;
  --pd-series-6: #008300;
  --pd-on-series-4: #0b0b0b;
}
@media (prefers-color-scheme: dark) {
  :root {
    --pd-series-1: #3987e5;
    --pd-series-2: #d95926;
    --pd-series-3: #199e70;
    --pd-series-4: #c98500;
    --pd-series-5: #d55181;
    --pd-series-6: #0ca30c;
    --pd-on-series-4: #ffffff;
  }
}
.pd-s1 { --pd-mark: var(--pd-series-1); --pd-on-mark: #ffffff; }
.pd-s2 { --pd-mark: var(--pd-series-2); --pd-on-mark: #ffffff; }
.pd-s3 { --pd-mark: var(--pd-series-3); --pd-on-mark: #ffffff; }
.pd-s4 { --pd-mark: var(--pd-series-4); --pd-on-mark: var(--pd-on-series-4); }
.pd-s5 { --pd-mark: var(--pd-series-5); --pd-on-mark: #ffffff; }
.pd-s6 { --pd-mark: var(--pd-series-6); --pd-on-mark: #ffffff; }

.pd-charts {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--pd-foot-line);
}
.pd-chart { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; margin: 0; }
.pd-chart-head { display: flex; flex-direction: column; gap: 2px; }
.pd-chart-title { font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--pd-text); overflow-wrap: anywhere; }
.pd-chart-unit { font-size: 12px; color: var(--pd-muted); }
.pd-chart-note { margin: 0; font-size: 12px; line-height: 1.45; color: var(--pd-muted); overflow-wrap: anywhere; }
.pd-chart-view { min-width: 0; }
.pd-chart-toggle {
  align-self: flex-start;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--pd-button-line);
  background: var(--pd-panel);
  font-size: 12px;
  font-weight: 500;
  color: var(--pd-text-2);
}
.pd-chart-toggle:hover { border-color: var(--pd-card-line); }

.pd-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  line-height: 1.4;
  color: var(--pd-text-2);
}
.pd-legend-item { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pd-legend-name { min-width: 0; overflow-wrap: anywhere; }
.pd-key { flex: none; background: var(--pd-mark); }
.pd-key-bar { width: 10px; height: 10px; border-radius: 2px; }
.pd-key-line { width: 14px; height: 2px; border-radius: 1px; }
.pd-legend-rows { flex-direction: column; flex-wrap: nowrap; gap: 6px; }
.pd-legend-rows .pd-legend-name { flex: 1; }
.pd-legend-value { flex: none; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--pd-text); }

/* Bars: thin, from one baseline, square there and rounded at the value. */
.pd-bars { display: flex; flex-direction: column; gap: 10px; --pd-value-room: 60px; }
.pd-bar-group { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pd-bar-label { margin-bottom: 2px; font-size: 12.5px; line-height: 1.35; color: var(--pd-text-2); overflow-wrap: anywhere; }
.pd-bar-line { display: flex; align-items: center; min-width: 0; padding-right: var(--pd-value-room); }
.pd-bar-track { display: contents; }
.pd-bar { flex: none; height: 16px; border-radius: 0 4px 4px 0; background: var(--pd-mark); }
.pd-bars-grouped .pd-bar { height: 12px; }
.pd-bar-line:hover .pd-bar { filter: brightness(1.1); }
.pd-bar-value {
  flex: none;
  margin-left: 6px;
  font-size: 12px;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--pd-text);
}
.pd-bars-grouped .pd-bar-value { font-size: 11.5px; line-height: 12px; }
.pd-bars-signed .pd-bar-line { padding-right: 0; }
.pd-bars-signed .pd-bar-track { display: block; position: relative; flex: 1; min-width: 0; height: 16px; }
.pd-bars-signed.pd-bars-grouped .pd-bar-track { height: 12px; }
.pd-bars-signed .pd-bar { position: absolute; top: 0; }
.pd-bars-signed .pd-bar-down { border-radius: 4px 0 0 4px; }
.pd-bar-zero { position: absolute; top: -2px; bottom: -2px; width: 1px; background: var(--pd-handle); }
.pd-bars-signed .pd-bar-value { width: var(--pd-value-room); margin-left: 8px; text-align: right; }

/* One whole in parts: blocks 28 px tall, 2 px of the surface between them. */
.pd-share { display: flex; flex-direction: column; gap: 12px; }
.pd-share-bar { display: flex; gap: 2px; height: 28px; }
.pd-share-part { flex: 1 1 0; min-width: 0; display: flex; align-items: center; border-radius: 4px; background: var(--pd-mark); }
.pd-share-part:hover { filter: brightness(1.1); }
.pd-share-label {
  flex: none;
  padding-left: 6px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--pd-on-mark);
}

.pd-line { min-height: 210px; }
.pd-line-svg { display: block; overflow: visible; touch-action: pan-y; }
.pd-line-svg:focus { outline: none; }
.pd-line-svg:focus-visible { outline: 2px solid var(--pd-focus); outline-offset: 2px; border-radius: 4px; }
.pd-grid { stroke: var(--pd-line); stroke-width: 1; }
.pd-axis { stroke: var(--pd-handle); stroke-width: 1; }
.pd-cross { stroke: var(--pd-icon); stroke-width: 1; }
.pd-tick { fill: var(--pd-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.pd-line-path { stroke: var(--pd-mark); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.pd-dot { fill: var(--pd-mark); stroke: var(--pd-panel); stroke-width: 2; }

.pd-tip {
  position: absolute;
  z-index: 2;
  max-width: 230px;
  padding: 7px 10px;
  border: 1px solid var(--pd-line);
  border-radius: 8px;
  background: var(--pd-panel);
  box-shadow: 0 8px 22px -10px rgba(23, 32, 27, 0.4);
  font-size: 12px;
  line-height: 1.45;
  color: var(--pd-text);
  pointer-events: none;
}
.pd-tip-head { color: var(--pd-muted); overflow-wrap: anywhere; }
.pd-tip-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pd-tip-key { flex: none; width: 10px; height: 2px; border-radius: 1px; background: var(--pd-mark); }
.pd-tip-row strong { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pd-tip-name { min-width: 0; color: var(--pd-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pd-table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--pd-line); border-radius: 8px; }
.pd-table-wrap:focus { outline: none; }
.pd-table-wrap:focus-visible { outline: 2px solid var(--pd-focus); outline-offset: 2px; }
.pd-table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.4; }
.pd-table th, .pd-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--pd-row-line);
  font-weight: 400;
  text-align: left;
  vertical-align: top;
  color: var(--pd-body);
}
.pd-table thead th { font-size: 12px; font-weight: 600; color: var(--pd-text-2); background: var(--pd-quiet); }
.pd-table tbody tr:last-child th, .pd-table tbody tr:last-child td { border-bottom: 0; }
.pd-table .pd-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (forced-colors: active) {
  .pd-bar, .pd-share-part, .pd-key, .pd-tip-key { forced-color-adjust: none; }
}

.pd-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pd-list { flex-direction: column; align-items: flex-start; }
.pd-choice {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--pd-primary);
  border-radius: 999px;
  background: var(--pd-panel);
  color: var(--pd-primary-text);
  font-size: 14px;
  text-align: left;
}
.pd-choice:hover:not(:disabled) { background: var(--pd-foot-ground); }
.pd-choice.pd-chosen { background: var(--pd-primary); color: var(--pd-on-primary); opacity: 1; }
.pd-choice:disabled:not(.pd-chosen) { opacity: 0.45; }

.pd-typing { align-items: flex-start; }
.pd-status {
  font-size: 12.5px;
  line-height: 1.3;
  color: var(--pd-muted);
  overflow-wrap: anywhere;
}
/* The thinking orb (static/orbs.js) and what the agent is doing beside it. */
.pd-dots.pd-thinking { align-items: center; gap: 0; padding: 9px 12px; max-width: 100%; }
.pd-dots.pd-thinking.pd-has-status { gap: 9px; padding-right: 14px; }
.pd-orb { display: block; flex: none; }

/* The answer while it is written: new parts fade in, a soft cursor follows
   the words; when the whole answer comes, what comes with it settles in. */
.pd-arrive { animation: pd-arrive 220ms ease-out both; }
.pd-caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 3px;
  vertical-align: -0.17em;
  border-radius: 1px;
  background: var(--pd-primary-text);
  opacity: 0.7;
  animation: pd-caret 1s ease-in-out infinite;
}
.pd-settled .pd-card-foot,
.pd-settled .pd-charts,
.pd-settled .pd-choices { animation: pd-arrive 260ms ease-out both; }
@keyframes pd-arrive { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@keyframes pd-caret { 0%, 100% { opacity: 0.75; } 50% { opacity: 0.15; } }
@media (prefers-reduced-motion: reduce) {
  .pd-arrive, .pd-settled .pd-card-foot, .pd-settled .pd-charts, .pd-settled .pd-choices { animation: none; }
  .pd-caret { animation: none; }
}
.pd-dots {
  display: flex;
  gap: 5px;
  padding: 13px 16px;
  border-radius: 16px;
  background: var(--pd-panel);
  border: 1px solid var(--pd-typing-line);
}
.pd-dot {
  width: 6px;
  height: 6px;
  border-radius: 9px;
  background: var(--pd-dot-1);
  animation: pd-blink 1.2s infinite ease-in-out;
}
.pd-dot:nth-child(2) { background: var(--pd-dot-2); animation-delay: 0.2s; }
.pd-dot:nth-child(3) { background: var(--pd-dot-3); animation-delay: 0.4s; }
@keyframes pd-blink { 0%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .pd-dot { animation: none; } }

.pd-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--pd-muted);
}
.pd-divider::before, .pd-divider::after { content: ""; flex: 1; height: 1px; background: var(--pd-line); }

.pd-notice {
  flex: none;
  align-self: center;
  max-width: calc(100% - 32px);
  margin: 0 0 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--pd-quiet);
  color: var(--pd-text-2);
  font-size: 13px;
  text-align: center;
}
.pd-check { display: flex; justify-content: center; padding: 8px; }
.pd-unavailable { margin: 24px; text-align: center; color: var(--pd-muted); }

/* -------------------------------------------------------------- composer */
.pd-composer {
  flex: none;
  padding: 10px 12px calc(14px + env(safe-area-inset-bottom));
  background: var(--pd-panel);
  border-top: 1px solid var(--pd-line);
}
.pd-compose-box {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 5px 5px 5px 14px;
  border-radius: 16px;
  border: 1px solid var(--pd-field-line);
  background: var(--pd-panel);
}
.pd-compose-box:focus-within {
  border-color: var(--pd-focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pd-primary) 18%, transparent);
}
.pd-input {
  flex: 1;
  min-width: 0;
  max-height: 144px;
  margin: 0;
  padding: 11px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--pd-text);
  font: 400 16px/22px Geist, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  resize: none;
}
.pd-input::placeholder { color: var(--pd-muted); }
.pd-input:focus-visible { outline: none; }
.pd-page .pd-composer { padding-bottom: max(26px, env(safe-area-inset-bottom)); }
.pd-send { background: var(--pd-primary); color: var(--pd-on-primary); }
.pd-mic.pd-recording { background: var(--pd-danger); color: #fff; }

/* --------------------------------------- sources (panel and sheet) and list */
.pd-sources-heading { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pd-sources-title { margin: 0; font-size: 16px; font-weight: 600; }
.pd-sources-sub { margin: 0; font-size: 13px; color: var(--pd-muted); }
.pd-sheet-head, .pd-aside-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pd-dialog-close { background: var(--pd-quiet); color: var(--pd-text-2); }

.pd-groups { display: flex; flex-direction: column; gap: 14px; }
.pd-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: 14px;
  background: var(--pd-ground);
}
.pd-group-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}
.pd-group-title svg { flex: none; color: var(--pd-muted); }
/* The sheet's rows step apart by the group's 8 px gap; the panel's sit tight. */
.pd-passages { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.pd-passage {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--pd-row-line);
  font-size: 14px;
  color: var(--pd-text);
}
.pd-passage:last-child { border-bottom: 0; }
.pd-passage-name { min-width: 0; overflow-wrap: anywhere; }
.pd-passage-page { flex: none; font-variant-numeric: tabular-nums; color: var(--pd-muted); }
.pd-passage-open { flex: none; font-weight: 500; color: var(--pd-primary-text); }

.pd-backdrop {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: var(--pd-scrim);
}
.pd-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 21;
  max-height: 88%;
  overflow-y: auto;
  padding: 10px 20px calc(32px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: var(--pd-panel);
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 -12px 40px rgba(14, 19, 17, 0.18);
}
.pd-handle {
  flex: none;
  align-self: center;
  width: 40px;
  height: 5px;
  border-radius: 9px;
  background: var(--pd-handle);
}

.pd-drawer {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 21;
  width: min(316px, 86%);
  display: flex;
  flex-direction: column;
  background: var(--pd-panel);
  box-shadow: 16px 0 40px -12px rgba(14, 19, 17, 0.25);
}
.pd-drawer-head {
  flex: none;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px 0 16px;
  border-bottom: 1px solid var(--pd-line);
}
.pd-drawer .pd-dialog-close { background: transparent; }
.pd-drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pd-list-title { margin: 0; padding: 0 10px 10px; font-size: 13px; font-weight: 600; }
.pd-questions { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.pd-question {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--pd-text-2);
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
  overflow-wrap: anywhere;
}
.pd-question:hover { background: var(--pd-ground); }
.pd-question[aria-current="true"] { background: var(--pd-ground); color: var(--pd-text); font-weight: 500; }

/* ------------------------------------------------- a page 1024 px and wider */
@media (min-width: 1024px) {
  .pd-page .pd-header { height: 60px; gap: 12px; padding: 0 24px; }
  .pd-page .pd-header .pd-mark { width: 30px; height: 30px; font-size: 14px; }
  .pd-page .pd-header .pd-title { font-size: 15px; }
  .pd-page .pd-list-button { display: none; }
  .pd-page .pd-call {
    width: auto;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--pd-field-line);
    border-radius: 10px;
    background: var(--pd-panel);
    font-size: 14px;
    font-weight: 500;
  }
  .pd-page .pd-call-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .pd-page .pd-call.pd-oncall { border-color: var(--pd-danger); }

  .pd-page .pd-body { gap: 16px; padding: 16px; }

  .pd-page .pd-rail {
    width: 232px;
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 10px;
    background: var(--pd-panel);
    border: 1px solid var(--pd-line);
    border-radius: 20px;
    overflow-y: auto;
  }
  .pd-page .pd-rail .pd-question { min-height: 0; padding: 10px; font-size: 13px; }

  .pd-page .pd-chat {
    background: var(--pd-panel);
    border: 1px solid var(--pd-line);
    border-radius: 20px;
    overflow: hidden;
  }
  .pd-page .pd-log { padding: 28px 36px 8px; gap: 22px; }
  .pd-page .pd-bubble { max-width: min(420px, 80%); padding: 10px 15px; }
  .pd-page .pd-agent { align-items: flex-start; }
  .pd-page .pd-card-body { padding: 18px 20px; line-height: 1.65; }
  .pd-page .pd-text ul, .pd-page .pd-text ol { padding-left: 20px; gap: 6px; }
  .pd-page .pd-card-foot { padding: 10px 12px 10px 20px; }
  .pd-page .pd-sources-button { height: 30px; }
  .pd-page .pd-choice { min-height: 36px; padding: 7px 14px; }
  .pd-page .pd-dots { padding: 14px 20px; }

  .pd-page .pd-composer { padding: 16px 24px 20px; background: transparent; border-top: 0; }
  .pd-page .pd-compose-box { gap: 8px; padding: 6px 6px 6px 16px; }
  .pd-page .pd-input { font-size: 15px; padding: 9px 0; }
  .pd-page .pd-compose-box .pd-icon { width: 40px; height: 40px; border-radius: 11px; }

  .pd-page .pd-aside {
    width: 340px;
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    background: var(--pd-panel);
    border: 1px solid var(--pd-line);
    border-radius: 20px;
    overflow-y: auto;
  }
  .pd-page .pd-aside[hidden] { display: none; }
  .pd-page .pd-aside-head { align-items: flex-start; }
  .pd-page .pd-aside .pd-sources-heading { gap: 4px; }
  .pd-page .pd-aside .pd-sources-title { font-size: 15px; }
  .pd-page .pd-aside .pd-dialog-close { width: 32px; height: 32px; border-radius: 9px; background: transparent; color: var(--pd-icon); }
  .pd-page .pd-aside .pd-group { gap: 10px; }
  .pd-page .pd-aside .pd-passages { gap: 0; }
  .pd-page .pd-aside .pd-passage { gap: 12px; padding: 7px 0; font-size: 13px; color: var(--pd-passage); }
}

/* The opening cards keep their size on the link's page too. */
.pd-page .pd-choice.pd-section { min-height: 56px; padding: 10px 12px; }
