/* ==========================================================
   Família Unida — estilos
   ========================================================== */
:root {
  --accent: #7c5cff;
  --accent-2: #b06bff;
  --bg: #f4f3fa;
  --bg-2: #ebe8f7;
  --card: #ffffff;
  --text: #1b1830;
  --muted: #7a7690;
  --line: #e9e6f3;
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(27, 24, 48, .04), 0 8px 24px rgba(27, 24, 48, .06);
  --shadow-lg: 0 20px 60px rgba(27, 24, 48, .18);
  --tabbar-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #100e1a;
    --bg-2: #181527;
    --card: #1c192c;
    --text: #f1effa;
    --muted: #9b97b2;
    --line: #2b2742;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--text); background: var(--bg);
  font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.05rem; }
p { margin: .25rem 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.mt { margin-top: 1.25rem; }
.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
[hidden] { display: none !important; }

/* ---------- Estrutura ---------- */
.app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; }
@media (min-width: 700px) {
  body:not(.guest) { background: radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent), var(--bg); }
  .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: var(--bg); }
}
.content { padding: 8px 18px calc(var(--tabbar-h) + var(--safe-b) + 90px); }

.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px;
  padding: calc(10px + var(--safe-t)) 14px 10px; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.05rem; }
.brand img { border-radius: 9px; }
.topbar-title { flex: 1; font-size: 1.05rem; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; gap: 4px; min-width: 40px; justify-content: flex-end; }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 0;
  background: transparent; cursor: pointer; color: var(--text); list-style: none;
}
.icon-btn:hover { background: var(--bg-2); }
.icon-btn .i { width: 22px; height: 22px; }
summary.icon-btn::-webkit-details-marker { display: none; }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); bottom: calc(10px + var(--safe-b));
  width: min(540px, calc(100% - 20px)); height: var(--tabbar-h); display: flex; align-items: center; justify-content: space-around;
  background: color-mix(in srgb, var(--card) 88%, transparent); border: 1px solid var(--line); border-radius: 26px;
  backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); box-shadow: var(--shadow-lg);
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: .7rem; font-weight: 600; padding: 6px 0; }
.tab .i { width: 24px; height: 24px; }
.tab.active { color: var(--accent); }
.tab-ico { position: relative; }
.badge { position: absolute; top: -6px; right: -10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .68rem; display: grid; place-items: center; border: 2px solid var(--card); }
.tab-fab {
  width: 56px; height: 56px; border-radius: 19px; border: 0; cursor: pointer; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 45%, transparent);
  transform: translateY(-14px); transition: transform .15s;
}
.tab-fab:active { transform: translateY(-14px) scale(.94); }
.tab-fab .i { width: 28px; height: 28px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
  padding: 12px 18px; border-radius: 14px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #ff6bd5));
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent); transition: transform .12s, opacity .12s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-lg { padding: 15px 20px; font-size: 1.02rem; border-radius: 16px; }
.btn-sm { padding: 8px 12px; font-size: .85rem; border-radius: 11px; }
.btn-block { width: 100%; }
.btn-ghost { background: var(--bg-2); color: var(--text); box-shadow: none; }
.btn-danger-ghost { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); box-shadow: none; margin-top: 10px; }
.link { color: var(--accent); font-weight: 700; font-size: .9rem; }

