:root {
  --so-black: #232629;
  --so-link: #0074cc;
  --so-link-hover: #0a95ff;
  --so-blue: #0a95ff;
  --so-orange: #7eb8e8; /* accent line (was orange; now light blue) */
  --so-border: #d6d9dc;
  --so-bg: #ffffff;
  --so-muted: #6a737c;
  --so-tag-bg: #e1ecf4;
  --so-tag-text: #39739d;
  --so-sidebar-active: #f1f2f3;
  --so-green: #2f6f44;
  --so-topbar: #f8f9f9;
  --page-max: 1264px;
  --warn-bg: #fff8e5;
  --warn-border: #f1e5bc;
  --warn-text: #664d03;
  --danger: #c22;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "IBM Plex Sans", Candara, "Trebuchet MS", sans-serif;
  color: var(--so-black);
  background: var(--so-bg);
  font-size: 13px;
  line-height: 1.4;
}
a { color: var(--so-link); text-decoration: none; }
a:hover { color: var(--so-link-hover); }
button, input, select, textarea { font: inherit; }
.hidden { display: none !important; }

.topbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--so-topbar);
  border-top: 3px solid var(--so-orange);
  border-bottom: 1px solid var(--so-border);
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.topbar-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  display: flex; align-items: center; gap: 8px;
  height: 50px; padding: 0 12px;
}
.logo {
  display: flex; align-items: center; gap: 6px;
  color: var(--so-black); font-weight: 700; font-size: 18px;
  white-space: nowrap; padding: 0 8px;
}
.logo:hover { color: var(--so-black); }
.logo-mark { width: 28px; height: 28px; display: grid; place-items: center; }
.logo-mark svg { width: 26px; height: 26px; }
.nav-link {
  color: var(--so-muted); padding: 6px 10px; border-radius: 1000px; white-space: nowrap;
}
.nav-link:hover { background: #e3e6e8; color: var(--so-black); }
.search {
  flex: 1; display: flex; align-items: center;
  border: 1px solid var(--so-border); border-radius: 6px; background: #fff;
  padding: 0 8px; height: 32px; max-width: 700px; margin: 0 8px;
}
.search:focus-within {
  border-color: #59a7e8;
  box-shadow: 0 0 0 4px rgba(0,116,204,.15);
}
.search svg { width: 16px; height: 16px; fill: var(--so-muted); flex-shrink: 0; }
.search input { border: 0; outline: 0; width: 100%; padding: 0 8px; background: transparent; }
.top-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.mobile-nav {
  display: none;
  border-top: 1px solid var(--so-border);
  background: var(--so-topbar);
  padding: 0 8px 8px;
  gap: 6px;
}
.mobile-nav-link {
  flex: 1;
  text-align: center;
  padding: 8px 6px;
  border-radius: 6px;
  color: var(--so-muted);
  font-weight: 600;
  font-size: 13px;
}
.mobile-nav-link:hover { background: #e3e6e8; color: var(--so-black); }
.mobile-nav-link.active {
  background: var(--so-sidebar-active);
  color: var(--so-black);
  border-bottom: 2px solid var(--so-orange);
}
.user-chip {
  color: var(--so-muted); padding: 0 6px; white-space: nowrap;
}
.btn {
  border-radius: 6px; padding: 8px 10.4px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; white-space: nowrap; background: #e3e6e8; color: var(--so-black);
}
.btn-login { background: #e1ecf4; border-color: #7aa7c7; color: #39739d; }
.btn-login:hover { background: #b3d3ea; }
.btn-signup, .btn-ask, .btn-primary {
  background: var(--so-blue); border-color: #122a4a; color: #fff;
  box-shadow: inset 0 1px 0 0 rgba(255,255,255,.4);
}
.btn-signup:hover, .btn-ask:hover, .btn-primary:hover { background: #0074cc; }
.btn-danger { background: #f8e7e7; border-color: #d94c4c; color: #9b1c1c; }

.page {
  max-width: var(--page-max); margin: 0 auto;
  display: grid; grid-template-columns: 164px minmax(0, 1fr);
  min-height: calc(100vh - 50px);
}
.sidebar {
  padding: 24px 0; border-right: 1px solid var(--so-border);
  position: sticky; top: 50px; height: calc(100vh - 50px); overflow: auto;
}
.side-item {
  display: flex; align-items: center; gap: 6px;
  padding: 8px; color: var(--so-muted); border-right: 3px solid transparent; font-size: 13px;
}
.side-item svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }
.side-item:hover { color: var(--so-black); background: #f9f9f9; }
.side-item.active {
  background: var(--so-sidebar-active); color: var(--so-black);
  font-weight: 700; border-right-color: var(--so-orange);
}
.side-section {
  margin-top: 18px; padding: 0 8px 6px 12px; color: #9199a1;
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
}

.main { padding: 24px; max-width: 100%; }
.main-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; margin-bottom: 12px;
}
.main-header h1 {
  margin: 0; font-size: 27px; font-weight: 400; line-height: 1.3;
}
.count-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.count { font-size: 17px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tabs { display: inline-flex; border: 1px solid var(--so-border); border-radius: 6px; overflow: hidden; }
.tab {
  border: 0; background: #fff; color: var(--so-muted); padding: 8px 11px; cursor: pointer;
  border-right: 1px solid var(--so-border); text-decoration: none; font: inherit; font-size: 12px;
}
.tab:last-child { border-right: 0; }
.tab.active { background: #e3e6e8; color: var(--so-black); }
.notice {
  background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn-text);
  border-radius: 6px; padding: 10px 12px; margin-bottom: 16px;
}
.error-banner {
  background: #fdf2f2; border: 1px solid #f0b4b4; color: #8a1f1f;
  border-radius: 6px; padding: 10px 12px; margin-bottom: 16px;
}
.success-banner {
  background: #eefbf1; border: 1px solid #b7e0c0; color: #1e5a2c;
  border-radius: 6px; padding: 10px 12px; margin-bottom: 16px;
}
.muted { color: var(--so-muted); font-size: 13px; font-weight: 500; }

.q-list { border-top: 1px solid var(--so-border); }
.q-item {
  display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 16px;
  padding: 16px 0; border-bottom: 1px solid var(--so-border);
}
.stats {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  color: var(--so-muted); padding-top: 2px;
}
.stat {
  min-width: 68px; text-align: center; padding: 4px 6px; border-radius: 4px;
}
.stat strong {
  display: block; font-weight: 500; color: var(--so-black); font-size: 17px; line-height: 1.1;
}
.stat span { font-size: 12px; }
.stat.answered {
  color: var(--so-green); border: 1px solid var(--so-green);
}
.stat.answered strong { color: var(--so-green); }
.q-title { font-size: 17px; font-weight: 400; margin: 0 0 6px; line-height: 1.35; }
.q-excerpt {
  margin: 0 0 8px; color: var(--so-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.q-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
  background: var(--so-tag-bg); color: var(--so-tag-text); border-radius: 3px;
  padding: 4.8px 6px; font-size: 12px; line-height: 1;
}
.user-meta {
  display: flex; align-items: center; gap: 6px; color: var(--so-muted);
  font-size: 12px; margin-left: auto;
}
.avatar {
  width: 16px; height: 16px; border-radius: 2px;
  background: linear-gradient(135deg, #7aa7c7, #3f6f5b);
}

.panel {
  border: 1px solid var(--so-border); border-radius: 8px; padding: 16px; background: #fff;
}
.panel + .panel { margin-top: 16px; }
.panel h2, .panel h3 { margin-top: 0; }
.meta { color: var(--so-muted); margin-bottom: 10px; }
.form-grid { display: grid; gap: 12px; max-width: 640px; }
.form-grid label { display: grid; gap: 4px; font-weight: 600; }
.form-grid input, .form-grid select, .form-grid textarea {
  border: 1px solid var(--so-border); border-radius: 6px; padding: 8px 10px; font-weight: 400;
}
.form-grid textarea { min-height: 110px; resize: vertical; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.check-row { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.method-row {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--so-border);
}
.method-row h3 { margin: 0 0 4px; font-size: 17px; font-weight: 600; }
.method-row p { margin: 0; color: var(--so-muted); }
.story-prompts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0 0 20px;
}
.story-prompt {
  text-align: left;
  border: 1px solid var(--so-border);
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.story-prompt:hover { border-color: #0a95ff; background: #f8fbff; }
.story-prompt h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.story-prompt p { margin: 0; color: var(--so-muted); font-size: 13px; line-height: 1.45; }
.story-phase-fieldset {
  border: 1px solid var(--so-border);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0;
}
.story-phase-fieldset legend {
  padding: 0 6px;
  font-weight: 600;
  font-size: 13px;
}
.story-phase-fieldset .check-row { margin: 8px 0; align-items: flex-start; }
.empty { color: var(--so-muted); padding: 24px 0; }
.loading { color: var(--so-muted); padding: 16px 0; }

.about-copy { max-width: 720px; }
.about-copy h2 {
  margin: 28px 0 8px; font-size: 20px; font-weight: 600;
}
.about-copy p, .about-copy li {
  font-size: 14px; line-height: 1.5;
}
.about-copy ul, .about-steps { margin: 0 0 16px; padding-left: 22px; }
.about-steps li { margin: 6px 0; }
.about-figure {
  margin: 12px 0 20px;
  border: 1px solid var(--so-border);
  border-radius: 8px;
  overflow: hidden;
  background: #f8f9f9;
}
.about-figure img {
  display: block; width: 100%; height: auto;
}
.about-figure figcaption {
  padding: 8px 12px;
  color: var(--so-muted);
  font-size: 12px;
  border-top: 1px solid var(--so-border);
  background: #fff;
}

@media (max-width: 980px) {
  .page { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .nav-hide-sm { display: none; }
  .mobile-nav { display: flex; }
  .mobile-nav-link { font-size: 12px; padding: 8px 4px; }
  .q-item { grid-template-columns: 76px minmax(0, 1fr); gap: 10px; }
  .user-meta { flex-wrap: wrap; justify-content: flex-end; }
  .story-prompts { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .search { display: none; }
  .main { padding: 16px 12px; }
  .user-chip { display: none; }
  .main-header { flex-direction: column; align-items: stretch; }
  .main-header .btn { width: 100%; }
}
