.trace-toggle { display: flex; align-items: center; gap: 8px; margin: 0 29px 10px; padding-top: 11px; border-top: 1px solid #e4e0dc; color: #5c5753; font: 9px DM Mono, monospace; cursor: pointer; }
.trace-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.trace-toggle > span { width: 27px; height: 15px; padding: 2px; border-radius: 20px; background: #d5d1cc; transition: .2s; }
.trace-toggle > span:after { content: ''; display: block; width: 11px; height: 11px; border-radius: 50%; background: #fff; transition: .2s; }
.trace-toggle input:checked + span { background: #1d5d95; }
.trace-toggle input:checked + span:after { transform: translateX(12px); }
.selection-trace { margin: 16px 0; padding: 13px; border: 1px solid #d9d5d0; border-radius: 8px; background: #fbfaf8; }
.trace-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 10px; border-bottom: 1px solid #e4e0dc; }
.trace-header span { color: #9c4e0f; font: 8px DM Mono, monospace; letter-spacing: .7px; }
.trace-header b { color: #5e5956; font: 9px DM Mono, monospace; font-weight: 500; }
.trace-row { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 10px 0 0; }
.trace-row + .trace-row { border-top: 1px solid #e9e5e1; margin-top: 10px; }
.trace-row i { width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid #cfc9c3; border-radius: 50%; color: #8c520e; font: 8px DM Mono, monospace; font-style: normal; }
.trace-row strong { display: block; font-size: 10px; font-weight: 700; }
.trace-row p { margin: 2px 0; color: #77716d; font-size: 9px; line-height: 1.55; }
.trace-row em { display: block; color: #2c7f5b; font: 8px DM Mono, monospace; font-style: normal; }

/* Keep the consultation window stable while its conversation history scrolls. */
.consult-panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto auto; height: min(700px, calc(100dvh - 40px)); min-height: 0; }
.consult-panel header, .consult-panel form, .consult-panel .fine-print, .consult-panel .trace-toggle { min-height: 0; }
.consult-content { height: 100%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #c8c2bb transparent; }
.consult-content::-webkit-scrollbar { width: 5px; }
.consult-content::-webkit-scrollbar-thumb { border-radius: 10px; background: #c8c2bb; }
@media(max-width:700px) { .consult-panel { height: min(680px, calc(100dvh - 20px)); } .trace-toggle { margin-left: 22px; margin-right: 22px; } }
