:root {
  --bg: #ffffff;
  --gutter: #f6f8fa;
  --ink: #1f2328;
  --muted: #4b5563;
  --line: #d0d7de;
  --raise: #f6f8fa;
  --accent: #0969da;
  --accent-ink: #ffffff;
  --late: #cf222e;
  --ok: #1a7f37;
  --win: #1a7f37;
  --pri-alta: #cf222e;
  --pri-media: #9a6700;
  --pri-baixa: #8c959f;
  --font-ui: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-num: "IBM Plex Mono", ui-monospace, monospace;
  --pad: 20px;
  --nav: 56px;
  --col: 480px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--gutter);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.45;
}

body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

input,
select,
textarea {
  font-size: 16px;
}

button {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

a {
  color: var(--accent);
  text-decoration: none;
}

#app {
  width: 100%;
  max-width: var(--col);
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.screen {
  min-height: 100dvh;
  padding: calc(16px + env(safe-area-inset-top)) var(--pad) calc(var(--nav) + 64px + env(safe-area-inset-bottom));
}

.screen.auth,
.screen.onboard {
  padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

.kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
}

.display {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.lede {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.flash {
  margin: 12px 0 0;
  color: var(--ok);
  font-size: 13px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field span,
.field-label {
  color: var(--muted);
  font-size: 12px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 6px;
  outline: none;
}

.field textarea {
  min-height: 80px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
}

.btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-ghost {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-text {
  background: transparent;
  color: var(--ink);
  min-height: 32px;
  font-size: 13px;
}

.btn-exit {
  color: var(--late);
  font-weight: 600;
}

.btn-late {
  background: var(--late);
  color: #fff;
}

.btn s {
  opacity: 0.75;
}

.links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
}

.links a {
  color: var(--accent);
}

.home-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.faces {
  display: flex;
  gap: 10px;
  margin: 16px 0 10px;
}

.home-line {
  margin: 0 0 4px;
  font-size: 14px;
}

.home-line a {
  color: var(--ink);
}

.home-line a:hover {
  color: var(--accent);
}

.teaser {
  display: block;
  margin: 16px 0 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--raise);
  color: inherit;
}

.teaser-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.score-lg {
  font-family: var(--font-num);
  font-size: 18px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.teaser-meta {
  text-align: right;
  color: var(--muted);
  font-size: 12px;
}

.teaser-meta strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 20px 0 6px;
}

.section-head h2,
.block-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.task {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-align: left;
  width: 100%;
}

.task-title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pri-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pri-baixa);
  flex: 0 0 auto;
}

.pri-alta .pri-dot {
  background: var(--pri-alta);
}

.pri-media .pri-dot {
  background: var(--pri-media);
}

.pri-baixa .pri-dot {
  background: var(--pri-baixa);
}

.pts-badge {
  color: var(--ok);
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.task-sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.task-flag {
  color: var(--late);
  font-size: 11px;
}

.task.is-late .task-title {
  color: var(--late);
}

.task.is-done {
  opacity: 0.55;
}

.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0 auto;
  width: 100%;
  max-width: var(--col);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg);
  border-top: 1px solid var(--line);
  z-index: 5;
}

.nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.nav a.active {
  color: var(--accent);
}

.nav svg,
.icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}

.meta-row dt {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.meta-row dd {
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 500;
}

.who-block {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: start;
  margin: 0 0 16px;
}

.who-block .lede {
  margin-top: 4px;
}

.comments {
  margin: 4px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment,
.hist {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
}

.hist {
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.comment-who {
  font-size: 13px;
  font-weight: 600;
}

.comment-at {
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
}

.comment-text {
  margin: 2px 0 0;
  font-size: 14px;
}

.seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  margin: 14px 0 8px;
}

.seg button {
  min-height: 32px;
  color: var(--muted);
  font-size: 13px;
}

.seg button.active {
  background: var(--raise);
  color: var(--ink);
  font-weight: 600;
}

.onboard .seg {
  grid-template-columns: 1fr 1fr;
}

.statline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.statline button,
.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding: 8px 10px;
  color: inherit;
  border-right: 1px solid var(--line);
}

.statline button:last-child {
  border-right: 0;
}

.statline .num,
.stat .num {
  font-family: var(--font-num);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.statline .lbl,
.stat .lbl {
  color: var(--muted);
  font-size: 11px;
}

.statline button.active {
  background: var(--raise);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.statline button.active .num {
  color: var(--accent);
}

.statline button.is-late .num {
  color: var(--late);
}

.statline button.is-done .num {
  color: var(--ok);
}

.statline button.is-late.active {
  box-shadow: inset 0 -2px 0 var(--late);
}

.statline button.is-done.active {
  box-shadow: inset 0 -2px 0 var(--ok);
}

.trophy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.trophy {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: var(--bg);
}

.trophy-label {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
}

.trophy-side {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.trophy-tag {
  margin: 0;
  font-size: 11px;
}

.trophy-side.best .trophy-tag {
  color: var(--ok);
}

.trophy-side.worst .trophy-tag {
  color: var(--late);
}

.trophy-who,
.trophy-val,
.trophy-tie {
  margin: 0;
  font-size: 13px;
}

.trophy-val,
.trophy-tie {
  color: var(--muted);
  font-size: 12px;
}

.faces-mini {
  display: flex;
}

.faces-mini .avatar {
  margin-right: -6px;
  box-shadow: 0 0 0 2px var(--bg);
}

.timeline {
  position: relative;
  margin-top: 12px;
  padding-left: 16px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--line);
}

.tl-day {
  margin: 18px 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.tl-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center;
  position: relative;
  padding: 10px 0;
  color: inherit;
}

.tl-dot {
  position: absolute;
  left: -16px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--bg);
}

.badge {
  color: var(--ok);
  font-size: 11px;
  font-weight: 500;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: var(--raise);
}

.avatar.sm {
  width: 28px;
  height: 28px;
}

.avatar.lg {
  width: 48px;
  height: 48px;
}

.who-block .avatar.lg {
  width: 56px;
  height: 56px;
}

.cols {
  display: grid;
  grid-template-columns: 1fr 64px 64px;
  gap: 0;
  margin: 8px 0 20px;
}

.cols-head,
.cols-row {
  display: contents;
}

.cols-head span {
  color: var(--muted);
  font-size: 11px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--line);
}

.cols-head span:not(:first-child),
.cols-row strong {
  text-align: right;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}

.cols-row span,
.cols-row strong {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 400;
}

.reward {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.reward h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

.reward p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.reward-cost {
  font-family: var(--font-num);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--muted);
}

.wallet-strip {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 12px 0 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--raise);
}

