.ta-root {
  --ta-green: #173527;
  --ta-ink: #18231c;
  --ta-muted: #566057;
  --ta-paper: #fcfbf8;
  --ta-line: #d6d7ce;
  font-family: "Manrope", Arial, sans-serif;
  color: var(--ta-ink);
}

.ta-root *,
.ta-root *::before,
.ta-root *::after {
  box-sizing: border-box;
}

.ta-root [hidden] {
  display: none !important;
}

.ta-root :is(button, input, select) {
  font: inherit;
  color: inherit;
  letter-spacing: normal;
}

.ta-root button {
  cursor: pointer;
}

.ta-root :is(button, input, select, a):focus-visible {
  outline: 2px solid var(--ta-green);
  outline-offset: 3px;
}

.ta-root svg {
  width: 21px;
  height: 21px;
  flex-shrink: 0;
}

.ta-launcher {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  width: 278px;
  max-width: calc(100% - 32px);
  min-height: 64px;
  padding: 9px 11px 9px 12px;
  border: 1px solid rgba(23, 53, 39, .17);
  border-radius: 15px;
  background: var(--ta-paper);
  box-shadow: 0 4px 13px rgba(16, 30, 22, .15), 0 10px 38px rgba(16, 30, 22, .13);
  text-align: left;
  transition: box-shadow .2s ease, transform .2s ease;
}

.ta-mark {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 10px;
  background: #e8ede5;
  color: var(--ta-green);
}

.ta-launch-copy {
  display: grid;
  gap: 2px;
  line-height: 1.2;
}

.ta-launch-copy strong {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.04em;
}

.ta-launch-copy small {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ta-muted);
}

.ta-launch-arrow,
.ta-send {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 35px;
  height: 35px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ta-green);
  color: white;
}

.ta-launch-arrow {
  margin-left: auto;
}

.ta-launch-arrow svg,
.ta-send svg {
  width: 18px;
  height: 18px;
}

@media (hover: hover) {
  .ta-launcher:hover {
    transform: translate(-50%, -2px);
    box-shadow: 0 5px 15px rgba(16, 30, 22, .17), 0 13px 39px rgba(16, 30, 22, .14);
  }

  .ta-root :is(.ta-choice, .ta-icon-btn, .ta-edit, .ta-back):hover {
    background: #e8ede5;
  }

  .ta-root :is(.ta-primary, .ta-send:enabled):hover {
    background: #28513d;
  }
}

