/* Identidade "Chapa" (decisão #2 da Central, CEN-12): sinalização industrial, zinco e grafite,
   amarelo segurança só para travas (aprovações e bloqueios), azul processo para andamento e links. */
:root {
  --bg: #E6E8E6; --surface: #FFFFFF; --surface-2: #F1F2F1; --border: #C9CFD2; --border-dash: #9BA5AB;
  --text: #1C2328; --muted: #3E4A52;
  --primary: #1C2328; --primary-text: #FFFFFF;
  --process: #2F5D8A; --process-text: #FFFFFF; --link: #2F5D8A;
  --lock: #F2C230; --lock-text: #1C2328;
  --done: #2E6B4F; --done-text: #FFFFFF; --cancel: #5B6770;
  --blade: #1C2328; --blade-empty: #B9C0C4;
  --danger: #A8352A; --danger-text: #FFFFFF; --shadow: 0 1px 2px rgba(28,35,40,.06);
  --font: 'Barlow', 'Helvetica Neue', Arial, sans-serif;
  --font-cond: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --mono: ui-monospace, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14191D; --surface: #1C2328; --surface-2: #222A30; --border: #323C43; --border-dash: #4A565E;
    --text: #E6E8E6; --muted: #9BA5AB;
    --primary: #E6E8E6; --primary-text: #14191D;
    --process: #6FA3D8; --process-text: #14191D; --link: #6FA3D8;
    --lock-text: #14191D;
    --done: #5FAF86; --done-text: #14191D; --cancel: #8A959C;
    --blade: #E6E8E6; --blade-empty: #3E4A52;
    --danger: #E07A6C; --danger-text: #14191D; --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14191D; --surface: #1C2328; --surface-2: #222A30; --border: #323C43; --border-dash: #4A565E;
  --text: #E6E8E6; --muted: #9BA5AB;
  --primary: #E6E8E6; --primary-text: #14191D;
  --process: #6FA3D8; --process-text: #14191D; --link: #6FA3D8;
  --lock-text: #14191D;
  --done: #5FAF86; --done-text: #14191D; --cancel: #8A959C;
  --blade: #E6E8E6; --blade-empty: #3E4A52;
  --danger: #E07A6C; --danger-text: #14191D; --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--link); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.erro { color: var(--danger); min-height: 1.2em; }
.cond { font-family: var(--font-cond); }
svg.i { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--process); outline-offset: 1px; }
textarea { min-height: 80px; resize: vertical; }
label { display: block; margin: 12px 0 4px; font-weight: 600; }
label > input, label > select, label > textarea { margin-top: 4px; font-weight: 400; }
button { cursor: pointer; border: 1px solid var(--border); background: var(--surface); padding: 7px 14px; border-radius: 6px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
button:hover { background: var(--surface-2); }
button.primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); font-weight: 600; }
button.primary:hover { opacity: .9; background: var(--primary); }
button.danger { color: var(--danger); border-color: var(--danger); }
button.ok { background: var(--done); color: var(--done-text); border-color: var(--done); font-weight: 600; }
button.ghost { border-color: transparent; background: transparent; }
button.ghost:hover { background: var(--surface-2); }
button:disabled { opacity: .5; cursor: not-allowed; }
.check { display: inline-flex; gap: 8px; align-items: center; margin: 0; font-weight: 400; }
.check input { width: auto; }
.pill { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--lock); color: var(--lock-text); font-size: 12px; font-weight: 700; text-align: center; line-height: 20px; }

/* Marca: quadrado com três lâminas + "Central" */
.brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-cond); font-weight: 700; font-size: 24px; line-height: 1; letter-spacing: -.2px; color: var(--text); }
.brand svg { width: 28px; height: 28px; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-box { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 28px; box-shadow: var(--shadow); }
.login-box .brand { font-size: 40px; }
.login-box .brand svg { width: 44px; height: 44px; }
.login-box > p.muted { margin: 6px 0 4px; }
.login-box button { width: 100%; margin-top: 18px; min-height: 46px; }
.login-box { min-width: 0; }
.login-box h2 { font-family: var(--font-cond); font-size: 25px; line-height: 1.15; margin: 20px 0 12px; }
.login-box input { min-height: 44px; }
.login-box .login-optional { font-weight: 400; }
.login-box .login-help { font-size: 13.5px; margin: 6px 0 12px; }
.login-box .erro { overflow-wrap: anywhere; }
.login-box .ghost { margin-top: 8px; }
.admin-qr { display: flex; justify-content: center; margin: 16px 0; }
.admin-qr img { display: block; width: 100%; max-width: 256px; height: auto; background: #FFFFFF; }
.admin-recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px; list-style: none; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); }
.admin-recovery-codes li { min-width: 0; font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; user-select: all; }

