/*
 * Casca nova do Atlas: Início, Quadro, etiquetas de frente e menu principal com ícones.
 * Só usa os tokens Studio do DESIGN.md (--bg, --paper, --ink, --muted, --line, --orange como acento)
 * e os cinco tokens de frente definidos aqui. Nenhuma classe de atelier.css, premium.css ou glass.css.
 */

:root {
  --front-agisales: var(--c-8fb8ff);
  --front-eu-sou-visto: var(--c-f2b077);
  --front-segundo-cerebro: var(--c-bda6f7);
  --front-rotina: var(--c-86d6b4);
  --front-outras: var(--c-b3bfd0);
  --front-none: var(--c-8d9bb0);
  --shell-accent: var(--c-c5d794);
  --shell-on-accent: var(--c-172117);
  --shell-raise: var(--c-1a2432);
  --shell-sink: var(--c-0f161f);
  --shell-warn: var(--c-efb29c);
  --shell-radius: 18px;
  --shell-ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- ícones Phosphor ---------- */

svg.ph {
  width: 18px;
  height: 18px;
  fill: currentColor;
  stroke: none;
  flex-shrink: 0;
}

.atlas-studio .nav button svg.ph {
  width: 17px;
  height: 17px;
}

.bottomnav button svg.ph {
  width: 22px;
  height: 22px;
}

.breadcrumb[hidden] {
  display: none !important;
}

@media (min-width: 901px) {
  .more-compact-only {
    display: none !important;
  }
}

/* ---------- etiquetas de frente ---------- */

.ft-tag,
.ft-chip {
  --front: var(--front-none);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--front);
  border-radius: 999px;
}

.ft-tag {
  padding: 4px 10px 4px 8px;
  background: color-mix(in srgb, var(--front) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--front) 26%, transparent);
  flex-shrink: 0;
}

.ft-tag i,
.ft-chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--front);
  flex-shrink: 0;
}

.ft-agisales { --front: var(--front-agisales); }
.ft-eu-sou-visto { --front: var(--front-eu-sou-visto); }
.ft-segundo-cerebro { --front: var(--front-segundo-cerebro); }
.ft-rotina { --front: var(--front-rotina); }
.ft-outras { --front: var(--front-outras); }

.ft-none {
  --front: var(--front-none);
  border-style: dashed;
  background: transparent;
}

.ft-none i {
  background: transparent;
  border: 1.5px solid var(--front);
}

/* ---------- Início ---------- */

.hm {
  max-width: 1240px;
  margin: 28px auto 0;
  display: grid;
  gap: 20px;
}

.hm button,
.bd button {
  font: inherit;
  color: inherit;
}

.hm :is(button, input, select):focus-visible,
.bd :is(button, input, select, summary):focus-visible {
  outline: 2px solid var(--shell-accent);
  outline-offset: 2px;
}

.hm-capture {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 8px 8px 8px 18px;
  background: linear-gradient(180deg, var(--shell-raise), var(--paper));
  border: 1px solid var(--line);
  border-radius: var(--shell-radius);
  box-shadow: 0 1px 0 var(--c-ffffff08) inset, 0 18px 40px -28px var(--c-000000);
  transition: border-color .18s var(--shell-ease), box-shadow .18s var(--shell-ease);
}

.hm-capture:focus-within {
  border-color: color-mix(in srgb, var(--shell-accent) 60%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--shell-accent) 12%, transparent), 0 18px 40px -28px var(--c-000000);
}

.hm-capture-mark {
  display: grid;
  place-items: center;
  color: var(--shell-accent);
}

.hm-capture-mark svg.ph {
  width: 20px;
  height: 20px;
}

.hm-capture input {
  flex: 1 1 200px;
  min-width: 0;
  min-height: 44px;
  background: transparent;
  border: 0;
  color: var(--ink);
  font: 500 15px/1.4 inherit;
}

.hm-capture input::placeholder {
  color: var(--muted);
  opacity: .8;
  font-weight: 400;
}

.hm-capture input:focus-visible {
  outline: none;
}

