:root {
  --canvas: #f3f5f1;
  --paper: #fbfcf9;
  --paper-strong: #ffffff;
  --ink: #18221f;
  --muted: #7f8c87;
  --muted-2: #a7b0ac;
  --line: #e7ece8;
  --green: #158f78;
  --green-dark: #0d735f;
  --green-soft: #e4f2ee;
  --sand: #f3eadb;
  --sent: #d9f1e9;
  --shadow: 0 18px 55px rgba(21, 48, 40, .08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--canvas); color: var(--ink); font-family: "IBM Plex Sans Arabic", system-ui, sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(21, 143, 120, .22); outline-offset: 2px; }
.icon { display: inline-flex; width: 19px; height: 19px; align-items: center; justify-content: center; }
.icon svg { width: 100%; height: 100%; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; fill: none; }

.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: fixed; inset: 0; z-index: 20; overflow: hidden; background: #0e806d; }
.auth-screen.is-hidden { display: none; }
.auth-screen::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 18% 20%, rgba(255,255,255,.16), transparent 28%), radial-gradient(circle at 85% 86%, rgba(255,193,140,.2), transparent 31%), linear-gradient(135deg, #0b735f, #158f78 55%, #2ca487); }
.auth-orbit { position: absolute; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; pointer-events: none; }
.auth-orbit-one { width: 460px; height: 460px; top: -240px; right: -100px; }
.auth-orbit-two { width: 580px; height: 580px; bottom: -340px; left: -190px; }
.auth-card { width: min(430px, 100%); position: relative; padding: 34px; border: 1px solid rgba(255,255,255,.22); border-radius: 28px; color: var(--ink); background: rgba(255,255,255,.94); box-shadow: 0 24px 70px rgba(4,45,36,.25); animation: auth-rise .45s ease both; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; color: var(--green-dark); }
.auth-brand strong { font-size: 22px; letter-spacing: -.05em; }
.auth-brand .brand-mark { width: 42px; height: 42px; border-color: var(--green); transform: rotate(-8deg); }
.auth-brand .brand-mark::after { background: white; border-color: var(--green); }
.auth-brand .brand-mark span { border-color: var(--green); }
.auth-brand .brand-mark span:last-child { background: var(--green); }
.auth-card .eyebrow { margin-bottom: 7px; }
.auth-card h1 { font-size: 26px; margin-bottom: 10px; }
.auth-copy { color: var(--muted); font-size: 13px; line-height: 1.9; margin-bottom: 26px; }
.auth-form { display: grid; gap: 9px; }
.auth-form.is-hidden { display: none; }
.auth-form label { font-size: 11px; font-weight: 700; color: #56665e; }
.auth-form input { width: 100%; height: 49px; border: 1px solid #dde8e2; border-radius: 14px; outline: 0; background: #f7faf8; color: var(--ink); padding: 0 15px; direction: ltr; text-align: left; font-family: Inter, system-ui, sans-serif; font-size: 15px; letter-spacing: .02em; }
.auth-form input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(21,143,120,.12); }
.auth-submit { height: 49px; border: 0; border-radius: 14px 14px 5px 14px; display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 7px; background: var(--green); color: white; font-size: 13px; font-weight: 700; transition: .18s ease; }
.auth-submit:hover { background: var(--green-dark); transform: translateY(-1px); }
.auth-submit span { font-size: 18px; line-height: 1; }
.auth-link { justify-self: center; border: 0; background: transparent; color: var(--green-dark); font-size: 12px; margin-top: 4px; }
.auth-status { min-height: 18px; margin: 15px 0 0; color: #bd6e52; font-size: 11px; line-height: 1.7; }
.auth-status.success { color: var(--green-dark); }
.auth-note { display: block; margin-top: 20px; color: var(--muted-2); font-size: 10px; line-height: 1.7; }
@keyframes auth-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.app-shell { display: grid; grid-template-columns: 72px minmax(300px, 355px) minmax(480px, 1fr) 290px; height: 100vh; min-height: 680px; max-width: 1700px; margin: 0 auto; overflow: hidden; background: var(--paper); box-shadow: var(--shadow); }
	.rail { display: flex; flex-direction: column; align-items: center; padding: 24px 12px 20px; background: var(--green); color: rgba(255,255,255,.82); }
	.brand-lockup { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 62px; }
	.brand-name { color: #fff; font-size: 11px; line-height: 1; letter-spacing: -.03em; }
	.brand-mark { width: 36px; height: 36px; border: 2px solid rgba(255,255,255,.92); border-radius: 12px 12px 12px 4px; position: relative; transform: rotate(-8deg); }
.brand-mark::after { content: ""; width: 8px; height: 8px; position: absolute; bottom: -5px; left: 3px; background: var(--green); border-left: 2px solid rgba(255,255,255,.92); transform: skew(-28deg); }
.brand-mark span { position: absolute; width: 10px; height: 10px; border: 2px solid rgba(255,255,255,.9); border-radius: 50%; top: 11px; }
.brand-mark span:first-child { left: 7px; } .brand-mark span:last-child { right: 7px; background: rgba(255,255,255,.85); }
.rail-nav, .rail-bottom { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.rail-bottom { margin-top: auto; }
.rail-button, .profile-dot { border: 0; color: inherit; background: transparent; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; position: relative; transition: .16s ease; }
.rail-button:hover { background: rgba(255,255,255,.13); color: white; }
.rail-button.is-active { background: white; color: var(--green); box-shadow: 0 8px 18px rgba(0,0,0,.09); }
.rail-button b { width: 6px; height: 6px; border-radius: 50%; background: #f4bd6e; position: absolute; top: 8px; right: 8px; }
.profile-dot { background: #e7be87; color: #4d3823; font-weight: 700; font-size: 14px; }

.inbox-panel { border-left: 1px solid var(--line); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; background: var(--paper); }
.inbox-header { padding: 29px 23px 0; }
.header-topline { display: flex; justify-content: space-between; align-items: flex-start; }
.eyebrow { color: var(--green); font-size: 11px; font-weight: 700; letter-spacing: .04em; margin: 0 0 5px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 26px; line-height: 1.15; margin-bottom: 0; letter-spacing: -.04em; }
.count-badge { display: inline-grid; place-items: center; min-width: 25px; height: 21px; padding: 0 7px; font: 600 11px Inter, sans-serif; color: var(--green-dark); background: var(--green-soft); border-radius: 20px; vertical-align: middle; margin-right: 5px; }
.header-actions { display: flex; gap: 5px; align-items: center; }
.icon-button, .composer-icon, .emoji-button { border: 0; background: transparent; color: var(--muted); width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; transition: .16s ease; }
.icon-button:hover, .composer-icon:hover, .emoji-button:hover { color: var(--green); background: var(--green-soft); }
.icon-button.filled { color: white; background: var(--green); }
.icon-button.filled:hover { background: var(--green-dark); }
.search-box { height: 42px; border-radius: 13px; margin-top: 23px; background: #f1f4f0; color: var(--muted); display: flex; align-items: center; gap: 9px; padding: 0 13px; }
.search-box input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); min-width: 0; font-size: 13px; }
.search-box input::placeholder { color: var(--muted-2); }
kbd { font: 600 11px Inter, sans-serif; border: 1px solid #dce4df; border-radius: 5px; padding: 2px 5px; color: var(--muted-2); background: white; }
.tabs { display: flex; gap: 7px; padding: 22px 0 15px; border-bottom: 1px solid var(--line); }
.tab { border: 0; background: transparent; padding: 7px 10px; border-radius: 8px; color: var(--muted); font-size: 12px; font-weight: 600; }
.tab span { font: 600 10px Inter, sans-serif; margin-right: 4px; opacity: .8; }
.tab:hover { color: var(--green); } .tab.is-active { background: var(--green-soft); color: var(--green-dark); }
.chat-list { flex: 1; overflow: auto; padding: 8px 10px; scrollbar-width: thin; }
.chat-item { display: flex; align-items: center; gap: 12px; padding: 12px 12px; border-radius: 16px; cursor: pointer; transition: .16s ease; position: relative; }
.chat-item:hover { background: #f3f6f3; } .chat-item.is-active { background: var(--green-soft); }
.avatar { flex: 0 0 auto; display: grid; place-items: center; border-radius: 14px; color: white; font-weight: 700; position: relative; }
.avatar-md { width: 47px; height: 47px; font-size: 16px; } .avatar-lg { width: 43px; height: 43px; font-size: 15px; border-radius: 14px; } .avatar-xl { width: 92px; height: 92px; font-size: 30px; border-radius: 29px; }
.avatar::after { content: ""; width: 10px; height: 10px; position: absolute; left: -2px; bottom: -1px; border-radius: 50%; background: #c6d0cc; border: 2px solid var(--paper); }
.avatar.online::after { background: #49c493; } .avatar.group::after { display: none; }
.avatar-teal { background: #4f9e91; } .avatar-amber { background: #d9995f; } .avatar-lilac { background: #9e8fc2; } .avatar-rose { background: #ce8293; } .avatar-navy { background: #5c7c9d; } .avatar-sage { background: #86a780; } .avatar-coral { background: #d77d63; }
.chat-copy { flex: 1; min-width: 0; } .chat-line { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.chat-line strong { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-time { color: var(--muted-2); font: 500 10px Inter, sans-serif; white-space: nowrap; }
.chat-preview { color: var(--muted); display: flex; align-items: center; gap: 4px; font-size: 12px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-preview .icon { width: 13px; height: 13px; color: var(--green); } .unread { background: var(--green); color: white; min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center; border-radius: 8px; font: 600 9px Inter, sans-serif; margin-right: 4px; }
.chat-pin { color: var(--muted-2); width: 14px; height: 14px; }
.inbox-footer { color: var(--muted-2); font-size: 10px; padding: 11px 21px 17px; display: flex; gap: 5px; align-items: center; }
.status-dot { width: 6px; height: 6px; background: #53bf93; border-radius: 50%; display: inline-block; }
.empty-search { padding: 40px 25px; text-align: center; color: var(--muted); } .empty-icon { width: 48px; height: 48px; border-radius: 16px; background: var(--green-soft); color: var(--green); margin: 0 auto 16px; display: grid; place-items: center; } .empty-search h2 { font-size: 16px; color: var(--ink); margin-bottom: 6px; } .empty-search p { font-size: 12px; line-height: 1.7; } .is-hidden { display: none !important; }

.conversation { min-width: 0; display: flex; flex-direction: column; background: #f6f8f5; }
.conversation-header { height: 92px; border-bottom: 1px solid var(--line); background: var(--paper-strong); display: flex; align-items: center; gap: 12px; padding: 17px 27px; }
.conversation-person { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; text-align: right; border: 0; background: transparent; padding: 0; color: var(--ink); }
.person-copy { display: flex; flex-direction: column; min-width: 0; } .person-copy strong { font-size: 15px; } .person-copy small { color: var(--green); font-size: 11px; margin-top: 4px; }
.back-button { display: none; border: 0; background: var(--green-soft); color: var(--green); width: 34px; height: 34px; border-radius: 10px; }
.message-canvas { flex: 1; overflow: auto; padding: 24px clamp(18px, 5vw, 72px) 18px; display: flex; flex-direction: column; }
.day-divider { text-align: center; margin: 2px 0 16px; } .day-divider span { background: #e9eee9; color: #8e9993; border-radius: 20px; font-size: 10px; padding: 6px 13px; }
.privacy-note { align-self: center; display: inline-flex; gap: 6px; align-items: center; color: #a2aaa6; background: rgba(255,255,255,.58); border: 1px solid rgba(226,233,228,.8); padding: 7px 11px; border-radius: 8px; font-size: 10px; margin-bottom: 26px; }
.privacy-note .icon { width: 13px; height: 13px; color: #94a39c; }
.messages { display: flex; flex-direction: column; gap: 9px; margin-top: auto; }
.message-row { display: flex; align-items: flex-end; gap: 8px; max-width: 79%; animation: rise .22s ease both; } .message-row.mine { align-self: flex-start; flex-direction: row-reverse; } .message-row.theirs { align-self: flex-end; }
.message-bubble { background: var(--paper-strong); border: 1px solid #ecf0ec; border-radius: 17px 17px 17px 5px; padding: 10px 13px 8px; box-shadow: 0 3px 10px rgba(20,40,30,.025); } .mine .message-bubble { background: var(--sent); border-color: transparent; border-radius: 17px 17px 5px 17px; }
.message-text { font-size: 13px; line-height: 1.65; } .message-meta { display: flex; justify-content: flex-start; align-items: center; gap: 5px; color: #a2aaa6; font: 500 9px Inter, sans-serif; margin-top: 3px; direction: ltr; } .mine .message-meta { color: #6aa695; } .message-meta .icon { width: 13px; height: 13px; }
.composer { display: flex; align-items: flex-end; gap: 7px; padding: 14px 25px 21px; background: var(--paper-strong); border-top: 1px solid var(--line); }
.composer-field { flex: 1; min-width: 0; position: relative; display: flex; align-items: center; background: #f2f5f2; border: 1px solid #edf1ee; border-radius: 15px; min-height: 44px; padding-left: 8px; }
.composer-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); padding: 0 15px; font-size: 13px; }
.composer-field input::placeholder { color: #9ca8a2; } .emoji-button { color: #84948d; font-size: 22px; width: 34px; height: 34px; font-family: Arial, sans-serif; }
.send-button { border: 0; width: 44px; height: 44px; border-radius: 14px 14px 5px 14px; display: grid; place-items: center; background: var(--green); color: white; transition: .16s ease; } .send-button:hover { background: var(--green-dark); transform: translateY(-1px); }
.emoji-picker { position: absolute; bottom: 52px; left: 0; display: flex; flex-wrap: wrap; gap: 4px; width: 192px; padding: 9px; background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); direction: ltr; } .emoji-picker button { border: 0; background: #f6f8f5; border-radius: 8px; width: 31px; height: 31px; font-size: 18px; } .emoji-picker button:hover { background: var(--green-soft); }

.details-panel { background: var(--paper-strong); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.details-panel.is-hidden { display: none !important; }
.details-header { display: flex; align-items: center; justify-content: space-between; padding: 28px 23px 12px; } .details-header h2 { font-size: 14px; margin: 0; }
.detail-profile { display: flex; flex-direction: column; align-items: center; padding: 17px 20px 25px; border-bottom: 1px solid var(--line); } .detail-profile .avatar { margin-bottom: 12px; } .detail-profile h3 { font-size: 17px; margin-bottom: 1px; } .detail-profile p { color: var(--muted); direction: ltr; font: 500 11px Inter, sans-serif; margin-bottom: 11px; } .online-pill { color: var(--green); background: var(--green-soft); border-radius: 20px; padding: 5px 9px; font-size: 10px; } .online-pill i { width: 5px; height: 5px; background: #48bb8d; border-radius: 50%; display: inline-block; margin-left: 3px; }
.detail-section { padding: 20px 22px; border-bottom: 1px solid var(--line); } .detail-label { color: var(--muted-2); font-size: 10px; font-weight: 700; display: block; margin-bottom: 9px; } .detail-bio { font-size: 12px; line-height: 1.8; margin: 0; color: #53635b; }
.media-preview { border: 0; background: transparent; display: flex; align-items: center; width: 100%; gap: 5px; padding: 0; color: var(--muted); font-size: 11px; } .media-preview strong { margin-right: auto; font-weight: 500; } .media-thumb { width: 35px; height: 35px; border-radius: 8px; display: block; } .media-thumb.warm { background: linear-gradient(135deg,#f0bd8d,#cf8168); } .media-thumb.mint { background: linear-gradient(135deg,#a9d8c6,#6ba994); } .media-thumb.lilac { background: linear-gradient(135deg,#d2c5e6,#9a85bf); } .media-preview .icon { width: 14px; height: 14px; }
.detail-links { padding-top: 10px; padding-bottom: 10px; } .detail-links button { width: 100%; border: 0; background: transparent; display: flex; align-items: center; gap: 10px; padding: 11px 0; color: #53635b; font-size: 12px; text-align: right; } .detail-links button:hover { color: var(--green); } .detail-links button .icon { color: #93a099; width: 17px; } .detail-links .muted { margin-right: auto; width: 13px; } .toggle { width: 28px; height: 17px; border-radius: 10px; background: var(--green); margin-right: auto; position: relative; } .toggle::after { content: ""; width: 11px; height: 11px; background: white; border-radius: 50%; position: absolute; left: 3px; top: 3px; } .detail-links .danger { color: #c46f6f; } .detail-links .danger .icon { color: #c46f6f; }
.details-footer { margin-top: auto; padding: 18px 22px 23px; color: var(--muted-2); font-size: 10px; text-align: center; } .details-footer span { margin: 0 4px; }
.toast { position: fixed; bottom: 25px; left: 50%; transform: translate(-50%, 14px); opacity: 0; pointer-events: none; background: var(--ink); color: white; padding: 10px 15px; border-radius: 11px; font-size: 12px; transition: .2s ease; z-index: 10; } .toast.show { opacity: 1; transform: translate(-50%, 0); }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1180px) { .app-shell { grid-template-columns: 68px minmax(280px, 315px) minmax(430px, 1fr); } .details-panel { display: none; } .details-panel.is-open { display: flex; position: fixed; inset: 0 0 0 auto; width: min(360px, 84vw); z-index: 5; box-shadow: var(--shadow); } }
	@media (max-width: 780px) { body { background: var(--paper); } .app-shell { display: block; height: 100vh; min-height: 0; } .rail { height: 62px; flex-direction: row; justify-content: space-between; padding: 9px 14px; } .brand-lockup { flex-direction: row; gap: 8px; margin: 0; } .brand-name { font-size: 13px; } .brand-mark { transform: scale(.8) rotate(-8deg); } .rail-nav, .rail-bottom { flex-direction: row; gap: 5px; margin: 0; } .rail-nav { order: 2; } .rail-bottom { order: 3; } .rail-button { width: 39px; height: 39px; } .rail-bottom .rail-button { display: none; } .profile-dot { width: 34px; height: 34px; } .inbox-panel { height: calc(100vh - 62px); border: 0; } .inbox-header { padding: 22px 18px 0; } .chat-list { padding: 8px 10px; } .conversation { display: none; height: calc(100vh - 62px); } .app-shell.mobile-chat .inbox-panel, .app-shell.mobile-chat .rail { display: none; } .app-shell.mobile-chat .conversation { display: flex; } .app-shell.mobile-chat .back-button { display: grid; place-items: center; } .conversation-header { height: 75px; padding: 12px 15px; gap: 8px; } .conversation-header .header-actions .icon-button:not(:last-child) { display: none; } .message-canvas { padding: 20px 14px 14px; } .message-row { max-width: 90%; } .composer { padding: 10px 12px 13px; } .composer-icon { width: 34px; } .details-panel { position: fixed; inset: 62px 0 0; z-index: 5; display: none; } .details-panel.is-open { display: flex; } }
