/* Red Flare Hub — A Grafit (design doc §16) */
:root, [data-theme="dark"] {
  --bg: #0E0E10;
  --side: #121214;
  --surf: #161618;
  --raised: #1F1F23;
  --hover: #26262B;
  --border: #28282D;
  --border-strong: #36363C;
  --text: #E8E8EA;
  --muted: #A0A0A8;
  --faint: #878790;
  --accent: #BB1C13;
  --accent-text: #F0645B;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #F6F6F7;
  --side: #EEEEF0;
  --surf: #FFFFFF;
  --raised: #E9E9EC;
  --hover: #E2E2E6;
  --border: #DEDEE3;
  --border-strong: #C9C9D0;
  --text: #1A1A1E;
  --muted: #55555D;
  --faint: #6A6A73;
  --accent: #BB1C13;
  --accent-text: #B01A12;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Noto Sans JP', system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
:lang(ja) { font-family: 'Noto Sans JP', 'Inter', system-ui, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--muted); }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--muted); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 32px; padding: 0 12px; border-radius: 6px;
  border: 1px solid var(--border); background: transparent; color: var(--text);
  cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--raised); }
.btn.primary { border: 0; background: var(--accent); color: #FFFFFF; font-weight: 500; }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn.quiet { border-color: transparent; color: var(--muted); }
.btn.small { min-height: 28px; padding: 0 10px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { color: var(--muted); font-size: 12px; }
.input, .select {
  min-height: 34px; padding: 0 10px; border-radius: 6px;
  border: 1px solid var(--border-strong); background: var(--surf); color: var(--text);
}
textarea.input { padding: 8px 10px; resize: vertical; }
.badge {
  display: inline-flex; align-items: center; font-size: 11px; padding: 0 6px; border-radius: 10px;
  background: var(--hover); color: var(--text); line-height: 18px;
}
.tag {
  display: inline-flex; align-items: center; font-size: 11px; padding: 0 6px; border-radius: 4px;
  border: 1px solid var(--border); color: var(--muted); line-height: 18px; white-space: nowrap;
}
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.card {
  background: var(--surf); border: 1px solid var(--border); border-radius: 10px; padding: 16px;
}
.notice {
  padding: 10px 12px; border-radius: 8px; border: 1px dashed var(--border-strong);
  color: var(--muted); font-size: 12px;
}
.error { color: var(--accent-text); font-size: 12px; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidenav {
  flex: 0 0 208px; width: 208px; position: sticky; top: 0; height: 100vh;
  background: var(--side); border-right: 1px solid var(--border);
  padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto;
}
.shell.rail .sidenav { flex-basis: 56px; width: 56px; }
.shell.rail .wide-only { display: none !important; }
.nav-link {
  display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 10px;
  border-radius: 6px; color: var(--muted); text-decoration: none; border: 0; background: transparent;
  width: 100%; text-align: left; cursor: pointer;
}
.nav-link:hover { background: var(--raised); color: var(--text); }
.nav-link[aria-current="page"] { background: var(--raised); color: var(--text); font-weight: 500; }
.nav-link[aria-current="page"] svg { stroke: var(--accent-text); }
.nav-link svg { flex: 0 0 16px; }
.nav-link .end { margin-left: auto; font-size: 11px; color: var(--faint); font-weight: 400; }
.nav-sep { height: 1px; background: var(--border); margin: 10px 8px; }
.nav-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.avatar {
  width: 20px; height: 20px; flex: 0 0 20px; border-radius: 50%; background: var(--hover);
  font-size: 10px; font-weight: 600; display: flex; align-items: center; justify-content: center;
}

.project-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; padding: 6px 8px;
  border: 0; border-radius: 6px; background: transparent; cursor: pointer; text-align: left;
}
.project-btn:hover { background: var(--raised); }
.logo { width: 20px; height: 20px; flex: 0 0 20px; border-radius: 4px; image-rendering: pixelated; }
.project-menu {
  margin: 4px 0 8px; padding: 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--surf);
  display: flex; flex-direction: column; gap: 2px;
}
.project-menu form { display: flex; gap: 4px; padding: 4px; }
.project-menu .input { min-height: 28px; flex: 1 1 auto; min-width: 0; }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 20px;
  border-bottom: 1px solid var(--border); min-height: 53px;
}
.topbar h1 { margin: 0; font-size: 15px; font-weight: 600; }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mobile-head { display: none; }
.content { padding: 20px; flex: 1 1 auto; }
.page-narrow { max-width: 760px; }

