/* Інтерактивна схема зв'язків. Без зовнішніх ресурсів; шрифт Inter — з /assets/fonts/. */
@font-face {
  font-family: "Inter";
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/Inter_400Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Inter";
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/Inter_500Medium.ttf") format("truetype");
}
@font-face {
  font-family: "Inter";
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/Inter_600SemiBold.ttf") format("truetype");
}
@font-face {
  font-family: "Inter";
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/Inter_700Bold.ttf") format("truetype");
}
@font-face {
  font-family: "Inter";
  font-weight: 800;
  font-display: swap;
  src: url("/assets/fonts/Inter_800ExtraBold.ttf") format("truetype");
}

:root {
  --ink: #111827;
  --muted: #4b5563;
  --soft: #9ca3af;
  --line: #d9dee7;
  --line-soft: #e8ecf2;
  --bg: #f4f6f9;
  --panel: #fff;
  --accent: #3b4f8a;
  --accent-soft: #eef1f9;
  --red: #b91c1c;
  --orange: #d97706;
  --grey: #6b7280;
  --green: #3a8a5c;
  --amber: #f59e0b;
  --shadow: 0 8px 28px rgba(15, 23, 42, 0.14);
  --r: 6px;
  --c-subord: #3b4f8a;
  --c-money: #3a8a5c;
  --c-infra: #4a86b5;
  --c-legal: #7d65a8;
  --c-office: #a87443;
  --c-comm: #3d8580;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
}
body {
  font-family:
    Inter,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  overflow-wrap: anywhere;
}
body.app {
  overflow: hidden;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
h1,
h2,
h3,
h4,
p {
  margin: 0;
}
a {
  color: var(--accent);
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── кнопки й поля ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--r);
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
  text-decoration: none;
  color: var(--ink);
}
.btn:hover {
  background: #f1f4f9;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover {
  background: #2f4073;
}
.btn.ghost {
  border-color: transparent;
  background: transparent;
}
.btn.ghost:hover {
  background: #eef1f6;
}
.btn.small {
  min-height: 28px;
  padding: 3px 9px;
  font-size: 12px;
}
.btn.danger {
  color: var(--red);
  border-color: #e7c1c1;
}
.btn[disabled] {
  opacity: 0.5;
  cursor: default;
}
.badge-n {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  font-weight: 700;
}
input[type="text"],
input[type="password"],
input[type="search"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #fff;
}
textarea {
  min-height: 110px;
  resize: vertical;
}
label.field {
  display: block;
  margin: 0 0 12px;
}
label.field > span.lbl {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}
.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.grow {
  flex: 1 1 auto;
  min-width: 0;
}
.muted {
  color: var(--muted);
}
.soft {
  color: var(--soft);
}
.small {
  font-size: 12px;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
.err {
  color: var(--red);
  font-size: 13px;
  margin: 6px 0;
}
.ok {
  color: var(--green);
}

/* ── каркас сторінки ── */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}
#top {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 8px 14px;
  z-index: 30;
  position: relative;
}
.top-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.top-title {
  min-width: 0;
  flex: 0 1 auto;
  margin-right: 6px;
}
.top-title h1 {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}
.top-title .kp {
  font-size: 12px;
  color: var(--muted);
}
.top-fabula {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 6px;
  max-width: 1100px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.top-spacer {
  flex: 1 1 20px;
}
.search-wrap {
  position: relative;
  flex: 1 1 280px;
  max-width: 420px;
  min-width: 0;
}
.results {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  max-height: 55vh;
  overflow: auto;
  z-index: 40;
}
.results button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  padding: 8px 12px;
  cursor: pointer;
  min-height: 44px;
}
.results button:hover,
.results button.sel {
  background: var(--accent-soft);
}
.results .t {
  font-weight: 600;
}
.results .s {
  font-size: 12px;
  color: var(--muted);
}
.results .none {
  padding: 10px 12px;
  color: var(--muted);
}
.pop {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 12px;
  min-width: 260px;
  z-index: 45;
}
.pop .item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 2px;
  cursor: pointer;
  min-height: 32px;
}
.pop button.item {
  width: 100%;
  background: none;
  border: 0;
  text-align: left;
  border-radius: 4px;
  padding: 8px 8px;
}
.pop button.item:hover {
  background: #eef1f6;
}
.pop hr {
  border: 0;
  border-top: 1px solid var(--line-soft);
  margin: 8px 0;
}
.pop h4 {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 2px 0 6px;
}
.swatch {
  display: inline-block;
  width: 22px;
  height: 0;
  border-top: 3px solid currentColor;
  flex: none;
}
.swatch.dashed {
  border-top-style: dashed;
}
.rel {
  position: relative;
}

