/* Mise en page : coquille, barre du haut, barre d’onglets, menu, feuilles, toasts */
/* ===== Mise en page ===== */
.shell { max-width: 700px; margin: 0 auto; min-height: 100dvh; padding-bottom: calc(var(--tabbar) + var(--safe-b) + 24px); }
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px;
  padding: calc(var(--safe-t) + 10px) 14px 10px; background: var(--bar); color: var(--bar-text);
}
.topbar .title { flex: 1; font-family: var(--display); font-weight: 700; font-size: 1.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar img.mark { width: 40px; height: 40px; border-radius: var(--r-sm); }
.topbar .icon-btn { color: var(--bar-text); }
.topbar .icon-btn:active { background: rgba(255,255,255,.12); }
main { padding: 20px 16px; overflow-x: hidden; }
.section { margin: 30px 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.section h2 { font-size: 1.25rem; }
.section > .small { background: var(--subtle); color: var(--title); font-family: var(--display); font-weight: 700; border-radius: var(--r-pill); padding: 2px 12px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center;
  background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px var(--safe-b);
}
.tabbar nav { display: flex; width: 100%; max-width: 700px; gap: 4px; }
.tabbar a {
  flex: 1; height: calc(var(--tabbar) - 12px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font-family: var(--display); font-size: .8rem; font-weight: 600; border-radius: var(--r-md);
}
.tabbar a svg { width: 26px; height: 26px; flex: none; }
.tabbar a span { white-space: nowrap; font-size: .76rem; letter-spacing: -.01em; }
.tabbar a.on { color: var(--action); background: var(--secret-bg); font-weight: 700; }

/* ===== Menu latéral, feuilles, toasts ===== */
.scrim { position: fixed; inset: 0; background: rgba(7,31,67,.5); z-index: 40; animation: fade .15s; }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; width: min(320px, 86vw); z-index: 41; background: var(--surface); padding: calc(var(--safe-t) + 16px) 12px 16px; display: flex; flex-direction: column; gap: 2px; animation: slide .18s ease-out; overflow-y: auto; box-shadow: var(--shadow-lg); }
.drawer a, .drawer button.link { display: flex; align-items: center; gap: 14px; padding: 13px 12px; border-radius: var(--r-md); color: var(--text); text-decoration: none; background: none; border: 0; cursor: pointer; text-align: left; width: 100%; font-family: var(--body); font-weight: 600; font-size: 1rem; }
.drawer a:hover, .drawer button.link:hover { background: var(--subtle); }
.drawer svg { width: 24px; height: 24px; color: var(--action); }
.drawer .me { display: flex; gap: 12px; align-items: center; padding: 8px 12px 18px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.drawer .me b { font-family: var(--display); font-weight: 700; font-size: 1.1rem; color: var(--title); }
.drawer .by-naroum { padding: 14px 12px 4px; border-top: 1px solid var(--line); margin-top: 8px; justify-content: flex-start; }
.drawer .by-naroum:hover { background: none; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 90dvh; overflow-y: auto; background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 24px 18px calc(20px + var(--safe-b)); animation: up .2s ease-out; max-width: 700px; margin: 0 auto; box-shadow: var(--shadow-lg); }
.sheet h2 { margin-bottom: 12px; font-size: 1.35rem; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(-100%); } }
@keyframes up { from { transform: translateY(100%); } }
#toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar) + var(--safe-b) + 14px); z-index: 60; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { background: #161e2b; color: #fff; padding: 13px 18px; border-radius: var(--r-md); font-weight: 600; box-shadow: var(--shadow-lg); animation: up .2s ease-out; max-width: 520px; text-align: center; }
.toast.err { background: #c2452a; }
