/* BalkanLoop - društvene funkcije: slika profila, postavke, prekidači, komentari (odgovori, redoslijed), prozorčić o nalogu,
   blokirani nalozi, pravila zajednice, prenosi uživo u "Otkrij" i savjet za iPhone.
   Osnova (boje, dugmad, prozorčići) je u style.css i screens.css. */

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { touch-action: manipulation; }                       /* nema uvećavanja dvostrukim dodirom */
/* iPhone uvećava stranicu čim se dodirne polje s manjim slovima od 16 px, pa se za njih slova povećaju */
html.ios input, html.ios textarea, html.ios select { font-size: 16px; }

/* ------------------------------------------------------------ slika profila u avataru */
.av.img { position: relative; overflow: hidden; background: #2c221c; }
.av.img img { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; }
.av.img::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .22); pointer-events: none; }

/* dugme na profilu i u uređivanju: dodirni sliku da je promijeniš */
.pav { position: relative; display: inline-block; flex: none; border-radius: 34%; }
.pav > .av, .pav [data-prev] > .av { display: grid; }
.pav [data-prev] { display: block; }
.pav:active > .av, .pav:active [data-prev] > .av { transform: scale(.97); }
.pav-badge { position: absolute; right: -5px; bottom: -5px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--amber); color: var(--ink); border: 3px solid var(--page); box-shadow: 0 4px 14px rgba(0, 0, 0, .4); pointer-events: none; }
.pav-badge svg { width: 15px; height: 15px; stroke-width: 2.4; }
.pav.big .pav-badge { width: 34px; height: 34px; right: -7px; bottom: -7px; }
.pav.big .pav-badge svg { width: 17px; height: 17px; }
.eav { gap: 8px; }
.eav .pav-badge { border-color: #1d1511; }
.eav-link { margin: 0; }

/* ------------------------------------------------------------ prekidač (uključeno / isključeno) */
.tgl { position: relative; flex: none; width: 50px; height: 30px; border-radius: 15px; background: var(--card3); border: 1px solid var(--line); transition: background .2s, border-color .2s; }
.tgl::after { content: ""; position: absolute; inset: -8px -4px; }          /* veća površina za dodir */
.tgl i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #e9dcc9; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); transition: transform .22s cubic-bezier(.3, .9, .3, 1), background .2s; }
.tgl.on { background: var(--amber); border-color: transparent; }
.tgl.on i { transform: translateX(20px); background: #fff; }
.tgl:disabled { opacity: .4; cursor: default; }

/* red s naslovom, malim opisom i prekidačem */
.opt { display: flex; align-items: center; gap: 14px; padding: 12px 0; }
.opt + .opt { border-top: 1px solid var(--line); }
.st { flex: 1; min-width: 0; display: grid; gap: 2px; text-align: left; }
.st b { font-size: 14.5px; font-weight: 700; color: var(--text); }
.st small { font-size: 12.5px; line-height: 1.4; font-weight: 500; color: var(--dim); }
.fl { font-size: 12.5px; font-weight: 700; color: var(--dim); }
.vnote { display: block; font-size: 12.5px; line-height: 1.45; color: var(--dim); }
.vnote:empty { display: none; }

/* izbor "Svi / Pratioci / Samo ja" */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 16px; background: rgba(251, 241, 227, .06); border: 1px solid var(--line); }
.seg button { height: 38px; padding: 0 4px; border-radius: 12px; font-weight: 700; font-size: 13.5px; color: var(--dim); white-space: nowrap; transition: background .18s, color .18s, box-shadow .18s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--amber); color: var(--ink); box-shadow: 0 3px 12px rgba(244, 166, 42, .28); }
.seg button:focus-visible { outline-offset: -2px; }
/* #82-slika: izbor "Video / Slika" na ekranu objave - isti .seg izgled, samo 2 stupca umjesto 3 */
.seg.utype { grid-template-columns: repeat(2, 1fr); margin-bottom: 14px; }