/* ---------- Mobile ---------- */
.bottombar { display: none; }
@media (max-width: 767px) {
  .sidenav { display: none; }
  .mobile-head {
    display: flex; align-items: center; gap: 10px; padding: 12px 16px;
    border-bottom: 1px solid var(--border); background: var(--side);
  }
  .mobile-head .logo { width: 24px; height: 24px; flex-basis: 24px; border-radius: 5px; }
  .mobile-head strong { font-size: 15px; }
  .topbar { padding: 10px 16px; }
  .content { padding: 16px; }
  .shell.has-bottombar .main { padding-bottom: 76px; }
  .bottombar {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    padding: 6px 8px 14px; border-top: 1px solid var(--border); background: var(--side);
  }
  .bottombar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 48px; color: var(--muted); text-decoration: none; font-size: 11px;
  }
  .bottombar a[aria-current="page"] { color: var(--text); font-weight: 600; }
  .bottombar a[aria-current="page"] svg { stroke: var(--accent-text); }
}
.sheet-list { display: flex; flex-direction: column; gap: 2px; }
.sheet-list .nav-link { min-height: 44px; font-size: 14px; }

/* ---------- Coming soon ---------- */
.soon { display: flex; flex-direction: column; gap: 16px; max-width: 720px; }
.soon-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.soon-icon {
  width: 40px; height: 40px; border-radius: 10px; background: var(--raised);
  display: flex; align-items: center; justify-content: center; color: var(--muted);
}
.soon h2 { margin: 0; font-size: 18px; font-weight: 600; }
.soon-pill {
  font-size: 11px; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--border-strong); color: var(--muted);
}
.soon ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.soon li { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); }
.soon li svg { flex: 0 0 14px; margin-top: 3px; color: var(--faint); }

/* ---------- Calendar ---------- */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-head h2 { margin: 0 8px 0 0; font-size: 15px; font-weight: 600; min-width: 140px; }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--border); gap: 1px;
}
.cal-dow { background: var(--side); padding: 6px 8px; font-size: 11px; color: var(--faint); }
.cal-day { background: var(--surf); min-height: 96px; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.cal-day.other { background: var(--bg); }
.cal-day.other .num { color: var(--faint); opacity: .6; }
.cal-day .num { font-size: 12px; color: var(--muted); }
.cal-day.today .num {
  color: var(--text); font-weight: 600; background: var(--raised); border-radius: 10px; padding: 0 6px; align-self: flex-start;
}
.cal-chip {
  font-size: 11px; padding: 2px 6px; border-radius: 4px; background: var(--raised); color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 0;
}
.agenda { display: flex; flex-direction: column; gap: 8px; }
.agenda-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; background: var(--surf); border: 1px solid var(--border); }
.agenda-date { flex: 0 0 44px; text-align: center; line-height: 1.2; }
.agenda-date b { display: block; font-size: 16px; }
.agenda-date span { font-size: 11px; color: var(--faint); text-transform: uppercase; }
.agenda-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1 1 140px; }
@media (max-width: 1000px) { .cal-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .cal-grid { display: none; } }

