:root{--green:#2fc976;--green2:#22b866;--ink:#14231c;--muted:#6f7d76;--line:#e7eee9;--bg:#f6f8f7;--danger:#df4b4b;--shadow:0 10px 30px rgba(23,50,37,.08)}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;font-family:Tahoma,Arial,sans-serif;background:var(--bg);color:var(--ink);direction:rtl}a{text-decoration:none;color:inherit}button,input,select,textarea{font:inherit}.app-main{min-height:calc(100vh - 150px)}.app-shell{width:min(1120px,calc(100% - 28px));margin:auto}.app-topbar{position:sticky;top:0;z-index:50;background:rgba(255,255,255,.96);backdrop-filter:blur(10px);border-bottom:1px solid var(--line)}.topbar-inner{height:66px;display:flex;align-items:center;gap:28px}.app-brand{display:flex;align-items:center;gap:9px;font-size:21px}.brand-dots{display:flex;gap:3px}.brand-dots i{width:7px;height:7px;border-radius:50%;background:var(--green)}.desktop-app-nav{display:flex;align-items:center;gap:22px;color:#425048;font-size:14px;flex:1}.desktop-app-nav a:hover{color:var(--green2)}.desktop-app-nav em{font-style:normal;background:var(--danger);color:#fff;padding:2px 6px;border-radius:999px;font-size:11px}.guest-actions{display:flex;gap:10px;align-items:center}.green-pill,.btn-primary{border:0;background:var(--green);color:#fff;padding:11px 18px;border-radius:12px;cursor:pointer}.green-pill:hover,.btn-primary:hover{background:var(--green2)}.top-avatar,.avatar{display:grid;place-items:center;border-radius:50%;overflow:hidden;background:#e9f8f0;color:var(--green2);font-weight:700}.top-avatar{width:42px;height:42px}.top-avatar img,.avatar img{width:100%;height:100%;object-fit:cover}.flash{width:min(760px,calc(100% - 28px));margin:16px auto 0;padding:12px 14px;border-radius:12px}.flash.success{background:#e9f8f0;color:#116e3d}.flash.error{background:#fff0f0;color:#a62626}.page-wrap{padding:28px 0 80px}.grid-main{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:22px;align-items:start}.card{background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow)}.card-pad{padding:20px}.section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}.section-head h1,.section-head h2,.section-head h3{margin:0}.muted{color:var(--muted)}.small{font-size:12px}.form-card{width:min(620px,calc(100% - 28px));margin:34px auto;padding:26px}.form-card h1{margin-top:0}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.field{display:flex;flex-direction:column;gap:7px}.field.full{grid-column:1/-1}.field label{font-size:13px;color:#49564f}.field input,.field select,.field textarea,.searchbar input,.searchbar select{width:100%;border:1px solid #dfe7e2;border-radius:12px;background:#fff;padding:12px 13px;outline:0}.field input:focus,.field select:focus,.field textarea:focus,.searchbar input:focus,.searchbar select:focus{border-color:var(--green);box-shadow:0 0 0 3px rgba(47,201,118,.12)}.field textarea{min-height:110px;resize:vertical}.help{font-size:12px;color:var(--muted)}.error-list{background:#fff1f1;color:#9e2727;border:1px solid #ffd9d9;padding:12px 16px;border-radius:12px;margin-bottom:16px}.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:12px;border:1px solid var(--line);padding:10px 14px;background:#fff;cursor:pointer}.btn:hover{border-color:#cbd8d0}.btn-danger{color:#b22f2f;border-color:#f0caca}.btn-soft{background:#edf9f3;color:#167b47;border-color:#d8f2e5}.btn-block{width:100%}.online-strip{display:flex;gap:13px;overflow:auto;padding:4px 2px 10px;scrollbar-width:none}.online-user{min-width:68px;text-align:center;font-size:12px;color:#4b5952}.online-user .avatar{width:54px;height:54px;margin:auto;border:2px solid var(--green);box-shadow:0 0 0 3px #e8f9f0}.online-user b{display:block;margin-top:6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.composer{padding:18px;margin-bottom:18px}.composer textarea{width:100%;border:0;resize:vertical;min-height:82px;outline:0;font-size:15px}.composer-foot{display:flex;justify-content:space-between;gap:12px;align-items:center;border-top:1px solid var(--line);padding-top:12px}.composer-file{font-size:13px;color:#4f5e56}.post-card{padding:18px;margin-bottom:18px}.post-head{display:flex;align-items:center;gap:11px}.post-head .avatar{width:48px;height:48px}.post-meta{flex:1}.post-meta b{display:block}.post-meta small{color:var(--muted)}.post-menu{display:flex;gap:6px}.post-body{line-height:1.9;margin:15px 0;white-space:pre-wrap}.post-image{width:100%;max-height:620px;object-fit:cover;border-radius:14px;background:#eef2ef}.post-actions{display:flex;gap:12px;border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:10px 0;margin-top:12px}.action-btn{border:0;background:transparent;cursor:pointer;padding:6px 8px;border-radius:9px}.action-btn:hover{background:#f4f7f5}.action-btn.liked{color:#e23957}.comment-list{display:flex;flex-direction:column;gap:9px;margin-top:13px}.comment{background:#f7f9f8;border-radius:12px;padding:10px 12px}.comment b{font-size:13px}.comment p{margin:4px 0 0;font-size:13px;line-height:1.7}.comment-form{display:flex;gap:8px;margin-top:10px}.comment-form input{flex:1;border:1px solid var(--line);border-radius:12px;padding:10px}.side-card{padding:18px;position:sticky;top:86px}.mini-list{display:flex;flex-direction:column;gap:12px}.mini-user{display:flex;align-items:center;gap:10px}.mini-user .avatar{width:42px;height:42px}.mini-user div{min-width:0}.mini-user b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mini-user small{color:var(--muted)}.profile-hero{overflow:hidden}.profile-cover{height:150px;background:linear-gradient(135deg,#dff9ea,#eef7ff)}.profile-info{padding:0 22px 22px;margin-top:-48px}.profile-avatar{width:96px;height:96px;border:5px solid #fff;border-radius:50%;overflow:hidden;background:#e9f8f0;display:grid;place-items:center;font-size:30px;color:var(--green2);font-weight:700}.profile-avatar img{width:100%;height:100%;object-fit:cover}.profile-name-row{display:flex;align-items:flex-start;justify-content:space-between;gap:15px;margin-top:12px}.profile-name-row h1{font-size:24px;margin:0 0 6px}.profile-tags{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}.tag{background:#f2f6f3;border:1px solid var(--line);border-radius:999px;padding:7px 11px;font-size:12px}.bio{line-height:1.9;color:#425048}.gallery{display:grid;grid-template-columns:repeat(4,1fr);gap:9px}.gallery-item{position:relative;aspect-ratio:1/1}.gallery img{width:100%;height:100%;object-fit:cover;border-radius:12px}.gallery-item form{position:absolute;left:6px;top:6px}.gallery-item button{border:0;background:rgba(0,0,0,.6);color:#fff;border-radius:8px;cursor:pointer}.searchbar{display:grid;grid-template-columns:1.3fr repeat(4,1fr) auto;gap:10px;margin-bottom:18px}.user-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}.user-card{padding:16px;text-align:center}.user-card .avatar{width:84px;height:84px;margin:0 auto 10px;font-size:26px}.online-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--green);margin-left:5px}.messages-layout{display:grid;grid-template-columns:330px minmax(0,1fr);gap:18px;min-height:620px}.conversation-list{overflow:hidden}.conversation-item{display:flex;gap:10px;padding:13px;border-bottom:1px solid var(--line);align-items:center}.conversation-item:hover,.conversation-item.active{background:#f2fbf6}.conversation-item .avatar{width:46px;height:46px;flex:none}.conversation-item .copy{min-width:0;flex:1}.conversation-item b,.conversation-item small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-card{display:flex;flex-direction:column;min-height:620px}.chat-head{display:flex;align-items:center;gap:10px;padding:14px 16px;border-bottom:1px solid var(--line)}.chat-head .avatar{width:44px;height:44px}.chat-messages{flex:1;padding:16px;display:flex;flex-direction:column;gap:9px;overflow:auto;max-height:520px}.bubble{max-width:75%;padding:10px 12px;border-radius:15px;background:#f0f4f2;align-self:flex-start}.bubble.mine{background:#dcf8e8;align-self:flex-end}.bubble small{display:block;margin-top:5px;color:var(--muted);font-size:10px}.bubble img{max-width:260px;border-radius:10px;display:block;margin-bottom:6px}.chat-form{display:grid;grid-template-columns:1fr auto auto;gap:8px;padding:12px;border-top:1px solid var(--line)}.chat-form input[type=text]{border:1px solid var(--line);border-radius:12px;padding:11px}.chat-form input[type=file]{max-width:150px}.empty-state{text-align:center;padding:50px 20px;color:var(--muted)}.admin-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.stat-card{padding:20px}.stat-card b{font-size:28px;display:block}.admin-table-wrap{overflow:auto}.admin-table{width:100%;border-collapse:collapse;font-size:13px}.admin-table th,.admin-table td{padding:10px;border-bottom:1px solid var(--line);text-align:right;white-space:nowrap}.status-active{color:#18814d}.status-suspended{color:#ba3434}.app-footer{background:#fff;border-top:1px solid var(--line);margin-top:40px}.footer-simple{min-height:86px;display:flex;align-items:center;justify-content:space-between;gap:18px;color:var(--muted);font-size:13px}.footer-simple nav{display:flex;gap:15px}.mobile-bottom-nav{display:none}.nav-dot{display:inline-block;width:6px;height:6px;background:#e34747;border-radius:50%;margin-right:2px}.inline-form{display:inline}.danger-text{color:var(--danger)}.badge{display:inline-block;padding:4px 8px;border-radius:999px;background:#f1f5f2;font-size:11px}.report-form{display:flex;gap:7px;align-items:center;flex-wrap:wrap}.report-form select,.report-form input{border:1px solid var(--line);border-radius:9px;padding:8px}.divider{height:1px;background:var(--line);margin:18px 0}.notice{background:#fffbe8;border:1px solid #f1e8aa;border-radius:12px;padding:12px 14px;color:#70652b;font-size:13px}.tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}.tabs a{padding:9px 12px;border-radius:10px;background:#fff;border:1px solid var(--line)}.tabs a.active{background:#eaf9f1;color:#147a45;border-color:#cfefde}@media(max-width:900px){.desktop-app-nav{display:none}.grid-main{grid-template-columns:1fr}.side-card{position:static}.user-grid{grid-template-columns:repeat(2,1fr)}.searchbar{grid-template-columns:1fr 1fr}.searchbar .wide{grid-column:1/-1}.messages-layout{grid-template-columns:1fr}.conversation-list{max-height:300px}.admin-grid{grid-template-columns:1fr 1fr}.footer-simple{padding-bottom:74px}}@media(max-width:700px){body{padding-bottom:68px}.app-shell{width:min(100% - 18px,1120px)}.topbar-inner{height:58px}.guest-actions{font-size:13px}.form-card{margin:16px auto;padding:18px}.form-grid{grid-template-columns:1fr}.field.full{grid-column:auto}.page-wrap{padding-top:14px}.card{border-radius:14px}.profile-cover{height:110px}.profile-info{padding:0 14px 16px;margin-top:-40px}.profile-avatar{width:80px;height:80px}.profile-name-row{flex-direction:column}.gallery{grid-template-columns:repeat(3,1fr)}.user-grid{grid-template-columns:repeat(2,1fr);gap:9px}.user-card{padding:12px}.user-card .avatar{width:68px;height:68px}.searchbar{grid-template-columns:1fr 1fr}.searchbar button,.searchbar .wide{grid-column:1/-1}.messages-layout{gap:10px}.chat-card{min-height:520px}.chat-messages{max-height:440px}.chat-form{grid-template-columns:1fr auto}.chat-form input[type=file]{grid-column:1/-1;max-width:none}.admin-grid{grid-template-columns:1fr}.footer-simple{display:none}.mobile-bottom-nav{position:fixed;display:grid;grid-template-columns:repeat(5,1fr);bottom:0;right:0;left:0;height:66px;background:#fff;border-top:1px solid var(--line);z-index:60;padding-bottom:env(safe-area-inset-bottom)}.mobile-bottom-nav a{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:2px;color:#68766f;font-size:18px}.mobile-bottom-nav small{font-size:10px}.mobile-bottom-nav .newpost span{display:grid;place-items:center;background:var(--green);color:white;border-radius:50%;width:38px;height:38px;margin-top:-18px;box-shadow:0 7px 18px rgba(47,201,118,.28)}.post-card{padding:13px}.composer{padding:14px}.post-head .avatar{width:43px;height:43px}.bubble{max-width:88%}}


/* =========================================================
   TORAN MOBILE APP UI
   Single mobile interface for phone + desktop
   ========================================================= */

html{
    background:#eef1f0;
}

body{
    margin:0;
    background:#eef1f0;
    overflow-x:hidden;
}

.toran-app{
    width:100%;
    max-width:480px;
    min-height:100vh;
    margin:0 auto;
    background:#f7f8f8;
    position:relative;
    box-shadow:0 0 45px rgba(0,0,0,.08);
}

.app-shell{
    width:100% !important;
    max-width:100% !important;
    margin:0 !important;
}

.app-main{
    min-height:calc(100vh - 64px);
    padding-bottom:88px;
}

/* ---------- header ---------- */

.app-topbar{
    height:62px;
    position:sticky;
    top:0;
    z-index:100;
    background:rgba(255,255,255,.97);
    border-bottom:1px solid #edf0ee;
    backdrop-filter:blur(18px);
}

.topbar-inner{
    width:100%;
    height:62px;
    padding:0 16px;
    display:grid;
    grid-template-columns:42px 1fr 42px;
    align-items:center;
}

.app-brand{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:7px;
    font-size:22px;
    font-weight:800;
    color:#15231c;
}

.brand-dots{
    display:flex;
    gap:3px;
}

.brand-dots i{
    width:6px;
    height:6px;
    border-radius:50%;
    background:#25c875;
}

.header-avatar{
    width:38px;
    height:38px;
    border-radius:50%;
    overflow:hidden;
    display:grid;
    place-items:center;
    background:#e7f8ef;
    color:#1aae64;
    font-weight:700;
}

.header-avatar img{
    width:100%;
    height:100%;
    object-fit:cover;
}

.header-action{
    width:38px;
    height:38px;
    border-radius:50%;
    display:grid;
    place-items:center;
    position:relative;
    background:#f6f8f7;
}

.header-icon{
    font-size:23px;
    line-height:1;
}

.header-badge{
    position:absolute;
    top:-3px;
    left:-3px;
    min-width:17px;
    height:17px;
    padding:0 4px;
    border-radius:9px;
    display:grid;
    place-items:center;
    background:#ef4057;
    color:white;
    font-size:9px;
}

.header-login{
    color:#20b96a;
    font-size:13px;
}

/* ---------- remove desktop layout ---------- */

.desktop-app-nav,
.app-footer,
.side-card{
    display:none !important;
}

.page-wrap{
    padding:0 0 12px !important;
}

.grid-main{
    display:block !important;
}

/* ---------- cards ---------- */

.card{
    border:0;
    border-radius:0;
    box-shadow:none;
    background:#fff;
}

.card-pad{
    padding:16px;
}

/* ---------- online people ---------- */

.page-wrap .card-pad:first-child{
    margin:0 0 8px !important;
    padding:15px 14px 12px;
}

.section-head{
    margin-bottom:12px;
}

.section-head h2{
    font-size:16px;
}

.online-strip{
    gap:13px;
    padding:2px 1px 4px;
    overflow-x:auto;
    scrollbar-width:none;
}

.online-strip::-webkit-scrollbar{
    display:none;
}

.online-user{
    min-width:62px;
    max-width:62px;
    font-size:11px;
}

.online-user .avatar{
    width:58px;
    height:58px;
    border:2px solid #28ca76;
    box-shadow:0 0 0 3px #e8faef;
}

.online-user b{
    margin-top:7px;
    font-weight:500;
}

/* ---------- composer ---------- */

.composer{
    margin:0 0 8px !important;
    padding:14px 15px;
}

.composer textarea{
    min-height:68px;
    padding:7px 2px;
    font-size:14px;
    line-height:1.9;
    background:transparent;
}

.composer-foot{
    padding-top:11px;
}

.composer-file{
    display:flex;
    align-items:center;
    gap:5px;
    cursor:pointer;
}

.composer-file input{
    max-width:175px;
    font-size:11px;
}

.btn-primary{
    background:#28c875;
    border-radius:11px;
    padding:9px 19px;
    font-size:13px;
}

/* ---------- feed ---------- */

.post-card{
    padding:0 !important;
    margin:0 0 8px !important;
    overflow:hidden;
}

.post-head{
    padding:14px 14px 8px;
    gap:10px;
}

.post-head .avatar{
    width:45px;
    height:45px;
    flex:0 0 45px;
}

.post-meta b{
    font-size:14px;
}

.post-meta small{
    display:block;
    margin-top:3px;
    font-size:11px;
}

.post-menu select{
    max-width:68px;
    border:0;
    background:transparent;
    color:#849087;
    font-size:11px;
}

.post-body{
    margin:3px 0 11px;
    padding:0 15px;
    font-size:14px;
    line-height:1.9;
}

.post-image{
    display:block;
    width:100%;
    max-height:none;
    border-radius:0;
    object-fit:cover;
    background:#f0f2f1;
}

.post-actions{
    margin:0;
    padding:9px 12px;
    border-top:0;
    border-bottom:1px solid #f0f2f1;
    gap:5px;
}

.post-actions .action-btn{
    font-size:14px;
    padding:7px 10px;
}

.action-btn.liked{
    color:#ed3655;
}

.comment-list{
    margin:0;
    padding:8px 13px 0;
}

.comment{
    border-radius:14px;
    padding:8px 11px;
}

.comment-form{
    padding:9px 13px 13px;
    margin:0;
}

.comment-form input{
    background:#f5f7f6;
    border:0;
    border-radius:18px;
    padding:10px 13px;
}

.comment-form .btn{
    border:0;
    color:#20b96a;
    background:transparent;
}

/* ---------- profile ---------- */

.profile-hero{
    border-radius:0 !important;
}

.profile-cover{
    height:135px;
}

.profile-info{
    padding:0 16px 18px;
}

.profile-avatar{
    width:88px;
    height:88px;
}

.profile-name-row h1{
    font-size:20px;
}

.gallery{
    grid-template-columns:repeat(3,1fr);
    gap:3px;
}

.gallery img{
    border-radius:2px;
}

/* ---------- search ---------- */

.searchbar{
    padding:12px;
    margin:0 0 8px;
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
    background:white;
}

.searchbar .wide,
.searchbar button{
    grid-column:1/-1;
}

.user-grid{
    padding:7px;
    grid-template-columns:repeat(2,1fr) !important;
    gap:7px;
}

.user-card{
    border-radius:14px;
    padding:14px 8px;
}

.user-card .avatar{
    width:76px;
    height:76px;
}

/* ---------- messages ---------- */

.messages-layout{
    display:block !important;
    min-height:0;
}

.conversation-list{
    border-radius:0;
    max-height:none;
}

.conversation-item{
    padding:13px 15px;
}

.chat-card{
    border-radius:0;
    min-height:calc(100vh - 135px);
}

.chat-messages{
    max-height:calc(100vh - 230px);
}

.bubble{
    max-width:82%;
}

/* ---------- forms ---------- */

.form-card{
    width:100%;
    margin:0;
    min-height:calc(100vh - 62px);
    border-radius:0;
    padding:20px 16px 90px;
}

.form-grid{
    grid-template-columns:1fr;
}

.field.full{
    grid-column:auto;
}

/* ---------- flash ---------- */

.flash{
    width:calc(100% - 24px);
    margin:10px auto;
    border-radius:12px;
    font-size:13px;
}

/* ---------- bottom navigation ---------- */

.mobile-bottom-nav{
    position:fixed;
    z-index:200;
    bottom:0;
    right:50%;
    transform:translateX(50%);
    width:100%;
    max-width:480px;
    height:68px;
    display:grid !important;
    grid-template-columns:repeat(5,1fr);
    align-items:center;
    background:rgba(255,255,255,.98);
    border-top:1px solid #e8ece9;
    padding-bottom:env(safe-area-inset-bottom);
    box-shadow:0 -5px 22px rgba(0,0,0,.04);
}

.mobile-bottom-nav a{
    height:100%;
    position:relative;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:2px;
    color:#89938d;
}

.mobile-bottom-nav .nav-icon{
    font-size:23px;
    line-height:1;
}

.mobile-bottom-nav small{
    font-size:9px;
}

.mobile-bottom-nav a.active{
    color:#22bd6c;
}

.mobile-bottom-nav .newpost span{
    width:46px;
    height:46px;
    margin-top:-25px;
    display:grid;
    place-items:center;
    border-radius:50%;
    background:#27c875;
    color:#fff;
    font-size:29px;
    border:4px solid white;
    box-shadow:0 7px 20px rgba(39,200,117,.32);
}

.nav-dot{
    position:absolute;
    top:12px;
    left:27%;
    width:7px;
    height:7px;
    border-radius:50%;
    background:#ef4057;
}

/* ---------- desktop = same mobile app ---------- */

@media(min-width:481px){

    body{
        padding-bottom:0 !important;
    }

    .toran-app{
        border-left:1px solid #e3e8e5;
        border-right:1px solid #e3e8e5;
    }

}

/* ---------- very small phones ---------- */

@media(max-width:360px){

    .topbar-inner{
        padding:0 11px;
    }

    .online-user{
        min-width:58px;
        max-width:58px;
    }

    .online-user .avatar{
        width:53px;
        height:53px;
    }

}

/* ===== TORAN SOCIAL FEED V2 ===== */

body{
    background:#dfe3e1;
}

.toran-app{
    background:#fff;
}

/* feed header */
.feed-title-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:3px 2px 12px;
}

