:root {
  --bg: #F6F5F2;
  --surface: #FFFFFF;
  --ink: #141414;
  --muted: #6E6D69;
  --line: #E6E3DD;
  --soft: #EFEDE8;
  --red: #E5392C;
  --red-soft: #FDECEA;
  --amber-soft: #FFF5DD;
  --amber-ink: #7A5200;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 10px 30px rgba(0, 0, 0, .04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111110;
    --surface: #1A1A19;
    --ink: #F2F1EE;
    --muted: #9C9A95;
    --line: #2C2B29;
    --soft: #232321;
    --red: #FF5A4E;
    --red-soft: #3A1A17;
    --amber-soft: #2E2510;
    --amber-ink: #F2C46B;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: -.02em; font-size: 17px; }
.logo svg, .ast svg { fill: none; stroke: var(--red); stroke-width: 3; stroke-linecap: round; }
.logo svg { width: 20px; height: 20px; }
.stepinfo { font-size: 13px; color: var(--muted); }
.progress { height: 2px; background: var(--line); }
.progress i { display: block; height: 100%; width: 0; background: var(--red); transition: width .35s ease; }

main.wrap { padding-top: 44px; padding-bottom: 150px; }

/* Type */
h1 { font-size: clamp(28px, 5.2vw, 40px); line-height: 1.08; letter-spacing: -.035em; margin: 0 0 14px; font-weight: 700; }
h2 { font-size: 18px; line-height: 1.3; letter-spacing: -.015em; margin: 0 0 14px; font-weight: 600; }
h3 { font-size: 16px; margin: 0; font-weight: 600; letter-spacing: -.01em; }
.lead { color: var(--muted); font-size: 17px; margin: 0 0 30px; max-width: 58ch; }
.muted { color: var(--muted); }
.eyebrow { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--red); margin-bottom: 14px; }
.sec { margin: 36px 0 14px; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 16px; }

/* Notes */
.note { border-radius: 12px; padding: 14px 16px; font-size: 14.5px; margin: 0 0 20px; background: var(--soft); }
.note.warn { background: var(--amber-soft); color: var(--amber-ink); }
.note.alert { background: var(--red-soft); }
.note b { font-weight: 600; }

/* Buttons */
.btn { border: 1px solid transparent; border-radius: 999px; padding: 11px 22px; font-weight: 600; font-size: 15px; transition: transform .08s, opacity .2s, background .2s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary.pendente { opacity: .45; }

/* Errors */
.erros ul { margin: 6px 0 0; padding-left: 18px; }
.erros li { margin-bottom: 3px; }
.falta, .input.falta, .day.falta { border-color: var(--red) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 15%, transparent); }
.disc-name.falta { box-shadow: inset 0 -2px 0 var(--red); }
.q.falta, .agree.falta, .seg.falta, .chips.falta { border-radius: 12px; }
.q.falta { box-shadow: inset 3px 0 0 var(--red); padding-left: 12px; }

/* Plan: average per task */
.media { display: flex; gap: 18px; align-items: center; justify-content: space-between; }
.media h2 { margin-bottom: 4px; }
.media > div { flex: 1; }
.media p { margin: 0; font-size: 14.5px; }
.media select.input { width: 190px; flex: none; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.ghost:hover { background: var(--soft); }
.btn.sm { padding: 8px 15px; font-size: 14px; }
.btn.accent { background: var(--red); color: #fff; }
.btn.add { width: 100%; background: transparent; border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 16px; color: var(--muted); }
.btn.add:hover { border-color: var(--muted); color: var(--ink); }
.link { background: none; border: 0; padding: 10px 0 0; color: var(--muted); font-weight: 500; font-size: 14px; }
.link:hover { color: var(--ink); }
.icon { width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; }
.icon:hover { background: var(--soft); color: var(--ink); }

/* Segmented */
.seg { display: inline-flex; background: var(--soft); border-radius: 999px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 8px 20px; font-weight: 500; font-size: 15px; color: var(--muted); }
.seg button.on { background: var(--ink); color: var(--bg); }
.seg.sm button { padding: 6px 15px; font-size: 14px; }

/* Fields */
.field { margin-bottom: 20px; }
.label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 8px; }
.input, select.input, textarea.input {
  width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.5; font-size: 14px; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 20px, calc(100% - 12px) 20px; background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 10%, transparent); }
.input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }

/* Agreement */
.check { list-style: none; padding: 0; margin: 0 0 18px; }
.check li { position: relative; padding: 0 0 10px 30px; }
.check li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 12px; height: 7px; border-left: 2px solid var(--red); border-bottom: 2px solid var(--red); transform: rotate(-45deg); }
.agree { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 12px; background: var(--soft); cursor: pointer; margin-top: 6px; }
.agree input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--red); flex: none; }

