/* forum.samhq.app. Dark first, light by prefers-color-scheme. Tokens follow the IndieCrumb dashboard (app.css). */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", "Inter", "Segoe UI", system-ui, sans-serif;
  --bg: #0d0d0e; --card: #141416; --field: #1c1c1f; --seg-on: #3a3a3d;
  --ink: #f5f5f7; --sub: #a1a1a6; --faint: #7c7c82;
  --line: rgba(255, 255, 255, .08); --line2: rgba(255, 255, 255, .13);
  --hover: rgba(255, 255, 255, .04); --press: rgba(255, 255, 255, .07);
  --coral: #f0654f; --coral-ink: #ff7a66; --coral-wash: rgba(240, 101, 79, .12); --on-coral: #fff;
  --blue: #2997ff; --green: #4cc764; --yellow: #f2c94c; --red: #ff6b7f; --gray: #7c7c82;
  --r: 14px; --r-sm: 10px;
  --ease: cubic-bezier(.25, .46, .45, .94);
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f4f5; --card: #ffffff; --field: #f3f3f5; --seg-on: #ffffff;
    --ink: #1d1d1f; --sub: #5a5b63; --faint: #6b6c74;
    --line: rgba(0, 0, 0, .08); --line2: rgba(0, 0, 0, .13);
    --hover: rgba(0, 0, 0, .035); --press: rgba(0, 0, 0, .06);
    --coral: #e8553e; --coral-ink: #d4472f; --coral-wash: rgba(232, 85, 62, .1);
    --blue: #0071e3; --green: #1f9a55; --yellow: #b98900; --red: #d93a30; --gray: #8a8b92;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-width: thin; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
svg { flex: none; }
:focus { outline: none; }
a:focus-visible, button:focus-visible { background-color: var(--press); border-radius: 8px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: default; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line2); background: var(--field); font-weight: 500; white-space: nowrap; transition: background-color .15s var(--ease); }
.btn:hover { background-color: var(--press); }
.btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.btn.primary { background: var(--coral); border-color: transparent; color: var(--on-coral); }
.btn.primary:hover, .btn.primary:focus-visible { background: var(--coral-ink); }
.btn.danger { color: var(--red); }
.link { color: var(--sub); font-size: 13px; }
.link:hover { color: var(--ink); }

/* Top bar */
.top { display: flex; align-items: center; gap: 14px; padding: 14px 32px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; color: var(--sub); margin-right: auto; white-space: nowrap; }
.brand b { color: var(--ink); font-weight: 600; }
.mark { width: 28px; height: 22px; color: var(--ink); }
.search { position: relative; width: min(420px, 100%); }
.search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); fill: none; stroke: var(--faint); stroke-width: 1.6; stroke-linecap: round; pointer-events: none; }
.search input { width: 100%; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--field); border: 1px solid var(--line2); border-radius: var(--r-sm); height: 36px; padding: 0 12px; transition: border-color .15s var(--ease); }
.search input { padding-left: 36px; }
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { border-color: var(--faint); }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
.me { display: flex; align-items: center; gap: 10px; }

/* Avatars */
.av { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 600; font-size: 14px; flex: none; }
.av.staff { background: var(--coral); }
.av.sm { width: 20px; height: 20px; font-size: 11px; }

.flash { margin: 12px 32px 0; padding: 10px 14px; border-radius: var(--r-sm); border: 1px solid var(--line2); background: var(--card); }
.flash.err { border-color: var(--red); color: var(--red); }

/* App filter strip */
.apps { display: flex; gap: 10px; padding: 16px 32px 0; overflow-x: auto; scrollbar-width: none; }
.apps::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }
.app { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--card); color: var(--sub); white-space: nowrap; transition: background-color .15s var(--ease), color .15s var(--ease); }
.app:hover { background-color: var(--hover); color: var(--ink); }
.app.on { background: var(--seg-on); border-color: var(--line2); color: var(--ink); }
.app img { width: 20px; height: 20px; border-radius: 5px; }
.n { color: var(--faint); margin-left: 8px; font-size: .92em; font-variant-numeric: tabular-nums; }
.app .n { margin-left: 2px; }

