.xtabs { display: flex; gap: 2px; padding: 8px 12px; border-bottom: 1px solid var(--line-2); overflow-x: auto; scrollbar-width: none; }
.xtabs button { height: 32px; padding: 0 10px; border-radius: var(--r); color: var(--mute); font-weight: 500; white-space: nowrap; font-size: 13px; }
.xtabs button[aria-selected="true"] { background: var(--panel-2); color: var(--ink); }
.xhead { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.xhead a { color: var(--mute); text-decoration: none; font-size: 13px; }
.xhead b { font-weight: 600; letter-spacing: .04em; }
.heat { display: grid; grid-template-columns: 22px repeat(24, 1fr); gap: 2px; font: 10px var(--mono); color: var(--mute); }
.heat i { display: block; aspect-ratio: 1; border-radius: 2px; background: var(--accent); }
.note { padding: 10px 0; border-bottom: 1px solid var(--line-2); font: 14px/1.55 var(--read); }
.note small { display: block; font: 11px var(--ui); color: var(--mute); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.rho { font-family: var(--mono); }
.side { display: none !important; }
body { display: flex; flex-direction: row; }   /* app.css с 19.10 ставит column под меню сверху */
.xnav { width: 200px; flex: none; display: flex; flex-direction: column; gap: 2px; padding: 14px 10px; background: var(--panel); border-right: 1px solid var(--line); }
.xbrand { padding: 4px 10px 14px; } .xbrand b { display: block; letter-spacing: .04em; font-size: 14px; } .xbrand a { font-size: 12px; color: var(--mute); text-decoration: none; }
.xnav button { text-align: left; height: 38px; padding: 0 10px; border-radius: var(--r); color: var(--mute); font-weight: 500; }
.xnav button[aria-current="page"] { background: var(--panel-2); color: var(--ink); } .xnav button:hover { color: var(--ink); }
.xfoot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; }
main.full > .map { display: none; } main.full > .panel { display: flex; flex: 1; width: auto; }
main.full #v { max-width: 1100px; width: 100%; margin: 0 auto; }
.xtabs[hidden] { display: none; }
@media (max-width: 860px) { body { flex-direction: column; } .xnav { width: auto; flex-direction: row; overflow-x: auto; padding: 6px; border-right: 0; border-bottom: 1px solid var(--line); } .xbrand { display: none; } .xfoot { margin: 0; padding: 0; border: 0; flex-direction: row; } .xnav button { white-space: nowrap; height: 32px; } main { position: relative; flex: 1; } }
.axis { margin: 6px 0 14px; }
.brow { display: grid; grid-template-columns: 1fr 70px auto; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.brow .bar2 { height: 8px; background: var(--panel-2); border-radius: 2px; position: relative; overflow: hidden; }
.brow .bar2 i { position: absolute; inset: 0 auto 0 0; background: var(--accent); opacity: .75; }
.lvl { font-size: 11px; padding: 1px 6px; border-radius: 3px; border: 1px solid var(--line); color: var(--mute); white-space: nowrap; }
.lvl.core { border-color: var(--accent); color: var(--accent); }
.marks { display: inline-flex; gap: 2px; }
.marks button { font-size: 11px; padding: 1px 6px; border-radius: 3px; border: 1px solid var(--line-2); color: var(--mute); }
.marks button[aria-pressed="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.trait { padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.trait .scale { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; font-size: 11px; color: var(--mute); margin: 6px 0 4px; }
.trait .scale div { height: 6px; background: var(--panel-2); border-radius: 3px; position: relative; }
.trait .scale b { position: absolute; top: -4px; width: 4px; height: 14px; border-radius: 2px; background: var(--accent); }
.fbar { position: sticky; bottom: 0; z-index: 3; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--ink); color: var(--panel); padding: 10px 14px; border-radius: 8px; margin-top: 10px; box-shadow: 0 -6px 18px rgba(0,0,0,.12); }
.fbar[hidden] { display: none; }
.fbar button { background: var(--panel); color: var(--ink); height: 28px; padding: 0 10px; border-radius: 5px; font-weight: 500; font-size: 12px; }
.fbar .ghost { background: none; color: var(--panel); text-decoration: underline; }
.trow2 { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; cursor: pointer; }
.trow2.off { opacity: .5; } .trow2 input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.trow2 .src { color: var(--mute); }
.evo { display: grid; gap: 2px; font: 11px var(--mono); color: var(--mute); }
.evo i { display: block; height: 14px; border-radius: 2px; background: var(--accent); }
#gx { position: absolute; inset: 0; }
/* подбор по вкусу */
.px-bar { display: flex; gap: 8px; margin-top: 12px; }
.px-bar input { flex: 1; min-width: 0; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel-2); color: var(--ink); font: 14px var(--mono); }
.px-bar input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.px-q { display: block; margin: 6px 0 10px; line-height: 1.5; } .px-q code, .kv code { font: 11px var(--mono); background: var(--panel-2); padding: 1px 5px; border-radius: 3px; word-break: break-word; }
.px-end { display: flex; justify-content: center; padding: 14px 0 24px; min-height: 40px; }
.px-card { content-visibility: auto; contain-intrinsic-size: auto 330px; }
.fav-controls { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-bottom:12px; }
.fav-controls .seg { flex-wrap:wrap; }
.fav-controls button { min-height:36px; }
.px-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.px-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); overflow: hidden; transition: opacity .2s; }
.px-card.gone { opacity: .45; }
.px-img { position: relative; display: block; aspect-ratio: 1; background: var(--panel-2); }
.px-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.px-noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--mute); font-size: 12px; }
.px-vid { position: absolute; left: 6px; top: 6px; background: var(--shade); color: #fff; font: 600 11px var(--ui); padding: 2px 6px; border-radius: 4px; }
.px-meta { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px 0; font-size: 13px; font-weight: 500; }
.px-meta small { color: var(--mute); font-weight: 400; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.px-whys { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 10px; min-height: 30px; }
.px-why { font: 11px var(--mono); padding: 1px 5px; border-radius: 3px; border: 1px solid var(--line); color: var(--accent); }
.px-why.neg { color: var(--warn); }
.px-act { display: flex; gap: 4px; padding: 0 8px 8px; margin-top: auto; align-items: center; }
.px-act button { height: 30px; padding: 0 8px; white-space: nowrap; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); font-size: 12px; font-weight: 500; color: var(--ink); }
.px-act button:first-child { flex: 1; }
.px-act button:hover { border-color: var(--accent); }
.px-done { flex: 1; font-size: 12px; color: var(--mute); }
.px-tag { text-align: left; color: var(--accent); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.px-tag small { color: var(--mute); }
@media (max-width: 520px) { .px-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .px-act button { padding: 0 6px; } .px-act button span { display: none; } }
/* на телефоне разделы без графа — на весь экран, а не нижней шторкой */
@media (max-width: 860px) { main.full > .panel { position: absolute; inset: 0; height: auto; border-radius: 0; border-top: 0; box-shadow: none; } }
/* просмотр поверх страницы */
.lb { position: fixed; inset: 0; z-index: 90; display: grid; grid-template-columns: 1fr 320px; background: rgba(10, 9, 8, .94); color: #EEE7DB; }
.lb[hidden] { display: none; }
body.lb-on { overflow: hidden; }
.lb-stage { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; padding: 16px 56px; cursor: zoom-out; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: calc(100vh - 32px); object-fit: contain; display: block; border-radius: 4px; cursor: default; background: #000; }
.lb-wait { position: absolute; inset: 0; display: grid; place-items: center; color: #A99F91; font-size: 13px; pointer-events: none; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 72px; border-radius: 8px; font-size: 34px; line-height: 1; color: #EEE7DB; background: rgba(255, 255, 255, .06); }
.lb-nav:hover { background: rgba(255, 255, 255, .14); } .lb-nav.prev { left: 6px; } .lb-nav.next { right: 6px; }
.lb-side { background: var(--panel); color: var(--ink); border-left: 1px solid var(--line); padding: 14px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.lb-top { display: flex; align-items: center; justify-content: space-between; }
.lb-x { width: 32px; height: 32px; border-radius: var(--r); font-size: 16px; color: var(--mute); } .lb-x:hover { background: var(--panel-2); color: var(--ink); }
.lb-score { font-size: 16px; font-weight: 600; }
.lb-act { display: flex; gap: 6px; margin-top: 6px; }
.lb-act button { flex: 1; height: 36px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; }
.lb-act button:hover { border-color: var(--accent); }
.lb-act button[aria-pressed="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.lb-ext { font-size: 13px; color: var(--accent); margin-top: 4px; }
.lb-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.lb-tag { font: 11px var(--mono); padding: 2px 6px; border-radius: 3px; border: 1px solid var(--line-2); color: var(--mute); }
.lb-tag.pos { color: var(--accent); border-color: var(--line); } .lb-tag.neg { color: var(--warn); border-color: var(--line); }
.lb-tag small { font-size: 10px; opacity: .8; }
.lb-keys { margin-top: auto; padding-top: 12px; font-size: 11px; }
@media (max-width: 860px) {
  .lb { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .lb-stage { padding: 8px 0; } .lb-stage img, .lb-stage video { max-height: calc(62vh); }
  .lb-nav { width: 36px; height: 56px; font-size: 28px; background: rgba(0, 0, 0, .35); }
  .lb-side { max-height: 38vh; border-left: 0; border-top: 1px solid var(--line); padding: 10px 12px; }
  .lb-keys { display: none; }
}
/* подбор: панель, сохранённые поиски, карта, отметки тегов */
.px-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 4px; }
.px-row .chip-btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.px-star { height: 36px; white-space: nowrap; }
.px-saved { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 2px; }
.px-sv { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--panel); }
.px-sv button { height: 28px; padding: 0 9px; font-size: 12px; color: var(--ink); }
.px-sv button b { color: var(--accent); }
.px-sv button + button { padding: 0 7px; color: var(--mute); border-left: 1px solid var(--line-2); }
.px-sv button:hover { background: var(--panel-2); }
.px-title { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0 0; font-size: 15px; }
.px-src { position: absolute; right: 6px; bottom: 6px; max-width: calc(100% - 12px); background: var(--shade); color: #fff; font: 500 10px var(--ui); padding: 2px 6px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.px-maprow { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.px-maprow b { font-weight: 600; font-size: 14px; } .px-maprow small { display: block; color: var(--mute); font-size: 12px; margin: 2px 0 6px; }
.px-maprow .bar2 { height: 6px; background: var(--panel-2); border-radius: 3px; position: relative; overflow: hidden; }
.px-maprow .bar2 i { position: absolute; inset: 0 auto 0 0; background: var(--accent); opacity: .75; }
.px-mapbtn { display: flex; gap: 6px; } .px-mapbtn a { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); }
.lb-links { display: flex; gap: 12px; align-items: center; margin-top: 4px; }
button.lb-tag { cursor: pointer; background: none; }
button.lb-tag:hover { border-color: var(--accent); } .lb-tag.lb-picked { outline: 2px solid var(--accent); outline-offset: 1px; }
.lb-tag b { color: var(--ink); font-weight: 600; }
.lb-tagmenu { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 8px; padding: 8px; background: var(--panel-2); border-radius: var(--r); font-size: 12px; }
.lb-tagmenu span { margin-right: 4px; word-break: break-all; }
.lb-tagmenu button { height: 26px; padding: 0 9px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); font-size: 12px; color: var(--ink); }
.lb-tagmenu button[aria-pressed="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.px-tw { display: flex; flex-wrap: wrap; gap: 6px; }
.px-twi { display: inline-flex; align-items: center; gap: 4px; font: 12px var(--mono); padding: 2px 4px 2px 8px; border: 1px solid var(--line); border-radius: var(--r); }
.px-twi small { color: var(--mute); font-family: var(--ui); } .px-twi button { width: 20px; height: 20px; color: var(--mute); }
.px-ta { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel-2); color: var(--ink); font: 12px/1.5 var(--mono); resize: vertical; }
@media (max-width: 520px) { .px-bar { flex-wrap: wrap; } .px-bar input { flex-basis: 100%; } .px-maprow { grid-template-columns: 1fr; } }
/* ExHentai в подборе */
.px-site { margin: 12px 0 0; }
.px-exh .px-img { aspect-ratio: 3 / 4; }
.px-exh .px-img img { object-position: top; }
.px-ttl { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal !important; color: var(--ink) !important; font-size: 12px !important; line-height: 1.35; margin: 2px 0; }
.lb-title { font-size: 14px; font-weight: 600; line-height: 1.4; word-break: break-word; }
.lb-stage img.lb-cover { height: min(86vh, 900px); width: auto; max-width: 100%; image-rendering: auto; }
@media (max-width: 860px) { .lb-stage img.lb-cover { height: 58vh; } }
/* чтение галереи ExHentai */
.lb-stage img.lb-page { max-height: calc(100vh - 32px); max-width: 100%; width: auto; height: auto; min-height: 40vh; object-fit: contain; }
.lb-reading { cursor: pointer; }
.lb-pgbar { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); background: rgba(0, 0, 0, .6); color: #fff; font: 500 12px var(--ui); padding: 3px 10px; border-radius: 10px; pointer-events: none; }
.lb-read { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.lb-wait[hidden] { display: none; }
@media (max-width: 860px) { .lb-stage img.lb-page { max-height: 60vh; min-height: 0; } }

/* The toolbar is a sibling of the image and the scrolling details panel. */
.lb-tools {
  position: absolute; z-index: 3; display: flex; gap: 6px;
  top: max(8px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right));
}
.lb-tools button {
  min-width: 44px; height: 44px; padding: 0 10px; border-radius: 10px;
  background: #23211f; color: #fff; border: 1px solid #746c62; font-size: 13px;
}
.lb-tools button.lb-x { font-size: 22px; }
.lb-tools button:hover, .lb-jump button:hover { background: #413b35; color: #fff; }
.lb-tools button:focus-visible, .lb-jump :focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lb-with-tools .lb-stage { grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
.lb-with-tools .lb-stage img, .lb-with-tools .lb-stage video { max-height: 100%; }
.lb-with-tools .lb-stage img.lb-page { min-height: 0; }
.lb-with-tools .lb-reading { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.lb-with-tools .lb-side { min-height: 0; }
@media (min-width: 861px) {
  .lb-with-tools .lb-side { padding-top: calc(60px + env(safe-area-inset-top)); }
}
@media (max-width: 860px) {
  .lb-with-tools .lb-stage { padding-top: calc(60px + env(safe-area-inset-top)); }
}
.lb.lb-immersive { grid-template: minmax(0, 1fr) / minmax(0, 1fr); background: #000; }
.lb.lb-immersive .lb-side { display: none; }
.lb.lb-immersive .lb-stage {
  padding: calc(58px + env(safe-area-inset-top)) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.lb.lb-immersive .lb-reading { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.lb.lb-immersive .lb-stage img { width: 100%; height: 100%; border-radius: 0; }
.lb-immersive .lb-nav { background: #23211f; }
.lb-immersive .lb-nav.prev { left: max(6px, env(safe-area-inset-left)); }
.lb-immersive .lb-nav.next { right: max(6px, env(safe-area-inset-right)); }
.lb-jump {
  position: absolute; z-index: 2; bottom: max(6px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  max-width: calc(100% - 16px); width: max-content; padding: 2px 8px;
  color: #fff; background: #23211f; border-radius: 10px; cursor: default;
}
.lb-jump-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.lb-jump .lb-pgbar { position: static; transform: none; padding: 0 2px; background: none; }
.lb-jump input, .lb-jump button { min-height: 44px; border: 1px solid #746c62; border-radius: 8px; }
.lb-jump input { width: 64px; padding: 0 6px; color: #fff; background: #171615; font: 16px var(--ui); }
.lb-jump input::placeholder { color: #d2c6b7; }
.lb-jump button { padding: 0 8px; color: #fff; }
.lb-jump-status { display: block; min-height: 18px; text-align: center; color: #ffdfac; font-size: 12px; }