.hm-capture select {
  min-height: 44px;
  max-width: 170px;
  padding: 0 30px 0 12px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  background-color: var(--shell-sink);
  border: 1px solid var(--line);
  border-radius: 12px;
  color-scheme: dark;
}

.hm-capture-go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  background: var(--shell-accent);
  color: var(--shell-on-accent) !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  border-radius: 12px;
  transition: transform .12s var(--shell-ease), filter .12s var(--shell-ease);
}

.hm-capture-go:hover {
  filter: brightness(1.06);
}

.hm-capture-go:active {
  transform: scale(.97);
}

.hm-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
  gap: 20px;
  align-items: start;
}

.hm-side {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.hm-panel {
  min-width: 0;
  padding: 22px 22px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--shell-radius);
}

.hm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.hm-head h2 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -.2px;
  color: var(--ink);
}

.hm-sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

.hm-count {
  min-width: 34px;
  padding: 4px 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--shell-accent);
  background: color-mix(in srgb, var(--shell-accent) 12%, transparent);
  border-radius: 999px;
}

.hm-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 4px;
  font-size: 12px !important;
  color: var(--muted) !important;
}

.hm-link:hover {
  color: var(--ink) !important;
}

.hm-link svg.ph,
.hm-more svg.ph {
  width: 14px;
  height: 14px;
}

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

.hm-list > li + li {
  border-top: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
}

.hm-task {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  margin: 0 -10px;
  padding: 0 10px 0 2px;
  border-radius: 12px;
  transition: background .15s var(--shell-ease);
}

.hm-task:hover {
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}

.hm-check {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.hm-check::before {
  content: '';
  grid-area: 1 / 1;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--c-5b6b84);
  border-radius: 50%;
  transition: border-color .15s, background .15s;
}

.hm-check svg.ph {
  grid-area: 1 / 1;
  width: 12px;
  height: 12px;
  color: var(--shell-on-accent);
  opacity: 0;
  transition: opacity .15s;
}

.hm-check:hover::before {
  border-color: var(--shell-accent);
  background: var(--shell-accent);
}

.hm-check:hover svg.ph {
  opacity: 1;
}

.hm-task-open {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  align-content: center;
  text-align: left;
}

.hm-task-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hm-task-when {
  font-size: 11px;
  color: var(--muted);
}

.hm-task.is-overdue .hm-task-when {
  color: var(--shell-warn);
}

.hm-high,
.bd-high {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--shell-warn);
  flex-shrink: 0;
}

.hm-high svg.ph,
.bd-high svg.ph {
  width: 13px;
  height: 13px;
}

.hm-empty {
  padding: 22px 0 18px;
  font-size: 13px;
  color: var(--muted);
}

.hm-note {
  margin: 0 0 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--muted);
  background: var(--shell-sink);
  border: 1px dashed var(--line);
  border-radius: 12px;
}

.hm-note button {
  min-height: 32px;
  margin-left: 6px;
  color: var(--shell-accent) !important;
  font-weight: 600 !important;
  text-decoration: underline;
}

.hm-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--shell-accent) !important;
}

.hm-pending {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding: 12px 0 6px;
  border-top: 1px solid var(--line);
}

.hm-pending button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 14px;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--ink) !important;
  background: var(--shell-sink);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color .15s;
}

.hm-pending button:hover {
  border-color: var(--c-53627a);
}

.hm-pending [data-home-scope="overdue"] svg.ph {
  color: var(--shell-warn);
}

.hm-event {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}

.hm-event-time {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--shell-accent);
}

