/* «Сопоставление» (#/mapping): only what is specific to this screen; tokens, buttons, chips, badges come from styles.css. */
.map-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); margin-bottom: var(--s3); }
.map-title { display: flex; align-items: baseline; gap: var(--s3); margin-right: auto; }
.map-left { font-size: var(--fs-sm); color: var(--muted); }
.map-left b { color: var(--fg); font-size: var(--fs-lg); }
.map-brand { width: auto; min-width: 160px; height: var(--ctl-sm); font-size: 14px; }
.map-dry { margin: 0 0 var(--s3); padding: 6px var(--s3); border: 1px solid var(--warn); background: var(--warn-bg); color: var(--warn); font-size: var(--fs-sm); font-weight: 600; }

.map-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
.map-photos { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.map-ph { margin: 0; display: grid; gap: 4px; align-content: start; min-width: 0; }
.map-img { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1; max-height: 46vh; padding: 0; border: 1px solid var(--border); background: var(--card); overflow: hidden; cursor: zoom-in; }
.map-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.map-img.none { background: var(--soft); cursor: default; color: var(--muted); font-size: var(--fs-sm); padding: var(--s3); text-align: center; }
.map-ph figcaption { font-size: 12px; color: var(--muted); line-height: 1.35; min-height: 32px; overflow-wrap: anywhere; }
.map-ph figcaption b { color: var(--fg); font-weight: 700; }
.map-ph figcaption .link { min-height: 0; padding: 0; font-size: 12px; }

.map-info { display: grid; gap: var(--s2); align-content: start; min-width: 0; }
.map-name { margin: 0; font-size: var(--fs-lg); line-height: 1.3; overflow-wrap: anywhere; }
.map-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s3); font-size: var(--fs-sm); color: var(--muted); }
.map-meta b { color: var(--fg); }
.map-reason { margin: 0; font-size: var(--fs-sm); line-height: 1.4; }
.map-warn { margin: 0; padding: 6px var(--s3); border: 1px solid var(--warn); background: var(--warn-bg); font-size: var(--fs-sm); line-height: 1.4; }
.map-old { margin: 0; font-size: 12px; color: var(--muted); }

.map-picks { display: grid; grid-template-columns: 1fr; gap: var(--s2); }
.map-pick { display: grid; gap: 2px; width: 100%; min-height: 54px; padding: 6px var(--s3) 7px; border: 1px solid var(--border); background: var(--card); text-align: left; position: relative; }
.map-pick::after { content: '▾'; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--muted); }
.map-pick:hover { border-color: var(--fg); }
.map-pick.was { border-color: var(--primary); background: var(--primary-bg); }
.map-pick.bad { border-color: var(--bad); background: var(--bad-bg); }
.map-pl { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.map-pl i { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--primary); }
.map-pv { font-size: 14px; font-weight: 600; line-height: 1.25; padding-right: 18px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.map-pv.none { color: var(--muted); font-weight: 400; }
kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px; border: 1px solid currentColor; border-radius: 3px; font: 600 11px/1 'Manrope', sans-serif; opacity: .65; text-transform: none; letter-spacing: 0; }

.map-bar { display: grid; gap: var(--s2); }
.map-acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.map-acts .btn { width: auto; flex: 0 0 auto; padding: 0 var(--s5); }
.map-acts .map-go { min-width: 220px; }
.map-iss { margin: 0; }
.map-keys { margin: 0; font-size: 12px; color: var(--muted); }
.map-rv-p { display: none; justify-self: start; }
.map-missing { grid-column: 1 / -1; display: grid; gap: var(--s2); max-width: 560px; padding: var(--s3); border: 1px solid var(--border); background: var(--card); }
.map-missing .row.auto { display: flex; gap: var(--s2); }
.map-missing .row.auto .btn { width: auto; }