.btn.dangerline { background: transparent; border-color: rgba(255, 141, 122, .5); color: #ff8d7a; }
.btn.dangerline:hover { background: rgba(229, 83, 61, .12); }
.btn.ulive, .ulive { margin-top: 10px; background: rgba(229, 83, 61, .14); border-color: rgba(229, 83, 61, .42); color: #ffb3a4; }
.ulive:hover { background: rgba(229, 83, 61, .22); }
.ulive svg { color: var(--paprika); }
.upriv { display: grid; gap: 8px; margin: 16px 0 0; padding: 14px 14px 4px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); }
.upriv .opt { margin: 4px 0 0; border-top: 1px solid var(--line); }

/* ------------------------------------------------------------ postavke (cijeli ekran) */
.sbody { padding-top: 0; }
.sgh { margin: 22px 4px 8px; font: 700 15.5px/1.2 var(--display); color: var(--amber2); }
.sgh:first-child { margin-top: 8px; }
.card.sgroup { margin: 0; padding: 2px 16px; }
.srow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 0; text-align: left; }
.srow + .srow { border-top: 1px solid var(--line); }
.srow.col { flex-direction: column; align-items: stretch; gap: 10px; }
.srow.col .st { flex: none; }
button.srow { cursor: pointer; transition: opacity .15s; }
button.srow:active { opacity: .7; }
.sico { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 12px; background: rgba(251, 241, 227, .08); color: var(--amber2); }
.sico svg { width: 18px; height: 18px; }
.sval { flex: none; min-width: 24px; padding: 3px 8px; border-radius: 999px; background: rgba(251, 241, 227, .08); font-weight: 800; font-size: 12.5px; line-height: 1.2; text-align: center; color: var(--dim); font-variant-numeric: tabular-nums; }
.sgo { flex: none; display: grid; opacity: .45; }
.sgo svg { width: 17px; height: 17px; }
.srow.danger .st b { color: #ff8d7a; }
.srow.danger .sico { color: #ff8d7a; background: rgba(229, 83, 61, .14); }

/* ------------------------------------------------------------ prozorčić o nalogu (dodir na ime ili sliku) */
.uhd { position: relative; flex: none; display: flex; align-items: center; gap: 12px; padding: 28px 56px 14px 18px; border-bottom: 1px solid var(--faint); }
.uhd .x { position: absolute; right: 10px; top: 14px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; }
.uhd .x:hover { background: rgba(251, 241, 227, .08); }
.uhd .x svg { width: 20px; height: 20px; }
.uhn { min-width: 0; display: grid; gap: 1px; }
.uhn b { display: flex; align-items: center; gap: 5px; min-width: 0; font: 700 italic 18px/1.2 var(--display); }
.uhn .hn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uhn > span { font-size: 13px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------ komentari: redoslijed, odgovori, oznaka Autor, spominjanje */
.csort { flex: none; display: flex; gap: 6px; padding: 10px 16px 2px; }
.csort button { padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line); font-weight: 700; font-size: 12.5px; color: var(--dim); transition: background .15s, color .15s; }
.csort button:hover { color: var(--text); }
.csort button.on { background: rgba(244, 166, 42, .16); border-color: transparent; color: var(--amber2); }
.c .cav { display: block; flex: none; border-radius: 34%; }
.c .cav:active .av { transform: scale(.95); }
.c .cn { display: inline; padding: 0; text-align: left; color: inherit; }
.c .cn:hover b { text-decoration: underline; }
.ch .t { white-space: nowrap; }
.ctag { flex: none; padding: 2px 7px; border-radius: 8px; background: rgba(43, 179, 163, .18); color: #5fd6c7; font: 800 10.5px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-style: normal; letter-spacing: .02em; }
.c.reply { margin-left: 46px; gap: 8px; padding: 6px 0; }
.c.reply .cl { width: 34px; }
.cdel { padding: 4px; }
.cdel[data-more] svg { width: 18px; height: 18px; }
.crep { display: inline-block; margin-top: 3px; padding: 3px 0; font-size: 12px; font-weight: 800; color: var(--dim); }
.crep:hover { color: var(--text); }
.men { color: var(--amber2); font-weight: 700; cursor: pointer; }
.men:hover { text-decoration: underline; }
.men:focus-visible { outline: 2px solid var(--amber2); outline-offset: 2px; border-radius: 4px; }
.men.off { color: var(--dim); font-weight: 600; cursor: default; }
.men.off:hover { text-decoration: none; }
.crb { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 8px 7px 16px; border-top: 1px solid var(--faint); background: rgba(244, 166, 42, .1); font-size: 12.5px; font-weight: 700; color: var(--amber2); }
.crb span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crb button { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; }
.crb button:hover { background: rgba(251, 241, 227, .08); }
.crb svg { width: 16px; height: 16px; }

/* ------------------------------------------------------------ mreža videa: oznake i postavke */
.tbadges { position: absolute; right: 7px; bottom: 7px; z-index: 1; display: flex; gap: 4px; pointer-events: none; }
.tb { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 8px; background: rgba(16, 12, 10, .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.tb svg { width: 13px; height: 13px; }
.tedit { position: absolute; right: 42px; top: 6px; z-index: 2; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: rgba(16, 12, 10, .68); }
.tedit svg { width: 15px; height: 15px; }

/* ------------------------------------------------------------ "Otkrij": uživo sada i nedavne pretrage */
.shrow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.hscroll.lives { gap: 10px; }
.lcard { position: relative; flex: none; width: 134px; height: 178px; border-radius: 20px; overflow: hidden; background: var(--card); border: 1px solid var(--line); text-align: left; color: #fff; cursor: pointer; }
.lcard > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }
/* #134 (23.9.): zamjena za img iznad kod pravih prenosa - nema poster sličice, pa BT.avatar (prava slika profila
   ili boja + slovo, isti izgled kao svuda drugo u aplikaciji) stoji centrirano preko var(--card) pozadine kartice.
   (.lc-views je uklonjen - nema pravog broja gledalaca prije nego se prenos otvori, vidi js/views.js.) */
.lcard-ph { position: absolute; inset: 0; display: grid; place-items: center; }
.lcard::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(16, 12, 10, .88), transparent 56%); pointer-events: none; }
.lcard .lv-badge { position: absolute; left: 8px; top: 8px; z-index: 1; }
.lc-info { position: absolute; left: 9px; right: 9px; bottom: 9px; z-index: 1; display: grid; gap: 1px; }
.lc-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 italic 14px/1.2 var(--display); }
.lc-info small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 11.5px; line-height: 1.25; color: rgba(251, 241, 227, .82); }
.lcard.go { display: grid; place-content: center; justify-items: center; gap: 6px; padding: 10px; text-align: center; background: linear-gradient(160deg, rgba(244, 166, 42, .22), rgba(229, 83, 61, .18)), var(--card); border: 1.5px dashed rgba(244, 166, 42, .55); }
.lcard.go::after { display: none; }
.lg-ico { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 17px; background: var(--paprika); color: #fff; box-shadow: 0 8px 22px rgba(229, 83, 61, .35); }
.lg-ico svg { width: 24px; height: 24px; }
.lcard.go b { font: 700 15px/1.2 var(--display); }
.lcard.go small { font-size: 11.5px; line-height: 1.3; color: var(--dim); }

/* ------------------------------------------------------------ profil: blokiran nalog, blokirani nalozi, pravila */
.pblocked { text-align: center; background: rgba(229, 83, 61, .07); border-color: rgba(229, 83, 61, .35); }
.pblocked p { margin-bottom: 0; }
/* #143 (24.9., privatan profil): isti oblik kao .pblocked iznad, samo neutralna boja (nije upozorenje/greška, samo stanje) */
.pprivate { text-align: center; background: rgba(138, 127, 116, .09); border-color: rgba(138, 127, 116, .3); }
.pprivate p { margin-bottom: 0; }
.brow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.bn { flex: 1; min-width: 0; display: grid; gap: 1px; }
.bn b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.bn span { font-size: 12.5px; color: var(--dim); }
.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.rules li { display: flex; align-items: flex-start; gap: 12px; }
.rn { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 11px; background: var(--amber); color: var(--ink); font: 800 14px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.rules li > div { display: grid; gap: 2px; min-width: 0; }
.rules li b { font-size: 14.5px; }
.rules li > div > span { font-size: 13px; line-height: 1.4; color: var(--dim); }

/* ------------------------------------------------------------ iPhone: kako dodati aplikaciju na početni ekran */
.ihb { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 18px calc(20px + var(--safe-b)); }
.ihb p { margin: 0 0 14px; font-size: 14px; line-height: 1.45; color: var(--dim); }
.ihb ol { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 13px; }
.ihb li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; line-height: 1.4; }
.ihn { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--amber); color: var(--ink); font: 800 13px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.ihi { display: inline-grid; place-items: center; width: 24px; height: 24px; margin: 0 2px; vertical-align: -6px; border-radius: 8px; background: rgba(251, 241, 227, .1); color: var(--amber2); }
.ihi svg { width: 15px; height: 15px; }

/* ------------------------------------------------------------ iPhone i Android: kad radi kao aplikacija (sa početnog ekrana) */
html.standalone body, html.native body { -webkit-touch-callout: none; }
html.standalone, html.standalone body { overscroll-behavior: none; }

/* uvod na iPhoneu u Safariju: savjet da se aplikacija prvo doda na početni ekran */
.ioswel { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; border-radius: 18px; background: rgba(244, 166, 42, .12); border: 1px solid rgba(244, 166, 42, .4); text-align: left; }
.ioswel > svg { flex: none; width: 24px; height: 24px; color: var(--amber2); }
.ioswel span { display: grid; gap: 1px; min-width: 0; }
.ioswel b { font-size: 13.5px; }
.ioswel small { font-size: 12px; line-height: 1.35; color: var(--dim); }
.ihnote { margin: -4px 0 16px !important; padding: 10px 12px; border-radius: 14px; background: rgba(251, 241, 227, .05); font-size: 12.5px !important; }
.uact .btn { padding: 0 10px; white-space: nowrap; }

/* ---- privatne poruke (27.9., js/messages.js) ---- */
.itabs { display: flex; gap: 6px; margin: 4px 0 10px; padding: 4px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.itabs button { flex: 1; height: 38px; border-radius: 12px; font-weight: 700; font-size: 14px; color: var(--dim); display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background .15s, color .15s; }
.itabs button.on { background: var(--card3); color: var(--text); }
.ibadge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--paprika); color: #fff; font-style: normal; font-weight: 800; font-size: 11px; line-height: 18px; }
.dmconvs .dmc { width: 100%; text-align: left; cursor: pointer; color: inherit; background: none; border-left: 0; border-right: 0; border-top: 0; font: inherit; }
.dmconvs .dmc.new { background: rgba(244, 166, 42, .1); }
.dmc .nb p small { color: var(--dim); font-weight: 400; }
.dmprev { display: block; font-size: 13px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dmc.new .dmprev { color: var(--text); font-weight: 600; }
.dmwhen { flex: none; display: grid; justify-items: end; gap: 6px; font-size: 11.5px; color: var(--dim); }
.dmdot { width: 10px; height: 10px; border-radius: 50%; background: var(--amber); }
.dmgate .btn { margin-top: 14px; }
.dmh { gap: 4px; border-bottom: 1px solid var(--line); }
.dmwho { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: left; padding: 4px; border-radius: 12px; color: inherit; }
.dmwho > span:last-child { min-width: 0; display: grid; gap: 2px; }
.dmwho b { font: 700 16px/1.2 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dmwho small { font-size: 12px; font-weight: 400; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dmlist { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 6px; }
.dmlist .empty-s { margin: auto 0; }
.dmload { margin: auto; color: var(--dim); font-size: 14px; }
.dmm { max-width: 78%; padding: 8px 12px 6px; border-radius: 18px 18px 18px 6px; background: var(--card2); align-self: flex-start; cursor: pointer; }
.dmm.me { align-self: flex-end; border-radius: 18px 18px 6px 18px; background: var(--amber); color: var(--ink); }
.dmm p { margin: 0; font-size: 15px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.dmt { display: block; margin-top: 2px; font-size: 10.5px; opacity: .62; text-align: right; }
.dmm.pic { padding: 4px; }
.dmpic { display: block; padding: 0; border-radius: 14px; overflow: hidden; background: none; }
.dmpic img { display: block; max-width: 100%; max-height: 320px; border-radius: 14px; }
.dmm.pic .dmt { padding: 2px 8px 2px; }
.dmrm { font-size: 13px; opacity: .8; }
.dmnote { margin: 0; padding: 10px 16px; font-size: 13px; color: var(--dim); text-align: center; border-top: 1px solid var(--line); }
.dmnote[hidden], .dmform[hidden] { display: none; }
.dmform { flex: none; display: flex; align-items: flex-end; gap: 6px; padding: 8px 10px calc(8px + var(--safe-b)); border-top: 1px solid var(--faint); }
.dmform textarea { flex: 1; min-width: 0; min-height: 42px; max-height: 120px; resize: none; border: 1px solid transparent; border-radius: 21px; background: var(--card2); color: var(--text); padding: 10px 16px; font: inherit; font-size: 15px; line-height: 1.35; outline: none; }
.dmform textarea:focus { border-color: var(--amber); }
.dmimg { flex: none; }
.dmimg svg { width: 24px; height: 24px; }
.dmlf { display: grid; gap: 10px; margin-top: 12px; }
.dmfl { display: grid; gap: 6px; font-size: 13px; color: var(--dim); text-align: left; }
.dmfl input { height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); color: var(--text); padding: 0 14px; font-size: 16px; outline: none; }
.dmfl input:focus { border-color: var(--amber); }
.dmfl[hidden], .dmerr[hidden], .dmalt[hidden] { display: none; }
.cbody .dmerr, .dmerr { margin: 0; color: #ff8d7a; font-size: 13px; text-align: left; }
.dmalt { margin: 2px 0 0; text-align: center; }
.sheet.dmimgview { padding: 12px; }
.sheet.dmimgview img { display: block; max-width: 100%; max-height: 75vh; margin: 36px auto 8px; border-radius: 14px; }
.sheet.dmimgview .x { position: absolute; right: 10px; top: 8px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: rgba(0, 0, 0, .4); }
.sheet.dmimgview .x svg { width: 20px; height: 20px; }
