@font-face { font-family: "FaCalibri"; src: url("calibri.ttf"), local("Calibri"); font-weight: 400; size-adjust: 118%; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200D; }
@font-face { font-family: "FaCalibri"; src: url("calibrib.ttf"), local("Calibri Bold"); font-weight: 700; size-adjust: 118%; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200D; }
@font-face { font-family: "Mali"; src: url("mali.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Mali"; src: url("mali-semibold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
:root { --bg:#0a100d; --panel:#101b16; --panel2:#17251b; --line:#2a3b30; --text:#f4f5ef; --muted:#9fb09d; --olive:#91ab58; --orange:#f28c28; --sky:#5aa9e6; --amber:#f2c94c; --coral:#e8705f; --teal:#3fb8a5; --violet:#a58be6; --ok:#6fcf7a; --err:#ff8a7a; --safe-b: env(safe-area-inset-bottom, 0px); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body { background: radial-gradient(900px 420px at 90% -10%, rgba(242,140,40,.12), transparent 60%), radial-gradient(700px 420px at 0% 25%, rgba(145,171,88,.10), transparent 60%), var(--bg); color: var(--text); font-family: "FaCalibri", "Mali", "Segoe UI", Tahoma, sans-serif; overflow-x: hidden; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.ltr { direction: ltr; text-align: left; unicode-bidi: plaintext; }

/* login */
.login { min-height: 100svh; display: grid; place-items: center; padding: 22px 16px; }
.login-card { width: min(420px, 100%); background: linear-gradient(180deg, rgba(255,255,255,.04), transparent 140px), var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 26px 22px 22px; box-shadow: 0 20px 60px #0009; animation: rise .5s ease-out both; }
.login-card .logo { display: block; width: 92px; margin: 0 auto 6px; animation: floaty 5s ease-in-out infinite; filter: drop-shadow(0 8px 18px rgba(0,0,0,.5)); }
.login-card h1 { margin: 0 0 4px; text-align: center; font-size: 26px; letter-spacing: .5px; }
.login-card .sub { margin: 0 0 18px; text-align: center; color: var(--muted); font-size: 14px; }
.fld { display: block; margin: 0 0 13px; font-size: 13.5px; color: #d5ddcb; }
.fld span { display: block; margin-bottom: 5px; }
.fld input, .compose textarea { width: 100%; height: 48px; padding: 0 13px; border-radius: 13px; border: 1px solid #34483a; background: #0b130e; font-size: 16px; transition: border-color .2s, box-shadow .2s; }
.fld input:focus, .compose textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(242,140,40,.28); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border: 1px solid #4b6853; border-radius: 13px; background: #1a2c22; font-weight: 700; transition: transform .12s, filter .2s; }
.btn:active { transform: scale(.97); }
.btn.pri { background: linear-gradient(180deg, #f6a04b, #ef7f1d); border-color: #f6a04b; color: #1b1205; width: 100%; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: .55; }
.err { min-height: 20px; margin: 4px 0 10px; color: var(--err); font-size: 13.5px; }
.linkrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; font-size: 13.5px; }
.linkrow a { color: var(--orange); text-decoration: none; font-weight: 700; }
.langsw { display: inline-flex; border: 1px solid #3a5040; border-radius: 999px; overflow: hidden; }
.langsw button { border: 0; background: transparent; padding: 6px 13px; font-size: 12.5px; color: #cfd9c6; }
.langsw button.on { background: var(--orange); color: #1b1205; font-weight: 700; }

/* shell */
.shell { min-height: 100svh; padding-bottom: calc(76px + var(--safe-b)); }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); background: rgba(10,16,13,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top img { width: 34px; height: 34px; object-fit: contain; }
.top b { font-size: 18px; flex: 1; }
.top .iconbtn { border: 1px solid #34483a; background: #12201a; border-radius: 10px; min-width: 38px; height: 36px; padding: 0 10px; }
.page { padding: 14px; max-width: 760px; margin: 0 auto; animation: rise .35s ease-out both; }
.tabs { position: fixed; z-index: 30; inset-inline: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 6px calc(6px + var(--safe-b)); background: rgba(12,20,16,.96); border-top: 1px solid var(--line); backdrop-filter: blur(10px); }
.tabs button { position: relative; border: 0; background: transparent; padding: 6px 2px; display: grid; justify-items: center; gap: 2px; color: var(--muted); font-size: 12px; border-radius: 12px; transition: color .2s, background .2s; }
.tabs button .ti { font-size: 21px; line-height: 1; }
.tabs button.on { color: var(--orange); background: rgba(242,140,40,.1); }
.badge { position: absolute; top: 2px; inset-inline-end: calc(50% - 22px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--orange); color: #1b1205; font-size: 11px; font-weight: 700; display: grid; place-items: center; }

/* cards */
.card { background: linear-gradient(180deg, rgba(255,255,255,.025), transparent 90px), var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.card.mine { border-color: var(--orange); box-shadow: 0 0 0 1px rgba(242,140,40,.35), 0 8px 26px rgba(242,140,40,.12); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.h2 { margin: 2px 0 10px; font-size: 15px; color: var(--olive); font-weight: 700; }
.muted { color: var(--muted); font-size: 13px; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #22362a; color: #cfe3c3; }
.chip.go { background: #3a2a10; color: #ffcf8a; } .chip.ok { background: #17331f; color: var(--ok); } .chip.bad { background: #3a1a17; color: var(--err); } .chip.me { background: var(--orange); color: #1b1205; }
.ld-title { font-size: 18px; font-weight: 700; }
.count { font-size: 26px; font-weight: 700; letter-spacing: 1px; direction: ltr; color: var(--amber); font-variant-numeric: tabular-nums; }
.names { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 14px; }
.names li { display: flex; gap: 8px; padding: 5px 8px; border-radius: 9px; background: #0d1711; }
.names li.me { background: rgba(242,140,40,.18); font-weight: 700; }
.names li i { color: var(--muted); font-style: normal; min-width: 22px; }
details.fold > summary { cursor: pointer; color: var(--sky); font-size: 13.5px; list-style: none; margin-top: 10px; }
details.fold > summary::-webkit-details-marker { display: none; }

/* folders */
.folders { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }
.folder { border: 1px solid var(--line); background: var(--panel); border-radius: 16px; padding: 14px 12px; text-align: start; display: grid; gap: 6px; border-top: 3px solid var(--c, var(--orange)); transition: transform .15s, border-color .2s; }
.folder:active { transform: scale(.97); }
.folder .fi { font-size: 26px; }
.folder b { font-size: 15px; }
.folder small { color: var(--muted); font-size: 12px; }
.kv { display: grid; grid-template-columns: 1fr; }
.kv > div { display: flex; justify-content: space-between; gap: 14px; padding: 10px 2px; border-bottom: 1px solid #1e2e24; font-size: 14.5px; }
.kv > div span:first-child { color: var(--muted); }
.kv > div span:last-child { text-align: end; font-weight: 700; word-break: break-word; }
.backrow { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: #22362a; display: grid; place-items: center; font-size: 28px; border: 2px solid var(--orange); }
.docrow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #1e2e24; }

/* messages */
.thread { display: grid; gap: 8px; margin-bottom: 12px; }
.msg { max-width: 86%; padding: 9px 12px; border-radius: 14px; font-size: 14.5px; white-space: pre-wrap; word-break: break-word; background: #1a2c22; border: 1px solid #2b4332; }
.msg.staff { justify-self: start; background: #2a2310; border-color: #5a4a1c; }
.msg.mine { justify-self: end; }
.msg small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.compose { position: sticky; bottom: calc(70px + var(--safe-b)); display: flex; gap: 8px; align-items: flex-end; background: var(--bg); padding: 8px 0; }
.compose textarea { height: 48px; min-height: 48px; padding: 12px 13px; resize: none; }

.note { display: flex; gap: 11px; padding: 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 9px; }
.note.new { border-color: var(--orange); background: #1d1a10; }
.note .ni { font-size: 22px; }
.empty { text-align: center; color: var(--muted); padding: 34px 10px; }
.toast { position: fixed; z-index: 60; inset-inline: 14px; bottom: calc(86px + var(--safe-b)); margin: 0 auto; max-width: 420px; padding: 12px 14px; border-radius: 14px; background: #1a2c22; border: 1px solid #4b6853; text-align: center; animation: rise .25s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.chk { display: flex; align-items: center; gap: 9px; margin: 2px 0 8px; font-size: 14px; color: #d5ddcb; }
.chk input { width: 18px; height: 18px; accent-color: var(--orange); }
