/* Результат остаётся поверх карты и имеет три высоты. Правила, напротив,
   являются полноценным разделом приложения, а не модалкой со статьёй. */
@media (max-width: 760px) {
  #mobile-result {
    position: fixed;
    z-index: 1400;
    right: 8px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    left: 8px;
    display: block;
    height: var(--sheet-height, min(58dvh, 492px));
    max-height: calc(100dvh - 92px);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow-sheet);
    transition: height .28s cubic-bezier(.2, .8, .25, 1);
  }

  #mobile-result[hidden] {
    display: none;
  }

  #mobile-result.is-dragging {
    transition: none;
    user-select: none;
  }

  #mobile-result-grabber {
    position: absolute;
    z-index: 8;
    top: 0;
    left: 50%;
    width: 92px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    cursor: ns-resize;
    touch-action: none;
    transform: translateX(-50%);
  }

  #mobile-result-grabber span {
    width: 40px;
    height: 4px;
    border-radius: var(--radius-pill);
    background: var(--line-strong);
  }

  #mobile-result-close {
    position: absolute;
    z-index: 9;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
  }

  #mobile-result-scroll {
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: auto;
  }

  #mobile-result .v-status {
    position: sticky;
    z-index: 6;
    top: 0;
    min-height: 64px;
    padding: 27px 58px 10px 16px;
    border-bottom: 1px solid color-mix(in srgb, currentColor 12%, transparent);
  }

  #mobile-result .v-status::before {
    width: 12px;
    height: 12px;
    border: 3px solid rgb(255 255 255 / 72%);
    box-shadow: 0 0 0 1px currentColor;
  }

  .v-status-copy {
    display: grid;
    gap: 1px;
  }

  #mobile-result .risk-mark {
    font-size: 10px;
    letter-spacing: .1em;
  }

  #mobile-result .v-status-caption {
    font-size: 12px;
    font-weight: 620;
  }

  #mobile-result .v-body {
    display: flex;
    flex-direction: column;
    padding: 14px 16px 22px;
  }

  #mobile-result .v-head {
    order: 10;
    padding-right: 2px;
    font-size: 18px;
    font-weight: 720;
    letter-spacing: -.02em;
  }

  #mobile-result .v-text {
    order: 20;
    margin-top: 4px;
    color: var(--ink-soft);
    font-size: 13.5px;
  }

  #mobile-result .v-zone-chips {
    order: 30;
    gap: 5px;
    margin-top: 10px;
  }

  #mobile-result .v-zone-chip {
    padding: 3px 4px;
  }

  #mobile-result .v-zone-chip-name {
    display: none;
  }

  #mobile-result .v-zone-chip-count {
    padding-right: 6px;
  }

  #mobile-result .v-actions {
    order: 40;
    margin-top: 12px;
  }

  #mobile-result .v-zones {
    order: 50;
    margin-top: 12px;
    overflow: hidden;
    border-radius: 14px;
  }

  #mobile-result .v-point {
    order: 60;
    min-height: 44px;
    margin-top: 12px;
    padding: 6px 6px 6px 11px;
    border-radius: 12px;
    background: var(--tint);
  }

  #mobile-result .v-actions-secondary {
    order: 70;
  }

  #mobile-result .v-coverage {
    order: 80;
    margin-top: 12px;
  }

  #mobile-result .official-check {
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--accent-bg);
    color: var(--accent-ink);
    font-weight: 720;
  }

  #mobile-result .official-check-secondary {
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--ink-soft);
  }

  #mobile-result .share-point {
    min-height: 34px;
    border: 0;
    border-radius: 10px;
    background: var(--accent-bg);
    color: var(--accent-ink);
  }

  .v-zones-heading {
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    background: var(--tint);
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 760;
    letter-spacing: .07em;
    text-transform: uppercase;
  }

  #mobile-result .v-zone {
    padding: 11px 12px;
  }

  #modal {
    z-index: 1500;
    display: block;
    padding: 0 0 calc(70px + env(safe-area-inset-bottom));
    background: var(--canvas);
    backdrop-filter: none;
  }

  #modal[hidden] {
    display: none;
  }

  #modal-box {
    width: 100%;
    max-width: none;
    height: calc(100dvh - 70px - env(safe-area-inset-bottom));
    max-height: none;
    padding: calc(12px + env(safe-area-inset-top)) 16px 28px;
    border: 0;
    border-radius: 0;
    background: var(--canvas);
    box-shadow: none;
  }

  #modal-close {
    position: absolute;
    z-index: 2;
    top: calc(10px + env(safe-area-inset-top));
    left: 12px;
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  #modal-box h2 {
    min-height: 44px;
    margin: 0 0 3px;
    padding: 7px 44px 5px 52px;
    color: var(--ink);
    font-size: 20px;
    font-weight: 720;
    letter-spacing: -.02em;
  }

  #modal-box > .tag {
    margin: 4px 4px 14px;
    font-size: 13px;
    line-height: 1.48;
  }

  .rules-highlights {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0 0 10px;
  }

  .rules-highlights > div {
    min-height: 82px;
    padding: 12px;
    border-radius: 15px;
  }

  .rules-highlights b {
    font-size: 15px;
  }

  .rules-highlights span {
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.35;
  }

  .rule-section {
    margin-top: 8px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--surface);
  }

  .rule-section > summary {
    min-height: 54px;
    padding: 14px 42px 14px 15px;
    font-size: 15px;
    font-weight: 680;
  }

  .rule-section > summary::after {
    right: 18px;
  }

  .rule-section > p,
  .rule-section > ul {
    padding-right: 15px;
    padding-left: 15px;
  }

  .rule-section > ul {
    padding-left: 34px;
  }

  .rule-section > p:last-child,
  .rule-section > ul:last-child {
    padding-bottom: 16px;
  }

  #modal-box .rule-section p,
  #modal-box .rule-section li {
    font-size: 14px;
    line-height: 1.55;
  }
}

@media (max-width: 380px) {
  #mobile-result {
    right: 5px;
    left: 5px;
  }

  .rules-highlights {
    grid-template-columns: 1fr;
  }

  .rules-highlights > div {
    min-height: 66px;
  }
}
