/* Professional dense community styling. */
:root {
  --bg: #f5f7f9;
  --surface: #fff;
  --surface-soft: #eef3f8;
  --line: #d7dee8;
  --fg: #18212f;
  --muted: #667085;
  --accent: #2563eb;
  --accent-strong: #174ea6;
  --link: #172033;
  --link-visited: #5b6472;
  --pill-bg: #e9f1ff;
  --pill-fg: #174ea6;
  --danger-bg: #fff1f1;
  --danger-border: #d92d20;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  background: var(--bg);
  color: var(--fg);
}

a { color: var(--link); text-decoration: none; }
a:visited { color: var(--link-visited); }
a:hover { text-decoration: underline; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 5;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin-right: 4px;
  text-decoration: none;
}
.logo-box {
  background: var(--accent);
  color: #fff;
  font-weight: bold;
  padding: 1px 7px;
  border-radius: 4px;
}
.logo-text { color: var(--fg); font-weight: 700; }

.topnav {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 260px;
}
.topnav a, .topnav .sep { color: var(--muted); font-size: 13px; }
.topnav a:hover { color: var(--accent-strong); }
.topnav .sep { color: #c2c8d0; }

.submit-cta {
  background: var(--accent);
  color: #fff;
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.submit-cta:visited { color: #fff; }
.submit-cta:hover {
  background: var(--accent-strong);
  text-decoration: none;
}

.account { color: var(--muted); font-size: 13px; }
.account a { color: var(--fg); }
.account-user {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.linklike {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.content {
  max-width: 1040px;
  margin: 0 auto;
  padding: 18px 14px;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  margin-top: 32px;
}

.empty p { max-width: 65ch; }

/* Profile page */
.proftab { border-collapse: collapse; }
.proftab td { padding: 2px 6px; vertical-align: top; }
.proftab td.label { color: #555; }
.proftab td.help small { color: var(--muted); }
.about-display {
  white-space: pre-wrap;
  font-family: inherit;
  background: none;
  margin: 0;
}
.profile-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}
.profile-heading h1 {
  margin: 0;
  font-size: 20px;
}

.avatar {
  --avatar-bg: var(--muted);
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--avatar-bg);
  color: #fff;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.3);
}
.avatar-xs {
  width: 18px;
  height: 18px;
  font-size: 10px;
}
.avatar-sm {
  width: 24px;
  height: 24px;
  font-size: 12px;
}
.user-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
  vertical-align: middle;
}
.user-link a {
  color: var(--muted);
  line-height: 1;
}

input[type="text"], input[type="number"], textarea, select {
  font-family: inherit;
  font-size: 14px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}

input[name="title"], input[name="url"], textarea {
  width: min(100%, 640px);
}

button {
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}

.error {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  padding: 8px 10px;
  color: #912018;
  max-width: 60ch;
  border-radius: 5px;
}

.badge {
  display: inline-block;
  font-size: 8pt;
  padding: 0 4px;
  margin-left: 4px;
  background: var(--pill-bg);
  color: #333;
  border-radius: 2px;
  vertical-align: middle;
}
.badge-mvp        { background: #b31b1b; color: #fff; }
.badge-mvp-rd     { background: #6b0f0f; color: #fff; }
.badge-microsoft  { background: #0078d4; color: #fff; }
.badge-admin      { background: #000;    color: #fff; }
.badge-mod        { background: #555;    color: #fff; }

/* Stories */
.story-list {
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.story-row {
  border-bottom: 1px solid var(--line);
}
.story-row:last-child {
  border-bottom: 0;
}
.story {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
}
.story-score {
  color: var(--muted);
  text-align: center;
  padding-top: 2px;
}
.score-count {
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 2px;
}
.story-main {
  min-width: 0;
}
.titleline {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}
.vote-form {
  display: block;
  margin: 0;
}
.inline-form {
  display: inline;
  margin: 0;
}
.subtle-link {
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}
.subtle-link:hover {
  text-decoration: underline;
}
.votearrow {
  display: inline-block;
  width: 24px;
  height: 22px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}
button.votearrow:hover {
  color: var(--accent-strong);
  border-color: #b9c7dc;
  text-decoration: none;
}
.muted-vote {
  opacity: 0.35;
  background: transparent;
}
.sitebit, .subtext, .form-help {
  color: var(--muted);
  font-size: 12px;
}
.subtext a { color: var(--muted); }
.sitebit {
  font-weight: 400;
}
.section-pill {
  display: inline-flex;
  align-items: center;
  background: var(--pill-bg);
  color: var(--pill-fg);
  border: 1px solid #cfe0ff;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 12px;
  font-weight: 600;
}
.section-pill:visited { color: var(--pill-fg); }
.section-pill:hover {
  text-decoration: none;
  border-color: #9ec0ff;
}
.story-preview {
  color: #3f4a59;
  font-size: 13px;
  margin-top: 4px;
  max-width: 78ch;
}
.comment-link {
  font-weight: 600;
}
.story-text, .comment-text {
  margin: 10px 0;
  max-width: 72ch;
  white-space: pre-wrap;
}
.comment-form {
  margin: 18px 0;
}
.comment {
  margin-top: 14px;
  padding-top: 4px;
}
.comment-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  max-width: 72ch;
}
.comment-votes {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}
.comment-vote-form {
  display: inline;
  margin: 0;
}
.comment-vote {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
}
button.comment-vote:hover {
  color: var(--accent-strong);
  border-color: #b9c7dc;
}
.thread-row {
  margin-bottom: 18px;
}
.reply-details {
  margin-top: 3px;
}
.reply-details summary {
  color: var(--muted);
  cursor: pointer;
  display: inline;
  font-size: 12px;
}
.inline-reply-form {
  margin-top: 6px;
}

@media (max-width: 640px) {
  body { font-size: 14px; }
  .topbar { align-items: flex-start; }
  .topnav { order: 3; width: 100%; min-width: 0; overflow-x: auto; }
  .content { padding: 12px 8px; }
  .story { grid-template-columns: 36px minmax(0, 1fr); padding: 10px 9px; }
  .titleline { font-size: 14px; }
  .comment-meta { max-width: 100%; }
}
