/* Buildboard – components: nav, modals, chat, reactions, jams, tabs, admin */
/* ---- accounts, likes, comments ---- */
.bar {
  max-width: 1100px; margin: 0 auto; padding: 16px 24px 0;
  display: flex; justify-content: space-between; align-items: center;
}
.brand { font-weight: 800; letter-spacing: -0.02em; }
.auth-area { display: flex; gap: 10px; align-items: center; }
.auth-area .hello { color: var(--muted); font-size: 0.95rem; }
.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.ghost:hover { background: var(--ink); color: #fff; }
.top { padding-top: 28px; }

.panel .note { margin: 0 0 14px; color: var(--muted); }

dialog { border: 2px solid var(--ink); border-radius: var(--radius); padding: 24px; width: min(360px, 92vw); font-family: inherit; color: var(--ink); }
dialog::backdrop { background: rgba(22, 29, 58, 0.5); }
dialog h2 { margin: 0 0 4px; }
.error { color: #c0262d; min-height: 1.2em; margin: 0; font-size: 0.9rem; }
.link { background: none; color: var(--accent); padding: 4px; font-weight: 600; }
.link:hover { background: none; text-decoration: underline; }

.card-top { display: flex; justify-content: space-between; align-items: center; }
.like { background: none; color: var(--muted); border: 1.5px solid var(--line); padding: 4px 12px; border-radius: 99px; }
.like:hover { background: none; border-color: var(--accent); color: var(--accent); }
.like[aria-pressed="true"] { color: #fff; background: #e0245e; border-color: #e0245e; }

details { border-top: 1px solid var(--line); padding-top: 10px; }
summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; }
.comment { margin: 10px 0 0; font-size: 0.9rem; }
.comment b { margin-right: 6px; }
.comment small { color: var(--muted); }
.comment .del { padding: 0 4px; font-size: 0.8rem; }
.comment-form { display: flex; gap: 8px; margin-top: 10px; }
.comment-form input { flex: 1; min-width: 0; }
.comment-form button { padding: 8px 12px; }
.hint { color: var(--muted); font-size: 0.85rem; margin: 10px 0 0; }
[hidden] { display: none !important; }

/* ---- v3: polish ---- */
:root { color-scheme: light dark; }
.top h1 {
  background: linear-gradient(90deg, var(--accent), #e0245e);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.toolbar #search { margin-bottom: 0; flex: 1; }
.toolbar select { font: inherit; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
#active-filter { margin-bottom: 14px; }
#active-filter:empty { margin: 0; }
.chip { background: var(--accent); padding: 5px 12px; border-radius: 99px; font-size: 0.85rem; }

.card { overflow: hidden; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(22, 29, 58, 0.14); }
.cover { position: relative; height: 130px; margin: -18px -18px 4px; display: grid; place-items: center; color: rgba(255,255,255,.85); font-size: 3.5rem; font-weight: 800; }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.tags .tag { background: var(--tag); color: #161d3a; padding: 2px 9px; border-radius: 99px; font-size: 0.78rem; font-weight: 600; }
.tags .tag:hover { background: #ffd23a; }

@media (prefers-color-scheme: dark) {
  :root { --bg: #0e1224; --surface: #171d38; --ink: #eef0fa; --muted: #9aa3c7; --line: #2a3358; --accent: #7b8bff; }
  input, textarea { background: var(--bg); }
  .ghost:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
  dialog { background: var(--surface); }
  .card:hover { box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5); }
}

/* ---- v4: profiles, chat, verification, detailed posts ---- */
select { font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfd; color: var(--ink); }
.banner { max-width: 1100px; margin: 12px auto 0; padding: 10px 24px; background: var(--tag); color: #161d3a; border-radius: 10px; font-weight: 600; }
.banner .link { color: #161d3a; text-decoration: underline; }

#modal { width: min(480px, 94vw); border: 2px solid var(--ink); border-radius: var(--radius); padding: 24px; color: var(--ink); background: var(--surface); }
#modal::backdrop { background: rgba(22, 29, 58, 0.5); }
.modal-body { display: grid; gap: 12px; }
.modal-body h2 { margin: 0; }
.profile-head { display: flex; gap: 14px; align-items: center; }
.avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 1.8rem; font-weight: 800; flex-shrink: 0; }

.msgs { display: flex; flex-direction: column; gap: 6px; height: 280px; overflow-y: auto; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.msg { margin: 0; max-width: 80%; padding: 7px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); align-self: flex-start; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; background: var(--accent); border-color: var(--accent); color: #fff; }
.inbox-row { display: grid; width: 100%; text-align: left; gap: 2px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); margin-bottom: 8px; }
.inbox-row:hover { background: var(--line); }
.inbox-row span { color: var(--muted); font-weight: 400; font-size: 0.9rem; }

.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 0.72rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.badge.st-Launched { background: #d6f5e0; color: #11602e; border-color: #d6f5e0; }
.badge.st-Inprogress { background: #dde3ff; color: #2531a8; border-color: #dde3ff; }
.badge.st-Idea { background: #ffe9c7; color: #8a4b00; border-color: #ffe9c7; }
.links { display: flex; gap: 14px; }
.details { white-space: pre-wrap; margin: 8px 0 0; font-size: 0.92rem; }
.by .link { padding: 0; }

@media (prefers-color-scheme: dark) {
  select { background: var(--bg); }
  #modal { background: var(--surface); }
}

/* ---- v5: reactions, replies, jams, notifications ---- */
.reacts { display: flex; flex-wrap: wrap; gap: 6px; }
.react { background: none; color: var(--muted); border: 1px solid var(--line); padding: 3px 10px; border-radius: 99px; font-size: 0.85rem; font-weight: 400; }
.react:hover { background: none; border-color: var(--accent); color: var(--accent); }
.react.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.comment.reply { margin-left: 18px; padding-left: 10px; border-left: 2px solid var(--line); }
.card.flash { outline: 3px solid var(--accent); outline-offset: 2px; }
.inbox-row.unread { border-left: 4px solid var(--accent); font-weight: 700; }
.jam { padding: 10px 0; border-bottom: 1px solid var(--line); }
.row { display: flex; gap: 10px; }
.rules { padding-left: 20px; display: grid; gap: 8px; }
.foot { text-align: center; padding: 30px 0 40px; color: var(--muted); }
.foot .link { padding: 0; }

/* ---- tabs & admin ---- */
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab { background: none; color: var(--muted); border: 1.5px solid var(--line); border-radius: 99px; padding: 6px 16px; }
.tab:hover { background: none; color: var(--accent); border-color: var(--accent); }
.tab.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn { display: inline-block; padding: 9px 14px; border-radius: 8px; text-decoration: none; font-weight: 600; }
.row { flex-wrap: wrap; }
.admin { max-width: 800px; margin: 0 auto; padding: 0 24px 64px; }

/* ---- trending, rich text, teammates ---- */
.spot { margin-bottom: 26px; }
.spot h2 { margin: 0 0 10px; font-size: 1.15rem; }
.spot .spot-sub { margin-top: 18px; }
.spot-hero { display: grid; grid-template-columns: 240px 1fr; gap: 18px; background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.spot-hero .cover { height: 100%; min-height: 200px; margin: 0; }
.spot-info { padding: 18px 18px 18px 0; display: grid; gap: 6px; align-content: center; }
.spot-info h3 { margin: 0; font-size: 1.5rem; }
.spot-info p { margin: 0; }
.spot-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.spot-tile { display: grid; gap: 4px; text-align: left; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 0 0 10px; overflow: hidden; font-weight: 400; }
.spot-tile:hover { background: var(--surface); border-color: var(--accent); }
.spot-tile b, .spot-tile span { padding: 0 10px; }
.spot-tile .cover { height: 80px; margin: 0 0 4px; font-size: 2rem; }

.rich { font-size: 0.92rem; }
.rich p { margin: 8px 0 0; }
.rich ul, .rich ol { margin: 8px 0 0; padding-left: 20px; }
.rich a { color: var(--accent); word-break: break-all; }

.badge.team { background: #dff7f0; color: #0b5f4d; border-color: #dff7f0; }
.react.team-btn { color: #0b8a6f; border-color: #0b8a6f; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }
@media (max-width: 700px) { .spot-hero { grid-template-columns: 1fr; } .spot-info { padding: 0 18px 18px; } }

/* ---- fix: forms must never overflow their panel, and tall forms must scroll ---- */
form { grid-template-columns: minmax(0, 1fr); }
.modal-body { grid-template-columns: minmax(0, 1fr); }
label { min-width: 0; }
input, textarea, select { width: 100%; max-width: 100%; min-width: 0; }
input[type="checkbox"] { width: auto; }
input[type="file"] { font-size: 0.85rem; padding: 7px; }
.comment-form input, .toolbar select { width: auto; }
.panel { max-height: calc(100vh - 48px); overflow-y: auto; }
@media (max-width: 800px) { .panel { max-height: none; overflow: visible; } }