.feed-title-row strong{
    font-size:20px;
    font-weight:800;
    direction:ltr;
}

.feed-title-row a{
    font-size:11px;
    color:#8a918d;
}

/* stories */
.stories-section{
    background:#fff;
    padding:12px 12px 11px;
    border-bottom:1px solid #eeeeee;
}

.stories-section .online-strip{
    gap:11px;
}

.stories-section .online-user{
    min-width:57px;
    max-width:57px;
}

.stories-section .online-user .avatar{
    width:52px;
    height:52px;
    border:2px solid #ffb11b;
    box-shadow:none;
    padding:2px;
    background:white;
}

.stories-section .online-user .avatar img{
    border-radius:50%;
}

.stories-section .online-user b{
    font-size:10px;
    color:#333;
    font-weight:500;
}

/* composer much smaller */
.composer{
    margin:0 !important;
    padding:12px 14px !important;
    border-bottom:7px solid #f2f3f3;
}

.composer textarea{
    min-height:48px;
    font-size:13px;
}

.composer-foot{
    padding-top:7px;
}

/* post becomes image-first */
.post-card{
    margin:0 !important;
    border-bottom:8px solid #f0f2f1 !important;
}

.post-head{
    min-height:58px;
    padding:10px 12px;
}

.post-head .avatar{
    width:38px;
    height:38px;
    flex-basis:38px;
}