.hm-event-title {
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hm-origin {
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.hm-connect button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 48px;
  text-align: left;
  font-size: 13px !important;
  color: var(--muted) !important;
}

.hm-connect button:hover {
  color: var(--shell-accent) !important;
}

.hm-project {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  margin: 0 -10px;
  padding: 12px 10px;
  width: calc(100% + 20px);
  text-align: left;
  border-radius: 12px;
  transition: background .15s var(--shell-ease);
}

.hm-project:hover {
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}

.hm-project-top {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hm-project-name {
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hm-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hm-bar {
  flex: 1;
  height: 4px;
  background: var(--shell-sink);
  border-radius: 4px;
  overflow: hidden;
}

.hm-bar i {
  display: block;
  height: 100%;
  background: var(--shell-accent);
  border-radius: 4px;
}

.hm-ratio {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.hm-next {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hm-next svg.ph {
  width: 13px;
  height: 13px;
}

.hm-next.is-missing {
  color: var(--shell-accent);
}

.hm-skeleton {
  display: block;
  height: 18px;
  margin: 14px 0;
  background: linear-gradient(90deg, var(--shell-raise), var(--c-233144), var(--shell-raise));
  background-size: 200% 100%;
  border-radius: 8px;
  animation: hm-shimmer 1.4s linear infinite;
}

@keyframes hm-shimmer {
  to { background-position: -200% 0; }
}

/* ---------- Quadro ---------- */

.bd {
  margin-top: 18px;
}

.bd-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
}

.bd-fronts,
.bd-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ft-chip {
  min-height: 44px;
  padding: 0 10px 0 9px;
  font-size: 12px;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  transition: border-color .15s, color .15s, background .15s;
}

.ft-chip b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  opacity: .8;
}

.ft-chip:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--front) 55%, var(--line));
}

.ft-chip[aria-pressed="true"] {
  color: var(--front);
  background: color-mix(in srgb, var(--front) 14%, var(--paper));
  border-color: color-mix(in srgb, var(--front) 60%, transparent);
}

.ft-chip[aria-pressed="true"] b {
  color: var(--front);
}

.bd-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.bd-search:focus-within {
  border-color: color-mix(in srgb, var(--shell-accent) 60%, var(--line));
}

.bd-search input {
  width: 120px;
  min-width: 0;
  min-height: 42px;
  background: transparent;
  border: 0;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.bd-search input:focus-visible {
  outline: none;
}

.bd-tool,
.board-views > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--ink) !important;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  list-style: none;
  transition: border-color .15s;
}

.bd-tool::-webkit-details-marker,
.board-views > summary::-webkit-details-marker {
  display: none;
}

.bd-tool:hover,
.board-views > summary:hover {
  border-color: var(--c-53627a);
}

.bd-tool b {
  min-width: 18px;
  padding: 1px 6px;
  text-align: center;
  font-size: 11px;
  color: var(--shell-on-accent);
  background: var(--shell-accent);
  border-radius: 999px;
}

.bd-filters,
.board-views {
  position: relative;
}

.bd-filters-panel,
.board-views-menu {
  position: absolute;
  z-index: 6;
  top: calc(100% + 8px);
  right: 0;
  padding: 14px;
  background: var(--shell-raise);
  border: 1px solid var(--c-3a495f);
  border-radius: 14px;
  box-shadow: 0 24px 60px -20px var(--c-000000);
}

.bd-filters-panel {
  width: min(340px, calc(100vw - 40px));
  display: grid;
  gap: 10px;
}

