:root {
  --ink: #18211f;
  --ink-soft: #52605d;
  --green: #173e35;
  --green-2: #215548;
  --cyan: #55b8c1;
  --cyan-soft: #e8f6f7;
  --gold: #b9904f;
  --paper: #f7f7f3;
  --surface: #ffffff;
  --line: #dde3df;
  --line-strong: #c9d2cd;
  --danger: #a44545;
  --shadow: 0 12px 34px rgba(28, 48, 42, .08);
  --header-h: 72px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf4f1;
  --ink-soft: #a7b5b0;
  --green: #63c2bd;
  --green-2: #79d0c9;
  --cyan: #59bbc4;
  --cyan-soft: #183431;
  --gold: #d3ad68;
  --paper: #101715;
  --surface: #18211f;
  --line: #2a3834;
  --line-strong: #3c4b46;
  --danger: #ee9393;
  --shadow: 0 18px 46px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "DM Sans", Arial, sans-serif; font-size: 15px; line-height: 1.5; letter-spacing: 0; }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.site-header { position: sticky; inset-block-start: 0; z-index: 50; height: var(--header-h); background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.header-inner { width: min(1640px, calc(100% - 48px)); height: 100%; margin: 0 auto; display: grid; grid-template-columns: minmax(220px, 1fr) minmax(150px, .75fr) minmax(360px, 2.4fr) auto; gap: 24px; align-items: center; }
.brand { display: inline-flex; align-items: center; width: max-content; padding: 0; border: 0; background: transparent; cursor: pointer; font-size: 20px; font-weight: 800; }
.brand-name { color: var(--green); }
.brand-dot { width: 6px; height: 6px; margin-left: 7px; border-radius: 50%; background: #67cbd1; }
.community-mark { display: flex; align-items: baseline; gap: 10px; border-left: 1px solid var(--line); padding-left: 22px; white-space: nowrap; }
.community-mark span { font-family: "Newsreader", Georgia, serif; font-size: 22px; font-weight: 600; }
.community-mark small { color: var(--ink-soft); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.global-search { height: 42px; display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; align-items: center; padding: 0 12px; background: #f2f4f1; border: 1px solid transparent; border-radius: 6px; color: var(--ink-soft); }
.global-search:focus-within { border-color: var(--cyan); background: var(--surface); box-shadow: 0 0 0 3px rgba(85,184,193,.13); }
.global-search svg { width: 18px; }
.global-search input { min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); }
.global-search kbd { min-width: 24px; padding: 1px 7px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface); color: var(--ink-soft); text-align: center; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.mobile-main-link { display: none; }
.theme-control { position: relative; }
.theme-menu { position: absolute; top: 46px; right: 0; z-index: 60; width: 228px; padding: 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow); }
.theme-menu button { width: 100%; display: grid; grid-template-columns: 22px 1fr 18px; gap: 10px; align-items: center; padding: 10px; border: 0; border-radius: 4px; background: transparent; color: var(--ink); cursor: pointer; text-align: left; }
.theme-menu button:hover, .theme-menu button.is-active { background: var(--cyan-soft); }
.theme-menu button > svg { width: 18px; }
.theme-menu button span, .theme-menu button strong, .theme-menu button small { display: block; }
.theme-menu button strong { font-size: 13px; }
.theme-menu button small { margin-top: 1px; color: var(--ink-soft); font-size: 10px; font-weight: 500; }
.theme-menu .theme-check { visibility: hidden; color: var(--green-2); }
.theme-menu button.is-active .theme-check { visibility: visible; }
.icon-button { width: 38px; height: 38px; display: inline-grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); cursor: pointer; position: relative; }
.icon-button:hover { border-color: var(--line-strong); background: #f2f5f2; }
.icon-button svg { width: 18px; height: 18px; }
.notification-dot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border: 2px solid white; border-radius: 50%; background: #d45757; }
.profile-button { height: 42px; display: flex; gap: 9px; align-items: center; padding: 4px 8px 4px 5px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); cursor: pointer; font-weight: 600; }
.profile-button > svg { width: 15px; color: var(--ink-soft); }
.account-control { position: relative; }
.account-menu { position: absolute; top: 48px; right: 0; z-index: 65; width: 230px; padding: 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow); }
.account-menu-user { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; padding: 9px 8px 12px; border-bottom: 1px solid var(--line); }
.account-menu-user strong, .account-menu-user small { display: block; }
.account-menu-user strong { font-size: 13px; }
.account-menu-user small { color: var(--ink-soft); font-size: 10px; }
.account-menu > button, .account-menu > a { width: 100%; min-height: 40px; display: grid; grid-template-columns: 20px 1fr auto; gap: 9px; align-items: center; padding: 0 9px; border: 0; border-radius: 4px; background: transparent; color: var(--ink); cursor: pointer; text-align: left; font-size: 12px; font-weight: 700; }
.account-menu > button:hover, .account-menu > a:hover { background: var(--cyan-soft); }
.account-menu > button svg, .account-menu > a svg { width: 17px; }
.account-menu .menu-external { width: 13px; color: var(--ink-soft); }
.account-menu .account-logout { margin-top: 5px; border-top: 1px solid var(--line); border-radius: 0 0 4px 4px; color: var(--danger); }

