/* ---------- Animesh_blog theme ---------- */
:root {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --surface-2: #f4f4f7;
  --text: #1a1a22;
  --text-soft: #5b5b6b;
  --muted: #8a8a99;
  --border: #e7e7ee;
  --accent: #6366f1;
  --accent-soft: #eef0ff;
  --danger: #e1483c;
  --ok: #16a34a;
  --shadow: 0 1px 3px rgba(20, 20, 40, .06), 0 8px 24px rgba(20, 20, 40, .05);
  --radius: 14px;
  --maxw: 760px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}
[data-theme="dark"] {
  --bg: #0e0e13;
  --surface: #17171f;
  --surface-2: #1f1f29;
  --text: #ececf2;
  --text-soft: #b6b6c4;
  --muted: #7c7c8c;
  --border: #2a2a36;
  --accent: #818cf8;
  --accent-soft: #20203a;
  --shadow: 0 1px 3px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { font-size: 1.25rem; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--accent); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.user-box { display: flex; align-items: center; gap: 10px; font-size: .92rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600;
  font-size: .9rem; cursor: pointer; transition: .15s ease; text-decoration: none;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { color: var(--danger); border-color: transparent; }
.btn-danger:hover { border-color: var(--danger); }
.btn-sm { padding: 5px 11px; font-size: .82rem; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; font-size: 1.05rem;
}
.icon-btn:hover { border-color: var(--accent); }

/* ---------- Hero ---------- */
.hero { padding: 46px 0 26px; text-align: center; }
.hero h1 { font-size: 2.5rem; letter-spacing: -.03em; margin: 0 0 8px; }
.hero p { color: var(--text-soft); font-size: 1.08rem; margin: 0; }

/* ---------- Blog cards ---------- */
.card-grid { display: grid; gap: 18px; padding-bottom: 60px; }
.card {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); text-decoration: none; }
.card-cover { height: 8px; }
.card-body { padding: 20px 22px; }
.card h2 { margin: 0 0 6px; font-size: 1.3rem; letter-spacing: -.02em; color: var(--text); }
.card .summary { color: var(--text-soft); margin: 0 0 14px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: .82rem; color: var(--muted); }
.card-meta .dot::before { content: "·"; margin-right: 14px; }

/* ---------- Article ---------- */
.article { padding: 30px 0 60px; }
.article-head { margin-bottom: 28px; }
.article-head .kicker { display: inline-block; height: 6px; width: 54px; border-radius: 3px; margin-bottom: 18px; }
.article h1 { font-size: 2.3rem; line-height: 1.2; letter-spacing: -.03em; margin: 0 0 14px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 16px; color: var(--muted); font-size: .9rem; align-items: center; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--accent);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem; margin-right: 8px;
}
.article-body { font-family: var(--serif); font-size: 1.18rem; line-height: 1.75; color: var(--text); }
.article-body h1, .article-body h2, .article-body h3 { font-family: var(--font); letter-spacing: -.02em; margin: 1.6em 0 .5em; }
.article-body p { margin: 0 0 1.1em; }
.article-body img { max-width: 100%; border-radius: 10px; }
.article-body blockquote {
  margin: 1.2em 0; padding: 4px 18px; border-left: 4px solid var(--accent);
  color: var(--text-soft); font-style: italic;
}
.article-body pre {
  background: var(--surface-2); padding: 14px 16px; border-radius: 10px;
  overflow-x: auto; font-size: .92rem; font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.article-body code { font-family: ui-monospace, "SF Mono", Menlo, monospace; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.article-body pre code { background: none; padding: 0; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin: 30px 0; padding-top: 22px; border-top: 1px solid var(--border); }

/* ---------- Comments ---------- */
.comments { margin-top: 40px; }
.comments h3 { font-size: 1.2rem; margin: 0 0 16px; }
.comment {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 12px;
}
.comment-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.comment-head .who { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .92rem; }
.comment-head time { color: var(--muted); font-size: .8rem; }
.comment-body { color: var(--text-soft); white-space: pre-wrap; word-break: break-word; }
.comment-form textarea, .field textarea, .field input, .field select {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; resize: vertical;
}
.comment-form textarea:focus, .field textarea:focus, .field input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.comment-form { margin-bottom: 24px; }
.comment-form .row { display: flex; justify-content: flex-end; margin-top: 10px; }
.signin-note { background: var(--surface-2); border: 1px dashed var(--border); border-radius: 12px; padding: 16px; text-align: center; color: var(--text-soft); }

/* ---------- Forms (auth + editor) ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px; margin: 30px auto 60px;
}
.panel.narrow { max-width: 420px; }
.panel h2 { margin: 0 0 6px; letter-spacing: -.02em; }
.panel .sub { color: var(--text-soft); margin: 0 0 22px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; }
.field .hint { color: var(--muted); font-size: .8rem; margin-top: 5px; }
.row-2 { display: flex; gap: 14px; align-items: center; }
.color-row { display: flex; align-items: center; gap: 12px; }
.color-row input[type=color] { width: 48px; height: 40px; padding: 2px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.switch-line { text-align: center; margin-top: 14px; color: var(--text-soft); font-size: .9rem; }
.error-banner { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); border-radius: 10px; padding: 10px 14px; font-size: .9rem; margin-bottom: 16px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 12px;
  font-size: .9rem; font-weight: 600; opacity: 0; pointer-events: none; transition: .25s ease; z-index: 100;
  box-shadow: var(--shadow); max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.danger { background: var(--danger); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }

/* ---------- Misc ---------- */
.footer { border-top: 1px solid var(--border); padding: 26px 0; color: var(--muted); font-size: .85rem; }
.footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.spinner { text-align: center; padding: 60px; color: var(--muted); }
.badge { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; background: var(--accent-soft); color: var(--accent); padding: 2px 8px; border-radius: 999px; }

@media (max-width: 600px) {
  .hero h1 { font-size: 2rem; }
  .article h1 { font-size: 1.8rem; }
  .article-body { font-size: 1.08rem; }
  .topbar-inner { height: 56px; }
  #newBtn span.lbl { display: none; }
}

/* ---------- Rich-text editor (post editor) ---------- */
.rt-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  padding: 6px 8px; background: var(--surface-2);
  border: 1px solid var(--border); border-bottom: none; border-radius: 10px 10px 0 0;
}
.rt-toolbar button {
  min-width: 32px; height: 30px; padding: 0 9px; cursor: pointer;
  border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--text); font: inherit; font-size: .9rem; line-height: 1;
}
.rt-toolbar button:hover { background: var(--surface); border-color: var(--border); }
.rt-toolbar select {
  height: 30px; padding: 0 6px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text); font: inherit; font-size: .85rem; cursor: pointer;
}
.rt-toolbar .sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.rt-editor {
  min-height: 300px; max-height: 60vh; overflow-y: auto;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: 0 0 10px 10px;
  background: var(--surface); color: var(--text);
  font-family: var(--serif); font-size: 1.08rem; line-height: 1.75; outline: none;
}
.rt-editor:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.rt-editor:empty::before { content: attr(data-placeholder); color: var(--muted); }
.rt-editor h1, .rt-editor h2, .rt-editor h3 { font-family: var(--font); letter-spacing: -.02em; margin: .6em 0 .3em; }
.rt-editor p { margin: 0 0 .8em; }
.rt-editor ul, .rt-editor ol { padding-left: 1.6em; margin: 0 0 .8em; }
.rt-editor li { margin: .2em 0; }
.rt-editor blockquote { margin: .8em 0; padding: 2px 16px; border-left: 4px solid var(--accent); color: var(--text-soft); font-style: italic; }
.rt-editor a { color: var(--accent); }