.topbar { display: flex; align-items: center; gap: 18px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button { border-color: transparent; background: transparent; color: var(--muted); min-height: 38px; }
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--primary); border-color: var(--primary); color: var(--primary-text); font-weight: 600; }
#project-tabs button { font-family: var(--font-cond); font-size: 18px; font-weight: 600; letter-spacing: .1px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
/* CEN-69: de 1200 px em diante o topo é uma linha só (antes quebrava a 1280 e a 1440 px com "Aguardando" visível). O
   seletor de projeto ocupa o que sobra e o nome dele encolhe (até 2 linhas); os botões da direita não encolhem. Até
   1499 px só os rótulos de Ideias, Memória global e Administração saem (o ícone fica, com título e aria-label), como já
   era com "Pessoas". Abaixo de 1200 px e no celular nada muda. */
@media (min-width: 1200px) {
  .topbar { flex-wrap: nowrap; }
  #project-tabs { flex: 1 1 0; min-width: 0; }
  .top-right { flex: none; }
}
@media (min-width: 1200px) and (max-width: 1499px) {
  #btn-ideias .lbl, #btn-global .lbl, #btn-admin .lbl { display: none; }
}
#btn-inbox.has-pending { background: var(--lock); color: var(--lock-text); border-color: var(--lock); font-weight: 700; }
#btn-inbox.has-pending .pill { background: var(--lock-text); color: var(--lock); }
.subbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; flex-wrap: wrap; }
.subbar .tabs button.active { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: inset 0 -3px 0 var(--primary); }
.subbar-actions { display: flex; gap: 12px; align-items: center; }
main { padding: 0 16px 28px; }

/* Status: chips da identidade */
.st { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 4px; font-weight: 600; font-size: 13px; line-height: 1.4; white-space: nowrap; border: 1.5px solid transparent; }
.st-backlog { border-color: var(--muted); color: var(--muted); }
.st-a_fazer { background: var(--primary); color: var(--primary-text); }
.st-em_andamento { background: var(--process); color: var(--process-text); }
.st-em_revisao { border-color: var(--process); color: var(--process); background: var(--surface); }
.st-bloqueado { background: var(--lock); color: var(--lock-text); }
.st-concluido { background: var(--done); color: var(--done-text); }
.st-cancelado { color: var(--cancel); text-decoration: line-through; padding-left: 0; }

