/* ---------- Design tokens (Instagram palette) ---------- */
@font-face {
  font-family: "Grand Hotel";
  src: url("/static/fonts/grand-hotel.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #fff;
  --bg-secondary: #fafafa;
  --border: #dbdbdb;
  --border-light: #efefef;
  --text: #262626;
  --text-secondary: #8e8e8e;
  --blue: #0095f6;
  --blue-hover: #1877f2;
  --blue-light: #b2dffc;
  --red: #ff3040;
  --link: #00376b;
  --overlay: rgba(0, 0, 0, 0.65);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --story-gradient: conic-gradient(from 210deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5, #feda75);
  --sidebar-w: 245px;
  --sidebar-rail-w: 72px;
  --topbar-h: 60px;
  --tabbar-h: 48px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 18px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img, svg, video { display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
input, textarea { font: inherit; color: inherit; }

.icon { flex-shrink: 0; }

/* ---------- Wordmark ---------- */
.wordmark {
  font-family: "Grand Hotel", "Brush Script MT", cursive;
  font-weight: 400;
  font-size: 24px;
  line-height: 1;
  color: var(--text);
}
.wordmark--lg { font-size: 44px; margin-bottom: 24px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  border: 0;
  transition: background-color 0.1s ease;
}
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-hover); }
.btn--primary:disabled { background: var(--blue-light); cursor: default; }
.btn--secondary { background: var(--border-light); color: var(--text); }
.btn--secondary:hover { background: var(--border); }
.btn--sm { padding: 5px 12px; font-size: 13px; }
.btn-link { color: var(--blue); font-weight: 600; }
.btn-link:hover { color: var(--link); }

/* ---------- Inputs ---------- */
.input {
  width: 100%;
  padding: 9px 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  outline: none;
}
.input:focus { border-color: #a8a8a8; }

/* ---------- Avatars & story rings ---------- */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-secondary);
  flex-shrink: 0;
}
.avatar-ring {
  --av: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: calc(var(--av) + 10px);
  height: calc(var(--av) + 10px);
  border-radius: 50%;
  background: var(--story-gradient);
  flex-shrink: 0;
}
.avatar-ring > .avatar {
  width: var(--av);
  height: var(--av);
  border: 2px solid var(--bg);
  box-sizing: content-box;
}
.avatar-ring--seen { background: var(--border); }

.nav-item__avatar.is-active { outline: 2px solid var(--text); outline-offset: 1px; }

/* ---------- Badges ---------- */
.nav-item__icon-wrap { position: relative; display: inline-flex; }
.badge-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 8px;
  height: 8px;
  border-radius: 8px;
  background: var(--red);
  border: 2px solid var(--bg);
}
.badge-dot--count {
  min-width: 18px;
  height: 18px;
  top: -6px;
  right: -8px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 14px;
  text-align: center;
  padding: 0 4px;
}

/* ---------- Modal shell ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close {
  position: fixed;
  top: 16px;
  right: 16px;
  color: #fff;
  z-index: 101;
  padding: 8px;
}
.modal-box {
  background: var(--bg);
  border-radius: 12px;
  overflow: hidden;
  max-height: calc(100vh - 80px);
  max-width: calc(100vw - 128px);
}
.modal-box--dialog {
  width: 400px;
  max-width: calc(100vw - 40px);
}
.modal-dialog-title {
  padding: 24px 24px 12px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-light);
}

/* ---------- Misc ---------- */
.text-secondary { color: var(--text-secondary); }
.text-bold { font-weight: 600; }
.text-small { font-size: 12px; line-height: 16px; }
.hidden { display: none !important; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 24px;
  text-align: center;
  color: var(--text);
}
.empty-state .icon { color: var(--text); }
.empty-state h2 { font-size: 22px; font-weight: 700; }
.empty-state p { color: var(--text-secondary); }

.spinner {
  width: 24px;
  height: 24px;
  margin: 16px auto;
  border: 2px solid var(--border);
  border-top-color: var(--text-secondary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

::-webkit-scrollbar { width: 0; height: 0; }