/* Board tabs + sort */
.boards { display: flex; align-items: center; gap: 16px; padding: 8px 32px 0; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 30px; overflow-x: auto; scrollbar-width: none; margin-right: auto; }
.tab { display: inline-flex; align-items: center; height: 46px; color: var(--sub); font-size: 16px; font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s var(--ease); }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); border-bottom-color: var(--ink); }
.seg { display: inline-flex; padding: 3px; border-radius: var(--r-sm); background: var(--field); border: 1px solid var(--line); margin-bottom: 6px; }
.seg a { display: grid; place-items: center; min-width: 58px; height: 30px; padding: 0 10px; border-radius: 7px; color: var(--sub); font-weight: 500; }
.seg a:hover { color: var(--ink); }
.seg a.on { background: var(--seg-on); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }

main { padding: 24px 32px 48px; }

/* List + rail */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.rows { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.row { display: flex; align-items: center; gap: 16px; padding: 12px 20px 12px 18px; transition: background-color .15s var(--ease); }
.row + .row { border-top: 1px solid var(--line); }
.row:hover { background-color: var(--hover); }
.main { flex: 1; min-width: 0; }
.title { display: block; font-size: 17px; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.title:hover { color: var(--coral-ink); }
.pin, .lock { width: 15px; height: 15px; margin-right: 6px; vertical-align: -2px; fill: none; stroke: var(--coral); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lock { stroke: var(--faint); }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; margin-top: 4px; color: var(--sub); font-size: 14px; }
.i { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
/* The dot rides with the item after it, so a wrapped line never ends on a dot. */
.i + .i::before { content: "·"; color: var(--faint); }
.ai { width: 18px; height: 18px; border-radius: 4px; }
.au { display: inline-flex; align-items: center; gap: 6px; }
.by { color: var(--faint); }
.side { display: flex; align-items: center; gap: 24px; flex: none; }
.st { display: inline-flex; align-items: center; gap: 8px; min-width: 112px; color: var(--ink); font-size: 14.5px; white-space: nowrap; }
.st i { width: 8px; height: 8px; border-radius: 50%; background: var(--gray); }
.st-shipped i { background: var(--green); }
.st-planned i { background: var(--blue); }
.st-in_progress i { background: var(--yellow); }
.st-confirmed i { background: var(--red); }
.st-open i { background: none; box-shadow: inset 0 0 0 1.5px var(--sub); }
.st-declined { color: var(--sub); }
.rc { display: inline-flex; align-items: center; justify-content: flex-end; gap: 7px; min-width: 52px; color: var(--sub); font-variant-numeric: tabular-nums; }
.rc svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }

/* Vote box */
.vote button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 56px; height: 60px; border-radius: var(--r-sm); border: 1px solid var(--line2); color: var(--ink); font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; transition: background-color .15s var(--ease), border-color .15s var(--ease); }
.vote button svg { width: 12px; height: 10px; fill: var(--sub); }
.vote button:not(:disabled):hover { background-color: var(--hover); border-color: var(--faint); }
.vote.on button { border-color: var(--coral); background: var(--coral-wash); color: var(--coral-ink); }
.vote.on button svg { fill: var(--coral); }
.vote.sm button { width: 44px; height: 50px; font-size: 14px; }

.empty { padding: 48px 24px; text-align: center; color: var(--sub); background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.empty .big { color: var(--ink); font-size: 17px; margin-bottom: 6px; }
.empty a, .note a { color: var(--coral-ink); }
.more { margin-top: 16px; }

.rail { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.card h2 { display: flex; justify-content: space-between; margin: 0 0 14px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--sub); }
.card h2 a { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 14px; color: var(--ink); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats b { display: block; font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stats span { color: var(--sub); font-size: 14px; }
.mini { list-style: none; margin: 0 -8px; padding: 0; }
.mini a { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; transition: background-color .15s var(--ease); }
.mini a:hover { background-color: var(--hover); }
.mini .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .r { display: inline-flex; align-items: center; gap: 4px; color: var(--faint); font-size: 14px; font-variant-numeric: tabular-nums; }
.mini .r svg { width: 10px; height: 8px; fill: currentColor; }
.mini .ai { width: 22px; height: 22px; }

/* Roadmap */
.road { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.col { display: grid; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.col h2 { display: flex; align-items: center; justify-content: space-between; margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.col h2 .st { min-width: 0; font-size: 15px; }
.rcard { display: flex; gap: 12px; padding: 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg); }
.rcard .title { font-size: 15.5px; }
.rcard .meta { font-size: 13px; }
.grow { flex: 1; }
.rcard .rc { min-width: 0; font-size: 13px; }
.rcard .rc svg { width: 15px; height: 15px; }
.none { color: var(--faint); padding: 8px 4px; }

/* Thread */
.thread { max-width: 900px; margin: 0 auto; display: grid; gap: 16px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; justify-self: start; color: var(--sub); padding: 4px 8px 4px 2px; }
.crumb:hover { color: var(--ink); }
.crumb svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.thead { display: flex; align-items: center; gap: 16px; }
.thead h1 { margin: 0; font-size: 24px; line-height: 1.25; font-weight: 600; overflow-wrap: anywhere; }
.thead .pin, .thead .lock { width: 18px; height: 18px; }
.mod { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r); border: 1px dashed var(--line2); }
.mod form { display: flex; align-items: center; gap: 8px; }
.mod label { color: var(--sub); font-size: 14px; }
.mod .btn { height: 32px; padding: 0 12px; font-size: 14px; }
.mod select { height: 32px; }
.posts { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.post { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 20px; }
.post.op { border-color: var(--line2); }
.post.hidden { opacity: .55; }
.phead { display: flex; align-items: center; gap: 6px; color: var(--sub); font-size: 14px; }
.phead .au { color: var(--ink); font-weight: 500; }
.phead a:hover { color: var(--ink); }
.hid { color: var(--red); margin-left: 6px; }
.ph-act { margin-left: auto; }
.body { margin-top: 10px; overflow-wrap: anywhere; }
.body > * { margin: 0 0 10px; }
.body > :last-child { margin-bottom: 0; }
.body a { color: var(--coral-ink); text-decoration: underline; text-underline-offset: 2px; }
.body code { font: 13.5px ui-monospace, "SF Mono", Menlo, monospace; background: var(--field); padding: 1px 5px; border-radius: 5px; }
.body pre { background: var(--field); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; overflow-x: auto; }
.body pre code { background: none; padding: 0; }
.body blockquote { margin-left: 0; padding-left: 12px; border-left: 3px solid var(--line2); color: var(--sub); }
.body ul, .body ol { padding-left: 22px; }
.note { padding: 14px 18px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); color: var(--sub); }

/* Forms */
.sheet { max-width: 720px; margin: 0 auto; display: grid; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; }
.sheet.narrow { max-width: 460px; margin-top: 24px; }
.sheet h1 { margin: 0; font-size: 22px; font-weight: 600; }
.sheet form { display: grid; gap: 16px; }
.lead { color: var(--sub); }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; color: var(--sub); }
.opt { color: var(--faint); font-weight: 400; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.hint { margin-right: auto; color: var(--faint); font-size: 13px; }
.reply { display: grid; gap: 10px; }
.cf-turnstile { min-height: 65px; }

/* Tablet: rail drops under the list */
@media (max-width: 1080px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .road { grid-template-columns: minmax(0, 1fr); }
}

/* Phone */
@media (max-width: 640px) {
  .top { flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
  .search { order: 5; width: 100%; }
  .top .btn span { display: none; }
  .top .btn.primary { width: 36px; padding: 0; justify-content: center; }
  .me .link { display: none; }
  .apps { padding: 12px 16px 0; gap: 8px; }
  .app { height: 36px; padding: 0 12px; }
  .boards { flex-wrap: wrap; gap: 0; padding: 4px 16px 0; }
  .tabs { gap: 22px; width: 100%; }
  .tab { font-size: 15px; height: 42px; }
  .seg { margin: 8px 0 10px; }
  main { padding: 16px 16px 40px; }
  .row { align-items: flex-start; flex-wrap: wrap; gap: 12px; padding: 12px 14px; }
  .row .vote button { width: 46px; height: 52px; font-size: 15px; }
  .row .main { flex-basis: calc(100% - 58px); }
  .title { font-size: 16px; }
  .meta { font-size: 13px; }
  .row .side { width: 100%; padding-left: 58px; gap: 16px; justify-content: space-between; }
  .st { min-width: 0; }
  .thead { flex-wrap: wrap; align-items: flex-start; }
  .thead .main { flex-basis: calc(100% - 72px); }
  .thead h1 { font-size: 20px; }
  .thead .side { width: 100%; padding-left: 72px; justify-content: space-between; }
  .post { padding: 14px 16px; }
  .two { grid-template-columns: 1fr; }
  .sheet { padding: 18px; }
  .hint { display: none; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