/* Prioridade em lâminas: P1 = quatro preenchidas, P4 = uma */
.blades { display: inline-flex; gap: 2px; }
.blades i { width: 14px; height: 4px; border-radius: 1px; background: var(--blade-empty); }
.blades i.on { background: var(--blade); }

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.column { background: transparent; border: 1px dashed var(--border-dash); border-radius: 8px; padding: 10px; min-height: 200px; }
.column h3 { margin: 0 2px 10px; display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.column h3 .n { font-family: var(--font-cond); font-size: 18px; font-weight: 600; color: var(--muted); }
.column.drop { outline: 2px solid var(--process); outline-offset: -1px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.card:hover, .card:focus-visible { border-color: var(--muted); outline: none; }
.card .card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card .id { font-family: var(--font-cond); font-weight: 600; font-size: 15px; color: var(--muted); letter-spacing: .2px; }
.card .title { font-size: 16px; font-weight: 600; line-height: 1.25; }
.card .meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 13.5px; color: var(--muted); }
.card .meta span { display: inline-flex; align-items: center; gap: 4px; }
.card .card-lock { margin-left: auto; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 4px; background: var(--lock); color: var(--lock-text); }
.card .card-lock svg.i { width: 16px; height: 16px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
/* CEN-19: lista de tokens do projeto */
.tk-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.tk-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.tk-row button { min-height: 40px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--border); white-space: nowrap; color: var(--muted); }
.badge.lock, .badge.block { background: var(--lock); color: var(--lock-text); border-color: var(--lock); }

dialog { width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); border: 1px solid var(--border); border-radius: 8px; padding: 0; background: var(--surface); color: var(--text); }
dialog::backdrop { background: rgba(20,25,29,.55); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h2 { margin: 0; font-family: var(--font-cond); font-weight: 600; font-size: 24px; line-height: 1.1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.modal-content { padding: 4px 18px 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
.section { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border); }
.section h3 { margin: 0 0 8px; font-family: var(--font-cond); font-weight: 600; font-size: 19px; display: flex; align-items: center; gap: 6px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.list-item { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; background: var(--surface-2); }
.list-item .meta { font-size: 12.5px; color: var(--muted); }
.list-item pre, .mem-content { white-space: pre-wrap; word-break: break-word; margin: 6px 0 0; font: 13px/1.45 var(--mono); }
.mem-content { font-family: inherit; }
.status-pendente { background: var(--lock); color: var(--lock-text); padding: 1px 8px; border-radius: 4px; font-weight: 700; }
.status-aprovada, .status-executada { color: var(--done); font-weight: 700; }
.status-rejeitada { color: var(--danger); font-weight: 700; }
.log { font-size: 14px; }

/* CEN-6: atividade por dia e por autor */
.act { max-width: 980px; }
.act-legend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; }
.act-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 3px 10px 3px 4px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface); font-size: 14px; }
.act-chip.on { border-color: var(--a); box-shadow: inset 0 0 0 1px var(--a); font-weight: 700; }
.act-n { color: var(--muted); font-size: 12.5px; }
.act-av { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: color-mix(in srgb, var(--a) 16%, var(--surface)); color: color-mix(in srgb, var(--a) 80%, var(--text)); }
.act-av svg.i { width: 16px; height: 16px; }
.act-day { margin-bottom: 18px; }
.act-day-h { font-family: var(--font-cond); font-weight: 600; font-size: 20px; margin: 0 0 8px; display: flex; gap: 8px; align-items: baseline; position: sticky; top: 0; background: var(--bg); padding: 4px 0; z-index: 1; }
.act-run { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--a); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; }
.act-who { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.act-role { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; }
.act-items { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.act-items li { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 8px; padding: 4px 0; border-top: 1px dashed var(--border); overflow-wrap: anywhere; }
.act-items li:first-child { border-top: 0; }
.act-items time { color: var(--muted); font-variant-numeric: tabular-nums; }
.log div { padding: 6px 0; border-bottom: 1px dashed var(--border); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px 18px; margin-bottom: 14px; max-width: 980px; }
.panel h3 { font-family: var(--font-cond); font-weight: 600; font-size: 22px; display: flex; align-items: center; gap: 8px; }
.token-box { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; font-family: var(--mono); padding: 10px; border: 1.5px dashed var(--lock); border-radius: 6px; word-break: break-all; background: var(--surface-2); }
/* CEN-76: formulário e inventário de tokens personalizados, sem tabela larga no celular. */
.pt-panel { min-width: 0; overflow-wrap: anywhere; }
.pt-panel [hidden] { display: none !important; }
.pt-panel h3 { margin-top: 0; }
.pt-panel input, .pt-panel select, .pt-panel textarea, .pt-panel .grid2 > * { min-width: 0; max-width: 100%; }
.pt-panel summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.pt-permissions { min-width: 0; margin: 16px 0; border: 1px solid var(--border); border-radius: 6px; padding: 12px; }
.pt-permissions legend { padding: 0 6px; font-weight: 600; }
.pt-permission { display: flex; align-items: flex-start; min-height: 44px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.pt-permission:last-child { border-bottom: 0; }
.pt-permission input { flex: none; margin-top: 4px; }
.pt-permission span { min-width: 0; }
.pt-permission small { display: block; font-family: var(--mono); font-size: 12px; }
.pt-sensitive { display: block; color: var(--danger); font-size: 13px; }
.pt-warning { border-left: 4px solid var(--lock); padding: 10px 12px; background: var(--surface-2); }
.pt-token { align-items: flex-start; flex-wrap: wrap; }
.pt-token > div { min-width: 0; flex: 1 1 240px; }
.pt-token ul { padding-left: 20px; }
.pt-panel button { min-height: 44px; max-width: 100%; }
.pt-panel #pt-import { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 10px; }
.pt-panel #pt-ficha { font-family: var(--mono); }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--primary); color: var(--primary-text); padding: 11px 18px; border-radius: 8px; max-width: calc(100vw - 32px); z-index: 100; font-weight: 500; }
.toast.erro-t { background: var(--danger); color: var(--danger-text); }
code { font-family: var(--mono); font-size: 12.5px; }

/* CEN-15: seletor de projeto no topo */
button.brand { border: 0; background: transparent; padding: 0; cursor: pointer; }
button.brand:hover { background: transparent; opacity: .85; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.project-switch { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left; min-height: 48px; min-width: 220px; padding: 4px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.project-switch:disabled { opacity: 1; cursor: default; }
.project-switch .ps-main { display: flex; align-items: baseline; gap: 8px; }
.project-switch .ps-name { font-family: var(--font-cond); font-weight: 600; font-size: 20px; line-height: 1.1; }
.project-switch .ps-meta { grid-column: 1; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.project-switch .ps-chev { grid-column: 2; grid-row: 1 / span 2; color: var(--muted); }
.ps-key { font-family: var(--font-cond); font-weight: 600; font-size: 13px; letter-spacing: .3px; padding: 0 6px; border: 1px solid var(--border); border-radius: 4px; color: var(--muted); }
.picker { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; }
.pick { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 56px; padding: 8px 14px; text-align: left; border-radius: 8px; }
.pick.current { border: 2px solid var(--primary); }
.pick-name { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-cond); font-weight: 600; font-size: 19px; }
.pick-meta { font-size: 13.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.pick-new { border-style: dashed; }

/* CEN-3: visão geral */
.inicio-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 14px 2px 12px; }
.inicio-head h2 { margin: 0; font-family: var(--font-cond); font-weight: 600; font-size: 28px; }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; max-width: 1200px; }
.proj-card { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 14px 16px; text-align: left; border-radius: 8px; min-height: 140px; }
.proj-card.has-pending { border: 2px solid var(--lock); }
.pc-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pc-name { font-family: var(--font-cond); font-weight: 600; font-size: 22px; line-height: 1.15; }
.pc-desc { font-size: 13.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; align-items: center; }
.pc-lock { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 4px; background: var(--lock); color: var(--lock-text); font-weight: 700; }
.pc-go { margin-top: auto; color: var(--link); font-weight: 600; font-size: 14px; }
.pc-review { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 4px; border: 1.5px solid var(--process); color: var(--process); font-weight: 700; }

/* CEN-38: caixa de revisão (cards em "Em revisão" de todos os projetos) — azul do status "Em revisão" */
.review-box { max-width: 1200px; margin: 0 0 12px; padding: 12px 14px 14px; border: 2px solid var(--process); border-radius: 8px; background: var(--surface); }
.review-box h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-family: var(--font-cond); font-weight: 600; font-size: 21px; color: var(--process); }
.review-n { min-width: 26px; padding: 0 8px; border-radius: 13px; background: var(--process); color: var(--process-text); font-family: var(--font); font-size: 14px; font-weight: 700; line-height: 26px; text-align: center; }
.review-sub { margin: 2px 0 10px; font-size: 14px; }
.review-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 8px; }
.review-item { width: 100%; min-height: 56px; flex-direction: column; align-items: stretch; justify-content: center; gap: 2px; padding: 8px 12px; text-align: left; border-radius: 6px; }
.ri-top { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--muted); }
.ri-id { flex: none; font-family: var(--font-cond); font-weight: 600; font-size: 15px; color: var(--text); letter-spacing: .2px; }
.ri-proj { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ri-lock { flex: none; margin-left: auto; display: inline-flex; padding: 1px 4px; border-radius: 4px; background: var(--lock); color: var(--lock-text); }
.ri-lock svg.i { width: 15px; height: 15px; }
.ri-title { font-weight: 600; overflow-wrap: anywhere; }
/* Lista recolhida: 6 itens no computador (2 linhas), 3 no celular; "Ver todos (N)" mostra o resto. */
.review-box:not(.all) .review-list > li:nth-child(n+7) { display: none; }
.review-more { display: none; margin: 8px 0 0; min-height: 44px; padding: 0 12px; color: var(--link); font-weight: 600; }
.review-box.over-d .review-more { display: inline-flex; }
@media (max-width: 640px) {
  .review-box:not(.all) .review-list > li:nth-child(n+4) { display: none; }
  .review-box.over-m .review-more { display: flex; width: 100%; }
}
.review-none { display: flex; align-items: center; gap: 6px; max-width: 1200px; margin: 0 0 12px; padding: 0 2px; font-size: 14px; }

/* CEN-14: Ideias */
.ideas-strip { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 1200px; margin: 0 0 12px; padding: 12px 16px; min-height: 52px; border: 1.5px dashed var(--border-dash); border-radius: 8px; background: transparent; text-align: left; font-size: 15px; }
.ideas-strip .pc-go { margin: 0 0 0 auto; white-space: nowrap; }
.ideas-head .primary { margin-left: auto; }
.idea-empty { max-width: 1200px; margin-bottom: 16px; }
.idea-group { margin: 6px 0 22px; max-width: 1200px; }
.idea-group h3 { margin: 0; font-family: var(--font-cond); font-weight: 600; font-size: 21px; }
.idea-group summary { cursor: pointer; font-family: var(--font-cond); font-weight: 600; font-size: 19px; color: var(--muted); min-height: 44px; display: flex; align-items: center; gap: 6px; }
.idea-hint { margin: 2px 0 10px; font-size: 14px; }
.idea-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.idea { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 14px 16px; text-align: left; border-radius: 8px; min-height: 110px; }
.idea-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.idea-title { font-family: var(--font-cond); font-weight: 600; font-size: 20px; line-height: 1.15; }
.idea-meta { margin-top: auto; font-size: 13px; color: var(--muted); }
.ichip { flex: none; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 4px; border: 1.5px solid var(--muted); color: var(--muted); }
.ichip-avaliando { border-color: var(--process); color: var(--process); }
.ichip-virou_projeto, .ichip-concluida { border-color: var(--done); background: var(--done); color: var(--done-text); }
.ichip-descartada { text-decoration: line-through; color: var(--cancel); border-color: var(--cancel); }
.idea-avaliando { border-left: 4px solid var(--process); }
.idea-concluida { border-left: 4px solid var(--done); }
.idea-descartada .idea-title { color: var(--cancel); }
.idea-done { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 12px; border-radius: 6px; background: var(--surface-2); }
.idea-done .primary { margin-left: auto; }
@media (max-width: 640px) {
  .ideas-head .primary { width: 100%; min-height: 48px; margin-left: 0; }
  .idea-grid { grid-template-columns: 1fr; }
}
.proj-new { border-style: dashed; justify-content: center; align-items: center; }

/* CEN-5: filtros do quadro */
.board-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; }
.bf-owner { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; color: var(--muted); }
.bf-owner select { width: auto; min-height: 40px; color: var(--text); }
.board-filters.is-active .bf-owner select { border-color: var(--primary); }
.bf-prio { display: inline-flex; gap: 4px; }
.bf-prio button { min-height: 40px; min-width: 44px; padding: 0 10px; font-family: var(--font-cond); font-weight: 600; font-size: 15px; }
.bf-prio button.on { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.bf-count { font-size: 13.5px; }

/* CEN-1: aprovações em destaque */
.approval-banner { display: flex; align-items: center; gap: 12px; margin: 10px 16px 0; padding: 8px 8px 8px 16px; border-radius: 8px; background: var(--lock); color: var(--lock-text); font-weight: 600; font-size: 16px; }
.approval-banner svg.i { width: 22px; height: 22px; }
.approval-banner .ab-text { flex: 1; min-width: 0; }
.approval-banner .ab-what { display: block; font-weight: 500; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; }
.approval-banner .ab-more { opacity: .75; white-space: nowrap; }
/* CEN-28: resumo de contexto da aprovação */
.ap-sum { display: grid; gap: 8px; margin: 10px 0 4px; padding: 10px 12px; border-radius: 6px; background: var(--surface-2); }
.ap-sum div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 10px; }
.ap-sum dt { font-family: var(--font-cond); font-weight: 600; font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.ap-sum dd { margin: 0; overflow-wrap: anywhere; }
.ap-tech { margin-top: 8px; }
.ap-tech summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--link); }
/* CEN-32: "Solicitar aprovação" e outros recolhíveis dentro das janelas com área de toque de 44px. */
#modal-body details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 6px; font-weight: 600; }
.approval-banner button.primary { min-height: 44px; padding: 0 18px; background: #1C2328; border-color: #1C2328; color: #FFFFFF; }
.list-item.approval.is-pending { border: 2px solid var(--lock); background: var(--surface); }
.ap-label { margin-top: 10px; font-family: var(--font-cond); font-weight: 600; font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.ap-revert { border-left: 3px solid var(--done); padding-left: 10px; }
.ap-actions { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; margin-top: 12px; }
button.big { min-height: 48px; padding: 0 22px; font-size: 16px; font-weight: 700; }
.ap-none { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border: 1px dashed var(--border-dash); border-radius: 8px; color: var(--muted); }

/* CEN-2: mover por menu e quadro no celular */
.move-to { display: flex; flex-wrap: wrap; gap: 8px; }
.move-to button { min-height: 44px; }
.move-to .mv-concluido { background: var(--done); color: var(--done-text); border-color: var(--done); font-weight: 700; }
.move-to .mv-bloqueado { border-color: var(--lock); }
.col-empty { color: var(--muted); font-size: 14px; margin: 4px 2px; }
.m-tabs, .bottom-nav, .fab { display: none; }

/* CEN-13: memória global como seção própria */
.mode-global #project-tabs, .mode-global .subbar, .mode-inicio .subbar, .mode-ideias .subbar, .mode-geral .subbar { display: none !important; }
#btn-global.active, #btn-admin.active, #btn-ideias.active { background: var(--primary); color: var(--primary-text); }
.global-head { margin: 0 0 8px; }
.global-head button { min-height: 44px; }
.global-head button { padding-left: 0; color: var(--link); font-weight: 600; }

@media (max-width: 760px) {
  .m-tabs { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 12px; padding: 2px 16px 6px; scrollbar-width: none; }
  .m-tabs::-webkit-scrollbar { display: none; }
  .m-tabs button { flex: none; min-height: 44px; border: 1.5px solid var(--muted); background: transparent; color: var(--muted); font-weight: 600; }
  .m-tabs button span { opacity: .8; }
  .m-tabs button.active { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
  .board { display: block; overflow: visible; }
  .board .column { display: none; border: 0; padding: 0; min-height: 0; }
  .board .column.m-active { display: block; }
  .board .column h3 { display: none; }
  .subbar .tabs, #btn-new-card { display: none !important; }
  .subbar { padding: 6px 16px; justify-content: flex-end; }
  .subbar:has(.check.hidden) { display: none; }
  body:not(.mode-global):not(.mode-admin) #app { padding-bottom: 76px; }
  .bottom-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: 68px; background: var(--surface); border-top: 1px solid var(--border); }
  .mode-global .bottom-nav, .mode-admin .bottom-nav { display: none; }
  .bottom-nav button { flex-direction: column; gap: 3px; border: 0; border-top: 3px solid transparent; border-radius: 0; background: transparent; color: var(--muted); font-size: 13px; padding: 0; }
  .bottom-nav button.hidden { display: none; }
  .bottom-nav button.active { border-top-color: var(--primary); color: var(--text); font-weight: 700; }
  .bottom-nav button svg.i { width: 22px; height: 22px; }
  .fab { display: inline-flex; position: fixed; right: 16px; bottom: 84px; z-index: 21; min-height: 52px; padding: 0 20px; border-radius: 8px; border: 0; background: var(--primary); color: var(--primary-text); font-weight: 700; font-size: 16px; box-shadow: 0 4px 14px rgba(20,25,29,.25); }
  .fab.hidden { display: none !important; }
  .ap-actions { grid-template-columns: 1fr 1fr; }
  .ap-actions input { grid-column: 1 / -1; }
  .approval-banner { margin: 8px 16px 0; font-size: 15px; }
  .ap-sum div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

@media (max-width: 640px) {
  .topbar { gap: 10px; }
  #project-tabs { width: 100%; order: 3; }
  .project-switch { width: 100%; min-height: 52px; }
  .bf-prio button, .bf-owner select { min-height: 44px; }
  .mode-inicio .bottom-nav, .mode-ideias .bottom-nav, .mode-geral .bottom-nav { display: grid; }
  .top-right { margin-left: 0; width: 100%; flex-wrap: wrap; }
  /* CEN-63: com o botão "Pessoas", o topo só cabe numa linha sem a palavra "Aprovações" (fica o cadeado e o número). */
  #who, #btn-admin .lbl, #btn-global .lbl, #btn-ideias .lbl, #btn-pessoas .lbl, #btn-inbox .lbl { display: none; }
  #btn-sair { margin-left: auto; }
  .top-right { gap: 2px; }
  .top-right button { padding: 7px 9px; }
  .tabs button { min-height: 44px; }
  .subbar .tabs button, .subbar-actions button { min-height: 44px; }
}

pre { max-width: 100%; overflow-x: auto; }

/* CEN-24: revisão de usabilidade no iPhone (393x852) */
@media (max-width: 760px) {
  /* Alvos de toque de pelo menos 44px. */
  button, select, input:not([type=checkbox]):not([type=radio]), .tabs button { min-height: 44px; }
  .top-right button, .modal-head [data-close] { min-width: 44px; }
  button.link { min-height: 44px; padding: 0 4px; }
  .tag.small, .tag { min-height: 34px; padding: 0 12px; }
  .mini-tabs button { min-height: 40px; padding: 0 14px; }
  .check { min-height: 44px; gap: 10px; }
  .check input, input[type=checkbox] { width: 22px; height: 22px; }
  .tag-input input { min-height: 36px; }
  /* Fonte de 16px nos campos: abaixo disso o Safari do iPhone dá zoom sozinho ao tocar. */
  input, select, textarea, .c-search input, .tag-input input { font-size: 16px; }
  .check input, input[type=checkbox] { flex: none; }
  .tk-row button, .mini-tabs button, .tag-input input { min-height: 44px; }
  /* Atalho de teclado não faz sentido no celular. */
  kbd { display: none !important; }
  /* Modais em tela cheia, com cabeçalho e botão de fechar sempre visíveis; rolagem só por dentro. */
  dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  dialog .modal-head { padding: 8px 8px 8px 16px; }
  dialog .modal-content { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  /* Barra inferior respeita a área do gesto do iPhone. */
  .bottom-nav { padding-bottom: env(safe-area-inset-bottom); height: calc(68px + env(safe-area-inset-bottom)); }
  .fab { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .brand { min-height: 44px; }
}

/* CEN-39: reabrir card concluído ou cancelado (só o Renato) */
.reopen { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-left: 4px solid var(--process); border-radius: 8px; background: var(--surface-2); }
.reopen-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.reopen-row label { flex: 1 1 180px; margin: 0; }
.reopen-row select { min-height: 44px; }
.reopen-row button { min-height: 44px; padding: 0 18px; }
.reopen input { min-height: 44px; }
.reopen-note, .edit-locked { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 12px; border: 1px dashed var(--border-dash); border-radius: 8px; color: var(--muted); }
.edit-locked { margin-top: 10px; }
.act-reopen { color: var(--process); }
@media (max-width: 640px) { .reopen-row button { flex: 1 1 100%; } }

/* CEN-36: nome (ou descrição) de projeto com uma palavra longa, sem espaço, quebra a linha em vez de empurrar a tela
   para o lado. No topo, o nome fica em no máximo duas linhas (e, no computador, com largura limitada); o nome inteiro
   está na aba Projeto e no seletor. */
.pc-name, .pc-desc, .pick-name, .pick-meta, .ps-name, .pj-title .pj-name { overflow-wrap: anywhere; min-width: 0; }
.pc-top, .project-switch .ps-main { min-width: 0; }
.project-switch { max-width: 100%; }
.project-switch .ps-name { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pj-title { flex-wrap: wrap; row-gap: 2px; }
@media (min-width: 761px) { .project-switch { max-width: 640px; } }

/* CEN-42: card com publicação pendente não conclui; o aviso fica junto do status */
.conclude-lock { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 8px; padding: 10px 12px; border: 2px solid var(--lock); border-radius: 8px; background: var(--surface); color: var(--text); }
.conclude-lock svg { flex: 0 0 auto; margin-top: 2px; }
.move-err { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0 0; padding: 10px 12px; border: 2px solid var(--danger); border-radius: 8px; background: var(--surface); color: var(--text); }
.move-err svg { flex: 0 0 auto; margin-top: 2px; color: var(--danger); }
/* Aviso flutuante: largura do texto (não meia tela), tocar fecha. */
.toast { cursor: pointer; width: max-content; }
.ap-revoke { grid-template-columns: 1fr auto; }
@media (max-width: 640px) { .ap-revoke { grid-template-columns: 1fr; } }

/* CEN-51: "Só eu concluo" — segura a conclusão do card com o Renato */
.hold-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; }
.hold-row button { min-height: 44px; }
.hold-row .muted { flex: 1 1 220px; font-size: 14px; }
.hold-note { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0; padding: 10px 12px; border: 1px dashed var(--lock); border-radius: 8px; }
.hold-note svg { flex: 0 0 auto; margin-top: 2px; }
@media (max-width: 640px) { .hold-row button { flex: 1 1 100%; } }
