/* ── ErrBits Article Shared Styles ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #08090d; --surface: #13151d; --border: #1c1f2e;
  --text: #e2e4ef; --text-muted: #7c7f96;
  --green: #22d97f; --red: #ff5f5f; --blue: #5b9cf5; --cyan: #00d2d3;
  --yellow: #f5c842;
}
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); line-height: 1.75; }
a { color: inherit; text-decoration: none; }

/* ── Navbar ── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(8,9,13,.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding: 0 1.5rem; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo-link { all: unset; cursor: pointer; display: inline-flex; }
html body a.nav-logo-link,
html body a.nav-logo-link:link,
html body a.nav-logo-link:visited,
html body a.nav-logo-link:hover,
html body a.nav-logo-link:focus,
html body a.nav-logo-link:active { text-decoration: none !important; -webkit-text-decoration: none !important; }
.nav-logo { font-family: 'JetBrains Mono', monospace; font-size: 1.1rem; font-weight: 700; display: inline-flex; align-items: center; gap: 0; }
.nav-logo .slash { color: #FF6B00; text-decoration: none !important; -webkit-text-decoration: none !important; }
.nav-logo .name  { color: #ffffff; text-decoration: none !important; -webkit-text-decoration: none !important; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { font-size: .875rem; color: var(--text-muted); transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-avatar-wrap { display: flex; align-items: center; gap: .6rem; }
#nav-avatar { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--green); display: none; }
#nav-name { font-size: .8rem; color: var(--text-muted); }

/* ── Article content (always visible — all articles are public) ── */
#article-content { display: block; max-width: 780px; margin: 0 auto; padding: 2.5rem 1.5rem 5rem; }

