:root {
  --ink: #0b1f3a;
  --bar: #2b7bff;
  --muted: #61758d;
  --line: #d7e3f4;
  --accent: #0b63f6;
  --wash: #eaf2ff;
  --page: #fff;
  --radius: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--page); color: var(--ink); font-family: "Segoe UI", Helvetica, Arial, sans-serif; }
a { color: var(--accent); }
img { max-width: 100%; }
.top {
  background: var(--bar);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 56px;
}
.brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; min-height: 44px; }
.brand a { color: inherit; text-decoration: none; }
.logo-plate { background: #fff; border-radius: 6px; padding: 3px 7px; display: flex; align-items: center; }
.logo-plate img { height: 28px; width: auto; display: block; }
.word { font-weight: 700; font-size: 0.95rem; white-space: nowrap; }
.top-search { flex: 1; display: flex; }
.top-search input, .phone-search input, .composer input, .composer textarea, .composer select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}
.top-search input { min-height: 40px; }
.signin, .account-btn {
  color: #fff;
  background: transparent;
  border: 0;
  min-height: 44px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.account { position: relative; }
.account-menu {
  position: absolute;
  right: 0;
  top: 100%;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 240px;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(11, 31, 58, 0.12);
}
.account-menu a, .account-menu button.linkish {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  color: var(--ink);
  text-decoration: none;
  padding: 8px;
  font: inherit;
  cursor: pointer;
}
.account-menu a:hover, .account-menu button.linkish:hover { background: var(--wash); }
.count { background: #fff; color: var(--accent); border-radius: 99px; padding: 0 6px; font-size: 0.75rem; font-weight: 800; }
.shell { display: flex; align-items: flex-start; }
.rail {
  width: 270px;
  flex: 0 0 270px;
  border-right: 1px solid var(--line);
  max-height: calc(100vh - 56px);
  overflow: auto;
  position: sticky;
  top: 56px;
  padding: 12px;
}
.rail-label { color: var(--muted); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; margin: 12px 4px 6px; }
.room { display: flex; gap: 10px; text-decoration: none; color: inherit; padding: 8px; border-radius: var(--radius); }
.room.on, .room:hover { background: var(--wash); }
.mark { width: 28px; height: 28px; border-radius: 6px; background: var(--wash); color: var(--accent); display: grid; place-items: center; font-weight: 800; flex: 0 0 auto; }
.room-name { font-weight: 800; display: flex; align-items: center; gap: 6px; }
.room-sub { display: block; color: var(--muted); font-size: 0.82rem; line-height: 1.35; }
.main { flex: 1; min-width: 0; padding: 18px 22px 48px; }
.phone-search { display: none; margin-bottom: 12px; }
.phone-rooms { display: none; }
.lede, .muted, .meta, .excerpt, .room-sub { color: var(--muted); }
.board-head, .thread-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 8px; }
h2 { font-size: 1.1rem; margin: 22px 0 8px; }
.btn {
  background: var(--bar);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  min-height: 40px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.oauth { display: grid; gap: 8px; margin: 12px 0; }
.oauth-btn { background: #fff; color: var(--ink); border: 1px solid var(--line); justify-content: center; }
.board { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.row:last-child { border-bottom: 0; }
.row-title { font-weight: 650; display: block; }
.row.unread .row-title { font-weight: 800; }
.excerpt { display: block; font-size: 0.92rem; margin-top: 2px; }
.meta { font-size: 0.82rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; flex: 0 0 auto; margin-top: 6px; }
.dot.off { background: transparent; }
.pinned { background: #f5f9ff; }
.pill { display: inline-block; background: var(--wash); color: var(--accent); border-radius: 99px; padding: 0 8px; font-size: 0.75rem; font-weight: 800; }
.pill.pin { background: #fff6df; color: #8a5a00; }
.filemark { margin-left: auto; color: var(--muted); font-size: 0.75rem; font-weight: 800; border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; }
.page { min-width: 36px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; color: var(--ink); padding: 0 8px; }
.page.on { background: var(--wash); color: var(--accent); font-weight: 800; }
.page.off { color: var(--muted); }
.post { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.post-h { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.who { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 800; }
.avatar, .avatar.sm { width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--wash); color: var(--accent); display: inline-grid; place-items: center; font-weight: 800; object-fit: cover; }
.rank, .edited { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.body { font-size: 1.05rem; line-height: 1.6; margin: 8px 0; }
.signature { color: var(--muted); font-size: 0.9rem; border-top: 1px solid var(--line); margin: 8px 0 0; padding-top: 6px; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.quote { border-left: 3px solid var(--accent); margin: 8px 0; padding: 6px 10px; background: var(--wash); color: var(--ink); }
.quote span { display: block; font-weight: 800; font-size: 0.85rem; }
.actions, .composer-row, .desk-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.textbtn { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 6px 0; min-height: 44px; text-decoration: none; }
.inline { display: inline; }
.composer { display: grid; gap: 8px; padding: 12px 0; }
.composer textarea { min-height: 120px; }
.field-error { color: #9b2c2c; margin: 0; }
input.bad, textarea.bad { outline: 2px solid var(--accent); }
.ok { color: #0b6b3a; }
.warn { background: #fff6df; padding: 8px 10px; border-radius: var(--radius); }
.files { display: grid; gap: 8px; }
.shot img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
.file { display: flex; gap: 10px; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; text-decoration: none; color: var(--ink); }
.report { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; display: grid; gap: 6px; }
.mention-list { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.mention-list button { display: block; width: 100%; text-align: left; background: #fff; border: 0; padding: 8px 10px; font: inherit; cursor: pointer; }
.profile-h { display: flex; align-items: center; gap: 10px; }
.inbox { display: grid; grid-template-columns: 280px 1fr; border: 1px solid var(--line); border-radius: var(--radius); min-height: 420px; }
.inbox-list { border-right: 1px solid var(--line); }
.inbox-pane { padding: 12px; }
.bubble { background: var(--wash); border-radius: var(--radius); padding: 8px 10px; margin: 0 0 8px; white-space: pre-wrap; }
.bubble.mine { background: #f4f7fb; }
.desk-card { border-bottom: 1px solid var(--line); padding: 10px 0; }
.empty { padding: 16px; }
.back { margin: 0 0 8px; }
.follow-note { background: var(--wash); padding: 8px 10px; border-radius: var(--radius); }
.lightbox { position: fixed; inset: 0; background: rgba(8, 18, 32, 0.82); display: grid; place-items: center; z-index: 20; padding: 16px; }
.lightbox img { max-width: min(1100px, 100%); max-height: 90vh; background: #fff; }
.check { display: flex; gap: 8px; align-items: center; }
@media (max-width: 899px) {
  .top-search, .rail { display: none; }
  .phone-search { display: block; }
  .phone-search input { min-height: 48px; }
  .main { padding: 16px 16px 96px; }
  body.is-home .phone-rooms { display: block; }
  body.is-home .board, body.is-home .lede, body.is-home .follow-note, body.is-home .board-head { display: none; }
  body.is-home .phone-rooms .room { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; padding: 12px; }
  body.is-thread .reply-dock, body.is-thread #reply { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); z-index: 6; }
  body.is-compose .composer .btn { position: fixed; left: 16px; right: 16px; bottom: calc(8px + env(safe-area-inset-bottom)); }
  .inbox { grid-template-columns: 1fr; }
  .row { min-height: 48px; }
  .row-title { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
}
