/* Renas writers' community — builds on tokens in site.css */
body { padding-bottom: 72px; }
@media (min-width: 900px) { body { padding-bottom: 0; } }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.muted { color: var(--muted); }
.page-title { font-size: 1.7rem; margin: 26px 0 18px; display: flex; align-items: center; gap: 10px; }
.block-sm { margin-top: 26px; }
.dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; display: inline-block; }

/* buttons */
.btn-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-ink); }
.btn-sm { height: 34px; padding: 0 14px; font-size: .84rem; }
.btn-lg { height: 48px; padding: 0 26px; font-size: 1rem; }
.btn-danger { background: transparent; color: var(--red); border: 1px solid color-mix(in srgb, var(--red) 40%, transparent); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-follow { background: var(--ink); color: var(--bg); }
.btn-follow:hover { background: var(--gold); color: var(--on-gold); }
.btn-follow.on { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.btn-follow.on:hover { border-color: var(--red); color: var(--red); }
.icon-btn.ghost { border-color: transparent; background: transparent; }
.icon-btn.ghost:hover { background: var(--surface); }

/* avatars */
.av { width: var(--s); height: var(--s); border-radius: 50%; object-fit: cover; flex: none; background: var(--surface); display: inline-block; }
.av-ph { display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: calc(var(--s) * .42); line-height: 1;
  background: linear-gradient(135deg, hsl(var(--h) 42% 46%), hsl(calc(var(--h) + 35) 48% 34%)); font-family: var(--f-body); }
.tick { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--gold); color: var(--on-gold); margin-inline-start: 5px; vertical-align: -3px; }
.tick .i { stroke-width: 3; }
.sample-tag { font-size: .66rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--surface); color: var(--muted); border: 1px solid var(--line); margin-inline-start: 6px; vertical-align: 2px; }
.pill { font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.pill-draft { background: var(--gold-soft); color: var(--gold-ink); }
.pill-hidden { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }

/* app bar */
.appbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.appbar-in { display: flex; align-items: center; gap: 12px; height: 62px; }
.app-brand img { height: 44px; width: auto; }
.app-search { display: none; max-width: 280px; height: 40px; }
@media (min-width: 900px) { .app-search { display: flex; } }
.app-nav { display: none; flex: 1; justify-content: center; gap: 4px; height: 100%; }
@media (min-width: 900px) { .app-nav { display: flex; } }
.app-nav a { position: relative; display: flex; align-items: center; gap: 8px; padding: 0 18px; color: var(--muted); font-weight: 600; font-size: .92rem; border-radius: 10px; }
.app-nav a span { display: none; }
@media (min-width: 1200px) { .app-nav a span { display: inline; } }
.app-nav a:hover { color: var(--ink); background: var(--surface); margin-block: 8px; }
.app-nav a.is-active { color: var(--gold-ink); }
.app-nav a.is-active::after { content: ""; position: absolute; inset-inline: 8px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--gold); }
.app-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
@media (min-width: 900px) { .app-actions { margin-inline-start: 0; } }
.write-btn { height: 40px; padding: 0 16px; }
@media (max-width: 899px) { .write-btn { display: none; } }
.bell { position: relative; }
.bell.is-active { color: var(--gold-ink); border-color: var(--gold); }
.bell .count { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--paper); }
.me-btn { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; display: flex; }
.me-btn:focus-visible { outline: 2.5px solid var(--gold); }

/* dropdown */
.menu-wrap { position: relative; }
.dropdown { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; min-width: 240px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px -14px rgba(30, 18, 10, .35); padding: 6px; z-index: 60; }
.dropdown a, .dropdown button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px; border: 0; background: none; cursor: pointer; font-weight: 500; font-size: .93rem; text-align: start; color: var(--ink); }
.dropdown a:hover, .dropdown button:hover { background: var(--surface); }
.dropdown .danger { color: var(--red); }
.dropdown form { margin: 0; }
.dd-me { border-bottom: 1px solid var(--line); border-radius: 10px 10px 0 0 !important; margin-bottom: 4px; padding-bottom: 12px !important; }
.dd-me span { display: grid; line-height: 1.3; }
.dd-me small { color: var(--muted); }

