:root {
  --bg: #f1f5f9;
  --panel: #ffffff;
  --panel-subtle: #f8fafc;
  --side: #0f172a;
  --side-hover: rgba(255, 255, 255, 0.07);
  --side-active: rgba(59, 130, 246, 0.22);
  --side-text: #cbd5e1;
  --primary: #2563eb;
  --primary-d: #1d4ed8;
  --primary-soft: #eff6ff;
  --danger: #dc2626;
  --warn: #d97706;
  --ok: #16a34a;
  --text: #0f172a;
  --text-secondary: #334155;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
}

body {
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
}

small, .muted {
  color: var(--muted);
}

/* Utilitário de acessibilidade canónico */
.visually-hidden {
  position: absolute;
  clip-path: inset(50%);
  overflow: hidden;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  white-space: nowrap;
}

/* Focus visível de alto contraste */
:focus-visible {
  outline: 2.5px solid var(--primary);
  outline-offset: 2px;
}

/* ============================ Layout Principal ============================ */

.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--side);
  color: var(--side-text);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 0;
  height: 100vh;
  border-inline-end: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-block-end: 6px;
}

.brand {
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.3px;
  padding: 4px 6px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand small {
  font-weight: 400;
  color: #94a3b8;
}

.brand.big {
  font-size: 26px;
  color: var(--side);
  justify-content: center;
  margin-block-end: 18px;
  display: flex;
}

.logo {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.compose-btn {
  width: 100%;
  justify-content: center;
  padding: 10px 16px;
  font-weight: 600;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.folders {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.folders a {
  color: var(--side-text);
  padding: 9px 12px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.folders a:hover {
  background: var(--side-hover);
  color: #fff;
}

.folders a.active {
  background: var(--side-active);
  color: #fff;
  font-weight: 600;
}

.nav-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.badge {
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 600;
}

.section-title {
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin: 14px 12px 2px;
  color: #64748b;
}

.quota {
  margin-block-start: auto;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.quota-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-block-end: 6px;
  color: #e2e8f0;
}

.quota small {
  color: #94a3b8;
  font-size: 12px;
}

.quota-bar {
  height: 6px;
  background: rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  overflow: hidden;
  margin-block-end: 6px;
}

.quota-bar span {
  display: block;
  height: 100%;
  width: var(--quota-pct, 0%);
  background: var(--ok);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.quota-bar span.warn {
  background: var(--warn);
}

.quota-bar span.danger {
  background: var(--danger);
}

.me {
  border-block-start: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 4px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.me-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  min-width: 0;
  flex: 1;
}

.me-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.me-info strong, .me-info small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.me-info small {
  color: #94a3b8;
  font-size: 12px;
}

.icon-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--side-text);
  padding: 7px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: var(--side-hover);
  color: #fff;
}

/* ============================ Workspace & Topbar ========================== */

.workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  background: var(--panel);
  border-block-end: 1px solid var(--border);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-search {
  flex: 1;
  max-width: 560px;
}

.search-form {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  inset-inline-start: 12px;
  color: var(--muted);
  pointer-events: none;
}

.search-form input[type="search"] {
  padding-inline-start: 36px;
  padding-inline-end: 32px;
  background: var(--panel-subtle);
  border-color: var(--border);
  border-radius: 999px;
  font-size: 14px;
  min-height: 38px;
}

.search-form input[type="search"]:focus {
  background: #fff;
}

.search-clear {
  position: absolute;
  inset-inline-end: 12px;
  color: var(--muted);
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.content {
  flex: 1;
  padding: 22px 28px 40px;
  min-width: 0;
  max-width: 1280px;
  width: 100%;
  margin-inline: auto;
}

.content.center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

/* =============================== Avatares ================================= */

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: hsl(var(--avatar-hue, 215) 75% 92%);
  color: hsl(var(--avatar-hue, 215) 70% 32%);
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  user-select: none;
}

.avatar.sm {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

/* ============================ Cartões & Botões ============================ */

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.card.narrow {
  max-width: 640px;
}

.card.no-pad {
  padding: 0;
  overflow-x: auto;
}

.login-card {
  width: 100%;
  max-width: 400px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.btn:hover {
  background: var(--panel-subtle);
  border-color: #94a3b8;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-d);
  border-color: var(--primary-d);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--panel-subtle);
  border-color: var(--border);
}

.btn-danger {
  color: var(--danger);
}

.btn-danger:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}

.btn-sm {
  padding: 5px 11px;
  font-size: 13px;
}

/* =============================== Formulários ============================== */

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 500;
  flex: 1;
}

label.check, .check-wrap {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.field-inline {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.field-inline label {
  color: var(--muted);
  font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
select,
textarea {
  font: inherit;
  font-size: max(0.92rem, 1em);
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  width: 100%;
  color: inherit;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

input:user-invalid,
textarea:user-invalid {
  border-color: var(--danger);
}

input:disabled {
  background: var(--panel-subtle);
  color: var(--muted);
}

textarea {
  resize: vertical;
  font-family: inherit;
}

.row {
  display: flex;
  gap: 14px;
}

.row[hidden] {
  display: none;
}

.row-end {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.input-group {
  display: flex;
  align-items: stretch;
}

.input-group input {
  border-start-end-radius: 0;
  border-end-end-radius: 0;
}

.input-group span {
  padding: 9px 12px;
  background: var(--panel-subtle);
  border: 1px solid var(--border-strong);
  border-inline-start: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--muted);
  font-weight: 400;
  white-space: nowrap;
}

.alert {
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  margin-block-end: 16px;
  border: 1px solid;
  font-weight: 500;
}

.alert-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.alert-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.alert-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

/* ==================== Lista de Conversas (Estilo Gmail) =================== */

.page-header,
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-block-end: 14px;
  flex-wrap: wrap;
}

.page-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.count-pill,
.folder-chip {
  background: #e2e8f0;
  color: var(--text-secondary);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.folder-chip {
  background: var(--primary-soft);
  color: var(--primary-d);
}

.mailbox-shell {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--panel-subtle);
  border-block-end: 1px solid var(--border);
  flex-wrap: wrap;
}

.action-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.thread-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.thread-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-inline: 16px;
  border-block-end: 1px solid var(--border);
  transition: background 0.1s ease;
}

.thread-row:last-child {
  border-block-end: 0;
}

.thread-row:hover {
  background: #f8fafc;
}

.thread-row.unread {
  background: #f0f6ff;
}

.thread-row.unread:hover {
  background: #e6f0ff;
}

.thread-check {
  display: flex;
  align-items: center;
}

.thread-link {
  flex: 1;
  display: grid;
  grid-template-columns: 36px 210px 1fr auto;
  align-items: center;
  gap: 14px;
  padding-block: 11px;
  color: var(--text);
  min-width: 0;
}

.thread-participants {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.participants-names {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
}

.thread-row.unread .participants-names,
.thread-row.unread .thread-subject,
.thread-row.unread .thread-date {
  font-weight: 700;
  color: var(--text);
}

.star-badge {
  color: #f59e0b;
  font-size: 15px;
  flex-shrink: 0;
}

.thread-count {
  background: #e2e8f0;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 6px;
  flex-shrink: 0;
}

.thread-content {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.thread-subject {
  color: var(--text);
}

.thread-snippet {
  color: var(--muted);
  font-weight: 400;
  margin-inline-start: 4px;
}

.thread-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.att-pill {
  background: var(--panel-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.thread-date {
  font-size: 12px;
  color: var(--muted);
}

.empty-state {
  text-align: center;
  padding: 64px 20px;
}

.empty-icon {
  color: #94a3b8;
  margin-block-end: 10px;
}

.empty-title {
  font-weight: 600;
  font-size: 16px;
  margin: 0 0 4px;
}

.pager {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin-block-start: 16px;
}

/* =================== Vista de Conversa (Thread Accordion) ================= */

.thread-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-block-end: 14px;
  flex-wrap: wrap;
}

.thread-topbar-left,
.thread-topbar-right,
.inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.thread-header {
  margin-block-end: 14px;
}

.thread-header h1 {
  font-size: 1.5rem;
  line-height: 1.3;
}

/* Mostrar apenas a etiqueta correspondente à ação do botão Expand/Collapse All */
[command="--toggle-all"][aria-expanded="true"] .expand,
[command="--toggle-all"][aria-expanded="false"] .collapse {
  display: none;
}

.toggle-all-btn {
  margin-block-end: 10px;
}

.thread-accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-block-end: 20px;
}

.thread-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.thread-item[open] {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.thread-summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s ease;
}

.thread-summary::-webkit-details-marker {
  display: none;
}

.thread-summary:hover {
  background: var(--panel-subtle);
}

.thread-summary::before {
  content: "▸";
  font-size: 14px;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.thread-item[open] > .thread-summary::before {
  transform: rotate(90deg);
}

.summary-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.summary-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sender-name {
  color: var(--text);
  font-size: 14px;
}

.sender-email {
  color: var(--muted);
  font-size: 12px;
}

.rcpt-badge {
  color: var(--muted);
  font-size: 12px;
  background: var(--panel-subtle);
  padding: 1px 8px;
  border-radius: 999px;
}

.summary-snippet {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Quando a mensagem está aberta, esconder o resumo truncado do cabeçalho */
.thread-item[open] > .thread-summary .summary-snippet {
  display: none;
}

.summary-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  font-size: 12px;
  color: var(--muted);
}

.thread-body-wrap {
  padding: 0 20px 20px;
  border-block-start: 1px solid var(--border);
}

.msg-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-block: 10px;
  border-block-end: 1px dashed var(--border);
  margin-block-end: 14px;
  flex-wrap: wrap;
}

.meta-disclosure {
  font-size: 12px;
}

.meta-trigger {
  color: var(--muted);
  cursor: pointer;
  padding: 4px 0;
}

.headers-grid {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 4px 12px;
  margin: 8px 0 0;
  padding: 10px 12px;
  background: var(--panel-subtle);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.headers-grid dt {
  color: var(--muted);
  font-weight: 600;
}

.headers-grid dd {
  margin: 0;
  word-break: break-word;
}

.msg-quick-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.attachments-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-block-end: 14px;
  align-items: center;
}

.att-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  background: var(--panel-subtle);
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.att-card:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.att-info {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.att-name {
  font-size: 13px;
}

.att-size {
  font-size: 11px;
}

.mail-body {
  width: 100%;
  border: 0;
  min-height: 120px;
  background: #fff;
  display: block;
}

.mail-text {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
  margin: 0;
  line-height: 1.6;
}

/* ==================== Editor Rich Text & Resposta Rápida ================== */

.quick-reply-card {
  border-color: #cbd5e1;
}

.quick-reply-header,
.compose-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-block-end: 14px;
  gap: 12px;
}

.quick-reply-modes {
  display: flex;
  gap: 8px;
}

.rte-wrapper {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rte-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.rte-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: var(--panel-subtle);
  border-block-end: 1px solid var(--border);
  flex-wrap: wrap;
}

.rte-select {
  width: auto;
  padding: 4px 8px;
  font-size: 13px;
  border-radius: 6px;
}

.rte-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 14px;
}

.rte-btn:hover {
  background: #e2e8f0;
  color: var(--text);
}

.rte-sep {
  width: 1px;
  height: 18px;
  background: var(--border-strong);
  margin-inline: 3px;
}

.rte-color {
  position: relative;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  flex: 0 0 auto;
}

.rte-color:hover {
  background: #e2e8f0;
}

.rte-color-indicator {
  font-weight: 700;
  font-size: 14px;
  border-block-end: 3px solid var(--primary);
  line-height: 1;
}

.rte-color input[type="color"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.rte-editor {
  min-height: 280px;
  max-height: 540px;
  overflow-y: auto;
  padding: 14px 16px;
  outline: none;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

.rte-editor.compact {
  min-height: 160px;
}

.rte-editor blockquote {
  margin: 8px 0;
  padding-inline-start: 12px;
  border-inline-start: 3px solid #cbd5e1;
  color: #475569;
}

.compose-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-block-start: 4px;
}

.file-picker-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* =========================== Tabelas (Admin) ============================== */

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 11px 16px;
  border-block-end: 1px solid var(--border);
  text-align: start;
  vertical-align: middle;
}

.table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--panel-subtle);
}

.table tr:last-child td {
  border-block-end: 0;
}

.right {
  text-align: end;
}

.nowrap {
  white-space: nowrap;
}

.quota-cell {
  min-width: 200px;
}

.tag {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #e2e8f0;
  color: var(--text-secondary);
}

.tag.admin {
  background: #dbeafe;
  color: var(--primary-d);
}

/* =============================== Responsivo =============================== */

@media (max-width: 900px) {
  .app {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
  }
  .topbar {
    padding: 10px 16px;
  }
  .content {
    padding: 16px;
  }
  .thread-link {
    grid-template-columns: 36px 1fr auto;
    gap: 8px;
  }
  .thread-content {
    grid-column: 2 / -1;
  }
  .row {
    flex-direction: column;
  }
  .field-inline {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