.post-meta b{
    font-size:13px;
}

.post-meta small{
    font-size:10px;
}

.post-body{
    font-size:14px;
    padding:5px 13px 11px;
    margin:0;
}

.post-image{
    width:100%;
    aspect-ratio:1 / .92;
    object-fit:cover;
}

/* interaction row like social apps */
.post-actions{
    height:48px;
    padding:5px 9px;
    display:flex;
    align-items:center;
    border:0;
}

.post-actions .action-btn{
    font-size:15px;
    font-weight:500;
}

.post-actions .action-btn:first-child{
    font-size:17px;
}

/* comments less bulky */
.comment-list{
    padding-top:2px;
}

.comment{
    background:transparent;
    padding:4px 3px;
}

.comment p{
    display:inline;
}

.comment-form{
    border-top:1px solid #f4f4f4;
}

/* remove empty giant area feeling */
.empty-state{
    min-height:180px;
    display:grid;
    place-items:center;
    border-radius:0;
    background:white;
    font-size:13px;
}

/* header closer to reference */
.app-topbar{
    border-bottom:0;
}

.topbar-inner{
    height:58px;
}

.app-brand b{
    font-size:21px;
}

.header-action{
    background:transparent;
}

.header-avatar{
    background:#f1f3f2;
}

/* bottom navigation */
.mobile-bottom-nav{
    height:64px;
    border-top:1px solid #eeeeee;
    box-shadow:0 -3px 15px rgba(0,0,0,.035);
}

