/* Mamãe Fluente na Rotina · Área da aluna · Proposta B "Clareza" (versão compacta) */
:root {
  --bg: #fbf4ef; --surface: #ffffff; --line: #eadfd6; --line-soft: #f1e8e1;
  --ink: #1f3b4d; --muted: #5b6f7c; --blue: #306582; --blue-press: #234d64; --blue-tint: #e4eff3;
  --terra: #d35400; --terra-text: #b34700; --terra-tint: #fbe9dd; --playing: #fdf3ec;
  --danger: #b3261e; --ring: #c9d8df;
  --font: Poppins, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tabbar: 52px; --player: 50px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-text-size-adjust: 100%; }
body { overflow: hidden; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--terra); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { height: 100%; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; position: relative; background: var(--bg); }
@media (min-width: 560px) { body { background: #efe6de; } .app { box-shadow: 0 0 0 1px var(--line); } }

/* ---------- headers ---------- */
.top { flex: none; height: 48px; display: flex; align-items: center; padding: 0 6px 0 2px; border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px); height: calc(48px + env(safe-area-inset-top, 0px)); }
.top h1 { flex: 1; margin: 0; font-size: 16px; font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .meta { font-size: 12px; color: var(--muted); padding-right: 6px; }
.top-home { flex: none; height: calc(52px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 4px 0 16px;
  display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.top-home img { width: 76px; height: auto; display: block; }
.icon-btn { width: 44px; height: 44px; border: 0; padding: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; }
.text-btn { height: 44px; padding: 0 10px; border: 0; background: transparent; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--blue); }

/* ---------- scroll area ---------- */
.scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 16px calc(var(--tabbar) + 16px + env(safe-area-inset-bottom, 0px)); }
.has-player .scroll { padding-bottom: calc(var(--tabbar) + var(--player) + 22px + env(safe-area-inset-bottom, 0px)); }
.scroll.tight { padding-left: 12px; padding-right: 12px; padding-top: 10px; }
.h-title { margin: 0 0 12px; font-size: 22px; font-weight: 600; }
.h-sub { margin: 0; font-size: 20px; font-weight: 600; }
.lead { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.section-label { margin: 18px 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.small-note { margin: 8px 0 0; font-size: 12px; color: var(--muted); }

/* ---------- lists & boxes ---------- */
.box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.row { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 4px 8px 4px 10px; border: 0; border-bottom: 1px solid var(--line-soft);
  background: transparent; text-align: left; color: var(--ink); text-decoration: none; }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row .t { font-size: 15px; font-weight: 500; line-height: 1.3; }
.row .s { font-size: 12px; color: var(--muted); line-height: 1.3; }
.row .n { font-size: 12px; color: var(--muted); }
.ico { flex: none; width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.ico.peach { background: var(--terra-tint); color: var(--terra-text); }
.ico.blue { background: var(--blue-tint); color: var(--blue); }
.ico.lg { width: 34px; height: 34px; border-radius: 9px; }
.group-head { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 10px 0; font-size: 15px; font-weight: 500; }
.row.sub { padding-left: 50px; min-height: 44px; }
.row.sub .t { font-size: 14px; font-weight: 400; }

.tiles { display: flex; flex-direction: column; gap: 8px; }
.tile { min-height: 56px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); display: flex; align-items: center; gap: 12px; text-align: left; color: var(--ink); }
.tile .t { font-size: 15px; font-weight: 600; } .tile .s { font-size: 12px; color: var(--muted); }

.cat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cat-tile { padding: 8px 4px 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ink); }
.cat-tile .t { font-size: 13px; font-weight: 600; line-height: 1.25; text-align: center; }
.cat-tile .s { font-size: 12px; color: var(--muted); }
.cat-tile .ico { width: 32px; height: 32px; }

/* ---------- audio list ---------- */
.track { width: 100%; display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 3px 4px 3px 10px; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; text-align: left; color: var(--ink); }
.track .num { width: 18px; flex: none; font-size: 12px; font-weight: 600; color: var(--muted); }
.track .t { font-size: 15px; font-weight: 500; line-height: 1.3; }
.track .s { font-size: 12px; color: var(--muted); line-height: 1.3; }
.track .pp { width: 40px; height: 40px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.track .pp span { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--ring); background: #fff; display: inline-flex; align-items: center; justify-content: center; color: var(--blue); }
.track.on { background: var(--playing); }
.track.on .num { color: var(--terra-text); }
.track.on .t { font-weight: 600; }
.track.on .pp span { background: var(--blue); border-color: var(--blue); color: #fff; }
.review { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 2px 12px 2px 10px; background: var(--bg); text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line-soft); }
.review .t { flex: 1; font-size: 14px; font-weight: 600; }
.review .open { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--terra-text); }
.list-box { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.list-box li:last-child > * { border-bottom: 0; }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: row dense; gap: 6px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 4px 4px 0; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.card.pair { grid-column: span 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.card.pair > div { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.card.on { border-color: var(--blue); }
.card .pic { width: 100%; height: 50px; border-radius: 7px; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.card .pic img { width: 44px; height: 44px; display: block; }
.card .w { margin-top: 4px; max-width: 100%; text-align: center; font-size: 13px; line-height: 1.2; font-weight: 600; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
.card .snd { margin-top: auto; width: 44px; height: 40px; flex: none; border: 0; padding: 0; background: transparent; display: flex; align-items: center; justify-content: center; }
.card .snd span { width: 26px; height: 26px; border-radius: 50%; border: 1.25px solid var(--blue); background: #fff; color: var(--blue); display: flex; align-items: center; justify-content: center; }
.card .snd.on span { background: var(--blue); color: #fff; box-shadow: 0 0 0 3px #d6e5ec; }
.card .snd.err span { border-style: dashed; border-color: var(--muted); color: var(--muted); }
@media (min-width: 430px) { .card .pic { height: 58px; } .card .pic img { width: 50px; height: 50px; } .card .w { font-size: 14px; } }

/* ---------- mini player ---------- */
.mini { position: absolute; left: 6px; right: 6px; bottom: calc(var(--tabbar) + 4px + env(safe-area-inset-bottom, 0px)); height: var(--player);
  background: var(--surface); border: 1px solid #e3d8cf; border-radius: 12px; padding: 0 0 0 10px; display: flex; align-items: center; gap: 6px;
  box-shadow: 0 4px 14px rgba(31, 59, 77, .10); overflow: hidden; z-index: 5; }
.mini .bar { position: absolute; left: 0; top: 0; height: 2px; background: var(--terra); width: 0; }
.mini .info { flex: 1; min-width: 0; display: flex; flex-direction: column; border: 0; background: transparent; text-align: left; padding: 0; height: 100%; justify-content: center; }
.mini .info .t { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .info .s { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pill { height: 24px; padding: 0 7px; border-radius: 999px; border: 1px solid var(--ring); font-size: 12px; font-weight: 600; color: var(--blue); display: inline-flex; align-items: center; }
.round { width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; }

/* expanded player */
.sheet-back { position: absolute; inset: 0; background: rgba(31, 59, 77, .28); z-index: 20; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 16px 16px 0 0; padding: 10px 18px calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 21; display: flex; flex-direction: column; gap: 10px; }
.sheet .grab { align-self: center; width: 40px; height: 4px; border-radius: 4px; background: var(--line); }
.sheet .t { font-size: 16px; font-weight: 600; } .sheet .s { font-size: 13px; color: var(--muted); }
.sheet input[type=range] { width: 100%; accent-color: var(--terra); height: 28px; }
.times { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: -6px; }
.controls { display: flex; align-items: center; justify-content: space-between; }
.big-play { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; }

/* ---------- tab bar ---------- */
.tabs { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px)); padding: 2px 8px env(safe-area-inset-bottom, 0px);
  background: var(--surface); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); z-index: 6; }
.tab { border: 0; padding: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; line-height: 1.2; font-weight: 500; color: var(--muted); }
.tab .pillbg { width: 44px; height: 24px; border-radius: 999px; display: flex; align-items: center; justify-content: center; }
.tab.on { color: var(--blue); font-weight: 600; } .tab.on .pillbg { background: var(--blue-tint); }

/* ---------- forms (login) ---------- */
.auth { flex: 1; overflow-y: auto; padding: calc(24px + env(safe-area-inset-top, 0px)) 20px calc(20px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.brand img { width: 270px; max-width: 100%; height: auto; display: block; }
.brand-mother { color: var(--terra); }
.brand p { margin: 0; max-width: 260px; text-align: center; font-size: 14px; line-height: 1.45; color: var(--muted); }
.form { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; }
.form h2 { margin: 0; font-size: 20px; font-weight: 600; }
.form .intro { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 13px; font-weight: 500; }
.field input { height: 46px; border-radius: 10px; border: 1px solid #d9cdc3; background: #fff; padding: 0 12px; font-size: 16px; width: 100%; }
.field input:focus { outline: none; border: 2px solid var(--blue); padding: 0 11px; }
.pw { position: relative; } .pw input { padding-right: 46px; } .pw .icon-btn { position: absolute; right: 1px; top: 1px; }
.btn { height: 46px; border-radius: 10px; border: 0; background: var(--blue); color: #fff; font-size: 16px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; padding: 0 16px; }
.btn:active { background: var(--blue-press); }
.btn[disabled] { opacity: .6; }
.btn.ghost { background: transparent; color: var(--blue); border: 1px solid var(--blue); font-size: 14px; }
.or { display: flex; align-items: center; gap: 10px; color: #6b7c87; font-size: 12px; } .or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.msg { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 14px; line-height: 1.5; }
.msg.info { background: var(--blue-tint); }
.msg.warn { background: var(--terra-tint); }
.msg:empty { display: none; }

/* blocked access */
.blocked { display: flex; flex-direction: column; gap: 12px; padding-top: 18px; }
.blocked .msg { font-size: 15px; }
.support-addr { font-size: 13px; color: var(--muted); user-select: all; -webkit-user-select: all; word-break: break-all; }

/* toast */
.toast { position: absolute; left: 12px; right: 12px; top: calc(56px + env(safe-area-inset-top, 0px)); z-index: 30; background: var(--ink); color: #fff; border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.45; box-shadow: 0 6px 18px rgba(0,0,0,.18); display: flex; gap: 10px; align-items: flex-start; }
.toast a { color: #fff; font-weight: 600; }
.toast button { margin-left: auto; flex: none; border: 0; background: transparent; color: #fff; width: 32px; height: 32px; margin-top: -6px; margin-right: -6px; }

.spin { width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: sp .8s linear infinite; display: inline-block; }
@keyframes sp { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2s; } }