/* ---------- Cartões e seções ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin: 14px 0; border: 1px solid var(--line); }
.card h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cards { display: grid; gap: 12px; }
.section { margin-top: 22px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 22px 2px 10px; }
.section-head h3 { display: flex; align-items: center; gap: 8px; }
.section-head h3 .i { color: var(--accent); }
.page-head { margin: 6px 2px 16px; }
.notice { background: var(--bg-2); border-radius: var(--radius-sm); padding: 12px 14px; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; margin-top: 16px; }

.empty { text-align: center; padding: 34px 18px; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.empty.small { padding: 18px; }
.empty-emoji { font-size: 3rem; margin-bottom: 6px; }
.empty p { margin-bottom: 10px; }
.empty .btn { margin-top: 8px; }

/* ---------- Tags ---------- */
.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 700; padding: 4px 8px; border-radius: 8px; background: var(--bg-2); color: var(--muted); }
.tag .i { width: 12px; height: 12px; }
.tag-owner { background: #fff3d6; color: #a86a00; }
.tag-admin { background: #e1efff; color: #1d64c8; }
.tag-member { background: var(--bg-2); color: var(--muted); }
.tag-rec { background: #ffe8f3; color: #c0267a; }
.tag-chk { background: #dcfaee; color: #0b8a5e; }
.tag-priv { background: #ede8ff; color: #5b3fd6; }
@media (prefers-color-scheme: dark) {
  .tag-owner { background: #3a2c0b; color: #ffc94d; }
  .tag-admin { background: #10294a; color: #78b6ff; }
  .tag-rec { background: #3c1029; color: #ff7cbc; }
  .tag-chk { background: #0c3527; color: #4be0a6; }
  .tag-priv { background: #251c4d; color: #ab97ff; }
}

/* ---------- Avatares ---------- */
.avatar {
  --c: var(--accent); display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 60%, #fff)); color: #fff; font-weight: 800; font-size: .9rem; flex: none;
  border: 2px solid var(--card);
}
.avatar-xs { width: 20px; height: 20px; font-size: .55rem; border-width: 1px; vertical-align: -5px; }
.avatar-sm { width: 28px; height: 28px; font-size: .66rem; }
.avatar-lg { width: 50px; height: 50px; font-size: 1.05rem; }
.avatar-xl { width: 92px; height: 92px; font-size: 2rem; border-width: 4px; }
.avatar-empty { background: var(--bg-2); color: var(--muted); }
.avatar-more { background: var(--bg-2); color: var(--muted); }
.avatars { display: flex; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.avatars .avatar { margin-right: -8px; }
.avatars .tag { margin-left: 16px; }

/* ---------- Login ---------- */
.login { min-height: 100vh; min-height: 100dvh; max-width: 460px; margin: 0 auto; padding: 0 18px 30px; display: flex; flex-direction: column; }
.login-hero { position: relative; text-align: center; padding: calc(56px + var(--safe-t)) 10px 34px; overflow: hidden; }
.login-hero h1 { font-size: 2rem; font-weight: 900; margin-top: 14px; }
.login-hero p { color: var(--muted); max-width: 320px; margin: 8px auto 0; }
.login-logo { border-radius: 26px; box-shadow: 0 16px 40px color-mix(in srgb, var(--accent) 40%, transparent); position: relative; animation: float 4s ease-in-out infinite; }
.hero-emojis { display: flex; justify-content: center; gap: 10px; margin-top: 18px; font-size: 1.5rem; }
.hero-emojis span { width: 46px; height: 46px; display: grid; place-items: center; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); animation: pop .6s backwards; }
.hero-emojis span:nth-child(2) { animation-delay: .08s; } .hero-emojis span:nth-child(3) { animation-delay: .16s; }
.hero-emojis span:nth-child(4) { animation-delay: .24s; } .hero-emojis span:nth-child(5) { animation-delay: .32s; }
.blob { position: absolute; border-radius: 50%; filter: blur(40px); opacity: .5; z-index: -1; }
.b1 { width: 220px; height: 220px; background: #7c5cff; top: -40px; left: -60px; }
.b2 { width: 180px; height: 180px; background: #ff6bd5; top: 40px; right: -50px; }
.b3 { width: 160px; height: 160px; background: #3dd6c3; top: 200px; left: 30%; opacity: .3; }
.login-card { background: var(--card); border-radius: 26px; padding: 22px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.login-card h2 { margin-bottom: 4px; }
.login-foot { text-align: center; margin-top: auto; padding-top: 24px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .78rem; margin: 20px 0 14px; text-align: center; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.demo-users { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.demo-user { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; font-size: .82rem; font-weight: 700; transition: transform .12s; }
.demo-user:active { transform: scale(.95); }

/* ---------- Formulários ---------- */
.form { display: grid; gap: 4px; }
.field { display: grid; gap: 6px; margin: 10px 0; border: 0; padding: 0; min-width: 0; }
.field > span, .field > legend { font-weight: 700; font-size: .88rem; padding: 0; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=time], select, textarea {
  width: 100%; padding: 13px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--bg); outline: none; transition: border-color .15s, box-shadow .15s; font-size: 16px;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; min-width: 0; }

.preview-badge { --c: var(--accent); width: 92px; height: 92px; border-radius: 28px; margin: 6px auto 4px; display: grid; place-items: center; font-size: 3rem; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 25%, var(--card)), color-mix(in srgb, var(--c) 10%, var(--card))); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 8px; }
.emoji-opt input, .color-opt input, .choice input, .weekdays input { position: absolute; opacity: 0; pointer-events: none; }
.emoji-opt span { display: grid; place-items: center; height: 48px; font-size: 1.5rem; border-radius: 14px; background: var(--bg); border: 2px solid transparent; cursor: pointer; transition: transform .12s; }
.emoji-opt input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--card)); transform: scale(1.05); }
.color-grid { display: flex; gap: 10px; flex-wrap: wrap; }
.color-opt span { display: block; width: 38px; height: 38px; border-radius: 50%; background: var(--c); cursor: pointer; border: 3px solid var(--card); box-shadow: 0 0 0 2px transparent; transition: box-shadow .15s; }
.color-opt input:checked + span { box-shadow: 0 0 0 2px var(--c); }
.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice span { display: grid; gap: 2px; padding: 14px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); cursor: pointer; height: 100%; }
.choice b { font-size: 1.5rem; }
.choice small { color: var(--muted); font-size: .76rem; line-height: 1.3; }
.choice input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
.choice.disabled span { opacity: .45; cursor: not-allowed; }

.segmented { display: flex; background: var(--bg-2); border-radius: 14px; padding: 4px; gap: 4px; margin: 16px 0 6px; }
.segmented > a, .segmented > label { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; border-radius: 11px; font-weight: 700; font-size: .9rem; color: var(--muted); cursor: pointer; }
.segmented > a b { font-size: .72rem; background: var(--card); padding: 1px 7px; border-radius: 8px; }
.segmented > .active, .segmented > label:has(input:checked) { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.segmented-sm { margin: 0; }
.segmented-sm input { position: absolute; opacity: 0; }
.weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 10px; }
.weekdays span { display: grid; place-items: center; height: 40px; border-radius: 12px; background: var(--bg); border: 2px solid var(--line); font-size: .78rem; font-weight: 700; cursor: pointer; }
.weekdays input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Home ---------- */
.hello { display: flex; justify-content: space-between; align-items: center; margin: 6px 2px 16px; }
.wave { display: inline-block; animation: wave 2.4s ease-in-out 1; transform-origin: 70% 70%; }
.today-card {
  display: flex; gap: 18px; align-items: center; padding: 20px; border-radius: 24px; color: #fff;
  background: linear-gradient(135deg, #7c5cff 0%, #a35cff 50%, #ff6bd5 120%); box-shadow: 0 16px 36px rgba(124, 92, 255, .35);
}
.today-card h3 { font-size: 1.2rem; }
.today-card p { opacity: .92; font-size: .92rem; }
.ring { position: relative; width: 74px; height: 74px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3.6; }
.ring-bg { stroke: rgba(255, 255, 255, .25); }
.ring-fg { stroke: #fff; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--p)); transition: stroke-dashoffset .6s cubic-bezier(.2, .8, .2, 1); }
.ring strong { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1rem; }
.invite-banner, .sheet-option { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); margin-top: 14px; }
.invite-banner span:nth-child(2), .sheet-option span:nth-child(2) { flex: 1; display: grid; }
.invite-banner small, .sheet-option small { color: var(--muted); }
.emoji-bubble { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; background: var(--bg-2); flex: none; }

.hscroll { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -18px; padding: 4px 18px 10px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.group-tile {
  --c: var(--accent); position: relative; flex: 0 0 150px; scroll-snap-align: start; padding: 16px; border-radius: 22px; display: grid; gap: 2px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 22%, var(--card)), var(--card) 70%); border: 1px solid color-mix(in srgb, var(--c) 25%, var(--line));
}
.group-tile-ico { font-size: 2rem; margin-bottom: 8px; }
.group-tile small { color: var(--muted); }
.role-pill { position: absolute; top: 12px; right: 12px; width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; background: var(--card); color: var(--c); }
.role-pill .i { width: 14px; height: 14px; }

/* ---------- Itens ---------- */
.items { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); transition: background .2s, opacity .3s; }
.item:last-child { border-bottom: 0; }
.item-ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 1.4rem; background: var(--bg-2); flex: none; transition: transform .2s; }
.item-body { flex: 1; min-width: 0; display: grid; gap: 1px; cursor: default; }
.item-body[data-edit] { cursor: pointer; }
.item-body strong { font-weight: 650; overflow-wrap: anywhere; }
.item-body small { color: var(--muted); font-size: .8rem; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.item-body small .i { width: 13px; height: 13px; }
.qty { font-style: normal; font-weight: 600; font-size: .78rem; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); padding: 1px 7px; border-radius: 7px; margin-left: 4px; }
.note { width: 100%; font-style: italic; }
.item.done .item-body strong { text-decoration: line-through; color: var(--muted); }
.item.done .item-ico { filter: grayscale(.6); opacity: .6; }
.item.off-day { opacity: .6; }
.streak { display: inline-flex; align-items: center; gap: 2px; color: #f97316; font-weight: 800; margin-left: 4px; }
.week { display: flex; gap: 4px; margin-top: 6px; }
.week i { width: 20px; height: 20px; border-radius: 6px; font-style: normal; font-size: .6rem; font-weight: 800; display: grid; place-items: center; }
.week .ok { background: var(--ok); color: #fff; }
.week .miss { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.week .rest { background: var(--bg-2); color: var(--muted); opacity: .6; }
.week .today { outline: 2px solid var(--accent); outline-offset: 1px; }
.week .today.miss { background: var(--bg-2); color: var(--muted); }
.assignee { flex: none; }

.check-form { margin: 0; flex: none; }
.check {
  width: 30px; height: 30px; border-radius: 10px; border: 2.5px solid color-mix(in srgb, var(--accent) 55%, var(--line)); background: transparent;
  display: grid; place-items: center; cursor: pointer; color: transparent; transition: all .18s cubic-bezier(.2, .8, .2, 1); padding: 0;
}
.check .i { width: 17px; height: 17px; transform: scale(.4); transition: transform .2s; }
.check.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.check.on .i { transform: scale(1); }
.check.locked { border-style: dashed; border-color: var(--line); color: var(--muted); }
.check.locked .i { transform: scale(.8); width: 14px; height: 14px; }
.check.locked.on { background: color-mix(in srgb, var(--ok) 25%, transparent); border-style: solid; border-color: transparent; color: var(--ok); }
.check.pop { animation: pop .35s; }
.done-group { margin-top: 18px; }
.done-group summary { cursor: pointer; color: var(--muted); font-weight: 700; padding: 8px 4px; list-style: none; }
.done-group summary::before { content: "▸ "; } .done-group[open] summary::before { content: "▾ "; }

/* ---------- Grupos e listas ---------- */
.limits { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.limit { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: grid; gap: 4px; box-shadow: var(--shadow); }
.limit-num { font-size: 1.6rem; font-weight: 900; }
.limit-num small { font-size: .9rem; color: var(--muted); font-weight: 700; }
.limit-label { font-size: .78rem; color: var(--muted); display: flex; gap: 4px; align-items: center; }
.bar, .progress { display: block; height: 6px; border-radius: 4px; background: var(--bg-2); overflow: hidden; }
.bar i, .progress i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #ff6bd5)); transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.progress { margin: 8px 0 4px; }
.progress-lg { height: 8px; }

.group-card, .list-card { --c: var(--accent); display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .12s; }
.group-card:active, .list-card:active { transform: scale(.985); }
.group-card > .i, .list-card > .i { color: var(--muted); }
.group-card-ico, .list-card-ico { width: 54px; height: 54px; border-radius: 17px; display: grid; place-items: center; font-size: 1.8rem; flex: none; background: color-mix(in srgb, var(--c) 16%, var(--card)); }
.list-card-ico { background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.group-card-body, .list-card-body { flex: 1; min-width: 0; display: grid; }
.group-card-body small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.group-hero { --c: var(--accent); display: flex; gap: 16px; align-items: center; padding: 20px; border-radius: 24px; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 55%, #ff6bd5)); color: #fff; box-shadow: 0 16px 36px color-mix(in srgb, var(--c) 35%, transparent); }
.group-hero p { opacity: .9; font-size: .92rem; }
.group-hero-ico { width: 70px; height: 70px; border-radius: 22px; display: grid; place-items: center; font-size: 2.4rem; background: rgba(255, 255, 255, .22); flex: none; }
.group-hero .avatar { border-color: color-mix(in srgb, var(--c) 80%, #000); }
.tag-light { background: rgba(255, 255, 255, .22) !important; color: #fff !important; }

.list-hero { display: flex; gap: 16px; align-items: center; padding: 18px; border-radius: 24px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); margin-bottom: 8px; }
.list-hero-ico { width: 66px; height: 66px; border-radius: 20px; display: grid; place-items: center; font-size: 2.2rem; flex: none; background: color-mix(in srgb, var(--accent) 14%, var(--card)); }
.list-hero-body { flex: 1; min-width: 0; }

.members { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
.member { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.member:last-child { border-bottom: 0; }
.member-body { flex: 1; min-width: 0; display: grid; gap: 3px; justify-items: start; }
.member-body em { font-style: normal; font-weight: 500; }
.member form { margin: 0; }
.roles-help summary { cursor: pointer; font-weight: 700; display: flex; gap: 8px; align-items: center; list-style: none; color: var(--accent); }
.roles-help ul { padding-left: 18px; margin: 12px 0 0; color: var(--muted); font-size: .9rem; display: grid; gap: 8px; }
.roles-help strong { color: var(--text); }
.invite-form small { display: block; margin-top: 8px; }

.invite-card { --c: var(--accent); background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 16px; border-top: 4px solid var(--c); }
.invite-top { display: flex; gap: 14px; align-items: center; }
.invite-top > div { display: grid; gap: 2px; }
.invite-actions { display: flex; gap: 10px; margin-top: 14px; }
.invite-actions form { flex: 1; }
.invite-actions .btn { width: 100%; }

/* ---------- Menus ---------- */
.menu { position: relative; }
.menu summary { list-style: none; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; z-index: 40; padding: 6px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: drop .16s ease-out;
}
.menu-pop a, .menu-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border-radius: 11px; border: 0; background: none; cursor: pointer; text-align: left; font-size: .93rem; font-weight: 600; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--bg-2); }
.menu-pop button:disabled { opacity: .4; cursor: not-allowed; }
.menu-pop form { margin: 0; }
.danger { color: var(--danger) !important; }
.menu-list { padding: 6px; }
.menu-list form { margin: 0; }
.menu-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border: 0; background: none; border-radius: 12px; font-weight: 600; cursor: pointer; text-align: left; }
.menu-row:hover { background: var(--bg-2); }

/* ---------- Adição rápida ---------- */
.quick-add {
  position: fixed; z-index: 25; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + var(--safe-b) + 20px);
  width: min(540px, calc(100% - 20px)); display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 8px; border-radius: 20px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.quick-add input[type=text] { flex: 1; border: 0; background: transparent; padding: 10px 4px; box-shadow: none; min-width: 0; }
.quick-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-2); font-size: 1.25rem; flex: none; transition: transform .2s; }
.quick-ico.bump { animation: pop .35s; }
.quick-send { width: 42px; height: 42px; border-radius: 14px; border: 0; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); cursor: pointer; flex: none; }
.page-list .content { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 110px); }

/* ---------- Bottom sheet ---------- */
.sheet {
  border: 0; padding: 10px 18px calc(18px + var(--safe-b)); margin: auto auto 0; width: min(560px, 100%); max-height: 88vh; max-height: 88dvh;
  border-radius: 28px 28px 0 0; background: var(--card); color: var(--text); box-shadow: var(--shadow-lg); overflow-y: auto;
}
.sheet[open] { animation: slideUp .26s cubic-bezier(.2, .8, .2, 1); }
.sheet::backdrop { background: rgba(10, 8, 20, .45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sheet-handle { width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: 2px auto 12px; }
.sheet-title { font-size: 1.2rem; margin-bottom: 8px; }
.sheet-sub { font-weight: 700; color: var(--muted); font-size: .85rem; margin: 18px 0 8px; }
.sheet-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.sheet .btn-block { margin-top: 12px; }
.sheet-option.disabled { opacity: .5; pointer-events: none; }
.chip-group { --c: var(--accent); display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; font-weight: 700; font-size: .9rem; background: color-mix(in srgb, var(--c) 14%, var(--card)); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); }
.sheet-actions { display: flex; gap: 10px; margin-top: 12px; }
.sheet-actions .btn { flex: 1; }
.icon-title { display: flex; gap: 10px; align-items: center; margin: 6px 0; }
.icon-title input { flex: 1; }
.icon-pick { width: 54px; height: 54px; border-radius: 16px; border: 2px dashed color-mix(in srgb, var(--accent) 50%, var(--line)); background: var(--bg); font-size: 1.7rem; cursor: pointer; flex: none; }
.icon-gallery { background: var(--bg); border-radius: 16px; padding: 4px 10px 10px; max-height: 260px; overflow-y: auto; margin-bottom: 6px; }
.gallery-cat { font-size: .74rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 10px 2px 6px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 4px; }
.gallery-grid button { height: 40px; border: 0; border-radius: 10px; font-size: 1.35rem; background: transparent; cursor: pointer; }
.gallery-grid button:hover, .gallery-grid button.sel { background: color-mix(in srgb, var(--accent) 16%, var(--card)); }

/* ---------- Perfil ---------- */
.profile-hero { text-align: center; padding: 10px 0 6px; }
.profile-hero h2 { margin-top: 10px; }
.stats { display: flex; justify-content: center; gap: 12px; margin-top: 16px; }
.stats div { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 18px; display: grid; box-shadow: var(--shadow); }
.stats strong { font-size: 1.3rem; }
.stats small { color: var(--muted); font-size: .76rem; }

/* ---------- Toasts / instalar ---------- */
.toasts { position: fixed; z-index: 100; top: calc(12px + var(--safe-t)); left: 50%; transform: translateX(-50%); width: min(520px, calc(100% - 24px)); display: grid; gap: 8px; pointer-events: none; }
.toast { padding: 13px 16px; border-radius: 16px; background: #1b1830; color: #fff; font-weight: 600; font-size: .93rem; box-shadow: var(--shadow-lg); animation: toastIn .3s cubic-bezier(.2, .8, .2, 1); pointer-events: auto; }
.toast-success { background: linear-gradient(135deg, #0f9f74, #10b981); }
.toast-error { background: linear-gradient(135deg, #dc2626, #f43f5e); }
.toast.hide { opacity: 0; transform: translateY(-10px); transition: all .3s; }
.install-banner { position: fixed; z-index: 35; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + var(--safe-b) + 22px); width: min(520px, calc(100% - 24px)); display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.install-banner img { border-radius: 11px; }
.install-banner div { flex: 1; display: grid; }
.install-banner small { color: var(--muted); }
.offline { min-height: 100vh; display: grid; place-content: center; text-align: center; gap: 10px; padding: 24px; }

/* ---------- Animações ---------- */
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes drop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.ring[style*="--p:0;"] .ring-fg, .ring[style="--p:0"] .ring-fg { opacity: 0; }
.item.done .qty { text-decoration: none; opacity: .6; }
.nowrap { white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; }
