
:root {
  --page: #e9e9eb; --surface: #ffffffb8; --solid: #ffffff; --text: #0b0b0b; --body: #3a3a3c; --muted: #6e6e73;
  --line: #0000000f; --fill: #0000000a; --press: #00000012; --accent: #48484a;
  --ok: #34c759; --warn: #ff9f0a; --bad: #ff3b30; --idle: #aeaeb2;
  --shadow: 0 1px 2px #0000000a, 0 8px 24px #0000000d;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1); --r: 20px; --rc: 12px;
  --head: "Inter Tight", -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  --sans: "Geist", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #0a0a0b; --surface: #1c1c1eb8; --solid: #1c1c1e; --text: #f5f5f7; --body: #c7c7cc; --muted: #8e8e93;
    --line: #ffffff14; --fill: #ffffff0f; --press: #ffffff1a; --accent: #a1a1a6;
    --ok: #30d158; --bad: #ff453a; --idle: #636366;
    --shadow: 0 1px 2px #00000066, 0 8px 24px #00000066;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--body); font: 400 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
h1, h2, h3, .brand, .n { font-family: var(--head); color: var(--text); letter-spacing: -0.015em; margin: 0; }
h1 { font-size: 28px; font-weight: 600; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; margin: 26px 0 10px; }
::selection { background: var(--accent); color: var(--solid); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.glass { background: var(--surface); border: 1px solid var(--line); backdrop-filter: saturate(1.8) blur(40px); -webkit-backdrop-filter: saturate(1.8) blur(40px); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }

.bar { position: sticky; top: 12px; z-index: 5; max-width: 1180px; margin: 12px auto 0; padding: 10px 12px 10px 22px; border-radius: var(--r);
  display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow); width: calc(100% - 32px); }
.brand { font-size: 17px; font-weight: 600; margin-right: auto; }
.pulse { color: var(--muted); font-size: 13px; white-space: nowrap; }
.controls { display: flex; align-items: center; gap: 14px; margin: 0; }

.seg { display: flex; padding: 3px; background: var(--fill); border-radius: var(--rc); }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 500; transition: all 0.2s var(--ease); }
.seg button[aria-pressed="true"] { background: var(--solid); color: var(--text); box-shadow: 0 1px 3px #0000001f; }

.switch { width: 46px; height: 28px; border-radius: 14px; border: 0; padding: 2px; background: var(--idle); cursor: pointer; transition: background 0.25s var(--ease); flex: none; }
.switch i { display: block; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #00000040; transition: transform 0.25s var(--ease); }
.switch[aria-checked="true"] { background: var(--ok); }
.switch[aria-checked="true"] i { transform: translateX(18px); }

.iconbtn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--rc); border: 0; background: none; color: var(--muted); cursor: pointer; transition: background 0.2s var(--ease); flex: none; }
.iconbtn:hover { background: var(--fill); color: var(--text); }

