/* =========================================================
   Ygara (canoa, em tupi) — visual "água e saneamento"
   Fundo de névoa, profundezas em azul-abismo, ciano de água tratada,
   laranja de boia para o que está represado/atrasado.
   ========================================================= */
:root {
  --abyss: #061a28;
  --deep: #0b3048;
  --deep2: #0f4361;
  --ink: #0f2738;
  --muted: #5d7688;
  --mist: #eef5f6;
  --paper: #ffffff;
  --line: #d6e4e8;
  --cyan: #0094a3;
  --cyan-d: #007684;
  --aqua: #5fd4d0;
  --foam: #e2f6f5;
  --buoy: #f2602f;
  --buoy-soft: #ffe9e0;
  --amber: #e9a31b;
  --amber-soft: #fdf2d8;
  --moss: #1fa874;
  --moss-soft: #ddf5ea;
  --slate: #7f93a3;
  --slate-soft: #e9eef2;
  --r: 14px;
  --shadow: 0 1px 2px rgba(6, 26, 40, .06), 0 6px 20px rgba(6, 26, 40, .06);
  --head: 'Space Grotesk', system-ui, sans-serif;
  --body: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--body); color: var(--ink); font-size: 15px; line-height: 1.45;
  background-color: var(--mist);
  /* linhas de contorno, como numa carta batimétrica */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='120' viewBox='0 0 240 120'%3E%3Cg fill='none' stroke='%230b3048' stroke-opacity='.045' stroke-width='1.2'%3E%3Cpath d='M0 20c40-14 80 14 120 0s80 14 120 0'/%3E%3Cpath d='M0 50c40-14 80 14 120 0s80 14 120 0'/%3E%3Cpath d='M0 80c40-14 80 14 120 0s80 14 120 0'/%3E%3Cpath d='M0 110c40-14 80 14 120 0s80 14 120 0'/%3E%3C/g%3E%3C/svg%3E");
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--head); letter-spacing: -.01em; margin: 0; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -3px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.lead { margin: 0 0 14px; }

