.sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--overlay);
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  max-width: 540px;
  max-height: 92vh;
  /* dvh учитывает адресную строку мобильного браузера — без него низ панели
     с кнопкой звонка уезжает под UI браузера. */
  max-height: 92dvh;
  margin: auto;
  padding: 22px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel-title {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 23px;
  line-height: 1.2;
}

.panel-spec { font-size: 14px; color: var(--fg-3); }

.panel-grab { display: none; }

.breakdown { border-top: 1px solid var(--line-card); padding-top: 12px; }

.breakdown summary {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 700;
  color: var(--fg-2);
  cursor: pointer;
  list-style: none;
}

.breakdown summary::-webkit-details-marker { display: none; }

.breakdown summary::after {
  content: '▾';
  font-size: 12px;
  color: var(--fg-3);
}

.breakdown[open] summary::after { content: '▴'; }

.icon-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: transparent;
  cursor: pointer;
}

.field { display: flex; flex-direction: column; gap: 8px; }

.field > span,
.field > label { font-size: 14px; font-weight: 700; color: var(--fg-2); }

.seg { display: flex; gap: 8px; }

.seg button {
  flex: 1;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: transparent;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}

.seg button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.bid {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg);
}

.bid-currency { color: var(--fg-3); font-weight: 700; }

.bid input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 18px;
  font-weight: 700;
  outline: none;
}

.rows { display: flex; flex-direction: column; }

.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-card);
  font-size: 15px;
}

.row span:first-child { min-width: 0; color: var(--fg-2); }
.row span:last-child { font-weight: 700; white-space: nowrap; }

.row-group {
  padding: 14px 0 2px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.total {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border-radius: 16px;
  background: var(--accent-soft);
}

.total small { font-size: 14px; color: var(--accent-soft-fg); }

.total b {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 36px;
  line-height: 1.1;
  color: var(--accent);
}

.total p { margin: 0; font-size: 15px; color: var(--accent-soft-fg); }

.warnbox {
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--warn-soft);
  color: var(--warn-fg);
  font-size: 14px;
}

.contacts { display: flex; flex-direction: column; gap: 10px; }

.contacts-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.fine { margin: 0; font-size: 13px; color: var(--fg-3); text-align: center; }

@media (max-width: 719px) {
  /* Полноценная нижняя шторка: прижата к низу, скругление только сверху. */
  .sheet { padding: 0; }

  .panel {
    max-width: none;
    margin: 0;
    padding: 10px 16px calc(18px + env(safe-area-inset-bottom, 0px));
    gap: 16px;
    border-bottom: 0;
    border-radius: 22px 22px 0 0;
    translate: 0 100%;
    transition: translate .22s ease-out;
  }

  .sheet.is-open .panel { translate: 0 0; }

  .panel-grab {
    display: block;
    flex: none;
    width: 36px;
    height: 4px;
    margin: 0 auto 2px;
    border-radius: 999px;
    background: var(--line-hover);
  }

  .panel-title { font-size: 20px; }
  .total { padding: 16px; }
  .total b { font-size: 31px; }

  .row { padding: 7px 0; font-size: 14px; }
  .seg button { font-size: 14px; padding: 0 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .panel { transition: none; }
}