.ta-dialog {
  position: fixed;
  inset: 0;
  display: none;
  width: min(470px, calc(100vw - 32px));
  max-width: none;
  max-height: min(740px, calc(100dvh - 48px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  border: 1px solid var(--ta-line);
  border-radius: 19px;
  background: var(--ta-paper);
  color: var(--ta-ink);
  box-shadow: 0 20px 90px rgba(15, 32, 23, .24);
  text-align: left;
}

.ta-dialog[open] {
  display: flex;
  flex-direction: column;
  animation: ta-appear .19s ease-out both;
}

.ta-dialog::backdrop {
  background: rgba(13, 27, 19, .45);
}

body:has(.ta-dialog[open]) {
  overflow: hidden;
}

@keyframes ta-appear {
  from { opacity: 0; translate: 0 7px; }
  to { opacity: 1; translate: 0 0; }
}

.ta-head {
  position: static;
  display: flex;
  flex: none;
  align-items: center;
  gap: 12px;
  padding: 17px 21px;
  border-bottom: 1px solid var(--ta-line);
  background: var(--ta-paper);
}

.ta-head h2 {
  margin: 0;
  color: var(--ta-ink);
  font: 800 17px/1.35 "Manrope", Arial, sans-serif;
  letter-spacing: -.045em;
}

.ta-head h2:focus,
.ta-plan h3:focus {
  outline: 0;
}

.ta-head > div > span {
  display: block;
  color: var(--ta-muted);
  font-size: 12px;
  line-height: 1.35;
}

.ta-icon-btn {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.ta-icon-btn svg {
  width: 19px;
  height: 19px;
}

.ta-chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ta-scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #a3aea3 var(--ta-paper);
}

.ta-chat-scroll,
.ta-plan {
  padding: 25px;
}

.ta-welcome,
.ta-plan h3 {
  max-width: 15em;
  margin: 0 0 9px;
  color: var(--ta-ink);
  font: 800 clamp(26px, 4vw, 32px)/1.09 "Manrope", Arial, sans-serif;
  letter-spacing: -.06em;
  text-wrap: balance;
}

.ta-intro,
.ta-message p,
.ta-summary dd {
  margin: 0;
  color: var(--ta-muted);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}

.ta-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 19px;
}

.ta-root .ta-choice,
.ta-root .ta-edit {
  min-height: 40px;
  padding: 7px 12px;
  border: 1px solid var(--ta-line);
  border-radius: 7px;
  background: transparent;
  color: var(--ta-green);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.ta-choice:first-child {
  background: #e8ede5;
}

.ta-log:not(:empty) {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.ta-message {
  scroll-margin: 15px;
}

.ta-visitor {
  justify-self: end;
  max-width: 90%;
  padding: 9px 13px;
  border-radius: 9px 9px 2px 9px;
  background: #e6eee5;
}

.ta-speaker {
  display: block;
  margin-bottom: 3px;
  color: var(--ta-green);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
}

.ta-message p,
.ta-summary dd {
  color: var(--ta-ink);
}

.ta-text-link {
  display: inline-block;
  margin-top: 6px;
  color: var(--ta-green);
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ta-compose {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 12px 18px;
  border-top: 1px solid var(--ta-line);
}

.ta-compose input {
  flex: 1;
  min-width: 0;
  height: 43px;
  padding: 0 7px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  font-size: 16px;
  line-height: 1.4;
}

.ta-compose input::placeholder {
  color: #5b625c;
}

.ta-root .ta-send {
  width: 42px;
  height: 42px;
  color: white;
}

.ta-send:disabled {
  background: #e4e7df;
  color: #667065;
  cursor: default;
}

.ta-root .ta-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  margin: -9px 0 12px -7px;
  padding: 5px 7px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ta-muted);
  font-size: 12px;
  font-weight: 700;
}

.ta-back svg {
  width: 15px;
  height: 15px;
}

.ta-plan-form {
  display: grid;
  gap: 17px;
  margin-top: 21px;
}

.ta-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ta-count,
.ta-field {
  display: block;
  color: var(--ta-ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.ta-count input,
.ta-field :is(input, select) {
  display: block;
  width: 100%;
  min-width: 0;
  height: 43px;
  margin-top: 5px;
  padding: 0 9px;
  border: 1px solid #a6b0a5;
  border-radius: 6px;
  background: #fff;
  color: var(--ta-ink);
  font-size: 16px;
  font-weight: 500;
}

.ta-count input {
  font-family: "JetBrains Mono", monospace;
}

.ta-field > span {
  margin-left: 3px;
  color: var(--ta-muted);
  font-size: 11px;
  font-weight: 500;
}

.ta-root .ta-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 8px 17px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--ta-green);
  color: white;
  font-size: 14px;
  font-weight: 700;
}

.ta-primary > span {
  font-size: 18px;
}

.ta-primary svg {
  width: 17px;
  height: 17px;
}

.ta-household {
  margin: 0;
  color: var(--ta-muted);
  font: 500 12px/1.6 "JetBrains Mono", monospace;
}

.ta-plan-actions {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.ta-summary {
  margin: 0;
}

.ta-summary dt {
  padding-top: 12px;
  border-top: 1px solid var(--ta-line);
  color: var(--ta-green);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.ta-summary dd {
  margin: 4px 0 14px;
}

.ta-summary dd:last-child {
  margin-bottom: 0;
}

.ta-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 600px) {
  .ta-launcher {
    bottom: max(12px, env(safe-area-inset-bottom));
    width: 243px;
    min-height: 55px;
    padding: 7px 10px;
    border-radius: 13px;
  }

  .ta-launch-copy strong { font-size: 14px; }
  .ta-launch-copy small { font-size: 11px; }
  .ta-launcher .ta-mark { width: 33px; height: 33px; }

  .ta-dialog {
    top: calc(var(--ta-viewport-top, 0px) + var(--ta-viewport-height, 100dvh) / 2);
    right: auto;
    bottom: auto;
    left: 50%;
    width: min(430px, calc(100% - 20px));
    max-height: calc(var(--ta-viewport-height, 100dvh) - 20px);
    margin: 0;
    transform: translate(-50%, -50%);
    border-radius: 15px;
  }

  .ta-head { padding: 11px 14px; }
  .ta-chat-scroll, .ta-plan { padding: 19px; }
  .ta-root .ta-choice, .ta-root .ta-edit { min-height: 44px; }
  .ta-compose { padding: 8px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .ta-root *,
  .ta-dialog[open] {
    animation: none;
    transition: none;
  }
}
