/* =========================================================================
   Карта мира — страница целиком состоит из карты
   ========================================================================= */
html.map-page, html.map-page body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.map-page body { background: #1b2229; }
html.map-page { --hh: 78px; }
@media (max-width: 1260px) { html.map-page { --hh: 68px; } }

/* шапка плавает поверх карты */
html.map-page .site-header { position: fixed; left: 0; right: 0; top: 0; background: rgba(16,17,20,0.72); }
html.map-page .site-header.is-scrolled { background: rgba(16,17,20,0.72); }
html.map-page .read-progress { display: none !important; }

.kt { position: fixed; inset: 0; overflow: hidden; color: #efe6cf; font-family: var(--font-body); -webkit-user-select: none; user-select: none; touch-action: none; }
.kt-stage { position: absolute; inset: 0; cursor: grab; }
.kt-stage.is-drag { cursor: grabbing; }
.kt-stage.is-hover { cursor: pointer; }
.kt-stage.is-pin { cursor: crosshair; }
.kt-stage canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; }
.kt-gl { background: #2a3b47; }
.kt-stage canvas[hidden] { display: none; }

/* ---------- легенда плана города ---------- */
.kt-legend {
  position: absolute; left: 18px; bottom: 24px; z-index: 12; width: min(300px, calc(100vw - 100px));
  padding: 10px; border-radius: 12px; background: rgba(18,20,24,.8); border: 1px solid rgba(217,185,106,.28);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 8px 22px rgba(0,0,0,.35);
}
.kt-legend[hidden] { display: none; }
.kt-lg-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 8px; padding: 3px; border-radius: 9px; background: rgba(0,0,0,.3); }
.kt-lg-modes button {
  padding: 6px 4px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; color: #cbbf9f;
  font-family: var(--font-display); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; transition: background .2s, color .2s;
}
.kt-lg-modes button:hover { color: #fff1cc; }
.kt-lg-modes button.is-on { background: linear-gradient(160deg, #e3c583, #b4924f); color: #1b1610; }
.kt-lg-list { list-style: none; margin: 0; padding: 0 2px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; max-height: 30vh; overflow: auto; }
.kt-lg-list li { display: flex; align-items: center; gap: 7px; font-size: 13.5px; line-height: 1.25; color: #e4dac2; min-width: 0; }
.kt-lg-list li i { flex: none; width: 12px; height: 12px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.45); }
.kt-lg-list li i.hatch { background: repeating-linear-gradient(135deg, #a08a6a 0 2px, transparent 2px 5px), #d8c9a4; }
.kt.is-city .kt-compass, .kt.is-city .kt-scale { opacity: 0; }
.kt-lg-more { display: none; }
@media (max-width: 700px) {
  .kt-legend { left: 12px; right: 12px; width: auto; bottom: 12px; padding: 8px; }
  .kt-lg-modes { margin-bottom: 0; }
  .kt-lg-more { display: block; width: 100%; margin-top: 6px; padding: 4px; border: 0; background: transparent; color: #b9a777; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; }
  .kt-lg-more::after { content: " ▾"; }
  .kt-legend.is-open .kt-lg-more::after { content: " ▴"; }
  .kt-legend:not(.is-open) .kt-lg-list { display: none; }
  .kt-legend .kt-lg-list { margin-top: 6px; }
  .kt.has-card .kt-legend { display: none; }
  .kt.has-card .kt-compass, .kt.has-card .kt-scale { opacity: 0; }
}
.kt-city, .kt-cityov { transition: opacity .55s ease; }

/* ---------- загрузка ---------- */
.kt-load {
  position: absolute; inset: 0; z-index: 30; display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 45%, #2b3740 0%, #161b20 70%);
  transition: opacity .9s ease, visibility .9s;
}
.kt-load.is-done { opacity: 0; visibility: hidden; }
.kt-load-in { text-align: center; padding: 24px; }
.kt-load-rose { width: 92px; height: 92px; color: #d9b96a; animation: ktSpin 9s linear infinite; filter: drop-shadow(0 0 18px rgba(217,185,106,.35)); }
@keyframes ktSpin { to { transform: rotate(360deg); } }
.kt-load-t { margin: 18px 0 4px; font-family: var(--font-display); font-size: 26px; letter-spacing: .24em; text-transform: uppercase; color: #ecd59a; }
.kt-load-s { margin: 0 0 16px; font-style: italic; font-size: 17px; color: #b8b0a0; min-height: 1.4em; }
.kt-load-bar { width: min(280px, 70vw); height: 2px; margin: 0 auto; background: rgba(217,185,106,.18); overflow: hidden; border-radius: 2px; }
.kt-load-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8a6d33, #ecd59a); transition: width .3s ease; }
.kt-load.is-error .kt-load-rose { animation: none; opacity: .5; }

/* ---------- кнопки ---------- */
.kt-btn {
  width: 42px; height: 42px; display: grid; place-items: center; padding: 0; cursor: pointer;
  color: #e6cf93; background: rgba(18,20,24,.78); border: 1px solid rgba(217,185,106,.32); border-radius: 10px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(0,0,0,.35); transition: background .2s, border-color .2s, color .2s, transform .15s;
}
.kt-btn svg { width: 20px; height: 20px; }
.kt-btn:hover { background: rgba(32,34,40,.9); border-color: rgba(236,213,154,.6); color: #fff1cc; }
.kt-btn:active { transform: scale(.94); }
.kt-btn.is-on { background: linear-gradient(160deg, rgba(227,197,131,.95), rgba(180,146,79,.95)); color: #1b1610; border-color: transparent; }
.kt-btn:focus-visible { outline: 2px solid #ecd59a; outline-offset: 2px; }

.kt-zoom { position: absolute; right: 18px; bottom: 28px; z-index: 12; display: flex; flex-direction: column; gap: 8px; }
.kt-tools { position: absolute; right: 18px; bottom: 186px; z-index: 12; display: flex; flex-direction: column; gap: 8px; }
.kt-tools .kt-btn[hidden] { display: none; }

/* ---------- панель слоёв ---------- */
.kt-panel {
  position: absolute; right: 70px; bottom: 140px; z-index: 16; width: 270px; max-height: calc(100vh - var(--hh) - 170px); overflow: auto;
  padding: 12px 14px; border-radius: 14px; background: linear-gradient(170deg, rgba(30,27,23,.95), rgba(18,17,15,.96));
  border: 1px solid rgba(217,185,106,.32); box-shadow: 0 18px 40px rgba(0,0,0,.45); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  animation: ktCardIn .25s ease; scrollbar-width: thin; scrollbar-color: rgba(217,185,106,.4) transparent; touch-action: pan-y;
}
.kt-panel[hidden] { display: none; }
.kt-panel h4 { margin: 4px 0 8px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: #c9a95e; }
.kt-panel h4:not(:first-child) { margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(217,185,106,.14); }
.kt-sw { display: flex; align-items: center; gap: 10px; padding: 5px 2px; cursor: pointer; font-size: 15px; color: #e4dac2; line-height: 1.2; }
.kt-sw input { position: absolute; opacity: 0; pointer-events: none; }
.kt-sw-k { flex: none; position: relative; width: 32px; height: 18px; border-radius: 999px; background: rgba(255,255,255,.12); border: 1px solid rgba(217,185,106,.25); transition: background .2s; }
.kt-sw-k::after { content: ""; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: #bfb39a; transition: transform .2s, background .2s; }
.kt-sw input:checked + .kt-sw-k { background: linear-gradient(160deg, #c9a95e, #8a6d33); }
.kt-sw input:checked + .kt-sw-k::after { transform: translateX(14px); background: #fff3d6; }
.kt-sw input:focus-visible + .kt-sw-k { outline: 2px solid #ecd59a; outline-offset: 2px; }
.kt-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 8px 0 4px; padding: 3px; border-radius: 9px; background: rgba(0,0,0,.3); }
.kt-seg button { padding: 6px 4px; border: 0; border-radius: 7px; background: transparent; color: #cbbf9f; cursor: pointer; font-family: var(--font-display); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.kt-seg button.is-on { background: linear-gradient(160deg, #e3c583, #b4924f); color: #1b1610; }
.kt-key { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 3px; }
.kt-key li { display: flex; align-items: center; gap: 9px; font-size: 14px; color: #e4dac2; }
.kt-key svg { flex: none; width: 34px; height: 18px; padding: 1px 3px; border-radius: 4px; background: #e6dcc0; }
.kt.is-night .kt-compass, .kt.is-night .kt-scale { color: rgba(236,213,154,.85); text-shadow: 0 1px 2px rgba(0,0,0,.6); filter: none; }
@media (max-width: 700px) { .kt-panel { right: 12px; left: 12px; width: auto; bottom: auto; top: calc(var(--hh) + 60px); } .kt-tools { top: calc(var(--hh) + 216px); bottom: auto; right: 12px; } }

/* ---------- полоса режима Мастера ---------- */
.kt-banner {
  position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 15;
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-radius: 999px; max-width: calc(100vw - 24px);
  background: linear-gradient(160deg, rgba(227,197,131,.96), rgba(180,146,79,.96)); color: #1b1610; box-shadow: 0 10px 26px rgba(0,0,0,.4);
  font-size: 15.5px; font-weight: 500;
}
.kt-banner[hidden] { display: none; }
.kt-banner button { border: 0; border-radius: 999px; padding: 6px 14px; cursor: pointer; background: rgba(27,22,16,.88); color: #f3dfa6; font-family: var(--font-display); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; }

/* ---------- окно метки ---------- */
.kt-modal { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; padding: calc(var(--hh) + 12px) 16px 16px; background: rgba(8,8,10,.55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.kt-modal[hidden] { display: none; }
.kt-modal-in {
  width: min(520px, 100%); max-height: calc(100vh - var(--hh) - 30px); overflow: auto; padding: 20px 20px 16px; border-radius: 16px;
  background: linear-gradient(170deg, #2a2620, #17150f); border: 1px solid rgba(217,185,106,.35); box-shadow: 0 24px 60px rgba(0,0,0,.55);
  color: #e8dec6; -webkit-user-select: text; user-select: text; touch-action: auto;
}
.kt-modal-in h3 { margin: 0 0 12px; font-family: var(--font-display); font-weight: 500; font-size: 20px; letter-spacing: .06em; color: #f3dfa6; }
.kt-modal-in label { display: block; margin: 10px 0 0; font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #c9b27a; }
.kt-modal-in input:not([type="checkbox"]), .kt-modal-in textarea, .kt-modal-in select {
  display: block; width: 100%; margin-top: 5px; padding: 9px 11px; border-radius: 9px; border: 1px solid rgba(217,185,106,.28);
  background: rgba(0,0,0,.35); color: #f2e8d0; font-family: var(--font-body); font-size: 16.5px; text-transform: none; letter-spacing: 0; resize: vertical;
}
.kt-modal-in input:focus, .kt-modal-in textarea:focus, .kt-modal-in select:focus { outline: none; border-color: #e3c583; box-shadow: 0 0 0 3px rgba(227,197,131,.15); }
.kt-modal-in .kt-secret { color: #d39a8a; }
.kt-modal-in .kt-secret textarea { border-color: rgba(211,154,138,.35); background: rgba(60,20,16,.3); }
.kt-kinds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.kt-kinds button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 10px; cursor: pointer; border: 1px solid rgba(217,185,106,.18); background: rgba(255,255,255,.03); color: #d8ccb0; font-size: 12.5px; line-height: 1.15; }
.kt-kinds button i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff8e6; font-style: normal; font-weight: 700; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.kt-kinds button.is-on { border-color: #e3c583; background: rgba(227,197,131,.12); color: #fff1cc; }
.kt-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.kt-modal-in .kt-check { display: flex; align-items: center; gap: 8px; font-family: var(--font-body); font-size: 16px; letter-spacing: 0; text-transform: none; color: #e8dec6; cursor: pointer; }
.kt-check input { width: 18px; height: 18px; accent-color: #c9a227; }
.kt-sel { min-width: 180px; }
.kt-sel[hidden] { display: none; }
.kt-modal-msg { min-height: 1.3em; margin: 10px 0 0; color: #f0907a; font-size: 15px; }
.kt-modal-go { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
@media (max-width: 520px) { .kt-kinds { grid-template-columns: repeat(2, 1fr); } .kt-kinds button { flex-direction: row; justify-content: flex-start; padding: 6px 8px; } }

/* ---------- компас и линейка ---------- */
.kt-compass { position: absolute; left: 22px; bottom: 54px; z-index: 11; width: 84px; height: 84px; color: rgba(70,52,30,.82); pointer-events: none; filter: drop-shadow(0 1px 0 rgba(255,245,220,.35)); transition: color .6s, opacity .6s; }
.kt-compass svg { width: 100%; height: 100%; }
.kt-compass::after { content: "С"; position: absolute; left: 50%; top: -14px; transform: translateX(-50%); font-family: var(--font-display); font-size: 13px; font-weight: 600; color: inherit; }
.kt-scale { position: absolute; left: 22px; bottom: 22px; z-index: 11; display: flex; align-items: center; gap: 8px; pointer-events: none; color: rgba(55,42,26,.9); font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-shadow: 0 1px 0 rgba(255,245,220,.35); transition: color .6s; }
.kt-scale i { display: block; height: 7px; border: 1.5px solid currentColor; border-top: 0; width: 100px; background: repeating-linear-gradient(90deg, currentColor 0 25%, transparent 25% 50%); background-size: 100% 2px; background-repeat: no-repeat; background-position: 0 100%; }
.kt.is-dark-ui .kt-compass, .kt.is-dark-ui .kt-scale { color: rgba(236,213,154,.85); text-shadow: 0 1px 2px rgba(0,0,0,.6); filter: none; }

/* ---------- хлебные крошки ---------- */
.kt-crumbs {
  position: absolute; left: 18px; top: calc(var(--hh) + 14px); z-index: 12; display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  max-width: calc(100vw - 36px); padding: 6px 8px; border-radius: 12px;
  background: rgba(18,20,24,.74); border: 1px solid rgba(217,185,106,.26); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(0,0,0,.3);
}
.kt-crumbs button {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 0; border-radius: 8px; background: transparent; cursor: pointer;
  color: #cbbf9f; font-family: var(--font-display); font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; transition: background .2s, color .2s;
}
.kt-crumbs button:hover { background: rgba(217,185,106,.12); color: #fff1cc; }
.kt-crumbs button.is-here { color: #ecd59a; cursor: default; background: rgba(217,185,106,.1); }
.kt-crumbs .sep { color: rgba(217,185,106,.45); font-size: 12px; }

/* ---------- поиск ---------- */
.kt-search { position: absolute; left: 18px; top: calc(var(--hh) + 66px); z-index: 17; }
.kt-search-btn {
  width: 40px; height: 40px; display: grid; place-items: center; padding: 0; cursor: pointer; color: #e6cf93;
  background: rgba(18,20,24,.78); border: 1px solid rgba(217,185,106,.3); border-radius: 10px; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(0,0,0,.3); transition: background .2s, border-color .2s;
}
.kt-search-btn svg { width: 19px; height: 19px; }
.kt-search-btn:hover, .kt-search.is-open .kt-search-btn { background: rgba(32,34,40,.92); border-color: rgba(236,213,154,.6); }
.kt-search-pop {
  position: absolute; left: 48px; top: 0; width: min(340px, calc(100vw - 96px)); border-radius: 12px; overflow: hidden;
  background: linear-gradient(170deg, rgba(30,27,23,.96), rgba(18,17,15,.97)); border: 1px solid rgba(217,185,106,.32); box-shadow: 0 18px 40px rgba(0,0,0,.45);
  animation: ktCardIn .2s ease; touch-action: auto; -webkit-user-select: text; user-select: text;
}
.kt-search-pop[hidden] { display: none; }
.kt-search-pop input { display: block; width: 100%; padding: 11px 14px; border: 0; border-bottom: 1px solid rgba(217,185,106,.2); background: transparent; color: #f2e8d0; font-family: var(--font-body); font-size: 17px; outline: none; }
.kt-search-pop input::placeholder { color: #8f8470; font-style: italic; }
.kt-search-pop ul { list-style: none; margin: 0; padding: 4px; max-height: 50vh; overflow: auto; }
.kt-search-pop li { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.kt-search-pop li b { font-weight: 500; font-size: 16px; color: #efe2bf; overflow-wrap: anywhere; }
.kt-search-pop li small { flex: none; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; color: #a99a78; text-align: right; }
.kt-search-pop li.is-sel, .kt-search-pop li:hover { background: rgba(217,185,106,.12); }
.kt-search-pop li.kt-search-none { color: #8f8470; font-style: italic; cursor: default; }
@media (max-width: 700px) { .kt-search { left: 12px; top: calc(var(--hh) + 56px); } }

/* ---------- подсказка ---------- */
.kt-tip {
  position: absolute; z-index: 14; pointer-events: none; padding: 6px 10px; border-radius: 8px; max-width: 280px;
  background: rgba(20,18,15,.9); border: 1px solid rgba(217,185,106,.35); color: #f2e6c8; font-size: 15px; line-height: 1.3;
  box-shadow: 0 8px 20px rgba(0,0,0,.4); transform: translate(-50%, calc(-100% - 14px));
}
.kt-tip small { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #b9a777; }

/* ---------- карточка места ---------- */
.kt-card {
  position: absolute; right: 18px; top: calc(var(--hh) + 14px); z-index: 13; width: min(380px, calc(100vw - 36px));
  max-height: calc(100vh - var(--hh) - 110px); overflow: auto; overscroll-behavior: contain;
  background: linear-gradient(170deg, rgba(30,27,23,.94), rgba(18,17,15,.95)); border: 1px solid rgba(217,185,106,.32); border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0,0,0,.45); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  -webkit-user-select: text; user-select: text; touch-action: pan-y;
  animation: ktCardIn .35s cubic-bezier(.2,.8,.2,1);
  scrollbar-width: thin; scrollbar-color: rgba(217,185,106,.4) transparent;
}
@keyframes ktCardIn { from { opacity: 0; transform: translateY(-8px); } }
.kt-card[hidden] { display: none; }
.kt-card-h { position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start; gap: 10px; padding: 16px 16px 12px; background: inherit; border-bottom: 1px solid rgba(217,185,106,.16); }
.kt-card-h > div { flex: 1; min-width: 0; }
.kt-card-k { margin: 0 0 4px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #b9a777; }
.kt-card-t { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 21px; letter-spacing: .04em; color: #f3dfa6; line-height: 1.2; overflow-wrap: anywhere; }
.kt-card-x { flex: none; width: 30px; height: 30px; border: 1px solid rgba(217,185,106,.25); border-radius: 8px; background: transparent; color: #cbbf9f; cursor: pointer; font-size: 18px; line-height: 1; }
.kt-card-x:hover { color: #fff1cc; border-color: rgba(236,213,154,.6); }
.kt-card-b { padding: 12px 16px 16px; font-size: 16.5px; line-height: 1.5; color: #e2d8c2; }
.kt-card-b p { margin: 0 0 10px; }
.kt-card-b h4 { margin: 14px 0 6px; font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: #c9a95e; }
.kt-card-b ul { margin: 0 0 8px; padding-left: 18px; }
.kt-card-b li { margin: 2px 0; }
.kt-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.kt-tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; color: #efe2bf; background: rgba(255,255,255,.05); border: 1px solid rgba(217,185,106,.22); }
.kt-tag i { width: 9px; height: 9px; border-radius: 50%; background: var(--c, #ccc); box-shadow: 0 0 0 1px rgba(0,0,0,.4); }
.kt-meter { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 4px 10px; margin: 6px 0 10px; font-size: 14px; color: #cfc4aa; }
.kt-meter b { display: block; height: 6px; border-radius: 3px; background: rgba(255,255,255,.07); overflow: hidden; }
.kt-meter b i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #8a6d33, #ecd59a); }
.kt-card-go { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.kt-go {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 9px; cursor: pointer;
  font-family: var(--font-display); font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: #1b1610; background: linear-gradient(160deg, #e3c583, #b4924f); border: 0;
}
.kt-go.ghost { color: #e6cf93; background: transparent; border: 1px solid rgba(217,185,106,.35); }
.kt-go:hover { filter: brightness(1.08); }

@media (max-width: 700px) {
  .kt-card { top: auto; bottom: 12px; right: 12px; left: 12px; width: auto; max-height: 52vh; }
  .kt-zoom { right: 12px; bottom: auto; top: calc(var(--hh) + 64px); }
  .kt-compass { width: 60px; height: 60px; left: 14px; bottom: 44px; }
  .kt-scale { left: 14px; bottom: 16px; }
  .kt-crumbs { left: 12px; top: calc(var(--hh) + 10px); max-width: calc(100vw - 24px); }
  .kt-crumbs button { font-size: 11px; padding: 4px 7px; }
}
@media (prefers-reduced-motion: reduce) {
  .kt-load-rose { animation: none; }
  .kt-card { animation: none; }
}

/* ---------- редактор карты (админы и Повелители тайн) ---------- */
.kt-edpanel {
  position: absolute; right: 70px; top: calc(var(--hh) + 14px); bottom: 20px; z-index: 18; width: min(380px, calc(100vw - 90px));
  display: flex; flex-direction: column; border-radius: 14px; overflow: hidden;
  background: linear-gradient(170deg, rgba(30,27,23,.97), rgba(18,17,15,.98)); border: 1px solid rgba(217,185,106,.35);
  box-shadow: 0 18px 40px rgba(0,0,0,.5); animation: ktCardIn .25s ease; touch-action: pan-y;
}
.kt-edpanel[hidden] { display: none; }
.kt-ed-h { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid rgba(217,185,106,.18); }
.kt-ed-h b { font-family: var(--font-display); font-weight: 500; font-size: 17px; letter-spacing: .08em; color: #f3dfa6; }
.kt-ed-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 10px 12px 0; padding: 3px; border-radius: 9px; background: rgba(0,0,0,.3); }
.kt-ed-tabs button { padding: 7px 4px; border: 0; border-radius: 7px; background: transparent; color: #cbbf9f; cursor: pointer; font-family: var(--font-display); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; }
.kt-ed-tabs button.is-on { background: linear-gradient(160deg, #e3c583, #b4924f); color: #1b1610; }
.kt-ed-body { flex: 1; overflow: auto; padding: 10px 14px 16px; scrollbar-width: thin; scrollbar-color: rgba(217,185,106,.4) transparent; }
.kt-ed-note { margin: 6px 0 10px; font-size: 14px; line-height: 1.45; color: #b3a888; }
.kt-ed-body h5 { margin: 14px 0 6px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: #c9a95e; }
.kt-ed-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.kt-ed-list li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 9px; background: rgba(255,255,255,.03); border: 1px solid rgba(217,185,106,.12); }
.kt-ed-list li.empty { color: #8f8470; font-style: italic; }
.kt-ed-list .sw { flex: none; width: 16px; height: 16px; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.kt-ed-list .t { flex: 1; min-width: 0; font-size: 15.5px; color: #efe2bf; overflow-wrap: anywhere; }
.kt-ed-list .t small, .kt-ed-list .nm small { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .04em; color: #9d8f70; }
.kt-ed-list li > button:not(.nm) { flex: none; width: 30px; height: 30px; border-radius: 8px; border: 1px solid rgba(217,185,106,.25); background: transparent; color: #d9c79a; cursor: pointer; }
.kt-ed-list li > button:not(.nm):hover { border-color: #e3c583; color: #fff1cc; }
.kt-ed-list.names li { padding: 0; }
.kt-ed-list .nm { width: 100%; text-align: left; padding: 7px 10px; border: 0; background: transparent; color: #efe2bf; font-family: var(--font-body); font-size: 15.5px; cursor: pointer; border-radius: 9px; }
.kt-ed-list .nm:hover { background: rgba(217,185,106,.1); }
.kt-ed-list .nm em { font-style: normal; font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; color: #1b1610; background: #c9a95e; padding: 1px 5px; border-radius: 4px; margin-left: 4px; }
.kt-ed-search { display: block; width: 100%; padding: 9px 12px; border-radius: 9px; border: 1px solid rgba(217,185,106,.28); background: rgba(0,0,0,.35); color: #f2e8d0; font-family: var(--font-body); font-size: 16px; outline: none; }
.kt-ed-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.kt-ed-chips button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; border: 1px solid rgba(217,185,106,.25); background: rgba(255,255,255,.03); color: #e4dac2; cursor: pointer; font-size: 14px; }
.kt-ed-chips button i { width: 10px; height: 10px; border-radius: 50%; }
.kt-ed-chips button:hover { border-color: #e3c583; }
.kt-ed-form .kt-ed-sub { margin: 16px 0 4px; font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: #c9a95e; }
.kt-ed-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kt-ed-mini { margin-top: 8px; padding: 6px 10px; font-size: 11px; }
.kt-ed-colors { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.kt-ed-colors input[type="color"] { width: 46px; height: 34px; padding: 0; border: 1px solid rgba(217,185,106,.35); border-radius: 8px; background: none; cursor: pointer; }
.kt-ed-colors button { width: 24px; height: 24px; border-radius: 6px; border: 1px solid rgba(0,0,0,.5); cursor: pointer; }
.kt-ed-colors button:hover { transform: scale(1.12); }
.kt-ed-gang { display: grid; grid-template-columns: 46px 1fr; gap: 10px; align-items: start; margin-top: 10px; padding: 8px; border-radius: 10px; border: 1px solid rgba(217,185,106,.15); }
.kt-ed-gang input[type="color"] { width: 46px; height: 46px; margin-top: 18px; padding: 0; border: 1px solid rgba(217,185,106,.35); border-radius: 8px; background: none; }
.kt-ed-reset { margin-right: auto; }
/* кнопки длинных форм всегда видны внизу */
.kt-ed-form .kt-modal-go { position: sticky; bottom: -16px; z-index: 2; margin: 10px -20px -16px; padding: 12px 20px 16px; background: linear-gradient(180deg, rgba(23,21,15,0), #17150f 30%); }
@media (max-width: 700px) { .kt-edpanel { right: 12px; left: 12px; width: auto; } .kt-ed-row2 { grid-template-columns: 1fr; } }

/* легенда влияния: кликабельные силы */
.kt-lg-list.is-pick { grid-template-columns: 1fr; gap: 2px; overflow-x: hidden; }
.kt-lg-list.is-pick li[data-key] { cursor: pointer; border-radius: 6px; padding: 3px 6px; transition: background .15s; }
.kt-lg-list.is-pick li[data-key]:hover { background: rgba(217,185,106,.12); }
.kt-lg-list li.is-focus { background: rgba(217,185,106,.2); outline: 1px solid rgba(227,197,131,.6); }
.kt-lg-list li small { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: #9d8f70; }
.kt-lg-hint { margin: 8px 2px 0; font-size: 12.5px; color: #9d8f70; font-style: italic; }

/* карта мира: легенда «Влияние сил» */
.kt-inflegend {
  position: absolute; left: 18px; top: calc(var(--hh) + 116px); z-index: 12; width: min(280px, calc(100vw - 36px)); max-height: 46vh; overflow: auto;
  padding: 10px 12px; border-radius: 12px; background: rgba(18,20,24,.84); border: 1px solid rgba(217,185,106,.28);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 8px 22px rgba(0,0,0,.35);
}
.kt-inflegend[hidden] { display: none; }
.kt-inflegend h4 { margin: 0 0 8px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: #c9a95e; }
.kt-inflegend ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.kt-inflegend li { display: flex; align-items: center; gap: 9px; padding: 5px 6px; border-radius: 8px; cursor: pointer; color: #e8dec6; font-size: 15px; }
.kt-inflegend li:hover { background: rgba(217,185,106,.1); }
.kt-inflegend li.is-focus { background: rgba(217,185,106,.2); outline: 1px solid rgba(227,197,131,.6); }
.kt-inflegend li i { flex: none; width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.5); }
.kt-inflegend li small { display: block; font-family: var(--font-mono); font-size: 10px; color: #9d8f70; }
.kt-inflegend p { margin: 8px 0 0; font-size: 13px; line-height: 1.4; color: #a99a78; font-style: italic; }
@media (max-width: 700px) { .kt-inflegend { top: calc(var(--hh) + 104px); left: 12px; } }