/* news sub-nav reuses .nav-in */
.newsnav { background: var(--bg); border-bottom: 1px solid var(--line); }

/* toast */
.toast { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 90; background: var(--brown-deep); color: #FBF1D3; padding: 12px 20px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 600; max-width: min(92vw, 560px); text-align: center; animation: toast 6s forwards; }
.toast-info { background: var(--gold); color: var(--on-gold); animation-duration: 30s; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -10px); } 5%, 90% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; visibility: hidden; } }

/* grid */
.side-left, .side-right { display: none; }
@media (min-width: 900px) { .side-right { display: block; } }
.app-grid { display: grid; gap: 22px; padding-top: 20px; align-items: start; }
@media (min-width: 900px) { .app-grid { grid-template-columns: minmax(0, 1fr) 300px; } .side-left { display: none; } }
@media (min-width: 1200px) { .app-grid { grid-template-columns: 250px minmax(0, 1fr) 310px; } .side-left { display: block; } }
.post-grid { grid-template-columns: minmax(0, 1fr) !important; }
@media (min-width: 900px) { .post-grid { grid-template-columns: minmax(0, 720px) 310px !important; justify-content: center; } }
.feed-col { min-width: 0; max-width: 680px; width: 100%; margin-inline: auto; }
.sticky-col { position: sticky; top: 80px; display: grid; gap: 16px; }
.side-title { font-size: 1.02rem; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }

.mini-profile { display: grid; justify-items: center; text-align: center; overflow: hidden; padding-bottom: 14px; }
.mp-cover { display: block; width: 100%; height: 64px; background: linear-gradient(120deg, #3B2B23, #977669 55%, #CA8A04); background-size: cover; background-position: center; }
.mp-av { margin-top: -32px; border: 3px solid var(--paper); box-sizing: content-box; }
.mini-profile strong { margin-top: 8px; font-size: 1.02rem; }
.mini-profile small, .author-card small, .writer-card small { color: var(--muted); font-size: .82rem; }
.mp-stats { display: flex; justify-content: center; gap: 16px; margin-top: 12px; font-size: .76rem; color: var(--muted); }
.mp-stats span { display: grid; justify-items: center; }
.mp-stats b { font-size: 1rem; color: var(--ink); }
.side-nav { padding: 8px; display: grid; }
.side-nav a, .side-cats a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: .93rem; color: var(--ink-2); }
.side-nav a:hover, .side-cats a:hover { background: var(--surface); color: var(--ink); }
.side-nav a.is-active, .side-cats a.is-active { background: var(--gold-soft); color: var(--gold-ink); }
.side-cats { padding: 14px 8px 8px; }
.side-cats .side-title { padding-inline: 12px; }
.cat-ic { width: 30px; height: 30px; border-radius: 9px; background: var(--surface); display: grid; place-items: center; color: var(--gold-ink); }
.side-box { padding: 16px; }
.who { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.who-txt { flex: 1; min-width: 0; line-height: 1.35; }
.who-txt a { font-weight: 700; font-size: .93rem; }
.who-txt small { display: block; color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-list { padding: 6px 16px; }
.who-list .who:not(:last-child) { border-bottom: 1px solid var(--line); }
.side-box .more { margin-top: 8px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-cloud a { padding: 5px 11px; border-radius: 999px; background: var(--surface); font-weight: 600; font-size: .85rem; color: var(--gold-ink); }
.tag-cloud a:hover { background: var(--gold-soft); }
.tag-cloud small { color: var(--muted); font-weight: 500; }
.sn-item { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 8px 0; font-size: .86rem; font-weight: 600; line-height: 1.45; border-bottom: 1px solid var(--line); }
.sn-item:hover { color: var(--gold-ink); }
.sn-item img { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; }
.sn-item small { display: block; color: var(--gold-ink); font-size: .7rem; font-weight: 700; }
.side-foot { font-size: .78rem; color: var(--muted); padding: 0 6px; line-height: 2; }
.side-foot span { display: block; }

/* join card */
.join-card { display: grid; overflow: hidden; margin-bottom: 18px; background: linear-gradient(135deg, var(--paper), var(--gold-soft)); }
@media (min-width: 640px) { .join-card { grid-template-columns: 1fr 180px; } }
.join-copy { padding: 26px; }
.join-copy h1 { font-size: clamp(1.6rem, 3.6vw, 2.2rem); margin: 6px 0 8px; }
.join-copy p { color: var(--ink-2); }
.join-points { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; font-weight: 600; font-size: .94rem; }
.join-points li { display: flex; gap: 8px; align-items: center; }
.join-points .i { color: var(--on-gold); background: var(--gold); border-radius: 50%; padding: 2px; stroke-width: 3; }
.join-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.join-art { display: none; position: relative; background: linear-gradient(160deg, #3B2B23, #6b4e3f); }
@media (min-width: 640px) { .join-art { display: block; } }
.ja-line { position: absolute; inset-inline: 22px; height: 6px; border-radius: 4px; background: rgba(250, 242, 231, .25); }
.ja-line.l1 { top: 40%; } .ja-line.l2 { top: 50%; inset-inline-end: 56px; } .ja-line.l3 { top: 60%; inset-inline-end: 80px; }
.ja-quill { position: absolute; top: 14%; inset-inline-end: 26px; color: #EAB308; }

/* composer */
.composer { padding: 14px 16px; margin-bottom: 14px; }
.cmp-row, .cmp-link { display: flex; align-items: center; gap: 12px; }
.cmp-link { margin-bottom: 14px; }
.cmp-fake { flex: 1; text-align: start; border: 0; background: var(--surface); color: var(--muted); padding: 12px 18px; border-radius: 999px; cursor: text; font-size: .96rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-fake:hover { background: color-mix(in srgb, var(--surface) 70%, var(--line)); }
.composer.open .cmp-row { display: none; }
.cmp-full textarea { width: 100%; border: 0; background: transparent; resize: none; outline: none; font-size: 1.12rem; line-height: 1.8; min-height: 120px; padding: 4px 2px; }
.lang-ar .cmp-full textarea { font-size: 1.2rem; }
.cmp-tools { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.tool { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: .88rem; color: var(--ink-2); cursor: pointer; }
.tool:hover { background: var(--surface); }
.tool:first-child .i { color: #2f9e5a; }
.tool .i { color: var(--gold-ink); }
.cmp-submit { margin-inline-start: auto; }
.cmp-preview { position: relative; margin: 10px 0; }
.cmp-preview img { width: 100%; max-height: 340px; object-fit: cover; border-radius: 12px; }
.cmp-preview .icon-btn { position: absolute; top: 8px; inset-inline-end: 8px; }

/* chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px 0 14px; }
.cat-filter::-webkit-scrollbar { display: none; }
.chip { flex: none; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span, a.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font-weight: 600; font-size: .86rem; color: var(--ink-2); white-space: nowrap; transition: all .15s; }
a.chip span { padding: 0; border: 0; background: none; }
.chip:hover span, a.chip:hover { border-color: var(--gold); }
.chip input:checked + span, a.chip.on { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-ink); }
.chip input:focus-visible + span { outline: 2.5px solid var(--gold); }
.cmp-cats { margin-top: 10px; }

/* feed tabs */
.feed-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 6px 0 12px; }
.feed-tabs a { padding: 10px 14px; font-weight: 700; font-size: .93rem; color: var(--muted); position: relative; }
.feed-tabs a[aria-selected="true"] { color: var(--ink); }
.feed-tabs a[aria-selected="true"]::after { content: ""; position: absolute; inset-inline: 10px; bottom: -1px; height: 3px; border-radius: 3px; background: var(--gold); }
.feed { display: grid; gap: 14px; }
.load-more { justify-self: center; margin: 6px 0 20px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); display: grid; justify-items: center; gap: 12px; }
.empty .i { color: var(--gold); }
.empty-inline { color: var(--muted); padding: 8px 0; }

/* post card */
.post-card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 16px 18px 6px; }
.pc-head { display: flex; gap: 12px; align-items: flex-start; }
.pc-who { flex: 1; min-width: 0; line-height: 1.35; }
.pc-name { font-weight: 700; font-size: .98rem; }
.pc-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.pc-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: .8rem; color: var(--muted); margin-top: 2px; }
.pc-meta a:hover { color: var(--ink); }
.pc-cat { color: var(--gold-ink) !important; font-weight: 700; }
.pc-menu { margin-inline-start: auto; margin-top: -4px; }
.pc-body { margin-top: 12px; font-size: 1.06rem; line-height: 1.85; word-wrap: break-word; overflow-wrap: anywhere; }
.lang-ar .pc-body { font-size: 1.14rem; line-height: 2; }
.pc-body.big { font-family: var(--f-head); font-size: 1.5rem; line-height: 1.6; }
.pc-body.clamp { max-height: 16.5em; overflow: hidden; position: relative; }
.pc-body.clamp.overflowing::after { content: ""; position: absolute; inset: auto 0 0; height: 4em; background: linear-gradient(transparent, var(--paper)); }
.pc-body.expanded { max-height: none; }
.pc-body.expanded::after { display: none; }
.see-more { border: 0; background: none; color: var(--gold-ink); font-weight: 700; cursor: pointer; padding: 4px 0; }
.rich p { margin: 0 0 .8em; }
.rich p:last-child { margin-bottom: 0; }
.rich h2 { font-size: 1.35rem; margin: 1.2em 0 .5em; }
.rich blockquote { margin: 1em 0; padding: 6px 16px; border-inline-start: 4px solid var(--gold); background: var(--gold-soft); border-radius: 0 10px 10px 0; font-family: var(--f-head); font-size: 1.08em; }
[dir="rtl"] .rich blockquote { border-radius: 10px 0 0 10px; }
.rich ul { padding-inline-start: 1.3em; margin: .6em 0; }
.rich a { color: var(--gold-ink); font-weight: 600; }
.rich a:hover { text-decoration: underline; }
.pc-media { display: block; margin: 12px -18px 0; }
.pc-media img { width: 100%; max-height: 520px; object-fit: cover; }
.pc-article { display: block; margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: border-color .15s; }
.pc-article:hover { border-color: var(--gold); }
.pc-cover { width: 100%; aspect-ratio: 16/8; object-fit: cover; }
.pc-article-body { padding: 14px 16px 16px; background: var(--bg); }
.pc-kind { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 700; color: var(--gold-ink); }
.pc-title { font-size: 1.35rem; margin: 6px 0; }
.pc-excerpt { color: var(--ink-2); font-size: .96rem; }
.pc-stats { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .84rem; color: var(--muted); padding: 12px 0 8px; min-height: 12px; }
.pc-stats [hidden] { display: none; }
.pc-stats a:hover { text-decoration: underline; }
.heart-dot { display: inline-grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: #E0464F; color: #fff; vertical-align: -4px; }
.heart-dot .i { fill: #fff; stroke: #fff; }
.pc-actions { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); padding: 4px 0; }
.act { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 4px; border: 0; background: none; cursor: pointer; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: .88rem; }
.act:hover { background: var(--surface); color: var(--ink); }
.act.like.on { color: #E0464F; }
.act.like.on .i { fill: #E0464F; }
.act.like.pop .i { animation: pop .35s; }
@keyframes pop { 50% { transform: scale(1.35); } }
.act.save.on { color: var(--gold-ink); }
.act.save.on .i { fill: var(--gold); stroke: var(--gold-ink); }
@media (max-width: 420px) { .act span { display: none; } }

/* single post */
.post-card.is-full { padding: 22px 24px 6px; }
.post-title { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 18px 0 8px; line-height: 1.3; }
.lang-ar .post-title { line-height: 1.55; }
.post-sub { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .84rem; }
.post-cover { width: calc(100% + 48px); margin: 18px -24px 0; max-height: 460px; object-fit: cover; }
.post-card.is-full .prose { margin-top: 18px; }
.post-card.is-full .pc-body { font-size: 1.2rem; }
.lang-ar .post-card.is-full .pc-body { font-size: 1.28rem; }
.post-card.is-full .pc-media { margin-inline: -24px; }

/* comments */
.comments-box { padding: 18px 20px; margin-top: 14px; }
.comments-box > h2 { font-size: 1.15rem; margin-bottom: 14px; }
.cm-count { color: var(--muted); font-weight: 600; font-size: .9rem; }
.comment-form { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px; }
.cf-box { flex: 1; position: relative; background: var(--surface); border-radius: 20px; border: 1px solid transparent; }
.cf-box:focus-within { border-color: var(--gold); background: var(--paper); }
.cf-box textarea { width: 100%; border: 0; background: none; resize: none; outline: none; padding: 10px 50px 10px 16px; min-height: 42px; max-height: 240px; line-height: 1.6; }
[dir="rtl"] .cf-box textarea { padding: 10px 16px 10px 50px; }
.cf-send { position: absolute; bottom: 5px; inset-inline-end: 6px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--gold); color: var(--on-gold); display: grid; place-items: center; cursor: pointer; }
[dir="rtl"] .cf-send .i { transform: scaleX(-1); }
.cf-replying { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px 0; font-size: .8rem; color: var(--gold-ink); font-weight: 600; }
.cf-replying button { border: 0; background: none; cursor: pointer; color: var(--muted); }
.cm-login { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; font-weight: 600; }
.comment { display: flex; gap: 10px; margin-top: 12px; }
.c-main { flex: 1; min-width: 0; }
.c-bubble { display: inline-block; max-width: 100%; background: var(--surface); padding: 8px 14px 10px; border-radius: 18px; }
.c-name { font-weight: 700; font-size: .88rem; }
.c-text { font-size: .97rem; line-height: 1.7; overflow-wrap: anywhere; }
.c-meta { display: flex; gap: 14px; font-size: .76rem; color: var(--muted); padding: 4px 12px 0; }
.c-meta button { border: 0; background: none; padding: 0; cursor: pointer; font-weight: 700; color: var(--muted); font-size: inherit; }
.c-meta button:hover { color: var(--ink); text-decoration: underline; }
.replies { padding-inline-start: 4px; }
.replies .comment { margin-top: 10px; }
.comment.flash .c-bubble { animation: flashbg 2s; }
@keyframes flashbg { 0%, 40% { background: var(--gold-soft); } }
.author-card { display: grid; justify-items: center; text-align: center; overflow: hidden; padding-bottom: 18px; }
.author-card .mp-cover { height: 80px; }
.author-card .mp-av { margin-top: -36px; }
.ac-name { font-weight: 700; font-size: 1.1rem; margin-top: 8px; }
.author-card p { padding: 8px 18px 0; font-size: .9rem; color: var(--ink-2); }
.author-card .btn { margin: 14px 18px 0; width: calc(100% - 36px); }
.more-item { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); font-weight: 600; font-size: .92rem; line-height: 1.5; }
.more-item:last-child { border-bottom: 0; }
.more-item small { display: block; color: var(--muted); font-weight: 500; font-size: .76rem; }
.more-item:hover span { color: var(--gold-ink); }

/* profile */
.profile-wrap { padding-top: 18px; }
.profile-head { overflow: hidden; }
.ph-cover { height: clamp(140px, 26vw, 280px); background: linear-gradient(120deg, #2A1F1A 0%, #5d4436 45%, #977669 70%, #CA8A04 100%); background-size: cover; background-position: center; position: relative; }
.ph-cover:not([style])::after { content: "”"; position: absolute; inset-inline-end: 6%; top: -10%; font: 800 clamp(10rem, 24vw, 18rem)/1 "Playfair Display", serif; color: rgba(250, 242, 231, .12); }
.ph-body { display: grid; gap: 14px; padding: 0 20px 20px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .ph-body { grid-template-columns: auto 1fr auto; align-items: end; padding: 0 28px 22px; } }
.ph-av { margin-top: -66px; }
.ph-av .av { border: 5px solid var(--paper); box-sizing: content-box; box-shadow: var(--shadow); }
@media (max-width: 759px) { .ph-av .av { --s: 104px !important; width: 104px; height: 104px; } .ph-av { margin-top: -54px; } }
.ph-id h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
.ph-handle { color: var(--muted); font-size: .92rem; }
.ph-type { color: var(--gold-ink); font-weight: 700; }
.ph-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; font-size: .9rem; color: var(--muted); }
.ph-stats b { color: var(--ink); }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.profile-grid { display: grid; gap: 18px; margin-top: 18px; }
@media (min-width: 900px) { .profile-grid { grid-template-columns: 320px minmax(0, 1fr); align-items: start; } .profile-grid .feed-col { margin: 0; } }
.about-box { padding: 18px; }
.bio { font-size: .96rem; line-height: 1.75; }
.facts { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; font-size: .9rem; color: var(--ink-2); }
.facts li { display: flex; gap: 10px; align-items: center; }
.facts .i { color: var(--muted); }
.facts a { color: var(--gold-ink); font-weight: 600; }

/* writers */
.writer-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-top: 18px; }
.writer-card { display: grid; justify-items: center; text-align: center; overflow: hidden; padding-bottom: 16px; align-content: start; }
.writer-card .mp-cover { height: 78px; }
.writer-card .mp-av { margin-top: -38px; }
.writer-card h2 { font-size: 1.08rem; margin-top: 8px; font-family: var(--f-body); }
.writer-card p { font-size: .86rem; color: var(--ink-2); padding: 6px 16px 0; min-height: 2.6em; }
.writer-card .btn { margin: 12px 16px 0; width: calc(100% - 32px); }

/* write page */
.write-wrap { max-width: 820px; padding-top: 22px; }
.write-card { padding: 20px 22px; }
.wc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.wc-who { display: flex; gap: 10px; align-items: center; line-height: 1.3; }
.wc-who small { display: block; color: var(--muted); }
.seg { display: inline-flex; background: var(--surface); border-radius: 12px; padding: 4px; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 9px; font-weight: 700; font-size: .86rem; color: var(--muted); cursor: pointer; }
.seg input:checked + span { background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.seg input:focus-visible + span { outline: 2px solid var(--gold); }
.wc-title { width: 100%; border: 0; background: none; outline: none; font: 700 clamp(1.5rem, 3.4vw, 2.1rem)/1.35 var(--f-head); margin-top: 18px; padding: 0; }
.wc-title::placeholder { color: var(--line-2); }
.write-card:not(.is-article) [data-article-only] { display: none; }
.wc-toolbar { display: flex; align-items: center; gap: 2px; margin-top: 14px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; width: fit-content; max-width: 100%; }
.wc-toolbar button { width: 36px; height: 34px; border: 0; background: none; border-radius: 8px; cursor: pointer; display: grid; place-items: center; color: var(--ink-2); }
.wc-toolbar button:hover { background: var(--surface); color: var(--gold-ink); }
.wc-count { font-size: .76rem; color: var(--muted); padding: 0 10px; font-variant-numeric: tabular-nums; }
.wc-body { width: 100%; min-height: 260px; border: 0; background: none; outline: none; resize: vertical; margin-top: 12px; font-size: 1.12rem; line-height: 1.9; padding: 0; }
.lang-ar .wc-body { font-size: 1.22rem; line-height: 2; }
.write-card.is-article .wc-body { min-height: 420px; }
.hint { font-size: .78rem; color: var(--muted); direction: ltr; text-align: start; unicode-bidi: plaintext; }
.wc-cover { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.wc-cats { border: 0; padding: 0; margin: 16px 0 0; }
.wc-cats legend { font-weight: 700; font-size: .9rem; margin-bottom: 10px; }
.wc-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.alert { background: color-mix(in srgb, var(--red) 10%, var(--paper)); border: 1px solid color-mix(in srgb, var(--red) 35%, transparent); color: var(--red); border-radius: 12px; padding: 10px 14px; margin: 14px 0; font-weight: 600; font-size: .92rem; }

/* auth */
.auth-wrap { display: grid; gap: 22px; padding-top: 28px; max-width: 1000px; }
@media (min-width: 860px) { .auth-wrap { grid-template-columns: 1fr 440px; align-items: stretch; } }
.auth-art { display: none; position: relative; overflow: hidden; border-radius: 20px; padding: 36px; color: #F6EEE4; background: radial-gradient(circle at 85% 15%, rgba(234, 179, 8, .35), transparent 45%), linear-gradient(150deg, #2A1F1A, #5d4436 70%, #977669); }
@media (min-width: 860px) { .auth-art { display: block; } }
.auth-art img { height: 70px; width: auto; filter: drop-shadow(0 2px 8px rgba(0,0,0,.3)); }
.auth-art h2 { font-size: 2rem; margin-top: 28px; color: #FFF3DD; }
.auth-art p { color: #E2D2C2; margin-top: 10px; max-width: 42ch; }
.auth-art .join-points { color: #FFF3DD; }
.auth-art .ja-quill { position: absolute; bottom: 24px; inset-inline-end: 28px; top: auto; opacity: .9; }
.auth-card { padding: 28px; }
.auth-card h1 { font-size: 1.6rem; margin-bottom: 18px; }
.stack-form { display: grid; gap: 14px; }
.stack-form label, .form-grid label { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; }
.stack-form input, .form-grid input, .form-grid select, .form-grid textarea, .admin-main select, .modal textarea {
  width: 100%; border: 1px solid var(--line-2); background: var(--bg); border-radius: 11px; padding: 11px 14px; font-weight: 400; font-size: 1rem; }
.stack-form input:focus, .form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus, .modal textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent); background: var(--paper); }
.at-field { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 11px; background: var(--bg); direction: ltr; }
.at-field span { padding-left: 14px; color: var(--muted); font-weight: 700; }
.at-field input { border: 0 !important; background: none !important; box-shadow: none !important; padding-left: 4px; }
.at-field:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent); }
.pw { position: relative; display: block; }
.pw-toggle { position: absolute; top: 50%; transform: translateY(-50%); right: 8px; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px; }
.field-err { color: var(--red); font-size: .82rem; font-weight: 600; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.switch { text-align: center; font-size: .92rem; color: var(--muted); }
.switch a, .fine a { color: var(--gold-ink); font-weight: 700; }
.fine { font-size: .8rem; color: var(--muted); text-align: center; }

/* settings */
.settings-wrap { max-width: 760px; }
.settings-card { padding: 22px; margin-bottom: 18px; }
.settings-card h2 { font-size: 1.15rem; margin-bottom: 14px; }
.set-images { position: relative; margin: -22px -22px 64px; }
.set-cover { display: block; height: 170px; border-radius: 16px 16px 0 0; background: linear-gradient(120deg, #2A1F1A, #977669 60%, #CA8A04); background-size: cover; background-position: center; cursor: pointer; position: relative; }
.set-change { position: absolute; bottom: 12px; inset-inline-end: 12px; display: inline-flex; gap: 6px; align-items: center; background: rgba(20, 13, 8, .6); color: #fff; padding: 7px 12px; border-radius: 999px; font-size: .82rem; font-weight: 600; }
.set-av { position: absolute; bottom: -56px; inset-inline-start: 22px; cursor: pointer; }
.set-av .av { border: 4px solid var(--paper); box-sizing: content-box; }
.set-av-btn { position: absolute; bottom: 4px; inset-inline-end: 4px; width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: var(--on-gold); display: grid; place-items: center; border: 3px solid var(--paper); }
.form-grid { display: grid; gap: 14px; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }
.form-actions { margin-top: 18px; display: flex; justify-content: flex-end; }
.switch-row { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.switch-row input { width: 20px; height: 20px; accent-color: var(--gold); }

/* notifications */
.notif-list { overflow: hidden; }
.notif { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.notif:last-child { border-bottom: 0; }
.notif:hover { background: var(--surface); }
.notif.unread { background: var(--gold-soft); }
.n-av { position: relative; flex: none; }
.n-ic { position: absolute; bottom: -2px; inset-inline-end: -4px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; border: 2px solid var(--paper); background: var(--gold); }
.n-like { background: #E0464F; } .n-follow { background: #3b82c4; } .n-comment, .n-reply { background: #2f9e5a; }
.n-txt { line-height: 1.55; font-size: .95rem; }
.n-txt em { display: block; font-style: normal; color: var(--ink-2); font-size: .88rem; }
.n-txt small { display: block; color: var(--gold-ink); font-weight: 600; font-size: .76rem; margin-top: 2px; }

/* admin */
.admin-wrap { display: grid; gap: 18px; padding-top: 18px; }
@media (min-width: 900px) { .admin-wrap { grid-template-columns: 220px minmax(0, 1fr); align-items: start; } .admin-tabs { position: sticky; top: 80px; } }
.admin-tabs { padding: 8px; display: flex; gap: 2px; overflow-x: auto; }
@media (min-width: 900px) { .admin-tabs { flex-direction: column; } }
.admin-tabs a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; font-weight: 600; white-space: nowrap; color: var(--ink-2); }
.admin-tabs a:hover { background: var(--surface); }
.admin-tabs a.is-active { background: var(--gold-soft); color: var(--gold-ink); }
.admin-main .page-title { margin-top: 0; }
.admin-main > .search-box { margin-bottom: 14px; max-width: 360px; }
.stat-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 18px; }
.stat { padding: 18px; }
.stat span { color: var(--muted); font-size: .86rem; font-weight: 600; }
.stat b { display: block; font-size: 2rem; font-family: "Playfair Display", Georgia, serif; color: var(--gold-ink); }
.table-card { padding: 16px; overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: start; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.is-banned { opacity: .55; }
.tbl-user { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.tbl-user span { display: grid; line-height: 1.3; }
.tbl-user small, .tbl-post small { color: var(--muted); font-weight: 500; font-size: .76rem; }
.tbl-post a { display: block; font-weight: 600; max-width: 380px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tbl select { padding: 6px 10px; border-radius: 8px; width: auto; }
form.inline { display: inline; margin: 0; }
.report { padding: 16px; margin-bottom: 12px; }
.report blockquote { margin: 10px 0; padding: 10px 14px; background: var(--surface); border-radius: 10px; }

/* pages */
.rules { padding-inline-start: 1.3em; display: grid; gap: 10px; font-size: 1.06rem; margin: 10px 0 24px; }

/* modal */
.modal { border: 0; padding: 0; background: transparent; max-width: 440px; width: calc(100% - 32px); }
.modal::backdrop { background: rgba(15, 10, 6, .55); }
.modal-card { background: var(--paper); color: var(--ink); border-radius: 18px; padding: 22px; display: grid; gap: 10px; }
.modal-card h2 { font-size: 1.2rem; margin-bottom: 4px; }
.radio { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 500; }
.radio:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }
.radio input { accent-color: var(--gold); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* mobile tab bar */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 45; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { .tabbar { display: none; } }
.tabbar a { display: grid; justify-items: center; gap: 2px; font-size: .68rem; font-weight: 600; color: var(--muted); padding: 4px 0; }
.tabbar a.is-active { color: var(--gold-ink); }
.tabbar .tab-write { width: 50px; height: 50px; border-radius: 16px; background: var(--gold); color: var(--on-gold); place-items: center; justify-self: center; box-shadow: 0 8px 20px -8px rgba(202, 138, 4, .8); margin-top: -18px; }

/* footer slim */
.footer.slim { padding-top: 0; margin-top: 48px; }
.footer .foot-inline { display: flex; gap: 16px; flex-wrap: wrap; }
.footer .foot-inline a:hover { color: #F2C14E; }
.footer:not(.slim) .foot-bottom { margin-top: 0; border-top: 0; }
[hidden] { display: none !important; }
.mention { unicode-bidi: isolate; direction: ltr; display: inline-block; }
.post-cover, .pc-media img, .pc-cover { max-width: none; }
.btn.is-busy { pointer-events: none; opacity: .85; }
.spin { width: 16px; height: 16px; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