#main {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
#stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  background: #e6eaf0;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
#stage.grabbing {
  cursor: grabbing;
}
#stage svg.scheme {
  display: block;
  width: 100%;
  height: 100%;
}
#stage .loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.zoom {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
}
.zoom .btn {
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 18px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}
.hint-bar {
  position: absolute;
  left: 64px;
  bottom: 12px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.85);
  padding: 4px 8px;
  border-radius: 4px;
  z-index: 10;
  pointer-events: none;
}

/* SVG схеми */
.scheme text {
  font-family: Inter, sans-serif;
}
.scheme .card,
.scheme .plate,
.scheme .pill,
.scheme .group,
.scheme .region,
.scheme .edge-hit,
.scheme [data-co] {
  cursor: pointer;
}
.scheme .edge-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 4;
  pointer-events: stroke;
}
.scheme .card,
.scheme .plate,
.scheme .pill,
.scheme .edge,
.scheme .group,
.scheme .region,
.scheme .tag {
  transition: opacity 0.15s;
}
.scheme .dim,
.scheme .fdim {
  opacity: 0.14;
}
.scheme .fdim {
  pointer-events: none;
}
.scheme .match {
  filter: drop-shadow(0 0 2.5px #f59e0b) drop-shadow(0 0 1px #f59e0b);
}
.scheme .sel-obj {
  filter: drop-shadow(0 0 3px #3b4f8a) drop-shadow(0 0 1px #3b4f8a);
}
.scheme .edge.hl {
  stroke-width: 1.1;
}
.scheme.off-subord [data-cat="subord"],
.scheme.off-money [data-cat="money"],
.scheme.off-infra [data-cat="infra"],
.scheme.off-legal [data-cat="legal"],
.scheme.off-office [data-cat="office"],
.scheme.off-comm [data-cat="comm"] {
  display: none;
}

/* ── бічна картка / шторка ── */
.side {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 410px;
  max-width: 100%;
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translateX(102%);
  transition: transform 0.2s ease;
  z-index: 20;
  display: flex;
  flex-direction: column;
  visibility: hidden;
}
.side.open {
  transform: none;
  visibility: visible;
}
.side-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  flex: none;
}
.side-head .ttl {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  flex: 1;
}
.side-body {
  overflow: auto;
  padding: 14px 16px 18px;
  flex: 1 1 auto;
  -webkit-overflow-scrolling: touch;
}
.grab {
  display: none;
}
.card-top {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.photo {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border: 1px solid var(--line);
  display: block;
  flex: none;
  background: #e5e7eb;
}
.photo.ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--grey);
  font-weight: 700;
  font-size: 26px;
}
.photo.ph small {
  font-size: 10px;
  font-weight: 500;
}
.card-top h2 {
  font-size: 17px;
  line-height: 1.25;
  font-weight: 700;
}
.kv {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
}
.kv b {
  color: var(--ink);
  font-weight: 600;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 8px 0;
}
.tag-b {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--grey);
}
.tag-b.searched {
  background: var(--red);
}
.tag-b.planned {
  background: #fff;
  color: var(--orange);
  border: 1px dashed var(--orange);
}
.tag-b.nominee {
  background: var(--grey);
}
.tag-b.organizer {
  background: #1f2937;
}
.tag-b.abroad {
  background: #f8fafc;
  color: #1e3a8a;
  border: 1px solid #94a3b8;
  font-weight: 600;
}
.tag-b.loc-ua {
  /* прапор: синій угорі плавно переходить у жовтий; текст — на жовтій частині */
  background: linear-gradient(180deg, #0057b7 0 38%, #ffd700 56% 100%);
  color: #0b2e6b;
  font-weight: 800;
  padding: 10px 10px 3px;
}
.tag-b.loc-abroad {
  background: #5b21b6;
  color: #fff;
}
.tag-b.loc-unknown {
  background: #f3f4f6;
  color: #4b5563;
  border: 1px dashed #9ca3af;
}
.tag-b.warn {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid var(--amber);
  font-weight: 600;
}
.tag-b.plain {
  background: #f1f5f9;
  color: var(--muted);
  font-weight: 600;
}
.tag-b.note {
  background: #f1f5f9;
  color: var(--muted);
  font-weight: 600;
}
.sec {
  margin-top: 14px;
}
.sec h3 {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 700;
}
.sec p {
  margin: 0 0 6px;
}
.ids {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 10px;
  font-size: 13px;
}
.ids dt {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.ids dd {
  margin: 0;
}
ul.plain {
  list-style: none;
  margin: 0;
  padding: 0;
}
ul.plain li {
  padding: 5px 0;
  border-bottom: 1px solid var(--line-soft);
}
ul.plain li:last-child {
  border-bottom: 0;
}
.linkbtn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: rgba(59, 79, 138, 0.35);
}
.linkbtn:hover {
  text-decoration-color: currentColor;
}
.rel-line {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.rel-dot {
  flex: none;
  width: 12px;
  height: 0;
  border-top: 3px solid currentColor;
  margin-top: 9px;
}
.rel-dot.dashed {
  border-top-style: dashed;
}
details.fold {
  margin-top: 12px;
  border-top: 1px solid var(--line-soft);
  padding-top: 8px;
}
details.fold > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--accent);
  list-style: none;
  min-height: 28px;
  display: flex;
  align-items: center;
}
details.fold > summary::-webkit-details-marker {
  display: none;
}
details.fold > summary::before {
  content: "▸";
  margin-right: 6px;
  font-size: 11px;
}
details.fold[open] > summary::before {
  content: "▾";
}
details.fold .inner {
  padding-top: 6px;
}
.srcs {
  font-size: 12px;
  color: var(--muted);
  white-space: pre-wrap;
}
.srcs li {
  margin-bottom: 6px;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.co-head {
  display: flex;
  gap: 12px;
  align-items: center;
}
.co-logo {
  max-width: 120px;
  max-height: 48px;
  object-fit: contain;
  display: block;
}
.chain {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  margin-top: 10px;
}
.chain dt {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 2px;
}
.chain dd {
  margin: 0;
}
.req {
  border-left: 3px solid var(--line);
  padding: 2px 0 2px 10px;
  margin: 0 0 8px;
  font-size: 13px;
}
.req .d {
  font-size: 12px;
  color: var(--muted);
}
.filter-in {
  margin: 6px 0 8px;
}
.dot-new {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--red);
  margin-right: 4px;
  border-radius: 2px;
}

