/* NEIS Circle v27 — local article recovery and database-backed article comments. */
.article-autosave-bar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:0 0 18px;padding:12px 14px;border:1px solid var(--line);border-radius:15px;background:var(--soft)}
.article-autosave-status{display:flex;align-items:center;gap:8px;min-width:0;color:var(--muted);font-size:10px;font-weight:650}
.article-autosave-status i{width:8px;height:8px;flex:0 0 8px;border-radius:50%;background:var(--muted)}
.article-autosave-status.is-saving i{background:#d3982f;animation:autosave-pulse .8s infinite alternate}
.article-autosave-status.is-saved i{background:var(--accent)}
.article-autosave-status.is-error{color:#9d352b}.article-autosave-status.is-error i{background:#b84437}
.article-autosave-time{white-space:nowrap;font-weight:500;opacity:.8}
@keyframes autosave-pulse{to{opacity:.3}}
.article-restore{display:grid;grid-template-columns:1fr auto;gap:14px;align-items:center;margin:0 0 18px;padding:16px;border:1px solid color-mix(in srgb,var(--accent) 35%,var(--line));border-radius:17px;background:color-mix(in srgb,var(--accent) 7%,var(--card))}
.article-restore b{display:block;font-size:12px}.article-restore p{margin:4px 0 0;color:var(--muted);font-size:10px;line-height:1.55}
.article-restore-actions{display:flex;gap:7px}.article-restore-actions button{height:38px}
.article-editor-meta{display:grid;grid-template-columns:minmax(0,.75fr) minmax(0,1.25fr);gap:12px}
.article-comments{margin-top:42px;padding-top:28px;border-top:1px solid var(--line)}
.reader[dir="rtl"] h1,.reader[dir="rtl"] .reader-body{text-align:right}.reader[dir="ltr"] h1,.reader[dir="ltr"] .reader-body{text-align:left}
.reader-body{unicode-bidi:plaintext}.reader-body p,.reader-body li,.reader-body blockquote,.reader-body h2,.reader-body h3{direction:inherit;text-align:start}
.article-card h3[dir="rtl"],.article-card p[dir="rtl"]{text-align:right}.article-card h3[dir="ltr"],.article-card p[dir="ltr"]{text-align:left}
.article-engagement{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:26px}
.article-engagement button{display:flex;align-items:center;justify-content:center;gap:8px;min-height:46px;padding:0 14px;border:1px solid var(--line);border-radius:14px;background:var(--soft);color:var(--muted);font:inherit;font-size:10px;font-weight:750;transition:border-color .18s ease,background .18s ease,color .18s ease,transform .18s ease}
.article-engagement button:hover{border-color:color-mix(in srgb,var(--accent) 45%,var(--line));color:var(--ink);transform:translateY(-1px)}
.article-engagement button.active{border-color:color-mix(in srgb,var(--accent) 40%,var(--line));background:color-mix(in srgb,var(--accent) 10%,var(--card));color:var(--accent)}
.article-engagement button:disabled{cursor:wait;opacity:.65;transform:none}.article-engagement svg{width:18px;height:18px;flex:0 0 18px;fill:none;stroke:currentColor;stroke-width:1.8}.article-engagement button.active svg{fill:currentColor}.article-engagement b{min-width:1ch;color:inherit;font-size:10px}
.article-comments-head{display:flex;align-items:end;justify-content:space-between;gap:16px;margin-bottom:18px}
.article-comments-head h2{margin:0;font-size:22px}.article-comments-head p{margin:5px 0 0;color:var(--muted);font-size:10px}
.article-comment-list{display:grid;gap:14px}
.article-comment{position:relative;padding:15px;border:1px solid var(--line);border-radius:17px;background:var(--card)}
.article-comment>.article-comment-children{display:grid;gap:13px;margin-block-start:15px;margin-inline-start:27px;padding-inline-start:14px;border-inline-start:2px solid color-mix(in srgb,var(--accent) 35%,var(--line))}
.article-comment-head{display:grid;grid-template-columns:auto minmax(0,1fr);gap:10px;align-items:center}
.article-comment-identity{min-width:0;display:grid;justify-items:start}.article-comment-identity b,.article-comment-identity small{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:start}
.article-comment-identity b{font-size:11px}.article-comment-identity small{color:var(--muted);font-size:9px;font-weight:500}
.article-comment-body{margin:12px 0 10px;overflow-wrap:anywhere;white-space:pre-wrap;unicode-bidi:plaintext;text-align:start;font-family:"Manrope","IBM Plex Sans Arabic",sans-serif;font-size:12px;line-height:1.75}
.article-comment-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.article-comment-actions button{height:31px;padding:0 9px;border:1px solid var(--line);border-radius:9px;background:var(--soft);color:var(--muted);font-size:9px;font-weight:750}
.article-comment-actions button.danger{margin-inline-start:auto}
.article-comment-edit{display:grid;gap:9px;margin-top:11px}.article-comment-edit textarea{width:100%;min-height:90px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--soft);color:var(--ink);font:inherit;line-height:1.6;resize:vertical;unicode-bidi:plaintext;text-align:start}
.article-comment-confirm{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:11px;padding:10px;border-radius:11px;background:var(--soft);font-size:9px}
.article-comment-confirm div{display:flex;gap:6px}
.article-comment-composer{display:grid;gap:10px;margin-top:20px;padding:15px;border:1px solid var(--line);border-radius:17px;background:var(--soft)}
.article-comment-replying{display:flex;align-items:center;justify-content:space-between;gap:10px;color:var(--muted);font-size:9px}.article-comment-replying.hidden{display:none}
.article-comment-replying button{border:0;background:transparent;color:var(--accent);font-weight:800}
.article-comment-composer textarea{width:100%;min-height:92px;padding:13px;border:1px solid var(--line);border-radius:13px;background:var(--card);color:var(--ink);font:inherit;line-height:1.65;resize:vertical}
.article-comment-composer footer{display:flex;align-items:center;justify-content:space-between;gap:12px}.article-comment-composer small{color:var(--muted);font-size:9px}.article-comment-composer button{min-width:118px}
.article-comments .loading-card{height:92px}.article-comment-error{padding:16px;border:1px solid #efc4bb;border-radius:14px;background:#fff5f2;color:#8f3327;font-size:11px}
body.rtl .article-comment,body.rtl .article-comment-identity{direction:rtl;text-align:right}
@media(max-width:760px){.article-autosave-bar,.article-restore{grid-template-columns:1fr;align-items:start}.article-restore{display:grid}.article-restore-actions{width:100%}.article-restore-actions button{flex:1}.article-editor-meta{grid-template-columns:1fr}.article-comments{margin-top:30px;padding-top:22px}.article-engagement{gap:6px}.article-engagement button{min-height:43px;padding:0 8px}.article-comment>.article-comment-children{margin-inline-start:10px;padding-inline-start:9px}.article-comment{padding:13px}.article-comment-composer footer{align-items:stretch;flex-direction:column}.article-comment-composer button{width:100%}}
@media(max-width:420px){.article-engagement button{gap:5px;font-size:9px}.article-engagement svg{width:16px;height:16px;flex-basis:16px}}


/* v69 — article comments exactly match post comments */
.article-comment-list{
  display:grid!important;
  gap:0!important;
  width:100%!important;
  min-width:0!important;
}
.article-comment-thread{
  width:100%!important;
  min-width:0!important;
  border-bottom:1px solid var(--line)!important;
}
.article-comment-thread:last-child{border-bottom:0!important}

.article-comment,
.article-comment.is-reply{
  position:relative!important;
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  padding:14px 2px 12px!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
.article-comment>.article-comment-children{
  display:none!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
}

.article-comment-head{
  display:flex!important;
  grid-template-columns:none!important;
  align-items:flex-start!important;
  gap:10px!important;
  min-width:0!important;
}
.article-comment-head .avatar{
  width:40px!important;
  height:40px!important;
  flex:0 0 40px!important;
  border-radius:13px!important;
}
.article-comment.is-reply .article-comment-head .avatar{
  width:40px!important;
  height:40px!important;
  flex-basis:40px!important;
  border-radius:13px!important;
}
.article-comment-identity{
  min-width:0!important;
  flex:1!important;
  display:block!important;
  justify-items:unset!important;
}
.article-comment-identity b{
  display:block!important;
  max-width:100%!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:12px!important;
  line-height:1.3!important;
  text-align:start!important;
}
.article-comment-identity small{
  display:block!important;
  max-width:100%!important;
  margin-top:2px!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  color:var(--muted)!important;
  font-size:9px!important;
  line-height:1.35!important;
  font-weight:500!important;
  text-align:start!important;
}

.article-comment-body{
  margin:8px 0 7px 50px!important;
  max-width:none!important;
  color:var(--ink)!important;
  font-family:inherit!important;
  font-size:13px!important;
  line-height:1.62!important;
  overflow-wrap:anywhere!important;
  white-space:pre-wrap!important;
  unicode-bidi:plaintext!important;
  text-align:start!important;
}
body.rtl .article-comment-body{
  margin:8px 50px 7px 0!important;
}
.article-comment.is-reply .article-comment-body{
  margin-inline-start:46px!important;
}
body.rtl .article-comment.is-reply .article-comment-body{
  margin-inline-start:0!important;
  margin-inline-end:46px!important;
}

.article-comment-actions{
  margin-inline-start:50px!important;
  display:flex!important;
  align-items:center!important;
  flex-wrap:nowrap!important;
  gap:2px!important;
  min-width:0!important;
  overflow-x:auto!important;
  overflow-y:hidden!important;
  scrollbar-width:none;
  -webkit-overflow-scrolling:touch;
  padding-bottom:2px!important;
}
body.rtl .article-comment-actions{
  margin-inline-start:0!important;
  margin-inline-end:50px!important;
}
.article-comment.is-reply .article-comment-actions{
  margin-inline-start:46px!important;
}
body.rtl .article-comment.is-reply .article-comment-actions{
  margin-inline-start:0!important;
  margin-inline-end:46px!important;
}
.article-comment-actions::-webkit-scrollbar{display:none!important}
.article-comment-actions button{
  flex:0 0 auto!important;
  width:auto!important;
  min-width:0!important;
  height:30px!important;
  min-height:30px!important;
  padding:3px 6px!important;
  border:0!important;
  border-radius:8px!important;
  background:transparent!important;
  color:var(--muted)!important;
  box-shadow:none!important;
  white-space:nowrap!important;
  font-size:9px!important;
  font-weight:700!important;
}
.article-comment-actions button:hover{
  background:var(--soft)!important;
  color:var(--ink)!important;
}
.article-comment-actions button.active{color:var(--accent)!important}
.article-comment-actions button.danger{
  margin-inline-start:0!important;
  color:#a53a2d!important;
}
.article-comment-actions button.danger:hover{
  background:color-mix(in srgb,#a53a2d 8%,transparent)!important;
  color:#923126!important;
}
.article-comment-actions .article-mention-action,
.article-comment-actions .native-mention-action{
  color:var(--accent)!important;
  font-weight:750!important;
}

.article-comment-actions .creator-heart,
.article-comment-actions .creator-heart-toggle{
  flex:0 0 28px!important;
  width:28px!important;
  min-width:28px!important;
  height:28px!important;
  min-height:28px!important;
  margin:0 2px!important;
  padding:0!important;
  display:inline-grid!important;
  place-items:center!important;
  border-radius:50%!important;
  line-height:1!important;
}

.article-comment-replies{
  width:calc(100% - 16px)!important;
  margin-inline-start:16px!important;
  padding:0!important;
  border:0!important;
}
body.rtl .article-comment-replies{
  margin-inline-start:0!important;
  margin-inline-end:16px!important;
}

.article-replies-toggle{
  appearance:none!important;
  -webkit-appearance:none!important;
  display:inline-flex!important;
  width:auto!important;
  min-width:0!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:8px!important;
  margin:7px 0 11px 50px!important;
  padding:4px 0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  color:var(--muted)!important;
  box-shadow:none!important;
  font-size:10px!important;
  font-weight:750!important;
  line-height:1.2!important;
}
body.rtl .article-replies-toggle{
  margin:7px 50px 11px 0!important;
}
.article-replies-toggle:hover{color:var(--ink)!important}
.article-replies-toggle>span:first-child{
  width:28px!important;
  height:1px!important;
  flex:0 0 28px!important;
  background:var(--line)!important;
}

@media(max-width:760px){
  .article-comment,
  .article-comment.is-reply{
    padding:14px 2px 12px!important;
  }
  .article-comment-replies{
    width:calc(100% - 16px)!important;
    margin-inline-start:16px!important;
  }
  body.rtl .article-comment-replies{
    margin-inline-start:0!important;
    margin-inline-end:16px!important;
  }
  .article-comment-actions{
    flex-wrap:nowrap!important;
    gap:2px!important;
  }
  .article-comment-actions button{
    height:30px!important;
    min-height:30px!important;
    padding:3px 6px!important;
    font-size:9px!important;
  }
}


/* v71 — Arabic comment text keeps RTL reading order but is visually left-aligned */
.article-comment-body[dir="auto"]{
  text-align:left!important;
}