/* ---------- Notifications ---------- */
.notif { display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 12px; border-radius: 8px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.notif:hover { background: var(--raised); }
.notif .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: 0 0 8px; border: 1.5px solid var(--faint); }
.notif.unread .dot { background: var(--text); border-color: var(--text); }
.notif .body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif.unread .text { font-weight: 500; }
.section-label { font-size: 11px; color: var(--faint); margin: 12px 12px 4px; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
th { font-size: 11px; font-weight: 500; color: var(--faint); background: var(--side); }
tr:last-child td { border-bottom: 0; }
td code, .code { font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; font-size: 12px; letter-spacing: .04em; }
tr.revoked td { color: var(--faint); }
.actions { display: flex; gap: 4px; }

/* ---------- Settings ---------- */
.set-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.set-row:last-child { border-bottom: 0; }
.set-row .label { flex: 1 1 240px; display: flex; flex-direction: column; gap: 2px; }
.seg { display: inline-flex; gap: 2px; padding: 2px; background: var(--side); border: 1px solid var(--border); border-radius: 8px; }
.seg button { min-height: 28px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--raised); color: var(--text); font-weight: 500; }
.switch { width: 34px; height: 20px; border-radius: 10px; background: var(--raised); border: 1px solid var(--border-strong); position: relative; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--faint); }
h3 { margin: 0 0 4px; font-size: 13px; font-weight: 600; }

/* ---------- Login (pixel style lives only here and in the logo) ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.login-box { width: 100%; max-width: 880px; display: flex; flex-direction: column; gap: 24px; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.login-brand img { width: 64px; height: 64px; image-rendering: pixelated; border-radius: 8px; }
.pixel-title { font-family: 'Silkscreen', monospace; font-size: 28px; letter-spacing: .04em; margin: 0; font-weight: 400; }
.login-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.login-cards .card { display: flex; flex-direction: column; gap: 12px; }
.login-cards h2 { margin: 0; font-size: 14px; font-weight: 600; }
.proto { border-style: dashed; }
.proto .row .btn { flex: 1 1 auto; }
.consent { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); }

/* ---------- Translator-only view ---------- */
.tr-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--side);
}
.tr-head .logo { width: 24px; height: 24px; flex-basis: 24px; border-radius: 5px; }
.tr-head .who { display: flex; flex-direction: column; line-height: 1.25; }
.tr-head .who span { font-size: 12px; color: var(--muted); }
.tr-head .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  background: var(--raised); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 10px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
@media (max-width: 767px) { .toast { bottom: 90px; } }