/* ---------- Top nav ---------- */
.mainnav{display:flex;gap:6px;margin-left:18px;flex:1}
.navlink{padding:7px 12px;border-radius:8px;color:var(--text-soft);font-weight:600;font-size:.92rem;text-decoration:none}
.navlink:hover{background:var(--surface-2);text-decoration:none}
.navlink.active{color:var(--accent);background:var(--accent-soft)}
@media(max-width:600px){.mainnav{margin-left:8px;gap:2px}.navlink{padding:6px 8px;font-size:.85rem}.brand{font-size:1.05rem}}

/* ---------- About page ---------- */
.about{padding:30px 0 60px}
.about-head{display:flex;gap:22px;align-items:center;margin-bottom:22px}
.about-photo{width:120px;height:120px;border-radius:50%;object-fit:cover;flex:none;background:var(--accent);color:#fff;display:flex;align-items:center;justify-content:center;font-size:2.4rem;font-weight:800;overflow:hidden}
.about-photo img{width:100%;height:100%;object-fit:cover}
.about-photo.small{width:64px;height:64px;font-size:1.3rem}
.about-photo.placeholder{background:var(--accent)}
.about h1{font-size:2rem;margin:0 0 4px;letter-spacing:-.02em}
.about .headline{color:var(--text-soft);font-size:1.1rem;margin:0 0 12px}
.about-links{display:flex;flex-wrap:wrap;gap:8px}
.about-bio{font-size:1.1rem}
.photo-row{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.link-row{display:flex;gap:8px;margin-bottom:8px}
.link-row .ll{flex:0 0 32%}.link-row .lu{flex:1}
.link-row input{padding:9px 11px;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--text);font:inherit}
@media(max-width:600px){.about-head{flex-direction:column;text-align:center}.about-links{justify-content:center}}

/* ---------- Reactions ---------- */
.reactions{margin:26px 0 8px;display:flex;flex-direction:column;gap:8px}
.react-total{color:var(--muted);font-size:.85rem}
.react-btns{display:flex;flex-wrap:wrap;gap:8px}
.react-btn{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--border);background:var(--surface);border-radius:999px;padding:6px 12px;cursor:pointer;font:inherit;font-size:.88rem;color:var(--text);transition:.12s}
.react-btn:hover{border-color:var(--accent)}
.react-btn.mine{background:var(--accent-soft);border-color:var(--accent);color:var(--accent);font-weight:700}
.react-btn .re{font-size:1.05rem}.react-btn .rc{color:var(--muted);font-weight:700}
.react-btn.mine .rc{color:var(--accent)}
@media(max-width:600px){.react-btn .rl{display:none}}