/* ---------- estrutura ---------- */
.app { display: flex; min-height: 100vh; }
body.logged-out .app, body.logged-out .bottom-nav { display: none; }
.rail {
  width: 248px; flex: none; position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, var(--abyss), #082537 70%, #0a2f45);
  color: #cfe6ec; display: flex; flex-direction: column; padding: 22px 14px;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 4px 8px 24px; }
.brand-mark { width: 38px; height: 38px; }
.brand-mark path { fill: var(--cyan); }
.brand-mark .w { fill: none; stroke: var(--foam); stroke-width: 2.2; stroke-linecap: round; }
.brand-mark .p { fill: none; stroke: var(--aqua); stroke-width: 2.4; stroke-linecap: round; }
.login-box .brand-mark .w { stroke: var(--aqua); }
.brand-name { font-family: var(--head); font-weight: 700; font-size: 26px; color: #fff; letter-spacing: -.02em; line-height: 1; }
.brand-sub { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--aqua); margin-top: 4px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 12px; border: 0; border-radius: 10px; background: none; color: #b9d3db; cursor: pointer; font-weight: 500;
}
.nav-item:hover { background: rgba(95, 212, 208, .08); color: #fff; }
.nav-item.on { background: rgba(95, 212, 208, .14); color: #fff; box-shadow: inset 3px 0 0 var(--aqua); }
.nav-item span { flex: 1; }
.nav-item span small { display: block; font-size: 11px; color: #7fa3ae; font-weight: 400; margin-top: -1px; }
.nb { background: var(--buoy); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; font-family: var(--mono); }
.rail-foot { margin-top: auto; }
.demo-tag { font-size: 12px; color: var(--aqua); border: 1px dashed rgba(95, 212, 208, .5); border-radius: 10px; padding: 10px 12px; }
.demo-tag small { color: #8fb0bb; }

.main { flex: 1; min-width: 0; }
.view { padding: 18px 32px 60px; max-width: 1180px; }

/* ---------- topo com ondas ---------- */
.hero {
  position: relative; overflow: hidden; color: #eaf7f9;
  background: radial-gradient(1200px 300px at 80% -20%, rgba(95, 212, 208, .25), transparent 60%),
              linear-gradient(160deg, var(--deep) 0%, var(--deep2) 55%, #0b5a73 100%);
  padding: 26px 32px 64px;
}
.hero-in { position: relative; z-index: 2; display: flex; gap: 24px; align-items: flex-end; justify-content: space-between; max-width: 1180px; }
.hero-date { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--aqua); margin-bottom: 6px; }
.hero h1 { font-size: 34px; font-weight: 700; color: #fff; line-height: 1.1; }
.hero p { margin: 8px 0 0; color: #b6d6de; max-width: 620px; }
.back { display: inline-flex; align-items: center; gap: 4px; background: rgba(255, 255, 255, .1); border: 0; color: #dff3f6; border-radius: 99px; padding: 4px 12px 4px 8px; margin-bottom: 10px; cursor: pointer; font-size: 13px; }
.back.dark { background: var(--paper); color: var(--deep); border: 1px solid var(--line); margin: 0; }
.gauge { display: flex; align-items: flex-end; gap: 16px; background: rgba(6, 26, 40, .35); border: 1px solid rgba(95, 212, 208, .25); border-radius: 14px; padding: 12px 16px; backdrop-filter: blur(4px); }
.gauge-num { display: flex; align-items: center; gap: 10px; }
.gauge-num b { font-family: var(--mono); font-size: 36px; color: var(--aqua); line-height: 1; }
.gauge-num span { white-space: nowrap; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: #cfe6ec; line-height: 1.25; }
.gauge-num small { text-transform: none; letter-spacing: 0; color: #93b6c0; font-size: 12px; }
.bars { display: flex; gap: 4px; align-items: flex-end; height: 44px; }
.bars i { width: 9px; height: max(3px, var(--h)); background: rgba(95, 212, 208, .45); border-radius: 3px 3px 1px 1px; }
.bars i.now { background: var(--aqua); box-shadow: 0 0 10px rgba(95, 212, 208, .6); }
.waves { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 70px; z-index: 1; }
.waves path { animation: drift 14s ease-in-out infinite alternate; }
.waves .w1 { fill: rgba(95, 212, 208, .16); }
.waves .w2 { fill: rgba(95, 212, 208, .22); animation-duration: 10s; animation-direction: alternate-reverse; }
.waves .w3 { fill: var(--mist); animation-duration: 18s; }
@keyframes drift { from { transform: translateX(-30px); } to { transform: translateX(30px); } }
@media (prefers-reduced-motion: reduce) { .waves path, .spin { animation: none !important; } }

.sync-bar { font-size: 12.5px; color: var(--muted); padding: 8px 32px 0; min-height: 28px; }
.sync-bar.ok { display: flex; gap: 6px; align-items: center; }
.sync-bar.ok .ic { color: var(--moss); width: 15px; height: 15px; }
.sync-bar.off { color: #9a3a14; background: var(--buoy-soft); padding: 8px 32px; }
.sync-bar.demo { color: var(--deep); background: var(--amber-soft); padding: 8px 32px; }
.link { background: none; border: 0; color: var(--cyan-d); text-decoration: underline; cursor: pointer; padding: 6px 0; }

/* ---------- peças ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card h2 { font-size: 17px; margin-bottom: 12px; display: flex; gap: 8px; align-items: center; }
.card h2.late { color: var(--buoy); }
.card h2.okh { color: var(--moss); }
.card h2.muted-h { color: var(--muted); }
.count { font-family: var(--mono); font-size: 12px; background: var(--slate-soft); color: var(--muted); padding: 1px 8px; border-radius: 99px; font-weight: 600; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  background: var(--cyan); color: #fff; border: 1px solid var(--cyan); border-radius: 10px;
  padding: 9px 16px; font-weight: 600; cursor: pointer; transition: background .15s, transform .05s;
}
.btn:hover { background: var(--cyan-d); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.ghost { background: var(--paper); color: var(--deep); border-color: var(--line); }
.btn.ghost:hover { background: var(--foam); }
.btn.danger { color: #b3401a; }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.full { width: 100%; }
.btn.paste { background: var(--deep); border-color: var(--deep); }
.btn.paste:hover { background: var(--abyss); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--paper); border-radius: 99px; padding: 6px 14px; cursor: pointer; font-weight: 500; color: var(--muted); }
.chip.on { background: var(--deep); border-color: var(--deep); color: #fff; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 6px 0 14px; flex-wrap: wrap; }
.toolbar p { margin: 0; }
.tag { display: inline-block; background: var(--foam); color: var(--cyan-d); border-radius: 6px; padding: 1px 8px; font-size: 12px; font-weight: 500; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.late { color: var(--buoy) !important; font-weight: 600; }
.okdate { color: var(--moss); font-size: 12.5px; display: inline-flex; gap: 4px; align-items: center; }
.okdate .ic { width: 14px; height: 14px; }
.banner { display: flex; align-items: center; gap: 10px; background: var(--foam); border: 1px solid #bfe9e6; border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; }
.banner span { flex: 1; }
.banner.warn { background: var(--amber-soft); border-color: #f4dc9f; }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; }
.empty .ic { width: 34px; height: 34px; color: var(--aqua); }
.empty p { margin: 8px 0 12px; }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--aqua); border-right-color: transparent; border-radius: 50%; animation: rot .7s linear infinite; vertical-align: -1px; }
@keyframes rot { to { transform: rotate(360deg); } }

/* status: cada um é um estado da água */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; border-radius: 99px; padding: 3px 10px 3px 8px; white-space: nowrap; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill small { font-weight: 400; opacity: .75; font-style: italic; }
.st-andamento { --st: var(--cyan); --st-soft: var(--foam); }
.st-aguardando { --st: var(--buoy); --st-soft: var(--buoy-soft); }
.st-parado { --st: var(--slate); --st-soft: var(--slate-soft); }
.st-ideia { --st: var(--moss); --st-soft: var(--moss-soft); }
.st-concluido { --st: var(--deep); --st-soft: #dde8ef; }
.st-cancelado { --st: #a7b4bd; --st-soft: #f1f4f6; }
.pill { color: var(--st); background: var(--st-soft); }
.pill.st-andamento i { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(0, 148, 163, .18); } }

/* níveis (contagem por status) */
.levels { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: 4px 0 16px; }
.level { position: relative; overflow: hidden; text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; }
.level::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--st); }
.level b { font-family: var(--mono); font-size: 26px; color: var(--st); line-height: 1.1; }
.level span { font-weight: 600; font-size: 13px; }
.level small { color: var(--muted); font-style: italic; font-size: 12px; }

.strip-h { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-bottom: 8px; color: var(--buoy); }
.strip-h .muted { font-size: 13px; }
.mini { list-style: none; margin: 0; padding: 0; }
.mini li { padding: 7px 0; border-top: 1px dashed var(--line); cursor: pointer; font-size: 14px; }
.mini li:first-child { border-top: 0; }
.mini li:hover { color: var(--cyan-d); }

/* cartões de projeto */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.pcard {
  position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px 14px 20px;
  box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column; gap: 10px; overflow: hidden; transition: transform .12s, box-shadow .12s;
}
.pcard::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--st); }
.pcard:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(6, 26, 40, .1); }
.pcard:focus-visible { outline: 3px solid var(--aqua); }
.pcard-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pcard h3 { font-size: 17px; line-height: 1.25; }
.due { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.due .ic { width: 14px; height: 14px; }
.next { font-size: 14px; background: var(--mist); border-radius: 8px; padding: 8px 10px; }
.next small { display: block; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.next em { color: var(--muted); }
.pcard-foot { display: flex; gap: 12px; align-items: center; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.pcard-foot .ic { width: 14px; height: 14px; }
.pcard-foot .w { color: var(--buoy); font-weight: 600; }
.people { margin-left: auto; display: flex; }
.people i { width: 24px; height: 24px; border-radius: 50%; background: var(--deep2); color: #fff; font-style: normal; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--paper); margin-left: -6px; }

/* tarefas — a bolinha enche de água ao concluir */
.tasks, .waits, .decs, .timeline, .past, .rv { list-style: none; margin: 0; padding: 0; }
.task { display: flex; gap: 12px; align-items: flex-start; padding: 10px 2px; border-top: 1px solid var(--line); }
.task:first-child { border-top: 0; }
.tick { flex: none; width: 30px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; margin-top: -2px; border-radius: 50%; }
.tick:focus-visible { outline: 3px solid var(--aqua); }
.tick svg { width: 30px; height: 30px; }
.tick .ring { fill: none; stroke: #9fb8c4; stroke-width: 1.8; }
.tick .fill { fill: var(--moss); transform-origin: 12px 12px; transform: scale(0); transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.tick .mark { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 16; stroke-dashoffset: 16; transition: stroke-dashoffset .3s .15s; }
.tick:hover .ring { stroke: var(--cyan); stroke-width: 2.4; }
.task.done .tick .fill { transform: scale(1); }
.task.done .tick .mark { stroke-dashoffset: 0; }
.task.done .tick .ring { stroke: var(--moss); }
.task.pending .tick .ring { stroke: var(--aqua); stroke-dasharray: 20 43; animation: rot .8s linear infinite; transform-origin: 12px 12px; }
.task-body { flex: 1; min-width: 0; cursor: pointer; }
.task-title { font-weight: 500; }
.task.done .task-title { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(31, 168, 116, .6); }
.task-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 3px; align-items: center; }
.task-meta .ic { width: 13px; height: 13px; }
.saving { color: var(--cyan-d); }
.savedok { color: #fff; background: var(--moss); border-radius: 99px; padding: 0 8px; font-weight: 600; animation: pop .3s ease-out; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }
.pad { padding: 12px 0; }

/* aguardando */
.wait { display: flex; gap: 14px; align-items: center; padding: 12px 2px; border-top: 1px solid var(--line); }
.wait:first-child { border-top: 0; }
.wait.resolved { opacity: .7; }
.wait-days { flex: none; width: 58px; height: 58px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; overflow: hidden; background: var(--mist); }
.wait-days::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; background: var(--lv); opacity: .2; height: var(--fill); }
.wait-days b { font-family: var(--mono); font-size: 22px; line-height: 1; color: var(--lvt); position: relative; }
.wait-days small { font-size: 11px; color: var(--muted); position: relative; }
.lv-lo { --lv: var(--cyan); --lvt: var(--cyan-d); --fill: 30%; }
.lv-mid { --lv: var(--amber); --lvt: #b07400; --fill: 60%; }
.lv-hi { --lv: var(--buoy); --lvt: var(--buoy); --fill: 92%; }
.wait-body { flex: 1; min-width: 0; cursor: pointer; }
.wait-who { font-weight: 700; font-family: var(--head); display: flex; gap: 6px; align-items: center; }
.wait-what { margin-top: 1px; }
.wait-act { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.nudge-hint { color: var(--buoy); font-size: 12px; font-weight: 700; display: inline-flex; gap: 3px; align-items: center; text-transform: uppercase; letter-spacing: .05em; }
.nudge-hint .ic { width: 14px; height: 14px; }
.whos { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.who { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; font-size: 13px; }
.who span { color: var(--muted); margin-left: 6px; }

/* hoje */
.quick { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.quick.card { padding: 12px; }
.quick input, .quick select, .field input, .field select, .field textarea, .mnote textarea, .mnote input, .status-sel, .chg .edit {
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; background: #fbfdfd; min-width: 0;
}
.quick input[name=title], .quick input[name=text] { flex: 1 1 220px; }
.quick.inline { margin-bottom: 10px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--aqua); outline-offset: 0; border-color: var(--aqua); }
.cols { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }

/* reuniões */
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.mcard { display: flex; gap: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; cursor: pointer; box-shadow: var(--shadow); }
.mcard.off { opacity: .55; }
.mcard h3 { font-size: 16px; margin-bottom: 4px; }
.mday { flex: none; width: 64px; border-radius: 10px; background: var(--deep); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 0; }
.mday b { font-family: var(--head); text-transform: uppercase; font-size: 15px; color: var(--aqua); }
.mday span { font-family: var(--mono); font-size: 14px; }
.mnote { display: flex; flex-direction: column; gap: 10px; }
.mnote textarea { width: 100%; resize: vertical; line-height: 1.5; }
.mnote label { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.decs li { padding: 8px 0; border-top: 1px dashed var(--line); display: flex; gap: 10px; }
.decs li:first-child { border-top: 0; }
.ddate { font-family: var(--mono); font-size: 12.5px; color: var(--cyan-d); background: var(--foam); border-radius: 6px; padding: 1px 6px; height: fit-content; }
.past li { padding: 8px 0; border-top: 1px dashed var(--line); cursor: pointer; font-size: 14px; }
.past li b { font-family: var(--mono); margin-right: 8px; color: var(--deep); }

/* revisão */
.rv li { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.rv li:first-child { border-top: 0; }
.rv-act { display: flex; gap: 6px; flex-wrap: wrap; }

/* projeto */
.phead { border-top: 5px solid var(--st); }
.phead-top { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.status-sel { padding: 5px 8px; font-size: 13px; }
.facts { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; margin: 0 0 16px; }
.facts dt { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.facts dd { margin: 0; font-weight: 500; }
.facts .wide dd { font-size: 16px; }
.facts em { color: var(--muted); font-weight: 400; }
.tabs { display: flex; gap: 4px; margin-bottom: -1px; overflow-x: auto; }
.tab { border: 1px solid transparent; border-bottom: 0; background: none; padding: 10px 16px; border-radius: 10px 10px 0 0; cursor: pointer; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tab.on { background: var(--paper); border-color: var(--line); color: var(--deep); }
.tabs + .card { border-top-left-radius: 0; }
.timeline li { display: grid; grid-template-columns: 170px 1fr; gap: 12px; padding: 8px 0 8px 14px; border-left: 2px solid var(--foam); position: relative; font-size: 14px; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--aqua); border: 2px solid var(--paper); }
.timeline time { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.intro h2 { font-size: 22px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(6, 26, 40, .55); display: grid; place-items: center; z-index: 50; padding: 16px; backdrop-filter: blur(2px); }
.modal-box { background: var(--paper); border-radius: 16px; width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal-box.wide { width: min(720px, 100%); }
.modal-box h3 { font-size: 20px; margin-bottom: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-weight: 600; font-size: 13.5px; }
.field textarea { resize: vertical; }
.hint { color: var(--muted); font-size: 12.5px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 12px; }
.modal-actions .danger { margin-right: auto; }
.form-msg { min-height: 1.2em; color: var(--cyan-d); font-size: 14px; margin: 6px 0 0; }
.caution { background: var(--amber-soft); border-radius: 8px; padding: 8px 10px; font-size: 13px; display: flex; gap: 8px; }
.chg-sec { border-left: 4px solid var(--c); padding: 4px 0 4px 12px; margin: 12px 0; }
.chg-sec h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--c); margin-bottom: 4px; }
.c-done { --c: var(--moss); } .c-new { --c: var(--cyan); } .c-status { --c: var(--deep2); } .c-next { --c: var(--deep2); }
.c-dec { --c: #7a5bd6; } .c-wait { --c: var(--buoy); } .c-res { --c: var(--moss); }
.chg { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.chg input[type=checkbox] { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--cyan); flex: none; }
.chg span { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chg small { display: block; width: 100%; color: var(--muted); font-size: 12.5px; }
.chg .edit { flex: 1 1 260px; padding: 6px 9px; }
.chg .edit.date { flex: 0 0 150px; }
.chg .edit.who { flex: 0 1 150px; font-weight: 600; }
.steps { padding-left: 20px; }
.qr { display: block; width: 190px; height: 190px; margin: 6px auto; }
.secret { word-break: break-all; background: var(--mist); padding: 2px 6px; border-radius: 6px; }

/* ---------- aviso ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: var(--abyss); color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 500; z-index: 60;
  transition: opacity .2s, transform .2s; max-width: min(560px, calc(100vw - 32px)); box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: #0d5c43; }
.toast.err { background: #a8360f; }

/* ---------- login ---------- */
.login { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; background: linear-gradient(170deg, var(--abyss), var(--deep) 60%, #0b5a73); overflow: hidden; }
.login .waves { height: 140px; }
.login .waves .w3 { fill: rgba(95, 212, 208, .3); }
.login-box { position: relative; z-index: 2; background: rgba(255, 255, 255, .97); border-radius: 18px; padding: 28px; width: min(380px, 100%); text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.login-box .brand-mark.big { width: 56px; height: 56px; }
.login-box .brand-name { color: var(--deep); font-size: 32px; }
.login-box .brand-sub { color: var(--cyan-d); margin-bottom: 18px; }
.login-box .field { text-align: left; }

/* ---------- celular ---------- */
.bottom-nav { display: none; }
@media (max-width: 1020px) {
  .levels { grid-template-columns: repeat(3, 1fr); }
  .cols { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .rail { display: none; }
  .hero { padding: 18px 16px 54px; }
  .hero-in { flex-direction: column; align-items: stretch; gap: 14px; }
  .hero h1 { font-size: 26px; }
  .gauge { justify-content: space-between; }
  .view { padding: 12px 14px 96px; }
  .sync-bar, .sync-bar.off, .sync-bar.demo { padding-left: 16px; padding-right: 16px; }
  .levels { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .level { padding: 8px 10px; }
  .level b { font-size: 20px; }
  .level small { display: none; }
  .pgrid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts .wide { grid-column: 1 / -1; }
  .wait { flex-wrap: wrap; }
  .wait-act { width: 100%; justify-content: flex-start; padding-left: 72px; }
  .timeline li { grid-template-columns: 1fr; gap: 0; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--abyss);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav button { flex: 1; background: none; border: 0; color: #9fc0ca; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; padding: 4px 0; position: relative; cursor: pointer; }
  .bottom-nav button.on { color: var(--aqua); }
  .bottom-nav .ic { width: 22px; height: 22px; }
  .bottom-nav .nb { position: absolute; top: 0; left: calc(50% + 6px); font-size: 10px; padding: 0 5px; }
  .toast { bottom: 84px; }
}
