:root {
  /* Fallback if tokens.css not loaded; prefer fn-tokens.css */
  --fn-bg: #050608;
  --fn-bg-elevated: #0b0d10;
  --fn-bg-card: #12151a;
  --fn-border: #252930;
  --fn-text: #ffffff;
  --fn-text-muted: #a7abb2;
  --fn-accent: #ff8a00;
  --fn-accent-soft: rgba(255, 138, 0, 0.16);
  --fn-radius: 14px;
  --fn-radius-sm: 10px;
  --fn-header-h: 64px;
  --fn-bottom-nav-h: 64px;
  --fn-safe-bottom: env(safe-area-inset-bottom, 0px);
  --fn-font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.fn-body {
  margin: 0;
  min-height: 100dvh;
  background: var(--fn-bg);
  color: var(--fn-text);
  font-family: var(--fn-font);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.fn-app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.fn-main {
  flex: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding-bottom: calc(var(--fn-bottom-nav-h) + var(--fn-safe-bottom) + 24px);
}

@media (min-width: 960px) {
  .fn-main {
    padding-bottom: 48px;
  }
}

.fn-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(13, 13, 13, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--fn-border);
}

.fn-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  min-height: var(--fn-header-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.fn-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.fn-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.fn-brand-logo {
  height: 28px;
  width: auto;
  display: block;
}

.fn-city-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  max-width: 180px;
  padding: 0 12px 0 10px;
  border: 1px solid var(--fn-border);
  border-radius: var(--fn-radius-control, 6px);
  background: var(--fn-bg-elevated);
  color: var(--fn-text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: background 160ms ease, border-color 160ms ease;
}

.fn-city-btn:hover {
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(139, 92, 246, 0.08);
}

.fn-city-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  font-size: 1.15rem;
  line-height: 1;
}

.fn-city-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fn-city-chevron .fn-icon {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.fn-header-nav {
  display: none;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.fn-header-link {
  color: var(--fn-text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--fn-radius-control, 6px);
}

.fn-header-link:hover,
.fn-header-link.is-active {
  color: var(--fn-text);
  background: rgba(255, 255, 255, 0.06);
}

.fn-header-link.is-active {
  color: var(--fn-accent);
}

.fn-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.fn-icon-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--fn-radius-control, 6px);
  border: 1px solid var(--fn-border);
  color: var(--fn-text);
  text-decoration: none;
  background: transparent;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.fn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--fn-radius-control, 6px);
  border: 1px solid transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.fn-btn-create {
  background: transparent;
  border-color: var(--fn-accent);
  color: var(--fn-accent);
}

.fn-btn-create:hover {
  background: var(--fn-accent-soft);
}

.fn-btn-signin {
  background: var(--fn-accent);
  border-color: var(--fn-accent);
  color: #fff;
  border-radius: var(--fn-radius-control, 6px);
  min-height: 40px;
  padding: 0 16px;
  font-weight: 600;
}

.fn-btn-signin:hover {
  background: var(--fn-accent-hot, #7c3aed);
  border-color: var(--fn-accent-hot, #7c3aed);
  color: #fff;
}

.fn-btn-primary {
  background: var(--fn-accent);
  color: #111;
}

.fn-btn-primary:hover {
  filter: brightness(1.05);
}

.fn-btn-ghost {
  background: transparent;
  border-color: var(--fn-border);
  color: var(--fn-text);
}

.fn-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--fn-radius-round, 999px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ff8a3d, #ff6b00);
  color: #111;
  font-weight: 800;
  text-decoration: none;
  flex-shrink: 0;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.fn-avatar-guest {
  background: var(--fn-bg-elevated);
  border: 1px solid var(--fn-border);
  color: var(--fn-text);
}

.fn-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  min-height: calc(var(--fn-bottom-nav-h) + var(--fn-safe-bottom));
  padding: 6px 8px calc(6px + var(--fn-safe-bottom));
  background: rgba(7, 7, 10, 0.94);
  border-top: 1px solid var(--fn-border);
  backdrop-filter: blur(16px);
  overflow: visible;
  pointer-events: auto;
}

.fn-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 48px;
  min-width: 0;
  padding: 4px 2px;
  color: var(--fn-text-muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0.01em;
  border-radius: var(--fn-radius-sm);
}

@media (min-width: 380px) {
  .fn-bottom-nav-item {
    font-size: 12px;
  }
}

.fn-bottom-nav-item.is-active {
  color: var(--fn-text);
}

.fn-bottom-nav-item.is-active .fn-bottom-nav-icon {
  color: var(--fn-accent);
}

.fn-bottom-nav-icon .fn-icon {
  width: 22px;
  height: 22px;
}

.fn-footer {
  display: none;
}

@media (min-width: 960px) {
  .fn-header-nav {
    display: flex;
  }

  .fn-header-right {
    margin-left: 0;
  }

  .fn-city-btn {
    max-width: 220px;
  }

  .fn-bottom-nav {
    display: none;
  }

  .fn-footer {
    display: block;
    border-top: 1px solid var(--fn-border);
    padding: 28px 16px 40px;
    text-align: center;
  }

  .fn-footer-tagline {
    margin: 0;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 12px;
    color: var(--fn-text-muted);
    font-weight: 600;
  }
}

@media (max-width: 959px) {
  .fn-header-desktop-only {
    display: none !important;
  }

  .fn-header-inner {
    padding: 0 12px;
    gap: 10px;
    min-height: 56px;
  }

  .fn-brand-logo {
    height: 24px;
  }

  .fn-city-btn {
    max-width: min(42vw, 140px);
    min-height: 40px;
    padding: 0 8px;
    font-size: 12px;
  }

  .fn-bottom-nav {
    padding: 4px 4px calc(4px + var(--fn-safe-bottom));
    min-height: calc(var(--fn-bottom-nav-h) + var(--fn-safe-bottom));
  }

  .fn-bottom-nav-item {
    min-height: 48px;
  }

  .fn-bottom-nav-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 1px;
    line-height: 1.15;
  }
}

@media (max-width: 719px) {
  .fn-btn-create-label {
    display: none;
  }

  .fn-btn-create::before {
    content: "＋";
  }
}

.fn-header-notify,
.fn-header-chats {
  position: relative;
}

.fn-header-chats.is-active,
.fn-header-notify.is-active {
  color: var(--fn-accent);
  border-color: var(--fn-accent);
}

.fn-notify-badge,
.fn-bottom-nav-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--fn-radius-round, 999px);
  background: var(--fn-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.fn-bottom-nav-item {
  position: relative;
}

.fn-bottom-nav-badge {
  top: 4px;
  right: calc(50% - 16px);
}

.fn-skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 2000;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--fn-orange, #ff8a00);
  color: #0a0a0a;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
}

.fn-skip-link:focus,
.fn-skip-link:focus-visible {
  transform: none;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Content text (addresses, descriptions, hours) stays selectable/copyable inside chrome. */
.fn-main p,
.fn-main address,
.fn-main dd,
.fn-main dt,
.fn-main li,
.fn-main h1,
.fn-main h2,
.fn-main h3,
.fn-main time,
.fn-main td,
.fn-main th {
  -webkit-user-select: text;
  user-select: text;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