.mobile-bottom-nav .newpost span{
    background:#111;
    width:52px;
    height:36px;
    border-radius:20px;
    border:0;
    margin-top:-7px;
    box-shadow:none;
    font-size:25px;
}

.mobile-bottom-nav a.active{
    color:#111;
}

.mobile-bottom-nav small{
    font-size:9px;
}

/* Desktop still shows EXACT mobile app */
@media(min-width:481px){
    .toran-app{
        min-height:100vh;
    }
}

/* ===== CREATE POST ===== */

.create-post-page{
    min-height:calc(100vh - 62px);
    background:#fff;
    padding-bottom:85px;
}

.create-post-head{
    height:55px;
    padding:0 15px;
    display:grid;
    grid-template-columns:40px 1fr 40px;
    align-items:center;
    border-bottom:1px solid #eee;
    text-align:center;
}

.create-post-head strong{
    font-size:16px;
}

.create-close{
    width:34px;
    height:34px;
    display:grid;
    place-items:center;
    font-size:28px;
    border-radius:50%;
    background:#f4f5f5;
}

.create-post-form{
    padding:16px;
}

.create-user{
    display:flex;
    align-items:center;
    gap:10px;
    margin-bottom:14px;
}

.create-user .avatar{
    width:43px;
    height:43px;
}

