/* An isolated, readable chat surface in both site themes. */
.earth-helper-launcher,.earth-helper-dialog{--eh-ink:#f1f4f0;--eh-muted:#b3bcb4;--eh-surface:#191f1b;--eh-soft:#252e27;--eh-hover:#303b32;--eh-line:#414e43;--eh-accent:#c2e3b6;--eh-on-accent:#18371d;--eh-focus:#d3efca;font-family:"DM Sans",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--eh-ink);font-size:14px;line-height:1.55;box-sizing:border-box}
html[data-theme="light"] :is(.earth-helper-launcher,.earth-helper-dialog){--eh-ink:#19261f;--eh-muted:#56655b;--eh-surface:#fff;--eh-soft:#f1f4f0;--eh-hover:#e7eee6;--eh-line:#d7dfd8;--eh-accent:#245836;--eh-on-accent:#fff;--eh-focus:#32734a}
.earth-helper-dialog *,.earth-helper-launcher *{box-sizing:border-box}
.earth-helper-launcher[hidden],.earth-helper-dialog [hidden]{display:none!important}
.earth-helper-launcher{position:fixed;right:max(24px,env(safe-area-inset-right));bottom:calc(22px + env(safe-area-inset-bottom));z-index:900;display:flex;align-items:center;gap:10px;min-height:52px;padding:9px 17px 9px 11px;border:1px solid #58745e;border-radius:50px;background:#244b32;color:#fff;box-shadow:0 8px 28px #0b251d30;font-weight:650;letter-spacing:-.2px;cursor:pointer;transition:transform .18s,box-shadow .18s}
.earth-helper-launcher:hover{transform:translateY(-2px);box-shadow:0 12px 32px #0b251d45}
.earth-helper-launcher-icon{width:31px;height:31px;display:grid;place-items:center;color:#d3edc7}.earth-helper-launcher svg{width:24px;height:24px}
.earth-helper-dialog{position:fixed;inset:auto max(22px,env(safe-area-inset-right)) calc(22px + env(safe-area-inset-bottom)) auto;margin:0;width:min(480px,calc(100% - 36px));height:min(760px,calc(100dvh - 44px));max-width:none;max-height:none;padding:0;border:1px solid var(--eh-line);border-radius:22px;background:var(--eh-surface);box-shadow:0 24px 90px #07190e55;overflow:hidden;overscroll-behavior:contain;text-align:left;color-scheme:dark}
html[data-theme="light"] .earth-helper-dialog{color-scheme:light;box-shadow:0 24px 90px #123b252b}
.earth-helper-dialog::backdrop{background:#05160f42;backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px)}.earth-helper-dialog[open]{animation:earth-helper-arrive .2s ease-out}
#earth-assistant-dialog :is(button,textarea,summary){font:inherit;letter-spacing:normal}#earth-assistant-dialog button{cursor:pointer}#earth-assistant-dialog button:disabled{cursor:default;opacity:.55}
#earth-assistant-dialog :is(button,a,textarea,summary,input,[tabindex]):focus-visible,.earth-helper-launcher:focus-visible{outline:3px solid var(--eh-focus);outline-offset:3px}
#earth-assistant-dialog :is(p,h2,h3,small,strong,label){color:var(--eh-ink)}
.earth-helper-shell{height:100%;display:flex;flex-direction:column;background:var(--eh-surface)}
.earth-helper-header{position:relative;display:flex;align-items:center;gap:10px;padding:18px 18px 15px;border-bottom:1px solid var(--eh-line);flex:none;z-index:2}.earth-helper-heading{min-width:0;flex:1}
.earth-helper-picker{position:relative;width:fit-content;max-width:100%;min-width:130px}
#earth-assistant-title{display:inline-block;white-space:nowrap;flex:none}
.earth-helper-picker>summary{display:flex;align-items:center;gap:8px;width:fit-content;max-width:100%;padding:3px 6px;margin-left:-6px;border-radius:7px;list-style:none;cursor:pointer;color:var(--eh-ink);font-weight:650!important;font-size:17px!important;letter-spacing:-.5px!important}
.earth-helper-picker>summary::-webkit-details-marker{display:none}.earth-helper-picker>summary:hover{background:var(--eh-soft)}
.earth-helper-picker>summary>svg{width:15px;height:15px;fill:none;stroke:var(--eh-muted);stroke-width:1.7;transition:transform .18s}.earth-helper-picker[open]>summary>svg{transform:rotate(180deg)}
.earth-helper-picker-menu{position:absolute;left:-7px;top:calc(100% + 12px);width:min(315px,calc(100vw - 56px));padding:7px;border:1px solid var(--eh-line);border-radius:15px;background:var(--eh-surface);box-shadow:0 15px 45px #07190e36;z-index:4}
.earth-helper-picker-menu button{display:flex;align-items:center;gap:12px;width:100%;padding:13px 11px;border:0;border-radius:9px;background:transparent;text-align:left;color:var(--eh-ink)}
.earth-helper-picker-menu button:hover,.earth-helper-picker-menu button[aria-pressed="true"]{background:var(--eh-soft)}.earth-helper-picker-menu button>span:first-child{display:grid;place-items:center;width:27px;flex:none;color:var(--eh-accent)}.earth-helper-picker-menu svg{width:23px;height:23px}
#earth-assistant-dialog .earth-helper-picker-menu strong{display:block;font-size:13px;font-weight:650;color:var(--eh-ink)}#earth-assistant-dialog .earth-helper-picker-menu small{display:block;margin-top:2px;font-size:11px;line-height:1.5;color:var(--eh-muted)}
.earth-helper-picker-menu i{margin-left:auto;font-style:normal;color:var(--eh-accent);visibility:hidden}.earth-helper-picker-menu [aria-pressed="true"] i{visibility:visible}
#earth-assistant-dialog .earth-helper-mode{margin:2px 0 0;font-size:11px;line-height:1.4;color:var(--eh-muted)}
.earth-helper-clear{background:none;border:0;color:var(--eh-muted);padding:9px 6px;font-size:11px!important;min-height:38px;white-space:nowrap;border-radius:8px}.earth-helper-clear:hover{background:var(--eh-soft)}
.earth-helper-icon-button{display:grid;place-items:center;width:34px;height:36px;flex:none;padding:8px;background:transparent;color:var(--eh-muted);border:0;border-radius:9px}.earth-helper-icon-button:hover{background:var(--eh-soft);color:var(--eh-ink)}.earth-helper-icon-button svg{height:18px;width:18px}
.earth-helper-log{min-height:110px;flex:1;overflow-y:auto;padding:23px 22px 12px;scrollbar-width:thin;scrollbar-color:var(--eh-line) transparent;overscroll-behavior:contain;scroll-padding:20px}.earth-helper-intro{padding:18px 0 12px}
#earth-assistant-dialog .earth-helper-eyebrow{margin:0 0 17px;color:var(--eh-muted);font-size:9px;font-weight:650;letter-spacing:.12em}#earth-assistant-dialog .earth-helper-intro h3{white-space:pre-line;margin:0 0 16px;color:var(--eh-ink);font-size:35px;font-weight:550;line-height:1.12;letter-spacing:-1.5px;font-family:inherit}#earth-assistant-dialog .earth-helper-intro-copy{margin:0;max-width:345px;font-size:13px;line-height:1.7;color:var(--eh-muted)}
.earth-helper-prompts{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin:24px 0 0}.earth-helper-prompt{display:block;width:100%;min-height:54px;padding:12px;text-align:left;font-size:12px!important;line-height:1.5;color:var(--eh-ink);border:1px solid var(--eh-line);border-radius:12px;background:transparent;transition:background .15s,border-color .15s}.earth-helper-prompt:hover{background:var(--eh-soft);border-color:var(--eh-accent)}
.earth-helper-followups{display:flex;flex-wrap:wrap;margin:15px 0 0;gap:7px}.earth-helper-followups .earth-helper-prompt{width:auto;min-height:36px;font-size:11px!important;border-radius:20px;padding:7px 10px}
.earth-helper-message{margin:0 0 24px;min-width:0}#earth-assistant-dialog .earth-helper-message-label{font-size:10px;font-weight:650;letter-spacing:.015em;color:var(--eh-muted);margin:0 0 8px}#earth-assistant-dialog .earth-helper-message-text{font-size:14px;line-height:1.85;white-space:pre-wrap;overflow-wrap:anywhere;margin:0;color:var(--eh-ink)}
.earth-helper-message-user{width:fit-content;max-width:89%;margin-left:auto;padding:12px 15px;border-radius:17px;background:var(--eh-soft)}#earth-assistant-dialog .earth-helper-message-user .earth-helper-message-label{margin-bottom:3px}#earth-assistant-dialog .earth-helper-message-note{font-size:10px;color:var(--eh-muted);display:block;line-height:1.55;margin-top:10px}
.earth-helper-extract{margin:14px 0 0;padding:11px 13px;border-left:2px solid var(--eh-accent);border-radius:0 8px 8px 0;background:var(--eh-soft)}#earth-assistant-dialog .earth-helper-extract small{display:block;font-size:10px;font-weight:650;line-height:1.6;color:var(--eh-muted);margin-bottom:5px}#earth-assistant-dialog .earth-helper-extract p{white-space:pre-wrap;overflow-wrap:anywhere;margin:0;font-size:13px;line-height:1.8;color:var(--eh-ink)}
.earth-helper-sources{display:flex;gap:7px;flex-wrap:wrap;margin-top:13px}.earth-helper-source{border:1px solid var(--eh-line);border-radius:8px;padding:8px 10px;display:inline-block;max-width:100%;overflow-wrap:anywhere;font-size:11px;line-height:1.4;color:var(--eh-accent);text-decoration:none;min-height:34px}.earth-helper-source:hover{background:var(--eh-soft);text-decoration:underline;border-color:var(--eh-accent)}
.earth-helper-working{display:flex;align-items:center;gap:10px;color:var(--eh-muted);font-size:12px;min-height:35px}.earth-helper-working>span:first-child{display:flex;align-items:center;gap:4px}.earth-helper-working i{display:block;width:5px;height:5px;border-radius:50%;background:var(--eh-accent);animation:earth-helper-breathe 1.2s infinite ease-in-out}.earth-helper-working i:nth-child(2){animation-delay:.15s}.earth-helper-working i:nth-child(3){animation-delay:.3s}
.earth-helper-options{flex:none;max-height:38%;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}.earth-helper-local{margin:0 21px 11px;color:var(--eh-muted);font-size:11px}.earth-helper-local>summary{cursor:pointer;padding:4px 0;color:var(--eh-muted);width:fit-content}.earth-helper-model{padding:10px 0 3px}
#earth-assistant-dialog .earth-helper-model-heading strong{font-size:12px;font-weight:600;color:var(--eh-ink)}#earth-assistant-dialog .earth-helper-model-description{margin:5px 0 0;color:var(--eh-muted);font-size:11px;line-height:1.55}.earth-helper-model-actions,.earth-helper-cloud-actions{display:flex;gap:9px;flex-wrap:wrap;align-items:center}
.earth-helper-model-button{margin-top:9px;min-height:36px;border:0;border-radius:9px;padding:8px 12px;background:var(--eh-accent);color:var(--eh-on-accent);font-size:11px!important;font-weight:600!important;line-height:1.4}.earth-helper-model-button.is-subtle{margin-top:5px;padding:5px 0;min-height:30px;background:none;color:var(--eh-accent);font-weight:500!important;text-decoration:underline;text-underline-offset:3px}
.earth-helper-model-progress{display:block;margin:9px 0 0;width:100%;height:4px;border:0;border-radius:4px;overflow:hidden;background:var(--eh-line);accent-color:var(--eh-accent)}.earth-helper-model-progress::-webkit-progress-bar{background:var(--eh-line)}.earth-helper-model-progress::-webkit-progress-value{background:var(--eh-accent);border-radius:4px;transition:width .25s}.earth-helper-model-progress::-moz-progress-bar{background:var(--eh-accent)}
.earth-helper-cloud{margin:0 17px 12px;padding:16px;border:1px solid var(--eh-line);border-radius:15px;background:var(--eh-soft)}.earth-helper-cloud-heading{display:flex;align-items:center;gap:10px}.earth-helper-cloud-heading>span{display:grid;place-items:center;width:29px;color:var(--eh-accent)}.earth-helper-cloud-heading svg{width:25px;height:25px}#earth-assistant-dialog .earth-helper-cloud-heading strong{font-size:13px;font-weight:650;color:var(--eh-ink)}#earth-assistant-dialog .earth-helper-cloud-heading p{margin:0;color:var(--eh-muted);font-size:11px}
#earth-assistant-dialog .earth-helper-cloud-status{margin:10px 0 3px;color:var(--eh-ink);font-size:12px;line-height:1.55}#earth-assistant-dialog .earth-helper-cloud-description{margin:9px 0 0;color:var(--eh-muted);font-size:10px;line-height:1.6}#earth-assistant-dialog .earth-helper-cloud-consent{display:flex;align-items:center;gap:9px;margin-top:13px;font-size:12px;line-height:1.55;color:var(--eh-ink);cursor:pointer;font-weight:600}#earth-assistant-dialog .earth-helper-cloud-consent input{appearance:auto;flex:none;margin:0;accent-color:var(--eh-accent);width:17px;height:17px;box-shadow:none;min-height:0;padding:0}
#earth-assistant-dialog .earth-helper-cloud-privacy{margin:8px 0 0;color:var(--eh-muted);font-size:10px}#earth-assistant-dialog .earth-helper-cloud-privacy a{color:var(--eh-accent);text-underline-offset:3px}
.earth-helper-usage{margin:0 18px 10px;padding:10px 12px;border:1px solid var(--eh-line);border-radius:10px;background:var(--eh-soft)}#earth-assistant-dialog .earth-helper-usage p{margin:0;color:var(--eh-ink);font-size:11px;line-height:1.55}.earth-helper-usage button{border:0;padding:5px 0;background:none;color:var(--eh-accent);text-decoration:underline;text-underline-offset:3px;font-size:11px!important}
.earth-helper-form{padding:0 16px 13px;flex:none;margin:0}.earth-helper-composer{display:flex;gap:8px;align-items:flex-end;border:1px solid var(--eh-line);border-radius:19px;background:var(--eh-soft);padding:9px 10px 9px 13px}.earth-helper-composer:focus-within{border-color:var(--eh-focus);box-shadow:0 0 0 1px var(--eh-focus)}
#earth-assistant-dialog .earth-helper-composer textarea{display:block;flex:1;min-width:0;min-height:47px;max-height:100px;border:0;outline:0!important;box-shadow:none!important;resize:none;background:transparent;color:var(--eh-ink);font-size:14px;line-height:1.65;padding:4px 0;margin:0;border-radius:0;caret-color:var(--eh-ink)}#earth-assistant-dialog .earth-helper-composer textarea::placeholder{color:var(--eh-muted);opacity:1}
.earth-helper-send{display:grid;place-items:center;height:35px;width:35px;flex:none;border:0;border-radius:50%;background:var(--eh-accent);color:var(--eh-on-accent);padding:9px}.earth-helper-send svg{height:18px;width:18px}.earth-helper-stop-square{height:11px;width:11px;background:currentColor;border-radius:2px}
.earth-helper-signature{display:flex;align-items:center;justify-content:center;gap:7px;margin:11px 0 0;color:var(--eh-ink);font-size:12px;letter-spacing:-.3px;animation:earth-helper-arrive .45s ease-out}.earth-helper-signature b{font-weight:650}.earth-helper-terra-mark{position:relative;display:grid;place-items:center;height:26px;width:26px;margin-right:2px;color:var(--eh-accent)}.earth-helper-terra-mark svg{height:15px;width:15px}.earth-helper-terra-mark>i{position:absolute;inset:1px;border:1px solid var(--eh-accent);border-radius:50%;opacity:.55;animation:earth-helper-orbit 12s linear infinite}.earth-helper-terra-mark>i:after{content:"";position:absolute;left:1px;top:1px;height:4px;width:4px;border-radius:50%;background:var(--eh-accent)}.earth-helper-terra-mark>i:nth-of-type(2){inset:4px -2px;opacity:.3;animation-duration:16s;animation-direction:reverse;transform:rotate(55deg)}
.earth-helper-terra-dots{display:none;gap:3px;align-items:center;margin-left:3px}.earth-helper-terra-dots i{width:3px;height:3px;background:var(--eh-accent);border-radius:50%;animation:earth-helper-breathe 1.2s ease-in-out infinite}.earth-helper-terra-dots i:nth-child(2){animation-delay:.15s}.earth-helper-terra-dots i:nth-child(3){animation-delay:.3s}.earth-helper-signature[data-busy="true"] .earth-helper-terra-dots{display:flex}.earth-helper-signature[data-busy="true"] .earth-helper-terra-mark>i{animation-duration:2.5s}
#earth-assistant-dialog .earth-helper-footnote{margin:8px 0 0;text-align:center;color:var(--eh-muted);font-size:10px;line-height:1.45}.earth-helper-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@keyframes earth-helper-arrive{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}@keyframes earth-helper-breathe{0%,80%,100%{opacity:.45;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}@keyframes earth-helper-orbit{to{transform:rotate(360deg)}}
@media(max-width:600px){.earth-helper-launcher{right:16px;bottom:calc(16px + env(safe-area-inset-bottom));min-height:50px;padding:8px 14px 8px 9px;font-size:13px}.earth-helper-dialog{width:calc(100% - 16px);right:8px;bottom:calc(8px + env(safe-area-inset-bottom));height:min(760px,calc(100dvh - 16px - env(safe-area-inset-bottom)));border-radius:20px}.earth-helper-header{padding:14px 15px 12px;gap:8px}.earth-helper-log{padding:21px 17px 10px}.earth-helper-intro{padding-top:12px}#earth-assistant-dialog .earth-helper-intro h3{font-size:32px}#earth-assistant-dialog .earth-helper-composer textarea{font-size:16px}.earth-helper-form{padding-left:12px;padding-right:12px}.earth-helper-source{min-height:38px}.earth-helper-cloud{margin-left:12px;margin-right:12px}.earth-helper-local{margin-left:17px}.earth-helper-clear{font-size:10px!important}.earth-helper-model-button{min-height:38px}.earth-helper-options{max-height:40%}}
@media(max-height:620px){.earth-helper-header{padding-top:11px;padding-bottom:10px}.earth-helper-intro{padding:4px 0}.earth-helper-log{min-height:80px;padding-top:14px}#earth-assistant-dialog .earth-helper-intro h3{font-size:27px}.earth-helper-prompts{margin-top:16px}.earth-helper-options{max-height:35%}.earth-helper-cloud{padding:12px}.earth-helper-signature{margin-top:7px}.earth-helper-form{padding-bottom:8px}}
@media(prefers-reduced-motion:reduce){.earth-helper-dialog[open],.earth-helper-signature,.earth-helper-working i,.earth-helper-terra-mark>i,.earth-helper-terra-dots i{animation:none}.earth-helper-launcher,.earth-helper-prompt,.earth-helper-picker>summary>svg,.earth-helper-model-progress::-webkit-progress-value{transition:none}.earth-helper-launcher:hover{transform:none}}
@media(forced-colors:active){.earth-helper-launcher,.earth-helper-dialog,.earth-helper-picker-menu,.earth-helper-prompt,.earth-helper-cloud,.earth-helper-composer,.earth-helper-source{border:1px solid ButtonText}.earth-helper-dialog::backdrop{background:#0008}.earth-helper-send,.earth-helper-model-button{border:1px solid ButtonText}.earth-helper-terra-mark>i{border-color:ButtonText}}
@media print{.earth-helper-launcher,.earth-helper-dialog{display:none!important}}

/* Account memory controls are shared with Scout's full-page chat. */
.earth-helper-memory-slot { margin: 0 18px 5px; }
.terra-memory {
  --tm-ink: var(--eh-ink, #203329);
  --tm-muted: var(--eh-muted, #4d6055);
  --tm-line: var(--eh-line, #c9d5ca);
  --tm-bg: var(--eh-surface, #fff);
  --tm-soft: var(--eh-soft, #f1f5ef);
  --tm-accent: var(--eh-accent, #285e39);
  min-width: 0;
  color: var(--tm-ink);
  font: 400 13px/1.5 "DM Sans", system-ui, sans-serif;
}
html[data-theme="dark"] .terra-memory {
  --tm-ink: var(--eh-ink, #f1f4f0);
  --tm-muted: var(--eh-muted, #b3bcb4);
  --tm-line: var(--eh-line, #414e43);
  --tm-bg: var(--eh-surface, #191f1b);
  --tm-soft: var(--eh-soft, #252e27);
  --tm-accent: var(--eh-accent, #c2e3b6);
}
.terra-memory[hidden], .terra-memory [hidden] { display: none !important; }
.terra-memory .terra-memory-summary { display: flex; align-items: center; gap: 8px; width: fit-content; padding: 7px 2px; cursor: pointer; font-weight: 650; color: var(--tm-ink); list-style: none; }
.terra-memory-summary::-webkit-details-marker { display: none; }
.terra-memory-summary::before { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); margin: 0 3px; }
.terra-memory[open] > .terra-memory-summary::before { transform: rotate(45deg); }
.terra-memory-indicator { color: var(--tm-muted); font-size: 11px; font-weight: 500; }
.terra-memory[data-enabled="true"] .terra-memory-indicator { color: var(--tm-accent); }
.terra-memory-body { background: var(--tm-bg); border: 1px solid var(--tm-line); border-radius: 13px; padding: 13px; }
.terra-memory .terra-memory-toggle { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--tm-ink); font-weight: 650; cursor: pointer; }
.terra-memory .terra-memory-toggle input { width: 17px; height: 17px; min-height: 0; padding: 0; margin: 0; accent-color: var(--tm-accent); }
.terra-memory .terra-memory-description, .terra-memory .terra-memory-status { margin: 6px 0 9px; font-size: 12px; line-height: 1.5; color: var(--tm-muted); }
.terra-memory .terra-memory-status { margin-bottom: 0; color: var(--tm-ink); }
.terra-memory-row { display: flex; align-items: center; gap: 6px; padding: 7px 0; border-top: 1px solid var(--tm-line); }
.terra-memory-value, .terra-memory .terra-memory-edit-label { display: grid; flex: 1; min-width: 0; margin: 0; gap: 2px; overflow-wrap: anywhere; color: var(--tm-ink); }
.terra-memory-value small { font-size: 11px; font-weight: 650; }
.terra-memory .terra-memory-edit-label { font-size: 12px; }
.terra-memory .terra-memory-input { padding: 7px; width: 100%; font: inherit; border: 1px solid var(--tm-line); border-radius: 5px; color: var(--tm-ink); background: var(--tm-soft); }
.terra-memory textarea.terra-memory-input { min-height: 60px; resize: vertical; }
.terra-memory .terra-memory-button { min-height: 28px; padding: 3px 7px; border-radius: 6px; border: 1px solid var(--tm-line); background: var(--tm-bg); color: var(--tm-ink); font: inherit; cursor: pointer; }
.terra-memory .terra-memory-button:hover, .terra-memory .terra-memory-button:focus-visible { background: var(--tm-soft); }
.terra-memory :is(input, textarea, button, a, summary):focus-visible { outline: 2px solid var(--tm-accent); outline-offset: 2px; }
.terra-memory-footer { display: flex; align-items: center; justify-content: space-between; gap: 9px; flex-wrap: wrap; margin-top: 7px; }
.terra-memory-footer a { color: var(--tm-accent); font-weight: 600; text-decoration: underline; }
.terra-memory-confirm { border-top: 1px solid var(--tm-line); padding-top: 5px; margin-top: 10px; }
.terra-memory-confirm button + button { margin-left: 6px; }
.terra-memory-history { border-top: 1px solid var(--tm-line); padding: 7px 0; }
.terra-memory-history > summary { color: var(--tm-ink); font-weight: 600; cursor: pointer; }
.terra-memory-turns { max-height: 170px; overflow: auto; overscroll-behavior: contain; overflow-wrap: anywhere; }
.terra-memory-turns p { display: grid; margin: 6px 0; }
#earth-assistant-dialog .earth-helper-profile-saved { display: block; margin-top: 5px; font-size: 12px; color: var(--eh-accent); }
#earth-assistant-dialog .earth-helper-clear-status { margin: 3px 18px; font-size: 13px; }

/* The conversation canvas and its optional settings rail share one dialog. */
.earth-helper-dialog {
  --eh-panel: var(--eh-surface);
  --eh-glass: color-mix(in srgb, var(--eh-panel) 95%, transparent);
  --eh-glow: #59e9e21c;
}
#earth-assistant-dialog[data-model="advanced"] {
  --eh-ink: #f1f8fc;
  --eh-muted: #acbdc9;
  --eh-surface: #0c141c;
  --eh-panel: #15232d;
  --eh-soft: #192c38;
  --eh-hover: #263b48;
  --eh-line: #36505b;
  --eh-accent: #9bf1e3;
  --eh-on-accent: #052e29;
  --eh-focus: #7ae4df;
}
html[data-theme="light"] #earth-assistant-dialog[data-model="advanced"] {
  --eh-ink: #102a35;
  --eh-muted: #455e69;
  --eh-surface: #f4f8f9;
  --eh-panel: #fffeff;
  --eh-soft: #e7f0f2;
  --eh-hover: #dcebec;
  --eh-line: #c4d5dc;
  --eh-accent: #155e66;
  --eh-on-accent: #fff;
  --eh-focus: #117b83;
  --eh-glow: #48afb519;
}
.earth-helper-workarea {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  isolation: isolate;
}
.earth-helper-main {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.earth-helper-dialog[data-model="advanced"] .earth-helper-main {
  background:
    radial-gradient(ellipse at 95% -20%, var(--eh-glow), transparent 55%),
    var(--eh-surface);
}
.earth-helper-dialog[data-model="advanced"] .earth-helper-header {
  padding-top: 14px;
  padding-bottom: 14px;
  color: #f1fcff;
  background:
    radial-gradient(ellipse at 90% -25%, #35808c58, transparent 60%),
    linear-gradient(120deg, #0b161e, #112b37 62%, #15232e);
  box-shadow: inset 0 1px #d2ffff1c;
  border-bottom: 1px solid #53747c;
}
#earth-assistant-dialog[data-model="advanced"] .earth-helper-header :is(.earth-helper-picker > summary,.earth-helper-clear,.earth-helper-icon-button) { color: #f0f9fc; }
#earth-assistant-dialog[data-model="advanced"] .earth-helper-header .earth-helper-mode { color: #bdcfd8; }
.earth-helper-dialog[data-model="advanced"] .earth-helper-picker > summary > svg { stroke: #b1ced7; }
.earth-helper-dialog[data-model="advanced"] .earth-helper-header :is(.earth-helper-clear,.earth-helper-icon-button,.earth-helper-picker > summary):hover {
  background: #c3eef517;
}
.earth-helper-dialog[data-model="advanced"] .earth-helper-picker > summary::before {
  content: "";
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 22%, #f6ffff, #a3f4ea 17%, #4f9db5 38%, #101e47 69%, #78c9c6 98%);
  box-shadow: 0 0 9px #5ff2df5c, inset 0 0 0 1px #cbf9ff69;
}
.earth-helper-dialog[data-model="advanced"] .earth-helper-intro { padding-top: clamp(12px,3vh,30px); }
.earth-helper-empty-mark {
  display: block;
  position: relative;
  width: 46px;
  aspect-ratio: 1;
  margin: 3px 0 19px 5px;
  border-radius: 50%;
  border: 1px solid #86d5e389;
  background:
    radial-gradient(ellipse at 25% 20%, #fcffff 0, #a4ffffa1 7%, transparent 27%),
    radial-gradient(ellipse at 78% 92%, #909cec 0, transparent 34%),
    radial-gradient(ellipse at 44% 33%, #64b6c1, #204655 50%, #0b1c2b 68%, #64d9dd 97%);
  box-shadow: inset -3px -2px 6px #1722428c, 0 4px 13px #243b4933, 0 0 16px #5da9ab2e;
}
.earth-helper-empty-mark::after {
  content: "";
  position: absolute;
  inset: 12px -8px;
  transform: rotate(-29deg);
  border: 1px solid #5bb1bc;
  border-top-color: #a5f9e875;
  border-radius: 50%;
}
#earth-assistant-dialog[data-model="advanced"] .earth-helper-intro h3 {
  max-width: 20ch;
  font-size: clamp(28px, 4.5vw, 36px);
  font-weight: 580;
  line-height: 1.08;
  letter-spacing: -.047em;
}
#earth-assistant-dialog .earth-helper-message-text { font-size: 15px; line-height: 1.7; }
#earth-assistant-dialog[data-model="advanced"] .earth-helper-message-user {
  border: 1px solid color-mix(in srgb,var(--eh-line) 65%,transparent);
  border-radius: 17px 17px 4px 17px;
}
#earth-assistant-dialog[data-model="advanced"] .earth-helper-prompt { background: var(--eh-panel); }
#earth-assistant-dialog[data-model="advanced"] .earth-helper-prompt:hover { background: var(--eh-soft); }
.earth-helper-composer {
  align-items: center;
  padding: 7px 8px;
  gap: 8px;
  box-shadow: 0 3px 9px #081c1d10;
}
#earth-assistant-dialog[data-model="advanced"] .earth-helper-composer {
  background: var(--eh-panel);
  border-color: color-mix(in srgb, var(--eh-line) 75%, var(--eh-accent));
}
#earth-assistant-dialog .earth-helper-composer textarea {
  min-height: 43px;
  line-height: 1.45;
  padding-block: 10px 5px;
}
.earth-helper-form { position: relative; }
.earth-helper-settings, .earth-helper-expand, .earth-helper-sidebar-close {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 36px;
  min-height: 36px;
  border: 0;
  border-radius: 11px;
  padding: 8px;
  color: var(--eh-muted);
  background: transparent;
}
.earth-helper-settings { position: relative; align-self: flex-end; border: 1px solid transparent; }
.earth-helper-settings[data-memory="on"]::after {
  content: ''; position: absolute; top: 6px; right: 5px; width: 5px; height: 5px;
  border-radius: 50%; background: #66dfba; box-shadow: 0 0 0 1px #133d3b;
}
.earth-helper-settings[aria-expanded="true"], .earth-helper-settings:hover, .earth-helper-sidebar-close:hover {
  color: var(--eh-accent);
  background: var(--eh-soft);
  border-color: var(--eh-line);
}
.earth-helper-settings svg, .earth-helper-expand svg, .earth-helper-sidebar-close svg { display: block; width: 18px; height: 18px; }
.earth-helper-send { align-self: flex-end; }
#earth-assistant-dialog[data-model="advanced"] .earth-helper-send {
  background: linear-gradient(135deg,#befff0,#76d8df);
  color: #092f39;
  box-shadow: inset 0 0 0 1px #edffff67;
}
.earth-helper-dialog .earth-helper-cloud {
  margin: 0 15px 8px;
  border: 0;
  border-left: 2px solid var(--eh-accent);
  border-radius: 0 8px 8px 0;
  padding: 6px 11px;
}
#earth-assistant-dialog .earth-helper-cloud-status { margin: 0; }
.earth-helper-dialog .earth-helper-cloud :is(a,button) { color: var(--eh-accent); }
.earth-helper-signature { margin-top: 5px; }
#earth-assistant-dialog .earth-helper-footnote { margin-top: 3px; }

.earth-helper-sidebar {
  position: absolute;
  z-index: 3;
  inset: auto auto 88px 14px;
  width: min(340px, calc(100% - 28px));
  max-height: calc(100% - 105px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--eh-line) transparent;
  padding: 16px;
  border: 1px solid var(--eh-line);
  border-radius: 18px;
  background: var(--eh-panel);
  background: var(--eh-glass);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 18px 46px #03131b34, inset 0 1px #ffffff28;
}
.earth-helper-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -3px -4px 14px 0;
}
#earth-assistant-dialog .earth-helper-sidebar-head h3 {
  font-family: inherit;
  font-size: 18px;
  font-weight: 620;
  line-height: 1.3;
  letter-spacing: -.035em;
  margin: 0;
}
.earth-helper-sidebar .earth-helper-memory-slot { margin: 16px 0 0; }
.earth-helper-meter { padding: 12px 14px; border: 1px solid var(--eh-line); border-radius: 13px; background: var(--eh-soft); }
#earth-assistant-dialog .earth-helper-meter :is(h3,h4,strong) { margin: 0; font: 650 13px/1.5 "DM Sans",system-ui,sans-serif; }
.earth-helper-meter progress {
  display: block;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  margin: 9px 0 6px;
  overflow: hidden;
  border: 0;
  border-radius: 5px;
  background: var(--eh-line);
  accent-color: var(--eh-accent);
}
.earth-helper-meter progress::-webkit-progress-bar { background: var(--eh-line); border-radius: 5px; }
.earth-helper-meter progress::-webkit-progress-value { border-radius: 5px; background: linear-gradient(90deg,var(--eh-accent),#499cbc); }
.earth-helper-meter progress::-moz-progress-bar { border-radius: 5px; background: linear-gradient(90deg,var(--eh-accent),#499cbc); }
#earth-assistant-dialog .earth-helper-meter-label, #earth-assistant-dialog .earth-helper-privacy {
  margin: 6px 0 0;
  color: var(--eh-muted);
  font-size: 12px;
  line-height: 1.55;
}
#earth-assistant-dialog a.earth-helper-privacy { display:block; border-top: 1px solid var(--eh-line); padding-top: 12px; margin-top: 15px; color: var(--eh-accent); text-underline-offset: .18em; }

.terra-memory[data-embedded="true"] .terra-memory-body { padding: 0; border: 0; border-radius: 0; background: transparent; }
.terra-memory[data-embedded="true"] .terra-memory-toggle { justify-content: space-between; font-size: 14px; }
.terra-memory[data-embedded="true"] .terra-memory-toggle input {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  display: block;
  flex: none;
  width: 34px;
  height: 20px;
  border: 1px solid var(--tm-muted);
  border-radius: 14px;
  background: var(--tm-soft);
  cursor: pointer;
}
.terra-memory[data-embedded="true"] .terra-memory-toggle input::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  left: 3px;
  top: 3px;
  background: var(--tm-muted);
  border-radius: 50%;
  transition: transform .18s;
}
.terra-memory[data-embedded="true"] .terra-memory-toggle input:checked { border-color: var(--tm-accent); background: var(--tm-accent); }
.terra-memory[data-embedded="true"] .terra-memory-toggle input:checked::before { background: var(--tm-bg); transform: translateX(14px); }
.terra-memory[data-embedded="true"] .terra-memory-toggle input:disabled { opacity: .6; cursor: wait; }
.terra-memory .terra-memory-row { padding-block: 9px; }
.terra-memory .terra-memory-button { font-size: 11px; padding: 4px 7px; }
.terra-memory .terra-memory-turns { max-height: clamp(130px,27vh,360px); }
.terra-memory .terra-memory-pair + .terra-memory-pair { margin-top: 10px; padding-top: 7px; border-top: 1px solid var(--tm-line); }
.terra-memory .terra-memory-pair span { white-space: pre-wrap; }
.terra-memory .terra-memory-archive-status, #earth-assistant-dialog .terra-memory-archive-status { margin: 5px 0; color: var(--tm-muted); font-size: 12px; }
.terra-memory .terra-memory-archive-status:empty { display: none; }
.terra-memory .terra-memory-turns strong { font-size: 11px; }
#earth-assistant-dialog .terra-memory-description { color: var(--tm-muted); }
#earth-assistant-dialog[data-expanded="true"] {
  inset: 0;
  width: 100%;
  height: 100dvh;
  border: 0;
  border-radius: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
#earth-assistant-dialog[data-expanded="true"] .earth-helper-header { padding-inline: clamp(14px,3vw,38px); }
#earth-assistant-dialog[data-expanded="true"] .earth-helper-log, #earth-assistant-dialog[data-expanded="true"] .earth-helper-form {
  padding-inline: max(15px, calc((100% - 770px) / 2));
}
#earth-assistant-dialog[data-expanded="true"] .earth-helper-log { padding-top: clamp(16px,4vh,52px); }
#earth-assistant-dialog[data-expanded="true"] .earth-helper-main > :is(.earth-helper-options,.earth-helper-usage,.earth-helper-clear-status) {
  width: min(100%,770px);
  align-self: center;
}
#earth-assistant-dialog[data-expanded="true"] .earth-helper-form { padding-bottom: max(12px,env(safe-area-inset-bottom)); }
@media(min-width:820px) {
  #earth-assistant-dialog[data-expanded="true"] .earth-helper-sidebar {
    position: relative;
    inset: auto;
    flex: 0 0 clamp(255px,23vw,332px);
    max-height: none;
    padding: 21px clamp(16px,1.8vw,26px);
    border: 0;
    border-right: 1px solid var(--eh-line);
    border-radius: 0;
    box-shadow: inset 0 1px #ffffff12;
  }
  #earth-assistant-dialog[data-expanded="true"] .earth-helper-intro { padding-top: clamp(24px,9vh,108px); }
  #earth-assistant-dialog[data-expanded="true"] .earth-helper-intro h3 { font-size: clamp(36px,4vw,52px); }
}

/* An iridescent bubble rises from the composer and releases a single ripple. */
.earth-helper-burst {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 18%;
  width: 72px;
  height: 72px;
  pointer-events: none;
  display: none;
  isolation: isolate;
}
.earth-helper-dialog[data-activating="true"] .earth-helper-burst { display: grid; place-items: center; }
.earth-helper-burst::before, .earth-helper-burst::after, .earth-helper-burst i, .earth-helper-burst b {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}
.earth-helper-burst::before {
  content: "";
  border: 1px solid #a4f5ff;
  background:
    radial-gradient(ellipse at 26% 21%, #fff 0%, #ebfffaab 5%, transparent 19%),
    radial-gradient(ellipse at 78% 83%, #c4acfbbf 0%, transparent 35%),
    radial-gradient(ellipse at 32% 34%,#61c6c6d9,#276679cd 39%,#132c4bd9 66%,#87dec5cb 99%);
  box-shadow: inset 0 0 10px #b3f8ffb0, 0 0 28px #5ebecb55;
  animation: terra-bubble-rise .93s cubic-bezier(.18,.74,.27,1) both;
}
.earth-helper-burst b {
  display: grid;
  place-items: center;
  color: #fff;
  font: 600 21px/1 "DM Sans",system-ui,sans-serif;
  letter-spacing: -.06em;
  text-shadow: 0 1px 7px #153143;
  animation: terra-bubble-rise .93s cubic-bezier(.18,.74,.27,1) both;
}
.earth-helper-burst::after {
  content: "";
  inset: -14px;
  border: 1px solid #70dacf;
  animation: terra-bubble-ring .95s ease-out both;
}
.earth-helper-burst i {
  width: 9px;
  height: 9px;
  background: radial-gradient(circle at 30% 26%,#fff,#85dad6 30%,#517da4 70%,#9cebe7);
  --terra-drop-x:-50px;
  --terra-drop-y:-70px;
  animation: terra-bubble-droplet .98s ease-out both;
}
.earth-helper-burst i:nth-of-type(2) { --terra-drop-x:46px; --terra-drop-y:-58px; width:7px; height:7px; }
.earth-helper-burst i:nth-of-type(3) { --terra-drop-x:29px; --terra-drop-y:-87px; width:5px; height:5px; }
@keyframes terra-bubble-rise {
  0% { opacity: 0; transform: translate(-50%,60px) scale(.28); }
  34% { opacity: 1; transform: translate(-50%,0) scale(.93); }
  67% { opacity: 1; transform: translate(-50%,-23px) scale(1); }
  93%,100% { opacity: 0; transform: translate(-50%,-36px) scale(1.29); }
}
@keyframes terra-bubble-ring {
  0%,59% { opacity: 0; transform: translate(-36px,-24px) scale(.4); }
  70% { opacity: .65; }
  100% { opacity: 0; transform: translate(-36px,-35px) scale(1.55); }
}
@keyframes terra-bubble-droplet {
  0%,66% { opacity: 0; transform: translate(0,0) scale(.34); }
  76% { opacity: .9; }
  100% { opacity: 0; transform: translate(var(--terra-drop-x),var(--terra-drop-y)) scale(.6); }
}
@media(max-width:600px) {
  .earth-helper-sidebar { inset: auto auto 88px 9px; width: min(340px,calc(100% - 18px)); padding: 14px; }
  .earth-helper-icon-button, .earth-helper-settings { width: 39px; min-height: 39px; }
  .earth-helper-dialog[data-model="advanced"] .earth-helper-header { padding-block: 10px; }
  .earth-helper-dialog[data-model="advanced"] .earth-helper-empty-mark { width: 36px; margin-bottom: 14px; }
}
@media(max-height:560px) {
  .earth-helper-sidebar { bottom: 4px; max-height: calc(100% - 8px); }
  .earth-helper-dialog .earth-helper-empty-mark { display: none; }
}
@media(prefers-reduced-motion:reduce) {
  .earth-helper-dialog[data-activating="true"] .earth-helper-burst { display:none; }
  .terra-memory-toggle input::before { transition:none!important; }
}
html[data-effects="off"] .earth-helper-dialog .earth-helper-burst { display:none; }
html[data-effects="off"] .earth-helper-dialog *, html[data-effects="off"] .earth-helper-dialog *::before { animation:none!important; transition:none!important; }
@media(forced-colors:active) {
  .earth-helper-sidebar, .earth-helper-meter, .earth-helper-settings, .earth-helper-expand { border: 1px solid ButtonText; }
  .earth-helper-burst, .earth-helper-empty-mark { display: none!important; }
  .terra-memory[data-embedded="true"] .terra-memory-toggle input { appearance:auto; width:20px; }
  .terra-memory[data-embedded="true"] .terra-memory-toggle input::before { content:none; }
}