.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border: 1px solid transparent; border-radius: 6px; cursor: pointer; font-weight: 700; white-space: nowrap; }
.button svg { width: 17px; height: 17px; }
.button-primary { background: var(--green); color: white; }
.button-primary:hover { background: var(--green-2); }
.button-secondary { border-color: var(--line-strong); background: var(--surface); }
.button-secondary:hover, .button-quiet:hover { background: #eff3ef; }
.button-quiet { background: transparent; }
.button-full { width: 100%; }
.button-danger { border-color: #e5c8c8; background: #fff8f8; color: var(--danger); }

.app-shell { width: min(1640px, calc(100% - 48px)); margin: 0 auto; display: grid; grid-template-columns: minmax(230px, 1fr) minmax(620px, 3fr) minmax(280px, 1fr); gap: 32px; align-items: start; }
.mobile-nav { display: none; }
.left-rail, .right-rail { position: sticky; top: calc(var(--header-h) + 24px); max-height: calc(100vh - var(--header-h) - 40px); overflow: auto; padding: 28px 0; scrollbar-width: none; }
.left-rail::-webkit-scrollbar, .right-rail::-webkit-scrollbar { display: none; }
.main-column { min-width: 0; padding: 34px 0 80px; }
.side-nav { display: grid; gap: 4px; }
.nav-item { width: 100%; height: 44px; display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; align-items: center; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; color: #40504b; text-align: left; font-weight: 600; }
.nav-item svg { width: 19px; }
.nav-item .nav-external { width: 14px; color: var(--ink-soft); }
.nav-item:hover { background: #edf1ed; }
.nav-item.is-active { background: var(--green); color: white; }
.nav-count { min-width: 21px; padding: 1px 6px; border-radius: 10px; background: var(--cyan); color: #0e302d; font-size: 11px; text-align: center; }
.principle-panel { margin-top: 30px; padding: 18px 16px; border-top: 2px solid var(--cyan); background: #edf3ef; }
.principle-panel h2 { margin: 8px 0 6px; font-family: "Newsreader", Georgia, serif; font-size: 19px; }
.principle-panel p { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.eyebrow { color: var(--green-2); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.rail-footer { display: grid; margin-top: 24px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 11px; }
.rail-footer a { min-height: 32px; display: flex; align-items: center; padding: 0 12px; border-radius: 4px; }
.rail-footer a:hover { background: var(--cyan-soft); color: var(--green-2); }
.rail-footer span { margin-top: 8px; padding: 12px; border-top: 1px solid var(--line); }

.page-heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; padding-bottom: 22px; border-bottom: 1px solid var(--line-strong); }
.page-heading h1 { margin: 4px 0 2px; font-family: "Newsreader", Georgia, serif; font-size: 38px; line-height: 1.1; font-weight: 600; }
.page-heading p { max-width: 570px; margin: 0; color: var(--ink-soft); }
.guest-banner { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; margin: 22px 0; padding: 15px 16px; border: 1px solid #cfe3df; border-left: 3px solid var(--cyan); background: #eef7f5; }
.guest-banner-icon { width: 36px; height: 36px; display: grid; place-items: center; color: var(--green); }
.guest-banner-icon svg { width: 22px; }
.guest-banner strong, .guest-banner span { display: block; }
.guest-banner span { color: var(--ink-soft); font-size: 13px; }

.composer { margin: 22px 0 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 4px 18px rgba(28,48,42,.04); }
.composer-top { display: grid; grid-template-columns: 42px 1fr; gap: 12px; align-items: center; }
.avatar { width: 42px; height: 42px; display: inline-grid; place-items: center; flex: 0 0 auto; overflow: hidden; border-radius: 50%; background: var(--cyan); color: #153a36; font-weight: 800; text-transform: uppercase; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 31px; height: 31px; font-size: 12px; }
.avatar-lg { width: 72px; height: 72px; font-family: "Newsreader", Georgia, serif; font-size: 28px; }
.composer-trigger { height: 42px; padding: 0 15px; border: 1px solid var(--line); border-radius: 6px; background: #f6f7f5; color: #7a8581; cursor: text; text-align: left; }
.composer-expanded { margin-top: 14px; }
.composer-expanded textarea, .auth-form input, .quran-modal input, .quran-modal textarea, .quran-modal select, .comment-form input, .message-form input { width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); outline: none; }
.composer-expanded textarea { min-height: 124px; padding: 12px; resize: vertical; }
.composer-expanded textarea:focus, .auth-form input:focus, .quran-modal input:focus, .quran-modal textarea:focus, .quran-modal select:focus, .comment-form input:focus, .message-form input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(85,184,193,.13); }
.composer-footer { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-top: 12px; }
.composer-tools, .composer-submit { display: flex; gap: 8px; align-items: center; }
.composer-submit > span { margin-right: 4px; color: var(--ink-soft); font-size: 11px; }
.tool-button { min-height: 36px; display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; border: 0; border-radius: 5px; background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--green-2); }
.tool-button:hover { background: var(--cyan-soft); }
.tool-button svg { width: 17px; }
.quran-preview { margin-top: 12px; }
.image-preview { position: relative; margin-top: 12px; overflow: hidden; border-radius: 6px; }
.image-preview img { width: 100%; max-height: 340px; object-fit: cover; }
.image-preview .icon-button { position: absolute; top: 10px; right: 10px; }

.feed-toolbar { height: 58px; display: flex; justify-content: space-between; align-items: center; margin-top: 16px; border-bottom: 1px solid var(--line); }
.tabs { height: 100%; display: flex; gap: 22px; }
.tab { position: relative; border: 0; background: transparent; color: var(--ink-soft); cursor: pointer; font-weight: 700; }
.tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: transparent; }
.tab.is-active { color: var(--green); }
.tab.is-active::after { background: var(--cyan); }

.post { padding: 22px 0; border-bottom: 1px solid var(--line); }
.post-head { display: flex; justify-content: space-between; gap: 18px; }
.member-line { display: flex; align-items: center; gap: 11px; min-width: 0; }
.member-copy { min-width: 0; }
.member-name { display: flex; align-items: center; gap: 6px; border: 0; padding: 0; background: transparent; cursor: pointer; font-weight: 800; }
.verified { width: 15px; height: 15px; color: var(--cyan); fill: var(--cyan); }
.member-meta { display: flex; gap: 6px; color: var(--ink-soft); font-size: 12px; }
.post-body { margin: 14px 0 15px 53px; white-space: pre-wrap; font-size: 15px; line-height: 1.7; }
.quran-pin { margin: 0 0 15px 53px; padding: 16px 18px 15px; border-left: 3px solid var(--cyan); background: #eef4f1; }
.quran-pin-head { display: flex; justify-content: space-between; gap: 12px; color: var(--green-2); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.quran-pin .arabic { margin: 11px 0 8px; font-family: "Noto Naskh Arabic", serif; font-size: 27px; line-height: 1.8; text-align: right; }
.quran-pin .translation { margin: 0; color: #3f4d49; font-family: "Newsreader", Georgia, serif; font-size: 17px; line-height: 1.45; }
.post-image { width: calc(100% - 53px); max-height: 480px; margin: 0 0 15px 53px; border-radius: 8px; object-fit: cover; }
.post-actions { display: flex; justify-content: space-between; align-items: center; margin-left: 53px; }
.action-group { display: flex; align-items: center; gap: 4px; }
.post-action { min-width: 38px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 9px; border: 0; border-radius: 5px; background: transparent; cursor: pointer; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.post-action:hover { background: #edf1ed; color: var(--green); }
.post-action svg { width: 17px; }
.post-action.is-active { color: var(--green-2); background: var(--cyan-soft); }
.comments { margin: 14px 0 0 53px; padding-top: 13px; border-top: 1px solid var(--line); }
.comment { display: grid; grid-template-columns: 30px 1fr; gap: 9px; margin-top: 10px; }
.comment .avatar { width: 30px; height: 30px; font-size: 11px; }
.comment-bubble { padding: 9px 11px; border-radius: 6px; background: #eff2ef; }
.comment-bubble strong { font-size: 12px; }
.comment-bubble p { margin: 2px 0 0; font-size: 13px; }
.comment-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 11px; }
.comment-form input { height: 38px; padding: 0 11px; }

.more-wrap { position: relative; }
.post-menu { position: absolute; top: 42px; right: 0; z-index: 10; width: 190px; padding: 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow); }
.post-menu button { width: 100%; height: 37px; display: flex; align-items: center; gap: 9px; padding: 0 10px; border: 0; border-radius: 4px; background: transparent; cursor: pointer; text-align: left; font-size: 13px; }
.post-menu button:hover { background: #eff2ef; }
.post-menu button svg { width: 16px; }
.post-menu .danger { color: var(--danger); }

.side-section { padding: 20px 0; border-bottom: 1px solid var(--line); }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-title > span { font-size: 11px; font-weight: 800; text-transform: uppercase; }
.section-title button { border: 0; background: transparent; color: var(--green-2); cursor: pointer; font-size: 11px; font-weight: 700; }
.trend-list { display: grid; }
.trend-list button { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border: 0; background: transparent; cursor: pointer; text-align: left; }
.trend-list button:hover strong { color: var(--green-2); }
.trend-list span { color: var(--ink-soft); font-size: 11px; }
.suggested-member { display: grid; grid-template-columns: 34px 1fr auto; gap: 9px; align-items: center; padding: 8px 0; }
.suggested-member .avatar { width: 34px; height: 34px; font-size: 11px; }
.suggested-member strong, .suggested-member small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggested-member strong { font-size: 12px; }
.suggested-member small { color: var(--ink-soft); font-size: 10px; }
.follow-mini { min-width: 60px; padding: 4px 7px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface); cursor: pointer; color: var(--green-2); font-size: 10px; font-weight: 800; }
.follow-mini.is-active { background: #edf2ee; color: var(--ink-soft); }
.reading-prompt { position: relative; }
.reading-prompt > svg { width: 26px; color: var(--gold); }
.reading-prompt p { margin: 8px 0 12px; font-family: "Newsreader", Georgia, serif; font-size: 18px; line-height: 1.35; }
.reading-prompt a { display: inline-flex; align-items: center; gap: 5px; color: var(--green-2); font-size: 11px; font-weight: 800; }
.reading-prompt a svg { width: 13px; }

.empty-state { padding: 64px 20px; text-align: center; }
.empty-state svg { width: 36px; height: 36px; margin-bottom: 12px; color: var(--cyan); }
.empty-state h2 { margin: 0 0 5px; font-family: "Newsreader", Georgia, serif; font-size: 26px; }
.empty-state p { margin: 0 auto 18px; max-width: 420px; color: var(--ink-soft); }
.loading { display: grid; gap: 12px; padding: 24px 0; }
.skeleton { height: 110px; background: linear-gradient(90deg, #ecefeb 25%, #f5f6f4 50%, #ecefeb 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.members-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-top: 18px; background: var(--line); border: 1px solid var(--line); }
.member-card { min-height: 180px; padding: 20px; background: var(--surface); }
.member-card-top { display: flex; justify-content: space-between; gap: 14px; }
.member-card h3 { margin: 12px 0 0; font-size: 16px; }
.member-card .username { color: var(--ink-soft); font-size: 12px; }
.member-card p { height: 42px; margin: 10px 0 16px; overflow: hidden; color: var(--ink-soft); font-size: 12px; }
.member-card-actions { display: flex; gap: 8px; }

.profile-hero { margin-top: 18px; padding: 26px 0 24px; border-bottom: 1px solid var(--line); }
.profile-main { display: grid; grid-template-columns: 76px 1fr auto; gap: 18px; align-items: start; }
.profile-main h2 { margin: 3px 0 0; font-family: "Newsreader", Georgia, serif; font-size: 29px; }
.profile-main .username { color: var(--ink-soft); }
.profile-main p { max-width: 530px; margin: 10px 0; }
.profile-meta { display: flex; gap: 16px; color: var(--ink-soft); font-size: 12px; }
.profile-meta span { display: inline-flex; gap: 5px; align-items: center; }
.profile-meta svg { width: 14px; }
.profile-actions { display: flex; gap: 8px; }
.profile-stats { display: flex; gap: 28px; margin: 18px 0 0 94px; }
.profile-stats strong, .profile-stats span { display: block; }
.profile-stats strong { font-size: 17px; }
.profile-stats span { color: var(--ink-soft); font-size: 11px; }

.settings-layout { display: grid; gap: 18px; margin-top: 18px; }
.settings-panel { padding: 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.settings-title h2 { margin: 3px 0 2px; font-family: "Newsreader", Georgia, serif; font-size: 25px; }
.settings-title p { margin: 0 0 20px; color: var(--ink-soft); font-size: 13px; }
.avatar-setting { display: flex; gap: 16px; align-items: center; margin-bottom: 22px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.avatar-setting > div { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.avatar-setting small { width: 100%; color: var(--ink-soft); font-size: 10px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.settings-grid label, .settings-field { display: grid; gap: 6px; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.settings-grid label > span, .settings-field > span { font-weight: 400; }
.settings-grid input, .settings-field textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); outline: 0; }
.settings-grid input { height: 44px; padding: 0 11px; }
.settings-field { margin-top: 15px; }
.settings-field textarea { padding: 11px; resize: vertical; }
.settings-grid input:focus, .settings-field textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(85,184,193,.13); }
.settings-grid input:disabled { background: #f1f3f1; color: var(--ink-soft); cursor: not-allowed; }
.settings-grid small { color: var(--ink-soft); font-size: 9px; font-weight: 400; }
.settings-actions { display: flex; justify-content: flex-end; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.password-grid { grid-template-columns: repeat(3, 1fr); }

.messages-layout { height: calc(100vh - 200px); min-height: 540px; display: grid; grid-template-columns: 245px 1fr; margin-top: 18px; border: 1px solid var(--line); background: var(--surface); }
.conversation-list { overflow: auto; border-right: 1px solid var(--line); }
.conversation { width: 100%; display: grid; grid-template-columns: 36px 1fr auto; gap: 9px; align-items: center; padding: 13px; border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; text-align: left; }
.conversation:hover, .conversation.is-active { background: #eff4f0; }
.conversation .avatar { width: 36px; height: 36px; font-size: 11px; }
.conversation strong, .conversation span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation span { color: var(--ink-soft); font-size: 10px; }
.unread-badge { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: var(--cyan); font-size: 9px; font-weight: 800; }
.chat-panel { min-width: 0; display: grid; grid-template-rows: auto 1fr auto; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 15px; border-bottom: 1px solid var(--line); }
.chat-head .avatar { width: 36px; height: 36px; font-size: 11px; }
.chat-stream { overflow: auto; padding: 18px; }
.message-bubble { max-width: 75%; margin-bottom: 10px; padding: 9px 12px; border-radius: 8px; background: #eef2ef; }
.message-bubble.mine { margin-left: auto; background: var(--green); color: white; }
.message-bubble span { display: block; margin-top: 3px; opacity: .7; font-size: 9px; }
.message-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.message-form input { height: 40px; padding: 0 11px; }

.notification-item { display: grid; grid-template-columns: 38px 1fr auto; gap: 11px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--line); }
.notification-item .avatar { width: 38px; height: 38px; font-size: 11px; }
.notification-item p { margin: 0; }
.notification-item time { color: var(--ink-soft); font-size: 10px; }
.notification-item.is-unread p::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-radius: 50%; background: var(--cyan); vertical-align: middle; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(11, 25, 22, .62); backdrop-filter: blur(4px); }
.modal { position: relative; width: min(500px, 100%); max-height: calc(100vh - 48px); overflow: auto; padding: 34px; border-radius: 8px; background: var(--surface); box-shadow: 0 24px 80px rgba(0,0,0,.24); }
.modal-close { position: absolute; top: 14px; right: 14px; }
.auth-brand { display: flex; align-items: center; width: max-content; margin-bottom: 20px; font-weight: 800; }
.modal h2 { margin: 4px 0; font-family: "Newsreader", Georgia, serif; font-size: 32px; }
.modal > p { margin: 0 0 20px; color: var(--ink-soft); }
.auth-form { display: grid; gap: 13px; }
.auth-form label, .quran-modal label { display: grid; gap: 6px; color: #43514d; font-size: 12px; font-weight: 700; }
.auth-form input, .quran-modal input, .quran-modal select { height: 44px; padding: 0 11px; }
.quran-modal textarea { padding: 10px; resize: vertical; }
.quran-modal label span { color: var(--ink-soft); font-weight: 400; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-switch { margin-top: 18px; text-align: center; color: var(--ink-soft); font-size: 12px; }
.auth-switch button { border: 0; background: transparent; color: var(--green-2); cursor: pointer; font-weight: 800; }
.demo-note { display: flex; gap: 8px; align-items: center; margin-top: 16px; padding: 10px 12px; background: #f1f5f1; color: var(--ink-soft); font-size: 11px; }
.demo-note svg { width: 15px; }
.auth-success { display: flex; gap: 12px; align-items: flex-start; margin: 18px 0; padding: 15px; border-left: 3px solid var(--cyan); background: var(--cyan-soft); }
.auth-success > svg { width: 22px; flex: 0 0 auto; color: var(--green-2); }
.auth-success strong, .auth-success span { display: block; }
.auth-success span { margin-top: 3px; color: var(--ink-soft); font-size: 12px; }
.form-error { min-height: 20px; margin: 8px 0 0 !important; color: var(--danger) !important; font-size: 12px; }
.quran-modal .form-row { margin-bottom: 13px; }
.quran-modal > label { margin-bottom: 13px; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 120; max-width: 360px; padding: 12px 15px; border-radius: 6px; background: #173e35; color: white; box-shadow: var(--shadow); transform: translateY(20px); opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.is-visible { transform: translateY(0); opacity: 1; }

html[data-theme="dark"] .site-header { background: rgba(18, 26, 24, .96); }
html[data-theme="dark"] .global-search,
html[data-theme="dark"] .composer-trigger { background: #111a18; }
html[data-theme="dark"] .global-search kbd,
html[data-theme="dark"] .icon-button,
html[data-theme="dark"] .profile-button,
html[data-theme="dark"] .button-secondary,
html[data-theme="dark"] .composer,
html[data-theme="dark"] .member-card,
html[data-theme="dark"] .messages-layout,
html[data-theme="dark"] .auth-form input,
html[data-theme="dark"] .quran-modal input,
html[data-theme="dark"] .quran-modal textarea,
html[data-theme="dark"] .quran-modal select,
html[data-theme="dark"] .comment-form input,
html[data-theme="dark"] .message-form input { background: var(--surface); color: var(--ink); }
html[data-theme="dark"] .settings-panel,
html[data-theme="dark"] .settings-grid input,
html[data-theme="dark"] .settings-field textarea { background: var(--surface); color: var(--ink); }
html[data-theme="dark"] .settings-grid input:disabled { background: #111a18; }
html[data-theme="dark"] .icon-button:hover,
html[data-theme="dark"] .button-secondary:hover,
html[data-theme="dark"] .button-quiet:hover,
html[data-theme="dark"] .nav-item:hover,
html[data-theme="dark"] .post-action:hover,
html[data-theme="dark"] .post-menu button:hover,
html[data-theme="dark"] .conversation:hover,
html[data-theme="dark"] .conversation.is-active { background: #22302c; }
html[data-theme="dark"] .button-primary,
html[data-theme="dark"] .nav-item.is-active { background: #28675b; color: #fff; }
html[data-theme="dark"] .brand-name { color: #83d2d2; }
html[data-theme="dark"] .principle-panel,
html[data-theme="dark"] .guest-banner,
html[data-theme="dark"] .quran-pin,
html[data-theme="dark"] .comment-bubble,
html[data-theme="dark"] .demo-note { background: #172a26; }
html[data-theme="dark"] .quran-pin .translation { color: #d6e1dd; }
html[data-theme="dark"] .message-bubble:not(.mine) { background: #172a26; color: var(--ink); }
html[data-theme="dark"] .button-danger { border-color: #704949; background: #2c1d1d; }
html[data-theme="dark"] .modal-backdrop { background: rgba(2, 8, 7, .76); }
html[data-theme="dark"] .skeleton { background: linear-gradient(90deg, #1b2522 25%, #24302c 50%, #1b2522 75%); background-size: 200% 100%; }
html[data-theme="dark"] .post-image { filter: brightness(.9); }

@media (max-width: 1200px) {
  .header-inner, .app-shell { width: min(1140px, calc(100% - 32px)); }
  .header-inner { grid-template-columns: 200px 1fr minmax(280px, 420px) auto; }
  .community-mark small { display: none; }
  .app-shell { grid-template-columns: 210px minmax(540px, 1fr) 260px; gap: 24px; }
}

@media (max-width: 1120px) {
  .right-rail { display: none; }
  .app-shell { grid-template-columns: 210px minmax(0, 720px); justify-content: center; }
  .header-inner { grid-template-columns: 190px 1fr auto; }
  .community-mark { display: none; }
}

@media (max-width: 720px) {
  :root { --header-h: 60px; }
  body { font-size: 14px; }
  .site-header { height: var(--header-h); }
  .header-inner { width: calc(100% - 24px); grid-template-columns: 1fr auto; gap: 8px; }
  .brand { font-size: 16px; }
  .community-mark, .global-search { display: none; }
  .header-actions { gap: 6px; }
  .header-actions .icon-button { width: 38px; height: 38px; }
  .mobile-main-link { display: inline-grid; }
  .header-actions > .guest-only { display: none !important; }
  .profile-button { width: 40px; padding: 4px; border: 0; background: transparent; }
  .profile-button #header-name, .profile-button > svg { display: none; }
  .theme-menu { position: fixed; top: 54px; right: 12px; width: min(228px, calc(100vw - 24px)); }

  .app-shell { width: 100%; display: block; }
  .left-rail, .right-rail { display: none; }
  .main-column { width: 100%; padding: 20px 0 calc(90px + env(safe-area-inset-bottom)); }
  .page-heading { min-height: 82px; align-items: center; padding: 0 16px 16px; }
  .page-heading h1 { margin-top: 3px; font-size: 30px; }
  .page-heading p { max-width: 290px; font-size: 12px; line-height: 1.45; }
  .page-heading .button { display: none; }
  .guest-banner { grid-template-columns: 36px 1fr; gap: 10px; margin: 0; padding: 14px 16px; border-right: 0; border-left-width: 3px; }
  .guest-banner .button { grid-column: 1 / -1; width: 100%; }
  .guest-banner span { font-size: 11px; }

  .composer { margin: 12px 12px 0; padding: 12px; }
  .composer-top { grid-template-columns: 38px 1fr; gap: 9px; }
  .composer-top .avatar { width: 38px; height: 38px; }
  .composer-trigger { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .composer-expanded { margin-top: 10px; }
  .composer-expanded textarea { min-height: 118px; }
  .composer-footer { display: grid; }
  .composer-tools, .composer-submit { justify-content: space-between; }
  .composer-submit > span { margin-right: auto; }
  .tool-button { padding: 0 7px; font-size: 11px; }

  .feed-toolbar { position: sticky; top: var(--header-h); z-index: 30; height: 52px; margin-top: 8px; padding: 0 12px; background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(12px); }
  .tabs { gap: 18px; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 0 0 auto; }

  .post { padding: 18px 16px; }
  .post-head { gap: 10px; }
  .member-line { gap: 9px; }
  .member-line .avatar { width: 38px; height: 38px; font-size: 11px; }
  .post-body, .quran-pin, .comments { margin-left: 0; }
  .post-body { margin-top: 13px; margin-bottom: 13px; line-height: 1.65; }
  .quran-pin { padding: 14px 14px 13px; }
  .quran-pin-head { align-items: flex-start; font-size: 9px; }
  .quran-pin-head a { text-align: right; }
  .quran-pin .arabic { font-size: 24px; }
  .quran-pin .translation { font-size: 16px; }
  .post-image { width: 100%; max-height: 420px; margin-left: 0; }
  .post-actions { margin-left: 0; }
  .post-action { min-width: 42px; min-height: 40px; padding: 0 8px; }
  .post-menu { position: fixed; top: auto; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); width: calc(100vw - 24px); padding: 8px; }
  .post-menu button { height: 46px; }
  .comments { margin-top: 12px; }
  .comment-form { grid-template-columns: minmax(0, 1fr) 42px; }
  .comment-form .button { width: 42px; padding: 0; }

  .members-grid { grid-template-columns: 1fr; margin: 0; border-right: 0; border-left: 0; }
  .member-card { min-height: 164px; padding: 18px 16px; }
  .member-card p { height: auto; min-height: 38px; }
  .member-card-actions .button { flex: 1; }

  .profile-hero { margin-top: 0; padding: 20px 16px; }
  .profile-main { grid-template-columns: 58px 1fr; gap: 13px; }
  .profile-main .avatar-lg { width: 58px; height: 58px; font-size: 22px; }
  .profile-main h2 { font-size: 25px; }
  .profile-main p { margin: 8px 0; font-size: 13px; }
  .profile-meta { flex-wrap: wrap; gap: 7px 12px; }
  .profile-actions { grid-column: 1 / -1; }
  .profile-actions .button { flex: 1; }
  .profile-stats { justify-content: space-around; gap: 12px; margin: 18px 0 0; padding-top: 15px; border-top: 1px solid var(--line); text-align: center; }

  .settings-layout { margin-top: 0; }
  .settings-panel { padding: 20px 16px; border-right: 0; border-left: 0; border-radius: 0; }
  .settings-grid, .password-grid { grid-template-columns: 1fr; }
  .settings-actions .button { width: 100%; }

  .messages-layout { height: calc(100dvh - 224px); min-height: 500px; grid-template-columns: 1fr; grid-template-rows: 76px minmax(0, 1fr); margin-top: 0; border-right: 0; border-left: 0; }
  .conversation-list { display: flex; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .conversation-list::-webkit-scrollbar { display: none; }
  .conversation { min-width: 220px; height: 74px; border-right: 1px solid var(--line); }
  .conversation > div { min-width: 0; }
  .chat-panel { min-height: 0; }
  .chat-stream { padding: 14px; }
  .message-bubble { max-width: 86%; }

  .notification-item { padding: 15px 16px; }
  .empty-state { padding: 54px 22px; }

  .modal-backdrop { align-items: end; padding: 0; }
  .modal { width: 100%; max-height: calc(100dvh - 36px); padding: 30px 20px calc(24px + env(safe-area-inset-bottom)); border-radius: 8px 8px 0 0; }
  .modal h2 { font-size: 29px; }
  .form-row { grid-template-columns: 1fr; }
  .toast { right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); left: 12px; max-width: none; text-align: center; }

  .mobile-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 70; height: calc(66px + env(safe-area-inset-bottom)); display: flex; align-items: flex-start; justify-content: space-around; padding: 7px 8px env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 96%, transparent); box-shadow: 0 -8px 24px rgba(13, 30, 25, .08); backdrop-filter: blur(16px); }
  .mobile-nav button { min-width: 0; height: 52px; display: flex; flex: 1 1 0; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: transparent; color: var(--ink-soft); font-size: 9px; font-weight: 700; cursor: pointer; }
  .mobile-nav button svg { width: 20px; height: 20px; }
  .mobile-nav button.is-active { color: var(--green-2); }
  .mobile-nav .mobile-compose { width: 50px; max-width: 50px; height: 50px; margin-top: -22px; border-radius: 50%; background: var(--green); color: white; box-shadow: 0 8px 20px rgba(23, 62, 53, .28); }
  .mobile-nav .mobile-compose svg { width: 22px; height: 22px; }
  html[data-theme="dark"] .mobile-nav .mobile-compose { background: #2d7568; }
}

/* rd-community-blue-grey-v1 */
html[data-theme="dark"] {
  --paper: #14252c;
  --surface: #17252c;
  --cyan-soft: #1d333e;
  --line: #2c414d;
  --line-strong: #405865;
  --ink: #edf3f6;
  --ink-soft: #abbac3;
}
html[data-theme="dark"] .site-header {
  background: rgba(23,37,44,.96);
}
html[data-theme="dark"] .global-search,
html[data-theme="dark"] .composer-trigger,
html[data-theme="dark"] .settings-grid input:disabled {
  background: #14232b;
}
html[data-theme="dark"] .icon-button:hover,
html[data-theme="dark"] .button-secondary:hover,
html[data-theme="dark"] .button-quiet:hover,
html[data-theme="dark"] .nav-item:hover,
html[data-theme="dark"] .post-action:hover,
html[data-theme="dark"] .post-menu button:hover,
html[data-theme="dark"] .conversation:hover,
html[data-theme="dark"] .conversation.is-active {
  background: #223844;
}
html[data-theme="dark"] .button-primary,
html[data-theme="dark"] .nav-item.is-active,
html[data-theme="dark"] .mobile-nav .mobile-compose {
  background: #28566e;
  color: #fff;
}
html[data-theme="dark"] .button-primary:hover {
  background: #316880;
}
html[data-theme="dark"] .principle-panel,
html[data-theme="dark"] .guest-banner,
html[data-theme="dark"] .quran-pin,
html[data-theme="dark"] .comment-bubble,
html[data-theme="dark"] .demo-note,
html[data-theme="dark"] .message-bubble:not(.mine) {
  background: #192e38;
}
html[data-theme="dark"] .quran-pin .translation {
  color: #d6e1e8;
}
html[data-theme="dark"] .modal-backdrop {
  background: rgba(3,10,15,.76);
}
html[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg,#1b2d37 25%,#243b47 50%,#1b2d37 75%);
  background-size: 200% 100%;
}

/* rd-community-homepage-logo-v1 */
@font-face {
    font-family: "RealDeen Sans";
    src: url("/front_assets/fonts/lang/ProximaVara/ProximaVara.woff2") format("woff2");
    font-display: swap;
    font-style: normal;
    font-weight: 100 900;
}
.site-header .rd-homepage-brand {
    --rd-logo-text: #17231f;
    --rd-logo-muted: #60706a;
    position: relative;
    display: grid !important;
    grid-template-columns: auto 7px;
    grid-template-rows: auto auto;
    column-gap: 6px;
    row-gap: 0;
    align-items: center;
    width: max-content;
    padding: 0;
    border: 0;
    background: transparent;
    font-family: "RealDeen Sans", Inter, Arial, sans-serif !important;
    text-align: left;
    text-decoration: none !important;
}
html[data-theme="dark"] .site-header .rd-homepage-brand {
    --rd-logo-text: #eef4f1;
    --rd-logo-muted: #9fada8;
}
.site-header .rd-homepage-brand,
.site-header .rd-homepage-brand *,
.site-header .rd-homepage-brand::after {
    box-sizing: border-box;
    letter-spacing: 0 !important;
}
.site-header .rd-homepage-brand .brand-name {
    grid-column: 1;
    grid-row: 1;
    color: var(--rd-logo-text) !important;
    font-family: "RealDeen Sans", Inter, Arial, sans-serif !important;
    font-size: 21px !important;
    font-weight: 830 !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
    white-space: nowrap;
}
.site-header .rd-homepage-brand .brand-dot {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    width: 7px !important;
    height: 7px !important;
    margin: 0 !important;
    border-radius: 50% !important;
    background: #76cbd0 !important;
}
.site-header .rd-homepage-brand::after {
    content: "READ  •  UNDERSTAND  •  REFLECT";
    display: block;
    grid-column: 1 / 3;
    grid-row: 2;
    margin-top: 4px;
    color: var(--rd-logo-muted) !important;
    font-family: "RealDeen Sans", Inter, Arial, sans-serif !important;
    font-size: 8px !important;
    font-weight: 760 !important;
    line-height: 1 !important;
    text-transform: uppercase;
    white-space: nowrap;
}
@media (max-width: 820px) {
    .site-header .rd-homepage-brand .brand-name {
        font-size: 17px !important;
    }
    .site-header .rd-homepage-brand .brand-dot {
        width: 6px !important;
        height: 6px !important;
    }
    .site-header .rd-homepage-brand::after {
        font-size: 6.5px !important;
        margin-top: 3px;
    }
}

/* rd-community-nav-white-all-states-v2 */
html[data-theme="dark"] .left-rail .side-nav .nav-item,
html[data-theme="dark"] .left-rail .side-nav .nav-item:is(:hover, :focus, :focus-visible, :active, :visited, .is-active),
html[data-theme="dark"] .left-rail .side-nav .nav-item > span,
html[data-theme="dark"] .left-rail .side-nav .nav-item > svg,
html[data-theme="dark"] .left-rail .side-nav .nav-item:is(:hover, :focus, :focus-visible, :active, :visited, .is-active) > span,
html[data-theme="dark"] .left-rail .side-nav .nav-item:is(:hover, :focus, :focus-visible, :active, :visited, .is-active) > svg {
    color: #ffffff !important;
}

/* rd-community-sidebar-heading-teal-v1 */
html[data-theme="dark"] .rd-sidebar-teal-title {
    color: #76cbd0 !important;
}

/* rd-community-search-border-v1 */
html[data-theme="dark"] .site-header .global-search {
    border: 1px solid rgba(118, 203, 208, .60) !important;
    border-radius: 6px;
}
html[data-theme="dark"] .site-header .global-search:hover {
    border-color: #76cbd0 !important;
}
html[data-theme="dark"] .site-header .global-search:focus-within {
    border-color: #76cbd0 !important;
    box-shadow: 0 0 0 3px rgba(118, 203, 208, .14) !important;
}

/* rd-community-search-alignment-v1 */
.rd-header-middle-v1 {
    display: contents;
}
@media (min-width: 1201px) {
    .site-header .header-inner {
        grid-template-columns:
            minmax(230px, 1fr)
            minmax(620px, 3fr)
            minmax(280px, 1fr);
        gap: 32px;
    }
    .site-header .rd-header-middle-v1 {
        display: grid;
        grid-template-columns: minmax(140px, .75fr) minmax(0, 2.4fr);
        align-items: center;
        gap: 24px;
        min-width: 0;
    }
    .site-header .rd-header-middle-v1 .global-search {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
        margin: 0;
    }
    .site-header .header-actions {
        justify-self: end;
        min-width: 0;
    }
}

/* rd-owner-delete-v1 */
.rd-comment-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.rd-comment-delete {
    flex: 0 0 auto;
    padding: 4px 6px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #a52e39;
    font: inherit;
    font-size: 11px;
    cursor: pointer;
}
html[data-theme="dark"] .rd-comment-delete {
    color: #ffabb3;
}
.rd-comment-delete:hover { text-decoration: underline; }
.rd-comment-delete:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}
.rd-comment-delete:disabled { opacity: .5; cursor: wait; }

/* rd-quran-checkboxes-v1 */
#quran-modal .rd-quran-languages {
  display: flex; flex-wrap: wrap; gap: 12px 20px;
  margin: 18px 0; padding: 14px;
  border: 1px solid var(--line-strong); border-radius: 6px;
}
#quran-modal .rd-quran-languages legend {
  padding: 0 6px; color: var(--ink); font-size: 13px; font-weight: 700;
}
#quran-modal .rd-quran-languages label {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink); cursor: pointer; font-size: 13px;
}
#quran-modal .rd-quran-languages input[type="checkbox"] {
  appearance: auto; width: 17px; height: 17px; margin: 0; padding: 0;
  flex: 0 0 17px; accent-color: #53b6bd;
}
#quran-modal .rd-quran-languages input:focus-visible {
  outline: 2px solid #76cbd0; outline-offset: 3px;
}
#quran-modal .form-row label { color: var(--ink); }
#quran-fetch-status { font-size: 12px; color: var(--ink-soft); line-height: 1.5; }
#quran-fetch-preview { margin-bottom: 18px; }
#quran-fetch-preview:empty { display: none; }
.rd-pin-language {
  margin-top: 14px; font-size: 10px; font-weight: 800;
  color: var(--ink-soft); text-transform: uppercase;
}
.quran-pin .translation { white-space: pre-wrap; overflow-wrap: anywhere; }
#save-quran:disabled { opacity: .5; cursor: wait; }

/* rd-audit-release-v1 */
.rd-post-permalink {color:inherit;text-decoration:none;}
.rd-post-permalink:hover,.rd-post-permalink:focus-visible {text-decoration:underline;}
.rd-notification-link {color:inherit;text-decoration:none;cursor:pointer;}
.rd-notification-count {font-size:10px;min-width:16px;padding:1px 4px;border-radius:9px;background:var(--cyan);color:var(--deep,#14252c);margin-left:4px;}
.rd-notification-count[hidden] {display:none!important;}
.rd-notification-tools {display:flex;justify-content:space-between;gap:8px;margin-bottom:12px;flex-wrap:wrap;}
.rd-ssr-post .post-body {white-space:pre-wrap;}
