/*!
 * Lumivia
 * Copyright (c) 2026 Sara Ingryd Alves Brito. Todos os direitos reservados.
 */
:root {
  --bg: #F4F6F3;
  --card: #FFFFFF;
  --ink: #1F2A24;
  --muted: #4C5852;
  --line: #C9D2CC;
  --soft: #E6ECE8;
  --brand: #2F6B5E;
  --brand-d: #1F4D43;
  --brand-l: #D5E3DD;
  --dark: #1F2A24;
  --dark-2: #2C3A33;
  --dark-m: #B9CCC4;
  --amber-bg: #F6E7CC;
  --amber: #7A4E0E;
  --danger: #A3302A;
  --ink-2: #3E4A44;
  --line-soft: #E1E7E3;
  --private: #FBF7EF;
  --private-2: #EDEFEA;
  --amber-bg2: #FDF0D5;
  --amber-ink: #5B4A2A;
  --amber-line: #E8CF9F;
  --amber-strong: #9A5B12;
  --warm: #FFFBF2;
  --mark: #F6E1A6;
  --bar: #C4D8D0;
  --cm-box: #D3E6E2;
  --remind: #FDF0DA;
  --wheel-bg: #E9E2F1;
  --wheel-fg: #5E3F7A;
  --wheel-grid: #DDE4E0;
  --rust: #B4471F;
  --locked: #E9EDEA;
  --locked-2: #DCE2DE;
  --field: #FFFFFF;
  --shadow: rgba(31, 42, 36, .16);
  --mc0: #B5523F; --mc1: #C98A2B; --mc2: #8F9A95; --mc3: #4E9A82; --mc4: #2F6B5E;
  --mb0: #F3D9D4; --mb1: #F6E7CC; --mb2: #E6ECE8; --mb3: #D5E3DD; --mb4: #BFD8CD;
  --mf0: #8A3B2E; --mf1: #7A4E0E; --mf2: #4C5852; --mf3: #2F6B5E; --mf4: #1F4D43;
  --g1: #2F6B5E; --g2: #B7791F; --g3: #3F6FA0; --g4: #7E57A0;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
h1, h2 { margin: 0; }
h1 { font-family: Outfit, Inter, sans-serif; font-weight: 600; font-size: 28px; line-height: 1.2; }
h2, .h2 { font-size: 17px; font-weight: 600; }
a { color: var(--brand); }
a:hover { color: var(--brand-d); }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.cap::first-letter { text-transform: uppercase; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.prose { white-space: pre-wrap; color: var(--ink-2); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }

.loading { min-height: 60vh; display: flex; align-items: center; justify-content: center; color: var(--muted); }

/* ---- Layout ---- */
.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 16px calc(110px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.hd { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hd > div { display: flex; flex-direction: column; gap: 4px; }
.hd-dark {
  margin: -40px -16px 0;
  padding: 28px 20px 22px;
  background: var(--dark);
  color: #FFFFFF;
  border-radius: 0 0 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hd-dark p { color: var(--dark-m); font-size: 14px; }
.kicker { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--dark-m); text-transform: uppercase; }
.back, .back-l {
  align-self: flex-start;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.back { color: var(--dark-m); }
.back:hover { color: #FFFFFF; }
.back-l { margin: -12px 0 -8px; }

.card { background: var(--card); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.sec { font-size: 13px; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); text-transform: uppercase; margin-top: 6px; }

.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--brand-l); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; text-decoration: none; flex-shrink: 0;
}

.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.lg { width: 112px; height: 112px; font-size: 36px; }
.profile-row { display: flex; align-items: center; gap: 16px; flex-direction: row; }
.photo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.photo-actions label.btn { cursor: pointer; }
.photo-actions input:focus-visible + label, .photo-actions label:focus-within { outline: 3px solid #7FB3A5; outline-offset: 2px; }

.card.consent { border: 2px solid var(--amber-line); }
.consent-ok, .consent-pending { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; border-radius: 12px; padding: 10px 12px; }
.consent-ok { background: var(--brand-l); color: var(--brand-d); }
.consent-ok svg { flex-shrink: 0; margin-top: 1px; }
.consent-pending { background: var(--amber-bg); color: var(--amber); font-weight: 600; }

.term-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.term-info { display: flex; flex-direction: column; }
.status { display: inline-flex; align-items: center; gap: 4px; border-radius: 20px; padding: 6px 12px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.status.ok { background: var(--brand-l); color: var(--brand-d); }
.status.pending { background: var(--amber-bg); color: var(--amber); }
.term-meta { margin: 0; display: flex; flex-direction: column; gap: 6px; background: var(--bg); border-radius: 12px; padding: 12px 14px; }
.term-meta div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.term-meta dt { color: var(--muted); }
.term-meta dd { margin: 0; text-align: right; font-weight: 500; }
.card .btn.sm { align-self: flex-start; }

.audience { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; }
.audience legend { padding: 0 6px; }
.audience input[type=radio] { width: 20px; height: 20px; accent-color: var(--brand); flex-shrink: 0; }
.selbox { margin: 4px 0 0 32px; display: flex; flex-direction: column; }
.selbox[hidden] { display: none; }
.selbox .respect { margin-top: 6px; border-top: 1px solid var(--line-soft); padding-top: 6px; }
.badge.personal { background: var(--brand-l); color: var(--brand-d); }
.for-you { display: flex; flex-direction: column; gap: 12px; background: var(--amber-bg); border-radius: 20px; padding: 14px; }
.rows li > span a { text-decoration: none; font-weight: 500; }

.badges { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.terms { gap: 8px; }
.terms h3 { font-size: 15px; color: var(--brand); margin: 12px 0 0; }
.terms ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.terms p, .terms li { font-size: 15px; color: var(--ink-2); }
.terms-alert { background: var(--amber-bg); border-radius: 12px; padding: 12px 14px; }
details.cond { border-top: 1px solid var(--line-soft); padding-top: 12px; }
details.cond > summary { cursor: pointer; font-weight: 600; color: var(--brand); min-height: 32px; }
details.cond form { margin-top: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 420px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }

/* ---- Navegação inferior ---- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--card);
  border-top: 1px solid var(--line-soft);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 10;
}
.nav-in { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.nav a {
  min-height: 68px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 12px; font-weight: 500; color: var(--muted); text-decoration: none;
}
.nav a[aria-current="page"] { color: var(--brand); font-weight: 600; }

/* ---- Formulários ---- */
.field { display: flex; flex-direction: column; gap: 6px; }
label, legend { font-size: 14px; font-weight: 600; }
input[type=text], input[type=number], input[type=tel], input[type=time], input[type=email], input[type=password], input[type=search], input[type=date], input[type=url], select, textarea {
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--field);
  padding: 10px 14px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
}
textarea { resize: vertical; line-height: 1.5; }
textarea.private { background: var(--private-2); }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid #7FB3A5; outline-offset: 2px;
}
fieldset { border: none; margin: 0; }
.check-line { display: flex; gap: 10px; align-items: center; font-weight: 500; min-height: 44px; }
.check-line input, .checks input { width: 22px; height: 22px; accent-color: var(--brand); flex-shrink: 0; }

.btn {
  min-height: 52px; padding: 0 20px;
  border-radius: 14px; border: none;
  background: var(--brand); color: #FFFFFF;
  font: inherit; font-size: 16px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--brand-d); color: #FFFFFF; }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn.ghost:hover { background: var(--brand-l); }
.btn.sm { min-height: 44px; font-size: 14px; padding: 0 14px; }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-link { background: none; border: none; color: var(--brand); font: inherit; font-size: 14px; font-weight: 500; min-height: 44px; cursor: pointer; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; border: none; background: none;
  color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.icon-btn:hover { background: var(--soft); color: var(--danger); }
.icon-btn.edit:hover { color: var(--brand); }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; min-width: 0; }

/* ---- Login ---- */
.login { max-width: 420px; margin: 0 auto; padding: 64px 24px 40px; display: flex; flex-direction: column; gap: 16px; min-height: 100vh; }
.login h1 { font-size: 34px; }
.login .lead { color: var(--muted); }
.login form { margin-top: 16px; }
.brand { width: 56px; height: 56px; border-radius: 18px; background: var(--brand); color: #FFFFFF; display: flex; align-items: center; justify-content: center; }
.note { margin-top: auto; display: flex; gap: 12px; background: var(--soft); border-radius: 16px; padding: 16px; font-size: 13px; color: var(--ink-2); }
.note svg { flex-shrink: 0; color: var(--brand); margin-top: 2px; }

/* ---- Início ---- */
.journey { background: var(--brand); color: #FFFFFF; border-radius: 22px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.journey .kicker { color: #D3E6DF; }
.journey h2 { font-family: Outfit, sans-serif; font-size: 22px; }
.progress { height: 8px; border-radius: 8px; background: #4F8577; overflow: hidden; }
.progress > div { height: 100%; border-radius: 8px; background: #F2C77E; }
.phases { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: #D3E6DF; }
.phases li.on { color: #FFFFFF; font-weight: 600; }

.bars { display: flex; gap: 10px; height: 110px; }
.bar { flex: 1; display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.bar-track { flex: 1; display: flex; align-items: flex-end; }
.bar-fill { width: 100%; border-radius: 8px 8px 4px 4px; background: var(--bar); }
.bar-fill.now { background: var(--brand); }
.bar-fill.empty { background: var(--soft); }
.bar span { font-size: 11px; color: var(--muted); text-align: center; }

.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.checks label { display: flex; gap: 12px; align-items: center; min-height: 44px; font-weight: 400; font-size: 15px; }
.checks input:checked + span { color: var(--muted); text-decoration: line-through; }

.highlight { background: var(--amber-bg); border-radius: 20px; padding: 16px 18px; display: flex; gap: 14px; align-items: center; text-decoration: none; color: var(--ink); }
.highlight:hover { color: var(--ink); filter: brightness(0.98); }
.highlight > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.hl-ico { width: 44px; height: 44px; border-radius: 14px; background: var(--card); color: var(--amber); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kicker-amber, .badge { font-size: 11px; font-weight: 600; color: var(--amber); letter-spacing: 0.03em; }
.badge { align-self: flex-start; background: var(--amber-bg); border-radius: 6px; padding: 2px 8px; }

/* ---- Listas ---- */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { min-height: 40px; padding: 0 16px; border-radius: 20px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.pill[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #FFFFFF; font-weight: 600; }

.item { background: var(--card); border-radius: 18px; padding: 14px; display: flex; gap: 14px; align-items: center; text-decoration: none; color: var(--ink); }
a.item:hover { color: var(--ink); box-shadow: 0 0 0 2px var(--brand-l); }
.item.locked { background: var(--locked); color: var(--ink-2); }
.item.locked .thumb { background: var(--locked-2); color: var(--muted); }
.thumb { width: 56px; height: 56px; border-radius: 14px; background: var(--brand-l); color: var(--brand); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.item-body { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.item-body strong { font-size: 15px; }

.video { position: relative; padding-top: 56.25%; border-radius: 16px; overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
video, audio { width: 100%; border-radius: 16px; }

.moods { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.mood { min-height: 56px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 12px; font-weight: 600; padding: 0 2px; cursor: pointer; }
.mood[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #FFFFFF; }

.entry { background: var(--card); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.entry.new { background: var(--amber-bg); }
.kicker-s { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.entry.new .kicker-s { color: var(--amber); }

.mat { display: flex; gap: 12px; align-items: center; min-height: 48px; padding: 0 12px; border-radius: 12px; background: var(--bg); text-decoration: none; color: var(--ink); font-size: 14px; font-weight: 500; }
.mat svg { color: var(--brand); flex-shrink: 0; }
.sub-h { font-size: 14px; font-weight: 600; color: var(--brand); }

details.card > summary { list-style: none; cursor: pointer; min-height: 24px; display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: "+"; color: var(--muted); font-weight: 500; }
details.card[open] > summary::after { content: "–"; }

.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rows li { display: flex; align-items: center; gap: 8px; min-height: 48px; border-bottom: 1px solid var(--line-soft); }
.rows li:last-child { border-bottom: none; }
.rows li > span { flex: 1; }
.rows .done { color: var(--muted); text-decoration: line-through; }

.phase-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; }
.phase-row > div { display: flex; flex-direction: column; }
.toggle { min-height: 40px; min-width: 100px; padding: 0 14px; border-radius: 20px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid var(--brand); background: var(--card); color: var(--brand); }
.toggle[aria-pressed="true"] { border-color: var(--brand-l); background: var(--brand-l); color: var(--brand-d); }

/* ---- Terapeuta ---- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.stats div { background: var(--dark-2); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; }
.stats strong { font-family: Outfit, sans-serif; font-size: 22px; }
.stats span { font-size: 12px; color: var(--dark-m); }

.link-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 44px; gap: 8px; align-items: center; }

.toast {
  position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--toast, #1F2A24); color: #FFFFFF; padding: 12px 18px; border-radius: 12px; font-size: 14px;
  max-width: calc(100% - 32px); z-index: 50; box-shadow: 0 6px 24px rgba(0,0,0,.18);
}
.toast.err { background: var(--danger); }

@media (min-width: 600px) {
  .hd-dark { border-radius: 0 0 24px 24px; }
}

/* ---- Manutenção ---- */
.maint { justify-content: center; text-align: left; }
.maint details { margin-top: 8px; }

/* ---- Pacientes inativos ---- */
.item.inactive { opacity: 0.75; }
.item.inactive .avatar { filter: grayscale(1); }

/* ---- Roda da Vida ---- */
.wheel { width: 100%; height: auto; display: block; }
.wheel-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.wheel-legend span { display: inline-flex; align-items: center; gap: 6px; }
.wheel-legend i, .wheel-group legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.wheel-legend i.dash { width: 18px; height: 0; border-top: 2.5px dashed var(--ink); border-radius: 0; }
.wheel-group { border: none; gap: 14px; border-left: 5px solid var(--gc); }
.wheel-group legend { display: flex; align-items: center; gap: 8px; font-size: 16px; padding: 0; margin-bottom: 4px; float: left; width: 100%; }
.slider { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.slider label { font-weight: 500; font-size: 15px; }
.slider output { font-family: Outfit, sans-serif; font-weight: 600; font-size: 20px; color: var(--gc); min-width: 28px; text-align: right; }
.slider input[type=range] { grid-column: 1 / -1; width: 100%; height: 32px; accent-color: var(--gc); }
.wheel-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.wheel-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.wheel-table td { padding: 7px 4px; border-bottom: 1px solid var(--line-soft); }
.wheel-table td:not(:first-child), .wheel-table th:not(:first-child) { text-align: center; }
.wheel-table .up { color: var(--brand); font-weight: 600; }
.wheel-table .down { color: var(--danger); font-weight: 600; }
.wheel-hl { background: var(--wheel-bg); }
.wheel-hl .hl-ico { color: var(--g4); }
.wheel-hl .kicker-amber { color: var(--wheel-fg); }

/* ---- Relatório da Roda ---- */
.report-head h2 { font-family: Outfit, sans-serif; font-size: 22px; }
.report-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.report-kpis div { background: var(--bg); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; }
.report-kpis strong { font-family: Outfit, sans-serif; font-size: 26px; }
.report-kpis span { font-size: 12px; color: var(--muted); }
.group-bars { display: flex; flex-direction: column; gap: 8px; }
.group-bars > div { display: grid; grid-template-columns: 130px 1fr 36px; gap: 10px; align-items: center; font-size: 14px; }
.group-bars .gb { height: 10px; background: var(--soft); border-radius: 6px; overflow: hidden; }
.group-bars .gb i { display: block; height: 100%; border-radius: 6px; }
.group-bars b { text-align: right; }
.report-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.report-list b { display: inline-block; min-width: 30px; font-family: Outfit, sans-serif; }
.quote { margin: 0; padding: 10px 14px; border-left: 4px solid var(--brand-l); color: var(--ink-2); font-style: italic; white-space: pre-wrap; }
.pnl-area { border-top: 1px solid var(--line-soft); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.pnl-area h3 { margin: 0; font-size: 15px; }
.pnl-area p { font-size: 15px; }
.report-q { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.up-t { color: var(--brand); } .down-t { color: var(--danger); }

@media print {
  .nav, .no-print, .back, .toast { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; max-width: none; }
  .hd-dark { margin: 0; border-radius: 0; background: #fff; color: var(--ink); border-bottom: 2px solid var(--brand); }
  .hd-dark p { color: var(--muted); }
  .card { break-inside: avoid; border: 1px solid var(--line-soft); }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---- Selo Novo ---- */
.nav a { position: relative; }
.nav-badge { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--rust); color: #FFFFFF; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.kicker-amber .badge, summary .badge { margin-left: 6px; vertical-align: middle; }
.seen { color: var(--brand); font-weight: 500; }
.unseen { color: var(--amber); font-weight: 500; }

/* ---- Gráfico de bem-estar ---- */
.bars { height: 140px; }
.bar .bar-val { font-size: 11px; font-weight: 600; color: var(--brand-d); text-align: center; min-height: 14px; line-height: 14px; white-space: nowrap; }
.chart-sum { font-size: 14px; }

/* ---- Instalação (PWA) ---- */
.install-card { border: 1px solid var(--brand-l); }
.install-card h2 { margin: 0; font-size: 17px; }
.install-ico { width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0; }
.install-card .row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.install-card .row-btns:empty { display: none; }
[hidden] { display: none !important; }

/* ---- Materiais da sessão ---- */
.mat-media { display: flex; flex-direction: column; gap: 8px; }
.mat-title { display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 600; color: var(--ink); }
.mat-title svg { color: var(--brand); flex-shrink: 0; }
.sess-group { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; background: var(--card, #fff); border: 1px solid var(--line); }
.sess-group .kicker { color: var(--brand); }

/* ---- Editor de texto ---- */
.prose.rich { white-space: normal; overflow-wrap: anywhere; }
.prose.rich ul, .rte-area ul { margin: 2px 0; padding-left: 22px; }
.prose.rich li, .rte-area li { margin: 2px 0; }
.prose.rich b, .rte-area b { font-weight: 700; color: var(--ink); }
.rte { position: relative; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.rte:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 107, 94, .15); }
.rte.private { background: var(--private); }
.rte-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 4px; padding: 6px; border-bottom: 1px solid var(--line-soft); background: inherit; border-radius: 14px 14px 0 0; }
.rte-btn { min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font: inherit; font-size: 17px; cursor: pointer; }
.rte-btn:hover { background: var(--bg); }
.rte-btn[aria-pressed="true"], .rte-btn[aria-expanded="true"] { background: var(--brand-l); color: var(--brand); }
.rte-btn i { font-family: Georgia, serif; font-size: 18px; }
.rte-sep { width: 1px; height: 22px; background: var(--line-soft); margin: 0 4px; }
.rte-area { padding: 12px 14px; outline: none; line-height: 1.55; color: var(--ink-2); overflow-wrap: anywhere; scroll-margin-bottom: 96px; }
.rte.is-empty .rte-area::before { content: attr(data-placeholder); color: var(--muted); opacity: .8; position: absolute; pointer-events: none; }
.rte-pop { position: absolute; top: 54px; left: 6px; right: 6px; z-index: 5; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 30px var(--shadow); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.rte-pop[hidden] { display: none; }
.rte-search { min-height: 40px; }
.rte-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 2px; max-height: 200px; overflow-y: auto; }
.rte-em { height: 42px; border: 0; border-radius: 10px; background: transparent; font-size: 24px; cursor: pointer; }
.rte-em:hover, .rte-em:focus-visible { background: var(--bg); }
@media (max-width: 720px) { body.typing .nav { display: none; } body.typing .page { padding-bottom: 24px; } }

/* ---- Diário: histórico e filtros ---- */
.mtag { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.erow { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fe { background: var(--card); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.fe.new { background: var(--amber-bg); }
.fe.new .kicker-s { color: var(--amber); }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.more { align-self: flex-start; border: 0; background: none; color: var(--brand); font: inherit; font-size: 13px; font-weight: 600; padding: 4px 0; min-height: 32px; cursor: pointer; }
.dist { display: flex; flex-direction: column; gap: 6px; }
.dbar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; gap: 2px; }
.dbar i { display: block; min-width: 4px; }
.dleg { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; color: var(--muted); }
.dist.on-dark .dleg { color: #E6F0EB; }
.mgroup { display: flex; flex-direction: column; }
.mhead { position: sticky; top: 0; z-index: 3; background: var(--bg); padding: 12px 2px 10px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--line-soft); cursor: pointer; list-style: none; }
.mhead::-webkit-details-marker { display: none; }
.mhead strong { font-size: 17px; }
.mhead .row-between > .muted::after { content: "  +"; }
.mgroup[open] .mhead .row-between > .muted::after { content: "  –"; }
.mgroup:not([open]) .mhead { position: static; background: var(--card); border: 1px solid var(--line-soft); border-radius: 16px; padding: 12px 14px; margin-bottom: 8px; }
.mitems { display: flex; flex-direction: column; gap: 10px; padding: 10px 0 14px; }
.sumcard { background: var(--brand); color: #fff; gap: 8px; }
.sumcard .kicker { color: #D5E3DD; }
.sumcard h2 { color: #fff; font-size: 22px; }
.btn-link.center { display: block; text-align: center; text-decoration: none; line-height: 44px; }
.dtools { display: flex; gap: 8px; }
.srch { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; min-height: 46px; color: var(--muted); }
.srch:focus-within { border-color: var(--brand); }
.srch input { border: 0; outline: none; background: transparent; flex: 1; min-width: 0; min-height: 44px; padding: 0; font: inherit; color: var(--ink); box-shadow: none; }
.fbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 0 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font: inherit; font-size: 14px; font-weight: 600; color: var(--brand); cursor: pointer; }
.fbtn .cnt { background: var(--brand); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; }
.atag { display: inline-flex; gap: 8px; align-items: center; background: var(--brand-l); color: var(--brand); font: inherit; font-size: 13px; font-weight: 600; border: 0; border-radius: 999px; padding: 7px 12px; cursor: pointer; }
.fsheet { position: fixed; inset: 0; z-index: 50; background: rgba(31, 42, 36, .38); display: flex; align-items: flex-end; justify-content: center; padding: 10px; }
.fsheet[hidden] { display: none; }
.fpanel { width: 100%; max-width: 520px; background: var(--card); border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 12px; max-height: 90vh; overflow: auto; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
.fpanel h2:focus { outline: none; }
.flbl { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.fchips { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip { font: inherit; font-size: 13px; font-weight: 600; padding: 8px 12px; min-height: 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.fchip[aria-pressed="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
.fdates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fdates label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.fdates input { min-height: 44px; width: 100%; min-width: 0; box-sizing: border-box; padding: 0 8px; }
.empty { align-items: flex-start; }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }
body.sheet-open { overflow: hidden; }
@media (min-width: 721px) { .fsheet { align-items: center; } }

/* ---- Diário: humor, notas privadas e destaques ---- */
.card.need { box-shadow: 0 0 0 2px var(--amber) inset; background: var(--warm); }
.mwarn { background: var(--amber-bg); color: var(--amber); font-size: 14px; font-weight: 600; border-radius: 12px; padding: 10px 12px; }
.daygrp { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 6px 0 -2px; }
.fe .time { font-weight: 700; color: var(--ink); }
.ftools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pin { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font: inherit; font-size: 13px; font-weight: 600; color: var(--brand); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; background: var(--card); cursor: pointer; }
.pin[aria-pressed="true"] { background: var(--amber-bg2); border-color: var(--amber-line); color: var(--amber); }
.pnote { background: var(--private); border: 1px dashed var(--amber-line); border-radius: 12px; padding: 10px 12px; font-size: 14px; color: var(--amber-ink); }
.pnote b { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--amber); display: block; margin-bottom: 2px; }
.pnote .prose { color: var(--amber-ink); }
.nedit { display: flex; flex-direction: column; gap: 8px; }
.toleva { background: var(--amber-bg2); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.toleva ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.toleva a { color: var(--amber-ink); font-size: 14px; text-decoration: none; line-height: 1.4; }
.toleva a b { color: var(--amber); }
.pinlink { display: block; background: var(--amber-bg2); color: var(--amber); font-weight: 600; font-size: 14px; border-radius: 12px; padding: 10px 14px; text-decoration: none; }
.fe.flash { box-shadow: 0 0 0 3px var(--amber-line); transition: box-shadow .3s; }
.btn-link.danger { color: var(--danger); }

/* ---- Exercício "Antes e depois do novo" ---- */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.steps li { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; min-height: 64px; border-bottom: 1px solid var(--line-soft); }
.steps li:last-child { border-bottom: none; }
.dot { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; background: var(--soft); color: var(--muted); }
.dot.ok { background: var(--brand); color: #fff; }
.dot.now { background: var(--amber-bg); color: var(--amber); box-shadow: 0 0 0 2px var(--amber-line); }
.steps .t { display: flex; flex-direction: column; }
.steps .t strong { font-size: 15px; }
.steps .t span { font-size: 13px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dscale { display: flex; flex-direction: column; gap: 6px; background: var(--bg); border-radius: 14px; padding: 12px 14px; }
.dscale output { align-self: center; font-family: Outfit, sans-serif; font-size: 30px; font-weight: 600; color: var(--amber-strong); line-height: 1; }
.dscale input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; margin: 0; }
.dscale input[type=range]::-webkit-slider-runnable-track { height: 10px; border-radius: 6px; background: linear-gradient(90deg, #9FD0BC, #F2C77E 55%, #E0896F); }
.dscale input[type=range]::-moz-range-track { height: 10px; border-radius: 6px; background: linear-gradient(90deg, #9FD0BC, #F2C77E 55%, #E0896F); }
.dscale input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; border-radius: 50%; background: var(--card); border: 3px solid var(--amber-strong); margin-top: -10px; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.dscale input[type=range]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--card); border: 3px solid var(--amber-strong); }
.scale-ends { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--muted); }
.newtag { background: var(--rust); color: #fff; border-radius: 6px; padding: 1px 7px; font-size: 10px; margin-left: 6px; letter-spacing: .04em; }
.highlight.soft { background: var(--brand-l); }
.highlight.soft .hl-ico { color: var(--brand); }
.highlight.soft .kicker-amber { color: var(--brand); }
.highlight .muted.small { display: block; }
.done-card { align-items: flex-start; }
.big-ok { width: 44px; height: 44px; border-radius: 50%; background: var(--brand-l); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.insight { background: var(--brand); color: #fff; border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.insight h2 { font-family: Outfit, sans-serif; font-size: 20px; }
.insight p { color: #D3E6DF; font-size: 15px; }
.nbars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.nbars.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.nbars > div { display: flex; flex-direction: column; gap: 6px; justify-content: flex-end; }
.nbars i { display: block; border-radius: 10px 10px 4px 4px; flex-shrink: 0; }
.nbars i.n1 { background: var(--amber-line); } .nbars i.n2 { background: var(--bar); } .nbars i.n3 { background: #8FB5A8; } .nbars i.n0 { height: 0; }
.nbars b { font-family: Outfit, sans-serif; font-size: 22px; text-align: center; }
.nbars span { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.3; min-height: 48px; }
.vs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.vs > div { border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; overflow-wrap: anywhere; }
.vs .a { background: var(--amber-bg); } .vs .b { background: var(--brand-l); }
.vs .kicker-s { font-size: 11px; }
.sit { display: flex; flex-direction: column; gap: 2px; border-radius: 12px; padding: 10px 12px; font-size: 14px; background: var(--brand-l); color: var(--brand-d); }
.sit.hard { background: var(--amber-bg2); color: var(--amber-ink); } .sit.hard b { color: var(--amber); }
.nex { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.nex .btn { align-self: flex-start; }
.small-pin { display: inline-block; align-self: flex-start; padding: 4px 10px; font-size: 13px; }
.nans { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.nans:last-child { border-bottom: none; }
.nanswers { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.nanswers dt { font-size: 12px; font-weight: 600; color: var(--muted); }
.nanswers dd { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
@media (max-width: 380px) { .vs { grid-template-columns: minmax(0, 1fr); } }

/* ---- Compromisso ---- */
.cm-new { border: 2px solid var(--amber-line); }
.cm-head { display: flex; flex-direction: column; gap: 6px; }
.cm-k { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--rust); }
.cm-k:focus { outline: none; }
.cm-t { font-family: Georgia, "Times New Roman", serif; font-size: 34px; font-weight: 700; }
.cm-intro { font-size: 17px; margin: 0; }
.cm-box { margin: 0; background: var(--cm-box); border-radius: 20px; padding: 20px 20px; font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: 21px; line-height: 1.45; color: var(--ink); }
.cm-box.sm { font-size: 16px; padding: 14px 16px; }
.cm-remind .cm-box { background: var(--card); }
.cm-step { background: var(--brand-l); border-radius: 14px; padding: 10px 14px; display: flex; flex-direction: column; font-size: 15px; color: var(--brand-d); }
.cm-step b { font-weight: 600; }
.cm-remind { background: var(--remind); }
.cm-remind p { margin: 0; }
.cm-mini { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 16px; padding: 12px 14px; border-left: 4px solid var(--rust); color: var(--ink); text-decoration: none; }
.cm-mini > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.cm-mini strong { color: var(--brand); }
.cm-mini svg { color: var(--brand); flex-shrink: 0; }
.row-gap { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.danger-t { color: var(--danger); }

/* ---- Sessão: objetivos e edição ---- */
.obj-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 8px; align-items: center; }
.obj-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.edit-note { display: flex; gap: 8px; align-items: flex-start; background: var(--amber-bg); color: var(--amber); border-radius: 12px; padding: 10px 12px; font-size: 14px; font-weight: 500; margin: 0; }
.edit-note svg { flex-shrink: 0; margin-top: 2px; }
.mat-t { display: inline-flex; gap: 8px; align-items: center; min-width: 0; }
.mat-t svg { flex-shrink: 0; color: var(--brand); }
.row-gap .btn.sm svg { margin-right: 6px; }
fieldset.field { padding: 0; min-width: 0; }
fieldset.field > legend { font-size: 14px; font-weight: 600; padding: 0; margin-bottom: 6px; }
.snum { font-weight: 700; }

/* ---- Diário: registro sobre ontem ---- */
.when-sw { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.when-sw .pill[aria-pressed="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
.when-note { margin: -4px 0 0; background: var(--amber-bg); color: var(--amber); border-radius: 12px; padding: 10px 12px; font-size: 14px; font-weight: 500; }
.when-note[hidden] { display: none; }
.late { font-style: italic; color: var(--amber); font-weight: 500; text-transform: none; letter-spacing: 0; }

/* ---- Novidades ---- */
.news { gap: 8px; }
.news h2 { font-size: 20px; }
.news-hl .kicker-amber { color: var(--brand); }
.link-card { display: flex; flex-direction: row; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; }
.link-card > span { flex: 1; display: flex; flex-direction: column; }
.link-card > svg { color: var(--brand); flex-shrink: 0; }

/* ---- Tema escuro ---- */
/* Ativado por <html data-theme="dark">. Fica restrito à tela para a impressão sair sempre clara. */
@media screen {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #121A17; --card: #1B2521; --ink: #E6EDE9; --muted: #A3B2AB; --line: #34433C; --soft: #24302B;
    --brand: #3D8A75; --brand-d: #A8D8C8; --brand-l: #213B34;
    --dark: #0C1210; --dark-2: #1C2622; --dark-m: #9FB5AC;
    --amber-bg: #3A2E1A; --amber: #E9B866; --danger: #E68B7F;
    --ink-2: #CBD6D1; --line-soft: #2A3631; --private: #221F19; --private-2: #1F2421;
    --amber-bg2: #3A2E1A; --amber-ink: #E8D3AE; --amber-line: #6B5530; --amber-strong: #E9B866;
    --warm: #2A2418; --mark: #6B5418; --bar: #3D5A50; --cm-box: #23403A; --remind: #2E2617;
    --wheel-bg: #2C2438; --wheel-fg: #CDB4EA; --wheel-grid: #34433C; --rust: #D0643C;
    --locked: #1F2925; --locked-2: #2A3631; --field: #141D1A; --shadow: rgba(0, 0, 0, .5); --toast: #2C3A33;
    --mc0: #D9735E; --mc1: #E0A84C; --mc2: #8E9C96; --mc3: #5DB89A; --mc4: #3E9C80;
    --mb0: #4A2620; --mb1: #43341A; --mb2: #2C3632; --mb3: #1F3D33; --mb4: #1C4136;
    --mf0: #F2B1A4; --mf1: #F0CB86; --mf2: #C3CEC9; --mf3: #9EDCC6; --mf4: #B8E8D6;
    --g1: #4FA88F; --g2: #E0A04A; --g3: #6E9FD1; --g4: #B08AD6;
  }
  :root[data-theme="dark"] .btn:hover { background: #347A67; }
  :root[data-theme="dark"] .journey, :root[data-theme="dark"] .sumcard, :root[data-theme="dark"] .insight { background: #24594C; }
  :root[data-theme="dark"] .progress { background: #1A4238; }
  :root[data-theme="dark"] .card, :root[data-theme="dark"] .highlight { box-shadow: none; }
  :root[data-theme="dark"] .card { border: 1px solid #26322D; }
  :root[data-theme="dark"] .rte-area { color: var(--ink); }
  :root[data-theme="dark"] .video { background: #000; }
  :root[data-theme="dark"] input::placeholder, :root[data-theme="dark"] textarea::placeholder { color: #7F8F88; }
}

/* ---- Conta: aparência ---- */
.theme-sw { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.theme-sw .pill { padding: 0 8px; }