.create-user b{
    font-size:14px;
}

.create-post-form textarea{
    width:100%;
    min-height:180px;
    border:0;
    outline:0;
    resize:none;
    font-size:16px;
    line-height:2;
    padding:5px 0;
}

.create-photo{
    min-height:54px;
    border-top:1px solid #eee;
    border-bottom:1px solid #eee;
    display:flex;
    align-items:center;
    gap:10px;
    cursor:pointer;
}

.create-photo span{
    font-size:24px;
}

.create-photo strong{
    font-size:13px;
}

.create-photo input{
    margin-right:auto;
    max-width:180px;
    font-size:11px;
}

.create-submit{
    width:100%;
    height:48px;
    margin-top:18px;
    border:0;
    border-radius:14px;
    background:#111;
    color:#fff;
    font-weight:700;
    cursor:pointer;
}



/* =========================================================
   TORAN HOME - REFERENCE FEED
   ========================================================= */

body:has(.ref-feed) .app-topbar{
    display:none !important;
}

body:has(.ref-feed) .app-main{
    padding-bottom:72px;
}

body:has(.ref-feed) .toran-app{
    background:#fff;
}

.ref-feed{
    background:#fff;
    min-height:100vh;
    direction:rtl;
}

/* top */

.ref-feed-header{
    height:62px;
    display:flex;
    direction:ltr;
    align-items:center;
    justify-content:space-between;
    padding:0 15px;
    background:#fff;
}

