/* Конструктор биографии. Главное на экране — дизайн модели на «столе»; панели спокойные и не спорят с ним. */
@font-face { font-family: bM; font-weight: 600; src: url(/static/bio/fonts/M600.woff2) format("woff2"); font-display: block; }
@font-face { font-family: bM; font-weight: 700; src: url(/static/bio/fonts/M700.woff2) format("woff2"); font-display: block; }
@font-face { font-family: bM; font-weight: 800; src: url(/static/bio/fonts/M800.woff2) format("woff2"); font-display: block; }
@font-face { font-family: bM; font-weight: 900; src: url(/static/bio/fonts/M900.woff2) format("woff2"); font-display: block; }
@font-face { font-family: bPF; font-weight: 700; src: url(/static/bio/fonts/Playfair.woff2) format("woff2"); font-display: block; }
@font-face { font-family: bCO; font-weight: 700; src: url(/static/bio/fonts/Comfortaa.woff2) format("woff2"); font-display: block; }
@font-face { font-family: bCV; font-weight: 700; src: url(/static/bio/fonts/Caveat.woff2) format("woff2"); font-display: block; }
@font-face { font-family: bUN; font-weight: 800; src: url(/static/bio/fonts/Unbounded.woff2) format("woff2"); font-display: block; }
@font-face { font-family: bRU; font-weight: 400; src: url(/static/bio/fonts/Russo.woff2) format("woff2"); font-display: block; }
@font-face { font-family: bLO; font-weight: 400; src: url(/static/bio/fonts/Lobster.woff2) format("woff2"); font-display: block; }
@font-face { font-family: bMK; font-weight: 400; src: url(/static/bio/fonts/Marck.woff2) format("woff2"); font-display: block; }
@font-face { font-family: bOS; font-weight: 700; src: url(/static/bio/fonts/Oswald.woff2) format("woff2"); font-display: block; }
@font-face { font-family: bCG; font-weight: 700; src: url(/static/bio/fonts/Cormorant.woff2) format("woff2"); font-display: block; }
@font-face { font-family: bBS; font-weight: 400; src: url(/static/bio/fonts/BadScript.woff2) format("woff2"); font-display: block; }
@font-face { font-family: bAM; font-weight: 700; src: url(/static/bio/fonts/Amatic.woff2) format("woff2"); font-display: block; }
@font-face { font-family: bPX; font-weight: 400; src: url(/static/bio/fonts/Pixel.woff2) format("woff2"); font-display: block; }
@font-face { font-family: bPA; font-weight: 400; src: url(/static/bio/fonts/Pacifico.woff2) format("woff2"); font-display: block; }
@font-face { font-family: bGV; font-weight: 400; src: url(/static/bio/fonts/GreatVibes.woff2) format("woff2"); font-display: block; }
@font-face { font-family: bRM; font-weight: 400; src: url(/static/bio/fonts/RubikMono.woff2) format("woff2"); font-display: block; }
@font-face { font-family: bRS; font-weight: 400; src: url(/static/bio/fonts/Ruslan.woff2) format("woff2"); font-display: block; }

.bio-intro { background: var(--night); color: var(--on-night-muted); padding-block: 22px 20px; }
.bio-intro h1 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 .25em; }
.bio-intro p { margin: 0; max-width: 46rem; }
.bio-intro .crumbs { margin-bottom: 8px; }

