:root {
  --bg: #dae0e6;
  --page: #f6f7f8;
  --surface: #ffffff;
  --surface-soft: #f7f9fa;
  --hover: #f2f4f5;
  --line: #ccd3d9;
  --line-strong: #aeb8c1;
  --text: #1c1c1c;
  --muted: #57636e;
  --soft: #7b8790;
  --brand: #1d6559;
  --brand-dark: #174d45;
  --brand-soft: #e7f2ef;
  --orange: #d85f18;
  --blue: #2a6f97;
  --amber: #9a6218;
  --red: #a23d3d;
  --shadow: 0 1px 2px rgba(28, 28, 28, 0.08), 0 8px 20px rgba(39, 51, 60, 0.05);
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #eef2f4 0, var(--bg) 160px),
    var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 56px;
  display: grid;
  grid-template-columns: 220px minmax(240px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #c3ccd3;
  box-shadow: 0 1px 2px rgba(28, 28, 28, 0.08);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #257766, #174d45);
  color: #fff;
  font-weight: 850;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.brand-text strong {
  display: block;
  font-size: 17px;
  line-height: 1.1;
}

.brand-text span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.1;
}

.global-search {
  position: relative;
}

.global-search input {
  width: 100%;
  height: 38px;
  border: 1px solid #c6d0d6;
  border-radius: 999px;
  background: #f9fbfc;
  color: var(--text);
  padding: 0 16px 0 40px;
  outline: none;
}

.global-search input:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(42, 111, 151, 0.1);
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--soft);
  font-size: 15px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.user-chip {
  max-width: 168px;
  overflow: hidden;
}

.user-chip .user-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: #26323a;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}

.btn:hover {
  border-color: #8e9ba5;
  background: var(--hover);
}