/* dropdown: a popover under the field on a desktop, a full-screen sheet on a phone */
.map-back { position: fixed; inset: 0; z-index: 110; background: rgba(20, 22, 26, .25); }
.map-pop { position: fixed; z-index: 111; display: grid; grid-template-rows: auto auto minmax(0, 1fr); background: var(--card); border: 1px solid var(--fg); box-shadow: none; }
.map-pop-h { display: none; align-items: center; justify-content: space-between; padding: 0 var(--s3); min-height: 44px; border-bottom: 1px solid var(--border); }
.map-q { border: 0; border-bottom: 1px solid var(--border); }
.map-opts { list-style: none; margin: 0; padding: 0; overflow: auto; overscroll-behavior: contain; }
.map-opt { display: flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 4px var(--s3); border-bottom: 1px solid var(--soft); cursor: pointer; }
.map-opt.act { background: var(--primary-bg); }
.map-opt.cur .map-ot b::before { content: '✓ '; color: var(--ok); }
.map-ot { display: grid; flex: 1; min-width: 0; line-height: 1.25; }
.map-ot b { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.map-ot small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.map-th { flex: none; width: 40px; height: 40px; border: 1px solid var(--border); background: var(--soft); overflow: hidden; }
.map-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.map-th.empty { border-style: dashed; }
.map-more { padding: var(--s3); font-size: var(--fs-sm); color: var(--muted); }
.map-zoom { position: fixed; z-index: 130; width: 280px; height: 280px; border: 1px solid var(--fg); background: var(--card); pointer-events: none; }
.map-zoom img { width: 100%; height: 100%; object-fit: contain; display: block; }

.map-lb { position: fixed; inset: 0; z-index: 140; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s2); padding: var(--s4); background: rgba(20, 22, 26, .88); cursor: zoom-out; }
.map-lb img { max-width: 100%; max-height: calc(100vh - 80px); object-fit: contain; background: #fff; }
.map-lb p { margin: 0; color: #fff; font-size: var(--fs-sm); text-align: center; }

.map-toast { position: fixed; z-index: 120; left: 50%; bottom: calc(var(--s4) + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: var(--s4); max-width: calc(100vw - 24px); padding: 8px var(--s3) 8px var(--s4); background: var(--fg); color: var(--bg); font-size: var(--fs-sm); font-weight: 600; }
.map-toast button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 var(--s3); border: 1px solid currentColor; background: none; color: inherit; font: inherit; font-weight: 700; }

@media (min-width: 1000px) {
  .map-card { grid-template-columns: minmax(0, 780px) minmax(0, 1fr); align-items: start; }
  .map-picks { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .map-bar { grid-column: 1 / -1; }
}
@media (min-width: 701px) and (max-width: 999px) {
  .map-picks { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .map-top { gap: var(--s2); margin-bottom: var(--s2); }
  .map-title h1 { font-size: 18px; }
  .map-top .chip { min-height: 34px; padding: 0 8px; font-size: 12.5px; gap: 5px; }
  .map-top .chips { gap: 6px; }
  .map-brand { width: 100%; height: 38px; }
  .map-dry { margin-bottom: var(--s2); }
  .map-card { gap: var(--s2); }
  /* phone order: name, photos, why, pickers, buttons (the info block dissolves into the grid) */
  .map-info { display: contents; }
  .map-name { order: 0; font-size: var(--fs-md); }
  .map-meta { order: 1; }
  .map-photos { order: 2; }
  .map-info > p { order: 3; }
  .map-picks { order: 4; grid-template-columns: 1fr 1fr; }
  .map-rv-p { display: block; order: 4; min-height: 32px; padding: 0; }
  .map-rv-d { display: none; }
  .map-bar { order: 5; }
  .map-missing { order: 6; }
  .map-img { max-height: none; }
  .map-pick { min-height: 58px; padding: 5px 10px 6px; }
  .map-pv { font-size: 13px; padding-right: 14px; }
  .map-pop { inset: 0; width: auto !important; max-height: none !important; border: 0; }
  .map-pop-h { display: flex; }
  .map-opt { min-height: 52px; }
  .map-bar { position: sticky; bottom: 0; z-index: 20; margin: 0 calc(-1 * var(--pad)); padding: var(--s2) var(--pad) calc(var(--s2) + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--border); }
  .map-acts { gap: 6px; }
  .map-acts .btn { flex: 1 1 auto; padding: 0 var(--s3); min-height: 44px; }
  .map-acts .map-go { flex: 1 1 100%; min-width: 0; min-height: 50px; font-size: 16px; }
  .map-toast { bottom: calc(140px + env(safe-area-inset-bottom)); }
}

/* stones from our stone accounting (owner 28.10.2026) */
.map-stones { margin: 4px 0; font-size: var(--fs-sm, 14px); }
.map-stones b { font-weight: 700; }
.map-stones.none { color: var(--muted, #777); }
