:root {
  --paper: #f4efe6;
  --surface: #fbf8f2;
  --card: #ffffff;
  --ink: #26211c;
  --muted: #6f665c;
  --line: #ddd4c5;
  --accent: #7a2e2a;
  --accent-ink: #ffffff;
  --danger: #a3271f;
  --shadow: 0 1px 2px rgb(38 33 28 / 0.08), 0 2px 8px rgb(38 33 28 / 0.05);
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1b1815;
    --surface: #24201c;
    --card: #2d2823;
    --ink: #efe8dc;
    --muted: #a69c8e;
    --line: #3f3830;
    --accent: #d98c7f;
    --accent-ink: #1b1815;
    --danger: #ef8a7e;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4);
  }
}

.c-vinho { --c: #8c2f39; }
.c-ambar { --c: #b7791f; }
.c-oliva { --c: #6b7a2a; }
.c-petroleo { --c: #1f6f6b; }
.c-azul { --c: #2f5d8c; }
.c-ameixa { --c: #6d3b7a; }
.c-grafite { --c: #5c5750; }

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.45 var(--sans);
}

#app { min-height: 100%; display: flex; flex-direction: column; }

h1, h2 { font-family: var(--serif); font-weight: 600; margin: 0; text-wrap: balance; }
p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.spacer { flex: 1; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.hint { color: var(--muted); font-size: 13px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- controles ---------- */

.btn {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 6px;
  padding: 7px 12px;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:disabled { opacity: 0.6; cursor: default; }
.btn.danger { color: var(--danger); border-color: transparent; background: none; }
.btn.danger:hover { border-color: var(--danger); }
.btn.quiet { border-color: transparent; background: none; color: var(--muted); }
.btn.quiet:hover { color: var(--ink); border-color: var(--line); }

.icon {
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
  width: 30px;
  height: 30px;
  font-size: 18px;
  line-height: 1;
  flex: none;
}
.icon:hover { background: var(--line); color: var(--ink); }

input:not([type='checkbox'], [type='radio']), select, textarea {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 6px;
  padding: 7px 10px;
  max-width: 100%;
}
textarea { resize: vertical; }

.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }

.field { display: flex; flex-direction: column; gap: 5px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > label, .field > legend { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0; }
.field > legend { margin-bottom: 5px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.swatches { display: flex; gap: 8px; }
.swatch { width: 28px; height: 28px; border-radius: 50%; background: var(--c); cursor: pointer; position: relative; }
.swatch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.swatch:has(input:checked) { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }
.swatch:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 5px; }

.form-error { color: var(--danger); font-size: 14px; min-height: 0; }
.form-error:empty { display: none; }

/* ---------- topo ---------- */

.brand { font-family: var(--serif); font-weight: 600; font-size: 21px; letter-spacing: 0.01em; }

.top {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex-wrap: wrap;
}
.top nav { display: flex; gap: 2px; margin-left: 14px; }
.tab {
  border: 0;
  background: none;
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--muted);
}
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); font-weight: 600; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.who { color: var(--muted); font-size: 14px; margin-right: 4px; }

.toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px 0; }

/* ---------- quadro ---------- */

main.tasks { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.board {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px 24px;
  overflow-x: auto;
}

.column {
  flex: none;
  width: 290px;
  max-width: 86vw;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--c);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.column.ghost { border: 1px dashed var(--line); background: none; }
.column > header, .theme > header { display: flex; align-items: center; gap: 8px; }
.column h2, .theme h2 { font-size: 17px; overflow-wrap: anywhere; }
.count { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; flex: 1; }

.cards { display: flex; flex-direction: column; gap: 8px; min-height: 12px; }
.cards.drop-end::after { content: ''; height: 3px; border-radius: 2px; background: var(--accent); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: grab;
}
.card.dragging { opacity: 0.4; }
.card.drop-before { box-shadow: 0 -3px 0 var(--accent); }
.card.s-done .card-title { color: var(--muted); text-decoration: line-through; }
.card-top { display: flex; align-items: flex-start; gap: 10px; }
.card-top .card-title { flex: 1; }
.check-btn {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--muted);
  background: none;
  color: transparent;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  position: relative;
}
/* Área de toque um pouco maior, mas só para fora do cartão: nunca por cima do título. */
.check-btn::after { content: ''; position: absolute; inset: -6px 0 -4px -8px; }
.check-btn:hover { border-color: #4f7a3a; color: #4f7a3a; }
.check-btn.on { background: #4f7a3a; border-color: #4f7a3a; color: #fff; }
.btn.done { border-color: #4f7a3a; color: #3d6229; font-weight: 600; }
@media (prefers-color-scheme: dark) {
  .btn.done { color: #9cc986; }
}

.card-title {
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.card-title:hover { text-decoration: underline; }
.card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.pill {
  border: 1px solid var(--line);
  background: none;
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 12px;
  cursor: pointer;
  color: var(--muted);
}
.pill.s-doing { border-color: #b7791f; color: #8a5a12; background: rgb(183 121 31 / 0.12); }
.pill.s-done { border-color: #4f7a3a; color: #3d6229; background: rgb(79 122 58 / 0.12); }
@media (prefers-color-scheme: dark) {
  .pill.s-doing { color: #e6b566; }
  .pill.s-done { color: #9cc986; }
}

.due { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.due.overdue { color: var(--danger); font-weight: 600; }

.avatars { display: inline-flex; }
.avatars .avatar { margin-left: -5px; box-shadow: 0 0 0 2px var(--card); }
.avatar {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex: none;
}
.avatar.inactive { opacity: 0.45; }
.av-0 { background: #8c2f39; }
.av-1 { background: #2f5d8c; }
.av-2 { background: #6b7a2a; }
.av-3 { background: #6d3b7a; }
.av-4 { background: #1f6f6b; }
.av-5 { background: #9a6417; }

.quick {
  border: 1px dashed transparent !important;
  background: none !important;
  width: 100%;
  color: var(--muted);
}
.quick:hover, .quick:focus { border-color: var(--line) !important; background: var(--card) !important; color: var(--ink); }

/* ---------- referências ---------- */

.themes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 12px;
  padding: 14px 16px 24px;
  align-items: start;
}
.theme {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.theme ul { display: flex; flex-direction: column; }
.ref { padding: 8px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.ref-head { display: flex; align-items: flex-start; gap: 8px; }
.ref-head > :first-child { flex: 1; overflow-wrap: anywhere; padding-top: 4px; }
.ref-head a { color: var(--accent); font-weight: 600; text-underline-offset: 2px; }
.note { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.theme .btn.quiet { align-self: flex-start; padding-left: 0; }
.empty { padding: 14px 16px 0; }

.ref.drop-here { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: 4px; }
.ref-foot { display: flex; align-items: center; gap: 8px; }
.btn.small { padding: 2px 8px; font-size: 13px; }

.preview {
  display: flex;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  font-weight: 400;
  margin: 4px 0;
}
.preview:hover { border-color: var(--muted); }
.preview img { width: 96px; min-height: 72px; object-fit: cover; flex: none; background: var(--line); }
.preview-text { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 8px 0; font-size: 13px; min-width: 0; }
.preview-text:first-child { padding-left: 10px; }
.preview-text strong { color: var(--ink); font-weight: 600; }
.preview-text > * { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.preview-text span { color: var(--muted); }

.embed { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.embed .btn { padding-left: 0; }
.embed iframe { width: 100%; height: 560px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; margin: 4px 0; }
.thumb { border: 1px solid var(--line); border-radius: 6px; padding: 0; overflow: hidden; cursor: zoom-in; aspect-ratio: 1; background: var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.modal.lightbox { width: min(900px, calc(100vw - 32px)); }
.stage { position: relative; display: grid; place-items: center; min-height: 200px; margin-bottom: 14px; touch-action: pan-y; }
.lightbox img { display: block; max-width: 100%; max-height: 72vh; border-radius: 6px; user-select: none; -webkit-user-drag: none; }
.nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgb(20 16 12 / 0.6);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  padding-bottom: 4px;
  cursor: pointer;
}
.nav:hover { background: rgb(20 16 12 / 0.85); }
.nav.prev { left: 6px; }
.nav.next { right: 6px; }
.thumb { position: relative; }
.thumb-reactions {
  position: absolute;
  left: 3px;
  bottom: 3px;
  background: rgb(20 16 12 / 0.72);
  color: #fff;
  border-radius: 999px;
  padding: 0 6px;
  font-size: 11px;
  line-height: 18px;
  white-space: nowrap;
}
.reactions { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 14px; }
.react {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 44px;
  min-height: 36px;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 18px;
  cursor: pointer;
}
.react span { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); }
.react:hover { border-color: var(--muted); }
.react.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--card)); }
.react.on span { color: var(--ink); font-weight: 600; }
.lightbox a.btn { text-decoration: none; color: inherit; }

/* ---------- janela do item e comentários ---------- */

.modal.item { width: min(600px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
.modal.item[open] { display: flex; flex-direction: column; gap: 12px; }
.item-head { display: flex; align-items: flex-start; gap: 8px; }
.item-head h2 { flex: 1; overflow-wrap: anywhere; padding-top: 2px; }
.modal.item h3 { font: 600 13px var(--sans); color: var(--muted); margin: 4px 0 0; text-transform: uppercase; letter-spacing: 0.05em; }
.details { display: flex; flex-direction: column; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chips .pill { cursor: default; }
.chip { font-size: 12px; border-radius: 999px; padding: 1px 9px; color: #fff; background: var(--c); }
.person { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.rich { white-space: pre-wrap; overflow-wrap: anywhere; }
.rich a { color: var(--accent); }
.mention { color: var(--accent); font-weight: 600; }
.mention.me { background: rgb(183 121 31 / 0.22); border-radius: 3px; padding: 0 2px; }

.thread { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; min-height: 40px; max-height: 38vh; padding: 0; margin: 0; list-style: none; }
.comment { display: flex; gap: 10px; align-items: flex-start; }
.comment > div { min-width: 0; flex: 1; }
.comment-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.linklike { border: 0; background: none; padding: 0; color: var(--muted); font-size: 12px; cursor: pointer; text-decoration: underline; }
.linklike:hover { color: var(--danger); }

.c-reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.react.small { min-width: 0; min-height: 26px; padding: 0 8px; font-size: 14px; gap: 4px; }
.react.small span { font-size: 12px; }
.react.add { color: var(--muted); border-style: dashed; font-size: 13px; }
.modal .composer { gap: 8px; }
.composer-box { position: relative; }
.composer textarea { width: 100%; display: block; }
.suggest {
  position: absolute;
  left: 0;
  bottom: 100%;
  margin-bottom: 4px;
  min-width: 220px;
  max-height: 200px;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.18);
  padding: 4px;
  z-index: 2;
}
.suggest[hidden] { display: none; }
.suggest li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 5px; cursor: pointer; }
.suggest li.on, .suggest li:hover { background: var(--paper); }

.btn.alert { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); font-weight: 600; }
.btn.alert:hover { color: var(--accent-ink); }
.mention-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.mention-list button { width: 100%; text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 6px; padding: 9px 11px; cursor: pointer; }
.mention-list button:hover { border-color: var(--muted); }
.excerpt { display: block; margin-top: 3px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }

.passkey-list { display: flex; flex-direction: column; gap: 6px; }
.passkey-list li:not(.hint) { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--card); border-radius: 6px; padding: 8px 10px; flex-wrap: wrap; }

/* ---------- dependências ---------- */

.blocked { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.card.is-blocked { background: color-mix(in srgb, var(--card) 55%, var(--surface)); border-style: dashed; box-shadow: none; }
.deps ul { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.deps button { width: 100%; display: flex; align-items: center; gap: 8px; text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 6px; padding: 6px 10px; cursor: pointer; }
.deps button:hover { border-color: var(--muted); }
.deps .dep-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.deps .done .dep-title { color: var(--muted); text-decoration: line-through; }
.deps .mark { color: var(--muted); width: 14px; text-align: center; }
.deps .done .mark { color: #4f7a3a; font-weight: 700; }
.checks { max-height: 190px; overflow-y: auto; }
.modal:not(.item) { max-height: calc(100dvh - 32px); overflow-y: auto; }

/* ---------- busca ---------- */

.modal.spotlight { width: min(620px, calc(100vw - 24px)); margin-top: 12vh; padding: 0; max-height: 70vh; overflow: hidden; }
.modal.spotlight[open] { display: flex; flex-direction: column; }
.spot-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.spot-input input { flex: 1; border: 0 !important; background: none !important; padding: 0 !important; font-size: 18px; outline: none; min-width: 0; }
.spot-input input::-webkit-search-cancel-button { display: none; }
.spot-status { padding: 14px 16px; }
.spot-status[hidden] { display: none; }
.spot-results { overflow-y: auto; padding: 6px; }
.spot-results:empty { display: none; }
.spot-results li { display: flex; align-items: baseline; gap: 10px; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.spot-results li.on { background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.spot-type { flex: none; width: 84px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.spot-main { display: flex; flex-direction: column; min-width: 0; }
.spot-main strong, .spot-main .hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.picked { display: flex; flex-direction: column; gap: 4px; }
.picked:empty { display: none; }
.picked-item { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--card); border-radius: 6px; padding: 5px 6px 5px 10px; font-size: 14px; overflow-wrap: anywhere; }
.picked-item button { margin-left: auto; flex: none; border: 0; background: none; color: var(--muted); cursor: pointer; width: 26px; height: 26px; border-radius: 5px; }
.picked-item button:hover { background: var(--line); color: var(--ink); }
.composer-box > input { width: 100%; }
.suggest li { overflow-wrap: anywhere; }

/* ---------- novidades ---------- */

.bell { position: relative; padding-left: 8px; padding-right: 8px; display: inline-flex; align-items: center; }
.bell svg { display: block; }
.bell.has { color: var(--ink); }
.bell .badge {
  position: absolute;
  top: -2px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.activity { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.activity .day { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; padding: 10px 0 4px; }
.activity button {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  border: 0;
  background: none;
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
}
.activity button:hover { background: var(--paper); }
.activity button.unread { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.act-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.act-text em { font-style: normal; font-weight: 600; }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 7px; }

/* ---------- arquivos ---------- */

.theme.drop-here { outline: 2px dashed var(--accent); outline-offset: 2px; }
.file { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.ext {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.file-main { flex: 1; min-width: 0; }
.file-main a { color: var(--accent); font-weight: 600; text-underline-offset: 2px; overflow-wrap: anywhere; }
a.icon { display: grid; place-items: center; text-decoration: none; }
.files > .hint.empty { padding-bottom: 24px; }
a.btn { text-decoration: none; color: inherit; display: inline-block; }
.backup { margin: 0 16px 16px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.backup h2 { font-size: 17px; }
.top nav { overflow-x: auto; scrollbar-width: none; }
.tab { white-space: nowrap; flex: none; }

/* ---------- conta corrente ---------- */

main.ledger { max-width: 980px; width: 100%; }
.balances { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; padding: 14px 16px 0; }
.balance { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.balance strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.balance.total { background: var(--card); border-color: var(--muted); }
.balance .person { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.expenses { margin: 14px 16px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.expense { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--line); }
.expense:first-child { border-top: 0; }
.expense.settled { opacity: 0.6; }
.expense.drop-here { outline: 2px dashed var(--accent); outline-offset: -2px; }
.exp-date { flex: none; width: 46px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.exp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; overflow-wrap: anywhere; }
.exp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.exp-meta .avatar { width: 18px; height: 18px; font-size: 8px; }
.exp-meta .person { font-size: 13px; }
.attach { display: inline-flex; align-items: center; gap: 4px; }
.attach a { color: var(--accent); }
.attach .linklike { text-decoration: none; }
.exp-amount { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; padding-top: 1px; white-space: nowrap; }
.expense > .icon { margin-top: -4px; }
main.ledger > .hint.empty { padding-bottom: 24px; }
.thumbs.big { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }

/* ---------- pessoas ---------- */

main.people { max-width: 680px; }
main.people > .hint { padding: 0 16px 24px; }
.people-list { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.people-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  flex-wrap: wrap;
}
.people-list li.inactive strong { color: var(--muted); }
.people-list .avatar { width: 32px; height: 32px; font-size: 12px; }
.tag { font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; color: var(--muted); }

/* ---------- diálogo e login ---------- */

.modal {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  padding: 20px;
  width: min(460px, calc(100vw - 32px));
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.25);
}
.modal::backdrop { background: rgb(20 16 12 / 0.5); }
.modal > p { margin: 12px 0; }
.modal form, .login form { display: flex; flex-direction: column; gap: 14px; }
.modal h2 { font-size: 20px; }
.modal-actions { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }

.login { flex: 1; display: grid; place-items: center; padding: 16px; }
.login form {
  width: min(340px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
}
.login .brand { font-size: 30px; }

#toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: var(--paper);
  padding: 9px 14px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.show.has-action { pointer-events: auto; display: flex; align-items: center; gap: 12px; }
#toast button { border: 1px solid currentColor; background: none; color: inherit; border-radius: 6px; padding: 3px 10px; font-weight: 600; cursor: pointer; flex: none; }
.pill:disabled { cursor: default; opacity: 1; }

@media (max-width: 560px) {
  .who, .composer .hint { display: none; }
  .top nav { margin-left: 0; order: 3; width: 100%; }
  .board { scroll-snap-type: x proximity; }
  .column { scroll-snap-align: center; }
}
