/* Tema único, claro: branco, verde e marrom.
   Verde-floresta = cor principal (ações, seleção). Marrom-terra = cor secundária (detalhes, tela).
   "Aberto" usa um âmbar-amarronzado e "Corrigido" um verde mais vivo, para não confundir com a cor principal. */
:root {
  --bg: #f7f5f1;
  --surface: #ffffff;
  --surface-2: #faf8f4;
  --border: #e7e0d6;
  --text: #24201b;
  --muted: #6f675d;
  --primary: #2f7a3a;
  --primary-hover: #25622f;
  --primary-soft: #e9f3ea;
  --primary-ink: #1f5428;
  --brown: #7a5230;
  --brown-soft: #f4ece2;
  --brown-border: #e3d2bf;
  --open: #a0581f;
  --open-soft: #f9eee2;
  --resolved: #1e8a4a;
  --resolved-soft: #e5f5eb;
  --danger: #b42318;
  --focus: #2f7a3a40;
  --shadow: 0 1px 2px rgb(40 30 20 / 0.06), 0 1px 3px rgb(40 30 20 / 0.04);
  --radius: 12px;

  /* Menu lateral (claro) */
  --sb-bg: #ffffff;
  --sb-border: #e7e0d6;
  --sb-text: #2a251f;
  --sb-muted: #6f675d;
  --sb-hover: #f5f1ea;
  --sb-active: #e9f3ea;
  --sb-active-text: #2f7a3a;
  --sb-input: #ffffff;

  --sidebar-w: 272px;
  --topbar-h: 64px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.muted { color: var(--muted); }
em.muted { font-style: normal; font-weight: 400; }

/* ---------- Brand ---------- */
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 17px; letter-spacing: -0.01em;
  color: inherit; text-decoration: none;
}
.brand-lg { font-size: 24px; justify-content: center; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M9 16.5l4.5 4.5L23 11.5' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 8px;
  padding: 8px 16px; font-weight: 600; cursor: pointer;
  background: transparent; transition: background .15s, border-color .15s;
}
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-ghost { border-color: var(--border); background: var(--surface); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-sm { padding: 5px 12px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-link {
  border: 0; background: none; padding: 4px 8px; cursor: pointer;
  color: var(--muted); font-size: 14px; font-weight: 600; border-radius: 6px;
}
.btn-link:hover { color: var(--text); background: var(--surface-2); }
.btn-link.danger:hover { color: var(--danger); }
.icon-btn {
  border: 0; background: none; cursor: pointer; color: inherit;
  width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; flex: none;
}
.icon-btn:hover { background: var(--surface-2); }

/* ---------- Forms ---------- */
.stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-weight: 600; font-size: 14px; }
.field small { font-size: 12.5px; }
input:not([type=checkbox]):not([type=file]), textarea, select {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); }
textarea { resize: vertical; min-height: 96px; }
.form-error { margin: 0; color: var(--danger); font-size: 14px; font-weight: 500; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.check input { accent-color: var(--primary); width: 16px; height: 16px; }

/* ---------- Segmented ---------- */
.segmented {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
}
.segmented button {
  border: 0; background: none; padding: 6px 14px; border-radius: 7px;
  font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.segmented button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.segmented .count { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Auth ---------- */
.auth {
  min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}

/* Lado esquerdo: apresentação */
.auth-hero {
  position: relative; overflow: hidden;
  display: grid; place-items: center;
  padding: 40px clamp(32px, 5vw, 72px);
  color: #f4efe6;
  background:
    radial-gradient(900px 520px at 110% -10%, rgb(108 168 96 / .45), transparent 60%),
    radial-gradient(760px 520px at -20% 115%, rgb(139 94 52 / .7), transparent 62%),
    linear-gradient(160deg, #1d3a22 0%, #2a5530 48%, #4a3220 100%);
}
.auth-hero::after { /* textura de pontos sutil */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgb(255 255 255 / .08) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
}
.auth-hero > * { position: relative; z-index: 1; }
.brand-mark-light {
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M9 16.5l4.5 4.5L23 11.5' fill='none' stroke='%232f7a3a' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
/* Marca em evidência, centralizada */
.hero-brand-big { display: flex; align-items: center; gap: clamp(14px, 1.6vw, 22px); }
.hero-mark {
  width: clamp(52px, 5.4vw, 76px); height: clamp(52px, 5.4vw, 76px);
  border-radius: clamp(14px, 1.4vw, 20px);
  box-shadow: 0 14px 40px -10px rgb(20 30 15 / .6);
}
.hero-name {
  margin: 0; color: #fff; white-space: nowrap;
  font-size: clamp(36px, 4.4vw, 64px); font-weight: 800; letter-spacing: -0.03em; line-height: 1;
  text-shadow: 0 6px 30px rgb(20 30 15 / .35);
}

/* Lado direito: login */
.auth-panel {
  display: grid; place-items: center; padding: 40px 24px;
  background: var(--surface);
}
.auth-card { width: 100%; max-width: 380px; }
.auth-title { margin: 0; font-size: 28px; letter-spacing: -0.02em; }
.auth-tagline { margin: 6px 0 28px; }
.auth-tabs { display: flex; margin-bottom: 20px; }
.auth-tabs button { flex: 1; }
.btn-lg { padding: 11px 16px; font-size: 15px; }
.btn-text {
  align-self: flex-start; border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--primary); font-weight: 600; font-size: 14px;
}
.btn-text:hover { text-decoration: underline; }
.auth-note {
  font-size: 13.5px; margin: 24px 0 0; padding-top: 20px; line-height: 1.6;
  border-top: 1px solid var(--border);
}
.auth-notice {
  margin: 0 0 16px; padding: 10px 12px; border-radius: 8px; font-size: 14px; font-weight: 500;
  background: var(--primary-soft); border: 1px solid #cfe3d1; color: var(--primary-ink);
}
.auth-notice.notice-success { background: var(--resolved-soft); border-color: #bfe5cb; color: var(--resolved); }
.auth-notice.notice-error { background: #fef3f2; border-color: #fecdca; color: var(--danger); }
.auth-notice.notice-warn { background: var(--open-soft); border-color: #f6d5b4; color: #8a3f06; margin: 16px 0 0; }

.check-email { text-align: center; }
.check-email p { margin: 12px 0 0; line-height: 1.6; }
.check-icon {
  width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 16px;
  display: grid; place-items: center; background: var(--primary-soft); color: var(--primary);
}
.check-addr { color: var(--text); word-break: break-all; }
.check-email .form-error { margin-top: 12px; }
.check-actions { margin-top: 24px; gap: 12px; align-items: center; }
.check-actions .btn-text { align-self: center; }

/* ---------- App shell ---------- */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  height: 100vh; height: 100dvh;
  overflow: hidden;
}
.app-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

/* ---------- Sidebar ---------- */
.sidebar {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--sb-bg); color: var(--sb-text);
  border-right: 1px solid var(--sb-border);
}
.sidebar-head {
  flex: none; height: var(--topbar-h); padding: 0 18px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--sb-border);
}
.sidebar-close { display: none; font-size: 26px; line-height: 1; color: var(--sb-muted); }
.sidebar .brand { color: var(--text); }
.sidebar .icon-btn:hover { background: var(--sb-hover); color: var(--sb-text); }

.nav { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 12px 20px; display: flex; flex-direction: column; gap: 2px; }
.nav::-webkit-scrollbar { width: 8px; }
.nav::-webkit-scrollbar-thumb { background: var(--sb-border); border-radius: 4px; }
.nav-label {
  margin: 20px 10px 6px; font-size: 11.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--sb-muted);
}
.nav-list, .nav-sublist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav-sublist { margin: 2px 0 6px 18px; padding-left: 10px; border-left: 1px solid var(--sb-border); }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border-radius: 8px; border: 0; background: none;
  color: var(--sb-text); text-decoration: none; font-weight: 500; font-size: 14.5px;
  text-align: left; cursor: pointer;
}
.nav-item:hover { background: var(--sb-hover); }
.nav-item[aria-current="page"] { background: var(--sb-active); color: var(--sb-active-text); font-weight: 700; }
.nav-item.is-parent-active { font-weight: 700; }
.nav-item svg { flex: none; color: var(--sb-muted); }
.nav-item[aria-current="page"] svg { color: var(--sb-active-text); }
.nav-sublist .nav-item { padding: 6px 10px; font-size: 14px; color: var(--sb-muted); }
.nav-sublist .nav-item:hover { color: var(--sb-text); }
.nav-sublist .nav-item[aria-current="page"] { color: var(--sb-active-text); }
.nav-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count {
  flex: none; min-width: 22px; padding: 0 7px; border-radius: 999px;
  font-size: 12px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums;
  background: var(--open-soft); color: var(--open);
}
.nav-count:empty { display: none; }
.nav-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.nav-add {
  margin-top: 4px; padding: 8px 10px; border: 0; background: none; cursor: pointer;
  color: var(--sb-active-text); font-weight: 600; font-size: 14px; text-align: left; border-radius: 8px;
}
.nav-add:hover { background: var(--sb-hover); }
.nav-sublist .nav-add { padding: 6px 10px; font-size: 13.5px; margin: 0; }
/* Reordenar módulos (administrador) */
.is-reorderable > li > .nav-item { position: relative; cursor: grab; }
.is-reorderable > li > .nav-item:active { cursor: grabbing; }
.drag-handle {
  flex: none; width: 8px; height: 14px; margin-left: -4px; opacity: 0; transition: opacity .15s;
  background-image: radial-gradient(currentColor 1.2px, transparent 1.3px);
  background-size: 4px 4px; color: var(--sb-muted);
}
.is-reorderable > li > .nav-item:hover .drag-handle,
.is-reorderable > li > .nav-item:focus-visible .drag-handle { opacity: 1; }
.is-dragging { opacity: .45; }
.is-dragging > .nav-item { background: var(--sb-active); outline: 1px dashed var(--primary); outline-offset: -1px; }

.nav-sublist-screens { margin-left: 12px; }
.nav-sublist-screens .nav-item { padding: 5px 10px; font-size: 13.5px; }
.nav-sublist-screens .nav-add { font-size: 13px; }
.nav-empty { padding: 4px 10px; font-size: 13.5px; color: var(--sb-muted); }

/* Formulários dentro do menu escuro */
.nav-form { padding: 8px 4px; gap: 8px; }
.sidebar input:not([type=checkbox]) {
  padding: 7px 10px; font-size: 14px;
  background: var(--sb-input); border-color: var(--sb-border); color: var(--sb-text);
}
.sidebar input::placeholder { color: var(--sb-muted); }
.sidebar .btn-ghost { background: transparent; border-color: var(--sb-border); color: var(--sb-text); }
.sidebar .btn-ghost:hover:not(:disabled) { background: var(--sb-hover); }
.sidebar .form-error { font-size: 13px; }

/* Conta (rodapé do menu) */
.sidebar-foot { flex: none; position: relative; padding: 10px; border-top: 1px solid var(--sb-border); }
.account-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: 10px; background: none;
  color: var(--sb-text); text-align: left; cursor: pointer;
}
.account-btn:hover, .account-btn[aria-expanded="true"] { background: var(--sb-hover); }
.me { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.me-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-user { font-size: 12.5px; color: var(--sb-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Seta para cima (o menu abre para cima); vira para baixo quando aberto */
.account-chevron { flex: none; color: var(--sb-muted); transition: transform .15s; }
.account-btn[aria-expanded="true"] .account-chevron { transform: rotate(180deg); }

.account-menu {
  position: absolute; left: 10px; right: 10px; bottom: calc(100% - 4px); z-index: 40;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 6px; box-shadow: 0 12px 32px -8px rgb(40 30 20 / .22), 0 2px 6px rgb(40 30 20 / .06);
}
.account-menu-head { padding: 8px 10px 10px; display: flex; flex-direction: column; line-height: 1.35; }
.account-menu-head strong { font-size: 14px; }
.account-menu-head span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu-head span:empty { display: none; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: 8px; background: none;
  color: var(--text); font-size: 14px; font-weight: 500; text-align: left; cursor: pointer;
}
.menu-item svg { color: var(--muted); flex: none; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); outline: none; }
.menu-item.danger, .menu-item.danger svg { color: var(--danger); }
.menu-item.danger:hover { background: #fef3f2; }
.menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }

/* Janela (configurações) */
.modal {
  width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  padding: 0; border: 1px solid var(--border); border-radius: 16px;
  background: var(--surface); color: var(--text);
  box-shadow: 0 24px 60px -12px rgb(40 30 20 / .3);
}
.modal::backdrop { background: rgb(40 30 20 / .45); }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 20px 14px 24px; border-bottom: 1px solid var(--border);
}
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-close { font-size: 24px; line-height: 1; color: var(--muted); }
.modal-section { padding: 20px 24px; }
.modal-section + .modal-section { border-top: 1px solid var(--border); }
.modal-section h3 { margin: 0; font-size: 15px; }
a.menu-item { text-decoration: none; }
.modal-sub { margin: 2px 0 0; font-size: 13.5px; }
.status-text { margin: 0; font-size: 14px; }
.btn-danger { background: #fff; color: var(--danger); border-color: #fecdca; }
.btn-danger:hover:not(:disabled) { background: #fef3f2; }
.btn-danger.is-restore { color: var(--resolved); border-color: #bfe5cb; }
.btn-danger.is-restore:hover:not(:disabled) { background: var(--resolved-soft); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Painel administrativo ---------- */
.admin-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.stat-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 26px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; margin-top: 2px; }
.admin-toolbar { display: flex; gap: 12px; margin-bottom: 12px; }
.admin-toolbar input[type=search] { max-width: 360px; padding: 8px 12px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); padding: 12px 16px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tr.is-inactive td { color: var(--muted); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.user-cell { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.user-cell strong { font-weight: 600; color: var(--text); }
.user-cell .you { font-size: 12px; color: var(--muted); font-weight: 500; }
.cell-muted { color: var(--muted); white-space: nowrap; }
.table .empty-row td { text-align: center; color: var(--muted); padding: 32px 16px; }

.tag {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.tag-admin { background: var(--primary-soft); color: var(--primary); }
.tag-user { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.tag-active { background: var(--resolved-soft); color: var(--resolved); }
.tag-inactive { background: #fef3f2; color: var(--danger); }
.tag-warn { background: var(--open-soft); color: var(--open); }

@media (max-width: 560px) {
  .admin-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 10px 12px; }
  .stat-value { font-size: 21px; }
  .admin-toolbar input[type=search] { max-width: none; }
}

.settings-warn { margin: 0; }
.me-user.is-missing { color: var(--open); font-weight: 600; }
.modal input:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }

.sidebar-backdrop { display: none; }

/* ---------- Topbar ---------- */
.topbar {
  flex: none; height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.menu-btn { display: none; }
.context-head { min-width: 0; }
.context-head h1 {
  margin: 0; font-size: 19px; line-height: 1.3; letter-spacing: -0.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.crumbs { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; line-height: 1.3; }
.crumbs a { color: var(--muted); text-decoration: none; font-weight: 500; }
.crumbs a:hover { color: var(--primary); text-decoration: underline; }
.crumbs:empty { display: none; }

/* ---------- Conteúdo ---------- */
.content { flex: 1; min-height: 0; overflow-y: auto; padding: 24px 28px 48px; }
.context-desc { margin: 0 0 16px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}

/* ---------- Composer ---------- */
.composer { padding: 14px 16px; }
.composer-trigger {
  display: flex; align-items: center; gap: 12px; width: 100%;
  border: 0; background: none; padding: 0; cursor: pointer; text-align: left;
}
.composer-placeholder {
  flex: 1; padding: 10px 14px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}
.composer-trigger:hover .composer-placeholder { border-color: var(--primary); }
.composer-head { display: flex; align-items: center; gap: 10px; }

.photo-picker { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.photo-add { cursor: pointer; }
.photo-previews { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-previews:empty { display: none; }
.preview {
  position: relative; width: 84px; height: 84px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border); background: var(--surface-2);
}
.preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview button {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px;
  border: 0; border-radius: 50%; background: rgb(0 0 0 / .65); color: #fff;
  cursor: pointer; font-size: 15px; line-height: 1; display: grid; place-items: center;
}

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; margin: 20px 0 12px;
}
.toolbar-right { display: flex; align-items: center; gap: 14px; flex: 1; justify-content: flex-end; min-width: 220px; }
.toolbar-right input[type=search] { max-width: 280px; padding: 7px 12px; }

/* ---------- Barra do feed (busca · filtros · novo) ---------- */
.feed-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.status-tabs { flex: none; }
.status-tabs button { padding: 7px 14px; }
.search-box { position: relative; flex: 1; min-width: 0; }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box input[type=search] { padding: 10px 12px 10px 38px; border-radius: 10px; background: var(--surface); }
.filter-wrap { position: relative; flex: none; }

/* Alternar Cards / Lista */
.layout-toggle { flex: none; }
.layout-toggle button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; }
.layout-toggle button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.layout-toggle button[aria-pressed="true"] svg { color: var(--primary); }
@media (max-width: 1200px) { .layout-label { display: none; } }

/* ---------- Visão em lista ---------- */
.feed.is-list {
  gap: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.feed.is-list:has(> .empty) { background: none; border: 0; box-shadow: none; }
.list-row {
  display: grid; align-items: center; column-gap: 14px;
  grid-template-columns: 92px minmax(200px, 3fr) minmax(100px, 1fr) minmax(100px, 1fr) minmax(150px, 1.3fr) minmax(110px, 1fr) 84px 40px;
  padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 14px;
}
.list-row:last-child { border-bottom: 0; }
.list-head {
  position: sticky; top: 0; z-index: 1; background: var(--surface-2);
  font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
  padding-top: 9px; padding-bottom: 9px;
}
.list-item { cursor: pointer; transition: background .12s; }
.list-item:hover { background: var(--surface-2); }
.list-item:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.list-item.is-open { box-shadow: inset 3px 0 0 var(--open); }
.list-item.is-resolved { box-shadow: inset 3px 0 0 var(--resolved); }
.list-cell { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-cell.muted { color: var(--muted); }
.list-title { white-space: normal; }
.list-title strong {
  font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.list-project { display: inline-block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.list-sub { display: none; }
.list-num { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.list-row .badge { font-size: 11.5px; padding: 2px 8px; }
.list-row .assignee { max-width: 100%; }
.list-row .assignee-label { display: none; }
.list-chip {
  display: inline-block; max-width: 100%; padding: 2px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;
}
.list-chip.ctx-module { background: var(--primary-soft); color: var(--primary-ink); }
.list-chip.ctx-screen { background: var(--brown-soft); color: var(--brown); }

@media (max-width: 1100px) {
  .list-row { grid-template-columns: 92px minmax(200px, 3fr) minmax(100px, 1fr) minmax(100px, 1fr) minmax(140px, 1.3fr) 40px; }
  .list-col-author, .list-col-date { display: none; }
}
@media (max-width: 700px) {
  .list-head { display: none; }
  .list-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; padding: 12px 14px; }
  .list-row > .list-cell { display: none; }
  .list-row > .list-title { display: block; grid-column: 1; grid-row: 1; }
  .list-row > .list-col-status { display: block; grid-column: 2; grid-row: 1; justify-self: end; }
  .list-sub { display: block; margin-top: 4px; font-size: 12.5px; color: var(--muted); white-space: normal; }
}
.filter-btn, .new-issue-btn { padding: 9px 14px; border-radius: 10px; white-space: nowrap; }
.filter-btn[aria-expanded="true"] { border-color: var(--primary); color: var(--primary); }
.filter-btn svg { color: var(--muted); }
.filter-btn[aria-expanded="true"] svg { color: var(--primary); }
.filter-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--primary); color: #fff; font-size: 12px; font-weight: 700;
  display: inline-grid; place-items: center;
}
.new-issue-btn { flex: none; }

.filter-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20;
  width: min(360px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 16px 40px -10px rgb(40 30 20 / .25), 0 2px 6px rgb(40 30 20 / .06);
  padding: 16px; display: flex; flex-direction: column; gap: 16px;
}
.filter-group { display: flex; flex-direction: column; gap: 8px; }
.filter-label { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.filter-group select { padding: 8px 10px; font-size: 14px; }
.filter-group select:disabled { background: var(--surface-2); color: var(--muted); }
.filter-actions {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px; border-top: 1px solid var(--border);
}
.filter-actions .btn-text { align-self: center; }

.feed-summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  min-height: 28px; margin-bottom: 12px; font-size: 14px; color: var(--muted);
}
.feed-summary strong { color: var(--text); }
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-ink); font-size: 13px; font-weight: 600;
  border: 0; cursor: pointer;
}
.chip span { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; line-height: 1; }
.chip:hover span { background: rgb(47 122 58 / .15); }

.modal-lg { width: min(720px, calc(100vw - 32px)); }
/* Editor de texto rico (descrição com imagens) */
.rich-field {
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); overflow: hidden;
}
.rich-field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); }
.rich-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 6px 8px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.btn-tool {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 6px;
  font-size: 13.5px; font-weight: 600; color: var(--text); cursor: pointer;
}
.btn-tool:hover { background: var(--border); }
.btn-tool svg { color: var(--primary); }
.rich-hint { font-size: 12.5px; color: var(--muted); }
kbd {
  font: 600 11px/1 system-ui, sans-serif; padding: 2px 5px; border-radius: 4px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.rich-editor {
  min-height: 160px; max-height: 50vh; overflow-y: auto;
  padding: 10px 12px; outline: none; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55;
}
.rich-editor.is-empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.ed-img {
  position: relative; display: inline-block; max-width: 100%; margin: 6px 0; vertical-align: top;
  border-radius: 8px; border: 1px solid var(--border); overflow: hidden; line-height: 0; user-select: none;
}
.ed-img img { display: block; max-width: 100%; max-height: 320px; object-fit: contain; }
.ed-img-remove {
  position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border: 0; border-radius: 50%;
  background: rgb(0 0 0 / .65); color: #fff; font-size: 17px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
.ed-img-remove:hover { background: var(--danger); }

/* ---------- Card clicável ---------- */
.post { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.post:hover { border-color: #d8cfc3; box-shadow: 0 4px 14px -6px rgb(40 30 20 / .18); }
.post:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.post .post-actions, .post .comments { cursor: default; }

/* Card compacto (feed) */
.post-compact { padding: 12px 18px 8px; }
.post-compact .post-head { align-items: center; gap: 10px; }
.post-compact .post-meta { display: flex; align-items: baseline; flex-wrap: wrap; min-width: 0; font-size: 14px; }
.post-compact .post-author { font-weight: 600; }
.post-compact .post-sub { font-size: 13px; }
/* ---------- Etiquetas (labels) ---------- */
.label-chip {
  --hue: 120;
  display: inline-flex; align-items: center; gap: 4px; max-width: 220px;
  padding: 2px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; line-height: 1.5;
  background: hsl(var(--hue) 55% 93%); color: hsl(var(--hue) 45% 28%);
  border: 1px solid hsl(var(--hue) 40% 82%);
}
.label-chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.label-chip button {
  border: 0; background: none; padding: 0 0 0 2px; cursor: pointer; color: inherit;
  font-size: 14px; line-height: 1; opacity: .7;
}
.label-chip button:hover { opacity: 1; }
.label-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.label-more { font-size: 12px; color: var(--muted); align-self: center; }
.list-title .label-row { margin-top: 4px; }
.drawer-labels { margin: -4px 0 14px; }

/* Campo de etiquetas (chips + digitação + sugestões) */
.label-input {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: text;
}
.label-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); }
.label-chips { display: contents; }
.label-input input[type=text] {
  flex: 1; min-width: 180px; width: auto; border: 0; padding: 4px 2px; box-shadow: none; background: none;
}
.label-input input[type=text]:focus { box-shadow: none; }
.label-suggest {
  position: absolute; left: -1px; right: -1px; top: calc(100% + 4px); z-index: 5;
  list-style: none; margin: 0; padding: 4px; max-height: 240px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 32px -8px rgb(40 30 20 / .22);
}
.label-suggest li {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 7px; cursor: pointer; font-size: 14px;
}
.label-suggest li[aria-selected="true"], .label-suggest li:hover { background: var(--surface-2); }
.label-suggest .suggest-uses { margin-left: auto; font-size: 12px; color: var(--muted); }
.label-suggest .suggest-create { color: var(--primary); font-weight: 600; }
.label-suggest .suggest-empty { color: var(--muted); cursor: default; }

/* Número do ticket (#42) antes do título */
.ticket-no { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Etiquetas de local no card: Projeto / Módulo / Tela */
.ctx-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ctx-tag {
  display: inline-flex; align-items: center; max-width: 100%; overflow: hidden;
  border-radius: 999px; font-size: 12.5px; line-height: 1; border: 1px solid;
}
.ctx-tag-label {
  padding: 4px 7px 4px 9px; font-weight: 700; font-size: 11px; letter-spacing: .03em; text-transform: uppercase;
}
.ctx-tag-value {
  padding: 4px 10px 4px 7px; font-weight: 600; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ctx-project { border-color: var(--border); background: var(--surface-2); color: var(--muted); }
.ctx-project .ctx-tag-label { background: var(--border); }
.ctx-module { border-color: #cfe3d1; background: var(--primary-soft); color: var(--primary-ink); }
.ctx-module .ctx-tag-label { background: #dcebdd; }
.ctx-screen { border-color: var(--brown-border); background: var(--brown-soft); color: var(--brown); }
.ctx-screen .ctx-tag-label { background: #ead9c6; }
.post-compact .ctx-tags + .post-title { margin-top: 8px; }
.post-compact .post-title {
  margin: 8px 0 0; font-size: 16.5px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-compact .post-context + .post-title { margin-top: 6px; }
.post-foot {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--border);
}
.post-foot .spacer { flex: 1; }
.post-foot .btn-link { margin-left: -8px; }
.field-row-title { grid-template-columns: minmax(0, 2fr) minmax(180px, 1fr); }
@media (max-width: 560px) { .field-row-title { grid-template-columns: 1fr; } }

/* Responsável no card */
.assignee {
  display: inline-flex; align-items: center; gap: 6px; max-width: 220px;
  font-size: 13px; color: var(--text); font-weight: 500;
}
.assignee .avatar { width: 22px; height: 22px; font-size: 9.5px; }
.assignee-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assignee-label { color: var(--muted); font-weight: 400; }
.assignee-none { color: var(--muted); font-style: italic; font-weight: 400; }
.btn-assume {
  border: 1px dashed #d8cfc3; background: none; border-radius: 999px; padding: 3px 10px;
  font-size: 12.5px; font-weight: 600; color: var(--primary); cursor: pointer;
}
.btn-assume:hover { background: var(--primary-soft); border-color: var(--primary); }

/* Responsável no painel */
.drawer-assignee {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 18px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border);
}
.drawer-assignee .filter-label { margin-right: 4px; }
.drawer-assignee select { width: auto; min-width: 200px; flex: 1; max-width: 320px; padding: 6px 10px; font-size: 14px; }

.post-indicator { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.post-indicator.resolved-by { color: var(--resolved); font-weight: 500; }

/* ---------- Painel do problema (meia tela / tela inteira) ---------- */
.drawer {
  position: fixed; top: 0; bottom: 0; right: 0; left: auto; margin: 0;
  width: min(max(50vw, 560px), 100vw); max-width: 100vw; height: 100vh; height: 100dvh; max-height: none;
  padding: 0; border: 0; border-left: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  box-shadow: -24px 0 60px -24px rgb(40 30 20 / .35);
}
.drawer[open] { display: flex; animation: drawer-in .2s ease-out; }
.drawer::backdrop { background: rgb(40 30 20 / .35); }
@keyframes drawer-in { from { transform: translateX(48px); opacity: 0; } }
.drawer-inner { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.drawer-head {
  flex: none; display: flex; align-items: center; gap: 12px;
  padding: 14px 16px 14px 24px; border-bottom: 1px solid var(--border);
}
.drawer-crumbs { flex: 1; min-width: 0; font-size: 13px; }
.drawer-close { font-size: 26px; line-height: 1; color: var(--muted); margin-left: auto; }
.drawer-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 28px 40px; }
.drawer-title { margin: 0 0 14px; font-size: 22px; line-height: 1.3; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.drawer-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.drawer-scroll .post-body { font-size: 15.5px; line-height: 1.6; }
.drawer-scroll .inline-img { max-width: 100%; }
.drawer-scroll .inline-img img { max-height: 70vh; }
.drawer-actions { margin-top: 20px; }
.drawer-section { margin-top: 24px; }
.drawer-section-title { margin: 0 0 12px; font-size: 15px; }
.drawer-comments { padding: 0 0 12px; }

@media (max-width: 900px) {
  .drawer { width: 100vw; border-left: 0; }
  .drawer-scroll { padding: 18px 16px 32px; }
  .drawer-head { padding: 12px 12px 12px 16px; }
  .drawer-title { font-size: 19px; }
}

/* Descrição com imagens no card do feed */
.post-text { white-space: pre-wrap; }
.inline-img {
  display: block; margin: 10px 0; padding: 0; border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; background: var(--surface-2); cursor: zoom-in; max-width: min(100%, 720px);
}
.inline-img img { display: block; max-width: 100%; max-height: 480px; object-fit: contain; }
.post-sub .edited { cursor: help; }
.modal-head .composer-head h2 { margin: 0; font-size: 18px; }
#issue-dialog .modal-section { padding-top: 18px; }

@media (max-width: 560px) {
  .feed-toolbar { flex-wrap: wrap; }
  .status-tabs { display: flex; flex-basis: 100%; }
  .status-tabs button { flex: 1; padding: 6px 6px; }
  .search-box { flex-basis: 100%; }
  .filter-wrap, .new-issue-btn { flex: 1; }
  .filter-btn, .new-issue-btn { width: 100%; justify-content: center; }
  .filter-panel { left: 0; right: auto; }
}

/* ---------- Feed ---------- */
.feed { display: flex; flex-direction: column; gap: 12px; }
.feed-footer { display: flex; justify-content: center; margin-top: 16px; }
.empty { text-align: center; padding: 56px 16px; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }

.post { padding: 16px 20px 8px; }
.post.is-resolved { border-left: 3px solid var(--resolved); }
.post.is-open { border-left: 3px solid var(--open); }
.post-head { display: flex; align-items: flex-start; gap: 12px; }
.post-meta { flex: 1; min-width: 0; }
.post-author { font-weight: 700; }
.post-sub { font-size: 13px; color: var(--muted); }
.post-sub time { cursor: default; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-open { background: var(--open-soft); color: var(--open); }
.badge-resolved { background: var(--resolved-soft); color: var(--resolved); }

.post-context {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px;
  margin-top: 12px; padding: 2px 8px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12.5px; font-weight: 600; color: var(--muted);
}
.post-context a { color: inherit; text-decoration: none; }
.post-context a:hover { color: var(--primary); text-decoration: underline; }
.post-title { margin: 10px 0 4px; font-size: 17px; line-height: 1.35; overflow-wrap: anywhere; }
.post-context + .post-title { margin-top: 8px; }
.post-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 110ch; }

.gallery { display: grid; gap: 4px; margin-top: 12px; border-radius: 10px; overflow: hidden; max-width: 860px; }
.gallery.n1 { grid-template-columns: 1fr; max-width: 640px; }
.gallery.n2, .gallery.n4 { grid-template-columns: 1fr 1fr; }
.gallery.n3, .gallery.n5, .gallery.n6 { grid-template-columns: 1fr 1fr 1fr; }
.gallery button {
  padding: 0; border: 0; cursor: zoom-in; background: var(--surface-2);
  aspect-ratio: 4 / 3; overflow: hidden;
}
.gallery.n1 button { aspect-ratio: auto; max-height: 420px; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery.n1 img { object-fit: contain; max-height: 420px; }

.resolved-note {
  display: inline-block; margin-top: 12px; padding: 8px 12px; border-radius: 8px;
  background: var(--resolved-soft); color: var(--resolved); font-size: 14px; font-weight: 500;
}

.post-actions {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 6px; border-top: 1px solid var(--border);
}
.post-actions .spacer { flex: 1; }
.btn-resolve { color: var(--resolved); }
.btn-resolve:hover { color: var(--resolved) !important; background: var(--resolved-soft) !important; }

/* ---------- Comments ---------- */
.comments { padding: 8px 0; display: flex; flex-direction: column; gap: 10px; }
.comment { display: flex; gap: 10px; }
.comment-bubble { background: var(--surface-2); border-radius: 12px; padding: 7px 12px; min-width: 0; flex: 1; }
.comment-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.comment-head strong { font-size: 13.5px; }
.comment-text { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-delete { margin-left: auto; font-size: 12.5px; padding: 0 4px; }
.comment-form { display: flex; gap: 8px; align-items: flex-end; }
.comment-form textarea { min-height: 40px; height: 40px; padding: 8px 12px; border-radius: 20px; resize: none; }

/* ---------- Avatar ---------- */
.avatar {
  --hue: 150;
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: hsl(var(--hue) 45% 88%); color: hsl(var(--hue) 50% 25%);
  font-weight: 700; font-size: 15px; letter-spacing: .02em;
}
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-xs { width: 28px; height: 28px; font-size: 11px; }

/* ---------- Lightbox ---------- */
.lightbox {
  border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh;
  width: 100vw; height: 100vh; margin: 0;
}
.lightbox::backdrop { background: rgb(0 0 0 / .88); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox img { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 6px; }
.lightbox-close, .lightbox-nav {
  position: fixed; border: 0; background: rgb(255 255 255 / .12); color: #fff;
  cursor: pointer; border-radius: 50%; display: grid; place-items: center;
}
.lightbox-close { top: 16px; right: 16px; width: 44px; height: 44px; font-size: 28px; line-height: 1; }
.lightbox-nav { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 32px; line-height: 1; }
.lightbox-nav.prev { left: 16px; }
.lightbox-nav.next { right: 16px; }
.lightbox-close:hover, .lightbox-nav:hover { background: rgb(255 255 255 / .24); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px;
  font-weight: 500; box-shadow: 0 6px 20px rgb(0 0 0 / .2); max-width: calc(100vw - 32px);
}

/* ---------- Tablet / celular: menu vira gaveta ---------- */
@media (max-width: 900px) {
  /* Login: apresentação vira cabeçalho compacto acima do formulário */
  .auth { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .auth-hero { padding: 36px 24px; }
  .hero-mark { width: 44px; height: 44px; border-radius: 12px; }
  .hero-name { font-size: 32px; }
  .auth-panel { place-items: start center; padding: 32px 20px 40px; }

  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: grid; margin-left: -8px; }
  .sidebar-close { display: grid; }
  .sidebar {
    position: fixed; z-index: 30; top: 0; left: 0; bottom: 0;
    width: min(300px, 86vw);
    transform: translateX(-100%); transition: transform .2s ease; visibility: hidden;
  }
  .sidebar.open { transform: none; visibility: visible; box-shadow: 0 0 40px rgb(0 0 0 / .35); }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 25; background: rgb(0 0 0 / .45); }
  .topbar { padding: 0 16px; }
  .content { padding: 16px 16px 40px; }
}

@media (max-width: 560px) {
  :root { --topbar-h: 58px; }
  .context-head h1 { font-size: 17px; }
  .field-row { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .segmented { display: flex; }
  .toolbar .segmented button { flex: 1; padding: 6px 6px; }
  .toolbar-right { justify-content: space-between; min-width: 0; }
  .toolbar-right input[type=search] { max-width: none; flex: 1; }
  .post { padding: 14px 14px 8px; }
  .post-head .badge { font-size: 11.5px; padding: 2px 8px; }
  .lightbox-nav { width: 40px; height: 40px; }
}
