
.tu-chrome-rail,
.tu-chrome-widget,
.tu-chrome-exit {
  box-sizing: border-box;
  font-family: var(--font-heading, var(--font-body, system-ui, -apple-system, sans-serif));
}
.tu-chrome-rail *,
.tu-chrome-widget *,
.tu-chrome-exit * {
  box-sizing: inherit;
}

/* --------------------------------------------------------------- rail --- */

.tu-chrome-rail {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 170;
  display: grid;
  gap: 10px;
  padding: 6px;
  border-radius: 44px;
  background: var(--color-surface, #fff);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.12);
}
.tu-chrome-rail__item {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Never the accent chain: on an unbranded site the accent can resolve to
     the same tone as this background, which hides the icon completely. */
  background: var(--color-dark, #222);
  color: #fff;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease;
}
.tu-chrome-rail__item svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}
.tu-chrome-rail__item:hover {
  transform: scale(1.08);
  background: var(--color-accent, #f7941d);
}
@media (max-width: 820px) {
  .tu-chrome-rail { display: none; }
}

/* ------------------------------------------------------------- widget --- */

.tu-chrome-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100010;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.tu-chrome-widget > * { pointer-events: auto; }
.tu-chrome-widget__toggle,
.tu-chrome-widget__call {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  border: none;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.tu-chrome-widget__toggle {
  background: var(--color-dark, #222);
  color: #fff;
}
.tu-chrome-widget__call {
  background: var(--color-accent, #f7941d);
  color: #fff;
}
.tu-chrome-widget__icon {
  width: 20px;
  height: 20px;
  flex: none;
}
@media (min-width: 601px) {
  .tu-chrome-widget__call { display: none; }
}
@media (max-width: 600px) {
  .tu-chrome-widget {
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    gap: 8px;
  }
  /*
    Two pills share one narrow row. A flex grow factor alone is not enough:
    a flex item defaults to min-width auto, so it refuses to shrink below its
    own text and the pair pushes past the viewport on a 390px phone. Setting
    min-width to 0, plus an ellipsis on the label, lets them divide the row.
  */
  .tu-chrome-widget__call,
  .tu-chrome-widget__toggle {
    flex: 1 1 0;
    min-width: 0;
    padding: 12px 14px;
  }
  .tu-chrome-widget__call span,
  .tu-chrome-widget__toggle span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.tu-chrome-widget__panel {
  position: fixed;
  right: 20px;
  bottom: 84px;
  z-index: 100020;
  width: min(384px, 100vw - 2rem);
  max-height: min(640px, 85vh);
  overflow-y: auto;
  padding: 20px;
  border-radius: 18px;
  background: var(--color-surface, #fff);
  color: var(--color-text, #1a1a1a);
  box-shadow: 0 25px 60px -20px rgba(0, 0, 0, 0.45);
}
.tu-chrome-widget__panel[hidden] { display: none; }
@media (max-width: 600px) {
  .tu-chrome-widget__panel {
    left: 12px;
    right: 12px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    width: auto;
  }
}
.tu-chrome-widget__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-right: 28px;
}
.tu-chrome-widget__logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: contain;
}
.tu-chrome-widget__title {
  font-weight: 700;
  line-height: 1.2;
}
.tu-chrome-widget__badge {
  display: inline-block;
  margin-top: 2px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #d9f4e4;
  color: #157f4a;
}
.tu-chrome-widget__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

/* --------------------------------------------------------------- exit --- */

.tu-chrome-exit {
  position: fixed;
  inset: 0;
  z-index: 250;
  padding: 20px;
  background: rgba(15, 12, 10, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.tu-chrome-exit.is-open {
  opacity: 1;
  pointer-events: auto;
}
.tu-chrome-exit[hidden] { display: none; }
.tu-chrome-exit__card {
  position: relative;
  width: min(520px, 100%);
  padding: 28px 28px 24px;
  border-radius: 18px;
  background: var(--color-surface, #fff);
  color: var(--color-text, #1a1a1a);
  box-shadow: 0 25px 60px -20px rgba(0, 0, 0, 0.45);
  transform: translateY(14px);
  transition: transform 0.25s ease;
}
.tu-chrome-exit.is-open .tu-chrome-exit__card { transform: none; }
.tu-chrome-exit__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.tu-chrome-exit__badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #d9f4e4;
  color: #157f4a;
}
.tu-chrome-exit__title {
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 700;
  line-height: 1.25;
}
.tu-chrome-exit__text {
  margin: 0 0 20px;
  line-height: 1.55;
}
.tu-chrome-exit__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tu-chrome-exit__cta,
.tu-chrome-exit__phone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 20px;
  border: none;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.tu-chrome-exit__cta {
  background: var(--color-dark, #222);
  color: #fff;
}
.tu-chrome-exit__phone {
  background: rgba(0, 0, 0, 0.06);
  color: inherit;
}
.tu-chrome-exit__dismiss {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 8px;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 14px;
  opacity: 0.7;
  text-decoration: underline;
  cursor: pointer;
}

/* ------------------------------------------------------- widget form --- */

.tu-chrome-widget__form {
  display: grid;
  gap: 10px;
}
.tu-chrome-widget__field {
  display: grid;
  gap: 4px;
}
.tu-chrome-widget__field[hidden] {
  display: none;
}
.tu-chrome-widget__field label,
.tu-chrome-widget__choice legend {
  font-size: 13px;
  font-weight: 600;
}
.tu-chrome-widget__choice {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.tu-chrome-widget__choice legend {
  padding: 0;
  margin-bottom: 4px;
}
.tu-chrome-widget__field .tu-chrome-widget__option {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 400;
}
.tu-chrome-widget__field input:not([type="radio"]),
.tu-chrome-widget__field select,
.tu-chrome-widget__field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 10px;
  font: inherit;
  background: #fff;
  color: inherit;
}
.tu-chrome-widget__field textarea {
  min-height: 88px;
  resize: vertical;
}
.tu-chrome-widget__submit {
  min-height: 44px;
  padding: 12px 18px;
  border: none;
  border-radius: 999px;
  background: var(--color-dark, #222);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.tu-chrome-widget__submit[disabled] {
  opacity: 0.6;
  cursor: progress;
}
.tu-chrome-widget__status:empty { display: none; }
.tu-chrome-widget__status {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}
.tu-chrome-widget__status[data-state="error"] { color: #b3261e; }
.tu-chrome-widget__status[data-state="success"] { color: #157f4a; }