.ref-feed-tabs{
    display:flex;
    align-items:center;
    gap:17px;
}

.ref-feed-tabs strong{
    font-size:21px;
    color:#111;
    font-weight:800;
}

.ref-feed-tabs span{
    color:#999;
    font-size:15px;
}

.ref-feed-tools{
    display:flex;
    align-items:center;
    gap:17px;
}

.ref-feed-tools a{
    color:#111;
    font-size:25px;
    line-height:1;
}

/* stories */

.ref-stories{
    direction:ltr;
    height:92px;
    padding:3px 10px 10px;
    display:flex;
    align-items:flex-start;
    gap:10px;
    overflow-x:auto;
    border-bottom:1px solid #eeeeee;
    scrollbar-width:none;
}

.ref-stories::-webkit-scrollbar{
    display:none;
}

.ref-story{
    width:58px;
    min-width:58px;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:5px;
}

.ref-story-ring{
    width:53px;
    height:53px;
    border-radius:50%;
    padding:2px;
    border:2px solid #f2a51b;
    display:grid;
    place-items:center;
    position:relative;
    background:#fff;
    overflow:visible;
}

.ref-story-ring img{
    width:100%;
    height:100%;
    object-fit:cover;
    border-radius:50%;
}

.ref-story-ring b{
    width:100%;
    height:100%;
    border-radius:50%;
    display:grid;
    place-items:center;
    background:#f0f2f1;
    color:#555;
}

.ref-story-ring.me{
    border-color:#111;
}

.ref-story-ring i{
    position:absolute;
    right:-2px;
    bottom:-2px;
    width:17px;
    height:17px;
    display:grid;
    place-items:center;
    border-radius:50%;
    background:#111;
    border:2px solid #fff;
    color:#fff;
    font-size:12px;
    font-style:normal;
}

.ref-story small{
    direction:rtl;
    width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    text-align:center;
    color:#444;
    font-size:9px;
}

/* posts */

.ref-posts{
    background:#fff;
}

.ref-post{
    background:#fff;
    margin:0 !important;
    border:0 !important;
    border-radius:0 !important;
    box-shadow:none !important;
    padding:0 !important;
}

.ref-post + .ref-post{
    border-top:7px solid #f3f3f3 !important;
}

.ref-post-user{
    min-height:57px;
    padding:8px 12px;
    display:flex;
    align-items:center;
    gap:9px;
}

.ref-post-avatar{
    width:39px;
    height:39px;
    flex:0 0 39px;
    border-radius:50%;
    overflow:hidden;
    display:grid;
    place-items:center;
    background:#eee;
}

.ref-post-avatar img{
    width:100%;
    height:100%;
    object-fit:cover;
}

.ref-post-user-copy{
    flex:1;
    min-width:0;
}

.ref-post-user-copy strong{
    display:block;
    color:#111;
    font-size:13px;
}

.ref-post-user-copy small{
    display:block;
    margin-top:2px;
    color:#969696;
    font-size:9px;
}

.ref-more{
    border:0;
    background:none;
    font-size:18px;
    letter-spacing:1px;
    color:#555;
    cursor:pointer;
    padding:8px;
}

.ref-post-media{
    width:100%;
    background:#efefef;
}

.ref-post-media img{
    display:block;
    width:100%;
    height:auto;
    max-height:610px;
    object-fit:cover;
}

/* actions */

.ref-post-actions{
    min-height:43px;
    padding:5px 11px;
    display:flex;
    direction:ltr;
    align-items:center;
    justify-content:space-between;
}

.ref-actions-main{
    display:flex;
    align-items:center;
    gap:13px;
}

