/* Torus chat — uses the site's colour tokens from styles.css */
.tc-launcher {
  position: fixed; inset-block-end: 1.25rem; inset-inline-end: 1.25rem; z-index: 40;
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .7rem 1.1rem .7rem .85rem; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--basalt); color: var(--stone); font: 500 .95rem/1 var(--text);
  box-shadow: 0 12px 28px -14px rgba(30, 43, 47, .7);
}
.tc-launcher svg, .tc-head svg { width: 1.6rem; height: 1.6rem; fill: none; stroke: currentColor; stroke-width: 1.4; }
.tc-launcher:hover { background: #2C3D42; }
.tc-launcher[aria-expanded="true"] { display: none; }

.tc-panel {
  position: fixed; inset-block-end: 1.25rem; inset-inline-end: 1.25rem; z-index: 41;
  width: min(24rem, calc(100vw - 2rem)); height: min(38rem, calc(100vh - 2.5rem));
  display: flex; flex-direction: column; overflow: hidden;
  background: #EFEDE7; color: var(--basalt); border: 1px solid var(--stone-deep); border-radius: 1.1rem;
  box-shadow: 0 24px 60px -24px rgba(30, 43, 47, .55);
  font-family: var(--text); font-size: .95rem; line-height: 1.5;
}
.tc-panel[hidden] { display: none; }

.tc-head {
  display: flex; align-items: center; gap: .7rem; padding: .85rem 1rem;
  background: var(--basalt); color: var(--stone);
}
.tc-head svg { stroke: var(--sand); }
.tc-head > div { flex: 1; min-width: 0; }
.tc-name { margin: 0; font-family: "Cormorant Garamond", serif; font-size: 1.3rem; line-height: 1.1; }
.tc-sub { margin: 0; font-size: .8rem; color: #AEB3AA; }
.tc-restart, .tc-close { background: none; border: 0; color: var(--stone); cursor: pointer; font: inherit; }
.tc-restart { font-size: .8rem; text-decoration: underline; text-underline-offset: .25em; text-decoration-color: var(--sand); padding: .3rem; }
.tc-close { font-size: 1.6rem; line-height: 1; padding: 0 .3rem; }
.tc-head :focus-visible { outline-color: var(--stone); }

.tc-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.tc-msg { max-width: 88%; padding: .6rem .85rem; border-radius: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.tc-bot { align-self: flex-start; background: #fff; border: 1px solid var(--stone-deep); border-end-start-radius: .25rem; }
.tc-user { align-self: flex-end; background: var(--basalt); color: var(--stone); border-end-end-radius: .25rem; }
.tc-user a { color: var(--stone); }
.tc-msg a { text-underline-offset: .2em; text-decoration-color: var(--sand); }
.tc-typing { color: var(--moss); font-style: italic; }
.tc-recap { margin: .6rem 0 0; display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; white-space: normal; font-size: .88rem; }
.tc-recap dt { color: var(--moss); }
.tc-recap dd { margin: 0; }

.tc-choices { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1rem .75rem; }
.tc-choices[hidden] { display: none; }
.tc-choice {
  border: 1px solid var(--basalt); background: transparent; color: var(--basalt);
  border-radius: 999px; padding: .4rem .8rem; font: inherit; font-size: .85rem; cursor: pointer; text-align: start;
}
.tc-choice:hover { background: var(--stone); }
.tc-choice.tc-primary { background: var(--basalt); color: var(--stone); }
.tc-busy .tc-choice { opacity: .5; pointer-events: none; }

.tc-form { display: flex; gap: .5rem; align-items: flex-end; padding: .75rem 1rem; border-top: 1px solid var(--stone-deep); }
.tc-form textarea {
  flex: 1; resize: none; border: 1px solid var(--stone-deep); border-radius: .75rem; padding: .6rem .75rem;
  font: inherit; background: #fff; color: var(--basalt); max-height: 140px;
}
.tc-form textarea:focus { outline: 2px solid var(--sand); outline-offset: 1px; }
.tc-form button {
  border: 0; border-radius: 999px; padding: .6rem 1rem; background: var(--basalt); color: var(--stone);
  font: 500 .9rem var(--text); cursor: pointer;
}
.tc-form button:disabled { opacity: .5; cursor: default; }
.tc-hp, .tc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tc-disclaimer { margin: 0; padding: 0 1rem .7rem; font-size: .72rem; color: var(--moss); }

@media (max-width: 34rem) {
  .tc-panel { inset: 0; width: 100%; height: 100%; border-radius: 0; border: 0; }
  .tc-launcher span { display: none; }
  .tc-launcher { padding: .85rem; }
}