.btn.primary {
  border-color: var(--brand-dark);
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.btn.primary:hover {
  background: var(--brand-dark);
}

.btn.flat {
  border-color: transparent;
  background: transparent;
}

.btn.small {
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.layout {
  width: min(1240px, calc(100% - 28px));
  margin: 18px auto 44px;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 312px;
  gap: 14px;
  align-items: start;
}

.left-rail,
.right-rail {
  position: sticky;
  top: 68px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rail-section,
.side-card,
.submit-box,
.sort-bar,
.post,
.news-view,
.community-header {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.rail-section {
  overflow: hidden;
}

.rail-title {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.community-list {
  display: flex;
  flex-direction: column;
  padding: 6px;
}

.community-btn {
  min-height: 34px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #28343c;
  text-align: left;
}

.community-btn:hover,
.community-btn.active {
  background: #edf2f4;
  color: var(--brand-dark);
  font-weight: 750;
}

.community-name {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.community-dot {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #e5efed;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  flex: 0 0 auto;
}

.community-count {
  color: var(--soft);
  font-size: 11px;
  font-weight: 650;
}

.mobile-communities {
  display: none;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.mobile-communities button {
  flex: 0 0 auto;
}

.feed-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.community-header {
  overflow: hidden;
}

.community-cover {
  min-height: 112px;
  padding: 16px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(29, 101, 89, 0.94), rgba(47, 91, 111, 0.92)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 13px);
}

.community-id {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.community-avatar {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  background: #fff;
  color: var(--brand-dark);
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(16, 29, 35, 0.22);
  flex: 0 0 auto;
}

.community-heading {
  min-width: 0;
}

.community-heading h1 {
  margin: 0;
  color: #fff;
  font-size: 27px;
  line-height: 1.05;
  font-weight: 850;
}

.community-heading p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 13px;
  line-height: 1.35;
}

.community-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.community-pill {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  padding: 0 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 780;
  backdrop-filter: blur(8px);
}

.community-tabs {
  min-height: 44px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  background: #fff;
}

.community-tab {
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0 11px;
  font-size: 13px;
  font-weight: 800;
}

.community-tab.active,
.community-tab:hover {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.submit-box {
  padding: 10px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #dfe8e6;
  color: var(--brand-dark);
  font-weight: 800;
}

.quick-input {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f6f7f8;
  color: var(--muted);
  padding: 0 14px;
  display: flex;
  align-items: center;
}

.sort-bar {
  min-height: 48px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sort-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.sort-tab {
  border: 0;
  border-radius: 999px;
  min-height: 32px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 760;
}

.sort-tab:hover,
.sort-tab.active {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.news-view {
  overflow: hidden;
  border-color: #c7d0d6;
}

.news-toolbar {
  min-height: 54px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.news-toolbar h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}

.news-meta {
  margin-top: 3px;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.35;
}

.news-list {
  display: grid;
  background: #fff;
}

.news-item {
  padding: 13px 14px;
  border-top: 1px solid var(--line);
}

.news-item:first-child {
  border-top: 0;
}

.news-item:hover {
  background: #fbfcfd;
}

.news-item-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.35;
}

.news-item h3 {
  margin: 7px 0 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.38;
}

.news-item p {
  margin: 8px 0 0;
  color: #354148;
  font-size: 13px;
  line-height: 1.58;
}

.news-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.filter-select {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0 10px;
  color: var(--muted);
  outline: none;
}

.post {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  overflow: hidden;
  border-color: #c7d0d6;
}

.post:hover {
  border-color: #8fa1ab;
  box-shadow: 0 1px 2px rgba(28, 28, 28, 0.1), 0 10px 24px rgba(28, 43, 52, 0.08);
}

.vote-column {
  background: linear-gradient(180deg, #fbfcfd, #eef3f5);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 9px 0;
  gap: 4px;
}

.vote-button {
  width: 48px;
  min-height: 34px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #8b969e;
  font-size: 13px;
  line-height: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.vote-button:hover {
  background: #e9eef1;
  color: var(--orange);
}

.vote-button span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
}

.score {
  color: #30363a;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.score-label {
  color: var(--soft);
  font-size: 10px;
  font-weight: 720;
}

.post-content {
  min-width: 0;
  padding: 10px 12px 11px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.35;
}

.community-link {
  color: var(--brand-dark);
  font-weight: 800;
}

.author-handle {
  color: #244f68;
  font-weight: 820;
}

.post-body.body-large {
  font-size: 15.5px;
  line-height: 1.64;
  white-space: pre-wrap;
}

.flair {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 7px;
  background: #e9f3f0;
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 800;
}

.flair.blue {
  background: #eaf3f8;
  color: #225d7d;
}

.flair.amber {
  background: #fff3dc;
  color: #815216;
}

.flair.red {
  background: #fbe9e9;
  color: #8d3030;
}

.post-title {
  margin: 7px 0 0;
  color: var(--text);
  font-size: 18.5px;
  line-height: 1.35;
  font-weight: 760;
}

.post-body {
  margin: 9px 0 0;
  color: #2f3a40;
  font-size: 14px;
  line-height: 1.62;
  white-space: pre-wrap;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.post-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.post-image {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #eef2f4;
}

.linked-laws {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.law-card {
  border: 1px solid #cbd9df;
  border-radius: var(--radius);
  background: #f7fbfc;
  padding: 9px 10px;
}

.law-card strong {
  display: block;
  color: #21414e;
  font-size: 13px;
}

.law-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.law-card .law-version,
.law-row .law-version,
.law-chip .law-version {
  color: #6b7880;
  font-size: 11px;
  font-weight: 700;
}

.law-card a {
  display: inline-flex;
  margin-top: 6px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.tag {
  min-height: 21px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #d5dde1;
  border-radius: 999px;
  padding: 0 7px;
  color: #52616a;
  background: #f7f9fa;
  font-size: 11px;
}

.answers {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.answer {
  border-left: 3px solid #d5dde1;
  padding: 3px 0 3px 10px;
}

.answer.accepted {
  border-left-color: var(--brand);
  background: linear-gradient(90deg, rgba(29, 101, 89, 0.1), transparent 74%);
}

.answer p {
  margin: 5px 0 0;
  color: #303b41;
  font-size: 13px;
  line-height: 1.55;
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.action-btn {
  min-height: 28px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 760;
}

.action-btn:hover {
  background: #edf2f4;
  color: var(--brand-dark);
}

.comment-form {
  display: none;
  margin-top: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f9fa;
  padding: 9px;
  gap: 8px;
}

.comment-form.open {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.comment-form textarea,
.composer textarea,
.composer input,
.composer select,
.auth-form input,
.auth-form select,
.chat-form textarea,
.newsletter-form input,
.newsletter-form select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  outline: none;
}

.comment-form textarea,
.composer textarea,
.chat-form textarea {
  min-height: 72px;
  resize: vertical;
  padding: 9px 10px;
  line-height: 1.5;
}

.composer input,
.composer select,
.auth-form input,
.auth-form select,
.newsletter-form input,
.newsletter-form select {
  height: 38px;
  padding: 0 10px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(42, 111, 151, 0.1);
}

.side-card {
  overflow: hidden;
  border-color: #c7d0d6;
}

.side-hero {
  height: 92px;
  background:
    linear-gradient(135deg, rgba(216, 95, 24, 0.86), rgba(29, 101, 89, 0.92)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.14) 0 1px, transparent 1px 14px);
  display: flex;
  align-items: flex-end;
  padding: 12px;
  color: #fff;
}

.side-hero strong {
  font-size: 19px;
  line-height: 1;
}

.side-body {
  padding: 12px;
}

.side-body h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
}

.side-body p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.side-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.side-stat strong {
  display: block;
  color: var(--text);
  font-size: 18px;
}

.side-stat span {
  color: var(--soft);
  font-size: 12px;
}

.rules,
.resource-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
}

.rules li,
.resource-list li {
  border-top: 1px solid var(--line);
  padding: 9px 0;
  color: #334148;
  font-size: 13px;
  line-height: 1.45;
}

.rules li:first-child,
.resource-list li:first-child {
  border-top: 0;
}

.resource-list button {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  color: #334148;
  text-align: left;
  line-height: 1.45;
}

.resource-list button:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

.newsletter-form {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.composer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 78px 18px 28px;
  background: rgba(26, 32, 36, 0.52);
  overflow: hidden;
}

.composer-backdrop.open {
  display: flex;
}

.composer {
  width: min(760px, 100%);
  max-height: calc(100dvh - 106px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 18px 46px rgba(20, 28, 34, 0.28);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.composer-head {
  min-height: 54px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: #f7f9fa;
}

.composer-head h2 {
  margin: 0;
  font-size: 17px;
}

.composer-form {
  padding: 14px;
  display: grid;
  gap: 11px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 78px 18px 28px;
  background: rgba(26, 32, 36, 0.52);
  overflow: hidden;
}

.modal-backdrop.open {
  display: flex;
}

.auth-modal,
.chat-modal {
  width: min(520px, 100%);
  max-height: calc(100dvh - 106px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 18px 46px rgba(20, 28, 34, 0.28);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chat-modal {
  width: min(860px, 100%);
}

.modal-head {
  min-height: 54px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: #f7f9fa;
}

.modal-head h2 {
  margin: 0;
  font-size: 17px;
}

.auth-form {
  padding: 14px;
  display: grid;
  gap: 11px;
  overflow-y: auto;
}

.auth-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-shell {
  min-height: 0;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  flex: 1;
}

.conversation-list {
  border-right: 1px solid var(--line);
  background: #f7f9fa;
  overflow-y: auto;
}

.conversation-item {
  width: 100%;
  min-height: 62px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 10px 12px;
  text-align: left;
  display: grid;
  gap: 4px;
}

.conversation-item:hover,
.conversation-item.active {
  background: #eaf2f0;
}

.conversation-item strong {
  color: #26343b;
  font-size: 13px;
}

.conversation-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.chat-main {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.chat-thread-meta {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.chat-messages {
  min-height: 260px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(247, 249, 250, 0.7), #fff 130px),
    #fff;
}

.message {
  max-width: 78%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f9fa;
  padding: 8px 10px;
  align-self: flex-start;
}

.message.me {
  border-color: #b8d0c9;
  background: #e9f5f1;
  align-self: flex-end;
}

.message strong {
  display: block;
  color: #29363d;
  font-size: 12px;
}

.message p {
  margin: 5px 0 0;
  color: #26343b;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.message span {
  display: block;
  margin-top: 5px;
  color: var(--soft);
  font-size: 11px;
}

.chat-form {
  padding: 10px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  background: #f7f9fa;
}

.attachment-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f9fa;
  padding: 11px;
  display: grid;
  gap: 10px;
}

.attachment-title {
  margin: 0;
  color: #27343b;
  font-size: 13px;
  font-weight: 850;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 8px;
}

.image-preview {
  position: relative;
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #eef2f4;
}

.image-preview img {
  width: 100%;
  height: 100%;
  min-height: 86px;
  object-fit: cover;
  display: block;
}

.image-preview span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 5px 6px;
  background: rgba(16, 26, 32, 0.72);
  color: #fff;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.law-picker {
  display: grid;
  gap: 8px;
}

.law-results,
.selected-laws {
  display: grid;
  gap: 7px;
}

.law-row,
.law-chip {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 8px 9px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.law-row strong,
.law-chip strong {
  display: block;
  color: #26343b;
  font-size: 13px;
}

.law-row span,
.law-chip span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.composer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  padding: 28px;
  color: var(--muted);
  text-align: center;
  line-height: 1.55;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 70;
  display: none;
  border: 1px solid #9fc3b9;
  border-radius: var(--radius);
  background: #f2fbf8;
  color: #1b584f;
  padding: 12px 14px;
  box-shadow: 0 8px 24px rgba(20, 28, 34, 0.14);
  font-size: 13px;
}

.toast.show {
  display: block;
}

@media (max-width: 1120px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 302px;
  }

  .left-rail {
    display: none;
  }

  .mobile-communities {
    display: flex;
  }
}

@media (max-width: 860px) {
  .topbar {
    height: auto;
    min-height: 56px;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 9px 12px;
  }

  .global-search {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .brand-text span {
    display: none;
  }

  .layout {
    width: min(100% - 18px, 720px);
    grid-template-columns: 1fr;
    margin-top: 10px;
  }

  .right-rail {
    position: static;
    grid-row: auto;
  }

  .chat-shell {
    grid-template-columns: 1fr;
  }

  .conversation-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    overflow-x: auto;
  }

  .conversation-item {
    min-width: 172px;
    border-right: 1px solid var(--line);
  }
}

@media (max-width: 560px) {
  .top-actions .btn.secondary {
    display: none;
  }

  .top-actions {
    gap: 5px;
  }

  .top-actions .btn {
    padding: 0 9px;
    font-size: 12px;
  }

  .user-chip .user-name {
    display: none;
  }

  .layout {
    width: 100%;
    margin-top: 0;
  }

  .feed-column {
    gap: 8px;
  }

  .submit-box,
  .sort-bar,
  .post,
  .news-view,
  .side-card,
  .rail-section,
  .community-header {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  .submit-box {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .submit-box .btn {
    grid-column: 1 / -1;
    border-radius: 4px;
  }

  .sort-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .news-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .post {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .vote-button {
    width: 44px;
  }

  .post-content {
    padding: 10px 10px 11px;
  }

  .post-title {
    font-size: 16px;
  }

  .community-cover {
    min-height: 126px;
    align-items: flex-start;
    flex-direction: column;
  }

  .community-heading h1 {
    font-size: 23px;
  }

  .community-pills {
    justify-content: flex-start;
  }

  .comment-form.open {
    grid-template-columns: 1fr;
  }

  .composer-grid {
    grid-template-columns: 1fr;
  }

  .composer-backdrop,
  .modal-backdrop {
    padding: 64px 0 0;
  }

  .composer,
  .auth-modal,
  .chat-modal {
    max-height: calc(100dvh - 64px);
    border-right: 0;
    border-left: 0;
    border-bottom: 0;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }
}