.ref-action,
.ref-save{
    border:0;
    background:none;
    padding:3px;
    display:flex;
    align-items:center;
    gap:4px;
    cursor:pointer;
    color:#222;
}

.ref-action span,
.ref-save{
    font-size:22px;
    line-height:1;
}

.ref-action b{
    font-size:10px;
    font-weight:500;
}

.ref-action.liked{
    color:#e83955;
}

.ref-action.liked span{
    color:#e83955;
}

/* caption */

.ref-caption{
    direction:rtl;
    padding:0 12px 5px;
    font-size:12px;
    line-height:1.8;
}

.ref-caption strong{
    margin-left:5px;
}

.ref-post-time{
    direction:rtl;
    padding:0 12px 8px;
    color:#999;
    font-size:9px;
}

/* comments */

.ref-comments{
    margin:0 !important;
    padding:3px 12px !important;
}

.ref-comments .comment{
    direction:rtl;
    background:transparent;
    padding:3px 0;
    font-size:11px;
}

.ref-comments .comment strong{
    margin-left:5px;
}

.ref-comments .comment button{
    border:0;
    background:none;
    color:#aaa;
    cursor:pointer;
}

.ref-comment-form{
    margin:0 !important;
    padding:7px 12px 11px !important;
    border-top:1px solid #f4f4f4;
    display:flex;
    gap:7px;
}

.ref-comment-form input{
    flex:1;
    height:34px;
    border:0 !important;
    outline:0;
    background:#f5f5f5 !important;
    border-radius:18px !important;
    padding:0 12px !important;
    font-size:11px;
}

.ref-comment-form button{
    border:0;
    background:none;
    color:#111;
    font-size:11px;
    font-weight:700;
}

/* empty */

.ref-empty{
    min-height:330px;
    padding:80px 25px;
    text-align:center;
    background:#fff;
}

.ref-empty strong{
    display:block;
    font-size:16px;
}

.ref-empty p{
    color:#999;
    font-size:12px;
}

.ref-empty a{
    display:inline-flex;
    margin-top:10px;
    padding:10px 17px;
    border-radius:20px;
    background:#111;
    color:#fff;
    font-size:12px;
}

/* bottom bar closer to reference */

body:has(.ref-feed) .mobile-bottom-nav{
    height:64px;
    background:#fff;
    border-top:1px solid #eee;
}

body:has(.ref-feed) .mobile-bottom-nav .newpost span{
    width:55px;
    height:37px;
    margin-top:0;
    border-radius:20px;
    background:#111;
    border:0;
    box-shadow:none;
    font-size:25px;
}

body:has(.ref-feed) .mobile-bottom-nav a{
    color:#8b8b8b;
}

body:has(.ref-feed) .mobile-bottom-nav a.active{
    color:#111;
}


/* ===== TORAN POST ACTIONS V2 ===== */

.toran-post-actions{
    height:48px;
    padding:4px 14px;
    display:flex;
    direction:ltr;
    align-items:center;
    gap:21px;
    background:#fff;
}

.toran-post-actions button{
    border:0;
    background:transparent;
    padding:4px 0;
    display:flex;
    align-items:center;
    gap:5px;
    color:#111;
    cursor:pointer;
}

.toran-post-actions button > span:first-child{
    font-size:25px;
    line-height:1;
    font-family:Arial,sans-serif;
}

.toran-post-actions .like-count,
.toran-post-actions .comment-count{
    font-size:11px;
    font-weight:500;
}

.toran-like.liked{
    color:#e92d4f;
}

.toran-like.liked .heart-icon{
    color:#e92d4f;
}

.toran-share{
    margin-left:1px;
}

.toran-comments-panel{
    display:none;
    background:#fff;
    border-top:1px solid #f3f3f3;
}

.toran-comments-panel.open{
    display:block;
}


/* SHARE SHEET */

body.share-open{
    overflow:hidden;
}

.share-sheet{
    position:fixed;
    inset:0;
    z-index:99999;
}

.share-sheet[hidden]{
    display:none;
}

.share-backdrop{
    position:absolute;
    inset:0;
    background:rgba(0,0,0,.38);
}

.share-box{
    position:absolute;
    left:50%;
    bottom:0;
    transform:translateX(-50%);
    width:min(100%,515px);
    max-height:72vh;
    background:#fff;
    border-radius:22px 22px 0 0;
    overflow:hidden;
    direction:rtl;
}

.share-handle{
    width:38px;
    height:4px;
    border-radius:10px;
    background:#d5d5d5;
    margin:8px auto 3px;
}

.share-head{
    height:48px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:0 15px;
    border-bottom:1px solid #eee;
}

.share-head strong{
    font-size:15px;
}

.share-head button{
    width:32px;
    height:32px;
    border:0;
    background:#f2f2f2;
    border-radius:50%;
    font-size:22px;
}

.share-search{
    padding:10px 12px;
}

.share-search input{
    width:100%;
    height:39px;
    border:0;
    outline:0;
    background:#f2f3f3;
    border-radius:12px;
    padding:0 13px;
    font-size:12px;
}

.share-users{
    overflow:auto;
    max-height:55vh;
    padding-bottom:18px;
}

.share-user{
    width:100%;
    min-height:62px;
    border:0;
    background:#fff;
    display:flex;
    align-items:center;
    gap:10px;
    padding:7px 13px;
    text-align:right;
}

