.estimate-float.btn {
  position: fixed;
  z-index: 20;
  inset-inline-end: max(16px, env(safe-area-inset-right));
  inset-block-end: max(16px, env(safe-area-inset-bottom));
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 10px 20px;
  background: #254dce;
  color: #fff;
  box-shadow: 0 4px 16px #0b173e44;
  font-size: .9rem;
  font-weight: 650;
}

.estimate-float.btn[hidden] { display: none; }
.estimate-float.btn:hover { background: #1b3da8; color: #fff; }

.btn.primary[data-estimate-open] { position: relative; }
.btn.primary[data-estimate-open], .estimate-float.btn { isolation: isolate; overflow: hidden; }

@media (prefers-reduced-motion: no-preference) {
  .btn.primary[data-estimate-open]::before, .estimate-float.btn::before {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
    inset: -55% auto -55% 0;
    width: 42%;
    opacity: 0;
    background: var(--glint-paint, linear-gradient(90deg, transparent, #fff9 50%, transparent));
    transform: translateX(-170%) skewX(-19deg);
    animation: price-glint 6s ease-in-out .95s infinite both;
  }

  @keyframes price-glint {
    0% { opacity: 0; transform: translateX(-170%) skewX(-19deg); }
    4%, 14% { opacity: var(--glint-opacity, .26); }
    20%, 100% { opacity: 0; transform: translateX(360%) skewX(-19deg); }
  }
}

@media (forced-colors: active) {
  .btn.primary[data-estimate-open]::before, .estimate-float.btn::before { display: none; }
}

.estimate-footer-cta .cta-tools { gap: 12px; }

.estimate-footer-cta .estimate-action {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  padding: 12px 20px;
  border-radius: 999px;
  background: #fff;
  color: #153697;
  font-weight: 650;
}

.estimate-footer-cta .estimate-action:hover { background: #edf3ff; }

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

.estimate-dialog {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 20px;
  width: min(590px,calc(100% - 20px));
  max-width: none;
  max-height: calc(100dvh - 20px);
  overflow: auto;
  overscroll-behavior: contain;
  scroll-padding-block: 12px;
  color: #202520;
  background: #f8f7f2;
  box-shadow: 0 24px 88px #101a2655;
}

.estimate-dialog::backdrop {
  background: #1318229c;
}

.estimate-dialog [hidden] {
  display: none!important;
}

.estimate-sheet {
  padding: clamp(12px,3vw,24px) clamp(14px,4vw,24px);
}

.estimate-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.estimate-dialog .estimate-top h2 {
  margin: 0;
  font-size: clamp(25px,4vw,34px);
  line-height: 1.06;
  outline: 0;
}

.estimate-close,.estimate-files button {
  display: grid;
  place-items: center;
  background: transparent;
  color: inherit;
  border: 0;
  cursor: pointer;
}

.estimate-close {
  width: 44px;
  height: 44px;
  flex: none;
  margin-inline-end: -6px;
  font-size: 1.7rem;
  line-height: 1;
}

.estimate-form {
  display: grid;
  gap: 8px 7px;
}

.estimate-file input {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.estimate-dialog :is(button,a,input,textarea,select,summary):focus-visible,.estimate-file:focus-within {
  outline: 3px solid #537ef1;
  outline-offset: 2px;
}

.estimate-field {
  display: grid;
  min-width: 0;
  gap: 3px;
  font-size: .88rem;
  line-height: 1.2;
  font-weight: 600;
}

.estimate-field :is(textarea,input,select) {
  border: 1px solid #bcc3bb;
  border-radius: 10px;
  min-height: 44px;
  padding: 7px 9px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.38;
  color: #202620;
  background: white;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.estimate-field textarea {
  resize: vertical;
  min-height: 52px;
  line-height: 1.16;
}

.estimate-field :is(input,textarea)::placeholder {
  color: #767676;
  opacity: 1;
  font-size: .9rem;
  font-weight: 350;
}

.estimate-reply {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.estimate-reply legend {
  padding: 0 0 4px;
  color: #254dce;
  font-weight: 600;
  font-size: .88rem;
  line-height: 1.25;
}

.estimate-reply-note {
  margin-inline-start: 4px;
  color: #666c65;
  font-size: .8rem;
  font-weight: 400;
}

.estimate-reply-fields {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 8px;
}

.estimate-photos small {
  color: #676c64;
  font-size: .78rem;
  line-height: 1.25;
}

.estimate-photos {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.estimate-photos:has(.estimate-files:not(:empty)) {
  display: grid;
  grid-template-columns: 54px auto minmax(0, 1fr);
}

.estimate-photos:has(.estimate-files:not(:empty)) small { grid-area: 1 / 3; }
.estimate-photos .estimate-files { grid-area: 1 / 2; }

.estimate-file {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 50px;
  flex: none;
  border: 1px solid #b9c6d5;
  border-radius: 11px;
  background: #f0f3f7;
  color: #34557b;
  font-size: .83rem;
  line-height: 1.25;
  cursor: pointer;
}

.estimate-file:focus-within { outline: 3px solid #537ef1; outline-offset: 2px; }

.estimate-file svg {
  width: 22px;
  height: 22px;
  flex: none;
}

.estimate-file:hover {
  border-color: #8dabc9;
  background: #e7edf4;
}

.estimate-files {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.estimate-files:empty,.estimate-error:empty {
  display: none;
}

.estimate-files li {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 50px;
  overflow: hidden;
  border: 1px solid #b9c6d5;
  border-radius: 9px;
  background: #e7edf4;
}

.estimate-files span {
  max-width: 100%;
  padding: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .65rem;
  align-self: end;
}

.estimate-files img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.estimate-files img[hidden] { display: none; }

.estimate-files button {
  position: absolute;
  inset-block-start: 1px;
  inset-inline-end: 1px;
  width: 24px;
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #222820df;
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
}

.estimate-files button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -3px;
}

.estimate-error {
  margin: 0;
  color: #95391e;
  font-size: .9rem;
}

.estimate-send {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 50px;
  gap: 8px;
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  background: #254dce;
  color: white;
  font-family: inherit;
  font-size: .88rem;
  line-height: 1.2;
  font-weight: 620;
  cursor: pointer;
  text-decoration: none;
}

.estimate-send:hover {
  background: #2044ba;
}

.estimate-send:disabled {
  opacity: .7;
  cursor: wait;
}

.estimate-actions {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  gap: 6px;
}

.estimate-tg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  padding: 8px 12px;
  border: 1px solid #a7c5dd;
  border-radius: 999px;
  background: #e6f1fa;
  color: #235478;
  font-family: inherit;
  font-size: .88rem;
  line-height: 1.2;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  box-sizing: border-box;
}

.estimate-actions svg {
  width: 17px;
  height: 17px;
  flex: none;
}

.estimate-tg:hover {
  background: #d9eaf7;
  border-color: #86b0d1;
}

.estimate-tg:active {
  background: #cfe5f5;
}

.estimate-form [hidden], .offer-form [hidden] {
  display: none !important;
}

.estimate-messengers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.estimate-messengers .estimate-tg {
  min-height: 44px;
  padding-inline: 5px;
  gap: 5px;
  font-size: .82rem;
  white-space: nowrap;
}

.estimate-messengers svg {
  width: 16px;
  height: 16px;
  flex: none;
}

@media (max-width: 359px) {
  .estimate-messengers .estimate-tg {
    flex-direction: column;
    gap: 3px;
    padding-block: 4px;
  }
}

@media (max-width: 420px) {
  .estimate-dialog .estimate-extra-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .estimate-extra-fields label[for^="estimate-model"] {
    grid-column: 1 / -1;
  }
}

.estimate-done p {
  margin-bottom: 18px;
}

.estimate-extra-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.estimate-extra-fields .estimate-field {
  grid-template-rows: 1fr auto;
}

#estimate-repair {
  appearance: none;
  padding-inline-end: 1.45rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%23202620' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 0.6rem center;
  background-repeat: no-repeat;
  background-size: 0.75rem;
}

@media (forced-colors: active) {
  #estimate-repair { appearance: auto; padding-inline-end: 9px; background-image: none; }
}

@media (min-width: 580px) {
  .estimate-extra-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.estimate-consent {
  text-align: center;
  font-size: .8rem;
  line-height: 1.5;
}

.estimate-consent input {
  width: 18px;
  height: 18px;
  margin: 0 0.25em 0 0;
  vertical-align: middle;
  accent-color: #254dce;
}

.estimate-consent label { cursor: pointer; }

.estimate-consent-links {
  display: inline-flex;
  column-gap: 0.6em;
  margin-inline-start: 0.4em;
}

.estimate-consent a {
  display: inline-block;
  align-content: center;
  min-height: 24px;
  color: #235478;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.estimate-dialog [aria-invalid="true"] {
  border-color: #95391e;
}

@media (max-height: 780px) {
  .estimate-dialog { max-height: calc(100dvh - 8px); }

  .estimate-sheet {
    padding-block: 6px;
  }

  .estimate-top { margin-bottom: 0; }
  .estimate-form { row-gap: 4px; }
  .estimate-actions { row-gap: 4px; }
  .estimate-extra-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 5px; }
  .estimate-field :is(input, select) { padding-block: 4px; }
  .estimate-field textarea { min-height: 46px; }
}

