:root {
  --bg: #0b0f1e;
  --panel: #141a2e;
  --panel-2: #1b2340;
  --text: #e8ebf5;
  --muted: #9aa3c0;
  --accent: #7aa2ff;
  --accent-2: #ffb86b;
  --line: #262f52;
  --radius: 14px;
  font-family: var(--lang-font, system-ui), system-ui, "Segoe UI", "Nirmala UI", "Noto Sans Bengali", "Noto Sans Devanagari", "Noto Sans Arabic", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(ellipse at top, #18214a 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  line-height: 1.65;
}
a { color: var(--accent); text-decoration: none; }
main { max-width: 1100px; margin: 0 auto; padding: 0 16px 48px; }
h1, h2, h3 { line-height: 1.3; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }

.top {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  max-width: 1100px; margin: 0 auto; padding: 14px 16px;
}
.brand { font-weight: 700; font-size: 1.2rem; color: var(--text); }
.top nav { display: flex; gap: 14px; flex: 1; flex-wrap: wrap; }
.top nav a { color: var(--muted); }
.top nav a:hover { color: var(--text); }
.lang select {
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 8px; font: inherit;
}
@media (max-width: 600px) {
  .top nav { order: 3; flex-basis: 100%; }
  .lang { margin-inline-start: auto; }
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.hero { padding: 28px 0 8px; }
.hero h1 { font-size: clamp(1.4rem, 4vw, 2.2rem); margin: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 24px; }
.grid > section, .ask, .article { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }

.card, .event, .fact {
  display: flex; gap: 12px; padding: 12px; border-radius: 10px; color: var(--text);
  background: var(--panel-2); margin-bottom: 10px; border: 1px solid transparent;
}
a.card:hover, a.event:hover { border-color: var(--accent); }
.card h3 { margin: 0 0 4px; font-size: 1rem; }
.card p, .fact p { margin: 0; color: var(--muted); font-size: .92rem; }
.icon { font-size: 1.8rem; line-height: 1; }
.year { font-weight: 700; color: var(--accent-2); min-width: 3.2em; }
.event span { font-size: .92rem; }
.badge {
  display: inline-block; font-size: .7rem; font-weight: 600; padding: 1px 7px; border-radius: 99px;
  background: #3a2f12; color: var(--accent-2); vertical-align: middle;
}

.tool-promo { margin: 24px 0; text-align: center; }
.tool-promo a {
  display: inline-block; padding: 12px 20px; border-radius: 99px;
  background: var(--panel-2); border: 1px solid var(--line); font-weight: 600;
}

.ask { margin-top: 24px; }
.ask p { color: var(--muted); margin-top: 0; }
.ask textarea {
  width: 100%; min-height: 90px; padding: 10px; border-radius: 10px; font: inherit;
  background: var(--bg); color: var(--text); border: 1px solid var(--line); resize: vertical;
}
.ask button, .tool input {
  font: inherit;
}
.ask button {
  margin-top: 10px; padding: 10px 18px; border: 0; border-radius: 99px;
  background: var(--accent); color: #0b0f1e; font-weight: 700; cursor: pointer;
}
.ask .status { min-height: 1.4em; margin: 8px 0 0; color: var(--accent-2); }

.article { max-width: 760px; margin: 24px auto 0; }
.article h1 { margin-top: 0; }
.lead { font-size: 1.1rem; color: var(--muted); }
.beat { border-inline-start: 3px solid var(--accent); padding-inline-start: 14px; margin: 18px 0; }
.beat.answer { border-color: #6be3a5; }
.beat.question { border-color: var(--accent-2); }
.beat h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 4px; }
.beat p { margin: 0; }
.sources ul { padding-inline-start: 20px; }
.notice { background: #2a2140; padding: 8px 12px; border-radius: 8px; color: var(--accent-2); font-size: .9rem; }
.year-big { font-size: 2.5rem; font-weight: 800; color: var(--accent-2); margin: 0; }
.article .ask { padding: 0; border: 0; background: none; margin-top: 32px; }

.weight-input { display: block; margin: 16px 0; font-weight: 600; }
.weight-input input {
  display: block; margin-top: 6px; width: 160px; padding: 10px; border-radius: 10px;
  background: var(--bg); color: var(--text); border: 1px solid var(--line); font-size: 1.2rem;
}
.planets { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.planets li { background: var(--panel-2); border-radius: 10px; padding: 12px; display: flex; justify-content: space-between; }
.planets output { font-weight: 700; color: var(--accent-2); }

.article.wide { max-width: 1000px; }
.hint { color: var(--muted); font-size: .92rem; }
.small { color: var(--muted); font-size: .8rem; }
.convert { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.pane label { display: block; font-weight: 600; margin-bottom: 6px; }
.tool textarea {
  width: 100%; min-height: 200px; padding: 12px; border-radius: 10px; font-size: 1.15rem;
  background: var(--bg); color: var(--text); border: 1px solid var(--line); resize: vertical; font-family: inherit;
}
.tool textarea.sutonny { font-family: "SutonnyMJ", "Consolas", monospace; }
.tool textarea.big { min-height: 220px; margin-top: 12px; }
.tool select {
  display: block; margin-top: 6px; padding: 8px; border-radius: 8px; font: inherit;
  background: var(--bg); color: var(--text); border: 1px solid var(--line);
}
.tool button {
  margin-top: 8px; padding: 9px 16px; border-radius: 99px; border: 0; cursor: pointer; font: inherit; font-weight: 600;
  background: var(--accent); color: #0b0f1e;
}
.tool button.ghost { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.tool button.mic { font-size: 1.1rem; padding: 12px 24px; }
.tool button.mic.on { background: #ff6b6b; }
.tool button:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }

.root-pick { text-align: center; padding-top: 30vh; }
footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 24px 16px; border-top: 1px solid var(--line); }

/* ---------- Layout with sidebar ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.sidebar { position: sticky; top: 16px; display: grid; gap: 20px; }
.layout .article { margin-top: 24px; max-width: none; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } .sidebar { position: static; } }

/* ---------- Space schedule ---------- */
.schedule, .quiz { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-top: 24px; }
.sidebar .quiz { margin-top: 24px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button { font: inherit; padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--accent); color: #0b0f1e; border-color: var(--accent); font-weight: 700; }
.sched-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.sched-item { display: grid; grid-template-columns: 90px 1fr auto; gap: 12px; align-items: center; background: var(--panel-2); border-radius: 10px; padding: 10px 12px; }
.sched-item .when, .sched-item .what { display: flex; flex-direction: column; }
.sched-item .when strong { font-size: 1.15rem; color: var(--accent-2); }
.sched-item .kind { font-size: .8rem; color: var(--muted); }
.sched-item .live { padding: 6px 12px; border-radius: 99px; background: #ff4d4d; color: #fff; font-weight: 700; font-size: .85rem; white-space: nowrap; }
.sched-list .empty, .comment-list .empty { color: var(--muted); list-style: none; }
@media (max-width: 560px) { .sched-item { grid-template-columns: 70px 1fr; } .sched-item .live { grid-column: 1 / -1; text-align: center; } }

/* ---------- Quiz ---------- */
.quiz-q { margin-bottom: 14px; }
.quiz-q .q { font-weight: 600; margin: 0 0 8px; }
.quiz-q .opt { display: block; width: 100%; text-align: start; font: inherit; margin: 4px 0; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; }
.quiz-q .opt:hover:not(:disabled) { border-color: var(--accent); }
.quiz-q .opt.right { background: #164a33; border-color: #6be3a5; }
.quiz-q .opt.wrong { background: #4a1c22; border-color: #ff6b6b; }
.quiz-q .feedback { font-size: .88rem; color: var(--muted); margin: 6px 0 0; }
.quiz-score { font-weight: 700; color: var(--accent-2); }
.quiz-score.win { color: #6be3a5; }

/* ---------- Ratings and comments ---------- */
.interact { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 16px; }
.stars button { font-size: 1.8rem; background: none; border: 0; color: var(--line); cursor: pointer; padding: 0 2px; }
.stars button.on, .stars button:hover { color: #ffcc4d; }
.comment-list { list-style: none; padding: 0; }
.comment { background: var(--panel-2); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.comment p { margin: 0 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-form input, .comment-form textarea { width: 100%; font: inherit; padding: 10px; border-radius: 10px; background: var(--bg); color: var(--text); border: 1px solid var(--line); margin-bottom: 8px; }
.comment-form textarea { min-height: 90px; resize: vertical; }
.comment-form button { padding: 10px 18px; border: 0; border-radius: 99px; background: var(--accent); color: #0b0f1e; font-weight: 700; cursor: pointer; font: inherit; }
.comment-form .status { color: var(--accent-2); min-height: 1.2em; }