.share-user:active{
    background:#f6f6f6;
}

.share-avatar{
    width:44px;
    height:44px;
    flex:0 0 44px;
    border-radius:50%;
    overflow:hidden;
    background:#eee;
}

.share-avatar img{
    width:100%;
    height:100%;
    object-fit:cover;
}

.share-letter{
    width:100%;
    height:100%;
    display:grid;
    place-items:center;
    font-weight:700;
}

.share-copy{
    flex:1;
    min-width:0;
}

.share-copy strong{
    display:block;
    font-size:13px;
    color:#111;
}

.share-copy small{
    display:block;
    color:#999;
    margin-top:3px;
    font-size:10px;
}

.share-send-label{
    min-width:57px;
    padding:7px 9px;
    border-radius:9px;
    background:#111;
    color:#fff;
    text-align:center;
    font-size:10px;
}

.share-loading{
    padding:35px 15px;
    text-align:center;
    color:#999;
    font-size:12px;
}


/* ===== TORAN HOME TOP ACTIONS ===== */

.toran-home-head{
    height:62px !important;
    min-height:62px !important;
    padding:0 18px !important;
    display:flex !important;
    align-items:center !important;
    justify-content:flex-start !important;
    gap:23px !important;
    direction:rtl !important;
    background:#fff !important;
    border-bottom:1px solid #f2f2f2 !important;
}

.toran-head-btn{
    position:relative;
    width:30px;
    height:40px;
    display:grid;
    place-items:center;
    color:#111;
    text-decoration:none;
}

.toran-head-btn svg{
    width:24px;
    height:24px;
    fill:none;
    stroke:currentColor;
    stroke-width:1.8;
    stroke-linecap:round;
    stroke-linejoin:round;
}

.toran-head-btn.active svg{
    fill:#111;
    stroke:#111;
}

.toran-head-message svg{
    width:25px;
    height:25px;
}

.toran-head-badge{
    position:absolute;
    top:2px;
    right:-5px;
    min-width:17px;
    height:17px;
    padding:0 4px;
    border-radius:10px;
    background:#e82946;
    color:#fff;
    border:2px solid #fff;
    font:700 9px/13px Arial,sans-serif;
    text-align:center;
}

/* در HOME هدر عمومی بالا نمایش داده نشود */
body:has(.ref-feed) > .toran-app > .app-topbar{
    display:none !important;
}



/* ==================================================
   TORAN GLOBAL HEADER
   یک هدر برای تمام صفحات
   ================================================== */

.toran-global-header{
    display:block !important;
    width:100% !important;
    height:58px !important;
    min-height:58px !important;
    background:#fff !important;
    border-bottom:1px solid #eeeeee !important;
    position:sticky !important;
    top:0 !important;
    z-index:9000 !important;
}

.toran-global-header-inner{
    width:100%;
    height:58px;
    padding:0 17px;
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:22px;
    direction:rtl;
}

.toran-global-action{
    position:relative;
    width:31px;
    height:42px;
    flex:0 0 31px;
    display:grid;
    place-items:center;
    color:#111;
    text-decoration:none;
}

.toran-global-action svg{
    width:23px;
    height:23px;
    display:block;
    fill:none;
    stroke:currentColor;
    stroke-width:1.8;
    stroke-linecap:round;
    stroke-linejoin:round;
}

.toran-global-action.active svg{
    fill:#111;
    stroke:#111;
}

.toran-global-message svg{
    width:24px;
    height:24px;
}

.toran-global-badge{
    position:absolute;
    top:1px;
    right:-5px;
    min-width:17px;
    height:17px;
    padding:0 4px;
    border-radius:10px;
    background:#e72b49;
    border:2px solid #fff;
    color:#fff;
    font:700 9px/13px Arial,sans-serif;
    text-align:center;
}


/*
 قبلاً HOME هدر عمومی را مخفی می‌کرد.
 از اینجا به بعد این قانون لغو می‌شود.
*/
body:has(.ref-feed) > .toran-app > .app-topbar{
    display:block !important;
}


/*
 هدر قدیمی Home اگر از CSS قبلی باقی مانده باشد
 دیگر نمایش داده نمی‌شود.
*/
.ref-feed-header,
.toran-home-head{
    display:none !important;
}


/* FIX: My avatar in stories */
.ref-story-ring.me{
    width:53px !important;
    height:53px !important;
    min-width:53px !important;
    min-height:53px !important;
    padding:2px !important;
    border:2px solid #111 !important;
    border-radius:50% !important;
    position:relative !important;
    overflow:visible !important;
    background:#fff !important;
}

.ref-story-ring.me > img{
    display:block !important;
    width:45px !important;
    height:45px !important;
    max-width:45px !important;
    max-height:45px !important;
    border-radius:50% !important;
    object-fit:cover !important;
    object-position:center !important;
    margin:0 !important;
}

.ref-story-ring.me > i{
    position:absolute !important;
    right:-3px !important;
    bottom:-3px !important;
    width:18px !important;
    height:18px !important;
    border-radius:50% !important;
    background:#111 !important;
    color:#fff !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    font-size:15px !important;
    line-height:18px !important;
    z-index:5 !important;
    border:2px solid #fff !important;
    box-sizing:content-box !important;
}

