:root {
  --bg: #eef6fc;
  --ink: #182430;
  --muted: #5f7180;
  --sky: #2f8fd6;
  --sky-dark: #1f679b;
  --out-bubble: var(--sky);
  --in-bubble: #ffffff;
  --line: #d6e8f5;
  --w: 720px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

header.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 14px 20px;
  position: sticky; top: 0; z-index: 10;
}
.topbar-inner {
  max-width: var(--w); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.15rem; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--sky); color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: .95rem; position: relative;
}
.avatar::after {
  content: ""; position: absolute; bottom: -1px; right: -1px;
  width: 10px; height: 10px; border-radius: 50%; background: #3ecf6e; border: 2px solid #fff;
}
nav.toplinks { display: flex; gap: 18px; font-size: .88rem; font-weight: 600; }
nav.toplinks a { color: var(--muted); text-decoration: none; }

main { max-width: var(--w); margin: 0 auto; padding: 28px 16px 70px; }

.thread { display: flex; flex-direction: column; gap: 4px; margin-bottom: 30px; }
.msg { max-width: 78%; padding: 13px 18px; border-radius: 18px; font-size: .98rem; line-height: 1.55; }
.msg .ts { display: block; font-size: .72rem; opacity: .65; margin-top: 4px; }
.msg.in { align-self: flex-start; background: var(--in-bubble); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.out { align-self: flex-end; background: var(--out-bubble); color: #fff; border-bottom-right-radius: 4px; }
.msg.out .ts { color: rgba(255,255,255,.75); }
.msg.in .ts { color: var(--muted); }
.msg h1 { font-size: 1.5rem; margin: 0 0 8px; line-height: 1.25; }
.msg p { margin: 0 0 0.8em; }
.msg p:last-of-type { margin-bottom: 0; }

.row-cta { display: flex; justify-content: center; margin: 26px 0 40px; }
.btn {
  display: inline-block; background: var(--sky); color: #fff; text-decoration: none;
  font-weight: 700; padding: 13px 30px; border-radius: 22px; font-size: .92rem;
  box-shadow: 0 8px 18px rgba(47,143,214,.28);
}
.btn:hover { background: var(--sky-dark); }
.btn-ghost {
  display: inline-block; background: #fff; color: var(--sky-dark); text-decoration: none;
  font-weight: 700; padding: 11px 26px; border-radius: 22px; font-size: .88rem;
  border: 1.5px solid var(--sky);
}

h2.section-h { font-size: 1.15rem; margin: 0 0 16px; padding-left: 4px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: .8rem; }

.reading-thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 40px; }
.reading-thread a.msg-link {
  display: block; text-decoration: none; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 18px; border-bottom-left-radius: 4px;
  padding: 14px 18px; max-width: 90%;
}
.reading-thread a.msg-link:hover { border-color: var(--sky); }
.reading-thread .tag { font-size: .72rem; color: var(--sky-dark); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.reading-thread h3 { margin: 6px 0 4px; font-size: 1rem; }
.reading-thread p { margin: 0; font-size: .86rem; color: var(--muted); }

article main { padding-top: 20px; }
.breadcrumb { font-size: .82rem; color: var(--muted); margin-bottom: 1em; }
.breadcrumb a { color: var(--muted); }

footer { border-top: 1px solid var(--line); padding: 24px 16px; text-align: center; }
.footer-inner { font-size: .82rem; color: var(--muted); display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.footer-inner a { color: var(--muted); text-decoration: none; }
