.ja-entry{display:flex;gap:12px;align-items:center;justify-content:space-between;margin:10px 0 18px;padding:13px 14px;border:1px solid #c7dfd0;border-radius:10px;background:#edf7f0;color:#173e2f}
.ja-entry h3,.ja-entry p{margin:0}.ja-entry h3{font-size:15px}.ja-entry p{font-size:12px;margin-top:4px;line-height:1.5;color:#466556}.ja-entry button{flex:none}
.ja-dialog{width:min(1020px,calc(100% - 36px));height:calc(100dvh - 30px);max-height:none;margin:auto;padding:0;border:1px solid #bdd2c4;border-radius:18px;background:#f8fbf9;color:#1a382b;box-shadow:0 22px 78px #14352d66}
.ja-dialog[open]{display:flex;flex-direction:column;overflow:hidden}
.ja-dialog [hidden]{display:none!important}
.ja-dialog::backdrop{background:#142b229e}
.ja-dialog .ja-header{position:static;display:flex;justify-content:space-between;align-items:center;gap:12px;flex:0 0 auto;min-height:0;height:auto;color:white;background:#174535;padding:14px 20px}
.ja-header h2,.ja-header p{margin:0}.ja-header h2{font-size:20px}.ja-header p{color:#d9eee0;font-size:12px;margin-top:4px}
.ja-heading{min-width:0}
.ja-header p{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ja-header-actions{display:flex;justify-content:flex-end;gap:7px;flex:none}
.ja-settings{width:min(540px,calc(100% - 28px));max-height:calc(100dvh - 32px);margin:auto;padding:0;overflow:auto;overscroll-behavior:contain;border:1px solid #bdd2c4;border-radius:14px;box-shadow:0 14px 50px #132e2466;background:white;color:#1a382b}
.ja-settings::backdrop{background:#17392d70}
.ja-settings-head{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:12px;background:#174535;color:white;padding:10px 16px}
.ja-settings-head h2{margin:0;font-size:17px}
.ja-setting-body{padding:12px 16px 16px}
.ja-settings-nav{display:flex;gap:7px;margin-bottom:12px}
.ja-settings-nav button[aria-pressed="true"]{color:#144935;background:#e2f2e8;border-color:#98c8ad;font-weight:700}
.ja-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:6px}
.ja-grid label,.ja-query{display:block;font-weight:600;font-size:12px;color:#25493a}
.ja-grid input,.ja-grid select,.ja-query input{width:100%;margin-top:3px}
.ja-grid a,.ja-message a{color:#1b6452}
.ja-note,.ja-status{margin:5px 0;font-size:12px;line-height:1.45;color:#476358;overflow-wrap:anywhere}.ja-note:empty,.ja-status:empty{display:none}.ja-status{font-weight:600}.ja-error{color:#962e2d}
.ja-actions,.ja-examples{display:flex;flex-wrap:wrap;gap:7px;margin-top:8px}
.ja-thread{flex:1;min-height:0;overflow:auto;padding:16px max(20px,calc((100% - 830px) / 2));overscroll-behavior:contain}
.ja-welcome{max-width:550px;margin:16px auto}.ja-welcome h3{margin:0 0 6px;font-size:19px}.ja-welcome p{margin:0;font-size:13px;color:#476358}.ja-examples{display:grid}.ja-examples button{text-align:left;justify-content:flex-start;white-space:normal}
.ja-message{width:fit-content;max-width:min(94%,860px);margin:0 0 12px;padding:11px 13px;border:1px solid #d4e3d8;border-radius:12px;background:white;overflow-wrap:anywhere;font-size:14px;line-height:1.65}
.ja-user{margin-left:auto;background:#eaf5ee;max-width:86%}
.ja-message h3{margin:0 0 5px;font-size:12px;color:#4c6b5a}.ja-message h4{margin:9px 0 4px;font-size:14px}
.ja-message p{margin:4px 0}.ja-message ol,.ja-message ul{margin:4px 0;padding-left:22px}.ja-message details{border-top:1px solid #dce9df;margin-top:9px;padding-top:7px}.ja-message summary{cursor:pointer;color:#205844}.ja-copy{margin-top:7px}
.ja-form{flex:0 0 auto;max-height:35%;overflow:auto;padding:9px max(20px,calc((100% - 830px) / 2)) 10px;border-top:1px solid #d4e4d9;background:white}
.ja-form textarea{display:block;width:100%;resize:vertical;min-height:46px;max-height:124px}
.ja-form-actions{display:flex;justify-content:flex-end;gap:7px;margin-top:7px}.ja-form-actions button{min-height:36px}
@media(max-width:540px){.ja-entry{flex-wrap:wrap}.ja-dialog{height:calc(100dvh - 18px);width:calc(100% - 12px);border-radius:11px}.ja-dialog .ja-header,.ja-thread,.ja-form{padding-inline:12px}.ja-form-actions button{min-height:42px}}
.ja-history{flex:0 0 auto;display:flex;flex-wrap:wrap;align-items:center;gap:7px;padding:7px 20px;border-bottom:1px solid #d4e4d9;background:white}
.ja-history select{flex:1;min-width:90px;max-width:100%;text-overflow:ellipsis}
.ja-history button{flex:none}
.ja-history .ja-note{margin:0}
.ja-stream-option{display:flex;align-items:center;gap:5px;margin-top:8px;font-size:12px;color:#25493a}
.ja-progress{display:flex;align-items:center;flex-wrap:wrap;gap:8px;color:#245742;font-weight:600}
.ja-progress::before{content:"";width:10px;height:10px;border:2px solid #c8e2d5;border-top-color:#28634d;border-radius:50%;animation:ja-turn 1s linear infinite}
.ja-progress small{color:#536d60;font-weight:400;font-variant-numeric:tabular-nums}
.ja-stream-text{white-space:pre-wrap}
.ja-stream-text:not(:empty){margin-top:9px}
.ja-turn-note{color:#80512c}
@keyframes ja-turn{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.ja-progress::before{animation:none}}
@media(max-width:540px){.ja-history{padding-inline:12px}.ja-history button{padding-inline:7px}.ja-history .ja-note{font-size:11px;flex-basis:100%}}
.ja-form-actions{align-items:center;flex-wrap:wrap}
.ja-quick{display:flex;align-items:center;gap:8px;margin-right:auto}
.ja-quick label{display:flex;align-items:center;gap:4px;font-size:13px}
.ja-quick button{max-width:44vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ja-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
@media(max-width:600px){.ja-form-actions small{display:none}}
.ja-timetable-options{margin:8px 0;padding:8px 10px;border:1px solid #d4e4d9;border-radius:8px;background:#f5faf7}
.ja-timetable-options>label{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:600;color:#25493a}
.ja-timetable-options .ja-query,#ja-query-row{margin-top:8px}
.ja-evidence li{margin:3px 0}
#ja-agent-options{margin:9px 0;padding:9px 10px;border:1px solid #d4e4d9;border-radius:8px;background:#f5faf7}
.ja-result-actions button{margin:5px 6px 2px 0;max-width:100%;white-space:normal;text-align:left}
.ja-tool-action{margin-top:8px}
.ja-answer-table{width:100%;max-width:100%;overflow:auto;margin:8px 0}
.ja-answer-table table{min-width:260px;border-collapse:collapse;font-size:13px}
.ja-answer-table th,.ja-answer-table td{min-width:84px;padding:5px 8px;border:1px solid #dce9df;text-align:left;vertical-align:top}
.ja-answer-table th{background:#ecf5ee}

/* Keep the reading area quiet and give the composer one clear action. */
.ja-dialog {
  border-color: var(--ui-rule);
  border-radius: var(--ui-panel-radius);
  background: var(--ui-canvas);
  color: var(--ui-ink);
  box-shadow: var(--ui-panel-shadow);
}
.ja-dialog::backdrop { background: #142b2263; }
.ja-dialog .ja-header,
.ja-settings-head {
  border-bottom: 1px solid var(--ui-rule);
  background: var(--ui-paper);
  color: var(--ui-ink);
}
.ja-dialog .ja-header h2 { color: var(--ui-ink); font-weight: 740; }
.ja-dialog .ja-header p { color: var(--ui-muted); }
.ja-dialog .fan-button {
  border-color: var(--ui-control-line);
  border-radius: var(--ui-control-radius);
  background: var(--ui-paper);
  color: var(--ui-accent-deep);
}
.ja-dialog .fan-button:hover { background: var(--ui-tint); }
.ja-history { border-color: var(--ui-rule); background: var(--ui-paper); }
.ja-history .fan-select { border-color: var(--ui-control-line); border-radius: var(--ui-control-radius); }
.ja-history .ja-note { flex-basis: 100%; }
.ja-thread .ja-welcome { margin-top: clamp(16px, 5dvh, 46px); }
.ja-welcome h3 { font-size: clamp(20px, 3vw, 26px); color: var(--ui-ink); }
.ja-welcome p { color: var(--ui-muted); font-size: 14px; line-height: 1.6; }
.ja-examples button { padding: 10px 12px; text-align: start; font-size: 13px; line-height: 1.5; }
.ja-dialog .ja-message { border-color: var(--ui-rule); border-radius: 12px; font-size: 14px; line-height: 1.65; }
.ja-dialog .ja-user { background: var(--ui-tint); border-color: transparent; }
.ja-form { border-color: var(--ui-rule); }
.ja-form textarea {
  border-color: var(--ui-control-line);
  border-radius: 11px;
  font-size: 16px;
  line-height: 1.5;
}
.ja-dialog #ja-send {
  min-width: 68px;
  background: var(--ui-accent-deep);
  border-color: var(--ui-accent-deep);
  color: var(--ui-paper);
  font-weight: 700;
}
.ja-dialog #ja-send:hover { background: var(--ui-accent); }
.ja-dialog #ja-send:disabled { opacity: .55; }
@media (max-width: 540px) {
  .ja-dialog { border-radius: 12px; }
  .ja-history button { min-height: 34px; }
}
.ja-dialog .ja-header { border-top: 2px solid var(--ui-accent); }
