/* TRIPOLIS v1.6 — visual social web + chronicle */
.person-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:0 44px 14px 0}.person-actions-top{position:sticky;top:-15px;z-index:8;padding:12px 0 10px;background:linear-gradient(180deg,#071927 72%,rgba(7,25,39,.84) 88%,transparent);backdrop-filter:blur(8px)}.person-actions button{min-height:42px;display:flex;align-items:center;justify-content:center;gap:7px;font-size:8px;font-weight:800;letter-spacing:.035em;white-space:nowrap;cursor:pointer;transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}.person-actions button:hover{transform:translateY(-1px);box-shadow:0 7px 18px rgba(0,0,0,.25)}.person-actions button span{font-size:13px;line-height:1}.person-actions .edit-action{border-color:#3e596b;color:#d9e5ec;background:linear-gradient(180deg,#0d2638,#081c2b)}.person-actions .social-action{border-color:#94713c;color:#f0cf89;background:linear-gradient(180deg,#10283a,#081c2b)}.person-actions .chronicle-action{border-color:#3e5f76;color:#cbdde7;background:linear-gradient(180deg,#0c2334,#071a29)}
.social-page,.chronicle-page{max-width:1450px;margin:auto}.social-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:13px}.social-head h3{font-size:23px;margin:6px 0 3px}.social-head p{margin:0;color:#879dac;font-size:9px}.social-head-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}.social-legend{display:flex;gap:8px 15px;flex-wrap:wrap;border:1px solid #213f53;background:#051724;padding:9px 11px;border-radius:5px;margin-bottom:10px}.social-legend span{display:flex;align-items:center;gap:6px;color:#9eb2bf;font-size:8px}.social-legend i{width:24px;height:3px;border-radius:99px;background:var(--rel)}.social-legend .legend-dash i{height:0;border-top:2px dashed #71889a;background:none}
.social-stage{position:relative;height:min(690px,67vh);min-height:500px;border:1px solid #294b61;border-radius:8px;overflow:hidden;background:radial-gradient(circle at 50% 48%,rgba(47,88,112,.24),transparent 24%),linear-gradient(180deg,#061b2a,#03111d 70%,#020d16);box-shadow:inset 0 0 70px rgba(0,0,0,.35)}.social-stage:before{content:'';position:absolute;inset:0;background-image:linear-gradient(rgba(67,102,122,.05) 1px,transparent 1px),linear-gradient(90deg,rgba(67,102,122,.05) 1px,transparent 1px);background-size:32px 32px;mask-image:radial-gradient(circle,#000 10%,transparent 76%);pointer-events:none}.social-lines{position:absolute;inset:0;width:100%;height:100%;overflow:visible}.social-link{vector-effect:non-scaling-stroke;filter:drop-shadow(0 0 4px rgba(255,255,255,.12));stroke-linecap:round;opacity:.92;stroke-dasharray:1000;stroke-dashoffset:1000;animation:drawSocialLine .75s ease forwards}.social-link.dashed{stroke-dasharray:9 8;stroke-dashoffset:0;animation:dashSocialLine 1.25s linear infinite}.social-link-hit{pointer-events:stroke;cursor:help}.social-center-wrap,.social-node-wrap{position:absolute;transform:translate(-50%,-50%);z-index:3}.social-center-wrap{left:50%;top:50%;z-index:5}.social-node{display:flex;align-items:center;gap:9px;width:168px;min-height:67px;padding:6px;border:1px solid #35576d;background:linear-gradient(180deg,rgba(13,38,55,.98),rgba(5,22,34,.98));color:#e6edf2;border-radius:7px;box-shadow:0 9px 24px rgba(0,0,0,.36);cursor:pointer;text-align:left;transition:transform .22s ease,border-color .22s ease,box-shadow .22s ease;animation:nodeIn .45s ease both}.social-node:hover{transform:translateY(-3px) scale(1.025);border-color:#a48149;box-shadow:0 12px 32px rgba(0,0,0,.5),0 0 0 1px rgba(211,170,92,.15)}.social-node.center{width:205px;min-height:84px;border-color:#9a7941;background:linear-gradient(180deg,#102c40,#071c2c);box-shadow:0 12px 42px rgba(0,0,0,.55),0 0 32px rgba(207,163,79,.12)}.social-node img,.social-node-fallback{width:52px;height:55px;border-radius:5px;object-fit:cover;object-position:50% 0%;border:1px solid #496778;background:#102b3c;flex:0 0 auto}.social-node.center img,.social-node.center .social-node-fallback{width:67px;height:70px}.social-node-fallback{display:grid;place-items:center;color:#e2bd72;font-weight:800;font-size:16px}.social-node-copy{min-width:0}.social-node-copy b{font-size:9px;display:block;line-height:1.25;white-space:normal}.social-node-copy small{font-size:7px;color:#8197a7;line-height:1.3;display:block;margin-top:3px;max-height:28px;overflow:hidden}.social-empty{position:absolute;left:50%;top:72%;transform:translateX(-50%);width:min(560px,88%);text-align:center;color:#718c9e;font-size:9px;z-index:2}.social-empty b{display:block;color:#b6c6d0;margin-bottom:5px}.social-empty span{line-height:1.5}.social-hover{position:absolute;left:50%;bottom:14px;transform:translateX(-50%) translateY(8px);z-index:9;width:min(630px,90%);padding:10px 12px;border:1px solid #405c6e;background:rgba(4,18,28,.96);backdrop-filter:blur(10px);border-radius:6px;opacity:0;pointer-events:none;transition:.2s ease;text-align:center}.social-hover.show{opacity:1;transform:translateX(-50%) translateY(0)}.social-hover b,.social-hover strong,.social-hover span,.social-hover em{display:block}.social-hover b{font-size:8px;letter-spacing:.08em;text-transform:uppercase}.social-hover strong{font-size:11px;margin:3px 0}.social-hover span{font-size:8px;color:#9fb2be}.social-hover em{font-size:7px;color:#d6a866;margin-top:4px;font-style:normal}.social-reasons{border:1px solid #213f53;background:#051522;border-radius:6px;margin-top:10px;padding:10px}.social-reasons h4{font-size:9px;letter-spacing:.08em;color:#d8b66f;margin:0 0 7px}.social-rel-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}.social-rel-row{display:grid;grid-template-columns:auto minmax(100px,.55fr) 1fr auto;align-items:center;gap:7px;border:1px solid #28485d;background:#071b2a;color:#c6d4dd;border-radius:4px;padding:7px;text-align:left;cursor:pointer}.social-rel-row:hover{border-color:#6b6c5a;background:#0a2132}.social-rel-row b{font-size:8px}.social-rel-row>span:not(.rel-dot){font-size:7px;color:#8ea3b1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.social-rel-row em{font-style:normal;font-size:6px;color:#d29c61;border:1px solid #684d32;padding:2px 4px;border-radius:99px}.rel-dot{width:9px;height:9px;border-radius:50%;background:var(--rel);box-shadow:0 0 8px var(--rel)}.social-rel-empty,.chronicle-empty{border:1px dashed #385368;padding:14px;text-align:center;color:#71899a;font-size:9px;border-radius:5px}.social-footnote{font-size:8px;color:#687f90;line-height:1.5;margin:10px 2px}.social-picker{display:grid;grid-template-columns:repeat(auto-fill,minmax(155px,1fr));gap:7px}.social-pick{display:grid;grid-template-columns:45px 1fr;grid-template-rows:auto auto;column-gap:8px;align-items:center;border:1px solid #28485e;background:#071927;color:#dce7ed;border-radius:5px;padding:6px;text-align:left;cursor:pointer}.social-pick:hover{border-color:#8b703e}.social-pick img,.social-pick>span{grid-row:1/3;width:45px;height:48px;object-fit:cover;object-position:50% 0%;border-radius:4px;background:#0c2a3c}.social-pick>span{display:grid;place-items:center;color:#ddb971}.social-pick b{font-size:8px}.social-pick small{font-size:7px;color:#7590a2}
.chronicle-timeline{position:relative;display:flex;flex-direction:column;gap:8px;margin-top:10px}.chronicle-timeline:before{content:'';position:absolute;left:84px;top:0;bottom:0;width:1px;background:linear-gradient(#6d5734,#284a60 40%,#172f40)}.chronicle-card{position:relative;display:grid;grid-template-columns:72px 150px 1fr;gap:14px;align-items:center;border:1px solid #29495f;background:linear-gradient(90deg,#071a29,#051522);border-radius:7px;padding:10px 12px;opacity:0;transform:translateY(12px);animation:chronicleIn .5s ease forwards;animation-delay:var(--delay,0ms)}.chronicle-card:before{content:'';position:absolute;left:78px;top:50%;width:13px;height:13px;border-radius:50%;transform:translate(-50%,-50%);background:#caa154;border:3px solid #071927;box-shadow:0 0 0 1px #675636}.chronicle-card.canon-start{border-color:#4d4936}.chronicle-date{text-align:right;padding-right:5px}.chronicle-date b{display:block;color:#e4bd6e;font-size:10px}.chronicle-date span{display:block;color:#6f899a;font-size:7px;margin-top:2px}.chronicle-visual{min-height:72px;display:flex;align-items:center}.chronicle-portraits{display:flex;align-items:center}.chronicle-portraits button{width:66px;height:72px;padding:0;border:2px solid #122d3e;background:#0c2738;border-radius:6px;overflow:hidden;margin-left:-18px;cursor:pointer;box-shadow:0 5px 15px rgba(0,0,0,.25);transition:.2s}.chronicle-portraits button:first-child{margin-left:0}.chronicle-portraits button:hover{transform:translateY(-4px);z-index:4;border-color:#9a7941}.chronicle-portraits img,.chronicle-portraits button>span{width:100%;height:100%;object-fit:cover;object-position:50% 0%;display:grid;place-items:center;color:#ddb971}.chronicle-copy h4{font-size:12px;margin:5px 0 4px}.chronicle-copy p{font-size:9px;line-height:1.5;color:#a7b9c5;margin:0}.chronicle-copy small{display:block;color:#607b8e;font-size:7px;margin-top:5px}.chronicle-tags{display:flex;gap:5px;flex-wrap:wrap}.chronicle-tag,.chronicle-visibility{display:inline-block;border:1px solid #40576a;color:#95acbb;border-radius:99px;padding:3px 6px;font-size:6px;letter-spacing:.05em}.chronicle-tag{border-color:#735b33;color:#dfba70}.chronicle-visibility.secret{border-color:#684634;color:#c58d62}.chronicle-people-links{display:flex;gap:4px;flex-wrap:wrap;margin-top:6px}.chronicle-people-links button{border:1px solid #2b4b60;background:#081d2c;color:#9db2bf;border-radius:99px;padding:3px 6px;font-size:6px;cursor:pointer}
@keyframes drawSocialLine{to{stroke-dashoffset:0}}@keyframes dashSocialLine{to{stroke-dashoffset:-34}}@keyframes nodeIn{from{opacity:0;transform:scale(.88)}to{opacity:1;transform:scale(1)}}@keyframes chronicleIn{to{opacity:1;transform:translateY(0)}}
@media(max-width:900px){.social-stage{height:660px;overflow:auto}.social-node{width:140px}.social-node.center{width:170px}.social-rel-list{grid-template-columns:1fr}.chronicle-card{grid-template-columns:62px 105px 1fr}.chronicle-timeline:before{left:74px}.chronicle-card:before{left:68px}.chronicle-portraits button{width:52px;height:60px}.social-head{display:block}.social-head-actions{justify-content:flex-start;margin-top:9px}}
@media(max-width:650px){.social-stage{min-height:760px}.social-node{width:118px;min-height:61px;gap:5px}.social-node img,.social-node-fallback{width:38px;height:45px}.social-node.center{width:145px}.social-node.center img,.social-node.center .social-node-fallback{width:48px;height:55px}.social-node-copy b{font-size:7px}.social-node-copy small{font-size:6px}.chronicle-card{grid-template-columns:1fr;gap:7px;padding-left:16px}.chronicle-timeline:before,.chronicle-card:before{display:none}.chronicle-date{text-align:left}.chronicle-visual{min-height:0}}

@media(max-width:760px){.person-actions{grid-template-columns:1fr;margin-right:38px}.person-actions-top{top:-15px}.person-actions button{min-height:39px}.personhero{grid-template-columns:1fr}.personhero>img{height:420px;object-position:50% 0%}}

/* TRIPOLIS v1.6.2 — VISUAL SCALE PASS
   User-requested visual-only update.
   Relationship / canon / LIFE ENGINE logic is unchanged. */

/* PERSONAL + CITY CHRONICLE: roughly +30% for readability */
.chronicle-timeline{gap:11px;margin-top:13px}
.chronicle-timeline:before{left:109px}
.chronicle-card{
  grid-template-columns:94px 195px 1fr;
  gap:18px;
  padding:13px 16px;
  border-radius:9px;
}
.chronicle-card:before{left:101px;width:16px;height:16px;border-width:4px}
.chronicle-date{padding-right:7px}
.chronicle-date b{font-size:13px}
.chronicle-date span{font-size:9px;margin-top:3px}
.chronicle-visual{min-height:94px}
.chronicle-portraits button{
  width:86px;
  height:94px;
  border-radius:8px;
  margin-left:-23px;
}
.chronicle-copy h4{font-size:16px;margin:7px 0 5px}
.chronicle-copy p{font-size:12px;line-height:1.55}
.chronicle-copy small{font-size:9px;margin-top:7px}
.chronicle-tags{gap:7px}
.chronicle-tag,.chronicle-visibility{padding:4px 8px;font-size:8px}
.chronicle-people-links{gap:6px;margin-top:8px}
.chronicle-people-links button{padding:4px 8px;font-size:8px}
.chronicle-empty{font-size:12px;padding:18px}

/* MAIN “СОЦІАЛЬНА МЕРЕЖА” PICKER: ~2x portraits/cards, fewer per row */
.social-picker{
  grid-template-columns:repeat(auto-fill,minmax(310px,1fr));
  gap:12px;
}
.social-pick{
  grid-template-columns:90px 1fr;
  grid-template-rows:auto auto;
  column-gap:14px;
  min-height:116px;
  padding:10px;
  border-radius:8px;
}
.social-pick img,.social-pick>span{
  width:90px;
  height:96px;
  border-radius:7px;
}
.social-pick b{font-size:12px;line-height:1.25}
.social-pick small{font-size:9px;line-height:1.35}

@media(max-width:900px){
  .chronicle-card{grid-template-columns:82px 150px 1fr;gap:14px;padding:12px 14px}
  .chronicle-timeline:before{left:96px}
  .chronicle-card:before{left:89px}
  .chronicle-portraits button{width:72px;height:80px;margin-left:-19px}
  .chronicle-visual{min-height:80px}
  .chronicle-copy h4{font-size:15px}
  .chronicle-copy p{font-size:11px}
  .social-picker{grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:10px}
  .social-pick{grid-template-columns:78px 1fr;min-height:102px;padding:9px}
  .social-pick img,.social-pick>span{width:78px;height:84px}
}
@media(max-width:650px){
  .chronicle-card{grid-template-columns:1fr;gap:9px;padding:14px 16px}
  .chronicle-timeline:before,.chronicle-card:before{display:none}
  .chronicle-date{text-align:left}
  .chronicle-visual{min-height:0}
  .chronicle-portraits button{width:78px;height:86px;margin-left:-18px}
  .chronicle-copy h4{font-size:15px}
  .chronicle-copy p{font-size:11px}
  .social-picker{grid-template-columns:1fr}
  .social-pick{grid-template-columns:84px 1fr;min-height:106px}
  .social-pick img,.social-pick>span{width:84px;height:90px}
}



/* TRIPOLIS v1.6.3 — CONTACT + LAYOUT RECONCILIATION
   Keep v1.6.2 visual scale, but prevent top controls / chronicle time / portrait overlap. */
.person-actions-top{
  position:relative;
  top:auto;
  z-index:1;
  padding:4px 0 10px;
  background:transparent;
  backdrop-filter:none;
}
.person-actions{margin-right:44px}

/* Desktop chronicle: reserve real space for clock/date and up to four enlarged portraits. */
.chronicle-timeline:before{left:126px}
.chronicle-card{
  grid-template-columns:110px 320px minmax(0,1fr);
  gap:20px;
  align-items:center;
  overflow:visible;
}
.chronicle-card:before{left:126px}
.chronicle-date{
  position:relative;
  z-index:3;
  min-width:0;
  padding-right:14px;
  white-space:normal;
}
.chronicle-date b{white-space:nowrap}
.chronicle-visual{
  min-width:0;
  width:100%;
  overflow:visible;
}
.chronicle-portraits{
  width:100%;
  min-width:0;
  display:flex;
  align-items:center;
  flex-wrap:nowrap;
  padding-left:4px;
}
.chronicle-portraits button{margin-left:-12px;flex:0 0 auto}
.chronicle-portraits button:first-child{margin-left:0}
.chronicle-copy{min-width:0}
.chronicle-copy h4,.chronicle-copy p{overflow-wrap:anywhere}

/* Long action labels and narrow modal widths: wrap instead of overlay. */
.person-actions button{white-space:normal;line-height:1.25;padding-inline:8px}

@media(max-width:1100px){
  .chronicle-timeline:before{left:112px}
  .chronicle-card{grid-template-columns:96px 270px minmax(0,1fr);gap:16px}
  .chronicle-card:before{left:112px}
  .chronicle-portraits button{width:72px;height:80px;margin-left:-10px}
}
@media(max-width:820px){
  .chronicle-card{grid-template-columns:88px 220px minmax(0,1fr);gap:13px}
  .chronicle-timeline:before,.chronicle-card:before{left:103px}
  .chronicle-portraits button{width:62px;height:72px;margin-left:-8px}
}
@media(max-width:650px){
  .chronicle-card{grid-template-columns:1fr;gap:9px;padding:14px 16px}
  .chronicle-timeline:before,.chronicle-card:before{display:none}
  .chronicle-date{text-align:left;padding-right:0}
  .chronicle-visual{min-height:0}
  .chronicle-portraits{width:auto;flex-wrap:wrap;gap:5px;padding-left:0}
  .chronicle-portraits button{width:78px;height:86px;margin-left:0}
  .person-actions{margin-right:38px}
}


/* TRIPOLIS v1.6.8 — SOCIAL READABILITY PASS requested by author.
   Desktop personal social map: portraits/icons +50%, primary text ~2x, reasons fully readable. */
@media(min-width:901px){
  .social-page{max-width:1500px}.social-head h3{font-size:28px}.social-head p{font-size:14px}.social-legend{padding:12px 14px;gap:10px 18px}.social-legend span{font-size:13px}.social-legend i{width:36px;height:5px}
  .social-stage{height:min(980px,82vh);min-height:820px;overflow:hidden}.social-node{width:270px;min-height:104px;gap:13px;padding:9px;border-radius:10px}.social-node.center{width:330px;min-height:126px}.social-node img,.social-node-fallback{width:78px;height:83px;border-radius:7px}.social-node.center img,.social-node.center .social-node-fallback{width:101px;height:105px}.social-node-fallback{font-size:24px}.social-node-copy b{font-size:18px;line-height:1.18}.social-node-copy small{font-size:14px;line-height:1.25;max-height:52px;margin-top:5px}
  .social-hover{width:min(820px,92%);padding:14px 16px}.social-hover b{font-size:13px}.social-hover strong{font-size:18px;margin:5px 0}.social-hover span{font-size:14px;line-height:1.4}.social-hover em{font-size:12px}
  .social-reasons{padding:15px;margin-top:14px}.social-reasons h4{font-size:16px;margin-bottom:11px}.social-rel-list{grid-template-columns:1fr;gap:8px}.social-rel-row{grid-template-columns:auto minmax(180px,.32fr) minmax(0,1fr) auto;gap:12px;padding:12px 13px}.social-rel-row b{font-size:16px}.social-rel-row>span:not(.rel-dot){font-size:14px;line-height:1.45;white-space:normal;overflow:visible;text-overflow:clip}.social-rel-row em{font-size:11px;padding:4px 7px}.rel-dot{width:14px;height:14px}.social-footnote{font-size:12px;line-height:1.6}
}
.author-scenario{margin-top:16px;border:1px solid #7a6239;background:linear-gradient(180deg,#10283a,#081c2b);border-radius:9px;padding:15px;scroll-margin-top:75px}.author-scenario-head h4{font-size:18px;color:#e8c676;margin:6px 0}.author-scenario-head p{font-size:12px;color:#9eb1be;line-height:1.5}.author-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:12px}.author-grid label{display:flex;flex-direction:column;gap:5px;font-size:10px;color:#9db0bd}.author-grid input,.author-grid select,.author-grid textarea{width:100%;border:1px solid #36566b;background:#071a29;color:#edf4f8;border-radius:5px;padding:9px}.author-grid .full{grid-column:1/-1}.author-grid textarea{resize:vertical;min-height:90px}.author-save{width:100%;padding:11px;font-weight:800;letter-spacing:.04em}
@media(max-width:900px){.author-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:650px){.author-grid{grid-template-columns:1fr}.author-grid .full{grid-column:1}.social-rel-row{display:grid;grid-template-columns:auto 1fr;gap:7px}.social-rel-row>span:not(.rel-dot),.social-rel-row em{grid-column:2}.social-rel-row b{font-size:12px}.social-rel-row>span:not(.rel-dot){font-size:11px;white-space:normal;overflow:visible}.social-reasons h4{font-size:13px}}