/* ── обговорення ── */
.drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 100%;
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translateX(102%);
  transition: transform 0.2s ease;
  z-index: 35;
  display: flex;
  flex-direction: column;
  visibility: hidden;
}
.drawer.open {
  transform: none;
  visibility: visible;
}
.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.tab {
  background: none;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 4px 11px;
  cursor: pointer;
  font-size: 12.5px;
  min-height: 30px;
}
.tab:hover {
  background: #eef1f6;
}
.tab[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: #c8d1ea;
  color: var(--accent);
  font-weight: 600;
}
.q-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  padding: 10px 14px;
  cursor: pointer;
}
.q-item:hover {
  background: #f6f8fb;
}
.q-item .h {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 3px;
}
.q-item .tx {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
}
.q-item .m {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.st {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  background: #eef1f6;
  color: var(--muted);
}
.st.new {
  background: #fef3c7;
  color: #92400e;
}
.st.in_progress {
  background: #dbeafe;
  color: #1e40af;
}
.st.answered,
.st.edited {
  background: #dcfce7;
  color: #166534;
}
.st.rejected {
  background: #fee2e2;
  color: #991b1b;
}
.st.hid {
  background: #e5e7eb;
  color: #374151;
}
.thread-text {
  white-space: pre-wrap;
  margin: 8px 0;
}
.reply {
  border-left: 3px solid var(--line);
  padding: 4px 0 4px 10px;
  margin: 10px 0;
}
.reply.sol {
  border-left-color: var(--green);
  background: #f3faf5;
}
.reply .m {
  font-size: 12px;
  color: var(--muted);
}
.reply .tx {
  white-space: pre-wrap;
}
.hidden-note {
  font-style: italic;
  color: var(--muted);
}
.admin-box {
  background: #f8fafc;
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  padding: 10px;
  margin-top: 14px;
}

/* ── модальні вікна ── */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.modal {
  background: #fff;
  width: min(580px, 100%);
  max-height: 92vh;
  max-height: 92dvh;
  overflow: auto;
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.modal.wide {
  width: min(760px, 100%);
}
.modal h2 {
  font-size: 17px;
  margin-bottom: 10px;
}
.modal .foot {
  position: sticky;
  bottom: -18px;
  background: #fff;
  padding: 10px 0 0;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
  flex-wrap: wrap;
}
.hint-box {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--r);
  padding: 10px 12px;
  margin: 0 0 12px;
}
.hint-box h4 {
  font-size: 13px;
  margin-bottom: 6px;
  color: #075985;
}
.hint-box .h-item {
  padding: 5px 0;
  border-top: 1px solid #dbeefb;
}
.hint-box .h-item:first-of-type {
  border-top: 0;
}
.picker {
  position: relative;
}
.picker .results {
  max-height: 220px;
}
.resume-ask {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 55;
  box-shadow: var(--shadow);
}
.radios {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.radios label {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  cursor: pointer;
  min-height: 28px;
}
.chg {
  margin-bottom: 12px;
}
.chg h3 {
  font-size: 14px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: #1f2937;
  color: #fff;
  padding: 9px 16px;
  border-radius: 6px;
  z-index: 90;
  max-width: 92vw;
  font-size: 13px;
  box-shadow: var(--shadow);
}
.toast.bad {
  background: var(--red);
}

/* водяний знак */
#wm {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
#wm .grid {
  position: absolute;
  left: -50%;
  top: -50%;
  width: 200%;
  height: 200%;
  transform: rotate(-28deg);
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 64px 80px;
}
#wm span {
  font-size: 15px;
  font-weight: 600;
  color: rgba(17, 24, 39, 0.06);
  white-space: nowrap;
}

