:root {
  --tm-primary: #15355c;
  --tm-primary-dark: #0d2440;
  --tm-bg: #ffffff;
  --tm-text: #1f2d3d;
  --tm-muted: #65717d;
  --tm-border: #e3e9f2;
  --tm-user: #eef7f0;
  --tm-shadow: 0 18px 60px rgba(21, 53, 92, .22);
}

#tm-assistant-root, #tm-assistant-root * { box-sizing: border-box; }
#tm-assistant-root { font-family: Inter, -apple-system, "Segoe UI", Roboto, Arial, Helvetica, sans-serif; color: var(--tm-text); }
.tm-launcher {
  position: fixed; right: 20px; bottom: 20px; z-index: 2147483000;
  height: 54px; border: 0; border-radius: 28px; cursor: pointer;
  background: var(--tm-primary); color: #fff; box-shadow: var(--tm-shadow);
  display: flex; align-items: center; gap: 9px; padding: 0 17px 0 9px;
  font: 700 14px/1 Inter, Arial, Helvetica, sans-serif;
}
.tm-launcher:hover { background: var(--tm-primary-dark); transform: translateY(-1px); }
.tm-launcher-icon {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.18); font-size: 21px; font-weight: 800; color: #f5a623;
}
.tm-launcher:focus-visible, .tm-send:focus-visible, .tm-close:focus-visible,
.tm-input:focus-visible, .tm-quick button:focus-visible, .tm-full-link:focus-visible {
  outline: 3px solid rgba(46, 125, 50, .3); outline-offset: 2px;
}
.tm-panel {
  position: fixed; right: 20px; bottom: 87px; z-index: 2147482999;
  width: min(392px, calc(100vw - 24px)); height: min(630px, calc(100vh - 110px));
  background: var(--tm-bg); border: 1px solid var(--tm-border); border-radius: 18px;
  box-shadow: var(--tm-shadow); display: none; overflow: hidden;
}
.tm-panel.tm-open { display: grid; grid-template-rows: auto 1fr auto auto; }
.tm-header { background: var(--tm-primary); color: #fff; padding: 15px 16px; display: flex; gap: 12px; align-items: center; }
.tm-avatar { width: 39px; height: 39px; border-radius: 11px; background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 21px; font-weight: 800; color: #f5a623; }
.tm-heading { flex: 1; min-width: 0; }
.tm-title { font-size: 16px; font-weight: 700; margin: 0 0 2px; }
.tm-subtitle { font-size: 12px; opacity: .88; margin: 0; }
.tm-close { border: 0; background: transparent; color: #fff; font-size: 25px; cursor: pointer; padding: 4px; }
.tm-messages { padding: 15px; overflow-y: auto; background: #f7faf8; }
.tm-message { margin: 0 0 12px; display: flex; }
.tm-message.tm-user { justify-content: flex-end; }
.tm-bubble { max-width: 88%; border-radius: 14px; padding: 10px 12px; font-size: 14px; line-height: 1.48; background: #fff; border: 1px solid var(--tm-border); overflow-wrap: anywhere; }
.tm-user .tm-bubble { background: var(--tm-user); border-color: #d3ead9; }
.tm-bubble p { margin: 0 0 8px; }
.tm-bubble p:last-child { margin-bottom: 0; }
.tm-sources { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--tm-border); font-size: 12px; }
.tm-sources-title { color: var(--tm-muted); margin-bottom: 5px; }
.tm-source { display: block; color: var(--tm-primary-dark); text-decoration: none; margin: 5px 0; }
.tm-source:hover { text-decoration: underline; }
.tm-support { display: inline-block; margin-top: 10px; padding: 8px 10px; border-radius: 9px; background: #2e7d32; color: #fff; text-decoration: none; font-size: 12px; font-weight: 700; }
.tm-typing { color: var(--tm-muted); font-style: italic; }
.tm-quick { display: flex; gap: 6px; overflow-x: auto; padding: 9px 11px; border-top: 1px solid var(--tm-border); background: #fff; }
.tm-quick button { flex: 0 0 auto; border: 1px solid #d9efe0; background: #eef7f0; color: #1f4d2c; border-radius: 999px; padding: 6px 9px; cursor: pointer; font-size: 11px; font-family: inherit; }
.tm-quick button:hover { background: #e2f2e7; }
.tm-composer { border-top: 1px solid var(--tm-border); background: #fff; padding: 11px; }
.tm-form { display: flex; gap: 8px; align-items: flex-end; }
.tm-input { flex: 1; resize: none; min-height: 42px; max-height: 104px; padding: 10px 11px; border: 1px solid #c3d2c9; border-radius: 11px; font: 14px/1.4 Inter, Arial, Helvetica, sans-serif; }
.tm-send { width: 43px; height: 43px; border: 0; border-radius: 11px; cursor: pointer; background: #2e7d32; color: #fff; font-size: 19px; }
.tm-send:disabled { opacity: .5; cursor: default; }
.tm-footer-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin: 7px 2px 0; }
.tm-note { color: var(--tm-muted); font-size: 10px; line-height: 1.3; }
.tm-full-link { color: var(--tm-primary-dark); font-size: 11px; font-weight: 700; white-space: nowrap; }
@media (max-width: 520px) {
  .tm-launcher { right: 13px; bottom: 13px; width: 54px; padding: 0 8px; justify-content: center; }
  .tm-launcher-label { display: none; }
  .tm-panel { inset: 8px; width: auto; height: auto; border-radius: 14px; }
}