.bio-sec { --desk: #e7e3f0; background: var(--desk); }
@media (prefers-color-scheme: dark) { .bio-sec { --desk: #0a0d2b; } .bio-tabs, .bio-save { background: #10143d !important; } }
.bio { display: grid; grid-template-columns: 168px 360px minmax(0, 1fr); min-height: calc(100vh - 68px); }

/* Вкладки */
.bio-tabs { background: #ece8f6; border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 68px; height: calc(100vh - 68px); overflow: auto; }
.bio-tabs button { text-align: left; border: 0; background: none; color: var(--muted); font: 700 .92rem var(--body); padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.bio-tabs button:hover { color: var(--ink); background: rgba(255,255,255,.6); }
.bio-tabs [aria-selected=true] { color: var(--ink); background: var(--surface); box-shadow: inset 3px 0 0 var(--accent), 0 1px 3px rgba(27,22,64,.08); }
.bio-tabs [data-tab=blk] { margin-top: auto; }

/* Панель */
.bio-side { background: var(--surface); border-right: 1px solid var(--line); position: sticky; top: 68px; height: calc(100vh - 68px); display: flex; flex-direction: column; }
.bio-panel { flex: 1; overflow: auto; padding: 18px 18px 24px; overscroll-behavior: contain; }
.bio-panel .bio-pt { font: 700 1.15rem/1.2 var(--display); color: var(--ink); margin: 0 0 6px; }
.bio-panel label { display: block; font-weight: 700; font-size: .86rem; color: var(--muted); margin: 12px 0 0; }
.bio-panel label small { font-weight: 600; color: var(--faint); }
.bio-panel input:not([type=radio]):not([type=range]):not([type=color]):not([type=checkbox]), .bio-panel textarea, .bio-panel select, .bio-result textarea {
  display: block; width: 100%; margin-top: 4px; font: 600 .93rem var(--body); color: var(--text); background: var(--sunk);
  border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; }
#bio-app [hidden] { display: none !important; }
.bio-panel textarea, .bio-result textarea { resize: vertical; line-height: 1.45; }
.bio-panel input:focus, .bio-panel textarea:focus, .bio-panel select:focus { outline: none; border-color: var(--accent); }
.bio-panel input[type=range] { width: 100%; accent-color: var(--accent); }
.bio-panel input[type=color] { display: block; width: 100%; height: 34px; border: 1.5px solid var(--line); border-radius: 8px; padding: 2px; background: var(--sunk); margin-top: 4px; cursor: pointer; }
.bio-panel fieldset { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 12px 12px; margin: 16px 0 0; }
.bio-panel legend { font-weight: 800; color: var(--ink); padding: 0 6px; font-size: .9rem; }
.bio-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.bio-short input { max-width: 120px; }
.bio-hint { color: var(--muted); font-size: .86rem; margin: 6px 0; line-height: 1.45; }
.bio-sub { font-weight: 800; color: var(--ink); font-size: .9rem; margin: 18px 0 8px; }
.bio-bh { font-size: 1rem; margin: 20px 0 4px; }
.bio-check { display: flex !important; align-items: center; gap: 8px; color: var(--text) !important; font-weight: 600 !important; }
.bio-link { border: 0; background: none; color: var(--accent); font: 700 .86rem var(--body); padding: 0; margin-top: 12px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.bio-mini { display: inline-flex !important; align-items: center; justify-content: center; border: 1.5px solid var(--line); background: var(--sunk); color: var(--ink) !important; font: 700 .8rem var(--body) !important; padding: 6px 10px; border-radius: 9px; cursor: pointer; margin: 0 !important; }
.bio-mini:hover { border-color: var(--accent); }
.bio-mini.wide { width: 100%; padding: 10px; margin-top: 10px !important; }
.bio-mini.danger { color: var(--err) !important; }
.bio-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* Шаблоны */
.bio-tpls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.bio-tpl { display: grid; gap: 3px; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; color: var(--text); font: inherit; }
.bio-thumb { display: block; height: 170px; overflow: hidden; border-radius: 10px; background: #fff; outline: 2px solid var(--line); outline-offset: -2px; }
.bio-thumb svg { display: block; width: 100%; height: auto; }
.bio-tpl.on .bio-thumb { outline: 3px solid var(--accent); }
.bio-tpl b { font-size: .9rem; color: var(--ink); margin-top: 4px; }
.bio-tpl small { font-size: .76rem; color: var(--muted); line-height: 1.3; }

/* Цвета и шрифты */
.bio-pals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bio-pal { display: grid; gap: 4px; border: 0; background: none; padding: 0; cursor: pointer; font: 700 .8rem var(--body); color: var(--text); text-align: left; }
.bio-pal span { display: flex; align-items: flex-end; gap: 4px; height: 46px; padding: 7px; border-radius: 10px; outline: 2px solid var(--line); outline-offset: -2px; }
.bio-pal i { width: 18px; height: 18px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,.7); }
.bio-pal.on span { outline: 3px solid var(--accent); }
.bio-colors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 8px; }
.bio-colors label { font-size: .78rem; }
.bio-fonts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.bio-font { border: 1.5px solid var(--line); background: var(--sunk); color: var(--ink); border-radius: 10px; padding: 8px 10px; text-align: left; cursor: pointer; font-size: 1.15rem; line-height: 1.2; }
.bio-fonts.small .bio-font { font-size: .95rem; }
.bio-font small { display: block; font: 600 .7rem var(--body); color: var(--muted); margin-top: 2px; }
.bio-font.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }

/* Фото */
.bio-phs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.bio-ph { position: relative; display: grid; gap: 5px; justify-items: center; background: var(--sunk); border: 1px dashed var(--line); border-radius: var(--r-sm); padding: 6px; }
.bio-ph img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.bio-ph > span { width: 100%; aspect-ratio: 1; display: grid; place-items: center; color: var(--faint); font-size: .8rem; }
.bio-ph select { padding: 3px !important; font-size: .76rem !important; margin: 0 !important; }
.bio-x { position: absolute; top: 2px; right: 2px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 16px; line-height: 1; }
.bio-socrow { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; }
.bio-socrow input:last-child { grid-column: 1 / -1; }
.bio-socrow input { margin: 0 !important; }

/* Фон и библиотеки */
.bio-radio label { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; }
.bio-radio input[type=color] { width: 42px; height: 28px; margin: 0; }
.bio-bgimg { display: flex; align-items: center; gap: 10px; }
.bio-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 10px; }
.bio-chip { border: 1.5px solid var(--line); background: none; color: var(--muted); border-radius: 99px; padding: 5px 11px; font: 700 .8rem var(--body); cursor: pointer; }
.bio-chip.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.bio-lib { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.bio-lib.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bio-lib.bg { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bio-lib button { border: 0; padding: 4px; background: var(--sunk); border-radius: 10px; cursor: pointer; aspect-ratio: 1; display: grid; place-items: center; }
.bio-lib.wide button { aspect-ratio: 2 / 1; }
.bio-lib.bg button { aspect-ratio: 9 / 16; padding: 0; overflow: hidden; }
.bio-lib img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.bio-lib.bg img { width: 100%; height: 100%; object-fit: cover; max-width: none; max-height: none; }
.bio-lib button:hover { box-shadow: 0 0 0 2px var(--accent); }
.bio-lib button.on { box-shadow: 0 0 0 3px var(--accent); }
.bio-frames { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.bio-frame { border: 0; background: var(--sunk); border-radius: 8px; padding: 4px; aspect-ratio: 2 / 1; display: grid; place-items: center; cursor: pointer; }
.bio-frame img { max-width: 100%; max-height: 100%; }
.bio-frame.on { box-shadow: 0 0 0 3px var(--accent); }
.bio-addlist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.bio-addb { border: 1.5px solid var(--line); background: var(--sunk); color: var(--ink); border-radius: 10px; padding: 11px 10px; font: 700 .86rem var(--body); text-align: left; cursor: pointer; }
.bio-addb:hover { border-color: var(--accent); }
.bio-own { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 8px; }
.bio-own summary { cursor: pointer; font-weight: 800; color: var(--ink); font-size: .9rem; }

/* Сохранение */
.bio-save { border-top: 1px solid #d9d2ee; padding: 14px 18px; background: #ece8f6; box-shadow: 0 -6px 16px rgba(27,22,64,.06); }
.bio-save .bio-width select { background: var(--surface); }
.bio-save > .btn { width: 100%; }
.bio-width { display: flex; align-items: center; justify-content: space-between; gap: 8px; font: 700 .82rem var(--body); color: var(--muted); margin-bottom: 8px; }
.bio-width select { font: 600 .82rem var(--body); color: var(--text); background: var(--sunk); border: 1.5px solid var(--line); border-radius: 8px; padding: 4px 6px; max-width: 62%; }
.bio-status { margin: 8px 0 0; font-weight: 700; color: var(--ink); font-size: .88rem; }
.bio-status:empty { display: none; }
.bio-result { max-height: 42vh; overflow: auto; }
.bio-result label { display: block; font-weight: 800; color: var(--ink); margin-top: 10px; font-size: .88rem; }
.bio-result textarea { font: 500 .78rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.bio-result .btn { margin-top: 6px; }
.bio-dl { font-size: .86rem; margin: 10px 0 0; }
.bio-dl .bio-link { margin: 0; }

/* Стол с дизайном */
.bio-main { padding: 18px 28px 60px; min-width: 0; }
.bio-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: -18px -28px 12px; padding: 12px 28px; justify-content: center; align-items: center; position: sticky; top: 68px; z-index: 7; background: var(--desk); }
.bio-tool.bio-hist { background: var(--accent); color: var(--accent-ink); font-size: .92rem; padding: 8px 16px; }
.bio-tool.bio-hist:hover { border-color: transparent; filter: brightness(1.08); }
.bio-tool.bio-hist:disabled { background: var(--surface); color: var(--faint); cursor: default; filter: none; }
.bio-tool.bio-danger { color: var(--err); }
.bio-tool.bio-danger:hover { border-color: var(--err); }
.bio-sep { width: 1px; height: 24px; background: var(--line); margin: 0 6px; }
.bio-tool { border: 1.5px solid transparent; background: var(--surface); color: var(--ink); border-radius: 99px; padding: 7px 14px; font: 700 .85rem var(--body); cursor: pointer; }
.bio-tool:hover { border-color: var(--accent); }
.bio-tool[aria-pressed=true] { background: var(--ink); color: var(--surface); }
.bio-warn { max-width: 760px; margin: 0 auto 12px; padding: 10px 14px 10px 30px; background: var(--surface); border-left: 4px solid var(--warn); border-radius: 8px; font-size: .88rem; color: var(--text); }
.bio-warn li + li { margin-top: 4px; }
.bio-desk { display: flex; flex-direction: column; align-items: center; }
.bio-phonecap { display: none; margin: 0 0 10px; font-size: .86rem; color: var(--muted); text-align: center; }
.bio-desk.phone .bio-phonecap { display: block; }
.bio-stage.phone { border: 10px solid #15122b; border-radius: 28px; overflow: hidden; }
.bio-toast { position: sticky; top: 128px; z-index: 6; max-width: 760px; margin: 0 auto 12px; display: flex; align-items: center; gap: 14px; justify-content: space-between;
  background: var(--ink); color: var(--surface); border-radius: 12px; padding: 10px 14px; font-size: .9rem; font-weight: 700; }
.bio-toast button { border: 0; background: none; color: inherit; font: 800 .9rem var(--body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 4px; }
.bio-stage { position: relative; width: 100%; max-width: 760px; box-shadow: 0 24px 60px rgba(20,16,60,.22); background: #fff; transition: max-width .25s; }
.bio-stage.phone { max-width: 375px; }
.bio-svg svg { display: block; width: 100%; height: auto; }
.bio-ov { position: absolute; inset: 0; }
.bio-blk { position: absolute; border: 1.5px dashed transparent; cursor: pointer; }
.bio-blk.free { cursor: move; touch-action: none; }
.bio-blk:hover { border-color: rgba(107,108,242,.75); }
.bio-blk.sel { border: 2px solid #6b6cf2; }
.bio-blk.over { border: 2px solid #e5484d; }
.bio-tag { position: absolute; left: 34px; top: -28px; font: 700 11px/1 var(--body); color: #fff; background: rgba(27,22,64,.85); border-radius: 6px; padding: 4px 6px; opacity: 0; pointer-events: none; white-space: nowrap; }
.bio-blk.free .bio-tag { left: 0; }
.bio-blk.over .bio-tag { background: #e5484d; opacity: 1; }
.bio-blk:hover .bio-tag, .bio-blk.sel .bio-tag { opacity: 1; }
.bio-mv, .bio-rs { position: absolute; border: 0; padding: 0; background: #6b6cf2; color: #fff; opacity: 0; touch-action: none; }
.bio-mv { left: 0; top: -31px; width: 26px; height: 26px; border-radius: 7px; cursor: move; }
.bio-mv::before { content: "✥"; font-size: 16px; line-height: 26px; }
.bio-blk.free .bio-mv { display: none; }
.bio-del { position: absolute; right: -11px; top: -11px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; background: #e5484d; color: #fff; font: 700 16px/18px var(--body); padding: 0; cursor: pointer; opacity: 0; box-shadow: 0 2px 6px rgba(0,0,0,.25); z-index: 2; }
.bio-blk:hover .bio-del, .bio-blk.sel .bio-del { opacity: 1; }
.bio-del:hover { transform: scale(1.12); }
.bio-rot { left: 50%; top: -38px; width: 26px; height: 26px; margin-left: -13px; border-radius: 50%; cursor: grab; background: #fff !important; border: 2px solid #6b6cf2 !important; }
.bio-rot::before { content: "⟳"; color: #6b6cf2; font-size: 15px; line-height: 22px; }
.bio-rot::after { content: ""; position: absolute; left: 50%; top: 24px; width: 2px; height: 12px; background: #6b6cf2; margin-left: -1px; }
.bio-rs { right: -2px; bottom: -2px; width: 18px; height: 18px; border-radius: 4px 0 4px 0; cursor: nwse-resize; }
.bio-blk:hover .bio-mv, .bio-blk:hover .bio-rs, .bio-blk.sel .bio-mv, .bio-blk.sel .bio-rs, .bio-blk.sel .bio-rot { opacity: 1; }

@media (max-width: 1180px) {
  .bio { grid-template-columns: 340px minmax(0, 1fr); }
  .bio-tabs { grid-column: 1 / -1; position: sticky; top: 68px; z-index: 5; height: auto; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 10px; }
  .bio-tabs button { white-space: nowrap; }
  .bio-tabs [aria-selected=true] { box-shadow: inset 0 -3px 0 var(--accent); }
  .bio-tabs [data-tab=blk] { margin-top: 0; }
  .bio-side { top: 120px; height: calc(100vh - 120px); }
}
@media (max-width: 760px) {
  .bio { grid-template-columns: minmax(0, 1fr); }
  .bio-side { position: static; height: auto; order: 3; border-right: 0; }
  .bio-panel { overflow: visible; }
  .bio-main { order: 2; padding: 12px 10px 16px; }
  .bio-stage { max-height: 62vh; overflow: auto; }
  .bio-blk.sel .bio-mv, .bio-blk.sel .bio-rs, .bio-blk.sel .bio-rot, .bio-blk.sel .bio-del { opacity: 1; }
  .bio-del { width: 30px; height: 30px; right: -13px; top: -13px; font-size: 19px; line-height: 24px; }
  .bio-blk:hover .bio-del { opacity: 0; }
  .bio-blk.sel:hover .bio-del { opacity: 1; }
  .bio-rot { width: 34px; height: 34px; margin-left: -17px; top: -46px; }
  .bio-main .bio-bar { margin: -12px -10px 10px; padding: 8px 10px; top: 0; }
  .bio-blk:hover .bio-mv, .bio-blk:hover .bio-rs { opacity: 0; }
  .bio-blk.sel:hover .bio-mv, .bio-blk.sel:hover .bio-rs { opacity: 1; }
  .bio-mv { width: 32px; height: 32px; top: -37px; }
  .bio-tag { left: 40px; top: -32px; }
  .bio-mv::before { line-height: 32px; }
  .bio-rs { width: 26px; height: 26px; }
  .bio-save { position: sticky; bottom: 0; z-index: 4; }
}
@media (prefers-reduced-motion: reduce) { .bio-stage { transition: none; } }

/* Порядок рядов */
.bio-rows { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; counter-reset: row; }
.bio-rows li { display: flex; align-items: center; gap: 6px; background: var(--sunk); border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 8px 8px 12px; counter-increment: row; }
.bio-rows li::before { content: counter(row); font: 800 .8rem var(--body); color: var(--faint); width: 18px; }
.bio-rows li.on { border-color: var(--accent); }
.bio-rows span { flex: 1; font-weight: 700; font-size: .88rem; color: var(--ink); }
.bio-rows button { width: 34px; height: 34px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 1rem; cursor: pointer; }
.bio-rows button:hover:not(:disabled) { border-color: var(--accent); }
.bio-rows button:disabled { opacity: .35; cursor: default; }

/* Ссылки */
.bio-link-row { display: grid !important; grid-template-columns: 130px minmax(0, 1fr); align-items: center; gap: 10px; margin-top: 8px !important; }
.bio-li { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 800; font-size: .88rem; }
.bio-li svg { flex: none; }
.bio-link-row input { margin: 0 !important; }

/* Шаблоны в статье под конструктором */
.bio-guide .prose { max-width: 860px; }
.bio-gal { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin: 18px 0 8px; }
.bio-gal figure { margin: 0; }
.bio-gal img { display: block; width: 100%; height: 230px; object-fit: cover; object-position: top; border-radius: 12px; outline: 1px solid var(--line); }
.bio-gal figcaption { font-size: .82rem; line-height: 1.35; color: var(--muted); margin-top: 6px; }
.bio-gal figcaption b { color: var(--ink); }
@media (max-width: 900px) { .bio-gal { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