/* ---------- Localization (live from Locvote) ---------- */
.loc-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.loc-card { display: flex; flex-direction: column; gap: 12px; }
.loc-head { display: flex; align-items: flex-start; gap: 12px; }
.loc-head h3 { margin: 0; font-size: 15px; }
.loc-head p { margin: 4px 0 0; font-size: 12px; }
.loc-pct { margin-left: auto; font-size: 20px; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.loc-bar { height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.loc-bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.loc-langs { display: flex; flex-wrap: wrap; gap: 6px; }
.loc-langs .tag { text-decoration: none; font-variant-numeric: tabular-nums; }
.loc-langs .tag:hover { color: var(--text); border-color: var(--border-strong); }
.loc-foot { display: flex; align-items: center; gap: 8px; }
.loc-foot .btn { margin-left: auto; text-decoration: none; }
.loc-note { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; max-width: 520px; }
.loc-note h3, .loc-note p { margin: 0; }
.loc-note .btn { text-decoration: none; }

/* ---------- Animation studio (iframe kept outside #app, laid over this slot) ---------- */
.anim-slot { height: calc(100vh - 112px); min-height: 480px; border: 1px solid var(--border); border-radius: 10px; }
.anim-frame { position: absolute; z-index: 5; border: 0; border-radius: 10px; background: var(--surf); }
@media (max-width: 760px) { .anim-slot { height: calc(100vh - 170px); } }

/* ---------- Steam reviews ---------- */
.steam-add { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin-bottom: 12px; }
.steam-add .field { flex: 1 1 320px; }
.steam-own { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); min-height: 34px; }
.steam-add + .notice, .steam-detail > .notice { margin: 0 0 12px; }
.steam-card h3 a { color: var(--text); text-decoration: none; }
.steam-card h3 a:hover { text-decoration: underline; }
.steam-card .loc-foot .btn { text-decoration: none; }
.steam-mix { background: #6b2a2a; }
.steam-mix span { background: #3f9a5a; }
.steam-detail { display: flex; flex-direction: column; gap: 12px; }
.steam-top { display: grid; gap: 12px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.steam-actions { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; }
.steam-actions .btn { text-decoration: none; }
.steam-grid { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.steam-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.steam-grid h3 { margin: 0 0 10px; font-size: 13px; }
.steam-rows { display: flex; flex-direction: column; gap: 6px; }
.steam-row { display: grid; grid-template-columns: 96px 1fr 76px; align-items: center; gap: 8px; font-size: 12px; }
.steam-label { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steam-track { height: 10px; border-radius: 5px; background: var(--raised); overflow: hidden; }
.steam-fill { display: block; height: 100%; background: #8a3434; border-radius: 5px; overflow: hidden; }
.steam-up { display: block; height: 100%; background: #3f9a5a; }
.steam-num { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.steam-reviews { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; max-height: 560px; overflow-y: auto; }
.steam-review { border-left: 3px solid #3f9a5a; padding: 2px 0 2px 10px; }
.steam-review.down { border-left-color: #b04040; }
.steam-review p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 1000px) { .steam-grid, .steam-grid.two, .steam-top { grid-template-columns: 1fr; } }

.steam-ai-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 8px; }
.steam-ai-head h3 { margin: 0; font-size: 14px; }
.steam-summary { margin: 0 0 14px; font-size: 14px; line-height: 1.55; }
.steam-ai h4 { margin: 0 0 10px; font-size: 12px; color: var(--muted); font-weight: 500; }
.steam-stack { display: flex; height: 100%; border-radius: 5px; overflow: hidden; }
.steam-stack .pos { background: #3f9a5a; }
.steam-stack .mixed { background: #a08a3a; }
.steam-stack .neg { background: #b04040; }
.steam-themes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.steam-themes li { display: flex; gap: 10px; align-items: baseline; font-size: 13px; }
.steam-theme-n { min-width: 28px; text-align: right; font-variant-numeric: tabular-nums; color: var(--accent-text); font-weight: 600; }

/* ---------- Community inbox (community.js) ---------- */
.cm { display: flex; flex-direction: column; gap: 12px; }
.cm h3 { margin: 0 0 8px; font-size: 14px; }
.cm-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; overflow-y: hidden; }
.cm-tabs a {
  padding: 8px 12px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent;
  white-space: nowrap; margin-bottom: -1px;
}
.cm-tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 500; }
.cm-tabs a:hover { color: var(--text); }
.cm-tabs .cm-soon span { font-size: 10px; color: var(--faint); }
.cm-badge {
  display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent);
  color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums;
}
.cm-warn { border-color: var(--accent); color: var(--accent-text); }

.cm-split {
  display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 12px;
  align-items: start; min-height: 60vh;
}
.cm-listpane, .cm-threadpane {
  background: var(--surf); border: 1px solid var(--border); border-radius: 10px; min-width: 0;
}
.cm-listpane { display: flex; flex-direction: column; max-height: calc(100vh - 170px); overflow: hidden; }
.cm-threadpane { display: flex; flex-direction: column; max-height: calc(100vh - 170px); }
.cm-pick { align-items: center; justify-content: center; min-height: 40vh; }

.cm-filters { padding: 10px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.cm-seg { display: flex; flex-wrap: wrap; }
.cm-seg button { padding: 0 8px; font-size: 12px; }
.cm-filter-row { display: flex; flex-wrap: wrap; gap: 6px; }
.cm-filter-row .select { flex: 1 1 0; min-width: 0; font-size: 12px; min-height: 30px; }
.cm-search { flex: 1 1 100%; min-width: 0; }
.cm-search .input { width: 100%; min-height: 30px; font-size: 12px; }

.cm-list { overflow-y: auto; }
.cm-row {
  display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border);
  color: var(--text); text-decoration: none; position: relative;
}
.cm-row:hover { background: var(--raised); }
.cm-row.active { background: var(--hover); }
.cm-row.unread::before {
  content: ""; position: absolute; left: 4px; top: 16px; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent-text);
}
.cm-row.unread strong { font-weight: 600; }
.cm-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cm-row-top { display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.cm-row-top strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-ctx { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.cm-time { margin-left: auto; white-space: nowrap; font-size: 11px; }
.cm-row-text {
  color: var(--muted); font-size: 12px; overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word;
}
.cm-row-meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 11px; }
.cm-row-meta .faint { display: inline-flex; align-items: center; gap: 2px; }
.cm-mini { width: 18px; height: 18px; flex-basis: 18px; margin-left: auto; }
.cm-empty { padding: 24px 16px; margin: 0; text-align: center; }
.cm-more { margin: 10px auto; }

.cm-plat {
  flex: 0 0 26px; width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 600; color: #fff; background: #55555d;
}
.cm-p-discord { background: #5865F2; }
.cm-p-youtube { background: #E62117; }
.cm-p-instagram { background: linear-gradient(45deg, #F58529, #DD2A7B 55%, #8134AF); }
.cm-p-x { background: #000; border: 1px solid #333; }
.cm-p-tiktok { background: #111; box-shadow: inset -2px 0 #25F4EE, inset 2px 0 #FE2C55; }
.cm-p-reddit { background: #FF4500; }
.cm-p-steam { background: #1B2838; }
.cm-p-email { background: #3f7f6a; }

.cm-tag {
  display: inline-flex; align-items: center; font-size: 11px; padding: 0 6px; border-radius: 4px;
  border: 1px solid var(--border); color: var(--muted); line-height: 18px; white-space: nowrap; background: transparent;
}
.cm-urgent { border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.cm-t-bug { color: #e0736b; }
.cm-t-request { color: #6aa6e6; }
.cm-t-question { color: #c9a94c; }
.cm-t-praise { color: #63b37a; }
.cm-t-complaint { color: #d9894a; }
.cm-t-business { color: #b083e0; }
[data-theme="light"] .cm-t-bug { color: #b3372e; }
[data-theme="light"] .cm-t-request { color: #2465a8; }
[data-theme="light"] .cm-t-question { color: #8a6d12; }
[data-theme="light"] .cm-t-praise { color: #2e7d46; }
[data-theme="light"] .cm-t-complaint { color: #a2531a; }
[data-theme="light"] .cm-t-business { color: #7340ad; }

.cm-thread-head {
  display: flex; align-items: center; gap: 10px; padding: 12px; border-bottom: 1px solid var(--border);
}
.cm-av { width: 32px; height: 32px; border-radius: 50%; }
.cm-thread-head .avatar { width: 32px; height: 32px; flex-basis: 32px; font-size: 13px; }
.cm-who { display: flex; flex-direction: column; min-width: 0; }
.cm-who .faint { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-head-right { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.cm-head-right .btn, .cm-send-row .btn { text-decoration: none; }
.cm-back { display: none; }

.cm-controls {
  display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.cm-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.cm-inline .select { min-height: 28px; font-size: 12px; }
.cm-tagpick { display: flex; flex-wrap: wrap; gap: 4px; }
.cm-tagpick .cm-tag { cursor: pointer; opacity: .55; }
.cm-tagpick .cm-tag.on { opacity: 1; border-color: currentColor; }
.cm-tagpick .cm-tag:hover { opacity: 1; }

.cm-msgs { flex: 1 1 auto; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.cm-msg {
  max-width: 85%; padding: 8px 10px; border-radius: 10px; background: var(--raised);
  border: 1px solid var(--border); align-self: flex-start;
}
.cm-msg.out {
  align-self: flex-end; background: color-mix(in srgb, var(--accent) 14%, var(--surf));
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}
.cm-msg-head { display: flex; gap: 8px; align-items: baseline; font-size: 12px; margin-bottom: 2px; }
.cm-msg-head a { display: inline-flex; }
.cm-msg-text { white-space: pre-wrap; word-break: break-word; font-size: 13px; }
.cm-msg-tr {
  margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border-strong);
  white-space: pre-wrap; word-break: break-word; color: var(--muted); font-size: 13px;
}
.cm-msg-tr > span { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); }

.cm-compose { border-top: 1px solid var(--border); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.cm-compose textarea { width: 100%; font: inherit; }
.cm-compose-meta { display: flex; gap: 10px; font-size: 12px; align-items: baseline; }
.cm-meaning { color: var(--muted); }
.cm-ai-row, .cm-send-row { display: flex; gap: 6px; flex-wrap: wrap; }
.cm-ai-row .input { flex: 1 1 220px; min-width: 0; }
.cm-draftby { margin: 0; font-size: 12px; }

.cm-manual { display: flex; flex-direction: column; gap: 10px; }
.cm-manual p { margin: 0; }
.cm-manual .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.cm-manual .row > .field { flex: 1 1 160px; }

.cm-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; align-items: start; }
.cm-settings form { display: flex; flex-direction: column; gap: 10px; }
.cm-settings p { margin: 0 0 8px; }
.cm-steps { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
.cm-server { margin-top: 12px; }
.cm-server h4 { margin: 0 0 6px; font-size: 13px; }
.cm-chan { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.cm-chan .cm-plat { flex-basis: 20px; width: 20px; height: 20px; font-size: 10px; border-radius: 5px; }
.cm-chan > .btn, .cm-chan-actions { margin-left: auto; display: flex; gap: 4px; }

@media (max-width: 1000px) {
  .cm-split { grid-template-columns: minmax(0, 1fr); }
  .cm-split.has-thread .cm-listpane, .cm-split:not(.has-thread) .cm-threadpane { display: none; }
  .cm-listpane, .cm-threadpane { max-height: none; }
  .cm-back { display: inline-flex; }
  .cm-msg { max-width: 100%; }
}

/* ---------- Post planner, approvals, notifications (planner.js) ---------- */
.pl-group h3 { margin: 4px 0 8px; font-size: 13px; color: var(--muted); font-weight: 500; }
.pl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.pl-card {
  display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 10px;
  background: var(--surf); border: 1px solid var(--border); color: var(--text); text-decoration: none;
}
.pl-card:hover { border-color: var(--border-strong); }
.pl-card-top { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; }
.pl-card-top .faint { white-space: nowrap; font-size: 12px; }
.pl-card-top a { color: var(--text); }
.pl-card-text {
  color: var(--muted); font-size: 12px; overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word;
}
.pl-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 11px; }
.pl-author { margin-left: auto; }
.pl-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 2px; border-radius: 12px;
  border: 1px solid var(--border); color: var(--muted);
}
.pl-chip .cm-plat, .pl-plat .cm-plat { flex-basis: 18px; width: 18px; height: 18px; font-size: 10px; border-radius: 5px; }
.pl-chip.pl-published, .pl-chip.pl-done { border-color: #3f9a5a; color: #63b37a; }
.pl-chip.pl-manual { border-color: #a08a3a; color: #c9a94c; }
.pl-chip.pl-failed { border-color: var(--accent); color: var(--accent-text); }
.pl-note { font-size: 12px; color: var(--accent-text); }

.pl-editor { display: flex; flex-direction: column; gap: 12px; max-width: 1100px; }
.pl-editor > p { margin: 0; }
.pl-main { display: flex; flex-direction: column; gap: 10px; }
.pl-main p { margin: 0; }
.pl-main .row { display: flex; gap: 10px; flex-wrap: wrap; }
.pl-main .row > .field { flex: 1 1 220px; }
.pl-main textarea, .pl-target textarea { width: 100%; font: inherit; }
.pl-plat-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 10px; }
.pl-plat-head h3 { margin: 0 auto 0 0; }
.pl-targets { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.pl-target {
  display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surf); min-width: 0;
}
.pl-target.off { opacity: .65; }
.pl-plat { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; cursor: default; }
label.pl-plat { cursor: pointer; }
.pl-plat .faint { font-size: 12px; }
.pl-status { margin-left: auto; font-size: 11px; color: var(--muted); }
.pl-target.pl-published .pl-status, .pl-target.pl-done .pl-status { color: #63b37a; }
.pl-target.pl-manual .pl-status { color: #c9a94c; }
.pl-target.pl-failed .pl-status { color: var(--accent-text); }
.pl-count { font-size: 11px; align-self: flex-end; }
.pl-text { white-space: pre-wrap; word-break: break-word; font-size: 13px; }
.pl-target-actions, .pl-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pl-target-actions .btn { text-decoration: none; }
.pl-right { margin-left: auto; }
.pl-approval { display: flex; flex-direction: column; gap: 10px; }
.pl-approval p { margin: 0; }
.pl-notifs a.notif { text-decoration: none; color: var(--text); display: flex; }
.pl-device { margin-top: 24px; }
.cm-bb { position: absolute; top: 4px; margin-left: 22px; }
.bottombar a { position: relative; }

/* ---------- Community overview ---------- */
.cm-daypick { align-self: flex-start; }
.cm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.cm-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px; }
.cm-stat strong { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cm-stat .faint { font-size: 12px; }
.cm-h { margin: 6px 0 0; font-size: 13px; color: var(--muted); font-weight: 500; }
.cm-pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.cm-pcard { display: flex; flex-direction: column; gap: 10px; }
.cm-pcard p { margin: 0; font-size: 12px; }
.cm-pcard-head { display: flex; align-items: center; gap: 8px; }
.cm-pcard-head .btn { margin-left: auto; }
.cm-pnums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cm-pnums div { display: flex; flex-direction: column; }
.cm-pnums strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.cm-pnums .faint { font-size: 11px; }
.cm-sent { display: block; height: 8px; border-radius: 5px; background: var(--raised); overflow: hidden; }
.cm-neutral { background: var(--border-strong); }
.cm-pleg { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.cm-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.cm-dot.pos { background: #3f9a5a; }
.cm-dot.neg { background: #b04040; margin-left: 10px; }
.cm-two { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 10px; align-items: start; }
.cm-days { display: flex; align-items: flex-end; gap: 3px; height: 140px; overflow-x: auto; }
.cm-day { flex: 1 0 14px; max-width: 40px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.cm-day .faint { font-size: 9px; white-space: nowrap; }
.cm-day-bar { width: 100%; display: flex; flex-direction: column; border-radius: 3px; overflow: hidden; min-height: 3px; }
.cm-day-bar .pos { background: #3f9a5a; }
.cm-day-bar .neg { background: #b04040; }
@media (max-width: 1000px) { .cm-two { grid-template-columns: minmax(0, 1fr); } }
.steam-rows .cm-neutral { background: var(--faint); }

/* ---------- Steam comparison ---------- */
.steam-cmp-wrap { overflow-x: auto; padding: 8px 12px; }
.steam-cmp { width: 100%; border-collapse: collapse; font-size: 13px; }
.steam-cmp th, .steam-cmp td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.steam-cmp th { font-weight: 600; }
.steam-cmp th a { color: var(--text); }
.steam-cmp td:first-child { color: var(--muted); }
.steam-cmp tr:last-child td { border-bottom: 0; }
.steam-cmp .faint { font-size: 11px; }
.steam-cmp-pct { font-weight: 600; font-variant-numeric: tabular-nums; }
.steam-cmp-pct.good { color: #63b37a; }
.steam-cmp-pct.mid { color: #c9a94c; }
.steam-cmp-pct.bad { color: var(--accent-text); }
.steam-cmp-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.steam-cmp-lists h4 { margin: 0 0 8px; font-size: 12px; color: var(--muted); font-weight: 500; }
