:root {
  --bg: #f4f3f0; --card: #fff; --card2: #f5f4f1; --hover: #faf9f6; --line: #e8e6e1; --line2: #d9d7d1;
  --text: #16171c; --soft: #42434d; --muted: #6e6f7a; --accent: #e85a0c; --accent-bg: rgba(232, 90, 12, .1); --ok: #10804a;
  --ink: #1d1f27;
  --hero: radial-gradient(90% 120% at 100% 0%, rgba(255, 160, 90, .55) 0%, transparent 60%), linear-gradient(160deg, #f0661a 0%, #e5560b 50%, #cf470a 100%);
  --shadow: 0 1px 2px rgba(20, 20, 30, .04), 0 4px 16px rgba(20, 20, 30, .05);
  --shadow-lg: 0 2px 4px rgba(20, 20, 30, .04), 0 14px 34px rgba(60, 30, 10, .11);
  --display: 'Space Grotesk', Inter, system-ui, sans-serif;
  --tabs: 0px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text); font: 14px/1.45 Inter, system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
/* Faixa atrás do relógio/notch: o status bar é translúcido, então o conteúdo que rola por baixo precisa de fundo. */
body::before { content: ''; position: fixed; z-index: 100; inset: 0 0 auto; height: var(--sat, env(safe-area-inset-top, 0px)); background: var(--accent); }
h1, h2, p { margin-top: 0; }
svg { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.page { display: flex; min-width: 0; min-height: 100dvh; flex-direction: column; }
.wrap { width: 100%; max-width: calc(1080px + 48px); margin: 0 auto; padding-left: max(24px, var(--sal, env(safe-area-inset-left, 0px))); padding-right: max(24px, var(--sar, env(safe-area-inset-right, 0px))); }
main.wrap { flex: 1; }

/* Cabeçalho laranja (vai até atrás do status bar) com a curva embaixo */
.hero { position: relative; overflow: hidden; padding: calc(var(--sat, env(safe-area-inset-top, 0px)) + 18px) 0 64px; background: var(--hero); color: #fff; }
.hero::before, .hero::after { content: ''; position: absolute; border-radius: 50%; pointer-events: none; }
.hero::before { right: -120px; top: -140px; width: 420px; height: 420px; border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 0 0 46px rgba(255, 255, 255, .04), 0 0 0 92px rgba(255, 255, 255, .03); }
.hero::after { left: -80px; bottom: -120px; width: 260px; height: 260px; background: radial-gradient(circle, rgba(255, 255, 255, .12), transparent 70%); }
.hero .wrap { position: relative; z-index: 1; }
.hero .wave { position: absolute; left: 0; right: 0; bottom: -1px; z-index: 1; width: 100%; height: 34px; fill: var(--bg); stroke: none; }
.hero.tall { padding-bottom: 84px; }
.hero.compact { padding-bottom: 104px; }
.topbar { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.mark { display: flex; width: 38px; height: 38px; flex: none; align-items: center; justify-content: center; border-radius: 12px; background: #fff; color: var(--accent); font: 800 21px/1 Inter, system-ui, sans-serif; font-style: normal; letter-spacing: -.06em; box-shadow: 0 6px 16px rgba(120, 40, 0, .22); }
.mark sup { position: relative; top: -6px; margin-left: 1px; font-size: 11px; letter-spacing: 0; }
.brand b { display: block; font-size: 15px; letter-spacing: -.01em; }
.brand small { display: block; color: rgba(255, 255, 255, .8); font-size: 12px; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--accent-bg); color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.hero .avatar { border: 2px solid rgba(255, 255, 255, .55); background: rgba(255, 255, 255, .18); color: #fff; }
.avatar.lg { width: 58px; height: 58px; font-size: 15px; box-shadow: 0 6px 18px rgba(120, 40, 0, .22); }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; cursor: pointer; }
.icon-btn:hover { background: rgba(255, 255, 255, .26); }
.icon-btn svg { width: 18px; height: 18px; }
.greet { margin-top: 30px; }
.greet .eyebrow, .hello .eyebrow { margin: 0 0 4px; color: rgba(255, 255, 255, .82); font-size: 12px; font-weight: 600; }
.hello .eyebrow::first-letter { text-transform: uppercase; }
.greet h1, .hello h1 { margin: 0 0 4px; font: 700 30px/1.1 var(--display); letter-spacing: -.03em; }
.greet p { max-width: 640px; margin: 0; color: rgba(255, 255, 255, .88); }
.back { display: inline-flex; align-items: center; gap: 2px; margin: 0 0 10px -6px; padding: 4px 8px 4px 2px; border-radius: 8px; color: #fff; font-size: 13px; font-weight: 600; text-decoration: none; }
.back:hover { background: rgba(255, 255, 255, .14); }
.back svg { width: 18px; height: 18px; }

/* Início: saudação e busca */
.hello { display: flex; align-items: center; gap: 16px; margin-top: 26px; }
.hello > div { min-width: 0; }
.hello h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hello p:last-child { margin: 0; color: rgba(255, 255, 255, .88); font-size: 13px; }
.search { display: flex; align-items: center; gap: 10px; max-width: 560px; height: 50px; margin-top: 22px; padding: 0 16px; border-radius: 16px; background: #fff; color: var(--muted); box-shadow: 0 10px 30px rgba(110, 35, 0, .22); cursor: text; }
.search svg { width: 20px; height: 20px; flex: none; }
.search input { width: 100%; min-width: 0; height: 100%; border: 0; background: none; color: var(--text); font: inherit; font-size: 16px; outline: none; }
.search input::placeholder { color: #8d8e97; }
.search:focus-within { box-shadow: 0 10px 30px rgba(110, 35, 0, .22), 0 0 0 3px rgba(255, 255, 255, .5); }

/* Seções */
main.wrap > section, .me-wrap { margin-top: 6px; }
main.wrap > section + section { margin-top: 30px; }
/* Próximos compromissos (Calendário) */
.agd-track { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 36px) / 4); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 8px; margin: 0 -2px; scrollbar-width: none; }
.agd-track::-webkit-scrollbar { display: none; }
.agd-card { position: relative; scroll-snap-align: start; display: flex; flex-direction: column; gap: 6px; min-height: 120px; padding: 15px 16px 15px 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: var(--shadow); color: inherit; text-decoration: none; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.agd-card:before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c, var(--accent)); }
.agd-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.agd-when { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; height: 24px; padding: 0 9px; border-radius: 99px; background: color-mix(in srgb, var(--c, var(--accent)) 13%, #fff); color: color-mix(in srgb, var(--c, var(--accent)) 75%, #000); font-size: 12px; font-weight: 700; }
.agd-card b { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font: 700 15px/1.3 var(--display); letter-spacing: -.01em; }
.agd-card small { margin-top: auto; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agd-card.live { border-color: rgba(225, 29, 72, .3); background: linear-gradient(180deg, rgba(225, 29, 72, .05), var(--card) 70%); }
.agd-card.live .agd-when { background: rgba(225, 29, 72, .1); color: #c81e46; }
.agd-card.live .agd-when i { width: 7px; height: 7px; border-radius: 50%; background: #e11d48; animation: agd-p 1.6s infinite; }
@keyframes agd-p { 0%, 100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, .45); } 50% { box-shadow: 0 0 0 5px rgba(225, 29, 72, 0); } }
.agd-all { align-items: flex-start; justify-content: center; background: var(--card2); border-style: dashed; box-shadow: none; }
.agd-all:before { display: none; }
.agd-all .app-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; }
.agd-all small { margin-top: 0; }
.agd-empty { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; row-gap: 2px; align-items: center; min-height: 0; }
.agd-empty .app-icon { grid-row: span 2; }
.agd.searching { display: none; }
@media (max-width: 640px) { .agd-track { grid-auto-columns: 74%; } .agd-empty { grid-column: auto; } }
@media (prefers-reduced-motion: reduce) { .agd-card.live .agd-when i { animation: none; } }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 2px 12px; }
.section-title h2 { margin: 0; font: 700 17px/1.2 var(--display); letter-spacing: -.02em; }
.section-title span { color: var(--muted); font-size: 12px; }
.section-title .link { padding: 4px 2px; }
.searching { display: none; }

/* Atalhos: blocos quadrados, escolhidos por cada um */
.tiles { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; }
.tile { display: flex; min-height: 112px; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 14px 6px 12px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: var(--shadow); color: var(--text); font: 600 12.5px/1.25 Inter, system-ui, sans-serif; text-align: center; text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; }
.tile > span:last-child { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.tile:hover { transform: translateY(-2px); border-color: #f1c3a6; box-shadow: var(--shadow-lg); }
.tile:active { transform: scale(.97); }
.tile.add { border-style: dashed; border-color: var(--line2); background: transparent; box-shadow: none; color: var(--muted); }
.tile.add .tile-icon { background: var(--card); color: var(--muted); }
.tile-icon, .app-icon, .promo-icon { display: grid; place-items: center; flex: none; }
.tile-icon { width: 46px; height: 46px; border-radius: 15px; background: var(--accent-bg); color: var(--accent); }
.tile-icon svg { width: 23px; height: 23px; }
.tile-icon.photo { overflow: hidden; border-radius: 50%; }
.tile-icon.photo img { width: 100%; height: 100%; object-fit: cover; }

/* Destaques: cartões grandes (rolam para o lado no celular) */
.promo-track { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.promo-track > #push-slot:not([hidden]) { display: contents; }
.promo { position: relative; display: flex; overflow: hidden; align-items: center; gap: 14px; width: 100%; min-height: 92px; padding: 18px; border: 0; border-radius: 22px; background: linear-gradient(135deg, #f37124, #d84c08); box-shadow: 0 12px 28px rgba(200, 70, 8, .22); color: #fff; font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.promo::after { content: ''; position: absolute; right: -40px; bottom: -70px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, .1); pointer-events: none; }
.promo.ink { background: linear-gradient(135deg, #2a2d38, #16171c); box-shadow: 0 12px 28px rgba(20, 20, 30, .2); }
.promo.ink::after { background: rgba(232, 90, 12, .28); }
.promo:disabled { cursor: default; }
.promo-icon { width: 48px; height: 48px; border-radius: 16px; background: rgba(255, 255, 255, .18); }
.promo-icon svg { width: 23px; height: 23px; }
.promo-body { position: relative; z-index: 1; min-width: 0; flex: 1; }
.promo-body b { display: block; font: 700 16px/1.25 var(--display); letter-spacing: -.01em; }
.promo-body small { display: block; margin-top: 3px; color: rgba(255, 255, 255, .85); font-size: 12.5px; line-height: 1.4; }
.promo-go { position: relative; z-index: 1; display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: #fff; color: var(--accent); }
.promo.ink .promo-go { background: var(--accent); color: #fff; }
.promo-go svg { width: 18px; height: 18px; }

/* Sistemas: cartões no computador, blocos no celular */
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
.app { position: relative; display: flex; min-height: 148px; flex-direction: column; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 22px; background: var(--card); box-shadow: var(--shadow); color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s; }
.app:hover { transform: translateY(-2px); border-color: #f1c3a6; box-shadow: var(--shadow-lg); }
.app:active { transform: scale(.98); }
.app-icon { width: 48px; height: 48px; border-radius: 16px; background: var(--accent-bg); color: var(--accent); transition: background .15s, color .15s; }
.app-icon svg { width: 24px; height: 24px; }
.app:hover .app-icon { background: var(--accent); color: #fff; }
.app-body { min-width: 0; }
.app-body b { display: block; font-size: 15px; letter-spacing: -.01em; }
.app-body small { display: block; margin-top: 4px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.app-go { position: absolute; top: 18px; right: 18px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--card2); color: #a9a8a2; transition: background .15s, color .15s, transform .15s; }
.app-go svg { width: 17px; height: 17px; }
.app:hover .app-go { background: var(--accent-bg); color: var(--accent); transform: translateX(2px); }
.empty { margin: 8px 0 0; padding: 28px 16px; border: 1px dashed var(--line2); border-radius: 18px; color: var(--muted); text-align: center; }

/* Moldura: barra lateral (computador) e abas embaixo (celular) */
.side { display: none; }
.tabbar { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; padding: 6px max(8px, var(--sal, env(safe-area-inset-left, 0px))) calc(6px + var(--sab, env(safe-area-inset-bottom, 0px))); border-top: 1px solid rgba(0, 0, 0, .06); background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 2px 0; color: var(--muted); font-size: 11px; font-weight: 600; text-decoration: none; }
.tabbar a svg { box-sizing: content-box; width: 22px; height: 22px; padding: 4px 18px; border-radius: 99px; transition: background .15s; }
.tabbar a.on { color: var(--accent); }
.tabbar a.on svg { background: var(--accent-bg); }
body.has-tabs { --tabs: 68px; }
body.has-tabs .install-prompt { bottom: calc(14px + var(--tabs) + var(--sab, env(safe-area-inset-bottom, 0px))); }
.panel h2 + .push-row { margin-top: -2px; }
.push-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--card2); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.push-row:disabled { cursor: default; }
.push-row .app-icon { width: 42px; height: 42px; border-radius: 14px; }
.push-row .app-icon svg { width: 21px; height: 21px; }
.push-row .app-body { flex: 1; }
.push-row .app-body b { font-size: 14px; }
.chev { display: grid; flex: none; color: #b4b3ad; }
.chev svg { width: 18px; height: 18px; }

/* Personalizar atalhos */
.fav-hint { margin: 8px 0 14px !important; }
.fav-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.fav-opt { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 12px 9px 9px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); font-size: 13px; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s; }
.fav-opt .tile-icon { width: 38px; height: 38px; border-radius: 12px; }
.fav-opt .tile-icon svg { width: 20px; height: 20px; }
.fav-opt > span:nth-child(2) { min-width: 0; flex: 1; line-height: 1.25; }
.fav-opt input { position: absolute; opacity: 0; pointer-events: none; }
.fav-opt .check { position: relative; width: 22px; height: 22px; flex: none; border: 2px solid var(--line2); border-radius: 50%; transition: .15s; }
.fav-opt:has(input:checked) { border-color: var(--accent); background: rgba(232, 90, 12, .05); }
.fav-opt input:checked + .check { border-color: var(--accent); background: var(--accent); }
.fav-opt input:checked + .check::after { content: ''; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.fav-opt input:focus-visible + .check { outline: 2px solid var(--accent); outline-offset: 2px; }
.fav-opt.off { opacity: .45; cursor: not-allowed; }

/* Acessos */
.access-list { overflow: hidden; margin-top: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.access-row { display: grid; grid-template-columns: 36px minmax(150px, 210px) minmax(0, 1fr); align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.access-row[hidden] { display: none; }
.access-tools { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-top: 24px; }
.access-tools input[type=search] { flex: 1; min-width: 200px; height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line2); background: var(--card); color: var(--text); font: inherit; font-size: 14px; outline: none; }
.access-tools input[type=search]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.access-empty { color: var(--muted); text-align: center; padding: 24px; }
.who2 { min-width: 0; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pills .lbl { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 2px; }
.pills .sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.pill { height: 28px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line2); background: var(--card2); color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s, border-color .15s; display: inline-flex; align-items: center; }
.pill:hover { color: var(--text); }
.pill.on { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); }
.pill.gen.on, .pill.fixed { border-color: transparent; background: var(--accent); color: #fff; }
.pill.fixed { cursor: default; }
.pill:disabled { opacity: .5; cursor: progress; }
.muted-note { font-size: 12px; color: var(--muted); }
/* Pessoas: cadastro em folha */
.access-row[data-off] > .avatar, .access-row[data-off] .who2 b { opacity: .55; }
.new-person { height: 42px; padding: 0 16px; margin-left: auto; }
body.sheet-open { overflow: hidden; }
.sheet-wrap { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(15, 15, 20, .45); }
.sheet { width: min(100%, 560px); max-height: calc(100dvh - 48px); overflow: auto; padding: 20px; border-radius: 20px; background: var(--card); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); overscroll-behavior: contain; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sheet-head .eyebrow { margin: 0 0 2px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.sheet-head h2 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.icon-close { width: 36px; height: 36px; flex: none; border: 0; border-radius: 50%; background: var(--card2); color: var(--soft); font-size: 22px; line-height: 1; cursor: pointer; }
.person-form { display: grid; gap: 13px; }
.person-form label { display: grid; gap: 6px; color: var(--soft); font-size: 12px; font-weight: 600; }
.person-form label small, .pf-hint { color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.4; }
.person-form input:not([type=checkbox]), .person-form select { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 12px; background: var(--card); color: var(--text); font: inherit; font-size: 15px; outline: none; }
.person-form input:focus, .person-form select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.person-form input[readonly] { background: var(--card2); color: var(--muted); }
.person-form input[name=trigram] { text-transform: uppercase; font-weight: 700; letter-spacing: .06em; }
.pf-grid { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; }
.pf-grid:has(select) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.pf-hint { margin: -6px 0 0; }
.person-form label.pf-check { display: flex; align-items: flex-start; gap: 9px; color: var(--text); font-size: 13px; font-weight: 500; }
.pf-check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.sheet-actions .btn.secondary { width: auto; }
.pf-pw { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.pf-pw h3 { margin: 0; font-size: 14px; }
.pf-pw .pf-hint { margin: 0; }
.pf-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.pf-row .btn { width: auto; height: 44px; padding: 0 16px; }
.pf-foot { margin: 14px 0 0; color: var(--muted); font-size: 12px; }
.mail-edit { display: block; max-width: 100%; margin-top: 3px; padding: 0; border: 0; background: none; color: var(--accent); font: 500 12px Inter, system-ui, sans-serif; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.mail-edit:hover { text-decoration: underline; }
.mail-edit.none { color: var(--muted); }
.mail-edit.warn { color: #b26a00; font-weight: 600; }
.mail-edit:disabled { color: var(--muted); cursor: default; text-decoration: none; }
.access-row:last-child { border-bottom: 0; }
.access-row .avatar { border: 1px solid var(--line2); background: var(--card2); }
.access-row b { display: block; font-size: 13px; }
.access-row small { display: block; color: var(--muted); font-size: 12px; }
.access-auto, .access-fixed { color: var(--muted); font-size: 12px; }
.access-fixed { color: var(--ok); font-weight: 600; }
.seg { display: inline-flex; gap: 4px; margin-top: 24px; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
.seg button { display: inline-flex; gap: 7px; align-items: center; height: 36px; padding: 0 14px; border: 0; border-radius: 10px; background: none; color: var(--muted); font: 600 13px Inter, system-ui, sans-serif; cursor: pointer; }
.seg button span { min-width: 20px; padding: 1px 6px; border-radius: 99px; background: var(--card2); font-size: 11px; text-align: center; }
.seg button.on { background: var(--accent); color: #fff; }
.seg button.on span { background: rgba(255, 255, 255, .22); }
.ext-form { margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.ext-form h2 { margin: 0 0 12px; font-size: 15px; letter-spacing: -.01em; }
.ext-form .form-error { margin-bottom: 12px; }
.ext-fields { display: grid; grid-template-columns: 110px minmax(0, 1fr) 170px auto; gap: 10px; align-items: end; }
.ext-fields label { display: grid; gap: 6px; color: var(--soft); font-size: 12px; font-weight: 600; }
.ext-fields input, .ext-fields select { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 12px; background: var(--card); color: var(--text); font: inherit; font-size: 15px; outline: none; }
.ext-fields input[name=trigram] { text-transform: uppercase; }
.ext-fields input:focus, .ext-fields select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.ext-fields .btn { height: 42px; padding: 0 18px; }
.pill.danger:hover { border-color: #c8233a; color: #c8233a; }
.warn-note { color: #b26a00; font-weight: 600; }
.switch { display: flex; align-items: center; gap: 7px; cursor: pointer; font-size: 12px; font-weight: 600; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: relative; width: 36px; height: 21px; border-radius: 99px; background: #c8c7c2; transition: .15s; }
.switch span:after { content: ''; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px #0003; transition: .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span:after { transform: translateX(15px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + span { opacity: .55; }

/* Foto de perfil */
.avatar.photo { overflow: hidden; padding: 0; }
.avatar.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar-link { display: block; border-radius: 50%; color: inherit; text-decoration: none; }
.avatar-link:hover .avatar { border-color: #fff; }
.avatar-link:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.avatar.xl { width: 104px; height: 104px; border: 0; background: var(--accent-bg); color: var(--accent); font-size: 26px; }

/* Meu perfil */
.me-wrap { display: grid; gap: 16px; align-content: start; }
.panel { position: relative; z-index: 2; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.panel h2 { margin: 0 0 14px; font-size: 15px; letter-spacing: -.01em; }
.me-card { display: flex; align-items: center; gap: 22px; margin-top: -44px; box-shadow: 0 10px 30px rgba(60, 30, 10, .1); }
.me-photo { position: relative; flex: none; }
.me-cam { position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center; width: 36px; height: 36px; border: 3px solid var(--card); border-radius: 50%; background: var(--accent); color: #fff; cursor: pointer; }
.me-cam svg { width: 17px; height: 17px; }
.me-id { min-width: 0; flex: 1; }
.me-id h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.me-id > p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.me-id .me-note { margin-top: 8px; color: var(--soft); font-size: 12px; }
.me-id .form-error { margin-top: 10px; }
.me-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn.small { height: 38px; gap: 7px; padding: 0 14px; background: var(--card); color: var(--soft); font-size: 13px; }
.btn.small.primary { background: var(--accent); color: #fff; }
.btn.small svg { width: 16px; height: 16px; }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: #c8233a; }
.busy { opacity: .55; pointer-events: none; }
.me-cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.panel form, form.panel { display: grid; gap: 13px; }
form.panel h2 { margin: 0; }
.panel label:not(.btn) { display: grid; gap: 6px; color: var(--soft); font-size: 12px; font-weight: 600; }
.panel label small { color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.4; }
.panel input:not([type=file]) { width: 100%; height: 44px; padding: 0 13px; border: 1px solid var(--line2); border-radius: 12px; background: var(--card); color: var(--text); font: inherit; font-size: 15px; outline: none; }
.panel input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.panel input[readonly] { background: var(--card2); color: var(--muted); }
.panel .btn.primary { margin-top: 2px; }
.me-foot { margin: 0; color: var(--muted); font-size: 12px; }
.me-logout { gap: 8px; }
.me-logout svg { width: 17px; height: 17px; }
.toast { position: fixed; z-index: 1000; left: 50%; bottom: calc(24px + var(--sab, env(safe-area-inset-bottom, 0px))); transform: translateX(-50%); padding: 11px 18px; border-radius: 12px; background: #16171c; color: #fff; font-size: 13px; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }

footer { padding: 36px 24px calc(24px + var(--tabs) + var(--sab, env(safe-area-inset-bottom, 0px))); color: var(--muted); text-align: center; font-size: 11px; }
.toast { bottom: calc(24px + var(--tabs) + var(--sab, env(safe-area-inset-bottom, 0px))); }

/* Login e recuperação */
.auth main.wrap { display: flex; align-items: flex-start; justify-content: center; }
.auth-card { width: min(100%, 420px); margin-top: -64px; padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: 0 10px 30px rgba(60, 30, 10, .1); position: relative; z-index: 2; }
.auth-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 18px; border-radius: 12px; background: var(--accent-bg); color: var(--accent); }
.auth-icon.ok { color: var(--ok); background: #eaf7ef; }
.auth-icon svg { width: 21px; height: 21px; }
.auth-card h1 { margin-bottom: 4px; font-size: 22px; letter-spacing: -.025em; }
.auth-card > p { margin-bottom: 20px; color: var(--muted); font-size: 13px; }
.auth-card form { display: grid; gap: 13px; }
.auth-card label { display: grid; gap: 6px; color: var(--soft); font-size: 12px; font-weight: 600; }
.auth-card input { width: 100%; height: 46px; padding: 0 13px; border: 1px solid var(--line2); border-radius: 12px; background: var(--card); font: inherit; font-size: 16px; outline: none; }
.auth-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.form-error { padding: 10px 11px; border-radius: 10px; background: #fff0f1; color: #c8233a; font-size: 12px; }
.btn { display: inline-flex; height: 46px; align-items: center; justify-content: center; border: 1px solid var(--line2); border-radius: 12px; font: 600 14px Inter, system-ui, sans-serif; text-decoration: none; cursor: pointer; }
.btn.primary { border: 0; background: var(--accent); color: #fff; }
.btn.primary:active { background: #d74f08; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.secondary { width: 100%; background: var(--card); color: var(--soft); }
.link { padding: 6px; border: 0; background: none; color: var(--accent); font: 600 13px Inter, system-ui, sans-serif; cursor: pointer; }

.error { display: grid; min-height: 100dvh; padding: 24px; place-content: center; color: var(--muted); text-align: center; }
.error b { display: block; margin-bottom: 10px; color: var(--text); }
.error button { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }

/* Computador: barra lateral fixa, sem abas */
@media (min-width: 1024px) {
  .shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); }
  .side { position: sticky; top: 0; display: flex; height: 100dvh; flex-direction: column; gap: 26px; padding: 22px 14px 16px; border-right: 1px solid var(--line); background: var(--card); }
  .side .brand { padding: 0 8px; color: var(--text); }
  .side .mark { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(232, 90, 12, .28); }
  .side .brand small { color: var(--muted); }
  .side nav { display: grid; gap: 4px; }
  .side nav a { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: 12px; color: var(--soft); font-weight: 600; text-decoration: none; transition: background .15s, color .15s; }
  .side nav a svg { width: 20px; height: 20px; }
  .side nav a:hover { background: var(--hover); color: var(--text); }
  .side nav a.on { background: var(--accent-bg); color: var(--accent); }
  .side-me { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--card2); }
  .side-me > span:nth-child(2) { min-width: 0; flex: 1; }
  .side-me b { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
  .side-me small { display: block; color: var(--muted); font-size: 11.5px; }
  .side-out { display: grid; place-items: center; width: 34px; height: 34px; flex: none; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
  .side-out:hover { background: #fff0f1; color: #c8233a; }
  .side-out svg { width: 18px; height: 18px; }
  .tabbar { display: none; }
  body.has-tabs { --tabs: 0px; }
  .shell .topbar, .shell .back, .only-mobile { display: none; }
  .shell .hero { padding-top: 40px; }
  .shell .hero .wrap, .shell main.wrap { max-width: calc(1120px + 48px); padding-left: 40px; padding-right: 40px; }
  .shell .greet, .shell .hello { margin-top: 0; }
  .hello h1 { font-size: 34px; }
  .avatar.lg { width: 66px; height: 66px; font-size: 17px; }
}
@media (max-width: 900px) {
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .access-row { grid-template-columns: 36px minmax(0, 1fr); align-items: start; }
  .access-row .pills { grid-column: 1 / -1; }
  .pills .sep { display: none; }
  .pills .lbl { flex-basis: 100%; margin-top: 4px; }
  .ext-fields { grid-template-columns: 90px minmax(0, 1fr); }
  .ext-fields .ext-role, .ext-fields .btn { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .wrap { padding-left: max(16px, var(--sal, env(safe-area-inset-left, 0px))); padding-right: max(16px, var(--sar, env(safe-area-inset-right, 0px))); }
  .hero { padding-top: calc(var(--sat, env(safe-area-inset-top, 0px)) + 10px); padding-bottom: 54px; }
  .hero .wave { height: 22px; }
  .hero.tall { padding-bottom: 76px; }
  .greet { margin-top: 22px; }
  .greet h1 { font-size: 27px; }
  .hello { gap: 14px; margin-top: 20px; }
  .hello h1 { font-size: 25px; }
  .search { height: 48px; margin-top: 18px; border-radius: 15px; }
  .section-title h2 { font-size: 16px; }
  /* Atalhos: 4 por linha */
  .tiles { gap: 8px; }
  .tile { min-height: 96px; gap: 8px; padding: 12px 4px 10px; border-radius: 18px; font-size: 11.5px; }
  .tile-icon { width: 42px; height: 42px; border-radius: 14px; }
  .tile-icon svg { width: 21px; height: 21px; }
  /* Destaques rolam para o lado */
  .promos { margin-left: -16px; margin-right: -16px; }
  .promo-track { display: flex; overflow-x: auto; gap: 10px; padding: 2px 16px 14px; scroll-snap-type: x mandatory; scroll-padding: 0 16px; scrollbar-width: none; }
  .promo-track::-webkit-scrollbar { display: none; }
  .promo { flex: 0 0 min(86%, 340px); scroll-snap-align: start; padding: 16px; }
  .promo-track > .promo:has(~ #push-slot[hidden]), .promo-track > #push-slot:first-child > .promo { flex-basis: 100%; }
  main.wrap > section.promos + section { margin-top: 16px; }
  /* Sistemas: 3 blocos por linha, só ícone e nome */
  .apps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .app { min-height: 108px; align-items: center; justify-content: center; gap: 9px; padding: 14px 6px 12px; border-radius: 18px; text-align: center; }
  .app-icon { width: 46px; height: 46px; border-radius: 15px; }
  .app-icon svg { width: 23px; height: 23px; }
  .app-body b { display: -webkit-box; overflow: hidden; font-size: 12px; font-weight: 600; line-height: 1.25; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .app-body small, .app-go { display: none; }
  .app:hover { transform: none; box-shadow: var(--shadow); border-color: var(--line); }
  .app:hover .app-icon { background: var(--accent-bg); color: var(--accent); }
  .fav-list { grid-template-columns: 1fr; }
  .access-list { margin-top: 18px; }
  .access-row { padding: 12px; gap: 10px; }
  .access-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .auth-card { padding: 22px; }
  .new-person { width: 100%; margin-left: 0; }
  .sheet-wrap { place-items: end stretch; padding: 0; }
  .sheet { width: 100%; max-height: calc(100dvh - var(--sat, env(safe-area-inset-top, 0px)) - 24px); padding: 18px 16px calc(18px + var(--sab, env(safe-area-inset-bottom, 0px))); border-radius: 22px 22px 0 0; }
  .person-form input:not([type=checkbox]), .person-form select { font-size: 16px; }
  .me-card { flex-direction: column; text-align: center; gap: 14px; padding: 22px 16px; }
  .me-actions { justify-content: center; }
  .me-cols { grid-template-columns: 1fr; }
  .panel { padding: 18px 16px; }
  .panel input:not([type=file]) { font-size: 16px; } /* iOS não dá zoom */
}
@media (max-width: 360px) {
  .apps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Salvar sempre à vista na lista de atalhos */
.fav-list { margin-bottom: 0; }
.fav-actions { position: sticky; bottom: -20px; margin: 0 -20px -20px; padding: 14px 20px calc(20px + var(--sab, env(safe-area-inset-bottom, 0px))); border-top: 1px solid var(--line); background: var(--card); }
@media (max-width: 640px) { .fav-actions { bottom: calc(-18px - var(--sab, env(safe-area-inset-bottom, 0px))); margin: 0 -16px calc(-18px - var(--sab, env(safe-area-inset-bottom, 0px))); padding: 12px 16px calc(18px + var(--sab, env(safe-area-inset-bottom, 0px))); } }
/* Seletor de unidade do ADM do sistema (Acessos, multiunidade) */
.unit-pick { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; font-weight: 600; }
.unit-pick select { height: 36px; border-radius: 10px; padding: 0 10px; font: inherit; }