/* ── сторінки входу й запрошення ── */
body.auth {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 14px;
  overflow: auto;
}
.auth-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 26px 26px 22px;
  width: min(440px, 100%);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}
.auth-card h1 {
  font-size: 19px;
  margin-bottom: 4px;
}
.auth-card .sub {
  color: var(--muted);
  margin-bottom: 16px;
  font-size: 13px;
}
.auth-card .btn {
  width: 100%;
  min-height: 42px;
  margin-top: 6px;
}
.qr {
  display: block;
  width: 200px;
  height: 200px;
  margin: 8px auto;
  border: 1px solid var(--line);
  padding: 6px;
  background: #fff;
}
.secret {
  display: block;
  text-align: center;
  font-size: 15px;
  letter-spacing: 0.08em;
  margin: 6px 0 12px;
  user-select: all;
}
.codes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  margin: 10px 0;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--r);
  text-align: center;
}
.codes span {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.notice {
  background: #fffbeb;
  border: 1px solid var(--amber);
  border-radius: var(--r);
  padding: 10px 12px;
  font-size: 13px;
  margin: 10px 0;
}
.check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 6px 0 10px;
  cursor: pointer;
}
.check input {
  margin-top: 3px;
}

/* ── мобільна версія ── */
@media (max-width: 700px) {
  #top {
    padding: 6px 10px;
  }
  .top-title h1 {
    font-size: 14px;
  }
  .top-fabula {
    display: none;
  }
  .search-wrap {
    flex: 1 1 100%;
    max-width: none;
    order: 5;
  }
  .btn {
    min-height: 44px;
  }
  .btn.small {
    min-height: 36px;
  }
  .btn .lbl-d {
    display: none;
  }
  .top-row {
    gap: 6px;
  }
  .zoom .btn {
    width: 46px;
    height: 46px;
  }
  .hint-bar {
    display: none;
  }
  .side,
  .drawer {
    top: auto;
    left: 0;
    right: 0;
    width: auto;
    max-width: none;
    max-height: 72%;
    border-left: 0;
    border-top: 1px solid var(--line);
    border-radius: 14px 14px 0 0;
    transform: translateY(105%);
  }
  .drawer {
    top: 0;
    max-height: none;
    border-radius: 0;
  }
  .side.open,
  .drawer.open {
    transform: none;
  }
  .grab {
    display: block;
    width: 44px;
    height: 5px;
    border-radius: 3px;
    background: #cbd5e1;
    margin: 7px auto 0;
    touch-action: none;
  }
  .side-head .btn {
    min-width: 44px;
  }
  .photo {
    width: 84px;
    height: 84px;
  }
  .modal {
    border-radius: 12px 12px 0 0;
    align-self: flex-end;
    max-height: 94dvh;
  }
  .backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .pop {
    position: fixed;
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 10px;
    margin: 0;
    min-width: 0;
  }
  .auth-card {
    padding: 20px 16px;
  }
  #wm .grid {
    gap: 50px 50px;
  }
  .results button {
    min-height: 48px;
  }
}
@media (pointer: coarse) {
  .tab {
    min-height: 38px;
  }
  .linkbtn {
    min-height: 32px;
  }
}
@media print {
  #wm {
    display: none;
  }
}