/* Week */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 15px; font-size: 14px; font-weight: 500; color: var(--muted); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.days { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 20px; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.day span { font-size: 13px; color: var(--muted); font-weight: 500; }
.hin { display: flex; align-items: baseline; gap: 4px; }
.hin input { width: 100%; border: 0; background: transparent; outline: none; font-size: 26px; font-weight: 600; letter-spacing: -.02em; padding: 0; }
.hin em { font-style: normal; color: var(--muted); }

/* Tasks */
.disc-head { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.disc-name { flex: 1; border: 0; background: transparent; outline: none; font-size: 19px; font-weight: 600; letter-spacing: -.015em; padding: 4px 0; min-width: 0; }
.disc-name::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.trow { display: grid; grid-template-columns: 1fr 136px 128px 36px; grid-template-areas: "ass rel tipo x" "cont cont cont ."; gap: 8px; padding: 14px 0; border-top: 1px solid var(--line); }
.trow .t-ass { grid-area: ass; } .trow .t-rel { grid-area: rel; } .trow .t-tipo { grid-area: tipo; }
.trow .t-cont { grid-area: cont; } .trow .icon { grid-area: x; align-self: center; }
.trow .tag-ia { grid-column: 1 / -1; justify-self: start; }
.tag-ia { font-size: 12px; font-weight: 500; padding: 3px 9px; border-radius: 999px; background: var(--amber-soft); color: var(--amber-ink); }
.ia-box { background: var(--soft); border-radius: 14px; padding: 18px; margin: 4px 0 14px; }
.ia-box ol { margin: 0 0 14px; padding-left: 20px; font-size: 14.5px; }
.ia-box ol li { margin-bottom: 4px; }
.ia-box textarea { margin-bottom: 10px; }
.ia-box .note.warn { margin-bottom: 14px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.ia-msg { font-size: 14px; color: var(--muted); }

/* Questions */
.q { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.q:first-of-type { border-top: 0; padding-top: 4px; }
.q b { font-weight: 600; display: block; }
.q small { color: var(--muted); font-size: 13px; }
.q .ctrl { display: flex; gap: 8px; align-items: center; flex: none; }
.taxa { display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 12px; height: 38px; }
.taxa input { width: 38px; border: 0; background: transparent; outline: none; text-align: right; font-weight: 600; }
.taxa em { font-style: normal; color: var(--muted); font-size: 14px; }

/* Relevance list */
.rel-group { margin-bottom: 16px; }
.rel-group h3 { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 6px; }
.tlist { list-style: none; margin: 0; padding: 0; }
.tlist li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.tlist li:first-child { border-top: 0; }
.tlist .body { flex: 1; min-width: 0; }
.tlist small { display: block; color: var(--muted); font-size: 13.5px; }
.ast { width: 18px; height: 18px; flex: none; margin-top: 3px; }
.ast svg { width: 18px; height: 18px; }
.ast.off svg { stroke: var(--line); }
.tipo { display: inline-block; font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); margin-left: 6px; vertical-align: 1px; }
.star .tipo { background: var(--red-soft); color: var(--red); }

/* Cuts */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stat b { display: block; font-size: 30px; letter-spacing: -.03em; line-height: 1.1; }
.stat span { font-size: 13px; color: var(--muted); }
.stat.hl b { color: var(--red); }
.cut-sec h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.cut-sec h3 .n { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--bg); font-size: 12px; display: grid; place-items: center; flex: none; }
.cut-sec .tlist li { color: var(--muted); }
.cut-sec .tlist li.strike .body > span { text-decoration: line-through; text-decoration-color: var(--red); }

/* Plan */
.plan-head { margin-bottom: 26px; }
.plan-head h1 { margin-bottom: 8px; }
.day-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 12px; break-inside: avoid; box-shadow: var(--shadow); }
.day-card header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.day-card header span { font-size: 14px; color: var(--muted); }
.day-card.off { background: transparent; box-shadow: none; padding: 12px 20px; }
.day-card.off header { margin: 0; }
.day-card.off h3 { color: var(--muted); font-weight: 500; }
.hpill { flex: none; font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--soft); }
.part { display: block; font-style: normal; font-size: 13.5px; color: var(--red); margin-top: 3px; }
.free { color: var(--muted); font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

/* Bottom nav */
.navbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.navbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 72px; }
.hint { font-size: 13.5px; color: var(--muted); }
.navbtns { display: flex; gap: 8px; flex: none; }

.fade { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 560px) {
  main.wrap { padding-top: 32px; }
  .trow { grid-template-columns: 1fr 1fr 36px; grid-template-areas: "ass ass x" "rel tipo tipo" "cont cont cont"; }
  .q { flex-direction: column; align-items: flex-start; }
  .media { flex-direction: column; align-items: stretch; }
  .media select.input { width: 100%; }
  .stats { gap: 8px; }
  .stat { padding: 12px; }
  .stat b { font-size: 24px; }
  .hint { display: none; }
  .navbtns { width: 100%; }
  .navbtns .btn { flex: 1; }
}

@media print {
  .topbar, .navbar, .actions, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  main.wrap { padding: 0; }
  .day-card, .card { box-shadow: none; }
}

/* Conta */
.top-right { display: flex; align-items: center; gap: 16px; }
.link.sair { padding: 0; font-size: 13px; }
.auth { max-width: 440px; margin: 0 auto; }
.auth form .link { display: block; margin: 12px auto 0; }
.btn.full { width: 100%; }
.small { font-size: 14px; }
.auth a { color: var(--ink); font-weight: 600; }
.auth .card .btn + .btn { margin-left: 8px; }