/* ---------- Share bar ---------- */
.share-bar{display:flex;align-items:center;gap:12px;margin:8px 0 4px;flex-wrap:wrap}
.share-label{color:var(--muted);font-size:.85rem;font-weight:600}
.share-btns{display:flex;gap:8px;flex-wrap:wrap}
.share-btn{width:38px;height:38px;border-radius:50%;border:1px solid var(--border);background:var(--surface);color:var(--text);cursor:pointer;font-size:.95rem;font-weight:700;display:flex;align-items:center;justify-content:center}
.share-btn:hover{border-color:var(--accent);color:var(--accent)}
.s-twitter{font-family:serif}

/* ---------- Comment emoji picker ---------- */
.comment-input{position:relative}
.emoji-toggle{position:absolute;right:8px;bottom:8px;border:none;background:transparent;cursor:pointer;font-size:1.15rem}
.emoji-pop{position:absolute;right:0;bottom:44px;z-index:10;background:var(--surface);border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow);padding:8px;display:grid;grid-template-columns:repeat(8,1fr);gap:2px;max-width:300px}
.emoji-pop .emoji{border:none;background:transparent;cursor:pointer;font-size:1.15rem;padding:4px;border-radius:6px}
.emoji-pop .emoji:hover{background:var(--surface-2)}

/* ---------- Captcha field ---------- */
.captcha input{width:120px}
.captcha label{font-weight:600;font-size:.85rem}

/* ---------- Analytics ---------- */
.stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:14px;margin-bottom:18px}
.stat{display:flex;align-items:center;gap:12px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:16px}
.stat-ico{font-size:1.5rem}
.stat-val{font-size:1.5rem;font-weight:800;letter-spacing:-.02em}
.stat-lbl{color:var(--muted);font-size:.82rem}
.card h3{margin:0 0 12px;font-size:1.05rem}
.bar-row{display:flex;align-items:center;gap:12px;margin-bottom:9px}
.bar-lbl{flex:0 0 110px;font-size:.88rem;text-transform:capitalize}
.bar{flex:1;height:12px;background:var(--surface-2);border-radius:999px;overflow:hidden}
.bar-fill{height:100%;background:var(--accent);border-radius:999px}
.bar-n{flex:0 0 36px;text-align:right;font-weight:700;font-size:.85rem}
.rx-row{display:flex;gap:16px;flex-wrap:wrap}.rx{font-size:1rem}
.table-wrap{overflow-x:auto}
.atable{width:100%;border-collapse:collapse;font-size:.9rem}
.atable th,.atable td{text-align:left;padding:9px 10px;border-bottom:1px solid var(--border)}
.atable th{color:var(--muted);font-weight:700;font-size:.8rem;text-transform:uppercase;letter-spacing:.04em}
.atable td:not(:first-child),.atable th:not(:first-child){text-align:right;width:80px}
.atable a{color:var(--accent);text-decoration:none}
.page-head{display:flex;align-items:center;justify-content:space-between;margin:24px 0 16px}
.page-head h1{margin:0;font-size:1.6rem;letter-spacing:-.02em}

/* ---------- Follow ---------- */
.follow-count{color:var(--text-soft);font-size:.92rem;margin:0 0 12px;font-weight:600}
.btn-following{background:var(--accent-soft);border-color:var(--accent);color:var(--accent);font-weight:700}