.bd-filters-panel label {
  display: grid;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.bd-filters-panel select {
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  color: var(--ink);
  background: var(--shell-sink);
  border: 1px solid var(--c-53627a);
  border-radius: 10px;
  color-scheme: dark;
  font: inherit;
  font-size: 13px;
}

.board-views-menu {
  display: grid;
  gap: 4px;
  min-width: 170px;
  padding: 6px;
}

.board-views-menu button {
  min-height: 44px;
  padding: 0 12px;
  text-align: left;
  font-size: 13px;
  color: var(--ink);
  border-radius: 9px;
}

.board-views-menu button:hover {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}

.board-views-menu button[aria-pressed="true"] {
  color: var(--shell-accent);
  background: color-mix(in srgb, var(--shell-accent) 10%, transparent);
}

.bd-new {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: var(--shell-on-accent) !important;
  background: var(--shell-accent);
  border-radius: 12px;
  transition: transform .12s var(--shell-ease), filter .12s var(--shell-ease);
}

.bd-new:hover {
  filter: brightness(1.06);
}

.bd-new:active {
  transform: scale(.97);
}

.bd-active {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.bd-active-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px 0 14px;
  font-size: 12px !important;
  color: var(--ink) !important;
  background: color-mix(in srgb, var(--shell-accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--shell-accent) 34%, transparent);
  border-radius: 999px;
}

.bd-active-chip svg.ph {
  width: 12px;
  height: 12px;
  color: var(--muted);
}

.bd-clear {
  min-height: 44px;
  padding: 0 8px;
  font-size: 12px !important;
  color: var(--muted) !important;
  text-decoration: underline;
}

.bd-subnav {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.atlas-shell .bd-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  margin-top: 18px;
  padding-bottom: 6px;
}

.atlas-shell .bd-column {
  min-width: 0;
  min-height: 260px;
  padding: 14px;
  background: var(--shell-sink);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.bd-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 12px;
  font-size: 12px;
  font-weight: 650;
  color: var(--ink);
}

.bd-column-head span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.bd-column-head b {
  min-width: 24px;
  padding: 2px 8px;
  text-align: center;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.bd-stage {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.bd-stage-doing { background: var(--front-agisales); }
.bd-stage-waiting { background: var(--front-eu-sou-visto); }
.bd-stage-done { background: var(--shell-accent); }

.bd-column-body {
  display: grid;
  gap: 10px;
  align-content: start;
}

.bd-column-empty {
  padding: 18px 6px;
  font-size: 12px;
  color: var(--muted);
  opacity: .75;
}

.atlas-shell .bd-card {
  min-width: 0;
  padding: 6px 14px 14px;
  background: var(--shell-raise);
  border: 1px solid var(--c-334156);
  border-radius: 14px;
  box-shadow: 0 1px 0 var(--c-ffffff06) inset;
  cursor: grab;
  transition: border-color .15s var(--shell-ease), transform .15s var(--shell-ease), box-shadow .15s var(--shell-ease);
}

.atlas-shell .bd-card:hover {
  border-color: var(--c-53627a);
  transform: translateY(-1px);
  box-shadow: 0 1px 0 var(--c-ffffff06) inset, 0 14px 28px -20px var(--c-000000);
}

.bd-card-title {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 8px 0 6px;
  text-align: left;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  line-height: 1.45;
  color: var(--ink) !important;
  overflow-wrap: anywhere;
}

.bd-card.is-done .bd-card-title {
  color: var(--muted) !important;
  text-decoration: line-through;
  text-decoration-color: var(--c-53627a);
}

.bd-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.bd-due {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.bd-due svg.ph {
  width: 13px;
  height: 13px;
}

.bd-due.is-late {
  color: var(--shell-warn);
}

.bd-due.is-empty {
  opacity: .7;
}

.atlas-shell .bd-board.list-mode {
  grid-template-columns: minmax(0, 1fr);
}

.atlas-shell .bd-board.list-mode .bd-column {
  min-height: 0;
}

.atlas-shell .bd-board.list-mode .bd-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  padding: 4px 14px;
}

.atlas-shell .bd-board.list-mode .bd-card-title {
  flex: 1 1 260px;
  width: auto;
}

.bd .reminder-panel {
  margin-top: 28px;
}

/* ---------- detalhe da tarefa ---------- */

.detail-actions {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.detail-actions > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.detail-actions button {
  min-height: 44px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  background: var(--shell-sink);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.detail-actions button:hover {
  border-color: var(--c-53627a);
}

.detail-actions .detail-danger {
  margin-left: auto;
  color: var(--shell-warn);
  background: transparent;
}

/* Início e Quadro dispensam a trilha: o cabeçalho encolhe e a linha de ferramentas cabe em uma linha. */
@media (min-width: 901px) {
  .atlas-shell .topbar {
    height: 60px;
    justify-content: flex-end;
  }
}

@media (min-width: 1201px) {
  .bd-toolbar,
  .bd-tools {
    flex-wrap: nowrap;
  }

  .bd-tools {
    flex-shrink: 0;
  }

  .bd-fronts {
    flex-wrap: nowrap;
    min-width: 0;
    gap: 5px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .bd-tools {
    gap: 6px;
  }

  /* A busca fica recolhida no ícone e abre ao focar ou quando há texto, para as seis frentes caberem inteiras. */
  .bd-search {
    gap: 0;
    cursor: text;
  }

  .bd-search input {
    width: 0;
    transition: width .18s var(--shell-ease), margin .18s var(--shell-ease);
  }

  .bd-search:focus-within input,
  .bd-search input:not(:placeholder-shown) {
    width: 150px;
    margin-left: 8px;
  }

  .bd-fronts .ft-chip {
    flex: 0 0 auto;
  }
}

/* ---------- responsivo ---------- */

@media (min-width: 901px) and (max-width: 1100px) {
  .atlas-shell .bd-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .hm {
    margin-top: 14px;
    gap: 14px;
  }

  .hm-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .hm-side {
    gap: 14px;
  }

  .hm-capture {
    flex-wrap: wrap;
    padding: 8px 10px 10px 14px;
    gap: 8px;
  }

  .hm-capture input {
    flex-basis: calc(100% - 40px);
  }

  .hm-capture select {
    flex: 1 1 0;
    max-width: none;
    min-width: 0;
  }

  .hm-capture-go span {
    display: none;
  }

  .hm-capture-go {
    padding: 0 14px;
  }

  .hm-panel {
    padding: 16px 16px 10px;
  }

  .hm-task {
    flex-wrap: wrap;
    row-gap: 0;
    padding-bottom: 10px;
  }

  .hm-task-open {
    flex: 1 1 calc(100% - 60px);
    padding-top: 8px;
  }

  .hm-task-title {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .hm-task .hm-high {
    margin-left: 54px;
  }

  .hm-task .hm-high + .ft-tag {
    margin-left: 0;
  }

  .hm-task .ft-tag {
    margin-left: 54px;
  }

  .hm-task .hm-high {
    margin-left: 57px;
  }

  .bottomnav {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }

  .bd {
    margin-top: 12px;
  }

  .bd-toolbar {
    gap: 8px;
  }

  .bd-fronts {
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .bd-fronts::-webkit-scrollbar {
    display: none;
  }

  .bd-fronts .ft-chip {
    flex: 0 0 auto;
  }

  .bd-tools {
    flex-wrap: nowrap;
    width: 100%;
    gap: 6px;
  }

  .bd-search {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 10px;
  }

  .bd-search input {
    width: 100%;
  }

  .bd-tool span,
  .bd-new span {
    display: none;
  }

  .bd-tool,
  .bd-new,
  .board-views > summary {
    padding: 0 12px;
  }

  .board-views > summary {
    font-size: 11px !important;
  }

  .bd-filters-panel {
    position: fixed;
    top: auto;
    left: 12px;
    right: 12px;
    bottom: calc(96px + env(safe-area-inset-bottom));
    width: auto;
    max-height: 60dvh;
    overflow-y: auto;
  }

  .atlas-shell .bd-board {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    padding-bottom: 14px;
  }

  .atlas-shell .bd-column {
    flex: 0 0 min(80vw, 330px);
    scroll-snap-align: start;
  }

  .atlas-shell .bd-board.list-mode {
    display: grid;
    overflow-x: visible;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hm *,
  .bd *,
  .hm-capture {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------- Configuração ---------- */

.st {
  display: grid;
  gap: 18px;
  padding-top: 18px;
}

.st-title h1 {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -.4px;
  color: var(--ink);
}

.st-title p,
.st-head p {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

.st-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}

.st-panel {
  min-width: 0;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--shell-radius);
}

.st-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.st-head h2 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -.2px;
  color: var(--ink);
}

.st-fronts {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
}

.st-front {
  min-width: 0;
  padding: 12px 14px;
  background: var(--shell-sink);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.st-front-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.st-front-count {
  margin-right: auto;
  font-size: 11px;
  color: var(--muted);
}

.st-projects,
.st-accounts {
  list-style: none;
  margin: 0;
  padding: 0;
}

.st-project,
.st-account {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink);
}

.st-project {
  flex-wrap: wrap;
  padding: 8px 0 2px;
}

.st-project-name {
  flex: 1 1 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}

.st-project-count {
  margin-right: auto;
}

.st-front-count {
  white-space: nowrap;
}

.st-project-count {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--muted);
}

.st-empty {
  padding: 10px 0 4px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.st-account span {
  flex: 1;
  min-width: 0;
}

.st-state {
  flex-shrink: 0;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 14%, transparent);
}

.st-state-on {
  color: var(--shell-accent);
  background: color-mix(in srgb, var(--shell-accent) 14%, transparent);
}

.st-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.st-primary,
.st-secondary,
.st-add,
.st-link,
.st-segment button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 650;
  border-radius: 10px;
  transition: filter .12s var(--shell-ease), background .12s var(--shell-ease);
}

.st-primary {
  color: var(--shell-on-accent);
  background: var(--shell-accent);
}

.st-primary:hover {
  filter: brightness(1.06);
}

.st-secondary,
.st-add {
  color: var(--ink);
  background: var(--shell-raise);
  border: 1px solid var(--line);
}

.st-add {
  padding: 0 10px;
  min-height: 36px;
}

.st-link {
  padding: 0 6px;
  color: var(--shell-accent);
}

.st-secondary:hover,
.st-add:hover {
  filter: brightness(1.08);
}

.st-segment {
  display: inline-flex;
  padding: 3px;
  background: var(--shell-sink);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.st-segment button {
  min-width: 96px;
  color: var(--muted);
  border-radius: 9px;
}

.st-segment button[aria-pressed="true"] {
  color: var(--shell-on-accent);
  background: var(--shell-accent);
}

.st :is(button):focus-visible {
  outline: 2px solid var(--shell-accent);
  outline-offset: 2px;
}

@media (min-width: 720px) {
  .st-grid,
  .st-fronts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .st-panel-wide {
    grid-column: 1 / -1;
  }

  .st-project {
    flex-wrap: nowrap;
    padding: 0;
  }

  .st-project-name {
    flex: 1;
  }

  .st-panel {
    padding: 22px;
  }
}

@media (min-width: 1180px) {
  .st-fronts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .st-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .st-primary,
  .st-secondary,
  .st-add,
  .st-segment button {
    transition: none;
  }
}

/* ---------- E-mail ---------- */

.ml {
  display: grid;
  gap: 14px;
  padding-top: 18px;
}

.ml-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ml-title h1 {
  margin-right: auto;
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -.4px;
  color: var(--ink);
}

.ml-accounts {
  display: inline-flex;
  padding: 3px;
  background: var(--shell-sink);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.ml-accounts button {
  min-height: 38px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  border-radius: 9px;
}

.ml-accounts button[aria-pressed="true"] {
  color: var(--shell-on-accent);
  background: var(--shell-accent);
}

.ml-primary,
.ml-secondary,
.ml-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
  border-radius: 10px;
}

.ml-primary {
  color: var(--shell-on-accent);
  background: var(--shell-accent);
}

.ml-secondary,
.ml-back {
  color: var(--ink);
  background: var(--shell-raise);
  border: 1px solid var(--line);
}

.ml-back svg {
  transform: rotate(180deg);
}

.ml-gate {
  max-width: 560px;
  padding: 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--shell-radius);
}

.ml-gate h2 {
  font-size: 17px;
  font-weight: 650;
  color: var(--ink);
}

.ml-gate p {
  margin: 8px 0 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.ml-panes {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

.ml-folders {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.ml-folder {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-height: 40px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.ml-folder[aria-pressed="true"] {
  color: var(--ink);
  border-color: var(--shell-accent);
}

.ml-folder b {
  padding: 1px 7px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--shell-accent);
  background: color-mix(in srgb, var(--shell-accent) 14%, transparent);
  border-radius: 999px;
}

.ml-messages,
.ml-reader {
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--shell-radius);
}

.ml-messages {
  padding: 6px;
}

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

.ml-row {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 12px 12px 12px 16px;
  text-align: left;
  border-radius: 12px;
  border-left: 3px solid transparent;
}

.ml-list li + li .ml-row {
  border-top: 1px solid var(--line);
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.ml-row:hover,
.ml-row.is-open {
  background: var(--shell-raise);
}

.ml-row.is-unread {
  border-left-color: var(--shell-accent);
}

.ml-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.ml-from {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--ink);
}

.ml-row.is-unread .ml-from,
.ml-row.is-unread .ml-subject {
  font-weight: 700;
}

.ml-row time {
  flex-shrink: 0;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.ml-subject,
.ml-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.ml-subject {
  color: var(--ink);
}

.ml-preview {
  color: var(--muted);
}

.ml-marks {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--shell-warn);
}

.ml-marks svg {
  width: 13px;
  height: 13px;
}

.ml-clip {
  color: var(--muted);
}

.ml-note {
  padding: 18px 14px 10px;
  font-size: 13px;
  color: var(--muted);
}

.ml-messages > .ml-secondary {
  margin: 4px 14px 12px;
}

.ml-more {
  width: calc(100% - 28px);
}

.ml-reader {
  padding: 18px;
}

.ml-reader h2 {
  margin-top: 12px;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -.2px;
  overflow-wrap: anywhere;
  color: var(--ink);
}

.ml-sender {
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink);
}

.ml-sender span,
.ml-meta {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.ml-meta {
  margin-top: 3px;
}

.ml-images {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.ml-images button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 650;
  color: var(--ink);
  background: var(--shell-raise);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ml-reader-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px 16px;
  margin-bottom: 14px;
}

.ml-reader-who {
  flex: 1 1 260px;
  min-width: 0;
}

.ml-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ml-body {
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink);
}

.ml-frame {
  display: block;
  width: 100%;
  height: max(360px, calc(100dvh - 380px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

/* No celular a leitura ocupa a tela; a lista volta pelo botão Voltar. */
.ml-reader-empty,
.ml.is-reading .ml-folders,
.ml.is-reading .ml-messages {
  display: none;
}

.ml :is(button, a):focus-visible {
  outline: 2px solid var(--shell-accent);
  outline-offset: 2px;
}

@media (min-width: 900px) {
  .ml-panes {
    grid-template-columns: 180px minmax(260px, 340px) minmax(0, 1fr);
    align-items: stretch;
  }

  .ml-folders {
    align-self: start;
  }

  .ml-folders {
    flex-direction: column;
    overflow: visible;
  }

  .ml-folder {
    justify-content: space-between;
    border-radius: 10px;
  }

  .ml.is-reading .ml-messages {
    display: block;
  }

  .ml.is-reading .ml-folders {
    display: flex;
  }

  .ml-back {
    display: none;
  }

  /* No computador a caixa ocupa a altura da janela: a lista e a mensagem rolam por dentro, a página não. */
  .ml-panes {
    height: max(380px, calc(100dvh - 236px));
  }

  .ml-messages {
    height: 100%;
    overflow-y: auto;
  }

  .ml-reader {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding: 20px 22px 14px;
    overflow-y: auto;
  }

  .ml-reader-empty {
    display: block;
  }

  .ml-frame {
    flex: 1;
    height: auto;
    min-height: 0;
  }

  .ml-body {
    flex: 1;
  }

  .ml ~ .footer {
    display: none;
  }

  .ml {
    gap: 10px;
    padding-top: 10px;
  }

  .ml-title h1 {
    font-size: 20px;
  }

  .ml-title .ml-secondary {
    min-height: 36px;
  }

  .ml-reader h2 {
    margin-top: 0;
  }
}

/* ---------- E-mail: separar por conta de entrada (iCloud) ---------- */

.ml-boxes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ml-box {
  min-height: 34px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.ml-box[aria-pressed="true"] {
  color: var(--ink);
  border-color: var(--shell-accent);
  background: color-mix(in srgb, var(--shell-accent) 12%, transparent);
}