main { max-width: 1180px; margin: 0 auto; padding: 24px 16px 72px; }
main.solo { max-width: 680px; display: grid; gap: 18px; justify-items: start; }
main.solo > .card, main.solo > h1 { width: 100%; }
main.solo > .card:has(.sheet) { background: var(--solid); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.stat { display: grid; gap: 6px; padding: 16px 20px; border-radius: var(--r); border: 1px solid transparent; transition: background 0.2s var(--ease); }
.stat:hover { background: var(--fill); }
.stat.on { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }
.n { font-size: 32px; font-weight: 600; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.l { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 500; }
.stat.on .l { color: var(--body); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--idle); flex: none; display: inline-block; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }

.reasons, .chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.reasons { margin-bottom: 14px; }
.reasons a, .chips li { display: block; padding: 6px 12px; border-radius: 999px; background: var(--fill); font-size: 13px; color: var(--muted); transition: background 0.2s var(--ease); }
.reasons a:hover { background: var(--press); }
.reasons b { color: var(--text); font-weight: 600; margin-right: 6px; font-variant-numeric: tabular-nums; }
.reasons a[aria-current] { background: var(--text); color: var(--page); }
.reasons a[aria-current] b { color: inherit; }
.chips li { color: var(--body); }

.list { overflow: hidden; }
.list + .list { margin-top: 14px; }
.group { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 12px 10px 20px; border-bottom: 1px solid var(--line); }
.group h2 { font-size: 15px; }
.group form { margin: 0; }
.count { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: auto; }
.hint { color: var(--muted); font-size: 13px; }

.row { display: grid; grid-template-columns: 30px minmax(0, 200px) minmax(0, 1.5fr) minmax(0, 1.1fr) minmax(0, 1.3fr); align-items: center; gap: 16px;
  min-height: 50px; padding: 0 20px; border-top: 1px solid var(--line); transition: background 0.15s var(--ease); }
.v-enviadas .row, .v-andamento .row { grid-template-columns: 30px minmax(0, 200px) minmax(0, 1.5fr) minmax(0, 1.1fr) minmax(0, 1fr) 72px; }
.row:first-child, .group + .row { border-top: 0; }
.row:hover { background: var(--fill); }
.row:active { background: var(--press); }
.row > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.co { color: var(--text); font-weight: 600; }
.meta, .note, time { color: var(--muted); font-size: 13px; }
.note .dot { margin-right: 7px; vertical-align: 1px; }
.row time { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 56px 20px; text-align: center; color: var(--muted); margin: 0; }

.ring { position: relative; width: 30px; height: 30px; display: grid; place-items: center; flex: none; overflow: visible; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring .track { stroke: var(--fill); }
.ring .fill { stroke: var(--text); stroke-linecap: round; }
.ring b { font-size: 11px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.ring.none { border: 2.5px solid var(--fill); border-radius: 50%; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 16px; border-radius: var(--rc); border: 1px solid var(--line); background: var(--solid);
  color: var(--text); font-weight: 500; cursor: pointer; white-space: nowrap; transition: transform 0.15s var(--ease), background 0.2s var(--ease), opacity 0.2s var(--ease); }
.btn:hover { background: var(--fill); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--text); color: var(--page); border-color: transparent; }
.btn.primary:hover { opacity: 0.86; background: var(--text); }
.btn.quiet { background: none; border-color: transparent; color: var(--muted); }
.btn.quiet:hover { background: var(--fill); color: var(--text); }
.btn.sm { height: 32px; padding: 0 14px; font-size: 13px; border-radius: 10px; }

dialog { border: 0; padding: 0; background: var(--solid); color: var(--body); border-radius: 24px; width: min(620px, calc(100vw - 24px)); max-height: min(88vh, 860px);
  box-shadow: 0 24px 80px #00000040; overflow: auto; overscroll-behavior: contain; }
dialog::backdrop { background: #00000052; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
dialog[open] { animation: rise 0.3s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(0.985); } }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

.sheet { position: relative; display: flow-root; margin: 0; padding: 28px 30px 30px; }
.sheet > header { display: flex; align-items: center; gap: 16px; padding-right: 44px; }
.sheet > header .ring { width: 46px; height: 46px; }
.sheet > header .ring b { font-size: 15px; }
.sheet h2 { font-size: 21px; line-height: 1.2; }
.sheet header p { margin: 3px 0 0; color: var(--muted); }
.close { position: absolute; top: 16px; right: 16px; }
.status { display: flex; align-items: center; gap: 8px; margin: 20px 0 0; color: var(--text); font-weight: 500; }
.status time { font-weight: 400; }
.why { margin: 6px 0 0; }
.to { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.facts { display: flex; flex-wrap: wrap; gap: 14px 36px; margin: 22px 0 0; padding: 18px 0; border-block: 1px solid var(--line); }
dt { color: var(--muted); font-size: 12.5px; }
dd { margin: 2px 0 0; color: var(--text); overflow-wrap: anywhere; }
.asklist { margin: 20px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.asklist li { padding: 10px 14px; border-radius: var(--rc); background: var(--fill); color: var(--text); }
.mail { padding: 16px 18px; border-radius: var(--rc); background: var(--fill); display: grid; gap: 8px; }
.mail b { color: var(--text); font-weight: 600; }
.mail p { margin: 0; white-space: pre-wrap; }
.proof { margin: 0; color: var(--text); }
.qa { display: grid; gap: 12px; margin: 0 0 6px; }
.log { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; }
.log li { display: grid; grid-template-columns: 76px 1fr; gap: 12px; }

details { margin-top: 14px; }
details + details { margin-top: 0; }
summary { display: flex; align-items: center; gap: 8px; padding: 12px 0; cursor: pointer; list-style: none; font: 600 14px var(--head); color: var(--text); letter-spacing: -0.015em; border-radius: 8px; }
summary::-webkit-details-marker { display: none; }
summary .count { font: 400 13px var(--sans); letter-spacing: 0; }
summary::after { content: ""; width: 7px; height: 7px; margin-right: 4px; border-right: 1.75px solid var(--muted); border-bottom: 1.75px solid var(--muted); transform: rotate(-45deg); transition: transform 0.2s var(--ease); }
details[open] > summary::after { transform: rotate(45deg); }

.foot { position: sticky; bottom: 0; display: flex; align-items: center; gap: 10px; margin: 26px -30px -30px; padding: 14px 30px; background: var(--solid);
  border-top: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r); }
.foot .quiet { margin-left: auto; }

.progress { display: flex; align-items: center; gap: 14px; margin: 4px 48px 28px 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.progress > i { flex: 1; height: 3px; border-radius: 2px; background: var(--fill); overflow: hidden; }
.progress i i { display: block; width: 0; height: 100%; border-radius: 2px; background: var(--text); transition: width 0.35s var(--ease); }
.step { display: grid; gap: 14px; align-content: start; }
.step + .step { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
[data-at] .step { min-height: 190px; margin: 0; padding: 0; border: 0; animation: fade 0.25s var(--ease); }
.step[hidden] { display: none; }
.step small { color: var(--muted); font-size: 13px; }
.step h2 { font-size: 20px; line-height: 1.3; text-wrap: pretty; margin-top: -8px; }
.step.wordy h2 { font: 500 15.5px/1.5 var(--sans); letter-spacing: 0; }
.step input:where(:not([type="radio"])), .step textarea { font-size: 16px; }
.step input:where(:not([type="radio"])) { height: 46px; }
.opts { display: grid; gap: 6px; }
.opt { display: flex; align-items: flex-start; gap: 12px; padding: 11px 14px; border-radius: var(--rc); border: 1px solid var(--line); color: var(--text); cursor: pointer; transition: background 0.15s var(--ease), border-color 0.15s var(--ease); }
.opt:hover { background: var(--fill); }
.opt:has(input:checked) { border-color: var(--text); background: var(--fill); }
.opt input { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin: 1px 0 0; padding: 0; border-radius: 50%; border: 1.5px solid var(--idle); background: none; flex: none; outline-offset: 3px; transition: border 0.15s var(--ease); }
.opt input:checked { border: 5.5px solid var(--text); }
.err { color: var(--bad); margin: 14px 0 0; font-size: 13px; }

input:where(:not([type="radio"])), textarea, select { width: 100%; min-width: 0; padding: 0 12px; border-radius: var(--rc); border: 1px solid var(--line); background: var(--fill); outline: none; transition: border-color 0.2s var(--ease), background 0.2s var(--ease); }
input:where(:not([type="radio"])), select { height: 38px; }
textarea { display: block; min-height: 120px; padding: 11px 12px; line-height: 1.45; resize: vertical; }
input:where(:not([type="radio"])):focus, textarea:focus, select:focus { border-color: var(--accent); background: var(--solid); }
input::placeholder { color: var(--muted); }

.form { padding: 24px 26px 26px; display: grid; gap: 18px; margin: 0; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.f { display: grid; gap: 6px; font-size: 13px; }
.in { position: relative; display: block; }
.in svg { position: absolute; right: 12px; top: 50%; margin-top: -8px; color: var(--ok); pointer-events: none; }
.form > .btn { justify-self: start; }

body.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: min(340px, 100%); padding: 32px; display: grid; gap: 14px; }
.login h1 { margin-bottom: 6px; }
.login .btn, .login input { height: 42px; }
.login .err { margin: 0; }

@media (max-width: 820px) {
  .row, .v-enviadas .row, .v-andamento .row { grid-template-columns: 30px minmax(0, 1fr) auto; grid-template-areas: "ring co tail" "ring role tail"; gap: 1px 12px; padding: 10px 16px; }
  .row .ring { grid-area: ring; }
  .co { grid-area: co; }
  .role { grid-area: role; color: var(--muted); font-size: 13px; }
  .row .meta { display: none; }
  .row .note, .row time { grid-area: tail; max-width: 38vw; text-align: right; }
  .v-enviadas .note, .v-andamento time { display: none; }
  .v-descartadas .row { grid-template-areas: "ring co" "ring role" "ring note"; grid-template-columns: 30px minmax(0, 1fr); }
  .v-descartadas .note { grid-area: note; max-width: none; text-align: left; }
  .group { padding-left: 16px; }
}
@media (max-width: 640px) {
  .bar { padding: 8px 8px 8px 16px; gap: 8px; }
  .pulse { display: none; }
  .controls { gap: 10px; }
  .seg button { padding: 6px 10px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .n { font-size: 28px; }
  .fields { grid-template-columns: 1fr; }
  .sheet { padding: 24px 20px 24px; }
  .foot { margin: 24px -20px -24px; padding: 12px 20px; flex-wrap: wrap; gap: 8px; }
  .foot .btn { height: 44px; }
  .foot:has(> :nth-child(3)) .btn { flex: 1 1 0; }
  .foot:has(> :nth-child(3)) .quiet { flex-basis: 100%; height: 34px; margin: 0; }
  .form { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