/* ── Article header ── */
.article-header { margin-bottom: 2.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.article-header .meta { display: flex; gap: .75rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.article-header .cat {
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  padding: .2rem .55rem; border-radius: 4px;
}
.cat-sys   { background: rgba(34,217,127,.1); color: var(--green); }
.cat-c     { background: rgba(0,210,211,.1);  color: var(--cyan);  }
.cat-cpp   { background: rgba(91,156,245,.1); color: var(--blue);  }
.cat-arm   { background: rgba(255,95,95,.1);  color: var(--red);   }
.cat-embed { background: rgba(91,156,245,.1); color: var(--blue);  }
.article-header .date { font-size: .8rem; color: var(--text-muted); }
.article-header h1 { font-size: 1.9rem; font-weight: 800; line-height: 1.25; }

/* ── Article body ── */
.article-body h2 { font-size: 1.35rem; font-weight: 700; margin: 2.5rem 0 .85rem; border-left: 3px solid var(--green); padding-left: .75rem; }
.article-body h3 { font-size: 1.05rem; font-weight: 600; margin: 1.75rem 0 .6rem; color: var(--cyan); }
.article-body p  { margin-bottom: 1rem; }
.article-body ul, .article-body ol { margin: .75rem 0 1rem 1.4rem; }
.article-body li { margin-bottom: .5rem; }
.article-body strong { color: var(--text); font-weight: 650; }
.article-body em { color: var(--cyan); font-style: italic; }
.article-body a { color: var(--blue); text-decoration: underline; }
.article-body a:hover { color: var(--cyan); }
.article-body blockquote {
  border-left: 3px solid var(--green); padding: .75rem 1.25rem;
  background: rgba(34,217,127,.04); border-radius: 0 6px 6px 0;
  margin: 1.25rem 0; color: var(--text-muted); font-style: italic;
}
.article-body pre, .article-body code {
  font-family: 'JetBrains Mono', monospace; font-size: .84rem;
}
.article-body pre {
  background: var(--surface); border: 1px solid var(--border);
  padding: 1.1rem 1.25rem; border-radius: 8px; overflow-x: auto;
  margin: 1.25rem 0; line-height: 1.65;
}
.article-body :not(pre) > code {
  background: rgba(91,156,245,.1); color: var(--blue);
  padding: .15em .4em; border-radius: 4px;
}

/* ── Syntax highlighting (nested + standalone) ── */
.article-body pre .cmt, .cmt { color: #4e5568; }
.article-body pre .kw,  .kw  { color: var(--cyan); }
.article-body pre .fn,  .fn  { color: var(--green); }
.article-body pre .str, .str { color: var(--yellow); }
.article-body pre .num, .num { color: #f5823a; }

/* ── Tables ── */
.article-body table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .87rem; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: .6rem .9rem; text-align: left; vertical-align: top; }
.article-body th { background: var(--surface); color: var(--green); font-weight: 600; font-family: 'JetBrains Mono', monospace; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.article-body td:first-child { color: var(--text-muted); font-size: .82rem; font-weight: 600; white-space: nowrap; }

/* ── Callouts ── */
.callout { border-radius: 8px; padding: 1rem 1.25rem; margin: 1.5rem 0; }
.callout-blue  { background: rgba(91,156,245,.07);  border: 1px solid rgba(91,156,245,.2);  }
.callout-green { background: rgba(34,217,127,.06);  border: 1px solid rgba(34,217,127,.2);  }
.callout-red   { background: rgba(255,95,95,.06);   border: 1px solid rgba(255,95,95,.2);   }
.callout-amber { background: rgba(245,166,35,.06);  border: 1px solid rgba(245,166,35,.2);  }
.callout strong { display: block; margin-bottom: .35rem; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }
.callout-blue  strong { color: var(--blue);  }
.callout-green strong { color: var(--green); }
.callout-red   strong { color: var(--red);   }
.callout-amber strong { color: var(--yellow); }

.article-body hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* ── Back link ── */
.breadcrumb { font-family: 'JetBrains Mono', monospace; font-size: .72rem; color: var(--text-muted); margin-bottom: 1rem; }
.breadcrumb a { color: var(--orange); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 .3rem; }

.back-link {
  display: inline-flex; align-items: center; gap: .4rem;
  color: var(--text-muted); font-size: .875rem; margin-bottom: 2rem; transition: color .2s;
}
.back-link:hover { color: var(--green); }

/* ── Footer ── */
footer { border-top: 1px solid var(--border); padding: 2rem 1.5rem; text-align: center; }
footer p { font-size: .8rem; color: var(--text-muted); }
footer .logo-text { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: .9rem; }
footer .logo-text .err { color: var(--red); }
footer .logo-text .bits { color: var(--green); }

/* ── Responsive ── */
@media (max-width: 600px) {
  .article-header h1 { font-size: 1.5rem; }
  #article-content { padding: 1.5rem 1rem 4rem; }
  .article-body table { font-size: .78rem; }
  .article-body td:first-child { white-space: normal; }
}

/* ── Google Translate ── */
.goog-te-banner-frame, .goog-te-gadget, #goog-gt-tt, .goog-tooltip { display: none !important; }
body { top: 0 !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }

/* ── Translate dropdown ── */
.translate-wrap { position: relative; }
.translate-btn {
  background: none; border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 9px;
  cursor: pointer; color: var(--text-muted);
  transition: border-color .2s, color .2s;
  display: flex; align-items: center;
}
.translate-btn:hover { border-color: var(--green); color: var(--text); }
.translate-drop {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; min-width: 170px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  overflow: hidden; z-index: 300; padding: .3rem 0;
}
.translate-drop.open { display: block; }
.translate-opt {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem 1rem; width: 100%; text-align: left;
  background: none; border: none;
  font-size: .82rem; color: var(--text-muted);
  cursor: pointer; transition: background .15s, color .15s;
}
.translate-opt:hover { background: var(--border); color: var(--text); }
.translate-opt.active { color: var(--green); }

/* ── Table of Contents ── */
.toc {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 1.1rem 1.4rem;
  margin: 0 0 2rem; font-size: .875rem;
}
.toc-title { font-family: 'JetBrains Mono', monospace; font-size: .75rem;
  text-transform: uppercase; letter-spacing: .08em; color: var(--green);
  font-weight: 700; margin-bottom: .65rem; }
.toc-list { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc-list li { counter-increment: toc; margin-bottom: .35rem;
  display: flex; align-items: baseline; gap: .5rem; }
.toc-list li::before { content: counter(toc); font-family: 'JetBrains Mono', monospace;
  font-size: .7rem; color: var(--text-muted); min-width: 16px; }
.toc-list a { color: var(--text-muted); text-decoration: none; transition: color .15s; }
.toc-list a:hover { color: var(--green); text-decoration: none; }

/* ── Author card ── */
.author-card {
  display: flex; align-items: center; gap: 1.1rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 1.1rem 1.4rem; margin: 2.5rem 0 0;
}
.author-avatar { width: 54px; height: 54px; border-radius: 50%;
  border: 2px solid var(--green); object-fit: cover; flex-shrink: 0; }
.author-info .author-name { font-weight: 700; font-size: .95rem; margin-bottom: .2rem; }
.author-info .author-bio { font-size: .82rem; color: var(--text-muted); line-height: 1.5; margin: 0; }

/* ── Related articles ── */
.related-section { margin: 2rem 0 0; }
.related-title { font-size: .75rem; font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase; letter-spacing: .08em; color: var(--green);
  font-weight: 700; margin-bottom: .9rem; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.related-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: .85rem 1rem;
  text-decoration: none; transition: border-color .2s;
  display: flex; flex-direction: column; gap: .4rem;
}
.related-card:hover { border-color: var(--green); }
.related-cat { font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--green); }
.related-name { font-size: .83rem; color: var(--text); line-height: 1.4; }
@media (max-width: 600px) { .related-grid { grid-template-columns: 1fr; } }

/* ── Bookmark button ── */
.bm-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .45rem .9rem; border-radius: 8px;
  border: 1px solid var(--border);
  background: none; color: var(--text-muted);
  font-size: .8rem; font-weight: 600; cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
  margin-top: .75rem;
}
/* public → orange; signed-in overrides below */
.bm-btn:hover { border-color: #FF6B00; color: #FF6B00; }
.bm-btn.saved { border-color: #FF6B00; color: #FF6B00; background: rgba(255,107,0,.08); }
.signed-in .bm-btn:hover { border-color: var(--green); color: var(--green); }
.signed-in .bm-btn.saved { border-color: var(--green); color: var(--green); background: rgba(34,217,127,.08); }

/* ── Bookmark login prompt ── */
.bm-prompt-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55); z-index: 1000;
  align-items: center; justify-content: center;
}
.bm-prompt-overlay.show { display: flex; }
.bm-prompt-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 2rem 2.2rem; max-width: 380px; width: 90%;
  text-align: center;
}
.bm-prompt-box h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.bm-prompt-box p  { font-size: .85rem; color: var(--text-muted); margin-bottom: 1.4rem; }
.btn-google-bm {
  display: inline-flex; align-items: center; gap: .6rem;
  background: #fff; color: #111; border: none; border-radius: 8px;
  padding: .65rem 1.4rem; font-size: .9rem; font-weight: 600;
  cursor: pointer; width: 100%; justify-content: center;
}
.btn-google-bm:hover { background: #f0f0f0; }
.btn-ms-bm {
  display: flex; align-items: center; gap: .6rem;
  width: 100%; justify-content: center;
  background: var(--surface); color: var(--text);
  border: 1px solid rgba(0,164,239,.35); border-radius: 8px;
  padding: .65rem 1.4rem; font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: border-color .2s; margin-top: .65rem;
}
.btn-ms-bm:hover { border-color: #00a4ef; }
.bm-prompt-close {
  display: block; margin-top: .9rem; font-size: .78rem;
  color: var(--text-muted); background: none; border: none; cursor: pointer;
}
.bm-prompt-close:hover { color: var(--text); }

/* ── Newsletter bar ── */
.nl-bar {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.6rem 1.8rem;
  margin: 2.5rem 0; text-align: center;
}
.nl-bar h3 { font-size: 1rem; margin-bottom: .35rem; }
.nl-bar p  { font-size: .83rem; color: var(--text-muted); margin-bottom: 1rem; }
.nl-form   { display: flex; gap: .6rem; max-width: 420px; margin: 0 auto; }
.nl-form input {
  flex: 1; padding: .55rem .9rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text); font-size: .88rem; outline: none;
}
/* public → orange; signed-in overrides below */
.nl-form input:focus { border-color: #FF6B00; }
.nl-form button {
  padding: .55rem 1.2rem; border-radius: 8px; border: none;
  background: #FF6B00; color: #fff;
  font-weight: 700; font-size: .88rem; cursor: pointer;
}
.nl-form button:hover { background: #e05f00; }
.signed-in .nl-form input:focus { border-color: var(--green); }
.signed-in .nl-form button { background: var(--green); color: #080a0d; }
.signed-in .nl-form button:hover { background: #1bc46e; }
.nl-ok { color: var(--green); font-weight: 600; font-size: .9rem; }

/* ── Newsletter beta opt-in checkbox ── */
.nl-beta-wrap {
  display: flex; align-items: flex-start; gap: .55rem;
  margin-top: .85rem; cursor: pointer; max-width: 420px; margin-left: auto; margin-right: auto;
}
.nl-beta-check {
  appearance: none; -webkit-appearance: none;
  width: 15px; height: 15px; min-width: 15px;
  border: 1.5px solid rgba(34,217,127,.45); border-radius: 3px;
  background: rgba(34,217,127,.06); cursor: pointer;
  margin-top: .18rem; transition: border-color .18s, background .18s;
}
.nl-beta-check:checked {
  background: var(--green); border-color: var(--green);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 4l3 3 5-6' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 10px 8px;
}
.nl-beta-label {
  font-size: .78rem; color: var(--text-muted); line-height: 1.4;
  transition: color .15s;
}
.nl-beta-wrap:hover .nl-beta-label { color: var(--text); }
.nl-beta-wrap:hover .nl-beta-check { border-color: var(--green); }

/* ── Toast ── */
#f-toast {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 9999;
  background: var(--surface); border: 1px solid var(--green);
  color: var(--text); padding: .7rem 1.2rem; border-radius: 8px;
  font-size: .85rem; font-weight: 500;
  transform: translateY(120%); opacity: 0; visibility: hidden;
  transition: transform .35s cubic-bezier(.16,1,.3,1), opacity .35s;
  pointer-events: none;
}
#f-toast.show { transform: translateY(0); opacity: 1; visibility: visible; }

/* ── Nav Sign-In Dropdown ── */
#nav-signin-wrap { position: relative; }
#nav-signin-btn {
  background: var(--green, #22d97f); color: #000;
  border: none; border-radius: 7px;
  padding: .3rem .85rem; font-size: .78rem; font-weight: 700;
  cursor: pointer; letter-spacing: .02em; transition: background .18s;
  display: flex; align-items: center; gap: .35rem;
}
#nav-signin-btn:hover { background: #1abf6e; }
#nav-signin-btn .nav-signin-arrow { font-size: .65rem; transition: transform .18s; }
#nav-signin-btn.open .nav-signin-arrow { transform: rotate(180deg); }
#nav-signin-drop {
  display: none; position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--surface, #13151d); border: 1px solid var(--border, #1c1f2e);
  border-radius: 9px; overflow: hidden; min-width: 200px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5); z-index: 999;
}
#nav-signin-drop.open { display: block; }
.nav-signin-opt {
  width: 100%; background: none; border: none; cursor: pointer;
  padding: .6rem .9rem; font-size: .78rem; font-weight: 600;
  color: var(--text, #e2e4ef); display: flex; align-items: center; gap: .6rem;
  transition: background .15s; text-align: left;
}
.nav-signin-opt:hover { background: rgba(255,255,255,.06); }

/* ── Studio Invite Card ── */
#studio-invite-card {
  margin: 1.25rem 0;
  background: var(--surface, #13151d);
  border: 1px solid rgba(34,217,127,.2);
  border-left: 3px solid var(--green, #22d97f);
  border-radius: 10px; padding: 1.1rem 1.25rem;
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
}
.si-tag {
  font-family: monospace; font-size: .65rem; font-weight: 700;
  color: var(--green, #22d97f); letter-spacing: .07em;
  background: rgba(34,217,127,.1); border: 1px solid rgba(34,217,127,.25);
  border-radius: 4px; padding: .15rem .45rem; white-space: nowrap; align-self: flex-start;
}
.si-body { flex: 1; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.si-text { font-size: .82rem; color: var(--text-muted, #7c7f96); margin: 0; line-height: 1.55; }
.si-text strong { color: var(--text, #e2e4ef); }
.si-btns { display: flex; gap: .5rem; flex-shrink: 0; }
.si-btn {
  background: var(--green, #22d97f); color: #000;
  border: none; border-radius: 7px;
  padding: .42rem .9rem; font-size: .76rem; font-weight: 700;
  cursor: pointer; white-space: nowrap; transition: background .18s;
  display: flex; align-items: center; gap: .35rem;
}
.si-btn:hover { background: #1abf6e; }
.si-btn-ms {
  background: rgba(0,164,239,.15); color: var(--text, #e2e4ef);
  border: 1px solid rgba(0,164,239,.3);
}
.si-btn-ms:hover { background: rgba(0,164,239,.28); }
#nav-avatar { cursor: pointer; }
@media (max-width: 600px) {
  #studio-invite-card { gap: .75rem; }
  .si-body { flex-direction: column; align-items: flex-start; }
}

/* ── Share Bar ── */
.share-bar {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  margin: 1.75rem 0 0; padding: 1.1rem 1.25rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
}
.share-bar-label {
  font-size: .78rem; color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: .04em; margin-right: .25rem; flex-shrink: 0;
}
.share-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .4rem .85rem; border: 1px solid var(--border); border-radius: 6px;
  background: transparent; color: var(--text-muted);
  font-size: .8rem; font-family: 'Inter', sans-serif;
  font-weight: 500; cursor: pointer; text-decoration: none;
  transition: border-color .2s, color .2s, background .2s; white-space: nowrap;
}
/* public → orange; signed-in overrides below */
.share-btn:hover { border-color: #FF6B00; color: #FF6B00; background: rgba(255,107,0,.06); }
.signed-in .share-btn:hover { border-color: var(--green); color: var(--green); background: rgba(34,217,127,.06); }
.share-btn svg { flex-shrink: 0; opacity: .85; }
.share-btn:hover svg { opacity: 1; }

/* ── Discussion Panel (fixed right side) ── */
:root { --disc-w:320px; --disc-strip-w:38px; }
.disc-panel {
  position: fixed; right: 0; top: 56px; bottom: 0;
  width: var(--disc-strip-w);
  background: #0e1017; border-left: 1px solid #1c1f2e;
  z-index: 900; display: flex; flex-direction: row;
  transition: width .28s cubic-bezier(.4,0,.2,1); overflow: hidden;
}
.disc-panel.disc-open { width: var(--disc-w); }
.disc-strip {
  width: var(--disc-strip-w); flex-shrink: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer; gap: .5rem; padding: .5rem 0;
  border-left: 2px solid #22d97f; transition: background .2s;
}
.disc-strip:hover { background: rgba(34,217,127,.06); }
.disc-strip-label {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-size: .68rem; letter-spacing: .1em;
  color: #7c7f96; font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase; user-select: none;
}
.disc-strip-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #22d97f; flex-shrink: 0;
}
@keyframes discPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(34,217,127,.5); }
  50%      { box-shadow: 0 0 0 5px rgba(34,217,127,0); }
}
.disc-strip-dot.pulse { animation: discPulse 1.8s ease infinite; }
.disc-content {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; min-width: 0;
}
.disc-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem .5rem; border-bottom: 1px solid #1c1f2e; flex-shrink: 0;
}
.disc-title { font-family: 'JetBrains Mono', monospace; font-size: .78rem; color: #22d97f; letter-spacing: .04em; }
.disc-close {
  background: none; border: none; color: #7c7f96;
  cursor: pointer; font-size: 1rem; padding: .1rem .3rem;
  line-height: 1; border-radius: 4px; transition: color .15s, background .15s;
}
.disc-close:hover { color: #e2e4ef; background: rgba(255,255,255,.06); }
.disc-notice {
  display: flex; align-items: flex-start; gap: .45rem;
  margin: .6rem .75rem .25rem; padding: .55rem .7rem;
  background: rgba(34,217,127,.07); border: 1px solid rgba(34,217,127,.2);
  border-radius: 6px; font-size: .75rem; color: #7c7f96; line-height: 1.5; flex-shrink: 0;
}
.disc-notice strong { color: #e2e4ef; }
.disc-auth-prompt {
  margin: .75rem; padding: .75rem;
  background: #13151d; border: 1px solid #1c1f2e;
  border-radius: 8px; text-align: center; flex-shrink: 0;
}
.disc-auth-prompt p { font-size: .78rem; color: #7c7f96; margin-bottom: .6rem; }
.disc-signin-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem 1rem; border-radius: 6px;
  background: #22d97f; color: #080a0d;
  font-size: .78rem; font-weight: 700;
  border: none; cursor: pointer; font-family: 'Inter', sans-serif;
  transition: opacity .15s;
}
.disc-signin-btn:hover { opacity: .88; }
.disc-compose { margin: .75rem .75rem .4rem; flex-shrink: 0; }
.disc-compose textarea {
  width: 100%; resize: none; height: 72px;
  background: #13151d; border: 1px solid #1c1f2e;
  border-radius: 6px; color: #e2e4ef;
  font-size: .8rem; font-family: 'Inter', sans-serif;
  padding: .5rem .65rem; line-height: 1.5;
  transition: border-color .2s; outline: none;
}
.disc-compose textarea:focus { border-color: rgba(34,217,127,.5); }
.disc-compose-footer {
  display: flex; justify-content: space-between; align-items: center; margin-top: .35rem;
}
.disc-char-count { font-size: .7rem; color: #7c7f96; }
.disc-post-btn {
  padding: .35rem .85rem; border-radius: 5px;
  background: #22d97f; color: #080a0d;
  font-size: .78rem; font-weight: 700;
  border: none; cursor: pointer; font-family: 'Inter', sans-serif;
  transition: opacity .15s;
}
.disc-post-btn:disabled { opacity: .45; cursor: not-allowed; }
.disc-post-btn:not(:disabled):hover { opacity: .88; }
.disc-comments { flex: 1; overflow-y: auto; padding: .4rem .75rem .75rem; }
.disc-comments::-webkit-scrollbar { width: 4px; }
.disc-comments::-webkit-scrollbar-track { background: transparent; }
.disc-comments::-webkit-scrollbar-thumb { background: #1c1f2e; border-radius: 4px; }
.disc-comment { padding: .6rem 0; border-bottom: 1px solid #1c1f2e; }
.disc-comment:last-child { border-bottom: none; }
.disc-comment-meta { display: flex; align-items: center; gap: .4rem; margin-bottom: .25rem; }
.disc-comment-user { font-size: .74rem; font-weight: 600; color: #22d97f; }
.disc-comment-time { font-size: .68rem; color: #4a4d62; margin-left: auto; }
.disc-comment-text { font-size: .8rem; color: #c4c6d8; line-height: 1.55; word-break: break-word; }
.disc-comment-del {
  background: none; border: none; color: #4a4d62;
  cursor: pointer; font-size: .68rem; padding: .1rem .25rem;
  border-radius: 3px; transition: color .15s; flex-shrink: 0;
}
.disc-comment-del:hover { color: #ff5f5f; }
.disc-empty { font-size: .78rem; color: #4a4d62; text-align: center; padding: 1.5rem 0; }
.disc-more-btn {
  display: block; width: 100%; margin: .5rem 0 .25rem;
  padding: .38rem 0; border-radius: 5px;
  background: none; border: 1px solid #1c1f2e;
  color: #7c7f96; font-size: .72rem; font-family: 'Inter', sans-serif;
  cursor: pointer; transition: border-color .15s, color .15s;
}
.disc-more-btn:hover { border-color: rgba(34,217,127,.35); color: #22d97f; }

/* Hide legacy nav-avatar/nav-name elements — replaced by nav-user-menu dropdown */
.nav-avatar-wrap #nav-avatar,
.nav-avatar-wrap #nav-name { display: none !important; }

/* ── Nav user dropdown (articles, guides, bookmarks) ── */
.nav-user-menu { position: relative; }
.nav-user-btn {
  display: flex; align-items: center; gap: .45rem;
  background: none; border: none; cursor: pointer;
  color: var(--text); padding: .2rem 0; font-family: 'Inter', sans-serif;
}
.nav-user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--green); display: block;
}
.nav-user-initials {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--green); color: #080a0d;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .7rem; flex-shrink: 0;
}
.nav-user-name { font-size: .8rem; color: var(--text-muted); }
.nav-user-drop {
  display: none; position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; min-width: 210px; z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,.4); overflow: hidden;
}
.nav-user-drop.open { display: block; }
.nav-drop-header {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem 1rem;
}
.nav-drop-header img, .nav-drop-header .nav-user-initials {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; object-fit: cover;
}
.nav-drop-name { font-size: .85rem; font-weight: 600; color: var(--text); }
.nav-drop-email {
  font-size: .7rem; color: var(--text-muted); margin-top: .1rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 155px;
}
.nav-drop-divider { border: none; border-top: 1px solid var(--border); margin: 0; }
.nav-drop-item {
  display: flex; align-items: center; gap: .55rem;
  width: 100%; padding: .6rem 1rem;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: .82rem;
  font-family: 'Inter', sans-serif; text-align: left;
  transition: background .15s, color .15s;
}
.nav-drop-item:hover { background: rgba(255,255,255,.04); color: var(--text); }
.nav-drop-item svg { flex-shrink: 0; }
.nav-drop-logout:hover { color: var(--red) !important; }