/* ---------- Notifications ---------- */
.notif-bell{position:relative;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:50%;font-size:1.05rem;text-decoration:none;color:var(--text-soft)}
.notif-bell:hover{background:var(--surface-2);text-decoration:none}
.notif-badge{position:absolute;top:-2px;right:-2px;min-width:17px;height:17px;padding:0 4px;border-radius:999px;background:var(--danger);color:#fff;font-size:.66rem;font-weight:700;display:inline-flex;align-items:center;justify-content:center;line-height:1}
.notif-list{display:flex;flex-direction:column;gap:8px}
.notif-item{display:flex;align-items:center;gap:12px;padding:14px 16px;border:1px solid var(--border);border-radius:12px;background:var(--surface);color:var(--text);text-decoration:none}
.notif-item:hover{border-color:var(--accent);text-decoration:none}
.notif-item.unread{background:var(--accent-soft);border-color:var(--accent)}
.notif-ico{font-size:1.2rem;flex:none}
.notif-text{flex:1;font-size:.96rem}
.notif-time{color:var(--muted);font-size:.82rem;flex:none}

/* ---------- Top follower count ---------- */
.top-follow{display:inline-flex;align-items:center;gap:8px}
.top-followers{display:inline-flex;align-items:center;gap:4px;font-size:.85rem;font-weight:700;color:var(--text-soft);white-space:nowrap}
.top-followers:hover{color:var(--accent);text-decoration:none}

/* ---------- Mobile nav toggle ---------- */
.nav-toggle{display:none;background:transparent;border:none;color:var(--text);font-size:1.4rem;cursor:pointer;padding:4px 8px;margin-right:4px;line-height:1}

/* ---------- Account / dashboard layout ---------- */
.dash-layout{display:grid;grid-template-columns:210px 1fr;gap:24px;align-items:start;padding:24px 0 60px}
.side-pane{position:sticky;top:80px;display:flex;flex-direction:column;gap:4px;background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:12px}
.side-title{font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);padding:6px 10px}
.side-link{display:flex;align-items:center;gap:8px;padding:9px 12px;border-radius:9px;color:var(--text-soft);font-weight:600;font-size:.92rem;text-decoration:none}
.side-link:hover{background:var(--surface-2);text-decoration:none}
.side-link.active{background:var(--accent-soft);color:var(--accent)}
.dash-content{min-width:0}
.dash-content h3{margin:18px 0 10px;font-size:1.1rem}

/* ---------- Info / form cards ---------- */
.info-card{display:flex;flex-direction:column;gap:0}
.info-row{display:flex;justify-content:space-between;gap:16px;padding:12px 0;border-bottom:1px solid var(--border)}
.info-row:last-child{border-bottom:none}
.info-k{color:var(--text-soft);font-weight:600}
.info-v{font-weight:600;word-break:break-word;text-align:right}
.form-card{padding:20px}
.danger-zone{border-color:color-mix(in srgb,var(--danger) 40%,var(--border))}
.danger-zone h3{color:var(--danger)}
.inline-form{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.inline-form input{flex:1;min-width:200px}
.plain{color:var(--text)}
.plain:hover{color:var(--accent)}
.rl-card .card-cover{display:block;height:8px;border-radius:0}

/* ---------- Info banner ---------- */
.info-banner{background:var(--accent-soft);color:var(--accent);border:1px solid var(--accent);border-radius:10px;padding:10px 14px;margin-bottom:14px;font-size:.92rem}

/* ---------- Consent bar ---------- */
.consent-bar{position:fixed;left:12px;right:12px;bottom:12px;z-index:60;display:flex;align-items:center;gap:14px;justify-content:space-between;background:var(--surface);border:1px solid var(--border);box-shadow:var(--shadow);border-radius:12px;padding:12px 16px;font-size:.88rem;color:var(--text-soft)}
.consent-bar button{flex:none}

/* ---------- Responsive: tablet & mobile ---------- */
@media (max-width:900px){
  .dash-layout{grid-template-columns:1fr;gap:14px}
  .side-pane{position:static;flex-direction:row;flex-wrap:wrap;gap:4px}
  .side-title{display:none}
  .side-link{flex:0 0 auto}
}
@media (max-width:760px){
  .nav-toggle{display:inline-block}
  .mainnav{position:absolute;top:100%;left:0;right:0;flex-direction:column;gap:2px;background:var(--surface);border-bottom:1px solid var(--border);padding:8px 16px;display:none;box-shadow:var(--shadow)}
  .mainnav.open{display:flex}
  .topbar{position:sticky}
  .topbar-inner{position:relative}
  .brand{flex:1}
}
@media (max-width:560px){
  .top-followers{display:none}
  .card-grid{grid-template-columns:1fr}
  .consent-bar{flex-direction:column;align-items:flex-start;gap:8px}
  .info-v{text-align:left}
}