.wallet-strip .num {
  font-family: var(--font-num);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.invite {
  margin: 8px 0 12px;
  padding: 12px 14px;
  font-family: var(--font-num);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-align: center;
  background: var(--raise);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.avatars {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.avatars button {
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid transparent;
  background: transparent;
  border-radius: 50%;
  overflow: hidden;
}

.avatars button img {
  width: 100%;
  height: 100%;
  display: block;
}

.avatars button.active {
  border-color: var(--accent);
}

.empty {
  color: var(--muted);
  font-size: 13px;
  padding: 12px 0;
}

.split {
  display: grid;
  gap: 24px;
}

.split-block {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.member-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.err {
  color: var(--late);
  font-size: 13px;
  margin: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 20px;
}

.brand img {
  display: block;
  border-radius: 6px;
}

.brand span {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}

.page-head .kicker {
  margin-bottom: 2px;
}

.top-avatar {
  flex: 0 0 auto;
  margin-top: 2px;
}

.top-avatar .avatar {
  width: 32px;
  height: 32px;
}

.pass-wrap {
  position: relative;
  display: block;
}

.pass-wrap input {
  padding-right: 40px;
}

.pass-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.pass-toggle .icon {
  width: 16px;
  height: 16px;
}

.when-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chips button,
.chip-check span {
  min-width: 36px;
  min-height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  font-family: var(--font-num);
}

.chips button.active,
.chip-check input:checked + span {
  border-color: var(--accent);
  background: var(--raise);
  color: var(--accent);
  font-weight: 600;
}

.chip-check {
  position: relative;
}

.chip-check input {
  position: absolute;
  opacity: 0;
  inset: 0;
}

.pick-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  text-align: left;
}

.pick-list {
  display: none;
  flex-direction: column;
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.pick-list.is-open {
  display: flex;
}

.pick-list button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  text-align: left;
  width: 100%;
}

.pick-list button:hover {
  background: var(--raise);
}

.is-hidden {
  display: none;
}

.fab {
  position: fixed;
  right: max(20px, calc((100vw - var(--col)) / 2 + 20px));
  bottom: calc(var(--nav) + 12px + env(safe-area-inset-bottom));
  z-index: 6;
  min-height: 40px;
  padding: 0 16px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 500;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(9, 105, 218, 0.25);
}

.screen.has-fab {
  padding-bottom: calc(var(--nav) + 64px + env(safe-area-inset-bottom));
}

.avatar-wrap {
  position: relative;
}

.done-mark {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.done-mark .icon {
  width: 12px;
  height: 12px;
  stroke-width: 3;
}

.who-block.is-resolved .kicker,
.who-block.is-resolved .display,
.who-block.is-resolved .lede {
  opacity: 0.62;
}

.who-block s {
  color: var(--muted);
}

.boards {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.board {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.board h2 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
}

.board-row {
  display: grid;
  grid-template-columns: 28px 72px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
}

.board-name {
  font-size: 13px;
}

.board-track {
  height: 4px;
  background: var(--raise);
  border-radius: 2px;
  overflow: hidden;
}

.board-track i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}

.board-row.is-lead .board-track i {
  background: var(--ok);
}

.board-val {
  font-family: var(--font-num);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.board-row.is-lead .board-val {
  color: var(--ink);
}

.need {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-align: right;
}

.reward-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--raise);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}

.reward-mark .icon {
  width: 18px;
  height: 18px;
}