.lbl-m {
  display: none;
}
/* мобільна шапка: назва + меню в першому рядку, пошук, потім кнопки в один ряд */
@media (max-width: 700px) {
  .top-title {
    order: 1;
    flex: 1 1 0;
    margin-right: 0;
  }
  .top-title h1 {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .top-title .kp {
    display: none;
  }
  .m-menu {
    order: 2;
  }
  .search-wrap {
    order: 3;
    flex: 1 1 100%;
  }
  .top-spacer {
    display: none;
  }
  #b-fit,
  .m-layers,
  #b-ask,
  #b-disc {
    order: 4;
    flex: 1 1 auto;
  }
  .m-layers .btn {
    width: 100%;
  }
  #top .btn {
    padding: 4px 8px;
    font-size: 12.5px;
  }
  #top .btn.primary {
    flex: 1.2 1 auto;
  }
  #b-menu {
    min-width: 44px;
  }
  .pop {
    z-index: 70;
  }
}

@media (max-width: 700px) {
  .lbl-m {
    display: inline;
  }
  .lbl-d {
    display: none;
  }
}

.pop a.item {
  justify-content: flex-start;
  width: 100%;
}

.req-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 8px 10px;
  margin: 0 0 8px;
  background: #fff;
}
.req-card .row {
  justify-content: space-between;
  align-items: flex-start;
}
